@remit/web-client-dist 0.0.674 → 0.0.676
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/AppFrame-DSPG81Mk.js +1 -0
- package/assets/BriefPane-Cfl-uWfm.js +1 -0
- package/assets/CalendarEventEditor-COnJXvRd.js +1 -0
- package/assets/CalendarEventPopup-CqHE2vrc.js +1 -0
- package/assets/CalendarLoadFailed-CxL15r1A.js +1 -0
- package/assets/CalendarQuickCreate-DxgU3bNP.js +1 -0
- package/assets/CalendarSession-BKwK9s2o.js +1 -0
- package/assets/EmptyState-BUOSmldo.js +1 -0
- package/assets/{ErrorState-Bi4vrhhQ.js → ErrorState-KjDYblD5.js} +1 -1
- package/assets/FlaggedPane-Dw-wR4tp.js +1 -0
- package/assets/{FullCompose-D6Xef8Ur.js → FullCompose-Djp_h4BT.js} +1 -1
- package/assets/{LabelApplyTrigger-BnPNejnI.js → LabelApplyTrigger-oS5sxATE.js} +1 -1
- package/assets/MailShell-LIuV2C3h.js +1 -0
- package/assets/MailViewChrome-yffBJjbO.js +1 -0
- package/assets/MailboxPane-DUCZVAx6.js +1 -0
- package/assets/{MessageBody-AvWIklnv.js → MessageBody-C89PSL_p.js} +3 -3
- package/assets/MessageToolbar-UJadqHyA.js +1 -0
- package/assets/NavMenuButton-B-goW-G5.js +1 -0
- package/assets/OnboardingWizard-Cvqq2aP_.js +1 -0
- package/assets/OutboxPane-ce4uTAzW.js +1 -0
- package/assets/_calendarObjectId-lcrg9Fhc.js +1 -0
- package/assets/_mailboxId-BzKo-TnK.js +1 -0
- package/assets/_messageId-C7U0TsBv.js +1 -0
- package/assets/_messageId-CGB3gt7C.js +1 -0
- package/assets/_messageId-D2Qjacn6.js +1 -0
- package/assets/_outboxMessageId-FUbJ3RF8.js +1 -0
- package/assets/_recurrenceId-DpQOCGAd.js +1 -0
- package/assets/_threadId-BmZ2vl5z.js +1 -0
- package/assets/_threadId-Bs84eLjr.js +1 -0
- package/assets/_threadId-DySupNzi.js +1 -0
- package/assets/_view._date-DYujYKtx.js +1 -0
- package/assets/account-service-status-oYDwuPLn.js +1 -0
- package/assets/accounts-DhSbRlEm.js +1 -0
- package/assets/advanced-B50NfkTy.js +1 -0
- package/assets/appearance-CYNOlHLz.js +1 -0
- package/assets/{avatar-qD7fcqFf.js → avatar-uWJajuSb.js} +1 -1
- package/assets/{bottom-sheet-B_7iO-ln.js → bottom-sheet-Bc0vwv2J.js} +1 -1
- package/assets/brief-DPWE6nMF.js +1 -0
- package/assets/{brief-RK0pe25_.js → brief-bdXCpAmW.js} +1 -1
- package/assets/calendar-7SdvLY_h.js +1 -0
- package/assets/calendar-event-popup-DsPmxVye.js +1 -0
- package/assets/calendar-event-sidebar-soFGsDRR.js +1 -0
- package/assets/calendar-failure-note-BtZLcaiZ.js +1 -0
- package/assets/calendar-format-BwCpz-JZ.js +1 -0
- package/assets/calendar-guests-BR4hC59z.js +1 -0
- package/assets/calendar-suggestion-8jcpefeR.js +1 -0
- package/assets/calendar-tMekVEGW.js +1 -0
- package/assets/calendars-bLB0g-E-.js +1 -0
- package/assets/{card-C9cgHaft.js → card-CPL-TrL1.js} +1 -1
- package/assets/checkbox-CGG1nAhQ.js +1 -0
- package/assets/{circle-check-big-ZwVj0mbk.js → circle-check-big-BsCwNdJZ.js} +1 -1
- package/assets/{circle-check-CQPt1U9q.js → circle-check-i3jeyeTf.js} +1 -1
- package/assets/{circle-help-BtMu5xYr.js → circle-help-CVWHf1ow.js} +1 -1
- package/assets/{clock-B-eYdLBT.js → clock-NnulNCOv.js} +1 -1
- package/assets/compose._-_outboxMessageId_-Be8c22eR.js +1 -0
- package/assets/compose._-_outboxMessageId_-BuomqJqQ.js +1 -0
- package/assets/compose._-_outboxMessageId_-Bv9hyiuT.js +1 -0
- package/assets/compose._-_outboxMessageId_-CvUr9awX.js +1 -0
- package/assets/{config-import-DhLbROIb.js → config-import-DmOMXQ5W.js} +1 -1
- package/assets/{confirm-dialog-AppxcVfC.js → confirm-dialog-q8tbS_22.js} +1 -1
- package/assets/{copy-BCzZpML3.js → copy-LUCWJAE6.js} +1 -1
- package/assets/{credential-steps-DCjuFFo-.js → credential-steps-DVglyUgf.js} +1 -1
- package/assets/{download-C6M2pRs1.js → download-SQdHw0Vd.js} +1 -1
- package/assets/draft-Y5XWTm_J.js +1 -0
- package/assets/edit-DMorYaTV.js +1 -0
- package/assets/edit-Dr5FEVcd.js +1 -0
- package/assets/{external-link-tmwz3hf0.js → external-link-BDqA_mVy.js} +1 -1
- package/assets/{file-json-BgVPDajK.js → file-json-DQGozYSr.js} +1 -1
- package/assets/filters-DFLdTFEB.js +1 -0
- package/assets/flagged-CCXBAY09.js +1 -0
- package/assets/{flagged-IHM3vv4x.js → flagged-CyMautVT.js} +1 -1
- package/assets/folders-DtchKvEA.js +1 -0
- package/assets/{help-copy-BN4-5aIP.js → help-copy-B2iT8EG_.js} +1 -1
- package/assets/{import-BT72aUBc.js → import-DqNA5XIM.js} +1 -1
- package/assets/index-BaEsIFAV.js +1 -0
- package/assets/index-Biz6TlId.js +1 -0
- package/assets/index-BkMAx0hv.js +1 -0
- package/assets/index-CL_fwLHN.js +349 -0
- package/assets/index-CZYy2P_j.js +1 -0
- package/assets/index-CqsCZrgd.js +1 -0
- package/assets/{index-C2Hz4y-Q.css → index-Cr6oUxXl.css} +1 -1
- package/assets/index-CvDZvwnj.js +1 -0
- package/assets/index-D2Qjacn6.js +1 -0
- package/assets/{index-Cb2UJhnj.js → index-DZb7rV9A.js} +7 -7
- package/assets/index-DoTwMLuw.js +1 -0
- package/assets/index-DrtbTKeC.js +1 -0
- package/assets/index-DtqBFgK5.js +1 -0
- package/assets/index-wVOTkeaF.js +1 -0
- package/assets/{kbd-DxdiA2Fl.js → kbd-CDJCJUnp.js} +1 -1
- package/assets/labels-rv-5Xb0f.js +1 -0
- package/assets/mail-SW3rbFnq.js +1 -0
- package/assets/{menu-ouYQ8aI9.js → menu-CcLh9Whg.js} +1 -1
- package/assets/new-Zmtsd7wU.js +1 -0
- package/assets/onboarding-BbZUe6dp.js +1 -0
- package/assets/{onboarding-completion-h9meGJrm.js → onboarding-completion-DoF3_MyG.js} +1 -1
- package/assets/outbox-ZJk7VidB.js +1 -0
- package/assets/{pencil-D0Kwpd2W.js → pencil-LSmMSKiW.js} +1 -1
- package/assets/{popover-menu-CTiORP1p.js → popover-menu-fjlAfNO1.js} +1 -1
- package/assets/{refresh-cw-aweb7slK.js → refresh-cw-5OKnYRBy.js} +1 -1
- package/assets/reply-DvdgFS16.js +1 -0
- package/assets/{rich-text-BlpPNJ69.js → rich-text-BBwYPM6F.js} +14 -14
- package/assets/{rich-text-spellcheck-worker-provider-BVC2WqOs.js → rich-text-spellcheck-worker-provider-Bk8cqxyg.js} +1 -1
- package/assets/{rotate-ccw-cFCdZR4R.js → rotate-ccw-CENCKp2Z.js} +1 -1
- package/assets/{roving-focus-iNw1K_A-.js → roving-focus-FWOr5tBU.js} +1 -1
- package/assets/{row-actions-CsY_49bo.js → row-actions-DA6zLLAB.js} +1 -1
- package/assets/search-mirror-Dri4pWEq.js +1 -0
- package/assets/search-token-index-B1HU1d2-.js +1 -0
- package/assets/{sections-By63r1y_.js → sections-Rf3k05-_.js} +1 -1
- package/assets/senders-ikMjTlbx.js +1 -0
- package/assets/settings-Bk7jziSO.js +1 -0
- package/assets/settings-screen-DBP3ABLE.js +1 -0
- package/assets/{shield-check-C6K5BNfE.js → shield-check-CdR23I2B.js} +1 -1
- package/assets/sparkles-Bcn4ZRhZ.js +1 -0
- package/assets/{suggested-vips-DnRYIdD0.js → suggested-vips-D-8cU8GT.js} +1 -1
- package/assets/suggestion._suggestionId-D6z0CuYD.js +1 -0
- package/assets/task._calendarTaskId-BYRN0yW3.js +1 -0
- package/assets/{undo-2-BV0sKXdu.js → undo-2-Bdx8L5xj.js} +1 -1
- package/assets/useCalendarData-DXhaM_NM.js +2 -0
- package/assets/useCalendarScheduling-BpjmrzdY.js +1 -0
- package/assets/useCalendarSuggestions-D3Jza1d7.js +1 -0
- package/assets/useCalendarTasks-D_NZ0GM6.js +1 -0
- package/assets/{useDebouncedValue--u19KX6h.js → useDebouncedValue-BTZsNKEh.js} +1 -1
- package/assets/{useFilters-Cmf0Cndn.js → useFilters-CIuC8WLg.js} +1 -1
- package/assets/{useLabels-CN56tbCw.js → useLabels-BZFMPVjT.js} +1 -1
- package/assets/useLayoutTier-DrLg7_rq.js +1 -0
- package/assets/{useMediaQuery-DB2OdJvp.js → useMediaQuery-DiQ0fGER.js} +1 -1
- package/assets/useMessageBodyContent-D-LJBFh4.js +1 -0
- package/assets/useQueries-hChzM5ru.js +1 -0
- package/assets/useRefreshControl-B6YIG0w2.js +1 -0
- package/assets/useResultFolderIndex-6TeGdWgp.js +1 -0
- package/assets/{useSignature-37xUEwqG.js → useSignature-BkzkUbjz.js} +1 -1
- package/assets/warnings-BdQvV6Kc.js +5 -0
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/BriefPane-zWXuK_Pj.js +0 -1
- package/assets/CalendarComposePane-Bz_-lcWc.js +0 -1
- package/assets/CalendarComposeSeed-DrUkfGTc.js +0 -1
- package/assets/CalendarShell-BATnya1t.js +0 -1
- package/assets/EmptyState-DjcO1Fvj.js +0 -1
- package/assets/FlaggedPane-Doc9iLZn.js +0 -1
- package/assets/MailNav-C8EZGG4u.js +0 -1
- package/assets/MailShell-Dc5V-rLi.js +0 -1
- package/assets/MailViewChrome-CJkUbWPO.js +0 -1
- package/assets/MailboxPane-Bzn-4kym.js +0 -1
- package/assets/MessageToolbar-CvC2dLSg.js +0 -1
- package/assets/NavMenuButton-DSpTQKmQ.js +0 -1
- package/assets/OnboardingWizard-DzR2uArY.js +0 -1
- package/assets/OpenCalendarEvent-DuKGo-jF.js +0 -2
- package/assets/OutboxPane-Bf8T7dxW.js +0 -1
- package/assets/SignInAgain-CCZnH9Mt.js +0 -1
- package/assets/_calendarObjectId-BGZWGcp9.js +0 -1
- package/assets/_mailboxId-GGJA-jVS.js +0 -1
- package/assets/_messageId-C5LRx072.js +0 -1
- package/assets/_messageId-CCba-TdT.js +0 -1
- package/assets/_messageId-TW2iI02X.js +0 -1
- package/assets/_outboxMessageId-BwVgR2h4.js +0 -1
- package/assets/_recurrenceId-pJxBSSXe.js +0 -1
- package/assets/_threadId-B_SsLFXa.js +0 -1
- package/assets/_threadId-CL2HHRtw.js +0 -1
- package/assets/_threadId-DLvgcvlr.js +0 -1
- package/assets/_view._date-wBuxk5kG.js +0 -1
- package/assets/accounts-Dc5147aO.js +0 -1
- package/assets/advanced-C3zdMHK5.js +0 -1
- package/assets/appearance-Df1fh0eu.js +0 -1
- package/assets/attendee-row-r-oUgLyi.js +0 -1
- package/assets/bell-off-DNCJLc9z.js +0 -1
- package/assets/brief-ClYJePmh.js +0 -1
- package/assets/bug-D6xXLRSh.js +0 -1
- package/assets/calendar-Dg7vWWgr.js +0 -1
- package/assets/calendar-clash-strip-C9X1djbQ.js +0 -1
- package/assets/calendar-report-BRGottVJ.js +0 -1
- package/assets/calendar-subscription-B-aAc2Gy.js +0 -1
- package/assets/calendar-suggestion-qEC_UasM.js +0 -1
- package/assets/calendars-DBDN0ptk.js +0 -1
- package/assets/checkbox-CiQllE1Y.js +0 -1
- package/assets/chevron-left-Bt4eJ35K.js +0 -1
- package/assets/compose._-_outboxMessageId_-BMq7tjfo.js +0 -1
- package/assets/compose._-_outboxMessageId_-CbnOP01x.js +0 -1
- package/assets/compose._-_outboxMessageId_-CoBJDS24.js +0 -1
- package/assets/compose._-_outboxMessageId_-Cr5hBZLH.js +0 -1
- package/assets/filters-CwblOGNb.js +0 -1
- package/assets/flagged-DvOlELtX.js +0 -1
- package/assets/folders-lF0pnG5O.js +0 -1
- package/assets/index-BDcVKyir.js +0 -1
- package/assets/index-C5LRx072.js +0 -1
- package/assets/index-CCba-TdT.js +0 -1
- package/assets/index-CVKDJurZ.js +0 -1
- package/assets/index-CXrVnh7V.js +0 -1
- package/assets/index-CXzCthHG.js +0 -349
- package/assets/index-DRT_I4p4.js +0 -1
- package/assets/index-DSNc3rHB.js +0 -1
- package/assets/index-T04Kj7bC.js +0 -1
- package/assets/index-TW2iI02X.js +0 -1
- package/assets/index-u72ANhps.js +0 -1
- package/assets/labels-CTSVGM1M.js +0 -1
- package/assets/mail-BLRLmM-I.js +0 -1
- package/assets/mail-CHopLOA-.js +0 -1
- package/assets/map-pin-DbNUeHlR.js +0 -1
- package/assets/minus-COyPQ5q9.js +0 -1
- package/assets/new-DRfIDZVL.js +0 -1
- package/assets/onboarding-U6yiJPWH.js +0 -1
- package/assets/outbox-DFxDZsE8.js +0 -1
- package/assets/reply-B9-kr45N.js +0 -1
- package/assets/search-mirror-Bg0i4bJE.js +0 -1
- package/assets/search-query-Dq2--dgF.js +0 -1
- package/assets/search-token-index-JnwciDu0.js +0 -1
- package/assets/senders-BollE7le.js +0 -1
- package/assets/settings-aPDqsj-M.js +0 -1
- package/assets/settings-screen-DxN6mICP.js +0 -1
- package/assets/suggestion._suggestionId-m9OzQCaR.js +0 -1
- package/assets/useCalendarData-BQ_jLMR7.js +0 -1
- package/assets/useCalendarEvents-lDPF_B6_.js +0 -1
- package/assets/useCalendarFreeBusy-BFq23gzr.js +0 -1
- package/assets/useCalendarWrites-CIJUCBzo.js +0 -1
- package/assets/useCalendars-BgSJfw8G.js +0 -1
- package/assets/useLayoutTier-CUyuK30O.js +0 -1
- package/assets/useMessageBodyContent-Gq_pdN4f.js +0 -1
- package/assets/useQueries-gpmd3w5y.js +0 -1
- package/assets/useRefreshControl-DdZILsE1.js +0 -1
- package/assets/useResultFolderIndex-EOtkNq1e.js +0 -1
- package/assets/warnings-BYDfjgnx.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fZ as r,f_ as o,f$ as a}from"./index-CL_fwLHN.js";import{o as n}from"./rich-text-spellcheck-provider-J8m9wz6A.js";const l=t=>({post:e=>t.postMessage(e),listen:e=>t.addEventListener("message",s=>e(s.data)),fail:e=>t.addEventListener("error",s=>e(s.message)),terminate:()=>t.terminate()}),i=async t=>{const e=r(t);if(!e)return null;const s=new Worker(new URL("/assets/rich-text-spellcheck-worker-pWkhC-WR.js",import.meta.url),{type:"module"});return n(e,o(),l(s),a(e))};export{i as openSpellcheckWorker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t}from"./index-
|
|
1
|
+
import{b as t}from"./index-CL_fwLHN.js";const e=t("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);export{e as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d}from"./index-
|
|
1
|
+
import{r as d}from"./index-CL_fwLHN.js";const E={"data-list-row":""},v="[data-list-row]";function m(e,r,s,i="vertical"){if(s===0)return null;const n=i==="vertical"?"ArrowDown":"ArrowRight",c=i==="vertical"?"ArrowUp":"ArrowLeft";return e===n?r<0?0:Math.min(r+1,s-1):e===c?r<=0?0:r-1:e==="Home"?0:e==="End"?s-1:null}function l(e,r){return Array.from(e.querySelectorAll(r))}function y({containerRef:e,itemSelector:r,orientation:s="vertical",enabled:i=!0}){d.useEffect(()=>{if(!i)return;const n=e.current;if(!n)return;const c=()=>{const t=l(n,r);if(t.length===0)return;const f=t.find(o=>o===document.activeElement)??t[0];for(const o of t)o.tabIndex=o===f?0:-1},u=t=>{if(t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)return;const a=l(n,r),f=a.indexOf(document.activeElement),o=m(t.key,f,a.length,s);o===null||o===f||(t.preventDefault(),t.stopPropagation(),a[o]?.focus())};return c(),n.addEventListener("focusin",c),n.addEventListener("keydown",u),()=>{n.removeEventListener("focusin",c),n.removeEventListener("keydown",u)}})}export{v as L,E as a,m as r,y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,j as l,d as b,o as y,L as x}from"./index-
|
|
1
|
+
import{r as e,j as l,d as b,o as y,L as x}from"./index-CL_fwLHN.js";const o=()=>l.jsx(x,{className:"size-3.5 animate-spin"}),m=(s,n)=>n?l.jsx("span",{className:"sr-only",children:s}):s;function p({actions:s=[],destructive:n,className:i}){const[f,r]=e.useState(!1);return f&&n?.confirm?l.jsxs("div",{className:y("flex items-center gap-2",i),children:[l.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),l.jsx(b,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:n.confirm.cancelLabel??"Cancel"}),l.jsx(b,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?o():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):l.jsxs("div",{className:y("flex items-center gap-2",i),children:[s.map(a=>l.jsx(b,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?o():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:m(a.label,a.iconOnly)},a.label)),n&&l.jsx(b,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?o():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){r(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:m(n.label,n.iconOnly)})]})}export{p as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as v,P as x,r as I}from"./index-CL_fwLHN.js";import{a as p,b,h as g}from"./reply-DvdgFS16.js";import{b as Q}from"./MailShell-LIuV2C3h.js";import{a as q}from"./useMessageBodyContent-D-LJBFh4.js";function A(a){const t=v(),{searchInput:c,searchQuery:e}=x(),i=p({select:o=>b(o.location.search)}),u=p({select:o=>o.location.pathname}),h=q(),f=g(),m=h||f,{to:s}=a,r="params"in a?a.params.mailboxId:void 0,l=r?`/mail/${r}`:s;I.useEffect(()=>{if(!Q({searchInput:c,committedQuery:e,urlQuery:i,pathname:u,listPath:l}))return;const y=!!e&&i!==e&&!m,n=d=>({...d,q:e||void 0});if(!y){t({to:".",search:n,hash:!0,replace:!0});return}if(s==="/mail/$mailboxId"){if(!r)return;t({to:s,params:{mailboxId:r},search:n,hash:!0,replace:!0});return}t({to:s,search:n,hash:!0,replace:!0})},[c,e,i,t,s,r,l,u,m])}export{A as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as V,r as l,j as h,bK as _,o as E,cD as G,X as Q,cE as j,cF as J,cG as z,cH as X,cI as Y,J as x,u as K,W,Y as N,_ as Z,$ as ee,P as te,cJ as M}from"./index-CL_fwLHN.js";import{g as ne,j as k,k as oe}from"./reply-DvdgFS16.js";import{s as se,S as re}from"./search-scope-UI1H6AzA.js";import{u as F}from"./useQueries-hChzM5ru.js";const Ie=V("BellOff",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]),ae=[{action:"focusNext",keys:["j","k"],label:"navigate"},{action:"muteSender",keys:["m"],label:"mute"},{action:"help",keys:["?"],label:"all shortcuts"}];function Ce(e){return ae.filter(t=>e[t.action]!==void 0)}const ie=[{title:"Navigation",hints:[{action:"focusNext",keys:["j"],description:"Focus the message below"},{action:"focusPrevious",keys:["k"],description:"Focus the message above"},{action:"focusNext",keys:["↓"],description:"Focus the message below"},{action:"focusPrevious",keys:["↑"],description:"Focus the message above"},{action:"focusFirst",keys:["Home"],description:"Focus first"},{action:"focusLast",keys:["End"],description:"Focus last"},{action:"openFocused",keys:["Enter"],description:"Open focused thread"},{action:"back",keys:["Esc"],description:"Back / close overlay"}]},{title:"Selection",hints:[{action:"toggleSelect",keys:["x"],description:"Toggle select"},{action:"toggleSelect",keys:["Space"],description:"Toggle select"},{action:"extendSelectDown",keys:["Shift","j"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","k"],description:"Extend selection up"},{action:"extendSelectDown",keys:["Shift","↓"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","↑"],description:"Extend selection up"},{action:"selectAll",keys:["⌘","A"],description:"Select all"}]},{title:"Actions",hints:[{action:"reply",keys:["r"],description:"Reply"},{action:"replyAll",keys:["a"],description:"Reply all"},{action:"forward",keys:["f"],description:"Forward"},{action:"delete",keys:["#"],description:"Delete"},{action:"toggleStar",keys:["s"],description:"Star / unstar"},{action:"toggleRead",keys:["u"],description:"Toggle read / unread"}]},{title:"Sender",hints:[{action:"muteSender",keys:["m"],description:"Mute sender"},{action:"blockSender",keys:["b"],description:"Block sender"},{action:"vipSender",keys:["v"],description:"VIP sender"},{action:"markJunk",keys:["!"],description:"Mark junk"}]},{title:"Go to",hints:[{action:"goBrief",keys:["g","b"],description:"Daily brief"},{action:"goInbox",keys:["g","i"],description:"Inbox"},{action:"goSent",keys:["g","s"],description:"Sent"},{action:"goFlagged",keys:["g","f"],description:"Starred"},{action:"goSettings",keys:["g",","],description:"Settings"}]},{title:"View & global",hints:[{action:"toggleIntelligence",keys:["i"],description:"Toggle intelligence"},{action:"toggleDensity",keys:["d"],description:"Toggle density"},{action:"focusSearch",keys:["/"],description:"Focus search"},{action:"compose",keys:["c"],description:"Compose"},{action:"compose",keys:["⌘","N"],description:"Compose"},{action:"help",keys:["?"],description:"Shortcut help"}]}];function ce(e){for(const t of ie){const n=t.hints.find(o=>o.action===e);if(n)return n.keys}}function le(e){const t=ce(e);return!t||t.length===0?"":t.length===1?t[0]??"":t[0]==="g"?t.join(" then "):t.join("")}function we(e){const t=le(e);return t===""?"":`(${t})`}function ue({key:e,shiftKey:t=!1,repeat:n=!1,caretAtStart:o,hasValue:i,chipCount:r}){const a=r-1;return e==="Escape"?i?{type:"clearQuery"}:{type:"blur"}:e==="Tab"&&t?r===0?{type:"none"}:{type:"focusChip",index:a}:e==="Backspace"||e==="ArrowLeft"?!o||r===0?{type:"none"}:n?{type:"none"}:{type:"focusChip",index:a}:{type:"none"}}function fe({key:e,repeat:t=!1,index:n,chipCount:o}){return e==="Backspace"||e==="Delete"?t?{type:"none"}:{type:"removeChip",index:n}:e==="ArrowLeft"?n===0?{type:"none"}:{type:"focusChip",index:n-1}:e==="ArrowRight"?n>=o-1?{type:"focusInput"}:{type:"focusChip",index:n+1}:e==="Enter"||e===" "?{type:"activateChip",index:n}:e==="Escape"?{type:"focusInput"}:{type:"none"}}function de(e,t){const n=t-1;return n<=0?null:e<n?e:n-1}const pe=e=>e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable:!1,me=({chips:e=[],onRemoveChip:t,value:n,onChange:o,onClear:i,onClearQuery:r,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:p=!0,size:m="sm",inputId:f,suggest:d,className:b})=>{const D=l.useId(),R=f??D,I=l.useRef(null),P=l.useRef([]),A=r??i,[$,C]=l.useState(null),S=l.useRef(void 0),[q,B]=l.useState(""),v=e.length>0;l.useEffect(()=>{C(s=>s!==null&&s>=e.length?null:s)},[e.length]),l.useEffect(()=>{const s=S.current;if(s!==void 0){if(S.current=void 0,s===null){I.current?.focus();return}P.current[s]?.focus()}});const L=l.useRef(void 0);l.useEffect(()=>{const s=d?.caret;if(!s||s===L.current)return;L.current=s;const c=I.current;!c||c.ownerDocument.activeElement!==c||(c.setSelectionRange(s.cursor,s.cursor),d?.onCaretChange(s.cursor))});const w=s=>{d?.onCaretChange(s.selectionStart??s.value.length)},g=l.useCallback(s=>{C(s),S.current=s},[]),T=l.useCallback(s=>{const c=e[s];c&&t&&(g(de(s,e.length)),B(`${c.label} removed`),t(c.id))},[e,t,g]),O=l.useCallback(()=>{g(null),i()},[i,g]),H=l.useCallback(s=>{const c=s.currentTarget;if(d?.onKeyDown(s))return;const y=ue({key:s.key,shiftKey:s.shiftKey,repeat:s.repeat,caretAtStart:c.selectionStart===0&&c.selectionEnd===0,hasValue:n.length>0,chipCount:e.length});switch(y.type){case"focusChip":s.preventDefault(),g(y.index);return;case"clearQuery":A();return;case"blur":c.blur();return;case"none":return}},[e.length,n,A,g,d]),U=l.useCallback(s=>c=>{const y=fe({key:c.key,repeat:c.repeat,index:s,chipCount:e.length});switch(y.type!=="none"&&c.preventDefault(),y.type){case"removeChip":T(y.index);return;case"focusChip":g(y.index);return;case"focusInput":g(null);return;case"activateChip":return;case"none":return}},[e,T,g]);return l.useEffect(()=>{if(!u)return;const s=c=>{c.key!=="/"||c.metaKey||c.ctrlKey||c.altKey||pe(c.target)||j("focusSearch")||(c.preventDefault(),I.current?.focus())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[u]),h.jsxs("label",{htmlFor:R,className:E("flex w-full items-center gap-1.5 text-sm","bg-surface-sunken/50 border border-transparent","focus-within:bg-canvas focus-within:border-line focus-within:ring-2 focus-within:ring-ring","transition-colors",m==="lg"?"rounded-xl px-4 py-2":"rounded-md px-2.5 py-1",b),children:[h.jsx(_,{className:E("shrink-0 text-fg-muted pointer-events-none",m==="lg"?"size-5":"size-4")}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:[v&&h.jsx("div",{role:"grid","aria-label":"Search filters",className:"flex min-w-0 flex-wrap items-center gap-1",children:e.map((s,c)=>h.jsx(G,{ref:y=>{P.current[c]=y},label:s.label,tone:s.tone,focused:$===c,onFocusLabel:()=>C(c),onKeyDown:U(c),onRemove:()=>T(c)},s.id))}),h.jsx("input",{ref:I,id:R,name:"q",type:"text","aria-label":"Search mail",autoComplete:"off",value:n,tabIndex:$===null?0:-1,onChange:s=>{o(s.target.value),w(s.target)},onKeyDown:H,onKeyUp:s=>w(s.currentTarget),onClick:s=>w(s.currentTarget),onFocus:s=>{C(null),d?.onFocusChange?.(!0),w(s.currentTarget)},onBlur:()=>d?.onFocusChange?.(!1),...d?.comboboxProps,placeholder:v?void 0:a,className:"min-w-24 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-muted"})]}),(n||v)&&p&&h.jsx("button",{type:"button",onClick:O,className:"shrink-0 rounded p-0.5 hover:bg-surface-raised transition-colors","aria-label":"Clear search",children:h.jsx(Q,{className:E("text-fg-muted",m==="lg"?"size-5":"size-4")})}),h.jsx("span",{role:"status","aria-live":"polite",className:"sr-only",children:q})]})},Se=({value:e,onChange:t,onClear:n,onClearQuery:o,chips:i,onRemoveChip:r,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:p=!0,size:m,inputId:f,suggest:d,className:b})=>h.jsx(me,{value:e,onChange:t,onClear:n,onClearQuery:o,chips:i,onRemoveChip:r,placeholder:a,globalFocusKey:u,showClearButton:p,size:m,inputId:f,suggest:d,className:b});function ve({handlers:e,enabled:t=!0,target:n,sequenceTimeoutMs:o=1e3}){const i=l.useRef(e);i.current=e;const r=l.useRef(null),a=l.useRef(null);l.useEffect(()=>{if(!t)return;const u=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null)},p=f=>{const d=J({key:f.key,shiftKey:f.shiftKey,metaKey:f.metaKey,ctrlKey:f.ctrlKey,altKey:f.altKey,inEditable:X(f.target),onControl:z(f.target)},r.current);if(Y().length>0){u(),r.current=null;return}if(u(),r.current=d.nextPrefix,d.nextPrefix!==null&&(a.current=setTimeout(()=>{r.current=null,a.current=null},o)),d.action===null||j(d.action)!==null)return;const b=i.current[d.action];b&&(d.preventDefault&&f.preventDefault(),b())},m=n===void 0?window:n;if(m!==null)return m.addEventListener("keydown",p),()=>{m.removeEventListener("keydown",p),u(),r.current=null}},[t,o,n])}function Te(){const e=x({from:"/mail/brief/$threadId",shouldThrow:!1}),t=x({from:"/mail/brief/$threadId/$messageId",shouldThrow:!1}),n=x({from:"/mail/flagged/$threadId",shouldThrow:!1}),o=x({from:"/mail/flagged/$threadId/$messageId",shouldThrow:!1}),i=x({from:"/mail/$mailboxId/$threadId",shouldThrow:!1}),r=x({from:"/mail/$mailboxId/$threadId/$messageId",shouldThrow:!1}),a=e?.threadId??n?.threadId??i?.threadId,u=t?.messageId??o?.messageId??r?.messageId;return l.useMemo(()=>a?{threadId:a,messageId:u}:void 0,[a,u])}function Ee(){const e=K(),t=ne(),{list:n,mailboxId:o}=k();return l.useCallback((i,r)=>{const a=r?.query,p={search:f=>a===void 0?f:{...f,q:a||void 0},hash:t,replace:r?.replace??!1};if(n==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:i,...p});return}const m=r?.mailboxId??o;if(n==="mailbox"&&m){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:m,...i},...p});return}e({to:"/mail/brief/$threadId/$messageId",params:i,...p})},[e,t,n,o])}function Me(){return oe()}function he(){const e=K();return l.useCallback(t=>{e({to:"/mail/brief",search:{q:t||void 0}})},[e])}function Ke(){const e=K();return l.useCallback((t,n)=>{e({to:"/mail/$mailboxId",params:{mailboxId:t},search:{q:n||void 0}})},[e])}const ge=({accounts:e})=>{const{list:t,mailboxId:n}=k(),{t:o}=W("mail",{useSuspense:!1}),i=l.useCallback((a,u)=>o(a,{defaultValue:u}),[o]),r=F({queries:e.map(a=>({...N({path:{accountId:a.accountId}}),staleTime:1/0}))});if(t==="outbox")return"Outbox";if(!n)return null;for(let a=0;a<e.length;a++){const u=r[a]?.data?.items;if(!u)continue;const p=u.find(f=>f.mailboxId===n);if(!p)continue;const m=Z(e[a].folderAppointments);return ee(p,m.get(n),i)}return null},Ne=({accounts:e})=>{const{mailboxId:t}=k(),n=F({queries:e.map(o=>({...N({path:{accountId:o.accountId}}),staleTime:1/0}))});if(!t)return null;for(const o of n){const i=o.data?.items;if(!i)continue;const r=i.find(a=>a.mailboxId===t);if(r)return r.unseenCount}return null},Fe=({accounts:e})=>{const{mailboxId:t}=k(),n=F({queries:e.map(o=>({...N({path:{accountId:o.accountId}}),staleTime:1/0}))});if(!t)return 0;for(const o of n){const i=o.data?.items;if(!i)continue;const r=i.find(a=>a.mailboxId===t);if(r)return r.messageCount}return 0};function Re(e){const t=he(),{searchInput:n}=te(),o=ge({accounts:e}),i=k(),r=l.useMemo(()=>se(i,o),[i,o]),a=l.useCallback(u=>{u===re&&t(n)},[t,n]);return{scope:r,clearScope:a}}function Pe(e){const t=new Map;for(const n of e){const o=n.email.toLowerCase(),i=o.split("@")[0];i&&!t.has(i)&&t.set(i,n.accountId),t.has(o)||t.set(o,n.accountId)}return t}function Ae(e){const t=new Map;for(const n of e)for(const o of n){const i=o.fullPath?.toLowerCase();if(!i)continue;const r=M(o).toLowerCase();t.has(i)||t.set(i,o.mailboxId),t.has(r)||t.set(r,o.mailboxId)}return t}function $e(e,t=[]){const n=e.flat().filter(r=>r.fullPath),o=new Map;for(const r of n){const a=M(r).toLowerCase();o.set(a,(o.get(a)??0)+1)}const i=new Map(t.map(r=>[r.accountId,r.email]));return n.map(r=>{const a=M(r),u=o.get(a.toLowerCase())===1,p=t.length>1?i.get(r.accountId):void 0;return{value:u?a:r.fullPath,label:r.displayNameOverride?.trim()||a,...p?{hint:p}:{}}})}function Le(e){const t=new Map;for(const n of e){const o=n.email.toLowerCase().split("@")[0]??"";t.set(o,(t.get(o)??0)+1)}return e.map(n=>{const o=n.email.split("@")[0]??n.email,i=t.get(o.toLowerCase())===1,r=n.displayName?.trim();return{value:i?o:n.email,label:r||n.email,...r?{hint:n.email}:{}}})}export{Ie as B,ie as K,Se as S,Te as a,Ae as b,ve as c,Pe as d,Ee as e,Me as f,ge as g,Ne as h,Fe as i,ae as j,$e as k,Le as l,Ke as m,Ce as n,le as s,we as t,Re as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e,r as s}from"./index-
|
|
1
|
+
import{u as e,r as s}from"./index-CL_fwLHN.js";const a={brief:"/mail/brief",flagged:"/mail/flagged",outbox:"/mail/outbox",settings:"/settings",accounts:"/settings/accounts",importConfig:"/import"};function c(){const t=e();return s.useCallback(o=>{t({to:a[o]})},[t])}function i(){const t=e();return s.useCallback(o=>{t({to:"/settings/accounts",search:{editAccountId:o,focusSmtp:!0}})},[t])}export{i as a,c as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,o as S,f as I,r as c,bH as A,a as C,g as k,bI as P,bJ as L,d as N,X as M,u as O,aK as T,au as $,bK as q,aM as K,bL as R,bM as D,S as G}from"./index-CL_fwLHN.js";import{E}from"./ErrorState-KjDYblD5.js";import{K as f}from"./kbd-CDJCJUnp.js";import{a as V,S as Q}from"./settings-screen-DBP3ABLE.js";import{u as _}from"./useDebouncedValue-BTZsNKEh.js";import{s as B}from"./help-copy-B2iT8EG_.js";import"./avatar-uWJajuSb.js";import"./menu-CcLh9Whg.js";import"./circle-help-CVWHf1ow.js";function F({options:t,active:r,onSelect:m}){return e.jsx("div",{role:"tablist",className:S("flex shrink-0 gap-1 overflow-x-auto border-b border-line p-2","lg:w-44 lg:flex-col lg:gap-0 lg:overflow-visible lg:border-r lg:border-b-0 lg:py-2 lg:pr-2 lg:pl-3"),children:t.map(n=>{const d=n.id===r;return e.jsxs("button",{type:"button",role:"tab","aria-selected":d,onClick:()=>m(n.id),className:S("flex min-h-11 shrink-0 items-center gap-2 rounded-md px-3 text-left text-sm transition-colors lg:min-h-0 lg:px-2 lg:py-1",d?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface-sunken hover:text-fg"),children:[e.jsx("span",{className:"flex-1 truncate",children:n.label}),e.jsx("span",{className:S("text-2xs tabular-nums",d?"text-accent-2":"text-fg-subtle"),children:n.count??"—"})]},n.id)})})}const v={vip:"VIPs",muted:"Muted",blocked:"Blocked"};function H({query:t,onCount:r}){const{data:m,isPending:n,isError:d,error:b}=C(R()),g=I(),i=k({...P(),onSettled:()=>{g.invalidateQueries({queryKey:D()})}}),l=m?.suggestions??[],p=t.trim().toLowerCase(),u=p?l.filter(a=>(a.displayName??"").toLowerCase().includes(p)||a.normalizedEmail.toLowerCase().includes(p)):l;return c.useEffect(()=>{r?.(u.length,l.length)},[r,u.length,l.length]),n?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Loading VIP suggestions…"}):d?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(E,{variant:"inline",title:"Couldn't load VIP suggestions",error:b})}):l.length===0?e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIP suggestions yet. As you reply to senders, they'll appear here. Press ",e.jsx(f,{children:"v"})," on any message to promote a sender to VIP."]}):u.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIPs match “",t,"”."]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-row-inset py-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Suggested — promote to VIP"}),u.map(a=>e.jsx(V,{name:a.displayName??a.normalizedEmail,email:a.normalizedEmail,meta:a.replyCount>0?`${a.inboundCount} received · you replied ${a.replyCount}×`:`${a.inboundCount} received · you've never replied`,trailing:e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(G,{className:"size-3.5"}),"aria-busy":i.isPending,onClick:()=>{i.isPending||i.mutate({path:{addressId:a.addressId},body:{flags:{vip:{value:!0,setAt:Date.now(),setBy:"user"}}}})},children:"Add VIP"})},a.addressId))]})}function J({group:t,query:r,onCount:m}){const n=_(r.trim(),300),d=I(),[b,g]=c.useState(null),i=n.length>=2,l=A({query:{q:n,limit:50}}),{data:p,isPending:u,isError:a,error:j}=C({...l,enabled:i}),x=k({...P(),onSuccess:()=>{d.invalidateQueries({queryKey:l.queryKey})}}),h=(p?.items??[]).filter(s=>t==="muted"?s.flags?.muted?.value??!1:s.flags?.blocked?.value??!1);return c.useEffect(()=>{m?.(i?h.length:0,null)},[m,i,h.length]),i?u?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Searching…"}):a?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(E,{variant:"inline",title:"Search failed",error:j})}):h.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No ",v[t].toLowerCase()," senders matching “",n,"”."]}):e.jsx(e.Fragment,{children:h.map(s=>{const o=t==="muted"?s.flags?.muted:s.flags?.blocked,y=o?[`${t}`,o.setAt&&L(o.setAt,{month:"short",year:"numeric"})||null,o.reason?`— ${o.reason}`:null].filter(Boolean).join(" "):t,w=x.isPending&&x.variables?.path.addressId===s.addressId,z=x.isError&&b===s.addressId;return e.jsx(V,{name:s.displayName??s.normalizedEmail,email:s.normalizedEmail,danger:t==="blocked",meta:y,trailing:z?e.jsx(N,{variant:"secondary",size:"sm",onClick:()=>{g(s.addressId),x.mutate({path:{addressId:s.addressId},body:{flags:{[t]:{value:!1,setAt:Date.now()}}}})},children:"Retry"}):e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(M,{className:"size-3.5"}),"aria-busy":w,"aria-label":`Remove ${t} flag`,onClick:()=>{w||(g(s.addressId),x.mutate({path:{addressId:s.addressId},body:{flags:{[t]:{value:!1,setAt:Date.now()}}}}))}})},s.addressId)})}):e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle space-y-2",children:[e.jsxs("p",{children:["Type 2+ characters to search ",v[t].toLowerCase()," ","senders by name or address."]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Note: a dedicated flagged-address list endpoint is in the backlog. Press ",e.jsx(f,{children:"m"})," on any message to mute its sender; ",e.jsx(f,{children:"b"})," to block."]})]})}function ne(){const t=O(),[r,m]=c.useState("vip"),[n,d]=c.useState(""),[b,g]=c.useState(!0),[i,l]=c.useState(0),[p,u]=c.useState({vip:0,muted:null,blocked:null}),a=c.useCallback((s,o)=>{l(s),u(y=>({...y,vip:o}))},[]),j=c.useCallback((s,o)=>{l(s),u(y=>({...y,[r]:s}))},[r]),x=p[r],h=s=>{const o=K[s];o&&t({to:o})};return e.jsx(Q,{items:T,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:B,helpOpen:b,onToggleHelp:()=>g(s=>!s),onSelect:h,onBackToMail:()=>{t({to:"/mail"})},children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[e.jsx(F,{active:r,onSelect:s=>{m(s),d("")},options:["vip","muted","blocked"].map(s=>({id:s,label:v[s],count:p[s]}))}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("div",{className:"border-b border-line px-row-inset py-2",children:e.jsx($,{icon:e.jsx(q,{className:"size-4"}),placeholder:`Filter ${v[r].toLowerCase()} by name or address`,className:"h-8 max-w-sm",value:n,onChange:s=>d(s.target.value)})}),e.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto",children:r==="vip"?e.jsx(H,{query:n,onCount:a}):e.jsx(J,{group:r,query:n,onCount:j})}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-line px-row-inset py-1 text-2xs text-fg-subtle",children:[e.jsx("span",{children:x!=null?`${i} of ${x} flagged senders`:`${i} flagged senders`}),e.jsxs("span",{children:[e.jsx(f,{children:"j"})," ",e.jsx(f,{children:"k"})," navigate · ",e.jsx(f,{children:"⌫"})," remove flag"]})]})]})]})})}export{J as SearchGroupPane,ne as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,O as o}from"./index-CL_fwLHN.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as j,j as e,o as f,bR as h,d as i,X as N,e as C}from"./index-CL_fwLHN.js";import{A as w}from"./avatar-uWJajuSb.js";import{M as S}from"./menu-CcLh9Whg.js";import{C as v}from"./circle-help-CVWHf1ow.js";function E({items:l,activeId:t,title:x,description:n,children:r,help:s,helpOpen:d=!0,flush:o,onSelect:k,onToggleHelp:u,onBackToMail:m}){const[y,c]=j.useState(!1),[b,z]=j.useState(!1),p=!!s&&d,g=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pt-3 pb-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Settings"}),e.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-1",children:l.map(a=>e.jsxs("button",{type:"button",onClick:()=>{k?.(a.id),c(!1)},className:f("flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors lg:min-h-0",a.id===t?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg"),children:[a.icon&&e.jsx("span",{className:f("shrink-0",a.id===t?"text-accent-2":"text-fg-subtle"),children:a.icon}),a.label]},a.id))})]});return e.jsxs("div",{className:"safe-area-frame flex h-dvh w-full overflow-hidden bg-canvas font-sans text-fg",children:[e.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col border-r border-line bg-surface-sunken lg:flex",children:[e.jsx("div",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-2",children:e.jsxs("button",{type:"button",onClick:m,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(h,{className:"size-4 text-fg-subtle"}),"Back to mail"]})}),g]}),y&&e.jsxs("div",{className:"fixed inset-0 z-50 flex lg:hidden",children:[e.jsx("button",{type:"button","aria-label":"Close menu",className:"absolute inset-0 bg-canvas/60",onClick:()=>c(!1)}),e.jsxs("aside",{className:"safe-area-frame relative flex w-72 max-w-[85%] flex-col border-r border-line bg-surface-sunken",children:[e.jsxs("div",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-2",children:[e.jsxs("button",{type:"button",onClick:()=>{m?.(),c(!1)},className:"flex items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(h,{className:"size-4 text-fg-subtle"}),"Back to mail"]}),e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),onClick:()=>c(!1),"aria-label":"Close menu"})]}),g]})]}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-3 border-b border-line px-3 lg:px-5",children:[m&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(h,{className:"size-4"}),className:"-ml-1 lg:hidden",onClick:m,"aria-label":"Back to mail"}),e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(S,{className:"size-4"}),className:"lg:hidden",onClick:()=>c(!0),"aria-label":"Open settings menu"}),e.jsx("h1",{className:"text-md font-semibold text-fg",children:x}),n&&e.jsx("p",{className:"hidden min-w-0 truncate text-xs text-fg-subtle lg:block",children:n}),s&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(v,{className:"size-4"}),className:"ml-auto lg:hidden",onClick:()=>z(a=>!a),"aria-label":"Tips","aria-expanded":b}),s&&!p&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(v,{className:"size-4"}),className:"hidden ml-auto lg:inline-flex",onClick:u,"aria-label":"Show tips"})]}),s&&b&&e.jsx("div",{className:"border-b border-line bg-surface-sunken px-row-inset py-3 text-xs leading-relaxed text-fg-muted lg:hidden",children:s}),o?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:r}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-2xl px-3 py-5 lg:px-5",children:e.jsx("div",{className:"space-y-5",children:r})})})]}),p&&e.jsxs("aside",{className:"hidden w-64 shrink-0 flex-col border-l border-line bg-surface-sunken lg:flex",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-row-inset",children:[e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Tips & tricks"}),e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-3.5"}),onClick:u,"aria-label":"Collapse tips"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-row-inset py-3 text-xs leading-relaxed text-fg-muted",children:s})]})]})}function F({name:l,email:t,meta:x,caption:n,danger:r,trailing:s}){return e.jsxs("div",{className:"flex items-center gap-3 px-row-inset py-2 hover:bg-surface-sunken",children:[e.jsx("span",{className:f(r&&"rounded-full ring-2 ring-danger/40"),children:e.jsx(w,{name:l,email:t,size:"sm"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-col gap-0 sm:flex-row sm:items-baseline sm:gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium text-fg",children:l}),e.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:t})]}),e.jsxs("div",{className:"text-xs text-fg-subtle",children:[x,n&&e.jsxs("span",{className:"text-fg-muted",children:[" · ",n]})]})]}),s&&e.jsx("div",{className:"shrink-0",children:s})]})}const O={healthy:{tone:"positive",label:"healthy"},error:{tone:"danger",label:"error"},muted:{tone:"neutral",label:"muted"}};function L({label:l,email:t,connector:x,syncLabel:n,state:r,errorDetail:s,trailing:d}){const o=O[r];return e.jsxs("div",{className:f("rounded-sm border border-line bg-surface",r==="muted"&&"opacity-65"),children:[e.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx(w,{name:l,email:t,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:l}),e.jsx(C,{tone:o.tone,dot:!0,children:o.label})]}),e.jsxs("div",{className:"truncate text-xs text-fg-subtle",children:[t," · ",x," · ",n]})]})]}),d&&e.jsx("div",{className:"shrink-0",children:d})]}),s&&e.jsx("div",{className:"border-t border-line px-row-inset py-2",children:e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s})})]})}export{L as A,E as S,F as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./index-
|
|
1
|
+
import{b as e}from"./index-CL_fwLHN.js";const d=e("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const h=e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{d as C,h as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a}from"./index-CL_fwLHN.js";const p=a("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);export{p as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,
|
|
1
|
+
import{j as t,ad as e}from"./index-CL_fwLHN.js";const o=()=>t.jsx(e,{to:"/settings/senders",replace:!0});export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i,X as Z,o as R,f6 as O,fb as $,f9 as v,r as u,cj as E,fR as F}from"./index-CL_fwLHN.js";import{E as L,C as W}from"./EmptyState-BUOSmldo.js";import{C as z}from"./calendar-event-sidebar-soFGsDRR.js";import{C as B}from"./calendar-failure-note-BtZLcaiZ.js";import{b as j,m as H,e as h,n as U,t as _,U as S,x as P,k,j as M,o as V}from"./useCalendarSuggestions-D3Jza1d7.js";import{e as w,p as G,a as X}from"./draft-Y5XWTm_J.js";import{f as Y}from"./calendar-format-BwCpz-JZ.js";import{a as q}from"./CalendarSession-BKwK9s2o.js";import"./reply-DvdgFS16.js";import{k as J,b as K}from"./calendar-tMekVEGW.js";import"./calendar-guests-BR4hC59z.js";import"./calendar-event-popup-DsPmxVye.js";import"./pencil-LSmMSKiW.js";import"./circle-help-CVWHf1ow.js";import"./ErrorState-KjDYblD5.js";import"./useQueries-hChzM5ru.js";import"./useMediaQuery-DiQ0fGER.js";function I({title:e,subtitle:a,onClose:r,children:s,className:o}){return i.jsxs("section",{className:R("flex h-full w-full flex-col bg-surface",o),children:[i.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[i.jsx("h2",{className:"shrink-0 text-xs font-medium text-fg",children:e}),a!==void 0&&a!==""&&i.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:a}),i.jsx("button",{type:"button","aria-label":"Close editor",onClick:r,className:"ml-auto flex size-7 shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Z,{className:"size-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-5",children:i.jsx("div",{className:"mx-auto w-full max-w-2xl",children:s})})]})}function Q(e,a,r){const s={title:e.summary,location:e.location};if(e.allDay){const t=e.dtStart.slice(0,10),c=e.dtEnd.slice(0,10);return{...w(t,a),...s,allDay:!0,startTime:"",endDate:c>t?O(c,-1):t,endTime:""}}const o=t=>e.zoneCertainty==="Ambiguous"?t:$(t,r),l=o(e.dtStart),d=o(e.dtEnd);return{...w(l.slice(0,10),a),...s,startTime:l.slice(11,16),endDate:d.slice(0,10),endTime:d.slice(11,16)}}function ee(e,a,r,s){const o=G(a,r,s);if(!o.ok)return o;const d=e.zoneCertainty==="Ambiguous"||o.patch.start!==void 0?{...o.patch,...X(r,s.clock),allDay:r.allDay,timeZone:s.anchor}:o.patch;return{ok:!0,input:{calendarId:r.calendarId,event:d}}}const te=[],ae={from:"",to:""};function ne(e,a=""){const{timeZoneByCalendarId:r}=j(),s=e.date!==""&&!e.allDay&&e.endDate!==""&&e.startTime!==""&&e.endTime!==""&&`${e.endDate}T${e.endTime}`>`${e.date}T${e.startTime}`,{instances:o,isLoading:l,error:d}=H({...s?{from:v("week",e.date).from,to:v("week",e.endDate).to}:ae,calendarIds:te,enabled:s}),t=h();return u.useMemo(()=>{if(!s||l||d)return;const c=E(e.date,e.startTime,t),p=E(e.endDate,e.endTime,t),f=o.filter(m=>U(m)&&m.calendarObjectId!==a).map(m=>_(m,r[m.calendarId]??S,t));return F({start:c,end:p},f).map(m=>({id:m.id,label:`${m.title}, ${Y(m)}`}))},[s,l,d,e.date,e.endDate,e.startTime,e.endTime,t,o,a,r])}const x="Add from mail",se="The invitation named a time zone nothing could resolve. The time below is as the mail wrote it — check it before adding.";function oe({suggestionId:e,onClose:a}){const{suggestion:r,isLoading:s,error:o}=P(e),l=r??void 0,[d,t]=u.useState(void 0);l!==void 0&&d===void 0&&t(l);const c=d??l;if(c!==void 0)return i.jsx(ie,{suggestion:c,onClose:a},c.suggestionId);if(o!==null){const p="Couldn't read what your mail is waiting on.";return i.jsx(I,{title:x,onClose:a,children:i.jsx(B,{text:`${p} Close this and try again.`,reportHref:k(p),className:"m-row-inset"})})}return i.jsx(I,{title:x,onClose:a,children:i.jsx(L,{message:s?"Reading the suggestion…":"This suggestion is no longer waiting on you. It was answered, or a later message replaced it."})})}function ie({suggestion:e,onClose:a}){const{calendars:r,defaultCalendarId:s,timeZoneByCalendarId:o}=j(),l=r.filter(n=>!n.readOnly),d=M(),[t]=u.useState(()=>Q(e,"",h())),[c,p]=u.useState(t),f=q()?.dispatch;u.useEffect(()=>{f?.({type:"sidebar-range",range:{date:t.date,endDate:t.endDate,startTime:t.allDay?"":t.startTime,endTime:t.allDay?"":t.endTime,allDay:t.allDay}})},[t,f]);const[m,y]=u.useState(""),[N,A]=u.useState(),D=ne(c),g=l.some(n=>n.id===s)?s:l[0]?.id??"";u.useEffect(()=>{g!==""&&p(n=>n.calendarId===""?{...n,calendarId:g}:n)},[g]);const C=()=>{const n=ee(e,t,c,{clock:h(),anchor:V(o[c.calendarId]??S)});if(!n.ok){y(n.problem);return}y(""),d.acceptEdited(e.suggestionId,n.input).then(b=>{if(b.kind==="answered"){a();return}const T=`Couldn't add this to your calendar: ${b.message}`;A({text:T,reportHref:k(T),onRetry:C})})};return i.jsx(z,{heading:x,draft:c,onChange:n=>{p(n),f?.({type:"sidebar-range",range:{date:n.date,endDate:n.endDate,startTime:n.allDay?"":n.startTime,endTime:n.allDay?"":n.endTime,allDay:n.allDay}})},calendars:l,calendarEditable:!0,repeatEditable:!1,timeZone:h(),timeZones:[h()],onTimeZone:()=>{},busy:!0,onBusy:()=>{},onSave:C,onCancel:a,saving:d.isAnswering,saveLabel:"Add",failure:N,problem:m!==""?m:e.zoneCertainty==="Ambiguous"?se:"",children:D&&i.jsx(W,{clashes:D})})}function Ee(){const e=J(),{closeToView:a}=K();return e===void 0?null:i.jsx(oe,{suggestionId:e,onClose:a})}export{Ee as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as w,r as d,j as e,T as R,X as E,o as z,C as $,fb as B,cj as L,fS as q}from"./index-CL_fwLHN.js";import{b as F,C as j,u as P}from"./useCalendarTasks-D_NZ0GM6.js";import{C as V}from"./calendar-event-popup-DsPmxVye.js";import{b as Z,e as H,c as K}from"./useCalendarSuggestions-D3Jza1d7.js";import"./reply-DvdgFS16.js";import{b as S}from"./calendar-tMekVEGW.js";import{C as M}from"./CalendarLoadFailed-CxL15r1A.js";import"./ErrorState-KjDYblD5.js";import"./pencil-LSmMSKiW.js";import"./useQueries-hChzM5ru.js";import"./useMediaQuery-DiQ0fGER.js";const A=w("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const O=w("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),D="flex size-9 items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40",v="h-9 w-full rounded-md border border-line bg-surface-sunken px-2 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring/30";function W({headingId:t,headingRef:i,fields:l,dueText:r,listName:u,completed:c,onToggle:f,onSave:x,onDelete:g,onClose:p,busy:m=!1,failure:h}){const[s,o]=d.useState(null);return e.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[e.jsxs("div",{className:"flex justify-end gap-1",children:[s===null&&e.jsx("button",{type:"button",onClick:()=>o(l),className:"rounded-md px-3 text-sm font-medium text-accent hover:bg-accent-soft focus-visible:ring-2 focus-visible:ring-ring",children:"Edit"}),e.jsx("button",{type:"button","aria-label":"Delete",onClick:g,disabled:m,className:D,children:e.jsx(R,{className:"size-4"})}),e.jsx("button",{type:"button","aria-label":"Close",onClick:p,className:D,children:e.jsx(E,{className:"size-4"})})]}),s===null?e.jsxs("div",{className:"flex flex-col gap-2 px-2",children:[e.jsx("h2",{id:t,ref:i,tabIndex:-1,className:z("text-xl font-normal break-words text-fg outline-none",c&&"text-fg-muted line-through"),children:l.title===""?"(No title)":l.title}),e.jsx("p",{className:"text-sm text-fg-muted",children:r}),e.jsxs("p",{className:"flex items-center gap-2 text-sm",children:[e.jsx($,{className:"size-4 text-fg-subtle","aria-label":"List"}),u]}),l.description!==""&&e.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:l.description})]}):e.jsxs("form",{className:"flex flex-col gap-2 px-2",onSubmit:n=>{n.preventDefault(),x(s),o(null)},children:[e.jsx("h2",{id:t,className:"sr-only",children:"Edit task"}),e.jsx("input",{"aria-label":"Title",value:s.title,onChange:n=>o({...s,title:n.target.value}),className:v}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"date","aria-label":"Due date",value:s.dueDate,onChange:n=>n.target.value!==""&&o({...s,dueDate:n.target.value}),className:v}),e.jsx("input",{type:"time","aria-label":"Due time",value:s.dueTime,onChange:n=>o({...s,dueTime:n.target.value}),className:v})]}),e.jsx("textarea",{"aria-label":"Description",rows:3,value:s.description,onChange:n=>o({...s,description:n.target.value}),className:"w-full rounded-md border border-line bg-surface-sunken px-2 py-1 text-sm"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>o(null),className:"h-9 rounded-md border border-line px-3 text-sm font-medium",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:m,className:"h-9 rounded-md bg-accent px-4 text-sm font-medium text-accent-fg disabled:opacity-50",children:"Save"})]})]}),h&&e.jsx(V,{failure:h}),s===null&&e.jsx("div",{className:"flex justify-end px-2",children:e.jsxs("button",{type:"button",onClick:f,disabled:m,className:"inline-flex h-9 items-center gap-2 rounded-md border border-line px-3 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:[c?e.jsx(O,{className:"size-4","aria-hidden":"true"}):e.jsx(A,{className:"size-4","aria-hidden":"true"}),c?"Mark not done":"Mark done"]})})]})}const U=(t,i)=>{const l=new Date(`${t.slice(0,10)}T00:00:00Z`),r=new Intl.DateTimeFormat(void 0,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"}).format(l);return i?`Due ${r}`:`Due ${r} · ${t.slice(11,16)}`};function X({calendarTaskId:t}){const i=F(t),{closeToView:l}=S(),r=d.useId(),u=d.useRef(null),c=i.kind==="gone";return d.useEffect(()=>{c&&u.current?.focus()},[c]),i.kind==="loading"?null:i.kind==="found"?e.jsx(G,{task:i.task}):i.kind==="failed"?e.jsx(j,{anchor:null,anchorKey:"failed",labelledBy:r,children:e.jsx("div",{id:r,className:"p-4",children:e.jsx(M,{title:"Couldn't open this task",error:i.error,onRetry:i.retry,compact:!0})})}):e.jsx(j,{anchor:null,anchorKey:"gone",labelledBy:r,children:e.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[e.jsx("h2",{id:r,className:"text-base font-medium text-fg",children:"This task was deleted or moved"}),e.jsx("button",{ref:u,type:"button",onClick:l,className:"self-end rounded-md border border-line px-3 py-1.5 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Close"})]})})}function G({task:t}){const{taskLists:i}=Z(),{closeToView:l}=S(),{updateTask:r,deleteTask:u,isWriting:c}=P(),f=d.useId(),x=d.useRef(null),[g,p]=d.useState(),[m,h]=d.useState(null),{calendarTaskId:s}=t;d.useLayoutEffect(()=>{h(document.querySelector(`[data-task-id="${CSS.escape(s)}"]`))},[s]),d.useEffect(()=>{x.current?.focus()},[]);const o=H(),n=t.allDay?t.due:B(t.due,o),I={title:t.summary,dueDate:n.slice(0,10),dueTime:t.allDay?"":n.slice(11,16),description:t.description},b=a=>N=>{if(N.kind==="written"){p(void 0);return}const T=`Couldn't save the task: ${N.message}`;p({text:T,reportHref:K(T),onRetry:a})},y=()=>{r(t,{completed:!t.completed}).then(b(y))},C=a=>{r(t,{summary:a.title,description:a.description,allDay:a.dueTime==="",due:a.dueTime===""?a.dueDate:L(a.dueDate,a.dueTime,o)}).then(b(()=>C(a)))},k=()=>{u(t).then(a=>{if(a.kind==="written"){l();return}b(k)(a)})};return e.jsx(j,{anchor:m,anchorKey:`${s}:${m?"chip":"none"}`,labelledBy:f,children:e.jsx(W,{headingId:f,headingRef:x,fields:I,dueText:U(n,t.allDay),listName:i.find(a=>a.id===t.calendarId)?.name??"Tasks",completed:t.completed,onToggle:y,onSave:C,onDelete:k,onClose:l,busy:c,failure:g})})}function re(){const{calendarTaskId:t}=q.useParams();return e.jsx(X,{calendarTaskId:t})}export{re as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./index-
|
|
1
|
+
import{b as a}from"./index-CL_fwLHN.js";const d=a("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);export{d as U};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as c,o as x,d as E,r as f,f9 as S}from"./index-CL_fwLHN.js";import{o as A,b as L,e as O,n as W,t as Z,U as B,m as P,p as U,h as F,r as M}from"./useCalendarSuggestions-D3Jza1d7.js";import{a as z,t as q}from"./useCalendarTasks-D_NZ0GM6.js";const K=[{scope:"this",label:"This event",note:"Leaves the rest of the series alone"},{scope:"following",label:"This and everything after",note:"Splits the series here"},{scope:"all",label:"The whole series",note:"Rewrites the rule itself"}];function Q({title:e,ruleText:s,instanceText:n,onChoose:t,onCancel:r,scopes:a,touch:o,className:d}){return c.jsxs("div",{className:x("flex flex-col gap-3",d),children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-md font-semibold text-fg",children:[e," repeats"]}),c.jsx("p",{className:"text-xs text-fg-muted",children:s}),c.jsxs("p",{className:"text-xs text-fg-subtle",children:["You clicked ",n,"."]})]}),c.jsx("p",{className:"text-sm text-fg",children:"What should the change apply to?"}),c.jsx("div",{className:"flex flex-col gap-1.5",children:K.filter(l=>a===void 0||a.includes(l.scope)).map(l=>c.jsxs("button",{type:"button",onClick:()=>t(l.scope),className:x("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",o&&"min-h-11 justify-center"),children:[c.jsx("span",{className:"text-sm font-medium text-fg",children:l.label}),c.jsx("span",{className:"text-2xs text-fg-subtle",children:l.note})]},l.scope))}),c.jsx(E,{variant:"ghost",size:o?"md":"sm",onClick:r,className:x("self-start",o&&"min-h-11"),children:"Cancel"})]})}const C=e=>e.replace(/\r?\n[ \t]/g,""),I=e=>e.replace(/\\n/gi,`
|
|
2
|
+
`).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function g(e,s){let n=!1;for(let t=s.length;t<e.length;t+=1){const r=e[t];if(t===s.length&&r!==";"&&r!==":")return;if(r==='"'){n=!n;continue}if(!n&&r===":")return e.slice(t+1).trim()}}function v(e,s){for(const n of C(e).split(/\r?\n/)){if(!n.startsWith(s))continue;const t=g(n,s);if(t!==void 0)return t}return""}const X=e=>v(e,"RRULE"),$=e=>({location:I(v(e,"LOCATION")),description:I(v(e,"DESCRIPTION"))});function ee(e,s){const n=C(e).split(/\r?\n/).find(r=>r.startsWith("DTSTART")&&g(r,"DTSTART")!==void 0);if(n===void 0)return A(s);const t=/;TZID="?([^;:"]+)"?/i.exec(n)?.[1];return t!==void 0?Intl.supportedValuesOf("timeZone").includes(t)?t:s:g(n,"DTSTART")?.toUpperCase().endsWith("Z")?"":s}function V(e,s){const n=e.map(a=>a.id);if(s.length===0)return n;const t=new Set(s),r=n.filter(a=>t.has(a));return r.length===0?n:r}function Y(e){const{calendars:s,colorByCalendarId:n,timeZoneByCalendarId:t,isLoading:r}=L(),a=V(s,e),o=a.length===s.length?[]:a,d=e.length===0||s.length>0;return{calendars:s,colorByCalendarId:n,timeZoneByCalendarId:t,shown:a,narrowed:o,resolved:d,isLoading:r}}function _(e,s,n){const t=n.join(",");return f.useMemo(()=>{const r=O(),a=new Set(t===""?[]:t.split(","));return e.filter(o=>W(o)&&a.has(o.calendarId)).map(o=>Z(o,s[o.calendarId]??B,r))},[e,s,t])}function se({view:e,date:s,calendarIds:n,enabled:t=!0}){const{calendars:r,colorByCalendarId:a,timeZoneByCalendarId:o,shown:d,narrowed:l,resolved:j,isLoading:N}=Y(n),w=S(e,s),h=t&&j,i=P({...w,calendarIds:l,enabled:h});U(e,s,l,h);const k=_(i.instances,o,d),p=z(w,h),m=p.tasks,D=f.useMemo(()=>m.map(q),[m]),T=i.refetch,b=p.refetch,y=f.useCallback(()=>{T(),b()},[T,b]),R=f.useMemo(()=>new Set(i.instances.filter(u=>u.transparency==="Transparent").map(u=>F(u.calendarObjectId,u.recurrenceId))),[i.instances]);return{calendars:r,events:k,colorByCalendarId:a,timeZoneByCalendarId:o,isLoading:N||i.isLoading,error:i.error??p.error,retry:y,storedTasks:m,tasks:D,instanceOf:M,freeIds:R}}export{Q as R,_ as a,V as b,se as c,X as r,ee as s,$ as t,Y as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as y,a as f,c as g,fE as m,g as b,fF as S,r as d,d2 as M,d0 as p,aY as I,bH as h}from"./index-CL_fwLHN.js";import{u as x}from"./useQueries-hChzM5ru.js";import{u as O}from"./useDebouncedValue-BTZsNKEh.js";function Q(){const s=y(),{data:a}=f({...g(),staleTime:6e4}),{data:o}=f(m()),r=b(S()),i=d.useMemo(()=>(a?.accounts??[]).filter(n=>n.syncedServices.includes("Mail")).map(n=>({accountId:n.accountId,email:n.email})),[a?.accounts]),l=o?.defaultInvitationSenderAccountId,c=d.useCallback(async n=>{await r.mutateAsync({body:{defaultInvitationSenderAccountId:n}}),await s.invalidateQueries({queryKey:m().queryKey})},[r,s]);return{senders:i,defaultSenderId:l,setDefaultSender:c}}const E=2;function w(s){const a=O(s.trim(),200),{data:o}=f({...h({query:{q:a,limit:8}}),enabled:a.length>=E});return d.useMemo(()=>(o?.items??[]).map(r=>({email:r.normalizedEmail,name:r.displayName??""})),[o?.items])}const q=["sent","unfiled","failed","blocked"],v=["failed","blocked"];function A(s){const a=y(),o=b(M()),r=x({queries:s.map(e=>({...p({path:{outboxMessageId:e.outboxMessageId}}),meta:{softErrorStatuses:[404]},retry:!1,refetchInterval:u=>{if(u.state.error)return!1;const t=u.state.data?.status;return t&&q.includes(t)?!1:1500}}))}),i=s.flatMap((e,u)=>{const t=r[u];return!t?.error||I(t.error)===404?[]:[{send:e,error:t.error,refetch:t.refetch}]}),l=()=>{for(const e of i)e.refetch()},c=s.filter((e,u)=>{const t=r[u]?.data?.status;return t!==void 0&&v.includes(t)}),n=d.useCallback(async()=>{for(const e of c)await o.mutateAsync({path:{outboxMessageId:e.outboxMessageId}}),await a.invalidateQueries({queryKey:p({path:{outboxMessageId:e.outboxMessageId}}).queryKey})},[c,o,a]);return{missed:c.map(e=>e.email),retry:n,checkError:i[0]?.error??null,unchecked:i.map(e=>e.send.email),recheck:l}}export{A as a,w as b,Q as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as X,aC as Q,aD as B,fb as _,a as C,fc as ee,r as d,f as b,s as y,g as m,fd as te,fe as ne,ff as ae,aY as A,b9 as se,b7 as re,b8 as oe,fg as ie,cc as w,fh as S,f9 as ce,cs as de,fi as le,fj as ue,fk as fe,fl as pe,fm as ge,fn as me,fo as Ce,fp as ye}from"./index-CL_fwLHN.js";import{f as I}from"./ErrorState-KjDYblD5.js";import{u as G}from"./useQueries-hChzM5ru.js";const Fe=X("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);function je(e){return Q(B({title:`Calendar invitation: ${e}`,errorMessage:e}))}function We(e){return Q(B({title:`Calendar event: ${e}`,errorMessage:e}))}const K=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,q="";function Ue(e){if(e!==q)return e;const t=K();return Intl.supportedValuesOf("timeZone").includes(t)?t:q}const Ee={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},Z={Unscheduled:"accepted",Organizer:"accepted",Accepted:"accepted",Tentative:"tentative",Declined:"declined",NeedsAction:"noReply"},$e=e=>Z[e],Oe={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},z="#";function he(e,t){return t===""?e:`${e}${z}${t}`}function R(e){const t=e.indexOf(z);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const H=(e,t)=>{const n=[...e].sort((a,r)=>Date.parse(a.start)-Date.parse(r.start));return n.find(a=>Date.parse(a.end)>Date.parse(t))??n[0]};function xe(e,t,n){const a=H(e.filter(r=>{const o=R(r.id);return o.calendarObjectId===t&&o.recurrenceId!==""}),n);return a?R(a.id):void 0}function F(e,t,n,a){const r=H(e.filter(o=>o.calendarObjectId===t&&ve(o)).map(o=>Se(o,"",a)),n);if(r)return{...R(r.id),calendarId:r.calendarId,date:r.start.slice(0,10)}}function j(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:Ee[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function Se(e,t,n){return{id:he(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):_(e.start,n),end:e.allDay?e.end.slice(0,10):_(e.end,n),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:Z[e.participation],threadId:"",threadSubject:"",timeZone:t,zoneCertainty:Oe[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const ve=e=>e.status!=="Cancelled";function Qe(){const{data:e,isLoading:t,error:n,refetch:a}=C(ee());return d.useMemo(()=>{const r=e?.items??[],o=r.filter(i=>i.componentSet!=="VtodoOnly"),l=o.map(j),s=r.filter(i=>i.componentSet==="VtodoOnly").map(j);return{calendars:l,taskLists:s,collections:r,colorByCalendarId:Object.fromEntries(l.map(i=>[i.id,i.color])),timeZoneByCalendarId:Object.fromEntries(r.map(i=>[i.calendarId,i.timezone])),defaultCalendarId:(o.find(i=>i.source==="Default")??o[0])?.calendarId??"",isLoading:t,error:n??null,retry:()=>{a()}}},[e,t,n,a])}const D=y(400,404,412),be=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","calendarTaskOperationsListCalendarTasks","calendarTaskDetailOperationsGetCalendarTask"]),W=e=>A(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},Ae={this:"This",following:"Following",all:"All"};function V(){const e=b();return d.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&be.has(a)}})},[e])}const U=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:Ae[e],recurrenceId:t};function Be(){const e=V(),t=m({...te(),meta:D,onSuccess:e}),n=m({...ne(),meta:D,onSuccess:e}),a=m({...ae(),meta:D,onSuccess:e}),r=d.useCallback(s=>t.mutateAsync({body:s}).then(i=>({kind:"created",calendarObjectId:i.calendarObjectId,sends:i.sends})).catch(i=>A(i)===412?{kind:"conflict"}:{kind:"refused",message:I(i)}),[t]),o=d.useCallback((s,i)=>n.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...U(s)},headers:{"If-Match":s.etag},body:i}).then(f=>({kind:"written",sends:f.sends})).catch(W),[n]),l=d.useCallback(s=>a.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...U(s)},headers:{"If-Match":s.etag}}).then(i=>({kind:"written",sends:i.sends})).catch(W),[a]);return d.useMemo(()=>({createEvent:r,updateEvent:o,deleteEvent:l,isWriting:t.isPending||n.isPending||a.isPending}),[r,o,l,t.isPending,n.isPending,a.isPending])}const M=y(400,404),L={kind:"written"},P=e=>({kind:"refused",message:I(e)});function we(){const e=b(),t=V(),n=d.useCallback(()=>e.invalidateQueries({queryKey:se()}),[e]),a=d.useCallback(()=>(t(),n()),[t,n]),r=m({...re(),meta:M,onSuccess:n}),o=m({...oe(),meta:M,onSuccess:a}),l=m({...ie(),meta:M,onSuccess:a}),s=d.useCallback(c=>r.mutateAsync({body:c}).then(()=>L).catch(P),[r]),i=d.useCallback((c,p)=>o.mutateAsync({path:{calendarId:c},body:p}).then(()=>L).catch(P),[o]),f=d.useCallback(c=>l.mutateAsync({path:{calendarId:c}}).then(()=>L).catch(P),[l]);return d.useMemo(()=>({createCalendar:s,updateCalendar:i,deleteCalendar:f,isWriting:r.isPending||o.isPending||l.isPending}),[s,i,f,r.isPending,o.isPending,l.isPending])}const Ie=y(404);function Ge(e,t){const{data:n,isLoading:a,error:r,refetch:o}=C({...w({path:{calendarObjectId:e},query:{calendarId:t}}),meta:Ie,enabled:e!==""&&t!==""});return{resource:n,isLoading:a,error:r,refetch:()=>{o()}}}const Y=y(400,404),k=5*6e4,T=({from:e,to:t,calendarIds:n})=>({query:n.length===0?{from:e,to:t}:{from:e,to:t,calendarId:[...n]}});function Ke(e){const{data:t,isLoading:n,error:a,refetch:r}=C({...S(T(e)),meta:Y,staleTime:k,enabled:e.enabled??!0});return{instances:t?.items??[],isLoading:n,error:a,refetch:()=>{r()}}}function Ze(e,t,n){const a=G({queries:e.map(c=>({...S(T({...c,calendarIds:t})),meta:Y,staleTime:k,enabled:n}))}),r=e.map(c=>c.from).join("|"),o=a.map(c=>c.data),l=a.map(c=>c.isPending).join("|"),s=a.find(c=>c.error)?.error??null,i=d.useMemo(()=>o.flatMap(c=>c?.items??[]),[r,l]),f=d.useMemo(()=>{const c=new Set;return e.forEach((p,u)=>{a[u]?.isPending&&c.add(p.from)}),c},[r,l]);return{instances:i,pendingWindows:f,error:s,refetch:()=>{for(const c of a)c.error&&c.refetch()}}}function ze(e,t,n,a){const r=b(),o=[...n].join(",");d.useEffect(()=>{if(!a)return;const l=o===""?[]:o.split(",");for(const s of[-1,1]){const i=ce(e,de(t,e,s));r.prefetchQuery({...S(T({...i,calendarIds:l})),staleTime:k})}},[r,e,t,o,a])}const ke=y(400,404);function He(e){const t=G({queries:e.map(s=>({...le({query:{from:s.from,to:s.to}}),meta:ke,staleTime:k}))}),n=e.map(s=>s.from).join("|"),a=t.map(s=>s.data),r=t.map(s=>s.isPending).join("|"),o=d.useMemo(()=>a.flatMap(s=>s?.items??[]),[n,r]),l=d.useMemo(()=>{const s=new Set;return e.forEach((i,f)=>{t[f]?.isPending&&s.add(i.from)}),s},[n,r]);return{spans:o,pendingWindows:l,error:t.find(s=>s.error)?.error??null,refetch:()=>{for(const s of t)s.error&&s.refetch()}}}const $=365*24*60*6e4,De=1440*6e4,x=y(),Me=y(404),v=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),Le=e=>{const t=e instanceof Error&&e.message!==""?e.message:"no reason given",n=A(e);return n===void 0?t:`${t} (HTTP ${n})`};function Ve(e,t){const[n]=d.useState(()=>Date.now()),a=K(),r=new Date(n).toISOString(),o=C({...S({query:{from:v(n),to:v(n+$),calendarObjectId:e}}),meta:x,retry:!1,enabled:t}),l=o.data?F(o.data.items,e,r,a):void 0,s=C({...w({path:{calendarObjectId:e}}),meta:Me,retry:!1,enabled:t&&o.data!==void 0&&l===void 0}),i=Date.parse(s.data?.dtStart??""),f=s.data!==void 0&&Number.isNaN(i),c=Number.isNaN(i)?0:i-De,p=C({...S({query:{from:v(c),to:v(c+$),calendarObjectId:e}}),meta:x,retry:!1,enabled:t&&s.data!==void 0&&!f}),u=p.data?F(p.data.items,e,r,a):void 0;if(!t)return{kind:"Idle"};if(l)return{kind:"Found",jump:l};if(u)return{kind:"Found",jump:u};const g=A(s.error)===404,N=[o.error,g?null:s.error,p.error].find(J=>J!==null);return N!==void 0?{kind:"Failed",reason:Le(N)}:g?{kind:"Deleted"}:f?{kind:"Failed",reason:`the stored event names no readable start (${s.data?.dtStart??""})`}:p.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const E=y(400,404),Pe=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),Re=e=>e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Pe.has(a)}});function Ye(e){const{data:t,isLoading:n,error:a}=C({...ue({path:{messageId:e}}),meta:E});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function Je(){const{data:e,isLoading:t,error:n}=C({...Ce({query:{state:"Pending"}}),meta:E});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const Te=async(e,t)=>{let n;do{const{data:a}=await ye({query:{state:"Pending",continuationToken:n},signal:t,throwOnError:!0}),r=a.items.find(o=>o.suggestionId===e);if(r)return r;n=a.continuationToken}while(n);return null};function Xe(e){const{data:t,isLoading:n,error:a}=C({queryKey:[{_id:"calendarSuggestionOperationsListCalendarSuggestions",suggestionId:e}],queryFn:({signal:r})=>Te(e,r),meta:E});return{suggestion:t,isLoading:n,error:a??null}}const O={kind:"answered"},h=e=>({kind:"refused",message:I(e)});function et(){const e=b(),t=d.useCallback(()=>Re(e),[e]),n=m({...fe(),meta:E,onSuccess:t}),a=m({...pe(),meta:E,onSuccess:t}),r=m({...ge(),meta:E,onSuccess:t}),o=m({...me(),meta:E,onSuccess:t}),l=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:g}}).then(()=>O).catch(h),[n]),s=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:g,answer:"Tentative"}}).then(()=>O).catch(h),[n]),i=d.useCallback((u,g)=>n.mutateAsync({path:{suggestionId:u},body:g}).then(()=>O).catch(h),[n]),f=d.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>O).catch(h),[a]),c=d.useCallback((u,g)=>r.mutateAsync({path:{suggestionId:u},body:{muteSender:g}}).then(()=>O).catch(h),[r]),p=d.useCallback(u=>o.mutateAsync({path:{suggestionId:u}}).then(()=>O).catch(h),[o]);return d.useMemo(()=>({accept:l,tentative:s,acceptEdited:i,decline:f,dismiss:c,reopen:p,isAnswering:n.isPending||a.isPending||r.isPending||o.isPending}),[l,s,i,f,c,p,n.isPending,a.isPending,r.isPending,o.isPending])}export{D as C,Fe as M,q as U,V as a,Qe as b,We as c,Be as d,K as e,Ze as f,He as g,he as h,Je as i,et as j,je as k,Ye as l,Ke as m,ve as n,Ue as o,ze as p,Ge as q,R as r,xe as s,Se as t,we as u,Ve as v,$e as w,Xe as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as u,j as O,o as v,g as y,fG as P,fH as q,fI as W,a as E,fJ as R,aY as I,fK as j,s as D}from"./index-CL_fwLHN.js";import{f as z}from"./ErrorState-KjDYblD5.js";import{a as G,C as k}from"./useCalendarSuggestions-D3Jza1d7.js";const i=8,x=(e,t,a)=>Math.min(Math.max(e,t),Math.max(t,a)),H=(e,t)=>e.width>0&&e.height>0&&e.left<t.width&&e.left+e.width>0&&e.top<t.height&&e.top+e.height>0;function C(e,t){return{left:Math.max(i,(t.width-e.width)/2),top:Math.max(i,(t.height-e.height)/2),side:"center"}}function Y(e,t,a){if(!e||!H(e,a))return C(t,a);const r=x(e.top,i,a.height-t.height-i),c=e.left+e.width+i;if(c+t.width<=a.width-i)return{left:c,top:r,side:"right"};const f=e.left-i-t.width;if(f>=i)return{left:f,top:r,side:"left"};const l=x(e.left,i,a.width-t.width-i),s=e.top+e.height+i;if(s+t.height<=a.height-i)return{left:l,top:s,side:"below"};const h=e.top-i-t.height;return h>=i?{left:l,top:h,side:"above"}:C(t,a)}const B='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function _({anchor:e,anchorKey:t,labelledBy:a,children:r,header:c,wrapTab:f=!1,panelRef:l,className:s}){const h=u.useRef(null),[w,M]=u.useState(null),[b,A]=u.useState({key:t,x:0,y:0}),g=b.key===t?b:{x:0,y:0};u.useLayoutEffect(()=>{const n=h.current;if(!n||t==="")return;const d=()=>{const o=(typeof e=="string"?document.querySelector(e):e)?.getBoundingClientRect();M(Y(o?{left:o.left,top:o.top,width:o.width,height:o.height}:null,{width:n.offsetWidth,height:n.offsetHeight},{width:window.innerWidth,height:window.innerHeight}))};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[e,t]);const L=n=>{if(n.button!==0||n.target instanceof Element&&n.target.closest("button, input, select, a"))return;n.preventDefault();const d={x:n.clientX-g.x,y:n.clientY-g.y},m=p=>A({key:t,x:p.clientX-d.x,y:p.clientY-d.y}),o=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",o)},S=n=>{if(!f||n.key!=="Tab")return;const d=Array.from(n.currentTarget.querySelectorAll(B));if(d.length===0)return;const m=d[0],o=d[d.length-1];n.shiftKey&&document.activeElement===m?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),m.focus())};return O.jsxs("div",{ref:n=>{h.current=n,typeof l=="function"?l(n):l&&(l.current=n)},role:"dialog","aria-modal":"false","aria-labelledby":a,"data-calendar-popover":"",onKeyDown:S,className:v("fixed z-40 w-[26rem] max-w-[calc(100vw-1rem)] rounded-xl border border-line bg-surface-raised text-fg shadow-xl shadow-black/20",w===null&&"opacity-0",s),style:{left:(w?.left??0)+g.x,top:(w?.top??0)+g.y},children:[c?.({onPointerDown:L}),r]})}const F=e=>({calendarTaskId:e.calendarTaskId,calendarId:e.calendarId,title:e.summary,due:e.allDay?e.due.slice(0,10):e.dueAt,allDay:e.allDay,completed:e.completed});function J(e,t=!0){const{data:a,error:r,refetch:c}=E({...R({query:{from:e.from,to:e.to}}),meta:D(400,404),enabled:t});return{tasks:u.useMemo(()=>a?.items??[],[a?.items]),error:r,refetch:c}}function Q(e){const{data:t,error:a,refetch:r}=E({...j({path:{calendarTaskId:e}}),meta:D(404),retry:!1});return t?{kind:"found",task:t}:a===null?{kind:"loading"}:I(a)===404?{kind:"gone"}:{kind:"failed",error:a,retry:()=>{r()}}}const T=e=>({kind:"refused",message:I(e)===412?"This task changed while you were looking at it. Close it and open it again.":z(e)});function V(){const e=G(),t=y({...P(),meta:k,onSuccess:e}),a=y({...q(),meta:k,onSuccess:e}),r=y({...W(),meta:k,onSuccess:e}),c=u.useCallback(s=>t.mutateAsync({body:s}).then(()=>({kind:"written"})).catch(T),[t]),f=u.useCallback((s,h)=>a.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag},body:h}).then(()=>({kind:"written"})).catch(T),[a]),l=u.useCallback(s=>r.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag}}).then(()=>({kind:"written"})).catch(T),[r]);return{createTask:c,updateTask:f,deleteTask:l,isWriting:t.isPending||a.isPending||r.isPending}}export{_ as C,J as a,Q as b,F as t,V as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./index-
|
|
1
|
+
import{r as o}from"./index-CL_fwLHN.js";const n=(e,t)=>{const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,g as h,
|
|
1
|
+
import{r as d,g as h,fq as x,a as A,fr as P,fs as N,ft as L,f as S,fu as T,fv as I,fw as w,fx as z,bb as R}from"./index-CL_fwLHN.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},O={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."},X=e=>e.disabledReason==="None"?void 0:(e.disabledReason==="AwaitingFolder"||e.disabledReason==="FolderCreateFailed")&&e.actionMailboxId!=="None"?O.UserDisabled:O[e.disabledReason],Z=e=>{if(!e)return;const t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},M=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,i,a]=r,n=new Date(Number(s),Number(i)-1,Number(a),23,59,59,0);if(Number.isNaN(n.getTime()))return;const o=-t.getTimezoneOffset(),l=o>=0?"+":"-",c=Math.abs(o),f=String(Math.floor(c/60)).padStart(2,"0"),p=String(c%60).padStart(2,"0"),u=m=>String(m).padStart(2,"0");return`${n.getFullYear()}-${u(n.getMonth()+1)}-${u(n.getDate())}T${u(n.getHours())}:${u(n.getMinutes())}:${u(n.getSeconds())}${l}${f}:${p}`},g="None",k=e=>({filterId:e,matchOperator:"And",literalClauses:[],actionLabelId:g,actionMailboxId:g}),D=e=>({matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??g,actionMailboxId:e.moveMailboxId??g}),ee=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",te=({ruleScope:e,clauses:t,matchOperator:r,moveMailboxId:s,until:i})=>({matchOperator:r==="all"?"And":"Or",literalClauses:t.map(a=>({field:a.field,value:a.value})),moveMailboxId:s,expiresAt:e==="until"?M(i??""):void 0}),y=(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??g,actionMailboxId:e.moveMailboxId??g}),_=new Set(["Complete","Failed"]),F=e=>e!==void 0&&_.has(e),J=1e3,$=15e3,U=e=>{const t=Math.max(0,e),r=J*2**t;return Math.min(r,$)},q=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},re=e=>{const[t,r]=d.useState(),s=h({...x(),onSuccess:b=>r(b.organizeJobId)}),{mutate:i}=s,a=A({...P({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:b=>{const E=b.state.data?.state;return F(E)?!1:U(b.state.dataUpdateCount)}}),n=d.useCallback(b=>{e&&i({path:{accountId:e},body:D(b)})},[e,i]),o=d.useCallback(b=>{e&&i({path:{accountId:e},body:k(b)})},[e,i]),{refetch:l}=a,c=d.useCallback(()=>{l()},[l]),f=a.data,p=s.isPending?void 0:f,u=p?.state??s.data?.state,m=F(p?.state),v={state:u,matchedCount:p?.matchedCount??0,appliedCount:p?.appliedCount??0,failedCount:p?.failedCount??0,errorMessage:p?.errorMessage??""};return{start:n,startForFilter:o,watch:r,refreshStatus:c,progress:v,isStarting:s.isPending,isRunning:!!t&&!m,isDone:m,failure:q(s.error,a.error,!!f)}},se=["From","Subject","HasWords","ListId","FromDomain"],Q=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},ae=(e,t)=>e==="ListId"?Q(t):t.trim(),j=e=>e==="all"?"And":"Or",K=e=>({matchOperator:j(e.matchOperator),literalClauses:e.clauses.map(t=>({field:t.field,value:t.value}))}),B=e=>!e.literalClauses.some(t=>t.field==="HasWords"),H=e=>JSON.stringify({operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),ie=e=>{const t=K(e);return{matchOperator:t.matchOperator,literalClauses:t.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?M(e.until??""):void 0}},W=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},V=350,ne=(e,t,r)=>{const s=h(N()),{mutateAsync:i}=s,a=H(t),[n,o]=d.useState(()=>({})),l=d.useRef(t);l.current=t;const c=d.useRef(a),f=B(t);return d.useEffect(()=>{if(!e||!f||a===n.previewedSignature||a===n.errorSignature)return;const p=setTimeout(()=>{const u=a;c.current=u,i({path:{accountId:e},body:D({...l.current})}).then(m=>{c.current===u&&o({count:m.matchedCount,matchedIds:m.messageIds,previewedSignature:u})}).catch(m=>{c.current===u&&o(v=>({...v,error:m instanceof Error?m.message:"Couldn't count matches.",errorSignature:u}))})},V);return()=>clearTimeout(p)},[e,f,a,n.previewedSignature,n.errorSignature,i]),f?{count:W(n,a),matchedIds:n.previewedSignature===a?n.matchedIds??[]:[]}:{count:{status:"error",reason:L},matchedIds:[]}},C=e=>I({path:{accountId:e}}),oe=e=>{const t=A({...w({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},le=e=>{const t=S(),r=h({...T(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:C(e)})}}),{mutate:s,mutateAsync:i}=r,a=d.useCallback((o,l,c)=>{e&&s({path:{accountId:e},body:y(o,l,c)})},[e,s]),n=d.useCallback(async(o,l,c)=>{if(e)return i({path:{accountId:e},body:y(o,l,c)}).then(f=>f,()=>{})},[e,i]);return{createFilter:a,createFilterAsync:n,data:r.data,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},ue=e=>{const t=S(),r=h({...z(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:C(e)})}}),{mutate:s}=r;return{deleteFilter:d.useCallback(a=>{e&&s({path:{accountId:e,filterId:a}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},de=e=>{const t=S(),r=h({...R(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:C(e)})}}),{mutate:s,variables:i}=r,a=d.useCallback((o,l)=>{e&&s({path:{accountId:e,filterId:o},body:{state:l?"Active":"Disabled"}})},[e,s]),n=d.useCallback(()=>{i&&s(i)},[s,i]);return{toggleFilter:a,retry:n,togglingFilterId:r.isPending?i?.path.filterId:void 0,isError:r.isError,error:r.error,enabling:i?.body?.state==="Active"}};export{g as N,se as S,re as a,C as b,ie as c,X as d,Z as e,G as f,oe as g,ue as h,de as i,le as j,te as k,ae as n,ee as o,M as p,K as r,ne as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as L,f0 as p,f as n,g as l,f1 as d,r as o,f2 as y,f3 as f,f4 as c}from"./index-CL_fwLHN.js";const u=e=>y({path:{accountId:e}}),P=e=>{const r=L({...p({path:{accountId:e??""}}),enabled:!!e});return{labels:r.data?.items??[],isPending:r.isPending,isError:r.isError,error:r.error,refetch:r.refetch}},m=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}},h=e=>{const r=n(),t=l({...f(),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({...c(),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{P as a,h as b,C as c,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./index-CL_fwLHN.js";import{a as s,D as e}from"./useMediaQuery-DiQ0fGER.js";const i=768,a=t=>t!=="desktop",p=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{a as i,p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CL_fwLHN.js";const r=1024,c=`(min-width: ${r}px) and (not ((orientation: portrait) and (pointer: coarse)))`,d=e=>{const[o,n]=s.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return s.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const t=window.matchMedia(e);n(t.matches);const a=i=>n(i.matches);return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e]),o},m=()=>d(c);export{c as D,d as a,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,u as P,cB as O,J as p,n as U,N as B,f as N,a as $,d5 as D,cW as L}from"./index-CL_fwLHN.js";import{g as F,j as _,k as v}from"./reply-DvdgFS16.js";const E="/mail/brief/compose/{-$outboxMessageId}",w="/mail/flagged/compose/{-$outboxMessageId}",S="/mail/outbox/compose/{-$outboxMessageId}",R="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=p({from:E,shouldThrow:!1}),t=p({from:w,shouldThrow:!1}),s=p({from:S,shouldThrow:!1}),r=p({from:R,shouldThrow:!1});return e??t??s??r}function te(){return T()!==void 0}function se(){return T()?.outboxMessageId}function K(e,t,s){return e==="flagged"?{to:w,params:{outboxMessageId:s}}:e==="outbox"?{to:S,params:{outboxMessageId:s}}:e==="mailbox"&&t?{to:R,params:{mailboxId:t,outboxMessageId:s}}:{to:E,params:{outboxMessageId:s}}}function b(){const e=P(),t=F(),{list:s,mailboxId:r}=_();return a.useCallback((o,n)=>{e({...K(s,r,o),search:O,hash:n?.keepPanels?!0:t,replace:n?.replace??!1})},[e,t,s,r])}function re(){const e=b();return a.useCallback(()=>e(void 0),[e])}function oe(){const e=b();return a.useCallback(t=>e(t),[e])}function ne(){const e=b();return a.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function ae(){return v()}const Q=new Set(["rfc822","global"]),q=e=>e.mediaType.toUpperCase()==="MESSAGE"&&Q.has(e.mediaSubtype.toLowerCase()),k=(e,t)=>e.partPath.startsWith(`${t}.`),I=e=>{const t=e.filter(q);return e.filter(s=>!t.some(r=>k(s,r.partPath)))},ce=(e,t)=>e.filter(s=>k(s,t)),W=e=>{const t=I(e).filter(o=>!o.isMultipart&&o.disposition!=="attachment"&&o.mediaType==="TEXT"&&o.contentUrl.length>0),s=t.find(o=>o.mediaSubtype.toUpperCase()==="HTML");if(s)return{kind:"html",contentUrl:s.contentUrl};const r=t.find(o=>o.mediaSubtype.toUpperCase()==="PLAIN");return r?{kind:"text",contentUrl:r.contentUrl}:null},g={all:["messages"],detail:e=>[...g.all,"detail",e],body:e=>[...g.detail(e),"body"]};class f extends Error{reason;status;retryAfterSeconds;constructor(t,s,r,o){super(s),this.name="BodyFetchError",this.reason=t,this.status=r,this.retryAfterSeconds=o}}const G=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},X=8,H="x-remit-403-reason",Y=(e,t)=>{const s=t?.trim()??"";return e===401?"auth":e===403?s.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},j=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,z=(e,t)=>{const s=(t??"").toLowerCase();return!!(e==="text"&&s.startsWith("text/html"))},J=async(e,t,s=async()=>null)=>{const r={},o=await s();o&&(r.Authorization=`Bearer ${o}`);const n=await L(e,{headers:r});if(n.status===202)throw new f("not-ready","Message body is still syncing",202,G(n.headers.get("Retry-After")));if(!n.ok){const l=n.headers.get(H),h=Y(n.status,l);throw new f(h,`Failed to load message body (${n.status} ${n.statusText})`,n.status)}const c=n.headers.get("content-type");if(z(t,c))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${c}`);const m=await n.text();if(j(m,c))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},V=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),ie=({messageId:e,bodyParts:t,enabled:s=!0})=>{const r=t?W(t):null,o=U(),{getToken:n}=B(),c=a.useRef(null),m=N(),l=a.useRef(!1),h=a.useRef(null),C=e&&r?`${e}:${r.contentUrl}`:null;h.current!==C&&(h.current=C,l.current=!1);const i=$({queryKey:e?[...g.body(e),r?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!r)throw new Error("No renderable body part");if(!e)throw new Error("No messageId");const d=l.current;return l.current=!1,V({fetchContent:(u,x)=>J(u,x,n),refetchDescribeMessage:()=>m.refetchQueries({queryKey:D({path:{messageId:e}})})},{contentUrl:r.contentUrl,kind:r.kind,isRetryAfterNotReady:d})},enabled:s&&!!e&&!!r,staleTime:300*1e3,gcTime:1800*1e3,retry:(d,u)=>u instanceof f&&u.reason==="not-ready"?d<X:d<1,retryDelay:(d,u)=>u instanceof f&&u.reason==="not-ready"?(l.current=!0,(u.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),y=i.isLoading&&!!r,A=t!==void 0&&r===null;a.useEffect(()=>{y&&(c.current=performance.now())},[y]),a.useEffect(()=>{i.isSuccess&&c.current!==null&&(o.recordTiming("message.body.load",Math.round(performance.now()-c.current)),c.current=null)},[i.isSuccess,o]);const M=i.data&&r?{kind:r.kind,body:i.data}:void 0;return{picked:r,data:M,isLoading:y,hasNoRenderablePart:A,isError:i.isError,error:i.error,refetch:i.refetch}};export{f as B,te as a,ie as b,Y as c,se as d,ne as e,ae as f,oe as g,ce as h,q as i,I as o,re as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d6 as Q,d7 as y,d8 as S,d9 as w,da as C,f as k,db as q,dc as x,r as p,dd as M,de as H,df as L,dg as P,dh as O,di as B,dj as A}from"./index-CL_fwLHN.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 j=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#a=[];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.#f(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.#d(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,c=i.some((o,f)=>o!==s[f]),d=u||c,b=d?!0:n.some((o,f)=>{const g=this.#e[f];return!g||!S(o,g)});!d&&!b||(d&&(this.#a=t,this.#s=i),this.#e=n,this.hasListeners()&&(d&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#d(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.#c(t,s)]}#c(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)}#d(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}#f(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.#c(this.#e,this.#a),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 I({queries:r,...e},s){const t=k(),i=q(),n=x(),u=p.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{M(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),L(n);const[c]=p.useState(()=>new j(t,u,e)),[d,b,o]=c.getOptimisticResult(u,e.combine),f=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>f?c.subscribe(y.batchCalls(h)):P,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,e)},[u,e,c]);const m=d.some((h,a)=>O(u[a],h))?d.flatMap((h,a)=>{const l=u[a];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=d.find((h,a)=>{const l=u[a];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{I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as E,w as K,o as Q,d as U,f as N,P as $,r as o,aO as R,U as z,V as B,n as G,a3 as I,a4 as V,a7 as X}from"./index-CL_fwLHN.js";import{C as J}from"./circle-check-big-BsCwNdJZ.js";import{R as Y}from"./refresh-cw-5OKnYRBy.js";import{u as P}from"./useQueries-hChzM5ru.js";function ye({state:e,onRefresh:s,label:t,errorMessage:r,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",n=e==="error",h=e==="success",y=n?E.jsx(K,{className:"size-4 text-danger"}):h?E.jsx(J,{className:"size-4 text-positive"}):E.jsx(Y,{className:Q("size-4",i&&"animate-spin")}),w=n?`${t} — failed: ${r??"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:y,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:n?r: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 Z=180*1e3,Se=30*1e3;let L=0;const M=new Set,ee=(e=Date.now())=>{L=e+Z;for(const s of M)s()},we=(e=Date.now())=>e<L,xe=e=>(M.add(e),()=>{M.delete(e)}),O=6e4,te=new Set(["sent","drafts","trash","archive"]),_=(e,s)=>{const t=new Map;for(const r of e){const a=s.get(r.mailboxId)?.role;a&&te.has(a)||t.set(r.mailboxId,r.highWaterMarkUid)}return t},q=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},se=(e,s)=>q(e,s).length>0,F=o.createContext(null),ne=()=>{const e=o.useContext(F);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function pe({accountIds:e,children:s}){const t=N(),{resultFolderIndex:r}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,n]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:O,staleTime:O,meta:{softError:!0}}))}),y=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??[],r),v=c.current.get(d);if(c.current.set(d,g),v){const A=q(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;se(W,g)&&(f.add(d),l=!0)}),l&&n(f)},[w,y]);const S=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{n(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??[],r)),u.current.add(f)}},[t,r]),m=o.useMemo(()=>({hasNewMail:S,acknowledge:x}),[S,x]);return E.jsx(F.Provider,{value:m,children:s})}const re=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function j(e){return!!e&&re.has(e)}const D=3e3,oe=D*2,C={syncing:!1,resolved:!1,synced:0,total:0};function Ee(e,s){const t=e.join(","),[r,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),oe);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!r,refetchInterval:D,meta:{softError:!0}}))}),n=i.every(m=>m.isSuccess||m.isError),h=i.length===0||n||u;let y=!1,w=0,S=0;for(const m of i)if(j(m.data?.syncPhase)){y=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,S+=l.messagesTotal}const x=s&&h&&!y;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?C:{syncing:y,resolved:!0,synced:w,total:S}}const ae=2e3,ie=45e3,ce=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",ue=e=>{X(e,{softError:!0})},T=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,le=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:r=0,onInboxSynced:a,deadline:u,pollMs:c=ae})=>{let i=!1;for(;;){const n=await s().then(S=>({ok:!0,data:S})).catch(S=>({ok:!1,error:S}));if(!n.ok)return{accountId:e,message:k(n.error)};const{syncPhase:h,lastSyncAt:y}=n.data;if((y??0)>t&&!j(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(n.data)>r&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ce(c)}},fe=async(e,s,t,r,a)=>{const u=await T(e,t).then(n=>({ok:!0,lastSyncAt:n.lastSyncAt??0,inboxSyncedAt:H(n)})).catch(n=>({ok:!1,error:n}));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(n=>({ok:!1,error:n}));if(!c.ok)return ue(c.error),{accountId:t,enqueued:!1,ok:!1,message:k(c.error)};s.recordEvent("sync.triggered");const i=await le({accountId:t,readStatus:()=>T(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:r});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},be=(e,s={})=>{const t=N(),r=G(),{acknowledge:a}=ne(),[u,c]=o.useState("idle"),[i,n]=o.useState(),h=o.useRef(0),y=o.useRef(e);y.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 S=o.useCallback(()=>{const x=y.current;if(x.length===0){c("error"),n("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),n(void 0),ee();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:V({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ie,d=await Promise.all(x.map(g=>fe(t,r,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"),n(b[0]?.message))})()},[a,t,r]);return{state:u,errorMessage:i,refresh:S}};export{Se as H,pe as M,ye as R,be as a,j as b,Ee as c,we as i,xe as s,ne as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as s,Y as o,r as n,bQ as r}from"./index-CL_fwLHN.js";import{u as d}from"./useQueries-hChzM5ru.js";const h=s("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]),p=t=>({items:t.map(e=>e.data?.items??[]),isPending:t.some(e=>e.isPending),error:t.find(e=>e.error)?.error??null});function u(t){const e=d({queries:t.map(i=>({...o({path:{accountId:i.accountId}}),staleTime:1/0})),combine:p});return{index:n.useMemo(()=>r(t.map((i,a)=>({folderAppointments:i.folderAppointments,mailboxes:e.items[a]??[]}))),[t,e]),isPending:e.isPending,error:e.error}}export{h as B,u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as g,
|
|
1
|
+
import{f as g,ao as f,a as p,c as m,r,g as y,aq as T,l as E,i as x}from"./index-CL_fwLHN.js";const i={html:"",plainText:""},d=e=>{const u=g(),{pushError:o}=f(),{data:n}=p({...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({...x(),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{d as u};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as s,aH as w,d,aR as _,e as j,bm as N,bk as y,B as C,ah as A,N as E,bD as $,bN as f,bO as k,bP as M,a as P,c as W,r as l,a5 as z,aC as x,aD as p,u as O,aK as L,aM as q}from"./index-CL_fwLHN.js";import{S as B}from"./settings-screen-DBP3ABLE.js";import{f as D}from"./ErrorState-KjDYblD5.js";import{C as U}from"./copy-LUCWJAE6.js";import{E as F}from"./external-link-BDqA_mVy.js";import{B as h,u as G}from"./useResultFolderIndex-6TeGdWgp.js";import{C as S}from"./circle-check-i3jeyeTf.js";import{w as H}from"./help-copy-B2iT8EG_.js";import"./avatar-uWJajuSb.js";import"./menu-CcLh9Whg.js";import"./circle-help-CVWHf1ow.js";import"./useQueries-hChzM5ru.js";import"./kbd-CDJCJUnp.js";function Q({report:e,onClose:t,issueUrl:n,onCopy:a}){return e===null?null:s.jsx(w,{open:!0,onClose:t,title:"Report this message",children:s.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[s.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-fg",children:"Report this message"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"This is everything the report contains. It describes what went wrong with the message — never its contents, addresses, subject, attachment names, folder name, or the parser's own error text."})]}),s.jsx("pre",{className:"flex-1 overflow-auto bg-surface-sunken px-4 py-3 text-2xs leading-relaxed whitespace-pre-wrap text-fg-muted",children:e}),s.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[s.jsx(d,{variant:"ghost",size:"sm",onClick:t,children:"Cancel"}),s.jsx(d,{variant:"secondary",size:"sm",icon:s.jsx(U,{className:"size-3.5"}),onClick:()=>a(e),children:"Copy report"}),s.jsx(_,{external:!0,size:"sm",href:n,icon:s.jsx(F,{className:"size-3.5"}),children:"Open on GitHub"})]})]})})}const V={BodyParse:"The message is built in a way Remit could not read."};function Y(e){return V[e]}function R(e){return e.split(";")[0].trim()}const b=/^[A-Za-z0-9!#$%&'*+._-]+$/,T=/^[A-Za-z0-9!#$%&'*+._-]+\/[A-Za-z0-9!#$%&'*+._-]+$/;function m(e,t){return t.test(e)?`\`${e}\``:`\`${JSON.stringify(e).replace(/`/g,"\\u0060")}\` (malformed)`}function Z(e){const t=R(e);return T.test(t)?t:JSON.stringify(t)}const g="_not read_";function J(e){return e.length===0?["(no MIME structure was read)"]:e.map(t=>`${" ".repeat(t.depth)}- ${Z(t.contentType)}`)}const K="_No message content, addresses, subject, attachment names or parser output are included._";function v(e){return{head:[`### Message quarantined at \`${e.failureStage}\``,"",`- **Failure**: \`${e.failureCode}\``,`- **Folder role**: ${e.mailboxRole??"_none appointed_"}`,`- **Failing part**: ${e.failurePartPath==null?"_whole message_":`\`${e.failurePartPath}\``}`,`- **Attempts before quarantine**: ${e.attempts}`,`- **Worker build**: ${e.workerVersion}`,`- **Message-ID hash**: ${e.messageIdHash==null?"_none declared_":`\`${e.messageIdHash}\``}`,"","#### Message shape","",`- **Content-Type**: ${e.contentType==null?g:m(R(e.contentType),T)}`,`- **Content-Transfer-Encoding**: ${e.transferEncoding==null?g:m(e.transferEncoding,b)}`,`- **Charset**: ${e.charset==null?"_not declared_":m(e.charset,b)}`,`- **Size**: ${e.sizeBytes==null?g:`${e.sizeBytes} bytes`}`,"","MIME structure:"].join(`
|
|
2
|
+
`),structure:J(e.structure).join(`
|
|
3
|
+
`),disclaimer:K}}function X(e){const{head:t,structure:n,disclaimer:a}=v(e);return[t,"","```",n,"```","",a].join(`
|
|
4
|
+
`)}function ee(e){return`Message quarantined: ${e.failureCode} at ${e.failureStage}`}function se(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function te({entry:e,onCutBug:t}){return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:Y(e.failureStage)}),s.jsx("p",{className:"truncate text-xs text-fg-muted",title:e.failureMessage,children:e.failureMessage}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[e.mailboxRole&&s.jsx(j,{tone:"warning",children:N(e.mailboxRole)}),s.jsx("span",{className:"truncate",title:e.mailboxPath,children:y(e.mailboxPath,e.mailboxDelimiter)}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:se(e.quarantinedAt)}),e.attempts>1&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]})]}),s.jsx(d,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ne({entries:e,onCutBug:t}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"Mail Remit could not read is set aside here instead of being skipped, so nothing goes missing quietly. The rest of the folder keeps syncing. Recovering a set-aside message is a re-sync, not a per-row action."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message has been read successfully. Nothing is set aside."})]}),e.length>1&&s.jsx(C,{tone:"warning",children:s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx(A,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),s.jsxs("span",{children:[s.jsx("span",{className:"font-semibold",children:`${e.length} messages could not be read.`})," ","More than one means something is wrong with how Remit reads mail, not with the mail. Reporting one of these gets it fixed."]})]})}),e.length>0&&s.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:e.map(n=>s.jsx(te,{entry:n,onCutBug:t},n.quarantineId))})]})}const ae={Retrying:"The message could not be synced. Remit tries again every sync.",GaveUp:"The message body could not be downloaded. Remit has stopped trying."};function re(e){return ae[e.state]}const ie="_No message content, addresses, subject, folder name or error text are included._";function oe(e){return[`### Message failed to sync at \`${e.stage}\``,"",`- **State**: \`${e.state}\``,`- **Attempts**: ${e.attempts}`,"",ie].join(`
|
|
5
|
+
`)}function le(e){return`Message failed to sync: ${e.state} at ${e.stage}`}function ce(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function de({entry:e,onReport:t}){const n=e.state==="GaveUp";return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:re(e)}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[s.jsx(j,{tone:n?"danger":"warning",children:n?"Gave up":"Retrying"}),s.jsx("span",{className:"truncate",children:e.folderLabel}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`since ${ce(e.createdAt)}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]}),s.jsx(d,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ue({entries:e,total:t,onReport:n}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages that failed to sync"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"A message shows here after three failed rounds and leaves on its own once it syncs. The rest of the folder keeps syncing."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message is syncing. Nothing has failed."})]}),t>e.length&&s.jsx("p",{className:"text-xs text-fg-muted",children:`Showing the ${e.length} newest of ${t} messages that failed to sync.`}),e.length>0&&s.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:e.map(a=>s.jsx(de,{entry:a,onReport:n},a.syncWarningId))})]})}function me(){const{Account:e}=E();return s.jsx(e,{children:({signOut:t})=>s.jsx("button",{type:"button",onClick:()=>t(),className:"rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Sign in again"})})}function ge(e,t){return{quarantineId:e.quarantineId,accountId:e.accountId,mailboxId:e.mailboxId,uidValidity:e.uidValidity,uid:e.uid,mailboxRole:e.mailboxRole?$[e.mailboxRole]:void 0,mailboxPath:e.mailboxPath,mailboxDelimiter:t,failureStage:e.failureStage,failureCode:e.failureCode,failureMessage:e.failureMessage,failurePartPath:e.failurePartPath,quarantinedAt:e.quarantinedAt,attempts:e.attempts,sizeBytes:e.sizeBytes,contentType:e.contentType,transferEncoding:e.transferEncoding,charset:e.charset,structure:e.structure,messageIdHash:e.messageIdHash,workerVersion:e.workerVersion}}const xe=3,pe=(e,t)=>e===k.Body&&t>=xe?f.GaveUp:f.Retrying,he="A folder no longer listed";function fe(e){return e?.role?N(e.role):e?.providerPath?y(e.providerPath,e.hierarchyDelimiter):he}function be(e,t){return{syncWarningId:e.syncWarningId,uid:e.uid,stage:e.stage,state:pe(e.stage,e.attempts),attempts:e.attempts,createdAt:e.createdAt,folderLabel:fe(t)}}const je=[],Ne=[];function ye(e){window.open(e,"_blank","noopener,noreferrer")}function Se(e){return{report:X(e),issueUrl:x(p({quarantine:v(e),title:ee(e)}))}}function Re(e){const t=oe(e);return{report:t,issueUrl:x(p({syncWarning:t,title:le(e)}))}}function Te({signIn:e}){return s.jsx("section",{role:"alert",className:"space-y-3",children:s.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[s.jsx("p",{className:"text-sm font-medium text-danger",children:"Your session has ended."}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Sign in again to see the messages that failed to sync or were set aside."}),e]})})}function ve({error:e}){return s.jsx("section",{role:"alert",className:"space-y-3",children:s.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[s.jsx("p",{className:"text-sm font-medium text-danger",children:"The warnings could not be read."}),s.jsx("p",{className:"break-words text-sm text-fg-muted",children:D(e)}),s.jsx("p",{className:"text-xs text-fg-muted",children:"Mail may still be failing to sync or have been set aside — this page cannot say either way until it can read the list. Reporting this gets it fixed."}),s.jsx(d,{variant:"secondary",size:"sm",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>ye(x(p())),children:"Report this"})]})})}function Ie({read:e,signIn:t}){const[n,a]=l.useState(null),[r,i]=l.useState(!1);if(e.kind==="Pending")return s.jsx("p",{className:"animate-pulse text-sm text-fg-subtle",children:"Checking for warnings…"});if(e.kind==="SignedOut")return s.jsx(Te,{signIn:t});if(e.kind==="Failed")return s.jsx(ve,{error:e.error});const u=o=>{navigator.clipboard.writeText(o).then(()=>{i(!1),a(null)},()=>{i(!0),a(null)})};return s.jsxs("div",{className:"space-y-6",children:[r&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:"The report was not copied — this browser refused clipboard access. Cut the bug again and use Open on GitHub, which needs no clipboard."}),s.jsx(ue,{entries:e.warnings,total:e.warningsTotal,onReport:o=>a(Re(o))}),s.jsx(ne,{entries:e.quarantine,onCutBug:o=>a(Se(o))}),s.jsx(Q,{report:n?.report??null,issueUrl:n?.issueUrl??"",onClose:()=>a(null),onCopy:u})]})}function we(e,t){return e.get(t)?.hierarchyDelimiter??""}function _e(){const e=M(),t=P(W()),n=l.useMemo(()=>t.data?.accounts??[],[t.data]),a=G(n),r=e.data?.entries??je,i=e.data?.warnings??Ne,u=l.useMemo(()=>r.map(c=>ge(c,we(a.index,c.mailboxId))),[r,a.index]),o=l.useMemo(()=>i.map(c=>be(c,a.index.get(c.mailboxId))),[i,a.index]),I=Ce(e.error??t.error??a.error,e.isPending||t.isPending||a.isPending,{kind:"Ready",quarantine:u,warnings:o,warningsTotal:e.data?.warningsTotal??0});return s.jsx(Ie,{read:I,signIn:s.jsx(me,{})})}function Ce(e,t,n){return z(e)?{kind:"SignedOut"}:e?{kind:"Failed",error:e}:t?{kind:"Pending"}:n}function Ue(){const e=O(),[t,n]=l.useState(!0),a=r=>{const i=q[r];i&&e({to:i})};return s.jsx(B,{items:L,activeId:"warnings",title:"Warnings",description:"Messages that failed to sync, and messages set aside.",help:H,helpOpen:t,onToggleHelp:()=>n(r=>!r),onSelect:a,onBackToMail:()=>{e({to:"/mail"})},children:s.jsx(_e,{})})}export{Ue as component};
|
package/index.html
CHANGED
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
} catch (_) {}
|
|
36
36
|
})();
|
|
37
37
|
</script>
|
|
38
|
-
<script type="module" crossorigin src="/assets/index-
|
|
39
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
38
|
+
<script type="module" crossorigin src="/assets/index-CL_fwLHN.js"></script>
|
|
39
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cr6oUxXl.css">
|
|
40
40
|
</head>
|
|
41
41
|
<body>
|
|
42
42
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,L as Mt,eN as Ue,eO as ne,e4 as re,r as a,a as Ge,w as ie,cV as jt,E as kt,dD as Et,eP as Ot,eQ as Ft,T as $e,ej as At,eR as Nt}from"./index-CXzCthHG.js";import{f as Ve,d as Bt,e as Ye,u as Lt,p as qt,R as Dt}from"./MessageBody-AvWIklnv.js";import{a6 as Pt,z as _t,B as Qt,am as zt,an as Wt,ao as Ht,ap as De,aq as Kt,ar as Ut,as as Gt,at as $t,au as Vt,ah as Yt,M as Jt,av as Zt,ai as Xt,aw as es,ax as ts,f as ss,q as os,ak as ns,o as rs,S as as,H as is,L as Pe,K as cs,I as ls,e as ds,W as us,X as xe,Y as fs,_ as Je,$ as Ze,a0 as ms,a1 as hs,a2 as gs}from"./MessageToolbar-CvC2dLSg.js";import{g as ps,n as xs,r as Is}from"./reply-B9-kr45N.js";import{a as ys}from"./useMessageBodyContent-Gq_pdN4f.js";import{m as vs,e as bs,f as Ss}from"./search-token-index-JnwciDu0.js";import{u as Xe}from"./sections-By63r1y_.js";import{S as Ts,u as Cs}from"./useLayoutTier-CUyuK30O.js";import{u as ws,a as Rs,R as Ms,b as js,c as ks}from"./useRefreshControl-DdZILsE1.js";import{u as ae}from"./useQueries-gpmd3w5y.js";import{t as et,s as Es,r as Os,L as Fs}from"./LabelApplyTrigger-BnPNejnI.js";import{a as As}from"./useLabels-CN56tbCw.js";import{u as Ns}from"./useMediaQuery-DB2OdJvp.js";import{d as Bs,w as Ls}from"./wizard-selection-zWa1qc6-.js";import{R as qs}from"./refresh-cw-aweb7slK.js";function Ds({sync:e}){return e?r.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",role:"status","aria-live":"polite",children:[r.jsx(Mt,{className:"size-8 animate-spin text-fg-subtle","aria-hidden":"true"}),r.jsx("p",{className:"text-sm font-medium text-fg",children:"Still syncing your mail"}),r.jsx("p",{className:"text-xs text-fg-subtle",children:Ps(e)})]}):r.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",children:[r.jsx(Ts,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),r.jsx("p",{className:"text-sm font-medium text-fg",children:"You're caught up"}),r.jsx("p",{className:"text-xs text-fg-subtle",children:"Nothing needs attention."})]})}function Ps({synced:e,total:t}){return t>0?`${e.toLocaleString()} of ${t.toLocaleString()} messages downloaded. This list fills in as they arrive.`:"Downloading your messages. This list fills in as they arrive."}const tt=[{id:"unread",name:"is",value:"unread"},{id:"attachment",name:"has",value:"attachment"}],st="category",_s={unclassified:"uncategorized"},H=e=>Bt(e).map(t=>t.raw),W=e=>e.join(" "),Ie=e=>{const t=Ye(e);if(t)return tt.find(s=>s.name===t.name&&s.value===t.value.toLowerCase())?.id},ye=e=>{const t=Ye(e);if(!t||t.name!==st)return;const s=t.value.toLowerCase(),n=_s[s];if(n)return n;if(!(!Ue(s)||s==="all"))return s},ot=e=>tt.find(t=>t.id===e),nt=e=>ot(e)!==void 0,Qs=e=>{const t=new Set;for(const s of H(e)){const n=Ie(s);n&&t.add(n)}return t},zs=e=>{let t="all";for(const s of H(e)){const n=ye(s);n&&(t=n)}return t},Ws=(e,t)=>{const s=ot(t);if(!s)return;const n=H(e),i=n.filter(d=>Ie(d)!==t);return i.length<n.length?W(i):W([...n,Ve(s.name,s.value)])},Hs=(e,t)=>{const s=H(e).filter(n=>!ye(n));return W(t==="all"?s:[...s,Ve(st,t)])},Ks=e=>W(H(e).filter(t=>!Ie(t)&&!ye(t))),rt=e=>e.trim().length>0,_e=e=>{if(!rt(e.query))return e.ownFilters;const t=new Set(Qs(e.query));for(const s of e.ownFilters)nt(s)||t.add(s);return t},Qe=e=>rt(e.query)?zs(e.query):e.ownCategory,ze=6e4,Us=3e4,Gs={kind:"unknown"},We=e=>(t,s)=>Pt(s?.queryKey,e)?t:void 0,$s=(e,t,s)=>({...e,category:[t],limit:s,order:"desc"}),Vs=(e,t)=>({...e,category:[t],order:"desc",count:!0,results:!1}),He=(e,t)=>({category:[t],...e.unread!==void 0?{unread:e.unread}:{},...e.starred!==void 0?{starred:e.starred}:{},...e.attachments!==void 0?{attachments:e.attachments}:{},...e.accountId!==void 0?{accountId:e.accountId}:{},...e.muted!==void 0?{muted:e.muted}:{}});function Ys({categories:e,criteria:t,limit:s,counted:n}){const i=ae({queries:e.map(c=>{const h=$s(t,c,s),u=He(t,c);return{queryKey:re({query:h}),queryFn:async()=>{const{data:v}=await ne({query:h,throwOnError:!0});return v},placeholderData:We(u),staleTime:ze}})}),d=ae({queries:e.map(c=>{const h=Vs(t,c),u=He(t,c);return{queryKey:re({query:h}),queryFn:async()=>{const{data:v}=await ne({query:h,throwOnError:!0});return v},enabled:n,placeholderData:We(u),staleTime:ze}})}),m=a.useMemo(()=>e.map((c,h)=>{const u=i[h],v=d[h],p=u?.data?.items??[];return{category:c,rows:p,atCap:p.length>=s,total:n?et(v?.data?.count):Gs,loading:u?.isPending??!0,failed:u?.isError??!1,retry:()=>{u?.refetch(),n&&v?.refetch()}}}),[e,i,d,n,s]),l=a.useCallback(()=>{for(const c of i)c.refetch();for(const c of d)c.refetch()},[i,d]);return{sections:m,isLoading:i.length>0&&i.every(c=>c.isPending),isError:i.length>0&&i.every(c=>c.isError),refetch:l}}function Js(e,t,s){const n={...e,limit:t,order:"desc"},{data:i,isLoading:d,isError:m,refetch:l}=Ge({queryKey:re({query:n}),queryFn:async()=>{const{data:h}=await ne({query:n,throwOnError:!0});return h},enabled:s,staleTime:Us});return{rows:a.useMemo(()=>s?i?.items??[]:[],[i,s]),isLoading:s&&d,isError:s&&m,refetch:a.useCallback(()=>{l()},[l])}}const Zs=3e4,Xs={kind:"unknown"},eo=(e,t)=>({...e,mailboxId:t,order:"desc",count:!0,results:!1});function to({criteria:e,junkMailboxIds:t,enabled:s}){const n=ae({queries:t.map(i=>{const d=eo(e,i);return{queryKey:re({query:d}),queryFn:async()=>{const{data:m}=await ne({query:d,throwOnError:!0});return m},enabled:s,staleTime:Zs}})});return a.useMemo(()=>t.map((i,d)=>({mailboxId:i,count:s?et(n[d]?.data?.count):Xs,failed:s?n[d]?.isError??!1:!1})),[t,n,s])}const so=(e,t)=>e.createdAt!==t.createdAt?e.createdAt-t.createdAt:e.accountId.localeCompare(t.accountId),oo=e=>[...e].sort(so),no=["from","subject","category","unread","starred","attachments"],at=["contacts","today"],ro=e=>new Set(at.filter(t=>e.has(t))),ao=(e,t,s,n)=>{const i=_t({category:e,attributes:t}),{params:d,residual:m}=Qt(s,i,no),l={...d,...i},c={muted:!1};return l.from!==void 0&&(c.from=l.from),l.subject!==void 0&&(c.subject=l.subject),l.unread!==void 0&&(c.unread=l.unread),l.starred!==void 0&&(c.starred=l.starred),l.attachments!==void 0&&(c.attachments=l.attachments),n!==void 0&&(c.accountId=n),{criteria:c,residual:m}},io=({residual:e,attributes:t})=>e.length===0&&!at.some(s=>t.has(s)),se=e=>e.count.kind==="exact"&&e.count.value>0?3:e.pageRows>0?2:e.count.kind==="unknown"?1:0,oe=e=>e.count.kind==="exact"?e.count.value:0,co=(e,t)=>se(e)!==se(t)?se(e)>se(t):oe(e)!==oe(t)?oe(e)>oe(t):e.pageRows>t.pageRows;function lo(e,{pageRowsByMailbox:t}){const s=e.map(u=>({...u,pageRows:t.get(u.mailboxId)??0}));for(const[u,v]of t)v<=0||s.some(p=>p.mailboxId===u)||s.push({mailboxId:u,count:{kind:"unknown"},failed:!1,pageRows:v});const n=s[0];if(!n)return;let i=0,d=!0,m=n;for(const u of s)u.count.kind==="unknown"?d=!1:i+=u.count.value,co(u,m)&&(m=u);const l=s.some(u=>u.pageRows>0),c=s.some(u=>u.failed);if(i===0&&!l&&(d||!c))return;const h=d&&i===0&&l;return{mailboxId:m.mailboxId,count:d&&!h?{kind:"exact",value:i}:{kind:"unknown"}}}const uo=50,fo=200,mo=[],Ke=()=>r.jsx("div",{className:"animate-pulse",children:Array.from({length:3}).map((e,t)=>r.jsxs("div",{className:"flex items-start gap-3 py-2 pl-5 pr-4 border-b border-line",children:[r.jsx("div",{className:"size-7 rounded-full bg-surface-sunken shrink-0 mt-0.5"}),r.jsxs("div",{className:"flex-1 space-y-1.5",children:[r.jsxs("div",{className:"flex justify-between gap-2",children:[r.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-28"}),r.jsx("div",{className:"h-3 bg-surface-sunken rounded w-12"})]}),r.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-48"}),r.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})]})]},t))}),ho=({accountEmail:e})=>{const t=Xe();return r.jsxs("div",{className:"flex items-center gap-2 px-row-inset py-2 border-b border-line bg-danger-soft/40 text-xs text-danger",children:[r.jsx($e,{className:"size-3.5 shrink-0"}),r.jsxs("span",{className:"flex-1 truncate",children:[e," can't connect"]}),r.jsx("button",{type:"button",onClick:()=>t("accounts"),className:"shrink-0 underline text-danger hover:opacity-80",children:"Reconnect"})]})},go=(e,t)=>{if(t.size===0)return{};const s=e.filter(d=>t.has(d.id)),n=Os(s.map(d=>d.accountId));if(n.restriction)return n;const i=new Set;for(const d of s)d.mailboxId&&i.add(d.mailboxId);return i.size>1?{accountId:n.accountId,restriction:"spansFolders",moveDisabledHint:`Move only works within one folder — this selection spans ${i.size} folders`}:{accountId:n.accountId,mailboxId:i.size===1?[...i][0]:void 0}};function po({header:e,rows:t,wizard:s,children:n}){const{selectedIds:i,selectedCount:d,exitSelection:m,orderedIds:l,allSelected:c,toggleAllLoaded:h}=ts(),u=a.useMemo(()=>go(t,i),[t,i]),{junkMailboxId:v}=ss(u.accountId),{labels:p}=As(u.accountId),b=a.useMemo(()=>Array.from(i),[i]),L=a.useMemo(()=>Ls(t,i),[t,i]),x=os(v,u.mailboxId),S=a.useMemo(()=>l.length>0?{checked:c,indeterminate:d>0&&!c,onChange:h}:void 0,[l.length,c,d,h]),A=u.moveDisabledHint?{tone:"warning",text:u.moveDisabledHint}:void 0,T=R=>r.jsx(as,{title:R.title,navSlot:R.navSlot,titleMeta:R.titleMeta,searchSlot:R.searchSlot,searchField:R.searchField,idleSlot:R.makeFilterSlot,count:d,onCancel:m,onDelete:()=>s.start("delete"),onMove:()=>s.start("move"),onOrganize:()=>s.start("organize"),onJunk:x?()=>s.start("junk"):void 0,onMarkRead:()=>s.start("markRead"),overflowSlot:u.accountId&&u.mailboxId&&d>0&&p.length>0?r.jsx(Fs,{accountId:u.accountId,mailboxId:u.mailboxId,messageIds:b}):void 0,selectAll:S,notice:A});return r.jsx(ns,{...e,selectionBar:T,paneOverlay:r.jsx(rs,{verb:s.verb,accountId:u.accountId,mailboxId:u.mailboxId,selection:L,selectionRestriction:u.restriction,onFinished:m}),children:n})}function xo({accounts:e,selectedMessageId:t,onOpenThread:s,commandsRef:n,onTriageContextChange:i,onDeleteMessages:d}){const{searchQuery:m,searchInput:l,resultFolderIndex:c,onSearchChange:h}=ie(),u=Lt(),v=Ns(),p=Cs(),b=jt(),L=vs(),x=a.useMemo(()=>oo(e.filter(o=>!o.muted?.value)),[e]),[S,A]=a.useState("all"),[T,R]=a.useState("all"),[N,q]=a.useState(new Set),[le,M]=a.useState(!1),D=a.useCallback(o=>{q(f=>{const g=new Set(f);return g.has(o)?g.delete(o):g.add(o),g})},[]),K=a.useCallback(()=>q(new Set),[]),E=l.trim().length>0,{freeText:w,tokens:P}=qt(m.trim().toLowerCase(),u),y=w.length>0,_=a.useMemo(()=>_e({query:l,ownFilters:N}),[l,N]),Q=a.useMemo(()=>Qe({query:l,ownCategory:T}),[l,T]),F=a.useMemo(()=>_e({query:m,ownFilters:N}),[m,N]),C=a.useMemo(()=>Qe({query:m,ownCategory:T}),[m,T]),I=a.useCallback(o=>{if(!E||!nt(o)){D(o);return}const f=Ws(l,o);f!==void 0&&h(f)},[E,l,h,D]),j=a.useCallback(o=>{if(!E){R(o);return}h(Hs(l,o))},[E,l,h]),de=a.useMemo(()=>C==="all"&&!y?o=>{Ue(o)&&j(o)}:void 0,[C,y,j]),ue=a.useCallback(()=>{R("all"),A("all"),K(),E&&h(Ks(l))},[E,l,h,K]),U=ae({queries:x.map(o=>({...kt({path:{accountId:o.accountId}}),staleTime:1/0,meta:{softError:!0}}))}),G=a.useMemo(()=>{const o=new Map;for(let f=0;f<x.length;f++){const g=x[f].accountId,te=(U[f]?.data?.items??[]).reduce((O,Rt)=>O+(Rt.unseenCount??0),0);o.set(g,te)}return o},[x,U]),lt=a.useMemo(()=>x.filter((o,f)=>{const g=U[f];return g?.isError?!Et(g.error):!1}),[x,U]),{criteria:fe,residual:$}=a.useMemo(()=>ao(C,F,P,S==="all"?void 0:S),[C,F,P,S]),dt=a.useMemo(()=>C==="all"?[...zt]:[C],[C]),ve=a.useMemo(()=>({...fe,query:w,...C==="all"?{}:{category:[C]}}),[fe,w,C]),be=io({residual:$,attributes:F}),{sections:V,isLoading:ut,isError:ft,refetch:Se}=Ys({categories:y?mo:dt,criteria:fe,limit:C==="all"?es:uo,counted:be}),{rows:Te,isLoading:mt,isError:ht,refetch:Ce}=Js(ve,fo,y),me=y?mt:ut,we=y?ht:ft,Re=a.useCallback(()=>{if(y){Ce();return}Se()},[y,Ce,Se]),Me=a.useMemo(()=>ro(F),[F]),Y=a.useCallback(o=>Bs(o).map(Wt).filter(f=>Ot(f,Me)&&Ht(f,$)),[Me,$]),J=a.useMemo(()=>V.map(o=>({category:o.category,total:o.total,atCap:o.atCap,loading:o.loading,failed:o.failed,rows:Y(o.rows)})),[V,Y]),Z=a.useMemo(()=>Y(Te),[Te,Y]),gt=a.useCallback(o=>{V.find(f=>f.category===o)?.retry()},[V]),k=a.useMemo(()=>y?Z:J.flatMap(o=>o.rows),[y,Z,J]),pt=a.useMemo(()=>Ft(c),[c]),je=to({criteria:ve,junkMailboxIds:pt,enabled:be&&Es({hasSearchQuery:y,freeText:w,residualTokenCount:$.length})}),{spamIds:he,briefSpamOffer:X}=a.useMemo(()=>{const o={spamIds:void 0,briefSpamOffer:void 0};if(!w)return o;const f=k.map(O=>De(O,c)),{spam:g}=Kt(f),B=new Map;for(const O of g)O.mailboxId&&B.set(O.mailboxId,(B.get(O.mailboxId)??0)+1);const te=lo(je,{pageRowsByMailbox:B});return g.length===0&&!te?o:{spamIds:g.length>0?new Set(g.map(O=>O.id)):void 0,briefSpamOffer:te}},[k,w,c,je]),ke=a.useMemo(()=>{const o=f=>he===void 0?f:f.filter(g=>!he.has(g.id));return y?[{id:"matches",threads:o(Z)}]:Ut(J.map(f=>({...f,rows:o(f.rows)})))},[y,Z,J,he]),Ee=a.useCallback((o,f)=>{const g=k.find(B=>B.id===o)?.threadId;g&&s?.({threadId:g,messageId:o},f)},[k,s]),xt=a.useCallback(o=>{const f=o.threadId??k.find(g=>g.id===o.id)?.threadId;f&&s?.({threadId:f,messageId:o.id})},[k,s]),ge=a.useMemo(()=>x.length<=1?[]:[{id:"all",label:"All",active:S==="all"},...x.map(o=>({id:o.accountId,label:o.email.split("@")[0]??o.email,count:G.get(o.accountId),active:S===o.accountId}))],[x,G,S]),z=a.useMemo(()=>e.filter(o=>o.muted?.value).length,[e]),It=a.useMemo(()=>Array.from(G.values()).reduce((o,f)=>o+f,0),[G]),pe=a.useMemo(()=>x.map(o=>o.accountId),[x]),{hasNewMail:Oe}=ws(),{state:Fe,errorMessage:Ae,refresh:Ne}=Rs(pe,{onSettled:()=>Re()}),yt=a.useMemo(()=>r.jsx(Ms,{state:Fe,onRefresh:Ne,label:"Refresh daily brief",errorMessage:Ae,hasUpdate:Oe(pe)}),[Fe,Ne,Ae,Oe,pe]),vt=a.useMemo(()=>k.map(o=>De(o,c)),[k,c]),bt=a.useMemo(()=>{const o=Gt(ge.map(f=>({id:f.id,label:f.label,count:f.count,active:f.active})));return{categories:o.categories,filters:o.filters,sources:o.sources,sourcesNote:z>0?`+${z} muted`:void 0,selectedCategory:Q,activeFilters:_,expanded:le,onExpandedChange:M,onSelectCategory:f=>j(f),onSelectSource:A,onToggleFilter:f=>I(f),onClear:ue}},[ge,z,Q,_,le,I,j,ue]),Be=ke.length===0&&S==="all"&&w.length===0&&P.length===0,St=a.useMemo(()=>x.map(o=>o.accountId),[x]),Tt=a.useMemo(()=>x.some(o=>js(o.syncPhase)),[x]),ee=ks(St,Be||Tt),Le=r.jsxs("div",{className:"h-full overflow-y-auto",children:[r.jsx(Ke,{}),r.jsx(Ke,{})]}),qe=!me&&!we&&!Be,Ct=$t({tier:p,hasLiveInput:E,hasCommittedQuery:m.trim().length>0,bodyRendersCommittedResults:!0}),wt=qe?r.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[X&&r.jsx(Vt,{count:X.count,onScopeToSpam:()=>L(X.mailboxId,m)}),r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(Yt,{sections:ke,briefCategory:Q,Row:Jt,selectedThreadId:t,onSelectThread:Ee,onShowAllSection:de,onRetrySection:gt,flat:y,onSelectBriefCategory:j,sources:ge,sourcesNote:z>0?`+${z} muted`:void 0,onSelectSource:A,activeFilters:_,onToggleFilter:I,onClearFilters:ue})})]}):me?Le:we?r.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 py-12 text-sm text-fg-muted",children:[r.jsx($e,{className:"size-8 text-danger"}),r.jsx("p",{children:"Couldn't load your messages"}),r.jsxs("button",{type:"button",onClick:()=>Re(),className:"flex items-center gap-1 text-accent underline text-xs",children:[r.jsx(qs,{className:"size-3.5"}),"Try again"]})]}):ee.resolved?r.jsx(Ds,{sync:ee.syncing?{synced:ee.synced,total:ee.total}:void 0}):Le;return r.jsx(At,{hasSheet:qe&&!Ct,children:r.jsx(Zt,{selectedMessageId:t,rows:k,onOpen:Ee,onDeleteMessages:d,onSelectionVerb:b.start,commandsRef:n,onTriageContextChange:i,children:r.jsx(po,{wizard:b,header:{title:"Daily brief",unreadCount:It,footer:v?r.jsx(Xt,{}):void 0,searchFilter:bt,searchResults:vt,searchLoading:me,onSelectSearchResult:xt,spamOffer:X,searchResultsInBody:!0,refreshControl:yt},rows:k,children:r.jsxs("div",{className:"flex h-full flex-col",children:[lt.map(o=>r.jsx(ho,{accountEmail:o.email,accountId:o.accountId},o.accountId)),r.jsx("div",{className:"min-h-0 flex-1",children:wt})]})})})})}const it=a.createContext(null);function ce(){const e=a.useContext(it);if(!e)throw new Error("BriefPane.* must be used inside <BriefPane>");return e}function Io({thread:e,children:t}){const s=bs(),n=Ss(),i=Xe(),{searchInput:d}=ie(),m=e?.threadId,l=e?.messageId,{data:c}=Ge({...Nt(),staleTime:6e4}),h=a.useMemo(()=>c?.items??[],[c]),u=a.useMemo(()=>{if(m)return h.find(I=>I.messageId===l)??h.find(I=>I.threadId===m)},[h,m,l]),v=is(m,l),p=u??v,b=l??p?.messageId,L=a.useMemo(()=>{if(m)return{threadId:m,mailboxId:p?.mailboxId??"",subject:p?.subject,messageId:b,authenticity:p?.authenticity}},[m,p,b]),x=a.useCallback((I,j)=>{s(I,{replace:j?.replace,query:d})},[s,d]),S=a.useCallback(I=>{b&&I.includes(b)&&n()},[b,n]),A=Pe({thread:p,isOpen:!0,onAfterOptimisticRemove:S}),T=cs(),{deleteMessages:R}=ls({mailboxId:p?.mailboxId??"",messages:h,onAfterOptimisticRemove:S}),{toggleReadFor:N}=ds({mailboxId:p?.mailboxId??"",messages:h}),q=T.focusedMessageId,M=a.useMemo(()=>h.find(I=>I.messageId===q),[h,q])??p,D=Pe({thread:M,isOpen:M?.messageId===b}),K=ys(),E=ps(),w=xs(),P=a.useMemo(()=>Is(w,m,b),[w,m,b]),y=a.useMemo(()=>{if(M)return I=>w({threadId:M.threadId,messageId:M.messageId,mode:I})},[w,M]),{nextMessageId:_,previousMessageId:Q}=us({context:T,orderedIds:T.orderedIds,selectedMessageId:b,enabled:!K&&!E,hasOpenThread:m!==void 0,onClose:n,handlers:{reply:()=>y?.("reply"),replyAll:()=>y?.("reply-all"),forward:()=>y?.("forward"),delete:()=>{T.listCommandsRef.current?.requestVerb("delete")||D.deleteThread()},toggleStar:D.toggleStar,toggleRead:()=>{T.listCommandsRef.current?.requestVerb("markRead")||M&&N([M.messageId],!M.isRead)},goFlagged:()=>i("flagged"),goSettings:()=>i("settings")}}),F=a.useCallback(I=>{if(!I)return;const j=h.find(de=>de.messageId===I);return j?{threadId:j.threadId,messageId:I}:void 0},[h]),C={selectedMessageId:b,selectedThread:p,conversation:L,onOpenThread:x,onCloseThread:n,nextThread:F(_),previousThread:F(Q),actions:A,onReply:P,triage:T,onDeleteMessages:R,handleDeselectIfRemoved:S};return r.jsx(it.Provider,{value:C,children:t})}function ct(){const{selectedMessageId:e,onOpenThread:t,triage:s,onDeleteMessages:n}=ce(),{accounts:i}=ie();return r.jsx(xo,{accounts:i,selectedMessageId:e,onOpenThread:t,commandsRef:s.listCommandsRef,onTriageContextChange:s.onTriageContextChange,onDeleteMessages:n})}function yo(){const e=xe(),{conversation:t,selectedThread:s,actions:n,onReply:i,handleDeselectIfRemoved:d,onOpenThread:m}=ce(),l=!!t,c=hs(t?.threadId);return r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[r.jsx(gs,{hasThread:l,intelligenceOpen:c.isShowing,canToggleIntelligence:c.canToggle,onToggleIntelligence:c.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:l?n.deleteThread:void 0,onToggleStar:l?n.toggleStar:void 0,isStarred:n.isStarred,moveContext:l&&n.accountId&&n.mailboxId?{accountId:n.accountId,currentMailboxId:n.mailboxId,onMove:n.moveThread}:void 0}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:t?r.jsx(Je,{threadId:t.threadId,mailboxId:t.mailboxId,subject:t.subject,selectedMessageId:t.messageId,authenticity:t.authenticity,onOpenIntelligence:c.open,listOnScreen:!0}):r.jsx(Dt,{})})]}),r.jsx(Ze,{isOpen:c.drawerOpen,onClose:c.closeDrawer,thread:s,accountId:s?.accountId,onAfterOptimisticRemove:d,onReplyWithText:e,onOpenThread:m})]})}function vo(){const e=xe(),{selectedThread:t,handleDeselectIfRemoved:s,onOpenThread:n}=ce(),{onToggleIntelligence:i}=ie();return r.jsx(ms,{onClose:i,thread:t,accountId:t?.accountId,onAfterOptimisticRemove:s,onReplyWithText:e,onOpenThread:n})}function bo(){const e=xe(),{selectedThread:t,conversation:s,onOpenThread:n,onCloseThread:i,nextThread:d,previousThread:m,handleDeselectIfRemoved:l}=ce(),c=fs(s?.threadId??null);return s?r.jsxs(r.Fragment,{children:[r.jsx(Je,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:i,onOpenIntelligence:c.toggle,onSwipeNext:d?()=>n(d):void 0,onSwipePrevious:m?()=>n(m):void 0,mobileIntelligenceOpen:c.isOpen}),r.jsx(Ze,{isOpen:c.isOpen,onClose:c.close,thread:t,accountId:t?.accountId,onAfterOptimisticRemove:l,onReplyWithText:e,onOpenThread:n})]}):r.jsx("div",{className:"h-full",children:r.jsx(ct,{})})}const qo=Object.assign(Io,{List:ct,Reading:yo,Intelligence:vo,Phone:bo});export{qo as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n,d as C,o as m,Q as X,R as ee,as as N,r as w,ar as te,X as ne,af as se,T as ae}from"./index-CXzCthHG.js";import{R as _,k as $,J as ie,c as re,K as oe,x as le,L as ce,G as de}from"./useCalendarEvents-lDPF_B6_.js";import{e as ue,g as j,h as me,u as he,b as U,d as xe,i as pe,t as ye,U as ve}from"./useCalendars-BgSJfw8G.js";import{C as ge}from"./calendar-clash-strip-C9X1djbQ.js";const De=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ne=["January","February","March","April","May","June","July","August","September","October","November","December"],Te=["first","second","third","fourth","last"],k="";function fe(e,t){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return[];const[s,a,r]=e.split("-").map(Number),o=new Date(Date.UTC(s,a-1,r)),i=De[o.getUTCDay()],c=Te[Math.min(Math.floor((r-1)/7),4)],l=t===""?"":`, ${t}`,d=o.getUTCDay()>=1&&o.getUTCDay()<=5;return[`Every day${l}`,...d?[`Every weekday${l}`]:[],`Every week on ${i}${l}`,`Every month on the ${c} ${i}${l}`,`Every year on ${r} ${Ne[a-1]}${l}`]}const be="w-full rounded-md border border-line bg-surface-sunken px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus-visible:border-line-strong focus-visible:ring-2 focus-visible:ring-ring/30",p=({draft:e,onChange:t},s,a)=>t({...e,[s]:a});function D({label:e,children:t}){return n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e}),t]})}function je({draft:e,onChange:t,layout:s="compact",touch:a}){const r=s==="pane";return n.jsx(N,{value:e.title,placeholder:"Title","aria-label":"Title",onChange:o=>p({draft:e,onChange:t},"title",o.target.value),className:m(r?"text-lg font-medium":"text-md font-medium",r?"h-11":a?"min-h-11":"")})}function P(e){return e.date===""||e.endDate===""?!1:e.allDay?e.endDate<e.date:e.startTime===""||e.endTime===""?!1:`${e.endDate}T${e.endTime}`<`${e.date}T${e.startTime}`}function Ee(e,t){return t===""?{...e,date:t}:e.endDate===""?{...e,date:t,endDate:t}:e.date===""?{...e,date:t}:{...e,date:t,endDate:$(t,ie(e.date,e.endDate))}}function Ce(e,t){const s=e.date!==""&&e.endDate===$(e.date,1)&&e.startTime!==""&&e.endTime!==""&&e.endTime<e.startTime;return t&&s?{...e,allDay:t,endDate:e.date}:!t&&e.date!==""&&e.endDate===e.date&&e.startTime!==""&&e.endTime!==""&&e.endTime<e.startTime?{...e,allDay:t,endDate:$(e.date,1)}:{...e,allDay:t}}function $e({draft:e,onChange:t,touch:s}){const a=s?"min-h-11":"",r=P(e),o=w.useId(),i={"aria-invalid":r,"aria-describedby":r?o:void 0},c=m("w-40",a,r&&"border-danger/60"),l=m("w-28",a,r&&"border-danger/60");return n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(N,{type:"date",value:e.date,"aria-label":"Date",...i,onChange:d=>t(Ee(e,d.target.value)),className:c}),!e.allDay&&n.jsx(N,{type:"time",value:e.startTime,"aria-label":"Start time",...i,onChange:d=>p({draft:e,onChange:t},"startTime",d.target.value),className:l}),n.jsx("span",{className:"text-sm text-fg-subtle",children:"to"}),n.jsx(N,{type:"date",value:e.endDate,"aria-label":"End date",min:e.date===""?void 0:e.date,...i,onChange:d=>p({draft:e,onChange:t},"endDate",d.target.value),className:c}),!e.allDay&&n.jsx(N,{type:"time",value:e.endTime,"aria-label":"End time",...i,onChange:d=>p({draft:e,onChange:t},"endTime",d.target.value),className:l}),n.jsxs("label",{className:"flex items-center gap-2 text-sm text-fg-muted",children:[n.jsx("input",{type:"checkbox",checked:e.allDay,onChange:d=>t(Ce(e,d.target.checked)),className:"size-4 accent-current"}),"All day"]})]}),r&&n.jsx("p",{id:o,className:"text-xs text-danger",role:"alert",children:e.allDay?`Ends before it starts. Move the end to ${e.date} or later.`:`Ends before it starts. Move the end past ${e.date} ${e.startTime}, or start earlier.`})]})}function ke({draft:e,onChange:t,calendars:s,touch:a}){return n.jsx(Fe,{calendars:s,value:e.calendarId,onChange:r=>p({draft:e,onChange:t},"calendarId",r),touch:a})}function we({draft:e,onChange:t,touch:s,repeatEditable:a=!0,onCustom:r}){return a?n.jsx(Re,{value:e.repeat,date:e.date,startTime:e.startTime,onChange:o=>p({draft:e,onChange:t},"repeat",o),onCustom:r,className:s?"min-h-11":""}):n.jsxs("p",{className:"flex items-center gap-2 text-sm text-fg-muted",children:[n.jsx(_,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.repeat===k?"Does not repeat":e.repeat]})}function Ye({draft:e,onChange:t,touch:s}){return n.jsx(N,{value:e.location,placeholder:"Location","aria-label":"Location",onChange:a=>p({draft:e,onChange:t},"location",a.target.value),className:s?"min-h-11":""})}function Ae({draft:e,onChange:t,touch:s}){return n.jsx(N,{value:e.guests,placeholder:"Guests, comma separated","aria-label":"Guests",onChange:a=>p({draft:e,onChange:t},"guests",a.target.value),className:s?"min-h-11":""})}function Oe({draft:e,onChange:t,layout:s="compact"}){return n.jsx("textarea",{value:e.notes,placeholder:"Notes","aria-label":"Notes",onChange:a=>p({draft:e,onChange:t},"notes",a.target.value),rows:s==="pane"?6:3,className:be})}function Me({draft:e,onChange:t,calendars:s,layout:a="compact",expanded:r=!1,onToggleExpanded:o,onSave:i,onCancel:c,onDelete:l,saveLabel:d="Add",header:h,repeatEditable:u=!0,guestsEditable:x=!1,calendarEditable:y=!0,onCustomRepeat:b,touch:v,className:A}){const f=a==="pane",g={draft:e,onChange:t,layout:a,touch:v},O=n.jsx(je,{...g}),M=n.jsx($e,{...g}),R=n.jsx(ke,{...g,calendars:s}),F=n.jsx(we,{...g,repeatEditable:u,onCustom:b}),S=n.jsx(Ye,{...g}),I=n.jsx(Ae,{...g}),L=n.jsx(Oe,{...g}),B=n.jsxs("div",{className:m("flex items-center gap-2",f?"pt-2":"pt-1"),children:[n.jsx(C,{variant:"primary",size:v||f?"md":"sm",onClick:i,disabled:P(e),className:v?"min-h-11 flex-1":"",children:d}),n.jsx(C,{variant:"ghost",size:v||f?"md":"sm",onClick:c,className:v?"min-h-11":"",children:"Cancel"}),l&&n.jsx(C,{variant:"ghost",size:v||f?"md":"sm",onClick:l,className:m("ml-auto text-danger",v&&"min-h-11"),children:"Delete"})]});if(f)return n.jsxs("div",{className:m("flex flex-col gap-5",A),children:[h,n.jsx(D,{label:"Title",children:O}),n.jsx(D,{label:"When",children:M}),y&&n.jsx(D,{label:"Calendar",children:R}),n.jsx(D,{label:"Repeat",children:F}),n.jsx(D,{label:"Location",children:S}),x&&n.jsx(D,{label:"Guests",children:I}),n.jsx(D,{label:"Notes",children:L}),B]});const q=o!==void 0&&!r;return n.jsxs("div",{className:m("flex flex-col gap-3",A),children:[h,O,M,y&&R,o&&n.jsxs("button",{type:"button",onClick:o,"aria-expanded":r,className:m("flex items-center gap-1 self-start rounded-sm text-xs font-medium text-fg-muted outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",v&&"min-h-11"),children:[r?n.jsx(X,{className:"size-3.5"}):n.jsx(ee,{className:"size-3.5"}),r?"Fewer details":"More details"]}),!q&&n.jsxs("div",{className:"flex flex-col gap-2 border-t border-line pt-3",children:[S,x&&I,F,L]}),B]})}const W="__custom__";function Re({value:e,date:t,startTime:s,onChange:a,onCustom:r,className:o}){const i=fe(t,s),c=e===k||i.includes(e)?i:[e,...i];return n.jsxs(te,{icon:n.jsx(_,{className:"size-4"}),"aria-label":"Repeat",value:e,onChange:l=>{if(l.target.value===W){r?.();return}a(l.target.value)},className:o,children:[n.jsx("option",{value:k,children:"Does not repeat"}),c.map(l=>n.jsx("option",{value:l,children:l},l)),r&&n.jsx("option",{value:W,children:"Custom…"})]})}function Fe({calendars:e,value:t,onChange:s,touch:a}){const r=w.useId();return n.jsxs("fieldset",{className:"flex flex-wrap gap-1.5",children:[n.jsx("legend",{className:"sr-only",children:"Calendar"}),e.map(o=>{const i=re(o.color),c=o.id===t;return n.jsxs("label",{className:m("inline-flex cursor-pointer items-center gap-1.5 rounded-full border px-2.5 text-xs transition-colors","has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring",a?"min-h-11":"h-7",c?m(i.soft,i.text,i.border):"border-line text-fg-muted hover:bg-surface-sunken"),children:[n.jsx("input",{type:"radio",name:r,value:o.id,checked:c,onChange:()=>s(o.id),className:"sr-only"}),n.jsx("span",{className:m("size-2 rounded-full",i.solid)}),o.name]},o.id)})]})}function Se({title:e,subtitle:t,onClose:s,children:a,className:r}){return n.jsxs("section",{className:m("flex h-full w-full flex-col bg-surface",r),children:[n.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[n.jsx("h2",{className:"shrink-0 text-xs font-medium text-fg",children:e}),t!==void 0&&t!==""&&n.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:t}),n.jsx("button",{type:"button","aria-label":"Close editor",onClick:s,className:"ml-auto flex size-7 shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:n.jsx(ne,{className:"size-4"})})]}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-5",children:n.jsx("div",{className:"mx-auto w-full max-w-2xl",children:a})})]})}const E=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],T=["SU","MO","TU","WE","TH","FR","SA"],Q=["January","February","March","April","May","June","July","August","September","October","November","December"],Z=["first","second","third","fourth","last"],Y=[1,2,3,4,-1],z="MO,TU,WE,TH,FR",Ie=e=>e.replace(/,\s*\d{2}:\d{2}$/,"").trim();function J(e){const t=Ie(e);if(t==="")return"";if(t==="Every day")return"FREQ=DAILY";if(t==="Every weekday")return`FREQ=WEEKLY;BYDAY=${z}`;const s=t.match(/^Every week on (\w+)$/);if(s){const o=E.indexOf(s[1]);return o===-1?void 0:`FREQ=WEEKLY;BYDAY=${T[o]}`}const a=t.match(/^Every month on the (\w+) (\w+)$/);if(a){const o=Z.indexOf(a[1]),i=E.indexOf(a[2]);return o===-1||i===-1?void 0:`FREQ=MONTHLY;BYDAY=${Y[o]}${T[i]}`}const r=t.match(/^Every year on (\d{1,2}) (\w+)$/);if(r){const o=Q.indexOf(r[2]);return o===-1?void 0:`FREQ=YEARLY;BYMONTH=${o+1};BYMONTHDAY=${Number(r[1])}`}}const Le=e=>e===""?"":`, ${e}`;function Ze(e,t){const s=new Map(e.split(";").map(i=>i.split("=")).filter(i=>i.length===2).map(([i,c])=>[i.toUpperCase(),c.toUpperCase()])),a=Le(t),r=s.get("FREQ"),o=s.get("BYDAY");if(!(s.has("INTERVAL")&&s.get("INTERVAL")!=="1")&&!(s.has("UNTIL")||s.has("COUNT"))){if(r==="DAILY")return`Every day${a}`;if(r==="WEEKLY"){if(o===void 0)return;if(o===z)return`Every weekday${a}`;const i=T.indexOf(o);return i===-1?void 0:`Every week on ${E[i]}${a}`}if(r==="MONTHLY"){const i=o?.match(/^(-?\d)([A-Z]{2})$/);if(!i)return;const c=Y.indexOf(Number(i[1])),l=T.indexOf(i[2]);return c===-1||l===-1?void 0:`Every month on the ${Z[c]} ${E[l]}${a}`}if(r==="YEARLY"){const i=Number(s.get("BYMONTH")),c=Number(s.get("BYMONTHDAY"));return!i||!c||i>12?void 0:`Every year on ${c} ${Q[i-1]}${a}`}}}const H=e=>Date.parse(`${e}T00:00:00Z`)/864e5;function Be(e,t,s){const a=H(s)-H(t);if(e===""||a===0||Number.isNaN(a))return e;const[r,o,i]=s.split("-").map(Number),c=new Date(Date.UTC(r,o-1,i)).getUTCDay(),l=/FREQ=(\w+)/i.exec(e)?.[1]?.toUpperCase();return e.split(";").map(d=>{const[h,u=""]=d.split("="),x=h.toUpperCase();return x==="BYDAY"&&l==="MONTHLY"?`BYDAY=${Y[Math.min(Math.floor((i-1)/7),4)]}${T[c]}`:x==="BYDAY"?`BYDAY=${u.split(",").map(y=>{const b=T.indexOf(y.toUpperCase());return b===-1?y:T[(b+a+7)%7]}).join(",")}`:x==="BYMONTH"?`BYMONTH=${o}`:x==="BYMONTHDAY"?`BYMONTHDAY=${i}`:d}).join(";")}function ze(e,t){return{title:"",date:e,startTime:"09:00",endDate:e,endTime:"10:00",allDay:!1,calendarId:t,location:"",guests:"",notes:"",repeat:""}}function Je(e,t){return{title:e.title,date:e.start.slice(0,10),startTime:e.allDay?"":e.start.slice(11,16),endDate:oe(e),endTime:e.allDay?"":e.end.slice(11,16),allDay:e.allDay,calendarId:e.calendarId,location:t.location,guests:"",notes:t.notes,repeat:t.repeat}}function K(e,t){return e.allDay?{start:e.date,end:ue(e.endDate,1)}:{start:j(e.date,e.startTime,t),end:j(e.endDate,e.endTime,t)}}function G(e,t,s){const a=J(e.repeat)??"",r=e.allDay?e.date:me(t,s.anchor===""?"UTC":s.anchor).slice(0,10);return Be(a,e.date,r)}function V(e,t){return e.title.trim()===""?"Give the event a title before saving it.":e.date===""?"Pick the day the event is on.":e.endDate===""?"Pick the day the event ends on.":e.calendarId===""?"Pick the calendar to save the event in.":!e.allDay&&(e.startTime===""||e.endTime==="")?"Set a start and an end time, or mark the event all day.":e.allDay&&e.endDate<e.date?"The last day is before the first. Move one of them.":!e.allDay&&`${e.endDate}T${e.endTime}`<=`${e.date}T${e.startTime}`?"The end is not after the start. Move one of them.":t&&J(e.repeat)===void 0?"This calendar can't store that repeat rule. Pick one of the offered rules, or turn the repeat off.":""}function Ke(e,t){const s=V(e,!0);if(s!=="")return{ok:!1,problem:s};const{start:a,end:r}=K(e,t.clock);return{ok:!0,input:{calendarId:e.calendarId,summary:e.title.trim(),description:e.notes,location:e.location,start:a,end:r,allDay:e.allDay,...t.anchor===""?{}:{timeZone:t.anchor},recurrenceRule:G(e,a,t)}}}function Ge(e,t,s){const a=t.repeat!==e.repeat,o=t.allDay!==e.allDay||t.date!==e.date||t.startTime!==e.startTime,i=o||t.endDate!==e.endDate||t.endTime!==e.endTime,c=V(t,a);if(c!=="")return{ok:!1,problem:c};const l={};t.title.trim()!==e.title.trim()&&(l.summary=t.title.trim()),t.location!==e.location&&(l.location=t.location),t.notes!==e.notes&&(l.description=t.notes);const{start:d,end:h}=K(t,s.clock);return o&&(l.start=d),i&&(l.end=h,l.allDay=t.allDay,s.anchor!==""&&(l.timeZone=s.anchor)),a&&(l.recurrenceRule=G(t,d,s)),{ok:!0,patch:l}}const Ue=[],We={from:"",to:""};function Ve(e,t=""){const{timeZoneByCalendarId:s}=he(),a=e.date!==""&&!e.allDay&&e.endDate!==""&&e.startTime!==""&&e.endTime!==""&&`${e.endDate}T${e.endTime}`>`${e.date}T${e.startTime}`,{instances:r,isLoading:o,error:i}=le({...a?{from:U("week",e.date).from,to:U("week",e.endDate).to}:We,calendarIds:Ue,enabled:a}),c=xe();return w.useMemo(()=>{if(!a||o||i)return;const l=j(e.date,e.startTime,c),d=j(e.endDate,e.endTime,c),h=r.filter(u=>pe(u)&&u.calendarObjectId!==t).map(u=>ye(u,s[u.calendarId]??ve,c));return ce({start:l,end:d},h).map(u=>({id:u.id,label:`${u.title}, ${de(u)}`}))},[a,o,i,e.date,e.endDate,e.startTime,e.endTime,c,r,t,s])}function qe({title:e,subtitle:t,notice:s="",calendars:a,draft:r,onChange:o,problem:i,saveLabel:c,isSaving:l,repeatEditable:d=!0,calendarEditable:h=!0,clashes:u,onSave:x,onCancel:y}){return n.jsx(Se,{title:e,subtitle:t,onClose:y,children:n.jsx(Me,{draft:r,onChange:o,calendars:a,layout:"pane",repeatEditable:d,calendarEditable:h,saveLabel:l?"Saving…":c,onSave:x,onCancel:y,header:i===""&&s===""&&u===void 0?void 0:n.jsxs("div",{className:"space-y-2",children:[s!==""&&n.jsxs("p",{className:"flex items-start gap-2 rounded-md border border-warning/40 bg-warning-soft px-3 py-2 text-sm text-fg",children:[n.jsx(se,{className:"mt-0.5 size-4 shrink-0 text-warning","aria-hidden":"true"}),n.jsx("span",{className:"min-w-0 flex-1 break-words",children:s})]}),i!==""&&n.jsxs("div",{role:"alert",className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[n.jsx(ae,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),n.jsx("p",{className:"min-w-0 flex-1 break-words text-fg",children:i})]}),u!==void 0&&n.jsx(ge,{clashes:u,clearText:"Nothing else is booked at this time."})]})})})}export{qe as C,Se as E,K as a,Ke as c,Je as d,ze as e,Be as m,Ge as p,Ze as t,Ve as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,r as e}from"./index-CXzCthHG.js";const o=e.createContext(void 0),C=({pick:s,children:r})=>t.jsx(o.Provider,{value:s,children:r}),d=()=>e.useContext(o);export{C,d as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as n,a9 as l,aa as o}from"./index-CXzCthHG.js";const i=r.createContext(null),v=({chrome:a,children:s})=>n.jsx(i.Provider,{value:a,children:s});function C({workspace:a,reading:s,hasOpenEvent:x}){const e=r.useContext(i);if(!e)return n.jsx(l,{});const t={nav:e.nav,skeleton:n.jsx(l,{}),isLoading:e.isLoading,navOpen:e.navOpen,onOpenNav:e.onOpenNav,onCloseNav:e.onCloseNav,listBias:"list"};return e.isSinglePane?n.jsx(o,{...t,list:x?s:a}):n.jsx(o,{...t,list:a,reading:s})}export{v as C,C as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./index-CXzCthHG.js";const x=({message:s,icon:t})=>e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[t&&e.jsx("div",{className:"mb-4 text-fg-muted",children:t}),e.jsx("p",{className:"text-fg-muted",children:s})]});export{x as E};
|