@remit/web-client-dist 0.0.685 → 0.0.686

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 (186) hide show
  1. package/assets/{BriefPane-BfKwBxLe.js → BriefPane-DbPnsOco.js} +1 -1
  2. package/assets/{CalendarEventEditor-Bsugk6rT.js → CalendarEventEditor-CGrl9NkK.js} +1 -1
  3. package/assets/{CalendarEventPopup-C-BVvxfV.js → CalendarEventPopup-DSoQ-1wk.js} +1 -1
  4. package/assets/{CalendarLoadFailed-DcrF_lyr.js → CalendarLoadFailed-ClpqypbH.js} +1 -1
  5. package/assets/{CalendarQuickCreate-_ki0X3rq.js → CalendarQuickCreate-CaYUiVR8.js} +1 -1
  6. package/assets/{CalendarSession-CK-EC1yK.js → CalendarSession-Ql7K56YK.js} +1 -1
  7. package/assets/{DesktopChrome-BfOVbUXt.js → DesktopChrome-e0x9SkC0.js} +1 -1
  8. package/assets/{DropdownMenu-B4qvRStt.js → DropdownMenu-DusMkzz6.js} +1 -1
  9. package/assets/{EmptyState-BYR2eIr2.js → EmptyState-BjhPv2hS.js} +1 -1
  10. package/assets/{ErrorState-BXxvOnci.js → ErrorState-nIG-x-Zh.js} +1 -1
  11. package/assets/FlaggedPane-CcaZOeS-.js +1 -0
  12. package/assets/{FullCompose-DEhDpjci.js → FullCompose-D5JLo7Rb.js} +1 -1
  13. package/assets/{LabelApplyTrigger-C4ode0Y9.js → LabelApplyTrigger-CUfdoyOX.js} +1 -1
  14. package/assets/{MailShell-DvQDMygz.js → MailShell-DIZSKkXP.js} +1 -1
  15. package/assets/{MailViewChrome-D66Dcy3c.js → MailViewChrome-B22GO2ZU.js} +1 -1
  16. package/assets/MailboxPane-ikbl6KSS.js +135 -0
  17. package/assets/{MessageBody-CDTfM1lc.js → MessageBody-DbkrLz4x.js} +1 -1
  18. package/assets/{MessageToolbar-BW852rJj.js → MessageToolbar-D-FLeer4.js} +1 -1
  19. package/assets/{NavMenuButton-BZWw6TBA.js → NavMenuButton-C78wt6tT.js} +1 -1
  20. package/assets/{OnboardingWizard-Bppp1CPR.js → OnboardingWizard-B7BpPMJF.js} +1 -1
  21. package/assets/{OutboxPane-B_ihIEGn.js → OutboxPane-Ch6JqV2D.js} +1 -1
  22. package/assets/{ReportLink-CwxUgr_7.js → ReportLink-BTuMtEGU.js} +1 -1
  23. package/assets/_calendarObjectId-CNeye1nX.js +1 -0
  24. package/assets/_mailboxId-CINQfps_.js +1 -0
  25. package/assets/_messageId-D0UOksYx.js +1 -0
  26. package/assets/_messageId-OM56_7mN.js +1 -0
  27. package/assets/_messageId-VtS9XL2y.js +1 -0
  28. package/assets/_outboxMessageId-B0eJRNrJ.js +1 -0
  29. package/assets/_recurrenceId-CwEJEhKM.js +1 -0
  30. package/assets/{_slotId-D9HVYRDd.js → _slotId-CukLHO14.js} +1 -1
  31. package/assets/_threadId-BvpkdG2H.js +1 -0
  32. package/assets/_threadId-CEIXKQzn.js +1 -0
  33. package/assets/_threadId-H3F-Cx53.js +1 -0
  34. package/assets/{_view._date-DCmCYHjG.js → _view._date-BhRGXGQG.js} +1 -1
  35. package/assets/{account-service-status-D-hGpg9e.js → account-service-status-2nmShluv.js} +1 -1
  36. package/assets/{accounts-BcJ04H8d.js → accounts-B_pt4l15.js} +1 -1
  37. package/assets/{advanced-DnA-3VCS.js → advanced-DzS_Bhbq.js} +1 -1
  38. package/assets/{agenda-time-O7rJVIvd.js → agenda-time-Bt4BEp3g.js} +1 -1
  39. package/assets/{app-chrome-DvUymvcE.js → app-chrome-CbZgCDW_.js} +1 -1
  40. package/assets/{appearance-CypE55tV.js → appearance-D6Q4ETnm.js} +1 -1
  41. package/assets/{avatar-BgqBWztU.js → avatar-CQq2GZz9.js} +1 -1
  42. package/assets/{badge-CfQoDkmE.js → badge-BVw5vgFN.js} +1 -1
  43. package/assets/{bottom-sheet-Dhk1Aqz2.js → bottom-sheet-C81CIc2R.js} +1 -1
  44. package/assets/{brief-DgC2R0u5.js → brief-CGFThfPb.js} +1 -1
  45. package/assets/brief-CGmiPbD7.js +1 -0
  46. package/assets/{calendar-Ix1rbLDg.js → calendar-Ddji3ram.js} +1 -1
  47. package/assets/{calendar-BJu4Vl-g.js → calendar-SMIdRsx9.js} +1 -1
  48. package/assets/{calendar-event-popup-B4-Dpgb6.js → calendar-event-popup-DqvJLPWt.js} +1 -1
  49. package/assets/{calendar-event-sidebar-DZum-8WN.js → calendar-event-sidebar-CGPuc517.js} +1 -1
  50. package/assets/{calendar-failure-note-DK-uzvky.js → calendar-failure-note-4qETx8lD.js} +1 -1
  51. package/assets/{calendar-guests-Diti9JO5.js → calendar-guests-Dt2cjTqc.js} +1 -1
  52. package/assets/{calendar-suggestion-C8kx9fKn.js → calendar-suggestion-BZ4IIHBe.js} +1 -1
  53. package/assets/{calendars-ne1Oj2RW.js → calendars-U4lDveGO.js} +1 -1
  54. package/assets/{card-B-YLocTg.js → card-kzE1rw9u.js} +1 -1
  55. package/assets/{checkbox-DL0pObJW.js → checkbox-BILwOn1g.js} +1 -1
  56. package/assets/chevron-down-TeH9o9Q-.js +1 -0
  57. package/assets/chevron-left-DUh7xA0y.js +1 -0
  58. package/assets/{circle-check-OUBTwy71.js → circle-check-CBDdVMl8.js} +1 -1
  59. package/assets/{circle-check-big-Czqmzl9y.js → circle-check-big-DlhpMe5P.js} +1 -1
  60. package/assets/{circle-help-DJ-Mtycd.js → circle-help-CP1s-Yi3.js} +1 -1
  61. package/assets/{classification-DLUltDdR.js → classification-DF13x4GV.js} +1 -1
  62. package/assets/{clock-Bw2dEIoB.js → clock-CLvsvjcH.js} +1 -1
  63. package/assets/compose._-_outboxMessageId_-3OLQ2cbN.js +1 -0
  64. package/assets/compose._-_outboxMessageId_-BYGqO75X.js +1 -0
  65. package/assets/compose._-_outboxMessageId_-Cc0PpaH6.js +1 -0
  66. package/assets/compose._-_outboxMessageId_-SAeViPeG.js +1 -0
  67. package/assets/{config-import-B6tjROvg.js → config-import-BRacJ1y6.js} +1 -1
  68. package/assets/{confirm-dialog-sa45Xnmn.js → confirm-dialog-B0MVMPmn.js} +1 -1
  69. package/assets/{copy-9W6V4dQI.js → copy-DMRh3Rb2.js} +1 -1
  70. package/assets/{credential-steps-P9fRg1pE.js → credential-steps-4YQ5eJjl.js} +1 -1
  71. package/assets/{download-O3cdl6IV.js → download-WnSzcn6T.js} +1 -1
  72. package/assets/{draft-QkjvtbSZ.js → draft-0DDwY2Pw.js} +1 -1
  73. package/assets/edit-B4dfxZaW.js +1 -0
  74. package/assets/edit-BU8CFYW0.js +1 -0
  75. package/assets/{external-link-BYIIFw9_.js → external-link-B_11YPnQ.js} +1 -1
  76. package/assets/{file-json-vVOzTp-u.js → file-json-D4Uv97RH.js} +1 -1
  77. package/assets/{filters-DohRSViK.js → filters-BWFo6zj7.js} +1 -1
  78. package/assets/flagged-BQl5KVuF.js +1 -0
  79. package/assets/{flagged-BHlMmpp_.js → flagged-C_307aIb.js} +1 -1
  80. package/assets/{folder-input-hVRteCio.js → folder-input-DjY4GpKG.js} +1 -1
  81. package/assets/{folders-BFfd-sur.js → folders-D7JFBgPP.js} +1 -1
  82. package/assets/{help-copy-_K3IfQdg.js → help-copy-bU0rZqtx.js} +1 -1
  83. package/assets/{import-ByOg30ul.js → import-CyBIMXQK.js} +1 -1
  84. package/assets/index-6cMF4pO8.js +1 -0
  85. package/assets/index-B0m7QGSS.js +1 -0
  86. package/assets/{index-Bn8n_AsE.js → index-BZ4sAts4.js} +3 -3
  87. package/assets/index-CH48-R4X.js +1 -0
  88. package/assets/index-CjLHI6va.js +1 -0
  89. package/assets/{index-k6LzEquX.js → index-CrUfJlwk.js} +4 -4
  90. package/assets/index-D-NR3LoA.js +1 -0
  91. package/assets/index-D0UOksYx.js +1 -0
  92. package/assets/index-D1_eaXw-.js +1 -0
  93. package/assets/index-OM56_7mN.js +1 -0
  94. package/assets/index-VtS9XL2y.js +1 -0
  95. package/assets/index-ksP05uVF.js +1 -0
  96. package/assets/{kbd-PiHV4odS.js → kbd-5V1_yqOW.js} +1 -1
  97. package/assets/{label-chip-BnNtXrWd.js → label-chip-BBPaslky.js} +1 -1
  98. package/assets/{labels-BQe-BkCj.js → labels-xO9yj2bw.js} +1 -1
  99. package/assets/{mail-CPplAOgE.js → mail-CRvRtCed.js} +1 -1
  100. package/assets/{mail-BFIBAL7w.js → mail-DcTEJ5uO.js} +1 -1
  101. package/assets/{menu-znX-3dzE.js → menu-DXmZUEBa.js} +1 -1
  102. package/assets/{nav-link-CtuHya9S.js → nav-link-BvBkmH1H.js} +1 -1
  103. package/assets/new-kYNP_cv-.js +1 -0
  104. package/assets/onboarding-CFIwco02.js +1 -0
  105. package/assets/{onboarding-completion-CKAiaYkS.js → onboarding-completion-CK2mHfmP.js} +1 -1
  106. package/assets/outbox-DgFmUFU6.js +1 -0
  107. package/assets/{pencil-DA21sF5f.js → pencil-Py3MXttE.js} +1 -1
  108. package/assets/{people-BQjKSotc.js → people-CxpFEQpi.js} +1 -1
  109. package/assets/{plus-6ss9YFRF.js → plus-5sFyaPZh.js} +1 -1
  110. package/assets/{popover-menu-iCbmrU-E.js → popover-menu-uIVgxYG_.js} +1 -1
  111. package/assets/{refresh-cw-CUyjBEl4.js → refresh-cw-Dar0XAdp.js} +1 -1
  112. package/assets/{reply-DmpF7cgR.js → reply-D8bLYzum.js} +1 -1
  113. package/assets/{rich-text-Cppy56p_.js → rich-text-B2jeK_lt.js} +1 -1
  114. package/assets/{rich-text-spellcheck-worker-provider-Bk2_kAe9.js → rich-text-spellcheck-worker-provider-D1J3yZU8.js} +1 -1
  115. package/assets/{rotate-ccw-Dtkxt0CH.js → rotate-ccw-CSByuoeY.js} +1 -1
  116. package/assets/{roving-focus-CzX6YmR4.js → roving-focus-1m_wY9_4.js} +1 -1
  117. package/assets/{row-actions-Cn7bQ_Ks.js → row-actions-CB2wYT6g.js} +1 -1
  118. package/assets/{search-mirror-BSzHMUcd.js → search-mirror-CFL35Bis.js} +1 -1
  119. package/assets/{search-scope-Cl87snrn.js → search-scope-BR87UqJt.js} +1 -1
  120. package/assets/{search-token-index-BSaB7qLo.js → search-token-index-CoqsoQJZ.js} +1 -1
  121. package/assets/{sections-DwdsQ0ad.js → sections-B9pteMHc.js} +1 -1
  122. package/assets/{segmented-control-68-bWTGV.js → segmented-control-CVMDr-Je.js} +1 -1
  123. package/assets/{select-Cc2Vc4qL.js → select-DXHN14lo.js} +1 -1
  124. package/assets/{senders-DwOfiVHu.js → senders-CXpJyu9L.js} +1 -1
  125. package/assets/settings-B2MbfPot.js +1 -0
  126. package/assets/{settings-screen-IjQOks0s.js → settings-screen-C8kBB2kR.js} +1 -1
  127. package/assets/{shield-check-jkVgxi6o.js → shield-check-Fest6_gL.js} +1 -1
  128. package/assets/{suggest-list-FaY4DThZ.js → suggest-list-CUEgGZt_.js} +1 -1
  129. package/assets/{suggested-vips-BLlvjvH5.js → suggested-vips-CiTGLmJd.js} +1 -1
  130. package/assets/{suggestion._suggestionId-CL7hLrk-.js → suggestion._suggestionId-BMRKFgLt.js} +1 -1
  131. package/assets/{switch-a7x-CFTd.js → switch-xqSp-gFV.js} +1 -1
  132. package/assets/{task._calendarTaskId-CkPsJj-a.js → task._calendarTaskId-AbdgpKo5.js} +1 -1
  133. package/assets/{undo-2-CnxBm8gd.js → undo-2-IdsgUvVv.js} +1 -1
  134. package/assets/{useCalendarData-RUYA8D_t.js → useCalendarData-BKkQY_vQ.js} +1 -1
  135. package/assets/{useCalendarScheduling-CO3VOpcB.js → useCalendarScheduling-D_qd-mRK.js} +1 -1
  136. package/assets/{useCalendarSuggestions-Bb4PGHae.js → useCalendarSuggestions-D58tKJtx.js} +1 -1
  137. package/assets/{useCalendarTasks-RmI_Ij1j.js → useCalendarTasks-DLNYnUeu.js} +1 -1
  138. package/assets/{useDebouncedValue-I0sDLoIF.js → useDebouncedValue-CMBraotV.js} +1 -1
  139. package/assets/{useFilters-DT8SxgF4.js → useFilters-28pRmQGT.js} +1 -1
  140. package/assets/{useLabels-DO4UWjpG.js → useLabels-CGCEGKuz.js} +1 -1
  141. package/assets/{useLayoutTier-Cn3SwiV2.js → useLayoutTier-CnmLTkLg.js} +1 -1
  142. package/assets/{useMediaQuery-C00TiD5k.js → useMediaQuery-D3m_n689.js} +1 -1
  143. package/assets/{useMessageBodyContent-lqVkO1fM.js → useMessageBodyContent-dd-lowbx.js} +1 -1
  144. package/assets/{useQueries-Bs7-L_2j.js → useQueries-B-X1sW9_.js} +1 -1
  145. package/assets/{useRefreshControl-Bt-oDRnY.js → useRefreshControl-DbHCcSXX.js} +1 -1
  146. package/assets/{useResultFolderIndex-CALTzfWS.js → useResultFolderIndex-BvBtm4F3.js} +1 -1
  147. package/assets/{useSignature-DRFIcifS.js → useSignature-CQZ_Ke3T.js} +1 -1
  148. package/assets/{warnings-ClaUoDQx.js → warnings-bjC-sL2O.js} +1 -1
  149. package/index.html +1 -1
  150. package/package.json +1 -1
  151. package/assets/FlaggedPane-F0FM2UJN.js +0 -1
  152. package/assets/MailboxPane-BDYnlpr2.js +0 -135
  153. package/assets/_calendarObjectId-CSwodc6y.js +0 -1
  154. package/assets/_mailboxId-BlTWUSb1.js +0 -1
  155. package/assets/_messageId-BaqNxGqi.js +0 -1
  156. package/assets/_messageId-DNtVsPPW.js +0 -1
  157. package/assets/_messageId-ciVFKEzn.js +0 -1
  158. package/assets/_outboxMessageId-LLqtF8cH.js +0 -1
  159. package/assets/_recurrenceId-G4qPwsrp.js +0 -1
  160. package/assets/_threadId-BAVZ7S8M.js +0 -1
  161. package/assets/_threadId-DL34NZT4.js +0 -1
  162. package/assets/_threadId-qmAQ7RKu.js +0 -1
  163. package/assets/brief-DcbZ7jHO.js +0 -1
  164. package/assets/chevron-down-BWbeCM3N.js +0 -1
  165. package/assets/chevron-left-CliOUq1O.js +0 -1
  166. package/assets/compose._-_outboxMessageId_-CAx_e1OV.js +0 -1
  167. package/assets/compose._-_outboxMessageId_-CnWaV_IX.js +0 -1
  168. package/assets/compose._-_outboxMessageId_-Dmj8hyvT.js +0 -1
  169. package/assets/compose._-_outboxMessageId_-z980Xa6X.js +0 -1
  170. package/assets/edit-B31QMGS3.js +0 -1
  171. package/assets/edit-DjkZZFBG.js +0 -1
  172. package/assets/flagged-DIi4rqg8.js +0 -1
  173. package/assets/index-BIhlBhBD.js +0 -1
  174. package/assets/index-BaqNxGqi.js +0 -1
  175. package/assets/index-C53Z5hF_.js +0 -1
  176. package/assets/index-CRnDeQMw.js +0 -1
  177. package/assets/index-CzbtDE1H.js +0 -1
  178. package/assets/index-DNtVsPPW.js +0 -1
  179. package/assets/index-DR2Joq7n.js +0 -1
  180. package/assets/index-DbyBl7Lq.js +0 -1
  181. package/assets/index-cVALleyU.js +0 -1
  182. package/assets/index-ciVFKEzn.js +0 -1
  183. package/assets/new-psckzAFd.js +0 -1
  184. package/assets/onboarding-B_l5ow67.js +0 -1
  185. package/assets/outbox-BTiQbMrW.js +0 -1
  186. package/assets/settings-BdeAbD2h.js +0 -1
