@remit/web-client-dist 0.0.626 → 0.0.628

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/assets/{BriefPane-_14jyTNU.js → BriefPane-tHzUzzx1.js} +1 -1
  2. package/assets/{CalendarComposePane-CvXktapf.js → CalendarComposePane-DfWDnSVI.js} +1 -1
  3. package/assets/{CalendarComposeSeed-CifBLPSk.js → CalendarComposeSeed-DH5mZaIr.js} +1 -1
  4. package/assets/{CalendarShell-CQKMfTHS.js → CalendarShell-B69HL1Vn.js} +1 -1
  5. package/assets/{EmptyState-DFn4LB7J.js → EmptyState-28oCa06N.js} +1 -1
  6. package/assets/{ErrorState-wz9YaOol.js → ErrorState-BzYqAQcg.js} +1 -1
  7. package/assets/{FlaggedPane-CGhj--Hm.js → FlaggedPane-FDV2sAhQ.js} +1 -1
  8. package/assets/{FullCompose-ChHG83dJ.js → FullCompose-DJNGdM6H.js} +1 -1
  9. package/assets/{MailListHeader-DfOCZnRx.js → MailListHeader-DvOWAj7-.js} +2 -2
  10. package/assets/{MailNav-CjfpinUe.js → MailNav-c2yINVkf.js} +1 -1
  11. package/assets/{MailShell-C1jECwgj.js → MailShell--9aT3BGW.js} +1 -1
  12. package/assets/{MailViewChrome-XZUEJlo5.js → MailViewChrome-BAdVRGhG.js} +1 -1
  13. package/assets/{MailboxPane-Czwm70WW.js → MailboxPane-Cvh0G1l2.js} +1 -1
  14. package/assets/{NavMenuButton-DeFLPsFB.js → NavMenuButton-BkuW2f2_.js} +1 -1
  15. package/assets/{OnboardingWizard-B-CFGg5s.js → OnboardingWizard-CalyNM8V.js} +1 -1
  16. package/assets/OpenCalendarEvent-TTnwIIyV.js +2 -0
  17. package/assets/{OutboxPane-HIJT_kwS.js → OutboxPane-D8zYXC_h.js} +1 -1
  18. package/assets/_calendarObjectId-DqvyUPbd.js +1 -0
  19. package/assets/_mailboxId-B5uTqd_A.js +1 -0
  20. package/assets/_messageId-BaTU4Qh8.js +1 -0
  21. package/assets/_messageId-DOYmBloa.js +1 -0
  22. package/assets/_messageId-M7jqBTxZ.js +1 -0
  23. package/assets/_outboxMessageId-B4gATrDu.js +1 -0
  24. package/assets/_recurrenceId-C6vHv8g0.js +1 -0
  25. package/assets/_threadId-40dUXZDK.js +1 -0
  26. package/assets/_threadId-W0xEPNq7.js +1 -0
  27. package/assets/_threadId-usCXu9pW.js +1 -0
  28. package/assets/_view._date-Blp0nEoE.js +1 -0
  29. package/assets/{accounts-UiS1FK2e.js → accounts-C1vLHE6M.js} +1 -1
  30. package/assets/{advanced-LKQZxDeW.js → advanced-S_vwbT38.js} +1 -1
  31. package/assets/{appearance-Csl0uD9E.js → appearance-C8xToJJQ.js} +1 -1
  32. package/assets/{attendee-row-BhqXy1fZ.js → attendee-row-DzVGYTJn.js} +1 -1
  33. package/assets/{avatar-Dq9zVRVl.js → avatar-BfRzACAd.js} +1 -1
  34. package/assets/{bell-off-zJIQc-fQ.js → bell-off-BGNttWrY.js} +1 -1
  35. package/assets/{bottom-sheet-CqUVoKvb.js → bottom-sheet-DLdGdNT_.js} +1 -1
  36. package/assets/brief-B8Maf2nT.js +1 -0
  37. package/assets/{brief-i89ZY7Gu.js → brief-BfNVHwc8.js} +1 -1
  38. package/assets/{browser-ponyfill-32LE6w6g.js → browser-ponyfill-BSP7q0CW.js} +1 -1
  39. package/assets/{bug-BX9QtfhB.js → bug-VvRcGYKb.js} +1 -1
  40. package/assets/{calendar-DLPNVzNq.js → calendar-BTrztmC9.js} +1 -1
  41. package/assets/{calendar-clash-strip-Bid2cYhz.js → calendar-clash-strip-D0oSgsYp.js} +1 -1
  42. package/assets/{calendar-format-M4S5xU7P.js → calendar-format-Cuk-IqMF.js} +1 -1
  43. package/assets/calendar-report-BP6aGPQB.js +1 -0
  44. package/assets/calendar-suggestion-DRetUYmN.js +1 -0
  45. package/assets/{calendars-D_kCUTOt.js → calendars-DKHAPwlL.js} +1 -1
  46. package/assets/{card-DgdelB3M.js → card-Bn8Hl7rv.js} +1 -1
  47. package/assets/chevron-left-2Pgm8rQs.js +1 -0
  48. package/assets/{circle-check-B0R88gmM.js → circle-check-DbWUDsDQ.js} +1 -1
  49. package/assets/{circle-check-big-DrhQmTbc.js → circle-check-big-_TJ-VjVx.js} +1 -1
  50. package/assets/{circle-help-Bh3n-6_h.js → circle-help-DjnTO-lQ.js} +1 -1
  51. package/assets/{clock-ByuYhL7c.js → clock-uaFy-j4_.js} +1 -1
  52. package/assets/compose._-_outboxMessageId_-BGlV_j4x.js +1 -0
  53. package/assets/compose._-_outboxMessageId_-DHGfeTdC.js +1 -0
  54. package/assets/compose._-_outboxMessageId_-DWih_4Y1.js +1 -0
  55. package/assets/compose._-_outboxMessageId_-DqUasn9w.js +1 -0
  56. package/assets/{config-import-Bugb2aMh.js → config-import-BfXysHsA.js} +1 -1
  57. package/assets/{confirm-dialog-D0wfxRPd.js → confirm-dialog-CxwxNGW_.js} +1 -1
  58. package/assets/{copy-baeOC0XH.js → copy-Ce9dPJUN.js} +1 -1
  59. package/assets/{credential-steps-DOdW-2H8.js → credential-steps-CSuwTPyr.js} +1 -1
  60. package/assets/{download-C79uP4C7.js → download-DndLNGVd.js} +1 -1
  61. package/assets/{file-json-CGQXrNbO.js → file-json-xCACRicJ.js} +1 -1
  62. package/assets/{filters-CAsK70Nx.js → filters-cKyjKiJX.js} +1 -1
  63. package/assets/flagged-BYjHNvav.js +1 -0
  64. package/assets/{flagged-uALUxb-O.js → flagged-C65tBcvn.js} +1 -1
  65. package/assets/{folders-Bx3SMw7d.js → folders-D4GtRo_k.js} +1 -1
  66. package/assets/{help-copy-C9SzNfoi.js → help-copy-DIony4zd.js} +1 -1
  67. package/assets/{import-BwX6jaiD.js → import-CG3doznc.js} +1 -1
  68. package/assets/index-BXcfGy1t.js +1 -0
  69. package/assets/index-BaTU4Qh8.js +1 -0
  70. package/assets/index-C1OT2u50.js +1 -0
  71. package/assets/index-CV3lav8x.js +1 -0
  72. package/assets/{index-UydO8d8c.js → index-CcbTB5sD.js} +4 -4
  73. package/assets/index-Cvv9ckN2.js +1 -0
  74. package/assets/index-DLVOTSNL.js +55 -0
  75. package/assets/index-DXDUYgt_.js +1 -0
  76. package/assets/index-DsVeiYQK.js +1 -0
  77. package/assets/{index-CLg2znEx.js → index-HuhbOhsZ.js} +1 -1
  78. package/assets/index-wkHQTfII.js +1 -0
  79. package/assets/index-zvrNCDcg.js +1 -0
  80. package/assets/{kbd-Dr4usi4j.js → kbd-C927jK4P.js} +1 -1
  81. package/assets/{labels-D22q095l.js → labels-DdHxlXiH.js} +1 -1
  82. package/assets/{mail-Db9OjHYL.js → mail-BGx3b4IE.js} +1 -1
  83. package/assets/{mail-CWdYkVJO.js → mail-CHF3I4M1.js} +1 -1
  84. package/assets/{menu-CbYnJN5U.js → menu-BlO9U_uh.js} +1 -1
  85. package/assets/{new-kq63OZ83.js → new-Cb3bUHQj.js} +1 -1
  86. package/assets/onboarding-DPUjf0wy.js +1 -0
  87. package/assets/{onboarding-completion-BlaYncdL.js → onboarding-completion-tC51Y0Qh.js} +1 -1
  88. package/assets/outbox-Cct9lTHi.js +1 -0
  89. package/assets/{pencil-u2t1F29A.js → pencil-C5Z2yWAL.js} +1 -1
  90. package/assets/{popover-menu--AoVAv-y.js → popover-menu-ySklKha2.js} +1 -1
  91. package/assets/{refresh-cw-Qp6f0dRu.js → refresh-cw-DYkfaCKh.js} +1 -1
  92. package/assets/{rich-text-D3RBxInX.js → rich-text-mV-FWtiq.js} +1 -1
  93. package/assets/{rich-text-spellcheck-worker-provider-9h-DIyCe.js → rich-text-spellcheck-worker-provider-DpOk3CBy.js} +1 -1
  94. package/assets/{rotate-ccw-SdroQT7m.js → rotate-ccw-Bo4Kjyvq.js} +1 -1
  95. package/assets/{roving-focus-BNBmBfAx.js → roving-focus-vUQMkWse.js} +1 -1
  96. package/assets/{row-actions-IPR7z5tr.js → row-actions-ADKfMpto.js} +1 -1
  97. package/assets/{search-mirror-Cv2S0VbB.js → search-mirror-DNVnl0Bz.js} +1 -1
  98. package/assets/{search-token-index-AOAqpH15.js → search-token-index-BYHoSA7d.js} +1 -1
  99. package/assets/{sections-EqJpt3TQ.js → sections-DYg5zJ6k.js} +1 -1
  100. package/assets/{senders-DnFn3aNI.js → senders-Dmg6lEiJ.js} +1 -1
  101. package/assets/settings-ChbjiVxx.js +1 -0
  102. package/assets/{settings-screen-WQb7kG5A.js → settings-screen-CeW5ksV6.js} +1 -1
  103. package/assets/{shield-check-D7EcTf9d.js → shield-check-DnptXaiX.js} +1 -1
  104. package/assets/{suggested-vips-QYhd7mHg.js → suggested-vips-DNYJx7cj.js} +1 -1
  105. package/assets/{undo-2-CveuEJjH.js → undo-2-Cgt6seFp.js} +1 -1
  106. package/assets/{useCalendarData-CMPLRued.js → useCalendarData-tOjD-sM9.js} +1 -1
  107. package/assets/{useCalendarWrites-BASehFYp.js → useCalendarWrites-CgwnlsLN.js} +1 -1
  108. package/assets/useCalendars-RTghAiMI.js +1 -0
  109. package/assets/{useDebouncedValue-Dt6rAAol.js → useDebouncedValue-aHAKoTFI.js} +1 -1
  110. package/assets/{useFilters-Bbcl4di_.js → useFilters-CrEu6ABm.js} +1 -1
  111. package/assets/{useLabels-DQs2z0T7.js → useLabels-DAY52Umi.js} +1 -1
  112. package/assets/{useLayoutTier-CF_kWPgV.js → useLayoutTier-DLwSx4uw.js} +1 -1
  113. package/assets/{useMessageBodyContent-DiiU1g37.js → useMessageBodyContent-DsJGPt91.js} +1 -1
  114. package/assets/{useQueries-CJUjXxvq.js → useQueries-BdXHQsH0.js} +1 -1
  115. package/assets/{useRefreshControl-BUZDaiTn.js → useRefreshControl-BHvXurmD.js} +1 -1
  116. package/assets/{useResultFolderIndex-D9ADFT-m.js → useResultFolderIndex-vej7cJKZ.js} +1 -1
  117. package/assets/{useSearchTokenContext-CBDSw3gJ.js → useSearchTokenContext-ByaKT82a.js} +3 -3
  118. package/assets/{useSemanticSearch-B7rQKIm8.js → useSemanticSearch-DTxWqPzH.js} +1 -1
  119. package/assets/{useSignature-DruMb0cI.js → useSignature-5UitVKwT.js} +1 -1
  120. package/index.html +1 -1
  121. package/package.json +1 -1
  122. package/assets/OpenCalendarEvent-DFERZRRh.js +0 -2
  123. package/assets/_calendarObjectId-CHrSuJ4j.js +0 -1
  124. package/assets/_mailboxId-Cx59NB_O.js +0 -1
  125. package/assets/_messageId-428jqG1g.js +0 -1
  126. package/assets/_messageId-BqS3jo2k.js +0 -1
  127. package/assets/_messageId-DLcoHrvg.js +0 -1
  128. package/assets/_outboxMessageId-DgbOcdNZ.js +0 -1
  129. package/assets/_recurrenceId-BNEK4esm.js +0 -1
  130. package/assets/_threadId-BpGxTAyH.js +0 -1
  131. package/assets/_threadId-DBQCQCIO.js +0 -1
  132. package/assets/_threadId-Li52F0Cd.js +0 -1
  133. package/assets/_view._date-CvSVriaI.js +0 -1
  134. package/assets/brief-CuAyGW-_.js +0 -1
  135. package/assets/calendar-suggestion-Dz1CYPKE.js +0 -1
  136. package/assets/chevron-left-Dd68kT1Y.js +0 -1
  137. package/assets/compose._-_outboxMessageId_-CJP6aGKp.js +0 -1
  138. package/assets/compose._-_outboxMessageId_-CMXTsNxj.js +0 -1
  139. package/assets/compose._-_outboxMessageId_-DIUaW_Wi.js +0 -1
  140. package/assets/compose._-_outboxMessageId_-ZpGAMi--.js +0 -1
  141. package/assets/flagged-CEg9zmAF.js +0 -1
  142. package/assets/index-B_wiLLnW.js +0 -1
  143. package/assets/index-BulHQ3Bz.js +0 -1
  144. package/assets/index-Bz3z8-Ud.js +0 -1
  145. package/assets/index-Caogy7TQ.js +0 -1
  146. package/assets/index-Cfb74LIY.js +0 -1
  147. package/assets/index-CvxW8FM1.js +0 -1
  148. package/assets/index-Cy75NEgh.js +0 -1
  149. package/assets/index-D4ZeuNuq.js +0 -55
  150. package/assets/index-DLcoHrvg.js +0 -1
  151. package/assets/index-DmMeuJEG.js +0 -1
  152. package/assets/map-pin-HJKJCWdt.js +0 -1
  153. package/assets/onboarding-DXy2aNhI.js +0 -1
  154. package/assets/outbox-CT3Ok2c-.js +0 -1
  155. package/assets/settings-CNMUput2.js +0 -1
  156. package/assets/useCalendars-DR1_eTjS.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as h,j as a,cu as Y,t as b,I as X,h as Z,at as J,i as ee,av as te,cM as se,bS as re,ab as ne,a0 as ae,X as oe,d5 as _,d6 as I,C as ie,co as ce}from"./index-UydO8d8c.js";import{K as A}from"./kbd-Dr4usi4j.js";import{B as le,b as de}from"./useMessageBodyContent-DiiU1g37.js";import{i as ue}from"./search-scope-B5-OK3Cq.js";const me='"Geist Variable", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',k={light:{fg:"oklch(0.3 0.025 235)",canvas:"oklch(0.96 0.015 90)",accent:"oklch(0.55 0.14 150)"},dark:{fg:"oklch(0.88 0.02 90)",canvas:"oklch(0.22 0.025 220)",accent:"oklch(0.78 0.16 150)"}},fe={background:!1,spacing:!1},he="16px",ge=()=>`html{padding:0}body{padding:${he};box-sizing:border-box}`,pe=()=>"html{overflow:hidden}body{overflow-x:auto}",be=/prefers-color-scheme\s*:\s*dark|color-scheme\s*:\s*[^;}"']*\bdark\b/i,ye='<meta name="viewport" content="width=device-width, initial-scale=1">',xe=e=>{const t=e?k.dark:k.light;return`
