@remit/web-client-dist 0.0.625 → 0.0.626
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-BcLRbXt0.js → BriefPane-_14jyTNU.js} +1 -1
- package/assets/{CalendarComposePane-BX_sGf_E.js → CalendarComposePane-CvXktapf.js} +1 -1
- package/assets/{CalendarComposeSeed-ueNtbA6-.js → CalendarComposeSeed-CifBLPSk.js} +1 -1
- package/assets/{CalendarShell-Cf0mR1zl.js → CalendarShell-CQKMfTHS.js} +1 -1
- package/assets/{EmptyState-CN1sTl54.js → EmptyState-DFn4LB7J.js} +1 -1
- package/assets/{ErrorState-ujr_GVkW.js → ErrorState-wz9YaOol.js} +1 -1
- package/assets/{FlaggedPane-CRQiEP8s.js → FlaggedPane-CGhj--Hm.js} +1 -1
- package/assets/{FullCompose-BAl3d_w0.js → FullCompose-ChHG83dJ.js} +1 -1
- package/assets/{MailListHeader-B8KqCoIm.js → MailListHeader-DfOCZnRx.js} +1 -1
- package/assets/{MailNav-eOhT4K5M.js → MailNav-CjfpinUe.js} +1 -1
- package/assets/{MailShell-CijmWfSp.js → MailShell-C1jECwgj.js} +1 -1
- package/assets/{MailViewChrome-ylQHccJD.js → MailViewChrome-XZUEJlo5.js} +1 -1
- package/assets/{MailboxPane-BSy756o9.js → MailboxPane-Czwm70WW.js} +1 -1
- package/assets/{NavMenuButton-DXqQI4Z5.js → NavMenuButton-DeFLPsFB.js} +1 -1
- package/assets/{OnboardingWizard-JlsmKOxT.js → OnboardingWizard-B-CFGg5s.js} +1 -1
- package/assets/{OpenCalendarEvent-AMoWfhdc.js → OpenCalendarEvent-DFERZRRh.js} +2 -2
- package/assets/{OutboxPane-CA4PZFqu.js → OutboxPane-HIJT_kwS.js} +1 -1
- package/assets/_calendarObjectId-CHrSuJ4j.js +1 -0
- package/assets/_mailboxId-Cx59NB_O.js +1 -0
- package/assets/_messageId-428jqG1g.js +1 -0
- package/assets/_messageId-BqS3jo2k.js +1 -0
- package/assets/_messageId-DLcoHrvg.js +1 -0
- package/assets/_outboxMessageId-DgbOcdNZ.js +1 -0
- package/assets/_recurrenceId-BNEK4esm.js +1 -0
- package/assets/_threadId-BpGxTAyH.js +1 -0
- package/assets/_threadId-DBQCQCIO.js +1 -0
- package/assets/_threadId-Li52F0Cd.js +1 -0
- package/assets/{_view._date-CG9W40_l.js → _view._date-CvSVriaI.js} +1 -1
- package/assets/accounts-UiS1FK2e.js +1 -0
- package/assets/{advanced-CDxG3KHI.js → advanced-LKQZxDeW.js} +2 -2
- package/assets/{appearance-CU8jNmrW.js → appearance-Csl0uD9E.js} +1 -1
- package/assets/{attendee-row-YXbrbIq8.js → attendee-row-BhqXy1fZ.js} +1 -1
- package/assets/{avatar-C5pPOUjS.js → avatar-Dq9zVRVl.js} +1 -1
- package/assets/{bell-off-CQoLYol5.js → bell-off-zJIQc-fQ.js} +1 -1
- package/assets/{bottom-sheet-C91fm1wU.js → bottom-sheet-CqUVoKvb.js} +1 -1
- package/assets/brief-CuAyGW-_.js +1 -0
- package/assets/{brief-C32PSIeP.js → brief-i89ZY7Gu.js} +1 -1
- package/assets/{browser-ponyfill-DzvjeLzv.js → browser-ponyfill-32LE6w6g.js} +2 -2
- package/assets/{bug-Bvjwypvc.js → bug-BX9QtfhB.js} +1 -1
- package/assets/{calendar-DrGm8UfQ.js → calendar-DLPNVzNq.js} +1 -1
- package/assets/{calendar-clash-strip-BLhPkquh.js → calendar-clash-strip-Bid2cYhz.js} +1 -1
- package/assets/{calendar-format-D-35Eq-A.js → calendar-format-M4S5xU7P.js} +1 -1
- package/assets/calendar-suggestion-Dz1CYPKE.js +1 -0
- package/assets/{calendars-5GLviUT4.js → calendars-D_kCUTOt.js} +1 -1
- package/assets/{card-DIRsRHeY.js → card-DgdelB3M.js} +1 -1
- package/assets/chevron-left-Dd68kT1Y.js +1 -0
- package/assets/{circle-check-uO4_WbZm.js → circle-check-B0R88gmM.js} +1 -1
- package/assets/{circle-check-big-BxS7u06D.js → circle-check-big-DrhQmTbc.js} +1 -1
- package/assets/{circle-help-BlZ4xP9R.js → circle-help-Bh3n-6_h.js} +1 -1
- package/assets/{clock-zn4wNsRc.js → clock-ByuYhL7c.js} +1 -1
- package/assets/compose._-_outboxMessageId_-CJP6aGKp.js +1 -0
- package/assets/compose._-_outboxMessageId_-CMXTsNxj.js +1 -0
- package/assets/compose._-_outboxMessageId_-DIUaW_Wi.js +1 -0
- package/assets/compose._-_outboxMessageId_-ZpGAMi--.js +1 -0
- package/assets/{config-import-CiK_cjWq.js → config-import-Bugb2aMh.js} +1 -1
- package/assets/{confirm-dialog-DStVP_YB.js → confirm-dialog-D0wfxRPd.js} +1 -1
- package/assets/{copy-CBi3fm5e.js → copy-baeOC0XH.js} +1 -1
- package/assets/{credential-steps-C0bopKBL.js → credential-steps-DOdW-2H8.js} +1 -1
- package/assets/{download--4zu6YFD.js → download-C79uP4C7.js} +1 -1
- package/assets/{file-json-CIHsLTs2.js → file-json-CGQXrNbO.js} +1 -1
- package/assets/{filters-Bs369HA4.js → filters-CAsK70Nx.js} +1 -1
- package/assets/flagged-CEg9zmAF.js +1 -0
- package/assets/{flagged-79ZpssaF.js → flagged-uALUxb-O.js} +1 -1
- package/assets/{folders-KCTLIIjZ.js → folders-Bx3SMw7d.js} +1 -1
- package/assets/{help-copy-uBF8fXGG.js → help-copy-C9SzNfoi.js} +1 -1
- package/assets/{import-CsL0jkis.js → import-BwX6jaiD.js} +1 -1
- package/assets/index-B_wiLLnW.js +1 -0
- package/assets/index-BulHQ3Bz.js +1 -0
- package/assets/index-Bz3z8-Ud.js +1 -0
- package/assets/{index-BP2ZVS4q.js → index-CLg2znEx.js} +1 -1
- package/assets/index-Caogy7TQ.js +1 -0
- package/assets/index-Cfb74LIY.js +1 -0
- package/assets/index-CvxW8FM1.js +1 -0
- package/assets/index-Cy75NEgh.js +1 -0
- package/assets/{index-D5i-rZKH.js → index-D4ZeuNuq.js} +4 -4
- package/assets/index-DLcoHrvg.js +1 -0
- package/assets/index-DmMeuJEG.js +1 -0
- package/assets/{index-Q4feV5hs.js → index-UydO8d8c.js} +61 -61
- package/assets/{kbd-shPcQMK0.js → kbd-Dr4usi4j.js} +1 -1
- package/assets/{labels-DSgUeEAp.js → labels-D22q095l.js} +1 -1
- package/assets/{mail-C9hQ4FN3.js → mail-CWdYkVJO.js} +1 -1
- package/assets/{mail-C_twG7GL.js → mail-Db9OjHYL.js} +1 -1
- package/assets/{map-pin-BBn-x2Kl.js → map-pin-HJKJCWdt.js} +1 -1
- package/assets/{menu-DTN4EvxK.js → menu-CbYnJN5U.js} +1 -1
- package/assets/{new-htfLYhI7.js → new-kq63OZ83.js} +1 -1
- package/assets/onboarding-DXy2aNhI.js +1 -0
- package/assets/{onboarding-completion-qZwYb_Ut.js → onboarding-completion-BlaYncdL.js} +1 -1
- package/assets/outbox-CT3Ok2c-.js +1 -0
- package/assets/{pencil-DeYHBqGJ.js → pencil-u2t1F29A.js} +1 -1
- package/assets/{popover-menu-TKxn0teJ.js → popover-menu--AoVAv-y.js} +1 -1
- package/assets/{refresh-cw-5HtDVbgJ.js → refresh-cw-Qp6f0dRu.js} +1 -1
- package/assets/{rich-text-19XjDhm5.js → rich-text-D3RBxInX.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-D_eo5-8u.js → rich-text-spellcheck-worker-provider-9h-DIyCe.js} +1 -1
- package/assets/{rotate-ccw-CQK-NIHI.js → rotate-ccw-SdroQT7m.js} +1 -1
- package/assets/{roving-focus-lu4GUcG_.js → roving-focus-BNBmBfAx.js} +1 -1
- package/assets/{row-actions-Dj7EnCiv.js → row-actions-IPR7z5tr.js} +1 -1
- package/assets/{search-mirror-yAtFv0xR.js → search-mirror-Cv2S0VbB.js} +1 -1
- package/assets/{search-token-index-DMotPy3S.js → search-token-index-AOAqpH15.js} +1 -1
- package/assets/{sections-BEjFgOOu.js → sections-EqJpt3TQ.js} +1 -1
- package/assets/{senders-XmPQgpCc.js → senders-DnFn3aNI.js} +1 -1
- package/assets/settings-CNMUput2.js +1 -0
- package/assets/{settings-screen-BRDJz8vo.js → settings-screen-WQb7kG5A.js} +1 -1
- package/assets/{shield-check-HOK5b_5p.js → shield-check-D7EcTf9d.js} +1 -1
- package/assets/{suggested-vips-C57jHxrP.js → suggested-vips-QYhd7mHg.js} +1 -1
- package/assets/{undo-2-SqKWoGew.js → undo-2-CveuEJjH.js} +1 -1
- package/assets/{useCalendarData-ScZEg4Bc.js → useCalendarData-CMPLRued.js} +1 -1
- package/assets/{useCalendarWrites-DdDEKJWs.js → useCalendarWrites-BASehFYp.js} +1 -1
- package/assets/{useCalendars-DB62jljf.js → useCalendars-DR1_eTjS.js} +1 -1
- package/assets/{useDebouncedValue-m9hfoeeT.js → useDebouncedValue-Dt6rAAol.js} +1 -1
- package/assets/{useFilters-MhGWNTRw.js → useFilters-Bbcl4di_.js} +1 -1
- package/assets/{useLabels-BCVlkzT_.js → useLabels-DQs2z0T7.js} +1 -1
- package/assets/{useLayoutTier-B7U5my6x.js → useLayoutTier-CF_kWPgV.js} +1 -1
- package/assets/{useMessageBodyContent-Bh1dkGuL.js → useMessageBodyContent-DiiU1g37.js} +1 -1
- package/assets/{useQueries-Dt_ZoQnW.js → useQueries-CJUjXxvq.js} +1 -1
- package/assets/{useRefreshControl-C5OCmhS8.js → useRefreshControl-BUZDaiTn.js} +1 -1
- package/assets/{useResultFolderIndex-D_wb9MYs.js → useResultFolderIndex-D9ADFT-m.js} +1 -1
- package/assets/{useSearchTokenContext-BtJhq-_Q.js → useSearchTokenContext-CBDSw3gJ.js} +3 -3
- package/assets/{useSemanticSearch-DfSsCW6c.js → useSemanticSearch-B7rQKIm8.js} +1 -1
- package/assets/{useSignature-CRBwOs1d.js → useSignature-DruMb0cI.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/_calendarObjectId-tOtImfXw.js +0 -1
- package/assets/_mailboxId-_P3tq8gl.js +0 -1
- package/assets/_messageId-COMQcfvI.js +0 -1
- package/assets/_messageId-DmH3Li5m.js +0 -1
- package/assets/_messageId-cFsRfOSD.js +0 -1
- package/assets/_outboxMessageId--susUoju.js +0 -1
- package/assets/_recurrenceId-CGhp2ffr.js +0 -1
- package/assets/_threadId--notVzkL.js +0 -1
- package/assets/_threadId-AEzpp5uR.js +0 -1
- package/assets/_threadId-BwJD_tv3.js +0 -1
- package/assets/accounts-8HbXfxyY.js +0 -1
- package/assets/brief-DpNC_lz8.js +0 -1
- package/assets/calendar-suggestion-Coshl0tU.js +0 -1
- package/assets/chevron-left-BzC14Odw.js +0 -1
- package/assets/compose._-_outboxMessageId_-BQfSgO1d.js +0 -1
- package/assets/compose._-_outboxMessageId_-BTwbuYpu.js +0 -1
- package/assets/compose._-_outboxMessageId_-C4C_6Pc5.js +0 -1
- package/assets/compose._-_outboxMessageId_-rrLNuGNc.js +0 -1
- package/assets/flagged-CXUG7hEi.js +0 -1
- package/assets/index-B-gorWZO.js +0 -1
- package/assets/index-BsZVtS6J.js +0 -1
- package/assets/index-CgYMdj4b.js +0 -1
- package/assets/index-Cm_p5S9S.js +0 -1
- package/assets/index-DXbMloJs.js +0 -1
- package/assets/index-DoeEkWBm.js +0 -1
- package/assets/index-Dpnd1WTE.js +0 -1
- package/assets/index-QHGSPpNt.js +0 -1
- package/assets/index-cFsRfOSD.js +0 -1
- package/assets/onboarding-CCQtdms3.js +0 -1
- package/assets/outbox-Gz6-I5eX.js +0 -1
- package/assets/settings-CW90bjLX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,
|
|
1
|
+
import{c as g,eA as T,r as h}from"./index-UydO8d8c.js";const s=e=>String(e).padStart(2,"0"),p=e=>`${e.getUTCFullYear()}-${s(e.getUTCMonth()+1)}-${s(e.getUTCDate())}`,d=e=>{const t=e<0?"-":"+",r=Math.abs(e);return`${t}${s(Math.floor(r/60))}:${s(r%60)}`};function $(e,t){const r=new Date(`${e}T${t}:00`);return`${e}T${t}:00${d(-r.getTimezoneOffset())}`}const i=new Map;function N(e){if(i.has(e))return i.get(e);let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{t=void 0}return i.set(e,t),t}function l(e,t){const r=N(e);if(!r)return Number.NaN;const a=r.formatToParts(new Date(t)),n=D=>Number(a.find(I=>I.type===D)?.value),o=n("hour")%24;return(Date.UTC(n("year"),n("month")-1,n("day"),o,n("minute"),n("second"))-t)/6e4}function S(e,t,r){if(r==="")return`${e}T${t}:00+00:00`;const a=Date.parse(`${e}T${t}:00Z`),n=l(r,a);if(Number.isNaN(n))return $(e,t);const o=l(r,a-n*6e4);return`${e}T${t}:00${d(Number.isNaN(o)?n:o)}`}function m(e,t){const r=Date.parse(e),a=l(t,r),n=Number.isNaN(a)?-new Date(r).getTimezoneOffset():a,o=new Date(r+n*6e4);return`${p(o)}T${s(o.getUTCHours())}:${s(o.getUTCMinutes())}:${s(o.getUTCSeconds())}${d(n)}`}const c=e=>$(e,"00:00");function u(e,t){const[r,a,n]=e.split("-").map(Number);return p(new Date(Date.UTC(r,a-1,n+t)))}function O(e){const[t,r,a]=e.split("-").map(Number),n=new Date(Date.UTC(t,r-1,a));return u(e,-((n.getUTCDay()+6)%7))}function b(e,t){const[r,a]=t.split("-").map(Number);if(e==="year")return[`${r}-01-01`,`${r+1}-01-01`];if(e==="month"){const o=`${r}-${s(a)}-01`,f=a===12?`${r+1}-01-01`:`${r}-${s(a+1)}-01`;return[o,f]}if(e==="day")return[t,u(t,1)];const n=O(t);return[n,u(n,7)]}function v(e,t){const[r,a]=b(e,t);return{from:c(r),to:c(a)}}function x(e,t){return{from:c(e),to:c(u(e,t))}}const U=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,C="";function L(e){if(e!==C)return e;const t=U();return Intl.supportedValuesOf("timeZone").includes(t)?t:C}const R={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},E={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},y="#";function w(e,t){return t===""?e:`${e}${y}${t}`}function M(e){const t=e.indexOf(y);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}function z(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:R[e.color]??"cal-1"}}function j(e,t,r){return{id:w(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):m(e.start,r),end:e.allDay?e.end.slice(0,10):m(e.end,r),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:"accepted",threadId:"",threadSubject:"",timeZone:t,zoneCertainty:E[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const F=e=>e.status!=="Cancelled";function B(){const{data:e,isLoading:t,error:r}=g(T());return h.useMemo(()=>{const a=e?.items??[],n=a.map(z);return{calendars:n,colorByCalendarId:Object.fromEntries(n.map(o=>[o.id,o.color])),timeZoneByCalendarId:Object.fromEntries(a.map(o=>[o.calendarId,o.timezone])),defaultCalendarId:(a.find(o=>o.source==="Default")??a[0])?.calendarId??"",isLoading:t,error:r??null}},[e,t,r])}export{C as U,x as a,u as b,w as c,U as d,v as e,L as f,S as g,m as h,F as i,M as r,j as t,B as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./index-
|
|
1
|
+
import{r as o}from"./index-UydO8d8c.js";const n=(e,t)=>{const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,i as b,
|
|
1
|
+
import{r as p,i as b,eF as I,c as C,eG as x,e0 as F,eH as D,h as y,eI as N,eJ as P,eK as L,eL as z}from"./index-UydO8d8c.js";const W=(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"},B=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"})},M=(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?"+":"-",l=Math.abs(o),c=String(Math.floor(l/60)).padStart(2,"0"),f=String(l%60).padStart(2,"0"),u=m=>String(m).padStart(2,"0");return`${s.getFullYear()}-${u(s.getMonth()+1)}-${u(s.getDate())}T${u(s.getHours())}:${u(s.getMinutes())}:${u(s.getSeconds())}${d}${c}:${f}`},h="None",G=e=>!e.literalClauses.some(t=>t.field==="HasWords"),O=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),V=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",X=({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"?M(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}:{}}),T=new Set(["Complete","Failed"]),v=e=>e!==void 0&&T.has(e),w=1e3,J=15e3,_=e=>{const t=Math.max(0,e),r=w*2**t;return Math.min(r,J)},$=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},Y=e=>{const[t,r]=p.useState(),a=b({...I(),onSuccess:g=>r(g.organizeJobId)}),{mutate:i}=a,n=C({...x({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const E=g.state.data?.state;return v(E)?!1:_(g.state.dataUpdateCount)}}),s=p.useCallback(g=>{e&&i({path:{accountId:e},body:O(g)})},[e,i]),{refetch:o}=n,d=p.useCallback(()=>{o()},[o]),l=n.data,c=a.isPending?void 0:l,f=c?.state??a.data?.state,u=v(c?.state),m={state:f,matchedCount:c?.matchedCount??0,appliedCount:c?.appliedCount??0,failedCount:c?.failedCount??0,errorMessage:c?.errorMessage??""};return{start:s,refreshStatus:d,progress:m,isStarting:a.isPending,isRunning:!!t&&!u,isDone:u,failure:$(a.error,n.error,!!l)}},Z=["From","Subject","HasWords","ListId","FromDomain"],k=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},ee=(e,t)=>e==="ListId"?k(t):t.trim(),R=e=>e==="all"?"And":"Or",U=(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:R(e.matchOperator),literalClauses:a}},H=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}`)}),te=(e,t)=>{const r=U(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?M(e.until??""):void 0}},j=(e,t)=>{if(e.error!==void 0&&e.errorSignature===t)return{status:"error",reason:e.error};if(e.count===void 0)return{status:"loading"};const r=e.indexEmpty===!0?{indexEmpty:!0}:{};return e.previewedSignature===t?{status:"ready",count:e.count,...r}:{status:"ready",count:e.count,stale:!0,...r}},q=350,re=(e,t,r)=>{const a=b(F()),{mutateAsync:i}=a,n=Q(t),[s,o]=p.useState(()=>({})),d=p.useRef(t);d.current=t;const l=p.useRef(n),c=H(t);return p.useEffect(()=>{if(!e||!c||n===s.previewedSignature||n===s.errorSignature)return;const f=setTimeout(()=>{const u=n;l.current=u,i({path:{accountId:e},body:O({...d.current})}).then(m=>{l.current===u&&o({count:m.matchedCount,matchedIds:m.messageIds,indexEmpty:m.semanticIndexEmpty===!0,previewedSignature:u})}).catch(m=>{l.current===u&&o(g=>({...g,error:m instanceof Error?m.message:"Couldn't count matches.",errorSignature:u}))})},q);return()=>clearTimeout(f)},[e,c,n,s.previewedSignature,s.errorSignature,i]),c?{count:j(s,n),matchedIds:s.previewedSignature===n?s.matchedIds??[]:[]}:{count:{status:"error",reason:D},matchedIds:[]}},A=e=>P({path:{accountId:e}}),se=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}},ae=e=>{const t=y(),r=b({...N(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a,mutateAsync:i}=r,n=p.useCallback((o,d,l)=>{e&&a({path:{accountId:e},body:S(o,d,l)})},[e,a]),s=p.useCallback(async(o,d,l)=>e?i({path:{accountId:e},body:S(o,d,l)}).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}},ne=e=>{const t=y(),r=b({...z(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a}=r;return{deleteFilter:p.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,Z as S,Y as a,A as b,te as c,B as d,se as e,W as f,ne as g,O as h,ae as i,X as j,G as k,ee as n,V as o,M as p,U as r,re as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,
|
|
1
|
+
import{c as p,ep as L,h as n,i as l,eq as d,r as o,er as y,es as c,et as g}from"./index-UydO8d8c.js";const u=e=>y({path:{accountId:e}}),f=e=>{const r=p({...L({path:{accountId:e??""}}),enabled:!!e});return{labels:r.data?.items??[],isPending:r.isPending,isError:r.isError,error:r.error,refetch:r.refetch}},h=e=>{const r=n(),t=l({...d(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:s}=t;return{createLabel:o.useCallback((a,i="Default")=>e?s({path:{accountId:e},body:{name:a,color:i}}):Promise.reject(new Error("No account")),[e,s]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},m=e=>{const r=n(),t=l({...c(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{updateLabel:o.useCallback((a,i)=>{e&&s({path:{accountId:e,labelId:a},body:i})},[e,s]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},C=e=>{const r=n(),t=l({...g(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{deleteLabel:o.useCallback(a=>{e&&s({path:{accountId:e,labelId:a}})},[e,s]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{f as a,m as b,C as c,h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c1 as s,c2 as e}from"./index-UydO8d8c.js";const i=768,r=t=>t!=="desktop",a=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{r as i,a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,u as S,
|
|
1
|
+
import{r as c,u as S,cn as O,co as N,a9 as h,cp as B,q as P,ab as U,h as $,c as D,cM as F,cN as v}from"./index-UydO8d8c.js";const R="/mail/brief/compose/{-$outboxMessageId}",w="/mail/flagged/compose/{-$outboxMessageId}",E="/mail/outbox/compose/{-$outboxMessageId}",k="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=h({from:R,shouldThrow:!1}),t=h({from:w,shouldThrow:!1}),r=h({from:E,shouldThrow:!1}),s=h({from:k,shouldThrow:!1});return e??t??r??s}function Y(){return T()!==void 0}function j(){return T()?.outboxMessageId}function L(e,t,r){return e==="flagged"?{to:w,params:{outboxMessageId:r}}:e==="outbox"?{to:E,params:{outboxMessageId:r}}:e==="mailbox"&&t?{to:k,params:{mailboxId:t,outboxMessageId:r}}:{to:R,params:{outboxMessageId:r}}}function g(){const e=S(),t=O(),{list:r,mailboxId:s}=N();return c.useCallback((n,o)=>{e({...L(r,s,n),search:a=>a,hash:o?.keepPanels?!0:t,replace:o?.replace??!1})},[e,t,r,s])}function J(){const e=g();return c.useCallback(()=>e(void 0),[e])}function V(){const e=g();return c.useCallback(t=>e(t),[e])}function Z(){const e=g();return c.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function ee(){return B()}const _=e=>{const t=e.filter(n=>!n.isMultipart&&n.disposition!=="attachment"&&n.mediaType==="TEXT"&&n.contentUrl.length>0),r=t.find(n=>n.mediaSubtype.toUpperCase()==="HTML");if(r)return{kind:"html",contentUrl:r.contentUrl};const s=t.find(n=>n.mediaSubtype.toUpperCase()==="PLAIN");return s?{kind:"text",contentUrl:s.contentUrl}:null},b={all:["messages"],detail:e=>[...b.all,"detail",e],body:e=>[...b.detail(e),"body"]};class f extends Error{reason;status;retryAfterSeconds;constructor(t,r,s,n){super(r),this.name="BodyFetchError",this.reason=t,this.status=s,this.retryAfterSeconds=n}}const q=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},K=8,Q="x-remit-403-reason",I=(e,t)=>{const r=t?.trim()??"";return e===401?"auth":e===403?r.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},X=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,G=(e,t)=>{const r=(t??"").toLowerCase();return!!(e==="text"&&r.startsWith("text/html"))},H=async(e,t,r=async()=>null)=>{const s={},n=await r();n&&(s.Authorization=`Bearer ${n}`);const o=await v(e,{headers:s});if(o.status===202)throw new f("not-ready","Message body is still syncing",202,q(o.headers.get("Retry-After")));if(!o.ok){const l=o.headers.get(Q),y=I(o.status,l);throw new f(y,`Failed to load message body (${o.status} ${o.statusText})`,o.status)}const a=o.headers.get("content-type");if(G(t,a))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${a}`);const m=await o.text();if(X(m,a))throw new f("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return m},W=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),te=({messageId:e,bodyParts:t,enabled:r=!0})=>{const s=t?_(t):null,n=P(),{getToken:o}=U(),a=c.useRef(null),m=$(),l=c.useRef(!1),y=c.useRef(null),C=e&&s?`${e}:${s.contentUrl}`:null;y.current!==C&&(y.current=C,l.current=!1);const i=D({queryKey:e?[...b.body(e),s?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!s)throw new Error("No renderable body part");if(!e)throw new Error("No messageId");const d=l.current;return l.current=!1,W({fetchContent:(u,M)=>H(u,M,o),refetchDescribeMessage:()=>m.refetchQueries({queryKey:F({path:{messageId:e}})})},{contentUrl:s.contentUrl,kind:s.kind,isRetryAfterNotReady:d})},enabled:r&&!!e&&!!s,staleTime:300*1e3,gcTime:1800*1e3,retry:(d,u)=>u instanceof f&&u.reason==="not-ready"?d<K:d<1,retryDelay:(d,u)=>u instanceof f&&u.reason==="not-ready"?(l.current=!0,(u.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),p=i.isLoading&&!!s,x=t!==void 0&&s===null;c.useEffect(()=>{p&&(a.current=performance.now())},[p]),c.useEffect(()=>{i.isSuccess&&a.current!==null&&(n.recordTiming("message.body.load",Math.round(performance.now()-a.current)),a.current=null)},[i.isSuccess,n]);const A=i.data&&s?{kind:s.kind,body:i.data}:void 0;return{picked:s,data:A,isLoading:p,hasNoRenderablePart:x,isError:i.isError,error:i.error,refetch:i.refetch}};export{f as B,Y as a,te as b,j as c,Z as d,ee as e,V as f,I as g,J as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c3 as Q,c4 as y,c5 as S,c6 as w,c7 as C,h as k,c8 as q,c9 as x,r as p,ca as M,cb as H,cc as L,cd as P,ce as O,cf as B,cg as A}from"./index-UydO8d8c.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function T(r,e,s){const t=r.slice(0);return t[e]=s,t}var z=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#c=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#d(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,a=i.some((o,d)=>o!==s[d]),f=u||a,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#c=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#a(t,s)]}#a(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=T(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const r=this.#a(this.#e,this.#c),e=this.#b(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function U({queries:r,...e},s){const t=k(),i=q(),n=x(),u=p.useMemo(()=>r.map(h=>{const c=t.defaultQueryOptions(h);return c._optimisticResults=i?"isRestoring":"optimistic",c}),[r,t,i]);u.forEach(h=>{M(h);const c=t.getQueryCache().get(h.queryHash);H(h,n,c)}),L(n);const[a]=p.useState(()=>new z(t,u,e)),[f,b,o]=a.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?a.subscribe(y.batchCalls(h)):P,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(u,e)},[u,e,a]);const m=f.some((h,c)=>O(u[c],h))?f.flatMap((h,c)=>{const l=u[c];if(l&&O(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=f.find((h,c)=>{const l=u[c];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as E,a0 as K,t as Q,f as U,r as o,
|
|
1
|
+
import{j as E,a0 as K,t as Q,f as U,r as o,aT as R,h as N,C as $,E as z,F as B,q as G,P as I,Q as X,R as V,S as J}from"./index-UydO8d8c.js";import{C as Y}from"./circle-check-big-DrhQmTbc.js";import{R as Z}from"./refresh-cw-Qp6f0dRu.js";import{u as P}from"./useQueries-CJUjXxvq.js";function ye({state:e,onRefresh:s,label:t,errorMessage:n,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",r=e==="error",h=e==="success",S=r?E.jsx(K,{className:"size-4 text-danger"}):h?E.jsx(Y,{className:"size-4 text-positive"}):E.jsx(Z,{className:Q("size-4",i&&"animate-spin")}),w=r?`${t} — failed: ${n??"try again"}`:i?`${t} — refreshing`:h?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(U,{variant:"ghost",size:u,icon:S,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:r?n:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const ee=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function L(e){return!!e&&ee.has(e)}const F=3e3,te=F*2,C={syncing:!1,resolved:!1,synced:0,total:0};function we(e,s){const t=e.join(","),[n,a]=o.useState(!1),[u,c]=o.useState(!1);o.useEffect(()=>{a(!1),c(!1)},[t,s]),o.useEffect(()=>{if(!s)return;const m=setTimeout(()=>c(!0),te);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!n,refetchInterval:F,meta:{softError:!0}}))}),r=i.every(m=>m.isSuccess||m.isError),h=i.length===0||r||u;let S=!1,w=0,y=0;for(const m of i)if(L(m.data?.syncPhase)){S=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,y+=l.messagesTotal}const x=s&&h&&!S;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?C:{syncing:S,resolved:!0,synced:w,total:y}}const se=180*1e3,xe=30*1e3;let q=0;const M=new Set,re=(e=Date.now())=>{q=e+se;for(const s of M)s()},pe=(e=Date.now())=>e<q,Ee=e=>(M.add(e),()=>{M.delete(e)}),T=6e4,ne=new Set(["sent","drafts","trash","archive"]),_=(e,s)=>{const t=new Map;for(const n of e){const a=s.get(n.mailboxId)?.role;a&&ne.has(a)||t.set(n.mailboxId,n.highWaterMarkUid)}return t},j=(e,s)=>{const t=[];for(const[n,a]of s)a>(e.get(n)??0)&&t.push(n);return t},oe=(e,s)=>j(e,s).length>0,D=o.createContext(null),ae=()=>{const e=o.useContext(D);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function be({accountIds:e,children:s}){const t=N(),{resultFolderIndex:n}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,r]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:T,staleTime:T,meta:{softError:!0}}))}),S=h.map(l=>l.dataUpdatedAt).join(","),w=e.join(",");o.useEffect(()=>{let l=!1;const f=new Set(i);e.forEach((d,p)=>{const b=h[p]?.data;if(!b)return;const g=_(b.mailboxes??[],n),v=c.current.get(d);if(c.current.set(d,g),v){const A=j(v,g);A.length>0&&z(t,B(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const W=a.current.get(d)??new Map;oe(W,g)&&(f.add(d),l=!0)}),l&&r(f)},[w,S]);const y=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{r(f=>{if(l.every(p=>!f.has(p)))return f;const d=new Set(f);for(const p of l)d.delete(p);return d});for(const f of l){const d=t.getQueryData(R({path:{accountId:f}}).queryKey);a.current.set(f,_(d?.mailboxes??[],n)),u.current.add(f)}},[t,n]),m=o.useMemo(()=>({hasNewMail:y,acknowledge:x}),[y,x]);return E.jsx(D.Provider,{value:m,children:s})}const ie=2e3,ce=45e3,ue=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",le=e=>{V(e,{softError:!0},"user")&&J(e)},O=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,fe=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:n=0,onInboxSynced:a,deadline:u,pollMs:c=ie})=>{let i=!1;for(;;){const r=await s().then(y=>({ok:!0,data:y})).catch(y=>({ok:!1,error:y}));if(!r.ok)return{accountId:e,message:k(r.error)};const{syncPhase:h,lastSyncAt:S}=r.data;if((S??0)>t&&!L(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(r.data)>n&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ue(c)}},de=async(e,s,t,n,a)=>{const u=await O(e,t).then(r=>({ok:!0,lastSyncAt:r.lastSyncAt??0,inboxSyncedAt:H(r)})).catch(r=>({ok:!1,error:r}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:k(u.error)};const c=await I({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(r=>({ok:!1,error:r}));if(!c.ok)return le(c.error),{accountId:t,enqueued:!1,ok:!1,message:k(c.error)};s.recordEvent("sync.triggered");const i=await fe({accountId:t,readStatus:()=>O(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:n});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},Re=(e,s={})=>{const t=N(),n=G(),{acknowledge:a}=ae(),[u,c]=o.useState("idle"),[i,r]=o.useState(),h=o.useRef(0),S=o.useRef(e);S.current=e;const w=o.useRef(s);w.current=s,o.useEffect(()=>{if(u!=="success")return;const x=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(x)},[u]);const y=o.useCallback(()=>{const x=S.current;if(x.length===0){c("error"),r("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),r(void 0),re();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:X({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ce,d=await Promise.all(x.map(g=>de(t,n,g,f,l)));if(h.current!==m)return;const p=d.filter(g=>g.enqueued).map(g=>g.accountId);for(const g of p)l(g);p.length>0&&a(p);const b=d.filter(g=>!g.ok);b.length===0?c("success"):(c("error"),r(b[0]?.message))})()},[a,t,n]);return{state:u,errorMessage:i,refresh:y}};export{xe as H,be as M,ye as R,Re as a,L as b,we as c,pe as i,Ee as s,ae as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as r,r as s,
|
|
1
|
+
import{K as r,r as s,b7 as t}from"./index-UydO8d8c.js";import{u as m}from"./useQueries-CJUjXxvq.js";const a=i=>({items:i.map(e=>e.data?.items??[]),isPending:i.some(e=>e.isPending),error:i.find(e=>e.error)?.error??null});function u(i){const e=m({queries:i.map(o=>({...r({path:{accountId:o.accountId}}),staleTime:1/0})),combine:a});return{index:s.useMemo(()=>t(i.map((o,n)=>({folderAppointments:o.folderAppointments,mailboxes:e.items[n]??[]}))),[i,e]),isPending:e.isPending,error:e.error}}export{u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as h,j as a,
|
|
1
|
+
import{r as h,j as a,cu as Y,t as b,I as X,h as Z,at as J,i as ee,av as te,cM as se,bS as re,ab as ne,a0 as ae,X as oe,d5 as _,d6 as I,C as ie,co as ce}from"./index-UydO8d8c.js";import{K as A}from"./kbd-Dr4usi4j.js";import{B as le,b as de}from"./useMessageBodyContent-DiiU1g37.js";import{i as ue}from"./search-scope-B5-OK3Cq.js";const me='"Geist Variable", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',k={light:{fg:"oklch(0.3 0.025 235)",canvas:"oklch(0.96 0.015 90)",accent:"oklch(0.55 0.14 150)"},dark:{fg:"oklch(0.88 0.02 90)",canvas:"oklch(0.22 0.025 220)",accent:"oklch(0.78 0.16 150)"}},fe={background:!1,spacing:!1},he="16px",ge=()=>`html{padding:0}body{padding:${he};box-sizing:border-box}`,pe=()=>"html{overflow:hidden}body{overflow-x:auto}",be=/prefers-color-scheme\s*:\s*dark|color-scheme\s*:\s*[^;}"']*\bdark\b/i,ye='<meta name="viewport" content="width=device-width, initial-scale=1">',xe=e=>{const t=e?k.dark:k.light;return`
|
|
2
2
|
/* Plain-email base: UI font-stack + theme-aware colors (#424) */
|
|
3
3
|
html, body {
|
|
4
4
|
font-family: ${me};
|
|
@@ -74,11 +74,11 @@ pre, code {
|
|
|
74
74
|
:is(pre, code, pre *, code *):is([nowrap], [style*="nowrap" i]) {
|
|
75
75
|
white-space: pre-wrap !important;
|
|
76
76
|
}
|
|
77
|
-
`,je=e=>{const t=new Map;for(const s of e){if(!s.contentId||s.contentUrl.length===0)continue;const r=s.contentId.replace(/^<|>$/g,"");t.set(r,s.contentUrl)}return s=>t.get(s.replace(/^<|>$/g,""))},Le=/^(none|transparent|inherit|initial|unset)\s*$/i,$=e=>{const t=[],s=/<style[^>]*>([\s\S]*?)<\/style>/gi;let r;for(r=s.exec(e);r!==null;)t.push(r[1]),r=s.exec(e);return t},Re=e=>{const t=/background(?:-color)?\s*:\s*([^;}\n]+)/gi;let s;for(s=t.exec(e);s!==null;){const r=s[1].trim();if(!Le.test(r))return!0;s=t.exec(e)}return!1},_e=e=>{if(/\bstyle\s*=\s*["'][^"']*background/i.test(e)||/\bbgcolor\s*=/i.test(e))return!0;for(const t of $(e))if(Re(t))return!0;return!1},Ie=new Set(["auto","none","initial","inherit","unset","revert","revert-layer"]),$e=new RegExp(`(?<![-\\w])(?:padding|margin)(?:-(top|right|bottom|left|block|inline)(?:-(?:start|end))?)?\\s*:\\s*([^;}"']+)`,"gi"),Be=new Set(["top","bottom","block"]),B=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),T=e=>{const t=e.toLowerCase();if(!t||Ie.has(t)||t.startsWith("-"))return!1;const s=/^\+?(\d*\.?\d+)[a-z%]*$/.exec(t);return s?Number.parseFloat(s[1])!==0:!0},
|
|
77
|
+
`,je=e=>{const t=new Map;for(const s of e){if(!s.contentId||s.contentUrl.length===0)continue;const r=s.contentId.replace(/^<|>$/g,"");t.set(r,s.contentUrl)}return s=>t.get(s.replace(/^<|>$/g,""))},Le=/^(none|transparent|inherit|initial|unset)\s*$/i,$=e=>{const t=[],s=/<style[^>]*>([\s\S]*?)<\/style>/gi;let r;for(r=s.exec(e);r!==null;)t.push(r[1]),r=s.exec(e);return t},Re=e=>{const t=/background(?:-color)?\s*:\s*([^;}\n]+)/gi;let s;for(s=t.exec(e);s!==null;){const r=s[1].trim();if(!Le.test(r))return!0;s=t.exec(e)}return!1},_e=e=>{if(/\bstyle\s*=\s*["'][^"']*background/i.test(e)||/\bbgcolor\s*=/i.test(e))return!0;for(const t of $(e))if(Re(t))return!0;return!1},Ie=new Set(["auto","none","initial","inherit","unset","revert","revert-layer"]),$e=new RegExp(`(?<![-\\w])(?:padding|margin)(?:-(top|right|bottom|left|block|inline)(?:-(?:start|end))?)?\\s*:\\s*([^;}"']+)`,"gi"),Be=new Set(["top","bottom","block"]),B=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),T=e=>{const t=e.toLowerCase();if(!t||Ie.has(t)||t.startsWith("-"))return!1;const s=/^\+?(\d*\.?\d+)[a-z%]*$/.exec(t);return s?Number.parseFloat(s[1])!==0:!0},Me=e=>{const t=e.split(/\s+/).filter(Boolean);return t.length<2?t:t.length<4?[t[1]]:[t[1],t[3]]},Oe=(e,t)=>{if(e&&Be.has(e))return!1;const s=t.replace(/!\s*important/gi,"").trim();return s?e?s.split(/\s+/).some(T):Me(s).some(T):!1},j=e=>{for(const t of B(e).matchAll($e))if(Oe(t[1],t[2]))return!0;return!1},M=new Set(["blockquote"]),De=e=>e.replace(/<!--[\s\S]*?-->/g,""),ze=e=>{const t=[],s=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,r=/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;for(const[,n,o]of e.matchAll(s))for(const d of o.matchAll(r))t.push({tag:n.toLowerCase(),style:d[1]??d[2]??""});return t},Pe=e=>[...B(e).matchAll(/([^{}]*)\{([^{}]*)\}/g)].map(t=>({selector:t[1].trim(),body:t[2]})),Ke=e=>{const t=e.trim().split(/[\s>+~]+/).pop()??"";return(/^[a-zA-Z][\w-]*/.exec(t)?.[0]??"").toLowerCase()},Fe=e=>e.split(",").every(t=>M.has(Ke(t))),He=e=>{const t=$(e),s=De(e);if(/\bcellpadding\s*=\s*["']?(?!0["'\s>])\d/i.test(s))return!0;for(const{tag:r,style:n}of ze(s))if(!M.has(r)&&j(n))return!0;for(const r of t)for(const n of Pe(r))if(!Fe(n.selector)&&j(n.body))return!0;return!1},Ge=["script","iframe","object","embed","form","input","button","textarea","select","meta","link","base"],Ue=["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur","onsubmit","onkeydown","onkeyup","formaction","xlink:href","data-bind"],We="data:image/svg+xml,"+encodeURIComponent(`
|
|
78
78
|
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
|
|
79
79
|
<rect fill="#f0f0f0" width="100" height="100"/>
|
|
80
80
|
<text x="50" y="50" text-anchor="middle" dy=".3em" fill="#999" font-size="12">
|
|
81
81
|
Image blocked
|
|
82
82
|
</text>
|
|
83
83
|
</svg>
|
|
84
|
-
`),Ve=e=>e.replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Qe=e=>e.replace(/@import[^;]*;/gi,"/* @import blocked */").replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),qe=(e={})=>{const t=Y(),s={FORBID_TAGS:Ge,FORBID_ATTR:Ue,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1};return t.addHook("afterSanitizeAttributes",r=>{if(e.allowExternalImages||(r.tagName==="IMG"&&r.removeAttribute("srcset"),r.tagName==="SOURCE"&&(r.removeAttribute("srcset"),r.removeAttribute("src")),r.tagName==="VIDEO"&&r.removeAttribute("poster")),r.tagName==="IMG"){const n=r.getAttribute("src")||"";if(n.startsWith("data:"))return;if(n.startsWith("cid:")){const d=n.slice(4).replace(/^<|>$/g,""),g=e.resolveCid?.(d);g&&(r.setAttribute("src",g),r.classList.add("inline-content"));return}e.allowExternalImages||(r.setAttribute("data-blocked-src",n),r.setAttribute("src",We),r.setAttribute("alt","[Blocked image]"),r.classList.add("blocked-image"))}if(r.tagName==="A"){const n=r.getAttribute("href")||"";if(/^(javascript|data):/i.test(n)){r.removeAttribute("href");return}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer nofollow"),r.classList.add("external-link")}if(r.hasAttribute("style")){const n=r.getAttribute("style")||"";r.setAttribute("style",Ve(n))}}),t.addHook("uponSanitizeElement",(r,n)=>{if(n.tagName==="style"){const o=r.textContent||"";r.textContent=Qe(o)}}),r=>{const n=_e(r),o=He(r),d=t.sanitize(r,s);return{html:`<style>${Te()}</style>${d}`,hasAuthorBackground:n,hasAuthorSpacing:o}}},L=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Et=({className:e,children:t})=>a.jsx("div",{className:b("[&_.message-body-frame]:-mx-2 lg:[&_.message-body-frame]:-mx-4",e),children:t}),Ye=({html:e,text:t,isDark:s=!1,category:r,allowImages:n=!1,resolveCid:o,className:d,renderBlockedNotice:g})=>{const i=h.useMemo(()=>!e||typeof document>"u"?null:qe({allowExternalImages:n,resolveCid:o})(e),[e,n,o]),c=i?.html??null,{framed:u,isPlain:m}=Ce(r,i?.hasAuthorBackground??!1),f=h.useMemo(()=>({background:i?.hasAuthorBackground??!1,spacing:i?.hasAuthorSpacing??!1}),[i?.hasAuthorBackground,i?.hasAuthorSpacing]),p=h.useMemo(()=>!c||n?0:(c.match(/data-blocked-src/g)||[]).length,[c,n]);return!c&&!t?a.jsx("div",{className:b("message-body",d),children:a.jsx(L,{})}):a.jsxs("div",{className:b("message-body",d),children:[p>0&&a.jsx("div",{children:g?.(p)}),c?a.jsx("div",{className:"message-body-frame",children:u?a.jsx("div",{className:"w-full max-w-full",children:a.jsx(C,{html:c,variant:"framed",isDark:s,declares:f})}):a.jsx("div",{className:"max-w-full lg:max-w-2xl",children:a.jsx(C,{html:c,variant:m?"plain":"framed",isDark:s,declares:f})})}):t?a.jsx("pre",{className:"email-text whitespace-pre-wrap text-sm leading-relaxed",children:t}):a.jsx(L,{})]})};function Nt({message:e="Select a thread to read",icon:t,showHints:s=!0,className:r}){return a.jsxs("div",{className:b("flex flex-1 flex-col items-center justify-center text-center",r),children:[t??a.jsx(X,{className:"size-10 text-fg-subtle"}),a.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:e}),s&&a.jsxs("p",{className:"text-2xs text-fg-subtle",children:[a.jsx(A,{children:"j"})," / ",a.jsx(A,{children:"k"})," to move, ",a.jsx(A,{children:"Enter"})," to open"]})]})}function M(e){const t=[];let s=-1,r=!1;for(let n=0;n<e.length;n++){const o=e[n];if(o==='"'){r=!r,s<0&&(s=n);continue}if(!r&&/\s/.test(o)){s>=0&&t.push({raw:e.slice(s,n),start:s,end:n}),s=-1;continue}s<0&&(s=n)}return s>=0&&t.push({raw:e.slice(s),start:s,end:e.length}),t}const Xe=e=>{if(!e.startsWith('"'))return e;const t=e.slice(1);return t.endsWith('"')?t.slice(0,-1):t};function Ze(e){const t=e.indexOf(":");if(t<=0)return;const s=e.slice(t+1);return{name:e.slice(0,t).toLowerCase(),value:Xe(s),rawValue:s}}const Je=e=>/[\s"]/.test(e),et=e=>Je(e)?`"${e.replace(/"/g,"")}"`:e,Ct=(e,t)=>`${e}:${et(t)}`,D=(e,t=Date.now())=>({value:e,setAt:t}),tt=(e,t,s,r)=>{if(e.addressId!==t)return e;const n={...e.flags??{}};return s?n.trusted=D(!0,r):delete n.trusted,{...e,flags:n}},st=(e,t,s,r)=>{const n=o=>o.map(d=>tt(d,t,s,r));return{...e,envelope:{...e.envelope,from:n(e.envelope.from),to:n(e.envelope.to),cc:n(e.envelope.cc),bcc:n(e.envelope.bcc),replyTo:n(e.envelope.replyTo)}}},rt=({messageId:e})=>{const t=Z(),{pushError:s}=J(),{mutate:r,isPending:n,error:o,reset:d}=ee({...re(),onMutate:async i=>{const c=i.path.addressId,m=i.body.flags?.trusted?.value===!0,f=se({path:{messageId:e}});await t.cancelQueries({queryKey:f});const p=t.getQueriesData({queryKey:f}).filter(l=>l[1]!==void 0).map(([l,x])=>({queryKey:l,data:x}));return t.setQueriesData({queryKey:f},l=>l&&st(l,c,m)),{describePrefix:f,previous:p}},onError:(i,c,u)=>{if(u)for(const m of u.previous)t.setQueryData(m.queryKey,m.data);s(te("Couldn't trust sender","The change wasn't saved.",i))},onSettled:(i,c,u,m)=>{m&&t.invalidateQueries({queryKey:m.describePrefix})}});return{toggleTrusted:(i,c)=>{r({path:{addressId:i},body:{flags:{trusted:D(!c)}}})},isPending:n,error:o,reset:d}},nt=()=>{const[e,t]=h.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return h.useEffect(()=>{const s=document.documentElement,r=new MutationObserver(()=>{t(s.classList.contains("dark"))});return r.observe(s,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e},at=(e,t)=>{const s=`${e} image${e>1?"s":""}`;return t?`${s} hidden — you blocked this sender`:`${s} blocked for privacy`},ot=({blockedImageCount:e,canAlwaysTrust:t,isTrustPending:s,isSenderBlocked:r,onLoadOnce:n,onAlwaysTrust:o})=>a.jsxs("div",{"data-testid":"blocked-images-notice",className:"mb-3 flex items-center justify-between rounded-md bg-surface-sunken/50 px-3 py-2 text-sm",children:[a.jsx("span",{className:"text-fg-muted",children:at(e,r)}),!r&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:n,className:"text-accent hover:underline",children:"Load once"}),t&&a.jsx("button",{type:"button",onClick:o,"aria-busy":s,className:"text-accent hover:underline aria-busy:opacity-50",children:s?"Trusting…":"Always trust"})]})]}),it=(e,t)=>{switch(e){case"auth":return{title:"Your session expired",detail:"Sign in again to reload the message body. Other parts of the app may also stop responding until you do."};case"body-missing":return{title:"Message body is missing in storage",detail:"A sync failure may have left this message without its body bytes. Contact support, or run the reconcile script to refetch from the upstream IMAP server."};case"content-type-mismatch":return{title:"Couldn't load message body",detail:"The server returned an unexpected content type for this part. The message body has not been rendered to keep you safe."};case"spa-shell-leak":return{title:"Couldn't load message body",detail:"The server returned the app shell instead of the message body. This is an infrastructure bug — please report it."};case"not-ready":return{title:"Message body is still syncing",detail:"This message's body hasn't finished downloading from the mail server yet. It should appear shortly — reopen the message to try again."};default:return{title:"Couldn't load message body",detail:t}}},ct=e=>e instanceof le?e.reason:"generic",lt=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while loading the message body.",dt=({error:e,onRetry:t})=>{const s=ct(e),r=lt(e),{title:n,detail:o}=it(s,r),[d,g]=h.useState(!1),{Account:i}=ne();return d?null:a.jsxs("div",{role:"alert","data-testid":"message-body-error-banner","data-reason":s,className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[a.jsx(ae,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-danger",children:n}),a.jsx("p",{className:"text-fg-muted mt-1 break-words",children:o})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s==="auth"&&a.jsx(i,{children:({signOut:c})=>a.jsx("button",{type:"button",onClick:()=>c(),className:"text-sm font-medium text-accent hover:underline",children:"Sign in again"})}),t&&a.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-accent hover:underline",children:"Retry"}),a.jsx("button",{type:"button",onClick:()=>g(!0),"aria-label":"Dismiss message body error",className:"rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors",children:a.jsx(oe,{className:"size-4","aria-hidden":"true"})})]})]})},ut=()=>a.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading message body",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"})]}),R=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Tt=({bodyParts:e,html:t,text:s,isTrusted:r=!1,isBlocked:n=!1,messageId:o,fromAddressId:d,category:g,className:i})=>{const[c,u]=h.useState(!1),[m,f]=h.useState(o);m!==o&&(f(o),u(!1));const p=!n&&(r||c),l=nt(),{toggleTrusted:x,isPending:w}=rt({messageId:o??""}),y=!!e&&e.length>0,{picked:z,data:v,isLoading:P,isError:K,error:F,refetch:H}=de({messageId:o,bodyParts:e,enabled:y}),G=h.useMemo(()=>je(e??[]),[e]),U=y&&v?.kind==="html"?v.body:t,W=y&&v?.kind==="text"?v.body:s;if(y){if(P)return a.jsx("div",{className:b("message-body",i),children:a.jsx(ut,{})});if(K)return a.jsx("div",{className:b("message-body",i),children:a.jsx(dt,{error:F,onRetry:()=>H()})});if(!z)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})})}else if(!t&&!s)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})});const V=!!(d&&o),Q=()=>{!d||w||(u(!0),x(d,!1))};return a.jsx(Ye,{className:i,html:U,text:W,isDark:l,category:g,allowImages:p,resolveCid:G,renderBlockedNotice:q=>a.jsx(ot,{blockedImageCount:q,canAlwaysTrust:V,isTrustPending:w,isSenderBlocked:n,onLoadOnce:()=>u(!0),onAlwaysTrust:Q})})},mt=Object.values(_).map(e=>({value:e,label:I[e]})),ft={unclassified:"uncategorized"},ht=[{name:"from",label:"Sender",values:"contact"},{name:"subject",label:"Subject",values:"text"},{name:"category",label:"Category",values:"fixed",options:mt},{name:"is",label:"State",values:"fixed",options:[{value:"unread",label:"Unread"},{value:"read",label:"Read"},{value:"starred",label:"Starred"}]},{name:"has",label:"Contents",values:"fixed",options:[{value:"attachment",label:"Has attachment"}]},{name:"in",label:"Folder",values:"mailbox"},{name:"account",label:"Account",values:"account"},{name:"after",label:"Sent on or after",values:"date"},{name:"before",label:"Sent before",values:"date"}],gt=new Map(ht.map(e=>[e.name,e])),jt=e=>gt.get(e.toLowerCase()),pt=/^\d{4}-\d{2}-\d{2}$/;function bt(e,t,s){if(!pt.test(s))return;const r=Date.parse(`${s}T00:00:00Z`);if(!Number.isNaN(r))return{type:e,raw:t,value:s,epochSeconds:Math.floor(r/1e3)}}function yt(e){const t=e.toLowerCase(),s=ft[t];return s||Object.values(_).find(n=>n===t)}function xt(e,t){switch(t.toLowerCase()){case"unread":return{type:"isUnread",raw:e};case"read":return{type:"isRead",raw:e};case"starred":case"flagged":return{type:"isStarred",raw:e};default:return}}function wt(e,t){const s=Ze(e);if(!s||s.value.length===0)return;const{name:r,value:n}=s;switch(r){case"from":return{type:"from",raw:e,value:n};case"subject":return{type:"subject",raw:e,value:n};case"category":{const o=yt(n);return o?{type:"category",raw:e,value:n,category:o}:void 0}case"is":return xt(e,n);case"has":return n.toLowerCase()==="attachment"?{type:"hasAttachment",raw:e}:void 0;case"before":case"after":return bt(r,e,n);case"in":{const o=t.mailboxesByName?.get(n.toLowerCase());return o?{type:"in",raw:e,value:n,mailboxId:o}:void 0}case"account":{const o=t.accountsByName?.get(n.toLowerCase());return o?{type:"account",raw:e,value:n,accountId:o}:void 0}default:return}}function Lt(e,t={}){const s=[],r=[];for(const n of M(e)){const o=wt(n.raw,t);o?s.push(o):r.push(n.raw)}return{freeText:r.join(" "),tokens:s}}function Rt(e,t){return M(e).filter(s=>s.raw!==t.raw).map(s=>s.raw).join(" ")}function _t(e){switch(e.type){case"from":return`From: ${e.value}`;case"subject":return`Subject: ${e.value}`;case"category":return`Category: ${I[e.category]}`;case"hasAttachment":return"Has attachment";case"isUnread":return"Unread";case"isRead":return"Read";case"isStarred":return"Starred";case"before":return`Before ${e.value}`;case"after":return`After ${e.value}`;case"in":return`In: ${e.value}`;case"account":return`Account: ${e.value}`}}function It(){const{mailboxNameIndex:e,accountNameIndex:t}=ie(),s=ce();return{...ue(s)?{}:{mailboxesByName:e},accountsByName:t}}export{Et as M,Nt as R,ht as S,Ye as a,rt as b,Tt as c,jt as d,M as e,Ze as f,Ct as g,Lt as p,Rt as r,_t as s,It as u};
|
|
84
|
+
`),Ve=e=>e.replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Qe=e=>e.replace(/@import[^;]*;/gi,"/* @import blocked */").replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),qe=(e={})=>{const t=Y(),s={FORBID_TAGS:Ge,FORBID_ATTR:Ue,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1};return t.addHook("afterSanitizeAttributes",r=>{if(e.allowExternalImages||(r.tagName==="IMG"&&r.removeAttribute("srcset"),r.tagName==="SOURCE"&&(r.removeAttribute("srcset"),r.removeAttribute("src")),r.tagName==="VIDEO"&&r.removeAttribute("poster")),r.tagName==="IMG"){const n=r.getAttribute("src")||"";if(n.startsWith("data:"))return;if(n.startsWith("cid:")){const d=n.slice(4).replace(/^<|>$/g,""),g=e.resolveCid?.(d);g&&(r.setAttribute("src",g),r.classList.add("inline-content"));return}e.allowExternalImages||(r.setAttribute("data-blocked-src",n),r.setAttribute("src",We),r.setAttribute("alt","[Blocked image]"),r.classList.add("blocked-image"))}if(r.tagName==="A"){const n=r.getAttribute("href")||"";if(/^(javascript|data):/i.test(n)){r.removeAttribute("href");return}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer nofollow"),r.classList.add("external-link")}if(r.hasAttribute("style")){const n=r.getAttribute("style")||"";r.setAttribute("style",Ve(n))}}),t.addHook("uponSanitizeElement",(r,n)=>{if(n.tagName==="style"){const o=r.textContent||"";r.textContent=Qe(o)}}),r=>{const n=_e(r),o=He(r),d=t.sanitize(r,s);return{html:`<style>${Te()}</style>${d}`,hasAuthorBackground:n,hasAuthorSpacing:o}}},L=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Et=({className:e,children:t})=>a.jsx("div",{className:b("[&_.message-body-frame]:-mx-2 lg:[&_.message-body-frame]:-mx-4",e),children:t}),Ye=({html:e,text:t,isDark:s=!1,category:r,allowImages:n=!1,resolveCid:o,className:d,renderBlockedNotice:g})=>{const i=h.useMemo(()=>!e||typeof document>"u"?null:qe({allowExternalImages:n,resolveCid:o})(e),[e,n,o]),c=i?.html??null,{framed:u,isPlain:m}=Ce(r,i?.hasAuthorBackground??!1),f=h.useMemo(()=>({background:i?.hasAuthorBackground??!1,spacing:i?.hasAuthorSpacing??!1}),[i?.hasAuthorBackground,i?.hasAuthorSpacing]),p=h.useMemo(()=>!c||n?0:(c.match(/data-blocked-src/g)||[]).length,[c,n]);return!c&&!t?a.jsx("div",{className:b("message-body",d),children:a.jsx(L,{})}):a.jsxs("div",{className:b("message-body",d),children:[p>0&&a.jsx("div",{children:g?.(p)}),c?a.jsx("div",{className:"message-body-frame",children:u?a.jsx("div",{className:"w-full max-w-full",children:a.jsx(C,{html:c,variant:"framed",isDark:s,declares:f})}):a.jsx("div",{className:"max-w-full lg:max-w-2xl",children:a.jsx(C,{html:c,variant:m?"plain":"framed",isDark:s,declares:f})})}):t?a.jsx("pre",{className:"email-text whitespace-pre-wrap text-sm leading-relaxed",children:t}):a.jsx(L,{})]})};function Nt({message:e="Select a thread to read",icon:t,showHints:s=!0,className:r}){return a.jsxs("div",{className:b("flex flex-1 flex-col items-center justify-center text-center",r),children:[t??a.jsx(X,{className:"size-10 text-fg-subtle"}),a.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:e}),s&&a.jsxs("p",{className:"text-2xs text-fg-subtle",children:[a.jsx(A,{children:"j"})," / ",a.jsx(A,{children:"k"})," to move, ",a.jsx(A,{children:"Enter"})," to open"]})]})}function O(e){const t=[];let s=-1,r=!1;for(let n=0;n<e.length;n++){const o=e[n];if(o==='"'){r=!r,s<0&&(s=n);continue}if(!r&&/\s/.test(o)){s>=0&&t.push({raw:e.slice(s,n),start:s,end:n}),s=-1;continue}s<0&&(s=n)}return s>=0&&t.push({raw:e.slice(s),start:s,end:e.length}),t}const Xe=e=>{if(!e.startsWith('"'))return e;const t=e.slice(1);return t.endsWith('"')?t.slice(0,-1):t};function Ze(e){const t=e.indexOf(":");if(t<=0)return;const s=e.slice(t+1);return{name:e.slice(0,t).toLowerCase(),value:Xe(s),rawValue:s}}const Je=e=>/[\s"]/.test(e),et=e=>Je(e)?`"${e.replace(/"/g,"")}"`:e,Ct=(e,t)=>`${e}:${et(t)}`,D=(e,t=Date.now())=>({value:e,setAt:t}),tt=(e,t,s,r)=>{if(e.addressId!==t)return e;const n={...e.flags??{}};return s?n.trusted=D(!0,r):delete n.trusted,{...e,flags:n}},st=(e,t,s,r)=>{const n=o=>o.map(d=>tt(d,t,s,r));return{...e,envelope:{...e.envelope,from:n(e.envelope.from),to:n(e.envelope.to),cc:n(e.envelope.cc),bcc:n(e.envelope.bcc),replyTo:n(e.envelope.replyTo)}}},rt=({messageId:e})=>{const t=Z(),{pushError:s}=J(),{mutate:r,isPending:n,error:o,reset:d}=ee({...re(),onMutate:async i=>{const c=i.path.addressId,m=i.body.flags?.trusted?.value===!0,f=se({path:{messageId:e}});await t.cancelQueries({queryKey:f});const p=t.getQueriesData({queryKey:f}).filter(l=>l[1]!==void 0).map(([l,x])=>({queryKey:l,data:x}));return t.setQueriesData({queryKey:f},l=>l&&st(l,c,m)),{describePrefix:f,previous:p}},onError:(i,c,u)=>{if(u)for(const m of u.previous)t.setQueryData(m.queryKey,m.data);s(te("Couldn't trust sender","The change wasn't saved.",i))},onSettled:(i,c,u,m)=>{m&&t.invalidateQueries({queryKey:m.describePrefix})}});return{toggleTrusted:(i,c)=>{r({path:{addressId:i},body:{flags:{trusted:D(!c)}}})},isPending:n,error:o,reset:d}},nt=()=>{const[e,t]=h.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return h.useEffect(()=>{const s=document.documentElement,r=new MutationObserver(()=>{t(s.classList.contains("dark"))});return r.observe(s,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e},at=(e,t)=>{const s=`${e} image${e>1?"s":""}`;return t?`${s} hidden — you blocked this sender`:`${s} blocked for privacy`},ot=({blockedImageCount:e,canAlwaysTrust:t,isTrustPending:s,isSenderBlocked:r,onLoadOnce:n,onAlwaysTrust:o})=>a.jsxs("div",{"data-testid":"blocked-images-notice",className:"mb-3 flex items-center justify-between rounded-md bg-surface-sunken/50 px-3 py-2 text-sm",children:[a.jsx("span",{className:"text-fg-muted",children:at(e,r)}),!r&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:n,className:"text-accent hover:underline",children:"Load once"}),t&&a.jsx("button",{type:"button",onClick:o,"aria-busy":s,className:"text-accent hover:underline aria-busy:opacity-50",children:s?"Trusting…":"Always trust"})]})]}),it=(e,t)=>{switch(e){case"auth":return{title:"Your session expired",detail:"Sign in again to reload the message body. Other parts of the app may also stop responding until you do."};case"body-missing":return{title:"Message body is missing in storage",detail:"A sync failure may have left this message without its body bytes. Contact support, or run the reconcile script to refetch from the upstream IMAP server."};case"content-type-mismatch":return{title:"Couldn't load message body",detail:"The server returned an unexpected content type for this part. The message body has not been rendered to keep you safe."};case"spa-shell-leak":return{title:"Couldn't load message body",detail:"The server returned the app shell instead of the message body. This is an infrastructure bug — please report it."};case"not-ready":return{title:"Message body is still syncing",detail:"This message's body hasn't finished downloading from the mail server yet. It should appear shortly — reopen the message to try again."};default:return{title:"Couldn't load message body",detail:t}}},ct=e=>e instanceof le?e.reason:"generic",lt=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while loading the message body.",dt=({error:e,onRetry:t})=>{const s=ct(e),r=lt(e),{title:n,detail:o}=it(s,r),[d,g]=h.useState(!1),{Account:i}=ne();return d?null:a.jsxs("div",{role:"alert","data-testid":"message-body-error-banner","data-reason":s,className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[a.jsx(ae,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-danger",children:n}),a.jsx("p",{className:"text-fg-muted mt-1 break-words",children:o})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s==="auth"&&a.jsx(i,{children:({signOut:c})=>a.jsx("button",{type:"button",onClick:()=>c(),className:"text-sm font-medium text-accent hover:underline",children:"Sign in again"})}),t&&a.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-accent hover:underline",children:"Retry"}),a.jsx("button",{type:"button",onClick:()=>g(!0),"aria-label":"Dismiss message body error",className:"rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors",children:a.jsx(oe,{className:"size-4","aria-hidden":"true"})})]})]})},ut=()=>a.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading message body",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"})]}),R=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),Tt=({bodyParts:e,html:t,text:s,isTrusted:r=!1,isBlocked:n=!1,messageId:o,fromAddressId:d,category:g,className:i})=>{const[c,u]=h.useState(!1),[m,f]=h.useState(o);m!==o&&(f(o),u(!1));const p=!n&&(r||c),l=nt(),{toggleTrusted:x,isPending:w}=rt({messageId:o??""}),y=!!e&&e.length>0,{picked:z,data:v,isLoading:P,isError:K,error:F,refetch:H}=de({messageId:o,bodyParts:e,enabled:y}),G=h.useMemo(()=>je(e??[]),[e]),U=y&&v?.kind==="html"?v.body:t,W=y&&v?.kind==="text"?v.body:s;if(y){if(P)return a.jsx("div",{className:b("message-body",i),children:a.jsx(ut,{})});if(K)return a.jsx("div",{className:b("message-body",i),children:a.jsx(dt,{error:F,onRetry:()=>H()})});if(!z)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})})}else if(!t&&!s)return a.jsx("div",{className:b("message-body",i),children:a.jsx(R,{})});const V=!!(d&&o),Q=()=>{!d||w||(u(!0),x(d,!1))};return a.jsx(Ye,{className:i,html:U,text:W,isDark:l,category:g,allowImages:p,resolveCid:G,renderBlockedNotice:q=>a.jsx(ot,{blockedImageCount:q,canAlwaysTrust:V,isTrustPending:w,isSenderBlocked:n,onLoadOnce:()=>u(!0),onAlwaysTrust:Q})})},mt=Object.values(_).map(e=>({value:e,label:I[e]})),ft={unclassified:"uncategorized"},ht=[{name:"from",label:"Sender",values:"contact"},{name:"subject",label:"Subject",values:"text"},{name:"category",label:"Category",values:"fixed",options:mt},{name:"is",label:"State",values:"fixed",options:[{value:"unread",label:"Unread"},{value:"read",label:"Read"},{value:"starred",label:"Starred"}]},{name:"has",label:"Contents",values:"fixed",options:[{value:"attachment",label:"Has attachment"}]},{name:"in",label:"Folder",values:"mailbox"},{name:"account",label:"Account",values:"account"},{name:"after",label:"Sent on or after",values:"date"},{name:"before",label:"Sent before",values:"date"}],gt=new Map(ht.map(e=>[e.name,e])),jt=e=>gt.get(e.toLowerCase()),pt=/^\d{4}-\d{2}-\d{2}$/;function bt(e,t,s){if(!pt.test(s))return;const r=Date.parse(`${s}T00:00:00Z`);if(!Number.isNaN(r))return{type:e,raw:t,value:s,epochSeconds:Math.floor(r/1e3)}}function yt(e){const t=e.toLowerCase(),s=ft[t];return s||Object.values(_).find(n=>n===t)}function xt(e,t){switch(t.toLowerCase()){case"unread":return{type:"isUnread",raw:e};case"read":return{type:"isRead",raw:e};case"starred":case"flagged":return{type:"isStarred",raw:e};default:return}}function wt(e,t){const s=Ze(e);if(!s||s.value.length===0)return;const{name:r,value:n}=s;switch(r){case"from":return{type:"from",raw:e,value:n};case"subject":return{type:"subject",raw:e,value:n};case"category":{const o=yt(n);return o?{type:"category",raw:e,value:n,category:o}:void 0}case"is":return xt(e,n);case"has":return n.toLowerCase()==="attachment"?{type:"hasAttachment",raw:e}:void 0;case"before":case"after":return bt(r,e,n);case"in":{const o=t.mailboxesByName?.get(n.toLowerCase());return o?{type:"in",raw:e,value:n,mailboxId:o}:void 0}case"account":{const o=t.accountsByName?.get(n.toLowerCase());return o?{type:"account",raw:e,value:n,accountId:o}:void 0}default:return}}function Lt(e,t={}){const s=[],r=[];for(const n of O(e)){const o=wt(n.raw,t);o?s.push(o):r.push(n.raw)}return{freeText:r.join(" "),tokens:s}}function Rt(e,t){return O(e).filter(s=>s.raw!==t.raw).map(s=>s.raw).join(" ")}function _t(e){switch(e.type){case"from":return`From: ${e.value}`;case"subject":return`Subject: ${e.value}`;case"category":return`Category: ${I[e.category]}`;case"hasAttachment":return"Has attachment";case"isUnread":return"Unread";case"isRead":return"Read";case"isStarred":return"Starred";case"before":return`Before ${e.value}`;case"after":return`After ${e.value}`;case"in":return`In: ${e.value}`;case"account":return`Account: ${e.value}`}}function It(){const{mailboxNameIndex:e,accountNameIndex:t}=ie(),s=ce();return{...ue(s)?{}:{mailboxesByName:e},accountsByName:t}}export{Et as M,Nt as R,ht as S,Ye as a,rt as b,Tt as c,jt as d,O as e,Ze as f,Ct as g,Lt as p,Rt as r,_t as s,It as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as L,at as M,i as k,E as I,F as E,
|
|
1
|
+
import{h as L,at as M,i as k,E as I,F as E,cz as A,el as R,r as v,dx as j,j as p,em as h,en as w,eo as D,C as _,co as z,c as N,dS as Q,d5 as O}from"./index-UydO8d8c.js";import{c as U}from"./popover-menu--AoVAv-y.js";import{aj as q}from"./MailListHeader-DfOCZnRx.js";import{a as P}from"./useLabels-DQs2z0T7.js";import{n as B}from"./search-query-Cr_ZXBCp.js";import{b as F}from"./search-scope-B5-OK3Cq.js";import{u as G,p as H}from"./useSearchTokenContext-CBDSw3gJ.js";const ne=e=>{const t=new Set;for(const s of e)s&&t.add(s);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},K=e=>{const{mailboxId:t,messages:s}=e,n=L(),{pushError:l}=M(),{mutateAsync:c,isPending:a}=k({...R(),onError:(r,u)=>{l({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:A(r),error:r})},onSettled:(r,u,d)=>{I(n,E(q(d.body.messageIds??[],s??[],t)))}});return{applyLabel:v.useCallback((r,u,d)=>{r.length!==0&&j(r,m=>c({body:{messageIds:m,labelId:u,action:d}}))},[c]),isPending:a}};function re({accountId:e,mailboxId:t,messageIds:s}){const{labels:n}=P(e),{applyLabel:l}=K({mailboxId:t}),c=v.useMemo(()=>n.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${w(a.color)?h[a.color]:h.Default}`}),onSelect:()=>l(s,a.labelId,"Apply")})),[n,s,l]);return c.length===0?null:p.jsx(U,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(D,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:c,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const V=3,ie=({hasSearchQuery:e,freeText:t,residualTokenCount:s})=>{if(!e||s>0)return!1;const n=t.trim();return n.length===0||n.length>=V},ce=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},Y=20,$=new Set(Object.values(O)),J=e=>e!==void 0&&$.has(e)?e:void 0,W=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function le({mailboxId:e,filterCategory:t}={}){const{searchQuery:s}=_(),n=G(),l=z(),c=B(s),{freeText:a,tokens:i}=H(c,n),r=a.length>0,u=i.find(o=>o.type==="category"),d=J(t)??u?.category,m=i.some(o=>o.type==="hasAttachment")?!0:void 0,f=i.some(o=>o.type==="isStarred")?!0:void 0,y=W(i),b=i.find(o=>o.type==="after"),g=i.find(o=>o.type==="before"),x=i.find(o=>o.type==="in"),S=F({browsed:l,callerMailboxId:e,inTokenMailboxId:x?.mailboxId}),{data:T,isLoading:C}=N({...Q({query:{query:a,mailboxId:S,limit:Y,...d!==void 0?{category:d}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:r,staleTime:6e4});return{hits:T?.items??[],isLoading:r&&C}}export{re as L,ne as r,ie as s,ce as t,le as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as g,at as p,c as f,d as m,r,i as y,av as T,o as E,l as d}from"./index-
|
|
1
|
+
import{h as g,at as p,c as f,d as m,r,i as y,av as T,o as E,l as d}from"./index-UydO8d8c.js";const i={html:"",plainText:""},x=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{x as u};
|
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-UydO8d8c.js"></script>
|
|
42
42
|
<link rel="stylesheet" crossorigin href="/assets/index-CzAIxx9Z.css">
|
|
43
43
|
</head>
|
|
44
44
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as o}from"./index-Q4feV5hs.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aj as m,j as o,O as p}from"./index-Q4feV5hs.js";import{a}from"./MailShell-CijmWfSp.js";import{M as r}from"./MailboxPane-BSy756o9.js";import{a as e}from"./search-token-index-DMotPy3S.js";import{u as s}from"./search-mirror-yAtFv0xR.js";import"./FullCompose-BAl3d_w0.js";import"./ErrorState-ujr_GVkW.js";import"./index-D5i-rZKH.js";import"./useMessageBodyContent-Bh1dkGuL.js";import"./useSignature-CRBwOs1d.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-m9hfoeeT.js";import"./sections-BEjFgOOu.js";import"./confirm-dialog-DStVP_YB.js";import"./useSearchTokenContext-BtJhq-_Q.js";import"./kbd-shPcQMK0.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-C5OCmhS8.js";import"./circle-check-big-BxS7u06D.js";import"./refresh-cw-5HtDVbgJ.js";import"./useQueries-Dt_ZoQnW.js";import"./MailListHeader-B8KqCoIm.js";import"./roving-focus-lu4GUcG_.js";import"./popover-menu-TKxn0teJ.js";import"./mail-C_twG7GL.js";import"./avatar-C5pPOUjS.js";import"./EmptyState-CN1sTl54.js";import"./undo-2-SqKWoGew.js";import"./download--4zu6YFD.js";import"./calendar-suggestion-Coshl0tU.js";import"./calendar-format-D-35Eq-A.js";import"./useCalendars-DB62jljf.js";import"./map-pin-BBn-x2Kl.js";import"./attendee-row-YXbrbIq8.js";import"./clock-zn4wNsRc.js";import"./calendar-clash-strip-BLhPkquh.js";import"./bell-off-CQoLYol5.js";import"./copy-CBi3fm5e.js";import"./shield-check-HOK5b_5p.js";import"./useFilters-MhGWNTRw.js";import"./useLayoutTier-B7U5my6x.js";import"./menu-DTN4EvxK.js";import"./MailViewChrome-ylQHccJD.js";import"./NavMenuButton-DXqQI4Z5.js";import"./useLabels-BCVlkzT_.js";import"./useSemanticSearch-DfSsCW6c.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-C91fm1wU.js";import"./circle-help-BlZ4xP9R.js";import"./circle-check-uO4_WbZm.js";function po(){const{mailboxId:t}=m.useParams(),i=e();return s({to:"/mail/$mailboxId",params:{mailboxId:t}}),o.jsx(r,{mailboxId:t,thread:i,children:o.jsx(a,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(p,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{po as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-Q4feV5hs.js";import{B as o}from"./BriefPane-BcLRbXt0.js";import"./useSearchTokenContext-BtJhq-_Q.js";import"./kbd-shPcQMK0.js";import"./useMessageBodyContent-Bh1dkGuL.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-B8KqCoIm.js";import"./roving-focus-lu4GUcG_.js";import"./search-token-index-DMotPy3S.js";import"./useQueries-Dt_ZoQnW.js";import"./popover-menu-TKxn0teJ.js";import"./mail-C_twG7GL.js";import"./avatar-C5pPOUjS.js";import"./index-D5i-rZKH.js";import"./useSignature-CRBwOs1d.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-m9hfoeeT.js";import"./sections-BEjFgOOu.js";import"./EmptyState-CN1sTl54.js";import"./ErrorState-ujr_GVkW.js";import"./undo-2-SqKWoGew.js";import"./download--4zu6YFD.js";import"./calendar-suggestion-Coshl0tU.js";import"./calendar-format-D-35Eq-A.js";import"./useCalendars-DB62jljf.js";import"./map-pin-BBn-x2Kl.js";import"./attendee-row-YXbrbIq8.js";import"./clock-zn4wNsRc.js";import"./calendar-clash-strip-BLhPkquh.js";import"./bell-off-CQoLYol5.js";import"./copy-CBi3fm5e.js";import"./shield-check-HOK5b_5p.js";import"./useFilters-MhGWNTRw.js";import"./confirm-dialog-DStVP_YB.js";import"./useLayoutTier-B7U5my6x.js";import"./menu-DTN4EvxK.js";import"./useRefreshControl-C5OCmhS8.js";import"./circle-check-big-BxS7u06D.js";import"./refresh-cw-5HtDVbgJ.js";import"./useSemanticSearch-DfSsCW6c.js";import"./useLabels-BCVlkzT_.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function T(){return r.jsx(o.Reading,{})}export{T as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Q4feV5hs.js";import{F as r}from"./FlaggedPane-CRQiEP8s.js";import"./useSearchTokenContext-BtJhq-_Q.js";import"./kbd-shPcQMK0.js";import"./useMessageBodyContent-Bh1dkGuL.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-B8KqCoIm.js";import"./roving-focus-lu4GUcG_.js";import"./search-token-index-DMotPy3S.js";import"./useQueries-Dt_ZoQnW.js";import"./popover-menu-TKxn0teJ.js";import"./mail-C_twG7GL.js";import"./avatar-C5pPOUjS.js";import"./index-D5i-rZKH.js";import"./useSignature-CRBwOs1d.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-m9hfoeeT.js";import"./sections-BEjFgOOu.js";import"./EmptyState-CN1sTl54.js";import"./ErrorState-ujr_GVkW.js";import"./undo-2-SqKWoGew.js";import"./download--4zu6YFD.js";import"./calendar-suggestion-Coshl0tU.js";import"./calendar-format-D-35Eq-A.js";import"./useCalendars-DB62jljf.js";import"./map-pin-BBn-x2Kl.js";import"./attendee-row-YXbrbIq8.js";import"./clock-zn4wNsRc.js";import"./calendar-clash-strip-BLhPkquh.js";import"./bell-off-CQoLYol5.js";import"./copy-CBi3fm5e.js";import"./shield-check-HOK5b_5p.js";import"./useFilters-MhGWNTRw.js";import"./confirm-dialog-DStVP_YB.js";import"./useLayoutTier-B7U5my6x.js";import"./menu-DTN4EvxK.js";import"./MailViewChrome-ylQHccJD.js";import"./refresh-cw-5HtDVbgJ.js";import"./wizard-selection-DxUM65kM.js";function N(){return o.jsx(r.Reading,{})}export{N as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Q4feV5hs.js";import{M as r}from"./MailboxPane-BSy756o9.js";import"./useSearchTokenContext-BtJhq-_Q.js";import"./kbd-shPcQMK0.js";import"./useMessageBodyContent-Bh1dkGuL.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-C5OCmhS8.js";import"./circle-check-big-BxS7u06D.js";import"./refresh-cw-5HtDVbgJ.js";import"./useQueries-Dt_ZoQnW.js";import"./MailListHeader-B8KqCoIm.js";import"./roving-focus-lu4GUcG_.js";import"./search-token-index-DMotPy3S.js";import"./popover-menu-TKxn0teJ.js";import"./mail-C_twG7GL.js";import"./avatar-C5pPOUjS.js";import"./index-D5i-rZKH.js";import"./useSignature-CRBwOs1d.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-m9hfoeeT.js";import"./sections-BEjFgOOu.js";import"./EmptyState-CN1sTl54.js";import"./ErrorState-ujr_GVkW.js";import"./undo-2-SqKWoGew.js";import"./download--4zu6YFD.js";import"./calendar-suggestion-Coshl0tU.js";import"./calendar-format-D-35Eq-A.js";import"./useCalendars-DB62jljf.js";import"./map-pin-BBn-x2Kl.js";import"./attendee-row-YXbrbIq8.js";import"./clock-zn4wNsRc.js";import"./calendar-clash-strip-BLhPkquh.js";import"./bell-off-CQoLYol5.js";import"./copy-CBi3fm5e.js";import"./shield-check-HOK5b_5p.js";import"./useFilters-MhGWNTRw.js";import"./confirm-dialog-DStVP_YB.js";import"./useLayoutTier-B7U5my6x.js";import"./menu-DTN4EvxK.js";import"./MailViewChrome-ylQHccJD.js";import"./NavMenuButton-DXqQI4Z5.js";import"./useLabels-BCVlkzT_.js";import"./useSemanticSearch-DfSsCW6c.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-C91fm1wU.js";import"./circle-help-BlZ4xP9R.js";import"./circle-check-uO4_WbZm.js";function X(){return o.jsx(r.Reading,{})}export{X as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Q4feV5hs.js";import{O as t}from"./OutboxPane-CA4PZFqu.js";import"./roving-focus-lu4GUcG_.js";import"./useSearchTokenContext-BtJhq-_Q.js";import"./kbd-shPcQMK0.js";import"./useMessageBodyContent-Bh1dkGuL.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-BxS7u06D.js";import"./clock-zn4wNsRc.js";import"./row-actions-Dj7EnCiv.js";import"./rotate-ccw-CQK-NIHI.js";import"./NavMenuButton-DXqQI4Z5.js";import"./menu-DTN4EvxK.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{eW as o,j as m}from"./index-Q4feV5hs.js";import{O as p}from"./OpenCalendarEvent-AMoWfhdc.js";import"./CalendarComposePane-BX_sGf_E.js";import"./calendar-format-D-35Eq-A.js";import"./useQueries-Dt_ZoQnW.js";import"./useCalendars-DB62jljf.js";import"./calendar-clash-strip-BLhPkquh.js";import"./attendee-row-YXbrbIq8.js";import"./avatar-C5pPOUjS.js";import"./clock-zn4wNsRc.js";import"./map-pin-BBn-x2Kl.js";import"./mail-C_twG7GL.js";import"./pencil-DeYHBqGJ.js";import"./useCalendarWrites-DdDEKJWs.js";import"./ErrorState-ujr_GVkW.js";import"./useCalendarData-ScZEg4Bc.js";function I(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:t})}export{I as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as o}from"./index-Q4feV5hs.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as o}from"./index-Q4feV5hs.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as o}from"./index-Q4feV5hs.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a,ao as De,f as te,Z as Ps,X as Ce,ap as ks,aq as Vs,ar as ut,G as Ds,r as C,H as Cs,t as Ge,as as ee,h as ft,at as Fs,c as Jt,d as Xt,au as Os,i as Se,av as Is,o as Te,l as es,aw as Rs,ax as Ms,ay as Ls,az as ve,aA as At,L as it,aB as Tt,aC as Us,aD as Re,aE as be,aF as _t,ab as Hs,aG as zs,aH as Bs,aI as ts,aJ as Et,u as qs,n as $s,aK as Ws,aL as Gs,B as Pt,g as Ks,aM as kt,aN as Ys,a3 as Zs,aO as Qs}from"./index-Q4feV5hs.js";import{R as Js}from"./row-actions-Dj7EnCiv.js";import{S as Xs,A as er}from"./settings-screen-BRDJz8vo.js";import{g as Vt,P as tr,O as sr}from"./OnboardingWizard-JlsmKOxT.js";import{s as Be,u as rr,b as ar,R as ir}from"./credential-steps-C0bopKBL.js";import{u as nr}from"./useSignature-CRBwOs1d.js";import{c as or,a as Dt,d as lr}from"./account-form-helpers-DhckT_PN.js";import{D as cr}from"./download--4zu6YFD.js";import{E as dr}from"./ErrorState-ujr_GVkW.js";import{a as ur}from"./help-copy-uBF8fXGG.js";import"./avatar-C5pPOUjS.js";import"./chevron-left-BzC14Odw.js";import"./menu-DTN4EvxK.js";import"./circle-help-BlZ4xP9R.js";import"./kbd-shPcQMK0.js";import"./mail-C_twG7GL.js";import"./file-json-CIHsLTs2.js";import"./card-DIRsRHeY.js";const fr=e=>{const s=new Set(e.map(ks));return Vs.map(t=>t.tag).filter(t=>!s.has(t)).sort((t,i)=>De(t).localeCompare(De(i)))},mr=({value:e,onChange:s,busy:t=!1})=>{const i=fr(e);return a.jsxs("div",{className:"space-y-2","data-testid":"compose-language-setting",children:[a.jsx("ul",{className:"space-y-1",children:e.map((o,d)=>a.jsxs("li",{"data-testid":`compose-language-row-${o}`,className:"flex items-center gap-2 rounded-md border border-line bg-surface-sunken px-3 py-1.5",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-fg",lang:o,children:De(o)}),d===0?a.jsx("span",{className:"shrink-0 text-2xs uppercase tracking-wider text-fg-subtle",children:"Default"}):a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ps,{className:"size-3.5"}),disabled:t,"aria-label":`Write new messages in ${De(o)} by default`,onClick:()=>s([o,...e.filter(n=>n!==o)]),children:"Default"}),a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ce,{className:"size-3.5"}),disabled:t||e.length===1,"aria-label":`Remove ${De(o)}`,onClick:()=>s(e.filter(n=>n!==o))})]},o))}),a.jsxs("select",{"aria-label":"Add a language",value:"",disabled:t||i.length===0,onChange:o=>{o.target.value!==""&&s([...e,o.target.value])},className:"w-full rounded-md border border-line bg-surface-sunken px-3 py-2 text-sm text-fg outline-none transition-colors focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30",children:[a.jsx("option",{value:"",children:"Add a language…"}),i.map(o=>a.jsx("option",{value:o,children:De(o)},o))]}),a.jsx("p",{className:"text-xs text-fg-muted",children:"A message is tagged with the language you write it in, picked from this list. Your browser, not this app, decides which dictionaries it spellchecks against — add the language there too to get its underlines."})]})};function pr({title:e,description:s,action:t}){return a.jsxs("div",{className:"rounded-sm border border-danger/50",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-danger/30 bg-danger-soft px-row-inset py-2",children:[a.jsx(ut,{className:"size-4 text-danger"}),a.jsx("h2",{className:"text-sm font-semibold text-danger",children:"Danger zone"})]}),a.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-medium text-fg",children:e}),a.jsx("p",{className:"text-xs text-fg-muted",children:s})]}),a.jsx("div",{className:"shrink-0",children:t})]})]})}function Ct({isOpen:e,onClose:s,title:t,children:i,footer:o}){Ds({id:"slide-panel",open:e,answers:{back:s}});const d=C.useRef(null);return Cs(d,e),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ge("fixed inset-0 z-40 bg-black/30 transition-opacity",e?"opacity-100":"pointer-events-none opacity-0"),onClick:s,"aria-hidden":"true"}),a.jsxs("div",{ref:d,className:Ge("safe-area-frame fixed top-0 right-0 z-50 flex h-full w-full flex-col border-l border-line bg-canvas shadow-xl sm:w-[400px] sm:max-w-[90vw]","transform transition-transform duration-200 ease-out",e?"translate-x-0":"pointer-events-none translate-x-full"),role:"dialog","aria-modal":"true","aria-hidden":!e,inert:!e,"aria-labelledby":"slide-panel-title",tabIndex:-1,children:[a.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-line px-4",children:[a.jsx("h2",{id:"slide-panel-title",className:"font-semibold",children:t}),a.jsx("button",{type:"button",onClick:s,className:"rounded-md p-1.5 transition-colors hover:bg-surface-raised","aria-label":"Close",children:a.jsx(Ce,{className:"size-5"})})]}),a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[a.jsx("div",{className:"flex-1 overflow-auto p-4",children:i}),o&&a.jsx("div",{className:"flex justify-end gap-3 border-t border-line bg-canvas p-4",children:o})]})]})]})}var Ue=e=>e.type==="checkbox",je=e=>e instanceof Date,K=e=>e==null;const mt=e=>typeof e=="object";var H=e=>!K(e)&&!Array.isArray(e)&&mt(e)&&!je(e),hr=e=>H(e)&&e.target?Ue(e.target)?e.target.checked:e.target.value:e,gr=(e,s)=>s.split(".").some((t,i,o)=>!isNaN(Number(t))&&e.has(o.slice(0,i).join("."))),ss=e=>{const s=e.constructor&&e.constructor.prototype;return H(s)&&s.hasOwnProperty("isPrototypeOf")},Ze=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function z(e){if(e instanceof Date)return new Date(e);const s=typeof FileList<"u"&&e instanceof FileList;if(Ze&&(e instanceof Blob||s))return e;const t=Array.isArray(e);if(!t&&!(H(e)&&ss(e)))return e;const i=t?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=z(e[o]));return i}const ke={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ue={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},de={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},rs="root",pt=["__proto__","constructor","prototype"],xr=/^\w*$/;var He=e=>xr.test(e),M=e=>e===void 0;const yr=/[.[\]'"]/;var Qe=e=>e.split(yr).filter(Boolean),y=(e,s,t)=>{if(!s||!H(e))return t;const i=He(s)?[s]:Qe(s);if(i.some(d=>pt.includes(d)))return t;const o=i.reduce((d,n)=>K(d)?void 0:d[n],e);return M(o)||o===e?M(e[s])?t:e[s]:o},pe=e=>typeof e=="boolean",ie=e=>typeof e=="function",F=(e,s,t)=>{let i=-1;const o=He(s)?[s]:Qe(s),d=o.length,n=d-1;for(;++i<d;){const u=o[i];let j=t;if(i!==n){const _=e[u];j=H(_)||Array.isArray(_)?_:isNaN(+o[i+1])?{}:[]}if(pt.includes(u))return;e[u]=j,e=e[u]}};const vr=ee.createContext(null);vr.displayName="HookFormControlContext";var br=(e,s,t,i=!0)=>{const o={};for(const d in e)Object.defineProperty(o,d,{get:()=>{const n=d;return s._proxyFormState[n]!==ue.all&&(s._proxyFormState[n]=!i||ue.all),e[n]}});return o};const jr=Ze?ee.useLayoutEffect:ee.useEffect;var Y=e=>typeof e=="string",Sr=(e,s,t,i,o)=>Y(e)?(i&&s.watch.add(e),y(t,e,o)):Array.isArray(e)?e.map(d=>(i&&s.watch.add(d),y(t,d))):(i&&(s.watchAll=!0),t),nt=e=>K(e)||!mt(e);const Ft=(e,s)=>s.length===0&&!Array.isArray(e)&&!ss(e);function he(e,s,t=new WeakMap){if(e===s)return!0;if(nt(e)||nt(s))return Object.is(e,s);if(je(e)&&je(s))return Object.is(e.getTime(),s.getTime());const i=Object.keys(e),o=Object.keys(s);if(i.length!==o.length)return!1;if(Ft(e,i)||Ft(s,o))return Object.is(e,s);if(!i.length&&Array.isArray(e)!==Array.isArray(s))return!1;const d=t.get(e);if(d&&d.has(s))return!0;if(d)d.add(s);else{const n=new WeakSet;n.add(s),t.set(e,n)}for(const n of i){const u=e[n];if(!(n in s))return!1;if(n!=="ref"){const j=s[n];if(je(u)&&je(j)||(H(u)||Array.isArray(u))&&(H(j)||Array.isArray(j))?!he(u,j,t):!Object.is(u,j))return!1}}return!0}var qe=e=>({isOnSubmit:!e||e===ue.onSubmit,isOnBlur:e===ue.onBlur,isOnChange:e===ue.onChange,isOnAll:e===ue.all,isOnTouch:e===ue.onTouched}),st=(e,s,t)=>{if(t)return!1;if(s.watchAll||s.watch.has(e))return!0;for(const i of s.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const Le=(e,s,t,i)=>{for(const o of t||Object.keys(e)){const d=y(e,o);if(d){const{_f:n,...u}=d;if(n){if(n.refs&&n.refs[0]&&s(n.refs[0],o)&&!i)return!0;if(n.ref&&s(n.ref,n.name)&&!i)return!0;if(Le(u,s))break}else if(H(u)&&Le(u,s))break}}};var Ot=(e,s,t)=>{const i=y(e,t),o=Array.isArray(i)?i:[];return F(o,rs,s[t]),F(e,t,o),e},G=e=>H(e)&&!Object.keys(e).length,ht=e=>e.type==="file",Ke=e=>{if(!Ze)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},gt=e=>e.type==="radio",Ye=e=>e instanceof RegExp,xt=(e,s,t,i,o)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:o||!0}}:{};const It={value:!1,isValid:!1},Rt={value:!0,isValid:!0};var as=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!M(e[0].attributes.value)?M(e[0].value)||e[0].value===""?Rt:{value:e[0].value,isValid:!0}:Rt:It}return It};const Mt={isValid:!1,value:null};var is=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Mt):Mt;function Lt(e,s,t="validate"){if(Y(e)||Array.isArray(e)&&e.every(Y)||pe(e)&&!e)return{type:t,message:Y(e)?e:"",ref:s}}var Ve=e=>H(e)&&!Ye(e)?e:{value:e,message:""},Ut=async(e,s,t,i,o,d)=>{const{ref:n,refs:u,required:j,maxLength:_,minLength:P,min:U,max:R,pattern:O,validate:E,name:f,valueAsNumber:b,mount:re}=e._f,N=y(t,f);if(!re||s.has(f))return{};const $=u?u[0]:n,I=T=>{if(o&&$.reportValidity){const k=pe(T)?"":T||"";u?u.forEach(D=>D.setCustomValidity(k)):$.setCustomValidity(k),$.reportValidity()}},A={},ne=gt(n),ae=Ue(n),ge=ne||ae,oe=(b||ht(n))&&M(n.value)&&M(N)||Ke(n)&&n.value===""||N===""||Array.isArray(N)&&!N.length,Z=xt.bind(null,f,i,A),le=(T,k,D,q=de.maxLength,Q=de.minLength)=>{const S=T?k:D;A[f]={type:T?q:Q,message:S,ref:n,...Z(T?q:Q,S)}};if(d?!Array.isArray(N)||!N.length:j&&(!ge&&(oe||K(N))||pe(N)&&!N||ae&&!as(u).isValid||ne&&!is(u).isValid)){const{value:T,message:k}=Y(j)?{value:!!j,message:j}:Ve(j);if(T&&(A[f]={type:de.required,message:k,ref:$,...Z(de.required,k)},!i))return I(k),A}if(!oe&&(!K(U)||!K(R))){let T,k;const D=Ve(R),q=Ve(U);if(!K(N)&&!isNaN(N)){const Q=n.valueAsNumber||N&&+N;K(D.value)||(T=Q>D.value),K(q.value)||(k=Q<q.value)}else{const Q=n.valueAsDate||new Date(N),S=fe=>new Date(new Date().toDateString()+" "+fe),J=n.type=="time",W=n.type=="week";Y(D.value)&&N&&(T=J?S(N)>S(D.value):W?N>D.value:Q>new Date(D.value)),Y(q.value)&&N&&(k=J?S(N)<S(q.value):W?N<q.value:Q<new Date(q.value))}if((T||k)&&(le(!!T,D.message,q.message,de.max,de.min),!i))return I(A[f].message),A}if((_||P)&&!oe&&(Y(N)||d&&Array.isArray(N))){const T=Ve(_),k=Ve(P),D=!K(T.value)&&N.length>+T.value,q=!K(k.value)&&N.length<+k.value;if((D||q)&&(le(D,T.message,k.message),!i))return I(A[f].message),A}if(O&&!oe&&Y(N)){const{value:T,message:k}=Ve(O);if(Ye(T)&&!N.match(T)&&(A[f]={type:de.pattern,message:k,ref:n,...Z(de.pattern,k)},!i))return I(k),A}if(E){if(ie(E)){const T=await E(N,t),k=Lt(T,$);if(k&&(A[f]={...k,...Z(de.validate,k.message)},!i))return I(k.message),A}else if(H(E)){let T={};for(const k in E){if(!G(T)&&!i)break;const D=Lt(await E[k](N,t),$,k);D&&(T={...D,...Z(k,D.message)},I(D.message),i&&(A[f]=T))}if(!G(T)&&(A[f]={ref:$,...T},!i))return A}}return I(!0),A},We=e=>Array.isArray(e)?e:[e],ns=e=>Array.isArray(e)?e.filter(Boolean):[];function wr(e,s){const t=s.slice(0,-1).length;let i=0;for(;i<t;){if(K(e)){e=void 0;break}e=e[s[i]],i++}return e}function Nr(e){for(const s in e)if(e.hasOwnProperty(s)&&!M(e[s]))return!1;return!0}function B(e,s){if(Y(s)&&Object.prototype.hasOwnProperty.call(e,s))return delete e[s],e;const t=Array.isArray(s)?s:He(s)?[s]:Qe(s);if(t.some(n=>pt.includes(String(n))))return e;const i=t.length===1?e:wr(e,t),o=t.length-1,d=t[o];return i&&delete i[d],o!==0&&(H(i)&&G(i)||Array.isArray(i)&&Nr(i))&&B(e,t.slice(0,-1)),e}const os=e=>{const s={};for(const t of Object.keys(e))if(mt(e[t])&&e[t]!==null&&!je(e[t])){const i=os(e[t]);for(const o of Object.keys(i))s[`${t}.${o}`]=i[o]}else s[t]=e[t];return s},Ar=ee.createContext(null);Ar.displayName="HookFormContext";var Ht=()=>{let e=[];return{get observers(){return e},next:o=>{for(const d of e)d.next&&d.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(d=>d!==o)}}),unsubscribe:()=>{e=[]}}};function ls(e,s){const t={};for(const i in e)if(e.hasOwnProperty(i)){const o=e[i],d=s[i];if(o&&H(o)&&d){const n=ls(o,d);H(n)&&(t[i]=n)}else e[i]&&(t[i]=d)}return t}var cs=e=>e.type==="select-multiple",Tr=e=>gt(e)||Ue(e),rt=e=>Ke(e)&&e.isConnected,_r=e=>{for(const s in e)if(ie(e[s]))return!0;return!1};function ds(e){return Array.isArray(e)||H(e)&&!_r(e)}function us(e){return!!(e&&"_f"in e)}function fs(e){return Array.isArray(e)?!e.some(s=>!M(s)):!Object.keys(e).length}function ot(e,s){Array.isArray(e)?e[s]=void 0:delete e[s]}function lt(e,s={},t){for(const i in e){const o=e[i],d=t&&t[i];ds(o)&&(!Array.isArray(o)||!us(d))?(s[i]=Array.isArray(o)?[]:{},lt(o,s[i],d),fs(s[i])&&ot(s,i)):M(o)||(s[i]=!0)}return s}function Ae(e,s,t,i){t||(t=lt(s,{},i));for(const o in e){const d=e[o],n=i&&i[o];ds(d)&&(!Array.isArray(d)||!us(n))?(M(s)||nt(t[o])?t[o]=lt(d,Array.isArray(d)?[]:{},n):Ae(d,K(s)?{}:s[o],t[o],n),fs(t[o])&&ot(t,o)):he(d,s[o])?ot(t,o):t[o]=!0}return t}var ms=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:i})=>M(e)?e:s?e===""?NaN:e&&+e:t&&Y(e)?new Date(e):i?i(e):e;function zt(e){const s=e.ref;return ht(s)?s.files:gt(s)?is(e.refs).value:cs(s)?[...s.selectedOptions].map(({value:t})=>t):Ue(s)?as(e.refs).value:ms(M(s.value)?e.ref.value:s.value,e)}var Er=(e,s,t,i)=>{const o={};for(const d of e){const n=y(s,d);n&&F(o,d,n._f)}return{criteriaMode:t,names:[...e],fields:o,shouldUseNativeValidation:i}},Me=e=>M(e)?e:Ye(e)?e.source:H(e)?Ye(e.value)?e.value.source:e.value:e;const Bt="AsyncFunction";var Pr=e=>{if(!e||!e.validate)return!1;if(ie(e.validate))return e.validate.constructor.name===Bt;if(H(e.validate)){for(const s in e.validate)if(e.validate[s].constructor.name===Bt)return!0}return!1},kr=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function qt(e,s,t){const i=y(e,t);if(i||He(t))return{error:i,name:t};const o=t.split(".");for(;o.length;){const d=o.join("."),n=y(s,d),u=y(e,d);if(n&&!Array.isArray(n)&&t!==d)return{name:t};if(u&&u.type)return{name:d,error:u};if(u&&u.root&&u.root.type)return{name:`${d}.root`,error:u.root};o.pop()}return{name:t}}var Vr=(e,s,t,i)=>{t(e);const{name:o,...d}=e,n=Object.keys(d);return!n.length||i&&n.length>=Object.keys(s).length||n.find(u=>s[u]===(!i||ue.all))},Dr=(e,s,t)=>!e||!s||e===s||We(e).some(i=>i&&(t?i===s||i.startsWith(s+"."):i.startsWith(s)||s.startsWith(i))),Cr=(e,s,t,i,o)=>o.isOnAll?!1:!t&&o.isOnTouch?!(s||e):(t?i.isOnBlur:o.isOnBlur)?!e:(t?i.isOnChange:o.isOnChange)?e:!0,Fr=(e,s)=>!ns(y(e,s)).length&&B(e,s);const Or={mode:ue.onSubmit,reValidateMode:ue.onChange,shouldFocusError:!0},at="form",ps={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Ir(e={}){let s={...Or,...e},t={...z(ps),isLoading:ie(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},i={},o=H(s.defaultValues)||H(s.values)?z(s.defaultValues||s.values)||{}:{},d=s.shouldUnregister?{}:z(o),n={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const j={},_={};let P=0,U=qe(s.mode),R=qe(s.reValidateMode);const O={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},E={...O};let f={...E};const b={array:Ht(),state:Ht()};let re=0;const N=s.criteriaMode===ue.all,$=(r,l)=>c=>{clearTimeout(_[r]),_[r]=setTimeout(l,c)},I=async r=>{if(!n.keepIsValid&&!s.disabled&&(E.isValid||f.isValid||r)){const l=++re;let c;s.resolver?(c=G((await D()).errors),l===re&&A()):c=await S({fields:i,onlyCheckValid:!0,eventType:ke.VALID}),l===re&&c!==t.isValid&&b.state.next({isValid:c})}},A=(r,l)=>{!s.disabled&&(E.isValidating||E.validatingFields||f.isValidating||f.validatingFields)&&((r||Array.from(u.mount)).forEach(c=>{c&&(l?F(t.validatingFields,c,l):B(t.validatingFields,c))}),b.state.next({validatingFields:t.validatingFields,isValidating:!G(t.validatingFields)}))},ne=()=>{t.dirtyFields=Ae(o,d,void 0,i)},ae=(r,l=[],c,m,p=!0,x=!0)=>{if(m&&c&&!s.disabled){if(n.action=!0,x&&Array.isArray(y(i,r))){const g=c(y(i,r),m.argA,m.argB);p&&F(i,r,g)}if(x&&Array.isArray(y(t.errors,r))){const g=c(y(t.errors,r),m.argA,m.argB);p&&F(t.errors,r,g),Fr(t.errors,r)}if((E.touchedFields||f.touchedFields)&&x&&Array.isArray(y(t.touchedFields,r))){const g=c(y(t.touchedFields,r),m.argA,m.argB);p&&F(t.touchedFields,r,g)}(E.dirtyFields||f.dirtyFields)&&ne(),b.state.next({name:r,isDirty:W(r,l),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else F(d,r,l)},ge=(r,l)=>{F(t.errors,r,l),t.errors={...t.errors},b.state.next({errors:t.errors})},oe=r=>{t.errors=r,b.state.next({errors:t.errors,isValid:!1})},Z=r=>{const l=He(r)?[r]:Qe(r);let c=d,m=o;for(let p=0;p<l.length-1;p++){const x=l[p];if(c=K(c)?c:c[x],m=K(m)?m:m[x],c===null&&m!==null)return!0}return!1},le=(r,l,c,m)=>{const p=y(i,r);if(p){if(Z(r))return;const x=M(y(d,r)),g=y(d,r,M(c)?y(o,r):c);M(g)||m&&m.defaultChecked||l?F(d,r,l?g:zt(p._f)):we(r,g),n.mount&&!n.action&&(I(),x&&t.isDirty&&(E.isDirty||f.isDirty)&&(W()||(t.isDirty=!1,b.state.next({...t}))),e.shouldUnregister&&x&&!M(y(d,r))&&st(r,u)&&(n.watch=!0))}},T=(r,l,c,m,p)=>{let x=!1,g=!1;const v={name:r};if(!s.disabled||m===!0){if(!c||m){const w=he(y(o,r),l);(E.isDirty||f.isDirty)&&(g=t.isDirty,t.isDirty=v.isDirty=!w||W(),x=g!==v.isDirty),g=!!y(t.dirtyFields,r),w!==t.isDirty?t.dirtyFields=Ae(o,d,void 0,i):w?B(t.dirtyFields,r):F(t.dirtyFields,r,!0),v.dirtyFields=t.dirtyFields,x=x||(E.dirtyFields||f.dirtyFields)&&g!==!w}if(c){const w=y(t.touchedFields,r);w||(F(t.touchedFields,r,c),v.touchedFields=t.touchedFields,x=x||(E.touchedFields||f.touchedFields)&&w!==c)}x&&p&&b.state.next(v)}return x?v:{}},k=(r,l,c,m)=>{const p=y(t.errors,r),x=(E.isValid||f.isValid)&&pe(l)&&t.isValid!==l;if(s.delayError&&c?(j[r]=$(r,()=>ge(r,c)),j[r](s.delayError)):(clearTimeout(_[r]),delete j[r],c?F(t.errors,r,c):B(t.errors,r),t.errors={...t.errors}),(c?!he(p,c):p)||!G(m)||x){const g={...m,...x&&pe(l)?{isValid:l}:{},errors:t.errors,name:r};t={...t,...g},b.state.next(g)}},D=async r=>(A(r,!0),await s.resolver(d,s.context,Er(r||u.mount,i,s.criteriaMode,s.shouldUseNativeValidation))),q=async r=>{const{errors:l}=await D(r);if(A(r),r){for(const c of r){const m=y(l,c);m?u.array.has(c)&&H(m)&&!Object.keys(m).some(p=>!Number.isNaN(Number(p)))?Ot(t.errors,{[c]:m},c):F(t.errors,c,m):B(t.errors,c)}t.errors={...t.errors}}else t.errors=l;return l},Q=async({name:r,eventType:l})=>{if(e.validate){const c=await e.validate({formValues:d,formState:t,name:r,eventType:l});if(H(c))for(const m in c){const p=c[m];p&&ze(`${at}.${m}`,{message:Y(p.message)?p.message:"",type:p.type||de.validate})}else Y(c)||!c?ze(at,{message:c||"",type:de.validate}):Pe(at);return c}return!0},S=async({fields:r,onlyCheckValid:l,name:c,eventType:m,context:p={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(p.runRootValidation=!0,!await Q({name:c,eventType:m})&&(p.valid=!1,l)))return p.valid;for(const x in r){const g=r[x];if(g){const{_f:v,...w}=g;if(v){const L=u.array.has(v.name),X=g._f&&Pr(g._f),xe=E.validatingFields||E.isValidating||f.validatingFields||f.isValidating;X&&xe&&A([v.name],!0);const ye=await Ut(g,u.disabled,d,N,s.shouldUseNativeValidation&&!l,L);if(X&&xe&&A([v.name]),ye[v.name]&&(p.valid=!1,l)||(!l&&(y(ye,v.name)?L?Ot(t.errors,ye,v.name):F(t.errors,v.name,ye[v.name]):B(t.errors,v.name)),e.shouldUseNativeValidation&&ye[v.name]))break}!G(w)&&await S({context:p,onlyCheckValid:l,fields:w,name:x,eventType:m})}}return p.valid},J=()=>{for(const r of u.unMount){const l=y(i,r);l&&(l._f.refs?l._f.refs.every(c=>!rt(c)):!rt(l._f.ref))&&Xe(r)}u.unMount=new Set},W=(r,l)=>(r&&l&&F(d,r,l),!he(n.mount?d:o,o)),fe=(r,l,c)=>Sr(r,u,{...n.mount?d:M(l)?o:Y(r)?{[r]:l}:l},c,l),_e=r=>ns(y(n.mount?d:o,r,s.shouldUnregister?y(o,r,[]):[])),we=(r,l,c={},m=!1,p=!1)=>{const x=y(i,r);let g=l;if(x){const v=x._f;v&&(!v.disabled&&F(d,r,ms(l,v)),g=Ke(v.ref)&&K(l)?"":l,cs(v.ref)?[...v.ref.options].forEach(w=>w.selected=g.includes(w.value)):v.refs?Ue(v.ref)?v.refs.forEach(w=>{(!w.defaultChecked||!w.disabled)&&(Array.isArray(g)?w.checked=!!g.find(L=>L===w.value):w.checked=g===w.value||!!g)}):v.refs.forEach(w=>w.checked=w.value===g):ht(v.ref)?v.ref.value="":(v.ref.value=g,!v.ref.type&&!p&&b.state.next({name:r,values:m?d:z(d)})))}(c.shouldDirty||c.shouldTouch)&&T(r,g,c.shouldTouch,c.shouldDirty,!p),c.shouldValidate&&me(r,{delayError:c.delayError})},Ee=(r,l,c,m=!1,p=!1)=>{for(const x in l){if(!l.hasOwnProperty(x))return;const g=l[x],v=r+"."+x,w=y(i,v);(u.array.has(r)||H(g)||w&&!w._f)&&!je(g)?Ee(v,g,c,m,p):we(v,g,c,m,p)}},Je=(r,l,c,m,p=!1)=>{const x=y(i,r),g=u.array.has(r),v=m?l:z(l),w=y(d,r),L=he(w,v);if(L||F(d,r,v),g)b.array.next({name:r,values:m?d:z(d)}),(E.isDirty||E.dirtyFields||f.isDirty||f.dirtyFields)&&c.shouldDirty&&(ne(),p||b.state.next({name:r,dirtyFields:t.dirtyFields,isDirty:W(r,v)}));else{const X=Array.isArray(v)&&!v.length||G(v);!x||x._f||K(v)||X?we(r,v,c,m,p):Ee(r,v,c,m,p)}if(!L&&!p){const X=st(r,u),xe=m?d:z(d);b.state.next({...X&&t,name:n.mount||X?r:void 0,values:xe})}},h=(r,l,c={})=>Je(r,l,c,!1),V=(r,l={})=>{const c=ie(r)?r(d):r;if(!he(d,c)){d={...d,...c};const m=os(c);for(const p of u.mount)p in m&&Je(p,m[p],l,!0,!0);b.state.next({...t,name:void 0,type:void 0,...P?{values:d}:{}}),l.shouldValidate&&I()}},ce=async r=>{n.mount=!0;const l=r.target;let c=l.name,m=!0;const p=y(i,c),x=g=>{m=Number.isNaN(g)||je(g)&&isNaN(g.getTime())||he(g,y(d,c,g))};if(p){let g,v;const w=l.type?zt(p._f):hr(r),L=r.type===ke.BLUR||r.type===ke.FOCUS_OUT,X=!kr(p._f)&&!e.validate&&!s.resolver&&!y(t.errors,c)&&!p._f.deps,xe=X||Cr(L,y(t.touchedFields,c),t.isSubmitted,R,U),ye=st(c,u,L);if(F(d,c,w),L){if(!l||!l.readOnly){p._f.onBlur&&p._f.onBlur(r);const Ie=j[c];Ie&&Ie(0)}}else p._f.onChange&&p._f.onChange(r);const Oe=T(c,w,L),_s=!G(Oe)||ye;if(!L&&b.state.next({name:c,type:r.type,...P?{values:z(d)}:{}}),xe)return(!X||!t.isValid)&&(E.isValid||f.isValid)&&(s.mode==="onBlur"?L&&I():L||I()),_s&&b.state.next({name:c,...ye?{}:Oe});if(!s.resolver&&e.validate&&await Q({name:c,eventType:r.type}),!L&&ye&&b.state.next({...t}),s.resolver){const{errors:Ie}=await D([c]);if(A([c]),x(w),!m){!G(Oe)&&b.state.next(Oe);return}const Es=qt(t.errors,i,c),Nt=qt(Ie,i,Es.name||c);g=Nt.error,c=Nt.name,v=G(Ie)}else A([c],!0),g=(await Ut(p,u.disabled,d,N,s.shouldUseNativeValidation))[c],A([c]),x(w),m&&(g?v=!1:(E.isValid||f.isValid)&&(v=await S({fields:i,onlyCheckValid:!0,name:c,eventType:r.type})));m&&(p._f.deps&&(!Array.isArray(p._f.deps)||p._f.deps.length>0)&&me(p._f.deps),k(c,v,g,Oe))}},se=(r,l)=>{if(y(t.errors,l)&&r.focus)return r.focus(),1},me=async(r,l={})=>{let c,m;const p=We(r);if(s.resolver){const x=await q(M(r)?r:p);c=G(x),m=r?!p.some(g=>y(x,g)):c}else r?(m=(await Promise.all(p.map(async x=>{const g=y(i,x);return await S({fields:g&&g._f?{[x]:g}:g,eventType:ke.TRIGGER})}))).every(Boolean),!(!m&&!t.isValid)&&I()):m=c=await S({fields:i,name:r,eventType:ke.TRIGGER});if(l.delayError&&s.delayError&&Y(r)){const x=y(t.errors,r);x?(B(t.errors,r),j[r]=$(r,()=>ge(r,x)),j[r](s.delayError)):(clearTimeout(_[r]),delete j[r])}return b.state.next({...!Y(r)||(E.isValid||f.isValid)&&c!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:c}:{},errors:t.errors}),l.shouldFocus&&!m&&Le(i,se,r?p:u.mount),m},Ne=(r,l)=>{let c={...n.mount?d:o};return l&&(c=ls(l.dirtyFields?t.dirtyFields:t.touchedFields,c)),M(r)?c:Y(r)?y(c,r):r.map(m=>y(c,m))},Fe=(r,l)=>({invalid:!!y((l||t).errors,r),isDirty:!!y((l||t).dirtyFields,r),error:y((l||t).errors,r),isValidating:!!y(t.validatingFields,r),isTouched:!!y((l||t).touchedFields,r)}),Pe=r=>{const l=r?We(r):void 0;l?.forEach(c=>B(t.errors,c)),l?l.forEach(c=>{b.state.next({name:c,errors:t.errors})}):b.state.next({errors:{}})},ze=(r,l,c)=>{const m=(y(i,r,{_f:{}})._f||{}).ref,p=y(t.errors,r)||{},{ref:x,message:g,type:v,...w}=p;F(t.errors,r,{...w,...l,ref:m}),b.state.next({name:r,errors:t.errors,isValid:!1}),c&&c.shouldFocus&&m&&m.focus&&m.focus()},js=(r,l)=>{if(ie(r)){P++;const{unsubscribe:c}=b.state.subscribe({next:p=>"values"in p&&r(p.values||fe(void 0,l),p)});let m=!1;return{unsubscribe:()=>{m||(m=!0,P--,c())}}}return fe(r,l,!0)},yt=r=>{var l;const c=!!(!((l=r.formState)===null||l===void 0)&&l.values);c&&P++;const{unsubscribe:m}=b.state.subscribe({next:x=>{if(Dr(r.name,x.name,r.exact)&&Vr(x,r.formState||E,Ts,r.reRenderRoot)){const g={...d};r.callback({values:g,...t,...x,defaultValues:o})}}});if(!c)return m;let p=!1;return()=>{p||(p=!0,P--,m())}},Ss=r=>(n.mount=!0,f={...f,...r.formState},yt({...r,formState:{...O,...r.formState}})),Xe=(r,l={})=>{for(const c of r?We(r):u.mount)u.mount.delete(c),u.array.delete(c),l.keepValue||(B(i,c),B(d,c)),!l.keepError&&B(t.errors,c),!l.keepDirty&&B(t.dirtyFields,c),!l.keepTouched&&B(t.touchedFields,c),!l.keepIsValidating&&B(t.validatingFields,c),!s.shouldUnregister&&!l.keepDefaultValue&&B(o,c);b.state.next({values:z(d)}),b.state.next({...t,...l.keepDirty?{isDirty:W()}:{}}),!l.keepIsValid&&I()},vt=({disabled:r,name:l})=>{if(pe(r)&&n.mount||r||u.disabled.has(l)){const p=u.disabled.has(l)!==!!r;r?u.disabled.add(l):u.disabled.delete(l),p&&n.mount&&!n.action&&I()}},et=(r,l={})=>{let c=y(i,r);const m=pe(l.disabled)||pe(s.disabled),p=!u.registerName.has(r)&&c&&c._f&&!c._f.mount;return F(i,r,{...c||{},_f:{...c&&c._f?c._f:{ref:{name:r}},name:r,mount:!0,...l}}),u.mount.add(r),c&&!p?vt({disabled:pe(l.disabled)?l.disabled:s.disabled,name:r}):le(r,!0,l.value),{...m?{disabled:l.disabled||s.disabled}:{},...s.progressive?{required:!!l.required,min:Me(l.min),max:Me(l.max),minLength:Me(l.minLength),maxLength:Me(l.maxLength),pattern:Me(l.pattern)}:{},name:r,onChange:ce,onBlur:ce,ref:x=>{if(x){u.registerName.add(r),et(r,l),u.registerName.delete(r),c=y(i,r);const g=M(x.value)&&x.querySelectorAll&&x.querySelectorAll("input,select,textarea")[0]||x,v=Tr(g),w=c._f.refs||[];if(v?w.find(L=>L===g):g===c._f.ref)return;F(i,r,{_f:{...c._f,...v?{refs:[...w.filter(rt),g,...Array.isArray(y(o,r))?[{}]:[]],ref:{type:g.type,name:r}}:{ref:g}}}),le(r,!1,void 0,g)}else c=y(i,r,{}),c._f&&(c._f.mount=!1),(s.shouldUnregister||l.shouldUnregister)&&!(gr(u.array,r)&&n.action)&&u.unMount.add(r)}}},tt=()=>s.shouldFocusError&&!s.shouldUseNativeValidation&&Le(i,se,u.mount),ws=r=>{pe(r)&&(b.state.next({disabled:r}),Le(i,(l,c)=>{const m=y(i,c);m&&(l.disabled=m._f.disabled||r,Array.isArray(m._f.refs)&&m._f.refs.forEach(p=>{p.disabled=m._f.disabled||r}))},0,!1))},bt=(r,l)=>async c=>{let m;c&&(c.preventDefault&&c.preventDefault(),c.persist&&c.persist());let p=z(d);if(b.state.next({isSubmitting:!0}),s.resolver){const{errors:x,values:g}=await D();A(),t.errors=x,p=z(g)}else await S({fields:i,eventType:ke.SUBMIT});if(u.disabled.size)for(const x of u.disabled)B(p,x);if(B(t.errors,rs),G(t.errors)){b.state.next({errors:{}});try{await r(p,c)}catch(x){m=x}}else l&&await l({...t.errors},c),tt(),setTimeout(tt);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:G(t.errors)&&!m,submitCount:t.submitCount+1,errors:t.errors}),m)throw m},Ns=(r,l={})=>{y(i,r)&&(M(l.defaultValue)?h(r,z(y(o,r))):(h(r,l.defaultValue),F(o,r,z(l.defaultValue))),l.keepTouched||B(t.touchedFields,r),l.keepDirty||(B(t.dirtyFields,r),t.isDirty=l.defaultValue?W(r,z(y(o,r))):W()),l.keepError||(B(t.errors,r),E.isValid&&I()),b.state.next({...t}))},jt=(r,l={})=>{const c=r?z(r):o,m=z(c),p=G(r),x=m,g=i;if(l.keepDefaultValues||(o=c),!l.keepValues){if(l.keepDirtyValues){const v=new Set([...u.mount,...Object.keys(Ae(o,d,void 0,g))]);for(const w of Array.from(v)){const L=y(t.dirtyFields,w),X=y(d,w),xe=y(x,w);L&&!M(X)?F(x,w,X):!L&&!M(xe)&&h(w,xe)}}else{if(Ze&&M(r))for(const v of u.mount){const w=y(i,v);if(w&&w._f){const L=Array.isArray(w._f.refs)?w._f.refs[0]:w._f.ref;if(Ke(L)){const X=L.closest("form");if(X){X.reset();break}}}}if(l.keepFieldsRef)for(const v of u.mount)h(v,y(x,v));else i={}}if(s.shouldUnregister){if(d=l.keepDefaultValues?z(o):{},l.keepFieldsRef)for(const v of u.mount)F(d,v,y(x,v))}else d=z(x);b.array.next({values:{...x}}),b.state.next({name:void 0,type:void 0,values:{...x}})}u={mount:l.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},n.mount=!E.isValid||!!l.keepIsValid||!!l.keepDirtyValues||!s.shouldUnregister&&!G(x),n.watch=!!s.shouldUnregister,n.keepIsValid=!!l.keepIsValid,n.action=!1,l.keepErrors||(t.errors={}),b.state.next({submitCount:l.keepSubmitCount?t.submitCount:0,isDirty:p?!1:l.keepDirty?t.isDirty:l.keepValues?W():!!(l.keepDefaultValues&&!he(r,o)),isSubmitted:l.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:p?{}:l.keepDirtyValues?l.keepDefaultValues&&d?Ae(o,d,void 0,g):t.dirtyFields:l.keepDefaultValues&&r?Ae(o,r,void 0,g):l.keepDirty?t.dirtyFields:{},touchedFields:l.keepTouched?t.touchedFields:{},errors:l.keepErrors?t.errors:{},isSubmitSuccessful:l.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},St=(r,l)=>jt(ie(r)?r(d):r,{...s.resetOptions,...l}),As=(r,l={})=>{const c=y(i,r),m=c&&c._f;if(m){const p=m.refs?m.refs[0]:m.ref;p.focus&&setTimeout(()=>{p.focus(),l.shouldSelect&&ie(p.select)&&p.select()})}},Ts=r=>{const{name:l,type:c,values:m,...p}=r;t={...t,...p}},wt={control:{register:et,unregister:Xe,getFieldState:Fe,handleSubmit:bt,setError:ze,_subscribe:yt,_runSchema:D,_updateIsValidating:A,_focusError:tt,_getWatch:fe,_getDirty:W,_setValid:I,_setFieldArray:ae,_setDisabledField:vt,_setErrors:oe,_getFieldArray:_e,_reset:jt,_resetDefaultValues:()=>ie(s.defaultValues)&&s.defaultValues().then(r=>{St(r,s.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:J,_disableForm:ws,_subjects:b,_proxyFormState:E,get _fields(){return i},get _formValues(){return d},get _state(){return n},set _state(r){n=r},get _defaultValues(){return o},get _names(){return u},set _names(r){u=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r},U=qe(s.mode),R=qe(s.reValidateMode)}},subscribe:Ss,trigger:me,register:et,handleSubmit:bt,watch:js,setValue:h,setValues:V,getValues:Ne,reset:St,resetField:Ns,resetDefaultValues:(r,l={})=>{if(o=z(r),!l.keepDirty){const c=Ae(o,d,void 0,i);t.dirtyFields=c,t.isDirty=!G(c)}l.keepIsValid||I(),b.state.next({...t,defaultValues:o})},clearErrors:Pe,unregister:Xe,setError:ze,setFocus:As,getFieldState:Fe};return{...wt,formControl:wt}}function Rr(e={}){const s=ee.useRef(void 0),t=ee.useRef(void 0),i=ee.useRef(e.formControl),[o,d]=ee.useState(()=>({...z(ps),isLoading:ie(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ie(e.defaultValues)?void 0:e.defaultValues}));if(!s.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)s.current={...e.formControl,formState:o},e.defaultValues&&!ie(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...j}=Ir(e);s.current={...j,formState:o}}const n=s.current.control;return n._options=e,jr(()=>{const u=n._subscribe({formState:n._proxyFormState,callback:()=>d({...n._formState,defaultValues:n._defaultValues}),reRenderRoot:!0});return d(j=>({...j,isReady:!0})),n._formState.isReady=!0,u},[n]),ee.useEffect(()=>n._disableForm(e.disabled),[n,e.disabled]),ee.useEffect(()=>{e.mode&&(n._options.mode=e.mode),e.reValidateMode&&(n._options.reValidateMode=e.reValidateMode)},[n,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(n._setErrors(e.errors),n._focusError())},[n,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&n._subjects.state.next({values:n._getWatch()})},[n,e.shouldUnregister]),ee.useEffect(()=>{if(n._proxyFormState.isDirty){const u=n._getDirty();u!==o.isDirty&&n._subjects.state.next({isDirty:u})}},[n,o.isDirty]),ee.useEffect(()=>{var u;e.values&&!he(e.values,t.current)?(n._reset(e.values,{keepFieldsRef:!0,...n._options.resetOptions}),!((u=n._options.resetOptions)===null||u===void 0)&&u.keepIsValid||n._setValid(),t.current=e.values,d(j=>({...j}))):n._resetDefaultValues()},[n,e.values]),ee.useEffect(()=>{n._state.mount||(n._setValid(),n._state.mount=!0),n._state.watch&&(n._state.watch=!1,n._subjects.state.next({...n._formState})),n._removeUnmounted()}),s.current.formState=ee.useMemo(()=>br(o,n),[n,o]),s.current}const $t=(e,s,t)=>{if(e&&"reportValidity"in e){const i=y(t,s);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},ct=(e,s)=>{for(const t in s.fields){const i=s.fields[t];i&&i.ref&&"reportValidity"in i.ref?$t(i.ref,t,e):i&&i.refs&&i.refs.forEach(o=>$t(o,t,e))}},Wt=(e,s)=>{s.shouldUseNativeValidation&&ct(e,s);const t={};for(const i in e){const o=y(s.fields,i),d=Object.assign(e[i]||{},{ref:o&&o.ref});if(Mr(s.names||Object.keys(e),i)){const n=Object.assign({},y(t,i));F(n,"root",d),F(t,i,n)}else F(t,i,d)}return t},Mr=(e,s)=>{const t=Gt(s).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>Gt(i).match(`^${t}\\.\\d+`))};function Gt(e){return e.replace(/[\[\]]/g,"")}function hs(e,s,t){function i(u,j){var _;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(_=u._zod).traits??(_.traits=new Set),u._zod.traits.add(e),s(u,j);for(const P in n.prototype)P in u||Object.defineProperty(u,P,{value:n.prototype[P].bind(u)});u._zod.constr=n,u._zod.def=j}const o=t?.Parent??Object;class d extends o{}Object.defineProperty(d,"name",{value:e});function n(u){var j;const _=t?.Parent?new d:this;i(_,u),(j=_._zod).deferred??(j.deferred=[]);for(const P of _._zod.deferred)P();return _}return Object.defineProperty(n,"init",{value:i}),Object.defineProperty(n,Symbol.hasInstance,{value:u=>t?.Parent&&u instanceof t.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(n,"name",{value:e}),n}class Lr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Ur={};function gs(e){return Ur}function Hr(e,s){return typeof s=="bigint"?s.toString():s}const xs=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function $e(e){return typeof e=="string"?e:e?.message}function ys(e,s,t){const i={...e,path:e.path??[]};if(!e.message){const o=$e(e.inst?._zod.def?.error?.(e))??$e(s?.error?.(e))??$e(t.customError?.(e))??$e(t.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,s?.reportInput||delete i.input,i}const vs=(e,s)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:s,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(s,Hr,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zr=hs("$ZodError",vs),bs=hs("$ZodError",vs,{Parent:Error}),Br=e=>(s,t,i,o)=>{const d=i?Object.assign(i,{async:!1}):{async:!1},n=s._zod.run({value:t,issues:[]},d);if(n instanceof Promise)throw new Lr;if(n.issues.length){const u=new(o?.Err??e)(n.issues.map(j=>ys(j,d,gs())));throw xs(u,o?.callee),u}return n.value},qr=Br(bs),$r=e=>async(s,t,i,o)=>{const d=i?Object.assign(i,{async:!0}):{async:!0};let n=s._zod.run({value:t,issues:[]},d);if(n instanceof Promise&&(n=await n),n.issues.length){const u=new(o?.Err??e)(n.issues.map(j=>ys(j,d,gs())));throw xs(u,o?.callee),u}return n.value},Wr=$r(bs);function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},dt.apply(null,arguments)}function Kt(e,s){try{var t=e()}catch(i){return s(i)}return t&&t.then?t.then(void 0,s):t}function Gr(e,s){for(var t={};e.length;){var i=e[0],o=i.code,d=i.message,n=i.path.join(".");if(!t[n])if("unionErrors"in i){var u=i.unionErrors[0].errors[0];t[n]={message:u.message,type:u.code}}else t[n]={message:d,type:o};if("unionErrors"in i&&i.unionErrors.forEach(function(P){return P.errors.forEach(function(U){return e.push(U)})}),s){var j=t[n].types,_=j&&j[i.code];t[n]=xt(n,s,t,o,_?[].concat(_,i.message):i.message)}e.shift()}return t}function Kr(e,s){for(var t={},i=function(){var o=e[0],d=o.code,n=o.message,u=o.path.join(".");if(!t[u])if(o.code==="invalid_union"&&o.errors.length>0){var j=o.errors[0][0];t[u]={message:j.message,type:j.code}}else t[u]={message:n,type:d};if(o.code==="invalid_union"&&o.errors.forEach(function(U){return U.forEach(function(R){return e.push(dt({},R,{path:[].concat(o.path,R.path)}))})}),s){var _=t[u].types,P=_&&_[o.code];t[u]=xt(u,s,t,d,P?[].concat(P,o.message):o.message)}e.shift()};e.length;)i();return t}function Yr(e,s,t){if(t===void 0&&(t={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(e))return function(i,o,d){try{return Promise.resolve(Kt(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](i,s)).then(function(n){return d.shouldUseNativeValidation&&ct({},d),{errors:{},values:t.raw?Object.assign({},i):n}})},function(n){if((function(u){return Array.isArray(u?.issues)})(n))return{values:{},errors:Wt(Gr(n.errors,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw n}))}catch(n){return Promise.reject(n)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,o,d){try{return Promise.resolve(Kt(function(){return Promise.resolve((t.mode==="sync"?qr:Wr)(e,i,s)).then(function(n){return d.shouldUseNativeValidation&&ct({},d),{errors:{},values:t.raw?Object.assign({},i):n}})},function(n){if((function(u){return u instanceof zr})(n))return{values:{},errors:Wt(Kr(n.issues,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw n}))}catch(n){return Promise.reject(n)}};throw new Error("Invalid input: not a Zod schema")}const Zr=e=>{const s=ft(),{pushError:t}=Fs(),{data:i}=Jt({...Xt(),staleTime:1/0}),o=i?.accounts.find(j=>j.accountId===e)?.composeLanguages,d=C.useMemo(()=>o&&o.length>0?[...o]:Os(navigator.languages),[o]),n=Se({...es(),onSuccess:()=>{s.invalidateQueries({queryKey:Te()})},onError:j=>{t(Is("Couldn't save languages","The writing languages weren't saved.",j))}}),u=C.useCallback(j=>{e&&n.mutate({path:{accountId:e},body:{composeLanguages:j}})},[e,n]);return{languages:d,setLanguages:u,isSaving:n.isPending}},Qr=e=>e.authType==="oauthMicrosoft",Jr="••••••••••",Xr=e=>{const s=e.smtpUsername?.trim();return s?s!==e.username:!1},ea=Us({email:be().email().min(1,"Email is required"),displayName:be().optional(),username:be().optional(),password:be().optional(),imapHost:be().min(1,"IMAP host is required"),imapPort:_t.number().int().min(1).max(65535),imapTls:Re(),imapStartTls:Re(),smtpHost:be().optional(),smtpPort:_t.number().int().min(1).max(65535).optional(),smtpTls:Re().optional(),smtpStartTls:Re().optional(),smtpUsername:be().optional(),smtpPassword:be().optional(),useDifferentSmtpCreds:Re().optional()}),ta=({isOpen:e,onClose:s,account:t,focusSmtp:i})=>{const o=ft(),d=!!t,[n,u]=C.useState(!1),[j,_]=C.useState(""),[P,U]=C.useState(!1),R=Vt(j),O=!!R&&!P,E=C.useRef(null),f=Rr({resolver:Yr(ea),defaultValues:{email:"",displayName:"",username:"",password:"",imapHost:"",imapPort:993,imapTls:!0,imapStartTls:!1,smtpHost:"",smtpPort:587,smtpTls:!1,smtpStartTls:!0,useDifferentSmtpCreds:!1}});C.useEffect(()=>{if(t){const h=Xr(t);f.reset({email:t.email,displayName:t.displayName||"",username:t.username||"",password:Jr,imapHost:t.imapHost,imapPort:t.imapPort,imapTls:t.imapTls,imapStartTls:t.imapStartTls,smtpHost:t.smtpHost||"",smtpPort:t.smtpPort||587,smtpTls:t.smtpTls||!1,smtpStartTls:t.smtpStartTls||!0,smtpUsername:h&&t.smtpUsername||"",smtpPassword:"",useDifferentSmtpCreds:h}),u(!1)}else f.reset({email:"",displayName:"",username:"",password:"",imapHost:"",imapPort:993,imapTls:!0,imapStartTls:!1,smtpHost:"",smtpPort:587,smtpTls:!1,smtpStartTls:!0,useDifferentSmtpCreds:!1}),u(!1)},[t,f]);const b=Se({...Rs()}),re=Se({...Ms(),onSuccess:()=>{o.invalidateQueries({queryKey:Te()}),s()}}),N=Se({...es(),onSuccess:()=>{o.invalidateQueries({queryKey:Te()}),s()}}),$=()=>{const h=f.getValues(),V=d&&!n;b.mutate({body:{accountId:V?t?.accountId:void 0,username:h.username||h.email,password:V?void 0:h.password||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls}})},I=()=>{const h=f.getValues(),V=d&&!n;b.mutate({body:{accountId:V?t?.accountId:void 0,username:h.username||h.email,password:V?void 0:h.password||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls,smtpHost:h.smtpHost||void 0,smtpPort:h.smtpPort?Number(h.smtpPort):void 0,smtpTls:h.smtpTls,smtpStartTls:h.smtpStartTls,smtpUsername:h.useDifferentSmtpCreds?h.smtpUsername:void 0,smtpPassword:h.useDifferentSmtpCreds?h.smtpPassword:void 0}})},A=f.handleSubmit(h=>{if(!d&&!h.password){f.setError("password",{message:"Password is required"});return}const V=or({imapHost:h.imapHost,smtpHost:h.smtpHost,smtpPort:h.smtpPort,smtpTls:h.smtpTls,smtpStartTls:h.smtpStartTls});V&&(f.setValue("smtpHost",V.smtpHost),f.setValue("smtpPort",V.smtpPort),f.setValue("smtpTls",V.smtpTls),f.setValue("smtpStartTls",V.smtpStartTls));const ce=V?.smtpHost??h.smtpHost,se=V?.smtpPort??h.smtpPort,me=V?.smtpTls??h.smtpTls,Ne=V?.smtpStartTls??h.smtpStartTls,Fe={email:h.email,displayName:h.displayName?.trim()||void 0,username:h.username||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls,smtpHost:ce||void 0,smtpPort:se?Number(se):void 0,smtpTls:me,smtpStartTls:Ne,smtpUsername:h.useDifferentSmtpCreds&&h.smtpUsername||void 0,smtpPassword:h.useDifferentSmtpCreds&&h.smtpPassword||void 0};if(d&&t){const Pe={...Fe,password:n?h.password:void 0};N.mutate({path:{accountId:t.accountId},body:Pe})}else{const Pe={...Fe,password:h.password};re.mutate({body:Pe})}}),ne=re.isPending||N.isPending,{signature:ae,setSignature:ge,isSaving:oe}=nr(t?.accountId),[Z,le]=C.useState(ae.plainText),{languages:T,setLanguages:k,isSaving:D}=Zr(t?.accountId),q=a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Writing languages"}),a.jsx(mr,{value:T,onChange:k,busy:D})]});C.useEffect(()=>{le(ae.plainText)},[ae.plainText]),C.useEffect(()=>{if(!e||!i)return;const h=E.current;if(!h)return;const V=window.setTimeout(()=>{h.scrollIntoView({behavior:"smooth",block:"start"})},250);return()=>window.clearTimeout(V)},[e,i]);const Q=C.useCallback(()=>{Z!==ae.plainText&&ge(Z,Z)},[Z,ae.plainText,ge]),S=h=>{const{tls:V,startTls:ce}=Be(h);f.setValue("imapTls",V),f.setValue("imapStartTls",ce);const se=f.getValues("imapPort");(se===993||se===143)&&f.setValue("imapPort",h==="tls"?993:143)},J=h=>{const{tls:V,startTls:ce}=Be(h);f.setValue("smtpTls",V),f.setValue("smtpStartTls",ce);const se=f.getValues("smtpPort");if(se===465||se===587||se===25){const Ne=h==="tls"?465:h==="starttls"?587:25;f.setValue("smtpPort",Ne)}},W=()=>{const h=f.getValues("imapHost");f.setValue("smtpHost",lr(h)),f.setValue("smtpTls",!1),f.setValue("smtpStartTls",!0),f.setValue("smtpPort",587)},fe=h=>{_(h),U(!1);const V=Vt(h);if(!V)return;const ce=Be(V.imap.security);f.setValue("imapHost",V.imap.host),f.setValue("imapPort",V.imap.port),f.setValue("imapTls",ce.tls),f.setValue("imapStartTls",ce.startTls);const se=Be(V.smtp.security);f.setValue("smtpHost",V.smtp.host),f.setValue("smtpPort",V.smtp.port),f.setValue("smtpTls",se.tls),f.setValue("smtpStartTls",se.startTls);const me=f.getValues("email").trim(),Ne=f.getValues("username")?.trim();me&&!Ne&&f.setValue("username",me)},_e=R?.passwordHelp.text,we=Dt(b.data?.imapError,_e),Ee=Dt(b.data?.smtpError,_e);return(t?Qr(t):!1)&&d?a.jsx(Ct,{isOpen:e,onClose:s,title:"Edit Account",footer:a.jsx(te,{type:"button",variant:"secondary",onClick:s,children:"Close"}),children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Microsoft 365 Account"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken px-3 py-2.5 text-sm text-fg-muted",children:[a.jsx("span",{className:"block text-2xs font-medium uppercase tracking-wider text-fg-subtle mb-1",children:"Email"}),a.jsx("span",{className:"text-fg",children:t?.email})]}),a.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken px-3 py-2.5 text-sm text-fg-muted",children:[a.jsx("span",{className:"block text-2xs font-medium uppercase tracking-wider text-fg-subtle mb-1",children:"Authentication"}),a.jsx("span",{className:"text-fg",children:"Microsoft OAuth (XOAUTH2)"})]}),a.jsx("p",{className:"text-xs text-fg-muted",children:"Server settings are managed automatically for Microsoft 365 accounts. To update credentials, use the Reconnect button."})]})]}),d&&a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Signature"}),a.jsx("div",{className:"space-y-3",children:a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email-sig-view",className:"text-sm font-medium mb-1.5 block",children:"Email Signature"}),a.jsx("textarea",{id:"email-sig-view",value:Z,onChange:h=>le(h.target.value),onBlur:Q,rows:5,className:"w-full px-3 py-2 border border-line rounded-md bg-surface-sunken text-sm text-fg placeholder:text-fg-subtle focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors resize-y outline-none",placeholder:"Enter your email signature..."}),a.jsx("p",{className:"text-xs text-fg-muted mt-1",children:oe?"Saving signature...":"This signature will be appended to new emails."})]})})]}),d&&q]})}):a.jsx(Ct,{isOpen:e,onClose:s,title:d?"Edit Account":"Add Account",footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{type:"button",variant:"secondary",onClick:s,children:"Cancel"}),a.jsx(te,{type:"submit",form:"account-form",variant:"primary",disabled:ne,children:ne?"Saving...":"Save Account"})]}),children:a.jsxs("form",{id:"account-form",onSubmit:A,className:"space-y-6",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Account Information"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-provider",className:"text-sm font-medium mb-1.5 block",children:"Provider"}),a.jsxs(Ls,{id:"account-provider",value:j,onChange:h=>fe(h.target.value),children:[a.jsx("option",{value:"",children:"Custom / other"}),tr.map(h=>a.jsx("option",{value:h.id,children:h.label},h.id))]}),a.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Pick your email provider to fill in server settings automatically, or choose Custom to enter them by hand."})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-email",className:"text-sm font-medium mb-1.5 block",children:"Email Address"}),a.jsx(ve,{id:"account-email",...f.register("email"),placeholder:"alice@example.com"}),f.formState.errors.email&&a.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.email.message})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-displayName",className:"text-sm font-medium mb-1.5 block",children:"Display name (optional)"}),a.jsx(ve,{id:"account-displayName",...f.register("displayName"),placeholder:"Alice"}),a.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-username",className:"text-sm font-medium mb-1.5 block",children:"Username"}),a.jsx(ve,{id:"account-username",...f.register("username"),placeholder:"Same as email if empty"})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-password",className:"text-sm font-medium mb-1.5 block",children:"Password"}),a.jsx(At,{id:"account-password",...f.register("password",{onChange:()=>u(!0)}),onFocus:()=>{d&&!n&&(f.setValue("password",""),u(!0))},placeholder:d?"Leave empty to keep current":""}),f.formState.errors.password&&a.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.password.message}),R&&a.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[R.passwordHelp.text," ",a.jsx("a",{href:R.passwordHelp.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Get an app password"})]})]})]})]}),a.jsxs("section",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider",children:"Incoming Mail (IMAP)"}),R&&a.jsx("button",{type:"button",onClick:()=>U(h=>!h),className:"text-xs text-fg-muted hover:text-fg transition-colors",children:P?"Use preset settings":"Advanced"})]}),O&&a.jsxs("p",{className:"text-xs text-fg-muted mb-3",children:["Server settings are pre-filled for ",R?.label," and locked. Choose Advanced to edit them by hand."]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"imap-host",className:"text-sm font-medium mb-1.5 block",children:"Server"}),a.jsx(ve,{id:"imap-host",...f.register("imapHost"),readOnly:O,placeholder:"imap.example.com"}),f.formState.errors.imapHost&&a.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.imapHost.message})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"imap-port",className:"text-sm font-medium mb-1.5 block",children:"Port"}),a.jsx(ve,{id:"imap-port",...f.register("imapPort"),readOnly:O,type:"number"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm font-medium mb-1.5 block",children:"Security"}),a.jsxs("div",{className:"space-y-1.5 mt-2",children:[a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:f.watch("imapTls"),onChange:()=>S("tls")}),"TLS (Port 993)"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:!f.watch("imapTls")&&f.watch("imapStartTls"),onChange:()=>S("starttls")}),"STARTTLS (Port 143)"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:!f.watch("imapTls")&&!f.watch("imapStartTls"),onChange:()=>S("none")}),"None (Unencrypted)"]})]})]})]}),a.jsx(te,{type:"button",variant:"secondary",onClick:$,disabled:b.isPending,className:"w-full",icon:b.isPending?a.jsx(it,{className:"size-4 animate-spin"}):void 0,children:b.isPending?"Testing...":"Test IMAP Connection"}),b.data&&a.jsxs("div",{className:Ge("p-2 rounded-md text-sm",b.data.imapSuccess?"bg-positive/10 text-positive":"bg-danger-soft text-danger"),children:[b.data.imapSuccess?a.jsx(Tt,{className:"inline size-4 mr-1"}):a.jsx(Ce,{className:"inline size-4 mr-1"}),b.data.imapSuccess?"IMAP Connected":we]})]})]}),a.jsxs("section",{ref:E,"data-testid":"smtp-section",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider",children:"Outgoing Mail (SMTP)"}),!O&&a.jsx("button",{type:"button",onClick:W,disabled:!f.watch("imapHost"),className:"text-xs text-fg-muted hover:text-fg transition-colors disabled:opacity-50",children:"Pre-fill from IMAP"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"smtp-host",className:"text-sm font-medium mb-1.5 block",children:"Server"}),a.jsx(ve,{id:"smtp-host",...f.register("smtpHost"),readOnly:O,placeholder:"smtp.example.com"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"smtp-port",className:"text-sm font-medium mb-1.5 block",children:"Port"}),a.jsx(ve,{id:"smtp-port",...f.register("smtpPort"),readOnly:O,type:"number"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm font-medium mb-1.5 block",children:"Security"}),a.jsxs("div",{className:"space-y-1.5 mt-2",children:[a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:f.watch("smtpTls")===!0,onChange:()=>J("tls")}),"TLS (Port 465)"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:!f.watch("smtpTls")&&f.watch("smtpStartTls")===!0,onChange:()=>J("starttls")}),"STARTTLS (Port 587)"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:!f.watch("smtpTls")&&!f.watch("smtpStartTls"),onChange:()=>J("none")}),"None (Unencrypted)"]})]})]})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"checkbox",...f.register("useDifferentSmtpCreds")}),"Use different credentials for SMTP"]}),f.watch("useDifferentSmtpCreds")&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"smtp-username",className:"text-sm font-medium mb-1.5 block",children:"SMTP Username"}),a.jsx(ve,{id:"smtp-username",...f.register("smtpUsername")})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"smtp-password",className:"text-sm font-medium mb-1.5 block",children:"SMTP Password"}),a.jsx(At,{id:"smtp-password",...f.register("smtpPassword")})]})]}),a.jsx(te,{type:"button",variant:"secondary",onClick:I,disabled:b.isPending||!f.watch("smtpHost"),className:"w-full",icon:b.isPending?a.jsx(it,{className:"size-4 animate-spin"}):void 0,children:b.isPending?"Testing...":"Test SMTP Connection"}),b.data?.smtpSuccess!==void 0&&a.jsxs("div",{className:Ge("p-2 rounded-md text-sm",b.data.smtpSuccess?"bg-positive/10 text-positive":"bg-danger-soft text-danger"),children:[b.data.smtpSuccess?a.jsx(Tt,{className:"inline size-4 mr-1"}):a.jsx(Ce,{className:"inline size-4 mr-1"}),b.data.smtpSuccess?"SMTP Connected":Ee]})]})]}),d&&a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Signature"}),a.jsx("div",{className:"space-y-3",children:a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email-sig-edit",className:"text-sm font-medium mb-1.5 block",children:"Email Signature"}),a.jsx("textarea",{id:"email-sig-edit",value:Z,onChange:h=>le(h.target.value),onBlur:Q,rows:5,className:"w-full px-3 py-2 border border-line rounded-md bg-surface-sunken text-sm text-fg placeholder:text-fg-subtle focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors resize-y outline-none",placeholder:"Enter your email signature..."}),a.jsx("p",{className:"text-xs text-fg-muted mt-1",children:oe?"Saving signature...":"This signature will be appended to new emails."})]})})]}),d&&q]})})};function Yt({open:e,onClose:s,accountEmail:t,signOut:i}){const[o,d]=C.useState(""),[n,u]=C.useState(!1),[j,_]=C.useState(!1),P=Se({...zs(),onSuccess:()=>{_(!0),setTimeout(()=>i(),2e3)}}),U=Se(Bs()),R=()=>{P.isPending||(d(""),u(!1),_(!1),P.reset(),U.reset(),s())},O=()=>{if(o.trim().toLowerCase()!==t.toLowerCase()){u(!0);return}u(!1),P.mutate({body:{confirmEmail:o.trim()}})};return a.jsxs(ts,{open:e,onClose:R,title:"Delete your Remit account",children:[a.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[a.jsx(ut,{className:"size-4 shrink-0 text-danger"}),a.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:"Delete your Remit account"}),a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ce,{className:"size-3.5"}),onClick:R,"aria-label":"Cancel"})]}),j?a.jsxs("div",{className:"px-5 py-6 text-sm text-fg-muted",children:[a.jsx("p",{className:"font-medium text-fg",children:"Account deletion scheduled."}),a.jsx("p",{className:"mt-1",children:"Your data will be erased shortly. Signing you out…"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[a.jsx("p",{children:"This permanently erases everything Remit holds for you:"}),a.jsxs("ul",{className:"space-y-1.5 text-xs",children:[a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-danger",children:"•"}),"All connected accounts disconnected and access tokens revoked."]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-danger",children:"•"}),"Synced mail cache and search index."]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-danger",children:"•"}),"AI history and insights."]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-danger",children:"•"}),"Preferences and rules."]})]}),a.jsxs("div",{className:"rounded-sm border border-line bg-surface-sunken px-3 py-2 text-xs",children:[a.jsx("strong",{className:"text-fg",children:"Your mail at Gmail / IMAP is not deleted."})," ","This only removes Remit's copy and its access — the mail stays in your provider mailboxes."]}),a.jsxs("div",{className:"text-xs",children:[a.jsxs("button",{type:"button",onClick:()=>U.mutate({}),"aria-busy":U.isPending,className:"inline-flex items-center gap-1.5 font-medium text-accent hover:underline",children:[a.jsx(cr,{className:"size-3.5"}),U.isPending?"Requesting export…":"Export my data first"]}),U.isSuccess&&a.jsx("p",{className:"mt-1.5 text-fg-muted",role:"status",children:"Export requested. We'll prepare a ZIP of your mail — find it under your data exports when it's ready."}),U.isError&&a.jsx("p",{className:"mt-1.5 text-danger",role:"alert",children:"Couldn't start the export. Please try again."})]}),a.jsxs("div",{children:[a.jsxs("label",{htmlFor:"confirm-remit-email",className:"mb-1 block text-xs font-medium text-fg",children:["Type"," ",a.jsx("span",{className:"font-mono text-fg-muted",children:t})," ","to confirm"]}),a.jsx(ve,{id:"confirm-remit-email",type:"email",placeholder:t,value:o,onChange:E=>{d(E.target.value),n&&u(!1),P.isError&&P.reset()},autoComplete:"off"}),n&&a.jsx("p",{className:"mt-1.5 text-xs text-danger",role:"alert",children:"That doesn't match your account email. Type it exactly to confirm."}),P.isError&&a.jsx("p",{className:"mt-1.5 text-xs text-danger",role:"alert",children:P.error instanceof Error?P.error.message:"Something went wrong. Please try again."})]})]}),a.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[a.jsx(te,{variant:"secondary",size:"sm",onClick:R,children:"Cancel"}),a.jsx(te,{variant:"danger",size:"sm",onClick:O,"aria-busy":P.isPending,children:P.isPending?"Deleting…":"Delete everything"})]})]})]})}function sa(e){const{Account:s}=Hs();return a.jsx(s,{fallback:a.jsx(Yt,{...e,accountEmail:"",signOut:()=>{}}),children:({email:t,signOut:i})=>a.jsx(Yt,{...e,accountEmail:t??"",signOut:i})})}function ra(){const[e,s]=C.useState(!1);return a.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[a.jsx(pr,{title:"Delete your Remit account",description:"Disconnects every account and erases Remit's copy of your mail, insights and preferences. Your mail at the providers is untouched.",action:a.jsx(te,{variant:"danger",size:"sm",onClick:()=>s(!0),children:"Delete your Remit account"})}),a.jsx(sa,{open:e,onClose:()=>s(!1)})]})}function aa(e){const s=e.toLowerCase();return s==="access_denied"?"You cancelled the sign-in.":s==="scope_not_granted"?"Microsoft did not grant access to every service you picked. Sign in again and accept each permission Microsoft asks for.":s==="consent_required"||s.includes("admin_consent")||s.includes("interaction_required")?"Your organisation's admin needs to approve Remit. Ask your IT admin to grant the required permissions.":s.includes("imap_disabled")||s.includes("imap disabled")?"IMAP is disabled for this account. Ask your admin to enable IMAP access in the Microsoft 365 admin centre.":`Sign-in failed: ${e}. Please try again.`}function ia(e){const s=e.split("@")[0]??"";return s?s.split(/[._-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):e}function na(e){const s=e.displayName?.trim();return s||ia(e.email)}function oa(e){if(!e.lastSyncAt)return"never synced";const s=Qs(e.lastSyncAt);return s?`synced ${s}`:"never synced"}function Zt(e){return e.muted?.value?"muted":e.lastError?"error":e.connectionState==="authenticated"?"healthy":"error"}function Qt(e){return e.connectionState==="reauth_required"}function la(e){return e.connectionState==="credentials_missing"}const ca=()=>a.jsx("div",{className:"space-y-3",role:"status","aria-busy":"true","aria-label":"Loading accounts",children:["skeleton-0","skeleton-1"].map(e=>a.jsx("div",{className:"rounded-sm border border-line bg-surface animate-pulse p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"size-10 rounded-full bg-surface-sunken"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-1/3"}),a.jsx("div",{className:"h-3 bg-surface-sunken rounded w-2/3"})]})]})},e))});function ka(){const e=Et.useSearch(),s=qs({from:Et.fullPath}),[t,i]=C.useState(!0),[o,d]=C.useState(!1),[n,u]=C.useState(!1),[j,_]=C.useState(null),[P,U]=C.useState(!1),[R,O]=C.useState(null),[E,f]=C.useState(null),[b,re]=C.useState(null),[N,$]=C.useState(null),I=ft(),{data:A,isPending:ne,isError:ae,error:ge,refetch:oe}=Jt(Xt());C.useEffect(()=>{e.editAccountId&&(_(e.editAccountId),U(!!e.focusSmtp),s({search:{editAccountId:void 0,focusSmtp:void 0,connected:e.connected,oauthError:e.oauthError},replace:!0}))},[e.editAccountId,e.focusSmtp,s,e.connected,e.oauthError]),C.useEffect(()=>{e.connected&&(f("Account connected successfully."),_(e.connected),I.invalidateQueries({queryKey:Te()}),s({search:{connected:void 0,oauthError:void 0,editAccountId:void 0,focusSmtp:void 0},replace:!0}))},[e.connected,s,I]),C.useEffect(()=>{e.oauthError&&(re(aa(e.oauthError)),$(null),s({search:{oauthError:void 0,connected:void 0,editAccountId:void 0,focusSmtp:void 0},replace:!0}))},[e.oauthError,s]),rr(N!==null,()=>{I.invalidateQueries({queryKey:Te()})}),C.useEffect(()=>{if(!N||!A)return;const S=A.accounts.find(J=>J.accountId===N);(!S||!Qt(S))&&$(null)},[A,N]);const Z=ar(S=>{$(null),S==="stalled"&&re(ir)}),le=Se({...$s(),onSuccess:S=>{Z(),window.location.assign(S.authorizationUrl)},onError:S=>{re(S instanceof Error?S.message:"Failed to start reconnect"),$(null)}}),T=Se({...Ws(),onSuccess:()=>{I.invalidateQueries({queryKey:Te()}),O(null)}}),k=A?.accounts.find(S=>S.accountId===R),D=A?.accounts.find(S=>S.accountId===j),q=()=>{d(!1),u(!1),_(null),U(!1)},Q=S=>{const J=Ys[S];J&&s({to:J})};return a.jsxs(Xs,{items:Gs,activeId:"accounts",title:"Accounts",description:"Every account keeps syncing — muted ones just stay out of unified views.",help:ur,helpOpen:t,onToggleHelp:()=>i(S=>!S),onSelect:Q,onBackToMail:()=>{s({to:"/mail"})},children:[E&&a.jsx(Pt,{tone:"success",variant:"soft","data-testid":"oauth-success-banner",onDismiss:()=>f(null),children:E}),b&&a.jsx(Pt,{tone:"danger",variant:"soft","data-testid":"oauth-error-banner",onDismiss:()=>re(null),children:b}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ks,{tone:"neutral",children:ne||ae?"accounts":`${A.accounts.length} ${A.accounts.length===1?"account":"accounts"}`}),a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(kt,{className:"size-3.5"}),onClick:()=>u(!0),children:"Add account"})]}),ne?a.jsx(ca,{}):ae?a.jsx(dr,{title:"Couldn't load accounts",error:ge,onRetry:()=>{oe()}}):A.accounts.length===0?a.jsxs("div",{className:"py-12 text-sm text-fg-muted","data-testid":"accounts-empty",children:[a.jsx("p",{className:"mb-3",children:"No accounts configured."}),a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(kt,{className:"size-3.5"}),onClick:()=>u(!0),children:"Add your first account"})]}):a.jsx("div",{className:"space-y-3",children:A.accounts.map(S=>{const J=Qt(S),W=la(S),fe=S.authType==="oauthMicrosoft",_e=N===S.accountId,we=J&&fe?{label:"Reconnect",variant:"secondary",busy:_e,busyLabel:"Redirecting…",onClick:()=>{$(S.accountId),le.mutate({body:{email:S.email,services:S.syncedServices}})}}:W?{label:"Enter password",variant:"secondary",onClick:()=>_(S.accountId)}:Zt(S)==="error"?{label:"Reconnect",variant:"secondary",onClick:()=>_(S.accountId)}:{label:"Manage",variant:"ghost",onClick:()=>_(S.accountId)},Ee=a.jsx(Js,{actions:[we],destructive:{label:"Delete account",iconOnly:!0,icon:a.jsx(Zs,{className:"size-3.5"}),onClick:()=>O(S.accountId)}});return a.jsx(er,{label:na(S),email:S.email,connector:fe?"Microsoft 365":"IMAP",syncLabel:oa(S),state:Zt(S),errorDetail:J?S.lastError??"Re-authentication required":W?"Imported from a config file, which carries no password. Enter one to start syncing.":S.lastError,trailing:Ee},S.accountId)})}),n&&a.jsx("div",{className:"fixed inset-0 z-40 overflow-auto bg-canvas",children:a.jsx(sr,{skipWelcome:!0,onComplete:()=>{u(!1),I.invalidateQueries({queryKey:Te()})},onCancel:()=>u(!1)})}),a.jsx(ta,{isOpen:o||!!j,account:D,focusSmtp:P,onClose:q}),a.jsxs(ts,{open:!!R,onClose:()=>O(null),title:"Delete account",children:[a.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[a.jsx(ut,{className:"size-4 shrink-0 text-danger"}),a.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:"Delete account"}),a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ce,{className:"size-3.5"}),onClick:()=>O(null),"aria-label":"Cancel"})]}),a.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[a.jsx("p",{className:"text-center text-lg font-medium text-fg",children:"Are you sure?"}),k&&a.jsx("p",{className:"text-center",children:k.email}),a.jsxs("ul",{className:"list-inside list-disc space-y-1",children:[a.jsx("li",{children:"Remove the account from your settings"}),a.jsx("li",{children:"Stop syncing mail for this account"}),a.jsx("li",{children:"Delete all associated data (within 24 hours)"})]})]}),a.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[a.jsx(te,{variant:"secondary",size:"sm",onClick:()=>O(null),children:"Cancel"}),a.jsx(te,{variant:"danger",size:"sm","aria-busy":T.isPending,icon:T.isPending?a.jsx(it,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>{T.isPending||R&&T.mutate({path:{accountId:R}})},children:T.isPending?"Deleting…":"Delete account"})]})]}),a.jsx(ra,{})]})}export{ka as component,aa as mapOauthError};
|
package/assets/brief-DpNC_lz8.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,O as i}from"./index-Q4feV5hs.js";import{a as m}from"./MailShell-CijmWfSp.js";import{B as o}from"./BriefPane-BcLRbXt0.js";import{a as p}from"./search-token-index-DMotPy3S.js";import{u as e}from"./search-mirror-yAtFv0xR.js";import"./FullCompose-BAl3d_w0.js";import"./ErrorState-ujr_GVkW.js";import"./index-D5i-rZKH.js";import"./useMessageBodyContent-Bh1dkGuL.js";import"./useSignature-CRBwOs1d.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-m9hfoeeT.js";import"./sections-BEjFgOOu.js";import"./confirm-dialog-DStVP_YB.js";import"./useSearchTokenContext-BtJhq-_Q.js";import"./kbd-shPcQMK0.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-B8KqCoIm.js";import"./roving-focus-lu4GUcG_.js";import"./popover-menu-TKxn0teJ.js";import"./mail-C_twG7GL.js";import"./avatar-C5pPOUjS.js";import"./EmptyState-CN1sTl54.js";import"./undo-2-SqKWoGew.js";import"./download--4zu6YFD.js";import"./calendar-suggestion-Coshl0tU.js";import"./calendar-format-D-35Eq-A.js";import"./useQueries-Dt_ZoQnW.js";import"./useCalendars-DB62jljf.js";import"./map-pin-BBn-x2Kl.js";import"./attendee-row-YXbrbIq8.js";import"./clock-zn4wNsRc.js";import"./calendar-clash-strip-BLhPkquh.js";import"./bell-off-CQoLYol5.js";import"./copy-CBi3fm5e.js";import"./shield-check-HOK5b_5p.js";import"./useFilters-MhGWNTRw.js";import"./useLayoutTier-B7U5my6x.js";import"./menu-DTN4EvxK.js";import"./useRefreshControl-C5OCmhS8.js";import"./circle-check-big-BxS7u06D.js";import"./refresh-cw-5HtDVbgJ.js";import"./useSemanticSearch-DfSsCW6c.js";import"./useLabels-BCVlkzT_.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function $(){const t=p();return e({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{$ as component};
|