@remit/web-client-dist 0.0.261 → 0.0.263

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 (39) hide show
  1. package/assets/{ComposeBody-BD0BvFfg.js → ComposeBody-CQNFMBGC.js} +1 -1
  2. package/assets/{ConfirmDialog-BR2iQ7LG.js → ConfirmDialog-CuccSyBe.js} +1 -1
  3. package/assets/{ErrorState-BAc24i1y.js → ErrorState-tHBWD4c8.js} +1 -1
  4. package/assets/{OnboardingWizard-CY_VnhnW.js → OnboardingWizard-D0jWAq6w.js} +1 -1
  5. package/assets/{account-form-helpers-C-TmXa2c.js → account-form-helpers-DLZXQJMj.js} +1 -1
  6. package/assets/{accounts-qYTHfmLr.js → accounts-DG0SYUa0.js} +1 -1
  7. package/assets/{advanced-Dla6XJpY.js → advanced-CzYkYAhp.js} +1 -1
  8. package/assets/{appearance-DvILzXs3.js → appearance-Bdtv93pH.js} +1 -1
  9. package/assets/{avatar-D1iiQ-CW.js → avatar-BowjsCjw.js} +1 -1
  10. package/assets/{browser-ponyfill-CcSVawLg.js → browser-ponyfill-BqaZXG1q.js} +1 -1
  11. package/assets/{circle-check-D5lXOU5X.js → circle-check-oMt2osqB.js} +1 -1
  12. package/assets/{download-B4jHkHIP.js → download-CVzoEwOR.js} +1 -1
  13. package/assets/{filters-Djic5bEt.js → filters-Bwn2nkIN.js} +1 -1
  14. package/assets/{flagged-CK1j_mep.js → flagged-DW8PY19T.js} +1 -1
  15. package/assets/{folders-7al7Qkyk.js → folders-Cr9DvtFX.js} +1 -1
  16. package/assets/index-BoIb3ibR.js +1 -0
  17. package/assets/{index-3z3LP9ZQ.js → index-CVNwLhZz.js} +1 -1
  18. package/assets/{index-Cg3kRYrn.js → index-DWwdULmh.js} +4 -4
  19. package/assets/{index-BmBkz8X4.css → index-DeCgrGqr.css} +1 -1
  20. package/assets/{kbd-SqXc4XUQ.js → kbd-1cC37e3Y.js} +1 -1
  21. package/assets/{labels-DBKt5IGY.js → labels-Ca9RCUoB.js} +1 -1
  22. package/assets/mail-CRq1_NqD.js +118 -0
  23. package/assets/{move-options-DMfZoYZ9.js → move-options-B3YoCieV.js} +1 -1
  24. package/assets/{onboarding-CHhqomCn.js → onboarding-COyy-mA4.js} +1 -1
  25. package/assets/{pencil-DgpIT0G4.js → pencil-BG6CzY8P.js} +1 -1
  26. package/assets/{senders-iDfMTZB8.js → senders-C63sbg-D.js} +1 -1
  27. package/assets/settings-DOFYrq4H.js +1 -0
  28. package/assets/{settings-screen-CdEb_kQS.js → settings-screen-DzZ0wprV.js} +1 -1
  29. package/assets/{shield-check-f1__ITi-.js → shield-check-DHL-0yOp.js} +1 -1
  30. package/assets/{suggested-vips-B0Ua3Gz1.js → suggested-vips-Cxz4Hqmc.js} +1 -1
  31. package/assets/{useDebouncedValue-BqXyb6Dq.js → useDebouncedValue-CQn6Bbu7.js} +1 -1
  32. package/assets/{useFilters-HZwf5khI.js → useFilters-BeuEYwND.js} +1 -1
  33. package/assets/{useLabels-488N4fht.js → useLabels-kaTIGV4T.js} +1 -1
  34. package/assets/{useSignature-Bs9L_OGv.js → useSignature-BATGEs4k.js} +1 -1
  35. package/index.html +2 -2
  36. package/package.json +1 -1
  37. package/assets/index-DCnwUDMA.js +0 -1
  38. package/assets/mail-mZFlOyaF.js +0 -118
  39. package/assets/settings-DL3Rv051.js +0 -1