1
+ import{r as h,j as a,cu as Y,t as b,I as X,h as Z,at as J,i as ee,av as te,cN as se,bS as re,ab as ne,a0 as ae,X as oe,d6 as _,d7 as I,C as ie,co as ce}from"./index-CcbTB5sD.js";import{K as A}from"./kbd-C927jK4P.js";import{B as le,b as de}from"./useMessageBodyContent-DsJGPt91.js";import{i as ue}from"./search-scope-B5-OK3Cq.js";const me='"Geist Variable", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',k={light:{fg:"oklch(0.3 0.025 235)",canvas:"oklch(0.96 0.015 90)",accent:"oklch(0.55 0.14 150)"},dark:{fg:"oklch(0.88 0.02 90)",canvas:"oklch(0.22 0.025 220)",accent:"oklch(0.78 0.16 150)"}},fe={background:!1,spacing:!1},he="16px",ge=()=>`html{padding:0}body{padding:${he};box-sizing:border-box}`,pe=()=>"html{overflow:hidden}body{overflow-x:auto}",be=/prefers-color-scheme\s*:\s*dark|color-scheme\s*:\s*[^;}"']*\bdark\b/i,ye='<meta name="viewport" content="width=device-width, initial-scale=1">',xe=e=>{const t=e?k.dark:k.light;return`
2
2
  /* Plain-email base: UI font-stack + theme-aware colors (#424) */
