@remit/web-client-dist 0.0.337 → 0.0.338
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-qa0MIXWV.js → BriefPane-BVxIcIjp.js} +1 -1
- package/assets/{ErrorState-Cxo3fVvx.js → ErrorState-Cuwsgd19.js} +1 -1
- package/assets/{FlaggedPane-P2hVt1sR.js → FlaggedPane-CJGtVdN5.js} +1 -1
- package/assets/{MailListHeader-Nb9izl_F.js → MailListHeader-DNHnhftv.js} +7 -7
- package/assets/{MailViewChrome-RL9UB34E.js → MailViewChrome-Dr_oxV0X.js} +1 -1
- package/assets/{MailboxPane-Y0QCECzQ.js → MailboxPane-De5LXMnX.js} +1 -1
- package/assets/{NavMenuButton-CLnauqPV.js → NavMenuButton-BFQz4dSv.js} +1 -1
- package/assets/{OnboardingWizard-DRX-L3C2.js → OnboardingWizard-D2ppWfeL.js} +1 -1
- package/assets/{OutboxPane-BdjLk-C_.js → OutboxPane-BBcr-9Dl.js} +1 -1
- package/assets/_mailboxId-LGD219Xp.js +1 -0
- package/assets/_messageId-BdkdfbhP.js +1 -0
- package/assets/_messageId-CuDxBqB7.js +1 -0
- package/assets/_messageId-D3QSsxF8.js +1 -0
- package/assets/_outboxMessageId-B1SCEx-M.js +1 -0
- package/assets/_threadId-CjCkrwgy.js +1 -0
- package/assets/_threadId-DFFPCWGt.js +1 -0
- package/assets/_threadId-Dwvr42_W.js +1 -0
- package/assets/{account-form-helpers-DGU4NIT4.js → account-form-helpers-CtR5prHx.js} +1 -1
- package/assets/{accounts-Ba8-ZFl_.js → accounts-BzjZofR1.js} +1 -1
- package/assets/advanced-DEXK50xQ.js +4 -0
- package/assets/{appearance-CYnuifdt.js → appearance-BVrJemGP.js} +1 -1
- package/assets/{avatar-C5PmB_EI.js → avatar-Cx6Rck7O.js} +1 -1
- package/assets/{bottom-sheet-CO75NUgO.js → bottom-sheet-BrW8bAFc.js} +1 -1
- package/assets/brief-BeouOblV.js +1 -0
- package/assets/{brief-CT9SrRVC.js → brief-C_CH6ZA9.js} +1 -1
- package/assets/{browser-ponyfill-hmQOgKM3.js → browser-ponyfill-Di8JCWHA.js} +1 -1
- package/assets/bug-D1wVBB7H.js +1 -0
- package/assets/{circle-check-B3gw_3Ro.js → circle-check-Dx0LDZLq.js} +1 -1
- package/assets/{circle-check-big-Co4azfdq.js → circle-check-big-C4zP0uN0.js} +1 -1
- package/assets/{circle-help-BCvtXNjF.js → circle-help-D5c23_B5.js} +1 -1
- package/assets/{clock-BGbbTR9M.js → clock-WiuzJVTL.js} +1 -1
- package/assets/{confirm-dialog-Csw7CqUT.js → confirm-dialog-D-STO6NY.js} +1 -1
- package/assets/{download-CKNPuBCg.js → download-NiiX30f0.js} +1 -1
- package/assets/{filters-Br818YgS.js → filters-CoioyuOY.js} +1 -1
- package/assets/flagged-BINL_JWX.js +1 -0
- package/assets/{flagged-CAGy_YWn.js → flagged-oPVTUoSg.js} +1 -1
- package/assets/{folders-C9H4ZiBJ.js → folders-Bb6Ie-xF.js} +1 -1
- package/assets/index-5fE-918b.js +1 -0
- package/assets/index-BQ7v6x2W.js +1 -0
- package/assets/index-BdkdfbhP.js +1 -0
- package/assets/index-BtARV8zx.js +1 -0
- package/assets/index-CCXImo8W.js +1 -0
- package/assets/index-CuDxBqB7.js +1 -0
- package/assets/index-DAW-xxw-.js +1 -0
- package/assets/index-_wF6wCgB.js +1 -0
- package/assets/{index-DEXImZSP.js → index-mfroFF6A.js} +18 -18
- package/assets/{kbd-CA35HBZD.js → kbd-DGG2T6qp.js} +1 -1
- package/assets/{labels-C5RDq75z.js → labels-BG8Y-Y3d.js} +1 -1
- package/assets/mail-Dw_SbLmc.js +1 -0
- package/assets/{menu-BFhXuEK8.js → menu-qUIIdZKI.js} +1 -1
- package/assets/{move-options-DJTQSJoc.js → move-options-ChvYTiEA.js} +1 -1
- package/assets/{nav-link-BGPUkE24.js → nav-link-CruidKLs.js} +1 -1
- package/assets/{onboarding-Dj8pD6RV.js → onboarding-DlmFsA7I.js} +1 -1
- package/assets/outbox-BlmZK3Y_.js +1 -0
- package/assets/{pencil-BtfAKbKN.js → pencil-CuOJSJGm.js} +1 -1
- package/assets/{rich-text-CR_pdwqJ.js → rich-text-DnlONWbW.js} +1 -1
- package/assets/{rotate-ccw-6QmeK9ZT.js → rotate-ccw-DKhRdavV.js} +1 -1
- package/assets/{row-actions-BhhavOse.js → row-actions-DFFJ1Ye7.js} +1 -1
- package/assets/{search-scope-CrXQTM9g.js → search-scope-DAoU1EP1.js} +1 -1
- package/assets/{search-token-index-HzD6MHJp.js → search-token-index-Dq9g3Rie.js} +1 -1
- package/assets/{search-view-ExRj3nwX.js → search-view-BLKN8HiH.js} +1 -1
- package/assets/{senders-CkFHkATf.js → senders-Dn3oWL4u.js} +1 -1
- package/assets/settings-DUUpZPxU.js +1 -0
- package/assets/{settings-screen-CQJh-xf-.js → settings-screen-k-YXYvCU.js} +1 -1
- package/assets/{shield-check-WoA7Uqox.js → shield-check-DE5WmOvN.js} +1 -1
- package/assets/{suggested-vips-CVCtzFT2.js → suggested-vips-mAx0Gkdt.js} +1 -1
- package/assets/{use-match-media-qBCYJz2o.js → use-match-media-B8WArMj0.js} +1 -1
- package/assets/{useDebouncedValue-BM9H0bdY.js → useDebouncedValue-BX7nj-Sd.js} +1 -1
- package/assets/{useFilters-CNDqeuwy.js → useFilters-DlVOHs94.js} +1 -1
- package/assets/{useLabels-DpjQB2m3.js → useLabels-C1J8eQzn.js} +1 -1
- package/assets/{useRefreshControl-DgMvaW0l.js → useRefreshControl-QWsenWR5.js} +1 -1
- package/assets/{useSearchMirror-D5uJzaCm.js → useSearchMirror-BgZZhOcW.js} +1 -1
- package/assets/{useSearchTokenContext-CmJvOV-Z.js → useSearchTokenContext-D1jbjsrx.js} +1 -1
- package/assets/{useSemanticSearch-Bhf16QYz.js → useSemanticSearch-BODyaU_A.js} +1 -1
- package/assets/{useSignature-B4QDHqqq.js → useSignature-MBEGFiOX.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/_mailboxId-CQoGbuz1.js +0 -1
- package/assets/_messageId-B05XkRF5.js +0 -1
- package/assets/_messageId-C09jB3H_.js +0 -1
- package/assets/_messageId-RDOFTHct.js +0 -1
- package/assets/_outboxMessageId-BmuQXtGK.js +0 -1
- package/assets/_threadId-D-iY1snh.js +0 -1
- package/assets/_threadId-D98m6qFp.js +0 -1
- package/assets/_threadId-DJnR2LoO.js +0 -1
- package/assets/advanced-PuU-YZcS.js +0 -1
- package/assets/brief-CNd400AH.js +0 -1
- package/assets/flagged-B2qg_fiI.js +0 -1
- package/assets/index-B05XkRF5.js +0 -1
- package/assets/index-Bq6a31Z9.js +0 -1
- package/assets/index-C09jB3H_.js +0 -1
- package/assets/index-DV24rLD0.js +0 -1
- package/assets/index-DW7V29aR.js +0 -1
- package/assets/index-Dawu8JkU.js +0 -1
- package/assets/index-DlkYycLP.js +0 -1
- package/assets/index-ipXhqBj0.js +0 -1
- package/assets/mail-BR-c8vnl.js +0 -1
- package/assets/outbox-CEwQiAJh.js +0 -1
- package/assets/settings-FHmjsbR-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,af as b,
|
|
1
|
+
import{r as m,af as b,cR as E,x as C,cS as D,cA as x,cT as F,s as M,cU as P,cV as N,cW as L,cX as T}from"./index-mfroFF6A.js";import{u as z}from"./use-match-media-B8WArMj0.js";import{D as w}from"./layout-breakpoints-BWjiUQKh.js";const Y=()=>z(w),G=(e,t)=>{if(e.state==="Expired")return"Expired";if(e.scope!=="Temporary"||!e.expiresAt)return"Active";const r=Date.parse(e.expiresAt);return Number.isNaN(r)?"Active":r<=t?"Expired":"Active"},Z=e=>{if(!e)return;const t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},O=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,a,i,n]=r,s=new Date(Number(a),Number(i)-1,Number(n),23,59,59,0);if(Number.isNaN(s.getTime()))return;const o=-t.getTimezoneOffset(),d=o>=0?"+":"-",c=Math.abs(o),l=String(Math.floor(c/60)).padStart(2,"0"),f=String(c%60).padStart(2,"0"),u=p=>String(p).padStart(2,"0");return`${s.getFullYear()}-${u(s.getMonth()+1)}-${u(s.getDate())}T${u(s.getHours())}:${u(s.getMinutes())}:${u(s.getSeconds())}${d}${l}:${f}`},h="None",ee=e=>!e.literalClauses.some(t=>t.field==="HasWords"),y=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),te=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",re=({mode:e,ruleScope:t,anchorMessageId:r,clauses:a,matchOperator:i,moveMailboxId:n,until:s})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:i==="all"?"And":"Or",literalClauses:a.map(o=>({field:o.field,value:o.value})),moveMailboxId:n,expiresAt:t==="until"?O(s??""):void 0}),S=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h,...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{}}),_=new Set(["Complete","Failed"]),v=e=>e!==void 0&&_.has(e),R=1e3,k=15e3,J=e=>{const t=Math.max(0,e),r=R*2**t;return Math.min(r,k)},$=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},se=e=>{const[t,r]=m.useState(),a=b({...E(),onSuccess:g=>r(g.organizeJobId)}),{mutate:i}=a,n=C({...D({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const I=g.state.data?.state;return v(I)?!1:J(g.state.dataUpdateCount)}}),s=m.useCallback(g=>{e&&i({path:{accountId:e},body:y(g)})},[e,i]),{refetch:o}=n,d=m.useCallback(()=>{o()},[o]),c=n.data,l=a.isPending?void 0:c,f=l?.state??a.data?.state,u=v(l?.state),p={state:f,matchedCount:l?.matchedCount??0,appliedCount:l?.appliedCount??0,failedCount:l?.failedCount??0,errorMessage:l?.errorMessage??""};return{start:s,refreshStatus:d,progress:p,isStarting:a.isPending,isRunning:!!t&&!u,isDone:u,failure:$(a.error,n.error,!!c)}},ae=["From","Subject","HasWords","ListId","FromDomain"],U=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},ne=(e,t)=>e==="ListId"?U(t):t.trim(),Q=e=>e==="all"?"And":"Or",W=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,a=e.clauses.map(i=>({field:i.field,value:i.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:Q(e.matchOperator),literalClauses:a}},j=e=>e.anchorMessageId!==void 0||!e.literalClauses.some(t=>t.field==="HasWords"),q=e=>JSON.stringify({anchor:e.anchorMessageId??null,operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),ie=(e,t)=>{const r=W(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?O(e.until??""):void 0}},H=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},K=350,oe=(e,t,r)=>{const a=b(x()),{mutateAsync:i}=a,n=q(t),[s,o]=m.useState(()=>({})),d=m.useRef(t);d.current=t;const c=m.useRef(n),l=j(t);return m.useEffect(()=>{if(!e||!l||n===s.previewedSignature||n===s.errorSignature)return;const f=setTimeout(()=>{const u=n;c.current=u,i({path:{accountId:e},body:y({...d.current})}).then(p=>{c.current===u&&o({count:p.matchedCount,matchedIds:p.messageIds,previewedSignature:u})}).catch(p=>{c.current===u&&o(g=>({...g,error:p instanceof Error?p.message:"Couldn't count matches.",errorSignature:u}))})},K);return()=>clearTimeout(f)},[e,l,n,s.previewedSignature,s.errorSignature,i]),l?{count:H(s,n),matchedIds:s.previewedSignature===n?s.matchedIds??[]:[]}:{count:{status:"error",reason:F},matchedIds:[]}},A=e=>N({path:{accountId:e}}),ue=e=>{const t=C({...L({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},ce=e=>{const t=M(),r=b({...P(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a,mutateAsync:i}=r,n=m.useCallback((o,d,c)=>{e&&a({path:{accountId:e},body:S(o,d,c)})},[e,a]),s=m.useCallback(async(o,d,c)=>e?i({path:{accountId:e},body:S(o,d,c)}).then(()=>!0,()=>!1):!1,[e,i]);return{createFilter:n,createFilterAsync:s,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},le=e=>{const t=M(),r=b({...T(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a}=r;return{deleteFilter:m.useCallback(n=>{e&&a({path:{accountId:e,filterId:n}})},[e,a]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}};export{h as N,ae as S,se as a,A as b,ie as c,Y as d,Z as e,G as f,ue as g,le as h,y as i,ce as j,re as k,ee as l,ne as n,te as o,O as p,W as r,oe as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as L,
|
|
1
|
+
import{x as L,bB as p,s as n,af as l,bC as d,r as o,bD as y,bE as c,bF as g}from"./index-mfroFF6A.js";const u=e=>y({path:{accountId:e}}),P=e=>{const s=L({...p({path:{accountId:e??""}}),enabled:!!e});return{labels:s.data?.items??[],isPending:s.isPending,isError:s.isError,error:s.error,refetch:s.refetch}},m=e=>{const s=n(),t=l({...d(),onSuccess:()=>{e&&s.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:r}=t;return{createLabel:o.useCallback((a,i="Default")=>e?r({path:{accountId:e},body:{name:a,color:i}}):Promise.reject(new Error("No account")),[e,r]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},C=e=>{const s=n(),t=l({...c(),onSuccess:()=>{e&&s.invalidateQueries({queryKey:u(e)})}}),{mutate:r}=t;return{updateLabel:o.useCallback((a,i)=>{e&&r({path:{accountId:e,labelId:a},body:i})},[e,r]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},h=e=>{const s=n(),t=l({...g(),onSuccess:()=>{e&&s.invalidateQueries({queryKey:u(e)})}}),{mutate:r}=t;return{deleteLabel:o.useCallback(a=>{e&&r({path:{accountId:e,labelId:a}})},[e,r]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{P as a,C as b,h as c,m as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as E,e as q,b as j,B as D,r as i,v as C,aF as R,s as P,o as K,a2 as Q,Q as A,P as $,R as z,U as B}from"./index-
|
|
1
|
+
import{j as E,e as q,b as j,B as D,r as i,v as C,aF as R,s as P,o as K,a2 as Q,Q as A,P as $,R as z,U as B}from"./index-mfroFF6A.js";import{C as G}from"./circle-check-big-C4zP0uN0.js";import{R as H}from"./search-token-index-Dq9g3Rie.js";function oe({state:e,onRefresh:t,label:s,errorMessage:a,hasUpdate:n,size:u="sm",className:c}){const o=e==="refreshing",f=e==="error",h=e==="success",g=f?E.jsx(q,{className:"size-4 text-danger"}):h?E.jsx(G,{className:"size-4 text-positive"}):E.jsx(H,{className:j("size-4",o&&"animate-spin")}),y=f?`${s} — failed: ${a??"try again"}`:o?`${s} — refreshing`:h?`${s} — up to date`:n?`${s} — new mail`:s;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(D,{variant:"ghost",size:u,icon:g,onClick:t,disabled:o,"aria-label":y,"aria-busy":o||void 0,title:f?a:s,className:c}),e==="idle"&&n&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const U=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function F(e){return!!e&&U.has(e)}const N=3e3,W=N*2,v={syncing:!1,resolved:!1,synced:0,total:0};function ie(e,t){const s=e.join(","),[a,n]=i.useState(!1),[u,c]=i.useState(!1);i.useEffect(()=>{n(!1),c(!1)},[s,t]),i.useEffect(()=>{if(!t)return;const r=setTimeout(()=>c(!0),W);return()=>clearTimeout(r)},[s,t]);const o=C({queries:e.map(r=>({...R({path:{accountId:r}}),enabled:t&&!a,refetchInterval:N,meta:{softError:!0}}))}),f=o.every(r=>r.isSuccess||r.isError),h=o.length===0||f||u;let g=!1,y=0,w=0;for(const r of o)if(F(r.data?.syncPhase)){g=!0;for(const l of r.data?.mailboxes??[])y+=l.messagesSynced,w+=l.messagesTotal}const S=t&&h&&!g;return i.useEffect(()=>{S&&n(!0)},[S]),!t||!h?v:{syncing:g,resolved:!0,synced:y,total:w}}const M=6e4,I=new Set(["sent","drafts","trash","archive"]),k=(e,t)=>{const s=new Map;for(const a of e){const n=t.get(a.mailboxId)?.role;n&&I.has(n)||s.set(a.mailboxId,a.messagesTotal)}return s},X=(e,t)=>{for(const[s,a]of t)if(a>(e.get(s)??0))return!0;return!1},_=i.createContext(null),J=()=>{const e=i.useContext(_);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function ce({accountIds:e,children:t}){const s=P(),{resultFolderIndex:a}=K(),n=i.useRef(new Map),u=i.useRef(new Set),[c,o]=i.useState(new Set),f=C({queries:e.map(r=>({...R({path:{accountId:r}}),refetchInterval:M,staleTime:M,meta:{softError:!0}}))}),h=f.map(r=>r.dataUpdatedAt).join(","),g=e.join(",");i.useEffect(()=>{let r=!1;const l=new Set(c);e.forEach((d,x)=>{const p=f[x]?.data;if(!p)return;const m=k(p.mailboxes??[],a);if(!u.current.has(d)){u.current.add(d),n.current.set(d,m);return}if(l.has(d))return;const T=n.current.get(d)??new Map;X(T,m)&&(l.add(d),r=!0)}),r&&o(l)},[g,h]);const y=i.useCallback(r=>r.some(l=>c.has(l)),[c]),w=i.useCallback(r=>{o(l=>{if(r.every(x=>!l.has(x)))return l;const d=new Set(l);for(const x of r)d.delete(x);return d});for(const l of r){const d=s.getQueryData(R({path:{accountId:l}}).queryKey);n.current.set(l,k(d?.mailboxes??[],a)),u.current.add(l)}},[s,a]),S=i.useMemo(()=>({hasNewMail:y,acknowledge:w}),[y,w]);return E.jsx(_.Provider,{value:S,children:t})}const V=2e3,Y=45e3,Z=e=>new Promise(t=>setTimeout(t,e)),b=e=>e instanceof Error&&e.message?e.message:"Something went wrong",ee=e=>{z(e,{softError:!0})&&B(e)},L=e=>e.reduce((t,s)=>Math.max(t,s.lastSyncedAt??0),0),O=(e,t)=>e.fetchQuery({...R({path:{accountId:t}}),staleTime:0}),se=async(e,t,s,a)=>{let n=!1;for(;;){const u=await O(e,t).then(f=>({ok:!0,data:f})).catch(f=>({ok:!1,error:f}));if(!u.ok)return{accountId:t,message:b(u.error)};const{syncPhase:c,mailboxes:o}=u.data;if(F(c))n=!0;else if(n||L(o??[])>s)return c==="error"?{accountId:t,message:"Sync failed for this account"}:void 0;if(Date.now()>=a)return{accountId:t,message:"Refresh is taking longer than usual"};await Z(V)}},te=async(e,t,s,a)=>{const n=await O(e,s).then(o=>({ok:!0,maxLastSynced:L(o.mailboxes??[])})).catch(o=>({ok:!1,error:o}));if(!n.ok)return{accountId:s,enqueued:!1,ok:!1,message:b(n.error)};const u=await $({path:{accountId:s},throwOnError:!0}).then(()=>({ok:!0})).catch(o=>({ok:!1,error:o}));if(!u.ok)return ee(u.error),{accountId:s,enqueued:!1,ok:!1,message:b(u.error)};t.recordEvent("sync.triggered");const c=await se(e,s,n.maxLastSynced,a);return c?{accountId:s,enqueued:!0,ok:!1,message:c.message}:{accountId:s,enqueued:!0,ok:!0}},ue=(e,t={})=>{const s=P(),a=Q(),{acknowledge:n}=J(),[u,c]=i.useState("idle"),[o,f]=i.useState(),h=i.useRef(0),g=i.useRef(e);g.current=e;const y=i.useRef(t);y.current=t,i.useEffect(()=>{if(u!=="success")return;const S=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(S)},[u]);const w=i.useCallback(()=>{const S=g.current;if(S.length===0){c("error"),f("Nothing to refresh yet");return}const r=++h.current;c("refreshing"),f(void 0),(async()=>{const l=Date.now()+Y,d=await Promise.all(S.map(m=>te(s,a,m,l)));if(h.current!==r)return;const x=d.filter(m=>m.enqueued).map(m=>m.accountId);for(const m of x)s.invalidateQueries({queryKey:A({path:{accountId:m}})});x.length>0&&(y.current.onSettled?.(),n(x));const p=d.filter(m=>!m.ok);p.length===0?c("success"):(c("error"),f(p[0]?.message))})()},[n,s,a]);return{state:u,errorMessage:o,refresh:w}};export{ce as M,oe as R,ue as a,ie as b,F as i,J as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as y,o as d,W as x,r as p}from"./index-
|
|
1
|
+
import{p as y,o as d,W as x,r as p}from"./index-mfroFF6A.js";import{u as Q}from"./search-scope-DAoU1EP1.js";import{b as v}from"./search-view-BLKN8HiH.js";function M(o){const a=y(),{searchInput:c,searchQuery:r}=d(),{q:i=""}=x({from:"/mail"}),n=Q({select:l=>l.location.pathname}),s=p.useRef(i);s.current=i;const{to:e}=o,t="params"in o?o.params.mailboxId:void 0,m=t?`/mail/${t}`:e;p.useEffect(()=>{if(!v({searchInput:c,committedQuery:r,urlQuery:s.current,pathname:n,listPath:m}))return;const f=!!r&&s.current!==r,u=h=>({...h,q:r||void 0});if(!f){a({to:".",search:u,replace:!0});return}if(e==="/mail/$mailboxId"){if(!t)return;a({to:e,params:{mailboxId:t},search:u,replace:!0});return}a({to:e,search:u,replace:!0})},[c,r,a,e,t,m,n])}export{M as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c3 as X,r as h,j as a,b as B,I as Y,a2 as Z,n as P,s as W,x as J,cr as H,cq as ee,ad as te,af as se,ag as re,bd as ne,e as ae,X as oe,K as C,o as ie}from"./index-mfroFF6A.js";import{K as L}from"./kbd-DGG2T6qp.js";import{u as ce}from"./use-match-media-B8WArMj0.js";import{M as Q}from"./enums-CCxx0t2v.js";import{u as le,i as de}from"./search-scope-DAoU1EP1.js";const ue=(e,t)=>{const r=e==="newsletter"||e==="marketing"||t;return{framed:r,isPlain:!r}},fe=()=>`
|
|
2
2
|
/* Zero the UA default body margin and clamp the document to the iframe width so
|
|
3
3
|
wide author markup can't push the body (and the page) past the viewport. */
|
|
4
4
|
html, body {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as L,ad as C,af as k,
|
|
1
|
+
import{s as L,ad as C,af as k,bv as I,bw as A,r as x,j as p,bx as h,by as E,bz as j,o as R,x as Q,bA as z}from"./index-mfroFF6A.js";import{aj as D,ak as O,al as _,am as N,an as P}from"./MailListHeader-DNHnhftv.js";import{a as q}from"./useLabels-C1J8eQzn.js";import{M as w}from"./enums-CCxx0t2v.js";import{u as U,s as B}from"./search-scope-DAoU1EP1.js";import{n as F}from"./search-query-Cr_ZXBCp.js";import{u as G,p as K}from"./useSearchTokenContext-D1jbjsrx.js";const V=t=>{const{mailboxId:s,messages:i}=t,l=L(),{pushError:c}=C(),{mutateAsync:r,isPending:a}=k({...A(),onError:(o,u)=>{c({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:I(o),error:o})},onSettled:(o,u,m)=>{D(l,O(_(m.body.messageIds??[],i??[],s)))}});return{applyLabel:x.useCallback((o,u,m)=>{o.length!==0&&N(o,d=>r({body:{messageIds:d,labelId:u,action:m}}))},[r]),isPending:a}};function oe({accountId:t,mailboxId:s,messageIds:i}){const{labels:l}=q(t),{applyLabel:c}=V({mailboxId:s}),r=x.useMemo(()=>l.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${E(a.color)?h[a.color]:h.Default}`}),onSelect:()=>c(i,a.labelId,"Apply")})),[l,i,c]);return r.length===0?null:p.jsx(P,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(j,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:r,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const $=20,H=new Set(Object.values(w)),J=t=>t!==void 0&&H.has(t)?t:void 0,W=t=>{if(t.some(s=>s.type==="isUnread"))return!1;if(t.some(s=>s.type==="isRead"))return!0};function ne({mailboxId:t,filterCategory:s}={}){const{searchQuery:i}=R(),l=G(),c=U({select:e=>e.matches}),r=F(i),{freeText:a,tokens:n}=K(r,l),o=a.length>0,u=n.find(e=>e.type==="category"),m=J(s)??u?.category,d=n.some(e=>e.type==="hasAttachment")?!0:void 0,y=n.some(e=>e.type==="isStarred")?!0:void 0,b=W(n),f=n.find(e=>e.type==="after"),g=n.find(e=>e.type==="before"),S=n.find(e=>e.type==="in"),v=B({matches:c,callerMailboxId:t,inTokenMailboxId:S?.mailboxId}),{data:M,isLoading:T}=Q({...z({query:{query:a,mailboxId:v,limit:$,...m!==void 0?{category:m}:{},...d!==void 0?{hasAttachment:d}:{},...y!==void 0?{hasStars:y}:{},...b!==void 0?{isRead:b}:{},...f?{sentDateFrom:f.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:o,staleTime:6e4});return{hits:M?.items??[],isLoading:o&&T}}export{oe as L,ne as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as c,ad as f,x as p,Z as m,r,af as y,ag as T,a1 as x,ah as E}from"./index-
|
|
1
|
+
import{s as c,ad as f,x as p,Z as m,r,af as y,ag as T,a1 as x,ah as E}from"./index-mfroFF6A.js";const i={html:"",plainText:""},h=e=>{const u=c(),{pushError:o}=f(),{data:n}=p({...m(),staleTime:1/0}),g=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(s=>s.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),a=y({...E(),onSuccess:()=>{u.invalidateQueries({queryKey:x()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),l=r.useCallback((t,s)=>{e&&a.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:s}})},[e,a]);return{signature:g,setSignature:l,isSaving:a.isPending}};export{h as u};
|
package/index.html
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
} catch (_) {}
|
|
39
39
|
})();
|
|
40
40
|
</script>
|
|
41
|
-
<script type="module" crossorigin src="/assets/index-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-mfroFF6A.js"></script>
|
|
42
42
|
<link rel="stylesheet" crossorigin href="/assets/index-B5g0rcGz.css">
|
|
43
43
|
</head>
|
|
44
44
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a3 as m,j as o,a0 as p}from"./index-DEXImZSP.js";import{a}from"./search-view-ExRj3nwX.js";import{M as r}from"./MailboxPane-Y0QCECzQ.js";import{u as e}from"./useSearchMirror-D5uJzaCm.js";import"./nav-link-BGPUkE24.js";import{u as s}from"./MailListHeader-Nb9izl_F.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./useRefreshControl-DgMvaW0l.js";import"./circle-check-big-Co4azfdq.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./MailViewChrome-RL9UB34E.js";import"./avatar-C5PmB_EI.js";import"./account-form-helpers-DGU4NIT4.js";import"./menu-BFhXuEK8.js";import"./ErrorState-Cxo3fVvx.js";import"./useFilters-CNDqeuwy.js";import"./confirm-dialog-Csw7CqUT.js";import"./format-De9HZKjg.js";import"./NavMenuButton-CLnauqPV.js";import"./useLabels-DpjQB2m3.js";import"./useSemanticSearch-Bhf16QYz.js";import"./search-query-Cr_ZXBCp.js";import"./shield-check-WoA7Uqox.js";import"./bottom-sheet-CO75NUgO.js";import"./circle-help-BCvtXNjF.js";import"./circle-check-B3gw_3Ro.js";import"./move-options-DJTQSJoc.js";import"./intelligence-pref-C6lFpj6U.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./download-CKNPuBCg.js";import"./clock-BGbbTR9M.js";function Q(){const{mailboxId:t}=m.useParams(),i=s();return e({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{Q as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-DEXImZSP.js";import{F as r}from"./FlaggedPane-P2hVt1sR.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./MailListHeader-Nb9izl_F.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./MailViewChrome-RL9UB34E.js";function v(){return o.jsx(r.Reading,{})}export{v as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-DEXImZSP.js";import{B as o}from"./BriefPane-qa0MIXWV.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./MailListHeader-Nb9izl_F.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./useRefreshControl-DgMvaW0l.js";import"./circle-check-big-Co4azfdq.js";import"./useLabels-DpjQB2m3.js";import"./useSemanticSearch-Bhf16QYz.js";import"./search-query-Cr_ZXBCp.js";function A(){return r.jsx(o.Reading,{})}export{A as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-DEXImZSP.js";import{M as r}from"./MailboxPane-Y0QCECzQ.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./useRefreshControl-DgMvaW0l.js";import"./circle-check-big-Co4azfdq.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./MailListHeader-Nb9izl_F.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./MailViewChrome-RL9UB34E.js";import"./NavMenuButton-CLnauqPV.js";import"./useLabels-DpjQB2m3.js";import"./useSemanticSearch-Bhf16QYz.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CO75NUgO.js";import"./circle-help-BCvtXNjF.js";import"./circle-check-B3gw_3Ro.js";import"./intelligence-pref-C6lFpj6U.js";function I(){return o.jsx(r.Reading,{})}export{I as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-DEXImZSP.js";import{O as t}from"./OutboxPane-BdjLk-C_.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./circle-check-big-Co4azfdq.js";import"./clock-BGbbTR9M.js";import"./row-actions-BhhavOse.js";import"./rotate-ccw-6QmeK9ZT.js";import"./NavMenuButton-CLnauqPV.js";import"./menu-BFhXuEK8.js";import"./format-De9HZKjg.js";import"./outbox-status-CPfNHfUQ.js";import"./search-query-Cr_ZXBCp.js";function R(){return o.jsx(t.Reading,{})}export{R as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a0 as o}from"./index-DEXImZSP.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a0 as o}from"./index-DEXImZSP.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a0 as o}from"./index-DEXImZSP.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as v,j as e,av as C,aG as y,B as n,aH as f,r as g,ab as m,aA as z,an as j,aB as R,aI as p,b as T,aJ as S,V as A,aK as I,aL as M,aM as V,p as B,az as D,aD as L}from"./index-DEXImZSP.js";import{S as _}from"./settings-screen-CQJh-xf-.js";import{D as b}from"./download-CKNPuBCg.js";import{R as N}from"./rotate-ccw-6QmeK9ZT.js";import{C as U}from"./clock-BGbbTR9M.js";import{C as H}from"./circle-check-B3gw_3Ro.js";import{S as E}from"./shield-check-WoA7Uqox.js";import"./avatar-C5PmB_EI.js";import"./menu-BFhXuEK8.js";import"./circle-help-BCvtXNjF.js";const Y=v("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const k=v("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),O=["Remit restarts. Mail stops loading for about a minute and this page will lose its connection while that happens.","Nothing is sent, deleted or moved. Your mail stays at your provider.","If the new version does not come back up, the version you are running now is restored automatically."];function P({open:s,currentVersion:t,release:a,appliesSchemaMigration:r=!1,onClose:i,onConfirm:c}){return s?e.jsx(C,{open:!0,onClose:i,title:`Install Remit ${a.version}`,children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Install Remit ",a.version,"?"]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["You are on ",t,". ",a.version," was released"," ",y(a.releasedAt),"."]})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-auto px-4 py-3",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:a.summary}),e.jsxs("ul",{className:"space-y-2",children:[O.map(o=>e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:o})]},o)),r&&e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:"This version updates the database while Remit is offline. The step forward cannot be undone by hand, but a failed start is still rolled back to the version and data you have now."})]})]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Good moment for this: when you are not waiting on a message."})]}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(n,{variant:"ghost",size:"sm",onClick:i,children:"Not now"}),e.jsx(f,{variant:"secondary",size:"sm",external:!0,href:a.releaseNotesUrl,icon:e.jsx(k,{className:"size-3.5"}),children:"Release notes"}),e.jsx(n,{size:"sm",icon:e.jsx(b,{className:"size-3.5"}),onClick:c,children:"Install and restart"})]})]})}):null}function l({children:s,tone:t}){return e.jsx("div",{className:T("rounded-sm border bg-surface px-row-inset py-3",t==="danger"?"border-danger/50":"border-line"),children:s})}function G({state:s,onCheck:t,onInstall:a,onDismissResult:r,now:i=Date.now()}){const[c,o]=g.useState(null),h=s.status==="checking",d=s.status==="available",x=()=>{if(h){o("Already checking. The result appears here in a moment.");return}o(null),t()},u=()=>{if(!d&&s.status!=="rolledBack"&&s.status!=="abandoned"){o("There is no update to install. Check for updates first — if one is found it appears here.");return}o(null),a()},w=(()=>{switch(s.status){case"upToDate":return e.jsx(l,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(H,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is the latest version.",e.jsxs("span",{className:"text-fg-subtle",children:[" ","Checked ",p(s.checkedAt,i),"."]})]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:x,children:"Check again"})]})});case"checking":return e.jsx(l,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(j,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Looking for a newer version. You are on ",s.version,"."]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:x,children:"Check again"})]})});case"neverChecked":return e.jsx(l,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx(U,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["No update check has run yet. Remit checks for updates on its own in the background.",s.lastCheckedAt!==void 0&&e.jsxs("span",{className:"text-fg-subtle",children:[" ","Last checked"," ",p(s.lastCheckedAt,i),"."]})]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:x,children:"Check now"})]})});case"checkFailed":return e.jsx(l,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Y,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:"Could not reach the update source."}),e.jsx("p",{className:"text-xs text-fg-muted",children:s.reason}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You are still on ",s.version," and it keeps working.",s.lastCheckedAt!==void 0&&e.jsxs(e.Fragment,{children:[" ","Last successful check"," ",p(s.lastCheckedAt,i),"."]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"secondary",size:"sm",onClick:x,children:"Try again"})})]})});case"available":return e.jsx(l,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-semibold text-fg",children:["Remit ",s.release.version]}),e.jsx(R,{tone:"accent",children:"update available"}),e.jsxs("span",{className:"text-2xs text-fg-subtle",children:["released ",y(s.release.releasedAt)," · you are on ",s.version]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.release.summary}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Installing restarts Remit, so mail stops loading for about a minute. If the new version does not come back up, the one you are running now is restored on its own."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{size:"sm",icon:e.jsx(b,{className:"size-3.5"}),onClick:u,children:["Install ",s.release.version]}),e.jsx(f,{variant:"secondary",size:"sm",external:!0,href:s.release.releaseNotesUrl,icon:e.jsx(k,{className:"size-3.5"}),children:"Release notes"})]})]})});case"applying":return e.jsx(l,{children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(j,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing Remit ",s.target,". The restart screen has the details."]})]})});case"succeeded":return e.jsx(z,{tone:"success",onDismiss:r,children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-semibold",children:["Updated to Remit ",s.version,"."]}),e.jsxs("p",{children:["You were on ",s.previousVersion,"."," ",e.jsx("a",{href:s.releaseNotesUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"See what changed"}),"."]})]})});case"rolledBack":return e.jsx(l,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(m,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start. Remit reports that it put ",s.version," back."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["You are running ",s.version," again. A failed update can still have changed things on the way — the log below is the only account of what it got as far as doing."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{variant:"secondary",size:"sm",icon:e.jsx(N,{className:"size-3.5"}),onClick:u,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(n,{variant:"ghost",size:"sm",onClick:r,children:["Stay on ",s.version]})]})]})});case"unreachable":return e.jsx(l,{tone:"danger",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(m,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Installing ",s.attemptedVersion," left the server unreachable."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Remit has answered again since, but nothing here can say what happened during the silence."})]})]}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"ghost",size:"sm",onClick:r,children:"Dismiss"})})]})});case"rollbackFailed":return e.jsx(l,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(m,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start, and Remit could not put ",s.previousVersion," back."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"This is the one outcome Remit cannot resolve on its own. The server is in a half-changed state and needs you at a shell. The log below is the only account of where it stopped."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log on the server:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"ghost",size:"sm",onClick:r,children:"Dismiss"})})]})});case"abandoned":return e.jsx(l,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(m,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," was not installed. Nothing changed."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["The update stopped before it altered anything. You are still running ",s.version,"."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{variant:"secondary",size:"sm",icon:e.jsx(N,{className:"size-3.5"}),onClick:u,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(n,{variant:"ghost",size:"sm",onClick:r,children:["Stay on ",s.version]})]})]})});default:return s}})();return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Updates"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This Remit runs on your own server, so it updates when you say so. Your mail lives at your provider and is never touched by an update."})]}),w,c&&e.jsx("p",{role:"status",className:"text-xs text-fg-muted",children:c})]})}function q(){const{surface:s,release:t,currentVersion:a,appliesSchemaMigration:r,onCheck:i,install:c,onDismissResult:o}=S(),[h,d]=g.useState(!1);return s.status!=="ready"?null:e.jsxs(e.Fragment,{children:[e.jsx(G,{state:s.section,onCheck:i,onInstall:()=>d(!0),onDismissResult:o}),t&&a&&e.jsx(P,{open:h,currentVersion:a,release:t,appliesSchemaMigration:r,onClose:()=>d(!1),onConfirm:()=>{d(!1),c(t.version)}})]})}function F(){return A().tlsMode!=="internal"?null:e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"TLS root certificate"}),e.jsx("p",{className:"text-sm text-fg-muted mb-2",children:"This deployment signs its own certificate. Import it into the trust store of each device you browse from, and the browser warning stops for good."}),e.jsx(f,{href:"/tls-root-ca.crt",download:!0,variant:"secondary",size:"sm",icon:e.jsx(E,{className:"size-3.5"}),children:"Download root certificate"})]})}function W(s){try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function J({sha:s=M,commitUrl:t=I,buildTime:a=V}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:s}):e.jsx("span",{className:"font-mono",children:s})," · ",e.jsxs("span",{children:["Built ",W(a)]})]})}const K=e.jsx("div",{className:"space-y-3",children:e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Notification rules"}),", data export, and per-account diagnostics are coming in a future release."]})});function le(){const s=B(),[t,a]=g.useState(!0),r=i=>{const c=L[i];c&&s({to:c})};return e.jsxs(_,{items:D,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:K,helpOpen:t,onToggleHelp:()=>a(i=>!i),onSelect:r,onBackToMail:()=>{s({to:"/mail"})},children:[e.jsx(q,{}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Notification rules, data export, and raw sync diagnostics are coming in a future release."}),e.jsx(F,{}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(J,{})]})]})}export{le as component};
|
package/assets/brief-CNd400AH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,a0 as i}from"./index-DEXImZSP.js";import{a as m}from"./search-view-ExRj3nwX.js";import{B as o}from"./BriefPane-qa0MIXWV.js";import{u as p}from"./useSearchMirror-D5uJzaCm.js";import"./nav-link-BGPUkE24.js";import{u as e}from"./MailListHeader-Nb9izl_F.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./useRefreshControl-DgMvaW0l.js";import"./circle-check-big-Co4azfdq.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./useLabels-DpjQB2m3.js";import"./useFilters-CNDqeuwy.js";import"./useSemanticSearch-Bhf16QYz.js";import"./search-query-Cr_ZXBCp.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";function D(){const t=e();return p({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{D as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,a0 as i}from"./index-DEXImZSP.js";import{a as m}from"./search-view-ExRj3nwX.js";import{F as r}from"./FlaggedPane-P2hVt1sR.js";import{u as p}from"./useSearchMirror-D5uJzaCm.js";import"./nav-link-BGPUkE24.js";import{u as e}from"./MailListHeader-Nb9izl_F.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./MailViewChrome-RL9UB34E.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./avatar-C5PmB_EI.js";import"./account-form-helpers-DGU4NIT4.js";import"./menu-BFhXuEK8.js";import"./ErrorState-Cxo3fVvx.js";import"./useFilters-CNDqeuwy.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./format-De9HZKjg.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";function v(){const t=e();return p({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{v as component};
|
package/assets/index-B05XkRF5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-DEXImZSP.js";import{F as r}from"./FlaggedPane-P2hVt1sR.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./MailListHeader-Nb9izl_F.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./MailViewChrome-RL9UB34E.js";function v(){return o.jsx(r.Reading,{})}export{v as component};
|
package/assets/index-Bq6a31Z9.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-DEXImZSP.js";import{F as r}from"./FlaggedPane-P2hVt1sR.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./MailListHeader-Nb9izl_F.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./MailViewChrome-RL9UB34E.js";function w(){return o.jsx(r.Reading,{})}export{w as component};
|
package/assets/index-C09jB3H_.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-DEXImZSP.js";import{B as o}from"./BriefPane-qa0MIXWV.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./MailListHeader-Nb9izl_F.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./useRefreshControl-DgMvaW0l.js";import"./circle-check-big-Co4azfdq.js";import"./useLabels-DpjQB2m3.js";import"./useSemanticSearch-Bhf16QYz.js";import"./search-query-Cr_ZXBCp.js";function A(){return r.jsx(o.Reading,{})}export{A as component};
|
package/assets/index-DV24rLD0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-DEXImZSP.js";import{O as t}from"./OutboxPane-BdjLk-C_.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./circle-check-big-Co4azfdq.js";import"./clock-BGbbTR9M.js";import"./row-actions-BhhavOse.js";import"./rotate-ccw-6QmeK9ZT.js";import"./NavMenuButton-CLnauqPV.js";import"./menu-BFhXuEK8.js";import"./format-De9HZKjg.js";import"./outbox-status-CPfNHfUQ.js";import"./search-query-Cr_ZXBCp.js";function d(){return o.jsx(t.Reading,{})}export{d as component};
|
package/assets/index-DW7V29aR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,a7 as o}from"./index-DEXImZSP.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|
package/assets/index-Dawu8JkU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-DEXImZSP.js";import{M as i}from"./MailboxPane-Y0QCECzQ.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./useRefreshControl-DgMvaW0l.js";import"./circle-check-big-Co4azfdq.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./MailListHeader-Nb9izl_F.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./MailViewChrome-RL9UB34E.js";import"./NavMenuButton-CLnauqPV.js";import"./useLabels-DpjQB2m3.js";import"./useSemanticSearch-Bhf16QYz.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CO75NUgO.js";import"./circle-help-BCvtXNjF.js";import"./circle-check-B3gw_3Ro.js";import"./intelligence-pref-C6lFpj6U.js";function I(){return o.jsx(i.Reading,{})}export{I as component};
|
package/assets/index-DlkYycLP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-DEXImZSP.js";import{M as r}from"./MailboxPane-Y0QCECzQ.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./useRefreshControl-DgMvaW0l.js";import"./circle-check-big-Co4azfdq.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./MailListHeader-Nb9izl_F.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./MailViewChrome-RL9UB34E.js";import"./NavMenuButton-CLnauqPV.js";import"./useLabels-DpjQB2m3.js";import"./useSemanticSearch-Bhf16QYz.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CO75NUgO.js";import"./circle-help-BCvtXNjF.js";import"./circle-check-B3gw_3Ro.js";import"./intelligence-pref-C6lFpj6U.js";function H(){return o.jsx(r.Reading,{})}export{H as component};
|
package/assets/index-ipXhqBj0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-DEXImZSP.js";import{B as o}from"./BriefPane-qa0MIXWV.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./MailListHeader-Nb9izl_F.js";import"./search-token-index-HzD6MHJp.js";import"./layout-breakpoints-BWjiUQKh.js";import"./account-form-helpers-DGU4NIT4.js";import"./avatar-C5PmB_EI.js";import"./useSignature-B4QDHqqq.js";import"./useDebouncedValue-BM9H0bdY.js";import"./useFilters-CNDqeuwy.js";import"./ErrorState-Cxo3fVvx.js";import"./format-De9HZKjg.js";import"./nav-link-BGPUkE24.js";import"./download-CKNPuBCg.js";import"./shield-check-WoA7Uqox.js";import"./move-options-DJTQSJoc.js";import"./confirm-dialog-Csw7CqUT.js";import"./clock-BGbbTR9M.js";import"./menu-BFhXuEK8.js";import"./useRefreshControl-DgMvaW0l.js";import"./circle-check-big-Co4azfdq.js";import"./useLabels-DpjQB2m3.js";import"./useSemanticSearch-Bhf16QYz.js";import"./search-query-Cr_ZXBCp.js";function C(){return r.jsx(o.Reading,{})}export{C as component};
|
package/assets/mail-BR-c8vnl.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as P,r as i,u as Pe,j as e,S as De,a as pe,b as M,C as ee,d as te,e as Fe,f as ge,F as Te,g as _e,X as be,T as Be,O as Ke,M as Ve,A as qe,h as Qe,I as He,i as ye,B as T,k as U,l as ve,m as $e,n as We,o as je,p as Y,q as Se,s as Ne,t as Ue,v as G,w as J,x as ke,y as Ye,z as Ge,D as Je,E as $,G as Xe,H as Ze,J as et,K as tt,L as st,N as at,P as nt,Q as rt,R as ot,U as it,V as lt,W as ct,Y as ut,Z as dt,_ as mt,$ as xt,a0 as ht}from"./index-DEXImZSP.js";import{B as ft,S as pt,D as gt,a as bt,b as yt,u as vt,s as jt,K as St,c as Nt,d as kt,e as Ct,f as wt,g as Mt,i as It}from"./search-token-index-HzD6MHJp.js";import{u as se}from"./search-scope-CrXQTM9g.js";import{P as Et}from"./pencil-BtfAKbKN.js";import{M as Ot,s as Rt,c as At}from"./search-view-ExRj3nwX.js";import{u as zt,a as Lt,R as Pt,M as Dt}from"./useRefreshControl-DgMvaW0l.js";import{M as Ft}from"./menu-BFhXuEK8.js";import{A as Tt}from"./avatar-C5PmB_EI.js";import{i as _t}from"./outbox-status-CPfNHfUQ.js";import{N as z}from"./nav-link-BGPUkE24.js";import{E as Bt}from"./ErrorState-Cxo3fVvx.js";import{K as ae}from"./kbd-CA35HBZD.js";import{u as Kt}from"./useDebouncedValue-BM9H0bdY.js";import{w as ne}from"./intelligence-pref-C6lFpj6U.js";import"./use-match-media-qBCYJz2o.js";import"./layout-breakpoints-BWjiUQKh.js";import"./circle-check-big-Co4azfdq.js";const Vt=P("BookmarkPlus",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]]);const Ce=P("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);const qt=P("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);const we=P("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);const Me=P("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Qt=P("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),Ht="button:not([disabled]), a[href]",O="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function $t({active:t,dimmed:s,indent:a}){return M("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",O,a&&"pl-7",t?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg",s&&"opacity-55")}function Wt({icon:t,label:s,count:a,active:n}){return e.jsxs(e.Fragment,{children:[t&&e.jsx("span",{className:M("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:t}),e.jsx("span",{className:"flex-1 truncate",children:s}),a!=null&&a>0&&e.jsx("span",{className:M("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function L({icon:t,label:s,count:a,active:n,dimmed:r,indent:o,navId:l,linkComponent:m,ariaLabel:x,title:p,onClick:b}){const u=$t({active:n,dimmed:r,indent:o}),h=e.jsx(Wt,{icon:t,label:s,count:a,active:n});return l&&m?m({navId:l,className:u,ariaLabel:x??s,title:p,onClick:b,children:h}):e.jsx("button",{type:"button",onClick:b,className:u,"aria-label":x,title:p,children:h})}const re={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function Ut(t){switch(t){case"inbox":return e.jsx(He,{className:"size-4"});case"flagged":return e.jsx(pe,{className:"size-4"});case"drafts":return e.jsx(Qe,{className:"size-4"});case"sent":return e.jsx(ge,{className:"size-4"});case"archive":return e.jsx(qe,{className:"size-4"});case"all":return e.jsx(Ve,{className:"size-4"});case"junk":return e.jsx(Ke,{className:"size-4"});case"trash":return e.jsx(Be,{className:"size-4"})}}const oe=t=>t.role!=null,H=8,ie="remit.nav.folders.open.",le="remit.nav.account.open.";function ce(t,s,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(t+s);return n===null?a:n!=="0"}function ue(t,s,a){typeof localStorage>"u"||localStorage.setItem(t+s,a?"1":"0")}function Yt({query:t,onSelect:s,onRemove:a}){return e.jsxs("div",{className:"group flex w-full items-center gap-1 rounded-md pr-1 hover:bg-surface",children:[e.jsxs("button",{type:"button",onClick:s,className:M("flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left text-sm text-fg-muted transition-colors hover:text-fg",O),children:[e.jsx(_e,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t})]}),a&&e.jsx("button",{type:"button",onClick:a,"aria-label":`Remove saved search: ${t}`,className:M("shrink-0 rounded-full p-1 text-fg-subtle opacity-0 transition-opacity hover:bg-surface-sunken hover:text-fg group-hover:opacity-100 focus-visible:opacity-100",O),children:e.jsx(be,{className:"size-3.5"})})]})}function Gt({savedSearches:t,saveableQuery:s,onSelectSavedSearch:a,onRemoveSavedSearch:n,onSaveCurrentSearch:r}){return t.length===0&&!s?null:e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"px-2 pb-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Saved searches"}),s&&e.jsxs("button",{type:"button",onClick:r,className:M("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-accent transition-colors hover:bg-surface",O),children:[e.jsx(Vt,{className:"size-4 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Save “",s,"”"]})]}),t.map(o=>e.jsx(Yt,{query:o,onSelect:()=>a?.(o),onRemove:n?()=>n(o):void 0},o))]})}function Jt({account:t,selectedNavId:s,onSelectNav:a,linkComponent:n}){const[r,o]=i.useState(()=>ce(le,t.id,!0)),[l,m]=i.useState(()=>ce(ie,t.id,!0)),[x,p]=i.useState(!1),b=()=>{o(c=>{const v=!c;return ue(le,t.id,v),v})},u=()=>{m(c=>{const v=!c;return ue(ie,t.id,v),v})},h=t.mailboxes.filter(oe).sort((c,v)=>re[c.role]-re[v.role]),f=t.mailboxes.filter(c=>!oe(c)),y=x||f.length<=H?f:f.slice(0,H),S=f.length-y.length,g=t.status??"ready",R=g==="ready"&&h.length===0&&f.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:b,"aria-expanded":r,className:M("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",O,t.muted&&"opacity-55"),children:[r?e.jsx(ee,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(te,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:t.label}),t.muted&&e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]})]}),r&&e.jsxs(e.Fragment,{children:[g==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),g==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(Fe,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),t.onRetry&&e.jsx("button",{type:"button",onClick:t.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),R&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),g==="ready"&&e.jsxs(e.Fragment,{children:[h.map(c=>e.jsx(L,{navId:c.id,linkComponent:n,icon:Ut(c.role),label:c.name,ariaLabel:c.name,title:c.fullPath??c.name,count:c.unseen,active:s===c.id,dimmed:t.muted,onClick:()=>a?.(c.id)},c.id)),t.outboxPending!==void 0&&e.jsx(L,{navId:"outbox",linkComponent:n,icon:e.jsx(ge,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:t.outboxPending>0?t.outboxPending:void 0,active:s==="outbox",dimmed:t.muted,onClick:()=>a?.("outbox")}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:u,"aria-expanded":l,className:M("mt-1 flex w-full items-center gap-1 px-2 py-1 text-left text-2xs font-semibold uppercase tracking-wider text-fg-subtle transition-colors hover:text-fg",O),children:[l?e.jsx(ee,{className:"size-3 shrink-0"}):e.jsx(te,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:f.length})]}),l&&e.jsxs(e.Fragment,{children:[y.map(c=>e.jsx(L,{navId:c.id,linkComponent:n,icon:e.jsx(Te,{className:"size-4"}),label:c.name,ariaLabel:c.name,title:c.fullPath??c.name,count:c.unseen,active:s===c.id,dimmed:t.muted,onClick:()=>a?.(c.id)},c.id)),(S>0||x)&&f.length>H&&e.jsx("button",{type:"button",onClick:()=>p(c=>!c),className:M("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",O),children:x?"Show less":`Show all (${f.length})`})]})]})]})]})]})}function Xt({accounts:t,selectedNavId:s,briefUnseen:a,onSelectNav:n,variant:r="desktop",linkComponent:o,calendarNav:l="hidden",savedSearches:m=[],saveableQuery:x,onSelectSavedSearch:p,onRemoveSavedSearch:b,onSaveCurrentSearch:u}){const h=i.useRef(null);Pe({containerRef:h,itemSelector:Ht});const f=r==="drawer",y=e.jsxs("nav",{ref:f?h:void 0,className:f?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(L,{navId:"brief",linkComponent:o,icon:e.jsx(De,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:s==="brief",onClick:()=>n?.("brief")}),l==="shown"&&e.jsx(L,{navId:"calendar",linkComponent:o,icon:e.jsx(qt,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:s==="calendar",onClick:()=>n?.("calendar")}),e.jsx(L,{navId:"flagged",linkComponent:o,icon:e.jsx(pe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:s==="flagged",onClick:()=>n?.("flagged")}),e.jsx(Gt,{savedSearches:m,saveableQuery:x,onSelectSavedSearch:p,onRemoveSavedSearch:b,onSaveCurrentSearch:u}),t.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):t.map(S=>e.jsx(Jt,{account:S,selectedNavId:s,onSelectNav:n,linkComponent:o},S.id))]});return f?y:e.jsx("aside",{ref:h,className:"flex h-full w-full flex-col bg-surface-sunken",children:y})}function Zt({leading:t,search:s,actions:a,className:n}){return e.jsxs("header",{className:M("flex min-h-pane-header w-full shrink-0 items-center gap-2 border-b border-line bg-canvas px-row-inset py-1",n),children:[t&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:t}),e.jsx("div",{className:"flex min-w-0 flex-1 justify-start",children:e.jsx("div",{className:"w-full max-w-xs transition-[max-width] duration-150 ease-out focus-within:max-w-lg",children:s})}),a&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:a})]})}function es(){const t=ye();if(!t)return null;const s=t.showNavPane?!t.navCollapsed:!1;return e.jsx(T,{variant:"ghost",size:"sm",icon:e.jsx(Ft,{className:"size-4"}),onClick:t.toggleNav,"aria-label":s?"Hide folders":"Show folders","aria-expanded":s,title:"Folders",className:"shrink-0"})}const ts={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ss({search:t,onCompose:s,onReportBug:a,onOpenSettings:n,composeShortcut:r,refreshControl:o,account:l}){return e.jsx(Zt,{leading:e.jsx(es,{}),search:e.jsx(pt,{value:t.value,onChange:t.onChange,onClear:t.onClear,onClearQuery:t.onClearQuery,chips:t.chips,onRemoveChip:t.onRemoveChip,placeholder:ts[t.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(T,{variant:"ghost",size:"sm",icon:e.jsx(Qt,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:s}),e.jsx(T,{variant:"ghost",size:"sm",icon:e.jsx(Ce,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(T,{variant:"ghost",size:"sm",icon:e.jsx(Me,{className:"size-4"}),title:"Settings","aria-label":"Settings",onClick:n}),o,l]})})}const as=()=>{const{state:t,openCompose:s}=U(),a=ve(),n=i.useCallback(()=>{s({mode:"new"})},[s]),r=$e(a.pathname);return!a.pathname.startsWith("/mail")||t.isOpen||r?null:e.jsx("button",{type:"button",onClick:n,"aria-label":"Compose new message",className:"lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all",style:{bottom:"calc(env(safe-area-inset-bottom, 0) + 1rem)"},children:e.jsx(Et,{className:"size-6"})})},Ie=({children:t})=>{const{Account:s}=We();return e.jsx(s,{children:t})},ns=({email:t,onSignOut:s})=>{const a=t??"Account";return e.jsxs(gt,{trigger:e.jsx(Tt,{name:a,email:t??void 0,size:"sm"}),align:"right",children:[t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-2 text-xs text-fg-muted truncate",title:t,"data-testid":"account-menu-email",children:t}),e.jsx(bt,{})]}),e.jsxs(yt,{onClick:s,children:[e.jsx(we,{className:"size-4"}),"Sign out"]})]})},rs=()=>e.jsx(Ie,{children:({email:t,signOut:s})=>e.jsx(ns,{email:t,onSignOut:s})});function os({accounts:t}){const{searchInput:s,onSearchChange:a,onSearchClear:n,onSearchClearQuery:r}=je(),o=Y(),{openCompose:l}=U(),m=i.useCallback(()=>{l({mode:"new"})},[l]),{scope:x,clearScope:p}=vt(t),b=x.kind==="scoped"?[{id:x.chip.id,label:x.chip.label,tone:"scope"}]:void 0,u=i.useMemo(()=>t.map(g=>g.accountId),[t]),{hasNewMail:h}=zt(),{state:f,errorMessage:y,refresh:S}=Lt(u);return e.jsx(ss,{search:{value:s,scope:x.kind,chips:b,onChange:a,onClear:n,onClearQuery:r,onRemoveChip:p},onCompose:m,onReportBug:Se,onOpenSettings:()=>o({to:"/settings/accounts"}),composeShortcut:jt("compose"),refreshControl:e.jsx(Pt,{state:f,onRefresh:S,label:"Refresh all accounts",errorMessage:y,hasUpdate:h(u)}),account:e.jsx(rs,{})})}const X="remit.savedSearches",is=25;function B(){try{const t=localStorage.getItem(X);if(!t)return[];const s=JSON.parse(t);return Array.isArray(s)?s.filter(a=>typeof a=="string"):[]}catch{return[]}}function ls(t){const s=t.trim();if(!s)return B();const a=[s,...B().filter(n=>n!==s)].slice(0,is);try{localStorage.setItem(X,JSON.stringify(a))}catch{return a}return a}function cs(t){const s=B().filter(a=>a!==t);try{localStorage.setItem(X,JSON.stringify(s))}catch{return s}return s}const de=t=>/^\d/.test(t),us=(t,s)=>{const a=de(t),n=de(s);return a&&!n?-1:!a&&n?1:t.localeCompare(s,void 0,{sensitivity:"base",numeric:!0})};function ds(t,s,a){const n=[],r=[];for(const o of t)s.has(o.mailboxId)?n.push(o):r.push(o);return r.sort((o,l)=>us($(o,void 0,a),$(l,void 0,a))),{system:n,labels:r}}function ms(t,s,a){const n=Xe(s)&&t.unseenCount>0;return{id:t.mailboxId,name:$(t,s,a),unseen:n?t.unseenCount:void 0,role:s,fullPath:t.fullPath}}function xs(){const t=ve(),s=Je({strict:!1});return t.pathname.startsWith("/settings")?"settings":t.pathname.startsWith("/mail/outbox")?"outbox":t.pathname.startsWith("/mail/flagged")?"flagged":t.pathname.startsWith("/mail/brief")?"brief":s.mailboxId?s.mailboxId:""}function me({accounts:t,onMailboxSelect:s,variant:a="desktop"}){const n=Ne(),r=Y(),o=xs(),{searchInput:l,onSearchChange:m}=je(),[x,p]=i.useState(B),{t:b}=Ue("mail",{useSuspense:!1}),u=i.useCallback((d,N)=>b(d,{defaultValue:N}),[b]),h=G({queries:t.map(d=>({...J({path:{accountId:d.accountId}}),staleTime:1/0}))}),{data:f}=ke(Ye()),y=i.useMemo(()=>(f?.items??[]).filter(d=>_t(d.status)).length,[f?.items]),S=i.useMemo(()=>t.map((d,N)=>{const k=h[N],I=k?.data?.items??[],w=Ge(d.folderAppointments),{system:E,labels:Q}=ds(I,w,u),C=k?.isError?"error":k?.isLoading?"loading":"ready";return{id:d.accountId,label:d.email,email:d.email,muted:!!d.muted,outboxPending:y,status:C,onRetry:()=>k?.refetch(),mailboxes:[...E,...Q].map(D=>ms(D,w.get(D.mailboxId),u))}}),[t,h,y,u]),g=d=>{n.invalidateQueries({queryKey:Ze({path:{mailboxId:d},query:{order:"desc"}})})},R=({navId:d,className:N,ariaLabel:k,title:I,children:w,onClick:E})=>d==="brief"?e.jsx(z,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>E?.(),className:N,"aria-label":k,title:I,children:w}):d==="outbox"?e.jsx(z,{to:"/mail/outbox",search:{q:void 0},onClick:()=>E?.(),className:N,"aria-label":k,title:I,children:w}):d==="flagged"?e.jsx(z,{to:"/mail/flagged",search:{q:void 0},onClick:()=>E?.(),className:N,"aria-label":k,title:I,children:w}):d==="settings"?e.jsx(z,{to:"/settings/accounts",onClick:()=>E?.(),className:N,"aria-label":k,title:I,children:w}):e.jsx(z,{to:"/mail/$mailboxId",params:{mailboxId:d},search:{q:void 0},onClick:()=>{g(d),E?.()},className:N,"aria-label":k,title:I,children:w}),c=()=>{m(""),s?.()},v=l.trim(),A=v.length>0&&!x.includes(v)?v:void 0,K=i.useCallback(()=>{A&&p(ls(A))},[A]),V=i.useCallback(d=>{p(cs(d))},[]),q=i.useCallback(d=>{m(d),r({to:"/mail/brief",search:{q:d}}),s?.()},[m,r,s]);return e.jsx(Xt,{accounts:S,selectedNavId:o,onSelectNav:c,linkComponent:R,variant:a,savedSearches:x,saveableQuery:A,onSaveCurrentSearch:K,onSelectSavedSearch:q,onRemoveSavedSearch:V})}function hs(){return e.jsxs("button",{type:"button",onClick:Se,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg",children:[e.jsx(Ce,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}function fs({accounts:t,onMailboxSelect:s}){return ye()?.showNavPane??!0?e.jsx(me,{accounts:t}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(me,{accounts:t,onMailboxSelect:s,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(z,{to:"/settings/accounts",onClick:s,children:[e.jsx(Me,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(hs,{}),e.jsx(Ie,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{s?.(),r()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(we,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}const ps=({isOpen:t,onClose:s})=>{const a=i.useCallback(n=>{n.key==="Escape"&&(n.preventDefault(),s())},[s]);return i.useEffect(()=>{if(t)return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,a]),t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(et,{label:"Dismiss keyboard shortcuts",onDismiss:s,className:"backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:tt("relative z-10 max-h-[85vh] w-full max-w-2xl overflow-y-auto","rounded-lg border border-line bg-surface shadow-lg","p-6"),children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard shortcuts"}),e.jsx("button",{type:"button",onClick:s,className:"p-1 text-fg-muted transition-colors hover:text-fg","aria-label":"Close",children:e.jsx(be,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:St.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(r=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:r.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:r.keys.map((o,l)=>e.jsxs(i.Fragment,{children:[l>0&&r.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(ae,{children:o})]},o))})]},`${r.action}-${r.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx(ae,{children:"Esc"})," to close"]})})]})]}):null};function gs(t){const s=G({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0}))});return i.useMemo(()=>Nt(s.map(a=>a.data?.items??[])),[s])}const bs=t=>t.map(s=>s.data?.items??[]);function ys(t){const s=G({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0})),combine:bs});return i.useMemo(()=>st(t.map((a,n)=>({folderAppointments:a.folderAppointments,mailboxes:s[n]??[]}))),[t,s])}var F={exports:{}},xe;function vs(){if(xe)return F.exports;xe=1;const t=(s,a,n)=>new Promise((r,o)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:l}=n;if(!(typeof l=="number"&&l>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${l}\` (${typeof l})`);const m=[],x=s[Symbol.iterator]();let p=!1,b=!1,u=0,h=0;const f=()=>{if(p)return;const y=x.next(),S=h;if(h++,y.done){b=!0,u===0&&r(m);return}u++,Promise.resolve(y.value).then(g=>a(g,S)).then(g=>{m[S]=g,u--,f()},g=>{p=!0,o(g)})};for(let y=0;y<l&&(f(),!b);y++);});return F.exports=t,F.exports.default=t,F.exports}var js=vs();const Ss=at(js),Ns=900*1e3,ks=300,Cs=(t,s)=>{if(!t)return s;const a=Number.parseInt(t,10);return Number.isFinite(a)&&a>0?a:s},ws=60*1e3,Ms=t=>Math.max(Cs(t,ks)*1e3,ws),_=Ms(lt().mailboxPollIntervalSeconds),Is=5,W=new Set,Es=(t,s,a=Ns)=>t.filter(n=>{const r=n.lastSyncAt;return r==null?!0:s-r>a}).map(n=>n.accountId),Os=(t,s,a=_)=>t-s>=a,Rs=(t,s)=>t.filter(a=>!s.has(a)),he=(t,s)=>{if(W.delete(t),ot(s,{softError:!0})){it(s);return}console.warn("[remit] background mailbox sync failed",{accountId:t,error:s})},fe=(t,s)=>nt({path:{accountId:t},throwOnError:!0}).then(()=>{s.invalidateQueries({queryKey:rt({path:{accountId:t}})})}),As=t=>{const s=Ne(),a=i.useRef(t);a.current=t;const n=t.map(r=>r.accountId).join(",");i.useEffect(()=>{const r=Date.now(),l=Es(a.current,r).filter(m=>!W.has(m));if(l.length!==0)for(const m of l)W.add(m),fe(m,s).catch(x=>{he(m,x)})},[n,s]),i.useEffect(()=>{let r=Date.now(),o;const l=new Set,m=()=>{r=Date.now();const b=Rs(a.current.map(u=>u.accountId),l);for(const u of b)l.add(u);Ss(b,u=>fe(u,s).catch(h=>{he(u,h)}).finally(()=>{l.delete(u)}),{concurrency:Is})},x=()=>{if(document.visibilityState==="visible"){m(),o=setTimeout(x,_);return}},p=()=>{document.visibilityState==="visible"&&Os(Date.now(),r)&&(o!==void 0&&clearTimeout(o),m(),o=setTimeout(x,_))};return o=setTimeout(x,_),document.addEventListener("visibilitychange",p),()=>{o!==void 0&&clearTimeout(o),document.removeEventListener("visibilitychange",p)}},[n,s])};function Gs(){const{q:t=""}=ct({from:"/mail"}),s=Y(),a=kt(),n=It(a),[r,o]=i.useState(!1),[l,m]=i.useState(!1),[x,p]=i.useState(!1),b=i.useCallback(j=>{p(j),ne(j)},[]),[u,h]=i.useState(t),f=Kt(u,200),y=At(u,f),S=se({select:j=>j.location.pathname}),g=se({select:j=>ut(j.matches)}),[R,c]=i.useState(g);if(R!==g){const j=Rt(R,g,t);c(g),j!==void 0&&h(j)}const{data:v,isLoading:A,isError:K,error:V,refetch:q}=ke({...dt(),staleTime:1/0}),d=!!(v&&(v.accounts?.length??0)===0);i.useEffect(()=>{d&&s({to:"/onboarding",replace:!0})},[d,s]),Ct({enabled:!r,bindings:[{key:"?",handler:()=>o(!0),noModifiers:!1,preventDefault:!0}]});const{openCompose:N}=U(),k=i.useMemo(()=>({compose:()=>N({mode:"new"})}),[N]);wt({enabled:!mt(S),handlers:k});const I=i.useCallback(j=>{h(j)},[]),w=i.useCallback(()=>{h("")},[]),E=i.useCallback(()=>{h("")},[]),Q=i.useCallback(()=>{p(j=>{const Z=!j;return ne(Z),Z})},[]),C=v?.accounts??[],D=i.useMemo(()=>C.map(j=>j.accountId),[C]),Ee=gs(C),Oe=ys(C),Re=i.useMemo(()=>Mt(C),[C]);As(C);const Ae=i.useCallback(()=>{m(!1)},[]),ze={accounts:C,mailboxNameIndex:Ee,accountNameIndex:Re,resultFolderIndex:Oe,searchQuery:y,searchInput:u,searchViewKey:g,onSearchChange:I,onSearchClear:w,onSearchClearQuery:E,intelligenceOpen:x,onToggleIntelligence:Q,onSetIntelligenceOpen:b},Le={isSinglePane:n,isLoading:A||d,intelligenceOpen:x,nav:e.jsx(fs,{accounts:C,onMailboxSelect:Ae}),topBar:n?void 0:e.jsx(os,{accounts:C}),overlay:n?e.jsx(as,{}):void 0,navOpen:l,onOpenNav:()=>m(!0),onCloseNav:()=>m(!1)};return e.jsx(xt.Provider,{value:ze,children:e.jsxs(Dt,{accountIds:D,children:[K?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(Bt,{title:"Couldn't load your account",error:V,onRetry:()=>{q()}})}):e.jsx(Ot,{chrome:Le,children:e.jsx(ht,{})}),e.jsx(ps,{isOpen:r,onClose:()=>o(!1)})]})})}export{Gs as component,je as useMailContext};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as i,j as o,a0 as s}from"./index-DEXImZSP.js";import{a as m}from"./search-view-ExRj3nwX.js";import{O as t}from"./OutboxPane-BdjLk-C_.js";import{u as a}from"./useSearchMirror-D5uJzaCm.js";import"./nav-link-BGPUkE24.js";import"./useSearchTokenContext-CmJvOV-Z.js";import"./kbd-CA35HBZD.js";import"./use-match-media-qBCYJz2o.js";import"./enums-CCxx0t2v.js";import"./search-scope-CrXQTM9g.js";import"./circle-check-big-Co4azfdq.js";import"./clock-BGbbTR9M.js";import"./row-actions-BhhavOse.js";import"./rotate-ccw-6QmeK9ZT.js";import"./NavMenuButton-CLnauqPV.js";import"./menu-BFhXuEK8.js";import"./format-De9HZKjg.js";import"./outbox-status-CPfNHfUQ.js";import"./search-query-Cr_ZXBCp.js";function e(){return i({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function w(){const r=e();return a({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(s,{})})})}export{w as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,a0 as o}from"./index-DEXImZSP.js";const n=()=>t.jsx(o,{});export{n as component};
|