@@ -1 +1 @@
1
- import{r as a,j as t,as as o}from"./index-Cg3kRYrn.js";const g=({isOpen:s,title:i,description:l,confirmLabel:d,cancelLabel:u="Cancel",destructive:m=!1,isBusy:f=!1,onConfirm:x,onCancel:r})=>{const c=a.useRef(null),n=a.useCallback(e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),r())},[r]);return a.useEffect(()=>{if(s)return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[s,n]),a.useEffect(()=>{s&&c.current?.focus()},[s]),s?t.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[t.jsx("div",{className:"absolute inset-0 bg-canvas/80 backdrop-blur-sm","aria-hidden":"true",onClick:r}),t.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"),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[t.jsx("h2",{className:"text-lg font-semibold",children:i}),l&&t.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:l}),t.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2",children:[t.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:u}),t.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",m?"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{g as C};
1
+ import{r as a,j as t,as as o}from"./index-DWwdULmh.js";const g=({isOpen:s,title:i,description:l,confirmLabel:d,cancelLabel:u="Cancel",destructive:m=!1,isBusy:f=!1,onConfirm:x,onCancel:r})=>{const c=a.useRef(null),n=a.useCallback(e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),r())},[r]);return a.useEffect(()=>{if(s)return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[s,n]),a.useEffect(()=>{s&&c.current?.focus()},[s]),s?t.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[t.jsx("div",{className:"absolute inset-0 bg-canvas/80 backdrop-blur-sm","aria-hidden":"true",onClick:r}),t.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"),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[t.jsx("h2",{className:"text-lg font-semibold",children:i}),l&&t.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:l}),t.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2",children:[t.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:u}),t.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",m?"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{g as C};
@@ -1 +1 @@
1
- import{j as t,g as r}from"./index-Cg3kRYrn.js";const d=e=>e instanceof Error?e.message:typeof e=="string"?e:typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:"An unexpected error occurred",l=({title:e="Couldn't load content",error:a,onRetry:s,variant:i="block"})=>{const n=d(a);return i==="inline"?t.jsxs("div",{role:"alert",className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[t.jsx(r,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"font-medium text-danger",children:e}),t.jsx("p",{className:"text-fg-muted mt-0.5 break-words",children:n})]}),s&&t.jsx("button",{type:"button",onClick:s,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}):t.jsxs("div",{role:"alert",className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[t.jsx(r,{className:"size-8 text-danger","aria-hidden":"true"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-danger",children:e}),t.jsx("p",{className:"text-sm text-fg-muted mt-1 break-words",children:n})]}),s&&t.jsx("button",{type:"button",onClick:s,className:"inline-flex items-center rounded-md border border-line bg-canvas px-4 py-2 text-sm font-medium hover:bg-surface-raised transition-colors",children:"Retry"})]})};export{l as E,d as f};
1
+ import{j as t,g as r}from"./index-DWwdULmh.js";const d=e=>e instanceof Error?e.message:typeof e=="string"?e:typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:"An unexpected error occurred",l=({title:e="Couldn't load content",error:a,onRetry:s,variant:i="block"})=>{const n=d(a);return i==="inline"?t.jsxs("div",{role:"alert",className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[t.jsx(r,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"font-medium text-danger",children:e}),t.jsx("p",{className:"text-fg-muted mt-0.5 break-words",children:n})]}),s&&t.jsx("button",{type:"button",onClick:s,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}):t.jsxs("div",{role:"alert",className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[t.jsx(r,{className:"size-8 text-danger","aria-hidden":"true"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-danger",children:e}),t.jsx("p",{className:"text-sm text-fg-muted mt-1 break-words",children:n})]}),s&&t.jsx("button",{type:"button",onClick:s,className:"inline-flex items-center rounded-md border border-line bg-canvas px-4 py-2 text-sm font-medium hover:bg-surface-raised transition-colors",children:"Retry"})]})};export{l as E,d as f};
@@ -1 +1 @@
1
- import{a as ot,j as t,d as R,bY as W,l as rt,r as c,e as pt,cb as I,bZ as F,aa as ht,aD as V,bT as xt,bW as ft,aA as K,b7 as Y,aL as yt,B as N,L as $,bV as gt,b_ as vt,E as Q,c6 as bt,o as jt}from"./index-Cg3kRYrn.js";import{K as St}from"./kbd-SqXc4XUQ.js";import{c as wt,M as kt}from"./account-form-helpers-C-TmXa2c.js";const X=ot("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);const Nt=ot("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function Ct({url:e}){return t.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Stored encrypted, used only to connect to your mail server."," ",e?t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"How to create an app password"}):t.jsx("span",{children:"Check your provider's help for app password instructions."})]})}function Et({raised:e,className:r,...s}){return t.jsx("div",{className:R("rounded-sm border border-line bg-surface",e?"bg-surface-raised shadow-sm":"",r),...s})}function Z({value:e,defaultValue:r,onValueChange:s,...n}){return s?t.jsxs(W,{value:e,onChange:a=>s(a.target.value),...n,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]}):t.jsxs(W,{defaultValue:r??e,...n,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]})}function q(e){return{tls:e==="tls",startTls:e==="starttls"}}function Tt({steps:e,activeStep:r}){return t.jsx("ol",{className:"flex items-center gap-1",children:e.map((s,n)=>{const a=n<r,o=n===r;return t.jsxs("li",{className:"flex items-center gap-1",children:[n>0&&t.jsx("span",{className:"h-px w-5 bg-line","aria-hidden":!0}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:R("flex size-5 items-center justify-center rounded-full text-2xs font-semibold tabular-nums",a&&"bg-accent text-accent-fg",o&&"bg-accent-soft text-accent ring-1 ring-accent",!a&&!o&&"bg-surface-sunken text-fg-subtle"),children:a?t.jsx(rt,{className:"size-3"}):n+1}),t.jsx("span",{className:R("hidden text-2xs sm:inline",o?"font-medium text-fg":"text-fg-subtle"),children:s})]})]},s)})})}function L({steps:e,activeStep:r,title:s,subtitle:n,children:a,footer:o,hideSteps:l}){return t.jsxs("div",{className:"flex min-h-dvh w-full flex-col items-center overflow-y-auto bg-canvas px-8 pb-8 pt-8 font-sans text-fg sm:pt-[30vh]",children:[!l&&t.jsx("div",{className:"mb-5 w-full max-w-xl",children:t.jsx(Tt,{steps:e,activeStep:r})}),t.jsxs(Et,{raised:!0,className:"w-full max-w-xl",children:[t.jsxs("div",{className:"px-5 pt-5",children:[t.jsx("h1",{className:"text-xl font-semibold text-fg",children:s}),n&&t.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:n})]}),t.jsx("div",{className:"px-5 py-5",children:a}),o&&t.jsx("div",{className:"flex items-center justify-between gap-3 border-t border-line px-5 py-3",children:o})]})]})}const Pt="Coming soon — use IMAP for now.";function U({name:e,description:r,icon:s,comingSoon:n,selected:a,onSelect:o}){const[l,p]=c.useState(!1),i=()=>{if(o){o();return}n&&p(!0)};return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("button",{type:"button",onClick:i,"aria-disabled":n||void 0,className:R("flex flex-col items-start gap-2 rounded-sm border p-3 text-left transition-colors",a?"border-accent-2 bg-accent-2-soft":"border-line bg-surface hover:border-line-strong",n&&"opacity-55"),children:[t.jsx("span",{className:R("text-fg-muted",a&&"text-accent-2"),children:s}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-semibold text-fg",children:e}),n&&t.jsx("span",{className:"rounded-full bg-surface-sunken px-1.5 py-0.5 text-2xs text-fg-subtle",children:"soon"})]}),t.jsx("span",{className:"text-xs text-fg-subtle",children:r})]}),l&&t.jsx("p",{className:"text-2xs text-fg-subtle",children:Pt})]})}function J({legend:e,badge:r,host:s,port:n,security:a,readOnly:o,onHostChange:l,onPortChange:p,onSecurityChange:i,hostPlaceholder:f,portPlaceholder:w}){const b=c.useId(),y=c.useId(),j=c.useId();return t.jsxs("fieldset",{children:[t.jsxs("legend",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[e,r&&t.jsx(pt,{tone:r.tone,children:r.label})]}),t.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-[1fr_6rem_8rem] sm:gap-2",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:b,children:"Host"}),l?t.jsx(F,{id:b,readOnly:o,value:s,onChange:x=>l(x.target.value),placeholder:f}):t.jsx(F,{id:b,readOnly:o,defaultValue:s,placeholder:f})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:y,children:"Port"}),p?t.jsx(F,{id:y,readOnly:o,value:n,onChange:x=>p(x.target.value),placeholder:w}):t.jsx(F,{id:y,readOnly:o,defaultValue:n,placeholder:w})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:j,children:"Security"}),i?t.jsx(Z,{id:j,value:a,onValueChange:i}):t.jsx(Z,{id:j,defaultValue:a})]})]})]})}function _({label:e,detail:r,state:s}){return t.jsxs("div",{className:"flex items-start gap-3 py-2",children:[t.jsxs("span",{className:R("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full text-2xs",s==="ok"&&"bg-positive text-accent-fg",s==="failed"&&"bg-danger text-accent-fg",s==="running"&&"border border-accent text-accent",s==="pending"&&"border border-line text-fg-subtle"),children:[s==="ok"&&t.jsx(rt,{className:"size-3"}),s==="failed"&&"!",s==="running"&&t.jsx("span",{className:"size-2 animate-pulse rounded-full bg-accent"})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:R("text-sm",s==="failed"?"font-medium text-danger":"text-fg"),children:e}),r&&t.jsx("div",{className:"mt-0.5 text-xs text-fg-subtle",children:r})]})]})}const At={"gmail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"googlemail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"outlook.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"hotmail.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"live.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"msn.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"icloud.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"me.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"mac.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"fastmail.com":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"fastmail.fm":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"yahoo.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"yahoo.co.uk":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"ymail.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"aol.com":{imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},source:"provider-table"},"zoho.com":{imap:{host:"imap.zoho.com",port:993,security:"tls"},smtp:{host:"smtp.zoho.com",port:465,security:"tls"},source:"provider-table"},"gmx.com":{imap:{host:"imap.gmx.com",port:993,security:"tls"},smtp:{host:"smtp.gmx.com",port:587,security:"starttls"},source:"provider-table"},"gmx.net":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"gmx.de":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"web.de":{imap:{host:"imap.web.de",port:993,security:"tls"},smtp:{host:"smtp.web.de",port:587,security:"starttls"},source:"provider-table"},"mail.com":{imap:{host:"imap.mail.com",port:993,security:"tls"},smtp:{host:"smtp.mail.com",port:465,security:"tls"},source:"provider-table"},"hey.com":{imap:{host:"imap.hey.com",port:993,security:"tls"},smtp:{host:"smtp.hey.com",port:465,security:"tls"},source:"provider-table"},"tutanota.com":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"tuta.io":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"posteo.de":{imap:{host:"posteo.de",port:993,security:"tls"},smtp:{host:"posteo.de",port:465,security:"tls"},source:"provider-table"},"runbox.com":{imap:{host:"imap.runbox.com",port:993,security:"tls"},smtp:{host:"smtp.runbox.com",port:587,security:"starttls"},source:"provider-table"},"mailbox.org":{imap:{host:"imap.mailbox.org",port:993,security:"tls"},smtp:{host:"smtp.mailbox.org",port:465,security:"tls"},source:"provider-table"},"hushmail.com":{imap:{host:"imap.hushmail.com",port:993,security:"tls"},smtp:{host:"smtp.hushmail.com",port:465,security:"tls"},source:"provider-table"}},It={"gmail.com":"https://support.google.com/accounts/answer/185833","googlemail.com":"https://support.google.com/accounts/answer/185833","yahoo.com":"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html","icloud.com":"https://support.apple.com/en-us/102654","me.com":"https://support.apple.com/en-us/102654","mac.com":"https://support.apple.com/en-us/102654","fastmail.com":"https://www.fastmail.help/hc/en-us/articles/360058752854","fastmail.fm":"https://www.fastmail.help/hc/en-us/articles/360058752854","outlook.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","hotmail.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","zoho.com":"https://help.zoho.com/portal/en/kb/zoho-mail/client-configuration/imap-access/articles/zoho-mail-app-passwords"};function at(e){try{const s=new DOMParser().parseFromString(e,"application/xml");if(s.querySelector("parsererror"))return null;const n=s.querySelectorAll("incomingServer[type='imap']"),a=s.querySelectorAll("outgoingServer[type='smtp']");if(!n.length||!a.length)return null;const o=n[0],l=a[0],p=o.querySelector("hostname")?.textContent?.trim(),i=o.querySelector("port")?.textContent?.trim(),f=o.querySelector("socketType")?.textContent?.trim().toUpperCase(),w=l.querySelector("hostname")?.textContent?.trim(),b=l.querySelector("port")?.textContent?.trim(),y=l.querySelector("socketType")?.textContent?.trim().toUpperCase();if(!p||!i||!w||!b)return null;const j=x=>x==="SSL"||x==="TLS"||x==="SSL/TLS"?"tls":x==="STARTTLS"?"starttls":"none";return{imap:{host:p,port:Number.parseInt(i,10),security:j(f)},smtp:{host:w,port:Number.parseInt(b,10),security:j(y)},source:"mozilla-autoconfig"}}catch{return null}}async function Lt(e,r){try{const s=`https://autoconfig.thunderbird.net/v1.1/${e}`,n=await fetch(s,{signal:r});if(!n.ok)return null;const a=await n.text(),o=at(a);return o||null}catch{return null}}async function Mt(e,r){try{const s=`https://autoconfig.${e}/mail/config-v1.1.xml`,n=await fetch(s,{signal:r});if(!n.ok)return null;const a=await n.text(),o=at(a);return o?{...o,source:"domain-autoconfig"}:null}catch{return null}}function Ft(e){return{imap:{host:`imap.${e}`,port:993,security:"tls"},smtp:{host:`smtp.${e}`,port:587,security:"starttls"},source:"heuristic"}}async function Ot(e,r=1500){const s=e.indexOf("@");if(s===-1)return null;const n=e.slice(s+1).toLowerCase();if(!n)return null;const a=At[n];if(a)return a;const o=new AbortController,l=setTimeout(()=>o.abort(),r);try{const p=await Lt(n,o.signal);if(p)return p;const i=await Mt(n,o.signal);if(i)return i}finally{clearTimeout(l)}return Ft(n)}function zt(e){const r=e.indexOf("@");return r===-1?"Looking up server settings…":`Looking up settings for ${e.slice(r+1)}…`}function nt(e){const r=e.indexOf("@");if(r===-1)return;const s=e.slice(r+1).toLowerCase();return It[s]}const it=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}}];function tt(e){return it.find(r=>r.id===e)}const Rt={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail"};function _t(e){const r=e.indexOf("@");if(r===-1)return"";const s=e.slice(r+1).toLowerCase();return Rt[s]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],O={connector:0,address:1,servers:2,credentials:3,test:4,sync:5},et={host:"",port:993,security:"tls"},st={host:"",port:587,security:"starttls"};function Ht({onStart:e}){return c.useEffect(()=>{const r=s=>{s.key==="Enter"&&e()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),t.jsx(L,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:"One inbox for all your mail, with context about every message.",footer:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-2xs text-fg-subtle",children:[t.jsx(St,{children:"Enter"})," to continue"]}),t.jsx(N,{variant:"primary",onClick:e,children:"Add your first account"})]}),children:t.jsxs("div",{className:"flex flex-col items-start py-5",children:[t.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:t.jsx(kt,{className:"size-7 text-accent"})}),t.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."})]})})}function Dt({onContinue:e,onMicrosoft:r,onBack:s,showBack:n}){const[a,o]=c.useState("imap");c.useEffect(()=>{const p=i=>{i.key==="Enter"&&(a==="microsoft"?r():e()),i.key==="Escape"&&s()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e,r,s,a]);const l=()=>{a==="microsoft"?r():e()};return t.jsx(L,{steps:M,activeStep:O.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:t.jsxs(t.Fragment,{children:[n?t.jsx(N,{variant:"ghost",onClick:s,children:"Back"}):t.jsx("span",{}),t.jsx(N,{variant:"primary",onClick:l,children:a==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[t.jsx(U,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:t.jsx(Nt,{className:"size-5"}),selected:a==="imap",onSelect:()=>o("imap")}),t.jsx(U,{name:"Gmail",description:"Sign in with Google. No app passwords.",icon:t.jsx(X,{className:"size-5"}),comingSoon:!0}),t.jsx(U,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:t.jsx(jt,{className:"size-5"}),selected:a==="microsoft",onSelect:()=>o("microsoft")})]})})}function $t({onBack:e,onRedirecting:r}){const[s,n]=c.useState(""),[a,o]=c.useState(null),l=V({...bt(),onSuccess:i=>{r(),window.location.assign(i.authorizationUrl)},onError:i=>{o(i instanceof Error?i.message:"Failed to start sign-in")}}),p=()=>{o(null),l.mutate({body:{email:s.trim()||void 0}})};return c.useEffect(()=>{const i=f=>{f.key==="Enter"&&!l.isPending&&p(),f.key==="Escape"&&e()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,l.isPending]),t.jsx(L,{steps:M,activeStep:O.connector,title:"Sign in with Microsoft",subtitle:"You'll be redirected to Microsoft to sign in securely.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:e,children:"Back"}),t.jsx(N,{variant:"primary",onClick:p,disabled:l.isPending,icon:l.isPending?t.jsx($,{className:"size-4 animate-spin"}):void 0,children:l.isPending?"Redirecting…":"Sign in with Microsoft"})]}),children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:"microsoft-email",children:"Email address (optional)"}),t.jsx(F,{id:"microsoft-email",icon:t.jsx(X,{className:"size-4"}),placeholder:"you@outlook.com",value:s,onChange:i=>n(i.target.value),type:"email",autoComplete:"email"}),t.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),a&&t.jsx(Q,{tone:"danger",children:a})]})})}function qt({initialEmail:e,initialDisplayName:r,onContinue:s,onBack:n}){const[a,o]=c.useState(e),[l,p]=c.useState(r),[i,f]=c.useState(!1),[w,b]=c.useState(""),[y,j]=c.useState(null),x=c.useCallback(async()=>{const g=a.trim();if(!g.includes("@")||!g.includes(".")){j("Enter a valid email address.");return}j(null),f(!0),b(zt(g));try{const m=await Ot(g);s(g,l.trim(),m)}finally{f(!1)}},[a,l,s]);return c.useEffect(()=>{const g=m=>{m.key==="Enter"&&!i&&x(),m.key==="Escape"&&n()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[x,i,n]),t.jsx(L,{steps:M,activeStep:O.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:n,children:"Back"}),t.jsx(N,{variant:"primary",disabled:i,onClick:()=>{x()},children:"Continue"})]}),children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:"onboarding-email",children:"Email address"}),t.jsx(F,{id:"onboarding-email",icon:t.jsx(X,{className:"size-4"}),placeholder:"you@example.com",value:a,onChange:g=>{o(g.target.value),j(null)},type:"email",autoComplete:"email"})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),t.jsx(F,{id:"onboarding-display-name",placeholder:"Alice",value:l,onChange:g=>p(g.target.value)}),t.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),i&&t.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[t.jsx($,{className:"size-3.5 animate-spin text-accent"}),w]}),y&&!i&&t.jsx("div",{className:"mt-3",children:t.jsx(Q,{tone:"danger",children:y})})]})})}function Gt({email:e,imapConfig:r,smtpConfig:s,discovered:n,onContinue:a,onBack:o,onChange:l}){const[p,i]=c.useState(r),[f,w]=c.useState(s),[b,y]=c.useState(()=>_t(e)),[j,x]=c.useState(!1),[g,m]=c.useState(null),k=tt(b),d=k!==void 0&&!j,E=c.useCallback(h=>{y(h),x(!1),m(null);const u=tt(h);u&&(i({host:u.imap.host,port:u.imap.port,security:u.imap.security}),w({host:u.smtp.host,port:u.smtp.port,security:u.smtp.security}))},[]);c.useEffect(()=>{l(p,f)},[p,f,l]);const v=p.host.trim()!=="",S=c.useCallback(()=>{if(!v){m("Enter the IMAP host.");return}m(null),a()},[v,a]);c.useEffect(()=>{const h=u=>{u.key==="Enter"&&S(),u.key==="Escape"&&o()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[S,o]);const T=e.split("@")[1]??"your domain",z=k?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":n?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${T} — enter them manually.`,P=d?{label:"preset",tone:"neutral"}:!k&&n?{label:"detected",tone:"positive"}:void 0,A=k?.passwordHelp.url??nt(e);return t.jsx(L,{steps:M,activeStep:O.servers,title:"Confirm server settings",subtitle:z,footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:o,children:"Back"}),t.jsx(N,{variant:"primary",onClick:S,children:"Continue"})]}),children:t.jsxs("div",{className:"space-y-5",children:[g&&t.jsx(Q,{tone:"danger",children:g}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"provider-select",children:"Provider"}),t.jsxs(W,{id:"provider-select",value:b,onChange:h=>E(h.target.value),children:[t.jsx("option",{value:"",children:"Custom / other"}),it.map(h=>t.jsx("option",{value:h.id,children:h.label},h.id))]}),k&&t.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:d?t.jsxs(t.Fragment,{children:["Server settings are pre-filled for ",k.label," and locked."," ",t.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>x(!0),children:"Advanced"})," ","lets you edit them by hand."]}):t.jsxs(t.Fragment,{children:["Editing ",k.label,"'s settings by hand."]})})]}),t.jsx(J,{legend:"IMAP — incoming",badge:P,readOnly:d,host:p.host,port:String(p.port),security:p.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:h=>{i(u=>({...u,host:h})),m(null)},onPortChange:h=>i(u=>({...u,port:Number(h)})),onSecurityChange:h=>i(u=>({...u,security:h}))}),t.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),t.jsx(J,{legend:"SMTP — outgoing (optional)",badge:P,readOnly:d,host:f.host,port:String(f.port),security:f.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:h=>{w(u=>({...u,host:h})),m(null)},onPortChange:h=>w(u=>({...u,port:Number(h)})),onSecurityChange:h=>w(u=>({...u,security:h}))}),k&&t.jsxs("p",{className:"text-2xs text-fg-subtle",children:[k.passwordHelp.text," ",A&&t.jsx("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}function Bt({email:e,username:r,password:s,onContinue:n,onBack:a,onChange:o}){const[l,p]=c.useState(r||e),[i,f]=c.useState(s),[w,b]=c.useState(null),y=e.split("@")[1]??"",j=nt(e),x=l.trim()!==""&&i.trim()!=="";c.useEffect(()=>{o(l,i)},[l,i,o]);const g=c.useCallback(()=>{if(!x){b("Enter your username and password.");return}b(null),n()},[x,n]);return c.useEffect(()=>{const m=k=>{k.key==="Enter"&&g(),k.key==="Escape"&&a()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[g,a]),t.jsx(L,{steps:M,activeStep:O.credentials,title:`Sign in to ${y||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:a,children:"Back"}),t.jsx(N,{variant:"primary",onClick:g,children:"Test connection"})]}),children:t.jsxs("div",{className:"space-y-3",children:[w&&t.jsx("div",{className:"rounded-md bg-danger-soft px-3 py-2 text-sm text-danger",children:w}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"credentials-username",children:"Username"}),t.jsx(F,{id:"credentials-username",value:l,onChange:m=>{p(m.target.value),b(null)},autoComplete:"username"})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"credentials-password",children:"Password or app password"}),t.jsx(vt,{id:"credentials-password",value:i,onChange:m=>{f(m.target.value),b(null)},autoComplete:"current-password"})]}),t.jsx(Ct,{url:j})]})})}function Ut({email:e,imapConfig:r,smtpConfig:s,username:n,password:a,onSuccess:o,onBackToCredentials:l,onBackToServers:p}){const[i,f]=c.useState({imapState:"running",smtpState:"pending",phase:"running"}),[w,b]=c.useState(0),y=s.host.trim()!=="",j=q(r.security),x=q(s.security),g=V({...gt()});c.useEffect(()=>{let d=!1;const E=[];return f({imapState:"running",smtpState:"pending",phase:"running"}),g.mutate({body:{username:n,password:a,imapHost:r.host,imapPort:r.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:s.host,smtpPort:s.port,smtpTls:x.tls,smtpStartTls:x.startTls}},{onSuccess:v=>{if(d)return;const S=v.imapSuccess,T=y?v.smtpSuccess:!0;f({imapState:S?"ok":"failed",smtpState:y?"running":"ok",imapDetail:S?`Connected — ${r.host}:${r.port}`:v.imapError,phase:"running"}),E.push(window.setTimeout(()=>{if(d)return;const z=A=>{const h=A?.toLowerCase()??"";return h.includes("auth")||h.includes("login")||h.includes("535")||h.includes("credential")},P=!S&&z(v.imapError)||S&&y&&!v.smtpSuccess&&z(v.smtpError);f({imapState:S?"ok":"failed",smtpState:y?v.smtpSuccess?"ok":"failed":"ok",imapDetail:S?`Connected — ${r.host}:${r.port}`:v.imapError,smtpDetail:y?v.smtpSuccess?`Connected — ${s.host}:${s.port}`:v.smtpError:"Not set up — receive-only",rawError:S?y&&!v.smtpSuccess?v.smtpError:void 0:v.imapError,phase:S&&T?"success":P?"auth-failure":"network-failure"}),S&&T&&E.push(window.setTimeout(()=>{d||o()},800))},400))},onError:v=>{if(d)return;const S=v instanceof Error?v.message:"Connection failed";f({imapState:"failed",smtpState:"failed",imapDetail:S,smtpDetail:S,rawError:S,phase:"network-failure"})}}),()=>{d=!0;for(const v of E)window.clearTimeout(v)}},[w]);const{phase:m}=i;c.useEffect(()=>{const d=E=>{E.key==="Escape"&&(m==="auth-failure"?l():m==="network-failure"&&p())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[m,l,p]);const k=m==="auth-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:l,children:"Back to credentials"}),t.jsx(N,{variant:"primary",onClick:()=>b(d=>d+1),children:"Retry"})]}):m==="network-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:p,children:"Back to servers"}),t.jsx(N,{variant:"primary",onClick:()=>b(d=>d+1),children:"Retry"})]}):m==="success"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Connection verified"}),t.jsx(N,{variant:"primary",onClick:o,children:"Start syncing"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Testing…"}),t.jsx("span",{})]});return t.jsx(L,{steps:M,activeStep:O.test,title:"Testing the connection",subtitle:`Checking ${e}`,footer:k,children:t.jsxs("div",{className:"divide-y divide-line",children:[t.jsx(_,{label:`IMAP — ${r.host}:${r.port}`,detail:i.imapDetail,state:i.imapState}),t.jsx(_,{label:y?`SMTP — ${s.host}:${s.port}`:"SMTP — sending",detail:y?i.smtpDetail:"Not set up — you can add sending later in Settings",state:i.smtpState}),(m==="auth-failure"||m==="network-failure")&&i.rawError&&t.jsxs("div",{className:"py-3",children:[m==="auth-failure"&&t.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:"Check your password — many providers require an app password."}),t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:i.rawError})]})]})})}const Wt=2e4;function Vt({email:e,displayName:r,imapConfig:s,smtpConfig:n,username:a,password:o,onGoToInbox:l}){const p=ht(),[i,f]=c.useState(null),[w,b]=c.useState(null),y=c.useRef(!1),j=q(s.security),x=q(n.security),g=V({...ft(),onSuccess:C=>{f(C.accountId),p.invalidateQueries({queryKey:xt()})},onError:C=>{b(C instanceof Error?C.message:"Failed to create account")}});c.useEffect(()=>{if(y.current)return;y.current=!0;const C=n.host.trim()!=="",H=wt({imapHost:s.host,smtpHost:n.host,smtpPort:n.port}),D=C?H??{smtpHost:n.host,smtpPort:n.port,smtpTls:x.tls,smtpStartTls:x.startTls}:null;g.mutate({body:{email:e,displayName:r||void 0,username:a!==e?a:void 0,password:o,imapHost:s.host,imapPort:s.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:D?.smtpHost||void 0,smtpPort:D?.smtpPort||void 0,smtpTls:D?.smtpTls??!1,smtpStartTls:D?.smtpStartTls??!1}})},[]);const{data:m,isError:k}=K({...Y({path:{accountId:i??""}}),enabled:!!i,refetchInterval:C=>{const H=C.state.data?.syncPhase;return H==="complete"||H==="error"?!1:2e3}}),d=m?.syncPhase==="error",{data:E}=K({...yt(),enabled:!!i&&d}),v=E?.accounts.find(C=>C.accountId===i)?.lastError,S=m?.mailboxes.find(C=>C.fullPath==="INBOX"||C.fullPath==="Inbox"),T=m?.mailboxCountTotal??0,z=m?.mailboxCountSynced??0,P=S?.messagesTotal??0,A=S?.messagesSynced??0,h=P>0?A/P:0,u=m?.syncPhase,ct=d?"failed":u==="idle"||u===void 0||u==="discovering_mailboxes"?"running":T>0?"ok":"running",G=d?"failed":!u||u==="idle"||u==="discovering_mailboxes"?"pending":u==="syncing_inbox"||u==="syncing_others"?"running":"ok",B=d?"failed":!u||u==="idle"||u==="discovering_mailboxes"||u==="syncing_inbox"?"pending":u==="syncing_others"?"running":"ok",lt=A>0||S?.phase==="complete"||u==="complete"||d,[mt,ut]=c.useState(!1);c.useEffect(()=>{if(!i)return;const C=setTimeout(()=>ut(!0),Wt);return()=>clearTimeout(C)},[i]);const dt=!!i&&(lt||k||mt);return w?t.jsx(L,{steps:M,activeStep:O.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{}),t.jsx(N,{variant:"primary",onClick:()=>{y.current=!1,b(null),g.mutate({body:{email:e,displayName:r||void 0,username:a!==e?a:void 0,password:o,imapHost:s.host,imapPort:s.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:n.host||void 0,smtpPort:n.port||void 0,smtpTls:x.tls,smtpStartTls:x.startTls}})},children:"Retry"})]}),children:t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:w})}):t.jsx(L,{steps:M,activeStep:O.sync,title:`Syncing ${e}`,subtitle:"Newest mail first — you can start reading right away.",footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),dt?t.jsx(N,{variant:"primary",onClick:()=>i&&l(i),children:"Go to inbox"}):t.jsx(N,{variant:"primary",disabled:!0,icon:t.jsx($,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:g.isPending?t.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[t.jsx($,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):t.jsxs("div",{className:"space-y-3",children:[P>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[t.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),t.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[A.toLocaleString()," / ",P.toLocaleString()," ","messages"]})]}),t.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:t.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,h*100)}%`}})})]}),t.jsxs("div",{className:"divide-y divide-line",children:[t.jsx(_,{label:"Mailboxes discovered",detail:T>0?`${T} mailbox${T===1?"":"es"} found`:"Discovering…",state:ct}),t.jsx(_,{label:"INBOX",detail:G==="ok"?`${A.toLocaleString()} messages synced`:G==="running"?"Syncing newest first…":"Queued",state:G}),z>1||u==="syncing_others"||u==="complete"?t.jsx(_,{label:"Other mailboxes",detail:B==="ok"?`${z-1} mailboxes synced`:B==="running"?"Syncing…":"Queued",state:B}):null]}),d&&t.jsxs("div",{className:"mt-2 space-y-2",children:[t.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",t.jsx("button",{type:"button",className:"underline",onClick:()=>{p.invalidateQueries({queryKey:Y({path:{accountId:i??""}}).queryKey})},children:"retry"})]}),v&&t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:v})]})]})})}function Yt({skipWelcome:e=!1,onComplete:r,onCancel:s}){const[n,a]=c.useState(e?"connector":"welcome"),[o,l]=c.useState({email:"",displayName:"",imapConfig:et,smtpConfig:st,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),p=c.useCallback(()=>a("connector"),[]),i=c.useCallback(()=>a("address"),[]),f=c.useCallback(()=>a("microsoft-email"),[]),w=c.useCallback(()=>{e?s?.():a("welcome")},[e,s]),b=c.useCallback((m,k,d)=>{let E=et,v=st,S=!1;d&&(S=d.source!=="heuristic",E={host:d.imap.host,port:d.imap.port,security:d.imap.security},v={host:d.smtp.host,port:d.smtp.port,security:d.smtp.security}),l(T=>({...T,email:m,displayName:k,imapConfig:E,smtpConfig:v,discoveryResult:d,discovered:S,username:m})),a("servers")},[]),y=c.useCallback((m,k)=>{l(d=>({...d,imapConfig:m,smtpConfig:k}))},[]),j=c.useCallback((m,k)=>{l(d=>({...d,username:m,password:k}))},[]),x=c.useCallback(()=>a("sync"),[]),g=c.useCallback(m=>{r(m)},[r]);switch(n){case"welcome":return t.jsx(Ht,{onStart:p});case"connector":return t.jsx(Dt,{onContinue:i,onMicrosoft:f,onBack:w,showBack:!e});case"microsoft-email":return t.jsx($t,{onBack:()=>a("connector"),onRedirecting:()=>{}});case"address":return t.jsx(qt,{initialEmail:o.email,initialDisplayName:o.displayName,onContinue:b,onBack:()=>a("connector")});case"servers":return t.jsx(Gt,{email:o.email,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,discovered:o.discovered,onContinue:()=>a("credentials"),onBack:()=>a("address"),onChange:y});case"credentials":return t.jsx(Bt,{email:o.email,username:o.username,password:o.password,onContinue:()=>a("test"),onBack:()=>a("servers"),onChange:j});case"test":return t.jsx(Ut,{email:o.email,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,username:o.username,password:o.password,onSuccess:x,onBackToCredentials:()=>a("credentials"),onBackToServers:()=>a("servers")});case"sync":return t.jsx(Vt,{email:o.email,displayName:o.displayName,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,username:o.username,password:o.password,onGoToInbox:g})}}export{Yt as O,it as P,tt as g,q as s};
1
+ import{a as ot,j as t,d as R,bY as W,l as rt,r as c,e as pt,cb as I,bZ as F,aa as ht,aI as V,bT as xt,bW as ft,aF as K,au as Y,aQ as yt,B as N,L as D,bV as gt,b_ as vt,E as Q,c6 as bt,o as jt}from"./index-DWwdULmh.js";import{K as St}from"./kbd-1cC37e3Y.js";import{c as wt,M as kt}from"./account-form-helpers-DLZXQJMj.js";const X=ot("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);const Nt=ot("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function Ct({url:e}){return t.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Stored encrypted, used only to connect to your mail server."," ",e?t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"How to create an app password"}):t.jsx("span",{children:"Check your provider's help for app password instructions."})]})}function Et({raised:e,className:r,...s}){return t.jsx("div",{className:R("rounded-sm border border-line bg-surface",e?"bg-surface-raised shadow-sm":"",r),...s})}function Z({value:e,defaultValue:r,onValueChange:s,...n}){return s?t.jsxs(W,{value:e,onChange:a=>s(a.target.value),...n,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]}):t.jsxs(W,{defaultValue:r??e,...n,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]})}function q(e){return{tls:e==="tls",startTls:e==="starttls"}}function Tt({steps:e,activeStep:r}){return t.jsx("ol",{className:"flex items-center gap-1",children:e.map((s,n)=>{const a=n<r,o=n===r;return t.jsxs("li",{className:"flex items-center gap-1",children:[n>0&&t.jsx("span",{className:"h-px w-5 bg-line","aria-hidden":!0}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:R("flex size-5 items-center justify-center rounded-full text-2xs font-semibold tabular-nums",a&&"bg-accent text-accent-fg",o&&"bg-accent-soft text-accent ring-1 ring-accent",!a&&!o&&"bg-surface-sunken text-fg-subtle"),children:a?t.jsx(rt,{className:"size-3"}):n+1}),t.jsx("span",{className:R("hidden text-2xs sm:inline",o?"font-medium text-fg":"text-fg-subtle"),children:s})]})]},s)})})}function L({steps:e,activeStep:r,title:s,subtitle:n,children:a,footer:o,hideSteps:l}){return t.jsxs("div",{className:"flex min-h-dvh w-full flex-col items-center overflow-y-auto bg-canvas px-8 pb-8 pt-8 font-sans text-fg sm:pt-[30vh]",children:[!l&&t.jsx("div",{className:"mb-5 w-full max-w-xl",children:t.jsx(Tt,{steps:e,activeStep:r})}),t.jsxs(Et,{raised:!0,className:"w-full max-w-xl",children:[t.jsxs("div",{className:"px-5 pt-5",children:[t.jsx("h1",{className:"text-xl font-semibold text-fg",children:s}),n&&t.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:n})]}),t.jsx("div",{className:"px-5 py-5",children:a}),o&&t.jsx("div",{className:"flex items-center justify-between gap-3 border-t border-line px-5 py-3",children:o})]})]})}const Pt="Coming soon — use IMAP for now.";function U({name:e,description:r,icon:s,comingSoon:n,selected:a,onSelect:o}){const[l,p]=c.useState(!1),i=()=>{if(o){o();return}n&&p(!0)};return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("button",{type:"button",onClick:i,"aria-disabled":n||void 0,className:R("flex flex-col items-start gap-2 rounded-sm border p-3 text-left transition-colors",a?"border-accent-2 bg-accent-2-soft":"border-line bg-surface hover:border-line-strong",n&&"opacity-55"),children:[t.jsx("span",{className:R("text-fg-muted",a&&"text-accent-2"),children:s}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-semibold text-fg",children:e}),n&&t.jsx("span",{className:"rounded-full bg-surface-sunken px-1.5 py-0.5 text-2xs text-fg-subtle",children:"soon"})]}),t.jsx("span",{className:"text-xs text-fg-subtle",children:r})]}),l&&t.jsx("p",{className:"text-2xs text-fg-subtle",children:Pt})]})}function J({legend:e,badge:r,host:s,port:n,security:a,readOnly:o,onHostChange:l,onPortChange:p,onSecurityChange:i,hostPlaceholder:f,portPlaceholder:w}){const b=c.useId(),y=c.useId(),j=c.useId();return t.jsxs("fieldset",{children:[t.jsxs("legend",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[e,r&&t.jsx(pt,{tone:r.tone,children:r.label})]}),t.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-[1fr_6rem_8rem] sm:gap-2",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:b,children:"Host"}),l?t.jsx(F,{id:b,readOnly:o,value:s,onChange:x=>l(x.target.value),placeholder:f}):t.jsx(F,{id:b,readOnly:o,defaultValue:s,placeholder:f})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:y,children:"Port"}),p?t.jsx(F,{id:y,readOnly:o,value:n,onChange:x=>p(x.target.value),placeholder:w}):t.jsx(F,{id:y,readOnly:o,defaultValue:n,placeholder:w})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:j,children:"Security"}),i?t.jsx(Z,{id:j,value:a,onValueChange:i}):t.jsx(Z,{id:j,defaultValue:a})]})]})]})}function _({label:e,detail:r,state:s}){return t.jsxs("div",{className:"flex items-start gap-3 py-2",children:[t.jsxs("span",{className:R("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full text-2xs",s==="ok"&&"bg-positive text-accent-fg",s==="failed"&&"bg-danger text-accent-fg",s==="running"&&"border border-accent text-accent",s==="pending"&&"border border-line text-fg-subtle"),children:[s==="ok"&&t.jsx(rt,{className:"size-3"}),s==="failed"&&"!",s==="running"&&t.jsx("span",{className:"size-2 animate-pulse rounded-full bg-accent"})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:R("text-sm",s==="failed"?"font-medium text-danger":"text-fg"),children:e}),r&&t.jsx("div",{className:"mt-0.5 text-xs text-fg-subtle",children:r})]})]})}const At={"gmail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"googlemail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"outlook.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"hotmail.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"live.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"msn.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"icloud.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"me.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"mac.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"fastmail.com":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"fastmail.fm":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"yahoo.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"yahoo.co.uk":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"ymail.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"aol.com":{imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},source:"provider-table"},"zoho.com":{imap:{host:"imap.zoho.com",port:993,security:"tls"},smtp:{host:"smtp.zoho.com",port:465,security:"tls"},source:"provider-table"},"gmx.com":{imap:{host:"imap.gmx.com",port:993,security:"tls"},smtp:{host:"smtp.gmx.com",port:587,security:"starttls"},source:"provider-table"},"gmx.net":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"gmx.de":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"web.de":{imap:{host:"imap.web.de",port:993,security:"tls"},smtp:{host:"smtp.web.de",port:587,security:"starttls"},source:"provider-table"},"mail.com":{imap:{host:"imap.mail.com",port:993,security:"tls"},smtp:{host:"smtp.mail.com",port:465,security:"tls"},source:"provider-table"},"hey.com":{imap:{host:"imap.hey.com",port:993,security:"tls"},smtp:{host:"smtp.hey.com",port:465,security:"tls"},source:"provider-table"},"tutanota.com":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"tuta.io":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"posteo.de":{imap:{host:"posteo.de",port:993,security:"tls"},smtp:{host:"posteo.de",port:465,security:"tls"},source:"provider-table"},"runbox.com":{imap:{host:"imap.runbox.com",port:993,security:"tls"},smtp:{host:"smtp.runbox.com",port:587,security:"starttls"},source:"provider-table"},"mailbox.org":{imap:{host:"imap.mailbox.org",port:993,security:"tls"},smtp:{host:"smtp.mailbox.org",port:465,security:"tls"},source:"provider-table"},"hushmail.com":{imap:{host:"imap.hushmail.com",port:993,security:"tls"},smtp:{host:"smtp.hushmail.com",port:465,security:"tls"},source:"provider-table"}},It={"gmail.com":"https://support.google.com/accounts/answer/185833","googlemail.com":"https://support.google.com/accounts/answer/185833","yahoo.com":"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html","icloud.com":"https://support.apple.com/en-us/102654","me.com":"https://support.apple.com/en-us/102654","mac.com":"https://support.apple.com/en-us/102654","fastmail.com":"https://www.fastmail.help/hc/en-us/articles/360058752854","fastmail.fm":"https://www.fastmail.help/hc/en-us/articles/360058752854","outlook.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","hotmail.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","zoho.com":"https://help.zoho.com/portal/en/kb/zoho-mail/client-configuration/imap-access/articles/zoho-mail-app-passwords"};function at(e){try{const s=new DOMParser().parseFromString(e,"application/xml");if(s.querySelector("parsererror"))return null;const n=s.querySelectorAll("incomingServer[type='imap']"),a=s.querySelectorAll("outgoingServer[type='smtp']");if(!n.length||!a.length)return null;const o=n[0],l=a[0],p=o.querySelector("hostname")?.textContent?.trim(),i=o.querySelector("port")?.textContent?.trim(),f=o.querySelector("socketType")?.textContent?.trim().toUpperCase(),w=l.querySelector("hostname")?.textContent?.trim(),b=l.querySelector("port")?.textContent?.trim(),y=l.querySelector("socketType")?.textContent?.trim().toUpperCase();if(!p||!i||!w||!b)return null;const j=x=>x==="SSL"||x==="TLS"||x==="SSL/TLS"?"tls":x==="STARTTLS"?"starttls":"none";return{imap:{host:p,port:Number.parseInt(i,10),security:j(f)},smtp:{host:w,port:Number.parseInt(b,10),security:j(y)},source:"mozilla-autoconfig"}}catch{return null}}async function Lt(e,r){try{const s=`https://autoconfig.thunderbird.net/v1.1/${e}`,n=await fetch(s,{signal:r});if(!n.ok)return null;const a=await n.text(),o=at(a);return o||null}catch{return null}}async function Mt(e,r){try{const s=`https://autoconfig.${e}/mail/config-v1.1.xml`,n=await fetch(s,{signal:r});if(!n.ok)return null;const a=await n.text(),o=at(a);return o?{...o,source:"domain-autoconfig"}:null}catch{return null}}function Ft(e){return{imap:{host:`imap.${e}`,port:993,security:"tls"},smtp:{host:`smtp.${e}`,port:587,security:"starttls"},source:"heuristic"}}async function Ot(e,r=1500){const s=e.indexOf("@");if(s===-1)return null;const n=e.slice(s+1).toLowerCase();if(!n)return null;const a=At[n];if(a)return a;const o=new AbortController,l=setTimeout(()=>o.abort(),r);try{const p=await Lt(n,o.signal);if(p)return p;const i=await Mt(n,o.signal);if(i)return i}finally{clearTimeout(l)}return Ft(n)}function zt(e){const r=e.indexOf("@");return r===-1?"Looking up server settings…":`Looking up settings for ${e.slice(r+1)}…`}function nt(e){const r=e.indexOf("@");if(r===-1)return;const s=e.slice(r+1).toLowerCase();return It[s]}const it=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}}];function tt(e){return it.find(r=>r.id===e)}const Rt={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail"};function _t(e){const r=e.indexOf("@");if(r===-1)return"";const s=e.slice(r+1).toLowerCase();return Rt[s]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],O={connector:0,address:1,servers:2,credentials:3,test:4,sync:5},et={host:"",port:993,security:"tls"},st={host:"",port:587,security:"starttls"};function Ht({onStart:e}){return c.useEffect(()=>{const r=s=>{s.key==="Enter"&&e()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),t.jsx(L,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:"One inbox for all your mail, with context about every message.",footer:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-2xs text-fg-subtle",children:[t.jsx(St,{children:"Enter"})," to continue"]}),t.jsx(N,{variant:"primary",onClick:e,children:"Add your first account"})]}),children:t.jsxs("div",{className:"flex flex-col items-start py-5",children:[t.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:t.jsx(kt,{className:"size-7 text-accent"})}),t.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."})]})})}function $t({onContinue:e,onMicrosoft:r,onBack:s,showBack:n}){const[a,o]=c.useState("imap");c.useEffect(()=>{const p=i=>{i.key==="Enter"&&(a==="microsoft"?r():e()),i.key==="Escape"&&s()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e,r,s,a]);const l=()=>{a==="microsoft"?r():e()};return t.jsx(L,{steps:M,activeStep:O.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:t.jsxs(t.Fragment,{children:[n?t.jsx(N,{variant:"ghost",onClick:s,children:"Back"}):t.jsx("span",{}),t.jsx(N,{variant:"primary",onClick:l,children:a==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[t.jsx(U,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:t.jsx(Nt,{className:"size-5"}),selected:a==="imap",onSelect:()=>o("imap")}),t.jsx(U,{name:"Gmail",description:"Sign in with Google. No app passwords.",icon:t.jsx(X,{className:"size-5"}),comingSoon:!0}),t.jsx(U,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:t.jsx(jt,{className:"size-5"}),selected:a==="microsoft",onSelect:()=>o("microsoft")})]})})}function Dt({onBack:e,onRedirecting:r}){const[s,n]=c.useState(""),[a,o]=c.useState(null),l=V({...bt(),onSuccess:i=>{r(),window.location.assign(i.authorizationUrl)},onError:i=>{o(i instanceof Error?i.message:"Failed to start sign-in")}}),p=()=>{o(null),l.mutate({body:{email:s.trim()||void 0}})};return c.useEffect(()=>{const i=f=>{f.key==="Enter"&&!l.isPending&&p(),f.key==="Escape"&&e()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,l.isPending]),t.jsx(L,{steps:M,activeStep:O.connector,title:"Sign in with Microsoft",subtitle:"You'll be redirected to Microsoft to sign in securely.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:e,children:"Back"}),t.jsx(N,{variant:"primary",onClick:p,disabled:l.isPending,icon:l.isPending?t.jsx(D,{className:"size-4 animate-spin"}):void 0,children:l.isPending?"Redirecting…":"Sign in with Microsoft"})]}),children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:"microsoft-email",children:"Email address (optional)"}),t.jsx(F,{id:"microsoft-email",icon:t.jsx(X,{className:"size-4"}),placeholder:"you@outlook.com",value:s,onChange:i=>n(i.target.value),type:"email",autoComplete:"email"}),t.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),a&&t.jsx(Q,{tone:"danger",children:a})]})})}function qt({initialEmail:e,initialDisplayName:r,onContinue:s,onBack:n}){const[a,o]=c.useState(e),[l,p]=c.useState(r),[i,f]=c.useState(!1),[w,b]=c.useState(""),[y,j]=c.useState(null),x=c.useCallback(async()=>{const g=a.trim();if(!g.includes("@")||!g.includes(".")){j("Enter a valid email address.");return}j(null),f(!0),b(zt(g));try{const m=await Ot(g);s(g,l.trim(),m)}finally{f(!1)}},[a,l,s]);return c.useEffect(()=>{const g=m=>{m.key==="Enter"&&!i&&x(),m.key==="Escape"&&n()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[x,i,n]),t.jsx(L,{steps:M,activeStep:O.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:n,children:"Back"}),t.jsx(N,{variant:"primary",disabled:i,onClick:()=>{x()},children:"Continue"})]}),children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:"onboarding-email",children:"Email address"}),t.jsx(F,{id:"onboarding-email",icon:t.jsx(X,{className:"size-4"}),placeholder:"you@example.com",value:a,onChange:g=>{o(g.target.value),j(null)},type:"email",autoComplete:"email"})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),t.jsx(F,{id:"onboarding-display-name",placeholder:"Alice",value:l,onChange:g=>p(g.target.value)}),t.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),i&&t.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[t.jsx(D,{className:"size-3.5 animate-spin text-accent"}),w]}),y&&!i&&t.jsx("div",{className:"mt-3",children:t.jsx(Q,{tone:"danger",children:y})})]})})}function Gt({email:e,imapConfig:r,smtpConfig:s,discovered:n,onContinue:a,onBack:o,onChange:l}){const[p,i]=c.useState(r),[f,w]=c.useState(s),[b,y]=c.useState(()=>_t(e)),[j,x]=c.useState(!1),[g,m]=c.useState(null),k=tt(b),d=k!==void 0&&!j,E=c.useCallback(h=>{y(h),x(!1),m(null);const u=tt(h);u&&(i({host:u.imap.host,port:u.imap.port,security:u.imap.security}),w({host:u.smtp.host,port:u.smtp.port,security:u.smtp.security}))},[]);c.useEffect(()=>{l(p,f)},[p,f,l]);const v=p.host.trim()!=="",S=c.useCallback(()=>{if(!v){m("Enter the IMAP host.");return}m(null),a()},[v,a]);c.useEffect(()=>{const h=u=>{u.key==="Enter"&&S(),u.key==="Escape"&&o()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[S,o]);const T=e.split("@")[1]??"your domain",z=k?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":n?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${T} — enter them manually.`,P=d?{label:"preset",tone:"neutral"}:!k&&n?{label:"detected",tone:"positive"}:void 0,A=k?.passwordHelp.url??nt(e);return t.jsx(L,{steps:M,activeStep:O.servers,title:"Confirm server settings",subtitle:z,footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:o,children:"Back"}),t.jsx(N,{variant:"primary",onClick:S,children:"Continue"})]}),children:t.jsxs("div",{className:"space-y-5",children:[g&&t.jsx(Q,{tone:"danger",children:g}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"provider-select",children:"Provider"}),t.jsxs(W,{id:"provider-select",value:b,onChange:h=>E(h.target.value),children:[t.jsx("option",{value:"",children:"Custom / other"}),it.map(h=>t.jsx("option",{value:h.id,children:h.label},h.id))]}),k&&t.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:d?t.jsxs(t.Fragment,{children:["Server settings are pre-filled for ",k.label," and locked."," ",t.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>x(!0),children:"Advanced"})," ","lets you edit them by hand."]}):t.jsxs(t.Fragment,{children:["Editing ",k.label,"'s settings by hand."]})})]}),t.jsx(J,{legend:"IMAP — incoming",badge:P,readOnly:d,host:p.host,port:String(p.port),security:p.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:h=>{i(u=>({...u,host:h})),m(null)},onPortChange:h=>i(u=>({...u,port:Number(h)})),onSecurityChange:h=>i(u=>({...u,security:h}))}),t.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),t.jsx(J,{legend:"SMTP — outgoing (optional)",badge:P,readOnly:d,host:f.host,port:String(f.port),security:f.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:h=>{w(u=>({...u,host:h})),m(null)},onPortChange:h=>w(u=>({...u,port:Number(h)})),onSecurityChange:h=>w(u=>({...u,security:h}))}),k&&t.jsxs("p",{className:"text-2xs text-fg-subtle",children:[k.passwordHelp.text," ",A&&t.jsx("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}function Bt({email:e,username:r,password:s,onContinue:n,onBack:a,onChange:o}){const[l,p]=c.useState(r||e),[i,f]=c.useState(s),[w,b]=c.useState(null),y=e.split("@")[1]??"",j=nt(e),x=l.trim()!==""&&i.trim()!=="";c.useEffect(()=>{o(l,i)},[l,i,o]);const g=c.useCallback(()=>{if(!x){b("Enter your username and password.");return}b(null),n()},[x,n]);return c.useEffect(()=>{const m=k=>{k.key==="Enter"&&g(),k.key==="Escape"&&a()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[g,a]),t.jsx(L,{steps:M,activeStep:O.credentials,title:`Sign in to ${y||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:a,children:"Back"}),t.jsx(N,{variant:"primary",onClick:g,children:"Test connection"})]}),children:t.jsxs("div",{className:"space-y-3",children:[w&&t.jsx("div",{className:"rounded-md bg-danger-soft px-3 py-2 text-sm text-danger",children:w}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"credentials-username",children:"Username"}),t.jsx(F,{id:"credentials-username",value:l,onChange:m=>{p(m.target.value),b(null)},autoComplete:"username"})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"credentials-password",children:"Password or app password"}),t.jsx(vt,{id:"credentials-password",value:i,onChange:m=>{f(m.target.value),b(null)},autoComplete:"current-password"})]}),t.jsx(Ct,{url:j})]})})}function Ut({email:e,imapConfig:r,smtpConfig:s,username:n,password:a,onSuccess:o,onBackToCredentials:l,onBackToServers:p}){const[i,f]=c.useState({imapState:"running",smtpState:"pending",phase:"running"}),[w,b]=c.useState(0),y=s.host.trim()!=="",j=q(r.security),x=q(s.security),g=V({...gt()});c.useEffect(()=>{let d=!1;const E=[];return f({imapState:"running",smtpState:"pending",phase:"running"}),g.mutate({body:{username:n,password:a,imapHost:r.host,imapPort:r.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:s.host,smtpPort:s.port,smtpTls:x.tls,smtpStartTls:x.startTls}},{onSuccess:v=>{if(d)return;const S=v.imapSuccess,T=y?v.smtpSuccess:!0;f({imapState:S?"ok":"failed",smtpState:y?"running":"ok",imapDetail:S?`Connected — ${r.host}:${r.port}`:v.imapError,phase:"running"}),E.push(window.setTimeout(()=>{if(d)return;const z=A=>{const h=A?.toLowerCase()??"";return h.includes("auth")||h.includes("login")||h.includes("535")||h.includes("credential")},P=!S&&z(v.imapError)||S&&y&&!v.smtpSuccess&&z(v.smtpError);f({imapState:S?"ok":"failed",smtpState:y?v.smtpSuccess?"ok":"failed":"ok",imapDetail:S?`Connected — ${r.host}:${r.port}`:v.imapError,smtpDetail:y?v.smtpSuccess?`Connected — ${s.host}:${s.port}`:v.smtpError:"Not set up — receive-only",rawError:S?y&&!v.smtpSuccess?v.smtpError:void 0:v.imapError,phase:S&&T?"success":P?"auth-failure":"network-failure"}),S&&T&&E.push(window.setTimeout(()=>{d||o()},800))},400))},onError:v=>{if(d)return;const S=v instanceof Error?v.message:"Connection failed";f({imapState:"failed",smtpState:"failed",imapDetail:S,smtpDetail:S,rawError:S,phase:"network-failure"})}}),()=>{d=!0;for(const v of E)window.clearTimeout(v)}},[w]);const{phase:m}=i;c.useEffect(()=>{const d=E=>{E.key==="Escape"&&(m==="auth-failure"?l():m==="network-failure"&&p())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[m,l,p]);const k=m==="auth-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:l,children:"Back to credentials"}),t.jsx(N,{variant:"primary",onClick:()=>b(d=>d+1),children:"Retry"})]}):m==="network-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:p,children:"Back to servers"}),t.jsx(N,{variant:"primary",onClick:()=>b(d=>d+1),children:"Retry"})]}):m==="success"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Connection verified"}),t.jsx(N,{variant:"primary",onClick:o,children:"Start syncing"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Testing…"}),t.jsx("span",{})]});return t.jsx(L,{steps:M,activeStep:O.test,title:"Testing the connection",subtitle:`Checking ${e}`,footer:k,children:t.jsxs("div",{className:"divide-y divide-line",children:[t.jsx(_,{label:`IMAP — ${r.host}:${r.port}`,detail:i.imapDetail,state:i.imapState}),t.jsx(_,{label:y?`SMTP — ${s.host}:${s.port}`:"SMTP — sending",detail:y?i.smtpDetail:"Not set up — you can add sending later in Settings",state:i.smtpState}),(m==="auth-failure"||m==="network-failure")&&i.rawError&&t.jsxs("div",{className:"py-3",children:[m==="auth-failure"&&t.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:"Check your password — many providers require an app password."}),t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:i.rawError})]})]})})}const Wt=2e4;function Vt({email:e,displayName:r,imapConfig:s,smtpConfig:n,username:a,password:o,onGoToInbox:l}){const p=ht(),[i,f]=c.useState(null),[w,b]=c.useState(null),y=c.useRef(!1),j=q(s.security),x=q(n.security),g=V({...ft(),onSuccess:C=>{f(C.accountId),p.invalidateQueries({queryKey:xt()})},onError:C=>{b(C instanceof Error?C.message:"Failed to create account")}});c.useEffect(()=>{if(y.current)return;y.current=!0;const C=n.host.trim()!=="",H=wt({imapHost:s.host,smtpHost:n.host,smtpPort:n.port}),$=C?H??{smtpHost:n.host,smtpPort:n.port,smtpTls:x.tls,smtpStartTls:x.startTls}:null;g.mutate({body:{email:e,displayName:r||void 0,username:a!==e?a:void 0,password:o,imapHost:s.host,imapPort:s.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:$?.smtpHost||void 0,smtpPort:$?.smtpPort||void 0,smtpTls:$?.smtpTls??!1,smtpStartTls:$?.smtpStartTls??!1}})},[]);const{data:m,isError:k}=K({...Y({path:{accountId:i??""}}),enabled:!!i,refetchInterval:C=>{const H=C.state.data?.syncPhase;return H==="complete"||H==="error"?!1:2e3}}),d=m?.syncPhase==="error",{data:E}=K({...yt(),enabled:!!i&&d}),v=E?.accounts.find(C=>C.accountId===i)?.lastError,S=m?.mailboxes.find(C=>C.fullPath==="INBOX"||C.fullPath==="Inbox"),T=m?.mailboxCountTotal??0,z=m?.mailboxCountSynced??0,P=S?.messagesTotal??0,A=S?.messagesSynced??0,h=P>0?A/P:0,u=m?.syncPhase,ct=d?"failed":u==="idle"||u===void 0||u==="discovering_mailboxes"?"running":T>0?"ok":"running",G=d?"failed":!u||u==="idle"||u==="discovering_mailboxes"?"pending":u==="syncing_inbox"||u==="syncing_others"?"running":"ok",B=d?"failed":!u||u==="idle"||u==="discovering_mailboxes"||u==="syncing_inbox"?"pending":u==="syncing_others"?"running":"ok",lt=A>0||S?.phase==="complete"||u==="complete"||d,[mt,ut]=c.useState(!1);c.useEffect(()=>{if(!i)return;const C=setTimeout(()=>ut(!0),Wt);return()=>clearTimeout(C)},[i]);const dt=!!i&&(lt||k||mt);return w?t.jsx(L,{steps:M,activeStep:O.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{}),t.jsx(N,{variant:"primary",onClick:()=>{y.current=!1,b(null),g.mutate({body:{email:e,displayName:r||void 0,username:a!==e?a:void 0,password:o,imapHost:s.host,imapPort:s.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:n.host||void 0,smtpPort:n.port||void 0,smtpTls:x.tls,smtpStartTls:x.startTls}})},children:"Retry"})]}),children:t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:w})}):t.jsx(L,{steps:M,activeStep:O.sync,title:`Syncing ${e}`,subtitle:"Newest mail first — you can start reading right away.",footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),dt?t.jsx(N,{variant:"primary",onClick:()=>i&&l(i),children:"Go to inbox"}):t.jsx(N,{variant:"primary",disabled:!0,icon:t.jsx(D,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:g.isPending?t.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[t.jsx(D,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):t.jsxs("div",{className:"space-y-3",children:[P>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[t.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),t.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[A.toLocaleString()," / ",P.toLocaleString()," ","messages"]})]}),t.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:t.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,h*100)}%`}})})]}),t.jsxs("div",{className:"divide-y divide-line",children:[t.jsx(_,{label:"Mailboxes discovered",detail:T>0?`${T} mailbox${T===1?"":"es"} found`:"Discovering…",state:ct}),t.jsx(_,{label:"INBOX",detail:G==="ok"?`${A.toLocaleString()} messages synced`:G==="running"?"Syncing newest first…":"Queued",state:G}),z>1||u==="syncing_others"||u==="complete"?t.jsx(_,{label:"Other mailboxes",detail:B==="ok"?`${z-1} mailboxes synced`:B==="running"?"Syncing…":"Queued",state:B}):null]}),d&&t.jsxs("div",{className:"mt-2 space-y-2",children:[t.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",t.jsx("button",{type:"button",className:"underline",onClick:()=>{p.invalidateQueries({queryKey:Y({path:{accountId:i??""}}).queryKey})},children:"retry"})]}),v&&t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:v})]})]})})}function Yt({skipWelcome:e=!1,onComplete:r,onCancel:s}){const[n,a]=c.useState(e?"connector":"welcome"),[o,l]=c.useState({email:"",displayName:"",imapConfig:et,smtpConfig:st,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),p=c.useCallback(()=>a("connector"),[]),i=c.useCallback(()=>a("address"),[]),f=c.useCallback(()=>a("microsoft-email"),[]),w=c.useCallback(()=>{e?s?.():a("welcome")},[e,s]),b=c.useCallback((m,k,d)=>{let E=et,v=st,S=!1;d&&(S=d.source!=="heuristic",E={host:d.imap.host,port:d.imap.port,security:d.imap.security},v={host:d.smtp.host,port:d.smtp.port,security:d.smtp.security}),l(T=>({...T,email:m,displayName:k,imapConfig:E,smtpConfig:v,discoveryResult:d,discovered:S,username:m})),a("servers")},[]),y=c.useCallback((m,k)=>{l(d=>({...d,imapConfig:m,smtpConfig:k}))},[]),j=c.useCallback((m,k)=>{l(d=>({...d,username:m,password:k}))},[]),x=c.useCallback(()=>a("sync"),[]),g=c.useCallback(m=>{r(m)},[r]);switch(n){case"welcome":return t.jsx(Ht,{onStart:p});case"connector":return t.jsx($t,{onContinue:i,onMicrosoft:f,onBack:w,showBack:!e});case"microsoft-email":return t.jsx(Dt,{onBack:()=>a("connector"),onRedirecting:()=>{}});case"address":return t.jsx(qt,{initialEmail:o.email,initialDisplayName:o.displayName,onContinue:b,onBack:()=>a("connector")});case"servers":return t.jsx(Gt,{email:o.email,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,discovered:o.discovered,onContinue:()=>a("credentials"),onBack:()=>a("address"),onChange:y});case"credentials":return t.jsx(Bt,{email:o.email,username:o.username,password:o.password,onContinue:()=>a("test"),onBack:()=>a("servers"),onChange:j});case"test":return t.jsx(Ut,{email:o.email,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,username:o.username,password:o.password,onSuccess:x,onBackToCredentials:()=>a("credentials"),onBackToServers:()=>a("servers")});case"sync":return t.jsx(Vt,{email:o.email,displayName:o.displayName,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,username:o.username,password:o.password,onGoToInbox:g})}}export{Yt as O,it as P,tt as g,q as s};
@@ -1 +1 @@
1
- import{a as s}from"./index-Cg3kRYrn.js";const u=s("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),o=587,i=!1,e=!0,c=t=>t.replace(/^imap\./i,"smtp."),a=t=>{if((t.smtpHost?.trim()??"").length>0)return null;const n=t.imapHost.trim();return n.length===0?null:{smtpHost:c(n),smtpPort:o,smtpTls:i,smtpStartTls:e}},m=t=>{const r=t?.toLowerCase()??"";return r.includes("auth")||r.includes("login")||r.includes("535")||r.includes("credential")},l=(t,r)=>!t||!r||!m(t)?t:`${t} — ${r}`,d=t=>t.smtpEnabled!==!0;export{u as M,d as a,l as b,a as c,c as d};
1
+ import{a as s}from"./index-DWwdULmh.js";const u=s("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),o=587,i=!1,e=!0,c=t=>t.replace(/^imap\./i,"smtp."),a=t=>{if((t.smtpHost?.trim()??"").length>0)return null;const n=t.imapHost.trim();return n.length===0?null:{smtpHost:c(n),smtpPort:o,smtpTls:i,smtpStartTls:e}},m=t=>{const r=t?.toLowerCase()??"";return r.includes("auth")||r.includes("login")||r.includes("535")||r.includes("credential")},l=(t,r)=>!t||!r||!m(t)?t:`${t} — ${r}`,d=t=>t.smtpEnabled!==!0;export{u as M,d as a,l as b,a as c,c as d};