@@ -1,3 +1,3 @@
1
- import{r as V,u as go,ce as _o,G as Wt,l as Eo,a7 as yo,e as Ao,a as bo,cC as So,co as Ro}from"./index-Bn8n_AsE.js";import{e as Oo,f as wo}from"./reply-DmpF7cgR.js";import{c as Do}from"./nav-link-CtuHya9S.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 Lo(n,o){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,c,p,h,F=[],A=!0,G=!1;try{if(p=(a=a.call(n)).next,o!==0)for(;!(A=(l=p.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 No(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as V,u as go,ce as _o,G as Wt,l as Eo,a7 as yo,e as Ao,a as bo,cC as So,co as Ro}from"./index-BZ4sAts4.js";import{e as Oo,f as wo}from"./reply-D8bLYzum.js";import{c as Do}from"./nav-link-BvBkmH1H.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 Lo(n,o){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,c,p,h,F=[],A=!0,G=!1;try{if(p=(a=a.call(n)).next,o!==0)for(;!(A=(l=p.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 No(){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 Io(n,o){return Co(n)||Lo(n,o)||Mo(n,o)||No()}function Mo(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,Po=Object.isFrozen,Dn=Object.getPrototypeOf,Cn=Object.getOwnPropertyDescriptor;let O=Object.freeze,D=Object.seal,Tt=Object.create,Ln=typeof Reflect<"u"&&Reflect,De=Ln.apply,Ce=Ln.construct;O||(O=function(o){return o});D||(D=function(o){return o});De||(De=function(o,a){for(var l=arguments.length,c=new Array(l>2?l-2:0),p=2;p<l;p++)c[p-2]=arguments[p];return o.apply(a,c)});Ce||(Ce=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),xo=E(Array.prototype.lastIndexOf),mn=E(Array.prototype.pop),Dt=E(Array.prototype.push),vo=E(Array.prototype.slice),ko=E(Array.prototype.splice),_t=Array.isArray,_e=Nn(Set),Ee=E(Set.prototype.add),Ct=E(Set.prototype.has),st=E(String.prototype.toLowerCase),ye=E(String.prototype.toString),dn=E(String.prototype.match),Lt=E(String.prototype.replace),hn=E(String.prototype.indexOf),Uo=E(String.prototype.trim),Fo=E(Number.prototype.toString),zo=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),Nt=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 De(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 Ce(n,a)}}function d(n,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:st;if(pn&&pn(n,null),!_t(o))return n;let l=o.length;for(;l--;){let c=o[l];if(typeof c=="string"){const p=a(c);p!==c&&(Po(o)||(o[l]=p),c=p)}n[c]=!0}return n}function Ho(n){for(let o=0;o<n.length;o++)P(n,o)||(n[o]=null);return n}function x(n){const o=Tt(null);for(const l of wn(n)){var a=Io(l,2);const c=a[0],p=a[1];P(n,c)&&(_t(p)?o[c]=Ho(p):p&&typeof p=="object"&&p.constructor===Object?o[c]=x(p):o[c]=p)}return o}function Bo(n){switch(typeof n){case"string":return n;case"number":return Fo(n);case"boolean":return zo(n);case"bigint":return Tn?Tn(n):"0";case"symbol":return gn?gn(n):"Symbol()";case"undefined":return Nt(n);case"function":case"object":{if(n===null)return Nt(n);const o=n,a=k(o,"toString");if(typeof a=="function"){const l=a(o);return typeof l=="string"?l:Nt(l)}return Nt(n)}default:return Nt(n)}}function k(n,o){for(;n!==null;){const l=Cn(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 Go(n,o){for(;n!==null;){const a=Cn(n,o);if(a)return a.get?E(a.get):null;n=Dn(n)}return null}function Wo(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"]),Ae=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"]),be=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"]),Yo=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"]),Se=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"]),$o=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"]),Re=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"]),Yt=O(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jo=D(/{{[\w\W]*|^[\w\W]*}}/g),Vo=D(/<%[\w\W]*|^[\w\W]*%>/g),Xo=D(/\${[\w\W]*/g),Ko=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),Qo=D(/^(?:\w+script|data):/i),Zo=D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Jo=D(/^html$/i),tr=D(/^[a-z][.\w]*(-[.\w]+)+$/i),Oe=D(/<[/\w!]/g),Sn=D(/<[/\w]/g),er=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},nr=O(d({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),or=function(){return typeof window>"u"?null:window},rr=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 p="dompurify"+(l?"#"+l:"");try{return o.createPolicy(p,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+p+" 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)&&_t(o[a])?d(c.base?x(c.base):{},o[a],c.transform):l},we=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]:or();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 p=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,Et=k(R,"cloneNode"),yt=k(R,"remove"),It=k(R,"removeAttributeNode"),J=k(R,"nextSibling"),L=k(R,"childNodes"),X=k(R,"parentNode"),$t=k(R,"shadowRoot"),jt=k(R,"attributes"),tt=h&&h.prototype?k(h.prototype,"nodeType"):null,at=h&&h.prototype?k(h.prototype,"nodeName"):null,Mt=h&&h.prototype?k(h.prototype,"ownerDocument"):null,v=function(t){return tt?tt(t):t.nodeType},At=function(t){return at?at(t):t.nodeName},Ie=Go(R,"namespaceURI"),Vt=function(t){return Ie?Ie(t):t.namespaceURI};if(typeof p=="function"){const s=a.createElement("template");s.content&&s.content.ownerDocument&&(a=s.content.ownerDocument)}let N,et="",Xt,Me=!1,bt=0;const Pe=function(){if(bt>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.')},lt=function(t){Pe(),bt++;try{return N.createHTML(t)}finally{bt--}},Fn=function(t){Pe(),bt++;try{return N.createScriptURL(t)}finally{bt--}},zn=function(){return Me||(Xt=rr(W,c),Me=!0),Xt},Pt=a,Kt=Pt.implementation,xe=Pt.createNodeIterator,Hn=Pt.createDocumentFragment,Bn=Pt.getElementsByTagName,Gn=l.importNode;let T=On();o.isSupported=typeof wn=="function"&&typeof X=="function"&&Kt&&Kt.createHTMLDocument!==void 0;const Wn=jo,Yn=Vo,$n=Xo,jn=Ko,Vn=qo,Xn=Qo,ve=Zo,Kn=tr;let ke=bn,g=null;const qt=d({},[..._n,...Ae,...be,...Se,...En]);let _=null;const Qt=d({},[...yn,...Re,...An,...Yt]);let z=Object.seal(Tt(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}})),St=null,Ue=null;const K=Object.seal(Tt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Fe=!0,Zt=!0,ze=!1,Jt=!0,Y=!1,nt=!0,ot=!1,te=!1,xt=null,vt=null,ee=!1,ct=!1,kt=!1,Ut=!1,He=!0,Be=!1;const Ge="user-content-";let ne=!0,oe=!1,rt=null,ut={},it=null;const We=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 Ye=null;const $e=d({},["audio","video","img","source","image","track"]);let je=null;const Ve=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ft="http://www.w3.org/1998/Math/MathML",zt="http://www.w3.org/2000/svg",H="http://www.w3.org/1999/xhtml";let ft=H,re=!1,ie=null;const qn=d({},[Ft,zt,H],ye),Xe=O(["mi","mo","mn","ms","mtext"]);let se=d({},Xe);const Ke=O(["annotation-xml"]);let ae=d({},Ke);const Qn=d({},["title","style","font","a","script"]);let Rt=null;const Zn=["application/xhtml+xml","text/html"],Jn="text/html";let y=null,pt=null;const to=a.createElement("form"),qe=function(t){return t instanceof RegExp||t instanceof Function},le=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pt&&pt===t)return;(!t||typeof t!="object")&&(t={}),t=x(t),Rt=Zn.indexOf(t.PARSER_MEDIA_TYPE)===-1?Jn:t.PARSER_MEDIA_TYPE,y=Rt==="application/xhtml+xml"?ye:st,g=Z(t,"ALLOWED_TAGS",qt,{transform:y}),_=Z(t,"ALLOWED_ATTR",Qt,{transform:y}),ie=Z(t,"ALLOWED_NAMESPACES",qn,{transform:ye}),je=Z(t,"ADD_URI_SAFE_ATTR",Ve,{transform:y,base:Ve}),Ye=Z(t,"ADD_DATA_URI_TAGS",$e,{transform:y,base:$e}),it=Z(t,"FORBID_CONTENTS",We,{transform:y}),St=Z(t,"FORBID_TAGS",x({}),{transform:y}),Ue=Z(t,"FORBID_ATTR",x({}),{transform:y}),ut=P(t,"USE_PROFILES")?t.USE_PROFILES&&typeof t.USE_PROFILES=="object"?x(t.USE_PROFILES):t.USE_PROFILES:!1,Fe=t.ALLOW_ARIA_ATTR!==!1,Zt=t.ALLOW_DATA_ATTR!==!1,ze=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Jt=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=t.SAFE_FOR_TEMPLATES||!1,nt=t.SAFE_FOR_XML!==!1,ot=t.WHOLE_DOCUMENT||!1,ct=t.RETURN_DOM||!1,kt=t.RETURN_DOM_FRAGMENT||!1,Ut=t.RETURN_TRUSTED_TYPE||!1,ee=t.FORCE_BODY||!1,He=t.SANITIZE_DOM!==!1,Be=t.SANITIZE_NAMED_PROPS||!1,ne=t.KEEP_CONTENT!==!1,oe=t.IN_PLACE||!1,ke=Wo(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:bn,ft=typeof t.NAMESPACE=="string"?t.NAMESPACE:H,se=we(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>d({},Xe)),ae=we(t,"HTML_INTEGRATION_POINTS",()=>d({},Ke));const e=we(t,"CUSTOM_ELEMENT_HANDLING",()=>Tt(null));if(z=Tt(null),P(e,"tagNameCheck")&&qe(e.tagNameCheck)&&(z.tagNameCheck=e.tagNameCheck),P(e,"attributeNameCheck")&&qe(e.attributeNameCheck)&&(z.attributeNameCheck=e.attributeNameCheck),P(e,"allowCustomizedBuiltInElements")&&typeof e.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),D(z),Y&&(Zt=!1),kt&&(ct=!0),ut&&(g=d({},En),_=Tt(null),ut.html===!0&&(d(g,_n),d(_,yn)),ut.svg===!0&&(d(g,Ae),d(_,Re),d(_,Yt)),ut.svgFilters===!0&&(d(g,be),d(_,Re),d(_,Yt)),ut.mathMl===!0&&(d(g,Se),d(_,An),d(_,Yt))),K.tagCheck=null,K.attributeCheck=null,P(t,"ADD_TAGS")&&(typeof t.ADD_TAGS=="function"?K.tagCheck=t.ADD_TAGS:_t(t.ADD_TAGS)&&(g===qt&&(g=x(g)),d(g,t.ADD_TAGS,y))),P(t,"ADD_ATTR")&&(typeof t.ADD_ATTR=="function"?K.attributeCheck=t.ADD_ATTR:_t(t.ADD_ATTR)&&(_===Qt&&(_=x(_)),d(_,t.ADD_ATTR,y))),P(t,"ADD_FORBID_CONTENTS")&&_t(t.ADD_FORBID_CONTENTS)&&(it===We&&(it=x(it)),d(it,t.ADD_FORBID_CONTENTS,y)),ne&&(g["#text"]=!0),ot&&d(g,["html","head","body"]),g.table&&(d(g,["tbody"]),delete St.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw j('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw j('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const r=N;N=t.TRUSTED_TYPES_POLICY;try{et=lt("")}catch(i){throw N=r,i}}else t.TRUSTED_TYPES_POLICY===null?(N=void 0,et=""):(N===void 0&&(N=zn()),N&&typeof et=="string"&&(et=lt("")));O&&O(t),pt=t},Qe=d({},[...Ae,...be,...Yo]),Ze=d({},[...Se,...$o]),eo=function(t,e,r){return e.namespaceURI===H?t==="svg":e.namespaceURI===Ft?t==="svg"&&(r==="annotation-xml"||se[r]):!!Qe[t]},no=function(t,e,r){return e.namespaceURI===H?t==="math":e.namespaceURI===zt?t==="math"&&ae[r]:!!Ze[t]},oo=function(t,e,r){return e.namespaceURI===zt&&!ae[r]||e.namespaceURI===Ft&&!se[r]?!1:!Ze[t]&&(Qn[t]||!Qe[t])},ro=function(t){const e=Vt(t),r=st(At(t)),i=X(t);let u,f;return i&&v(i)===b.element?(u={namespaceURI:Vt(i)},f=st(At(i))):(u={namespaceURI:ft},f="template"),ie[e]?e===zt?eo(r,u,f):e===Ft?no(r,u,f):e===H?oo(r,u,f):!!(Rt==="application/xhtml+xml"&&ie[e]):!1},q=function(t){Dt(o.removed,{element:t});try{X(t).removeChild(t)}catch{if(yt(t),!X(t))throw j("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Je=function(t,e,r){try{It(t,e)}catch{try{t.removeAttribute(r)}catch{}}},ce=function(t){fe(t);const e=L(t);e&&$(vo(e),i=>{try{yt(i)}catch{}});const r=v(t)===b.element?jt(t):null;if(r)for(let i=r.length-1;i>=0;--i){const u=r[i],f=u&&u.name;typeof f=="string"&&Je(t,u,f)}},mt=function(t,e,r){if(!r)try{r=e.getAttributeNode(t)}catch{r=null}Dt(o.removed,{attribute:r||null,from:e});try{r?It(e,r):e.removeAttribute(t)}catch{try{e.removeAttribute(t)}catch{}}if(t==="is")if(ct||kt)try{q(e)}catch{}else try{e.setAttribute(t,"")}catch{}},tn=function(t){const e=jt(t);if(e)for(let r=e.length-1;r>=0;--r){const i=e[r],u=i&&i.name;typeof u!="string"||_[y(u)]||Je(t,i,u)}},ue=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[t];for(;i.length>0;){const u=i.pop();if(e(u)===!1)continue;if(r&&v(u)===b.element){const m=$t(u);Q(m)&&i.push(m)}const f=L(u);if(f)for(let m=f.length-1;m>=0;--m)i.push(f[m])}},fe=function(t){ue(t,e=>{v(e)===b.element&&tn(e)})},pe=function(t){const e=[];return ue(t,r=>{e.push(r)},!0),e},io=function(t,e){const r=_e();$(pe(t),i=>{v(i)===b.element&&Ee(r,i)}),$(e,i=>{v(i)===b.element&&!Ct(r,i)&&tn(i)})},en=function(t,e){let r=!1;return $(o.removed,i=>{i.element&&(r=r||i.element===t,fe(i.element))}),io(t,e),r},so=8,ao=function(t,e){const r=rt;let i=null;const u=()=>(i||(i=_e(),$(e,f=>{Ee(i,f)})),i);for(let f=0;;f++){const m=pe(t),S=[t];let B=!1;if($(m,C=>{v(C)===b.documentFragment?Dt(S,C):!B&&!Ct(r,C)&&(B=Ct(u(),C))}),!B)return;if(f>=so)throw j("the tree kept changing during in-place sanitization; refusing to return it");$(S,(C,I)=>{lo(C,I>0,t,u())})}},lo=function(t,e,r,i){const u=me(t);let f;for(;f=u.nextNode();)!Ct(i,f)||Ct(rt,f)||(e&&U(T.uponSanitizeShadowNode,f,null),he(f,r),Te(f,r),Q(f.content)&&wt(f.content))},co=function(t){rt&&Ee(rt,t)},nn=function(t,e){return nt?t==="patchsrc"?!0:t==="for"&&e!=="label"&&e!=="output":!1},uo=function(t){nt&&ue(t,e=>{const r=v(e);if(r===b.processingInstruction||r===b.comment&&w(Sn,e.data)){try{yt(e)}catch{}return!1}if(r===b.element){const i=e,u=y(At(e));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(t){let e=null,r=null;if(ee)t="<remove></remove>"+t;else{const f=dn(t,/^[\r\n\t ]+/);r=f&&f[0]}Rt==="application/xhtml+xml"&&ft===H&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const i=N?lt(t):t;if(ft===H)try{e=new G().parseFromString(i,Rt)}catch{}if(!e||!e.documentElement){e=Kt.createDocument(ft,"template",null);try{e.documentElement.innerHTML=re?et:i}catch{}}const u=e.body||e.documentElement;return t&&r&&u.insertBefore(a.createTextNode(r),u.childNodes[0]||null),ft===H?Bn.call(e,ot?"html":"body")[0]:ot?e.documentElement:u},me=function(t){const e=Mt?Mt(t):t.ownerDocument;return xe.call(e||t,t,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT|A.SHOW_PROCESSING_INSTRUCTION|A.SHOW_CDATA_SECTION,null)},Ht=function(t){return t=Lt(t,Wn," "),t=Lt(t,Yn," "),t=Lt(t,$n," "),t},de=function(t){var e;rn(t);const r=(e=t.querySelectorAll)===null||e===void 0?void 0:e.call(t,"template");r&&$(r,i=>{Q(i.content)&&de(i.content)})},rn=function(t){t.normalize();const e=Mt?Mt(t):t.ownerDocument,r=xe.call(e||t,t,A.SHOW_TEXT|A.SHOW_COMMENT|A.SHOW_CDATA_SECTION|A.SHOW_PROCESSING_INSTRUCTION,null);let i=r.nextNode();for(;i;)i.data=Ht(i.data),i=r.nextNode()},Bt=function(t){const e=at?at(t):null;return typeof e!="string"||y(e)!=="form"?!1:typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||t.attributes!==jt(t)||typeof t.removeAttribute!="function"||typeof t.removeAttributeNode!="function"||typeof t.getAttributeNode!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function"||t.nodeType!==tt(t)||t.childNodes!==L(t)},Q=function(t){if(!tt||typeof t!="object"||t===null)return!1;try{return tt(t)===b.documentFragment}catch{return!1}},Ot=function(t){if(!tt||typeof t!="object"||t===null)return!1;try{return typeof tt(t)=="number"}catch{return!1}};function U(s,t,e){s.length!==0&&$(s,r=>{r.call(o,t,e,pt)})}const fo=function(t,e){return!!(nt&&t.hasChildNodes()&&!Ot(t.firstElementChild)&&w(Oe,t.textContent)&&w(Oe,t.innerHTML)||nt&&nr[e]&&v(t)===b.element&&Vt(t)===H&&(Ot(t.firstElementChild)||typeof t.textContent=="string"&&w(Oe,t.textContent))||t.nodeType===b.processingInstruction||nt&&t.nodeType===b.comment&&w(Sn,t.data))},Gt=function(t,e){if(t instanceof RegExp)return w(t,e);if(t 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!!t(e,...i)}return!1},po=function(t,e,r){if(!St[e]&&ln(e)&&Gt(z.tagNameCheck,e))return!1;if(ne&&!it[e]&&!it[st(e)]){const i=X(t),u=L(t);if(u&&i){const f=u.length;for(let m=f-1;m>=0;--m){const S=t===r?Et(u[m],!0):u[m];i.insertBefore(S,J(t))}}}return q(t),!0},sn=function(t,e,r,i){return t.length===0?e:e===r||e===i?x(e):e},dt=function(t,e){return t===e||X(t)!==null?!1:(oe&&fe(t),!0)},he=function(t,e){if(co(t),U(T.beforeSanitizeElements,t,null),dt(t,e))return!0;if(Bt(t))return q(t),!0;const r=y(At(t));if(g=sn(T.uponSanitizeElement,g,qt,xt),U(T.uponSanitizeElement,t,{tagName:r,allowedTags:g}),dt(t,e))return!0;if(fo(t,r))return q(t),!0;if(St[r]||!(K.tagCheck instanceof Function&&K.tagCheck(r))&&!g[r]){const i=po(t,r,e);return i===!1&&(U(T.afterSanitizeElements,t,null),dt(t,e))?!0:i}if(v(t)===b.element&&!ro(t)||(r==="noscript"||r==="noembed"||r==="noframes")&&w(er,t.innerHTML))return q(t),!0;if(Y&&t.nodeType===b.text){const i=Ht(t.textContent);t.textContent!==i&&(Dt(o.removed,{element:t.cloneNode()}),t.textContent=i)}return U(T.afterSanitizeElements,t,null),dt(t,e)},an=function(t,e,r){if(Ue[e]||nn(e,t)||He&&(e==="id"||e==="name")&&(r in a||r in to))return!1;const i=_[e]||K.attributeCheck instanceof Function&&K.attributeCheck(e,t);return Zt&&w(jn,e)||Fe&&w(Vn,e)?!0:i?je[e]||w(ke,Lt(r,ve,""))||(e==="src"||e==="xlink:href"||e==="href")&&t!=="script"&&hn(r,"data:")===0&&Ye[t]||ze&&!w(Xn,Lt(r,ve,""))?!0:!r:ln(t)&&Gt(z.tagNameCheck,t)&&Gt(z.attributeNameCheck,e,t)||e==="is"&&z.allowCustomizedBuiltInElements&&Gt(z.tagNameCheck,r)},mo=d({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ln=function(t){return!mo[st(t)]&&w(Kn,t)},ho=function(t,e,r,i){if(N&&typeof W=="object"&&typeof W.getAttributeType=="function"&&!r)switch(W.getAttributeType(t,e)){case"TrustedHTML":return lt(i);case"TrustedScriptURL":return Fn(i)}return i},To=function(t,e,r,i){try{return r?t.setAttributeNS(r,e,i):t.setAttribute(e,i),Bt(t)?(q(t),!1):!0}catch{return mt(e,t),!1}},cn=function(t,e){return nt&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,e)?!0:st(t)==="attributename"&&dn(e,"href")!==null},Te=function(t,e){if(U(T.beforeSanitizeAttributes,t,null),dt(t,e))return;const r=t.attributes;if(!r||Bt(t))return;_=sn(T.uponSanitizeAttribute,_,Qt,vt);const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let u=r.length;const f=y(t.nodeName);for(;u--;){const m=r[u],S=m.name,B=m.namespaceURI,C=m.value,I=y(S),ht=C;let M=S==="value"?ht:Uo(ht),un=!1;if(i.attrName=I,i.attrValue=M,i.keepAttr=!0,i.forceKeepAttr=void 0,U(T.uponSanitizeAttribute,t,i),M=i.attrValue,Be&&(I==="id"||I==="name")&&hn(M,Ge)!==0&&(mt(S,t,m),M=Ge+M,un=!0),cn(S,M)){mt(S,t,m);continue}if(!i.forceKeepAttr){if(!i.keepAttr){mt(S,t,m);continue}if(!Jt&&w(Rn,M)){mt(S,t,m);continue}if(Y&&(M=Ht(M)),!an(f,I,M)){mt(S,t,m);continue}M=ho(f,I,B,M),M!==ht&&To(t,S,B,M)&&un&&mn(o.removed)}}U(T.afterSanitizeAttributes,t,null),dt(t,e)},wt=function(t){let e=null;const r=me(t);for(U(T.beforeSanitizeShadowDOM,t,null);e=r.nextNode();)if(U(T.uponSanitizeShadowNode,e,null),he(e,t),Te(e,t),Q(e.content)&&wt(e.content),v(e)===b.element){const i=$t(e);Q(i)&&(ge(i),wt(i))}Y&&rn(t),U(T.afterSanitizeShadowDOM,t,null)},ge=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const r=e.pop();if(r.shadow){wt(r.shadow);continue}const i=r.node,u=v(i)===b.element,f=L(i);if(f)for(let m=f.length-1;m>=0;--m)e.push({node:f[m],shadow:null});if(u){const m=at?at(i):null;if(typeof m=="string"&&y(m)==="template"){const S=i.content;Q(S)&&e.push({node:S,shadow:null})}}if(u){const m=$t(i);Q(m)&&e.push({node:null,shadow:m},{node:m,shadow:null})}}};return o.sanitize=function(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,r=null,i=null,u=null;if(re=!s,re&&(s="<!-->"),typeof s!="string"&&!Ot(s)&&(s=Bo(s),typeof s!="string"))throw j("dirty is not a string, aborting");if(!o.isSupported)return s;te?(g=xt,_=vt):le(t),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(g=x(g)),T.uponSanitizeAttribute.length>0&&(_=x(_)),o.removed=[];const f=oe&&typeof s!="string"&&Ot(s);let m=[];const S=rt;if(f){uo(s);const I=At(s);if(typeof I=="string"){const ht=y(I);if(!g[ht]||St[ht])throw ce(s),j("root node is forbidden and cannot be sanitized in-place")}if(Bt(s))throw ce(s),j("root node is clobbered and cannot be sanitized in-place");m=pe(s),rt=_e()}else if(Ot(s))e=on("<!---->"),r=e.ownerDocument.importNode(s,!0),r.nodeType===b.element&&r.nodeName==="BODY"||r.nodeName==="HTML"?e=r:e.appendChild(r),ge(e);else{if(!ct&&!Y&&!ot&&s.indexOf("<")===-1)return N&&Ut?lt(s):s;if(e=on(s),!e)return ct?null:Ut?et:""}e&&ee&&q(e.firstChild);const B=f?s:e;try{f&&ge(s);const I=me(B);for(;i=I.nextNode();)he(i,B),Te(i,B),Q(i.content)&&wt(i.content);f&&ao(s,m)}catch(I){throw f&&(ce(s),en(s,m)),I}finally{rt=S}if(f){if(en(s,m))throw j("a node selected for removal could not be safely returned; refusing to sanitize in place");return Y&&de(s),s}if(ct){if(Y&&de(e),kt)for(u=Hn.call(e.ownerDocument);e.firstChild;)u.appendChild(e.firstChild);else u=e;return(_.shadowroot||_.shadowrootmode)&&(u=Gn.call(l,u,!0)),u}let C=ot?e.outerHTML:e.innerHTML;return ot&&g["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&w(Jo,e.ownerDocument.doctype.name)&&(C="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
3
3
  `+C),Y&&(C=Ht(C)),N&&Ut?lt(C):C},o.setConfig=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};le(s),te=!0,xt=g,vt=_},o.clearConfig=function(){pt=null,te=!1,xt=null,vt=null,N=Xt,et=""},o.isValidAttribute=function(s,t,e){pt||le({});const r=y(s),i=y(t);return typeof e=="string"&&(cn(t,e)||!Jt&&w(Rn,e))?!1:an(r,i,e)},o.addHook=function(s,t){typeof t=="function"&&P(T,s)&&Dt(T[s],t)},o.removeHook=function(s,t){if(P(T,s)){if(t!==void 0){const e=xo(T[s],t);return e===-1?void 0:ko(T[s],e,1)[0]}return mn(T[s])}},o.removeHooks=function(s){P(T,s)&&(T[s]=[])},o.removeAllHooks=function(){T=On()},o}var Ar=In();const Mn="/mail/brief/compose/{-$outboxMessageId}",Pn="/mail/flagged/compose/{-$outboxMessageId}",xn="/mail/outbox/compose/{-$outboxMessageId}",vn="/mail/$mailboxId/compose/{-$outboxMessageId}";function kn(){const n=Wt({from:Mn,shouldThrow:!1}),o=Wt({from:Pn,shouldThrow:!1}),a=Wt({from:xn,shouldThrow:!1}),l=Wt({from:vn,shouldThrow:!1});return n??o??a??l}function br(){return kn()!==void 0}function Sr(){return kn()?.outboxMessageId}function ir(n,o,a){return n==="flagged"?{to:Pn,params:{outboxMessageId:a}}:n==="outbox"?{to:xn,params:{outboxMessageId:a}}:n==="mailbox"&&o?{to:vn,params:{mailboxId:o,outboxMessageId:a}}:{to:Mn,params:{outboxMessageId:a}}}function Ne(){const n=go(),o=Do(),{list:a,mailboxId:l}=Oo();return V.useCallback((c,p)=>{n({...ir(a,l,c),search:_o,hash:p?.keepPanels?!0:o,replace:p?.replace??!1})},[n,o,a,l])}function Rr(){const n=Ne();return V.useCallback(()=>n(void 0),[n])}function Or(){const n=Ne();return V.useCallback(o=>n(o),[n])}function wr(){const n=Ne();return V.useCallback(o=>n(o,{replace:!0,keepPanels:!0}),[n])}function Dr(){return wo()}const sr=new Set(["rfc822","global"]),ar=n=>n.mediaType.toUpperCase()==="MESSAGE"&&sr.has(n.mediaSubtype.toLowerCase()),Un=(n,o)=>n.partPath.startsWith(`${o}.`),lr=n=>{const o=n.filter(ar);return n.filter(a=>!o.some(l=>Un(a,l.partPath)))},Cr=(n,o)=>n.filter(a=>Un(a,o)),cr=n=>{const o=lr(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},Le={all:["messages"],detail:n=>[...Le.all,"detail",n],body:n=>[...Le.detail(n),"body"]};class gt 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 ur=n=>{const o=Number.parseInt(n??"",10);return!Number.isFinite(o)||o<=0?1:Math.min(o,30)},fr=8,pr="x-remit-403-reason",mr=(n,o)=>{const a=o?.trim()??"";return n===401?"auth":n===403?a.length>0?"auth":"body-missing":n===404?"body-missing":"generic"},dr=(n,o)=>(o??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(n):!1,hr=(n,o)=>{const a=(o??"").toLowerCase();return!!(n==="text"&&a.startsWith("text/html"))},Tr=async(n,o,a=async()=>null)=>{const l={},c=await a();c&&(l.Authorization=`Bearer ${c}`);const p=await Ro(n,{headers:l});if(p.status===202)throw new gt("not-ready","Message body is still syncing",202,ur(p.headers.get("Retry-After")));if(!p.ok){const A=p.headers.get(pr),G=mr(p.status,A);throw new gt(G,`Failed to load message body (${p.status} ${p.statusText})`,p.status)}const h=p.headers.get("content-type");if(hr(o,h))throw new gt("content-type-mismatch",`Refusing to render message body — expected ${o}, got Content-Type ${h}`);const F=await p.text();if(dr(F,h))throw new gt("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return F},gr=async(n,o)=>(o.isRetryAfterNotReady&&await n.refetchDescribeMessage(),n.fetchContent(o.contentUrl,o.kind)),Lr=({messageId:n,bodyParts:o,enabled:a=!0})=>{const l=o?cr(o):null,c=Eo(),{getToken:p}=yo(),h=V.useRef(null),F=Ao(),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=bo({queryKey:n?[...Le.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,gr({fetchContent:(L,X)=>Tr(L,X,p),refetchDescribeMessage:()=>F.refetchQueries({queryKey:So({path:{messageId:n}})})},{contentUrl:l.contentUrl,kind:l.kind,isRetryAfterNotReady:J})},enabled:a&&!!n&&!!l,staleTime:300*1e3,gcTime:1800*1e3,retry:(J,L)=>L instanceof gt&&L.reason==="not-ready"?J<fr:J<1,retryDelay:(J,L)=>L instanceof gt&&L.reason==="not-ready"?(A.current=!0,(L.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),Et=R.isLoading&&!!l,yt=o!==void 0&&l===null;V.useEffect(()=>{Et&&(h.current=performance.now())},[Et]),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 It=R.data&&l?{kind:l.kind,body:R.data}:void 0;return{picked:l,data:It,isLoading:Et,hasNoRenderablePart:yt,isError:R.isError,error:R.error,refetch:R.refetch}};export{gt as B,br as a,Lr as b,mr as c,Sr as d,wr as e,Dr as f,Or as g,Cr as h,ar as i,lr as o,Ar as p,Rr as u};
@@ -1 +1 @@
1
- import{cD as Q,cE as y,cF as S,cG as w,cH as C,e as k,cI as M,cJ as q,r as p,cK as x,cL as H,cM as L,cN as P,cO as v,cP as B,cQ as A}from"./index-Bn8n_AsE.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function I(r,e,s){const t=r.slice(0);return t[e]=s,t}var T=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#c=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#d(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,a=i.some((o,d)=>o!==s[d]),f=u||a,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#c=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#a(t,s)]}#a(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=I(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 D({queries:r,...e},s){const t=k(),i=M(),n=q(),u=p.useMemo(()=>r.map(h=>{const c=t.defaultQueryOptions(h);return c._optimisticResults=i?"isRestoring":"optimistic",c}),[r,t,i]);u.forEach(h=>{x(h);const c=t.getQueryCache().get(h.queryHash);H(h,n,c)}),L(n);const[a]=p.useState(()=>new T(t,u,e)),[f,b,o]=a.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?a.subscribe(y.batchCalls(h)):P,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(u,e)},[u,e,a]);const m=f.some((h,c)=>v(u[c],h))?f.flatMap((h,c)=>{const l=u[c];if(l&&v(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const O=f.find((h,c)=>{const l=u[c];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(O?.error)throw O.error;return b(o())}export{D as u};
1
+ import{cD as Q,cE as y,cF as S,cG as w,cH as C,e as k,cI as M,cJ as q,r as p,cK as x,cL as H,cM as L,cN as P,cO as v,cP as B,cQ as A}from"./index-BZ4sAts4.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function I(r,e,s){const t=r.slice(0);return t[e]=s,t}var T=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#c=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#d(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,a=i.some((o,d)=>o!==s[d]),f=u||a,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#c=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#a(t,s)]}#a(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=I(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 D({queries:r,...e},s){const t=k(),i=M(),n=q(),u=p.useMemo(()=>r.map(h=>{const c=t.defaultQueryOptions(h);return c._optimisticResults=i?"isRestoring":"optimistic",c}),[r,t,i]);u.forEach(h=>{x(h);const c=t.getQueryCache().get(h.queryHash);H(h,n,c)}),L(n);const[a]=p.useState(()=>new T(t,u,e)),[f,b,o]=a.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?a.subscribe(y.batchCalls(h)):P,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(u,e)},[u,e,a]);const m=f.some((h,c)=>v(u[c],h))?f.flatMap((h,c)=>{const l=u[c];if(l&&v(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const O=f.find((h,c)=>{const l=u[c];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(O?.error)throw O.error;return b(o())}export{D as u};
@@ -1 +1 @@
1
- import{j as E,v as K,p as Q,B as U,e as N,J as B,r as o,aF as R,P as $,Q as z,l as G,a0 as I,a1 as X,a4 as J}from"./index-Bn8n_AsE.js";import{C as V}from"./circle-check-big-Czqmzl9y.js";import{R as Y}from"./refresh-cw-CUyjBEl4.js";import{u as P}from"./useQueries-Bs7-L_2j.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(V,{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},F=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},se=(e,s)=>F(e,s).length>0,q=o.createContext(null),ne=()=>{const e=o.useContext(q);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=F(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(q.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=>{J(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:X({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,v as K,p as Q,B as U,e as N,J as B,r as o,aF as R,P as $,Q as z,l as G,a0 as I,a1 as X,a4 as J}from"./index-BZ4sAts4.js";import{C as V}from"./circle-check-big-DlhpMe5P.js";import{R as Y}from"./refresh-cw-Dar0XAdp.js";import{u as P}from"./useQueries-B-X1sW9_.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(V,{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},F=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},se=(e,s)=>F(e,s).length>0,q=o.createContext(null),ne=()=>{const e=o.useContext(q);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=F(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(q.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=>{J(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:X({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 s,U as o,r as n,b_ as r}from"./index-Bn8n_AsE.js";import{u as d}from"./useQueries-Bs7-L_2j.js";const h=s("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]),p=t=>({items:t.map(e=>e.data?.items??[]),isPending:t.some(e=>e.isPending),error:t.find(e=>e.error)?.error??null});function u(t){const e=d({queries:t.map(i=>({...o({path:{accountId:i.accountId}}),staleTime:1/0})),combine:p});return{index:n.useMemo(()=>r(t.map((i,a)=>({folderAppointments:i.folderAppointments,mailboxes:e.items[a]??[]}))),[t,e]),isPending:e.isPending,error:e.error}}export{h as B,u};
1
+ import{b as s,U as o,r as n,b_ as r}from"./index-BZ4sAts4.js";import{u as d}from"./useQueries-B-X1sW9_.js";const h=s("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]),p=t=>({items:t.map(e=>e.data?.items??[]),isPending:t.some(e=>e.isPending),error:t.find(e=>e.error)?.error??null});function u(t){const e=d({queries:t.map(i=>({...o({path:{accountId:i.accountId}}),staleTime:1/0})),combine:p});return{index:n.useMemo(()=>r(t.map((i,a)=>({folderAppointments:i.folderAppointments,mailboxes:e.items[a]??[]}))),[t,e]),isPending:e.isPending,error:e.error}}export{h as B,u};
@@ -1 +1 @@
1
- import{e as m,ak as y,a as b,c as L,r as c,f as w,al as S,k,h as E}from"./index-Bn8n_AsE.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({...E(),onSuccess:()=>{n.invalidateQueries({queryKey:k()})},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,ak as y,a as b,c as L,r as c,f as w,al as S,k,h as E}from"./index-BZ4sAts4.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({...E(),onSuccess:()=>{n.invalidateQueries({queryKey:k()})},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,aB as T,B as d,aI as C,bm as j,bk as N,d as $,ad as k,a7 as A,bC as E,bX as f,bY as _,bZ as M,a as P,c as W,r as l,a2 as z,aw as x,ax as p,u as O,ac as B}from"./index-Bn8n_AsE.js";import{B as h,u as L}from"./useResultFolderIndex-CALTzfWS.js";import{B as y}from"./badge-CfQoDkmE.js";import{C as S}from"./circle-check-OUBTwy71.js";import{C as q}from"./copy-9W6V4dQI.js";import{E as D}from"./external-link-BYIIFw9_.js";import{f as U}from"./ErrorState-BXxvOnci.js";import{a as F}from"./sections-DwdsQ0ad.js";import{w as G}from"./help-copy-_K3IfQdg.js";import{S as H}from"./settings-screen-IjQOks0s.js";import"./useQueries-Bs7-L_2j.js";import"./kbd-PiHV4odS.js";import"./avatar-BgqBWztU.js";import"./chevron-left-CliOUq1O.js";import"./menu-znX-3dzE.js";import"./circle-help-DJ-Mtycd.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,aB as T,B as d,aI as C,bm as j,bk as N,d as $,ad as k,a7 as A,bC as E,bX as f,bY as _,bZ as M,a as P,c as W,r as l,a2 as z,aw as x,ax as p,u as O,ac as B}from"./index-BZ4sAts4.js";import{B as h,u as L}from"./useResultFolderIndex-BvBtm4F3.js";import{B as y}from"./badge-BVw5vgFN.js";import{C as S}from"./circle-check-CBDdVMl8.js";import{C as q}from"./copy-DMRh3Rb2.js";import{E as D}from"./external-link-B_11YPnQ.js";import{f as U}from"./ErrorState-nIG-x-Zh.js";import{a as F}from"./sections-B9pteMHc.js";import{w as G}from"./help-copy-bU0rZqtx.js";import{S as H}from"./settings-screen-C8kBB2kR.js";import"./useQueries-B-X1sW9_.js";import"./kbd-5V1_yqOW.js";import"./avatar-CQq2GZz9.js";import"./chevron-left-DUh7xA0y.js";import"./menu-DXmZUEBa.js";import"./circle-help-CP1s-Yi3.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(k,{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-Bn8n_AsE.js"></script>
38
+ <script type="module" crossorigin src="/assets/index-BZ4sAts4.js"></script>
39
39
  <link rel="stylesheet" crossorigin href="/assets/index-CqMlmBtY.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.685",
3
+ "version": "0.0.686",
4
4
  "description": "Built Remit web client — static assets and the default runtime config.",
5
5
  "files": [
6
6
  "**/*"
@@ -1 +0,0 @@
1
- import{eM as U,r as n,e4 as $,a as le,J as z,c$ as ce,aw as ue,ax as ge,j as r}from"./index-Bn8n_AsE.js";import{y as he,A as me,ao as pe,aq as fe,aA as xe,ar as Ie,d as Te,M as ye,ax as ve,aB as be,az as Re,m as Ce,G as Se,K as _,J as we,H as je,e as Fe,V as Me,W as H,X as Oe,Z as X,_ as Z,$ as ke,a0 as Pe,a1 as Le}from"./MessageToolbar-BW852rJj.js";import{u as Ae,l as Ne,b as De,a as qe}from"./MailViewChrome-D66Dcy3c.js";import"./nav-link-CtuHya9S.js";import{a as Ee}from"./useMessageBodyContent-lqVkO1fM.js";import{e as Be,f as We}from"./search-token-index-BSaB7qLo.js";import{d as Qe,g as ze,r as He}from"./reply-DmpF7cgR.js";import{u as Ke}from"./sections-DwdsQ0ad.js";import{u as Ve}from"./useMediaQuery-C00TiD5k.js";import{u as Ge,p as J,R as _e}from"./MessageBody-CDTfM1lc.js";import{d as Je,w as Ue}from"./wizard-selection-zWa1qc6-.js";import{f as $e}from"./ErrorState-BXxvOnci.js";const K=t=>({...t,starred:!0,order:"desc"}),Xe=(t={})=>$({query:K(t)});function Y(t={}){const{data:e,isLoading:s,isError:a,error:i,refetch:f,fetchNextPage:l,hasNextPage:g,isFetchingNextPage:o}=Ae({queryKey:Xe(t),queryFn:async({pageParam:x})=>{const{data:u}=await U({query:{...K(t),continuationToken:x},throwOnError:!0});return u},initialPageParam:void 0,getNextPageParam:x=>x.continuationToken,staleTime:6e4});return{threads:n.useMemo(()=>(e?.pages??[]).flatMap(x=>x.items??[]),[e]),isLoading:s,isError:a,error:i,refetch:f,fetchNextPage:l,hasNextPage:g,isFetchingNextPage:o}}function Ze(t={}){const e={...K(t),unread:!0,count:!0,results:!1},{data:s}=le({queryKey:$({query:e}),queryFn:async()=>{const{data:a}=await U({query:e,throwOnError:!0});return a},staleTime:6e4});return s?.count}const Ye=["from","subject","category","unread","starred","attachments"],et=(t,e)=>{const s=he(t),{params:a,residual:i}=me(e,{...s,starred:!0},Ye);return{criteria:{...a,...s},residual:i}};function tt({rows:t,verb:e}){const{selectedIds:s,exitSelection:a}=Re(),i=n.useMemo(()=>Ue(t,s),[t,s]);return r.jsx(Ce,{verb:e,selection:i,selectionRestriction:"spansAccounts",onFinished:a})}function st({selectedMessageId:t,onOpenThread:e,commandsRef:s,onTriageContextChange:a,onDeleteMessages:i}){const{searchQuery:f,resultFolderIndex:l,onSearchClearQuery:g}=z(),o=Ge(),k=Ve(),x=ce(),[u,h]=n.useState("all"),[v,P]=n.useState(new Set),S=n.useCallback(d=>{P(C=>{const I=new Set(C);return I.has(d)?I.delete(d):I.add(d),I})},[]),w=n.useCallback(()=>{h("all"),P(new Set)},[]),T=n.useCallback(()=>{w(),g()},[w,g]),{freeText:j,tokens:b}=J(f.trim().toLowerCase(),o),L=J(f.trim(),o).freeText,{criteria:A,residual:m}=n.useMemo(()=>et({category:u,attributes:v},b),[u,v,b]),F=n.useMemo(()=>j?{...A,query:j}:A,[A,j]),{threads:N,isLoading:D,isError:y,error:E,refetch:M,fetchNextPage:B,hasNextPage:W,isFetchingNextPage:O}=Y(F),p=n.useMemo(()=>Je(N).map(pe).filter(d=>fe(d,m)),[N,m]),c=n.useCallback((d,C)=>{const I=p.find(de=>de.id===d)?.threadId;I&&e?.({threadId:I,messageId:d},C)},[p,e]),R=n.useCallback(d=>{const C=d.threadId??p.find(I=>I.id===d.id)?.threadId;C&&e?.({threadId:C,messageId:d.id})},[p,e]),Q=n.useMemo(()=>xe(),[]),se=n.useMemo(()=>p.map(d=>Ie(d,l)),[p,l]),ae=Ze(F)??null,re=n.useMemo(()=>b.filter(d=>d.type!=="isStarred"),[b]),oe=Ne({chips:{category:u,attributes:v},tokens:re,reach:m.length>0?"loaded-pages":"whole-folder",onClear:T}),V=D?"loading":y?"error":p.length===0?"empty":"ready",ne=n.useCallback(()=>{const d=ue(ge());window.open(d,"_blank","noopener,noreferrer")},[]),G=Te(),ie=r.jsx("div",{className:"flex h-full min-h-0 flex-col",children:r.jsxs("div",{className:"flex-1 overflow-y-auto",children:[r.jsx("div",{className:"divide-y divide-line",children:p.map(d=>r.jsx(ye,{thread:d,active:d.id===t,onClick:()=>c(d.id)},d.id))}),W?r.jsx("button",{type:"button",className:"w-full py-3 text-sm text-muted hover:text-fg disabled:opacity-50",onClick:()=>B(),disabled:O,children:O?"Loading…":"Load more"}):null]})});return r.jsx(De,{title:"Starred",unreadCount:ae,preset:Q,selectedCategory:u,activeFilters:v,onSelectCategory:h,onToggleFilter:S,onClearFilters:w,searchResults:se,searchLoading:D,onSelectSearchResult:R,searchResultsInBody:!0,children:r.jsxs(ve,{selectedMessageId:t,rows:p,onOpen:c,onDeleteMessages:i,onSelectionVerb:x.start,commandsRef:s,onTriageContextChange:a,children:[r.jsx(qe,{listTitle:"Starred",sections:[{id:"flagged",threads:p}],flatList:!0,hideHeader:!0,listState:G.searchResults?"ready":V,listFilter:oe,listScopeLabel:"Starred",searchQuery:L||void 0,errorMessage:y?$e(E):void 0,onRetry:()=>M(),onReportError:ne,selectedThreadId:t,onSelectThread:c,isDesktop:k,selectionBar:r.jsx(be,{title:"Starred"}),listBody:G.searchResults??(V==="ready"?ie:void 0)}),r.jsx(tt,{rows:p,verb:x.verb})]})})}const ee=n.createContext(null);function q(){const t=n.useContext(ee);if(!t)throw new Error("FlaggedPane.* must be used inside <FlaggedPane>");return t}function at({thread:t,children:e}){const s=Be(),a=We(),i=Ke(),{searchInput:f}=z(),l=t?.threadId,g=t?.messageId,{threads:o}=Y(),k=n.useMemo(()=>{if(l)return o.find(c=>c.messageId===g)??o.find(c=>c.threadId===l)},[o,l,g]),x=Se(l,g),u=k??x,h=g??u?.messageId,v=n.useMemo(()=>{if(l)return{threadId:l,mailboxId:u?.mailboxId??"",subject:u?.subject,messageId:h,authenticity:u?.authenticity}},[l,u,h]),P=n.useCallback((c,R)=>{s(c,{replace:R?.replace,query:f})},[s,f]),S=n.useCallback(c=>{h&&c.includes(h)&&a()},[h,a]),w=_({thread:u,isOpen:!0,onAfterOptimisticRemove:S}),T=we(),{deleteMessages:j}=je({mailboxId:u?.mailboxId??"",messages:o,onAfterOptimisticRemove:S}),{toggleReadFor:b}=Fe({mailboxId:u?.mailboxId??"",messages:o}),L=T.focusedMessageId,m=n.useMemo(()=>o.find(c=>c.messageId===L),[o,L])??u,F=_({thread:m,isOpen:m?.messageId===h}),N=Ee(),D=Qe(),y=ze(),E=n.useMemo(()=>He(y,l,h),[y,l,h]),M=n.useMemo(()=>{if(m)return c=>y({threadId:m.threadId,messageId:m.messageId,mode:c})},[y,m]),{nextMessageId:B,previousMessageId:W}=Me({context:T,orderedIds:T.orderedIds,selectedMessageId:h,enabled:!N&&!D,hasOpenThread:l!==void 0,onClose:a,handlers:{reply:()=>M?.("reply"),replyAll:()=>M?.("reply-all"),forward:()=>M?.("forward"),delete:()=>{T.listCommandsRef.current?.requestVerb("delete")||F.deleteThread()},toggleStar:F.toggleStar,toggleRead:()=>{T.listCommandsRef.current?.requestVerb("markRead")||m&&b([m.messageId],!m.isRead)},goBrief:()=>i("brief"),goSettings:()=>i("settings")}}),O=n.useCallback(c=>{if(!c)return;const R=o.find(Q=>Q.messageId===c);return R?{threadId:R.threadId,messageId:c}:void 0},[o]),p={selectedMessageId:h,selectedThread:u,conversation:v,onOpenThread:P,onCloseThread:a,nextThread:O(B),previousThread:O(W),actions:w,onReply:E,triage:T,onDeleteMessages:j,handleDeselectIfRemoved:S};return r.jsx(ee.Provider,{value:p,children:e})}function te(){const{selectedMessageId:t,onOpenThread:e,triage:s,onDeleteMessages:a}=q();return r.jsx(st,{selectedMessageId:t,onOpenThread:e,commandsRef:s.listCommandsRef,onTriageContextChange:s.onTriageContextChange,onDeleteMessages:a})}function rt(){const t=H(),{conversation:e,selectedThread:s,actions:a,onReply:i,handleDeselectIfRemoved:f,onOpenThread:l}=q(),g=!!e,o=Pe(e?.threadId);return r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[r.jsx(Le,{hasThread:g,intelligenceOpen:o.isShowing,canToggleIntelligence:o.canToggle,onToggleIntelligence:o.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:g?a.deleteThread:void 0,onToggleStar:g?a.toggleStar:void 0,isStarred:a.isStarred,moveContext:g&&a.accountId&&a.mailboxId?{accountId:a.accountId,currentMailboxId:a.mailboxId,onMove:a.moveThread}:void 0}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?r.jsx(X,{threadId:e.threadId,mailboxId:e.mailboxId,subject:e.subject,selectedMessageId:e.messageId,authenticity:e.authenticity,onOpenIntelligence:o.open,listOnScreen:!0}):r.jsx(_e,{})})]}),r.jsx(Z,{isOpen:o.drawerOpen,onClose:o.closeDrawer,thread:s,accountId:s?.accountId,onAfterOptimisticRemove:f,onReplyWithText:t,onOpenThread:l})]})}function ot(){const t=H(),{selectedThread:e,handleDeselectIfRemoved:s,onOpenThread:a}=q(),{onToggleIntelligence:i}=z();return r.jsx(ke,{onClose:i,thread:e,accountId:e?.accountId,onAfterOptimisticRemove:s,onReplyWithText:t,onOpenThread:a})}function nt(){const t=H(),{selectedThread:e,conversation:s,onCloseThread:a,onOpenThread:i,nextThread:f,previousThread:l,handleDeselectIfRemoved:g}=q(),o=Oe(s?.threadId??null);return s?r.jsxs(r.Fragment,{children:[r.jsx(X,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:a,onOpenIntelligence:o.toggle,onSwipeNext:f?()=>i(f):void 0,onSwipePrevious:l?()=>i(l):void 0,mobileIntelligenceOpen:o.isOpen}),r.jsx(Z,{isOpen:o.isOpen,onClose:o.close,thread:e,accountId:e?.accountId,onAfterOptimisticRemove:g,onReplyWithText:t,onOpenThread:i})]}):r.jsx("div",{className:"h-full",children:r.jsx(te,{})})}const Tt=Object.assign(at,{List:te,Reading:rt,Intelligence:ot,Phone:nt});export{Tt as F};