@remit/web-client-dist 0.0.355 → 0.0.357

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 (130) hide show
  1. package/assets/BriefPane-puM8DuEu.js +1 -0
  2. package/assets/{ErrorState-CJ2aoLG_.js → ErrorState-DE7fNU8i.js} +1 -1
  3. package/assets/FlaggedPane-CAEBNxx7.js +1 -0
  4. package/assets/FullCompose-CF-9-qhJ.js +1 -0
  5. package/assets/MailListHeader-CYgtRJbp.js +7 -0
  6. package/assets/MailViewChrome-C6eAuQJs.js +1 -0
  7. package/assets/MailboxPane-DbkiJ-ZU.js +1 -0
  8. package/assets/{NavMenuButton-DCYDMDv1.js → NavMenuButton-DETzPdQ0.js} +1 -1
  9. package/assets/OnboardingWizard-DlLLqDnD.js +1 -0
  10. package/assets/OutboxPane-rhl_tAc1.js +1 -0
  11. package/assets/_mailboxId-BR-LNTQS.js +1 -0
  12. package/assets/_messageId-CxBxkF3k.js +1 -0
  13. package/assets/_messageId-DjOWQUpX.js +1 -0
  14. package/assets/_messageId-qN-nMeXL.js +1 -0
  15. package/assets/_outboxMessageId-BQrj00OE.js +1 -0
  16. package/assets/_threadId-BGf6L5rM.js +1 -0
  17. package/assets/_threadId-BRuwbmj0.js +1 -0
  18. package/assets/_threadId-BlCdqtPP.js +1 -0
  19. package/assets/account-form-helpers-DhckT_PN.js +1 -0
  20. package/assets/accounts-DbaCuU1h.js +1 -0
  21. package/assets/{advanced-hybSRTbS.js → advanced-BSm56wvd.js} +2 -2
  22. package/assets/{appearance-BpvA9O2b.js → appearance-B-YQ_D-G.js} +1 -1
  23. package/assets/attachment-file-tMJndpDR.js +1 -0
  24. package/assets/{avatar-CmvuzecB.js → avatar-PxGVQCQm.js} +1 -1
  25. package/assets/{bottom-sheet-BYOjIdVx.js → bottom-sheet-Ciu6wor9.js} +1 -1
  26. package/assets/brief-Dp35AAgB.js +1 -0
  27. package/assets/{brief-BVPyzhNL.js → brief-DubGNUqe.js} +1 -1
  28. package/assets/{browser-ponyfill-C0xW0XXl.js → browser-ponyfill-C4FMZXOi.js} +2 -2
  29. package/assets/{bug-JM5TdK6J.js → bug-JImhsPJZ.js} +1 -1
  30. package/assets/{circle-check-DlmySaui.js → circle-check-BishEtb4.js} +1 -1
  31. package/assets/{circle-check-big-Cj9roMB7.js → circle-check-big-CKyhX0ge.js} +1 -1
  32. package/assets/{circle-help-C_AXwAaV.js → circle-help-DNSDxunA.js} +1 -1
  33. package/assets/{clock-C4V2tcYN.js → clock-C6eJ9JFT.js} +1 -1
  34. package/assets/compose-AxF0yn31.js +1 -0
  35. package/assets/compose._-_outboxMessageId_-BfYj8gy-.js +1 -0
  36. package/assets/compose._-_outboxMessageId_-Cc3PlpVt.js +1 -0
  37. package/assets/compose._-_outboxMessageId_-DlR5IYTH.js +1 -0
  38. package/assets/compose._-_outboxMessageId_-Dt7szGb0.js +1 -0
  39. package/assets/{confirm-dialog-DPkij3bo.js → confirm-dialog-CywFW_iF.js} +1 -1
  40. package/assets/{download-ChGh-J5t.js → download-DmAN5nYp.js} +1 -1
  41. package/assets/{filters-GacN8-tL.js → filters-At6X_4Qa.js} +1 -1
  42. package/assets/flagged-LjN4HTxh.js +1 -0
  43. package/assets/{flagged-D5M0XeA-.js → flagged-jp1NtAkh.js} +1 -1
  44. package/assets/folders-DbfZVDiu.js +1 -0
  45. package/assets/index-BXLKZFis.js +1 -0
  46. package/assets/index-Bc4oWEgj.js +46 -0
  47. package/assets/index-CTtiHBdR.js +1 -0
  48. package/assets/index-CxBxkF3k.js +1 -0
  49. package/assets/index-DEiS9BN9.js +1 -0
  50. package/assets/index-DjOWQUpX.js +1 -0
  51. package/assets/index-DurZ9GJj.js +1 -0
  52. package/assets/index-DxnTd-0-.js +1 -0
  53. package/assets/{index-Bqn7f16e.js → index-hsglfEcH.js} +65 -65
  54. package/assets/index-wfsMNkWS.js +1 -0
  55. package/assets/{kbd-BG1I0chs.js → kbd-BnNxZdo9.js} +1 -1
  56. package/assets/{labels-BavFLXMP.js → labels-C9gJSc2V.js} +1 -1
  57. package/assets/mail-DhWlCt7m.js +1 -0
  58. package/assets/mail-yJsrR6p8.js +1 -0
  59. package/assets/{menu-vEH9STs_.js → menu-CblIqBpR.js} +1 -1
  60. package/assets/move-options-PPPCxetl.js +1 -0
  61. package/assets/onboarding-Duh_dZ50.js +1 -0
  62. package/assets/outbox-DNUUZW9t.js +1 -0
  63. package/assets/{pencil-CkIitMcy.js → pencil-B86il4i1.js} +1 -1
  64. package/assets/{rich-text-CsEQAreR.js → rich-text-BwRqTdXk.js} +3 -3
  65. package/assets/{rich-text-spellcheck-worker-provider-x6rgxHWR.js → rich-text-spellcheck-worker-provider-Cw73W4ra.js} +1 -1
  66. package/assets/{rotate-ccw-xiByt5L1.js → rotate-ccw-BE3AeQO_.js} +1 -1
  67. package/assets/{row-actions-t73y2fxd.js → row-actions-BIuqQwly.js} +1 -1
  68. package/assets/search-scope-BJ5VJ_uq.js +1 -0
  69. package/assets/search-token-index-DMBdkNPl.js +1 -0
  70. package/assets/search-view-CIqdN9ZA.js +1 -0
  71. package/assets/{senders-cIRRNPpD.js → senders-D0EUFTR8.js} +1 -1
  72. package/assets/settings-jhnhMsua.js +1 -0
  73. package/assets/{settings-screen-CH2hBhXZ.js → settings-screen-C21f5beW.js} +1 -1
  74. package/assets/{shield-check-drtxfxOL.js → shield-check-Df-A4ExU.js} +1 -1
  75. package/assets/suggested-vips-Ca0ezOFd.js +1 -0
  76. package/assets/{useDebouncedValue-upT4qR9G.js → useDebouncedValue-IVFdfd-Z.js} +1 -1
  77. package/assets/{useFilters-SCAefE6U.js → useFilters-BDcT8xyT.js} +1 -1
  78. package/assets/useLabels-DgAdgt4V.js +1 -0
  79. package/assets/{useMediaQuery-C47DmZA5.js → useMediaQuery-Do73WdTM.js} +1 -1
  80. package/assets/useMessageBodyContent-BmfPKs9C.js +1 -0
  81. package/assets/useRefreshControl-VEa-1NUQ.js +1 -0
  82. package/assets/useSearchMirror-BT4CR3rd.js +1 -0
  83. package/assets/useSearchTokenContext-BAqGqR_E.js +84 -0
  84. package/assets/useSemanticSearch-Crkt2g7K.js +1 -0
  85. package/assets/useSignature-Bs8Za-GC.js +1 -0
  86. package/index.html +1 -1
  87. package/package.json +1 -1
  88. package/assets/BriefPane-CYfwVL8Y.js +0 -1
  89. package/assets/FlaggedPane-Sleye2NB.js +0 -1
  90. package/assets/MailListHeader-CiYx2Ro0.js +0 -52
  91. package/assets/MailViewChrome-4eYgZdUD.js +0 -1
  92. package/assets/MailboxPane-VSk6AMXL.js +0 -1
  93. package/assets/OnboardingWizard-DoBOq2ec.js +0 -1
  94. package/assets/OutboxPane-D0ChJoAd.js +0 -1
  95. package/assets/_mailboxId-CK7QowXy.js +0 -1
  96. package/assets/_messageId-Bw730qzW.js +0 -1
  97. package/assets/_messageId-DRTnEPcv.js +0 -1
  98. package/assets/_messageId-DeYJ2FsF.js +0 -1
  99. package/assets/_outboxMessageId-CECizJ1R.js +0 -1
  100. package/assets/_threadId-DgtAhuV_.js +0 -1
  101. package/assets/_threadId-Dj8HOsy1.js +0 -1
  102. package/assets/_threadId-I8eJqG4z.js +0 -1
  103. package/assets/account-form-helpers-DAuyJa3o.js +0 -1
  104. package/assets/accounts-CeDKOmD9.js +0 -1
  105. package/assets/brief-DF7GfO-r.js +0 -1
  106. package/assets/flagged-DRo_foUo.js +0 -1
  107. package/assets/folders-BrH0h_oC.js +0 -1
  108. package/assets/index-0RAdsyez.js +0 -1
  109. package/assets/index-Csk5-jLk.js +0 -1
  110. package/assets/index-D6wIsDjM.js +0 -1
  111. package/assets/index-DRTnEPcv.js +0 -1
  112. package/assets/index-DeYJ2FsF.js +0 -1
  113. package/assets/index-W1wD_fe0.js +0 -1
  114. package/assets/index-hR0QoOpl.js +0 -1
  115. package/assets/index-u91rwMUb.js +0 -1
  116. package/assets/mail-2xAGIPds.js +0 -1
  117. package/assets/move-options-k5syuO4O.js +0 -1
  118. package/assets/nav-link-COOZsOLo.js +0 -1
  119. package/assets/onboarding-B28Gihze.js +0 -1
  120. package/assets/outbox-XuiN4du0.js +0 -1
  121. package/assets/search-token-index-D-3XiS1P.js +0 -1
  122. package/assets/search-view-B6uoqRaE.js +0 -1
  123. package/assets/settings-DzfdNeyv.js +0 -1
  124. package/assets/suggested-vips-CNjxCtfh.js +0 -1
  125. package/assets/useLabels-EfJaVdWJ.js +0 -1
  126. package/assets/useRefreshControl-DMQBrv7r.js +0 -1
  127. package/assets/useSearchMirror-BaenAzTH.js +0 -1
  128. package/assets/useSearchTokenContext-ki2AZ7p9.js +0 -84
  129. package/assets/useSemanticSearch-DoxylHxn.js +0 -1
  130. package/assets/useSignature-6eMCtb3X.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as b,j as e,au as C,B as r,aF as p,aA as R,aG as V,aH as L,az as z,aa as x,aI as T,r as h,am as y,aJ as g,b as O,aK as q,x as D,aL as H,aM as S,aN as I,aO as U,U as F,aP as Q,aQ as Y,aR as G,p as W,ay as J,aC as Z}from"./index-Bqn7f16e.js";import{S as K}from"./settings-screen-CH2hBhXZ.js";import{B as A}from"./bug-JM5TdK6J.js";import{C as _}from"./circle-check-DlmySaui.js";import{f as X}from"./ErrorState-CJ2aoLG_.js";import{D as M}from"./download-ChGh-J5t.js";import{R as k}from"./rotate-ccw-xiByt5L1.js";import{C as ee}from"./clock-C4V2tcYN.js";import{S as se}from"./shield-check-drtxfxOL.js";import"./avatar-CmvuzecB.js";import"./menu-vEH9STs_.js";import"./circle-help-C_AXwAaV.js";const ae=b("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const te=b("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const v=b("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),ne={BodyParse:"The message is built in a way Remit could not read."};function ie(s){return ne[s]}function $(s){return s.split(";")[0].trim()}const w=/^[A-Za-z0-9!#$%&'*+._-]+$/,E=/^[A-Za-z0-9!#$%&'*+._-]+\/[A-Za-z0-9!#$%&'*+._-]+$/;function j(s,a){return a.test(s)?`\`${s}\``:`\`${JSON.stringify(s).replace(/`/g,"\\u0060")}\` (malformed)`}function re(s){const a=$(s);return E.test(a)?a:JSON.stringify(a)}const N="_not read_";function le(s){return s.length===0?["(no MIME structure was read)"]:s.map(a=>`${" ".repeat(a.depth)}- ${re(a.contentType)}`)}const ce="_No message content, addresses, subject, attachment names or parser output are included._";function P(s){return{head:[`### Message quarantined at \`${s.failureStage}\``,"",`- **Failure**: \`${s.failureCode}\``,`- **Folder role**: ${s.mailboxRole??"_none appointed_"}`,`- **Failing part**: ${s.failurePartPath==null?"_whole message_":`\`${s.failurePartPath}\``}`,`- **Attempts before quarantine**: ${s.attempts}`,`- **Worker build**: ${s.workerVersion}`,`- **Message-ID hash**: ${s.messageIdHash==null?"_none declared_":`\`${s.messageIdHash}\``}`,"","#### Message shape","",`- **Content-Type**: ${s.contentType==null?N:j($(s.contentType),E)}`,`- **Content-Transfer-Encoding**: ${s.transferEncoding==null?N:j(s.transferEncoding,w)}`,`- **Charset**: ${s.charset==null?"_not declared_":j(s.charset,w)}`,`- **Size**: ${s.sizeBytes==null?N:`${s.sizeBytes} bytes`}`,"","MIME structure:"].join(`
1
+ import{c as b,j as e,an as C,B as r,ay as p,at as R,az as V,aA as D,as as z,a3 as x,aB as T,r as h,af as y,aC as g,b as L,aD as O,s as q,aE as H,aF as S,aG as I,aH as U,N as F,aI as Q,aJ as Y,aK as G,m as W,ar as J,av as Z}from"./index-hsglfEcH.js";import{S as K}from"./settings-screen-C21f5beW.js";import{B as A}from"./bug-JImhsPJZ.js";import{C as _}from"./circle-check-BishEtb4.js";import{f as X}from"./ErrorState-DE7fNU8i.js";import{D as M}from"./download-DmAN5nYp.js";import{R as k}from"./rotate-ccw-BE3AeQO_.js";import{C as ee}from"./clock-C6eJ9JFT.js";import{S as se}from"./shield-check-Df-A4ExU.js";import"./avatar-PxGVQCQm.js";import"./menu-CblIqBpR.js";import"./circle-help-DNSDxunA.js";const ae=b("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const te=b("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const v=b("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),ne={BodyParse:"The message is built in a way Remit could not read."};function ie(s){return ne[s]}function $(s){return s.split(";")[0].trim()}const w=/^[A-Za-z0-9!#$%&'*+._-]+$/,E=/^[A-Za-z0-9!#$%&'*+._-]+\/[A-Za-z0-9!#$%&'*+._-]+$/;function j(s,a){return a.test(s)?`\`${s}\``:`\`${JSON.stringify(s).replace(/`/g,"\\u0060")}\` (malformed)`}function re(s){const a=$(s);return E.test(a)?a:JSON.stringify(a)}const N="_not read_";function le(s){return s.length===0?["(no MIME structure was read)"]:s.map(a=>`${" ".repeat(a.depth)}- ${re(a.contentType)}`)}const ce="_No message content, addresses, subject, attachment names or parser output are included._";function P(s){return{head:[`### Message quarantined at \`${s.failureStage}\``,"",`- **Failure**: \`${s.failureCode}\``,`- **Folder role**: ${s.mailboxRole??"_none appointed_"}`,`- **Failing part**: ${s.failurePartPath==null?"_whole message_":`\`${s.failurePartPath}\``}`,`- **Attempts before quarantine**: ${s.attempts}`,`- **Worker build**: ${s.workerVersion}`,`- **Message-ID hash**: ${s.messageIdHash==null?"_none declared_":`\`${s.messageIdHash}\``}`,"","#### Message shape","",`- **Content-Type**: ${s.contentType==null?N:j($(s.contentType),E)}`,`- **Content-Transfer-Encoding**: ${s.transferEncoding==null?N:j(s.transferEncoding,w)}`,`- **Charset**: ${s.charset==null?"_not declared_":j(s.charset,w)}`,`- **Size**: ${s.sizeBytes==null?N:`${s.sizeBytes} bytes`}`,"","MIME structure:"].join(`
2
2
  `),structure:le(s.structure).join(`
3
3
  `),disclaimer:ce}}function oe(s){const{head:a,structure:t,disclaimer:i}=P(s);return[a,"","```",t,"```","",i].join(`
4
- `)}function de(s){return`Message quarantined: ${s.failureCode} at ${s.failureStage}`}function me({entry:s,onClose:a,issueUrl:t,onCopy:i}){if(!s)return null;const n=oe(s);return e.jsx(C,{open:!0,onClose:a,title:"Report this message",children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-fg",children:"Report this message"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This is everything the report contains. It describes the shape of the message — never its contents, addresses, subject, attachment names, or the parser's own error text."})]}),e.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:n}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(r,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(r,{variant:"secondary",size:"sm",icon:e.jsx(te,{className:"size-3.5"}),onClick:()=>i(n),children:"Copy report"}),e.jsx(p,{external:!0,size:"sm",href:t,icon:e.jsx(v,{className:"size-3.5"}),children:"Open on GitHub"})]})]})})}function xe(s){return new Date(s).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function he({entry:s,onCutBug:a}){return e.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:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:ie(s.failureStage)}),e.jsx("p",{className:"truncate text-xs text-fg-muted",title:s.failureMessage,children:s.failureMessage}),e.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[s.mailboxRole&&e.jsx(R,{tone:"warning",children:V(s.mailboxRole)}),e.jsx("span",{className:"truncate",title:s.mailboxPath,children:L(s.mailboxPath)}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:`uid ${s.uid}`}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:xe(s.quarantinedAt)}),s.attempts>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:`${s.attempts} attempts`})]})]})]}),e.jsx(r,{variant:"secondary",size:"sm",className:"shrink-0",icon:e.jsx(A,{className:"size-3.5"}),onClick:()=>a(s),children:"Cut a bug"})]})}function ue({entries:s,onCutBug:a}){return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),e.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."})]}),s.length===0&&e.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[e.jsx(_,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Every message has been read successfully. Nothing is set aside."})]}),s.length>1&&e.jsx(z,{tone:"warning",children:e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("span",{className:"font-semibold",children:`${s.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."]})]})}),s.length>0&&e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:s.map(t=>e.jsx(he,{entry:t,onCutBug:a},t.quarantineId))})]})}const pe=["Remit restarts. Mail stops loading for about a minute and this page will lose its connection while that happens.","Nothing is sent, deleted or moved. Your mail stays at your provider.","If the new version does not come back up, the version you are running now is restored automatically."];function fe({open:s,currentVersion:a,release:t,appliesSchemaMigration:i=!1,onClose:n,onConfirm:c}){return s?e.jsx(C,{open:!0,onClose:n,title:`Install Remit ${t.version}`,children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Install Remit ",t.version,"?"]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["You are on ",a,". ",t.version," was released"," ",T(t.releasedAt),"."]})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-auto px-4 py-3",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:t.summary}),e.jsxs("ul",{className:"space-y-2",children:[pe.map(l=>e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:l})]},l)),i&&e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:"This version updates the database while Remit is offline. The step forward cannot be undone by hand, but a failed start is still rolled back to the version and data you have now."})]})]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Good moment for this: when you are not waiting on a message."})]}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(r,{variant:"ghost",size:"sm",onClick:n,children:"Not now"}),e.jsx(p,{variant:"secondary",size:"sm",external:!0,href:t.releaseNotesUrl,icon:e.jsx(v,{className:"size-3.5"}),children:"Release notes"}),e.jsx(r,{size:"sm",icon:e.jsx(M,{className:"size-3.5"}),onClick:c,children:"Install and restart"})]})]})}):null}function o({children:s,tone:a}){return e.jsx("div",{className:O("rounded-sm border bg-surface px-row-inset py-3",a==="danger"?"border-danger/50":"border-line"),children:s})}function ge({state:s,onCheck:a,onInstall:t,onDismissResult:i,now:n=Date.now()}){const[c,l]=h.useState(null),m=s.status==="checking",d=s.status==="available",u=()=>{if(m){l("Already checking. The result appears here in a moment.");return}l(null),a()},f=()=>{if(!d&&s.status!=="rolledBack"&&s.status!=="abandoned"){l("There is no update to install. Check for updates first — if one is found it appears here.");return}l(null),t()},B=(()=>{switch(s.status){case"upToDate":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(_,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is the latest version.",e.jsxs("span",{className:"text-fg-subtle",children:[" ","Checked ",g(s.checkedAt,n),"."]})]})]}),e.jsx(r,{variant:"secondary",size:"sm",className:"shrink-0",onClick:u,children:"Check again"})]})});case"checking":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(y,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Looking for a newer version. You are on ",s.version,"."]})]}),e.jsx(r,{variant:"secondary",size:"sm",className:"shrink-0",onClick:u,children:"Check again"})]})});case"neverChecked":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx(ee,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["No update check has run yet. Remit checks for updates on its own in the background.",s.lastCheckedAt!==void 0&&e.jsxs("span",{className:"text-fg-subtle",children:[" ","Last checked"," ",g(s.lastCheckedAt,n),"."]})]})]}),e.jsx(r,{variant:"secondary",size:"sm",className:"shrink-0",onClick:u,children:"Check now"})]})});case"checkFailed":return e.jsx(o,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ae,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:"Could not reach the update source."}),e.jsx("p",{className:"text-xs text-fg-muted",children:s.reason}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You are still on ",s.version," and it keeps working.",s.lastCheckedAt!==void 0&&e.jsxs(e.Fragment,{children:[" ","Last successful check"," ",g(s.lastCheckedAt,n),"."]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(r,{variant:"secondary",size:"sm",onClick:u,children:"Try again"})})]})});case"available":return e.jsx(o,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-semibold text-fg",children:["Remit ",s.release.version]}),e.jsx(R,{tone:"accent",children:"update available"}),e.jsxs("span",{className:"text-2xs text-fg-subtle",children:["released ",T(s.release.releasedAt)," · you are on ",s.version]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.release.summary}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Installing restarts Remit, so mail stops loading for about a minute. If the new version does not come back up, the one you are running now is restored on its own."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(r,{size:"sm",icon:e.jsx(M,{className:"size-3.5"}),onClick:f,children:["Install ",s.release.version]}),e.jsx(p,{variant:"secondary",size:"sm",external:!0,href:s.release.releaseNotesUrl,icon:e.jsx(v,{className:"size-3.5"}),children:"Release notes"})]})]})});case"applying":return e.jsx(o,{children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(y,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing Remit ",s.target,". The restart screen has the details."]})]})});case"succeeded":return e.jsx(z,{tone:"success",onDismiss:i,children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-semibold",children:["Updated to Remit ",s.version,"."]}),e.jsxs("p",{children:["You were on ",s.previousVersion,"."," ",e.jsx("a",{href:s.releaseNotesUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"See what changed"}),"."]})]})});case"rolledBack":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start. Remit reports that it put ",s.version," back."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["You are running ",s.version," again. A failed update can still have changed things on the way — the log below is the only account of what it got as far as doing."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(r,{variant:"secondary",size:"sm",icon:e.jsx(k,{className:"size-3.5"}),onClick:f,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});case"unreachable":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Installing ",s.attemptedVersion," left the server unreachable."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Remit has answered again since, but nothing here can say what happened during the silence."})]})]}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand}),e.jsx("div",{className:"flex justify-end",children:e.jsx(r,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"rollbackFailed":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start, and Remit could not put ",s.previousVersion," back."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"This is the one outcome Remit cannot resolve on its own. The server is in a half-changed state and needs you at a shell. The log below is the only account of where it stopped."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log on the server:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(r,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"abandoned":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," was not installed. Nothing changed."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["The update stopped before it altered anything. You are still running ",s.version,"."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(r,{variant:"secondary",size:"sm",icon:e.jsx(k,{className:"size-3.5"}),onClick:f,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});default:return s}})();return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Updates"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This Remit runs on your own server, so it updates when you say so. Your mail lives at your provider and is never touched by an update."})]}),B,c&&e.jsx("p",{role:"status",className:"text-xs text-fg-muted",children:c})]})}function je(s){return{quarantineId:s.quarantineId,accountId:s.accountId,mailboxId:s.mailboxId,uidValidity:s.uidValidity,uid:s.uid,mailboxRole:s.mailboxRole?q[s.mailboxRole]:void 0,mailboxPath:s.mailboxPath,failureStage:s.failureStage,failureCode:s.failureCode,failureMessage:s.failureMessage,failurePartPath:s.failurePartPath,quarantinedAt:s.quarantinedAt,attempts:s.attempts,sizeBytes:s.sizeBytes,contentType:s.contentType,transferEncoding:s.transferEncoding,charset:s.charset,structure:s.structure,messageIdHash:s.messageIdHash,workerVersion:s.workerVersion}}function Ne(s){window.open(s,"_blank","noopener,noreferrer")}function be(s){return S(I({quarantine:P(s),title:de(s)}))}function ve({error:s}){return e.jsxs("section",{role:"alert",className:"space-y-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),e.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[e.jsx("p",{className:"text-sm font-medium text-danger",children:"The list of set-aside messages could not be read."}),e.jsx("p",{className:"break-words text-sm text-fg-muted",children:X(s)}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Mail may still have been set aside — this page cannot say either way until it can read the list. Reporting this gets it fixed."}),e.jsx(r,{variant:"secondary",size:"sm",icon:e.jsx(A,{className:"size-3.5"}),onClick:()=>Ne(S(I())),children:"Report this"})]})]})}function ye({entries:s,isPending:a,error:t}){const[i,n]=h.useState(null),[c,l]=h.useState(!1);if(a)return e.jsx("p",{className:"animate-pulse text-sm text-fg-subtle",children:"Checking for messages set aside…"});if(t)return e.jsx(ve,{error:t});const m=d=>{navigator.clipboard.writeText(d).then(()=>{l(!1),n(null)},()=>{l(!0),n(null)})};return e.jsxs(e.Fragment,{children:[c&&e.jsx("p",{role:"alert",className:"mb-3 text-sm text-danger",children:"The report was not copied — this browser refused clipboard access. Cut the bug again and use Open on GitHub, which needs no clipboard."}),e.jsx(ue,{entries:s,onCutBug:n}),e.jsx(me,{entry:i,issueUrl:i?be(i):"",onClose:()=>n(null),onCopy:m})]})}function ke(){const{data:s,isPending:a,error:t}=D(H());return e.jsx(ye,{entries:(s?.entries??[]).map(je),isPending:a,error:t})}function we(){const{surface:s,release:a,currentVersion:t,appliesSchemaMigration:i,onCheck:n,install:c,onDismissResult:l}=U(),[m,d]=h.useState(!1);return s.status!=="ready"?null:e.jsxs(e.Fragment,{children:[e.jsx(ge,{state:s.section,onCheck:n,onInstall:()=>d(!0),onDismissResult:l}),a&&t&&e.jsx(fe,{open:m,currentVersion:t,release:a,appliesSchemaMigration:i,onClose:()=>d(!1),onConfirm:()=>{d(!1),c(a.version)}})]})}function Ce(){return F().tlsMode!=="internal"?null:e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"TLS root certificate"}),e.jsx("p",{className:"text-sm text-fg-muted mb-2",children:"This deployment signs its own certificate. Import it into the trust store of each device you browse from, and the browser warning stops for good."}),e.jsx(p,{href:"/tls-root-ca.crt",download:!0,variant:"secondary",size:"sm",icon:e.jsx(se,{className:"size-3.5"}),children:"Download root certificate"})]})}function Re(s){try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function ze({sha:s=Y,commitUrl:a=Q,buildTime:t=G}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",a?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:s}):e.jsx("span",{className:"font-mono",children:s})," · ",e.jsxs("span",{children:["Built ",Re(t)]})]})}const Te=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Notification rules"})," and data export are coming in a future release."]}),e.jsxs("p",{children:["A message Remit cannot read is"," ",e.jsx("strong",{className:"text-fg",children:"set aside"})," rather than skipped, and the folder keeps syncing. Setting one aside is a defect in Remit, so every entry can be reported with the diagnostics already attached."]})]});function De(){const s=W(),[a,t]=h.useState(!0),i=n=>{const c=Z[n];c&&s({to:c})};return e.jsxs(K,{items:J,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:Te,helpOpen:a,onToggleHelp:()=>t(n=>!n),onSelect:i,onBackToMail:()=>{s({to:"/mail"})},children:[e.jsx(we,{}),e.jsx(ke,{}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsx("p",{className:"text-sm text-fg-muted",children:"Notification rules and data export are coming in a future release."})}),e.jsx(Ce,{}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(ze,{})]})]})}export{De as component};
4
+ `)}function de(s){return`Message quarantined: ${s.failureCode} at ${s.failureStage}`}function me({entry:s,onClose:a,issueUrl:t,onCopy:i}){if(!s)return null;const n=oe(s);return e.jsx(C,{open:!0,onClose:a,title:"Report this message",children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-fg",children:"Report this message"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This is everything the report contains. It describes the shape of the message — never its contents, addresses, subject, attachment names, or the parser's own error text."})]}),e.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:n}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(r,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(r,{variant:"secondary",size:"sm",icon:e.jsx(te,{className:"size-3.5"}),onClick:()=>i(n),children:"Copy report"}),e.jsx(p,{external:!0,size:"sm",href:t,icon:e.jsx(v,{className:"size-3.5"}),children:"Open on GitHub"})]})]})})}function xe(s){return new Date(s).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function he({entry:s,onCutBug:a}){return e.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:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:ie(s.failureStage)}),e.jsx("p",{className:"truncate text-xs text-fg-muted",title:s.failureMessage,children:s.failureMessage}),e.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[s.mailboxRole&&e.jsx(R,{tone:"warning",children:V(s.mailboxRole)}),e.jsx("span",{className:"truncate",title:s.mailboxPath,children:D(s.mailboxPath)}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:`uid ${s.uid}`}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:xe(s.quarantinedAt)}),s.attempts>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:`${s.attempts} attempts`})]})]})]}),e.jsx(r,{variant:"secondary",size:"sm",className:"shrink-0",icon:e.jsx(A,{className:"size-3.5"}),onClick:()=>a(s),children:"Cut a bug"})]})}function ue({entries:s,onCutBug:a}){return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),e.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."})]}),s.length===0&&e.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[e.jsx(_,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Every message has been read successfully. Nothing is set aside."})]}),s.length>1&&e.jsx(z,{tone:"warning",children:e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("span",{className:"font-semibold",children:`${s.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."]})]})}),s.length>0&&e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:s.map(t=>e.jsx(he,{entry:t,onCutBug:a},t.quarantineId))})]})}const pe=["Remit restarts. Mail stops loading for about a minute and this page will lose its connection while that happens.","Nothing is sent, deleted or moved. Your mail stays at your provider.","If the new version does not come back up, the version you are running now is restored automatically."];function fe({open:s,currentVersion:a,release:t,appliesSchemaMigration:i=!1,onClose:n,onConfirm:c}){return s?e.jsx(C,{open:!0,onClose:n,title:`Install Remit ${t.version}`,children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Install Remit ",t.version,"?"]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["You are on ",a,". ",t.version," was released"," ",T(t.releasedAt),"."]})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-auto px-4 py-3",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:t.summary}),e.jsxs("ul",{className:"space-y-2",children:[pe.map(l=>e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:l})]},l)),i&&e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:"This version updates the database while Remit is offline. The step forward cannot be undone by hand, but a failed start is still rolled back to the version and data you have now."})]})]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Good moment for this: when you are not waiting on a message."})]}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(r,{variant:"ghost",size:"sm",onClick:n,children:"Not now"}),e.jsx(p,{variant:"secondary",size:"sm",external:!0,href:t.releaseNotesUrl,icon:e.jsx(v,{className:"size-3.5"}),children:"Release notes"}),e.jsx(r,{size:"sm",icon:e.jsx(M,{className:"size-3.5"}),onClick:c,children:"Install and restart"})]})]})}):null}function o({children:s,tone:a}){return e.jsx("div",{className:L("rounded-sm border bg-surface px-row-inset py-3",a==="danger"?"border-danger/50":"border-line"),children:s})}function ge({state:s,onCheck:a,onInstall:t,onDismissResult:i,now:n=Date.now()}){const[c,l]=h.useState(null),m=s.status==="checking",d=s.status==="available",u=()=>{if(m){l("Already checking. The result appears here in a moment.");return}l(null),a()},f=()=>{if(!d&&s.status!=="rolledBack"&&s.status!=="abandoned"){l("There is no update to install. Check for updates first — if one is found it appears here.");return}l(null),t()},B=(()=>{switch(s.status){case"upToDate":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(_,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is the latest version.",e.jsxs("span",{className:"text-fg-subtle",children:[" ","Checked ",g(s.checkedAt,n),"."]})]})]}),e.jsx(r,{variant:"secondary",size:"sm",className:"shrink-0",onClick:u,children:"Check again"})]})});case"checking":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(y,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Looking for a newer version. You are on ",s.version,"."]})]}),e.jsx(r,{variant:"secondary",size:"sm",className:"shrink-0",onClick:u,children:"Check again"})]})});case"neverChecked":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx(ee,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["No update check has run yet. Remit checks for updates on its own in the background.",s.lastCheckedAt!==void 0&&e.jsxs("span",{className:"text-fg-subtle",children:[" ","Last checked"," ",g(s.lastCheckedAt,n),"."]})]})]}),e.jsx(r,{variant:"secondary",size:"sm",className:"shrink-0",onClick:u,children:"Check now"})]})});case"checkFailed":return e.jsx(o,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ae,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:"Could not reach the update source."}),e.jsx("p",{className:"text-xs text-fg-muted",children:s.reason}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You are still on ",s.version," and it keeps working.",s.lastCheckedAt!==void 0&&e.jsxs(e.Fragment,{children:[" ","Last successful check"," ",g(s.lastCheckedAt,n),"."]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(r,{variant:"secondary",size:"sm",onClick:u,children:"Try again"})})]})});case"available":return e.jsx(o,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-semibold text-fg",children:["Remit ",s.release.version]}),e.jsx(R,{tone:"accent",children:"update available"}),e.jsxs("span",{className:"text-2xs text-fg-subtle",children:["released ",T(s.release.releasedAt)," · you are on ",s.version]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.release.summary}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Installing restarts Remit, so mail stops loading for about a minute. If the new version does not come back up, the one you are running now is restored on its own."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(r,{size:"sm",icon:e.jsx(M,{className:"size-3.5"}),onClick:f,children:["Install ",s.release.version]}),e.jsx(p,{variant:"secondary",size:"sm",external:!0,href:s.release.releaseNotesUrl,icon:e.jsx(v,{className:"size-3.5"}),children:"Release notes"})]})]})});case"applying":return e.jsx(o,{children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(y,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing Remit ",s.target,". The restart screen has the details."]})]})});case"succeeded":return e.jsx(z,{tone:"success",onDismiss:i,children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-semibold",children:["Updated to Remit ",s.version,"."]}),e.jsxs("p",{children:["You were on ",s.previousVersion,"."," ",e.jsx("a",{href:s.releaseNotesUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"See what changed"}),"."]})]})});case"rolledBack":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start. Remit reports that it put ",s.version," back."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["You are running ",s.version," again. A failed update can still have changed things on the way — the log below is the only account of what it got as far as doing."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(r,{variant:"secondary",size:"sm",icon:e.jsx(k,{className:"size-3.5"}),onClick:f,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});case"unreachable":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Installing ",s.attemptedVersion," left the server unreachable."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Remit has answered again since, but nothing here can say what happened during the silence."})]})]}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand}),e.jsx("div",{className:"flex justify-end",children:e.jsx(r,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"rollbackFailed":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start, and Remit could not put ",s.previousVersion," back."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"This is the one outcome Remit cannot resolve on its own. The server is in a half-changed state and needs you at a shell. The log below is the only account of where it stopped."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log on the server:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(r,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"abandoned":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," was not installed. Nothing changed."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["The update stopped before it altered anything. You are still running ",s.version,"."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(r,{variant:"secondary",size:"sm",icon:e.jsx(k,{className:"size-3.5"}),onClick:f,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});default:return s}})();return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Updates"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This Remit runs on your own server, so it updates when you say so. Your mail lives at your provider and is never touched by an update."})]}),B,c&&e.jsx("p",{role:"status",className:"text-xs text-fg-muted",children:c})]})}function je(s){return{quarantineId:s.quarantineId,accountId:s.accountId,mailboxId:s.mailboxId,uidValidity:s.uidValidity,uid:s.uid,mailboxRole:s.mailboxRole?O[s.mailboxRole]:void 0,mailboxPath:s.mailboxPath,failureStage:s.failureStage,failureCode:s.failureCode,failureMessage:s.failureMessage,failurePartPath:s.failurePartPath,quarantinedAt:s.quarantinedAt,attempts:s.attempts,sizeBytes:s.sizeBytes,contentType:s.contentType,transferEncoding:s.transferEncoding,charset:s.charset,structure:s.structure,messageIdHash:s.messageIdHash,workerVersion:s.workerVersion}}function Ne(s){window.open(s,"_blank","noopener,noreferrer")}function be(s){return S(I({quarantine:P(s),title:de(s)}))}function ve({error:s}){return e.jsxs("section",{role:"alert",className:"space-y-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),e.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[e.jsx("p",{className:"text-sm font-medium text-danger",children:"The list of set-aside messages could not be read."}),e.jsx("p",{className:"break-words text-sm text-fg-muted",children:X(s)}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Mail may still have been set aside — this page cannot say either way until it can read the list. Reporting this gets it fixed."}),e.jsx(r,{variant:"secondary",size:"sm",icon:e.jsx(A,{className:"size-3.5"}),onClick:()=>Ne(S(I())),children:"Report this"})]})]})}function ye({entries:s,isPending:a,error:t}){const[i,n]=h.useState(null),[c,l]=h.useState(!1);if(a)return e.jsx("p",{className:"animate-pulse text-sm text-fg-subtle",children:"Checking for messages set aside…"});if(t)return e.jsx(ve,{error:t});const m=d=>{navigator.clipboard.writeText(d).then(()=>{l(!1),n(null)},()=>{l(!0),n(null)})};return e.jsxs(e.Fragment,{children:[c&&e.jsx("p",{role:"alert",className:"mb-3 text-sm text-danger",children:"The report was not copied — this browser refused clipboard access. Cut the bug again and use Open on GitHub, which needs no clipboard."}),e.jsx(ue,{entries:s,onCutBug:n}),e.jsx(me,{entry:i,issueUrl:i?be(i):"",onClose:()=>n(null),onCopy:m})]})}function ke(){const{data:s,isPending:a,error:t}=q(H());return e.jsx(ye,{entries:(s?.entries??[]).map(je),isPending:a,error:t})}function we(){const{surface:s,release:a,currentVersion:t,appliesSchemaMigration:i,onCheck:n,install:c,onDismissResult:l}=U(),[m,d]=h.useState(!1);return s.status!=="ready"?null:e.jsxs(e.Fragment,{children:[e.jsx(ge,{state:s.section,onCheck:n,onInstall:()=>d(!0),onDismissResult:l}),a&&t&&e.jsx(fe,{open:m,currentVersion:t,release:a,appliesSchemaMigration:i,onClose:()=>d(!1),onConfirm:()=>{d(!1),c(a.version)}})]})}function Ce(){return F().tlsMode!=="internal"?null:e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"TLS root certificate"}),e.jsx("p",{className:"text-sm text-fg-muted mb-2",children:"This deployment signs its own certificate. Import it into the trust store of each device you browse from, and the browser warning stops for good."}),e.jsx(p,{href:"/tls-root-ca.crt",download:!0,variant:"secondary",size:"sm",icon:e.jsx(se,{className:"size-3.5"}),children:"Download root certificate"})]})}function Re(s){try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function ze({sha:s=Y,commitUrl:a=Q,buildTime:t=G}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",a?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:s}):e.jsx("span",{className:"font-mono",children:s})," · ",e.jsxs("span",{children:["Built ",Re(t)]})]})}const Te=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Notification rules"})," and data export are coming in a future release."]}),e.jsxs("p",{children:["A message Remit cannot read is"," ",e.jsx("strong",{className:"text-fg",children:"set aside"})," rather than skipped, and the folder keeps syncing. Setting one aside is a defect in Remit, so every entry can be reported with the diagnostics already attached."]})]});function qe(){const s=W(),[a,t]=h.useState(!0),i=n=>{const c=Z[n];c&&s({to:c})};return e.jsxs(K,{items:J,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:Te,helpOpen:a,onToggleHelp:()=>t(n=>!n),onSelect:i,onBackToMail:()=>{s({to:"/mail"})},children:[e.jsx(we,{}),e.jsx(ke,{}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsx("p",{className:"text-sm text-fg-muted",children:"Notification rules and data export are coming in a future release."})}),e.jsx(Ce,{}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(ze,{})]})]})}export{qe as component};
@@ -1 +1 @@
1
- import{p as g,r as s,aS as y,j as e,ay as u,aT as l,aC as S,aU as T}from"./index-Bqn7f16e.js";import{S as b}from"./settings-screen-CH2hBhXZ.js";import"./avatar-CmvuzecB.js";import"./menu-vEH9STs_.js";import"./circle-help-C_AXwAaV.js";const o="remit.density";function j(){return typeof localStorage>"u"?"comfortable":localStorage.getItem(o)??"comfortable"}const v=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Density"})," controls how much information fits on screen. Compact is great on smaller displays; Comfortable gives each item more breathing room."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Theme"})," switches between light, dark, and system-preference modes instantly. The change takes effect across the whole app immediately."]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Preferences are stored locally in this browser. Server-side sync is coming soon."})]});function E(){const a=g(),[i,r]=s.useState(!0),[c,m]=s.useState(j),[p,d]=s.useState(y),h=t=>{m(t),typeof localStorage<"u"&&localStorage.setItem(o,t)},f=t=>{d(t),T(t)},x=t=>{const n=S[t];n&&a({to:n})};return e.jsx(b,{items:u,activeId:"appearance",title:"Appearance",description:"Display density and colour theme — instant-apply.",help:v,helpOpen:i,onToggleHelp:()=>r(t=>!t),onSelect:x,onBackToMail:()=>{a({to:"/mail"})},children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Density"}),e.jsx(l,{name:"density","aria-label":"Density",value:c,onChange:h,options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Controls the spacing of message rows in the mail list."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Theme"}),e.jsx(l,{name:"theme","aria-label":"Theme",value:p,onChange:f,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Applies immediately. System default follows your OS preference."})]})]})})}export{E as component};
1
+ import{m as g,r as s,aL as y,j as e,ar as u,aM as l,av as S,aN as b}from"./index-hsglfEcH.js";import{S as j}from"./settings-screen-C21f5beW.js";import"./avatar-PxGVQCQm.js";import"./menu-CblIqBpR.js";import"./circle-help-DNSDxunA.js";const o="remit.density";function v(){return typeof localStorage>"u"?"comfortable":localStorage.getItem(o)??"comfortable"}const N=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Density"})," controls how much information fits on screen. Compact is great on smaller displays; Comfortable gives each item more breathing room."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Theme"})," switches between light, dark, and system-preference modes instantly. The change takes effect across the whole app immediately."]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Preferences are stored locally in this browser. Server-side sync is coming soon."})]});function E(){const a=g(),[i,r]=s.useState(!0),[c,m]=s.useState(v),[p,d]=s.useState(y),h=t=>{m(t),typeof localStorage<"u"&&localStorage.setItem(o,t)},f=t=>{d(t),b(t)},x=t=>{const n=S[t];n&&a({to:n})};return e.jsx(j,{items:u,activeId:"appearance",title:"Appearance",description:"Display density and colour theme — instant-apply.",help:N,helpOpen:i,onToggleHelp:()=>r(t=>!t),onSelect:x,onBackToMail:()=>{a({to:"/mail"})},children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Density"}),e.jsx(l,{name:"density","aria-label":"Density",value:c,onChange:h,options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Controls the spacing of message rows in the mail list."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Theme"}),e.jsx(l,{name:"theme","aria-label":"Theme",value:p,onChange:f,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Applies immediately. System default follows your OS preference."})]})]})})}export{E as component};
@@ -0,0 +1 @@
1
+ import{c as M,r as h,j as i,B as R,b as g,ba as _}from"./index-hsglfEcH.js";const k=M("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);const $=M("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),y=4,E=8;function I(e,t,s){const n=Math.max(E,window.innerWidth-t.width-E),o=s==="end"?e.right-t.width:e.left,r=Math.min(Math.max(o,E),n),l=e.bottom+y,c=e.top-y-t.height,f=l+t.height<=window.innerHeight-E||c<E?l:c;return{left:r,top:f}}function P(e,t,s,n){const[o,r]=h.useState(null),l=h.useRef(n);return l.current=n,h.useLayoutEffect(()=>{if(!t){r(null);return}const c=()=>{const p=e.current,f=l.current();if(!p||!f)return;const a=p.getBoundingClientRect(),x={width:a.right-a.left,height:a.bottom-a.top},d=I(f,x,s);r(m=>m?.left===d.left&&m.top===d.top?m:{position:"fixed",left:d.left,top:d.top})};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[t,s,e]),o}function S({open:e,align:t="start",getAnchor:s,panelRef:n,children:o}){const r=P(n,e,t,s);return e?_.createPortal(i.jsx("div",{style:r??{position:"fixed",visibility:"hidden"},children:o}),document.body):null}function j({label:e,children:t,className:s,ref:n,onKeyDown:o,"data-testid":r}){return i.jsx("div",{ref:n,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:o,"data-testid":r,className:g("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",s),children:t})}function T({label:e,icon:t,onSelect:s,className:n,lang:o,"data-testid":r}){return i.jsxs("button",{type:"button",role:"menuitem",lang:o,onClick:s,"data-testid":r,className:g("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",n),children:[t&&i.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function U({triggerLabel:e,triggerIcon:t,triggerText:s,items:n,align:o="end",touch:r=!0,className:l,triggerClassName:c,nested:p=!1,children:f}){const[a,x]=h.useState(!1),d=h.useRef(null),m=h.useRef(null);return h.useEffect(()=>{if(!a)return;const u=b=>{const v=b.target;d.current?.contains(v)||m.current?.contains(v)||x(!1)},w=b=>{b.key==="Escape"&&x(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",w)}},[a]),n.length===0&&!f?null:i.jsxs("div",{ref:d,className:g("relative",l),...p?{role:"none"}:{},children:[i.jsx(R,{variant:"ghost",size:"sm",icon:t??i.jsx(k,{className:"size-5"}),onClick:()=>x(u=>!u),"aria-label":e,"aria-haspopup":"menu","aria-expanded":a,...p?{role:"menuitem"}:{},className:g(r&&"min-h-11 min-w-11 px-0",c),children:s}),i.jsx(S,{open:a,align:o,panelRef:m,getAnchor:()=>d.current?.getBoundingClientRect()??null,children:i.jsxs(j,{ref:m,children:[n.map(u=>i.jsx(T,{label:u.label,icon:u.icon,onSelect:()=>{x(!1),u.onSelect()}},u.key)),f]})})]})}const B=/[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028\u2029\u202a-\u202e\u2066-\u2069\ufeff]/g,C=/[<>:"|?*]/g,z=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\.|$)/i,A=120,H=12,F="attachment",N=e=>{const t=[...e];if(t.length<=A)return e;const s=e.lastIndexOf("."),n=s>0&&[...e.slice(s)].length<=H?e.slice(s):"",o=A-[...n].length;return t.slice(0,o).join("")+n},G=(e,t=F)=>{const n=e.replace(B,"").split(/[/\\]/),r=(n[n.length-1]??"").replace(C,"_").replace(/^[.\s]+/,"").replace(/[.\s]+$/,"");if(r.length===0)return N(t);const l=z.test(r)?`_${r}`:r;return N(l)},L=["KB","MB","GB","TB"],O=e=>{if(!Number.isFinite(e)||e<0)return"unknown size";const t=Math.round(e);if(t<1024)return t===1?"1 byte":`${t} bytes`;const s=1023.95;let n=t/1024,o=0;for(;n>=s&&o<L.length-1;)n/=1024,o+=1;return`${n.toFixed(1).replace(/\.0$/,"")} ${L[o]}`};export{k as E,U as P,$ as U,S as a,j as b,T as c,O as f,G as s};
@@ -1 +1 @@
1
- import{r as a,j as h,b as u}from"./index-Bqn7f16e.js";const p={sm:"size-7 text-2xs",md:"size-9 text-sm",lg:"size-11 text-md"},n=["oklch(0.6 0.08 150)","oklch(0.6 0.08 185)","oklch(0.6 0.08 215)","oklch(0.6 0.07 250)","oklch(0.6 0.07 310)","oklch(0.62 0.07 110)"],d="oklch(0.97 0.012 90)";function f(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function m({name:e,email:t,size:l="md",className:c}){const i=a.useMemo(()=>{const r=t??e;let s=0;for(let o=0;o<r.length;o++)s=s*31+r.charCodeAt(o)>>>0;return n[s%n.length]},[e,t]);return h.jsx("span",{className:u("inline-flex shrink-0 items-center justify-center rounded-full font-semibold select-none",p[l],c),style:{backgroundColor:i,color:d},"aria-hidden":!0,children:f(e)})}export{m as A};
1
+ import{r as a,j as h,b as u}from"./index-hsglfEcH.js";const p={sm:"size-7 text-2xs",md:"size-9 text-sm",lg:"size-11 text-md"},n=["oklch(0.6 0.08 150)","oklch(0.6 0.08 185)","oklch(0.6 0.08 215)","oklch(0.6 0.07 250)","oklch(0.6 0.07 310)","oklch(0.62 0.07 110)"],d="oklch(0.97 0.012 90)";function f(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function m({name:e,email:t,size:l="md",className:c}){const i=a.useMemo(()=>{const r=t??e;let s=0;for(let o=0;o<r.length;o++)s=s*31+r.charCodeAt(o)>>>0;return n[s%n.length]},[e,t]);return h.jsx("span",{className:u("inline-flex shrink-0 items-center justify-center rounded-full font-semibold select-none",p[l],c),style:{backgroundColor:i,color:d},"aria-hidden":!0,children:f(e)})}export{m as A};
@@ -1 +1 @@
1
- import{r as n,j as o,b as v}from"./index-Bqn7f16e.js";const w=320,I="cubic-bezier(0.32, 0.9, 0.3, 1)",N=.5,k=.4,C=360;function E(r){return Math.sign(r)*Math.sqrt(Math.abs(r))*4}function T({open:r,onClose:c,children:g,dismissLabel:Y="Dismiss"}){const d=n.useRef(null),[i,S]=n.useState(C),[b,u]=n.useState(null);n.useLayoutEffect(()=>{const t=d.current;if(!t)return;const e=()=>S(t.offsetHeight);e();const s=new ResizeObserver(e);return s.observe(t),()=>s.disconnect()},[]);const l=n.useRef(null),y=n.useCallback(t=>{t.currentTarget.setPointerCapture(t.pointerId),l.current={startY:t.clientY,lastY:t.clientY,lastT:t.timeStamp,velocity:0,moved:!1},u(0)},[]),M=n.useCallback(t=>{const e=l.current;if(!e)return;const s=t.timeStamp-e.lastT;s>0&&(e.velocity=(t.clientY-e.lastY)/s),e.lastY=t.clientY,e.lastT=t.timeStamp;const a=t.clientY-e.startY;Math.abs(a)>4&&(e.moved=!0);const j=a<0?E(a):a;u(j)},[]),m=n.useCallback(()=>{const t=l.current;if(l.current=null,!t)return;const e=t.lastY-t.startY,a=t.velocity>N||e>i*k;u(null),a&&c()},[i,c]),x=b!==null,p=r?b??0:i,f=Math.min(Math.max(1-p/i,0),1),h=x?"none":`transform ${w}ms ${I}`;return o.jsxs("div",{className:v("absolute inset-0 z-40 select-none overflow-hidden",r||x?"":"pointer-events-none"),children:[o.jsx("button",{type:"button","aria-label":Y,tabIndex:-1,onClick:c,className:v("absolute inset-0 bg-black/40",f>0?"pointer-events-auto":"pointer-events-none"),style:{opacity:f*.6,transition:h.replace("transform","opacity")}}),o.jsxs("div",{ref:d,className:"absolute inset-x-0 bottom-0 flex max-h-[92%] flex-col rounded-t-3xl border-t border-line bg-surface pb-[env(safe-area-inset-bottom,0px)] shadow-2xl shadow-black/30",style:{transform:`translateY(${p}px)`,transition:h},children:[o.jsx("div",{role:"slider","aria-label":"Drag down to dismiss","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f*100),tabIndex:0,onPointerDown:y,onPointerMove:M,onPointerUp:m,onPointerCancel:m,className:"flex cursor-grab touch-none justify-center pb-1 pt-2.5 active:cursor-grabbing",children:o.jsx("div",{className:"h-1 w-10 rounded-full bg-fg-subtle/40"})}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:g})]})]})}export{T as B};
1
+ import{r as n,j as o,b as v}from"./index-hsglfEcH.js";const w=320,I="cubic-bezier(0.32, 0.9, 0.3, 1)",N=.5,k=.4,C=360;function E(r){return Math.sign(r)*Math.sqrt(Math.abs(r))*4}function T({open:r,onClose:c,children:g,dismissLabel:Y="Dismiss"}){const d=n.useRef(null),[i,S]=n.useState(C),[b,u]=n.useState(null);n.useLayoutEffect(()=>{const t=d.current;if(!t)return;const e=()=>S(t.offsetHeight);e();const s=new ResizeObserver(e);return s.observe(t),()=>s.disconnect()},[]);const l=n.useRef(null),y=n.useCallback(t=>{t.currentTarget.setPointerCapture(t.pointerId),l.current={startY:t.clientY,lastY:t.clientY,lastT:t.timeStamp,velocity:0,moved:!1},u(0)},[]),M=n.useCallback(t=>{const e=l.current;if(!e)return;const s=t.timeStamp-e.lastT;s>0&&(e.velocity=(t.clientY-e.lastY)/s),e.lastY=t.clientY,e.lastT=t.timeStamp;const a=t.clientY-e.startY;Math.abs(a)>4&&(e.moved=!0);const j=a<0?E(a):a;u(j)},[]),m=n.useCallback(()=>{const t=l.current;if(l.current=null,!t)return;const e=t.lastY-t.startY,a=t.velocity>N||e>i*k;u(null),a&&c()},[i,c]),x=b!==null,p=r?b??0:i,f=Math.min(Math.max(1-p/i,0),1),h=x?"none":`transform ${w}ms ${I}`;return o.jsxs("div",{className:v("absolute inset-0 z-40 select-none overflow-hidden",r||x?"":"pointer-events-none"),children:[o.jsx("button",{type:"button","aria-label":Y,tabIndex:-1,onClick:c,className:v("absolute inset-0 bg-black/40",f>0?"pointer-events-auto":"pointer-events-none"),style:{opacity:f*.6,transition:h.replace("transform","opacity")}}),o.jsxs("div",{ref:d,className:"absolute inset-x-0 bottom-0 flex max-h-[92%] flex-col rounded-t-3xl border-t border-line bg-surface pb-[env(safe-area-inset-bottom,0px)] shadow-2xl shadow-black/30",style:{transform:`translateY(${p}px)`,transition:h},children:[o.jsx("div",{role:"slider","aria-label":"Drag down to dismiss","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f*100),tabIndex:0,onPointerDown:y,onPointerMove:M,onPointerUp:m,onPointerCancel:m,className:"flex cursor-grab touch-none justify-center pb-1 pt-2.5 active:cursor-grabbing",children:o.jsx("div",{className:"h-1 w-10 rounded-full bg-fg-subtle/40"})}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:g})]})]})}export{T as B};
@@ -0,0 +1 @@
1
+ import{j as r,U as i}from"./index-hsglfEcH.js";import{a as m}from"./search-view-CIqdN9ZA.js";import{B as o}from"./BriefPane-puM8DuEu.js";import{u as p}from"./useSearchMirror-BT4CR3rd.js";import"./useMessageBodyContent-BmfPKs9C.js";import{f as e}from"./search-token-index-DMBdkNPl.js";import"./FullCompose-CF-9-qhJ.js";import"./ErrorState-DE7fNU8i.js";import"./index-Bc4oWEgj.js";import"./useSignature-Bs8Za-GC.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-IVFdfd-Z.js";import"./useMediaQuery-Do73WdTM.js";import"./compose-AxF0yn31.js";import"./confirm-dialog-CywFW_iF.js";import"./useSearchTokenContext-BAqGqR_E.js";import"./kbd-BnNxZdo9.js";import"./enums-CCxx0t2v.js";import"./search-scope-BJ5VJ_uq.js";import"./MailListHeader-CYgtRJbp.js";import"./attachment-file-tMJndpDR.js";import"./mail-DhWlCt7m.js";import"./avatar-PxGVQCQm.js";import"./format-De9HZKjg.js";import"./download-DmAN5nYp.js";import"./shield-check-Df-A4ExU.js";import"./move-options-PPPCxetl.js";import"./useFilters-BDcT8xyT.js";import"./clock-C6eJ9JFT.js";import"./menu-CblIqBpR.js";import"./useRefreshControl-VEa-1NUQ.js";import"./circle-check-big-CKyhX0ge.js";import"./useLabels-DgAdgt4V.js";import"./useSemanticSearch-Crkt2g7K.js";import"./search-query-Cr_ZXBCp.js";function H(){const t=e();return p({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{H as component};
@@ -1 +1 @@
1
- import{j as r}from"./index-Bqn7f16e.js";import{E as t}from"./ErrorState-CJ2aoLG_.js";const i=({error:e,reset:o})=>r.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:r.jsx(t,{title:"Couldn't load your mailboxes",error:e,onRetry:o})});export{i as errorComponent};
1
+ import{j as r}from"./index-hsglfEcH.js";import{E as t}from"./ErrorState-DE7fNU8i.js";const i=({error:e,reset:o})=>r.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:r.jsx(t,{title:"Couldn't load your mailboxes",error:e,onRetry:o})});export{i as errorComponent};
@@ -1,2 +1,2 @@
1
- import{c$ as A,L as $}from"./index-Bqn7f16e.js";function X(_,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const l in y)if(l!=="default"&&!(l in _)){const p=Object.getOwnPropertyDescriptor(y,l);p&&Object.defineProperty(_,l,p.get?p:{enumerable:!0,get:()=>y[l]})}}}return Object.freeze(Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}},H;function J(){return H||(H=1,(function(_,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof A<"u"&&A,y=(function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p})();(function(p){(function(h){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof A<"u"&&A||{},u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function F(e){return e&&DataView.prototype.isPrototypeOf(e)}if(u.arrayBuffer)var q=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C=ArrayBuffer.isView||function(e){return e&&q.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function T(e){return typeof e!="string"&&(e=String(e)),e}function B(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return u.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}i.prototype.append=function(e,t){e=v(e),t=T(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},i.prototype.delete=function(e){delete this.map[v(e)]},i.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},i.prototype.set=function(e,t){this.map[v(e)]=T(t)},i.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),B(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),B(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),B(e)},u.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);function O(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function D(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function I(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function M(e){var t=new FileReader,r=D(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=n?n[1]:"utf-8";return t.readAsText(e,s),r}function L(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function R(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:u.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u.arrayBuffer&&u.blob&&F(e)?(this._bodyArrayBuffer=R(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||C(e))?this._bodyArrayBuffer=R(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=O(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(u.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function k(e){var t=e.toUpperCase();return N.indexOf(t)>-1?t:e}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new i(t.headers)),this.method=k(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||(function(){if("AbortController"in a){var o=new AbortController;return o.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})};function z(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(o))}}),t}function G(e){var t=new i,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
2
- `)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var g=s.join(":").trim();try{t.append(o,g)}catch(x){console.warn("Response "+x.message)}}}),t}U.call(w.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}U.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var V=[301,302,303,307,308];c.redirect=function(e,t){if(V.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},h.DOMException=a.DOMException;try{new h.DOMException}catch{h.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function P(e,t){return new Promise(function(r,n){var s=new w(e,t);if(s.signal&&s.signal.aborted)return n(new h.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function g(){o.abort()}o.onload=function(){var f={statusText:o.statusText,headers:G(o.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(o.status<200||o.status>599)?f.status=200:f.status=o.status,f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var m="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(m,f))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){n(new h.DOMException("Aborted","AbortError"))},0)};function x(f){try{return f===""&&a.location.href?a.location.href:f}catch{return f}}if(o.open(s.method,x(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(u.blob?o.responseType="blob":u.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||a.Headers&&t.headers instanceof a.Headers)){var j=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){j.push(v(f)),o.setRequestHeader(f,T(t.headers[f]))}),s.headers.forEach(function(f,m){j.indexOf(m)===-1&&o.setRequestHeader(m,f)})}else s.headers.forEach(function(f,m){o.setRequestHeader(m,f)});s.signal&&(s.signal.addEventListener("abort",g),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",g)}),o.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}return P.polyfill=!0,a.fetch||(a.fetch=P,a.Headers=i,a.Request=w,a.Response=c),h.Headers=i,h.Request=w,h.Response=c,h.fetch=P,h})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var l=b.fetch?b:y;d=l.fetch,d.default=l.fetch,d.fetch=l.fetch,d.Headers=l.Headers,d.Request=l.Request,d.Response=l.Response,_.exports=d})(E,E.exports)),E.exports}var S=J();const Z=$(S),Q=X({__proto__:null,default:Z},[S]);export{Q as b};
1
+ import{d5 as A,G as $}from"./index-hsglfEcH.js";function X(_,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const l in y)if(l!=="default"&&!(l in _)){const p=Object.getOwnPropertyDescriptor(y,l);p&&Object.defineProperty(_,l,p.get?p:{enumerable:!0,get:()=>y[l]})}}}return Object.freeze(Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}},H;function J(){return H||(H=1,(function(_,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof A<"u"&&A,y=(function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p})();(function(p){(function(h){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof A<"u"&&A||{},u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function F(e){return e&&DataView.prototype.isPrototypeOf(e)}if(u.arrayBuffer)var q=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C=ArrayBuffer.isView||function(e){return e&&q.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function T(e){return typeof e!="string"&&(e=String(e)),e}function B(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return u.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}i.prototype.append=function(e,t){e=v(e),t=T(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},i.prototype.delete=function(e){delete this.map[v(e)]},i.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},i.prototype.set=function(e,t){this.map[v(e)]=T(t)},i.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),B(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),B(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),B(e)},u.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);function O(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function D(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function I(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function M(e){var t=new FileReader,r=D(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=n?n[1]:"utf-8";return t.readAsText(e,s),r}function L(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function R(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:u.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u.arrayBuffer&&u.blob&&F(e)?(this._bodyArrayBuffer=R(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||C(e))?this._bodyArrayBuffer=R(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=O(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(u.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(G)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function k(e){var t=e.toUpperCase();return N.indexOf(t)>-1?t:e}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new i(t.headers)),this.method=k(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||(function(){if("AbortController"in a){var o=new AbortController;return o.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})};function G(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(o))}}),t}function z(e){var t=new i,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
2
+ `)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var g=s.join(":").trim();try{t.append(o,g)}catch(x){console.warn("Response "+x.message)}}}),t}U.call(w.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}U.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var V=[301,302,303,307,308];c.redirect=function(e,t){if(V.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},h.DOMException=a.DOMException;try{new h.DOMException}catch{h.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function P(e,t){return new Promise(function(r,n){var s=new w(e,t);if(s.signal&&s.signal.aborted)return n(new h.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function g(){o.abort()}o.onload=function(){var f={statusText:o.statusText,headers:z(o.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(o.status<200||o.status>599)?f.status=200:f.status=o.status,f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var m="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(m,f))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){n(new h.DOMException("Aborted","AbortError"))},0)};function x(f){try{return f===""&&a.location.href?a.location.href:f}catch{return f}}if(o.open(s.method,x(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(u.blob?o.responseType="blob":u.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||a.Headers&&t.headers instanceof a.Headers)){var j=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){j.push(v(f)),o.setRequestHeader(f,T(t.headers[f]))}),s.headers.forEach(function(f,m){j.indexOf(m)===-1&&o.setRequestHeader(m,f)})}else s.headers.forEach(function(f,m){o.setRequestHeader(m,f)});s.signal&&(s.signal.addEventListener("abort",g),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",g)}),o.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}return P.polyfill=!0,a.fetch||(a.fetch=P,a.Headers=i,a.Request=w,a.Response=c),h.Headers=i,h.Request=w,h.Response=c,h.fetch=P,h})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var l=b.fetch?b:y;d=l.fetch,d.default=l.fetch,d.fetch=l.fetch,d.Headers=l.Headers,d.Request=l.Request,d.Response=l.Response,_.exports=d})(E,E.exports)),E.exports}var S=J();const Z=$(S),Q=X({__proto__:null,default:Z},[S]);export{Q as b};
@@ -1 +1 @@
1
- import{c as a}from"./index-Bqn7f16e.js";const t=a("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"}]]);export{t as B};
1
+ import{c as a}from"./index-hsglfEcH.js";const t=a("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"}]]);export{t as B};
@@ -1 +1 @@
1
- import{c}from"./index-Bqn7f16e.js";const r=c("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{r as C};
1
+ import{c}from"./index-hsglfEcH.js";const r=c("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{r as C};
@@ -1 +1 @@
1
- import{c}from"./index-Bqn7f16e.js";const t=c("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);export{t as C};
1
+ import{c}from"./index-hsglfEcH.js";const t=c("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);export{t as C};
@@ -1 +1 @@
1
- import{c}from"./index-Bqn7f16e.js";const p=c("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);export{p as C};
1
+ import{c}from"./index-hsglfEcH.js";const p=c("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);export{p as C};
@@ -1 +1 @@
1
- import{c}from"./index-Bqn7f16e.js";const o=c("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);export{o as C};
1
+ import{c}from"./index-hsglfEcH.js";const o=c("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);export{o as C};
@@ -0,0 +1 @@
1
+ import{w as n,r as u,m}from"./index-hsglfEcH.js";import{f as c,c as g,d as h}from"./useMessageBodyContent-BmfPKs9C.js";const f="/mail/brief/compose/{-$outboxMessageId}",p="/mail/flagged/compose/{-$outboxMessageId}",b="/mail/outbox/compose/{-$outboxMessageId}",d="/mail/$mailboxId/compose/{-$outboxMessageId}";function C(){const o=n({from:f,shouldThrow:!1}),e=n({from:p,shouldThrow:!1}),s=n({from:b,shouldThrow:!1}),a=n({from:d,shouldThrow:!1});return o??e??s??a}function E(){return C()!==void 0}function k(){return C()?.outboxMessageId}function x(){const o=g({select:s=>h(s.matches)?.list}),e=n({from:"/mail/$mailboxId",shouldThrow:!1});return{list:o,mailboxId:e?.mailboxId}}function O(o,e,s){return o==="flagged"?{to:p,params:{outboxMessageId:s}}:o==="outbox"?{to:b,params:{outboxMessageId:s}}:o==="mailbox"&&e?{to:d,params:{mailboxId:e,outboxMessageId:s}}:{to:f,params:{outboxMessageId:s}}}function i(){const o=m(),e=c(),{list:s,mailboxId:a}=x();return u.useCallback((r,t)=>{o({...O(s,a,r),search:l=>l,hash:t?.keepPanels?!0:e,replace:t?.replace??!1})},[o,e,s,a])}function w(){const o=i();return u.useCallback(()=>o(void 0),[o])}function M(){const o=i();return u.useCallback(e=>o(e),[o])}function T(){const o=i();return u.useCallback(e=>o(e,{replace:!0,keepPanels:!0}),[o])}function $(){const o=m(),e=c(),{list:s,mailboxId:a}=x();return u.useCallback(()=>{const r=l=>l,t=e;if(s==="flagged"){o({to:"/mail/flagged",search:r,hash:t});return}if(s==="outbox"){o({to:"/mail/outbox",search:r,hash:t});return}if(s==="mailbox"&&a){o({to:"/mail/$mailboxId",params:{mailboxId:a},search:r,hash:t});return}o({to:"/mail/brief",search:r,hash:t})},[o,e,s,a])}export{E as a,k as b,M as c,T as d,$ as e,w as u};
@@ -0,0 +1 @@
1
+ import{F as o}from"./FullCompose-CF-9-qhJ.js";import"./index-hsglfEcH.js";import"./ErrorState-DE7fNU8i.js";import"./index-Bc4oWEgj.js";import"./useMessageBodyContent-BmfPKs9C.js";import"./useMediaQuery-Do73WdTM.js";import"./useSignature-Bs8Za-GC.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-IVFdfd-Z.js";import"./compose-AxF0yn31.js";import"./confirm-dialog-CywFW_iF.js";const C=o;export{C as component};
@@ -0,0 +1 @@
1
+ import{F as o}from"./FullCompose-CF-9-qhJ.js";import"./index-hsglfEcH.js";import"./ErrorState-DE7fNU8i.js";import"./index-Bc4oWEgj.js";import"./useMessageBodyContent-BmfPKs9C.js";import"./useMediaQuery-Do73WdTM.js";import"./useSignature-Bs8Za-GC.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-IVFdfd-Z.js";import"./compose-AxF0yn31.js";import"./confirm-dialog-CywFW_iF.js";const C=o;export{C as component};
@@ -0,0 +1 @@
1
+ import{F as o}from"./FullCompose-CF-9-qhJ.js";import"./index-hsglfEcH.js";import"./ErrorState-DE7fNU8i.js";import"./index-Bc4oWEgj.js";import"./useMessageBodyContent-BmfPKs9C.js";import"./useMediaQuery-Do73WdTM.js";import"./useSignature-Bs8Za-GC.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-IVFdfd-Z.js";import"./compose-AxF0yn31.js";import"./confirm-dialog-CywFW_iF.js";const C=o;export{C as component};
@@ -0,0 +1 @@
1
+ import{F as o}from"./FullCompose-CF-9-qhJ.js";import"./index-hsglfEcH.js";import"./ErrorState-DE7fNU8i.js";import"./index-Bc4oWEgj.js";import"./useMessageBodyContent-BmfPKs9C.js";import"./useMediaQuery-Do73WdTM.js";import"./useSignature-Bs8Za-GC.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-IVFdfd-Z.js";import"./compose-AxF0yn31.js";import"./confirm-dialog-CywFW_iF.js";const C=o;export{C as component};
@@ -1 +1 @@
1
- import{r as n,j as e,J as b,b as o}from"./index-Bqn7f16e.js";const h=({isOpen:s,title:i,description:l,confirmLabel:d,cancelLabel:m="Cancel",destructive:u=!1,isBusy:f=!1,onConfirm:x,onCancel:r})=>{const c=n.useRef(null),a=n.useCallback(t=>{t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r())},[r]);return n.useEffect(()=>{if(s)return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[s,a]),n.useEffect(()=>{if(!s)return;const t=document.activeElement instanceof HTMLElement?document.activeElement:null;return c.current?.focus(),()=>{t?.isConnected&&t.focus()}},[s]),s?e.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center",children:[e.jsx(b,{label:"Dismiss confirmation",onDismiss:r,className:"backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":i,className:o("relative z-10 w-full max-w-sm","bg-surface border border-line rounded-sm shadow-lg","p-6"),children:[e.jsx("h2",{className:"text-lg font-semibold",children:i}),l&&e.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:l}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2",children:[e.jsx("button",{ref:c,type:"button",onClick:r,className:o("min-h-11 inline-flex items-center justify-center px-4 rounded text-sm font-medium transition-colors","border border-line hover:bg-surface-raised"),children:m}),e.jsx("button",{type:"button",onClick:x,disabled:f,className:o("min-h-11 inline-flex items-center justify-center px-4 rounded text-sm font-medium transition-colors",u?"bg-danger text-canvas hover:bg-danger/90":"bg-accent text-accent-fg hover:bg-accent-hover","disabled:opacity-50 disabled:cursor-not-allowed"),children:d})]})]})]}):null};export{h as C};
1
+ import{r as n,j as e,D as b,b as o}from"./index-hsglfEcH.js";const h=({isOpen:s,title:i,description:l,confirmLabel:d,cancelLabel:m="Cancel",destructive:u=!1,isBusy:f=!1,onConfirm:x,onCancel:r})=>{const c=n.useRef(null),a=n.useCallback(t=>{t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r())},[r]);return n.useEffect(()=>{if(s)return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[s,a]),n.useEffect(()=>{if(!s)return;const t=document.activeElement instanceof HTMLElement?document.activeElement:null;return c.current?.focus(),()=>{t?.isConnected&&t.focus()}},[s]),s?e.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center",children:[e.jsx(b,{label:"Dismiss confirmation",onDismiss:r,className:"backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":i,className:o("relative z-10 w-full max-w-sm","bg-surface border border-line rounded-sm shadow-lg","p-6"),children:[e.jsx("h2",{className:"text-lg font-semibold",children:i}),l&&e.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:l}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2",children:[e.jsx("button",{ref:c,type:"button",onClick:r,className:o("min-h-11 inline-flex items-center justify-center px-4 rounded text-sm font-medium transition-colors","border border-line hover:bg-surface-raised"),children:m}),e.jsx("button",{type:"button",onClick:x,disabled:f,className:o("min-h-11 inline-flex items-center justify-center px-4 rounded text-sm font-medium transition-colors",u?"bg-danger text-canvas hover:bg-danger/90":"bg-accent text-accent-fg hover:bg-accent-hover","disabled:opacity-50 disabled:cursor-not-allowed"),children:d})]})]})]}):null};export{h as C};
@@ -1 +1 @@
1
- import{c as o}from"./index-Bqn7f16e.js";const a=o("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);export{a as D};
1
+ import{c as o}from"./index-hsglfEcH.js";const a=o("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);export{a as D};
@@ -1 +1 @@
1
- import{s as X,ae as Z,aV as ee,aW as te,r as x,j as t,aX as ae,aY as se,am as R,B as N,au as ie,aA as ne,aZ as re,a_ as oe,T as le,x as P,w as ce,z as de,E as me,p as ue,Y as pe,ay as xe,aC as fe}from"./index-Bqn7f16e.js";import{S as he}from"./settings-screen-CH2hBhXZ.js";import{B as ge}from"./bottom-sheet-BYOjIdVx.js";import{u as ve}from"./useMediaQuery-C47DmZA5.js";import{u as be,a as ye,b as je,f as Ne}from"./move-options-k5syuO4O.js";import{u as Ce,a as Se}from"./useLabels-EfJaVdWJ.js";import{b as Fe,N as S,p as Me,u as Ie,r as we,a as Ee,S as L,c as Oe,n as Ae,f as De,d as Le,e as Te,g as ke}from"./useFilters-SCAefE6U.js";import{C as D}from"./circle-check-DlmySaui.js";import{E as z}from"./ErrorState-CJ2aoLG_.js";import"./avatar-CmvuzecB.js";import"./menu-vEH9STs_.js";import"./circle-help-C_AXwAaV.js";import"./enums-CCxx0t2v.js";const Re=(e,a)=>{const r=X(),i=Z({...te(),onSuccess:()=>{e&&(r.invalidateQueries({queryKey:Fe(e)}),a&&r.invalidateQueries({queryKey:ee({path:{accountId:e,filterId:a}})}))}}),{mutate:c}=i;return{updateFilter:x.useCallback(d=>{!e||!a||c({path:{accountId:e,filterId:a},body:d})},[e,a,c]),isPending:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error,reset:i.reset}},Pe=(e,a=!1)=>({clauses:e.literalClauses.map((i,c)=>({id:`clause-${c}`,field:i.field,value:i.value})),matchOperator:e.matchOperator==="And"?"all":"any",widen:e.hasAnchor?{anchorCount:1,...a?{inactive:!0}:{}}:void 0,moveMailboxId:e.actionMailboxId!==S?e.actionMailboxId:void 0,labelId:e.actionLabelId!==S?e.actionLabelId:void 0,scope:e.scope==="Temporary"?"until":"standing",until:e.scope==="Temporary"?ze(e.expiresAt):void 0,name:e.name}),ze=e=>{if(!e)return"";const a=Date.parse(e);if(Number.isNaN(a))return"";const r=new Date(a),i=c=>String(c).padStart(2,"0");return`${r.getFullYear()}-${i(r.getMonth()+1)}-${i(r.getDate())}`},T=e=>JSON.stringify({clauses:e.clauses.map(a=>[a.field,a.value]),operator:e.matchOperator,move:e.moveMailboxId??null,label:e.labelId??null,widen:e.widen?e.widen.inactive?"inactive":"active":"none"}),$=(e,a)=>T(e)!==T(a),k=e=>JSON.stringify({scope:e.scope==="until"?"until":"standing",until:e.scope==="until"?e.until??"":""}),_=(e,a)=>k(e)!==k(a),$e=(e,a)=>{const r={},i=(e.name??"").trim();return i!==(a.name??"").trim()&&(r.name=i),$(e,a)&&(r.matchOperator=e.matchOperator==="all"?"And":"Or",r.literalClauses=e.clauses.map(c=>({field:c.field,value:c.value})),r.actionMailboxId=e.moveMailboxId??S,r.actionLabelId=e.labelId??S),_(e,a)&&(r.scope=e.scope==="until"?"Temporary":"Standing",e.scope==="until"&&(r.expiresAt=Me(e.until??""))),r};function _e({accountId:e,filter:a,folders:r,delimiter:i,labels:c,semanticUnavailable:g=!1,onClose:d}){const f=x.useMemo(()=>Pe(a,g),[a,g]),[n,l]=x.useState(f),[m,u]=x.useState(),[h,b]=x.useState(!1),M=x.useRef(0),{count:C}=Ie(e,we(n)),j=Re(e,a.filterId),v=Ee(e),{createFolderIn:F}=be(e),{createLabel:E}=Ce(e),I=async o=>{const s=await E(o);return{id:s.labelId,name:s.name,color:s.color}},p=()=>u({mode:"add",draft:{field:L[0],value:""}}),w=o=>{const s=n.clauses.find(y=>y.id===o);s&&u({mode:"edit",clauseId:o,draft:{field:s.field,value:s.value}})},O=o=>u(s=>s&&{...s,draft:{...s.draft,field:o}}),B=o=>u(s=>s&&{...s,draft:{...s.draft,value:o}}),U=()=>{if(!m)return;const o=m.draft.field,s=Ae(o,m.draft.value);s!==""&&(l(y=>m.mode==="edit"&&m.clauseId?{...y,clauses:y.clauses.map(A=>A.id===m.clauseId?{id:A.id,field:o,value:s}:A)}:(M.current+=1,{...y,clauses:[...y.clauses,{id:`new-${M.current}`,field:o,value:s}]})),u(void 0))},K=o=>l(s=>({...s,clauses:s.clauses.filter(y=>y.id!==o)})),Q=o=>l(s=>({...s,matchOperator:o})),V=o=>l(s=>({...s,moveMailboxId:o||void 0})),G=o=>l(s=>({...s,labelId:o||void 0})),H=o=>l(s=>({...s,name:o})),J=o=>l(s=>({...s,scope:o,until:o==="until"?s.until:void 0})),q=o=>l(s=>({...s,until:o})),Y=()=>{const o=$(n,f)||_(n,f),s=$e(n,f);if(Object.keys(s).length===0){d();return}b(o),j.updateFilter(s)},W=()=>v.start(Oe(n));return v.isStarting||v.isRunning||v.isDone?t.jsx(Qe,{progress:v.progress,isDone:v.isDone,onClose:d}):j.isPending?t.jsx(Be,{}):j.isError?t.jsx(Ve,{onRetry:j.reset,onClose:d}):j.isSuccess?h?t.jsx(Ke,{preview:ae(C),blocked:C.status!=="ready"||C.stale===!0,onReapply:W,onClose:d}):t.jsx(Ue,{onClose:d}):t.jsx(se,{rule:n,folders:r,delimiter:i,labels:c,preview:C,semanticAvailable:!1,clauseFields:L,anchorLocked:!0,clauseEdit:m,onStartAddClause:p,onStartEditClause:w,onRemoveClause:K,onChangeDraftField:O,onChangeDraftValue:B,onSubmitClause:U,onCancelClause:()=>u(void 0),onChangeMatchOperator:Q,onChangeMove:V,onCreateFolder:F,onChangeLabel:G,onCreateLabel:I,onChangeName:H,onChangeScope:J,onChangeUntil:q,onCommit:Y,onCancel:d})}function Be(){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function Ue({onClose:e}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(D,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),t.jsx(N,{variant:"primary",onClick:e,className:"mt-2",children:"Done"})]})}function Ke({preview:e,blocked:a,onReapply:r,onClose:i}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(D,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),t.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",e," — move the mail already in your mailbox too?"]}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:r,disabled:a,children:"Move existing mail"}),t.jsx(N,{variant:"ghost",onClick:i,children:"Not now"})]})]})}function Qe({progress:e,isDone:a,onClose:r}){const i=e.state==="Failed";return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[a?i?t.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):t.jsx(D,{className:"size-8 text-positive"}):t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),!a&&t.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),a&&!i&&t.jsxs("div",{className:"text-sm text-fg",children:[t.jsx("p",{className:"font-medium",children:"Done"}),t.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[e.appliedCount," of ",e.matchedCount," moved",e.failedCount>0?` · ${e.failedCount} failed`:"","."]})]}),a&&i&&t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:e.errorMessage||"Something went wrong. Please try again."}),a&&t.jsx(N,{variant:"primary",onClick:r,className:"mt-2",children:"Done"})]})}function Ve({onRetry:e,onClose:a}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:e,children:"Try again"}),t.jsx(N,{variant:"ghost",onClick:a,children:"Not now"})]})]})}function Ge({accountId:e,filter:a,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d}){const f=ve(),n=t.jsx(_e,{accountId:e,filter:a,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d});return f?t.jsx(ie,{open:!0,onClose:d,title:"Filter rule",children:n}):t.jsx(ge,{open:!0,onClose:d,dismissLabel:"Dismiss filter rule",children:n})}function He({filters:e,mailboxName:a,labelById:r,onEdit:i,onDelete:c,deletingFilterId:g,semanticUnavailable:d=!1,now:f=Date.now()}){return e.length===0?t.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):t.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:e.map(n=>{const l=De(n,f),m=l==="Expired",u=n.actionMailboxId!==S?a(n.actionMailboxId):void 0,h=n.actionLabelId!==S?r.get(n.actionLabelId):void 0,b=Le(n.expiresAt);return t.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[t.jsxs("button",{type:"button",onClick:()=>i(n.filterId),"aria-label":`Edit filter ${n.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`truncate text-sm font-medium ${m?"text-fg-muted":"text-fg"}`,children:n.name}),t.jsx(ne,{tone:m?"neutral":"positive",dot:!0,children:l})]}),t.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[u?`Moves matches to ${u}`:"No move action",n.scope==="Temporary"&&b?m?` · expired ${b}`:` · until ${b}`:n.scope==="Standing"?" · always":""]}),(n.hasAnchor||h)&&t.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:[n.hasAnchor&&t.jsx(re,{widen:{anchorCount:1,...d?{inactive:!0}:{}}}),h&&t.jsx(oe,{label:{labelId:h.id,name:h.name,color:h.color}})]})]}),t.jsx(N,{variant:"ghost",size:"sm",icon:t.jsx(le,{className:"size-4 text-danger"}),onClick:()=>c(n.filterId),disabled:g===n.filterId,"aria-label":`Delete filter ${n.name}`})]},n.filterId)})})}const Je=t.jsxs("div",{className:"space-y-3",children:[t.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",t.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",t.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),t.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."})]});function qe({account:e}){const a=e.accountId,{filters:r,isPending:i,isError:c,error:g,refetch:d}=Te(a),{deleteFilter:f,deletingFilterId:n}=ke(a),[l,m]=x.useState(),{data:u}=P({...ce({path:{accountId:a}}),staleTime:1/0}),h=ye(),b=x.useMemo(()=>de(e.folderAppointments),[e.folderAppointments]),M=x.useCallback(p=>{const w=u?.items.find(O=>O.mailboxId===p);if(w)return me(w,b.get(p),h)},[u?.items,b,h]),C=x.useMemo(()=>je({mailboxes:u?.items??[],folderAppointments:e.folderAppointments,translator:h}),[u?.items,e.folderAppointments,h]),j=Ne(u?.items??[]),{labels:v}=Se(a),F=x.useMemo(()=>v.map(p=>({id:p.labelId,name:p.name,color:p.color})),[v]),E=x.useMemo(()=>new Map(F.map(p=>[p.id,p])),[F]),I=r.find(p=>p.filterId===l);return t.jsxs("section",{className:"space-y-2",children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:e.email}),I&&t.jsx(Ge,{accountId:a,filter:I,folders:C,delimiter:j,labels:F,onClose:()=>m(void 0)}),i?t.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${e.email}`}):c?t.jsx(z,{variant:"inline",title:`Couldn't load filters for ${e.email}`,error:g,onRetry:()=>{d()}}):t.jsx(He,{filters:r,mailboxName:M,labelById:E,onEdit:m,onDelete:f,deletingFilterId:n})]})}function ct(){const e=ue(),[a,r]=x.useState(!0),{data:i,isPending:c,isError:g,error:d,refetch:f}=P(pe()),n=l=>{const m=fe[l];m&&e({to:m})};return t.jsx(he,{items:xe,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:Je,helpOpen:a,onToggleHelp:()=>r(l=>!l),onSelect:n,onBackToMail:()=>{e({to:"/mail"})},children:c?t.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):g?t.jsx(z,{title:"Couldn't load accounts",error:d,onRetry:()=>{f()}}):i.accounts.length===0?t.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):t.jsx("div",{className:"space-y-8",children:i.accounts.map(l=>t.jsx(qe,{account:l},l.accountId))})})}export{qe as AccountFilters,ct as component};
1
+ import{n as X,a7 as Z,aO as ee,aP as te,r as x,j as t,aQ as ae,aR as se,af as R,B as N,an as ie,at as ne,aS as re,aT as oe,T as le,s as P,q as ce,v as de,x as me,m as ue,Q as pe,ar as xe,av as fe}from"./index-hsglfEcH.js";import{S as he}from"./settings-screen-C21f5beW.js";import{B as ge}from"./bottom-sheet-Ciu6wor9.js";import{u as ve}from"./useMediaQuery-Do73WdTM.js";import{u as be,a as ye,b as je,f as Ne}from"./move-options-PPPCxetl.js";import{u as Ce,a as Se}from"./useLabels-DgAdgt4V.js";import{b as Fe,N as S,p as Me,u as Ie,r as Oe,a as we,S as L,c as Ee,n as De,f as Ae,d as Le,e as Te,g as ke}from"./useFilters-BDcT8xyT.js";import{C as A}from"./circle-check-BishEtb4.js";import{E as $}from"./ErrorState-DE7fNU8i.js";import"./avatar-PxGVQCQm.js";import"./menu-CblIqBpR.js";import"./circle-help-DNSDxunA.js";import"./enums-CCxx0t2v.js";const Re=(e,a)=>{const r=X(),i=Z({...te(),onSuccess:()=>{e&&(r.invalidateQueries({queryKey:Fe(e)}),a&&r.invalidateQueries({queryKey:ee({path:{accountId:e,filterId:a}})}))}}),{mutate:c}=i;return{updateFilter:x.useCallback(d=>{!e||!a||c({path:{accountId:e,filterId:a},body:d})},[e,a,c]),isPending:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error,reset:i.reset}},Pe=(e,a=!1)=>({clauses:e.literalClauses.map((i,c)=>({id:`clause-${c}`,field:i.field,value:i.value})),matchOperator:e.matchOperator==="And"?"all":"any",widen:e.hasAnchor?{anchorCount:1,...a?{inactive:!0}:{}}:void 0,moveMailboxId:e.actionMailboxId!==S?e.actionMailboxId:void 0,labelId:e.actionLabelId!==S?e.actionLabelId:void 0,scope:e.scope==="Temporary"?"until":"standing",until:e.scope==="Temporary"?$e(e.expiresAt):void 0,name:e.name}),$e=e=>{if(!e)return"";const a=Date.parse(e);if(Number.isNaN(a))return"";const r=new Date(a),i=c=>String(c).padStart(2,"0");return`${r.getFullYear()}-${i(r.getMonth()+1)}-${i(r.getDate())}`},T=e=>JSON.stringify({clauses:e.clauses.map(a=>[a.field,a.value]),operator:e.matchOperator,move:e.moveMailboxId??null,label:e.labelId??null,widen:e.widen?e.widen.inactive?"inactive":"active":"none"}),z=(e,a)=>T(e)!==T(a),k=e=>JSON.stringify({scope:e.scope==="until"?"until":"standing",until:e.scope==="until"?e.until??"":""}),_=(e,a)=>k(e)!==k(a),ze=(e,a)=>{const r={},i=(e.name??"").trim();return i!==(a.name??"").trim()&&(r.name=i),z(e,a)&&(r.matchOperator=e.matchOperator==="all"?"And":"Or",r.literalClauses=e.clauses.map(c=>({field:c.field,value:c.value})),r.actionMailboxId=e.moveMailboxId??S,r.actionLabelId=e.labelId??S),_(e,a)&&(r.scope=e.scope==="until"?"Temporary":"Standing",e.scope==="until"&&(r.expiresAt=Me(e.until??""))),r};function _e({accountId:e,filter:a,folders:r,delimiter:i,labels:c,semanticUnavailable:g=!1,onClose:d}){const f=x.useMemo(()=>Pe(a,g),[a,g]),[n,l]=x.useState(f),[m,u]=x.useState(),[h,b]=x.useState(!1),M=x.useRef(0),{count:C}=Ie(e,Oe(n)),j=Re(e,a.filterId),v=we(e),{createFolderIn:F}=be(e),{createLabel:w}=Ce(e),I=async o=>{const s=await w(o);return{id:s.labelId,name:s.name,color:s.color}},p=()=>u({mode:"add",draft:{field:L[0],value:""}}),O=o=>{const s=n.clauses.find(y=>y.id===o);s&&u({mode:"edit",clauseId:o,draft:{field:s.field,value:s.value}})},E=o=>u(s=>s&&{...s,draft:{...s.draft,field:o}}),B=o=>u(s=>s&&{...s,draft:{...s.draft,value:o}}),Q=()=>{if(!m)return;const o=m.draft.field,s=De(o,m.draft.value);s!==""&&(l(y=>m.mode==="edit"&&m.clauseId?{...y,clauses:y.clauses.map(D=>D.id===m.clauseId?{id:D.id,field:o,value:s}:D)}:(M.current+=1,{...y,clauses:[...y.clauses,{id:`new-${M.current}`,field:o,value:s}]})),u(void 0))},U=o=>l(s=>({...s,clauses:s.clauses.filter(y=>y.id!==o)})),K=o=>l(s=>({...s,matchOperator:o})),q=o=>l(s=>({...s,moveMailboxId:o||void 0})),G=o=>l(s=>({...s,labelId:o||void 0})),H=o=>l(s=>({...s,name:o})),J=o=>l(s=>({...s,scope:o,until:o==="until"?s.until:void 0})),V=o=>l(s=>({...s,until:o})),W=()=>{const o=z(n,f)||_(n,f),s=ze(n,f);if(Object.keys(s).length===0){d();return}b(o),j.updateFilter(s)},Y=()=>v.start(Ee(n));return v.isStarting||v.isRunning||v.isDone?t.jsx(Ke,{progress:v.progress,isDone:v.isDone,onClose:d}):j.isPending?t.jsx(Be,{}):j.isError?t.jsx(qe,{onRetry:j.reset,onClose:d}):j.isSuccess?h?t.jsx(Ue,{preview:ae(C),blocked:C.status!=="ready"||C.stale===!0,onReapply:Y,onClose:d}):t.jsx(Qe,{onClose:d}):t.jsx(se,{rule:n,folders:r,delimiter:i,labels:c,preview:C,semanticAvailable:!1,clauseFields:L,anchorLocked:!0,clauseEdit:m,onStartAddClause:p,onStartEditClause:O,onRemoveClause:U,onChangeDraftField:E,onChangeDraftValue:B,onSubmitClause:Q,onCancelClause:()=>u(void 0),onChangeMatchOperator:K,onChangeMove:q,onCreateFolder:F,onChangeLabel:G,onCreateLabel:I,onChangeName:H,onChangeScope:J,onChangeUntil:V,onCommit:W,onCancel:d})}function Be(){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function Qe({onClose:e}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(A,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),t.jsx(N,{variant:"primary",onClick:e,className:"mt-2",children:"Done"})]})}function Ue({preview:e,blocked:a,onReapply:r,onClose:i}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(A,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),t.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",e," — move the mail already in your mailbox too?"]}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:r,disabled:a,children:"Move existing mail"}),t.jsx(N,{variant:"ghost",onClick:i,children:"Not now"})]})]})}function Ke({progress:e,isDone:a,onClose:r}){const i=e.state==="Failed";return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[a?i?t.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):t.jsx(A,{className:"size-8 text-positive"}):t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),!a&&t.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),a&&!i&&t.jsxs("div",{className:"text-sm text-fg",children:[t.jsx("p",{className:"font-medium",children:"Done"}),t.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[e.appliedCount," of ",e.matchedCount," moved",e.failedCount>0?` · ${e.failedCount} failed`:"","."]})]}),a&&i&&t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:e.errorMessage||"Something went wrong. Please try again."}),a&&t.jsx(N,{variant:"primary",onClick:r,className:"mt-2",children:"Done"})]})}function qe({onRetry:e,onClose:a}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:e,children:"Try again"}),t.jsx(N,{variant:"ghost",onClick:a,children:"Not now"})]})]})}function Ge({accountId:e,filter:a,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d}){const f=ve(),n=t.jsx(_e,{accountId:e,filter:a,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d});return f?t.jsx(ie,{open:!0,onClose:d,title:"Filter rule",children:n}):t.jsx(ge,{open:!0,onClose:d,dismissLabel:"Dismiss filter rule",children:n})}function He({filters:e,mailboxName:a,labelById:r,onEdit:i,onDelete:c,deletingFilterId:g,semanticUnavailable:d=!1,now:f=Date.now()}){return e.length===0?t.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):t.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:e.map(n=>{const l=Ae(n,f),m=l==="Expired",u=n.actionMailboxId!==S?a(n.actionMailboxId):void 0,h=n.actionLabelId!==S?r.get(n.actionLabelId):void 0,b=Le(n.expiresAt);return t.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[t.jsxs("button",{type:"button",onClick:()=>i(n.filterId),"aria-label":`Edit filter ${n.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`truncate text-sm font-medium ${m?"text-fg-muted":"text-fg"}`,children:n.name}),t.jsx(ne,{tone:m?"neutral":"positive",dot:!0,children:l})]}),t.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[u?`Moves matches to ${u}`:"No move action",n.scope==="Temporary"&&b?m?` · expired ${b}`:` · until ${b}`:n.scope==="Standing"?" · always":""]}),(n.hasAnchor||h)&&t.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:[n.hasAnchor&&t.jsx(re,{widen:{anchorCount:1,...d?{inactive:!0}:{}}}),h&&t.jsx(oe,{label:{labelId:h.id,name:h.name,color:h.color}})]})]}),t.jsx(N,{variant:"ghost",size:"sm",icon:t.jsx(le,{className:"size-4 text-danger"}),onClick:()=>c(n.filterId),disabled:g===n.filterId,"aria-label":`Delete filter ${n.name}`})]},n.filterId)})})}const Je=t.jsxs("div",{className:"space-y-3",children:[t.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",t.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",t.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),t.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."})]});function Ve({account:e}){const a=e.accountId,{filters:r,isPending:i,isError:c,error:g,refetch:d}=Te(a),{deleteFilter:f,deletingFilterId:n}=ke(a),[l,m]=x.useState(),{data:u}=P({...ce({path:{accountId:a}}),staleTime:1/0}),h=ye(),b=x.useMemo(()=>de(e.folderAppointments),[e.folderAppointments]),M=x.useCallback(p=>{const O=u?.items.find(E=>E.mailboxId===p);if(O)return me(O,b.get(p),h)},[u?.items,b,h]),C=x.useMemo(()=>je({mailboxes:u?.items??[],folderAppointments:e.folderAppointments,translator:h}),[u?.items,e.folderAppointments,h]),j=Ne(u?.items??[]),{labels:v}=Se(a),F=x.useMemo(()=>v.map(p=>({id:p.labelId,name:p.name,color:p.color})),[v]),w=x.useMemo(()=>new Map(F.map(p=>[p.id,p])),[F]),I=r.find(p=>p.filterId===l);return t.jsxs("section",{className:"space-y-2",children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:e.email}),I&&t.jsx(Ge,{accountId:a,filter:I,folders:C,delimiter:j,labels:F,onClose:()=>m(void 0)}),i?t.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${e.email}`}):c?t.jsx($,{variant:"inline",title:`Couldn't load filters for ${e.email}`,error:g,onRetry:()=>{d()}}):t.jsx(He,{filters:r,mailboxName:M,labelById:w,onEdit:m,onDelete:f,deletingFilterId:n})]})}function ct(){const e=ue(),[a,r]=x.useState(!0),{data:i,isPending:c,isError:g,error:d,refetch:f}=P(pe()),n=l=>{const m=fe[l];m&&e({to:m})};return t.jsx(he,{items:xe,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:Je,helpOpen:a,onToggleHelp:()=>r(l=>!l),onSelect:n,onBackToMail:()=>{e({to:"/mail"})},children:c?t.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):g?t.jsx($,{title:"Couldn't load accounts",error:d,onRetry:()=>{f()}}):i.accounts.length===0?t.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):t.jsx("div",{className:"space-y-8",children:i.accounts.map(l=>t.jsx(Ve,{account:l},l.accountId))})})}export{Ve as AccountFilters,ct as component};
@@ -0,0 +1 @@
1
+ import{j as o,U as i}from"./index-hsglfEcH.js";import{a as m}from"./search-view-CIqdN9ZA.js";import{F as r}from"./FlaggedPane-CAEBNxx7.js";import{u as p}from"./useSearchMirror-BT4CR3rd.js";import"./useMessageBodyContent-BmfPKs9C.js";import{f as e}from"./search-token-index-DMBdkNPl.js";import"./FullCompose-CF-9-qhJ.js";import"./ErrorState-DE7fNU8i.js";import"./index-Bc4oWEgj.js";import"./useSignature-Bs8Za-GC.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-IVFdfd-Z.js";import"./useMediaQuery-Do73WdTM.js";import"./compose-AxF0yn31.js";import"./confirm-dialog-CywFW_iF.js";import"./useSearchTokenContext-BAqGqR_E.js";import"./kbd-BnNxZdo9.js";import"./enums-CCxx0t2v.js";import"./search-scope-BJ5VJ_uq.js";import"./MailListHeader-CYgtRJbp.js";import"./attachment-file-tMJndpDR.js";import"./mail-DhWlCt7m.js";import"./avatar-PxGVQCQm.js";import"./format-De9HZKjg.js";import"./download-DmAN5nYp.js";import"./shield-check-Df-A4ExU.js";import"./move-options-PPPCxetl.js";import"./useFilters-BDcT8xyT.js";import"./clock-C6eJ9JFT.js";import"./menu-CblIqBpR.js";import"./MailViewChrome-C6eAuQJs.js";function A(){const t=e();return p({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{A as component};
@@ -1 +1 @@
1
- import{j as r}from"./index-Bqn7f16e.js";import{E as o}from"./ErrorState-CJ2aoLG_.js";const l=({error:t,reset:e})=>r.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:r.jsx(o,{title:"Couldn't load your starred mail",error:t,onRetry:e})});export{l as errorComponent};
1
+ import{j as r}from"./index-hsglfEcH.js";import{E as o}from"./ErrorState-DE7fNU8i.js";const l=({error:t,reset:e})=>r.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:r.jsx(o,{title:"Couldn't load your starred mail",error:t,onRetry:e})});export{l as errorComponent};
@@ -0,0 +1 @@
1
+ import{j as e,B as j,T as R,aU as V,r as u,an as G,X as H,aw as ie,ad as Y,F as le,aA as W,aV as ce,ac as de,ag as me,az as xe,n as X,J as Z,V as J,aW as ue,aX as he,aY as fe,aZ as U,x as z,v as ee,af as q,as as se,a_ as pe,a3 as ge,m as be,s as te,Q as je,ar as ve,av as ye,q as Ne,a7 as B,a$ as Ce,b0 as ke,aD as Me,b1 as we}from"./index-hsglfEcH.js";import{P as Ie}from"./pencil-B86il4i1.js";import{S as Se}from"./settings-screen-C21f5beW.js";import{c as Oe,d as F,e as Ae,M as De,i as Q,u as ae,a as re,b as Ee,m as K,g as Te}from"./move-options-PPPCxetl.js";import{E as ne}from"./ErrorState-DE7fNU8i.js";import"./avatar-PxGVQCQm.js";import"./menu-CblIqBpR.js";import"./circle-help-DNSDxunA.js";import"./enums-CCxx0t2v.js";const Fe=({label:s,onRename:n,onDelete:t,deleteBlockedReason:i,renameLabel:d=c=>`Rename ${c}`,deleteLabel:r=c=>`Delete ${c}`})=>{const c=i?`${r(s)} — ${i}`:r(s);return e.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 pr-2",children:[e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(Ie,{className:"size-3.5"}),"aria-label":d(s),onClick:n}),e.jsx("span",{title:i,children:e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(R,{className:"size-3.5"}),"aria-label":c,disabled:i!==void 0,onClick:t})})]})},Pe=({folders:s,onRename:n,onDelete:t,onCreateFolder:i,delimiter:d,labels:r})=>{const c=new Map(s.map(o=>[o.id,o]));return e.jsx(V,{folders:s,onCreateFolder:i,delimiter:d,labels:{treeAriaLabel:"Your folders",optionLabel:o=>o,...r},rowActions:o=>{const a=c.get(o.id);return a?e.jsx(Fe,{label:a.label,deleteBlockedReason:a.deleteBlockedReason,renameLabel:r?.rename,deleteLabel:r?.remove,onRename:()=>n(a),onDelete:()=>t(a)}):null}})},Re=({open:s,folderLabel:n,defaultLabel:t,name:i,onNameChange:d,onSubmit:r,onClose:c,pending:o=!1,error:a})=>{const l=u.useId(),p=`Rename ${n}`;return s?e.jsxs(G,{open:s,onClose:c,title:p,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:p}),e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(H,{className:"size-3.5"}),onClick:c,"aria-label":"Cancel"})]}),e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx(ie,{htmlFor:l,children:"Folder name"}),e.jsx(Y,{id:l,value:i,placeholder:t,onChange:m=>d(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r())}})]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Shown everywhere in Remit. Leave it blank to use"," ",e.jsx("span",{className:"font-medium text-fg",children:t}),"."]}),a&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:a})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:c,children:"Cancel"}),e.jsx(j,{variant:"primary",size:"sm",onClick:r,disabled:o,children:o?"Saving…":"Save name"})]})]}):null},ze=["inbox","drafts","sent","archive","junk","trash"],L="";function Le(s){const n=s.messageCount===1?"msg":"msgs";return`${W(s.providerPath)} · ${s.messageCount} ${n}`}function $e({role:s,folders:n,appointedId:t,displayName:i,onAppoint:d,onRename:r}){const[c,o]=u.useState(i),a=n.find(m=>m.mailboxId===t)??null,l=xe(s),p=a!=null&&c.trim()!==i.trim();return e.jsxs("div",{className:"flex flex-col gap-1 border-b border-line px-row-inset py-2.5 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex w-28 shrink-0 items-center gap-2 text-sm font-medium text-fg",children:[ce(s),l]}),e.jsxs(de,{className:"w-56 shrink-0",value:t??L,"aria-label":`Folder for ${l}`,onChange:m=>d(s,m.target.value===L?null:m.target.value),children:[e.jsx("option",{value:L,children:"None"}),n.map(m=>e.jsx("option",{value:m.mailboxId,children:Le(m)},m.mailboxId))]}),a&&e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"flex-1",value:c,placeholder:l,"aria-label":`Display name for ${l}`,onChange:m=>o(m.target.value)}),p&&e.jsx(j,{variant:"ghost",size:"sm",className:"shrink-0",icon:e.jsx(me,{className:"size-4"}),"aria-label":"Save display name",onClick:()=>r(a.mailboxId,c)})]})]}),a&&e.jsxs("span",{className:"truncate pl-[7.5rem] text-2xs text-fg-subtle",title:a.providerPath,children:[a.providerPath," · ",a.messageCount," ",a.messageCount===1?"message":"messages"]})]})}function _e({accountEmail:s,folders:n,appointments:t,displayNames:i={},onAppoint:d,onRename:r}){const c=new Set(Object.values(t).filter(a=>a!=null)),o=n.filter(a=>!c.has(a.mailboxId));return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-sm font-semibold text-fg",children:["Folder roles — ",s]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Each role points to one folder. Pick the folder that holds the mail — the counts help you tell real folders from empty look-alikes. Appointing a folder here removes it from any other role."})]}),e.jsx("div",{className:"rounded-sm border border-line bg-surface",children:ze.map(a=>{const l=t[a]??null;return e.jsx($e,{role:a,folders:n,appointedId:l,displayName:l?i[l]??"":"",onAppoint:d,onRename:r},a)})}),o.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h3",{className:"text-xs font-medium text-fg-muted",children:"Other folders"}),e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:o.map(a=>e.jsxs("li",{className:"flex items-center gap-2 border-b border-line px-row-inset py-2 text-sm text-fg last:border-b-0",children:[e.jsx(le,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate",children:W(a.providerPath)}),e.jsxs("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:[a.messageCount," ",a.messageCount===1?"message":"messages"]})]},a.mailboxId))})]})]})}const oe=50,qe=s=>s instanceof Error?s.message:"Something went wrong.",T=s=>s.then(n=>({ok:!0,value:n}),n=>({ok:!1,error:qe(n)})),Be=async(s,n,t,i)=>{const d=[];let r;for(let c=0;c<oe;c+=1){if(i.aborted)return d;const{data:o}=await U({path:{mailboxId:s},query:{order:"desc",continuationToken:r},throwOnError:!0});for(const a of o.items)if(!a.isDeleted&&!n.has(a.messageId)&&!d.includes(a.messageId)&&(d.push(a.messageId),d.length>=t))return d;if(!o.continuationToken)break;r=o.continuationToken}return d},Qe=async(s,n)=>{let t=0,i;for(let d=0;d<oe;d+=1){if(n.aborted)return t;const{data:r}=await U({path:{mailboxId:s},query:{order:"desc",continuationToken:i},throwOnError:!0});for(const c of r.items)c.isDeleted||(t+=1);if(!r.continuationToken)break;i=r.continuationToken}return t};function Ke({accountId:s,mailboxId:n,onDeleted:t}){const i=X(),[d,r]=u.useState("idle"),[c,o]=u.useState(null),[a,l]=u.useState(),p=u.useRef(null),m=u.useCallback(()=>{i.invalidateQueries({queryKey:Z({path:{accountId:s}})}),i.invalidateQueries({queryKey:J()})},[i,s]),N=u.useCallback(async()=>{r("deleting");const b=await T(ue({path:{accountId:s,mailboxId:n},throwOnError:!0}));if(!b.ok){l(b.error),r("error");return}m(),r("done"),t()},[s,n,m,t]),C=u.useCallback(()=>he({path:{accountId:s},throwOnError:!0}).then(({data:b})=>b.items.find(g=>g.mailboxId===n)?.messageCount??0),[s,n]),E=u.useCallback(()=>{p.current?.abort()},[]),w=u.useCallback(async b=>{const g=new AbortController;p.current=g;const{signal:f}=g;r("moving"),l(void 0);const I=await T(C());if(f.aborted)return;if(!I.ok){l(I.error),r("error");return}let h=Oe(I.value);o(h);const k=new Set;for(;;){if(f.aborted)return;const v=await T(Be(n,k,De,f));if(f.aborted)return;if(!v.ok){h=F(h,v.error),o(h),l(v.error),r("error");return}const M=v.value;if(M.length===0)break;const A=await T(fe({body:{messageIds:M,destinationMailboxId:b},throwOnError:!0}));if(f.aborted)return;if(!A.ok){h=F(h,A.error),o(h),l(A.error),r("error");return}for(const S of M)k.add(S);h=Ae(h,M.length),o(h)}const y=await T(Qe(n,f));if(!f.aborted){if(!y.ok){h=F(h,y.error),o(h),l(y.error),r("error");return}if(y.value>0){const v=`${y.value} ${y.value===1?"email is":"emails are"} still syncing. Re-open delete to finish removing this folder.`;h=F(h,v),o(h),l(v),r("error"),m();return}await N()}},[n,C,N,m]),D=u.useCallback(()=>{p.current?.abort(),p.current=null,r("idle"),o(null),l(void 0)},[]);return{phase:d,progress:c,errorMessage:a,deleteMailbox:N,moveThenDelete:w,cancel:E,reset:D}}const P=s=>`${s} ${s===1?"email":"emails"}`;function Ve({open:s,accountId:n,folder:t,mailboxes:i,appointments:d,onClose:r}){const[c,o]=u.useState(()=>Q(t.messageCount)),[a,l]=u.useState(),{createFolderIn:p}=ae(n),m=re(),{phase:N,progress:C,errorMessage:E,deleteMailbox:w,moveThenDelete:D,cancel:b,reset:g}=Ke({accountId:n,mailboxId:t.mailboxId,onDeleted:r});u.useEffect(()=>{s&&(o(Q(t.messageCount)),g())},[s,t.messageCount,g]),u.useEffect(()=>{s&&l(void 0)},[s]),u.useEffect(()=>b,[b]);const f=u.useCallback(()=>{b(),r()},[b,r]),I=u.useMemo(()=>Ee({mailboxes:i,folderAppointments:d,excludeMailboxId:t.mailboxId,translator:m}),[i,d,t.mailboxId,m]),h=I.find(M=>M.id===a),k=u.useMemo(()=>z(t,ee(d).get(t.mailboxId),m),[t,d,m]);if(!s)return null;const y=`Delete ${k}`,v=N==="moving"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(q,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving emails…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:C?K(C):"Moved 0 of 0"})]}):N==="deleting"||N==="done"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(q,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Deleting folder…"})]}):N==="error"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(se,{tone:"danger",variant:"soft",children:E??"Something went wrong. Please try again."}),C&&e.jsxs("p",{className:"text-xs text-fg-muted",children:[K(C),". Already-moved emails stay moved — re-open delete to continue with the rest."]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{variant:"secondary",size:"sm",onClick:f,children:"Close"})})]}):c==="confirm-empty"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:k}),"? This folder is empty and will be removed from the server."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:f,children:"Cancel"}),e.jsx(j,{variant:"danger",size:"sm",icon:e.jsx(R,{className:"size-3.5"}),onClick:()=>w(),children:"Delete folder"})]})]}):c==="choose-fate"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:k})," holds"," ",P(t.messageCount),". What should happen to them?"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:()=>o("confirm-delete-all"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(R,{className:"size-4 shrink-0 text-danger"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Delete them with the folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"The emails are removed from the server and can't be recovered."})]})]}),e.jsxs("button",{type:"button",onClick:()=>o("pick-destination"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(pe,{className:"size-4 shrink-0 text-accent-2"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Move them to another folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"Keep the emails, then delete the emptied folder."})]})]})]})]}),e.jsx("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:e.jsx(j,{variant:"secondary",size:"sm",onClick:f,children:"Cancel"})})]}):c==="confirm-delete-all"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:k})," and its"," ",P(t.messageCount),"? The messages are removed from the server with the folder and can't be recovered."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:()=>o("choose-fate"),children:"Back"}),e.jsx(j,{variant:"danger",size:"sm",icon:e.jsx(R,{className:"size-3.5"}),onClick:()=>w(),children:"Delete folder and emails"})]})]}):e.jsxs("div",{className:"flex h-[26rem] flex-col",children:[e.jsxs("p",{className:"px-5 pt-4 text-sm text-fg-muted",children:["Move the ",P(t.messageCount)," in"," ",e.jsx("strong",{className:"text-fg",children:k})," to:"]}),e.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:e.jsx(V,{folders:I,selectedId:a,delimiter:i[0]?.hierarchyDelimiter??"/",onSelect:l,onCreateFolder:p,onCancel:()=>{l(void 0),o("choose-fate")},labels:{filterPlaceholder:"Move emails to…"}})}),h&&e.jsx("footer",{className:"shrink-0 border-t border-line p-2",children:e.jsx(j,{variant:"danger",onClick:()=>D(h.id),className:"h-11 w-full font-semibold",children:e.jsx("span",{className:"truncate",children:`Move ${P(t.messageCount)} to ${h.label}`})})})]});return e.jsxs(G,{open:s,onClose:f,title:y,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx(ge,{className:"size-4 shrink-0 text-danger"}),e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:y}),e.jsx(j,{variant:"ghost",size:"sm",icon:e.jsx(H,{className:"size-3.5"}),onClick:f,"aria-label":"Cancel"})]}),v]})}const Ge=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each canonical role — Inbox, Drafts, Sent, Archive, Spam, Trash — points at one of your account's real folders. Pick the one that actually holds the mail; the message counts tell real folders from empty look-alikes."}),e.jsx("p",{children:`Appointing a folder to a role here doesn't touch any other role, and doesn't move or rename anything on the server — it just tells Remit which folder to treat as e.g. "Drafts" everywhere (sidebar, unread badges, the compose flow).`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Your folders"})," is the account's real hierarchy. Open a folder to see what's inside it, make a new one where you're looking, and rename or delete any of them from its row."]})]});function He({account:s}){const n=X(),t=s.accountId,i=re(),{data:d,isPending:r,isError:c,error:o,refetch:a}=te(Ne({path:{accountId:t}})),{createFolderIn:l}=ae(t),p=B({...Ce(),onSuccess:()=>{n.invalidateQueries({queryKey:J()})}}),m=B({...ke(),onSuccess:()=>{n.invalidateQueries({queryKey:Z({path:{accountId:t}})})}}),[N,C]=u.useState(),[E,w]=u.useState(),[D,b]=u.useState(""),g=u.useMemo(()=>d?.items??[],[d]),f=u.useMemo(()=>ee(s.folderAppointments),[s.folderAppointments]),I=u.useMemo(()=>g.map(x=>({id:x.mailboxId,label:z(x,f.get(x.mailboxId),i),path:x.fullPath,deleteBlockedReason:Te(x,g,s.folderAppointments).message})),[g,f,i,s.folderAppointments]),h=(x,O)=>{p.mutate({path:{accountId:t,role:we[x]},body:{mailboxId:O}})},k=(x,O)=>{const _=O.trim();m.mutate({path:{accountId:t,mailboxId:x},body:{displayNameOverride:_===""?null:_}})};if(r)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":`Loading folders for ${s.email}`});if(c)return e.jsx(ne,{variant:"inline",title:`Couldn't load folders for ${s.email}`,error:o,onRetry:()=>{a()}});const y=g.map(x=>({mailboxId:x.mailboxId,providerPath:x.fullPath,messageCount:x.messageCount})),v={};for(const x of s.folderAppointments){const O=Me[x.role];O&&(v[O]=x.mailboxId??null)}const M={};for(const x of g)x.displayNameOverride&&(M[x.mailboxId]=x.displayNameOverride);const A=x=>g.find(O=>O.mailboxId===x),S=A(E),$=A(N);return e.jsxs("div",{className:"space-y-4",children:[(p.isError||m.isError)&&e.jsx(se,{tone:"danger",variant:"soft",children:"Couldn't save that change. Please try again."}),e.jsx(_e,{accountEmail:s.email,folders:y,appointments:v,displayNames:M,onAppoint:h,onRename:k}),e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Your folders — ",s.email]}),e.jsx("div",{className:"flex h-[28rem] flex-col overflow-hidden rounded-sm border border-line bg-surface",children:e.jsx(Pe,{folders:I,delimiter:g[0]?.hierarchyDelimiter??"/",onCreateFolder:l,onRename:x=>{w(x.id),b(A(x.id)?.displayNameOverride?.trim()??"")},onDelete:x=>C(x.id),labels:{treeAriaLabel:`All folders for ${s.email}`}})})]}),S&&e.jsx(Re,{open:!0,folderLabel:z(S,f.get(S.mailboxId),i),defaultLabel:z({fullPath:S.fullPath},f.get(S.mailboxId),i),name:D,onNameChange:b,pending:m.isPending,error:m.isError?"Couldn't save that name. Please try again.":void 0,onSubmit:()=>{const x=D.trim();m.mutate({path:{accountId:t,mailboxId:S.mailboxId},body:{displayNameOverride:x===""?null:x}},{onSuccess:()=>w(void 0)})},onClose:()=>w(void 0)}),$&&e.jsx(Ve,{open:!0,accountId:t,folder:$,mailboxes:g,appointments:s.folderAppointments,onClose:()=>C(void 0)})]})}function as(){const s=be(),[n,t]=u.useState(!0),{data:i,isPending:d,isError:r,error:c,refetch:o}=te(je()),a=l=>{const p=ye[l];p&&s({to:p})};return e.jsx(Se,{items:ve,activeId:"folders",title:"Folder roles",description:"Appoint which real folder fills each canonical role, per account.",help:Ge,helpOpen:n,onToggleHelp:()=>t(l=>!l),onSelect:a,onBackToMail:()=>{s({to:"/mail"})},children:d?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):r?e.jsx(ne,{title:"Couldn't load accounts",error:c,onRetry:()=>{o()}}):i.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:i.accounts.map(l=>e.jsx(He,{account:l},l.accountId))})})}export{as as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-hsglfEcH.js";import{M as r}from"./MailboxPane-DbkiJ-ZU.js";import"./useSearchTokenContext-BAqGqR_E.js";import"./kbd-BnNxZdo9.js";import"./useMessageBodyContent-BmfPKs9C.js";import"./useMediaQuery-Do73WdTM.js";import"./enums-CCxx0t2v.js";import"./search-scope-BJ5VJ_uq.js";import"./useRefreshControl-VEa-1NUQ.js";import"./circle-check-big-CKyhX0ge.js";import"./search-token-index-DMBdkNPl.js";import"./MailListHeader-CYgtRJbp.js";import"./attachment-file-tMJndpDR.js";import"./mail-DhWlCt7m.js";import"./avatar-PxGVQCQm.js";import"./index-Bc4oWEgj.js";import"./useSignature-Bs8Za-GC.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-IVFdfd-Z.js";import"./ErrorState-DE7fNU8i.js";import"./format-De9HZKjg.js";import"./download-DmAN5nYp.js";import"./shield-check-Df-A4ExU.js";import"./move-options-PPPCxetl.js";import"./useFilters-BDcT8xyT.js";import"./confirm-dialog-CywFW_iF.js";import"./clock-C6eJ9JFT.js";import"./menu-CblIqBpR.js";import"./MailViewChrome-C6eAuQJs.js";import"./compose-AxF0yn31.js";import"./NavMenuButton-DETzPdQ0.js";import"./useLabels-DgAdgt4V.js";import"./useSemanticSearch-Crkt2g7K.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-Ciu6wor9.js";import"./circle-help-DNSDxunA.js";import"./circle-check-BishEtb4.js";function J(){return o.jsx(r.Reading,{})}export{J as component};