@remit/web-client-dist 0.0.633 → 0.0.634

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/assets/{BriefPane-mgiwuRg9.js → BriefPane-vy_IYp6r.js} +1 -1
  2. package/assets/{CalendarComposePane-C8OCyygH.js → CalendarComposePane-DB4HeWNS.js} +1 -1
  3. package/assets/{CalendarComposeSeed-BJLZoW6n.js → CalendarComposeSeed-B6nFA_f0.js} +1 -1
  4. package/assets/{CalendarShell-HpApyXbh.js → CalendarShell-BBNjTwSn.js} +1 -1
  5. package/assets/{EmptyState-ByT1Gu5Q.js → EmptyState-vNikAux4.js} +1 -1
  6. package/assets/{ErrorState-lOy9oWsG.js → ErrorState-MkWnA_AH.js} +1 -1
  7. package/assets/{FlaggedPane-ABu3En8n.js → FlaggedPane-CCmpWVCC.js} +1 -1
  8. package/assets/{FullCompose-CJfpPY9W.js → FullCompose-Cw9sBIOx.js} +1 -1
  9. package/assets/{MailListHeader-BWxCXjLF.js → MailListHeader-DeHdq2wd.js} +1 -1
  10. package/assets/{MailNav-DWhkyT8m.js → MailNav-D2043cKq.js} +1 -1
  11. package/assets/{MailShell-BV9UNC34.js → MailShell-CiDN1xD8.js} +1 -1
  12. package/assets/{MailViewChrome-CwBNpH4r.js → MailViewChrome-DaH0OdZq.js} +1 -1
  13. package/assets/{MailboxPane-CF_r6Qn_.js → MailboxPane-C_1U-O7p.js} +1 -1
  14. package/assets/{NavMenuButton-G9j_DlDH.js → NavMenuButton-SR6KExG_.js} +1 -1
  15. package/assets/{OnboardingWizard-AgffmEPL.js → OnboardingWizard-CGX0L-TE.js} +1 -1
  16. package/assets/{OpenCalendarEvent-C0fD7GK1.js → OpenCalendarEvent-BOHQ3TTe.js} +1 -1
  17. package/assets/{OutboxPane-hqh9NzYa.js → OutboxPane-C0oZJfDH.js} +1 -1
  18. package/assets/_calendarObjectId-DJ7Nhp-g.js +1 -0
  19. package/assets/_mailboxId-Ctq4aznJ.js +1 -0
  20. package/assets/_messageId-BJCOJFAi.js +1 -0
  21. package/assets/_messageId-CTg9y1WM.js +1 -0
  22. package/assets/_messageId-DFLQ_8Dt.js +1 -0
  23. package/assets/_outboxMessageId-B1BBhWts.js +1 -0
  24. package/assets/_recurrenceId-DpIw5bG8.js +1 -0
  25. package/assets/_threadId-BaUSofq6.js +1 -0
  26. package/assets/_threadId-Br3ttD7g.js +1 -0
  27. package/assets/_threadId-D3b40dn6.js +1 -0
  28. package/assets/{_view._date-DmyvZaE4.js → _view._date-Mag5-4Ic.js} +1 -1
  29. package/assets/{accounts-DTdyCDrD.js → accounts-ClGO2vyU.js} +1 -1
  30. package/assets/{advanced-C59X86iF.js → advanced-CujH6BnU.js} +1 -1
  31. package/assets/{appearance-hZfF_gnE.js → appearance-8UUN0RGZ.js} +1 -1
  32. package/assets/{attendee-row-aOKxNWMD.js → attendee-row-BdVO9YBH.js} +1 -1
  33. package/assets/{avatar-pYJD4LCB.js → avatar-BzaP_y_q.js} +1 -1
  34. package/assets/{bell-off-D9rYrUVT.js → bell-off-CETTrJrt.js} +1 -1
  35. package/assets/{bottom-sheet-DD_X_Lv6.js → bottom-sheet-BMunxmHD.js} +1 -1
  36. package/assets/{brief-NnJWKuDi.js → brief-AZsd-Cmv.js} +1 -1
  37. package/assets/brief-OUnRzM3V.js +1 -0
  38. package/assets/{browser-ponyfill-Cf6rRFf8.js → browser-ponyfill-CEeOUpKI.js} +1 -1
  39. package/assets/{bug-MPpCckiP.js → bug-CRjU1tIq.js} +1 -1
  40. package/assets/{calendar-DAkM9bOK.js → calendar-CI2dKpjb.js} +1 -1
  41. package/assets/{calendar-clash-strip-BqcFrBRc.js → calendar-clash-strip-C-v3coN1.js} +1 -1
  42. package/assets/{calendar-format-x-1AymaW.js → calendar-format-Ch4ZatHK.js} +1 -1
  43. package/assets/{calendar-report-Cf2ve-41.js → calendar-report-zFqpuKO8.js} +1 -1
  44. package/assets/{calendar-suggestion-BfpRtMnb.js → calendar-suggestion-z_AVgOCk.js} +1 -1
  45. package/assets/{calendars-C-Q4wy4V.js → calendars-DXHUMr0r.js} +1 -1
  46. package/assets/{card-DIdrYGds.js → card-ahXePaGc.js} +1 -1
  47. package/assets/{checkbox-DUtcTeBq.js → checkbox-pZa9S0p_.js} +1 -1
  48. package/assets/chevron-left-D8iIV_aC.js +1 -0
  49. package/assets/{circle-check-7STILCER.js → circle-check-CPBWxFDr.js} +1 -1
  50. package/assets/{circle-check-big-CfQbbZSe.js → circle-check-big-_JWisn_m.js} +1 -1
  51. package/assets/{circle-help-DCDtKNKZ.js → circle-help-CJ1KaD6i.js} +1 -1
  52. package/assets/{clock-8NSnUnYb.js → clock-CyGn-j-o.js} +1 -1
  53. package/assets/compose._-_outboxMessageId_-BsrFBdYj.js +1 -0
  54. package/assets/compose._-_outboxMessageId_-CBCUcOQP.js +1 -0
  55. package/assets/compose._-_outboxMessageId_-Cl1uSbP1.js +1 -0
  56. package/assets/compose._-_outboxMessageId_-D2fcLnlL.js +1 -0
  57. package/assets/{config-import-CjdBZe0f.js → config-import-PsleY4IF.js} +1 -1
  58. package/assets/{confirm-dialog-Bmgy9_rb.js → confirm-dialog-DUV0fEd3.js} +1 -1
  59. package/assets/{copy-CpGnsr3_.js → copy-D5CeLMkV.js} +1 -1
  60. package/assets/{credential-steps-Brnf4ED3.js → credential-steps-B17eE_3M.js} +1 -1
  61. package/assets/{download-B5vMU4mu.js → download-C4XKs49j.js} +1 -1
  62. package/assets/{file-json-CKTJc-DA.js → file-json-7ow4D5Mz.js} +1 -1
  63. package/assets/filters-DQInzU7Y.js +1 -0
  64. package/assets/flagged-DDNJwwsC.js +1 -0
  65. package/assets/{flagged-CzDGg02J.js → flagged-Vc5VZZr_.js} +1 -1
  66. package/assets/{folders-BlfZq-xA.js → folders-DRiA49H2.js} +1 -1
  67. package/assets/{help-copy-DYz-SVwI.js → help-copy-NsI0UN_l.js} +1 -1
  68. package/assets/import-Ck3z9u7s.js +1 -0
  69. package/assets/{index-BmR_2vd-.js → index-B4o5v1F5.js} +1 -1
  70. package/assets/index-BJCOJFAi.js +1 -0
  71. package/assets/{index-JvL7NOOT.js → index-BKXywaqj.js} +4 -4
  72. package/assets/index-Bhlyaw1n.js +1 -0
  73. package/assets/index-CmvxMIY5.js +1 -0
  74. package/assets/index-CyAbUMwh.js +1 -0
  75. package/assets/index-DFLQ_8Dt.js +1 -0
  76. package/assets/index-DSab0RVh.js +1 -0
  77. package/assets/index-DbH2QfiI.js +1 -0
  78. package/assets/{index-B35L-Beh.js → index-DkijjMA0.js} +4 -4
  79. package/assets/index-DxWzW_qm.js +1 -0
  80. package/assets/index-m2CGtMA2.js +1 -0
  81. package/assets/{kbd-DEjfq9k-.js → kbd-Cmz62yKU.js} +1 -1
  82. package/assets/{labels-Bek9fcco.js → labels-DxHVj4IJ.js} +1 -1
  83. package/assets/{mail-B04n2cXx.js → mail-DR33AcdE.js} +1 -1
  84. package/assets/{mail-CIA62edO.js → mail-DhO8CS3i.js} +1 -1
  85. package/assets/{menu-BoIu1FfU.js → menu-BNeG0Yhm.js} +1 -1
  86. package/assets/minus-CEjs47xp.js +1 -0
  87. package/assets/{new-DlWlLikN.js → new-CXwTYbAV.js} +1 -1
  88. package/assets/onboarding-C4IfuhAu.js +1 -0
  89. package/assets/{onboarding-completion-Vf4AlB2g.js → onboarding-completion-DJDYDB_M.js} +1 -1
  90. package/assets/outbox-CecuKwoU.js +1 -0
  91. package/assets/{pane-header-BW-iAwQv.js → pane-header-B8UoIQwX.js} +1 -1
  92. package/assets/{pencil-D4L00dK0.js → pencil-Cc2HbaRE.js} +1 -1
  93. package/assets/{popover-menu-ndRLkI9F.js → popover-menu-B4_qYf1U.js} +1 -1
  94. package/assets/{refresh-cw-DNKXC09U.js → refresh-cw-8q8pd7J0.js} +1 -1
  95. package/assets/{rich-text-Djblrh2N.js → rich-text-B3Pqno9m.js} +1 -1
  96. package/assets/{rich-text-spellcheck-worker-provider-UCzOxQ6c.js → rich-text-spellcheck-worker-provider-DMWlviYu.js} +1 -1
  97. package/assets/{rotate-ccw-Dbjk6oUv.js → rotate-ccw-Bgg1HwEo.js} +1 -1
  98. package/assets/{roving-focus-DkDN4BU_.js → roving-focus-DOpKwxIm.js} +1 -1
  99. package/assets/{row-actions-VNJRTDlw.js → row-actions-vBpGC0JB.js} +1 -1
  100. package/assets/{search-mirror-0dWFcBnP.js → search-mirror-Bkr8j6On.js} +1 -1
  101. package/assets/{search-token-index-BtlfcrE4.js → search-token-index-B4_v9qNk.js} +1 -1
  102. package/assets/{sections-CmtFaATd.js → sections-8wmuEx77.js} +1 -1
  103. package/assets/{senders-CRrzN6rH.js → senders-C0Ibm3Lc.js} +1 -1
  104. package/assets/settings-77D0cFP0.js +1 -0
  105. package/assets/{settings-screen-DtaOQKyP.js → settings-screen-DDkJSfc2.js} +1 -1
  106. package/assets/{shield-check-D_54Wl8K.js → shield-check-wbP9Pmjg.js} +1 -1
  107. package/assets/{suggested-vips-BXHIzIUY.js → suggested-vips-D0mrMUT4.js} +1 -1
  108. package/assets/{undo-2-TZSl58QT.js → undo-2-Boit1GsT.js} +1 -1
  109. package/assets/{useCalendarData-BkgGbKw4.js → useCalendarData-BSd7U7Ed.js} +1 -1
  110. package/assets/{useCalendarWrites-BkFeh-BY.js → useCalendarWrites-C7lTJVSJ.js} +1 -1
  111. package/assets/{useCalendars-CHGwm2tA.js → useCalendars-BPcGiSxU.js} +1 -1
  112. package/assets/{useDebouncedValue-Dasyblh3.js → useDebouncedValue-m0z_HnbO.js} +1 -1
  113. package/assets/useFilters-jZLUyKcu.js +1 -0
  114. package/assets/{useLabels-BPGhj-Hw.js → useLabels-D2-mQooI.js} +1 -1
  115. package/assets/{useLayoutTier-DGCxVtYf.js → useLayoutTier-cKkwHb7Q.js} +1 -1
  116. package/assets/{useMessageBodyContent-CDZhnuFx.js → useMessageBodyContent-CLvOMnCF.js} +1 -1
  117. package/assets/{useQueries-CG7A63o2.js → useQueries-CmbTgxFM.js} +1 -1
  118. package/assets/{useRefreshControl-Dy0MbIBR.js → useRefreshControl-DXttB2fO.js} +1 -1
  119. package/assets/{useResultFolderIndex-C4MzvJSk.js → useResultFolderIndex-Dh-WUOcE.js} +1 -1
  120. package/assets/{useSearchTokenContext-DCNyVMih.js → useSearchTokenContext-BX5ihJio.js} +1 -1
  121. package/assets/{useSemanticSearch-Br4oTbAk.js → useSemanticSearch-DeUrPphU.js} +1 -1
  122. package/assets/{useSignature-BiJchsQV.js → useSignature-jnMomtrH.js} +1 -1
  123. package/index.html +1 -1
  124. package/package.json +1 -1
  125. package/assets/_calendarObjectId-s2QGsHkK.js +0 -1
  126. package/assets/_mailboxId-aqYfy-nL.js +0 -1
  127. package/assets/_messageId-BmUq12TV.js +0 -1
  128. package/assets/_messageId-Bwwgt809.js +0 -1
  129. package/assets/_messageId-DxKD9YHn.js +0 -1
  130. package/assets/_outboxMessageId-lGsDFXKf.js +0 -1
  131. package/assets/_recurrenceId-BDttLIbh.js +0 -1
  132. package/assets/_threadId-2dLcjrUO.js +0 -1
  133. package/assets/_threadId-BxpLhDIN.js +0 -1
  134. package/assets/_threadId-zlX1k6qc.js +0 -1
  135. package/assets/brief-C0hM3LlK.js +0 -1
  136. package/assets/chevron-left-BhcXrgJJ.js +0 -1
  137. package/assets/compose._-_outboxMessageId_-B5fdNLIB.js +0 -1
  138. package/assets/compose._-_outboxMessageId_-BM4tI3Gt.js +0 -1
  139. package/assets/compose._-_outboxMessageId_-Ct9qBLMK.js +0 -1
  140. package/assets/compose._-_outboxMessageId_-Dp8xuo_5.js +0 -1
  141. package/assets/filters-CkmIwXL0.js +0 -1
  142. package/assets/flagged-PXdGk5Jo.js +0 -1
  143. package/assets/import-B7zgS3x5.js +0 -1
  144. package/assets/index-BM48DNLo.js +0 -1
  145. package/assets/index-Bwwgt809.js +0 -1
  146. package/assets/index-C7e4dDMm.js +0 -1
  147. package/assets/index-CZc1f6iR.js +0 -1
  148. package/assets/index-Dlo6Af1O.js +0 -1
  149. package/assets/index-DsQGJCt0.js +0 -1
  150. package/assets/index-DxKD9YHn.js +0 -1
  151. package/assets/index-G_CJZn4M.js +0 -1
  152. package/assets/index-XE_Yht9W.js +0 -1
  153. package/assets/minus-nUrea2mK.js +0 -1
  154. package/assets/onboarding-BCYsbV5G.js +0 -1
  155. package/assets/outbox-BJOCTOIE.js +0 -1
  156. package/assets/settings-Bkpqnd9B.js +0 -1
  157. package/assets/useFilters-Bvbtlnnx.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as m,i as b,eF as x,c as M,eG as D,e0 as I,eH as P,h as v,eI as N,eJ as L,eK as T,eL as w,bm as z}from"./index-BKXywaqj.js";const G=(e,t)=>{if(e.state==="Expired")return"Expired";const r=e.state==="Disabled"?"Disabled":"Active";if(e.scope!=="Temporary"||!e.expiresAt)return r;const s=Date.parse(e.expiresAt);return Number.isNaN(s)?r:s<=t?"Expired":r},y={UserDisabled:"Turned off. Turn it on to run it on new mail again.",AwaitingFolder:"Off until its folder exists on the mail server. It turns on by itself once the folder is created.",FolderCreateFailed:"Off: the mail server refused to create its folder. Pick another folder in the rule, then turn it on.",FolderMissing:"Off: the folder it moves mail into no longer exists. Pick another folder in the rule, then turn it on."},V=e=>e.disabledReason==="None"?void 0:(e.disabledReason==="AwaitingFolder"||e.disabledReason==="FolderCreateFailed")&&e.actionMailboxId!=="None"?y.UserDisabled:y[e.disabledReason],Y=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"})},F=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,n,i]=r,a=new Date(Number(s),Number(n)-1,Number(i),23,59,59,0);if(Number.isNaN(a.getTime()))return;const o=-t.getTimezoneOffset(),c=o>=0?"+":"-",u=Math.abs(o),d=String(Math.floor(u/60)).padStart(2,"0"),f=String(u%60).padStart(2,"0"),l=p=>String(p).padStart(2,"0");return`${a.getFullYear()}-${l(a.getMonth()+1)}-${l(a.getDate())}T${l(a.getHours())}:${l(a.getMinutes())}:${l(a.getSeconds())}${c}${d}:${f}`},h="None",X=e=>!e.literalClauses.some(t=>t.field==="HasWords"),A=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),Z=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",ee=({mode:e,ruleScope:t,anchorMessageId:r,clauses:s,matchOperator:n,moveMailboxId:i,until:a})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:n==="all"?"And":"Or",literalClauses:s.map(o=>({field:o.field,value:o.value})),moveMailboxId:i,expiresAt:t==="until"?F(a??""):void 0}),C=(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}:{}}),R=new Set(["Complete","Failed"]),O=e=>e!==void 0&&R.has(e),k=1e3,_=15e3,J=e=>{const t=Math.max(0,e),r=k*2**t;return Math.min(r,_)},$=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},te=e=>{const[t,r]=m.useState(),s=b({...x(),onSuccess:g=>r(g.organizeJobId)}),{mutate:n}=s,i=M({...D({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const E=g.state.data?.state;return O(E)?!1:J(g.state.dataUpdateCount)}}),a=m.useCallback(g=>{e&&n({path:{accountId:e},body:A(g)})},[e,n]),{refetch:o}=i,c=m.useCallback(()=>{o()},[o]),u=i.data,d=s.isPending?void 0:u,f=d?.state??s.data?.state,l=O(d?.state),p={state:f,matchedCount:d?.matchedCount??0,appliedCount:d?.appliedCount??0,failedCount:d?.failedCount??0,errorMessage:d?.errorMessage??""};return{start:a,refreshStatus:c,progress:p,isStarting:s.isPending,isRunning:!!t&&!l,isDone:l,failure:$(s.error,i.error,!!u)}},re=["From","Subject","HasWords","ListId","FromDomain"],U=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},se=(e,t)=>e==="ListId"?U(t):t.trim(),q=e=>e==="all"?"And":"Or",Q=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,s=e.clauses.map(n=>({field:n.field,value:n.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:q(e.matchOperator),literalClauses:s}},H=e=>e.anchorMessageId!==void 0||!e.literalClauses.some(t=>t.field==="HasWords"),K=e=>JSON.stringify({anchor:e.anchorMessageId??null,operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),ae=(e,t)=>{const r=Q(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?F(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}},B=350,ne=(e,t,r)=>{const s=b(I()),{mutateAsync:n}=s,i=K(t),[a,o]=m.useState(()=>({})),c=m.useRef(t);c.current=t;const u=m.useRef(i),d=H(t);return m.useEffect(()=>{if(!e||!d||i===a.previewedSignature||i===a.errorSignature)return;const f=setTimeout(()=>{const l=i;u.current=l,n({path:{accountId:e},body:A({...c.current})}).then(p=>{u.current===l&&o({count:p.matchedCount,matchedIds:p.messageIds,indexEmpty:p.semanticIndexEmpty===!0,previewedSignature:l})}).catch(p=>{u.current===l&&o(g=>({...g,error:p instanceof Error?p.message:"Couldn't count matches.",errorSignature:l}))})},B);return()=>clearTimeout(f)},[e,d,i,a.previewedSignature,a.errorSignature,n]),d?{count:j(a,i),matchedIds:a.previewedSignature===i?a.matchedIds??[]:[]}:{count:{status:"error",reason:P},matchedIds:[]}},S=e=>L({path:{accountId:e}}),ie=e=>{const t=M({...T({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},oe=e=>{const t=v(),r=b({...N(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s,mutateAsync:n}=r,i=m.useCallback((o,c,u)=>{e&&s({path:{accountId:e},body:C(o,c,u)})},[e,s]),a=m.useCallback(async(o,c,u)=>e?n({path:{accountId:e},body:C(o,c,u)}).then(()=>!0,()=>!1):!1,[e,n]);return{createFilter:i,createFilterAsync:a,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},le=e=>{const t=v(),r=b({...w(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s}=r;return{deleteFilter:m.useCallback(i=>{e&&s({path:{accountId:e,filterId:i}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},ue=e=>{const t=v(),r=b({...z(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s,variables:n}=r,i=m.useCallback((o,c)=>{e&&s({path:{accountId:e,filterId:o},body:{state:c?"Active":"Disabled"}})},[e,s]),a=m.useCallback(()=>{n&&s(n)},[s,n]);return{toggleFilter:i,retry:a,togglingFilterId:r.isPending?n?.path.filterId:void 0,isError:r.isError,error:r.error,enabling:n?.body?.state==="Active"}};export{h as N,re as S,te as a,S as b,ae as c,V as d,Y as e,G as f,ie as g,le as h,ue as i,A as j,oe as k,ee as l,X as m,se as n,Z as o,F as p,Q as r,ne as u};
@@ -1 +1 @@
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-JvL7NOOT.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
+ 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-BKXywaqj.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{c1 as s,c2 as e}from"./index-JvL7NOOT.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
+ import{c1 as s,c2 as e}from"./index-BKXywaqj.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,cn as O,co as N,a9 as h,cp as B,q as P,ab as U,h as $,c as D,cN as F,cO as v}from"./index-JvL7NOOT.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
+ 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,cN as F,cO as v}from"./index-BKXywaqj.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{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-JvL7NOOT.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
+ 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-BKXywaqj.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,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-JvL7NOOT.js";import{C as Y}from"./circle-check-big-CfQbbZSe.js";import{R as Z}from"./refresh-cw-DNKXC09U.js";import{u as P}from"./useQueries-CG7A63o2.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
+ 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-BKXywaqj.js";import{C as Y}from"./circle-check-big-_JWisn_m.js";import{R as Z}from"./refresh-cw-8q8pd7J0.js";import{u as P}from"./useQueries-CmbTgxFM.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,b7 as t}from"./index-JvL7NOOT.js";import{u as m}from"./useQueries-CG7A63o2.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
+ import{K as r,r as s,b7 as t}from"./index-BKXywaqj.js";import{u as m}from"./useQueries-CmbTgxFM.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,cu as Y,t as b,I as X,h as Z,at as J,i as ee,av as te,cN as se,bS as re,ab as ne,a0 as ae,X as oe,d6 as _,d7 as I,C as ie,co as ce}from"./index-JvL7NOOT.js";import{K as A}from"./kbd-DEjfq9k-.js";import{B as le,b as de}from"./useMessageBodyContent-CDZhnuFx.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`
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,cN as se,bS as re,ab as ne,a0 as ae,X as oe,d6 as _,d7 as I,C as ie,co as ce}from"./index-BKXywaqj.js";import{K as A}from"./kbd-Cmz62yKU.js";import{B as le,b as de}from"./useMessageBodyContent-CLvOMnCF.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};
@@ -1 +1 @@
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,dy as w,j as p,em as h,en as D,eo as _,C as j,co as z,c as N,dS as Q,d6 as O}from"./index-JvL7NOOT.js";import{c as U}from"./popover-menu-ndRLkI9F.js";import{ai as q}from"./MailListHeader-BWxCXjLF.js";import{a as P}from"./useLabels-BPGhj-Hw.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-DCNyVMih.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&&w(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 ${D(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(_,{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}=j(),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"),S=i.find(o=>o.type==="in"),x=F({browsed:l,callerMailboxId:e,inTokenMailboxId:S?.mailboxId}),{data:T,isLoading:C}=N({...Q({query:{query:a,mailboxId:x,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
+ 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,dy as w,j as p,em as h,en as D,eo as _,C as j,co as z,c as N,dS as Q,d6 as O}from"./index-BKXywaqj.js";import{c as U}from"./popover-menu-B4_qYf1U.js";import{ai as q}from"./MailListHeader-DeHdq2wd.js";import{a as P}from"./useLabels-D2-mQooI.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-BX5ihJio.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&&w(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 ${D(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(_,{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}=j(),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"),S=i.find(o=>o.type==="in"),x=F({browsed:l,callerMailboxId:e,inTokenMailboxId:S?.mailboxId}),{data:T,isLoading:C}=N({...Q({query:{query:a,mailboxId:x,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-JvL7NOOT.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};
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-BKXywaqj.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-JvL7NOOT.js"></script>
41
+ <script type="module" crossorigin src="/assets/index-BKXywaqj.js"></script>
42
42
  <link rel="stylesheet" crossorigin href="/assets/index-BZsbyrwY.css">
43
43
  </head>
44
44
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client-dist",
3
- "version": "0.0.633",
3
+ "version": "0.0.634",
4
4
  "description": "Built Remit web client — static assets and the default runtime config.",
5
5
  "files": [
6
6
  "**/*"
@@ -1 +0,0 @@
1
- import{O as o}from"./index-JvL7NOOT.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{aj as m,j as o,O as p}from"./index-JvL7NOOT.js";import{a}from"./MailShell-BV9UNC34.js";import{M as r}from"./MailboxPane-CF_r6Qn_.js";import{a as e}from"./search-token-index-BtlfcrE4.js";import{u as s}from"./search-mirror-0dWFcBnP.js";import"./FullCompose-CJfpPY9W.js";import"./ErrorState-lOy9oWsG.js";import"./index-B35L-Beh.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-Dy0MbIBR.js";import"./circle-check-big-CfQbbZSe.js";import"./refresh-cw-DNKXC09U.js";import"./useQueries-CG7A63o2.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./EmptyState-ByT1Gu5Q.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./MailViewChrome-CwBNpH4r.js";import"./pane-header-BW-iAwQv.js";import"./NavMenuButton-G9j_DlDH.js";import"./useLabels-BPGhj-Hw.js";import"./useSemanticSearch-Br4oTbAk.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-DD_X_Lv6.js";import"./circle-help-DCDtKNKZ.js";import"./circle-check-7STILCER.js";function so(){const{mailboxId:t}=m.useParams(),i=e();return s({to:"/mail/$mailboxId",params:{mailboxId:t}}),o.jsx(r,{mailboxId:t,thread:i,children:o.jsx(a,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(p,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{so as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-JvL7NOOT.js";import{F as r}from"./FlaggedPane-ABu3En8n.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./useQueries-CG7A63o2.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./MailViewChrome-CwBNpH4r.js";import"./refresh-cw-DNKXC09U.js";import"./wizard-selection-DxUM65kM.js";function Q(){return o.jsx(r.Reading,{})}export{Q as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-JvL7NOOT.js";import{M as r}from"./MailboxPane-CF_r6Qn_.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-Dy0MbIBR.js";import"./circle-check-big-CfQbbZSe.js";import"./refresh-cw-DNKXC09U.js";import"./useQueries-CG7A63o2.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./MailViewChrome-CwBNpH4r.js";import"./pane-header-BW-iAwQv.js";import"./NavMenuButton-G9j_DlDH.js";import"./useLabels-BPGhj-Hw.js";import"./useSemanticSearch-Br4oTbAk.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-DD_X_Lv6.js";import"./circle-help-DCDtKNKZ.js";import"./circle-check-7STILCER.js";function _(){return o.jsx(r.Reading,{})}export{_ as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-JvL7NOOT.js";import{B as o}from"./BriefPane-mgiwuRg9.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./useQueries-CG7A63o2.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./useRefreshControl-Dy0MbIBR.js";import"./circle-check-big-CfQbbZSe.js";import"./refresh-cw-DNKXC09U.js";import"./useSemanticSearch-Br4oTbAk.js";import"./useLabels-BPGhj-Hw.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function V(){return r.jsx(o.Reading,{})}export{V as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-JvL7NOOT.js";import{O as t}from"./OutboxPane-hqh9NzYa.js";import"./roving-focus-DkDN4BU_.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-CfQbbZSe.js";import"./clock-8NSnUnYb.js";import"./row-actions-VNJRTDlw.js";import"./rotate-ccw-Dbjk6oUv.js";import"./pane-header-BW-iAwQv.js";import"./NavMenuButton-G9j_DlDH.js";import"./menu-BoIu1FfU.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function R(){return o.jsx(t.Reading,{})}export{R as component};
@@ -1 +0,0 @@
1
- import{eX as o,j as m}from"./index-JvL7NOOT.js";import{O as p}from"./OpenCalendarEvent-C0fD7GK1.js";import"./CalendarComposePane-C8OCyygH.js";import"./calendar-format-x-1AymaW.js";import"./useQueries-CG7A63o2.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./attendee-row-aOKxNWMD.js";import"./avatar-pYJD4LCB.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-report-Cf2ve-41.js";import"./mail-B04n2cXx.js";import"./pencil-D4L00dK0.js";import"./useCalendarWrites-BkFeh-BY.js";import"./ErrorState-lOy9oWsG.js";import"./useCalendarData-BkgGbKw4.js";import"./calendar-subscription-B-aAc2Gy.js";function v(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:t})}export{v as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-JvL7NOOT.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-JvL7NOOT.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-JvL7NOOT.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{j as r,O as i}from"./index-JvL7NOOT.js";import{a as m}from"./MailShell-BV9UNC34.js";import{B as o}from"./BriefPane-mgiwuRg9.js";import{a as p}from"./search-token-index-BtlfcrE4.js";import{u as e}from"./search-mirror-0dWFcBnP.js";import"./FullCompose-CJfpPY9W.js";import"./ErrorState-lOy9oWsG.js";import"./index-B35L-Beh.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./EmptyState-ByT1Gu5Q.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useQueries-CG7A63o2.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./useRefreshControl-Dy0MbIBR.js";import"./circle-check-big-CfQbbZSe.js";import"./refresh-cw-DNKXC09U.js";import"./useSemanticSearch-Br4oTbAk.js";import"./useLabels-BPGhj-Hw.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function or(){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{or as component};
@@ -1 +0,0 @@
1
- import{e}from"./index-JvL7NOOT.js";const t=e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);export{t as C};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-CJfpPY9W.js";import"./index-JvL7NOOT.js";import"./ErrorState-lOy9oWsG.js";import"./index-B35L-Beh.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./confirm-dialog-Bmgy9_rb.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-CJfpPY9W.js";import"./index-JvL7NOOT.js";import"./ErrorState-lOy9oWsG.js";import"./index-B35L-Beh.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./confirm-dialog-Bmgy9_rb.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-CJfpPY9W.js";import"./index-JvL7NOOT.js";import"./ErrorState-lOy9oWsG.js";import"./index-B35L-Beh.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./confirm-dialog-Bmgy9_rb.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-CJfpPY9W.js";import"./index-JvL7NOOT.js";import"./ErrorState-lOy9oWsG.js";import"./index-B35L-Beh.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./confirm-dialog-Bmgy9_rb.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{h as X,i as Z,bl as ee,bm as te,r as x,bn as se,j as t,bo as ae,bp as ie,L as R,f as N,bq as ne,aM as re,g as oe,br as le,bs as ce,a3 as de,c as P,K as me,bt as ue,ae as pe,af as xe,bu as fe,bv as he,u as ge,d as be,aP as ve,aR as ye}from"./index-JvL7NOOT.js";import{S as je}from"./settings-screen-DtaOQKyP.js";import{B as Ne}from"./bottom-sheet-DD_X_Lv6.js";import{u as Ce,a as Se}from"./useLabels-BPGhj-Hw.js";import{b as Fe,N as S,p as Me,u as Ie,r as we,a as Ee,S as L,c as Oe,n as De,f as Ae,d as Le,e as ke,g as Te}from"./useFilters-Bvbtlnnx.js";import{C as A}from"./circle-check-7STILCER.js";import{E as $}from"./ErrorState-lOy9oWsG.js";import"./avatar-pYJD4LCB.js";import"./chevron-left-BhcXrgJJ.js";import"./menu-BoIu1FfU.js";import"./circle-help-DCDtKNKZ.js";const Re=(e,s)=>{const r=X(),i=Z({...te(),onSuccess:()=>{e&&(r.invalidateQueries({queryKey:Fe(e)}),s&&r.invalidateQueries({queryKey:ee({path:{accountId:e,filterId:s}})}))}}),{mutate:c}=i;return{updateFilter:x.useCallback(d=>{!e||!s||c({path:{accountId:e,filterId:s},body:d})},[e,s,c]),isPending:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error,reset:i.reset}},Pe=(e,s=!1)=>({clauses:e.literalClauses.map((i,c)=>({id:`clause-${c}`,field:i.field,value:i.value})),matchOperator:e.matchOperator==="And"?"all":"any",widen:e.hasAnchor?{anchorCount:1,...s?{inactive:!0}:{}}:void 0,moveMailboxId:e.actionMailboxId!==S?e.actionMailboxId:void 0,labelId:e.actionLabelId!==S?e.actionLabelId:void 0,scope:e.scope==="Temporary"?"until":"standing",until:e.scope==="Temporary"?$e(e.expiresAt):void 0,name:e.name}),$e=e=>{if(!e)return"";const s=Date.parse(e);if(Number.isNaN(s))return"";const r=new Date(s),i=c=>String(c).padStart(2,"0");return`${r.getFullYear()}-${i(r.getMonth()+1)}-${i(r.getDate())}`},k=e=>JSON.stringify({clauses:e.clauses.map(s=>[s.field,s.value]),operator:e.matchOperator,move:e.moveMailboxId??null,label:e.labelId??null,widen:e.widen?e.widen.inactive?"inactive":"active":"none"}),z=(e,s)=>k(e)!==k(s),T=e=>JSON.stringify({scope:e.scope==="until"?"until":"standing",until:e.scope==="until"?e.until??"":""}),_=(e,s)=>T(e)!==T(s),ze=(e,s)=>{const r={},i=(e.name??"").trim();return i!==(s.name??"").trim()&&(r.name=i),z(e,s)&&(r.matchOperator=e.matchOperator==="all"?"And":"Or",r.literalClauses=e.clauses.map(c=>({field:c.field,value:c.value})),r.actionMailboxId=e.moveMailboxId??S,r.actionLabelId=e.labelId??S),_(e,s)&&(r.scope=e.scope==="until"?"Temporary":"Standing",e.scope==="until"&&(r.expiresAt=Me(e.until??""))),r};function _e({accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g=!1,onClose:d}){const f=x.useMemo(()=>Pe(s,g),[s,g]),[n,l]=x.useState(f),[m,u]=x.useState(),[h,v]=x.useState(!1),M=x.useRef(0),{count:C}=Ie(e,we(n)),j=Re(e,s.filterId),b=Ee(e),{createFolderIn:F}=se(e),{createLabel:E}=Ce(e),I=async o=>{const a=await E(o);return{id:a.labelId,name:a.name,color:a.color}},p=()=>u({mode:"add",draft:{field:L[0],value:""}}),w=o=>{const a=n.clauses.find(y=>y.id===o);a&&u({mode:"edit",clauseId:o,draft:{field:a.field,value:a.value}})},O=o=>u(a=>a&&{...a,draft:{...a.draft,field:o}}),K=o=>u(a=>a&&{...a,draft:{...a.draft,value:o}}),U=()=>{if(!m)return;const o=m.draft.field,a=De(o,m.draft.value);a!==""&&(l(y=>m.mode==="edit"&&m.clauseId?{...y,clauses:y.clauses.map(D=>D.id===m.clauseId?{id:D.id,field:o,value:a}:D)}:(M.current+=1,{...y,clauses:[...y.clauses,{id:`new-${M.current}`,field:o,value:a}]})),u(void 0))},B=o=>l(a=>({...a,clauses:a.clauses.filter(y=>y.id!==o)})),Q=o=>l(a=>({...a,matchOperator:o})),q=o=>l(a=>({...a,moveMailboxId:o||void 0})),G=o=>l(a=>({...a,labelId:o||void 0})),H=o=>l(a=>({...a,name:o})),J=o=>l(a=>({...a,scope:o,until:o==="until"?a.until:void 0})),V=o=>l(a=>({...a,until:o})),W=()=>{const o=z(n,f)||_(n,f),a=ze(n,f);if(Object.keys(a).length===0){d();return}v(o),j.updateFilter(a)},Y=()=>b.start(Oe(n));return b.isStarting||b.isRunning||b.isDone?t.jsx(Qe,{progress:b.progress,isDone:b.isDone,onClose:d}):j.isPending?t.jsx(Ke,{}):j.isError?t.jsx(qe,{onRetry:j.reset,onClose:d}):j.isSuccess?h?t.jsx(Be,{preview:ae(C),blocked:C.status!=="ready"||C.stale===!0,onReapply:Y,onClose:d}):t.jsx(Ue,{onClose:d}):t.jsx(ie,{rule:n,folders:r,delimiter:i,labels:c,preview:C,semanticAvailable:!1,clauseFields:L,anchorLocked:!0,clauseEdit:m,onStartAddClause:p,onStartEditClause:w,onRemoveClause:B,onChangeDraftField:O,onChangeDraftValue:K,onSubmitClause:U,onCancelClause:()=>u(void 0),onChangeMatchOperator:Q,onChangeMove:q,onCreateFolder:F,onChangeLabel:G,onCreateLabel:I,onChangeName:H,onChangeScope:J,onChangeUntil:V,onCommit:W,onCancel:d})}function Ke(){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function Ue({onClose:e}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(A,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),t.jsx(N,{variant:"primary",onClick:e,className:"mt-2",children:"Done"})]})}function Be({preview:e,blocked:s,onReapply:r,onClose:i}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(A,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),t.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",e," — move the mail already in your mailbox too?"]}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:r,disabled:s,children:"Move existing mail"}),t.jsx(N,{variant:"ghost",onClick:i,children:"Not now"})]})]})}function Qe({progress:e,isDone:s,onClose:r}){const i=e.state==="Failed";return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[s?i?t.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):t.jsx(A,{className:"size-8 text-positive"}):t.jsx(R,{className:"size-8 animate-spin text-accent-2"}),!s&&t.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),s&&!i&&t.jsxs("div",{className:"text-sm text-fg",children:[t.jsx("p",{className:"font-medium",children:"Done"}),t.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[e.appliedCount," of ",e.matchedCount," moved",e.failedCount>0?` · ${e.failedCount} failed`:"","."]})]}),s&&i&&t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:e.errorMessage||"Something went wrong. Please try again."}),s&&t.jsx(N,{variant:"primary",onClick:r,className:"mt-2",children:"Done"})]})}function qe({onRetry:e,onClose:s}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(N,{variant:"primary",onClick:e,children:"Try again"}),t.jsx(N,{variant:"ghost",onClick:s,children:"Not now"})]})]})}function Ge({accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d}){const f=ne(),n=t.jsx(_e,{accountId:e,filter:s,folders:r,delimiter:i,labels:c,semanticUnavailable:g,onClose:d});return f?t.jsx(re,{open:!0,onClose:d,title:"Filter rule",children:n}):t.jsx(Ne,{open:!0,onClose:d,label:"Filter rule",dismissLabel:"Dismiss filter rule",children:n})}function He({filters:e,mailboxName:s,labelById:r,onEdit:i,onDelete:c,deletingFilterId:g,semanticUnavailable:d=!1,now:f=Date.now()}){return e.length===0?t.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):t.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:e.map(n=>{const l=Ae(n,f),m=l==="Expired",u=n.actionMailboxId!==S?s(n.actionMailboxId):void 0,h=n.actionLabelId!==S?r.get(n.actionLabelId):void 0,v=Le(n.expiresAt);return t.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[t.jsxs("button",{type:"button",onClick:()=>i(n.filterId),"aria-label":`Edit filter ${n.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`truncate text-sm font-medium ${m?"text-fg-muted":"text-fg"}`,children:n.name}),t.jsx(oe,{tone:m?"neutral":"positive",dot:!0,children:l})]}),t.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[u?`Moves matches to ${u}`:"No move action",n.scope==="Temporary"&&v?m?` · expired ${v}`:` · until ${v}`:n.scope==="Standing"?" · always":""]}),(n.hasAnchor||h)&&t.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:[n.hasAnchor&&t.jsx(le,{widen:{anchorCount:1,...d?{inactive:!0}:{}}}),h&&t.jsx(ce,{label:{labelId:h.id,name:h.name,color:h.color}})]})]}),t.jsx(N,{variant:"ghost",size:"sm",icon:t.jsx(de,{className:"size-4 text-danger"}),onClick:()=>c(n.filterId),disabled:g===n.filterId,"aria-label":`Delete filter ${n.name}`})]},n.filterId)})})}const Je=t.jsxs("div",{className:"space-y-3",children:[t.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",t.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",t.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),t.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."})]});function Ve({account:e}){const s=e.accountId,{filters:r,isPending:i,isError:c,error:g,refetch:d}=ke(s),{deleteFilter:f,deletingFilterId:n}=Te(s),[l,m]=x.useState(),{data:u}=P({...me({path:{accountId:s}}),staleTime:1/0}),h=ue(),v=x.useMemo(()=>pe(e.folderAppointments),[e.folderAppointments]),M=x.useCallback(p=>{const w=u?.items.find(O=>O.mailboxId===p);if(w)return xe(w,v.get(p),h)},[u?.items,v,h]),C=x.useMemo(()=>fe({mailboxes:u?.items??[],folderAppointments:e.folderAppointments,translator:h}),[u?.items,e.folderAppointments,h]),j=he(u?.items??[]),{labels:b}=Se(s),F=x.useMemo(()=>b.map(p=>({id:p.labelId,name:p.name,color:p.color})),[b]),E=x.useMemo(()=>new Map(F.map(p=>[p.id,p])),[F]),I=r.find(p=>p.filterId===l);return t.jsxs("section",{className:"space-y-2",children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:e.email}),I&&t.jsx(Ge,{accountId:s,filter:I,folders:C,delimiter:j,labels:F,onClose:()=>m(void 0)}),i?t.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${e.email}`}):c?t.jsx($,{variant:"inline",title:`Couldn't load filters for ${e.email}`,error:g,onRetry:()=>{d()}}):t.jsx(He,{filters:r,mailboxName:M,labelById:E,onEdit:m,onDelete:f,deletingFilterId:n})]})}function ot(){const e=ge(),[s,r]=x.useState(!0),{data:i,isPending:c,isError:g,error:d,refetch:f}=P(be()),n=l=>{const m=ye[l];m&&e({to:m})};return t.jsx(je,{items:ve,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:Je,helpOpen:s,onToggleHelp:()=>r(l=>!l),onSelect:n,onBackToMail:()=>{e({to:"/mail"})},children:c?t.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):g?t.jsx($,{title:"Couldn't load accounts",error:d,onRetry:()=>{f()}}):i.accounts.length===0?t.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):t.jsx("div",{className:"space-y-8",children:i.accounts.map(l=>t.jsx(Ve,{account:l},l.accountId))})})}export{Ve as AccountFilters,ot as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-JvL7NOOT.js";import{a as m}from"./MailShell-BV9UNC34.js";import{F as r}from"./FlaggedPane-ABu3En8n.js";import{a as p}from"./search-token-index-BtlfcrE4.js";import{u as e}from"./search-mirror-0dWFcBnP.js";import"./FullCompose-CJfpPY9W.js";import"./ErrorState-lOy9oWsG.js";import"./index-B35L-Beh.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./EmptyState-ByT1Gu5Q.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useQueries-CG7A63o2.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./MailViewChrome-CwBNpH4r.js";import"./refresh-cw-DNKXC09U.js";import"./wizard-selection-DxUM65kM.js";function Z(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{Z as component};
@@ -1 +0,0 @@
1
- import{e as H,j as e,B as x,f,L as _,X as Ee,r,I as Oe,g as O,h as pe,c as ze,d as Be,i as q,s as de,k as $e,l as Pe,m as De,n as Le,o as J,q as qe}from"./index-JvL7NOOT.js";import{W as k,C as fe,a as le,u as We,b as He,c as _e,d as Ke,S as Qe,R as Ue}from"./credential-steps-Brnf4ED3.js";import{c as ge,f as Ve,v as xe,r as Ge,a as Je,b as ue,w as me,p as Xe,W as Ye,s as Ze,g as et}from"./config-import-CjdBZe0f.js";import{F as tt}from"./file-json-CKTJc-DA.js";import{c as st}from"./onboarding-completion-Vf4AlB2g.js";import"./card-DIdrYGds.js";const nt=H("FolderClock",[["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}],["path",{d:"M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2",key:"1urifu"}],["path",{d:"M16 14v2l1 1",key:"xth2jh"}]]);const it=H("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);const at=H("Merge",[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]);const rt=H("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),y=["File","Review","Credentials","Folders"];function Y({children:t}){return e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:t})}function ot({state:t="idle",file:n,ready:i=!1,failure:s,onChoose:d,onDragStateChange:l,onNext:h}){const w=r.useId(),u=r.useRef(null),p=t==="dragging",j=t==="reading",S=t==="checking",R=j||S,N=m=>{m.preventDefault(),l?.(!1);const b=m.dataTransfer.files.item(0);b&&d?.(b)};return e.jsx(k,{steps:y,activeStep:0,title:"Import a config file",subtitle:"Accounts, folder roles, rules, senders and appearance — everything except passwords.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Nothing is written until you have seen what will change."}),e.jsx(f,{variant:"primary",disabled:R||!i,icon:R?e.jsx(_,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:j?"Reading…":S?"Checking…":"Check the file"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{tone:"danger",children:s.title}),e.jsx("p",{className:"text-sm text-fg",children:s.explanation}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.fix}),e.jsx(Y,{children:s.raw})]}),e.jsxs("div",{onDragOver:m=>{m.preventDefault(),l?.(!0)},onDragLeave:()=>l?.(!1),onDrop:N,className:p?"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-accent bg-accent-soft px-4 py-9 text-center":"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-line px-4 py-9 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-md bg-surface-sunken",children:e.jsx(rt,{className:"size-5 text-fg-muted"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:p?"Drop it here":"Drop a config file here, or choose one"}),e.jsx("p",{className:"mt-1 text-xs text-fg-subtle",children:"A .json file written by Reader — up to 2 MB."})]}),e.jsx("input",{ref:u,id:w,type:"file",accept:"application/json,.json",className:"sr-only",onChange:m=>{const b=m.target.files?.item(0);b&&d?.(b)}}),e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>u.current?.click(),children:"Choose file"})]}),n&&e.jsxs("div",{className:"flex items-start gap-3 rounded-sm border border-line px-3 py-2.5",children:[e.jsx(tt,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm text-fg",children:n.name}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[Ve(n.size)," ·"," ",j?"reading it from disk":S?"checking it against this instance":i?"ready to check — nothing has been sent yet":"not a configuration this instance can read"]})]})]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Export one from Settings → Advanced on the instance you are moving from, or run"," ",e.jsx("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:"remit config save"})," ","on its host."]})]})})}function ct({sections:t}){const n=ge(t.flatMap(i=>i.entries.map(s=>({section:i.id,key:s.label,verdict:s.verdict}))));return e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["created","updated","unchanged","skipped","rejected"].filter(i=>n[i]>0).map(i=>e.jsxs(O,{tone:xe[i],dot:!0,children:[n[i]," ",i]},i))})}function dt({section:t}){return e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:t.title}),e.jsx("ul",{className:"mt-1.5 divide-y divide-line",children:t.entries.map(n=>e.jsxs("li",{className:"flex items-start gap-3 py-2",children:[e.jsx(O,{tone:xe[n.verdict],className:"mt-0.5 shrink-0",children:n.verdict}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm text-fg",children:n.label}),n.reason&&e.jsx("p",{className:n.verdict==="rejected"?"mt-1 text-xs text-danger":"mt-1 text-xs text-warning",children:n.reason})]})]},n.id))})]})}function lt({sections:t,fileName:n,warnings:i=[],applying:s=!1,onBack:d,onNext:l}){const h=ge(t.flatMap(p=>p.entries.map(j=>({section:p.id,key:j.label,verdict:j.verdict})))),w=h.created+h.updated,u=h.skipped+h.rejected;return e.jsx(k,{steps:y,activeStep:1,title:"What this file will change",subtitle:`${n} · nothing has been written yet.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:s,icon:s?e.jsx(_,{className:"size-3.5 animate-spin"}):void 0,onClick:l,children:s?"Importing…":`Import ${w} changes`})]}),children:e.jsxs("div",{className:"space-y-5",children:[e.jsx(ct,{sections:t}),u>0&&e.jsxs(x,{tone:"warning",children:[u," entries will not be imported. Each says why below — read them before you continue, because nothing here retries on its own."]}),i.length>0&&e.jsx("ul",{className:"space-y-1 text-xs text-warning",children:i.map(p=>e.jsx("li",{children:p},p))}),t.map(p=>e.jsx(dt,{section:p},p.id))]})})}function ut({choice:t,held:n,onChoose:i,onBack:s,onNext:d}){return e.jsx(k,{steps:y,activeStep:1,title:"This instance already has configuration",subtitle:n,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:s,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:!t,onClick:d,children:t==="merge"?"Continue with merge":"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"warning",children:"An import into a configured instance can only add and update — it never deletes what is here. Pick how the two should meet."}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(le,{name:"Stop, keep this instance",description:"Nothing is written. Use this if you meant to import into a fresh instance.",icon:e.jsx(Ee,{className:"size-5"}),selected:t==="abort",onSelect:()=>i?.("abort")}),e.jsx(le,{name:"Merge the file in",description:"Adds what is missing and updates what differs. Existing accounts keep their server settings.",icon:e.jsx(at,{className:"size-5"}),selected:t==="merge",onSelect:()=>i?.("merge")})]}),t==="merge"&&e.jsx("p",{className:"text-xs text-fg-muted",children:"The next screen lists every add and update before anything is written."})]})})}function mt(t){return t==="entered"?e.jsx(O,{tone:"positive",children:"ready"}):t==="failed"?e.jsx(O,{tone:"danger",children:"sign-in failed"}):e.jsx(O,{tone:"danger",children:"credentials needed"})}function ht({accounts:t,busyAccountId:n,onOpen:i}){return e.jsx("ul",{className:"divide-y divide-line",children:t.map(s=>e.jsxs("li",{className:s.state==="entered"?"flex flex-wrap items-start justify-between gap-3 py-3":"flex flex-wrap items-start justify-between gap-3 border-l-2 border-danger bg-danger-soft py-3 pl-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:s.address}),mt(s.state)]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[s.displayName," ·"," ",s.connector==="microsoft"?"Microsoft 365":"IMAP / SMTP"," ","· ",s.server]}),s.state!=="entered"&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:s.failure??(s.connector==="microsoft"?"Config files never carry OAuth tokens. Reconnect with Microsoft to start syncing this account.":"Config files never carry passwords. Enter this mailbox's password to start syncing.")})]}),s.state!=="entered"&&e.jsx(f,{variant:"primary",size:"sm",disabled:n===s.accountId,icon:n===s.accountId?e.jsx(_,{className:"size-3.5 animate-spin"}):s.connector==="microsoft"?e.jsx(Oe,{className:"size-3.5"}):e.jsx(it,{className:"size-3.5"}),onClick:()=>i?.(s),children:n===s.accountId?"Redirecting…":s.connector==="microsoft"?"Reconnect":s.state==="failed"?"Try again":"Enter password"})]},s.accountId))})}function pt({accounts:t,busyAccountId:n,error:i,onOpen:s,onNext:d}){const l=t.filter(h=>h.state!=="entered").length;return e.jsx(k,{steps:y,activeStep:2,title:"These accounts need credentials",subtitle:"The config file carries servers and settings. Passwords and Microsoft sign-ins it deliberately leaves out.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:l>0?"Settings › Accounts keeps asking until every account is signed in.":"Every account can sync."}),e.jsx(f,{variant:"primary",onClick:d,children:l>0?"Finish later":"All accounts connected"})]}),children:e.jsxs("div",{className:"space-y-4",children:[i&&e.jsx(x,{tone:"danger",children:i}),l>0&&e.jsxs(x,{tone:"danger",children:[l," of ",t.length," accounts cannot sync yet. They stay listed in Settings, marked like this, until you sign in — no mail arrives for them in the meantime."]}),e.jsx(ht,{accounts:t,busyAccountId:n,onOpen:s})]})})}function ft({account:t,position:n,total:i,error:s,busy:d=!1,onBack:l,onNext:h}){return e.jsx(k,{steps:y,activeStep:2,title:`Reconnect ${t.address}`,subtitle:`Account ${n} of ${i} · Microsoft 365`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:l,children:"Back"}),e.jsx(f,{variant:"primary",disabled:d,icon:d?e.jsx(_,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:d?"Redirecting…":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsx(x,{tone:"danger",children:s}),e.jsx(x,{tone:"info",children:"A config file never carries an OAuth token — one only works for the instance it was granted to. Signing in here mints a fresh one for this instance."}),e.jsxs("div",{className:"rounded-sm border border-line px-3 py-2.5",children:[e.jsx("p",{className:"text-sm text-fg",children:t.displayName}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[t.address," · ",t.server]})]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"You will be sent to Microsoft and returned here. If your organisation requires admin approval, the sign-in stops there and this account keeps waiting."})]})})}function gt({folders:t,onNext:n}){return e.jsx(k,{steps:y,activeStep:3,title:t.length>0?"Waiting on folders":"Import finished",subtitle:t.length>0?"The config names folders this server has not shown us yet.":"Everything in the file landed, and every folder it named resolved.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Folder discovery runs with every sync."}),e.jsx(f,{variant:"primary",onClick:n,children:"Go to inbox"})]}),children:e.jsx("div",{className:"space-y-4",children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsxs(x,{tone:"warning",children:[t.length," settings are imported but switched off. Each turns itself on the moment its folder appears — nothing was dropped. If a folder never appears, create it in your mail client, or edit the setting in Settings → Senders & Rules."]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(nt,{className:"size-4"}),"Folder discovery runs with every sync of the account."]}),e.jsx("div",{className:"divide-y divide-line",children:t.map(i=>e.jsx(fe,{label:i.path,detail:i.waitingFor,state:"pending"},`${i.accountId??""}-${i.path}-${i.waitingFor}`))})]}):e.jsx(x,{tone:"success",children:"Every account, rule, label and sender in the file is live on this instance."})})})}function xt({failure:t,onBack:n}){return e.jsx(k,{steps:y,activeStep:0,title:t.title,subtitle:"Nothing was imported.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"This instance is unchanged."}),e.jsx(f,{variant:"primary",onClick:n,children:"Choose another file"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(x,{tone:"danger",children:t.explanation}),e.jsx("p",{className:"text-sm text-fg",children:t.fix}),e.jsx(Y,{children:t.raw})]})})}function jt(t){return t==="landed"?"ok":t==="failed"||t==="unknown"?"failed":"pending"}function vt({results:t,message:n,raw:i,nothingLanded:s,onBack:d,onNext:l}){const h=t.filter(u=>u.state==="landed").length,w=t.some(u=>u.state==="unknown");return e.jsx(k,{steps:y,activeStep:1,title:s?"The import stopped, and nothing landed":"The import stopped part-way",subtitle:s?"No section of the file was written.":w?"It did not say how far it got, so check Settings before importing again.":`${h} of ${t.length} sections landed.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",onClick:l,children:s?"Try the import again":"Retry the rest"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"danger",children:n}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Retrying is safe: an import folds into what is already here rather than replacing it, so what landed is recognised and left alone."}),e.jsx("div",{className:"divide-y divide-line",children:t.map(u=>e.jsx(fe,{label:u.title,detail:u.detail,state:jt(u.state)},u.section))}),e.jsx(Y,{children:i})]})})}const je=(t,n)=>t?"tls":n?"starttls":"none",yt=t=>({host:t.imapHost,port:t.imapPort,security:je(t.imapTls,t.imapStartTls)}),wt=t=>({host:t.smtpEnabled?t.smtpHost:"",port:t.smtpPort,security:je(t.smtpTls,t.smtpStartTls)}),he=(t,n,i)=>{const s=t.authType==="oauthMicrosoft"?"microsoft":"imap",d=!i&&(s==="microsoft"?t.connectionState==="reauth_required":t.connectionState==="credentials_missing");return{accountId:t.accountId,address:t.email,displayName:t.displayName?.trim()||t.email,connector:s,server:`${t.imapHost}:${t.imapPort}`,state:n?"failed":d?"needed":"entered",failure:n}},bt=t=>{if(!t)return"This instance already holds configuration of its own.";const n=[["accounts","account"],["labels","label"],["filters","rule"],["addressFlags","flagged sender"]].map(([i,s])=>({count:Number(t[i]??0),noun:s})).filter(i=>i.count>0).map(i=>`${i.count} ${i.noun}${i.count===1?"":"s"}`);return n.length===0?"This instance already holds configuration of its own.":`${n.join(", ")} are set up here already.`},W=(t,n)=>{if(t instanceof Error)return t.message;if(typeof t=="object"&&t!==null){const i=t.message;if(typeof i=="string")return i}return n};function kt({onDone:t}){const n=pe(),[i,s]=r.useState("file"),[d,l]=r.useState(!1),[h,w]=r.useState(!1),[u,p]=r.useState(void 0),[j,S]=r.useState(void 0),[R,N]=r.useState(void 0),[m,b]=r.useState(void 0),[Z,ee]=r.useState("abort"),[te,se]=r.useState(void 0),[ye,K]=r.useState(void 0),[C,we]=r.useState([]),[Q,be]=r.useState([]),[g,I]=r.useState(null),[T,U]=r.useState({username:"",password:""}),[F,V]=r.useState({}),[ke,ne]=r.useState(void 0),[G,z]=r.useState(null),[B,Se]=r.useState([]),{data:$}=ze({...Be(),enabled:C.length>0||i==="folders"}),A=r.useMemo(()=>{const a=new Map;for(const o of $?.accounts??[])a.set(o.accountId,o);return a},[$]),Ne=r.useMemo(()=>C.map(a=>A.get(a)).filter(a=>!!a).map(a=>he(a,F[a.accountId],Q.includes(a.accountId))),[C,A,F,Q]),c=g?A.get(g):void 0,ie=g?C.indexOf(g)+1:0,P=q({...$e(),meta:de(409)}),ae=q({...Pe(),meta:de(403,404)}),re=q(De()),oe=q(Le());We(G!==null,()=>{n.invalidateQueries({queryKey:J()}),z(null)});const ce=He(a=>{z(null),a==="stalled"&&ne(Ue)}),Ce=r.useCallback(a=>{l(!1),w(!0),p({name:a.name,size:a.size}),N(void 0),S(void 0),a.text().then(o=>Ge(a.name,a.size,o)).then(o=>{if(w(!1),!o.ok){N(o.failure);return}S(o.document)}).catch(o=>{w(!1),N({title:"That file could not be read",explanation:`The browser could not read ${a.name} from disk, so nothing was sent.`,fix:"Check the file is still there and try again.",raw:W(o,"the file read was refused")})})},[]),D=r.useCallback((a,o)=>{j&&(K(void 0),P.mutate({body:{mode:a,onExisting:o,document:j}},{onSuccess:v=>{if(b(v),ue(v)){s("rejected");return}if(me(v)){s("partial");return}if(a==="validate"){s("review");return}if(Se(Xe(v)),n.invalidateQueries({queryKey:J()}),v.accountsNeedingCredentials.length>0){we([...v.accountsNeedingCredentials]),s("credentials");return}s("folders")},onError:v=>{const L=Je(v);if(L){K(L),se(void 0),s("conflict");return}N({title:"The import could not be sent",explanation:"The request to this instance failed before it produced a report, so nothing was written.",fix:"Check your connection and try again.",raw:W(v,"POST /config/import failed")}),s("file")}}))},[j,P,n]),Ie=r.useCallback(a=>{if(I(a.accountId),ne(void 0),a.connector==="microsoft"){s("account-oauth");return}const o=A.get(a.accountId);U({username:o?.username||a.address,password:""}),s("account-password")},[A]),Te=r.useCallback(()=>{g&&ae.mutate({path:{accountId:g},body:{password:T.password,isActive:!0}},{onSuccess:()=>{re.mutate({path:{accountId:g}}),be(a=>a.includes(g)?a:[...a,g]),V(a=>{const o={...a};return delete o[g],o}),n.invalidateQueries({queryKey:J()}),U({username:"",password:""}),I(null),s("credentials")},onError:a=>{V(o=>({...o,[g]:W(a,"The password was verified but could not be stored. Try again.")})),I(null),s("credentials")}})},[g,T.password,n,re,ae]),Re=r.useCallback(()=>{c&&(z(c.accountId),oe.mutate({body:{email:c.email}},{onSuccess:a=>{ce(),window.location.assign(a.authorizationUrl)},onError:a=>{z(null),V(o=>({...o,[c.accountId]:W(a,"Microsoft sign-in could not be started.")})),I(null),s("credentials")}}))},[c,ce,oe]),Fe=r.useCallback((a,o)=>U({username:a,password:o}),[]),Ae=r.useMemo(()=>{const a=$?.pendingImport?.folderPaths;if(!a)return B;const o=new Set(a),v=B.filter(E=>o.has(E.path)),L=a.filter(E=>!B.some(Me=>Me.path===E)).map(E=>({path:E,waitingFor:"An imported setting"}));return[...v,...L]},[$,B]),M=r.useCallback(()=>{b(void 0),K(void 0),N(void 0),p(void 0),S(void 0),ee("abort"),s("file")},[]);switch(i){case"file":return e.jsx(ot,{state:h?"reading":P.isPending?"checking":d?"dragging":"idle",file:u,ready:j!==void 0,failure:R,onChoose:Ce,onDragStateChange:l,onNext:()=>D("validate",Z)});case"rejected":return e.jsx(xt,{failure:(m&&ue(m))??R??{title:"The file could not be imported",explanation:"The import was refused and nothing was written.",fix:"Re-export the configuration and try again.",raw:"no error was reported"},onBack:M});case"conflict":return e.jsx(ut,{choice:te,held:bt(ye?.details),onChoose:se,onBack:M,onNext:()=>{if(te==="abort"){t("abandoned");return}ee("merge"),D("validate","merge")}});case"review":return e.jsx(lt,{sections:et(m?.items??[]),fileName:u?.name??"the config file",warnings:(m?.warnings??[]).map(a=>a.message),applying:P.isPending,onBack:M,onNext:()=>D("apply",Z)});case"partial":{if(!m)return e.jsx(St,{onBack:M});const a=me(m);return e.jsx(vt,{results:Ze(m),message:a?.message??"The import stopped before it finished.",raw:`${a?.code??Ye}: ${a?.message??"no message"}`,nothingLanded:!m.applied,onBack:M,onNext:()=>D("apply","merge")})}case"credentials":return e.jsx(pt,{accounts:Ne,busyAccountId:G??void 0,error:ke,onOpen:Ie,onNext:()=>s("folders")});case"account-password":return c?e.jsx(Ke,{steps:y,activeStep:2,title:`Sign in to ${c.email}`,subtitle:`Account ${ie} of ${C.length} · ${c.imapHost}:${c.imapPort}`,email:c.email,username:T.username,password:T.password,error:F[c.accountId],continueLabel:"Test and continue",notice:e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(Qe,{className:"size-3.5"}),"Server settings came from the config file — edit them in Settings if they are wrong."]}),onContinue:()=>s("account-test"),onBack:()=>{I(null),s("credentials")},onChange:Fe}):e.jsx(X,{onBack:()=>t("abandoned")});case"account-test":return c?e.jsx(_e,{steps:y,activeStep:2,email:c.email,imapConfig:yt(c),smtpConfig:wt(c),username:T.username,password:T.password,credentialsBackLabel:"Back to the password",serversBackLabel:"Back to the password",successLabel:"Save and continue",onSuccess:Te,onBackToCredentials:()=>s("account-password"),onBackToServers:()=>s("account-password")}):e.jsx(X,{onBack:()=>t("abandoned")});case"account-oauth":return c?e.jsx(ft,{account:he(c,F[c.accountId],Q.includes(c.accountId)),position:ie,total:C.length,error:F[c.accountId],busy:G===c.accountId,onBack:()=>{I(null),s("credentials")},onNext:Re}):e.jsx(X,{onBack:()=>t("abandoned")});case"folders":return e.jsx(gt,{folders:Ae,onNext:()=>t("imported")})}}function ve({children:t,label:n,onBack:i}){return e.jsxs("div",{className:"mx-auto max-w-lg p-6",children:[e.jsx(x,{tone:"danger",children:t}),e.jsx("button",{type:"button",className:"mt-3 text-sm text-accent underline",onClick:i,children:n})]})}function X({onBack:t}){return e.jsx(ve,{label:"Go to inbox",onBack:t,children:"That account is no longer in this instance's configuration, so there is nothing left to sign in to. Open Settings › Accounts to see what is here."})}function St({onBack:t}){return e.jsx(ve,{label:"Choose another file",onBack:t,children:"The import stopped but produced no report, so nothing here can say what it wrote. Open Settings to see what this instance holds before importing again."})}function At(){const t=qe(),n=pe(),i=r.useCallback(s=>{st({queryClient:n,recordCompleted:()=>{s==="imported"&&t.recordEvent("config.imported")},navigateToInbox:()=>{window.location.assign("/mail")}})},[t,n]);return e.jsx(kt,{onDone:i})}export{At as component};
@@ -1 +0,0 @@
1
- import{eV as o,j as r}from"./index-JvL7NOOT.js";import{O as m}from"./OpenCalendarEvent-C0fD7GK1.js";import"./CalendarComposePane-C8OCyygH.js";import"./calendar-format-x-1AymaW.js";import"./useQueries-CG7A63o2.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./attendee-row-aOKxNWMD.js";import"./avatar-pYJD4LCB.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-report-Cf2ve-41.js";import"./mail-B04n2cXx.js";import"./pencil-D4L00dK0.js";import"./useCalendarWrites-BkFeh-BY.js";import"./ErrorState-lOy9oWsG.js";import"./useCalendarData-BkgGbKw4.js";import"./calendar-subscription-B-aAc2Gy.js";function b(){const{calendarObjectId:t}=o.useParams();return r.jsx(m,{calendarObjectId:t})}export{b as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-JvL7NOOT.js";import{M as r}from"./MailboxPane-CF_r6Qn_.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-Dy0MbIBR.js";import"./circle-check-big-CfQbbZSe.js";import"./refresh-cw-DNKXC09U.js";import"./useQueries-CG7A63o2.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./MailViewChrome-CwBNpH4r.js";import"./pane-header-BW-iAwQv.js";import"./NavMenuButton-G9j_DlDH.js";import"./useLabels-BPGhj-Hw.js";import"./useSemanticSearch-Br4oTbAk.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-DD_X_Lv6.js";import"./circle-help-DCDtKNKZ.js";import"./circle-check-7STILCER.js";function _(){return o.jsx(r.Reading,{})}export{_ as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-JvL7NOOT.js";import{O as t}from"./OutboxPane-hqh9NzYa.js";import"./roving-focus-DkDN4BU_.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-CfQbbZSe.js";import"./clock-8NSnUnYb.js";import"./row-actions-VNJRTDlw.js";import"./rotate-ccw-Dbjk6oUv.js";import"./pane-header-BW-iAwQv.js";import"./NavMenuButton-G9j_DlDH.js";import"./menu-BoIu1FfU.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function d(){return o.jsx(t.Reading,{})}export{d as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-JvL7NOOT.js";import{F as r}from"./FlaggedPane-ABu3En8n.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./useQueries-CG7A63o2.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./MailViewChrome-CwBNpH4r.js";import"./refresh-cw-DNKXC09U.js";import"./wizard-selection-DxUM65kM.js";function Q(){return o.jsx(r.Reading,{})}export{Q as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-JvL7NOOT.js";import{F as r}from"./FlaggedPane-ABu3En8n.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./useQueries-CG7A63o2.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./MailViewChrome-CwBNpH4r.js";import"./refresh-cw-DNKXC09U.js";import"./wizard-selection-DxUM65kM.js";function O(){return o.jsx(r.Reading,{})}export{O as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-JvL7NOOT.js";import{B as o}from"./BriefPane-mgiwuRg9.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./useQueries-CG7A63o2.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./useRefreshControl-Dy0MbIBR.js";import"./circle-check-big-CfQbbZSe.js";import"./refresh-cw-DNKXC09U.js";import"./useSemanticSearch-Br4oTbAk.js";import"./useLabels-BPGhj-Hw.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function V(){return r.jsx(o.Reading,{})}export{V as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-JvL7NOOT.js";import{B as o}from"./BriefPane-mgiwuRg9.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./useQueries-CG7A63o2.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./useRefreshControl-Dy0MbIBR.js";import"./circle-check-big-CfQbbZSe.js";import"./refresh-cw-DNKXC09U.js";import"./useSemanticSearch-Br4oTbAk.js";import"./useLabels-BPGhj-Hw.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function V(){return r.jsx(o.Reading,{})}export{V as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-JvL7NOOT.js";import{M as i}from"./MailboxPane-CF_r6Qn_.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-Dy0MbIBR.js";import"./circle-check-big-CfQbbZSe.js";import"./refresh-cw-DNKXC09U.js";import"./useQueries-CG7A63o2.js";import"./MailListHeader-BWxCXjLF.js";import"./roving-focus-DkDN4BU_.js";import"./search-token-index-BtlfcrE4.js";import"./popover-menu-ndRLkI9F.js";import"./mail-B04n2cXx.js";import"./avatar-pYJD4LCB.js";import"./index-B35L-Beh.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./EmptyState-ByT1Gu5Q.js";import"./ErrorState-lOy9oWsG.js";import"./undo-2-TZSl58QT.js";import"./download-B5vMU4mu.js";import"./calendar-suggestion-BfpRtMnb.js";import"./calendar-format-x-1AymaW.js";import"./useCalendars-CHGwm2tA.js";import"./calendar-report-Cf2ve-41.js";import"./attendee-row-aOKxNWMD.js";import"./minus-nUrea2mK.js";import"./clock-8NSnUnYb.js";import"./calendar-clash-strip-BqcFrBRc.js";import"./bell-off-D9rYrUVT.js";import"./copy-CpGnsr3_.js";import"./shield-check-D_54Wl8K.js";import"./useFilters-Bvbtlnnx.js";import"./checkbox-DUtcTeBq.js";import"./confirm-dialog-Bmgy9_rb.js";import"./useLayoutTier-DGCxVtYf.js";import"./menu-BoIu1FfU.js";import"./MailViewChrome-CwBNpH4r.js";import"./pane-header-BW-iAwQv.js";import"./NavMenuButton-G9j_DlDH.js";import"./useLabels-BPGhj-Hw.js";import"./useSemanticSearch-Br4oTbAk.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-DD_X_Lv6.js";import"./circle-help-DCDtKNKZ.js";import"./circle-check-7STILCER.js";function _(){return o.jsx(i.Reading,{})}export{_ as component};
@@ -1 +0,0 @@
1
- import{j as t,an as o}from"./index-JvL7NOOT.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
@@ -1 +0,0 @@
1
- import{e}from"./index-JvL7NOOT.js";const a=e("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);export{a as M};
@@ -1 +0,0 @@
1
- import{q as i,h as n,u as a,r as m,j as s}from"./index-JvL7NOOT.js";import{O as p}from"./OnboardingWizard-AgffmEPL.js";import{c}from"./onboarding-completion-Vf4AlB2g.js";import"./checkbox-DUtcTeBq.js";import"./minus-nUrea2mK.js";import"./kbd-DEjfq9k-.js";import"./credential-steps-Brnf4ED3.js";import"./card-DIdrYGds.js";import"./account-form-helpers-DhckT_PN.js";import"./mail-B04n2cXx.js";import"./file-json-CKTJc-DA.js";function E(){const o=i(),t=n(),e=a(),r=m.useCallback(l=>{c({queryClient:t,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[o,t]);return s.jsx(p,{skipWelcome:!1,onComplete:r,onImportConfig:()=>{e({to:"/import"})}})}export{E as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-JvL7NOOT.js";import{a as m}from"./MailShell-BV9UNC34.js";import{u as p,O as t}from"./OutboxPane-hqh9NzYa.js";import{u as s}from"./search-mirror-0dWFcBnP.js";import"./FullCompose-CJfpPY9W.js";import"./ErrorState-lOy9oWsG.js";import"./index-B35L-Beh.js";import"./useMessageBodyContent-CDZhnuFx.js";import"./useSignature-BiJchsQV.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Dasyblh3.js";import"./sections-CmtFaATd.js";import"./confirm-dialog-Bmgy9_rb.js";import"./roving-focus-DkDN4BU_.js";import"./useSearchTokenContext-DCNyVMih.js";import"./kbd-DEjfq9k-.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-CfQbbZSe.js";import"./clock-8NSnUnYb.js";import"./row-actions-VNJRTDlw.js";import"./rotate-ccw-Dbjk6oUv.js";import"./pane-header-BW-iAwQv.js";import"./NavMenuButton-G9j_DlDH.js";import"./menu-BoIu1FfU.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function w(){const r=p();return s({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(i,{})})})}export{w as component};
@@ -1 +0,0 @@
1
- import{j as t,O as o}from"./index-JvL7NOOT.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +0,0 @@
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-JvL7NOOT.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};