@remit/web-client-dist 0.0.679 → 0.0.681
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/BriefPane-Ct5mLFno.js +1 -0
- package/assets/CalendarEventEditor-BDZOuAkE.js +1 -0
- package/assets/CalendarEventPopup-Cd49o1aV.js +1 -0
- package/assets/{CalendarLoadFailed-DL8u-JFQ.js → CalendarLoadFailed--QaS7mCJ.js} +1 -1
- package/assets/CalendarQuickCreate-BYHJja5o.js +1 -0
- package/assets/{CalendarSession-BMeYMexj.js → CalendarSession-CS_x_fs5.js} +1 -1
- package/assets/DesktopChrome-DGlb8cny.js +1 -0
- package/assets/{DropdownMenu-pEN-d7K3.js → DropdownMenu-T79mAX3f.js} +1 -1
- package/assets/{EmptyState-CP5Vn2LS.js → EmptyState-CA538vCg.js} +1 -1
- package/assets/{ErrorState-BmfRU6e6.js → ErrorState-DD3UfsN8.js} +1 -1
- package/assets/{FlaggedPane-CGZ_AxBh.js → FlaggedPane-DLqwSIp0.js} +1 -1
- package/assets/{FullCompose-YhsG0MQv.js → FullCompose-DnUwBsN_.js} +1 -1
- package/assets/LabelApplyTrigger-Ox3K3UZo.js +1 -0
- package/assets/MailShell-DVTROO5Y.js +1 -0
- package/assets/MailViewChrome-BXIIRW1m.js +1 -0
- package/assets/MailboxPane-ZTGfkp9r.js +135 -0
- package/assets/MessageBody-Bn9CiLsL.js +84 -0
- package/assets/MessageToolbar-bKPOSy0d.js +1 -0
- package/assets/NavMenuButton-DS-H9eDz.js +1 -0
- package/assets/{OnboardingWizard-DADGyMEc.js → OnboardingWizard-BpOpo7pG.js} +1 -1
- package/assets/OutboxPane-D90GSWPB.js +1 -0
- package/assets/_calendarObjectId-DLrseFHy.js +1 -0
- package/assets/_mailboxId-ChbfZSu5.js +1 -0
- package/assets/_messageId-C3xB5mTr.js +1 -0
- package/assets/_messageId-DkZ9lbs8.js +1 -0
- package/assets/_messageId-sIYPsGs_.js +1 -0
- package/assets/_outboxMessageId-p9gMPFrF.js +1 -0
- package/assets/_recurrenceId-Dr6Hnp4i.js +1 -0
- package/assets/_threadId-CZDsH_MT.js +1 -0
- package/assets/_threadId-H8aKyGzF.js +1 -0
- package/assets/_threadId-KqET2q-N.js +1 -0
- package/assets/_view-CtgngRpB.css +1 -0
- package/assets/_view._date-FIQ-o-2N.js +1 -0
- package/assets/{account-service-status-DbTLkFuz.js → account-service-status-6nrumJJk.js} +1 -1
- package/assets/accounts-BzG1i3mT.js +1 -0
- package/assets/advanced-BNNZ1epf.js +1 -0
- package/assets/agenda-time-C_THqiEa.js +1 -0
- package/assets/app-chrome-Cb3lBdOZ.js +1 -0
- package/assets/appearance-BihwpGRs.js +1 -0
- package/assets/{avatar-CxJjt5__.js → avatar-COUm7SBG.js} +1 -1
- package/assets/badge-C-N2Sfyc.js +1 -0
- package/assets/{bottom-sheet-BX4KSkk6.js → bottom-sheet-DDC7O5sx.js} +1 -1
- package/assets/{brief-BudFNiO7.js → brief-Bs9H-S4e.js} +1 -1
- package/assets/brief-DJ5051HC.js +1 -0
- package/assets/calendar-BR-28-ej.js +1 -0
- package/assets/{calendar-D6a4XfwP.js → calendar-BYyDHpZa.js} +1 -1
- package/assets/calendar-event-popup-Clle6FA1.js +1 -0
- package/assets/{calendar-event-sidebar-DhwwreFW.js → calendar-event-sidebar-CPgDwmOs.js} +1 -1
- package/assets/{calendar-failure-note-CJWF9Bm9.js → calendar-failure-note-C9fIL_8K.js} +1 -1
- package/assets/{calendar-guests-D5tYwBA8.js → calendar-guests-DEOe1juO.js} +1 -1
- package/assets/calendar-suggestion-DVjK0aSt.js +1 -0
- package/assets/calendars-DaDEW0oA.js +1 -0
- package/assets/{card-BsZT3k9v.js → card-MWxaP_DH.js} +1 -1
- package/assets/{checkbox-C3Yttn2a.js → checkbox-jLurGcNS.js} +1 -1
- package/assets/chevron-down-B3lcZAVN.js +1 -0
- package/assets/chevron-left-B-i0rFYx.js +1 -0
- package/assets/{circle-check-Doz35Q_M.js → circle-check-QqmhC0RV.js} +1 -1
- package/assets/{circle-check-big-D9Wjhdx-.js → circle-check-big-ChJ8pH-b.js} +1 -1
- package/assets/{circle-help-B5DNH9Yv.js → circle-help-C9O6dqh6.js} +1 -1
- package/assets/{clock-D8iwoylV.js → clock-CNuf0kus.js} +1 -1
- package/assets/{cloud-off-B3IezOXr.js → cloud-off-C48CGroa.js} +1 -1
- package/assets/compose._-_outboxMessageId_-7cX9IraZ.js +1 -0
- package/assets/compose._-_outboxMessageId_-B4dAIiSz.js +1 -0
- package/assets/compose._-_outboxMessageId_-B8Bi18pS.js +1 -0
- package/assets/compose._-_outboxMessageId_-T4c20e76.js +1 -0
- package/assets/{config-import-CwIr-NJ5.js → config-import-BAWkCcKm.js} +1 -1
- package/assets/{confirm-dialog-DhdN2rki.js → confirm-dialog-CjHvZbGT.js} +1 -1
- package/assets/{copy-CtEwcw6R.js → copy-Ixy5ZR35.js} +1 -1
- package/assets/credential-steps-CREMZs9P.js +1 -0
- package/assets/{download-vcht0JNA.js → download-DCGyf3W_.js} +1 -1
- package/assets/draft-H1bLeWg_.js +1 -0
- package/assets/edit-BX860zdz.js +1 -0
- package/assets/edit-DvrV6duf.js +1 -0
- package/assets/{external-link-D5RMYJCY.js → external-link-kBeg4Rkl.js} +1 -1
- package/assets/{file-json-d4ZS8Wws.js → file-json-CxV9Z8Xk.js} +1 -1
- package/assets/filters-BqpcwwPd.js +1 -0
- package/assets/{flagged-BfctmA4r.js → flagged-Bjcd8w-O.js} +1 -1
- package/assets/flagged-DXwt3SZW.js +1 -0
- package/assets/folder-input-CmDkygvp.js +1 -0
- package/assets/folders-CeYrerQG.js +1 -0
- package/assets/{help-copy-PBpM2Nt-.js → help-copy-DLhRgp5W.js} +1 -1
- package/assets/import-yc3QynRF.js +1 -0
- package/assets/index-44Nd6hoS.js +1 -0
- package/assets/index-BafgExsO.js +1 -0
- package/assets/index-C3xB5mTr.js +1 -0
- package/assets/{index-CNLnhDIy.css → index-CMNnsfzR.css} +1 -1
- package/assets/index-D4ibfGR2.js +1 -0
- package/assets/index-D8uIyhWM.js +1 -0
- package/assets/index-DXydIDl3.js +1 -0
- package/assets/index-D_t--guV.js +1 -0
- package/assets/{index-D9rVZImU.js → index-DjF679iU.js} +11 -11
- package/assets/index-PazExuj-.js +1 -0
- package/assets/index-X3HUQEvM.js +213 -0
- package/assets/index-rv5AdzRX.js +1 -0
- package/assets/index-sIYPsGs_.js +1 -0
- package/assets/{kbd-Ba8uOP5b.js → kbd-DiYloCGE.js} +1 -1
- package/assets/label-chip-tLLbdHoz.js +1 -0
- package/assets/labels-DwqUITi6.js +1 -0
- package/assets/mail-CDuFGyaA.js +1 -0
- package/assets/mail-DxkYnpSf.js +1 -0
- package/assets/{menu-B9EpNfSt.js → menu-v-YxaQQ_.js} +1 -1
- package/assets/new-BrQZmpeT.js +1 -0
- package/assets/onboarding-DLvfj4LK.js +1 -0
- package/assets/{onboarding-completion-epwWc7r3.js → onboarding-completion-BG60cd5s.js} +1 -1
- package/assets/outbox-CZQb6qAX.js +1 -0
- package/assets/{pencil-CnNCN6P1.js → pencil-BnBK7tmS.js} +1 -1
- package/assets/people-OwHrHrdJ.js +1 -0
- package/assets/plus-GnqfNmfx.js +1 -0
- package/assets/{popover-menu-2YIsUsHr.js → popover-menu-J56UZVjI.js} +1 -1
- package/assets/{refresh-cw-Cr0O1tfh.js → refresh-cw-3jpeaUi7.js} +1 -1
- package/assets/reply-Bs_YhRF4.js +1 -0
- package/assets/{rich-text-BlVMVJea.js → rich-text-Bd-wRHu1.js} +3 -3
- package/assets/rich-text-spellcheck-worker-provider-Bnm0BFqL.js +1 -0
- package/assets/{rotate-ccw-fZQtnzhi.js → rotate-ccw-D8SF2xHr.js} +1 -1
- package/assets/{roving-focus-Di2-_Bi5.js → roving-focus-nxbliQos.js} +1 -1
- package/assets/{row-actions-FzEmQlCI.js → row-actions-YYjMjrwp.js} +1 -1
- package/assets/{search-mirror-Rg0rkpEY.js → search-mirror-DgYKzQ_z.js} +1 -1
- package/assets/search-scope-D_Xp19lV.js +1 -0
- package/assets/search-token-index-BIZzLNv9.js +1 -0
- package/assets/{sections-DPhyxq2e.js → sections-CRDaS4nn.js} +1 -1
- package/assets/segmented-control-DFN0EF39.js +1 -0
- package/assets/select-DaBof-xM.js +1 -0
- package/assets/senders-BReSWLlj.js +1 -0
- package/assets/settings-DXQ3zZlR.js +1 -0
- package/assets/settings-screen-DU3TjNi2.js +1 -0
- package/assets/{shield-check-DPCURbcU.js → shield-check-DZBDPqGc.js} +1 -1
- package/assets/{sparkles-CKGM5ogH.js → sparkles-DrZ81rOU.js} +1 -1
- package/assets/suggest-list-Bl5m8GjB.js +1 -0
- package/assets/{suggested-vips-CEDSSHCK.js → suggested-vips-CjpCfM-Q.js} +1 -1
- package/assets/suggestion._suggestionId-KbtftShf.js +1 -0
- package/assets/{task._calendarTaskId-COR3DmT4.js → task._calendarTaskId-CJNNC87Y.js} +1 -1
- package/assets/{undo-2-91d41Gxr.js → undo-2-DT3EdJen.js} +1 -1
- package/assets/{useCalendarData-D4cVUO0c.js → useCalendarData-CDMAl9sB.js} +1 -1
- package/assets/{useCalendarScheduling-BjOsYgtF.js → useCalendarScheduling-J13iQDXH.js} +1 -1
- package/assets/useCalendarSuggestions-BLiBIz-1.js +1 -0
- package/assets/{useCalendarTasks-vU39_Pqu.js → useCalendarTasks-DClcdx9Q.js} +1 -1
- package/assets/{useDebouncedValue-CCQodc3r.js → useDebouncedValue-CiTDV7kX.js} +1 -1
- package/assets/useFilters-D_mEdyEH.js +1 -0
- package/assets/useLabels-Beg-UxxE.js +1 -0
- package/assets/useLayoutTier-B5_piqNJ.js +1 -0
- package/assets/{useMediaQuery-eKKtffrD.js → useMediaQuery-9NJJDrX6.js} +1 -1
- package/assets/useMessageBodyContent-Dhtu6I6l.js +3 -0
- package/assets/useQueries-BO8eIXDf.js +1 -0
- package/assets/useRefreshControl-c8RtcGU3.js +1 -0
- package/assets/{useResultFolderIndex-Cn4PEyDR.js → useResultFolderIndex-CJrt60fl.js} +1 -1
- package/assets/useSignature-ZAeHuLA5.js +1 -0
- package/assets/{warnings-D0W4PYa1.js → warnings-CN1cP32K.js} +3 -3
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/BriefPane-IZ_xj1Lk.js +0 -1
- package/assets/CalendarEventEditor-DUg5gUNR.js +0 -1
- package/assets/CalendarEventPopup-BbBoaCKG.js +0 -1
- package/assets/CalendarQuickCreate-DVjhHPuJ.js +0 -1
- package/assets/DesktopChrome-CKI3QDy9.js +0 -1
- package/assets/LabelApplyTrigger-19lK6vLg.js +0 -1
- package/assets/MailShell-C3h8o0Po.js +0 -1
- package/assets/MailViewChrome-bMtbpNoZ.js +0 -1
- package/assets/MailboxPane-BO_DmR1T.js +0 -1
- package/assets/MessageBody-Dw2SMxor.js +0 -84
- package/assets/MessageToolbar-C4ylsZ_k.js +0 -1
- package/assets/NavMenuButton-BLH-0IxV.js +0 -1
- package/assets/OutboxPane-DuQ45_dm.js +0 -1
- package/assets/_calendarObjectId-Bu1gEdx4.js +0 -1
- package/assets/_mailboxId-DfmkdvY1.js +0 -1
- package/assets/_messageId-C16gKcH0.js +0 -1
- package/assets/_messageId-_anK-ruA.js +0 -1
- package/assets/_messageId-uhJG8cXc.js +0 -1
- package/assets/_outboxMessageId-CaSX9ZOS.js +0 -1
- package/assets/_recurrenceId-C3Qcwwvr.js +0 -1
- package/assets/_threadId-CstWlugv.js +0 -1
- package/assets/_threadId-DXKO9oGh.js +0 -1
- package/assets/_threadId-DwOOZ66z.js +0 -1
- package/assets/_view._date-Cp0fmpb2.js +0 -1
- package/assets/accounts-gJO9pQry.js +0 -1
- package/assets/advanced-UrNGfD9P.js +0 -1
- package/assets/appearance-BbURt4Vo.js +0 -1
- package/assets/brief-D2JSdiJk.js +0 -1
- package/assets/calendar-BlTUf0bx.js +0 -1
- package/assets/calendar-event-popup-BuR0xhCL.js +0 -1
- package/assets/calendar-suggestion-DRPyaTm4.js +0 -1
- package/assets/calendars-tQGYwNBq.js +0 -1
- package/assets/compose._-_outboxMessageId_-BPU3iogA.js +0 -1
- package/assets/compose._-_outboxMessageId_-BgVnlkG4.js +0 -1
- package/assets/compose._-_outboxMessageId_-BnsIRMLA.js +0 -1
- package/assets/compose._-_outboxMessageId_-CpaquYol.js +0 -1
- package/assets/credential-steps-dUNvV52R.js +0 -1
- package/assets/draft-Cn-cGLa8.js +0 -1
- package/assets/edit-B-28N5ki.js +0 -1
- package/assets/edit-OALDWD3A.js +0 -1
- package/assets/filters-DrX3DsrZ.js +0 -1
- package/assets/flagged-CU6IaMWI.js +0 -1
- package/assets/folders-0XOIE3da.js +0 -1
- package/assets/import-BTQvBLt4.js +0 -1
- package/assets/index-BHtOQW8x.js +0 -1
- package/assets/index-BoRZwOaB.js +0 -1
- package/assets/index-C0jxJ9rz.js +0 -1
- package/assets/index-C15-ASoN.js +0 -1
- package/assets/index-C16gKcH0.js +0 -1
- package/assets/index-DefW0u5m.js +0 -1
- package/assets/index-Dg1Qx5Zn.js +0 -1
- package/assets/index-IUjWbCxV.js +0 -1
- package/assets/index-JcHkcLZl.js +0 -349
- package/assets/index-fTiw_j5r.js +0 -1
- package/assets/index-uhJG8cXc.js +0 -1
- package/assets/labels-7qLNnQ4p.js +0 -1
- package/assets/mail-DfXdcXsx.js +0 -1
- package/assets/new-CQLfecpu.js +0 -1
- package/assets/onboarding-u4F7mHOL.js +0 -1
- package/assets/outbox-CQ-KfDPo.js +0 -1
- package/assets/people-Bp5zi0j-.js +0 -1
- package/assets/reply-Dh35Hqag.js +0 -1
- package/assets/rich-text-spellcheck-worker-provider-Bh7g2S3c.js +0 -1
- package/assets/search-scope-UI1H6AzA.js +0 -1
- package/assets/search-token-index-DKhKuetV.js +0 -1
- package/assets/senders-iDSnpdnW.js +0 -1
- package/assets/settings-C4JJ05jn.js +0 -1
- package/assets/settings-screen-B4Stef9n.js +0 -1
- package/assets/suggestion._suggestionId-B9utmB_0.js +0 -1
- package/assets/useCalendarSuggestions-DVLnDR0Q.js +0 -1
- package/assets/useFilters-bWTIYb6Z.js +0 -1
- package/assets/useLabels-ymrfdmw5.js +0 -1
- package/assets/useLayoutTier-BUzxktUV.js +0 -1
- package/assets/useMessageBodyContent-BwiAK6tQ.js +0 -1
- package/assets/useQueries-eyXujaLS.js +0 -1
- package/assets/useRefreshControl-DMEs8u4b.js +0 -1
- package/assets/useSignature-bFJVFu89.js +0 -1
package/assets/index-fTiw_j5r.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g2 as o,j as r}from"./index-JcHkcLZl.js";import{C as m}from"./CalendarEventPopup-BbBoaCKG.js";import"./confirm-dialog-DhdN2rki.js";import"./calendar-event-popup-BuR0xhCL.js";import"./pencil-CnNCN6P1.js";import"./useCalendarSuggestions-DVLnDR0Q.js";import"./ErrorState-BmfRU6e6.js";import"./useQueries-eyXujaLS.js";import"./calendar-guests-D5tYwBA8.js";import"./circle-help-B5DNH9Yv.js";import"./useCalendarTasks-vU39_Pqu.js";import"./useCalendarData-D4cVUO0c.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-Dh35Hqag.js";import"./useMediaQuery-eKKtffrD.js";import"./calendar-D6a4XfwP.js";import"./CalendarSession-BMeYMexj.js";function P(){const{calendarObjectId:t}=o.useParams();return r.jsx(m,{calendarObjectId:t})}export{P as component};
|
package/assets/index-uhJG8cXc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-JcHkcLZl.js";import{B as o}from"./BriefPane-IZ_xj1Lk.js";import"./MessageBody-Dw2SMxor.js";import"./kbd-Ba8uOP5b.js";import"./search-scope-UI1H6AzA.js";import"./reply-Dh35Hqag.js";import"./useMediaQuery-eKKtffrD.js";import"./useMessageBodyContent-BwiAK6tQ.js";import"./MessageToolbar-C4ylsZ_k.js";import"./roving-focus-Di2-_Bi5.js";import"./search-token-index-DKhKuetV.js";import"./useQueries-eyXujaLS.js";import"./EmptyState-CP5Vn2LS.js";import"./ErrorState-BmfRU6e6.js";import"./popover-menu-2YIsUsHr.js";import"./avatar-CxJjt5__.js";import"./index-D9rVZImU.js";import"./useSignature-bFJVFu89.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CCQodc3r.js";import"./sections-DPhyxq2e.js";import"./undo-2-91d41Gxr.js";import"./DropdownMenu-pEN-d7K3.js";import"./download-vcht0JNA.js";import"./calendar-suggestion-DRPyaTm4.js";import"./sparkles-CKGM5ogH.js";import"./useCalendarSuggestions-DVLnDR0Q.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-CJWF9Bm9.js";import"./checkbox-C3Yttn2a.js";import"./clock-D8iwoylV.js";import"./shield-check-DPCURbcU.js";import"./calendar-D6a4XfwP.js";import"./useLayoutTier-BUzxktUV.js";import"./menu-B9EpNfSt.js";import"./useFilters-bWTIYb6Z.js";import"./cloud-off-B3IezOXr.js";import"./confirm-dialog-DhdN2rki.js";import"./useRefreshControl-DMEs8u4b.js";import"./circle-check-big-D9Wjhdx-.js";import"./refresh-cw-Cr0O1tfh.js";import"./LabelApplyTrigger-19lK6vLg.js";import"./useLabels-ymrfdmw5.js";import"./wizard-selection-zWa1qc6-.js";function U(){return r.jsx(o.Reading,{})}export{U as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,j as e,av as h,bg as y,au as b,bH as g,B as v,T as N,u as C,aK as L,a as I,c as D,aN as S,d as w}from"./index-JcHkcLZl.js";import{C as $}from"./confirm-dialog-DhdN2rki.js";import{E as j}from"./ErrorState-BmfRU6e6.js";import{S as E}from"./settings-screen-B4Stef9n.js";import{a as k,b as R,c as T,u as O}from"./useLabels-ymrfdmw5.js";import"./avatar-CxJjt5__.js";import"./menu-B9EpNfSt.js";import"./circle-help-B5DNH9Yv.js";function B({labels:l,onRename:n,onRecolor:i,onDelete:u,deletingLabelId:r}){const[m,o]=f.useState(),[c,d]=f.useState("");if(l.length===0)return e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No labels yet. Create one below, then use it in a filter or apply it to mail directly."});const s=t=>{const a=c.trim();a!==""&&n(t,a),o(void 0)};return e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:l.map(t=>e.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[m===t.labelId?e.jsx(h,{autoFocus:!0,value:c,onChange:a=>d(a.target.value),onBlur:()=>s(t.labelId),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),s(t.labelId)),a.key==="Escape"&&(a.preventDefault(),o(void 0))},"aria-label":`Rename label ${t.name}`}):e.jsx("button",{type:"button",onClick:()=>{o(t.labelId),d(t.name)},"aria-label":`Rename label ${t.name}`,className:"flex items-center gap-2 rounded-sm text-left hover:opacity-80",children:e.jsx(y,{label:t})}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-subtle",children:t.filterCount===0?"Not used in any filter":`Used in ${t.filterCount} ${t.filterCount===1?"filter":"filters"}`})]}),e.jsx(b,{"aria-label":`Color for ${t.name}`,value:t.color,onChange:a=>i(t.labelId,a.target.value),className:"w-28 shrink-0",children:g.map(a=>e.jsx("option",{value:a,children:a},a))}),e.jsx(v,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4 text-danger"}),onClick:()=>u(t),disabled:r===t.labelId,"aria-label":`Delete label ${t.name}`})]},t.labelId))})}const P=(l,n)=>{if(n===0)return{title:`Delete the "${l}" label?`};const i=n===1?"filter":"filters";return{title:`Delete the "${l}" label?`,description:`This also deletes ${n} ${i} that ${n===1?"applies":"apply"} it — they can't be recovered.`}},H=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Labels mark mail without moving it — a message can carry any number of them alongside whichever folder it lives in."}),e.jsx("p",{children:"Use a label in a filter's action to have new (and existing) mail label itself automatically, or apply one to a selection directly from the mailbox."}),e.jsx("p",{children:"Deleting a label removes it from every message, and deletes every filter that applies it — the confirmation names how many."})]});function K({accountId:l}){const{createLabel:n,isPending:i,isError:u}=O(l),[r,m]=f.useState(""),[o,c]=f.useState("Default"),d=()=>{const s=r.trim();s!==""&&n(s,o).then(()=>{m(""),c("Default")})};return e.jsxs("div",{className:"space-y-2 rounded-sm border border-line bg-surface p-3",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"New label"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Name"}),e.jsx(h,{value:r,onChange:s=>m(s.target.value),placeholder:"e.g. Receipts","aria-label":"Label name",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),d())}})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Color"}),e.jsx(b,{value:o,onChange:s=>c(s.target.value),"aria-label":"Label color",className:"w-28",children:g.map(s=>e.jsx("option",{value:s,children:s},s))})]}),e.jsx(v,{variant:"primary",onClick:d,disabled:i||r.trim()==="",children:i?"Creating…":"Create label"})]}),u&&e.jsx(w,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function U({account:l}){const n=l.accountId,{labels:i,isPending:u,isError:r,error:m,refetch:o}=k(n),{updateLabel:c}=R(n),{deleteLabel:d,deletingLabelId:s}=T(n),[t,a]=f.useState();return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:l.email}),u?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading labels for ${l.email}`}):r?e.jsx(j,{variant:"inline",title:`Couldn't load labels for ${l.email}`,error:m,onRetry:()=>{o()}}):e.jsx(B,{labels:i,onRename:(p,x)=>c(p,{name:x}),onRecolor:(p,x)=>c(p,{color:x}),onDelete:a,deletingLabelId:s}),e.jsx(K,{accountId:n}),t&&(()=>{const p=P(t.name,t.filterCount);return e.jsx($,{isOpen:!0,title:p.title,description:p.description,confirmLabel:"Delete label",destructive:!0,isBusy:s===t.labelId,onConfirm:()=>{d(t.labelId),a(void 0)},onCancel:()=>a(void 0)})})()]})}function J(){const l=C(),n=L(),[i,u]=f.useState(!0),{data:r,isPending:m,isError:o,error:c,refetch:d}=I(D()),s=t=>{const a=S[t];a&&l({to:a})};return e.jsx(E,{items:n,activeId:"labels",title:"Labels",description:"Mark mail without moving it, per account.",help:H,helpOpen:i,onToggleHelp:()=>u(t=>!t),onSelect:s,onBackToMail:()=>{l({to:"/mail"})},children:m?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):o?e.jsx(j,{title:"Couldn't load accounts",error:c,onRetry:()=>{d()}}):r.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:r.accounts.map(t=>e.jsx(U,{account:t},t.accountId))})})}export{J as component};
|
package/assets/mail-DfXdcXsx.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as Me,j as e,r as p,o as Ee,p as Pe,D as Le,X as Te,q as I,C as Fe,S as oe,t as Q,v as q,w as re,x as ie,F as Ae,T as ze,y as De,M as _e,z as Be,E as Ke,I as Qe,G as le,B as E,H as ce,J as qe,K as He,N as ue,f as B,P as de,Q as me,R as $e,U as Ve,V as Ue,W as xe,a as fe,Y as We,Z as Ge,_ as z,$ as Ye,a0 as Je,a1 as Xe,a2 as Ze,a3 as es,a4 as ss,a5 as ts,a6 as as,a7 as ns,u as os,c as rs,a8 as is,O as ls}from"./index-JcHkcLZl.js";import{E as cs}from"./ErrorState-BmfRU6e6.js";import{K as us,B as ds,S as ms,u as xs,s as fs,b as ps,a as hs,c as gs,d as bs}from"./search-token-index-DKhKuetV.js";import{K as H}from"./kbd-Ba8uOP5b.js";import{u as vs,l as O,a as D,m as $,b as ys,c as js,N as C,d as Ns,e as Ss,i as Cs,f as Is}from"./reply-Dh35Hqag.js";import{A as ws,S as pe,a as Os,c as ks,L as Rs,b as Ms,D as Es,d as Ps}from"./DesktopChrome-CKI3QDy9.js";import{P as Ls}from"./pencil-CnNCN6P1.js";import{u as K,a as Ts}from"./useMessageBodyContent-BwiAK6tQ.js";import{c as Fs,s as As,M as zs}from"./MailShell-C3h8o0Po.js";import{u as Ds,a as _s,R as Bs,s as Ks,i as Qs,H as qs,M as Hs}from"./useRefreshControl-DMEs8u4b.js";import{M as $s}from"./menu-B9EpNfSt.js";import{B as he,u as Vs}from"./useResultFolderIndex-Cn4PEyDR.js";import{u as Us}from"./sections-DPhyxq2e.js";import{u as Ws}from"./roving-focus-Di2-_Bi5.js";import{C as Gs,A as Ys}from"./account-service-status-DbTLkFuz.js";import{S as Js}from"./sparkles-CKGM5ogH.js";import{u as ge}from"./useQueries-eyXujaLS.js";import{f as Xs}from"./folder-failure-CqkVSsrb.js";import{i as Zs}from"./outbox-status-BlKn6P0x.js";import{u as et}from"./index-D9rVZImU.js";import{u as be,i as st}from"./useLayoutTier-BUzxktUV.js";import{u as tt}from"./useDebouncedValue-CCQodc3r.js";import"./search-scope-UI1H6AzA.js";import"./useMediaQuery-eKKtffrD.js";import"./avatar-CxJjt5__.js";import"./popover-menu-2YIsUsHr.js";import"./shield-check-DPCURbcU.js";import"./FullCompose-YhsG0MQv.js";import"./confirm-dialog-DhdN2rki.js";import"./circle-check-big-D9Wjhdx-.js";import"./refresh-cw-Cr0O1tfh.js";import"./useSignature-bFJVFu89.js";import"./account-form-helpers-DhckT_PN.js";const at=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function nt({onCompose:s}){return e.jsx("button",{type:"button",onClick:s,"aria-label":"Compose new message",className:"lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all",style:{bottom:"calc(var(--app-tab-bar, 0px) + env(safe-area-inset-bottom, 0px) + 1rem)"},children:e.jsx(Ls,{className:"size-6"})})}const ot=({isOpen:s,onClose:t})=>{const a=p.useRef(null);return Ee({id:"shortcuts",open:s,answers:{back:t}}),Pe(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Le,{label:"Dismiss keyboard shortcuts",onDismiss:t,className:"backdrop-blur-sm"}),e.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",tabIndex:-1,className:I("relative z-10 max-h-[85vh] w-full max-w-2xl overflow-y-auto","rounded-lg border border-line bg-surface shadow-lg","p-6"),children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard shortcuts"}),e.jsx("button",{type:"button",onClick:t,className:"p-1 text-fg-muted transition-colors hover:text-fg","aria-label":"Close",children:e.jsx(Te,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:us.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(o=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:o.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:o.keys.map((r,c)=>e.jsxs(p.Fragment,{children:[c>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(H,{children:r})]},r))})]},`${o.action}-${o.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx(H,{children:"Esc"})," to close"]})})]})]}):null},rt="button:not([disabled]), a[href]",P="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function it({active:s,dimmed:t,indent:a}){return I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",P,a&&"pl-7",s?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg",t&&"opacity-55")}function lt({icon:s,label:t,count:a,active:n,failure:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:I("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:s}),e.jsx("span",{className:"flex-1 truncate",children:t}),o&&e.jsx(re,{className:"size-3.5 shrink-0 text-danger","aria-hidden":"true"}),a!=null&&a>0&&e.jsx("span",{className:I("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function w({icon:s,label:t,count:a,active:n,dimmed:o,indent:r,navId:c,linkComponent:u,ariaLabel:x,title:d,failure:h,onClick:y}){const g=it({active:n,dimmed:o,indent:r}),l=e.jsx(lt,{icon:s,label:t,count:a,active:n,failure:h}),v=x??t,m=h?`${v} — ${h}`:v,f=h?`${d??t} — ${h}`:d;return c&&u?u({navId:c,className:g,ariaLabel:m,title:f,onClick:y,children:l}):e.jsx("button",{type:"button",onClick:y,className:g,"aria-label":h?m:x,title:f,children:l})}const V={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function ct(s){switch(s){case"inbox":return e.jsx(Qe,{className:"size-4"});case"flagged":return e.jsx(oe,{className:"size-4"});case"drafts":return e.jsx(Ke,{className:"size-4"});case"sent":return e.jsx(ie,{className:"size-4"});case"archive":return e.jsx(Be,{className:"size-4"});case"all":return e.jsx(_e,{className:"size-4"});case"junk":return e.jsx(De,{className:"size-4"});case"trash":return e.jsx(ze,{className:"size-4"})}}const U=s=>s.role!=null,A=8,W="remit.nav.folders.open.",G="remit.nav.account.open.";function Y(s,t,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}function J(s,t,a){typeof localStorage>"u"||localStorage.setItem(s+t,a?"1":"0")}function ut({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,r]=p.useState(()=>Y(G,s.id,!0)),[c,u]=p.useState(()=>Y(W,s.id,!0)),[x,d]=p.useState(!1),h=()=>{r(i=>{const j=!i;return J(G,s.id,j),j})},y=()=>{u(i=>{const j=!i;return J(W,s.id,j),j})},g=s.mailboxes.filter(U).sort((i,j)=>V[i.role]-V[j.role]),l=s.mailboxes.filter(i=>!U(i)),v=x||l.length<=A?l:l.slice(0,A),m=l.length-v.length,f=s.status??"ready",b=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),N=f==="ready"&&g.length===0&&l.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:h,"aria-expanded":o,className:I("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",P,s.muted&&"opacity-55"),children:[o?e.jsx(Q,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(q,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:s.label}),s.muted&&e.jsxs(e.Fragment,{children:[e.jsx(ds,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]}),b&&e.jsxs(e.Fragment,{children:[e.jsx(Gs,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:Ys.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[f==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),f==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(re,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),s.onRetry&&e.jsx("button",{type:"button",onClick:s.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),N&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),f==="ready"&&e.jsxs(e.Fragment,{children:[g.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:ct(i.role),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),s.outboxPending!==void 0&&e.jsx(w,{navId:"outbox",linkComponent:n,icon:e.jsx(ie,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:s.outboxPending>0?s.outboxPending:void 0,active:t==="outbox",dimmed:s.muted,onClick:()=>a?.("outbox")}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:y,"aria-expanded":c,className:I("mt-1 flex w-full items-center gap-1 px-2 py-1 text-left text-2xs font-semibold uppercase tracking-wider text-fg-subtle transition-colors hover:text-fg",P),children:[c?e.jsx(Q,{className:"size-3 shrink-0"}):e.jsx(q,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:l.length})]}),c&&e.jsxs(e.Fragment,{children:[v.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:e.jsx(Ae,{className:"size-4"}),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),(m>0||x)&&l.length>A&&e.jsx("button",{type:"button",onClick:()=>d(i=>!i),className:I("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",P),children:x?"Show less":`Show all (${l.length})`})]})]})]})]})]})}function dt({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:r,calendarNav:c="hidden"}){const u=p.useRef(null);Ws({containerRef:u,itemSelector:rt});const x=o==="drawer",d=e.jsxs("nav",{ref:x?u:void 0,className:x?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(w,{navId:"brief",linkComponent:r,icon:e.jsx(Js,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),c==="shown"&&e.jsx(w,{navId:"calendar",linkComponent:r,icon:e.jsx(Fe,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(w,{navId:"flagged",linkComponent:r,icon:e.jsx(oe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:t==="flagged",onClick:()=>n?.("flagged")}),s.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):s.map(h=>e.jsx(ut,{account:h,selectedNavId:t,onSelectNav:n,linkComponent:r},h.id))]});return x?d:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:d})}function mt(){const s=le();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx($s,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const xt={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ft({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:r,refreshControl:c,account:u}){return e.jsx(ws,{leading:e.jsx(mt,{}),search:e.jsx(ms,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:xt[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(at,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(he,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(ce,{label:o,children:e.jsx(pe,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),c,u]})})}function pt(){const{pathname:s}=vs(),t=qe({from:"/mail/$mailboxId",shouldThrow:!1});return O(s,"/settings")?"settings":O(s,"/calendar")?"calendar":O(s,"/mail/outbox")?"outbox":O(s,"/mail/flagged")?"flagged":O(s,"/mail/brief")?"brief":t?.mailboxId??""}function ht(){const s=He(),t=D({select:d=>$(d.location.pathname)}),a=D({select:d=>ys(d.location.search)}),[n,o]=p.useState(a),r=tt(n,200),[c,u]=p.useState(t);if(c!==t){const d=As(c,t,a);u(t),d!==void 0&&o(d)}const x=p.useCallback(d=>{u($(s.state.location.pathname)),o(d)},[s]);return{searchInput:n,committedQuery:Fs(n,r),viewKey:t,setSearchInput:x}}const gt=()=>{const s=K();return js()?null:e.jsx(nt,{onCompose:s})};function X({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:r}=ue(),c=B(),u=Us(),x=K(),{scope:d,clearScope:h}=xs(s),y=de(),g=d.kind==="scoped"?[{id:d.chip.id,label:d.chip.label,tone:"scope"}]:void 0,l=p.useMemo(()=>s.map(N=>N.accountId),[s]),{hasNewMail:v}=Ds(),{state:m,errorMessage:f,refresh:b}=_s(l,{onSettled:()=>$e(c,Ve(r.keys()))});return e.jsx(ft,{search:{value:t,scope:d.kind,chips:g,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:h},onCompose:x,onReportBug:me,onOpenSettings:()=>u("accounts"),settingsAttention:y,composeShortcut:fs("compose"),refreshControl:e.jsx(Bs,{state:m,onRefresh:b,label:"Refresh all accounts",errorMessage:f,hasUpdate:v(l)}),account:e.jsx(Os,{})})}function bt(){return e.jsxs("button",{type:"button",onClick:me,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg",children:[e.jsx(he,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const Z=s=>/^\d/.test(s),vt=(s,t)=>{const a=Z(s),n=Z(t);return a&&!n?-1:!a&&n?1:s.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})};function yt(s,t,a){const n=[],o=[];for(const r of s)t.has(r.mailboxId)?n.push(r):o.push(r);return o.sort((r,c)=>vt(z(r,void 0,a),z(c,void 0,a))),{system:n,labels:o}}function jt(s,t,a){const n=Ye(t)&&s.unseenCount>0;return{id:s.mailboxId,name:z(s,t,a),unseen:n?s.unseenCount:void 0,role:t,fullPath:s.fullPath,failure:Xs(s)}}function ee({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=B(),o=pt(),{onSearchChange:r}=ue(),{t:c}=Ue("mail",{useSuspense:!1}),u=p.useCallback((m,f)=>c(m,{defaultValue:f}),[c]),x=ge({queries:s.map(m=>({...xe({path:{accountId:m.accountId}}),staleTime:1/0}))}),{data:d}=fe(We()),h=p.useMemo(()=>(d?.items??[]).filter(m=>Zs(m.status)).length,[d?.items]),y=p.useMemo(()=>s.map((m,f)=>{const b=x[f],N=b?.data?.items??[],i=Ge(m.folderAppointments),{system:j,labels:L}=yt(N,i,u),T=b?.isError?"error":b?.isLoading?"loading":"ready";return{id:m.accountId,label:m.email,email:m.email,muted:!!m.muted,outboxPending:h,status:T,onRetry:()=>b?.refetch(),mailboxes:[...j,...L].map(k=>jt(k,i.get(k.mailboxId),u))}}),[s,x,h,u]),g=m=>{n.invalidateQueries({queryKey:Je({path:{mailboxId:m},query:{order:"desc"}})})},l=({navId:m,className:f,ariaLabel:b,title:N,children:i,onClick:j})=>m==="brief"?e.jsx(C,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="calendar"?e.jsx(C,{to:"/calendar",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="outbox"?e.jsx(C,{to:"/mail/outbox",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="flagged"?e.jsx(C,{to:"/mail/flagged",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="settings"?e.jsx(C,{to:"/settings/accounts",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):e.jsx(C,{to:"/mail/$mailboxId",params:{mailboxId:m},search:{q:void 0},onClick:()=>{g(m),j?.()},className:f,"aria-label":b,title:N,children:i}),v=()=>{r(""),t?.()};return e.jsx(dt,{accounts:y,selectedNavId:o,onSelectNav:v,linkComponent:l,variant:a})}function Nt({accounts:s,onMailboxSelect:t}){const n=le()?.showNavPane??!0,o=de();return n?e.jsx(ee,{accounts:s}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(ee,{accounts:s,onMailboxSelect:t,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(C,{to:"/settings/accounts",onClick:t,children:[e.jsx(ce,{label:o,children:e.jsx(pe,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(bt,{}),e.jsx(ks,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{t?.(),r()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(Rs,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function St(s){const t=ge({queries:s.map(a=>({...xe({path:{accountId:a.accountId}}),staleTime:1/0}))});return p.useMemo(()=>ps(t.map(a=>a.data?.items??[])),[t])}const ve="remit:intelligence-open";function Ct(){try{return localStorage.getItem(ve)!=="closed"}catch{return!0}}function It(s){try{localStorage.setItem(ve,s?"open":"closed")}catch{}}function se({panels:s,prefersOpen:t,isDesktop:a,hasThread:n,raisedFor:o,openMessage:r}){if(o!==null&&o===r)return!0;const c=s.filter(u=>u!=="sidebar");return c.length>0?c.includes("intelligence"):a&&n&&t}const wt=()=>{const s=be(),t=Ns(),a=Ss(),n=t.find(Cs),o=hs(),[r,c]=p.useState(Ct),u=o?`${o.threadId}/${o.messageId??""}`:null,[x,d]=p.useState(null),h={panels:t,prefersOpen:r,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},y=se({...h,raisedFor:x}),g=se({...h,raisedFor:null}),l=p.useCallback((b,N)=>{a([...b?["intelligence"]:[],...N?[N]:[]])},[a]),v=p.useCallback(b=>{l(g,b)},[g,l]),m=p.useCallback(()=>{if(y&&!g){d(null);return}const b=!y;It(b),c(b),d(null),l(b,n)},[g,y,n,l]),f=p.useCallback(()=>{d(u)},[u]);return{openOverlay:n,intelligenceOpen:y,showOverlay:v,toggleIntelligence:m,raiseIntelligence:f}};var R={exports:{}},te;function Ot(){if(te)return R.exports;te=1;const s=(t,a,n)=>new Promise((o,r)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:c}=n;if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);const u=[],x=t[Symbol.iterator]();let d=!1,h=!1,y=0,g=0;const l=()=>{if(d)return;const v=x.next(),m=g;if(g++,v.done){h=!0,y===0&&o(u);return}y++,Promise.resolve(v.value).then(f=>a(f,m)).then(f=>{u[m]=f,y--,l()},f=>{d=!0,r(f)})};for(let v=0;v<c&&(l(),!h);v++);});return R.exports=s,R.exports.default=s,R.exports}var kt=Ot();const Rt=Xe(kt),Mt=900*1e3,Et=30,Pt=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},Lt=30*1e3,Tt=s=>Math.max(Pt(s,Et)*1e3,Lt),ye=Tt(ns().mailboxPollIntervalSeconds),M=(s=Date.now(),t=ye)=>Qs(s)?Math.min(qs,t):t,Ft=5,_=new Set,At=(s,t,a=Mt)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),zt=(s,t,a=ye)=>s-t>=a,Dt=(s,t)=>s.filter(a=>!t.has(a)),ae=(s,t)=>{if(_.delete(s),ss(t)||ts(t,{softError:!0})){as(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ne=(s,t)=>Ze({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:es({path:{accountId:s}})})}),_t=s=>{const t=B(),a=p.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");p.useEffect(()=>{const o=Date.now(),c=At(a.current,o).filter(u=>!_.has(u));if(c.length!==0)for(const u of c)_.add(u),ne(u,t).catch(x=>{ae(u,x)})},[n,t]),p.useEffect(()=>{let o=Date.now(),r;const c=new Set,u=()=>{o=Date.now();const g=Dt(a.current.map(l=>l.accountId),c);for(const l of g)c.add(l);Rt(g,l=>ne(l,t).catch(v=>{ae(l,v)}).finally(()=>{c.delete(l)}),{concurrency:Ft})},x=()=>{if(document.visibilityState==="visible"){u(),r=setTimeout(x,M());return}},d=()=>{if(document.visibilityState!=="visible")return;r!==void 0&&clearTimeout(r);const g=Date.now(),l=M(g);if(zt(g,o,l)){u(),r=setTimeout(x,l);return}r=setTimeout(x,o+l-g)},h=()=>{document.visibilityState==="visible"&&(r!==void 0&&clearTimeout(r),o=Date.now(),r=setTimeout(x,M()))};r=setTimeout(x,M()),document.addEventListener("visibilitychange",d);const y=Ks(h);return()=>{r!==void 0&&clearTimeout(r),document.removeEventListener("visibilitychange",d),y()}},[n,t])};function va(){const s=os(),t=be(),a=st(t),{openOverlay:n,intelligenceOpen:o,showOverlay:r,toggleIntelligence:c,raiseIntelligence:u}=wt(),x=n==="shortcuts",d=n==="nav",{searchInput:h,committedQuery:y,viewKey:g,setSearchInput:l}=ht(),{data:v,isLoading:m,isError:f,error:b,refetch:N}=fe({...rs(),staleTime:1/0}),i=!!(v&&(v.accounts?.length??0)===0);p.useEffect(()=>{i&&s({to:"/onboarding",replace:!0})},[i,s]),et({enabled:!x,bindings:[{key:"?",action:"help",handler:()=>r("shortcuts"),noModifiers:!1,preventDefault:!0}]});const j=K(),L=Ts(),T=D({select:F=>Is(F.matches)?.list==="mailbox"}),k=p.useMemo(()=>({compose:j}),[j]);gs({enabled:!T&&!L,handlers:k});const je=p.useCallback(()=>{l("")},[l]),Ne=p.useCallback(()=>{l("")},[l]),S=v?.accounts??[],Se=p.useMemo(()=>S.map(F=>F.accountId),[S]),Ce=St(S),Ie=Vs(S).index,we=p.useMemo(()=>bs(S),[S]);_t(S);const Oe=p.useCallback(()=>{n==="nav"&&r(void 0)},[n,r]),ke={accounts:S,mailboxNameIndex:Ce,accountNameIndex:we,resultFolderIndex:Ie,searchQuery:y,searchInput:h,searchViewKey:g,onSearchChange:l,onSearchClear:je,onSearchClearQuery:Ne,intelligenceOpen:o,onToggleIntelligence:c,onRaiseIntelligence:u},Re={isSinglePane:a,isLoading:m||i,intelligenceOpen:o,nav:e.jsx(Nt,{accounts:S,onMailboxSelect:Oe}),topBar:a?void 0:e.jsx(X,{accounts:S}),appBar:t==="phone"?void 0:e.jsx(Ps,{}),overlay:a?e.jsx(gt,{}):void 0,navOpen:d,onOpenNav:()=>r("nav"),onCloseNav:()=>r(void 0)};return e.jsx(is.Provider,{value:ke,children:e.jsxs(Hs,{accountIds:Se,children:[e.jsx(Ms,{children:f?e.jsx(Es,{topBar:e.jsx(X,{accounts:S}),children:e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(cs,{title:"Couldn't load your account",error:b,onRetry:()=>{N()}})})}):e.jsx(zs,{chrome:Re,children:e.jsx(ls,{})})}),e.jsx(ot,{isOpen:x,onClose:()=>r(void 0)})]})})}export{va as component,ue as useMailContext};
|
package/assets/new-CQLfecpu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./CalendarEventEditor-DUg5gUNR.js";import"./index-JcHkcLZl.js";import"./confirm-dialog-DhdN2rki.js";import"./calendar-event-popup-BuR0xhCL.js";import"./pencil-CnNCN6P1.js";import"./useCalendarSuggestions-DVLnDR0Q.js";import"./ErrorState-BmfRU6e6.js";import"./useQueries-eyXujaLS.js";import"./calendar-event-sidebar-DhwwreFW.js";import"./calendar-guests-D5tYwBA8.js";import"./circle-help-B5DNH9Yv.js";import"./useCalendarData-D4cVUO0c.js";import"./useCalendarTasks-vU39_Pqu.js";import"./draft-Cn-cGLa8.js";import"./useCalendarScheduling-BjOsYgtF.js";import"./useDebouncedValue-CCQodc3r.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-Dh35Hqag.js";import"./useMediaQuery-eKKtffrD.js";import"./calendar-D6a4XfwP.js";import"./CalendarQuickCreate-DVjhHPuJ.js";import"./CalendarSession-BMeYMexj.js";const h=o;export{h as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n,f as i,u as a,r as m,j as s}from"./index-JcHkcLZl.js";import{O as p}from"./OnboardingWizard-DADGyMEc.js";import{c}from"./onboarding-completion-epwWc7r3.js";import"./checkbox-C3Yttn2a.js";import"./kbd-Ba8uOP5b.js";import"./credential-steps-dUNvV52R.js";import"./card-BsZT3k9v.js";import"./account-form-helpers-DhckT_PN.js";import"./file-json-d4ZS8Wws.js";function O(){const o=n(),e=i(),t=a(),r=m.useCallback(l=>{c({queryClient:e,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[o,e]);return s.jsx(p,{skipWelcome:!1,onComplete:r,onImportConfig:()=>{t({to:"/import"})}})}export{O as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,O as i}from"./index-JcHkcLZl.js";import{a as m}from"./MailShell-C3h8o0Po.js";import{u as p,O as t}from"./OutboxPane-DuQ45_dm.js";import"./reply-Dh35Hqag.js";import{u as s}from"./search-mirror-Rg0rkpEY.js";import"./useMessageBodyContent-BwiAK6tQ.js";import"./FullCompose-YhsG0MQv.js";import"./ErrorState-BmfRU6e6.js";import"./index-D9rVZImU.js";import"./useSignature-bFJVFu89.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CCQodc3r.js";import"./sections-DPhyxq2e.js";import"./useMediaQuery-eKKtffrD.js";import"./confirm-dialog-DhdN2rki.js";import"./roving-focus-Di2-_Bi5.js";import"./MessageBody-Dw2SMxor.js";import"./kbd-Ba8uOP5b.js";import"./search-scope-UI1H6AzA.js";import"./circle-check-big-D9Wjhdx-.js";import"./clock-D8iwoylV.js";import"./row-actions-FzEmQlCI.js";import"./rotate-ccw-fZQtnzhi.js";import"./NavMenuButton-BLH-0IxV.js";import"./menu-B9EpNfSt.js";import"./outbox-status-BlKn6P0x.js";function w(){const r=p();return s({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(i,{})})})}export{w as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as D,f as I,g as O,bI as T,bJ as E,bK as R,bL as A,bM as L,bN as F,bO as z,bP as v,r as c,j as e,aI as k,B as m,X as M,aw as U,bQ as g,bR as _,ax as B,bS as H,d as b,bT as K,bU as C,bV as w,u as Q,aK as G,aN as W}from"./index-JcHkcLZl.js";import{S as Y}from"./settings-screen-B4Stef9n.js";import{D as q,a as h,b as $}from"./DropdownMenu-pEN-d7K3.js";import{C as J}from"./copy-CtEwcw6R.js";import"./avatar-CxJjt5__.js";import"./menu-B9EpNfSt.js";import"./circle-help-B5DNH9Yv.js";const V=D("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),X=async({action:s,person:t},r)=>{const n={userId:t.userId};if(s==="SignOut"){const{data:a}=await L({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a,resetUrl:void 0}}if(s==="ResetPassword"){const{data:a}=await F({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a.person,resetUrl:a.resetUrl}}const{data:o}=await z({path:n,body:{status:s==="Disable"?"Disabled":"Active",stepUpToken:r},throwOnError:!0});return{person:o,resetUrl:void 0}},Z=s=>{const t=I();return O({meta:T,gcTime:0,mutationFn:async r=>{const{data:n}=await A({body:{password:s,action:r.action,userId:r.person.userId},throwOnError:!0});return X(r,n.stepUpToken)},onSuccess:({person:r})=>{t.setQueryData(E(),n=>n&&{people:R(n.people,r)})}})},ee="That is not your password. Try again.",se="Five wrong passwords in 15 minutes. Wait 15 minutes, then try again.";function te({action:s,person:t,onCancel:r,onDone:n,onFailed:o}){const a=v(s,t.email),[l,p]=c.useState(""),[u,x]=c.useState(null),i=Z(l),d=()=>{i.isPending||r()},P=f=>{f.preventDefault(),!(i.isPending||l==="")&&(x(null),i.mutate({action:s,person:t},{onSuccess:n,onError:y=>{const j=g(y);if(j.kind==="wrongPassword"){p(""),x(ee);return}if(j.kind==="locked"){p(""),x(se);return}if(j.kind==="signedOut"){r(),_();return}o(y)}}))};return e.jsx(k,{open:!0,onClose:d,title:a.title,children:e.jsxs("form",{onSubmit:P,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:a.title}),e.jsx(m,{variant:"ghost",size:"sm",icon:e.jsx(M,{className:"size-3.5"}),onClick:d,"aria-label":"Close"})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:a.body}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"people-step-up-password",className:"text-xs font-medium text-fg",children:"Your password"}),e.jsx(U,{id:"people-step-up-password",autoComplete:"current-password",value:l,onChange:f=>{p(f.target.value),x(null)},"aria-invalid":u!==null,"aria-describedby":"people-step-up-hint",required:!0}),e.jsx("p",{id:"people-step-up-hint",className:"text-xs",children:u?e.jsx("span",{className:"text-danger",role:"alert",children:u}):"Confirm with your own password. It counts for this one action."})]})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(m,{variant:"secondary",size:"sm",onClick:d,children:"Cancel"}),e.jsx(m,{type:"submit",variant:a.destructive?"danger":"primary",size:"sm",disabled:l==="","aria-busy":i.isPending,children:a.confirmLabel})]})]})})}const ne=()=>{};function re({email:s,resetUrl:t,onDone:r}){const[n,o]=c.useState(!1),[a,l]=c.useState(!1),p=()=>{navigator.clipboard.writeText(t).then(()=>{l(!1),o(!0)}).catch(()=>l(!0))};return e.jsxs(k,{open:!0,onClose:ne,title:`Reset link for ${s}`,children:[e.jsxs("header",{className:"border-b border-line px-5 py-3 text-sm font-semibold text-fg",children:["Reset link for ",s]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:"They are signed out everywhere. Give them this link, by message or in person. It works once, for 24 hours."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx(m,{variant:"primary",size:"sm",icon:n?e.jsx(B,{className:"size-3.5"}):e.jsx(J,{className:"size-3.5"}),onClick:p,children:n?"Copied":"Copy"}),e.jsx("input",{readOnly:!0,tabIndex:-1,value:t,"aria-label":`Reset link for ${s}`,onFocus:u=>u.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg sm:order-first"})]}),a&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:"Copying did not work in this browser. Select the link and copy it by hand."}),e.jsx("p",{children:"You see this link only now. Close this window and it is gone. Make a new one if it gets lost."})]}),e.jsx("footer",{className:"flex justify-end border-t border-line px-5 py-3",children:e.jsx(m,{variant:"secondary",size:"sm",onClick:r,children:"Done"})})]})}const N="The list of people did not load";function S({href:s}){return e.jsx("a",{href:s,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})}function ae({failure:s}){const t=c.useRef(null);return c.useEffect(()=>{t.current?.focus()},[]),e.jsx("div",{ref:t,tabIndex:-1,className:"outline-none",children:e.jsxs(b,{tone:"danger",children:[e.jsx("p",{className:"font-medium",children:s.title}),e.jsx("p",{className:"mt-1 text-fg-muted",children:s.reason}),e.jsx("p",{className:"mt-1",children:e.jsx(S,{href:C(s.title,s.error)})})]})})}function oe({person:s,onPick:t}){const r=s.status==="Disabled";return e.jsxs(q,{trigger:e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"size-4","aria-hidden":"true"}),e.jsxs("span",{className:"sr-only",children:["Actions for ",s.email]})]}),children:[e.jsx(h,{onClick:()=>t("SignOut"),children:"Sign out everywhere"}),e.jsx(h,{onClick:()=>t("ResetPassword"),children:"Reset password"}),e.jsx($,{}),r?e.jsx(h,{onClick:()=>t("Enable"),children:"Enable"}):e.jsx(h,{onClick:()=>t("Disable"),disabled:s.isCaller,destructive:!s.isCaller,children:e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{children:"Disable"}),s.isCaller&&e.jsx("span",{className:"text-xs text-fg-subtle",children:"Not your own account"})]})})]})}function ie({people:s,onPick:t}){const r=new Date;return e.jsx("div",{className:"overflow-x-auto rounded-sm border border-line bg-surface",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-line text-xs text-fg-muted",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Email"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Created"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Last sign-in"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Sessions"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),e.jsx("th",{scope:"col",className:"w-12 px-1 py-2",children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx("tbody",{children:s.map(n=>e.jsxs("tr",{className:"border-b border-line last:border-b-0",children:[e.jsxs("td",{className:"px-3 py-1 text-fg",children:[n.email,n.isCaller&&e.jsx("span",{className:"text-fg-muted",children:" (you)"})]}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.createdAt,r)}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.lastSignInAt,r)}),e.jsx("td",{className:"px-3 py-1 tabular-nums text-fg-muted",children:n.sessionCount}),e.jsx("td",{className:n.status==="Disabled"?"px-3 py-1 text-danger":"px-3 py-1 text-fg-muted",children:n.status}),e.jsx("td",{className:"px-1 py-1",children:e.jsx(oe,{person:n,onPick:o=>t(o,n)})})]},n.userId))})]})})}function le(){const s=H(),[t,r]=c.useState(null),[n,o]=c.useState(null),[a,l]=c.useState(null);if(s.isPending)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading people"});if(s.unavailable)return e.jsx(b,{tone:"info",children:"This server has no People page. It shows on a self-hosted server once self sign-up is turned off."});if(s.isError)return g(s.error).kind==="signedOut"?null:e.jsxs(b,{tone:"danger",children:[e.jsxs("p",{className:"font-medium",children:[N,"."]}),e.jsx("p",{className:"mt-1 text-fg-muted",children:K(s.error)}),e.jsxs("p",{className:"mt-2 flex items-center gap-3",children:[e.jsx(m,{variant:"secondary",size:"sm",onClick:()=>{s.refetch()},children:"Try again"}),e.jsx(S,{href:C(N,s.error)})]})]});const p=(i,d)=>{o(null),r({action:i,person:d})},u=i=>{i.resetUrl&&t&&l({email:t.person.email,resetUrl:i.resetUrl}),r(null)},x=i=>{if(!t)return;const d=g(i);o({title:v(t.action,t.person.email).failedTitle,reason:d.kind==="failed"?d.reason:"Something went wrong. Nothing changed. Try again.",error:i}),r(null)};return e.jsxs("div",{className:"space-y-4",children:[n&&e.jsx(ae,{failure:n}),e.jsx(ie,{people:s.data.people,onPick:p}),t&&e.jsx(te,{action:t.action,person:t.person,onCancel:()=>r(null),onDone:u,onFailed:x}),a&&e.jsx(re,{email:a.email,resetUrl:a.resetUrl,onDone:()=>l(null)})]})}const ce=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Anyone signed in here can manage every account. Each action asks for your own password first, and is recorded with who took it and from where."}),e.jsx("p",{children:"Disabling an account signs that person out within 15 minutes and stops their calendar feed links. Their mail stays. You cannot disable your own account, so one account always stays on."}),e.jsx("p",{children:"A reset link works once, for 24 hours, and is shown only once. Making one stops the old password at once."}),e.jsxs("p",{children:["The person who runs this server can turn all sign-in off with"," ",e.jsx("code",{children:"remit sign-in off"}),", and recover an account from the host with"," ",e.jsx("code",{children:"remit people enable"})," or ",e.jsx("code",{children:"remit people reset"}),"."]})]});function je(){const s=Q(),t=G(),[r,n]=c.useState(!0);return e.jsx(Y,{items:t,activeId:"people",title:"People",description:"Everyone with an account on this server.",help:ce,helpOpen:r,onToggleHelp:()=>n(o=>!o),onSelect:o=>{const a=W[o];a&&s({to:a})},onBackToMail:()=>{s({to:"/mail"})},children:e.jsx(le,{})})}export{je as component};
|
package/assets/reply-Dh35Hqag.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as R,cK as L,cL as O,r as o,u,cM as M,J as l,j as A,cN as B,cO as C,cP as m,cQ as $}from"./index-JcHkcLZl.js";import{u as N}from"./useMediaQuery-eKKtffrD.js";function j(e){const s=R({warn:e?.router===void 0}),t=e?.router||s;return L(t.stores.__store,O(e,t))}function P(e){const s=R();return L(s.stores.location,O(e,s))}const I=["intelligence","sidebar","nav","shortcuts"],F=["nav","shortcuts"],k=e=>F.includes(e);function ee(e,s){return[...e.filter(t=>!k(t)),...s?[s]:[]]}const U=M(I);function h(e){const s=new Set(e.split(",").map(t=>U.safeParse(t)).filter(t=>t.success).map(t=>t.data));return I.filter(t=>s.has(t))}function p(e){return I.filter(s=>e.includes(s)).join(",")}function se(){const e=P({select:s=>p(h(s.hash))});return o.useMemo(()=>h(e),[e])}const G=(e,s)=>!k(e)&&s;function K(e){return(s="")=>p(h(s).filter(t=>G(t,e)))}function c(){const e=N();return o.useMemo(()=>K(e),[e])}function te(){const e=u();return o.useCallback(s=>{e({search:!0,hash:p(s),replace:!0,hashScrollIntoView:!1})},[e])}const _="/mail/brief",w="/mail/$mailboxId",T="/mail/outbox",S="/mail/flagged";function V(e){for(const s of e){if(s.routeId===_)return{list:"brief"};if(s.routeId===S)return{list:"flagged"};if(s.routeId===T)return{list:"outbox"};if(s.routeId===w)return{list:"mailbox",mailboxId:s.params?.mailboxId}}}function ae(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);if(s[0]!=="mail")return"";const t=s[1];return t?t==="brief"?_:t==="flagged"?S:t==="outbox"?T:X(t):""}function re(e){if(typeof e!="object"||e===null)return"";const{q:s}=e;return typeof s=="string"?s:""}function X(e){return`${w}:${e}`}function ne(e,s){return e===s?!0:e.startsWith(`${s}/`)}function Y(e){const s=e.split(/[?#]/)[0].split("/").filter(Boolean);return s[0]==="mail"&&s.length>2}function d(){const e=j({select:a=>V(a.matches)?.list}),t=l({from:"/mail/$mailboxId",shouldThrow:!1})?.mailboxId;return o.useMemo(()=>({list:e,mailboxId:t}),[e,t])}function oe(){const{pathname:e}=P();return Y(e)}function ie(){const e=u(),s=c(),{list:t,mailboxId:a}=d();return o.useCallback(()=>{const r=i=>i,n=s;if(t==="flagged"){e({to:"/mail/flagged",search:r,hash:n});return}if(t==="outbox"){e({to:"/mail/outbox",search:r,hash:n});return}if(t==="mailbox"&&a){e({to:"/mail/$mailboxId",params:{mailboxId:a},search:r,hash:n});return}e({to:"/mail/brief",search:r,hash:n})},[e,s,t,a])}const q=B(C);function ue({fragment:e,...s}){const t=c();return A.jsx(q,{...s,hash:e??t})}const Q=["reply","reply-all","forward"],W=M(Q),g="/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}",b="/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}",x="/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}";function E(){const e=l({from:g,shouldThrow:!1}),s=l({from:b,shouldThrow:!1}),t=l({from:x,shouldThrow:!1});return e??s??t}function J(){const e=m({from:g,shouldThrow:!1}),s=m({from:b,shouldThrow:!1}),t=m({from:x,shouldThrow:!1});return(e??s??t)?.body}const y=e=>s=>e===void 0?$(s):{...$(s),body:e.body};function v(){const e=E(),s=J();return o.useMemo(()=>{if(!e)return;const t=W.safeParse(e.mode);return t.success?{kind:"reply",mode:t.data,threadId:e.threadId,sourceMessageId:e.messageId,outboxMessageId:e.outboxMessageId,seed:s===void 0?void 0:{body:s}}:{kind:"unknown",segment:e.mode}},[e,s])}function le(){return v()?.kind==="reply"}function D(e,s,t,a){return e==="flagged"?{to:b,params:{...t,outboxMessageId:a}}:e==="mailbox"&&s?{to:x,params:{...t,mailboxId:s,outboxMessageId:a}}:{to:g,params:{...t,outboxMessageId:a}}}function z(e,s){if(e?.kind==="reply"&&e.threadId===s.threadId&&e.sourceMessageId===s.messageId)return e.outboxMessageId}function ce(){const e=u(),s=c(),{list:t,mailboxId:a}=d(),r=v();return o.useCallback((n,i)=>{e({...D(t,a,n,i===void 0?z(r,n):void 0),search:y(i),hash:s})},[e,s,t,a,r])}function de(e,s,t){if(!(!s||!t))return a=>e({threadId:s,messageId:t,mode:a})}function fe(){const e=u(),{list:s,mailboxId:t}=d(),a=v();return o.useCallback(r=>{a?.kind==="reply"&&e({...D(s,t,{threadId:a.threadId,messageId:a.sourceMessageId,mode:a.mode},r),search:y(void 0),hash:!0,replace:!0})},[e,s,t,a])}function me(){const e=u(),s=c(),{list:t,mailboxId:a}=d(),r=E();return o.useCallback(()=>{if(!r)return;const n=y(void 0),i=s,f={threadId:r.threadId,messageId:r.messageId};if(t==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:f,search:n,hash:i});return}if(t==="mailbox"&&a){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{...f,mailboxId:a},search:n,hash:i});return}e({to:"/mail/brief/$threadId/$messageId",params:f,search:n,hash:i})},[e,s,t,a,r])}export{ue as N,j as a,re as b,oe as c,se as d,te as e,V as f,c as g,le as h,k as i,d as j,ie as k,ne as l,ae as m,ce as n,fe as o,ee as p,me as q,de as r,v as s,P as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gc as r,gd as o,ge as a}from"./index-JcHkcLZl.js";import{o as n}from"./rich-text-spellcheck-provider-J8m9wz6A.js";const c=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(),c(s),a(e))};export{i as openSpellcheckWorker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t="search-scope";function o(i){const e=i.trim().replace(/\s+/g," ").toLowerCase();return/\s/.test(e)?`in:"${e}"`:`in:${e}`}function r(i){return i.list!==void 0&&i.list!=="brief"}function l(i){return i.list==="mailbox"?i.mailboxId:void 0}function s(i,e){return i.list==="flagged"?{kind:"scoped",chip:{id:t,label:"is:starred"}}:i.list==="outbox"?{kind:"scoped",chip:{id:t,label:"in:outbox"}}:i.list==="mailbox"?e?{kind:"scoped",chip:{id:t,label:o(e)}}:{kind:"pending"}:{kind:"global"}}function a(i,e,n){return e.kind==="global"?{kind:"global"}:i.list==="flagged"?{kind:"collection"}:{kind:"folder",...n?{role:n}:{}}}export{t as S,a,r as i,l as r,s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as U,r as l,j as h,bZ as _,q as E,cS as Q,X as G,cT as j,cU as X,cV as z,cW as J,cX as W,J as x,u as N,V as Y,W as K,Z,_ as ee,N as te,cY as M}from"./index-JcHkcLZl.js";import{g as ne,j as k,k as oe}from"./reply-Dh35Hqag.js";import{s as se,S as re}from"./search-scope-UI1H6AzA.js";import{u as R}from"./useQueries-eyXujaLS.js";const Ie=U("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(),F=f??D,I=l.useRef(null),A=l.useRef([]),P=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}A.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":P();return;case"blur":c.blur();return;case"none":return}},[e.length,n,P,g,d]),V=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:F,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(Q,{ref:y=>{A.current[c]=y},label:s.label,tone:s.tone,focused:$===c,onFocusLabel:()=>C(c),onKeyDown:V(c),onRemove:()=>T(c)},s.id))}),h.jsx("input",{ref:I,id:F,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(G,{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=X({key:f.key,shiftKey:f.shiftKey,metaKey:f.metaKey,ctrlKey:f.ctrlKey,altKey:f.altKey,inEditable:J(f.target),onControl:z(f.target)},r.current);if(W().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=N(),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=N();return l.useCallback(t=>{e({to:"/mail/brief",search:{q:t||void 0}})},[e])}function Ne(){const e=N();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}=Y("mail",{useSuspense:!1}),i=l.useCallback((a,u)=>o(a,{defaultValue:u}),[o]),r=R({queries:e.map(a=>({...K({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},Ke=({accounts:e})=>{const{mailboxId:t}=k(),n=R({queries:e.map(o=>({...K({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},Re=({accounts:e})=>{const{mailboxId:t}=k(),n=R({queries:e.map(o=>({...K({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 Fe(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 Ae(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 Pe(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,Pe as b,ve as c,Ae as d,Ee as e,Me as f,ge as g,Ke as h,Re as i,ae as j,$e as k,Le as l,Ne as m,Ce as n,le as s,we as t,Fe as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,q as S,f as I,r as c,bW as $,a as C,g as k,bX as P,bY as A,B as w,X as L,u as O,aK as q,av as R,bZ as D,aN as K,b_ as M,b$ as Q,S as T}from"./index-JcHkcLZl.js";import{E}from"./ErrorState-BmfRU6e6.js";import{K as y}from"./kbd-Ba8uOP5b.js";import{a as V,S as B}from"./settings-screen-B4Stef9n.js";import{u as G}from"./useDebouncedValue-CCQodc3r.js";import{s as F}from"./help-copy-PBpM2Nt-.js";import"./avatar-CxJjt5__.js";import"./menu-B9EpNfSt.js";import"./circle-help-B5DNH9Yv.js";function _({options:t,active:m,onSelect:r}){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(i=>{const l=i.id===m;return e.jsxs("button",{type:"button",role:"tab","aria-selected":l,onClick:()=>r(i.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",l?"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:i.label}),e.jsx("span",{className:S("text-2xs tabular-nums",l?"text-accent-2":"text-fg-subtle"),children:i.count??"—"})]},i.id)})})}const j={vip:"VIPs",muted:"Muted",blocked:"Blocked"};function H({query:t,onCount:m}){const{data:r,isPending:i,isError:l,error:f}=C(M()),b=I(),d=k({...P(),onSettled:()=>{b.invalidateQueries({queryKey:Q()})}}),o=r?.suggestions??[],p=t.trim().toLowerCase(),u=p?o.filter(a=>(a.displayName??"").toLowerCase().includes(p)||a.normalizedEmail.toLowerCase().includes(p)):o;return c.useEffect(()=>{m?.(u.length,o.length)},[m,u.length,o.length]),i?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Loading VIP suggestions…"}):l?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(E,{variant:"inline",title:"Couldn't load VIP suggestions",error:f})}):o.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(y,{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(w,{variant:"ghost",size:"sm",icon:e.jsx(T,{className:"size-3.5"}),"aria-busy":d.isPending,onClick:()=>{d.isPending||d.mutate({path:{addressId:a.addressId},body:{flags:{vip:{value:!0,setAt:Date.now(),setBy:"user"}}}})},children:"Add VIP"})},a.addressId))]})}function X({group:t,query:m,onCount:r}){const i=G(m.trim(),300),l=I(),[f,b]=c.useState(null),d=i.length>=2,o=$({query:{q:i,limit:50}}),{data:p,isPending:u,isError:a,error:N}=C({...o,enabled:d}),x=k({...P(),onSuccess:()=>{l.invalidateQueries({queryKey:o.queryKey})}}),g=(p?.items??[]).filter(n=>t==="muted"?n.flags?.muted?.value??!1:n.flags?.blocked?.value??!1);return c.useEffect(()=>{r?.(d?g.length:0,null)},[r,d,g.length]),d?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:N})}):g.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No ",j[t].toLowerCase()," senders matching “",i,"”."]}):e.jsx(e.Fragment,{children:g.map(n=>{const s=t==="muted"?n.flags?.muted:n.flags?.blocked,h=s?[`${t}`,s.setAt&&A(s.setAt,{month:"short",year:"numeric"})||null,s.reason?`— ${s.reason}`:null].filter(Boolean).join(" "):t,v=x.isPending&&x.variables?.path.addressId===n.addressId,z=x.isError&&f===n.addressId;return e.jsx(V,{name:n.displayName??n.normalizedEmail,email:n.normalizedEmail,danger:t==="blocked",meta:h,trailing:z?e.jsx(w,{variant:"secondary",size:"sm",onClick:()=>{b(n.addressId),x.mutate({path:{addressId:n.addressId},body:{flags:{[t]:{value:!1,setAt:Date.now()}}}})},children:"Retry"}):e.jsx(w,{variant:"ghost",size:"sm",icon:e.jsx(L,{className:"size-3.5"}),"aria-busy":v,"aria-label":`Remove ${t} flag`,onClick:()=>{v||(b(n.addressId),x.mutate({path:{addressId:n.addressId},body:{flags:{[t]:{value:!1,setAt:Date.now()}}}}))}})},n.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 ",j[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(y,{children:"m"})," on any message to mute its sender; ",e.jsx(y,{children:"b"})," to block."]})]})}function ne(){const t=O(),m=q(),[r,i]=c.useState("vip"),[l,f]=c.useState(""),[b,d]=c.useState(!0),[o,p]=c.useState(0),[u,a]=c.useState({vip:0,muted:null,blocked:null}),N=c.useCallback((s,h)=>{p(s),a(v=>({...v,vip:h}))},[]),x=c.useCallback((s,h)=>{p(s),a(v=>({...v,[r]:s}))},[r]),g=u[r],n=s=>{const h=K[s];h&&t({to:h})};return e.jsx(B,{items:m,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:F,helpOpen:b,onToggleHelp:()=>d(s=>!s),onSelect:n,onBackToMail:()=>{t({to:"/mail"})},children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[e.jsx(_,{active:r,onSelect:s=>{i(s),f("")},options:["vip","muted","blocked"].map(s=>({id:s,label:j[s],count:u[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(R,{icon:e.jsx(D,{className:"size-4"}),placeholder:`Filter ${j[r].toLowerCase()} by name or address`,className:"h-8 max-w-sm",value:l,onChange:s=>f(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:l,onCount:N}):e.jsx(X,{group:r,query:l,onCount:x})}),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:g!=null?`${o} of ${g} flagged senders`:`${o} flagged senders`}),e.jsxs("span",{children:[e.jsx(y,{children:"j"})," ",e.jsx(y,{children:"k"})," navigate · ",e.jsx(y,{children:"⌫"})," remove flag"]})]})]})]})})}export{X as SearchGroupPane,ne as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,O as o}from"./index-JcHkcLZl.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as j,j as e,q as f,c4 as h,B as i,X as N,e as C}from"./index-JcHkcLZl.js";import{A as w}from"./avatar-CxJjt5__.js";import{M as S}from"./menu-B9EpNfSt.js";import{C as v}from"./circle-help-B5DNH9Yv.js";function F({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 R({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 B={healthy:{tone:"positive",label:"healthy"},error:{tone:"danger",label:"error"},muted:{tone:"neutral",label:"muted"}};function q({label:l,email:t,connector:x,syncLabel:n,state:r,errorDetail:s,trailing:d}){const o=B[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{q as A,F as S,R as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i,X as Z,q as O,fl as R,fq as $,fo as v,r as u,cy as E,g4 as F}from"./index-JcHkcLZl.js";import{E as L,C as W}from"./EmptyState-CP5Vn2LS.js";import{C as z}from"./calendar-event-sidebar-DhwwreFW.js";import{C as B}from"./calendar-failure-note-CJWF9Bm9.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 q,o as M}from"./useCalendarSuggestions-DVLnDR0Q.js";import{e as w,p as V,a as G}from"./draft-Cn-cGLa8.js";import{f as X}from"./calendar-format-BwCpz-JZ.js";import{a as Y}from"./CalendarSession-BMeYMexj.js";import"./reply-Dh35Hqag.js";import{k as J,b as K}from"./calendar-D6a4XfwP.js";import"./calendar-guests-D5tYwBA8.js";import"./calendar-event-popup-BuR0xhCL.js";import"./pencil-CnNCN6P1.js";import"./circle-help-B5DNH9Yv.js";import"./ErrorState-BmfRU6e6.js";import"./useQueries-eyXujaLS.js";import"./useMediaQuery-eKKtffrD.js";function I({title:e,subtitle:a,onClose:r,children:s,className:o}){return i.jsxs("section",{className:O("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?R(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=V(a,r,s);if(!o.ok)return o;const d=e.zoneCertainty==="Ambiguous"||o.patch.start!==void 0?{...o.patch,...G(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}, ${X(m)}`}))},[s,l,d,e.date,e.endDate,e.startTime,e.endTime,t,o,a,r])}const y="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:y,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:y,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=q(),[t]=u.useState(()=>Q(e,"",h())),[c,p]=u.useState(t),f=Y()?.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,x]=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:M(o[c.calendarId]??S)});if(!n.ok){x(n.problem);return}x(""),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:y,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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as X,aD as B,aE as Q,fq as _,a as C,fr as ee,r as d,f as b,s as y,g as m,fs as te,ft as ne,fu as ae,aZ as A,ba as se,b8 as re,b9 as oe,fv as ie,cr as w,fw as S,fo as ce,cH as de,fx as le,fy as ue,fz as fe,fA as pe,fB as ge,fC as me,fD as Ce,fE as ye}from"./index-JcHkcLZl.js";import{f as I}from"./ErrorState-BmfRU6e6.js";import{u as G}from"./useQueries-eyXujaLS.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 We(e){return B(Q({title:`Calendar invitation: ${e}`,errorMessage:e}))}function je(e){return B(Q({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"},xe=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 $e(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 W(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 Be(){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(W),s=r.filter(i=>i.componentSet==="VtodoOnly").map(W);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"]),j=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 Qe(){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(j),[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(j),[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 x=365*24*60*6e4,De=1440*6e4,$=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+x),calendarObjectId:e}}),meta:$,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+x),calendarObjectId:e}}),meta:$,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,Be as b,je as c,Qe as d,K as e,Ze as f,He as g,he as h,Je as i,et as j,We as k,Ye as l,Ke as m,ve as n,Ue as o,ze as p,Ge as q,R as r,$e as s,Se as t,we as u,Ve as v,xe as w,Xe as x};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,g as h,fF as x,a as M,fG as P,fH as N,fI as L,f as v,fJ as I,fK as T,fL as z,fM as R,bc as w}from"./index-JcHkcLZl.js";const Y=(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"})},A=(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"?A(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=M({...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),S={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:S,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(),K=e=>e==="all"?"And":"Or",j=e=>({matchOperator:K(e.matchOperator),literalClauses:e.clauses.map(t=>({field:t.field,value:t.value}))}),H=e=>!e.literalClauses.some(t=>t.field==="HasWords"),B=e=>JSON.stringify({operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),ie=e=>{const t=j(e);return{matchOperator:t.matchOperator,literalClauses:t.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?A(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},G=350,ne=(e,t,r)=>{const s=h(N()),{mutateAsync:i}=s,a=B(t),[n,o]=d.useState(()=>({})),l=d.useRef(t);l.current=t;const c=d.useRef(a),f=H(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(S=>({...S,error:m instanceof Error?m.message:"Couldn't count matches.",errorSignature:u}))})},G);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=>T({path:{accountId:e}}),oe=e=>{const t=M({...z({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=v(),r=h({...I(),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=v(),r=h({...R(),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=v(),r=h({...w(),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,Y as f,oe as g,ue as h,de as i,le as j,te as k,ae as n,ee as o,A as p,j as r,ne as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as L,ff as p,f as n,g as l,fg as d,r as o,fh as y,fi as f,fj as g}from"./index-JcHkcLZl.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}},h=e=>{const r=n(),t=l({...d(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:s}=t;return{createLabel:o.useCallback((a,i="Default")=>e?s({path:{accountId:e},body:{name:a,color:i}}):Promise.reject(new Error("No account")),[e,s]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},m=e=>{const r=n(),t=l({...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({...g(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{deleteLabel:o.useCallback(a=>{e&&s({path:{accountId:e,labelId:a}})},[e,s]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{P as a,m as b,C as c,h as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-JcHkcLZl.js";import{a as s,D as e}from"./useMediaQuery-eKKtffrD.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 +0,0 @@
|
|
|
1
|
-
import{r as a,u as P,cQ as O,J as p,n as U,aa as B,f as N,a as $,dk as D,d9 as L}from"./index-JcHkcLZl.js";import{g as F,j as _,k as v}from"./reply-Dh35Hqag.js";const E="/mail/brief/compose/{-$outboxMessageId}",w="/mail/flagged/compose/{-$outboxMessageId}",S="/mail/outbox/compose/{-$outboxMessageId}",R="/mail/$mailboxId/compose/{-$outboxMessageId}";function k(){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 k()!==void 0}function se(){return k()?.outboxMessageId}function Q(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({...Q(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 K=new Set(["rfc822","global"]),q=e=>e.mediaType.toUpperCase()==="MESSAGE"&&K.has(e.mediaSubtype.toLowerCase()),T=(e,t)=>e.partPath.startsWith(`${t}.`),I=e=>{const t=e.filter(q);return e.filter(s=>!t.some(r=>T(s,r.partPath)))},ce=(e,t)=>e.filter(s=>T(s,t)),G=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 W=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,W(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?G(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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{dl as Q,dm as y,dn as w,dp as S,dq as C,f as k,dr as q,ds as x,r as p,dt as M,du as H,dv as L,dw as P,dx as O,dy as B,dz as z}from"./index-JcHkcLZl.js";function R(r,s){const e=new Set(s);return r.filter(t=>!e.has(t))}function A(r,s,e){const t=r.slice(0);return t[s]=e,t}var T=class extends Q{#i;#s;#n;#r;#e;#t;#o;#u;#h;#a=[];constructor(r,s,e){super(),this.#i=r,this.#r=e,this.#n=[],this.#e=[],this.#s=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(r=>{r.subscribe(s=>{this.#f(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(r=>{r.destroy()})}setQueries(r,s){this.#n=r,this.#r=s,y.batch(()=>{const e=this.#e,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=e.length!==i.length,c=i.some((o,f)=>o!==e[f]),d=u||c,b=d?!0:n.some((o,f)=>{const g=this.#s[f];return!g||!w(o,g)});!d&&!b||(d&&(this.#a=t,this.#e=i),this.#s=n,this.hasListeners()&&(d&&(R(e,i).forEach(o=>{o.destroy()}),R(i,e).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#p()))})}getCurrentResult(){return this.#s}getQueries(){return this.#e.map(r=>r.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(r,s){const e=this.#d(r),t=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=e.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,s,i),()=>this.#c(t,e)]}#c(r,s){return s.map((e,t)=>{const i=r[t];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,n=>{s.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,s,e){if(s){const t=this.#h,i=e!==void 0&&t!==void 0&&(t.length!==e.length||e.some((n,u)=>n!==t[u]));return(!this.#t||this.#s!==this.#u||i||s!==this.#o)&&(this.#o=s,this.#u=this.#s,e!==void 0&&(this.#h=e),this.#t=S(this.#t,s(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#e.some((r,s)=>r.options.suspense&&this.#s[s]?.data===void 0)}#d(r){const s=new Map;this.#e.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=s.get(i);n?n.push(t):s.set(i,[t])});const e=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=s.get(i.queryHash)?.shift()??new C(this.#i,i);e.push({defaultedQueryOptions:i,observer:u})}),e}#f(r,s){const e=this.#e.indexOf(r);e!==-1&&(this.#s=A(this.#s,e,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#s,this.#a),s=this.#b(),e=this.#t,t=s?e:this.#l(r,this.#r?.combine);(s||e!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#s)})})}}};function U({queries:r,...s},e){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 T(t,u,s)),[d,b,o]=c.getOptimisticResult(u,s.combine),f=!i&&s.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,s)},[u,s,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&&z({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as E,w as K,q as Q,B as U,f as T,N as B,r as o,aP as R,R as $,U as z,n as G,a2 as I,a3 as X,a6 as V}from"./index-JcHkcLZl.js";import{C as J}from"./circle-check-big-D9Wjhdx-.js";import{R as Y}from"./refresh-cw-Cr0O1tfh.js";import{u as P}from"./useQueries-eyXujaLS.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)}),_=6e4,te=new Set(["sent","drafts","trash","archive"]),C=(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=T(),{resultFolderIndex:r}=B(),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:_,staleTime:_,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=C(b.mailboxes??[],r),v=c.current.get(d);if(c.current.set(d,g),v){const A=q(v,g);A.length>0&&$(t,z(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,C(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,N={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?N:{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=>{V(e,{softError:!0})},O=(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 O(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:()=>O(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=T(),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:X({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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as g,ap as p,a as f,c as m,r,g as y,ar as T,l as E,i as x}from"./index-JcHkcLZl.js";const i={html:"",plainText:""},d=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...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};
|