3
3
  html, body {
4
4
  font-family: ${me};
@@ -74,11 +74,11 @@ pre, code {
74
74
  :is(pre, code, pre *, code *):is([nowrap], [style*="nowrap" i]) {
75
75
  white-space: pre-wrap !important;
76
76
  }
77
- `,je=e=>{const t=new Map;for(const s of e){if(!s.contentId||s.contentUrl.length===0)continue;const r=s.contentId.replace(/^<|>$/g,"");t.set(r,s.contentUrl)}return s=>t.get(s.replace(/^<|>$/g,""))},Le=/^(none|transparent|inherit|initial|unset)\s*$/i,$=e=>{const t=[],s=/<style[^>]*>([\s\S]*?)<\/style>/gi;let r;for(r=s.exec(e);r!==null;)t.push(r[1]),r=s.exec(e);return t},Re=e=>{const t=/background(?:-color)?\s*:\s*([^;}\n]+)/gi;let s;for(s=t.exec(e);s!==null;){const r=s[1].trim();if(!Le.test(r))return!0;s=t.exec(e)}return!1},_e=e=>{if(/\bstyle\s*=\s*["'][^"']*background/i.test(e)||/\bbgcolor\s*=/i.test(e))return!0;for(const t of $(e))if(Re(t))return!0;return!1},Ie=new Set(["auto","none","initial","inherit","unset","revert","revert-layer"]),$e=new RegExp(`(?<![-\\w])(?:padding|margin)(?:-(top|right|bottom|left|block|inline)(?:-(?:start|end))?)?\\s*:\\s*([^;}"']+)`,"gi"),Be=new Set(["top","bottom","block"]),B=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),T=e=>{const t=e.toLowerCase();if(!t||Ie.has(t)||t.startsWith("-"))return!1;const s=/^\+?(\d*\.?\d+)[a-z%]*$/.exec(t);return s?Number.parseFloat(s[1])!==0:!0},Me=e=>{const t=e.split(/\s+/).filter(Boolean);return t.length<2?t:t.length<4?[t[1]]:[t[1],t[3]]},Oe=(e,t)=>{if(e&&Be.has(e))return!1;const s=t.replace(/!\s*important/gi,"").trim();return s?e?s.split(/\s+/).some(T):Me(s).some(T):!1},j=e=>{for(const t of B(e).matchAll($e))if(Oe(t[1],t[2]))return!0;return!1},M=new Set(["blockquote"]),De=e=>e.replace(/<!--[\s\S]*?-->/g,""),ze=e=>{const t=[],s=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,r=/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;for(const[,n,o]of e.matchAll(s))for(const d of o.matchAll(r))t.push({tag:n.toLowerCase(),style:d[1]??d[2]??""});return t},Pe=e=>[...B(e).matchAll(/([^{}]*)\{([^{}]*)\}/g)].map(t=>({selector:t[1].trim(),body:t[2]})),Ke=e=>{const t=e.trim().split(/[\s>+~]+/).pop()??"";return(/^[a-zA-Z][\w-]*/.exec(t)?.[0]??"").toLowerCase()},Fe=e=>e.split(",").every(t=>M.has(Ke(t))),He=e=>{const t=$(e),s=De(e);if(/\bcellpadding\s*=\s*["']?(?!0["'\s>])\d/i.test(s))return!0;for(const{tag:r,style:n}of ze(s))if(!M.has(r)&&j(n))return!0;for(const r of t)for(const n of Pe(r))if(!Fe(n.selector)&&j(n.body))return!0;return!1},Ge=["script","iframe","object","embed","form","input","button","textarea","select","meta","link","base"],Ue=["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur","onsubmit","onkeydown","onkeyup","formaction","xlink:href","data-bind"],We="data:image/svg+xml,"+encodeURIComponent(`
77
+ `,je=e=>{const t=new Map;for(const s of e){if(!s.contentId||s.contentUrl.length===0)continue;const r=s.contentId.replace(/^<|>$/g,"");t.set(r,s.contentUrl)}return s=>t.get(s.replace(/^<|>$/g,""))},Le=/^(none|transparent|inherit|initial|unset)\s*$/i,$=e=>{const t=[],s=/<style[^>]*>([\s\S]*?)<\/style>/gi;let r;for(r=s.exec(e);r!==null;)t.push(r[1]),r=s.exec(e);return t},Re=e=>{const t=/background(?:-color)?\s*:\s*([^;}\n]+)/gi;let s;for(s=t.exec(e);s!==null;){const r=s[1].trim();if(!Le.test(r))return!0;s=t.exec(e)}return!1},_e=e=>{if(/\bstyle\s*=\s*["'][^"']*background/i.test(e)||/\bbgcolor\s*=/i.test(e))return!0;for(const t of $(e))if(Re(t))return!0;return!1},Ie=new Set(["auto","none","initial","inherit","unset","revert","revert-layer"]),$e=new RegExp(`(?<![-\\w])(?:padding|margin)(?:-(top|right|bottom|left|block|inline)(?:-(?:start|end))?)?\\s*:\\s*([^;}"']+)`,"gi"),Be=new Set(["top","bottom","block"]),B=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),T=e=>{const t=e.toLowerCase();if(!t||Ie.has(t)||t.startsWith("-"))return!1;const s=/^\+?(\d*\.?\d+)[a-z%]*$/.exec(t);return s?Number.parseFloat(s[1])!==0:!0},Oe=e=>{const t=e.split(/\s+/).filter(Boolean);return t.length<2?t:t.length<4?[t[1]]:[t[1],t[3]]},Me=(e,t)=>{if(e&&Be.has(e))return!1;const s=t.replace(/!\s*important/gi,"").trim();return s?e?s.split(/\s+/).some(T):Oe(s).some(T):!1},j=e=>{for(const t of B(e).matchAll($e))if(Me(t[1],t[2]))return!0;return!1},O=new Set(["blockquote"]),De=e=>e.replace(/<!--[\s\S]*?-->/g,""),ze=e=>{const t=[],s=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,r=/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;for(const[,n,o]of e.matchAll(s))for(const d of o.matchAll(r))t.push({tag:n.toLowerCase(),style:d[1]??d[2]??""});return t},Pe=e=>[...B(e).matchAll(/([^{}]*)\{([^{}]*)\}/g)].map(t=>({selector:t[1].trim(),body:t[2]})),Ke=e=>{const t=e.trim().split(/[\s>+~]+/).pop()??"";return(/^[a-zA-Z][\w-]*/.exec(t)?.[0]??"").toLowerCase()},Fe=e=>e.split(",").every(t=>O.has(Ke(t))),He=e=>{const t=$(e),s=De(e);if(/\bcellpadding\s*=\s*["']?(?!0["'\s>])\d/i.test(s))return!0;for(const{tag:r,style:n}of ze(s))if(!O.has(r)&&j(n))return!0;for(const r of t)for(const n of Pe(r))if(!Fe(n.selector)&&j(n.body))return!0;return!1},Ge=["script","iframe","object","embed","form","input","button","textarea","select","meta","link","base"],Ue=["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur","onsubmit","onkeydown","onkeyup","formaction","xlink:href","data-bind"],We="data:image/svg+xml,"+encodeURIComponent(`
78
78
  <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
79
79
  <rect fill="#f0f0f0" width="100" height="100"/>
80
80
  <text x="50" y="50" text-anchor="middle" dy=".3em" fill="#999" font-size="12">
81
81
  Image blocked
82
82
  </text>
83
83
  </svg>
84
- `),Ve=e=>e.replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Qe=e=>e.replace(/@import[^;]*;/gi,"/* @import blocked */").replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),qe=(e={})=>{const t=Y(),s={FORBID_TAGS:Ge,FORBID_ATTR:Ue,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1};return t.addHook("afterSanitizeAttributes",r=>{if(e.allowExternalImages||(r.tagName==="IMG"&&r.removeAttribute("srcset"),r.tagName==="SOURCE"&&(r.removeAttribute("srcset"),r.removeAttribute("src")),r.tagName==="VIDEO"&&r.removeAttribute("poster")),r.tagName==="IMG"){const n=r.getAttribute("src")||"";if(n.startsWith("data:"))return;if(n.startsWith("cid:")){const d=n.slice(4).replace(/^<|>$/g,""),g=e.resolveCid?.(d);g&&(r.setAttribute("src",g),r.classList.add("inline-content"));return}e.allowExternalImages||(r.setAttribute("data-blocked-src",n),r.setAttribute("src",We),r.setAttribute("alt","[Blocked image]"),r.classList.add("blocked-image"))}if(r.tagName==="A"){const n=r.getAttribute("href")||"";if(/^(javascript|data):/i.test(n)){r.removeAttribute("href");return}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer nofollow"),r.classList.add("external-link")}if(r.hasAttribute("style")){const n=r.getAttribute("style")||"";r.setAttribute("style",Ve(n))}}),t.addHook("uponSanitizeElement",(r,n)=>{if(n.tagName==="style"){const o=r.textContent||"";r.textContent=Qe(o)}}),r=>{const n=_e(r),o=He(r),d=t.sanitize(r,s);return{html:`<style>${Te()}</style>${d}`,hasAuthorBackground:n,hasAuthorSpacing:o}}},L=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Et=({className:e,children:t})=>a.jsx("div",{className:b("[&_.message-body-frame]:-mx-2 lg:[&_.message-body-frame]:-mx-4",e),children:t}),Ye=({html:e,text:t,isDark:s=!1,category:r,allowImages:n=!1,resolveCid:o,className:d,renderBlockedNotice:g})=>{const i=h.useMemo(()=>!e||typeof document>"u"?null:qe({allowExternalImages:n,resolveCid:o})(e),[e,n,o]),c=i?.html??null,{framed:u,isPlain:m}=Ce(r,i?.hasAuthorBackground??!1),f=h.useMemo(()=>({background:i?.hasAuthorBackground??!1,spacing:i?.hasAuthorSpacing??!1}),[i?.hasAuthorBackground,i?.hasAuthorSpacing]),p=h.useMemo(()=>!c||n?0:(c.match(/data-blocked-src/g)||[]).length,[c,n]);return!c&&!t?a.jsx("div",{className:b("message-body",d),children:a.jsx(L,{})}):a.jsxs("div",{className:b("message-body",d),children:[p>0&&a.jsx("div",{children:g?.(p)}),c?a.jsx("div",{className:"message-body-frame",children:u?a.jsx("div",{className:"w-full max-w-full",children:a.jsx(C,{html:c,variant:"framed",isDark:s,declares:f})}):a.jsx("div",{className:"max-w-full lg:max-w-2xl",children:a.jsx(C,{html:c,variant:m?"plain":"framed",isDark:s,declares:f})})}):t?a.jsx("pre",{className:"email-text whitespace-pre-wrap text-sm leading-relaxed",children:t}):a.jsx(L,{})]})};function Nt({message:e="Select a thread to read",icon:t,showHints:s=!0,className:r}){return a.jsxs("div",{className:b("flex flex-1 flex-col items-center justify-center text-center",r),children:[t??a.jsx(X,{className:"size-10 text-fg-subtle"}),a.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:e}),s&&a.jsxs("p",{className:"text-2xs text-fg-subtle",children:[a.jsx(A,{children:"j"})," / ",a.jsx(A,{children:"k"})," to move, ",a.jsx(A,{children:"Enter"})," to open"]})]})}function O(e){const t=[];let s=-1,r=!1;for(let n=0;n<e.length;n++){const o=e[n];if(o==='"'){r=!r,s<0&&(s=n);continue}if(!r&&/\s/.test(o)){s>=0&&t.push({raw:e.slice(s,n),start:s,end:n}),s=-1;continue}s<0&&(s=n)}return s>=0&&t.push({raw:e.slice(s),start:s,end:e.length}),t}const Xe=e=>{if(!e.startsWith('"'))return e;const t=e.slice(1);return t.endsWith('"')?t.slice(0,-1):t};function Ze(e){const t=e.indexOf(":");if(t<=0)return;const s=e.slice(t+1);return{name:e.slice(0,t).toLowerCase(),value:Xe(s),rawValue:s}}const Je=e=>/[\s"]/.test(e),et=e=>Je(e)?`"${e.replace(/"/g,"")}"`:e,Ct=(e,t)=>`${e}:${et(t)}`,D=(e,t=Date.now())=>({value:e,setAt:t}),tt=(e,t,s,r)=>{if(e.addressId!==t)return e;const n={...e.flags??{}};return s?n.trusted=D(!0,r):delete n.trusted,{...e,flags:n}},st=(e,t,s,r)=>{const n=o=>o.map(d=>tt(d,t,s,r));return{...e,envelope:{...e.envelope,from:n(e.envelope.from),to:n(e.envelope.to),cc:n(e.envelope.cc),bcc:n(e.envelope.bcc),replyTo:n(e.envelope.replyTo)}}},rt=({messageId:e})=>{const t=Z(),{pushError:s}=J(),{mutate:r,isPending:n,error:o,reset:d}=ee({...re(),onMutate:async i=>{const c=i.path.addressId,m=i.body.flags?.trusted?.value===!0,f=se({path:{messageId:e}});await t.cancelQueries({queryKey:f});const p=t.getQueriesData({queryKey:f}).filter(l=>l[1]!==void 0).map(([l,x])=>({queryKey:l,data:x}));return t.setQueriesData({queryKey:f},l=>l&&st(l,c,m)),{describePrefix:f,previous:p}},onError:(i,c,u)=>{if(u)for(const m of u.previous)t.setQueryData(m.queryKey,m.data);s(te("Couldn't trust sender","The change wasn't saved.",i))},onSettled:(i,c,u,m)=>{m&&t.invalidateQueries({queryKey:m.describePrefix})}});return{toggleTrusted:(i,c)=>{r({path:{addressId:i},body:{flags:{trusted:D(!c)}}})},isPending:n,error:o,reset:d}},nt=()=>{const[e,t]=h.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return h.useEffect(()=>{const s=document.documentElement,r=new MutationObserver(()=>{t(s.classList.contains("dark"))});return r.observe(s,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e},at=(e,t)=>{const s=`${e} image${e>1?"s":""}`;return t?`${s} hidden — you blocked this sender`:`${s} blocked for privacy`},ot=({blockedImageCount:e,canAlwaysTrust:t,isTrustPending:s,isSenderBlocked:r,onLoadOnce:n,onAlwaysTrust:o})=>a.jsxs("div",{"data-testid":"blocked-images-notice",className:"mb-3 flex items-center justify-between rounded-md bg-surface-sunken/50 px-3 py-2 text-sm",children:[a.jsx("span",{className:"text-fg-muted",children:at(e,r)}),!r&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:n,className:"text-accent hover:underline",children:"Load once"}),t&&a.jsx("button",{type:"button",onClick:o,"aria-busy":s,className:"text-accent hover:underline aria-busy:opacity-50",children:s?"Trusting…":"Always trust"})]})]}),it=(e,t)=>{switch(e){case"auth":return{title:"Your session expired",detail:"Sign in again to reload the message body. Other parts of the app may also stop responding until you do."};case"body-missing":return{title:"Message body is missing in storage",detail:"A sync failure may have left this message without its body bytes. Contact support, or run the reconcile script to refetch from the upstream IMAP server."};case"content-type-mismatch":return{title:"Couldn't load message body",detail:"The server returned an unexpected content type for this part. The message body has not been rendered to keep you safe."};case"spa-shell-leak":return{title:"Couldn't load message body",detail:"The server returned the app shell instead of the message body. This is an infrastructure bug — please report it."};case"not-ready":return{title:"Message body is still syncing",detail:"This message's body hasn't finished downloading from the mail server yet. It should appear shortly — reopen the message to try again."};default:return{title:"Couldn't load message body",detail:t}}},ct=e=>e instanceof le?e.reason:"generic",lt=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while loading the message body.",dt=({error:e,onRetry:t})=>{const s=ct(e),r=lt(e),{title:n,detail:o}=it(s,r),[d,g]=h.useState(!1),{Account:i}=ne();return d?null:a.jsxs("div",{role:"alert","data-testid":"message-body-error-banner","data-reason":s,className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[a.jsx(ae,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-danger",children:n}),a.jsx("p",{className:"text-fg-muted mt-1 break-words",children:o})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s==="auth"&&a.jsx(i,{children:({signOut:c})=>a.jsx("button",{type:"button",onClick:()=>c(),className:"text-sm font-medium text-accent hover:underline",children:"Sign in again"})}),t&&a.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-accent hover:underline",children:"Retry"}),a.jsx("button",{type:"button",onClick:()=>g(!0),"aria-label":"Dismiss message body error",className:"rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors",children:a.jsx(oe,{className:"size-4","aria-hidden":"true"})})]})]})},ut=()=>a.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading message body",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"})]}),R=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Tt=({bodyParts:e,html:t,text:s,isTrusted:r=!1,isBlocked:n=!1,messageId:o,fromAddressId:d,category:g,className:i})=>{const[c,u]=h.useState(!1),[m,f]=h.useState(o);m!==o&&(f(o),u(!1));const p=!n&&(r||c),l=nt(),{toggleTrusted:x,isPending:w}=rt({messageId:o??""}),y=!!e&&e.length>0,{picked:z,data:v,isLoading:P,isError:K,error:F,refetch:H}=de({messageId:o,bodyParts:e,enabled:y}),G=h.useMemo(()=>je(e??[]),[e]),U=y&&v?.kind==="html"?v.body:t,W=y&&v?.kind==="text"?v.body:s;if(y){if(P)return a.jsx("div",{className:b("message-body",i),children:a.jsx(ut,{})});if(K)return a.jsx("div",{className:b("message-body",i),children:a.jsx(dt,{error:F,onRetry:()=>H()})});if(!z)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})})}else if(!t&&!s)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})});const V=!!(d&&o),Q=()=>{!d||w||(u(!0),x(d,!1))};return a.jsx(Ye,{className:i,html:U,text:W,isDark:l,category:g,allowImages:p,resolveCid:G,renderBlockedNotice:q=>a.jsx(ot,{blockedImageCount:q,canAlwaysTrust:V,isTrustPending:w,isSenderBlocked:n,onLoadOnce:()=>u(!0),onAlwaysTrust:Q})})},mt=Object.values(_).map(e=>({value:e,label:I[e]})),ft={unclassified:"uncategorized"},ht=[{name:"from",label:"Sender",values:"contact"},{name:"subject",label:"Subject",values:"text"},{name:"category",label:"Category",values:"fixed",options:mt},{name:"is",label:"State",values:"fixed",options:[{value:"unread",label:"Unread"},{value:"read",label:"Read"},{value:"starred",label:"Starred"}]},{name:"has",label:"Contents",values:"fixed",options:[{value:"attachment",label:"Has attachment"}]},{name:"in",label:"Folder",values:"mailbox"},{name:"account",label:"Account",values:"account"},{name:"after",label:"Sent on or after",values:"date"},{name:"before",label:"Sent before",values:"date"}],gt=new Map(ht.map(e=>[e.name,e])),jt=e=>gt.get(e.toLowerCase()),pt=/^\d{4}-\d{2}-\d{2}$/;function bt(e,t,s){if(!pt.test(s))return;const r=Date.parse(`${s}T00:00:00Z`);if(!Number.isNaN(r))return{type:e,raw:t,value:s,epochSeconds:Math.floor(r/1e3)}}function yt(e){const t=e.toLowerCase(),s=ft[t];return s||Object.values(_).find(n=>n===t)}function xt(e,t){switch(t.toLowerCase()){case"unread":return{type:"isUnread",raw:e};case"read":return{type:"isRead",raw:e};case"starred":case"flagged":return{type:"isStarred",raw:e};default:return}}function wt(e,t){const s=Ze(e);if(!s||s.value.length===0)return;const{name:r,value:n}=s;switch(r){case"from":return{type:"from",raw:e,value:n};case"subject":return{type:"subject",raw:e,value:n};case"category":{const o=yt(n);return o?{type:"category",raw:e,value:n,category:o}:void 0}case"is":return xt(e,n);case"has":return n.toLowerCase()==="attachment"?{type:"hasAttachment",raw:e}:void 0;case"before":case"after":return bt(r,e,n);case"in":{const o=t.mailboxesByName?.get(n.toLowerCase());return o?{type:"in",raw:e,value:n,mailboxId:o}:void 0}case"account":{const o=t.accountsByName?.get(n.toLowerCase());return o?{type:"account",raw:e,value:n,accountId:o}:void 0}default:return}}function Lt(e,t={}){const s=[],r=[];for(const n of O(e)){const o=wt(n.raw,t);o?s.push(o):r.push(n.raw)}return{freeText:r.join(" "),tokens:s}}function Rt(e,t){return O(e).filter(s=>s.raw!==t.raw).map(s=>s.raw).join(" ")}function _t(e){switch(e.type){case"from":return`From: ${e.value}`;case"subject":return`Subject: ${e.value}`;case"category":return`Category: ${I[e.category]}`;case"hasAttachment":return"Has attachment";case"isUnread":return"Unread";case"isRead":return"Read";case"isStarred":return"Starred";case"before":return`Before ${e.value}`;case"after":return`After ${e.value}`;case"in":return`In: ${e.value}`;case"account":return`Account: ${e.value}`}}function It(){const{mailboxNameIndex:e,accountNameIndex:t}=ie(),s=ce();return{...ue(s)?{}:{mailboxesByName:e},accountsByName:t}}export{Et as M,Nt as R,ht as S,Ye as a,rt as b,Tt as c,jt as d,O as e,Ze as f,Ct as g,Lt as p,Rt as r,_t as s,It as u};
84
+ `),Ve=e=>e.replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Qe=e=>e.replace(/@import[^;]*;/gi,"/* @import blocked */").replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),qe=(e={})=>{const t=Y(),s={FORBID_TAGS:Ge,FORBID_ATTR:Ue,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1};return t.addHook("afterSanitizeAttributes",r=>{if(e.allowExternalImages||(r.tagName==="IMG"&&r.removeAttribute("srcset"),r.tagName==="SOURCE"&&(r.removeAttribute("srcset"),r.removeAttribute("src")),r.tagName==="VIDEO"&&r.removeAttribute("poster")),r.tagName==="IMG"){const n=r.getAttribute("src")||"";if(n.startsWith("data:"))return;if(n.startsWith("cid:")){const d=n.slice(4).replace(/^<|>$/g,""),g=e.resolveCid?.(d);g&&(r.setAttribute("src",g),r.classList.add("inline-content"));return}e.allowExternalImages||(r.setAttribute("data-blocked-src",n),r.setAttribute("src",We),r.setAttribute("alt","[Blocked image]"),r.classList.add("blocked-image"))}if(r.tagName==="A"){const n=r.getAttribute("href")||"";if(/^(javascript|data):/i.test(n)){r.removeAttribute("href");return}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer nofollow"),r.classList.add("external-link")}if(r.hasAttribute("style")){const n=r.getAttribute("style")||"";r.setAttribute("style",Ve(n))}}),t.addHook("uponSanitizeElement",(r,n)=>{if(n.tagName==="style"){const o=r.textContent||"";r.textContent=Qe(o)}}),r=>{const n=_e(r),o=He(r),d=t.sanitize(r,s);return{html:`<style>${Te()}</style>${d}`,hasAuthorBackground:n,hasAuthorSpacing:o}}},L=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Et=({className:e,children:t})=>a.jsx("div",{className:b("[&_.message-body-frame]:-mx-2 lg:[&_.message-body-frame]:-mx-4",e),children:t}),Ye=({html:e,text:t,isDark:s=!1,category:r,allowImages:n=!1,resolveCid:o,className:d,renderBlockedNotice:g})=>{const i=h.useMemo(()=>!e||typeof document>"u"?null:qe({allowExternalImages:n,resolveCid:o})(e),[e,n,o]),c=i?.html??null,{framed:u,isPlain:m}=Ce(r,i?.hasAuthorBackground??!1),f=h.useMemo(()=>({background:i?.hasAuthorBackground??!1,spacing:i?.hasAuthorSpacing??!1}),[i?.hasAuthorBackground,i?.hasAuthorSpacing]),p=h.useMemo(()=>!c||n?0:(c.match(/data-blocked-src/g)||[]).length,[c,n]);return!c&&!t?a.jsx("div",{className:b("message-body",d),children:a.jsx(L,{})}):a.jsxs("div",{className:b("message-body",d),children:[p>0&&a.jsx("div",{children:g?.(p)}),c?a.jsx("div",{className:"message-body-frame",children:u?a.jsx("div",{className:"w-full max-w-full",children:a.jsx(C,{html:c,variant:"framed",isDark:s,declares:f})}):a.jsx("div",{className:"max-w-full lg:max-w-2xl",children:a.jsx(C,{html:c,variant:m?"plain":"framed",isDark:s,declares:f})})}):t?a.jsx("pre",{className:"email-text whitespace-pre-wrap text-sm leading-relaxed",children:t}):a.jsx(L,{})]})};function Nt({message:e="Select a thread to read",icon:t,showHints:s=!0,className:r}){return a.jsxs("div",{className:b("flex flex-1 flex-col items-center justify-center text-center",r),children:[t??a.jsx(X,{className:"size-10 text-fg-subtle"}),a.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:e}),s&&a.jsxs("p",{className:"text-2xs text-fg-subtle",children:[a.jsx(A,{children:"j"})," / ",a.jsx(A,{children:"k"})," to move, ",a.jsx(A,{children:"Enter"})," to open"]})]})}function M(e){const t=[];let s=-1,r=!1;for(let n=0;n<e.length;n++){const o=e[n];if(o==='"'){r=!r,s<0&&(s=n);continue}if(!r&&/\s/.test(o)){s>=0&&t.push({raw:e.slice(s,n),start:s,end:n}),s=-1;continue}s<0&&(s=n)}return s>=0&&t.push({raw:e.slice(s),start:s,end:e.length}),t}const Xe=e=>{if(!e.startsWith('"'))return e;const t=e.slice(1);return t.endsWith('"')?t.slice(0,-1):t};function Ze(e){const t=e.indexOf(":");if(t<=0)return;const s=e.slice(t+1);return{name:e.slice(0,t).toLowerCase(),value:Xe(s),rawValue:s}}const Je=e=>/[\s"]/.test(e),et=e=>Je(e)?`"${e.replace(/"/g,"")}"`:e,Ct=(e,t)=>`${e}:${et(t)}`,D=(e,t=Date.now())=>({value:e,setAt:t}),tt=(e,t,s,r)=>{if(e.addressId!==t)return e;const n={...e.flags??{}};return s?n.trusted=D(!0,r):delete n.trusted,{...e,flags:n}},st=(e,t,s,r)=>{const n=o=>o.map(d=>tt(d,t,s,r));return{...e,envelope:{...e.envelope,from:n(e.envelope.from),to:n(e.envelope.to),cc:n(e.envelope.cc),bcc:n(e.envelope.bcc),replyTo:n(e.envelope.replyTo)}}},rt=({messageId:e})=>{const t=Z(),{pushError:s}=J(),{mutate:r,isPending:n,error:o,reset:d}=ee({...re(),onMutate:async i=>{const c=i.path.addressId,m=i.body.flags?.trusted?.value===!0,f=se({path:{messageId:e}});await t.cancelQueries({queryKey:f});const p=t.getQueriesData({queryKey:f}).filter(l=>l[1]!==void 0).map(([l,x])=>({queryKey:l,data:x}));return t.setQueriesData({queryKey:f},l=>l&&st(l,c,m)),{describePrefix:f,previous:p}},onError:(i,c,u)=>{if(u)for(const m of u.previous)t.setQueryData(m.queryKey,m.data);s(te("Couldn't trust sender","The change wasn't saved.",i))},onSettled:(i,c,u,m)=>{m&&t.invalidateQueries({queryKey:m.describePrefix})}});return{toggleTrusted:(i,c)=>{r({path:{addressId:i},body:{flags:{trusted:D(!c)}}})},isPending:n,error:o,reset:d}},nt=()=>{const[e,t]=h.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return h.useEffect(()=>{const s=document.documentElement,r=new MutationObserver(()=>{t(s.classList.contains("dark"))});return r.observe(s,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e},at=(e,t)=>{const s=`${e} image${e>1?"s":""}`;return t?`${s} hidden — you blocked this sender`:`${s} blocked for privacy`},ot=({blockedImageCount:e,canAlwaysTrust:t,isTrustPending:s,isSenderBlocked:r,onLoadOnce:n,onAlwaysTrust:o})=>a.jsxs("div",{"data-testid":"blocked-images-notice",className:"mb-3 flex items-center justify-between rounded-md bg-surface-sunken/50 px-3 py-2 text-sm",children:[a.jsx("span",{className:"text-fg-muted",children:at(e,r)}),!r&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:n,className:"text-accent hover:underline",children:"Load once"}),t&&a.jsx("button",{type:"button",onClick:o,"aria-busy":s,className:"text-accent hover:underline aria-busy:opacity-50",children:s?"Trusting…":"Always trust"})]})]}),it=(e,t)=>{switch(e){case"auth":return{title:"Your session expired",detail:"Sign in again to reload the message body. Other parts of the app may also stop responding until you do."};case"body-missing":return{title:"Message body is missing in storage",detail:"A sync failure may have left this message without its body bytes. Contact support, or run the reconcile script to refetch from the upstream IMAP server."};case"content-type-mismatch":return{title:"Couldn't load message body",detail:"The server returned an unexpected content type for this part. The message body has not been rendered to keep you safe."};case"spa-shell-leak":return{title:"Couldn't load message body",detail:"The server returned the app shell instead of the message body. This is an infrastructure bug — please report it."};case"not-ready":return{title:"Message body is still syncing",detail:"This message's body hasn't finished downloading from the mail server yet. It should appear shortly — reopen the message to try again."};default:return{title:"Couldn't load message body",detail:t}}},ct=e=>e instanceof le?e.reason:"generic",lt=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while loading the message body.",dt=({error:e,onRetry:t})=>{const s=ct(e),r=lt(e),{title:n,detail:o}=it(s,r),[d,g]=h.useState(!1),{Account:i}=ne();return d?null:a.jsxs("div",{role:"alert","data-testid":"message-body-error-banner","data-reason":s,className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[a.jsx(ae,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-danger",children:n}),a.jsx("p",{className:"text-fg-muted mt-1 break-words",children:o})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s==="auth"&&a.jsx(i,{children:({signOut:c})=>a.jsx("button",{type:"button",onClick:()=>c(),className:"text-sm font-medium text-accent hover:underline",children:"Sign in again"})}),t&&a.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-accent hover:underline",children:"Retry"}),a.jsx("button",{type:"button",onClick:()=>g(!0),"aria-label":"Dismiss message body error",className:"rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors",children:a.jsx(oe,{className:"size-4","aria-hidden":"true"})})]})]})},ut=()=>a.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading message body",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"})]}),R=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Tt=({bodyParts:e,html:t,text:s,isTrusted:r=!1,isBlocked:n=!1,messageId:o,fromAddressId:d,category:g,className:i})=>{const[c,u]=h.useState(!1),[m,f]=h.useState(o);m!==o&&(f(o),u(!1));const p=!n&&(r||c),l=nt(),{toggleTrusted:x,isPending:w}=rt({messageId:o??""}),y=!!e&&e.length>0,{picked:z,data:v,isLoading:P,isError:K,error:F,refetch:H}=de({messageId:o,bodyParts:e,enabled:y}),G=h.useMemo(()=>je(e??[]),[e]),U=y&&v?.kind==="html"?v.body:t,W=y&&v?.kind==="text"?v.body:s;if(y){if(P)return a.jsx("div",{className:b("message-body",i),children:a.jsx(ut,{})});if(K)return a.jsx("div",{className:b("message-body",i),children:a.jsx(dt,{error:F,onRetry:()=>H()})});if(!z)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})})}else if(!t&&!s)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})});const V=!!(d&&o),Q=()=>{!d||w||(u(!0),x(d,!1))};return a.jsx(Ye,{className:i,html:U,text:W,isDark:l,category:g,allowImages:p,resolveCid:G,renderBlockedNotice:q=>a.jsx(ot,{blockedImageCount:q,canAlwaysTrust:V,isTrustPending:w,isSenderBlocked:n,onLoadOnce:()=>u(!0),onAlwaysTrust:Q})})},mt=Object.values(_).map(e=>({value:e,label:I[e]})),ft={unclassified:"uncategorized"},ht=[{name:"from",label:"Sender",values:"contact"},{name:"subject",label:"Subject",values:"text"},{name:"category",label:"Category",values:"fixed",options:mt},{name:"is",label:"State",values:"fixed",options:[{value:"unread",label:"Unread"},{value:"read",label:"Read"},{value:"starred",label:"Starred"}]},{name:"has",label:"Contents",values:"fixed",options:[{value:"attachment",label:"Has attachment"}]},{name:"in",label:"Folder",values:"mailbox"},{name:"account",label:"Account",values:"account"},{name:"after",label:"Sent on or after",values:"date"},{name:"before",label:"Sent before",values:"date"}],gt=new Map(ht.map(e=>[e.name,e])),jt=e=>gt.get(e.toLowerCase()),pt=/^\d{4}-\d{2}-\d{2}$/;function bt(e,t,s){if(!pt.test(s))return;const r=Date.parse(`${s}T00:00:00Z`);if(!Number.isNaN(r))return{type:e,raw:t,value:s,epochSeconds:Math.floor(r/1e3)}}function yt(e){const t=e.toLowerCase(),s=ft[t];return s||Object.values(_).find(n=>n===t)}function xt(e,t){switch(t.toLowerCase()){case"unread":return{type:"isUnread",raw:e};case"read":return{type:"isRead",raw:e};case"starred":case"flagged":return{type:"isStarred",raw:e};default:return}}function wt(e,t){const s=Ze(e);if(!s||s.value.length===0)return;const{name:r,value:n}=s;switch(r){case"from":return{type:"from",raw:e,value:n};case"subject":return{type:"subject",raw:e,value:n};case"category":{const o=yt(n);return o?{type:"category",raw:e,value:n,category:o}:void 0}case"is":return xt(e,n);case"has":return n.toLowerCase()==="attachment"?{type:"hasAttachment",raw:e}:void 0;case"before":case"after":return bt(r,e,n);case"in":{const o=t.mailboxesByName?.get(n.toLowerCase());return o?{type:"in",raw:e,value:n,mailboxId:o}:void 0}case"account":{const o=t.accountsByName?.get(n.toLowerCase());return o?{type:"account",raw:e,value:n,accountId:o}:void 0}default:return}}function Lt(e,t={}){const s=[],r=[];for(const n of M(e)){const o=wt(n.raw,t);o?s.push(o):r.push(n.raw)}return{freeText:r.join(" "),tokens:s}}function Rt(e,t){return M(e).filter(s=>s.raw!==t.raw).map(s=>s.raw).join(" ")}function _t(e){switch(e.type){case"from":return`From: ${e.value}`;case"subject":return`Subject: ${e.value}`;case"category":return`Category: ${I[e.category]}`;case"hasAttachment":return"Has attachment";case"isUnread":return"Unread";case"isRead":return"Read";case"isStarred":return"Starred";case"before":return`Before ${e.value}`;case"after":return`After ${e.value}`;case"in":return`In: ${e.value}`;case"account":return`Account: ${e.value}`}}function It(){const{mailboxNameIndex:e,accountNameIndex:t}=ie(),s=ce();return{...ue(s)?{}:{mailboxesByName:e},accountsByName:t}}export{Et as M,Nt as R,ht as S,Ye as a,rt as b,Tt as c,jt as d,M as e,Ze as f,Ct as g,Lt as p,Rt as r,_t as s,It as u};
@@ -1 +1 @@
1
- import{h as L,at as M,i as k,E as I,F as E,cz as A,el as R,r as v,dx as j,j as p,em as h,en as w,eo as D,C as _,co as z,c as N,dS as Q,d5 as O}from"./index-UydO8d8c.js";import{c as U}from"./popover-menu--AoVAv-y.js";import{aj as q}from"./MailListHeader-DfOCZnRx.js";import{a as P}from"./useLabels-DQs2z0T7.js";import{n as B}from"./search-query-Cr_ZXBCp.js";import{b as F}from"./search-scope-B5-OK3Cq.js";import{u as G,p as H}from"./useSearchTokenContext-CBDSw3gJ.js";const ne=e=>{const t=new Set;for(const s of e)s&&t.add(s);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},K=e=>{const{mailboxId:t,messages:s}=e,n=L(),{pushError:l}=M(),{mutateAsync:c,isPending:a}=k({...R(),onError:(r,u)=>{l({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:A(r),error:r})},onSettled:(r,u,d)=>{I(n,E(q(d.body.messageIds??[],s??[],t)))}});return{applyLabel:v.useCallback((r,u,d)=>{r.length!==0&&j(r,m=>c({body:{messageIds:m,labelId:u,action:d}}))},[c]),isPending:a}};function re({accountId:e,mailboxId:t,messageIds:s}){const{labels:n}=P(e),{applyLabel:l}=K({mailboxId:t}),c=v.useMemo(()=>n.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${w(a.color)?h[a.color]:h.Default}`}),onSelect:()=>l(s,a.labelId,"Apply")})),[n,s,l]);return c.length===0?null:p.jsx(U,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(D,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:c,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const V=3,ie=({hasSearchQuery:e,freeText:t,residualTokenCount:s})=>{if(!e||s>0)return!1;const n=t.trim();return n.length===0||n.length>=V},ce=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},Y=20,$=new Set(Object.values(O)),J=e=>e!==void 0&&$.has(e)?e:void 0,W=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function le({mailboxId:e,filterCategory:t}={}){const{searchQuery:s}=_(),n=G(),l=z(),c=B(s),{freeText:a,tokens:i}=H(c,n),r=a.length>0,u=i.find(o=>o.type==="category"),d=J(t)??u?.category,m=i.some(o=>o.type==="hasAttachment")?!0:void 0,f=i.some(o=>o.type==="isStarred")?!0:void 0,y=W(i),b=i.find(o=>o.type==="after"),g=i.find(o=>o.type==="before"),x=i.find(o=>o.type==="in"),S=F({browsed:l,callerMailboxId:e,inTokenMailboxId:x?.mailboxId}),{data:T,isLoading:C}=N({...Q({query:{query:a,mailboxId:S,limit:Y,...d!==void 0?{category:d}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:r,staleTime:6e4});return{hits:T?.items??[],isLoading:r&&C}}export{re as L,ne as r,ie as s,ce as t,le as u};
1
+ import{h as L,at as M,i as k,E as I,F as E,cz as A,el as R,r as v,dy as j,j as p,em as h,en as w,eo as D,C as _,co as z,c as N,dS as Q,d6 as O}from"./index-CcbTB5sD.js";import{c as U}from"./popover-menu-ySklKha2.js";import{aj as q}from"./MailListHeader-DvOWAj7-.js";import{a as P}from"./useLabels-DAY52Umi.js";import{n as B}from"./search-query-Cr_ZXBCp.js";import{b as F}from"./search-scope-B5-OK3Cq.js";import{u as G,p as H}from"./useSearchTokenContext-ByaKT82a.js";const ne=e=>{const t=new Set;for(const s of e)s&&t.add(s);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},K=e=>{const{mailboxId:t,messages:s}=e,n=L(),{pushError:l}=M(),{mutateAsync:c,isPending:a}=k({...R(),onError:(r,u)=>{l({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:A(r),error:r})},onSettled:(r,u,d)=>{I(n,E(q(d.body.messageIds??[],s??[],t)))}});return{applyLabel:v.useCallback((r,u,d)=>{r.length!==0&&j(r,m=>c({body:{messageIds:m,labelId:u,action:d}}))},[c]),isPending:a}};function re({accountId:e,mailboxId:t,messageIds:s}){const{labels:n}=P(e),{applyLabel:l}=K({mailboxId:t}),c=v.useMemo(()=>n.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${w(a.color)?h[a.color]:h.Default}`}),onSelect:()=>l(s,a.labelId,"Apply")})),[n,s,l]);return c.length===0?null:p.jsx(U,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(D,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:c,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const V=3,ie=({hasSearchQuery:e,freeText:t,residualTokenCount:s})=>{if(!e||s>0)return!1;const n=t.trim();return n.length===0||n.length>=V},ce=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},Y=20,$=new Set(Object.values(O)),J=e=>e!==void 0&&$.has(e)?e:void 0,W=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function le({mailboxId:e,filterCategory:t}={}){const{searchQuery:s}=_(),n=G(),l=z(),c=B(s),{freeText:a,tokens:i}=H(c,n),r=a.length>0,u=i.find(o=>o.type==="category"),d=J(t)??u?.category,m=i.some(o=>o.type==="hasAttachment")?!0:void 0,f=i.some(o=>o.type==="isStarred")?!0:void 0,y=W(i),b=i.find(o=>o.type==="after"),g=i.find(o=>o.type==="before"),S=i.find(o=>o.type==="in"),x=F({browsed:l,callerMailboxId:e,inTokenMailboxId:S?.mailboxId}),{data:T,isLoading:C}=N({...Q({query:{query:a,mailboxId:x,limit:Y,...d!==void 0?{category:d}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:r,staleTime:6e4});return{hits:T?.items??[],isLoading:r&&C}}export{re as L,ne as r,ie as s,ce as t,le as u};
@@ -1 +1 @@
1
- import{h as g,at as p,c as f,d as m,r,i as y,av as T,o as E,l as d}from"./index-UydO8d8c.js";const i={html:"",plainText:""},x=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{x as u};
1
+ import{h as g,at as p,c as f,d as m,r,i as y,av as T,o as E,l as d}from"./index-CcbTB5sD.js";const i={html:"",plainText:""},x=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{x as u};
package/index.html CHANGED
@@ -38,7 +38,7 @@
38
38
  } catch (_) {}
39
39
  })();
40
40
  </script>
41
- <script type="module" crossorigin src="/assets/index-UydO8d8c.js"></script>
41
+ <script type="module" crossorigin src="/assets/index-CcbTB5sD.js"></script>
42
42
  <link rel="stylesheet" crossorigin href="/assets/index-CzAIxx9Z.css">
43
43
  </head>
44
44
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client-dist",
3
- "version": "0.0.626",
3
+ "version": "0.0.628",
4
4
  "description": "Built Remit web client — static assets and the default runtime config.",
5
5
  "files": [
6
6
  "**/*"
@@ -1,2 +0,0 @@
1
- import{j as e,t as h,f as S,a3 as J,X as K,c as $,eW as ee,s as se,Y as te,a0 as ne,r as w}from"./index-UydO8d8c.js";import{u as ae,e as re,m as ie,t as oe,C as le,d as ce,p as de}from"./CalendarComposePane-CvXktapf.js";import{c as xe,R as fe,F as V,u as me,n as ue}from"./calendar-format-M4S5xU7P.js";import{R as he,A as pe}from"./attendee-row-BhqXy1fZ.js";import{C as ge}from"./clock-ByuYhL7c.js";import{G as B,M as ve}from"./map-pin-HJKJCWdt.js";import{M as be}from"./mail-Db9OjHYL.js";import{P as je}from"./pencil-u2t1F29A.js";import{f as Ne,u as Ce,c as we,U as G,h as ke,d as ye}from"./useCalendars-DR1_eTjS.js";import{a as Ee}from"./useCalendarWrites-BASehFYp.js";import{b as Te}from"./useCalendarData-CMPLRued.js";function v({icon:s,children:t}){return e.jsxs("div",{className:"flex items-start gap-2.5 py-1",children:[e.jsx("span",{className:"mt-0.5 shrink-0 text-fg-subtle",children:s}),e.jsx("div",{className:"min-w-0 flex-1 text-sm text-fg",children:t})]})}function Re({event:s,calendar:t,whenText:r,onEdit:n,onDelete:i,onOpenThread:l,onClose:d,activeAttendee:x="",onActivateAttendee:b,renderAttendeeContext:k,touch:y=!1,chrome:E="header",className:a}){const T=xe(t.color),c=e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-xl font-semibold text-fg",children:s.title}),e.jsxs("div",{className:"mt-3 flex flex-col border-b border-line pb-3",children:[e.jsx(v,{icon:e.jsx(ge,{className:"size-4"}),children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[r,s.attendees.length>0&&e.jsx(he,{rsvp:s.myRsvp})]})}),s.zoneCertainty==="ambiguous"?e.jsx(v,{icon:e.jsx(B,{className:"size-4 text-warning"}),children:e.jsx("span",{className:"text-warning",children:"The mail said a time but never a zone. Shown in your own; confirm before you travel for it."})}):s.timeZone!==""&&e.jsx(v,{icon:e.jsx(B,{className:"size-4"}),children:s.timeZone}),s.recurrenceRule!==""&&e.jsx(v,{icon:e.jsx(fe,{className:"size-4"}),children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.recurrenceRule,s.seriesException&&e.jsx("span",{className:"rounded-xs bg-warning-soft px-1.5 py-0.5 text-2xs text-warning",children:"Moved out of the series"})]})}),s.location!==""&&e.jsx(v,{icon:e.jsx(ve,{className:"size-4"}),children:s.location})]}),s.threadId!==""&&l&&e.jsxs("button",{type:"button",onClick:l,className:"mt-3 flex w-full items-center gap-2.5 rounded-md border border-line bg-surface-sunken px-3 py-2 text-left outline-none hover:border-line-strong focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx(be,{className:"size-4 shrink-0 text-accent-2"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:"From this thread"}),e.jsx("span",{className:"block truncate text-sm text-fg",children:s.threadSubject})]})]}),s.attendees.length>0&&e.jsx(pe,{attendees:s.attendees,activeEmail:x,onActivate:b,renderContext:k,touch:y,className:"mt-3"}),s.notes!==""&&e.jsx("p",{className:"mt-3 whitespace-pre-wrap text-sm text-fg-muted",children:s.notes})]});return E==="bare"?e.jsx("div",{className:h("flex flex-col",a),children:c}):e.jsxs("article",{className:h("flex h-full w-full flex-col bg-surface",a),children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[e.jsx("span",{className:h("size-2.5 shrink-0 rounded-full",T.solid)}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:[t.name," · ",t.accountLabel]}),n&&e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(je,{className:"size-3.5"}),onClick:n,children:"Edit"}),i&&e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(J,{className:"size-3.5"}),onClick:i,className:"text-danger",children:"Delete"}),d&&e.jsx("button",{type:"button","aria-label":"Close event",onClick:d,className:"flex size-7 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:e.jsx(K,{className:"size-4"})})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-3",children:c})]})}const De=[{scope:"this",label:"This event",note:"Leaves the rest of the series alone"},{scope:"following",label:"This and everything after",note:"Splits the series here"},{scope:"all",label:"The whole series",note:"Rewrites the rule itself"}];function ze({title:s,ruleText:t,instanceText:r,onChoose:n,onCancel:i,touch:l,className:d}){return e.jsxs("div",{className:h("flex flex-col gap-3",d),children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-md font-semibold text-fg",children:[s," repeats"]}),e.jsx("p",{className:"text-xs text-fg-muted",children:t}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You clicked ",r,"."]})]}),e.jsx("p",{className:"text-sm text-fg",children:"What should the change apply to?"}),e.jsx("div",{className:"flex flex-col gap-1.5",children:De.map(x=>e.jsxs("button",{type:"button",onClick:()=>n(x.scope),className:h("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",l&&"min-h-11 justify-center"),children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:x.label}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:x.note})]},x.scope))}),e.jsx(S,{variant:"ghost",size:l?"md":"sm",onClick:i,className:h("self-start",l&&"min-h-11"),children:"Cancel"})]})}const Y=s=>s.replace(/\r?\n[ \t]/g,""),q=s=>s.replace(/\\n/gi,`
2
- `).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function A(s,t){let r=!1;for(let n=t.length;n<s.length;n+=1){const i=s[n];if(n===t.length&&i!==";"&&i!==":")return;if(i==='"'){r=!r;continue}if(!r&&i===":")return s.slice(n+1).trim()}}function I(s,t){for(const r of Y(s).split(/\r?\n/)){if(!r.startsWith(t))continue;const n=A(r,t);if(n!==void 0)return n}return""}const Se=s=>I(s,"RRULE"),Ae=s=>({location:q(I(s,"LOCATION")),description:q(I(s,"DESCRIPTION"))});function Ie(s,t){const r=Y(s).split(/\r?\n/).find(i=>i.startsWith("DTSTART")&&A(i,"DTSTART")!==void 0);if(r===void 0)return Ne(t);const n=/;TZID="?([^;:"]+)"?/i.exec(r)?.[1];return n!==void 0?Intl.supportedValuesOf("timeZone").includes(n)?n:t:A(r,"DTSTART")?.toUpperCase().endsWith("Z")?"":t}const Fe=se(404);function Le(s,t){const{data:r,isLoading:n,error:i,refetch:l}=$({...ee({path:{calendarObjectId:s},query:{calendarId:t}}),meta:Fe,enabled:s!==""&&t!==""});return{resource:r,isLoading:n,error:i,refetch:()=>{l()}}}function Oe({event:s,calendar:t,isOccurrence:r,problem:n="",onEdit:i,onDelete:l,onClose:d}){return!s||!t?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-surface p-8 text-center",children:[e.jsx(te,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"That event isn't on this week"}),e.jsx("p",{className:"max-w-xs text-sm text-fg-muted",children:"The address names an event the calendar doesn't have here."}),e.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Back to the calendar"})]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[r&&e.jsx("p",{className:"shrink-0 border-b border-line bg-surface-sunken px-row-inset py-1.5 text-2xs uppercase tracking-wider text-fg-subtle",children:"One occurrence of a repeating event"}),n!==""&&e.jsxs("div",{role:"alert",className:"flex shrink-0 items-start gap-2 border-b border-danger/40 bg-danger-soft px-row-inset py-2 text-sm",children:[e.jsx(ne,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("p",{className:"min-w-0 flex-1 break-words text-fg",children:n})]}),e.jsx(Re,{event:s,calendar:t,whenText:V(s),onEdit:i,onDelete:l,onClose:d,className:"min-h-0 flex-1"})]})}const Pe="This event changed somewhere else — over CalDAV, or in another tab. Nothing was saved. Close it and open it again to see the version that's stored now.";function Xe({calendarObjectId:s,recurrenceId:t}){const{view:r,date:n,calendarIds:i}=me(),{events:l}=Te({view:r,date:n,calendarIds:i}),{calendars:d,timeZoneByCalendarId:x}=Ce(),{closeEvent:b}=ue(),{updateEvent:k,deleteEvent:y,isWriting:E}=Ee(),a=l.find(o=>o.id===we(s,t??"")),T=d.find(o=>o.id===a?.calendarId),{resource:c}=Le(s,a?.calendarId??""),[F,p]=w.useState(void 0),[m,R]=w.useState(void 0),[u,j]=w.useState(void 0),[L,g]=w.useState(""),_=ae(u??re("",""),s),N=c?Ae(c.icalData):void 0,D=c?Se(c.icalData):"",Q=a&&!a.allDay?a.start.slice(11,16):"",z=c?Ie(c.icalData,x[a?.calendarId??""]??G):G,X=a&&!a.allDay?ie(D,ke(a.start,z===""?"UTC":z).slice(0,10),a.start.slice(0,10)):D,C=D===""?"":oe(X,Q)??"Repeats",O=a!==void 0&&a.seriesId!==""&&t!==void 0&&t!=="",P=a!==void 0&&c!==void 0,W=(o,f)=>{if(o.kind==="written"){g(""),f();return}g(o.kind==="conflict"?Pe:o.message)},Z=o=>({calendarObjectId:s,calendarId:a?.calendarId??"",recurrenceId:t??"",scope:o,etag:c?.etag??""}),M=o=>{if(!a)return;const f=ce(a,{repeat:C,location:N?.location??"",notes:N?.description??""});p(void 0),R({before:f,scope:o}),j(f),g("")},U=o=>{p(void 0),y(Z(o)).then(f=>W(f,b))},H=()=>{if(!m||!u)return;const o=de(m.before,u,{clock:ye(),anchor:z});if(!o.ok){g(o.problem);return}k(Z(m.scope),o.patch).then(f=>W(f,()=>{R(void 0),j(void 0)}))};return F!==void 0&&a?e.jsx("div",{className:"flex h-full flex-col justify-center bg-surface px-row-inset",children:e.jsx(ze,{className:"mx-auto w-full max-w-md",title:a.title,ruleText:C===""?"It repeats":C,instanceText:V(a),onChoose:F==="edit"?M:U,onCancel:()=>p(void 0)})}):m&&u?e.jsx(le,{title:"Edit event",subtitle:m.scope==="this"?"This occurrence only":u.date,calendars:d,draft:u,onChange:j,problem:L,saveLabel:"Save",isSaving:E,repeatEditable:m.scope===void 0||m.scope==="all",calendarEditable:!1,clashes:_,onSave:H,onCancel:()=>{R(void 0),j(void 0),g("")}}):e.jsx(Oe,{event:a&&{...a,location:N?.location??"",notes:N?.description??"",recurrenceRule:C},calendar:T,isOccurrence:t!==void 0,problem:L,onEdit:P?()=>O?p("edit"):M(void 0):void 0,onDelete:P?()=>O?p("delete"):U(void 0):void 0,onClose:b})}export{Xe as O};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-UydO8d8c.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{aj as m,j as o,O as p}from"./index-UydO8d8c.js";import{a}from"./MailShell-C1jECwgj.js";import{M as r}from"./MailboxPane-Czwm70WW.js";import{a as e}from"./search-token-index-AOAqpH15.js";import{u as s}from"./search-mirror-Cv2S0VbB.js";import"./FullCompose-ChHG83dJ.js";import"./ErrorState-wz9YaOol.js";import"./index-D4ZeuNuq.js";import"./useMessageBodyContent-DiiU1g37.js";import"./useSignature-DruMb0cI.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dt6rAAol.js";import"./sections-EqJpt3TQ.js";import"./confirm-dialog-D0wfxRPd.js";import"./useSearchTokenContext-CBDSw3gJ.js";import"./kbd-Dr4usi4j.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-BUZDaiTn.js";import"./circle-check-big-DrhQmTbc.js";import"./refresh-cw-Qp6f0dRu.js";import"./useQueries-CJUjXxvq.js";import"./MailListHeader-DfOCZnRx.js";import"./roving-focus-BNBmBfAx.js";import"./popover-menu--AoVAv-y.js";import"./mail-Db9OjHYL.js";import"./avatar-Dq9zVRVl.js";import"./EmptyState-DFn4LB7J.js";import"./undo-2-CveuEJjH.js";import"./download-C79uP4C7.js";import"./calendar-suggestion-Dz1CYPKE.js";import"./calendar-format-M4S5xU7P.js";import"./useCalendars-DR1_eTjS.js";import"./map-pin-HJKJCWdt.js";import"./attendee-row-BhqXy1fZ.js";import"./clock-ByuYhL7c.js";import"./calendar-clash-strip-Bid2cYhz.js";import"./bell-off-zJIQc-fQ.js";import"./copy-baeOC0XH.js";import"./shield-check-D7EcTf9d.js";import"./useFilters-Bbcl4di_.js";import"./useLayoutTier-CF_kWPgV.js";import"./menu-CbYnJN5U.js";import"./MailViewChrome-XZUEJlo5.js";import"./NavMenuButton-DeFLPsFB.js";import"./useLabels-DQs2z0T7.js";import"./useSemanticSearch-B7rQKIm8.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CqUVoKvb.js";import"./circle-help-Bh3n-6_h.js";import"./circle-check-B0R88gmM.js";function po(){const{mailboxId:t}=m.useParams(),i=e();return s({to:"/mail/$mailboxId",params:{mailboxId:t}}),o.jsx(r,{mailboxId:t,thread:i,children:o.jsx(a,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(p,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{po as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-UydO8d8c.js";import{B as o}from"./BriefPane-_14jyTNU.js";import"./useSearchTokenContext-CBDSw3gJ.js";import"./kbd-Dr4usi4j.js";import"./useMessageBodyContent-DiiU1g37.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-DfOCZnRx.js";import"./roving-focus-BNBmBfAx.js";import"./search-token-index-AOAqpH15.js";import"./useQueries-CJUjXxvq.js";import"./popover-menu--AoVAv-y.js";import"./mail-Db9OjHYL.js";import"./avatar-Dq9zVRVl.js";import"./index-D4ZeuNuq.js";import"./useSignature-DruMb0cI.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dt6rAAol.js";import"./sections-EqJpt3TQ.js";import"./EmptyState-DFn4LB7J.js";import"./ErrorState-wz9YaOol.js";import"./undo-2-CveuEJjH.js";import"./download-C79uP4C7.js";import"./calendar-suggestion-Dz1CYPKE.js";import"./calendar-format-M4S5xU7P.js";import"./useCalendars-DR1_eTjS.js";import"./map-pin-HJKJCWdt.js";import"./attendee-row-BhqXy1fZ.js";import"./clock-ByuYhL7c.js";import"./calendar-clash-strip-Bid2cYhz.js";import"./bell-off-zJIQc-fQ.js";import"./copy-baeOC0XH.js";import"./shield-check-D7EcTf9d.js";import"./useFilters-Bbcl4di_.js";import"./confirm-dialog-D0wfxRPd.js";import"./useLayoutTier-CF_kWPgV.js";import"./menu-CbYnJN5U.js";import"./useRefreshControl-BUZDaiTn.js";import"./circle-check-big-DrhQmTbc.js";import"./refresh-cw-Qp6f0dRu.js";import"./useSemanticSearch-B7rQKIm8.js";import"./useLabels-DQs2z0T7.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function T(){return r.jsx(o.Reading,{})}export{T as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-UydO8d8c.js";import{F as r}from"./FlaggedPane-CGhj--Hm.js";import"./useSearchTokenContext-CBDSw3gJ.js";import"./kbd-Dr4usi4j.js";import"./useMessageBodyContent-DiiU1g37.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-DfOCZnRx.js";import"./roving-focus-BNBmBfAx.js";import"./search-token-index-AOAqpH15.js";import"./useQueries-CJUjXxvq.js";import"./popover-menu--AoVAv-y.js";import"./mail-Db9OjHYL.js";import"./avatar-Dq9zVRVl.js";import"./index-D4ZeuNuq.js";import"./useSignature-DruMb0cI.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dt6rAAol.js";import"./sections-EqJpt3TQ.js";import"./EmptyState-DFn4LB7J.js";import"./ErrorState-wz9YaOol.js";import"./undo-2-CveuEJjH.js";import"./download-C79uP4C7.js";import"./calendar-suggestion-Dz1CYPKE.js";import"./calendar-format-M4S5xU7P.js";import"./useCalendars-DR1_eTjS.js";import"./map-pin-HJKJCWdt.js";import"./attendee-row-BhqXy1fZ.js";import"./clock-ByuYhL7c.js";import"./calendar-clash-strip-Bid2cYhz.js";import"./bell-off-zJIQc-fQ.js";import"./copy-baeOC0XH.js";import"./shield-check-D7EcTf9d.js";import"./useFilters-Bbcl4di_.js";import"./confirm-dialog-D0wfxRPd.js";import"./useLayoutTier-CF_kWPgV.js";import"./menu-CbYnJN5U.js";import"./MailViewChrome-XZUEJlo5.js";import"./refresh-cw-Qp6f0dRu.js";import"./wizard-selection-DxUM65kM.js";function N(){return o.jsx(r.Reading,{})}export{N as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-UydO8d8c.js";import{M as r}from"./MailboxPane-Czwm70WW.js";import"./useSearchTokenContext-CBDSw3gJ.js";import"./kbd-Dr4usi4j.js";import"./useMessageBodyContent-DiiU1g37.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-BUZDaiTn.js";import"./circle-check-big-DrhQmTbc.js";import"./refresh-cw-Qp6f0dRu.js";import"./useQueries-CJUjXxvq.js";import"./MailListHeader-DfOCZnRx.js";import"./roving-focus-BNBmBfAx.js";import"./search-token-index-AOAqpH15.js";import"./popover-menu--AoVAv-y.js";import"./mail-Db9OjHYL.js";import"./avatar-Dq9zVRVl.js";import"./index-D4ZeuNuq.js";import"./useSignature-DruMb0cI.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dt6rAAol.js";import"./sections-EqJpt3TQ.js";import"./EmptyState-DFn4LB7J.js";import"./ErrorState-wz9YaOol.js";import"./undo-2-CveuEJjH.js";import"./download-C79uP4C7.js";import"./calendar-suggestion-Dz1CYPKE.js";import"./calendar-format-M4S5xU7P.js";import"./useCalendars-DR1_eTjS.js";import"./map-pin-HJKJCWdt.js";import"./attendee-row-BhqXy1fZ.js";import"./clock-ByuYhL7c.js";import"./calendar-clash-strip-Bid2cYhz.js";import"./bell-off-zJIQc-fQ.js";import"./copy-baeOC0XH.js";import"./shield-check-D7EcTf9d.js";import"./useFilters-Bbcl4di_.js";import"./confirm-dialog-D0wfxRPd.js";import"./useLayoutTier-CF_kWPgV.js";import"./menu-CbYnJN5U.js";import"./MailViewChrome-XZUEJlo5.js";import"./NavMenuButton-DeFLPsFB.js";import"./useLabels-DQs2z0T7.js";import"./useSemanticSearch-B7rQKIm8.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CqUVoKvb.js";import"./circle-help-Bh3n-6_h.js";import"./circle-check-B0R88gmM.js";function X(){return o.jsx(r.Reading,{})}export{X as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-UydO8d8c.js";import{O as t}from"./OutboxPane-HIJT_kwS.js";import"./roving-focus-BNBmBfAx.js";import"./useSearchTokenContext-CBDSw3gJ.js";import"./kbd-Dr4usi4j.js";import"./useMessageBodyContent-DiiU1g37.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-DrhQmTbc.js";import"./clock-ByuYhL7c.js";import"./row-actions-IPR7z5tr.js";import"./rotate-ccw-SdroQT7m.js";import"./NavMenuButton-DeFLPsFB.js";import"./menu-CbYnJN5U.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
@@ -1 +0,0 @@
1
- import{eX as o,j as m}from"./index-UydO8d8c.js";import{O as p}from"./OpenCalendarEvent-DFERZRRh.js";import"./CalendarComposePane-CvXktapf.js";import"./calendar-format-M4S5xU7P.js";import"./useQueries-CJUjXxvq.js";import"./useCalendars-DR1_eTjS.js";import"./calendar-clash-strip-Bid2cYhz.js";import"./attendee-row-BhqXy1fZ.js";import"./avatar-Dq9zVRVl.js";import"./clock-ByuYhL7c.js";import"./map-pin-HJKJCWdt.js";import"./mail-Db9OjHYL.js";import"./pencil-u2t1F29A.js";import"./useCalendarWrites-BASehFYp.js";import"./ErrorState-wz9YaOol.js";import"./useCalendarData-CMPLRued.js";function I(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:t})}export{I as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-UydO8d8c.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-UydO8d8c.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-UydO8d8c.js";const n=o;export{n as component};