@remit/web-client-dist 0.0.637 → 0.0.639
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.
- package/assets/{BriefPane-i-1XzvAd.js → BriefPane-CdiCvSuF.js} +1 -1
- package/assets/{CalendarComposePane-C9LVQJgz.js → CalendarComposePane-C5loQEEz.js} +1 -1
- package/assets/{CalendarComposeSeed-BcquqWwH.js → CalendarComposeSeed-B602bh7Z.js} +1 -1
- package/assets/{CalendarShell-BrNxa6Nn.js → CalendarShell-BP7ONGRL.js} +1 -1
- package/assets/{EmptyState-haDMp8Ar.js → EmptyState-ClLPPGI1.js} +1 -1
- package/assets/{ErrorState-CmLGalXf.js → ErrorState-CX8jPS64.js} +1 -1
- package/assets/{FlaggedPane-B5Ht6vwP.js → FlaggedPane-CD2pUbFg.js} +1 -1
- package/assets/{FullCompose-BDr9-FPu.js → FullCompose-CgTCPbiG.js} +1 -1
- package/assets/MailListHeader-C8fUfLdY.js +7 -0
- package/assets/{MailNav-BQXjAtKO.js → MailNav-CFYn6k9r.js} +1 -1
- package/assets/{MailShell-CBX109fx.js → MailShell-BnAscFqh.js} +1 -1
- package/assets/{MailViewChrome-K588o61G.js → MailViewChrome-BgP0RFzV.js} +1 -1
- package/assets/{MailboxPane-D9zqi3Rr.js → MailboxPane-CG-dcZ55.js} +1 -1
- package/assets/{NavMenuButton-BpGFPcon.js → NavMenuButton-ggAVFYnQ.js} +1 -1
- package/assets/{OnboardingWizard-ThfV-x2z.js → OnboardingWizard-CrpfDnhV.js} +1 -1
- package/assets/{OpenCalendarEvent-BwmHUJaw.js → OpenCalendarEvent-C-aoRB9f.js} +1 -1
- package/assets/{OutboxPane-Bk9nNby0.js → OutboxPane-CM3kwG8i.js} +1 -1
- package/assets/_calendarObjectId-UmX8K95N.js +1 -0
- package/assets/_mailboxId-DRa01xOQ.js +1 -0
- package/assets/_messageId-BMOloRC2.js +1 -0
- package/assets/_messageId-UrdBJAzT.js +1 -0
- package/assets/_messageId-s6b1mjWq.js +1 -0
- package/assets/_outboxMessageId-C8DuFjhs.js +1 -0
- package/assets/_recurrenceId-qf3rXRrq.js +1 -0
- package/assets/_threadId-CkqELJtN.js +1 -0
- package/assets/_threadId-DdjdPPV9.js +1 -0
- package/assets/_threadId-Dehzj5sp.js +1 -0
- package/assets/{_view._date-B1Vb2h-D.js → _view._date-8_v9V7g9.js} +1 -1
- package/assets/{accounts-ChoqdfMH.js → accounts-ezV4xN2p.js} +1 -1
- package/assets/{advanced-BQgtDSX_.js → advanced-CHdzXVPf.js} +1 -1
- package/assets/{appearance-CiLCRkQD.js → appearance-Dzm_Xcwd.js} +1 -1
- package/assets/{attendee-row-DMe42k7H.js → attendee-row-DaC0cWu0.js} +1 -1
- package/assets/{avatar-OJww5F3k.js → avatar-CMrR_WCW.js} +1 -1
- package/assets/{bell-off-JyhxJiJh.js → bell-off-CjFQsmU0.js} +1 -1
- package/assets/{bottom-sheet-BXHtkHEQ.js → bottom-sheet-lVnXVWKS.js} +1 -1
- package/assets/{brief-Ct3P0mmd.js → brief-B2hZLxBG.js} +1 -1
- package/assets/brief-CbnxY4As.js +1 -0
- package/assets/{browser-ponyfill-BZhAFCLP.js → browser-ponyfill-_Ty7DcLK.js} +1 -1
- package/assets/{bug-BXAS92HM.js → bug-ysY2Lcys.js} +1 -1
- package/assets/{calendar-CIrHuuJU.js → calendar-CozJzlZZ.js} +1 -1
- package/assets/{calendar-clash-strip-Do_J9SgJ.js → calendar-clash-strip-DH-rkJMi.js} +1 -1
- package/assets/{calendar-format-CwRw4RDu.js → calendar-format-CHntutZg.js} +1 -1
- package/assets/{calendar-report-DMvb9Sqg.js → calendar-report-DAUzkHX3.js} +1 -1
- package/assets/calendar-suggestion-CaACTNVX.js +1 -0
- package/assets/{calendars-FdgmByI_.js → calendars-CYKvOlYj.js} +1 -1
- package/assets/{card-Cj-QGmCF.js → card-ChUQkNyW.js} +1 -1
- package/assets/{checkbox-SlSTA73y.js → checkbox-lv4ht1p0.js} +1 -1
- package/assets/chevron-left-BnXYRBLM.js +1 -0
- package/assets/{circle-check-Bp2lyV0E.js → circle-check-CmZH70G9.js} +1 -1
- package/assets/{circle-check-big-Vq2QoGgP.js → circle-check-big-DsPxeo1f.js} +1 -1
- package/assets/{circle-help-gen-dtEL.js → circle-help-CxlWBIxf.js} +1 -1
- package/assets/{clock-BBpIdhnS.js → clock-BQFlXobK.js} +1 -1
- package/assets/compose._-_outboxMessageId_-BFJxAVoN.js +1 -0
- package/assets/compose._-_outboxMessageId_-Bth4jzBG.js +1 -0
- package/assets/compose._-_outboxMessageId_-C8FGmbP_.js +1 -0
- package/assets/compose._-_outboxMessageId_-Kpi3RLY9.js +1 -0
- package/assets/{config-import-DwGVp5nY.js → config-import-CO5AR73r.js} +1 -1
- package/assets/{confirm-dialog-DqUyGPYb.js → confirm-dialog-DM1V3tLO.js} +1 -1
- package/assets/{copy-BFnJYo3G.js → copy-D9w0yOJZ.js} +1 -1
- package/assets/{credential-steps-BYrGAoU5.js → credential-steps-8oD-bgsd.js} +1 -1
- package/assets/{download-CExFNT5m.js → download-D3c-jAvE.js} +1 -1
- package/assets/{file-json-ChcZbyWI.js → file-json-DgAW6fCg.js} +1 -1
- package/assets/{filters-DSI3RcDp.js → filters-COsyZM0t.js} +1 -1
- package/assets/flagged-DKGPYmqT.js +1 -0
- package/assets/{flagged-BTuHoVag.js → flagged-PvSBYoZf.js} +1 -1
- package/assets/{folders-B3UvbiMG.js → folders-9bvPOa--.js} +1 -1
- package/assets/{help-copy-BpnCsJKm.js → help-copy-Bfcrl0wG.js} +1 -1
- package/assets/{import-BtjgDhbI.js → import-CZn1xOPk.js} +1 -1
- package/assets/index-BMOloRC2.js +1 -0
- package/assets/{index-CEJMvVKP.js → index-BNf6kiaX.js} +7 -7
- package/assets/index-BT8lpC7o.js +1 -0
- package/assets/index-B_EiAJWG.js +1 -0
- package/assets/index-C3ge01DK.js +1 -0
- package/assets/{index-C44gqDSI.js → index-COLU2y0-.js} +1 -1
- package/assets/index-Ca6ZI10M.js +1 -0
- package/assets/index-CpzmW4H6.js +1 -0
- package/assets/index-DLln0xg-.js +1 -0
- package/assets/{index-BgsHJXrW.js → index-J89guRVU.js} +4 -4
- package/assets/index-Ncy8w6TK.js +1 -0
- package/assets/index-UrdBJAzT.js +1 -0
- package/assets/{kbd-o1nflZRu.js → kbd-CKw25IK5.js} +1 -1
- package/assets/{labels-DHP_zjK4.js → labels-CfHv29D2.js} +1 -1
- package/assets/{mail-Szc-p5g3.js → mail-5fD0jufv.js} +1 -1
- package/assets/{mail-xjJzF7Ec.js → mail-Daw23XZE.js} +1 -1
- package/assets/{menu-B7ZT3hES.js → menu-lOydIsUw.js} +1 -1
- package/assets/minus-oqpCotLr.js +1 -0
- package/assets/{new-DHxq4krb.js → new-Bx8aW3eQ.js} +1 -1
- package/assets/onboarding-CeRgXqq1.js +1 -0
- package/assets/{onboarding-completion-DIPuDK0D.js → onboarding-completion-Dyuup5X9.js} +1 -1
- package/assets/outbox-ughpF9_W.js +1 -0
- package/assets/{pane-header-BCtLNcGD.js → pane-header-CKSUzAfS.js} +1 -1
- package/assets/{pencil-BDdwSTNF.js → pencil-mpUWk0sq.js} +1 -1
- package/assets/{popover-menu-DH1B01dU.js → popover-menu-Cl-N1YPe.js} +1 -1
- package/assets/{refresh-cw-DmMLGyvw.js → refresh-cw-D2y2CKsF.js} +1 -1
- package/assets/{rich-text-DEvS7fTK.js → rich-text-D3O6tZw_.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-BKBVX-2v.js → rich-text-spellcheck-worker-provider-DrY6X3cn.js} +1 -1
- package/assets/{rotate-ccw-BzTXXy6H.js → rotate-ccw-86rVy6Oh.js} +1 -1
- package/assets/{roving-focus-D8ieiood.js → roving-focus-CzTCkI7v.js} +1 -1
- package/assets/{row-actions-d4_6b5VY.js → row-actions-C0iitOlE.js} +1 -1
- package/assets/{search-mirror-wk9khC5m.js → search-mirror-BlS_Ifso.js} +1 -1
- package/assets/{search-token-index-CrVbBlms.js → search-token-index-BXCXhECA.js} +1 -1
- package/assets/{sections-CgVZgQC0.js → sections-CmVNNIn5.js} +1 -1
- package/assets/{senders-mxAKZ_FE.js → senders-D9KOa6tO.js} +1 -1
- package/assets/settings-CGcDDxqi.js +1 -0
- package/assets/{settings-screen-Bsl0UC9v.js → settings-screen-CPKUaFTz.js} +1 -1
- package/assets/{shield-check-CUjnaEJM.js → shield-check-Bz65Alvp.js} +1 -1
- package/assets/{suggested-vips-BENsVw__.js → suggested-vips-jAg1lHBx.js} +1 -1
- package/assets/{undo-2-QAbYZsVP.js → undo-2-C5A6ikAQ.js} +1 -1
- package/assets/{useCalendarData-J9M1uPwl.js → useCalendarData-Di1HMX87.js} +1 -1
- package/assets/{useCalendarWrites-CMxbq1Ns.js → useCalendarWrites-B_iDGi_d.js} +1 -1
- package/assets/{useCalendars-DEAe0d5P.js → useCalendars-Du8oLBQy.js} +1 -1
- package/assets/{useDebouncedValue-CypIbLxd.js → useDebouncedValue-Cyjl5fcM.js} +1 -1
- package/assets/{useFilters-Cv87jtMp.js → useFilters-Dn74lJWT.js} +1 -1
- package/assets/{useLabels-B74FIyrh.js → useLabels-Bhad46sq.js} +1 -1
- package/assets/{useLayoutTier-BnLQZtW5.js → useLayoutTier-I-ZeE96x.js} +1 -1
- package/assets/{useMessageBodyContent-QMy924K4.js → useMessageBodyContent-Bl5Y6AAH.js} +1 -1
- package/assets/{useQueries-DBc1JIwH.js → useQueries-Ch9XYsKm.js} +1 -1
- package/assets/{useRefreshControl-DNtJwW7i.js → useRefreshControl-sKR2_udi.js} +1 -1
- package/assets/{useResultFolderIndex-BeXuylki.js → useResultFolderIndex-CizpN02R.js} +1 -1
- package/assets/{useSearchTokenContext-_mPqHIqE.js → useSearchTokenContext-Dl9jDzQw.js} +1 -1
- package/assets/{useSemanticSearch-JUvleuzy.js → useSemanticSearch-NkagUfNs.js} +1 -1
- package/assets/{useSignature-_lI__r_z.js → useSignature-z9_OAiTD.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/MailListHeader-D8dncvLk.js +0 -7
- package/assets/_calendarObjectId-D9_7PYZI.js +0 -1
- package/assets/_mailboxId-BuhgZ4EU.js +0 -1
- package/assets/_messageId-BoJ0kGms.js +0 -1
- package/assets/_messageId-BtCpeBln.js +0 -1
- package/assets/_messageId-sDYnK_ny.js +0 -1
- package/assets/_outboxMessageId-DnZaclF5.js +0 -1
- package/assets/_recurrenceId-75JuQikX.js +0 -1
- package/assets/_threadId-DQ7XFMjK.js +0 -1
- package/assets/_threadId-Dj_Z5hNe.js +0 -1
- package/assets/_threadId-E1Ji1VBb.js +0 -1
- package/assets/brief-3daIc_U_.js +0 -1
- package/assets/calendar-suggestion-f9IkXHda.js +0 -1
- package/assets/chevron-left-CyT8rYCK.js +0 -1
- package/assets/compose._-_outboxMessageId_-Bx07nXWx.js +0 -1
- package/assets/compose._-_outboxMessageId_-BxSDuFqr.js +0 -1
- package/assets/compose._-_outboxMessageId_-Dskdpi6-.js +0 -1
- package/assets/compose._-_outboxMessageId_-f_gWZERZ.js +0 -1
- package/assets/flagged-BZt2fsuR.js +0 -1
- package/assets/index-BS7Corg7.js +0 -1
- package/assets/index-BbW12rrk.js +0 -1
- package/assets/index-BtCpeBln.js +0 -1
- package/assets/index-C1YxhEeX.js +0 -1
- package/assets/index-CB6Q9Qtt.js +0 -1
- package/assets/index-CTeWdcpn.js +0 -1
- package/assets/index-CWfcTzfZ.js +0 -1
- package/assets/index-Dt3c3MCO.js +0 -1
- package/assets/index-sDYnK_ny.js +0 -1
- package/assets/minus-BD2hQqDO.js +0 -1
- package/assets/onboarding-CdkmnzTh.js +0 -1
- package/assets/outbox-BeQ7n9ml.js +0 -1
- package/assets/settings-Gkdms0mB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as le,r as t,j as e,B as L,h as de,i as te,o as ue,ax as me,c as D,aT as Q,d as U,f as C,L as G,aU as W,ay as pe,az as q,I as he,n as fe}from"./index-BgsHJXrW.js";import{C as xe}from"./checkbox-SlSTA73y.js";import{K as ge}from"./kbd-o1nflZRu.js";import{A as ye,c as ve,d as Se,s as V,W as R,C as _,g as je,e as K,f as be,h as Ce,a as X,S as we,b as ke,R as Ee}from"./credential-steps-BYrGAoU5.js";import{c as Ne}from"./account-form-helpers-DhckT_PN.js";import{M as Ae}from"./mail-xjJzF7Ec.js";import{F as Me}from"./file-json-ChcZbyWI.js";const se=le("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"}]]),Te="Pick at least one. An account has to sync something.",ne=[{id:"Mail",label:"Mail",description:"Messages, folders and sending."},{id:"Calendar",label:"Calendar",description:"This account's provider calendar, read into Remit."}];function Ie({providerName:s,offered:i,selected:c,onChange:o,error:u}){const g=t.useId(),r=ne.filter(p=>i.includes(p.id)),f=u?e.jsx(L,{tone:"danger",variant:"soft",className:"mt-2 text-xs",children:u}):null;if(r.length<2)return f;const l=(p,y)=>{if(!y){o(c.filter(a=>a!==p));return}o(r.filter(a=>a.id===p||c.includes(a.id)).map(a=>a.id))};return e.jsxs("fieldset",{"aria-describedby":g,children:[e.jsx("legend",{className:"text-sm font-semibold text-fg",children:"What should Remit sync?"}),e.jsx("div",{className:"mt-1 divide-y divide-line",children:r.map(p=>e.jsx(xe,{label:p.label,description:p.description,checked:c.includes(p.id),onChange:y=>l(p.id,y.target.checked)},p.id))}),e.jsx("p",{id:g,className:"mt-1.5 text-2xs text-fg-subtle",children:`Adding a service later means signing in with ${s} again.`}),f]})}const ae=[{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"}},{id:"gmail",label:"Gmail",username:"full-email",imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},passwordHelp:{text:"Gmail requires an app password, not your Google password. First turn on 2-Step Verification for your Google Account, then create an app password under Security → 2-Step Verification → App passwords.",url:ye["gmail.com"]}}];function Y(s){return ae.find(i=>i.id===s)}const Pe={"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","gmail.com":"gmail","googlemail.com":"gmail"};function Re(s){const i=s.indexOf("@");if(i===-1)return"";const c=s.slice(i+1).toLowerCase();return Pe[c]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],P={connector:0,"microsoft-granted":5,address:1,servers:2,credentials:3,test:4,sync:5},J={host:"",port:993,security:"tls"},Z={host:"",port:587,security:"starttls"};function Fe({onStart:s,onImportConfig:i}){return t.useEffect(()=>{const c=o=>{o.key==="Enter"&&s()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),e.jsx(R,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:i?"Set up your first account, or bring the settings from another Reader.":"One inbox for all your mail, with context about every message.",footer:e.jsxs(e.Fragment,{children:[i?e.jsx(C,{variant:"secondary",icon:e.jsx(Me,{className:"size-4"}),onClick:i,children:"Import a config file"}):e.jsxs("span",{className:"text-2xs text-fg-subtle",children:[e.jsx(ge,{children:"Enter"})," to continue"]}),e.jsx(C,{variant:"primary",onClick:s,children:"Add your first account"})]}),children:e.jsxs("div",{className:"flex flex-col items-start py-5",children:[e.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:e.jsx(Ae,{className:"size-7 text-accent"})}),e.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."}),i&&e.jsx("p",{className:"mt-3 max-w-sm text-sm leading-relaxed text-fg-muted",children:"A config file carries your accounts, folder roles, rules, flagged senders and appearance from another Reader. It never carries passwords, so you sign in again here."})]})})}function Le({onContinue:s,onMicrosoft:i,onBack:c,showBack:o}){const[u,g]=t.useState("imap");t.useEffect(()=>{const f=l=>{l.key==="Enter"&&(u==="microsoft"?i():s()),l.key==="Escape"&&c()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[s,i,c,u]);const r=()=>{u==="microsoft"?i():s()};return e.jsx(R,{steps:M,activeStep:P.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:e.jsxs(e.Fragment,{children:[o?e.jsx(C,{variant:"ghost",onClick:c,children:"Back"}):e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:r,children:u==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(X,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:e.jsx(we,{className:"size-5"}),selected:u==="imap",onSelect:()=>g("imap")}),e.jsx(X,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:e.jsx(he,{className:"size-5"}),selected:u==="microsoft",onSelect:()=>g("microsoft")})]})})}const ee=["Mail","Calendar"];function Oe({refusal:s,onBack:i,onConnected:c}){const[o,u]=t.useState(s?.email??""),[g,r]=t.useState(s?.services??ee),[f,l]=t.useState(!1),[p,y]=t.useState(s?.message??null),[a,w]=t.useState(!1),[N,j]=t.useState(!1),h=t.useRef(!0);t.useEffect(()=>(h.current=!0,()=>{h.current=!1}),[]);const v=t.useRef(new Set),{refetch:b}=D(U()),k=ke(d=>{if(j(!1),d==="stalled"){w(!1),y(Ee);return}b().then(({data:S,isError:x})=>{if(!h.current)return;if(x||!S){y("Couldn't check whether the sign-in finished. Open Settings › Accounts to see whether the account is connected.");return}y(null);const m=S.accounts.find(n=>!v.current.has(n.accountId));m&&c(m.accountId)})}),F=te({...fe(),onSuccess:d=>{h.current&&(k(),w(!0),window.location.assign(d.authorizationUrl))},onError:d=>{j(!1),y(d instanceof Error?d.message:"Failed to start sign-in")}}),T=N||F.isPending,A=()=>{if(!T){if(g.length===0){l(!0);return}y(null),j(!0),b().then(({data:d,isError:S})=>{if(h.current){if(S||!d){j(!1),y("Couldn't read this instance's accounts, so sign-in can't be tracked. Check your connection and try again.");return}v.current=new Set(d.accounts.map(x=>x.accountId)),F.mutate({body:{email:o.trim()||void 0,services:g}})}})}},I=t.useRef(A);return I.current=A,t.useEffect(()=>{const d=S=>{S.key==="Enter"&&I.current(),S.key==="Escape"&&i()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i]),e.jsx(R,{steps:M,activeStep:P.connector,title:s?.reconnect&&s.email?`Reconnect ${s.email}`:"Sign in with Microsoft",subtitle:"Microsoft is asked for the mail and calendar access you pick here.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:i,children:"Back"}),e.jsx(C,{variant:"primary",onClick:A,disabled:T,icon:T?e.jsx(G,{className:"size-4 animate-spin"}):void 0,children:T?"Redirecting…":a?"Start over":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ie,{providerName:"Microsoft",offered:ee,selected:g,onChange:d=>{r(d),d.length>0&&l(!1)},error:f?Te:void 0}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"microsoft-email",children:"Email address (optional)"}),e.jsx(q,{id:"microsoft-email",icon:e.jsx(se,{className:"size-4"}),placeholder:"you@outlook.com",value:o,onChange:d=>u(d.target.value),type:"email",autoComplete:"email"}),e.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&&e.jsx(L,{tone:"info",children:"Waiting for Microsoft. Finish signing in — this window carries on the moment the account is connected, wherever you finished."}),p&&e.jsx(L,{tone:"danger",children:p})]})})}function _e({accountId:s,onSignInAgain:i,onContinue:c}){const{data:o,isError:u,isFetching:g,refetch:r}=D(U()),f=o?.accounts.find(l=>l.accountId===s);return u?e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"Couldn't read the new account",subtitle:"Microsoft finished, but this instance did not answer.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{r()},disabled:g,children:"Retry"})]}),children:e.jsx(L,{tone:"danger",children:"Couldn't load the account Microsoft just connected. Check your connection and retry, or open Settings › Accounts to see it."})}):!o||!f&&g?e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"Reading the new account",subtitle:"Checking what Microsoft granted.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Loading…"}),e.jsx("span",{})]}),children:e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(G,{className:"size-4 animate-spin text-accent"}),"Loading the account…"]})}):f?e.jsx(Ge,{account:f,onContinue:c}):e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"The account is not here",subtitle:"Microsoft sent the sign-in back, but no account was kept.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:i,children:"Sign in again"})]}),children:e.jsx(L,{tone:"danger",children:"This instance holds no account from that sign-in. Sign in with Microsoft again to connect it."})})}function Ge({account:s,onContinue:i}){const c=s.syncedServices.includes("Mail");return e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:`Connected ${s.email}`,subtitle:"Microsoft granted access to what you picked.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Change this later in Settings › Accounts"}),e.jsx(C,{variant:"primary",onClick:()=>i(s.accountId),children:c?"Go to inbox":"Continue"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"divide-y divide-line",children:ne.map(o=>s.syncedServices.includes(o.id)?e.jsx(_,{label:o.label,detail:"Access granted — syncing",state:"ok"},o.id):e.jsx(_,{label:o.label,detail:"Not synced. Turn it on in Settings › Accounts; Microsoft asks for access then.",state:"pending"},o.id))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Permissions Microsoft granted"}),e.jsx("code",{className:"mt-1 block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted","data-testid":"granted-scopes",children:s.grantedScopes.join(" ")})]})]})})}function He({initialEmail:s,initialDisplayName:i,onContinue:c,onBack:o}){const[u,g]=t.useState(s),[r,f]=t.useState(i),[l,p]=t.useState(!1),[y,a]=t.useState(""),[w,N]=t.useState(null),j=t.useCallback(async()=>{const h=u.trim();if(!h.includes("@")||!h.includes(".")){N("Enter a valid email address.");return}N(null),p(!0),a(be(h));try{const v=await Ce(h);c(h,r.trim(),v)}finally{p(!1)}},[u,r,c]);return t.useEffect(()=>{const h=v=>{v.key==="Enter"&&!l&&j(),v.key==="Escape"&&o()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[j,l,o]),e.jsx(R,{steps:M,activeStep:P.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:o,children:"Back"}),e.jsx(C,{variant:"primary",disabled:l,onClick:()=>{j()},children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(W,{htmlFor:"onboarding-email",children:"Email address"}),e.jsx(q,{id:"onboarding-email",icon:e.jsx(se,{className:"size-4"}),placeholder:"you@example.com",value:u,onChange:h=>{g(h.target.value),N(null)},type:"email",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),e.jsx(q,{id:"onboarding-display-name",placeholder:"Alice",value:r,onChange:h=>f(h.target.value)}),e.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."})]}),l&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(G,{className:"size-3.5 animate-spin text-accent"}),y]}),w&&!l&&e.jsx("div",{className:"mt-3",children:e.jsx(L,{tone:"danger",children:w})})]})})}function ze({email:s,imapConfig:i,smtpConfig:c,discovered:o,onContinue:u,onBack:g,onChange:r}){const[f,l]=t.useState(i),[p,y]=t.useState(c),[a,w]=t.useState(()=>Re(s)),[N,j]=t.useState(!1),[h,v]=t.useState(null),b=Y(a),k=b!==void 0&&!N,F=t.useCallback(m=>{w(m),j(!1),v(null);const n=Y(m);n&&(l({host:n.imap.host,port:n.imap.port,security:n.imap.security}),y({host:n.smtp.host,port:n.smtp.port,security:n.smtp.security}))},[]);t.useEffect(()=>{r(f,p)},[f,p,r]);const T=f.host.trim()!=="",A=t.useCallback(()=>{if(!T){v("Enter the IMAP host.");return}v(null),u()},[T,u]);t.useEffect(()=>{const m=n=>{n.key==="Enter"&&A(),n.key==="Escape"&&g()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[A,g]);const I=s.split("@")[1]??"your domain",d=b?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":o?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${I} — enter them manually.`,S=k?{label:"preset",tone:"neutral"}:!b&&o?{label:"detected",tone:"positive"}:void 0,x=b?.passwordHelp.url??je(s);return e.jsx(R,{steps:M,activeStep:P.servers,title:"Confirm server settings",subtitle:d,footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:g,children:"Back"}),e.jsx(C,{variant:"primary",onClick:A,children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-5",children:[h&&e.jsx(L,{tone:"danger",children:h}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"provider-select",children:"Provider"}),e.jsxs(pe,{id:"provider-select",value:a,onChange:m=>F(m.target.value),children:[e.jsx("option",{value:"",children:"Custom / other"}),ae.map(m=>e.jsx("option",{value:m.id,children:m.label},m.id))]}),b&&e.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:k?e.jsxs(e.Fragment,{children:["Server settings are pre-filled for ",b.label," and locked."," ",e.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>j(!0),children:"Advanced"})," ","lets you edit them by hand."]}):e.jsxs(e.Fragment,{children:["Editing ",b.label,"'s settings by hand."]})})]}),e.jsx(K,{legend:"IMAP — incoming",badge:S,readOnly:k,host:f.host,port:String(f.port),security:f.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:m=>{l(n=>({...n,host:m})),v(null)},onPortChange:m=>l(n=>({...n,port:Number(m)})),onSecurityChange:m=>l(n=>({...n,security:m}))}),e.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."}),e.jsx(K,{legend:"SMTP — outgoing (optional)",badge:S,readOnly:k,host:p.host,port:String(p.port),security:p.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:m=>{y(n=>({...n,host:m})),v(null)},onPortChange:m=>y(n=>({...n,port:Number(m)})),onSecurityChange:m=>y(n=>({...n,security:m}))}),b&&e.jsxs("p",{className:"text-2xs text-fg-subtle",children:[b.passwordHelp.text," ",x&&e.jsx("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}const Be=2e4;function De({email:s,displayName:i,imapConfig:c,smtpConfig:o,username:u,password:g,onGoToInbox:r}){const f=de(),[l,p]=t.useState(null),[y,a]=t.useState(null),w=t.useRef(!1),N=V(c.security),j=V(o.security),h=te({...me(),onSuccess:E=>{p(E.accountId),f.invalidateQueries({queryKey:ue()})},onError:E=>{a(E instanceof Error?E.message:"Failed to create account")}});t.useEffect(()=>{if(w.current)return;w.current=!0;const E=o.host.trim()!=="",z=Ne({imapHost:c.host,smtpHost:o.host,smtpPort:o.port}),B=E?z??{smtpHost:o.host,smtpPort:o.port,smtpTls:j.tls,smtpStartTls:j.startTls}:null;h.mutate({body:{email:s,displayName:i||void 0,username:u!==s?u:void 0,password:g,imapHost:c.host,imapPort:c.port,imapTls:N.tls,imapStartTls:N.startTls,smtpHost:B?.smtpHost||void 0,smtpPort:B?.smtpPort||void 0,smtpTls:B?.smtpTls??!1,smtpStartTls:B?.smtpStartTls??!1}})},[]);const{data:v,isError:b}=D({...Q({path:{accountId:l??""}}),enabled:!!l,refetchInterval:E=>{const z=E.state.data?.syncPhase;return z==="complete"||z==="error"?!1:2e3}}),k=v?.syncPhase==="error",{data:F}=D({...U(),enabled:!!l&&k}),T=F?.accounts.find(E=>E.accountId===l)?.lastError,A=v?.mailboxes.find(E=>E.fullPath==="INBOX"||E.fullPath==="Inbox"),I=v?.mailboxCountTotal??0,d=v?.mailboxCountSynced??0,S=A?.messagesTotal??0,x=A?.messagesSynced??0,m=S>0?x/S:0,n=v?.syncPhase,H=k?"failed":n==="idle"||n===void 0||n==="discovering_mailboxes"?"running":I>0?"ok":"running",O=k?"failed":!n||n==="idle"||n==="discovering_mailboxes"?"pending":n==="syncing_inbox"||n==="syncing_others"?"running":"ok",$=k?"failed":!n||n==="idle"||n==="discovering_mailboxes"||n==="syncing_inbox"?"pending":n==="syncing_others"?"running":"ok",ie=x>0||A?.phase==="complete"||n==="complete"||k,[oe,re]=t.useState(!1);t.useEffect(()=>{if(!l)return;const E=setTimeout(()=>re(!0),Be);return()=>clearTimeout(E)},[l]);const ce=!!l&&(ie||b||oe);return y?e.jsx(R,{steps:M,activeStep:P.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{w.current=!1,a(null),h.mutate({body:{email:s,displayName:i||void 0,username:u!==s?u:void 0,password:g,imapHost:c.host,imapPort:c.port,imapTls:N.tls,imapStartTls:N.startTls,smtpHost:o.host||void 0,smtpPort:o.port||void 0,smtpTls:j.tls,smtpStartTls:j.startTls}})},children:"Retry"})]}),children:e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:y})}):e.jsx(R,{steps:M,activeStep:P.sync,title:`Syncing ${s}`,subtitle:"Newest mail first — you can start reading right away.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),ce?e.jsx(C,{variant:"primary",onClick:()=>l&&r(l),children:"Go to inbox"}):e.jsx(C,{variant:"primary",disabled:!0,icon:e.jsx(G,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:h.isPending?e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(G,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):e.jsxs("div",{className:"space-y-3",children:[S>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[e.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),e.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[x.toLocaleString()," / ",S.toLocaleString()," ","messages"]})]}),e.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,m*100)}%`}})})]}),e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(_,{label:"Mailboxes discovered",detail:I>0?`${I} mailbox${I===1?"":"es"} found`:"Discovering…",state:H}),e.jsx(_,{label:"INBOX",detail:O==="ok"?`${x.toLocaleString()} messages synced`:O==="running"?"Syncing newest first…":"Queued",state:O}),d>1||n==="syncing_others"||n==="complete"?e.jsx(_,{label:"Other mailboxes",detail:$==="ok"?`${d-1} mailboxes synced`:$==="running"?"Syncing…":"Queued",state:$}):null]}),k&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>{f.invalidateQueries({queryKey:Q({path:{accountId:l??""}}).queryKey})},children:"retry"})]}),T&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:T})]})]})})}const We=(s,i)=>i?.kind==="connected"?"microsoft-granted":i?.kind==="refused"?"microsoft-email":s?"connector":"welcome";function Ye({skipWelcome:s=!1,onComplete:i,onCancel:c,onImportConfig:o,microsoftReturn:u}){const[g,r]=t.useState(We(s,u)),[f,l]=t.useState(u?.kind==="refused"?u:void 0),[p,y]=t.useState(u?.kind==="connected"?u.accountId:null),[a,w]=t.useState({email:"",displayName:"",imapConfig:J,smtpConfig:Z,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),N=t.useCallback(()=>r("connector"),[]),j=t.useCallback(()=>r("address"),[]),h=t.useCallback(()=>r("microsoft-email"),[]),v=t.useCallback(()=>{s?c?.():r("welcome")},[s,c]),b=t.useCallback((d,S,x)=>{let m=J,n=Z,H=!1;x&&(H=x.source!=="heuristic",m={host:x.imap.host,port:x.imap.port,security:x.imap.security},n={host:x.smtp.host,port:x.smtp.port,security:x.smtp.security}),w(O=>({...O,email:d,displayName:S,imapConfig:m,smtpConfig:n,discoveryResult:x,discovered:H,username:d})),r("servers")},[]),k=t.useCallback((d,S)=>{w(x=>({...x,imapConfig:d,smtpConfig:S}))},[]),F=t.useCallback((d,S)=>{w(x=>({...x,username:d,password:S}))},[]),T=t.useCallback(()=>r("sync"),[]),A=t.useCallback(d=>{i(d)},[i]),I=e.jsx(Oe,{refusal:f,onBack:()=>{l(void 0),r("connector")},onConnected:d=>{y(d),r("microsoft-granted")}});switch(g){case"welcome":return e.jsx(Fe,{onStart:N,onImportConfig:o});case"connector":return e.jsx(Le,{onContinue:j,onMicrosoft:h,onBack:v,showBack:!s});case"microsoft-email":return I;case"microsoft-granted":return p===null?I:e.jsx(_e,{accountId:p,onSignInAgain:()=>r("microsoft-email"),onContinue:A});case"address":return e.jsx(He,{initialEmail:a.email,initialDisplayName:a.displayName,onContinue:b,onBack:()=>r("connector")});case"servers":return e.jsx(ze,{email:a.email,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,discovered:a.discovered,onContinue:()=>r("credentials"),onBack:()=>r("address"),onChange:k});case"credentials":return e.jsx(Se,{steps:M,activeStep:P.credentials,title:`Sign in to ${a.email.split("@")[1]||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",email:a.email,username:a.username,password:a.password,onContinue:()=>r("test"),onBack:()=>r("servers"),onChange:F});case"test":return e.jsx(ve,{steps:M,activeStep:P.test,email:a.email,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,username:a.username,password:a.password,onSuccess:T,onBackToCredentials:()=>r("credentials"),onBackToServers:()=>r("servers")});case"sync":return e.jsx(De,{email:a.email,displayName:a.displayName,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,username:a.username,password:a.password,onGoToInbox:A})}}export{ne as A,Ye as O,ae as P,Y as g};
|
|
1
|
+
import{e as le,r as t,j as e,B as L,h as de,i as te,o as ue,ax as me,c as D,aT as Q,d as U,f as C,L as G,aU as W,ay as pe,az as q,I as he,n as fe}from"./index-J89guRVU.js";import{C as xe}from"./checkbox-lv4ht1p0.js";import{K as ge}from"./kbd-CKw25IK5.js";import{A as ye,c as ve,d as Se,s as V,W as R,C as _,g as je,e as K,f as be,h as Ce,a as X,S as we,b as ke,R as Ee}from"./credential-steps-8oD-bgsd.js";import{c as Ne}from"./account-form-helpers-DhckT_PN.js";import{M as Ae}from"./mail-Daw23XZE.js";import{F as Me}from"./file-json-DgAW6fCg.js";const se=le("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"}]]),Te="Pick at least one. An account has to sync something.",ne=[{id:"Mail",label:"Mail",description:"Messages, folders and sending."},{id:"Calendar",label:"Calendar",description:"This account's provider calendar, read into Remit."}];function Ie({providerName:s,offered:i,selected:c,onChange:o,error:u}){const g=t.useId(),r=ne.filter(p=>i.includes(p.id)),f=u?e.jsx(L,{tone:"danger",variant:"soft",className:"mt-2 text-xs",children:u}):null;if(r.length<2)return f;const l=(p,y)=>{if(!y){o(c.filter(a=>a!==p));return}o(r.filter(a=>a.id===p||c.includes(a.id)).map(a=>a.id))};return e.jsxs("fieldset",{"aria-describedby":g,children:[e.jsx("legend",{className:"text-sm font-semibold text-fg",children:"What should Remit sync?"}),e.jsx("div",{className:"mt-1 divide-y divide-line",children:r.map(p=>e.jsx(xe,{label:p.label,description:p.description,checked:c.includes(p.id),onChange:y=>l(p.id,y.target.checked)},p.id))}),e.jsx("p",{id:g,className:"mt-1.5 text-2xs text-fg-subtle",children:`Adding a service later means signing in with ${s} again.`}),f]})}const ae=[{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"}},{id:"gmail",label:"Gmail",username:"full-email",imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},passwordHelp:{text:"Gmail requires an app password, not your Google password. First turn on 2-Step Verification for your Google Account, then create an app password under Security → 2-Step Verification → App passwords.",url:ye["gmail.com"]}}];function Y(s){return ae.find(i=>i.id===s)}const Pe={"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","gmail.com":"gmail","googlemail.com":"gmail"};function Re(s){const i=s.indexOf("@");if(i===-1)return"";const c=s.slice(i+1).toLowerCase();return Pe[c]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],P={connector:0,"microsoft-granted":5,address:1,servers:2,credentials:3,test:4,sync:5},J={host:"",port:993,security:"tls"},Z={host:"",port:587,security:"starttls"};function Fe({onStart:s,onImportConfig:i}){return t.useEffect(()=>{const c=o=>{o.key==="Enter"&&s()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),e.jsx(R,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:i?"Set up your first account, or bring the settings from another Reader.":"One inbox for all your mail, with context about every message.",footer:e.jsxs(e.Fragment,{children:[i?e.jsx(C,{variant:"secondary",icon:e.jsx(Me,{className:"size-4"}),onClick:i,children:"Import a config file"}):e.jsxs("span",{className:"text-2xs text-fg-subtle",children:[e.jsx(ge,{children:"Enter"})," to continue"]}),e.jsx(C,{variant:"primary",onClick:s,children:"Add your first account"})]}),children:e.jsxs("div",{className:"flex flex-col items-start py-5",children:[e.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:e.jsx(Ae,{className:"size-7 text-accent"})}),e.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."}),i&&e.jsx("p",{className:"mt-3 max-w-sm text-sm leading-relaxed text-fg-muted",children:"A config file carries your accounts, folder roles, rules, flagged senders and appearance from another Reader. It never carries passwords, so you sign in again here."})]})})}function Le({onContinue:s,onMicrosoft:i,onBack:c,showBack:o}){const[u,g]=t.useState("imap");t.useEffect(()=>{const f=l=>{l.key==="Enter"&&(u==="microsoft"?i():s()),l.key==="Escape"&&c()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[s,i,c,u]);const r=()=>{u==="microsoft"?i():s()};return e.jsx(R,{steps:M,activeStep:P.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:e.jsxs(e.Fragment,{children:[o?e.jsx(C,{variant:"ghost",onClick:c,children:"Back"}):e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:r,children:u==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(X,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:e.jsx(we,{className:"size-5"}),selected:u==="imap",onSelect:()=>g("imap")}),e.jsx(X,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:e.jsx(he,{className:"size-5"}),selected:u==="microsoft",onSelect:()=>g("microsoft")})]})})}const ee=["Mail","Calendar"];function Oe({refusal:s,onBack:i,onConnected:c}){const[o,u]=t.useState(s?.email??""),[g,r]=t.useState(s?.services??ee),[f,l]=t.useState(!1),[p,y]=t.useState(s?.message??null),[a,w]=t.useState(!1),[N,j]=t.useState(!1),h=t.useRef(!0);t.useEffect(()=>(h.current=!0,()=>{h.current=!1}),[]);const v=t.useRef(new Set),{refetch:b}=D(U()),k=ke(d=>{if(j(!1),d==="stalled"){w(!1),y(Ee);return}b().then(({data:S,isError:x})=>{if(!h.current)return;if(x||!S){y("Couldn't check whether the sign-in finished. Open Settings › Accounts to see whether the account is connected.");return}y(null);const m=S.accounts.find(n=>!v.current.has(n.accountId));m&&c(m.accountId)})}),F=te({...fe(),onSuccess:d=>{h.current&&(k(),w(!0),window.location.assign(d.authorizationUrl))},onError:d=>{j(!1),y(d instanceof Error?d.message:"Failed to start sign-in")}}),T=N||F.isPending,A=()=>{if(!T){if(g.length===0){l(!0);return}y(null),j(!0),b().then(({data:d,isError:S})=>{if(h.current){if(S||!d){j(!1),y("Couldn't read this instance's accounts, so sign-in can't be tracked. Check your connection and try again.");return}v.current=new Set(d.accounts.map(x=>x.accountId)),F.mutate({body:{email:o.trim()||void 0,services:g}})}})}},I=t.useRef(A);return I.current=A,t.useEffect(()=>{const d=S=>{S.key==="Enter"&&I.current(),S.key==="Escape"&&i()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i]),e.jsx(R,{steps:M,activeStep:P.connector,title:s?.reconnect&&s.email?`Reconnect ${s.email}`:"Sign in with Microsoft",subtitle:"Microsoft is asked for the mail and calendar access you pick here.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:i,children:"Back"}),e.jsx(C,{variant:"primary",onClick:A,disabled:T,icon:T?e.jsx(G,{className:"size-4 animate-spin"}):void 0,children:T?"Redirecting…":a?"Start over":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ie,{providerName:"Microsoft",offered:ee,selected:g,onChange:d=>{r(d),d.length>0&&l(!1)},error:f?Te:void 0}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"microsoft-email",children:"Email address (optional)"}),e.jsx(q,{id:"microsoft-email",icon:e.jsx(se,{className:"size-4"}),placeholder:"you@outlook.com",value:o,onChange:d=>u(d.target.value),type:"email",autoComplete:"email"}),e.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&&e.jsx(L,{tone:"info",children:"Waiting for Microsoft. Finish signing in — this window carries on the moment the account is connected, wherever you finished."}),p&&e.jsx(L,{tone:"danger",children:p})]})})}function _e({accountId:s,onSignInAgain:i,onContinue:c}){const{data:o,isError:u,isFetching:g,refetch:r}=D(U()),f=o?.accounts.find(l=>l.accountId===s);return u?e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"Couldn't read the new account",subtitle:"Microsoft finished, but this instance did not answer.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{r()},disabled:g,children:"Retry"})]}),children:e.jsx(L,{tone:"danger",children:"Couldn't load the account Microsoft just connected. Check your connection and retry, or open Settings › Accounts to see it."})}):!o||!f&&g?e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"Reading the new account",subtitle:"Checking what Microsoft granted.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Loading…"}),e.jsx("span",{})]}),children:e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(G,{className:"size-4 animate-spin text-accent"}),"Loading the account…"]})}):f?e.jsx(Ge,{account:f,onContinue:c}):e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"The account is not here",subtitle:"Microsoft sent the sign-in back, but no account was kept.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:i,children:"Sign in again"})]}),children:e.jsx(L,{tone:"danger",children:"This instance holds no account from that sign-in. Sign in with Microsoft again to connect it."})})}function Ge({account:s,onContinue:i}){const c=s.syncedServices.includes("Mail");return e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:`Connected ${s.email}`,subtitle:"Microsoft granted access to what you picked.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Change this later in Settings › Accounts"}),e.jsx(C,{variant:"primary",onClick:()=>i(s.accountId),children:c?"Go to inbox":"Continue"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"divide-y divide-line",children:ne.map(o=>s.syncedServices.includes(o.id)?e.jsx(_,{label:o.label,detail:"Access granted — syncing",state:"ok"},o.id):e.jsx(_,{label:o.label,detail:"Not synced. Turn it on in Settings › Accounts; Microsoft asks for access then.",state:"pending"},o.id))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Permissions Microsoft granted"}),e.jsx("code",{className:"mt-1 block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted","data-testid":"granted-scopes",children:s.grantedScopes.join(" ")})]})]})})}function He({initialEmail:s,initialDisplayName:i,onContinue:c,onBack:o}){const[u,g]=t.useState(s),[r,f]=t.useState(i),[l,p]=t.useState(!1),[y,a]=t.useState(""),[w,N]=t.useState(null),j=t.useCallback(async()=>{const h=u.trim();if(!h.includes("@")||!h.includes(".")){N("Enter a valid email address.");return}N(null),p(!0),a(be(h));try{const v=await Ce(h);c(h,r.trim(),v)}finally{p(!1)}},[u,r,c]);return t.useEffect(()=>{const h=v=>{v.key==="Enter"&&!l&&j(),v.key==="Escape"&&o()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[j,l,o]),e.jsx(R,{steps:M,activeStep:P.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:o,children:"Back"}),e.jsx(C,{variant:"primary",disabled:l,onClick:()=>{j()},children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(W,{htmlFor:"onboarding-email",children:"Email address"}),e.jsx(q,{id:"onboarding-email",icon:e.jsx(se,{className:"size-4"}),placeholder:"you@example.com",value:u,onChange:h=>{g(h.target.value),N(null)},type:"email",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),e.jsx(q,{id:"onboarding-display-name",placeholder:"Alice",value:r,onChange:h=>f(h.target.value)}),e.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."})]}),l&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(G,{className:"size-3.5 animate-spin text-accent"}),y]}),w&&!l&&e.jsx("div",{className:"mt-3",children:e.jsx(L,{tone:"danger",children:w})})]})})}function ze({email:s,imapConfig:i,smtpConfig:c,discovered:o,onContinue:u,onBack:g,onChange:r}){const[f,l]=t.useState(i),[p,y]=t.useState(c),[a,w]=t.useState(()=>Re(s)),[N,j]=t.useState(!1),[h,v]=t.useState(null),b=Y(a),k=b!==void 0&&!N,F=t.useCallback(m=>{w(m),j(!1),v(null);const n=Y(m);n&&(l({host:n.imap.host,port:n.imap.port,security:n.imap.security}),y({host:n.smtp.host,port:n.smtp.port,security:n.smtp.security}))},[]);t.useEffect(()=>{r(f,p)},[f,p,r]);const T=f.host.trim()!=="",A=t.useCallback(()=>{if(!T){v("Enter the IMAP host.");return}v(null),u()},[T,u]);t.useEffect(()=>{const m=n=>{n.key==="Enter"&&A(),n.key==="Escape"&&g()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[A,g]);const I=s.split("@")[1]??"your domain",d=b?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":o?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${I} — enter them manually.`,S=k?{label:"preset",tone:"neutral"}:!b&&o?{label:"detected",tone:"positive"}:void 0,x=b?.passwordHelp.url??je(s);return e.jsx(R,{steps:M,activeStep:P.servers,title:"Confirm server settings",subtitle:d,footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:g,children:"Back"}),e.jsx(C,{variant:"primary",onClick:A,children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-5",children:[h&&e.jsx(L,{tone:"danger",children:h}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"provider-select",children:"Provider"}),e.jsxs(pe,{id:"provider-select",value:a,onChange:m=>F(m.target.value),children:[e.jsx("option",{value:"",children:"Custom / other"}),ae.map(m=>e.jsx("option",{value:m.id,children:m.label},m.id))]}),b&&e.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:k?e.jsxs(e.Fragment,{children:["Server settings are pre-filled for ",b.label," and locked."," ",e.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>j(!0),children:"Advanced"})," ","lets you edit them by hand."]}):e.jsxs(e.Fragment,{children:["Editing ",b.label,"'s settings by hand."]})})]}),e.jsx(K,{legend:"IMAP — incoming",badge:S,readOnly:k,host:f.host,port:String(f.port),security:f.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:m=>{l(n=>({...n,host:m})),v(null)},onPortChange:m=>l(n=>({...n,port:Number(m)})),onSecurityChange:m=>l(n=>({...n,security:m}))}),e.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."}),e.jsx(K,{legend:"SMTP — outgoing (optional)",badge:S,readOnly:k,host:p.host,port:String(p.port),security:p.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:m=>{y(n=>({...n,host:m})),v(null)},onPortChange:m=>y(n=>({...n,port:Number(m)})),onSecurityChange:m=>y(n=>({...n,security:m}))}),b&&e.jsxs("p",{className:"text-2xs text-fg-subtle",children:[b.passwordHelp.text," ",x&&e.jsx("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}const Be=2e4;function De({email:s,displayName:i,imapConfig:c,smtpConfig:o,username:u,password:g,onGoToInbox:r}){const f=de(),[l,p]=t.useState(null),[y,a]=t.useState(null),w=t.useRef(!1),N=V(c.security),j=V(o.security),h=te({...me(),onSuccess:E=>{p(E.accountId),f.invalidateQueries({queryKey:ue()})},onError:E=>{a(E instanceof Error?E.message:"Failed to create account")}});t.useEffect(()=>{if(w.current)return;w.current=!0;const E=o.host.trim()!=="",z=Ne({imapHost:c.host,smtpHost:o.host,smtpPort:o.port}),B=E?z??{smtpHost:o.host,smtpPort:o.port,smtpTls:j.tls,smtpStartTls:j.startTls}:null;h.mutate({body:{email:s,displayName:i||void 0,username:u!==s?u:void 0,password:g,imapHost:c.host,imapPort:c.port,imapTls:N.tls,imapStartTls:N.startTls,smtpHost:B?.smtpHost||void 0,smtpPort:B?.smtpPort||void 0,smtpTls:B?.smtpTls??!1,smtpStartTls:B?.smtpStartTls??!1}})},[]);const{data:v,isError:b}=D({...Q({path:{accountId:l??""}}),enabled:!!l,refetchInterval:E=>{const z=E.state.data?.syncPhase;return z==="complete"||z==="error"?!1:2e3}}),k=v?.syncPhase==="error",{data:F}=D({...U(),enabled:!!l&&k}),T=F?.accounts.find(E=>E.accountId===l)?.lastError,A=v?.mailboxes.find(E=>E.fullPath==="INBOX"||E.fullPath==="Inbox"),I=v?.mailboxCountTotal??0,d=v?.mailboxCountSynced??0,S=A?.messagesTotal??0,x=A?.messagesSynced??0,m=S>0?x/S:0,n=v?.syncPhase,H=k?"failed":n==="idle"||n===void 0||n==="discovering_mailboxes"?"running":I>0?"ok":"running",O=k?"failed":!n||n==="idle"||n==="discovering_mailboxes"?"pending":n==="syncing_inbox"||n==="syncing_others"?"running":"ok",$=k?"failed":!n||n==="idle"||n==="discovering_mailboxes"||n==="syncing_inbox"?"pending":n==="syncing_others"?"running":"ok",ie=x>0||A?.phase==="complete"||n==="complete"||k,[oe,re]=t.useState(!1);t.useEffect(()=>{if(!l)return;const E=setTimeout(()=>re(!0),Be);return()=>clearTimeout(E)},[l]);const ce=!!l&&(ie||b||oe);return y?e.jsx(R,{steps:M,activeStep:P.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{w.current=!1,a(null),h.mutate({body:{email:s,displayName:i||void 0,username:u!==s?u:void 0,password:g,imapHost:c.host,imapPort:c.port,imapTls:N.tls,imapStartTls:N.startTls,smtpHost:o.host||void 0,smtpPort:o.port||void 0,smtpTls:j.tls,smtpStartTls:j.startTls}})},children:"Retry"})]}),children:e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:y})}):e.jsx(R,{steps:M,activeStep:P.sync,title:`Syncing ${s}`,subtitle:"Newest mail first — you can start reading right away.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),ce?e.jsx(C,{variant:"primary",onClick:()=>l&&r(l),children:"Go to inbox"}):e.jsx(C,{variant:"primary",disabled:!0,icon:e.jsx(G,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:h.isPending?e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(G,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):e.jsxs("div",{className:"space-y-3",children:[S>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[e.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),e.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[x.toLocaleString()," / ",S.toLocaleString()," ","messages"]})]}),e.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,m*100)}%`}})})]}),e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(_,{label:"Mailboxes discovered",detail:I>0?`${I} mailbox${I===1?"":"es"} found`:"Discovering…",state:H}),e.jsx(_,{label:"INBOX",detail:O==="ok"?`${x.toLocaleString()} messages synced`:O==="running"?"Syncing newest first…":"Queued",state:O}),d>1||n==="syncing_others"||n==="complete"?e.jsx(_,{label:"Other mailboxes",detail:$==="ok"?`${d-1} mailboxes synced`:$==="running"?"Syncing…":"Queued",state:$}):null]}),k&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>{f.invalidateQueries({queryKey:Q({path:{accountId:l??""}}).queryKey})},children:"retry"})]}),T&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:T})]})]})})}const We=(s,i)=>i?.kind==="connected"?"microsoft-granted":i?.kind==="refused"?"microsoft-email":s?"connector":"welcome";function Ye({skipWelcome:s=!1,onComplete:i,onCancel:c,onImportConfig:o,microsoftReturn:u}){const[g,r]=t.useState(We(s,u)),[f,l]=t.useState(u?.kind==="refused"?u:void 0),[p,y]=t.useState(u?.kind==="connected"?u.accountId:null),[a,w]=t.useState({email:"",displayName:"",imapConfig:J,smtpConfig:Z,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),N=t.useCallback(()=>r("connector"),[]),j=t.useCallback(()=>r("address"),[]),h=t.useCallback(()=>r("microsoft-email"),[]),v=t.useCallback(()=>{s?c?.():r("welcome")},[s,c]),b=t.useCallback((d,S,x)=>{let m=J,n=Z,H=!1;x&&(H=x.source!=="heuristic",m={host:x.imap.host,port:x.imap.port,security:x.imap.security},n={host:x.smtp.host,port:x.smtp.port,security:x.smtp.security}),w(O=>({...O,email:d,displayName:S,imapConfig:m,smtpConfig:n,discoveryResult:x,discovered:H,username:d})),r("servers")},[]),k=t.useCallback((d,S)=>{w(x=>({...x,imapConfig:d,smtpConfig:S}))},[]),F=t.useCallback((d,S)=>{w(x=>({...x,username:d,password:S}))},[]),T=t.useCallback(()=>r("sync"),[]),A=t.useCallback(d=>{i(d)},[i]),I=e.jsx(Oe,{refusal:f,onBack:()=>{l(void 0),r("connector")},onConnected:d=>{y(d),r("microsoft-granted")}});switch(g){case"welcome":return e.jsx(Fe,{onStart:N,onImportConfig:o});case"connector":return e.jsx(Le,{onContinue:j,onMicrosoft:h,onBack:v,showBack:!s});case"microsoft-email":return I;case"microsoft-granted":return p===null?I:e.jsx(_e,{accountId:p,onSignInAgain:()=>r("microsoft-email"),onContinue:A});case"address":return e.jsx(He,{initialEmail:a.email,initialDisplayName:a.displayName,onContinue:b,onBack:()=>r("connector")});case"servers":return e.jsx(ze,{email:a.email,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,discovered:a.discovered,onContinue:()=>r("credentials"),onBack:()=>r("address"),onChange:k});case"credentials":return e.jsx(Se,{steps:M,activeStep:P.credentials,title:`Sign in to ${a.email.split("@")[1]||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",email:a.email,username:a.username,password:a.password,onContinue:()=>r("test"),onBack:()=>r("servers"),onChange:F});case"test":return e.jsx(ve,{steps:M,activeStep:P.test,email:a.email,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,username:a.username,password:a.password,onSuccess:T,onBackToCredentials:()=>r("credentials"),onBackToServers:()=>r("servers")});case"sync":return e.jsx(De,{email:a.email,displayName:a.displayName,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,username:a.username,password:a.password,onGoToInbox:A})}}export{ne as A,Ye as O,ae as P,Y as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as pe,j as t,t as k,f as W,a3 as ge,X as ve,c as F,eV as le,s as V,r as E,eD as ee,b5 as Z,Y as be,a0 as Ne,an as P,ab as je}from"./index-
|
|
1
|
+
import{e as pe,j as t,t as k,f as W,a3 as ge,X as ve,c as F,eV as le,s as V,r as E,eD as ee,b5 as Z,Y as be,a0 as Ne,an as P,ab as je}from"./index-J89guRVU.js";import{u as ke,e as we,m as ye,t as Ce,C as Se,d as Ee,p as Te}from"./CalendarComposePane-C5loQEEz.js";import{c as Ie,R as De,F as ce,u as Oe,n as Re}from"./calendar-format-CHntutZg.js";import{R as Fe,A as Ae}from"./attendee-row-DaC0cWu0.js";import{C as ze}from"./clock-BQFlXobK.js";import{G as te,M as Le,a as $e}from"./calendar-report-DAUzkHX3.js";import{M as Me}from"./mail-Daw23XZE.js";import{P as Pe}from"./pencil-mpUWk0sq.js";import{f as We,d as de,j as se,u as Ze,c as _e,s as Ue,U as ne,h as Ve}from"./useCalendars-Du8oLBQy.js";import{a as qe}from"./useCalendarWrites-B_iDGi_d.js";import{b as Be}from"./useCalendarData-Di1HMX87.js";import{a as Ge}from"./calendar-subscription-B-aAc2Gy.js";const He=pe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);function S({icon:e,children:s}){return t.jsxs("div",{className:"flex items-start gap-2.5 py-1",children:[t.jsx("span",{className:"mt-0.5 shrink-0 text-fg-subtle",children:e}),t.jsx("div",{className:"min-w-0 flex-1 text-sm text-fg",children:s})]})}function Ye({event:e,calendar:s,whenText:r,onEdit:n,onDelete:i,onOpenThread:l,onClose:d,activeAttendee:c="",onActivateAttendee:u,renderAttendeeContext:p,touch:x=!1,chrome:f="header",className:v}){const N=Ie(s.color),a=t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"text-xl font-semibold text-fg",children:e.title}),t.jsxs("div",{className:"mt-3 flex flex-col border-b border-line pb-3",children:[t.jsx(S,{icon:t.jsx(ze,{className:"size-4"}),children:t.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[r,e.attendees.length>0&&t.jsx(Fe,{rsvp:e.myRsvp})]})}),e.zoneCertainty==="ambiguous"?t.jsx(S,{icon:t.jsx(te,{className:"size-4 text-warning"}),children:t.jsx("span",{className:"text-warning",children:"The mail said a time but never a zone. Shown in your own; confirm before you travel for it."})}):e.timeZone!==""&&t.jsx(S,{icon:t.jsx(te,{className:"size-4"}),children:e.timeZone}),e.recurrenceRule!==""&&t.jsx(S,{icon:t.jsx(De,{className:"size-4"}),children:t.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.recurrenceRule,e.seriesException&&t.jsx("span",{className:"rounded-xs bg-warning-soft px-1.5 py-0.5 text-2xs text-warning",children:"Moved out of the series"})]})}),e.location!==""&&t.jsx(S,{icon:t.jsx(Le,{className:"size-4"}),children:e.location})]}),e.threadId!==""&&l&&t.jsxs("button",{type:"button",onClick:l,className:"mt-3 flex w-full items-center gap-2.5 rounded-md border border-line bg-surface-sunken px-3 py-2 text-left outline-none hover:border-line-strong focus-visible:ring-2 focus-visible:ring-ring",children:[t.jsx(Me,{className:"size-4 shrink-0 text-accent-2"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:"From this thread"}),t.jsx("span",{className:"block truncate text-sm text-fg",children:e.threadSubject})]})]}),e.attendees.length>0&&t.jsx(Ae,{attendees:e.attendees,activeEmail:c,onActivate:u,renderContext:p,touch:x,className:"mt-3"}),e.notes!==""&&t.jsx("p",{className:"mt-3 whitespace-pre-wrap text-sm text-fg-muted",children:e.notes})]});return f==="bare"?t.jsx("div",{className:k("flex flex-col",v),children:a}):t.jsxs("article",{className:k("flex h-full w-full flex-col bg-surface",v),children:[t.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[t.jsx("span",{className:k("size-2.5 shrink-0 rounded-full",N.solid)}),t.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:[s.name," · ",s.accountLabel]}),n&&t.jsx(W,{variant:"ghost",size:"sm",icon:t.jsx(Pe,{className:"size-3.5"}),onClick:n,children:"Edit"}),i&&t.jsx(W,{variant:"ghost",size:"sm",icon:t.jsx(ge,{className:"size-3.5"}),onClick:i,className:"text-danger",children:"Delete"}),d&&t.jsx("button",{type:"button","aria-label":"Close event",onClick:d,className:"flex size-7 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:t.jsx(ve,{className:"size-4"})})]}),t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-3",children:a})]})}const Je=[{scope:"this",label:"This event",note:"Leaves the rest of the series alone"},{scope:"following",label:"This and everything after",note:"Splits the series here"},{scope:"all",label:"The whole series",note:"Rewrites the rule itself"}];function Ke({title:e,ruleText:s,instanceText:r,onChoose:n,onCancel:i,touch:l,className:d}){return t.jsxs("div",{className:k("flex flex-col gap-3",d),children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-md font-semibold text-fg",children:[e," repeats"]}),t.jsx("p",{className:"text-xs text-fg-muted",children:s}),t.jsxs("p",{className:"text-xs text-fg-subtle",children:["You clicked ",r,"."]})]}),t.jsx("p",{className:"text-sm text-fg",children:"What should the change apply to?"}),t.jsx("div",{className:"flex flex-col gap-1.5",children:Je.map(c=>t.jsxs("button",{type:"button",onClick:()=>n(c.scope),className:k("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",l&&"min-h-11 justify-center"),children:[t.jsx("span",{className:"text-sm font-medium text-fg",children:c.label}),t.jsx("span",{className:"text-2xs text-fg-subtle",children:c.note})]},c.scope))}),t.jsx(W,{variant:"ghost",size:l?"md":"sm",onClick:i,className:k("self-start",l&&"min-h-11"),children:"Cancel"})]})}const ue=e=>e.replace(/\r?\n[ \t]/g,""),re=e=>e.replace(/\\n/gi,`
|
|
2
2
|
`).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function _(e,s){let r=!1;for(let n=s.length;n<e.length;n+=1){const i=e[n];if(n===s.length&&i!==";"&&i!==":")return;if(i==='"'){r=!r;continue}if(!r&&i===":")return e.slice(n+1).trim()}}function U(e,s){for(const r of ue(e).split(/\r?\n/)){if(!r.startsWith(s))continue;const n=_(r,s);if(n!==void 0)return n}return""}const Qe=e=>U(e,"RRULE"),Xe=e=>({location:re(U(e,"LOCATION")),description:re(U(e,"DESCRIPTION"))});function et(e,s){const r=ue(e).split(/\r?\n/).find(i=>i.startsWith("DTSTART")&&_(i,"DTSTART")!==void 0);if(r===void 0)return We(s);const n=/;TZID="?([^;:"]+)"?/i.exec(r)?.[1];return n!==void 0?Intl.supportedValuesOf("timeZone").includes(n)?n:s:_(r,"DTSTART")?.toUpperCase().endsWith("Z")?"":s}const tt=V(404);function st(e,s){const{data:r,isLoading:n,error:i,refetch:l}=F({...le({path:{calendarObjectId:e},query:{calendarId:s}}),meta:tt,enabled:e!==""&&s!==""});return{resource:r,isLoading:n,error:i,refetch:()=>{l()}}}const ae=365*24*60*6e4,nt=1440*6e4,ie=V(401),rt=V(401,404),R=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),at=e=>{const s=e instanceof Error&&e.message!==""?e.message:"no reason given",r=Z(e);return r===void 0?s:`${s} (HTTP ${r})`};function it(e,s){const[r]=E.useState(()=>Date.now()),n=de(),i=new Date(r).toISOString(),l=F({...ee({query:{from:R(r),to:R(r+ae),calendarObjectId:e}}),meta:ie,retry:!1,enabled:s}),d=l.data?se(l.data.items,e,i,n):void 0,c=F({...le({path:{calendarObjectId:e}}),meta:rt,retry:!1,enabled:s&&l.data!==void 0&&d===void 0}),u=Date.parse(c.data?.dtStart??""),p=c.data!==void 0&&Number.isNaN(u),x=Number.isNaN(u)?0:u-nt,f=F({...ee({query:{from:R(x),to:R(x+ae),calendarObjectId:e}}),meta:ie,retry:!1,enabled:s&&c.data!==void 0&&!p}),v=f.data?se(f.data.items,e,i,n):void 0;if(!s)return{kind:"Idle"};if(d)return{kind:"Found",jump:d};if(v)return{kind:"Found",jump:v};const N=Z(c.error)===404,a=[l.error,N?null:c.error,f.error].find(w=>w!==null);return a!==void 0?Z(a)===401?{kind:"SignedOut"}:{kind:"Failed",reason:at(a)}:N?{kind:"Deleted"}:p?{kind:"Failed",reason:`the stored event names no readable start (${c.data?.dtStart??""})`}:f.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const ot={kind:"NotInView"},oe="rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring";function lt(e){switch(e.kind){case"Finding":return{title:"Finding the event",detail:"Looking for the day it falls on."};case"Deleted":return{title:"This event was deleted",detail:"None of your calendars holds it any more."};case"NoOccurrenceFound":return{title:"No occurrence in its first year or the coming year",detail:"Its repeat rule, or the days taken out of it, leave it no day in either."};case"SignedOut":return{title:"Your session has ended",detail:"Sign in again to open this event."};case"Failed":return{title:"The event couldn't be looked up",detail:e.reason};case"NotInView":return{title:"That event isn't on this week",detail:"The address names an event the calendar doesn't have here."}}}function ct({event:e,calendar:s,isOccurrence:r,absence:n=ot,problem:i="",readOnlyNote:l="",onEdit:d,onDelete:c,onClose:u}){if(!e||!s){const{title:p,detail:x}=lt(n),f=n.kind==="Failed"||n.kind==="SignedOut";return t.jsxs("div",{role:f?"alert":void 0,className:"flex h-full flex-col items-center justify-center gap-2 bg-surface p-8 text-center",children:[t.jsx(be,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:p}),t.jsx("p",{className:"max-w-xs break-words text-sm text-fg-muted",children:x}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[n.kind==="SignedOut"&&n.signIn,n.kind==="Failed"&&t.jsx("a",{href:n.reportHref,target:"_blank",rel:"noreferrer",className:oe,children:"Report an issue"}),t.jsx("button",{type:"button",onClick:u,className:oe,children:"Back to the calendar"})]})]})}return t.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[r&&t.jsx("p",{className:"shrink-0 border-b border-line bg-surface-sunken px-row-inset py-1.5 text-2xs uppercase tracking-wider text-fg-subtle",children:"One occurrence of a repeating event"}),l!==""&&t.jsxs("p",{className:"flex shrink-0 items-start gap-2 border-b border-line bg-surface-sunken px-row-inset py-2 text-sm text-fg-muted",children:[t.jsx(He,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),t.jsx("span",{className:"min-w-0 flex-1 break-words",children:l})]}),i!==""&&t.jsxs("div",{role:"alert",className:"flex shrink-0 items-start gap-2 border-b border-danger/40 bg-danger-soft px-row-inset py-2 text-sm",children:[t.jsx(Ne,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),t.jsx("p",{className:"min-w-0 flex-1 break-words text-fg",children:i})]}),t.jsx(Ye,{event:e,calendar:s,whenText:ce(e),onEdit:d,onDelete:c,onClose:u,className:"min-h-0 flex-1"})]})}const dt="This event changed somewhere else — over CalDAV, or in another tab. Nothing was saved. Close it and open it again to see the version that's stored now.";function ut(){const{Account:e}=je();return t.jsx(e,{children:({signOut:s})=>t.jsx("button",{type:"button",onClick:()=>s(),className:"rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Sign in again"})})}const ft=(e,s)=>{switch(e.kind){case"Deleted":case"NoOccurrenceFound":return{kind:e.kind};case"SignedOut":return{kind:"SignedOut",signIn:t.jsx(ut,{})};case"Failed":return{kind:"Failed",reason:e.reason,reportHref:$e(`opening an event failed: ${e.reason}`)};case"Searching":return{kind:"Finding"};default:return{kind:s?"Finding":"NotInView"}}};function Ct({calendarObjectId:e,recurrenceId:s}){const{view:r,date:n,calendarIds:i}=Oe(),{events:l,isLoading:d}=Be({view:r,date:n,calendarIds:i}),{calendars:c,collections:u,timeZoneByCalendarId:p}=Ze(),{closeEvent:x}=Re(),{updateEvent:f,deleteEvent:v,isWriting:N}=qe(),a=l.find(o=>o.id===_e(e,s??"")),w=s===void 0&&a===void 0,A=w?Ue(l,e,new Date().toISOString()):void 0,z=it(e,w&&!d&&A===void 0),T=c.find(o=>o.id===a?.calendarId),{resource:g}=st(e,a?.calendarId??""),[q,y]=E.useState(void 0),[b,L]=E.useState(void 0),[j,I]=E.useState(void 0),[B,C]=E.useState(""),fe=ke(j??we("",""),e),D=g?Xe(g.icalData):void 0,$=g?Qe(g.icalData):"",me=a&&!a.allDay?a.start.slice(11,16):"",M=g?et(g.icalData,p[a?.calendarId??""]??ne):ne,xe=a&&!a.allDay?ye($,Ve(a.start,M===""?"UTC":M).slice(0,10),a.start.slice(0,10)):$,O=$===""?"":Ce(xe,me)??"Repeats",G=a!==void 0&&a.seriesId!==""&&s!==void 0&&s!=="",H=a!==void 0&&g!==void 0&&!T?.readOnly,Y=(o,m)=>{if(o.kind==="written"){C(""),m();return}C(o.kind==="conflict"?dt:o.message)},J=o=>({calendarObjectId:e,calendarId:a?.calendarId??"",recurrenceId:s??"",scope:o,etag:g?.etag??""}),K=o=>{if(!a)return;const m=Ee(a,{repeat:O,location:D?.location??"",notes:D?.description??""});y(void 0),L({before:m,scope:o}),I(m),C("")},Q=o=>{y(void 0),v(J(o)).then(m=>Y(m,x))},he=()=>{if(!b||!j)return;const o=Te(b.before,j,{clock:de(),anchor:M});if(!o.ok){C(o.problem);return}f(J(b.scope),o.patch).then(m=>Y(m,()=>{L(void 0),I(void 0)}))};if(A)return t.jsx(P,{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:r,date:n,calendarObjectId:e,recurrenceId:A.recurrenceId},search:!0,hash:!0,replace:!0});const h=z.kind==="Found"?z.jump:void 0,X=h!==void 0&&i.length>0&&!i.includes(h.calendarId);if(h&&(h.date!==n||X)){const o=X?m=>({...m,calendarId:[...i,h.calendarId]}):!0;return h.recurrenceId===""?t.jsx(P,{to:"/calendar/$view/$date/$calendarObjectId",params:{view:r,date:h.date,calendarObjectId:e},search:o,hash:!0,replace:!0}):t.jsx(P,{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:r,date:h.date,calendarObjectId:e,recurrenceId:h.recurrenceId},search:o,hash:!0,replace:!0})}return q!==void 0&&a?t.jsx("div",{className:"flex h-full flex-col justify-center bg-surface px-row-inset",children:t.jsx(Ke,{className:"mx-auto w-full max-w-md",title:a.title,ruleText:O===""?"It repeats":O,instanceText:ce(a),onChoose:q==="edit"?K:Q,onCancel:()=>y(void 0)})}):b&&j?t.jsx(Se,{title:"Edit event",subtitle:b.scope==="this"?"This occurrence only":j.date,calendars:c,draft:j,onChange:I,problem:B,saveLabel:"Save",isSaving:N,repeatEditable:b.scope===void 0||b.scope==="all",calendarEditable:!1,clashes:fe,onSave:he,onCancel:()=>{L(void 0),I(void 0),C("")}}):t.jsx(ct,{event:a&&{...a,location:D?.location??"",notes:D?.description??"",recurrenceRule:O},calendar:T,readOnlyNote:T?.readOnly?Ge(u.find(o=>o.calendarId===T.id)?.subscriptionUrl??""):"",isOccurrence:s!==void 0,absence:ft(z,w&&d),problem:B,onEdit:H?()=>G?y("edit"):K(void 0):void 0,onDelete:H?()=>G?y("delete"):Q(void 0):void 0,onClose:x})}export{Ct as O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as g,a0 as w,L as C,j as s,t as b,a3 as H,a1 as S,a9 as _,u as q,cm as K,r as x,co as U,c as W,ad as G,C as J,dk as V,h as X,at as Y,cQ as Z,i as v,av as y,cJ as ee,cK as se,bT as p,eQ as te}from"./index-
|
|
1
|
+
import{ar as g,a0 as w,L as C,j as s,t as b,a3 as H,a1 as S,a9 as _,u as q,cm as K,r as x,co as U,c as W,ad as G,C as J,dk as V,h as X,at as Y,cQ as Z,i as v,av as y,cJ as ee,cK as se,bT as p,eQ as te}from"./index-J89guRVU.js";import{a as ne,u as k,L as R}from"./roving-focus-CzTCkI7v.js";import{u as ae,p as oe,R as j,c as re}from"./useSearchTokenContext-Dl9jDzQw.js";import{C as I}from"./circle-check-big-DsPxeo1f.js";import{C as L}from"./clock-BQFlXobK.js";import{R as ie}from"./row-actions-C0iitOlE.js";import{R as le}from"./rotate-ccw-86rVy6Oh.js";import{P as T}from"./pane-header-CKSUzAfS.js";import{N as ce}from"./NavMenuButton-ggAVFYnQ.js";import{i as ue,s as D}from"./outbox-status-BlKn6P0x.js";import{n as de}from"./search-query-Cr_ZXBCp.js";import{f as xe}from"./useMessageBodyContent-Bl5Y6AAH.js";const fe={queued:{icon:L,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2",spin:!0},sent:{icon:I,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}};function O({status:e,iconOnly:n,className:a}){const t=fe[e],o=t.icon;return s.jsxs("span",{className:b("inline-flex items-center gap-1.5 text-xs font-medium",t.className,a),children:[s.jsx(o,{className:b("size-4",t.spin&&"animate-spin")}),!n&&t.label]})}const me=(e,n)=>n?"bg-accent-2-soft":e==="failed"?"bg-danger-soft":e==="blocked"||e==="unfiled"?"bg-warning/10":"";function he({recipients:e,subject:n,time:a,status:t,error:o,selected:l,onSelect:c,onRetry:r,retrying:u,onEdit:i,onDelete:f,deleting:d}){const m=t==="failed"||t==="blocked"||t==="unfiled";return s.jsxs("div",{className:b("flex items-start gap-3 border-b border-line px-4 py-3 transition-colors hover:bg-surface-raised",me(t,l)),children:[s.jsxs("button",{type:"button",...ne,onClick:c,className:"flex flex-1 min-w-0 items-start gap-3 text-left",children:[s.jsx("div",{className:"mt-0.5 shrink-0",children:s.jsx(O,{status:t,iconOnly:!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:e}),s.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:a})]}),s.jsx("div",{className:"truncate text-sm",children:n||"No subject"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(O,{status:t}),o&&s.jsxs("span",{className:"truncate text-xs text-fg-muted",children:["— ",o]})]})]})]}),m&&s.jsx("div",{className:"shrink-0",children:s.jsx(ie,{actions:[...t==="failed"&&r?[{label:"Retry sending",iconOnly:!0,icon:s.jsx(le,{className:"size-3.5"}),busy:u,onClick:r}]:[],...t==="unfiled"?[]:[{label:"Edit as draft",iconOnly:!0,icon:s.jsx(S,{className:"size-3.5"}),onClick:i}]],destructive:{label:"Delete message",iconOnly:!0,icon:s.jsx(H,{className:"size-3.5"}),busy:d,confirm:{prompt:"Delete this message?",confirmLabel:"Delete"},onClick:f}})})]})}function Be(){return _({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function be(){const e=q(),n=K();return x.useCallback(a=>{e({to:"/mail/outbox/draft/$outboxMessageId",params:{outboxMessageId:a},search:t=>t,hash:n})},[e,n])}function ge(){return U()}function pe(e,n){const a=n.trim().toLowerCase();if(a.length===0)return!0;const t=[e.subject,e.fromAddress,e.fromName,...e.toAddresses??[],...e.ccAddresses??[]].filter(o=>typeof o=="string").join(" ").toLowerCase();return a.split(/\s+/).every(o=>o.length===0||t.includes(o))}function je(e){return e.tokens.length>0&&e.freeText.trim().length===0}const A={queued:{icon:L,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2"},sent:{icon:I,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}},Ne=e=>te(e).toDateString()===new Date().toDateString()?p(e,{hour:"numeric",minute:"2-digit"}):p(e,{month:"short",day:"numeric"}),M=e=>p(e,{dateStyle:"medium",timeStyle:"short"}),ve=e=>{const n=e.toAddresses??[];return n.length===0?"No recipients":n.length===1?n[0]:`${n[0]} +${n.length-1}`},E=(e,n)=>n?"The outbox cannot filter on those terms":e?"No matching outbox messages":"No outbox messages",Q=x.createContext(null);function N(){const e=x.useContext(Q);if(!e)throw new Error("OutboxPane.* must be used inside <OutboxPane>");return e}function ye({outboxMessageId:e,children:n}){const a=be(),t=ge(),{data:o,isLoading:l}=W(G()),{searchQuery:c}=J(),r=ae(),u=de(c),i=oe(u,r),f=u.length>0,d=je(i),m=x.useMemo(()=>d?[]:(o?.items??[]).filter(h=>ue(h.status)).filter(h=>pe(h,i.freeText)),[o,i.freeText,d]),F=x.useMemo(()=>m.find(h=>h.outboxMessageId===e),[m,e]),$={messages:m,hasQuery:f,unsupportedQuery:d,isLoading:l,selectedMessageId:e,selectedMessage:F,onOpenMessage:a,onCloseMessage:t};return s.jsx(Q.Provider,{value:$,children:n})}function P({message:e,isSelected:n,onSelect:a}){const t=X(),o=xe(),{pushError:l}=Y(),c=x.useCallback(()=>{t.invalidateQueries({queryKey:Z()})},[t]),r=v({...ee(),onSuccess:c,onError:d=>{l(y("Couldn't resend message","The message wasn't sent.",d))}}),u=v({...se(),onSuccess:c,onError:d=>{l(y("Couldn't delete message","The message wasn't deleted.",d))}}),i=e.status;if(!A[i])return null;const f=D(e.status);return s.jsx(he,{recipients:ve(e),subject:e.subject||"",time:Ne(e.sentAt??e.updatedAt),status:i,error:f?e.lastError??void 0:void 0,selected:n,onSelect:a,onRetry:i==="failed"?()=>r.mutate({path:{outboxMessageId:e.outboxMessageId}}):void 0,retrying:r.isPending,onEdit:()=>o(e.outboxMessageId),onDelete:()=>u.mutate({path:{outboxMessageId:e.outboxMessageId}}),deleting:u.isPending})}function B({message:e,onBack:n}){const a=e.status,t=A[a],o=t?.icon??S,l=e.sentAt?M(e.sentAt):M(e.updatedAt);return s.jsxs("div",{className:"h-full overflow-y-auto bg-canvas",children:[s.jsxs("div",{className:"border-b border-line p-4",children:[n&&s.jsxs("button",{type:"button",onClick:n,className:"mb-3 inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg",children:[s.jsx(V,{className:"size-4"}),s.jsx("span",{children:"Back"})]}),s.jsx("h1",{className:"text-xl font-semibold mb-3",children:e.subject||"(No subject)"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"From:"}),s.jsx("span",{className:"text-fg",children:e.fromName?`${e.fromName} <${e.fromAddress}>`:e.fromAddress})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"To:"}),s.jsx("span",{className:"text-fg",children:(e.toAddresses??[]).join(", ")})]}),e.ccAddresses&&e.ccAddresses.length>0&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Cc:"}),s.jsx("span",{className:"text-fg",children:e.ccAddresses.join(", ")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Date:"}),s.jsx("span",{className:"text-fg",children:l})]}),t&&s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(o,{className:b("size-4",t.className,a==="sending"&&"animate-spin")}),s.jsx("span",{className:b("text-xs font-medium",t.className),children:t.label}),D(e.status)&&e.lastError&&s.jsxs("span",{className:"text-xs text-fg-muted",children:["— ",e.lastError]})]})]})]}),s.jsx("div",{className:"p-4",children:s.jsx(re,{html:e.htmlBody,text:e.textBody})})]})}function Oe(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,onOpenMessage:l}=N(),c=x.useRef(null);return k({containerRef:c,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsx(z,{count:e.length}),s.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:e.map(r=>s.jsx(P,{message:r,isSelected:o===r.outboxMessageId,onSelect:()=>l(r.outboxMessageId)},r.outboxMessageId))})]})}function z({count:e}){return s.jsx(T,{title:"Outbox",leading:s.jsx(ce,{}),children:s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e," ",e===1?"message":"messages"]})})}function Me(){const{selectedMessage:e}=N();return s.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[s.jsx(T,{}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?s.jsx(B,{message:e}):s.jsx(j,{message:"Select a message to read",showHints:!1})})]})}function we(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,selectedMessage:l,onOpenMessage:c,onCloseMessage:r}=N(),u=x.useRef(null);return k({containerRef:u,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):l?s.jsx(B,{message:l,onBack:r}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsx(z,{count:e.length}),s.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",children:e.map(i=>s.jsx(P,{message:i,isSelected:o===i.outboxMessageId,onSelect:()=>c(i.outboxMessageId)},i.outboxMessageId))})]})}const ze=Object.assign(ye,{List:Oe,Reading:Me,Phone:we});export{ze as O,Be as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-J89guRVU.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aj as m,j as o,O as p}from"./index-J89guRVU.js";import{a}from"./MailShell-BnAscFqh.js";import{M as r}from"./MailboxPane-CG-dcZ55.js";import{a as e}from"./search-token-index-BXCXhECA.js";import{u as s}from"./search-mirror-BlS_Ifso.js";import"./FullCompose-CgTCPbiG.js";import"./ErrorState-CX8jPS64.js";import"./index-BNf6kiaX.js";import"./useMessageBodyContent-Bl5Y6AAH.js";import"./useSignature-z9_OAiTD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Cyjl5fcM.js";import"./sections-CmVNNIn5.js";import"./confirm-dialog-DM1V3tLO.js";import"./useSearchTokenContext-Dl9jDzQw.js";import"./kbd-CKw25IK5.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-sKR2_udi.js";import"./circle-check-big-DsPxeo1f.js";import"./refresh-cw-D2y2CKsF.js";import"./useQueries-Ch9XYsKm.js";import"./MailListHeader-C8fUfLdY.js";import"./roving-focus-CzTCkI7v.js";import"./popover-menu-Cl-N1YPe.js";import"./mail-Daw23XZE.js";import"./avatar-CMrR_WCW.js";import"./EmptyState-ClLPPGI1.js";import"./undo-2-C5A6ikAQ.js";import"./download-D3c-jAvE.js";import"./calendar-suggestion-CaACTNVX.js";import"./calendar-format-CHntutZg.js";import"./useCalendars-Du8oLBQy.js";import"./calendar-report-DAUzkHX3.js";import"./attendee-row-DaC0cWu0.js";import"./minus-oqpCotLr.js";import"./clock-BQFlXobK.js";import"./calendar-clash-strip-DH-rkJMi.js";import"./bell-off-CjFQsmU0.js";import"./copy-D9w0yOJZ.js";import"./shield-check-Bz65Alvp.js";import"./useFilters-Dn74lJWT.js";import"./checkbox-lv4ht1p0.js";import"./useLayoutTier-I-ZeE96x.js";import"./menu-lOydIsUw.js";import"./MailViewChrome-BgP0RFzV.js";import"./pane-header-CKSUzAfS.js";import"./NavMenuButton-ggAVFYnQ.js";import"./useLabels-Bhad46sq.js";import"./useSemanticSearch-NkagUfNs.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-lVnXVWKS.js";import"./circle-help-CxlWBIxf.js";import"./circle-check-CmZH70G9.js";function so(){const{mailboxId:t}=m.useParams(),i=e();return s({to:"/mail/$mailboxId",params:{mailboxId:t}}),o.jsx(r,{mailboxId:t,thread:i,children:o.jsx(a,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(p,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{so as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-J89guRVU.js";import{B as o}from"./BriefPane-CdiCvSuF.js";import"./useSearchTokenContext-Dl9jDzQw.js";import"./kbd-CKw25IK5.js";import"./useMessageBodyContent-Bl5Y6AAH.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-C8fUfLdY.js";import"./roving-focus-CzTCkI7v.js";import"./search-token-index-BXCXhECA.js";import"./useQueries-Ch9XYsKm.js";import"./popover-menu-Cl-N1YPe.js";import"./mail-Daw23XZE.js";import"./avatar-CMrR_WCW.js";import"./index-BNf6kiaX.js";import"./useSignature-z9_OAiTD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Cyjl5fcM.js";import"./sections-CmVNNIn5.js";import"./EmptyState-ClLPPGI1.js";import"./ErrorState-CX8jPS64.js";import"./undo-2-C5A6ikAQ.js";import"./download-D3c-jAvE.js";import"./calendar-suggestion-CaACTNVX.js";import"./calendar-format-CHntutZg.js";import"./useCalendars-Du8oLBQy.js";import"./calendar-report-DAUzkHX3.js";import"./attendee-row-DaC0cWu0.js";import"./minus-oqpCotLr.js";import"./clock-BQFlXobK.js";import"./calendar-clash-strip-DH-rkJMi.js";import"./bell-off-CjFQsmU0.js";import"./copy-D9w0yOJZ.js";import"./shield-check-Bz65Alvp.js";import"./useFilters-Dn74lJWT.js";import"./checkbox-lv4ht1p0.js";import"./confirm-dialog-DM1V3tLO.js";import"./useLayoutTier-I-ZeE96x.js";import"./menu-lOydIsUw.js";import"./useRefreshControl-sKR2_udi.js";import"./circle-check-big-DsPxeo1f.js";import"./refresh-cw-D2y2CKsF.js";import"./useSemanticSearch-NkagUfNs.js";import"./useLabels-Bhad46sq.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function V(){return r.jsx(o.Reading,{})}export{V as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-J89guRVU.js";import{M as r}from"./MailboxPane-CG-dcZ55.js";import"./useSearchTokenContext-Dl9jDzQw.js";import"./kbd-CKw25IK5.js";import"./useMessageBodyContent-Bl5Y6AAH.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-sKR2_udi.js";import"./circle-check-big-DsPxeo1f.js";import"./refresh-cw-D2y2CKsF.js";import"./useQueries-Ch9XYsKm.js";import"./MailListHeader-C8fUfLdY.js";import"./roving-focus-CzTCkI7v.js";import"./search-token-index-BXCXhECA.js";import"./popover-menu-Cl-N1YPe.js";import"./mail-Daw23XZE.js";import"./avatar-CMrR_WCW.js";import"./index-BNf6kiaX.js";import"./useSignature-z9_OAiTD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Cyjl5fcM.js";import"./sections-CmVNNIn5.js";import"./EmptyState-ClLPPGI1.js";import"./ErrorState-CX8jPS64.js";import"./undo-2-C5A6ikAQ.js";import"./download-D3c-jAvE.js";import"./calendar-suggestion-CaACTNVX.js";import"./calendar-format-CHntutZg.js";import"./useCalendars-Du8oLBQy.js";import"./calendar-report-DAUzkHX3.js";import"./attendee-row-DaC0cWu0.js";import"./minus-oqpCotLr.js";import"./clock-BQFlXobK.js";import"./calendar-clash-strip-DH-rkJMi.js";import"./bell-off-CjFQsmU0.js";import"./copy-D9w0yOJZ.js";import"./shield-check-Bz65Alvp.js";import"./useFilters-Dn74lJWT.js";import"./checkbox-lv4ht1p0.js";import"./confirm-dialog-DM1V3tLO.js";import"./useLayoutTier-I-ZeE96x.js";import"./menu-lOydIsUw.js";import"./MailViewChrome-BgP0RFzV.js";import"./pane-header-CKSUzAfS.js";import"./NavMenuButton-ggAVFYnQ.js";import"./useLabels-Bhad46sq.js";import"./useSemanticSearch-NkagUfNs.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-lVnXVWKS.js";import"./circle-help-CxlWBIxf.js";import"./circle-check-CmZH70G9.js";function _(){return o.jsx(r.Reading,{})}export{_ as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-J89guRVU.js";import{F as r}from"./FlaggedPane-CD2pUbFg.js";import"./useSearchTokenContext-Dl9jDzQw.js";import"./kbd-CKw25IK5.js";import"./useMessageBodyContent-Bl5Y6AAH.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-C8fUfLdY.js";import"./roving-focus-CzTCkI7v.js";import"./search-token-index-BXCXhECA.js";import"./useQueries-Ch9XYsKm.js";import"./popover-menu-Cl-N1YPe.js";import"./mail-Daw23XZE.js";import"./avatar-CMrR_WCW.js";import"./index-BNf6kiaX.js";import"./useSignature-z9_OAiTD.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Cyjl5fcM.js";import"./sections-CmVNNIn5.js";import"./EmptyState-ClLPPGI1.js";import"./ErrorState-CX8jPS64.js";import"./undo-2-C5A6ikAQ.js";import"./download-D3c-jAvE.js";import"./calendar-suggestion-CaACTNVX.js";import"./calendar-format-CHntutZg.js";import"./useCalendars-Du8oLBQy.js";import"./calendar-report-DAUzkHX3.js";import"./attendee-row-DaC0cWu0.js";import"./minus-oqpCotLr.js";import"./clock-BQFlXobK.js";import"./calendar-clash-strip-DH-rkJMi.js";import"./bell-off-CjFQsmU0.js";import"./copy-D9w0yOJZ.js";import"./shield-check-Bz65Alvp.js";import"./useFilters-Dn74lJWT.js";import"./checkbox-lv4ht1p0.js";import"./confirm-dialog-DM1V3tLO.js";import"./useLayoutTier-I-ZeE96x.js";import"./menu-lOydIsUw.js";import"./MailViewChrome-BgP0RFzV.js";import"./refresh-cw-D2y2CKsF.js";import"./wizard-selection-DxUM65kM.js";function Q(){return o.jsx(r.Reading,{})}export{Q as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-J89guRVU.js";import{O as t}from"./OutboxPane-CM3kwG8i.js";import"./roving-focus-CzTCkI7v.js";import"./useSearchTokenContext-Dl9jDzQw.js";import"./kbd-CKw25IK5.js";import"./useMessageBodyContent-Bl5Y6AAH.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-DsPxeo1f.js";import"./clock-BQFlXobK.js";import"./row-actions-C0iitOlE.js";import"./rotate-ccw-86rVy6Oh.js";import"./pane-header-CKSUzAfS.js";import"./NavMenuButton-ggAVFYnQ.js";import"./menu-lOydIsUw.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function R(){return o.jsx(t.Reading,{})}export{R as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{eW as o,j as m}from"./index-J89guRVU.js";import{O as p}from"./OpenCalendarEvent-C-aoRB9f.js";import"./CalendarComposePane-C5loQEEz.js";import"./calendar-format-CHntutZg.js";import"./useQueries-Ch9XYsKm.js";import"./useCalendars-Du8oLBQy.js";import"./calendar-clash-strip-DH-rkJMi.js";import"./attendee-row-DaC0cWu0.js";import"./avatar-CMrR_WCW.js";import"./minus-oqpCotLr.js";import"./clock-BQFlXobK.js";import"./calendar-report-DAUzkHX3.js";import"./mail-Daw23XZE.js";import"./pencil-mpUWk0sq.js";import"./useCalendarWrites-B_iDGi_d.js";import"./ErrorState-CX8jPS64.js";import"./useCalendarData-Di1HMX87.js";import"./calendar-subscription-B-aAc2Gy.js";function v(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:t})}export{v as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-J89guRVU.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-J89guRVU.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-J89guRVU.js";const n=o;export{n as component};
|