@remit/web-client-dist 0.0.678 → 0.0.680
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-CcwdfBlh.js +1 -0
- package/assets/CalendarEventEditor-Cpu5cJxJ.js +1 -0
- package/assets/CalendarEventPopup-ecl1-NSt.js +1 -0
- package/assets/{CalendarLoadFailed-DGqiWK7A.js → CalendarLoadFailed-BbUr2ubu.js} +1 -1
- package/assets/CalendarQuickCreate-DF0Uxv4V.js +1 -0
- package/assets/{CalendarSession-DGGQfwLi.js → CalendarSession-XIbMK3oT.js} +1 -1
- package/assets/DesktopChrome-Ciuao7Ro.js +1 -0
- package/assets/{DropdownMenu-CowSyQUa.js → DropdownMenu-fskbk1FW.js} +1 -1
- package/assets/{EmptyState-DcHnaG2R.js → EmptyState-CzSAWxdK.js} +1 -1
- package/assets/{ErrorState-DcP5ZTMN.js → ErrorState-KWmymUQR.js} +1 -1
- package/assets/{FlaggedPane-CuevlxSV.js → FlaggedPane-CMZMZWbM.js} +1 -1
- package/assets/{FullCompose-BdpPcB8J.js → FullCompose-6pNo7wi4.js} +1 -1
- package/assets/LabelApplyTrigger-C0GQNIEk.js +1 -0
- package/assets/MailShell--jgEGKni.js +1 -0
- package/assets/MailViewChrome-33SQAjQn.js +1 -0
- package/assets/MailboxPane-CvW6x3uh.js +135 -0
- package/assets/MessageBody-Ba6dVlG6.js +84 -0
- package/assets/MessageToolbar-BB_mPS4p.js +1 -0
- package/assets/NavMenuButton-DuV5qIvO.js +1 -0
- package/assets/{OnboardingWizard-CPxEO5Gn.js → OnboardingWizard-BHqhUNht.js} +1 -1
- package/assets/OutboxPane-vxvckaxe.js +1 -0
- package/assets/_calendarObjectId-CysTJCDO.js +1 -0
- package/assets/_mailboxId-sUyLlrph.js +1 -0
- package/assets/_messageId-BNOLD_NW.js +1 -0
- package/assets/_messageId-C11dYlL_.js +1 -0
- package/assets/_messageId-sL5uhmsZ.js +1 -0
- package/assets/_outboxMessageId-D8CVGqIw.js +1 -0
- package/assets/_recurrenceId-BZ43TEn7.js +1 -0
- package/assets/_threadId-CKva01mK.js +1 -0
- package/assets/_threadId-Dcu-hZiA.js +1 -0
- package/assets/_threadId-mSRKzdYV.js +1 -0
- package/assets/_view-CtgngRpB.css +1 -0
- package/assets/_view._date-BcsaqrBS.js +1 -0
- package/assets/{account-service-status-BrL78Bwl.js → account-service-status-u9m2wO3G.js} +1 -1
- package/assets/accounts-GeT0KphS.js +1 -0
- package/assets/advanced-A-kGFwE6.js +1 -0
- package/assets/agenda-time-C_tFoNHA.js +1 -0
- package/assets/app-chrome-CAqI0L8I.js +1 -0
- package/assets/appearance-C0uk70LK.js +1 -0
- package/assets/{avatar-B4KRzyzS.js → avatar-BKCZjVnK.js} +1 -1
- package/assets/badge-BmEPIQJj.js +1 -0
- package/assets/{bottom-sheet-B5OEKAh2.js → bottom-sheet-CYnEFnuG.js} +1 -1
- package/assets/{brief-ChnlqLdX.js → brief-CT4sagsk.js} +1 -1
- package/assets/brief-DcVaSAff.js +1 -0
- package/assets/calendar-DEqazg7d.js +1 -0
- package/assets/{calendar-miAZmlW9.js → calendar-W0j7nrh5.js} +1 -1
- package/assets/calendar-event-popup-GQy2blc9.js +1 -0
- package/assets/{calendar-event-sidebar-D_7uvmvT.js → calendar-event-sidebar-BdPLf9Q-.js} +1 -1
- package/assets/{calendar-failure-note-BJCyTf1U.js → calendar-failure-note-Cc_-yh_l.js} +1 -1
- package/assets/{calendar-guests-BCC1uGzd.js → calendar-guests-DCkwUUaR.js} +1 -1
- package/assets/calendar-suggestion-w5Buli06.js +1 -0
- package/assets/calendars-CN_LOe7f.js +1 -0
- package/assets/{card-WB75jB_w.js → card-BYFKESRL.js} +1 -1
- package/assets/{checkbox-BXzuviQP.js → checkbox-CPr2JwkJ.js} +1 -1
- package/assets/chevron-down-BI1fWP0V.js +1 -0
- package/assets/chevron-left-BQBw-0xj.js +1 -0
- package/assets/{circle-check-Bifl6wEJ.js → circle-check-DyyOWTYB.js} +1 -1
- package/assets/{circle-check-big-BrmrabN6.js → circle-check-big-CVlYwPvW.js} +1 -1
- package/assets/{circle-help-Cyj92MDS.js → circle-help-BSxYNH4r.js} +1 -1
- package/assets/{clock-A6ewTncv.js → clock-DQO0Oi4O.js} +1 -1
- package/assets/{cloud-off-CsGOr1Gn.js → cloud-off-CUN7xSDU.js} +1 -1
- package/assets/compose._-_outboxMessageId_--bw-JQyQ.js +1 -0
- package/assets/compose._-_outboxMessageId_-9p2UwGZ2.js +1 -0
- package/assets/compose._-_outboxMessageId_-BKX6xXkK.js +1 -0
- package/assets/compose._-_outboxMessageId_-CoRtMIvt.js +1 -0
- package/assets/{config-import-DTjV5c_Y.js → config-import-3qED7KRP.js} +1 -1
- package/assets/{confirm-dialog-9Q6aXOb5.js → confirm-dialog-DCFAU3wg.js} +1 -1
- package/assets/{copy-DjyWdtW5.js → copy-CMEksM9b.js} +1 -1
- package/assets/credential-steps-DjMS9JxY.js +1 -0
- package/assets/{download-CtoLQ9Ox.js → download-DpUgrnYE.js} +1 -1
- package/assets/draft-UntYYkEO.js +1 -0
- package/assets/edit-C5xc8ZMZ.js +1 -0
- package/assets/edit-DY8bOvEH.js +1 -0
- package/assets/{external-link-Dn2gWGrg.js → external-link-Dp_vrT3U.js} +1 -1
- package/assets/{file-json-B4YU26EQ.js → file-json-BXCpWMKO.js} +1 -1
- package/assets/filters-BPOqWe_z.js +1 -0
- package/assets/flagged-B0gfe6c8.js +1 -0
- package/assets/{flagged-CjfnRBYq.js → flagged-DOHBcWRm.js} +1 -1
- package/assets/folder-input-v9jv3QvB.js +1 -0
- package/assets/folders-WZv8o8Yl.js +1 -0
- package/assets/{help-copy-CQIBCXJf.js → help-copy-BEXklmCF.js} +1 -1
- package/assets/import-H021ROti.js +1 -0
- package/assets/index-B0WA56eY.js +1 -0
- package/assets/index-BNOLD_NW.js +1 -0
- package/assets/index-BQRB4Hbr.js +1 -0
- package/assets/index-BSVI2qk3.js +1 -0
- package/assets/index-BTWqd0y1.js +1 -0
- package/assets/index-BVIV7uOn.js +213 -0
- package/assets/index-C11dYlL_.js +1 -0
- package/assets/index-C9L3Y4ln.js +1 -0
- package/assets/{index-CNLnhDIy.css → index-CMNnsfzR.css} +1 -1
- package/assets/index-CMYDLexx.js +1 -0
- package/assets/index-Ct_bZm5J.js +1 -0
- package/assets/{index-BNUBjW43.js → index-KSq98OCk.js} +11 -11
- package/assets/index-cUEB_Vmo.js +1 -0
- package/assets/{kbd-D0eWE7Kp.js → kbd-CD9WJQDD.js} +1 -1
- package/assets/label-chip-D6H7mAQZ.js +1 -0
- package/assets/labels-B1aYofac.js +1 -0
- package/assets/mail-BXDRGUJS.js +1 -0
- package/assets/mail-CzYW0cEP.js +1 -0
- package/assets/{menu-D06KWsdQ.js → menu-Cul_tOCl.js} +1 -1
- package/assets/new-CdrTfyYm.js +1 -0
- package/assets/onboarding-Bt28IS6_.js +1 -0
- package/assets/{onboarding-completion-DnXMA7VE.js → onboarding-completion-C5SxIJff.js} +1 -1
- package/assets/outbox-C-QNKevV.js +1 -0
- package/assets/{pencil-CA6DIP59.js → pencil-D4t_TOKs.js} +1 -1
- package/assets/people-CBau3oq-.js +1 -0
- package/assets/plus-BSFg3ibr.js +1 -0
- package/assets/{popover-menu-BT-fkOr5.js → popover-menu-Drk7oRld.js} +1 -1
- package/assets/{refresh-cw-BERt5E10.js → refresh-cw-CuoE7FSQ.js} +1 -1
- package/assets/reply-DtObeSB2.js +1 -0
- package/assets/{rich-text-C9TR28N2.js → rich-text-Fi0gjjkk.js} +3 -3
- package/assets/rich-text-spellcheck-worker-provider-uKovGi4E.js +1 -0
- package/assets/{rotate-ccw-C-agNTCI.js → rotate-ccw-9KACcb0y.js} +1 -1
- package/assets/{roving-focus-Cj3j6dFs.js → roving-focus-WwAX8-VC.js} +1 -1
- package/assets/{row-actions-C7JJUiqN.js → row-actions-C0oNI3Ia.js} +1 -1
- package/assets/{search-mirror-B5Imt12Z.js → search-mirror-CQaPpynv.js} +1 -1
- package/assets/search-scope-CuQFKckU.js +1 -0
- package/assets/search-token-index-BXdRQHFC.js +1 -0
- package/assets/{sections-DiFHIPo4.js → sections-DssOe_S4.js} +1 -1
- package/assets/segmented-control-DH-yNZtm.js +1 -0
- package/assets/select-CU_oR6rc.js +1 -0
- package/assets/senders-OMax5Bsf.js +1 -0
- package/assets/settings-qYifOymR.js +1 -0
- package/assets/settings-screen-FlCW-JB0.js +1 -0
- package/assets/{shield-check-DDrlOAO3.js → shield-check-7IzpHero.js} +1 -1
- package/assets/{sparkles-MrqvyWps.js → sparkles-D9JSeha5.js} +1 -1
- package/assets/suggest-list-MxpHM4zs.js +1 -0
- package/assets/{suggested-vips-ODDnv-D2.js → suggested-vips-CUOrJsvn.js} +1 -1
- package/assets/suggestion._suggestionId-BDEu9XtG.js +1 -0
- package/assets/{task._calendarTaskId-BfaZmOEn.js → task._calendarTaskId-glaP1HGu.js} +1 -1
- package/assets/{undo-2-C6aYHE3s.js → undo-2-BLxVGig8.js} +1 -1
- package/assets/{useCalendarData-C3WbLJaC.js → useCalendarData-BHwxEmxu.js} +1 -1
- package/assets/{useCalendarScheduling-CjI7T1o-.js → useCalendarScheduling-BPs-bAlU.js} +1 -1
- package/assets/useCalendarSuggestions-C4O39URl.js +1 -0
- package/assets/{useCalendarTasks-DNBYBsvN.js → useCalendarTasks-BYrDBjzg.js} +1 -1
- package/assets/{useDebouncedValue-B0BMCu3v.js → useDebouncedValue-CQk7uQJy.js} +1 -1
- package/assets/useFilters-DXcDtC9M.js +1 -0
- package/assets/useLabels-Ds4FhWUf.js +1 -0
- package/assets/useLayoutTier-CDh6ugx0.js +1 -0
- package/assets/{useMediaQuery-a7SamL-l.js → useMediaQuery-DHHct6HU.js} +1 -1
- package/assets/useMessageBodyContent-Bz4eLwYW.js +3 -0
- package/assets/useQueries-CFXMrDWB.js +1 -0
- package/assets/useRefreshControl-CmSuQYeT.js +1 -0
- package/assets/{useResultFolderIndex-koSvRw-H.js → useResultFolderIndex-B-bcuKwK.js} +1 -1
- package/assets/useSignature-ChD8g6V6.js +1 -0
- package/assets/{warnings-De2eUHBy.js → warnings-DuiY0HQB.js} +3 -3
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/BriefPane-DZbE8ZNv.js +0 -1
- package/assets/CalendarEventEditor-LUplTbrz.js +0 -1
- package/assets/CalendarEventPopup-CQaPJg2s.js +0 -1
- package/assets/CalendarQuickCreate-DqIwACsh.js +0 -1
- package/assets/DesktopChrome-Dl4YzJrV.js +0 -1
- package/assets/LabelApplyTrigger-c7ugtEyT.js +0 -1
- package/assets/MailShell-C7RoeX76.js +0 -1
- package/assets/MailViewChrome-CQnNS9Dt.js +0 -1
- package/assets/MailboxPane-GqjbzfQ9.js +0 -1
- package/assets/MessageBody-B3Z3zu18.js +0 -84
- package/assets/MessageToolbar-DpBF7XWc.js +0 -1
- package/assets/NavMenuButton-d1WErbNE.js +0 -1
- package/assets/OutboxPane-CnWjm3Kz.js +0 -1
- package/assets/_calendarObjectId-BNxfdsFq.js +0 -1
- package/assets/_mailboxId-5uzJGGTA.js +0 -1
- package/assets/_messageId-CtUY7QaK.js +0 -1
- package/assets/_messageId-CyMtXqvK.js +0 -1
- package/assets/_messageId-jb0nvtAH.js +0 -1
- package/assets/_outboxMessageId-CRuHx4Az.js +0 -1
- package/assets/_recurrenceId-Dcdvy3HK.js +0 -1
- package/assets/_threadId-B17WzUu-.js +0 -1
- package/assets/_threadId-Djcejxjj.js +0 -1
- package/assets/_threadId-TLGn2UeF.js +0 -1
- package/assets/_view._date-DLGnjbKh.js +0 -1
- package/assets/accounts-DKPcRgRU.js +0 -1
- package/assets/advanced-BjXiUDtl.js +0 -1
- package/assets/appearance-MzTWiLTR.js +0 -1
- package/assets/brief-C-5GXXj6.js +0 -1
- package/assets/calendar-event-popup-Dbcz3Zb_.js +0 -1
- package/assets/calendar-mwWH-7s8.js +0 -1
- package/assets/calendar-suggestion-BppH-3oL.js +0 -1
- package/assets/calendars-D9ZEiowB.js +0 -1
- package/assets/compose._-_outboxMessageId_-C6-fUwE2.js +0 -1
- package/assets/compose._-_outboxMessageId_-CSKV8YnZ.js +0 -1
- package/assets/compose._-_outboxMessageId_-Djp_aqSn.js +0 -1
- package/assets/compose._-_outboxMessageId_-DspXe17c.js +0 -1
- package/assets/credential-steps-BoiX5zy2.js +0 -1
- package/assets/draft-CdiiJR8n.js +0 -1
- package/assets/edit-D9g3EW1R.js +0 -1
- package/assets/edit-DkOWaaHs.js +0 -1
- package/assets/filters--HZZoQYr.js +0 -1
- package/assets/flagged-CVmpEd-z.js +0 -1
- package/assets/folders-BEv1OKE6.js +0 -1
- package/assets/import-DhvqQyGM.js +0 -1
- package/assets/index-4XPoPWhu.js +0 -349
- package/assets/index-B4YQCeZ5.js +0 -1
- package/assets/index-B8TxM1Ri.js +0 -1
- package/assets/index-BqN9osrB.js +0 -1
- package/assets/index-CA4e3svh.js +0 -1
- package/assets/index-ChXNLMBw.js +0 -1
- package/assets/index-Cm4__-V6.js +0 -1
- package/assets/index-CtUY7QaK.js +0 -1
- package/assets/index-CyMtXqvK.js +0 -1
- package/assets/index-DDMaQQcI.js +0 -1
- package/assets/index-aTwfTj57.js +0 -1
- package/assets/labels-DlSg6Q8z.js +0 -1
- package/assets/mail-CmiK10Kq.js +0 -1
- package/assets/new-B_n0KCot.js +0 -1
- package/assets/onboarding-DVJYsyGv.js +0 -1
- package/assets/outbox-_8AzSWX1.js +0 -1
- package/assets/people-BAjwQQiz.js +0 -1
- package/assets/reply-FoVQqDdv.js +0 -1
- package/assets/rich-text-spellcheck-worker-provider-DjdTU9LK.js +0 -1
- package/assets/search-scope-UI1H6AzA.js +0 -1
- package/assets/search-token-index-C7o7PQIx.js +0 -1
- package/assets/senders-BpChah6o.js +0 -1
- package/assets/settings-kL8Y1zKC.js +0 -1
- package/assets/settings-screen-ZYutaKzZ.js +0 -1
- package/assets/suggestion._suggestionId-DZhG3YlZ.js +0 -1
- package/assets/useCalendarSuggestions-D6k1REyo.js +0 -1
- package/assets/useFilters-C_nA08Aa.js +0 -1
- package/assets/useLabels-Dn9qgr5w.js +0 -1
- package/assets/useLayoutTier-DtUqYCCh.js +0 -1
- package/assets/useMessageBodyContent-ClVl7CBj.js +0 -1
- package/assets/useQueries-XPiXhlQX.js +0 -1
- package/assets/useRefreshControl-C9tPndY1.js +0 -1
- package/assets/useSignature-rM5axmpY.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as r,s as o,g as a}from"./useSignature-ChD8g6V6.js";import{o as n}from"./rich-text-spellcheck-provider-J8m9wz6A.js";import"./index-BVIV7uOn.js";const l=t=>({post:e=>t.postMessage(e),listen:e=>t.addEventListener("message",s=>e(s.data)),fail:e=>t.addEventListener("error",s=>e(s.message)),terminate:()=>t.terminate()}),m=async t=>{const e=r(t);if(!e)return null;const s=new Worker(new URL("/assets/rich-text-spellcheck-worker-pWkhC-WR.js",import.meta.url),{type:"module"});return n(e,o(),l(s),a(e))};export{m as openSpellcheckWorker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t}from"./index-
|
|
1
|
+
import{b as t}from"./index-BVIV7uOn.js";const e=t("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);export{e as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d}from"./index-
|
|
1
|
+
import{r as d}from"./index-BVIV7uOn.js";const E={"data-list-row":""},v="[data-list-row]";function m(e,r,s,i="vertical"){if(s===0)return null;const n=i==="vertical"?"ArrowDown":"ArrowRight",c=i==="vertical"?"ArrowUp":"ArrowLeft";return e===n?r<0?0:Math.min(r+1,s-1):e===c?r<=0?0:r-1:e==="Home"?0:e==="End"?s-1:null}function l(e,r){return Array.from(e.querySelectorAll(r))}function y({containerRef:e,itemSelector:r,orientation:s="vertical",enabled:i=!0}){d.useEffect(()=>{if(!i)return;const n=e.current;if(!n)return;const c=()=>{const t=l(n,r);if(t.length===0)return;const f=t.find(o=>o===document.activeElement)??t[0];for(const o of t)o.tabIndex=o===f?0:-1},u=t=>{if(t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)return;const a=l(n,r),f=a.indexOf(document.activeElement),o=m(t.key,f,a.length,s);o===null||o===f||(t.preventDefault(),t.stopPropagation(),a[o]?.focus())};return c(),n.addEventListener("focusin",c),n.addEventListener("keydown",u),()=>{n.removeEventListener("focusin",c),n.removeEventListener("keydown",u)}})}export{v as L,E as a,m as r,y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,j as l,B as b,
|
|
1
|
+
import{r as e,j as l,B as b,p as y,L as x}from"./index-BVIV7uOn.js";const i=()=>l.jsx(x,{className:"size-3.5 animate-spin"}),m=(s,n)=>n?l.jsx("span",{className:"sr-only",children:s}):s;function c({actions:s=[],destructive:n,className:o}){const[f,r]=e.useState(!1);return f&&n?.confirm?l.jsxs("div",{className:y("flex items-center gap-2",o),children:[l.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),l.jsx(b,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:n.confirm.cancelLabel??"Cancel"}),l.jsx(b,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?i():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):l.jsxs("div",{className:y("flex items-center gap-2",o),children:[s.map(a=>l.jsx(b,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?i():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:m(a.label,a.iconOnly)},a.label)),n&&l.jsx(b,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?i():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){r(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:m(n.label,n.iconOnly)})]})}export{c as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as v,
|
|
1
|
+
import{u as v,H as x,r as I}from"./index-BVIV7uOn.js";import{a as p,b,h as g}from"./reply-DtObeSB2.js";import{b as Q}from"./MailShell--jgEGKni.js";import{a as q}from"./useMessageBodyContent-Bz4eLwYW.js";function A(a){const t=v(),{searchInput:c,searchQuery:e}=x(),i=p({select:o=>b(o.location.search)}),u=p({select:o=>o.location.pathname}),h=q(),f=g(),m=h||f,{to:s}=a,r="params"in a?a.params.mailboxId:void 0,l=r?`/mail/${r}`:s;I.useEffect(()=>{if(!Q({searchInput:c,committedQuery:e,urlQuery:i,pathname:u,listPath:l}))return;const y=!!e&&i!==e&&!m,n=d=>({...d,q:e||void 0});if(!y){t({to:".",search:n,hash:!0,replace:!0});return}if(s==="/mail/$mailboxId"){if(!r)return;t({to:s,params:{mailboxId:r},search:n,hash:!0,replace:!0});return}t({to:s,search:n,hash:!0,replace:!0})},[c,e,i,t,s,r,l,u,m])}export{A as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as u,c8 as En,j as A,p as en,ax as In}from"./index-BVIV7uOn.js";import{A as Rn}from"./app-chrome-CAqI0L8I.js";const Nn=1024,An=1280;function Ln(e,n=Nn,t=An){const r=e>=n;return{nav:r,reading:r,intelligence:e>=t}}function dt(e){return e===void 0?!1:e.handlers.focusNext!==void 0&&e.handlers.focusPrevious!==void 0}function kn(e){const n=u.useRef(null),[t,r]=u.useState(e??null);return u.useEffect(()=>{const i=n.current;if(!i||typeof ResizeObserver>"u")return;const o=new ResizeObserver(a=>{const g=a[0];g&&r(g.contentRect.width)});o.observe(i);const l=getComputedStyle(i),s=Number.parseFloat(l.paddingLeft)+Number.parseFloat(l.paddingRight);return r(i.clientWidth-s),()=>o.disconnect()},[]),[n,t]}const Ee=u.createContext(null);Ee.displayName="PanelGroupContext";const H={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Ge=10,se=u.useLayoutEffect,Ve=En.useId,Dn=typeof Ve=="function"?Ve:()=>null;let Mn=0;function We(e=null){const n=Dn(),t=u.useRef(e||n||null);return t.current===null&&(t.current=""+Mn++),e??t.current}function nn({children:e,className:n="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:s,minSize:a,onCollapse:g,onExpand:w,onResize:f,order:c,style:z,tagName:h="div",...E}){const C=u.useContext(Ee);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:P,expandPanel:N,getPanelSize:k,getPanelStyle:D,groupId:O,isPanelCollapsed:I,reevaluatePanelConstraints:v,registerPanel:V,resizePanel:B,unregisterPanel:F}=C,W=We(l),L=u.useRef({callbacks:{onCollapse:g,onExpand:w,onResize:f},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:s,minSize:a},id:W,idIsFromProps:l!==void 0,order:c});u.useRef({didLogMissingDefaultSizeWarning:!1}),se(()=>{const{callbacks:j,constraints:$}=L.current,G={...$};L.current.id=W,L.current.idIsFromProps=l!==void 0,L.current.order=c,j.onCollapse=g,j.onExpand=w,j.onResize=f,$.collapsedSize=t,$.collapsible=r,$.defaultSize=i,$.maxSize=s,$.minSize=a,(G.collapsedSize!==$.collapsedSize||G.collapsible!==$.collapsible||G.maxSize!==$.maxSize||G.minSize!==$.minSize)&&v(L.current,G)}),se(()=>{const j=L.current;return V(j),()=>{F(j)}},[c,W,V,F]),u.useImperativeHandle(o,()=>({collapse:()=>{P(L.current)},expand:j=>{N(L.current,j)},getId(){return W},getSize(){return k(L.current)},isCollapsed(){return I(L.current)},isExpanded(){return!I(L.current)},resize:j=>{B(L.current,j)}}),[P,N,k,I,W,B]);const U=D(L.current,i);return u.createElement(h,{...E,children:e,className:n,id:W,style:{...U,...z},[H.groupId]:O,[H.panel]:"",[H.panelCollapsible]:r||void 0,[H.panelId]:W,[H.panelSize]:parseFloat(""+U.flexGrow).toFixed(1)})}const tn=u.forwardRef((e,n)=>u.createElement(nn,{...e,forwardedRef:n}));nn.displayName="Panel";tn.displayName="forwardRef(Panel)";let je=null,Pe=-1,ne=null;function Hn(e,n){if(n){const t=(n&an)!==0,r=(n&cn)!==0,i=(n&un)!==0,o=(n&dn)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function $n(){ne!==null&&(document.head.removeChild(ne),je=null,ne=null,Pe=-1)}function Le(e,n){var t,r;const i=Hn(e,n);if(je!==i){if(je=i,ne===null&&(ne=document.createElement("style"),document.head.appendChild(ne)),Pe>=0){var o;(o=ne.sheet)===null||o===void 0||o.removeRule(Pe)}Pe=(t=(r=ne.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function rn(e){return e.type==="keydown"}function on(e){return e.type.startsWith("pointer")}function ln(e){return e.type.startsWith("mouse")}function Ie(e){if(on(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(ln(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function _n(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function jn(e,n,t){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function Gn(e,n){if(e===n)throw new Error("Cannot compare node with itself");const t={a:qe(e),b:qe(n)};let r;for(;t.a.at(-1)===t.b.at(-1);)e=t.a.pop(),n=t.b.pop(),r=e;S(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let s=o.length;for(;s--;){const a=o[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(i.a-i.b)}const Wn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Fn(e){var n;const t=getComputedStyle((n=sn(e))!==null&&n!==void 0?n:e).display;return t==="flex"||t==="inline-flex"}function Bn(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||Fn(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||Wn.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function Ke(e){let n=e.length;for(;n--;){const t=e[n];if(S(t,"Missing node"),Bn(t))return t}return null}function Ue(e){return e&&Number(getComputedStyle(e).zIndex)||0}function qe(e){const n=[];for(;e;)n.push(e),e=sn(e);return n}function sn(e){const{parentNode:n}=e;return n&&n instanceof ShadowRoot?n.host:n}const an=1,cn=2,un=4,dn=8,Tn=_n()==="coarse";let X=[],pe=!1,le=new Map,Re=new Map;const ve=new Set;function On(e,n,t,r,i){var o;const{ownerDocument:l}=n,s={direction:t,element:n,hitAreaMargins:r,setResizeHandlerState:i},a=(o=le.get(l))!==null&&o!==void 0?o:0;return le.set(l,a+1),ve.add(s),we(),function(){var w;Re.delete(e),ve.delete(s);const f=(w=le.get(l))!==null&&w!==void 0?w:1;if(le.set(l,f-1),we(),f===1&&le.delete(l),X.includes(s)){const c=X.indexOf(s);c>=0&&X.splice(c,1),Be(),i("up",!0,null)}}}function Vn(e){const{target:n}=e,{x:t,y:r}=Ie(e);pe=!0,Fe({target:n,x:t,y:r}),we(),X.length>0&&(Ce("down",e),e.preventDefault(),fn(n)||e.stopImmediatePropagation())}function ke(e){const{x:n,y:t}=Ie(e);if(pe&&e.buttons===0&&(pe=!1,Ce("up",e)),!pe){const{target:r}=e;Fe({target:r,x:n,y:t})}Ce("move",e),Be(),X.length>0&&e.preventDefault()}function De(e){const{target:n}=e,{x:t,y:r}=Ie(e);Re.clear(),pe=!1,X.length>0&&(e.preventDefault(),fn(n)||e.stopImmediatePropagation()),Ce("up",e),Fe({target:n,x:t,y:r}),Be(),we()}function fn(e){let n=e;for(;n;){if(n.hasAttribute(H.resizeHandle))return!0;n=n.parentElement}return!1}function Fe({target:e,x:n,y:t}){X.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),ve.forEach(i=>{const{element:o,hitAreaMargins:l}=i,s=o.getBoundingClientRect(),{bottom:a,left:g,right:w,top:f}=s,c=Tn?l.coarse:l.fine;if(n>=g-c&&n<=w+c&&t>=f-c&&t<=a+c){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&Gn(r,o)>0){let h=r,E=!1;for(;h&&!h.contains(o);){if(jn(h.getBoundingClientRect(),s)){E=!0;break}h=h.parentElement}if(E)return}X.push(i)}})}function Me(e,n){Re.set(e,n)}function Be(){let e=!1,n=!1;X.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:n=!0});let t=0;Re.forEach(r=>{t|=r}),e&&n?Le("intersection",t):e?Le("horizontal",t):n?Le("vertical",t):$n()}let He=new AbortController;function we(){He.abort(),He=new AbortController;const e={capture:!0,signal:He.signal};ve.size&&(pe?(X.length>0&&le.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("contextmenu",De,e),r.addEventListener("pointerleave",ke,e),r.addEventListener("pointermove",ke,e))}),window.addEventListener("pointerup",De,e),window.addEventListener("pointercancel",De,e)):le.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("pointerdown",Vn,e),r.addEventListener("pointermove",ke,e))}))}function Ce(e,n){ve.forEach(t=>{const{setResizeHandlerState:r}=t,i=X.includes(t);r(e,i,n)})}function Kn(){const[e,n]=u.useState(0);return u.useCallback(()=>n(t=>t+1),[])}function S(e,n){if(!e)throw console.error(n),Error(n)}function ae(e,n,t=Ge){return e.toFixed(t)===n.toFixed(t)?0:e>n?1:-1}function Z(e,n,t=Ge){return ae(e,n,t)===0}function K(e,n,t){return ae(e,n,t)===0}function Un(e,n,t){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=n[r];if(!K(i,o,t))return!1}return!0}function fe({panelConstraints:e,panelIndex:n,size:t}){const r=e[n];S(r!=null,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:s=0}=r;if(ae(t,s)<0)if(o){const a=(i+s)/2;ae(t,a)<0?t=i:t=s}else t=s;return t=Math.min(l,t),t=parseFloat(t.toFixed(Ge)),t}function xe({delta:e,initialLayout:n,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(K(e,0))return n;const l=[...n],[s,a]=r;S(s!=null,"Invalid first pivot index"),S(a!=null,"Invalid second pivot index");let g=0;if(o==="keyboard"){{const f=e<0?a:s,c=t[f];S(c,`Panel constraints not found for index ${f}`);const{collapsedSize:z=0,collapsible:h,minSize:E=0}=c;if(h){const C=n[f];if(S(C!=null,`Previous layout not found for panel index ${f}`),K(C,z)){const P=E-C;ae(P,Math.abs(e))>0&&(e=e<0?0-P:P)}}}{const f=e<0?s:a,c=t[f];S(c,`No panel constraints found for index ${f}`);const{collapsedSize:z=0,collapsible:h,minSize:E=0}=c;if(h){const C=n[f];if(S(C!=null,`Previous layout not found for panel index ${f}`),K(C,E)){const P=C-z;ae(P,Math.abs(e))>0&&(e=e<0?0-P:P)}}}}{const f=e<0?1:-1;let c=e<0?a:s,z=0;for(;;){const E=n[c];S(E!=null,`Previous layout not found for panel index ${c}`);const P=fe({panelConstraints:t,panelIndex:c,size:100})-E;if(z+=P,c+=f,c<0||c>=t.length)break}const h=Math.min(Math.abs(e),Math.abs(z));e=e<0?0-h:h}{let c=e<0?s:a;for(;c>=0&&c<t.length;){const z=Math.abs(e)-Math.abs(g),h=n[c];S(h!=null,`Previous layout not found for panel index ${c}`);const E=h-z,C=fe({panelConstraints:t,panelIndex:c,size:E});if(!K(h,C)&&(g+=h-C,l[c]=C,g.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?c--:c++}}if(Un(i,l))return i;{const f=e<0?a:s,c=n[f];S(c!=null,`Previous layout not found for panel index ${f}`);const z=c+g,h=fe({panelConstraints:t,panelIndex:f,size:z});if(l[f]=h,!K(h,z)){let E=z-h,P=e<0?a:s;for(;P>=0&&P<t.length;){const N=l[P];S(N!=null,`Previous layout not found for panel index ${P}`);const k=N+E,D=fe({panelConstraints:t,panelIndex:P,size:k});if(K(N,D)||(E-=D-N,l[P]=D),K(E,0))break;e>0?P--:P++}}}const w=l.reduce((f,c)=>c+f,0);return K(w,100)?l:i}function qn({layout:e,panelsArray:n,pivotIndices:t}){let r=0,i=100,o=0,l=0;const s=t[0];S(s!=null,"No pivot index found"),n.forEach((f,c)=>{const{constraints:z}=f,{maxSize:h=100,minSize:E=0}=z;c===s?(r=E,i=h):(o+=E,l+=h)});const a=Math.min(i,100-o),g=Math.max(r,100-l),w=e[s];return{valueMax:a,valueMin:g,valueNow:w}}function ye(e,n=document){return Array.from(n.querySelectorAll(`[${H.resizeHandleId}][data-panel-group-id="${e}"]`))}function pn(e,n,t=document){const i=ye(e,t).findIndex(o=>o.getAttribute(H.resizeHandleId)===n);return i??null}function gn(e,n,t){const r=pn(e,n,t);return r!=null?[r,r+1]:[-1,-1]}function hn(e,n=document){var t;if(n instanceof HTMLElement&&(n==null||(t=n.dataset)===null||t===void 0?void 0:t.panelGroupId)==e)return n;const r=n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Ne(e,n=document){const t=n.querySelector(`[${H.resizeHandleId}="${e}"]`);return t||null}function Xn(e,n,t,r=document){var i,o,l,s;const a=Ne(n,r),g=ye(e,r),w=a?g.indexOf(a):-1,f=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,c=(l=(s=t[w+1])===null||s===void 0?void 0:s.id)!==null&&l!==void 0?l:null;return[f,c]}function Jn({committedValuesRef:e,eagerValuesRef:n,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){u.useRef({didWarnAboutMissingResizeHandle:!1}),se(()=>{if(!o)return;const s=ye(t,o);for(let a=0;a<i.length-1;a++){const{valueMax:g,valueMin:w,valueNow:f}=qn({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),c=s[a];if(c!=null){const z=i[a];S(z,`No panel data found for index "${a}"`),c.setAttribute("aria-controls",z.id),c.setAttribute("aria-valuemax",""+Math.round(g)),c.setAttribute("aria-valuemin",""+Math.round(w)),c.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{s.forEach((a,g)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[t,r,i,o]),u.useEffect(()=>{if(!o)return;const s=n.current;S(s,"Eager values not found");const{panelDataArray:a}=s,g=hn(t,o);S(g!=null,`No group found for id "${t}"`);const w=ye(t,o);S(w,`No resize handles found for group id "${t}"`);const f=w.map(c=>{const z=c.getAttribute(H.resizeHandleId);S(z,"Resize handle element has no handle id attribute");const[h,E]=Xn(t,z,a,o);if(h==null||E==null)return()=>{};const C=P=>{if(!P.defaultPrevented)switch(P.key){case"Enter":{P.preventDefault();const N=a.findIndex(k=>k.id===h);if(N>=0){const k=a[N];S(k,`No panel data found for index ${N}`);const D=r[N],{collapsedSize:O=0,collapsible:I,minSize:v=0}=k.constraints;if(D!=null&&I){const V=xe({delta:K(D,O)?v-O:O-D,initialLayout:r,panelConstraints:a.map(B=>B.constraints),pivotIndices:gn(t,z,o),prevLayout:r,trigger:"keyboard"});r!==V&&l(V)}}break}}};return c.addEventListener("keydown",C),()=>{c.removeEventListener("keydown",C)}});return()=>{f.forEach(c=>c())}},[o,e,n,t,r,i,l])}function Xe(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function mn(e,n){const t=e==="horizontal",{x:r,y:i}=Ie(n);return t?r:i}function Yn(e,n,t,r,i){const o=t==="horizontal",l=Ne(n,i);S(l,`No resize handle element found for id "${n}"`);const s=l.getAttribute(H.groupId);S(s,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=r;const g=mn(t,e),w=hn(s,i);S(w,`No group element found for id "${s}"`);const f=w.getBoundingClientRect(),c=o?f.width:f.height;return(g-a)/c*100}function Zn(e,n,t,r,i,o){if(rn(e)){const l=t==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=l?0:s;break;case"ArrowLeft":a=l?-s:0;break;case"ArrowRight":a=l?s:0;break;case"ArrowUp":a=l?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Yn(e,n,t,r,o)}function Qn({panelDataArray:e}){const n=Array(e.length),t=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const l=t[o];S(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;s!=null&&(r++,n[o]=s,i-=s)}for(let o=0;o<e.length;o++){const l=t[o];S(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;if(s!=null)continue;const a=e.length-r,g=i/a;r++,n[o]=g,i-=g}return n}function ue(e,n,t){n.forEach((r,i)=>{const o=e[i];S(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:s,id:a}=o,{collapsedSize:g=0,collapsible:w}=s,f=t[a];if(f==null||r!==f){t[a]=r;const{onCollapse:c,onExpand:z,onResize:h}=l;h&&h(r,f),w&&(c||z)&&(z&&(f==null||Z(f,g))&&!Z(r,g)&&z(),c&&(f==null||!Z(f,g))&&Z(r,g)&&c())}})}function be(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!=n[t])return!1;return!0}function et({defaultSize:e,dragState:n,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let s;return l==null?s=e!=null?e.toPrecision(o):"1":r.length===1?s="1":s=l.toPrecision(o),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:n!==null?"none":void 0}}function nt(e,n=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{e(...i)},n)}}function Je(e){try{if(typeof localStorage<"u")e.getItem=n=>localStorage.getItem(n),e.setItem=(n,t)=>{localStorage.setItem(n,t)};else throw new Error("localStorage not supported in this environment")}catch(n){console.error(n),e.getItem=()=>null,e.setItem=()=>{}}}function xn(e){return`react-resizable-panels:${e}`}function zn(e){return e.map(n=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=n;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((n,t)=>n.localeCompare(t)).join(",")}function vn(e,n){try{const t=xn(e),r=n.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function tt(e,n,t){var r,i;const o=(r=vn(e,t))!==null&&r!==void 0?r:{},l=zn(n);return(i=o[l])!==null&&i!==void 0?i:null}function rt(e,n,t,r,i){var o;const l=xn(e),s=zn(n),a=(o=vn(e,i))!==null&&o!==void 0?o:{};a[s]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(a))}catch(g){console.error(g)}}function Ye({layout:e,panelConstraints:n}){const t=[...e],r=t.reduce((o,l)=>o+l,0);if(t.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!K(r,100)&&t.length>0)for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=100/r*l;t[o]=s}let i=0;for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=fe({panelConstraints:n,panelIndex:o,size:l});l!=s&&(i+=l-s,t[o]=s)}if(!K(i,0))for(let o=0;o<n.length;o++){const l=t[o];S(l!=null,`No layout data found for index ${o}`);const s=l+i,a=fe({panelConstraints:n,panelIndex:o,size:s});if(l!==a&&(i-=a-l,t[o]=a,K(i,0)))break}return t}const ot=100,ze={getItem:e=>(Je(ze),ze.getItem(e)),setItem:(e,n)=>{Je(ze),ze.setItem(e,n)}},Ze={};function yn({autoSaveId:e=null,children:n,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:s=null,storage:a=ze,style:g,tagName:w="div",...f}){const c=We(o),z=u.useRef(null),[h,E]=u.useState(null),[C,P]=u.useState([]),N=Kn(),k=u.useRef({}),D=u.useRef(new Map),O=u.useRef(0),I=u.useRef({autoSaveId:e,direction:r,dragState:h,id:c,keyboardResizeBy:s,onLayout:l,storage:a}),v=u.useRef({layout:C,panelDataArray:[],panelDataArrayChanged:!1});u.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),u.useImperativeHandle(i,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:d}=v.current;return d},setLayout:d=>{const{onLayout:x}=I.current,{layout:b,panelDataArray:m}=v.current,p=Ye({layout:d,panelConstraints:m.map(y=>y.constraints)});Xe(b,p)||(P(p),v.current.layout=p,x&&x(p),ue(m,p,k.current))}}),[]),se(()=>{I.current.autoSaveId=e,I.current.direction=r,I.current.dragState=h,I.current.id=c,I.current.onLayout=l,I.current.storage=a}),Jn({committedValuesRef:I,eagerValuesRef:v,groupId:c,layout:C,panelDataArray:v.current.panelDataArray,setLayout:P,panelGroupElement:z.current}),u.useEffect(()=>{const{panelDataArray:d}=v.current;if(e){if(C.length===0||C.length!==d.length)return;let x=Ze[e];x==null&&(x=nt(rt,ot),Ze[e]=x);const b=[...d],m=new Map(D.current);x(e,b,m,C,a)}},[e,C,a]),u.useEffect(()=>{});const V=u.useCallback(d=>{const{onLayout:x}=I.current,{layout:b,panelDataArray:m}=v.current;if(d.constraints.collapsible){const p=m.map(J=>J.constraints),{collapsedSize:y=0,panelSize:R,pivotIndices:_}=ie(m,d,b);if(S(R!=null,`Panel size not found for panel "${d.id}"`),!Z(R,y)){D.current.set(d.id,R);const Y=de(m,d)===m.length-1?R-y:y-R,M=xe({delta:Y,initialLayout:b,panelConstraints:p,pivotIndices:_,prevLayout:b,trigger:"imperative-api"});be(b,M)||(P(M),v.current.layout=M,x&&x(M),ue(m,M,k.current))}}},[]),B=u.useCallback((d,x)=>{const{onLayout:b}=I.current,{layout:m,panelDataArray:p}=v.current;if(d.constraints.collapsible){const y=p.map(q=>q.constraints),{collapsedSize:R=0,panelSize:_=0,minSize:J=0,pivotIndices:Y}=ie(p,d,m),M=x??J;if(Z(_,R)){const q=D.current.get(d.id),ge=q!=null&&q>=M?q:M,Ae=de(p,d)===p.length-1?_-ge:ge-_,T=xe({delta:Ae,initialLayout:m,panelConstraints:y,pivotIndices:Y,prevLayout:m,trigger:"imperative-api"});be(m,T)||(P(T),v.current.layout=T,b&&b(T),ue(p,T,k.current))}}},[]),F=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{panelSize:m}=ie(b,d,x);return S(m!=null,`Panel size not found for panel "${d.id}"`),m},[]),W=u.useCallback((d,x)=>{const{panelDataArray:b}=v.current,m=de(b,d);return et({defaultSize:x,dragState:h,layout:C,panelData:b,panelIndex:m})},[h,C]),L=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{collapsedSize:m=0,collapsible:p,panelSize:y}=ie(b,d,x);return S(y!=null,`Panel size not found for panel "${d.id}"`),p===!0&&Z(y,m)},[]),U=u.useCallback(d=>{const{layout:x,panelDataArray:b}=v.current,{collapsedSize:m=0,collapsible:p,panelSize:y}=ie(b,d,x);return S(y!=null,`Panel size not found for panel "${d.id}"`),!p||ae(y,m)>0},[]),j=u.useCallback(d=>{const{panelDataArray:x}=v.current;x.push(d),x.sort((b,m)=>{const p=b.order,y=m.order;return p==null&&y==null?0:p==null?-1:y==null?1:p-y}),v.current.panelDataArrayChanged=!0,N()},[N]);se(()=>{if(v.current.panelDataArrayChanged){v.current.panelDataArrayChanged=!1;const{autoSaveId:d,onLayout:x,storage:b}=I.current,{layout:m,panelDataArray:p}=v.current;let y=null;if(d){const _=tt(d,p,b);_&&(D.current=new Map(Object.entries(_.expandToSizes)),y=_.layout)}y==null&&(y=Qn({panelDataArray:p}));const R=Ye({layout:y,panelConstraints:p.map(_=>_.constraints)});Xe(m,R)||(P(R),v.current.layout=R,x&&x(R),ue(p,R,k.current))}}),se(()=>{const d=v.current;return()=>{d.layout=[]}},[]);const $=u.useCallback(d=>{let x=!1;const b=z.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(x=!0),function(p){p.preventDefault();const y=z.current;if(!y)return()=>null;const{direction:R,dragState:_,id:J,keyboardResizeBy:Y,onLayout:M}=I.current,{layout:q,panelDataArray:ge}=v.current,{initialLayout:Se}=_??{},Ae=gn(J,d,y);let T=Zn(p,d,R,_,Y,y);const Te=R==="horizontal";Te&&x&&(T=-T);const wn=ge.map(Cn=>Cn.constraints),he=xe({delta:T,initialLayout:Se??q,panelConstraints:wn,pivotIndices:Ae,prevLayout:q,trigger:rn(p)?"keyboard":"mouse-or-touch"}),Oe=!be(q,he);(on(p)||ln(p))&&O.current!=T&&(O.current=T,!Oe&&T!==0?Te?Me(d,T<0?an:cn):Me(d,T<0?un:dn):Me(d,0)),Oe&&(P(he),v.current.layout=he,M&&M(he),ue(ge,he,k.current))}},[]),G=u.useCallback((d,x)=>{const{onLayout:b}=I.current,{layout:m,panelDataArray:p}=v.current,y=p.map(q=>q.constraints),{panelSize:R,pivotIndices:_}=ie(p,d,m);S(R!=null,`Panel size not found for panel "${d.id}"`);const Y=de(p,d)===p.length-1?R-x:x-R,M=xe({delta:Y,initialLayout:m,panelConstraints:y,pivotIndices:_,prevLayout:m,trigger:"imperative-api"});be(m,M)||(P(M),v.current.layout=M,b&&b(M),ue(p,M,k.current))},[]),te=u.useCallback((d,x)=>{const{layout:b,panelDataArray:m}=v.current,{collapsedSize:p=0,collapsible:y}=x,{collapsedSize:R=0,collapsible:_,maxSize:J=100,minSize:Y=0}=d.constraints,{panelSize:M}=ie(m,d,b);M!=null&&(y&&_&&Z(M,p)?Z(p,R)||G(d,R):M<Y?G(d,Y):M>J&&G(d,J))},[G]),ce=u.useCallback((d,x)=>{const{direction:b}=I.current,{layout:m}=v.current;if(!z.current)return;const p=Ne(d,z.current);S(p,`Drag handle element not found for id "${d}"`);const y=mn(b,x);E({dragHandleId:d,dragHandleRect:p.getBoundingClientRect(),initialCursorPosition:y,initialLayout:m})},[]),re=u.useCallback(()=>{E(null)},[]),oe=u.useCallback(d=>{const{panelDataArray:x}=v.current,b=de(x,d);b>=0&&(x.splice(b,1),delete k.current[d.id],v.current.panelDataArrayChanged=!0,N())},[N]),Q=u.useMemo(()=>({collapsePanel:V,direction:r,dragState:h,expandPanel:B,getPanelSize:F,getPanelStyle:W,groupId:c,isPanelCollapsed:L,isPanelExpanded:U,reevaluatePanelConstraints:te,registerPanel:j,registerResizeHandle:$,resizePanel:G,startDragging:ce,stopDragging:re,unregisterPanel:oe,panelGroupElement:z.current}),[V,h,r,B,F,W,c,L,U,te,j,$,G,ce,re,oe]),ee={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return u.createElement(Ee.Provider,{value:Q},u.createElement(w,{...f,children:n,className:t,id:o,ref:z,style:{...ee,...g},[H.group]:"",[H.groupDirection]:r,[H.groupId]:c}))}const Sn=u.forwardRef((e,n)=>u.createElement(yn,{...e,forwardedRef:n}));yn.displayName="PanelGroup";Sn.displayName="forwardRef(PanelGroup)";function de(e,n){return e.findIndex(t=>t===n||t.id===n.id)}function ie(e,n,t){const r=de(e,n),o=r===e.length-1?[r-1,r]:[r,r+1],l=t[r];return{...n.constraints,panelSize:l,pivotIndices:o}}function it({disabled:e,handleId:n,resizeHandler:t,panelGroupElement:r}){u.useEffect(()=>{if(e||t==null||r==null)return;const i=Ne(n,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const s=i.getAttribute(H.groupId);S(s,`No group element found for id "${s}"`);const a=ye(s,r),g=pn(s,n,r);S(g!==null,`No resize element found for id "${n}"`);const w=l.shiftKey?g>0?g-1:a.length-1:g+1<a.length?g+1:0;a[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,n,t])}function bn({children:e=null,className:n="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:s,onFocus:a,onPointerDown:g,onPointerUp:w,style:f={},tabIndex:c=0,tagName:z="div",...h}){var E,C;const P=u.useRef(null),N=u.useRef({onClick:l,onDragging:s,onPointerDown:g,onPointerUp:w});u.useEffect(()=>{N.current.onClick=l,N.current.onDragging=s,N.current.onPointerDown=g,N.current.onPointerUp=w});const k=u.useContext(Ee);if(k===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:O,registerResizeHandle:I,startDragging:v,stopDragging:V,panelGroupElement:B}=k,F=We(i),[W,L]=u.useState("inactive"),[U,j]=u.useState(!1),[$,G]=u.useState(null),te=u.useRef({state:W});se(()=>{te.current.state=W}),u.useEffect(()=>{if(t)G(null);else{const Q=I(F);G(()=>Q)}},[t,F,I]);const ce=(E=r?.coarse)!==null&&E!==void 0?E:15,re=(C=r?.fine)!==null&&C!==void 0?C:5;u.useEffect(()=>{if(t||$==null)return;const Q=P.current;S(Q,"Element ref not attached");let ee=!1;return On(F,Q,D,{coarse:ce,fine:re},(x,b,m)=>{if(!b){L("inactive");return}switch(x){case"down":{L("drag"),ee=!1,S(m,'Expected event to be defined for "down" action'),v(F,m);const{onDragging:p,onPointerDown:y}=N.current;p?.(!0),y?.();break}case"move":{const{state:p}=te.current;ee=!0,p!=="drag"&&L("hover"),S(m,'Expected event to be defined for "move" action'),$(m);break}case"up":{L("hover"),V();const{onClick:p,onDragging:y,onPointerUp:R}=N.current;y?.(!1),R?.(),ee||p?.();break}}})},[ce,D,t,re,I,F,$,v,V]),it({disabled:t,handleId:F,resizeHandler:$,panelGroupElement:B});const oe={touchAction:"none",userSelect:"none"};return u.createElement(z,{...h,children:e,className:n,id:i,onBlur:()=>{j(!1),o?.()},onFocus:()=>{j(!0),a?.()},ref:P,role:"separator",style:{...oe,...f},tabIndex:c,[H.groupDirection]:D,[H.groupId]:O,[H.resizeHandle]:"",[H.resizeHandleActive]:W==="drag"?"pointer":U?"keyboard":void 0,[H.resizeHandleEnabled]:!t,[H.resizeHandleId]:F,[H.resizeHandleState]:W})}bn.displayName="PanelResizeHandle";function Qe({className:e,...n}){return A.jsx(Sn,{className:en("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...n})}const me=tn;function $e({className:e,...n}){return A.jsx(bn,{className:en("relative w-px shrink-0 bg-line transition-colors cursor-col-resize","after:absolute after:inset-y-0 after:left-1/2 after:w-1.5 after:-translate-x-1/2","data-[resize-handle-state=hover]:bg-line-strong","data-[resize-handle-state=drag]:bg-accent","focus-visible:outline-none focus-visible:bg-accent",e),...n})}function lt({className:e,children:n}){const t=u.useRef(null),[r,i]=u.useState(null);return u.useEffect(()=>{const o=t.current?.parentElement;if(!o||typeof ResizeObserver>"u")return;const l=()=>{const a=Math.floor(o.getBoundingClientRect().width);i(g=>g===a?g:a)};l();const s=new ResizeObserver(l);return s.observe(o),()=>s.disconnect()},[]),A.jsx("div",{ref:t,className:e,style:r===null?void 0:{width:`${r}px`},children:n})}const Pn=u.createContext(null);function st(e,n){return e==="list"?{size:62,max:78}:e==="detail"?{size:26,max:45}:{size:n==="compact"?43:33,max:58}}function ft(){return u.useContext(Pn)}function pt({nav:e,list:n,reading:t,intelligence:r,intelligenceOpen:i=!0,hasThread:o=!0,density:l="comfortable",listBias:s="balanced",header:a,topBar:g,appBar:w,overlay:f,skeleton:c,isLoading:z=!1,initialWidth:h,navOpen:E,onOpenNav:C,onCloseNav:P}){const[N,k]=kn(h),D=Ln(k??0),[O,I]=u.useState(!1),v=D.nav,V=v&&!O,B=D.reading&&!!t,F=D.intelligence,[W,L]=u.useState(!1),U=E!==void 0,j=U?E:W,$=()=>{U||L(!0),C?.()},G=()=>{U||L(!1),P?.()},te=F&&i&&o&&!!r,re={panes:D,containerWidth:k,showNavPane:v,openNav:$,navCollapsed:O,toggleNav:()=>{if(!v){j?G():$();return}I(d=>!d)},showReadingPane:B,showIntelligencePane:F},oe=st(s,l),Q=A.jsxs(Qe,{direction:"horizontal",className:"min-h-0 flex-1",children:[A.jsx(me,{id:"list",order:1,defaultSize:B?oe.size:100,minSize:22,maxSize:B?oe.max:100,className:"min-w-0",children:n}),B&&A.jsxs(A.Fragment,{children:[A.jsx($e,{}),A.jsx(me,{id:"reading",order:2,minSize:29,className:"min-w-0",children:A.jsx(lt,{className:"h-full",children:t})})]}),te&&A.jsxs(A.Fragment,{children:[A.jsx($e,{}),A.jsx(me,{id:"intelligence",order:3,defaultSize:25,minSize:18,maxSize:39,className:"min-w-0",children:r})]})]},B?"list-reading":"list-only"),ee=A.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[!v&&a&&A.jsx("div",{className:"shrink-0",children:a}),Q]});return A.jsx(Pn.Provider,{value:re,children:A.jsxs("div",{ref:N,className:"safe-area-frame @container flex h-full w-full flex-col overflow-hidden bg-canvas font-sans text-fg",children:[A.jsx(Rn,{topBar:g,appBar:w,children:z&&c?c:V?A.jsxs(Qe,{direction:"horizontal",className:"min-h-0 flex-1",children:[A.jsx(me,{id:"nav",order:1,defaultSize:17,minSize:12,maxSize:24,className:"min-w-0",children:e}),A.jsx($e,{}),A.jsx(me,{id:"content",order:2,className:"flex min-w-0 flex-col",children:ee})]}):ee}),!(z&&c)&&A.jsxs(A.Fragment,{children:[!v&&A.jsx(In,{open:j,onClose:G,title:"Folders",anchor:"left",children:e}),f]})]})})}const _e="search-scope";function at(e){const n=e.trim().replace(/\s+/g," ").toLowerCase();return/\s/.test(n)?`in:"${n}"`:`in:${n}`}function gt(e){return e.list!==void 0&&e.list!=="brief"}function ht(e){return e.list==="mailbox"?e.mailboxId:void 0}function mt(e,n){return e.list==="flagged"?{kind:"scoped",chip:{id:_e,label:"is:starred"}}:e.list==="outbox"?{kind:"scoped",chip:{id:_e,label:"in:outbox"}}:e.list==="mailbox"?n?{kind:"scoped",chip:{id:_e,label:at(n)}}:{kind:"pending"}:{kind:"global"}}function xt(e,n,t){return n.kind==="global"?{kind:"global"}:e.list==="flagged"?{kind:"collection"}:{kind:"folder",...t?{role:t}:{}}}export{pt as A,_e as S,xt as a,gt as i,dt as k,ht as r,mt as s,ft as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as z,r as l,j as d,p as y,X as R,bN as G,cc as D,cq as X,cr as J,cs as W,ct as Y,E as k,u as j,Q as Z,R as M,V as ee,W as te,H as ne,cu as E}from"./index-BVIV7uOn.js";import{g as re,j as I,k as se}from"./reply-DtObeSB2.js";import{s as oe,S as ae}from"./search-scope-CuQFKckU.js";import{u as K}from"./useQueries-CFXMrDWB.js";const Ce=z("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"}]]),ie=[{action:"focusNext",keys:["j","k"],label:"navigate"},{action:"muteSender",keys:["m"],label:"mute"},{action:"help",keys:["?"],label:"all shortcuts"}];function Se(e){return ie.filter(t=>e[t.action]!==void 0)}const ce=[{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 le(e){for(const t of ce){const n=t.hints.find(r=>r.action===e);if(n)return n.keys}}function ue(e){const t=le(e);return!t||t.length===0?"":t.length===1?t[0]??"":t[0]==="g"?t.join(" then "):t.join("")}function ve(e){const t=ue(e);return t===""?"":`(${t})`}function de({key:e,shiftKey:t=!1,repeat:n=!1,caretAtStart:r,hasValue:i,chipCount:s}){const a=s-1;return e==="Escape"?i?{type:"clearQuery"}:{type:"blur"}:e==="Tab"&&t?s===0?{type:"none"}:{type:"focusChip",index:a}:e==="Backspace"||e==="ArrowLeft"?!r||s===0?{type:"none"}:n?{type:"none"}:{type:"focusChip",index:a}:{type:"none"}}function fe({key:e,repeat:t=!1,index:n,chipCount:r}){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>=r-1?{type:"focusInput"}:{type:"focusChip",index:n+1}:e==="Enter"||e===" "?{type:"activateChip",index:n}:e==="Escape"?{type:"focusInput"}:{type:"none"}}function pe(e,t){const n=t-1;return n<=0?null:e<n?e:n-1}const q={filter:"border-line bg-surface-sunken text-fg-muted",scope:"border-accent-2/40 bg-accent-2-soft text-accent-2"},me=({label:e,onRemove:t,tone:n="filter",className:r})=>d.jsxs("span",{className:y("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-2xs",q[n],r),children:[d.jsx("span",{children:e}),d.jsx("button",{type:"button",onClick:t,className:"shrink-0 rounded-full p-0.5 hover:bg-fg-muted/20 transition-colors","aria-label":`Remove filter: ${e}`,children:d.jsx(R,{className:"size-3"})})]}),B=l.forwardRef(({label:e,onRemove:t,onActivate:n,tone:r="filter",focused:i=!1,onKeyDown:s,onFocusLabel:a,className:u},f)=>d.jsxs("span",{role:"row",tabIndex:-1,className:y("inline-flex max-w-48 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs transition-colors",q[r],i&&"ring-2 ring-ring",u),children:[d.jsx("button",{ref:f,type:"button",role:"gridcell",tabIndex:i?0:-1,onClick:n,onFocus:a,onKeyDown:s,className:y("block min-w-0 max-w-full truncate rounded-full outline-none",n?"cursor-pointer":"cursor-default"),children:e}),d.jsx("button",{type:"button",role:"gridcell",tabIndex:-1,onClick:t,className:"block shrink-0 rounded-full p-0.5 transition-colors hover:bg-fg-muted/20","aria-label":`Remove filter: ${e}`,children:d.jsx(R,{className:"size-3"})})]}));B.displayName="SearchChipRow";const Te=({tokens:e,className:t})=>e.length===0?null:d.jsx("div",{className:y("flex flex-wrap items-center gap-1.5 border-b border-line bg-surface px-row-inset py-1.5",t),children:e.map(n=>d.jsx(me,{label:n.label,onRemove:n.onRemove},n.label))}),he=e=>e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable:!1,ge=({chips:e=[],onRemoveChip:t,value:n,onChange:r,onClear:i,onClearQuery:s,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:f=!0,size:h="sm",inputId:p,suggest:m,className:x})=>{const O=l.useId(),F=p??O,w=l.useRef(null),$=l.useRef([]),P=s??i,[A,C]=l.useState(null),v=l.useRef(void 0),[H,V]=l.useState(""),T=e.length>0;l.useEffect(()=>{C(o=>o!==null&&o>=e.length?null:o)},[e.length]),l.useEffect(()=>{const o=v.current;if(o!==void 0){if(v.current=void 0,o===null){w.current?.focus();return}$.current[o]?.focus()}});const L=l.useRef(void 0);l.useEffect(()=>{const o=m?.caret;if(!o||o===L.current)return;L.current=o;const c=w.current;!c||c.ownerDocument.activeElement!==c||(c.setSelectionRange(o.cursor,o.cursor),m?.onCaretChange(o.cursor))});const S=o=>{m?.onCaretChange(o.selectionStart??o.value.length)},g=l.useCallback(o=>{C(o),v.current=o},[]),N=l.useCallback(o=>{const c=e[o];c&&t&&(g(pe(o,e.length)),V(`${c.label} removed`),t(c.id))},[e,t,g]),U=l.useCallback(()=>{g(null),i()},[i,g]),Q=l.useCallback(o=>{const c=o.currentTarget;if(m?.onKeyDown(o))return;const b=de({key:o.key,shiftKey:o.shiftKey,repeat:o.repeat,caretAtStart:c.selectionStart===0&&c.selectionEnd===0,hasValue:n.length>0,chipCount:e.length});switch(b.type){case"focusChip":o.preventDefault(),g(b.index);return;case"clearQuery":P();return;case"blur":c.blur();return;case"none":return}},[e.length,n,P,g,m]),_=l.useCallback(o=>c=>{const b=fe({key:c.key,repeat:c.repeat,index:o,chipCount:e.length});switch(b.type!=="none"&&c.preventDefault(),b.type){case"removeChip":N(b.index);return;case"focusChip":g(b.index);return;case"focusInput":g(null);return;case"activateChip":return;case"none":return}},[e,N,g]);return l.useEffect(()=>{if(!u)return;const o=c=>{c.key!=="/"||c.metaKey||c.ctrlKey||c.altKey||he(c.target)||D("focusSearch")||(c.preventDefault(),w.current?.focus())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[u]),d.jsxs("label",{htmlFor:F,className:y("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",h==="lg"?"rounded-xl px-4 py-2":"rounded-md px-2.5 py-1",x),children:[d.jsx(G,{className:y("shrink-0 text-fg-muted pointer-events-none",h==="lg"?"size-5":"size-4")}),d.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:[T&&d.jsx("div",{role:"grid","aria-label":"Search filters",className:"flex min-w-0 flex-wrap items-center gap-1",children:e.map((o,c)=>d.jsx(B,{ref:b=>{$.current[c]=b},label:o.label,tone:o.tone,focused:A===c,onFocusLabel:()=>C(c),onKeyDown:_(c),onRemove:()=>N(c)},o.id))}),d.jsx("input",{ref:w,id:F,name:"q",type:"text","aria-label":"Search mail",autoComplete:"off",value:n,tabIndex:A===null?0:-1,onChange:o=>{r(o.target.value),S(o.target)},onKeyDown:Q,onKeyUp:o=>S(o.currentTarget),onClick:o=>S(o.currentTarget),onFocus:o=>{C(null),m?.onFocusChange?.(!0),S(o.currentTarget)},onBlur:()=>m?.onFocusChange?.(!1),...m?.comboboxProps,placeholder:T?void 0:a,className:"min-w-24 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-muted"})]}),(n||T)&&f&&d.jsx("button",{type:"button",onClick:U,className:"shrink-0 rounded p-0.5 hover:bg-surface-raised transition-colors","aria-label":"Clear search",children:d.jsx(R,{className:y("text-fg-muted",h==="lg"?"size-5":"size-4")})}),d.jsx("span",{role:"status","aria-live":"polite",className:"sr-only",children:H})]})},Ne=({value:e,onChange:t,onClear:n,onClearQuery:r,chips:i,onRemoveChip:s,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:f=!0,size:h,inputId:p,suggest:m,className:x})=>d.jsx(ge,{value:e,onChange:t,onClear:n,onClearQuery:r,chips:i,onRemoveChip:s,placeholder:a,globalFocusKey:u,showClearButton:f,size:h,inputId:p,suggest:m,className:x});function Ee({handlers:e,enabled:t=!0,target:n,sequenceTimeoutMs:r=1e3}){const i=l.useRef(e);i.current=e;const s=l.useRef(null),a=l.useRef(null);l.useEffect(()=>{if(!t)return;const u=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null)},f=p=>{const m=X({key:p.key,shiftKey:p.shiftKey,metaKey:p.metaKey,ctrlKey:p.ctrlKey,altKey:p.altKey,inEditable:W(p.target),onControl:J(p.target)},s.current);if(Y().length>0){u(),s.current=null;return}if(u(),s.current=m.nextPrefix,m.nextPrefix!==null&&(a.current=setTimeout(()=>{s.current=null,a.current=null},r)),m.action===null||D(m.action)!==null)return;const x=i.current[m.action];x&&(m.preventDefault&&p.preventDefault(),x())},h=n===void 0?window:n;if(h!==null)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f),u(),s.current=null}},[t,r,n])}function Re(){const e=k({from:"/mail/brief/$threadId",shouldThrow:!1}),t=k({from:"/mail/brief/$threadId/$messageId",shouldThrow:!1}),n=k({from:"/mail/flagged/$threadId",shouldThrow:!1}),r=k({from:"/mail/flagged/$threadId/$messageId",shouldThrow:!1}),i=k({from:"/mail/$mailboxId/$threadId",shouldThrow:!1}),s=k({from:"/mail/$mailboxId/$threadId/$messageId",shouldThrow:!1}),a=e?.threadId??n?.threadId??i?.threadId,u=t?.messageId??r?.messageId??s?.messageId;return l.useMemo(()=>a?{threadId:a,messageId:u}:void 0,[a,u])}function je(){const e=j(),t=re(),{list:n,mailboxId:r}=I();return l.useCallback((i,s)=>{const a=s?.query,f={search:p=>a===void 0?p:{...p,q:a||void 0},hash:t,replace:s?.replace??!1};if(n==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:i,...f});return}const h=s?.mailboxId??r;if(n==="mailbox"&&h){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:h,...i},...f});return}e({to:"/mail/brief/$threadId/$messageId",params:i,...f})},[e,t,n,r])}function Me(){return se()}function be(){const e=j();return l.useCallback(t=>{e({to:"/mail/brief",search:{q:t||void 0}})},[e])}function Ke(){const e=j();return l.useCallback((t,n)=>{e({to:"/mail/$mailboxId",params:{mailboxId:t},search:{q:n||void 0}})},[e])}const ye=({accounts:e})=>{const{list:t,mailboxId:n}=I(),{t:r}=Z("mail",{useSuspense:!1}),i=l.useCallback((a,u)=>r(a,{defaultValue:u}),[r]),s=K({queries:e.map(a=>({...M({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=s[a]?.data?.items;if(!u)continue;const f=u.find(p=>p.mailboxId===n);if(!f)continue;const h=ee(e[a].folderAppointments);return te(f,h.get(n),i)}return null},Fe=({accounts:e})=>{const{mailboxId:t}=I(),n=K({queries:e.map(r=>({...M({path:{accountId:r.accountId}}),staleTime:1/0}))});if(!t)return null;for(const r of n){const i=r.data?.items;if(!i)continue;const s=i.find(a=>a.mailboxId===t);if(s)return s.unseenCount}return null},$e=({accounts:e})=>{const{mailboxId:t}=I(),n=K({queries:e.map(r=>({...M({path:{accountId:r.accountId}}),staleTime:1/0}))});if(!t)return 0;for(const r of n){const i=r.data?.items;if(!i)continue;const s=i.find(a=>a.mailboxId===t);if(s)return s.messageCount}return 0};function Pe(e){const t=be(),{searchInput:n}=ne(),r=ye({accounts:e}),i=I(),s=l.useMemo(()=>oe(i,r),[i,r]),a=l.useCallback(u=>{u===ae&&t(n)},[t,n]);return{scope:s,clearScope:a}}function Ae(e){const t=new Map;for(const n of e){const r=n.email.toLowerCase(),i=r.split("@")[0];i&&!t.has(i)&&t.set(i,n.accountId),t.has(r)||t.set(r,n.accountId)}return t}function Le(e){const t=new Map;for(const n of e)for(const r of n){const i=r.fullPath?.toLowerCase();if(!i)continue;const s=E(r).toLowerCase();t.has(i)||t.set(i,r.mailboxId),t.has(s)||t.set(s,r.mailboxId)}return t}function De(e,t=[]){const n=e.flat().filter(s=>s.fullPath),r=new Map;for(const s of n){const a=E(s).toLowerCase();r.set(a,(r.get(a)??0)+1)}const i=new Map(t.map(s=>[s.accountId,s.email]));return n.map(s=>{const a=E(s),u=r.get(a.toLowerCase())===1,f=t.length>1?i.get(s.accountId):void 0;return{value:u?a:s.fullPath,label:s.displayNameOverride?.trim()||a,...f?{hint:f}:{}}})}function qe(e){const t=new Map;for(const n of e){const r=n.email.toLowerCase().split("@")[0]??"";t.set(r,(t.get(r)??0)+1)}return e.map(n=>{const r=n.email.split("@")[0]??n.email,i=t.get(r.toLowerCase())===1,s=n.displayName?.trim();return{value:i?r:n.email,label:s||n.email,...s?{hint:n.email}:{}}})}export{Ce as B,ce as K,Ne as S,Re as a,Le as b,Ee as c,Ae as d,je as e,Me as f,ye as g,Fe as h,$e as i,ie as j,Se as k,Te as l,De as m,qe as n,Ke as o,ue as s,ve as t,Pe as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e,r as s}from"./index-
|
|
1
|
+
import{u as e,r as s}from"./index-BVIV7uOn.js";const a={brief:"/mail/brief",flagged:"/mail/flagged",outbox:"/mail/outbox",settings:"/settings",accounts:"/settings/accounts",importConfig:"/import"};function c(){const t=e();return s.useCallback(o=>{t({to:a[o]})},[t])}function i(){const t=e();return s.useCallback(o=>{t({to:"/settings/accounts",search:{editAccountId:o,focusSmtp:!0}})},[t])}export{i as a,c as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,p as x}from"./index-BVIV7uOn.js";const f={sm:"min-h-9 px-3 text-xs",md:"min-h-11 px-4 text-sm"};function h({name:l,options:r,value:s,onChange:d,size:i="md","aria-label":o}){const c=r.findIndex(e=>e.value===s);return a.jsx("div",{role:"radiogroup","aria-label":o,className:"inline-flex rounded-md border border-line bg-surface-sunken p-0.5",children:r.map((e,n)=>{const t=e.value===s,u=!t&&n<r.length-1&&c!==n+1;return a.jsxs("label",{className:x("relative flex cursor-pointer items-center justify-center rounded-[5px] font-medium transition-colors",f[i],t?"bg-surface text-fg shadow":"text-fg-muted hover:text-fg",u&&"after:pointer-events-none after:absolute after:right-0 after:top-1/4 after:h-1/2 after:w-px after:bg-line"),children:[a.jsx("input",{type:"radio",name:l,value:e.value,checked:t,onChange:()=>d(e.value),className:"sr-only"}),e.label]},e.value)})})}export{h as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,p as o}from"./index-BVIV7uOn.js";import{C as a}from"./chevron-down-BI1fWP0V.js";function p({icon:n,className:s,children:t,ref:r,...i}){return e.jsxs("div",{className:o("relative flex h-9 items-center gap-2 rounded-md border border-line bg-surface-sunken pl-3 text-sm","focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors",s),children:[n&&e.jsx("span",{className:"shrink-0 text-fg-subtle",children:n}),e.jsx("select",{ref:r,className:"min-w-0 flex-1 appearance-none bg-transparent py-0 pr-8 text-fg outline-none",...i,children:t}),e.jsx(a,{className:"pointer-events-none absolute right-2.5 size-4 text-fg-subtle"})]})}export{p as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,p as S,e as I,r as c,bK as L,a as C,f as k,bL as P,bM as O,B as w,X as A,u as $,az as q,ak as M,bN as R,aB as B,bO as D,bP as K,S as Q}from"./index-BVIV7uOn.js";import{u as T}from"./useDebouncedValue-CQk7uQJy.js";import{s as G}from"./help-copy-BEXklmCF.js";import{K as y}from"./kbd-CD9WJQDD.js";import{E}from"./ErrorState-KWmymUQR.js";import{a as V,S as F}from"./settings-screen-FlCW-JB0.js";import"./avatar-BKCZjVnK.js";import"./badge-BmEPIQJj.js";import"./chevron-left-BQBw-0xj.js";import"./menu-Cul_tOCl.js";import"./circle-help-BSxYNH4r.js";function H({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 _({query:t,onCount:m}){const{data:r,isPending:i,isError:l,error:f}=C(D()),b=I(),d=k({...P(),onSettled:()=>{b.invalidateQueries({queryKey:K()})}}),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(Q,{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 U({group:t,query:m,onCount:r}){const i=T(m.trim(),300),l=I(),[f,b]=c.useState(null),d=i.length>=2,o=L({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&&O(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(A,{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 ie(){const t=$(),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=B[s];h&&t({to:h})};return e.jsx(F,{items:m,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:G,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(H,{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(M,{icon:e.jsx(R,{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(_,{query:l,onCount:N}):e.jsx(U,{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{U as SearchGroupPane,ie as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,O as o}from"./index-BVIV7uOn.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as j,j as e,p as f,B as i,X as N}from"./index-BVIV7uOn.js";import{A as w}from"./avatar-BKCZjVnK.js";import{B as z}from"./badge-BmEPIQJj.js";import{C as h}from"./chevron-left-BQBw-0xj.js";import{M as S}from"./menu-Cul_tOCl.js";import{C as v}from"./circle-help-BSxYNH4r.js";function L({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),[p,C]=j.useState(!1),b=!!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:()=>C(a=>!a),"aria-label":"Tips","aria-expanded":p}),s&&!b&&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&&p&&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})})})]}),b&&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 X({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(z,{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,L as S,X as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./index-
|
|
1
|
+
import{b as e}from"./index-BVIV7uOn.js";const c=e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{c as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./index-
|
|
1
|
+
import{b as a}from"./index-BVIV7uOn.js";const p=a("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);export{p as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as x,p as b}from"./index-BVIV7uOn.js";const v={type:"none"};function I(e){if(!e.open||e.count<=0)return v;if(e.key==="ArrowDown"){const t=e.activeIndex+1;return{type:"move",index:t>=e.count?0:t}}if(e.key==="ArrowUp"){const t=e.activeIndex-1;return{type:"move",index:t<0?e.count-1:t}}return e.key==="Escape"?{type:"dismiss"}:(e.key==="Enter"||(e.acceptKeys??[]).includes(e.key))&&e.activeIndex>=0&&e.activeIndex<e.count?{type:"accept",index:e.activeIndex}:v}function j({count:e,onAccept:a,acceptKeys:t}){const[m,i]=s.useState(!1),[c,u]=s.useState(-1),p=s.useId().replace(/[^a-zA-Z0-9_-]/g,""),n=`suggest-${p}`,r=s.useCallback(f=>`suggest-${p}-option-${f}`,[p]);s.useEffect(()=>{u(-1),i(!1)},[e]);const o=e>0&&!m,y=s.useRef({open:o,count:e,activeIndex:c,acceptKeys:t,onAccept:a});y.current={open:o,count:e,activeIndex:c,acceptKeys:t,onAccept:a};const h=s.useCallback(f=>{const d=y.current,l=I({key:f.key,open:d.open,count:d.count,activeIndex:d.activeIndex,acceptKeys:d.acceptKeys});return l.type==="none"?!1:(f.preventDefault(),l.type==="move"&&u(l.index),l.type==="dismiss"&&i(!0),l.type==="accept"&&d.onAccept(l.index),!0)},[]),k=s.useMemo(()=>({role:"combobox","aria-expanded":o,"aria-controls":n,"aria-autocomplete":"list",...c>=0?{"aria-activedescendant":r(c)}:{},...o?{"data-escape-owner":""}:{}}),[o,n,c,r]);return{open:o,activeIndex:c,setActiveIndex:u,dismiss:s.useCallback(()=>i(!0),[]),reopen:s.useCallback(()=>i(!1),[]),handleKeyDown:h,listId:n,optionId:r,comboboxProps:k}}function E({id:e,suggestions:a,activeIndex:t,optionId:m,onPick:i,onHighlight:c,label:u,className:p}){return a.length===0?null:x.jsx("div",{id:e,role:"listbox","aria-label":u,className:b("max-h-44 overflow-y-auto rounded-md border border-line bg-surface py-1 shadow-sm",p),children:a.map((n,r)=>x.jsxs("div",{id:m(r),role:"option",tabIndex:-1,"aria-selected":r===t,className:b("flex cursor-pointer items-baseline gap-2 px-3 py-2 text-sm text-fg",r===t&&"bg-accent-2-soft"),onMouseDown:o=>{o.preventDefault(),i(n)},onMouseEnter:()=>c(r),children:[x.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.label??n.value}),n.hint&&x.jsx("span",{className:"shrink-0 truncate text-2xs text-fg-subtle",children:n.hint}),n.source&&x.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle",children:n.source})]},n.value))})}export{E as S,j as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,
|
|
1
|
+
import{j as t,a8 as e}from"./index-BVIV7uOn.js";const o=()=>t.jsx(e,{to:"/settings/senders",replace:!0});export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i,X as Z,p as O,ed as R,ef as $,ee as v,r as u,bY as E}from"./index-BVIV7uOn.js";import{b as S,n as F,f as h,o as L,t as W,U as j,y as z,l as k,k as B,p as H}from"./useCalendarSuggestions-C4O39URl.js";import{e as w,p as U,a as _}from"./draft-UntYYkEO.js";import{f as P}from"./calendar-format-BwCpz-JZ.js";import{t as M}from"./agenda-time-C_tFoNHA.js";import{a as V}from"./CalendarSession-XIbMK3oT.js";import{C as Y}from"./calendar-failure-note-Cc_-yh_l.js";import{E as G,C as X}from"./EmptyState-CzSAWxdK.js";import{C as q}from"./calendar-event-sidebar-BdPLf9Q-.js";import"./reply-DtObeSB2.js";import{k as J,b as K}from"./calendar-W0j7nrh5.js";import"./ErrorState-KWmymUQR.js";import"./useQueries-CFXMrDWB.js";import"./calendar-guests-DCkwUUaR.js";import"./calendar-event-popup-GQy2blc9.js";import"./pencil-D4t_TOKs.js";import"./circle-help-BSxYNH4r.js";import"./select-CU_oR6rc.js";import"./chevron-down-BI1fWP0V.js";import"./useMediaQuery-DHHct6HU.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=U(a,r,s);if(!o.ok)return o;const d=e.zoneCertainty==="Ambiguous"||o.patch.start!==void 0?{...o.patch,..._(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}=S(),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}=F({...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=>L(m)&&m.calendarObjectId!==a).map(m=>W(m,r[m.calendarId]??j,t));return M({start:c,end:p},f).map(m=>({id:m.id,label:`${m.title}, ${P(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}=z(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(Y,{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(G,{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}=S(),l=r.filter(n=>!n.readOnly),d=B(),[t]=u.useState(()=>Q(e,"",h())),[c,p]=u.useState(t),f=V()?.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,D]=u.useState(""),[N,A]=u.useState(),x=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:H(o[c.calendarId]??j)});if(!n.ok){D(n.problem);return}D(""),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(q,{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:x&&i.jsx(X,{clashes:x})})}function Se(){const e=J(),{closeToView:a}=K();return e===void 0?null:i.jsx(oe,{suggestionId:e,onClose:a})}export{Se as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as w,r as d,j as e,T as R,X as E,
|
|
1
|
+
import{b as w,r as d,j as e,T as R,X as E,p as z,C as $,ef as B,bY as L,eT as q}from"./index-BVIV7uOn.js";import{b as F,f as P,c as V}from"./useCalendarSuggestions-C4O39URl.js";import{b as Z,C as j,u as H}from"./useCalendarTasks-BYrDBjzg.js";import"./reply-DtObeSB2.js";import{b as S}from"./calendar-W0j7nrh5.js";import{C as K}from"./CalendarLoadFailed-BbUr2ubu.js";import{C as M}from"./calendar-event-popup-GQy2blc9.js";import"./ErrorState-KWmymUQR.js";import"./useQueries-CFXMrDWB.js";import"./useMediaQuery-DHHct6HU.js";import"./pencil-D4t_TOKs.js";const A=w("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const O=w("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),D="flex size-9 items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40",v="h-9 w-full rounded-md border border-line bg-surface-sunken px-2 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring/30";function W({headingId:t,headingRef:i,fields:l,dueText:r,listName:u,completed:c,onToggle:f,onSave:x,onDelete:g,onClose:p,busy:m=!1,failure:h}){const[s,o]=d.useState(null);return e.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[e.jsxs("div",{className:"flex justify-end gap-1",children:[s===null&&e.jsx("button",{type:"button",onClick:()=>o(l),className:"rounded-md px-3 text-sm font-medium text-accent hover:bg-accent-soft focus-visible:ring-2 focus-visible:ring-ring",children:"Edit"}),e.jsx("button",{type:"button","aria-label":"Delete",onClick:g,disabled:m,className:D,children:e.jsx(R,{className:"size-4"})}),e.jsx("button",{type:"button","aria-label":"Close",onClick:p,className:D,children:e.jsx(E,{className:"size-4"})})]}),s===null?e.jsxs("div",{className:"flex flex-col gap-2 px-2",children:[e.jsx("h2",{id:t,ref:i,tabIndex:-1,className:z("text-xl font-normal break-words text-fg outline-none",c&&"text-fg-muted line-through"),children:l.title===""?"(No title)":l.title}),e.jsx("p",{className:"text-sm text-fg-muted",children:r}),e.jsxs("p",{className:"flex items-center gap-2 text-sm",children:[e.jsx($,{className:"size-4 text-fg-subtle","aria-label":"List"}),u]}),l.description!==""&&e.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:l.description})]}):e.jsxs("form",{className:"flex flex-col gap-2 px-2",onSubmit:n=>{n.preventDefault(),x(s),o(null)},children:[e.jsx("h2",{id:t,className:"sr-only",children:"Edit task"}),e.jsx("input",{"aria-label":"Title",value:s.title,onChange:n=>o({...s,title:n.target.value}),className:v}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"date","aria-label":"Due date",value:s.dueDate,onChange:n=>n.target.value!==""&&o({...s,dueDate:n.target.value}),className:v}),e.jsx("input",{type:"time","aria-label":"Due time",value:s.dueTime,onChange:n=>o({...s,dueTime:n.target.value}),className:v})]}),e.jsx("textarea",{"aria-label":"Description",rows:3,value:s.description,onChange:n=>o({...s,description:n.target.value}),className:"w-full rounded-md border border-line bg-surface-sunken px-2 py-1 text-sm"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>o(null),className:"h-9 rounded-md border border-line px-3 text-sm font-medium",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:m,className:"h-9 rounded-md bg-accent px-4 text-sm font-medium text-accent-fg disabled:opacity-50",children:"Save"})]})]}),h&&e.jsx(M,{failure:h}),s===null&&e.jsx("div",{className:"flex justify-end px-2",children:e.jsxs("button",{type:"button",onClick:f,disabled:m,className:"inline-flex h-9 items-center gap-2 rounded-md border border-line px-3 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:[c?e.jsx(O,{className:"size-4","aria-hidden":"true"}):e.jsx(A,{className:"size-4","aria-hidden":"true"}),c?"Mark not done":"Mark done"]})})]})}const U=(t,i)=>{const l=new Date(`${t.slice(0,10)}T00:00:00Z`),r=new Intl.DateTimeFormat(void 0,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"}).format(l);return i?`Due ${r}`:`Due ${r} · ${t.slice(11,16)}`};function X({calendarTaskId:t}){const i=Z(t),{closeToView:l}=S(),r=d.useId(),u=d.useRef(null),c=i.kind==="gone";return d.useEffect(()=>{c&&u.current?.focus()},[c]),i.kind==="loading"?null:i.kind==="found"?e.jsx(Y,{task:i.task}):i.kind==="failed"?e.jsx(j,{anchor:null,anchorKey:"failed",labelledBy:r,children:e.jsx("div",{id:r,className:"p-4",children:e.jsx(K,{title:"Couldn't open this task",error:i.error,onRetry:i.retry,compact:!0})})}):e.jsx(j,{anchor:null,anchorKey:"gone",labelledBy:r,children:e.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[e.jsx("h2",{id:r,className:"text-base font-medium text-fg",children:"This task was deleted or moved"}),e.jsx("button",{ref:u,type:"button",onClick:l,className:"self-end rounded-md border border-line px-3 py-1.5 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Close"})]})})}function Y({task:t}){const{taskLists:i}=F(),{closeToView:l}=S(),{updateTask:r,deleteTask:u,isWriting:c}=H(),f=d.useId(),x=d.useRef(null),[g,p]=d.useState(),[m,h]=d.useState(null),{calendarTaskId:s}=t;d.useLayoutEffect(()=>{h(document.querySelector(`[data-task-id="${CSS.escape(s)}"]`))},[s]),d.useEffect(()=>{x.current?.focus()},[]);const o=P(),n=t.allDay?t.due:B(t.due,o),I={title:t.summary,dueDate:n.slice(0,10),dueTime:t.allDay?"":n.slice(11,16),description:t.description},b=a=>N=>{if(N.kind==="written"){p(void 0);return}const T=`Couldn't save the task: ${N.message}`;p({text:T,reportHref:V(T),onRetry:a})},y=()=>{r(t,{completed:!t.completed}).then(b(y))},C=a=>{r(t,{summary:a.title,description:a.description,allDay:a.dueTime==="",due:a.dueTime===""?a.dueDate:L(a.dueDate,a.dueTime,o)}).then(b(()=>C(a)))},k=()=>{u(t).then(a=>{if(a.kind==="written"){l();return}b(k)(a)})};return e.jsx(j,{anchor:m,anchorKey:`${s}:${m?"chip":"none"}`,labelledBy:f,children:e.jsx(W,{headingId:f,headingRef:x,fields:I,dueText:U(n,t.allDay),listName:i.find(a=>a.id===t.calendarId)?.name??"Tasks",completed:t.completed,onToggle:y,onSave:C,onDelete:k,onClose:l,busy:c,failure:g})})}function re(){const{calendarTaskId:t}=q.useParams();return e.jsx(X,{calendarTaskId:t})}export{re as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./index-
|
|
1
|
+
import{b as a}from"./index-BVIV7uOn.js";const d=a("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);export{d as U};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as c,
|
|
1
|
+
import{j as c,p as x,B as E,r as f,ee as S}from"./index-BVIV7uOn.js";import{p as A,b as L,f as O,o as W,t as Z,U as B,n as P,q as U,i as F,r as M}from"./useCalendarSuggestions-C4O39URl.js";import{a as q,t as z}from"./useCalendarTasks-BYrDBjzg.js";const K=[{scope:"this",label:"This event",note:"Leaves the rest of the series alone"},{scope:"following",label:"This and everything after",note:"Splits the series here"},{scope:"all",label:"The whole series",note:"Rewrites the rule itself"}];function Q({title:e,ruleText:s,instanceText:n,onChoose:t,onCancel:r,scopes:a,touch:o,className:d}){return c.jsxs("div",{className:x("flex flex-col gap-3",d),children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-md font-semibold text-fg",children:[e," repeats"]}),c.jsx("p",{className:"text-xs text-fg-muted",children:s}),c.jsxs("p",{className:"text-xs text-fg-subtle",children:["You clicked ",n,"."]})]}),c.jsx("p",{className:"text-sm text-fg",children:"What should the change apply to?"}),c.jsx("div",{className:"flex flex-col gap-1.5",children:K.filter(l=>a===void 0||a.includes(l.scope)).map(l=>c.jsxs("button",{type:"button",onClick:()=>t(l.scope),className:x("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",o&&"min-h-11 justify-center"),children:[c.jsx("span",{className:"text-sm font-medium text-fg",children:l.label}),c.jsx("span",{className:"text-2xs text-fg-subtle",children:l.note})]},l.scope))}),c.jsx(E,{variant:"ghost",size:o?"md":"sm",onClick:r,className:x("self-start",o&&"min-h-11"),children:"Cancel"})]})}const C=e=>e.replace(/\r?\n[ \t]/g,""),I=e=>e.replace(/\\n/gi,`
|
|
2
2
|
`).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function g(e,s){let n=!1;for(let t=s.length;t<e.length;t+=1){const r=e[t];if(t===s.length&&r!==";"&&r!==":")return;if(r==='"'){n=!n;continue}if(!n&&r===":")return e.slice(t+1).trim()}}function v(e,s){for(const n of C(e).split(/\r?\n/)){if(!n.startsWith(s))continue;const t=g(n,s);if(t!==void 0)return t}return""}const X=e=>v(e,"RRULE"),$=e=>({location:I(v(e,"LOCATION")),description:I(v(e,"DESCRIPTION"))});function ee(e,s){const n=C(e).split(/\r?\n/).find(r=>r.startsWith("DTSTART")&&g(r,"DTSTART")!==void 0);if(n===void 0)return A(s);const t=/;TZID="?([^;:"]+)"?/i.exec(n)?.[1];return t!==void 0?Intl.supportedValuesOf("timeZone").includes(t)?t:s:g(n,"DTSTART")?.toUpperCase().endsWith("Z")?"":s}function V(e,s){const n=e.map(a=>a.id);if(s.length===0)return n;const t=new Set(s),r=n.filter(a=>t.has(a));return r.length===0?n:r}function Y(e){const{calendars:s,colorByCalendarId:n,timeZoneByCalendarId:t,isLoading:r}=L(),a=V(s,e),o=a.length===s.length?[]:a,d=e.length===0||s.length>0;return{calendars:s,colorByCalendarId:n,timeZoneByCalendarId:t,shown:a,narrowed:o,resolved:d,isLoading:r}}function _(e,s,n){const t=n.join(",");return f.useMemo(()=>{const r=O(),a=new Set(t===""?[]:t.split(","));return e.filter(o=>W(o)&&a.has(o.calendarId)).map(o=>Z(o,s[o.calendarId]??B,r))},[e,s,t])}function se({view:e,date:s,calendarIds:n,enabled:t=!0}){const{calendars:r,colorByCalendarId:a,timeZoneByCalendarId:o,shown:d,narrowed:l,resolved:j,isLoading:N}=Y(n),w=S(e,s),h=t&&j,i=P({...w,calendarIds:l,enabled:h});U(e,s,l,h);const k=_(i.instances,o,d),p=q(w,h),m=p.tasks,D=f.useMemo(()=>m.map(z),[m]),T=i.refetch,b=p.refetch,y=f.useCallback(()=>{T(),b()},[T,b]),R=f.useMemo(()=>new Set(i.instances.filter(u=>u.transparency==="Transparent").map(u=>F(u.calendarObjectId,u.recurrenceId))),[i.instances]);return{calendars:r,events:k,colorByCalendarId:a,timeZoneByCalendarId:o,isLoading:N||i.isLoading,error:i.error??p.error,retry:y,storedTasks:m,tasks:D,instanceOf:M,freeIds:R}}export{Q as R,_ as a,V as b,se as c,X as r,ee as s,$ as t,Y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as y,a as f,c as g,eJ as m,f as b,eK as S,r as d,cn as M,cm as p,aN as I,bK as h}from"./index-BVIV7uOn.js";import{u as x}from"./useQueries-CFXMrDWB.js";import{u as O}from"./useDebouncedValue-CQk7uQJy.js";function K(){const s=y(),{data:a}=f({...g(),staleTime:6e4}),{data:o}=f(m()),r=b(S()),i=d.useMemo(()=>(a?.accounts??[]).filter(n=>n.syncedServices.includes("Mail")).map(n=>({accountId:n.accountId,email:n.email})),[a?.accounts]),l=o?.defaultInvitationSenderAccountId,c=d.useCallback(async n=>{await r.mutateAsync({body:{defaultInvitationSenderAccountId:n}}),await s.invalidateQueries({queryKey:m().queryKey})},[r,s]);return{senders:i,defaultSenderId:l,setDefaultSender:c}}const E=2;function Q(s){const a=O(s.trim(),200),{data:o}=f({...h({query:{q:a,limit:8}}),enabled:a.length>=E});return d.useMemo(()=>(o?.items??[]).map(r=>({email:r.normalizedEmail,name:r.displayName??""})),[o?.items])}const q=["sent","unfiled","failed","blocked"],v=["failed","blocked"];function w(s){const a=y(),o=b(M()),r=x({queries:s.map(e=>({...p({path:{outboxMessageId:e.outboxMessageId}}),meta:{softErrorStatuses:[404]},retry:!1,refetchInterval:u=>{if(u.state.error)return!1;const t=u.state.data?.status;return t&&q.includes(t)?!1:1500}}))}),i=s.flatMap((e,u)=>{const t=r[u];return!t?.error||I(t.error)===404?[]:[{send:e,error:t.error,refetch:t.refetch}]}),l=()=>{for(const e of i)e.refetch()},c=s.filter((e,u)=>{const t=r[u]?.data?.status;return t!==void 0&&v.includes(t)}),n=d.useCallback(async()=>{for(const e of c)await o.mutateAsync({path:{outboxMessageId:e.outboxMessageId}}),await a.invalidateQueries({queryKey:p({path:{outboxMessageId:e.outboxMessageId}}).queryKey})},[c,o,a]);return{missed:c.map(e=>e.email),retry:n,checkError:i[0]?.error??null,unchecked:i.map(e=>e.send.email),recheck:l}}export{w as a,Q as b,K as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as X,as as Q,at as B,ef as _,a as C,eg as ee,r as d,e as v,s as y,f as m,eh as te,ei as ne,ej as ae,aN as A,aZ as se,aX as re,aY as oe,ek as ie,bW as w,el as h,ee as ce,b$ as de,em as le,en as ue,eo as ge,ep as fe,eq as pe,er as me,es as Ce,et as ye}from"./index-BVIV7uOn.js";import{f as I}from"./ErrorState-KWmymUQR.js";import{u as G}from"./useQueries-CFXMrDWB.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"}]]),be={"cal-1":{solid:"bg-cal-1",soft:"bg-cal-1-soft",text:"text-cal-1",border:"border-cal-1",rail:"border-l-cal-1"},"cal-2":{solid:"bg-cal-2",soft:"bg-cal-2-soft",text:"text-cal-2",border:"border-cal-2",rail:"border-l-cal-2"},"cal-3":{solid:"bg-cal-3",soft:"bg-cal-3-soft",text:"text-cal-3",border:"border-cal-3",rail:"border-l-cal-3"},"cal-4":{solid:"bg-cal-4",soft:"bg-cal-4-soft",text:"text-cal-4",border:"border-cal-4",rail:"border-l-cal-4"},"cal-5":{solid:"bg-cal-5",soft:"bg-cal-5-soft",text:"text-cal-5",border:"border-cal-5",rail:"border-l-cal-5"},"cal-6":{solid:"bg-cal-6",soft:"bg-cal-6-soft",text:"text-cal-6",border:"border-cal-6",rail:"border-l-cal-6"}};function We(e){return be[e]}function je(e){return Q(B({title:`Calendar invitation: ${e}`,errorMessage:e}))}function Ue(e){return Q(B({title:`Calendar event: ${e}`,errorMessage:e}))}const K=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,q="";function $e(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"},Qe=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 Be(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 x(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 F(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 we(){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(F),s=r.filter(i=>i.componentSet==="VtodoOnly").map(F);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),Ae=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","calendarTaskOperationsListCalendarTasks","calendarTaskDetailOperationsGetCalendarTask"]),W=e=>A(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},Ie={this:"This",following:"Following",all:"All"};function V(){const e=v();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"&&Ae.has(a)}})},[e])}const j=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:Ie[e],recurrenceId:t};function Ge(){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,...j(s)},headers:{"If-Match":s.etag},body:i}).then(g=>({kind:"written",sends:g.sends})).catch(W),[n]),l=d.useCallback(s=>a.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...j(s)},headers:{"If-Match":s.etag}}).then(i=>({kind:"written",sends:i.sends})).catch(W),[a]);return d.useMemo(()=>({createEvent:r,updateEvent:o,deleteEvent:l,isWriting:t.isPending||n.isPending||a.isPending}),[r,o,l,t.isPending,n.isPending,a.isPending])}const M=y(400,404),L={kind:"written"},P=e=>({kind:"refused",message:I(e)});function Ke(){const e=v(),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,f)=>o.mutateAsync({path:{calendarId:c},body:f}).then(()=>L).catch(P),[o]),g=d.useCallback(c=>l.mutateAsync({path:{calendarId:c}}).then(()=>L).catch(P),[l]);return d.useMemo(()=>({createCalendar:s,updateCalendar:i,deleteCalendar:g,isWriting:r.isPending||o.isPending||l.isPending}),[s,i,g,r.isPending,o.isPending,l.isPending])}const ke=y(404);function Ze(e,t){const{data:n,isLoading:a,error:r,refetch:o}=C({...w({path:{calendarObjectId:e},query:{calendarId:t}}),meta:ke,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 ze(e){const{data:t,isLoading:n,error:a,refetch:r}=C({...h(T(e)),meta:Y,staleTime:k,enabled:e.enabled??!0});return{instances:t?.items??[],isLoading:n,error:a,refetch:()=>{r()}}}function He(e,t,n){const a=G({queries:e.map(c=>({...h(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]),g=d.useMemo(()=>{const c=new Set;return e.forEach((f,u)=>{a[u]?.isPending&&c.add(f.from)}),c},[r,l]);return{instances:i,pendingWindows:g,error:s,refetch:()=>{for(const c of a)c.error&&c.refetch()}}}function Ve(e,t,n,a){const r=v(),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({...h(T({...i,calendarIds:l})),staleTime:k})}},[r,e,t,o,a])}const De=y(400,404);function Ye(e){const t=G({queries:e.map(s=>({...le({query:{from:s.from,to:s.to}}),meta:De,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,g)=>{t[g]?.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 U=365*24*60*6e4,Me=1440*6e4,$=y(),Le=y(404),S=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),Pe=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 Je(e,t){const[n]=d.useState(()=>Date.now()),a=K(),r=new Date(n).toISOString(),o=C({...h({query:{from:S(n),to:S(n+U),calendarObjectId:e}}),meta:$,retry:!1,enabled:t}),l=o.data?x(o.data.items,e,r,a):void 0,s=C({...w({path:{calendarObjectId:e}}),meta:Le,retry:!1,enabled:t&&o.data!==void 0&&l===void 0}),i=Date.parse(s.data?.dtStart??""),g=s.data!==void 0&&Number.isNaN(i),c=Number.isNaN(i)?0:i-Me,f=C({...h({query:{from:S(c),to:S(c+U),calendarObjectId:e}}),meta:$,retry:!1,enabled:t&&s.data!==void 0&&!g}),u=f.data?x(f.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 p=A(s.error)===404,N=[o.error,p?null:s.error,f.error].find(J=>J!==null);return N!==void 0?{kind:"Failed",reason:Pe(N)}:p?{kind:"Deleted"}:g?{kind:"Failed",reason:`the stored event names no readable start (${s.data?.dtStart??""})`}:f.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const b=y(400,404),Re=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),Te=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"&&Re.has(a)}});function Xe(e){const{data:t,isLoading:n,error:a}=C({...ue({path:{messageId:e}}),meta:b});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function et(){const{data:e,isLoading:t,error:n}=C({...Ce({query:{state:"Pending"}}),meta:b});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const Ne=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 tt(e){const{data:t,isLoading:n,error:a}=C({queryKey:[{_id:"calendarSuggestionOperationsListCalendarSuggestions",suggestionId:e}],queryFn:({signal:r})=>Ne(e,r),meta:b});return{suggestion:t,isLoading:n,error:a??null}}const E={kind:"answered"},O=e=>({kind:"refused",message:I(e)});function nt(){const e=v(),t=d.useCallback(()=>Te(e),[e]),n=m({...ge(),meta:b,onSuccess:t}),a=m({...fe(),meta:b,onSuccess:t}),r=m({...pe(),meta:b,onSuccess:t}),o=m({...me(),meta:b,onSuccess:t}),l=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:p}}).then(()=>E).catch(O),[n]),s=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:p,answer:"Tentative"}}).then(()=>E).catch(O),[n]),i=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:p}).then(()=>E).catch(O),[n]),g=d.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>E).catch(O),[a]),c=d.useCallback((u,p)=>r.mutateAsync({path:{suggestionId:u},body:{muteSender:p}}).then(()=>E).catch(O),[r]),f=d.useCallback(u=>o.mutateAsync({path:{suggestionId:u}}).then(()=>E).catch(O),[o]);return d.useMemo(()=>({accept:l,tentative:s,acceptEdited:i,decline:g,dismiss:c,reopen:f,isAnswering:n.isPending||a.isPending||r.isPending||o.isPending}),[l,s,i,g,c,f,n.isPending,a.isPending,r.isPending,o.isPending])}export{D as C,Fe as M,q as U,V as a,we as b,Ue as c,We as d,Ge as e,K as f,He as g,Ye as h,he as i,et as j,nt as k,je as l,Xe as m,ze as n,ve as o,$e as p,Ve as q,R as r,Ze as s,Se as t,Ke as u,Be as v,Je as w,Qe as x,tt as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as
|
|
1
|
+
import{r as u,j as S,p as P,f as y,eL as v,eM as q,eN as W,a as E,eO as N,aN as I,eP as R,s as D}from"./index-BVIV7uOn.js";import{a as j,C as k}from"./useCalendarSuggestions-C4O39URl.js";import{f as z}from"./ErrorState-KWmymUQR.js";const i=8,x=(e,t,a)=>Math.min(Math.max(e,t),Math.max(t,a)),B=(e,t)=>e.width>0&&e.height>0&&e.left<t.width&&e.left+e.width>0&&e.top<t.height&&e.top+e.height>0;function C(e,t){return{left:Math.max(i,(t.width-e.width)/2),top:Math.max(i,(t.height-e.height)/2),side:"center"}}function G(e,t,a){if(!e||!B(e,a))return C(t,a);const r=x(e.top,i,a.height-t.height-i),c=e.left+e.width+i;if(c+t.width<=a.width-i)return{left:c,top:r,side:"right"};const f=e.left-i-t.width;if(f>=i)return{left:f,top:r,side:"left"};const l=x(e.left,i,a.width-t.width-i),s=e.top+e.height+i;if(s+t.height<=a.height-i)return{left:l,top:s,side:"below"};const h=e.top-i-t.height;return h>=i?{left:l,top:h,side:"above"}:C(t,a)}const H='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function _({anchor:e,anchorKey:t,labelledBy:a,children:r,header:c,wrapTab:f=!1,panelRef:l,className:s}){const h=u.useRef(null),[w,M]=u.useState(null),[b,A]=u.useState({key:t,x:0,y:0}),g=b.key===t?b:{x:0,y:0};u.useLayoutEffect(()=>{const n=h.current;if(!n||t==="")return;const d=()=>{const o=(typeof e=="string"?document.querySelector(e):e)?.getBoundingClientRect();M(G(o?{left:o.left,top:o.top,width:o.width,height:o.height}:null,{width:n.offsetWidth,height:n.offsetHeight},{width:window.innerWidth,height:window.innerHeight}))};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[e,t]);const L=n=>{if(n.button!==0||n.target instanceof Element&&n.target.closest("button, input, select, a"))return;n.preventDefault();const d={x:n.clientX-g.x,y:n.clientY-g.y},m=p=>A({key:t,x:p.clientX-d.x,y:p.clientY-d.y}),o=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",o)},O=n=>{if(!f||n.key!=="Tab")return;const d=Array.from(n.currentTarget.querySelectorAll(H));if(d.length===0)return;const m=d[0],o=d[d.length-1];n.shiftKey&&document.activeElement===m?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),m.focus())};return S.jsxs("div",{ref:n=>{h.current=n,typeof l=="function"?l(n):l&&(l.current=n)},role:"dialog","aria-modal":"false","aria-labelledby":a,"data-calendar-popover":"",onKeyDown:O,className:P("fixed z-40 w-[26rem] max-w-[calc(100vw-1rem)] rounded-xl border border-line bg-surface-raised text-fg shadow-xl shadow-black/20",w===null&&"opacity-0",s),style:{left:(w?.left??0)+g.x,top:(w?.top??0)+g.y},children:[c?.({onPointerDown:L}),r]})}const F=e=>({calendarTaskId:e.calendarTaskId,calendarId:e.calendarId,title:e.summary,due:e.allDay?e.due.slice(0,10):e.dueAt,allDay:e.allDay,completed:e.completed});function Q(e,t=!0){const{data:a,error:r,refetch:c}=E({...N({query:{from:e.from,to:e.to}}),meta:D(400,404),enabled:t});return{tasks:u.useMemo(()=>a?.items??[],[a?.items]),error:r,refetch:c}}function V(e){const{data:t,error:a,refetch:r}=E({...R({path:{calendarTaskId:e}}),meta:D(404),retry:!1});return t?{kind:"found",task:t}:a===null?{kind:"loading"}:I(a)===404?{kind:"gone"}:{kind:"failed",error:a,retry:()=>{r()}}}const T=e=>({kind:"refused",message:I(e)===412?"This task changed while you were looking at it. Close it and open it again.":z(e)});function J(){const e=j(),t=y({...v(),meta:k,onSuccess:e}),a=y({...q(),meta:k,onSuccess:e}),r=y({...W(),meta:k,onSuccess:e}),c=u.useCallback(s=>t.mutateAsync({body:s}).then(()=>({kind:"written"})).catch(T),[t]),f=u.useCallback((s,h)=>a.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag},body:h}).then(()=>({kind:"written"})).catch(T),[a]),l=u.useCallback(s=>r.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag}}).then(()=>({kind:"written"})).catch(T),[r]);return{createTask:c,updateTask:f,deleteTask:l,isWriting:t.isPending||a.isPending||r.isPending}}export{_ as C,Q as a,V as b,F as t,J as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./index-
|
|
1
|
+
import{r as o}from"./index-BVIV7uOn.js";const n=(e,t)=>{const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u,eu as x,X as E,p as M,ev as z,ew as L,ak as w,B as O,r as p,f as v,ex as T,a as D,ey as R,ez as $,eA as _,e as S,eB as J,eC as U,eD as B,eE as q,b6 as K}from"./index-BVIV7uOn.js";import{u as Q,S as H}from"./suggest-list-MxpHM4zs.js";import{S as W}from"./select-CU_oR6rc.js";import{P as X}from"./plus-BSFg3ibr.js";const P="inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs";function pe({clause:e,onEdit:t,onRemove:r}){return u.jsxs("span",{className:M(P,e.derived?"border-dashed border-line-strong bg-surface-sunken":"border-line bg-surface"),children:[u.jsxs("button",{type:"button",onClick:t,"aria-label":`Edit ${x(e.field)} clause`,className:"flex items-center gap-1 text-left",children:[u.jsx("span",{className:"font-medium text-fg-muted",children:x(e.field)}),u.jsx("span",{className:"text-fg",children:e.value})]}),e.derived&&u.jsx("span",{className:"text-2xs text-fg-subtle",children:"from sender"}),r&&u.jsx("button",{type:"button",onClick:r,"aria-label":`Remove ${x(e.field)} clause`,className:"flex size-4 items-center justify-center rounded-full text-fg-subtle hover:bg-surface-sunken hover:text-fg-muted",children:u.jsx(E,{className:"size-3"})})]})}function fe({label:e,onClick:t}){return u.jsxs("button",{type:"button",onClick:t,className:M(P,"border-dashed border-line-strong text-fg-muted hover:border-accent-2 hover:text-accent-2"),children:[u.jsx(X,{className:"size-3","aria-hidden":"true"}),e]})}function be({draft:e,mode:t,fields:r=L,suggestions:s=[],onChangeField:o,onChangeValue:a,onSubmit:n,onCancel:c}){const d=z(e.field),l=Q({count:s.length,onAccept:i=>a?.(s[i].value)});return u.jsxs("div",{className:"space-y-1.5 rounded-lg border border-accent-2 bg-surface p-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(W,{"aria-label":"Clause field",value:e.field,onChange:i=>o?.(i.target.value),className:"h-8 w-32 shrink-0",children:r.map(i=>u.jsx("option",{value:i,children:x(i)},i))}),u.jsx(w,{"aria-label":"Clause value",value:e.value,placeholder:"value…",autoComplete:"off",onChange:i=>{l.reopen(),a?.(i.target.value)},onKeyDown:i=>{l.handleKeyDown(i)||i.key==="Enter"&&n?.()},className:"h-8 min-w-40 flex-1",...l.comboboxProps}),u.jsx(O,{variant:"primary",size:"sm",onClick:n,disabled:e.value.trim()==="",className:"shrink-0",children:t==="add"?"Add":"Save"}),u.jsx(O,{variant:"ghost",size:"sm",onClick:c,"aria-label":"Cancel clause edit",icon:u.jsx(E,{className:"size-4"}),className:"shrink-0 px-2"})]}),l.open&&u.jsx(H,{id:l.listId,suggestions:s,activeIndex:l.activeIndex,optionId:l.optionId,onPick:i=>{a?.(i.value),l.dismiss()},onHighlight:l.setActiveIndex,label:`${x(e.field)} suggestions`}),d&&u.jsx("p",{className:"px-0.5 text-2xs text-fg-subtle",children:d})]})}const ge=(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},N={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."},he=e=>e.disabledReason==="None"?void 0:(e.disabledReason==="AwaitingFolder"||e.disabledReason==="FolderCreateFailed")&&e.actionMailboxId!=="None"?N.UserDisabled:N[e.disabledReason],xe=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"})},j=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,o,a]=r,n=new Date(Number(s),Number(o)-1,Number(a),23,59,59,0);if(Number.isNaN(n.getTime()))return;const c=-t.getTimezoneOffset(),d=c>=0?"+":"-",l=Math.abs(c),i=String(Math.floor(l/60)).padStart(2,"0"),f=String(l%60).padStart(2,"0"),m=b=>String(b).padStart(2,"0");return`${n.getFullYear()}-${m(n.getMonth()+1)}-${m(n.getDate())}T${m(n.getHours())}:${m(n.getMinutes())}:${m(n.getSeconds())}${d}${i}:${f}`},h="None",Y=e=>({filterId:e,matchOperator:"And",literalClauses:[],actionLabelId:h,actionMailboxId:h}),k=e=>({matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),ve=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",Ce=({ruleScope:e,clauses:t,matchOperator:r,moveMailboxId:s,until:o})=>({matchOperator:r==="all"?"And":"Or",literalClauses:t.map(a=>({field:a.field,value:a.value})),moveMailboxId:s,expiresAt:e==="until"?j(o??""):void 0}),F=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),G=new Set(["Complete","Failed"]),A=e=>e!==void 0&&G.has(e),V=1e3,Z=15e3,ee=e=>{const t=Math.max(0,e),r=V*2**t;return Math.min(r,Z)},te=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},Se=e=>{const[t,r]=p.useState(),s=v({...T(),onSuccess:g=>r(g.organizeJobId)}),{mutate:o}=s,a=D({...R({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const I=g.state.data?.state;return A(I)?!1:ee(g.state.dataUpdateCount)}}),n=p.useCallback(g=>{e&&o({path:{accountId:e},body:k(g)})},[e,o]),c=p.useCallback(g=>{e&&o({path:{accountId:e},body:Y(g)})},[e,o]),{refetch:d}=a,l=p.useCallback(()=>{d()},[d]),i=a.data,f=s.isPending?void 0:i,m=f?.state??s.data?.state,b=A(f?.state),C={state:m,matchedCount:f?.matchedCount??0,appliedCount:f?.appliedCount??0,failedCount:f?.failedCount??0,errorMessage:f?.errorMessage??""};return{start:n,startForFilter:c,watch:r,refreshStatus:l,progress:C,isStarting:s.isPending,isRunning:!!t&&!b,isDone:b,failure:te(s.error,a.error,!!i)}},ye=["From","Subject","HasWords","ListId","FromDomain"],re=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},Oe=(e,t)=>e==="ListId"?re(t):t.trim(),se=e=>e==="all"?"And":"Or",ae=e=>({matchOperator:se(e.matchOperator),literalClauses:e.clauses.map(t=>({field:t.field,value:t.value}))}),ie=e=>!e.literalClauses.some(t=>t.field==="HasWords"),ne=e=>JSON.stringify({operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),Ne=e=>{const t=ae(e);return{matchOperator:t.matchOperator,literalClauses:t.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?j(e.until??""):void 0}},oe=(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},le=350,Fe=(e,t,r)=>{const s=v($()),{mutateAsync:o}=s,a=ne(t),[n,c]=p.useState(()=>({})),d=p.useRef(t);d.current=t;const l=p.useRef(a),i=ie(t);return p.useEffect(()=>{if(!e||!i||a===n.previewedSignature||a===n.errorSignature)return;const f=setTimeout(()=>{const m=a;l.current=m,o({path:{accountId:e},body:k({...d.current})}).then(b=>{l.current===m&&c({count:b.matchedCount,matchedIds:b.messageIds,previewedSignature:m})}).catch(b=>{l.current===m&&c(C=>({...C,error:b instanceof Error?b.message:"Couldn't count matches.",errorSignature:m}))})},le);return()=>clearTimeout(f)},[e,i,a,n.previewedSignature,n.errorSignature,o]),i?{count:oe(n,a),matchedIds:n.previewedSignature===a?n.matchedIds??[]:[]}:{count:{status:"error",reason:_},matchedIds:[]}},y=e=>U({path:{accountId:e}}),Ae=e=>{const t=D({...B({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},Ee=e=>{const t=S(),r=v({...J(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s,mutateAsync:o}=r,a=p.useCallback((c,d,l)=>{e&&s({path:{accountId:e},body:F(c,d,l)})},[e,s]),n=p.useCallback(async(c,d,l)=>{if(e)return o({path:{accountId:e},body:F(c,d,l)}).then(i=>i,()=>{})},[e,o]);return{createFilter:a,createFilterAsync:n,data:r.data,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},Me=e=>{const t=S(),r=v({...q(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s}=r;return{deleteFilter:p.useCallback(a=>{e&&s({path:{accountId:e,filterId:a}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},De=e=>{const t=S(),r=v({...K(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s,variables:o}=r,a=p.useCallback((c,d)=>{e&&s({path:{accountId:e,filterId:c},body:{state:d?"Active":"Disabled"}})},[e,s]),n=p.useCallback(()=>{o&&s(o)},[s,o]);return{toggleFilter:a,retry:n,togglingFilterId:r.isPending?o?.path.filterId:void 0,isError:r.isError,error:r.error,enabling:o?.body?.state==="Active"}};export{fe as A,pe as C,h as N,ye as S,be as a,y as b,Se as c,Ne as d,he as e,ge as f,xe as g,Ae as h,Me as i,De as j,Ee as k,Ce as l,Oe as n,ve as o,j as p,ae as r,Fe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as L,e8 as p,e as n,f as l,e9 as d,r as o,ea as y,eb as c,ec as g}from"./index-BVIV7uOn.js";const u=e=>y({path:{accountId:e}}),P=e=>{const a=L({...p({path:{accountId:e??""}}),enabled:!!e});return{labels:a.data?.items??[],isPending:a.isPending,isError:a.isError,error:a.error,refetch:a.refetch}},m=e=>{const a=n(),t=l({...d(),onSuccess:()=>{e&&a.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:r}=t;return{createLabel:o.useCallback((s,i="Default")=>e?r({path:{accountId:e},body:{name:s,color:i}}):Promise.reject(new Error("No account")),[e,r]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},h=e=>{const a=n(),t=l({...c(),onSuccess:()=>{e&&a.invalidateQueries({queryKey:u(e)})}}),{mutate:r}=t;return{updateLabel:o.useCallback((s,i)=>{e&&r({path:{accountId:e,labelId:s},body:i})},[e,r]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},C=e=>{const a=n(),t=l({...g(),onSuccess:()=>{e&&a.invalidateQueries({queryKey:u(e)})}}),{mutate:r}=t;return{deleteLabel:o.useCallback(s=>{e&&r({path:{accountId:e,labelId:s}})},[e,r]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{P as a,h as b,C as c,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,D as e}from"./useMediaQuery-DHHct6HU.js";const i=768,a=t=>t!=="desktop",r=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{a as i,r as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-BVIV7uOn.js";const r=1024,c=`(min-width: ${r}px) and (not ((orientation: portrait) and (pointer: coarse)))`,d=e=>{const[o,n]=s.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return s.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const t=window.matchMedia(e);n(t.matches);const a=i=>n(i.matches);return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e]),o},m=()=>d(c);export{c as D,d as a,m as u};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as V,u as go,c6 as _o,E as Wt,l as Eo,a6 as yo,e as Ao,a as bo,cv as So,ch as Ro}from"./index-BVIV7uOn.js";import{g as Oo,j as wo,k as Do}from"./reply-DtObeSB2.js";function fn(n,o){(o==null||o>n.length)&&(o=n.length);for(var a=0,l=Array(o);a<o;a++)l[a]=n[a];return l}function Co(n){if(Array.isArray(n))return n}function Lo(n,o){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,c,p,h,F=[],A=!0,G=!1;try{if(p=(a=a.call(n)).next,o!==0)for(;!(A=(l=p.call(a)).done)&&(F.push(l.value),F.length!==o);A=!0);}catch(W){G=!0,c=W}finally{try{if(!A&&a.return!=null&&(h=a.return(),Object(h)!==h))return}finally{if(G)throw c}}return F}}function No(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(n,o){return Co(n)||Lo(n,o)||Mo(n,o)||No()}function Mo(n,o){if(n){if(typeof n=="string")return fn(n,o);var a={}.toString.call(n).slice(8,-1);return a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set"?Array.from(n):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?fn(n,o):void 0}}const wn=Object.entries,pn=Object.setPrototypeOf,Po=Object.isFrozen,Dn=Object.getPrototypeOf,Cn=Object.getOwnPropertyDescriptor;let O=Object.freeze,D=Object.seal,Tt=Object.create,Ln=typeof Reflect<"u"&&Reflect,De=Ln.apply,Ce=Ln.construct;O||(O=function(o){return o});D||(D=function(o){return o});De||(De=function(o,a){for(var l=arguments.length,c=new Array(l>2?l-2:0),p=2;p<l;p++)c[p-2]=arguments[p];return o.apply(a,c)});Ce||(Ce=function(o){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return new o(...l)});const $=E(Array.prototype.forEach),xo=E(Array.prototype.lastIndexOf),mn=E(Array.prototype.pop),Dt=E(Array.prototype.push),vo=E(Array.prototype.slice),ko=E(Array.prototype.splice),_t=Array.isArray,_e=Nn(Set),Ee=E(Set.prototype.add),Ct=E(Set.prototype.has),st=E(String.prototype.toLowerCase),ye=E(String.prototype.toString),dn=E(String.prototype.match),Lt=E(String.prototype.replace),hn=E(String.prototype.indexOf),Uo=E(String.prototype.trim),Fo=E(Number.prototype.toString),zo=E(Boolean.prototype.toString),Tn=typeof BigInt>"u"?null:E(BigInt.prototype.toString),gn=typeof Symbol>"u"?null:E(Symbol.prototype.toString),P=E(Object.prototype.hasOwnProperty),Nt=E(Object.prototype.toString),w=E(RegExp.prototype.test),j=Nn(TypeError);function E(n){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return De(n,o,l)}}function Nn(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return Ce(n,a)}}function d(n,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:st;if(pn&&pn(n,null),!_t(o))return n;let l=o.length;for(;l--;){let c=o[l];if(typeof c=="string"){const p=a(c);p!==c&&(Po(o)||(o[l]=p),c=p)}n[c]=!0}return n}function Ho(n){for(let o=0;o<n.length;o++)P(n,o)||(n[o]=null);return n}function x(n){const o=Tt(null);for(const l of wn(n)){var a=Io(l,2);const c=a[0],p=a[1];P(n,c)&&(_t(p)?o[c]=Ho(p):p&&typeof p=="object"&&p.constructor===Object?o[c]=x(p):o[c]=p)}return o}function Bo(n){switch(typeof n){case"string":return n;case"number":return Fo(n);case"boolean":return zo(n);case"bigint":return Tn?Tn(n):"0";case"symbol":return gn?gn(n):"Symbol()";case"undefined":return Nt(n);case"function":case"object":{if(n===null)return Nt(n);const o=n,a=k(o,"toString");if(typeof a=="function"){const l=a(o);return typeof l=="string"?l:Nt(l)}return Nt(n)}default:return Nt(n)}}function k(n,o){for(;n!==null;){const l=Cn(n,o);if(l){if(l.get)return E(l.get);if(typeof l.value=="function")return E(l.value)}n=Dn(n)}function a(){return null}return a}function Go(n,o){for(;n!==null;){const a=Cn(n,o);if(a)return a.get?E(a.get):null;n=Dn(n)}return null}function Wo(n){try{return w(n,""),!0}catch{return!1}}const _n=O(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ae=O(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),be=O(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Yo=O(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Se=O(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$o=O(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),En=O(["#text"]),yn=O(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Re=O(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),An=O(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yt=O(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jo=D(/{{[\w\W]*|^[\w\W]*}}/g),Vo=D(/<%[\w\W]*|^[\w\W]*%>/g),Xo=D(/\${[\w\W]*/g),Ko=D(/^data-[\-\w.\u00B7-\uFFFF]+$/),qo=D(/^aria-[\-\w]+$/),bn=D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qo=D(/^(?:\w+script|data):/i),Zo=D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Jo=D(/^html$/i),tr=D(/^[a-z][.\w]*(-[.\w]+)+$/i),Oe=D(/<[/\w!]/g),Sn=D(/<[/\w]/g),er=D(/<\/no(script|embed|frames)/i),Rn=D(/\/>/i),b={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nr=O(d({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),or=function(){return typeof window>"u"?null:window},rr=function(o,a){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let l=null;const c="data-tt-policy-suffix";a&&a.hasAttribute(c)&&(l=a.getAttribute(c));const p="dompurify"+(l?"#"+l:"");try{return o.createPolicy(p,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+p+" could not be created."),null}},On=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Z=function(o,a,l,c){return P(o,a)&&_t(o[a])?d(c.base?x(c.base):{},o[a],c.transform):l},we=function(o,a,l){const c=P(o,a)?o[a]:void 0;return c&&typeof c=="object"?x(c):l()};function In(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:or();const o=s=>In(s);if(o.version="3.4.17",o.removed=[],!n||!n.document||n.document.nodeType!==b.document||!n.Element)return o.isSupported=!1,o;let a=n.document;const l=a,c=l.currentScript;n.DocumentFragment;const p=n.HTMLTemplateElement,h=n.Node,F=n.Element,A=n.NodeFilter;n.NamedNodeMap===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const G=n.DOMParser,W=n.trustedTypes,R=F.prototype,Et=k(R,"cloneNode"),yt=k(R,"remove"),It=k(R,"removeAttributeNode"),J=k(R,"nextSibling"),L=k(R,"childNodes"),X=k(R,"parentNode"),$t=k(R,"shadowRoot"),jt=k(R,"attributes"),tt=h&&h.prototype?k(h.prototype,"nodeType"):null,at=h&&h.prototype?k(h.prototype,"nodeName"):null,Mt=h&&h.prototype?k(h.prototype,"ownerDocument"):null,v=function(t){return tt?tt(t):t.nodeType},At=function(t){return at?at(t):t.nodeName},Ie=Go(R,"namespaceURI"),Vt=function(t){return Ie?Ie(t):t.namespaceURI};if(typeof p=="function"){const s=a.createElement("template");s.content&&s.content.ownerDocument&&(a=s.content.ownerDocument)}let N,et="",Xt,Me=!1,bt=0;const Pe=function(){if(bt>0)throw j('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},lt=function(t){Pe(),bt++;try{return N.createHTML(t)}finally{bt--}},Fn=function(t){Pe(),bt++;try{return N.createScriptURL(t)}finally{bt--}},zn=function(){return Me||(Xt=rr(W,c),Me=!0),Xt},Pt=a,Kt=Pt.implementation,xe=Pt.createNodeIterator,Hn=Pt.createDocumentFragment,Bn=Pt.getElementsByTagName,Gn=l.importNode;let T=On();o.isSupported=typeof wn=="function"&&typeof X=="function"&&Kt&&Kt.createHTMLDocument!==void 0;const Wn=jo,Yn=Vo,$n=Xo,jn=Ko,Vn=qo,Xn=Qo,ve=Zo,Kn=tr;let ke=bn,g=null;const qt=d({},[..._n,...Ae,...be,...Se,...En]);let _=null;const Qt=d({},[...yn,...Re,...An,...Yt]);let z=Object.seal(Tt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),St=null,Ue=null;const K=Object.seal(Tt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Fe=!0,Zt=!0,ze=!1,Jt=!0,Y=!1,nt=!0,ot=!1,te=!1,xt=null,vt=null,ee=!1,ct=!1,kt=!1,Ut=!1,He=!0,Be=!1;const Ge="user-content-";let ne=!0,oe=!1,rt=null,ut={},it=null;const We=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ye=null;const $e=d({},["audio","video","img","source","image","track"]);let je=null;const Ve=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ft="http://www.w3.org/1998/Math/MathML",zt="http://www.w3.org/2000/svg",H="http://www.w3.org/1999/xhtml";let ft=H,re=!1,ie=null;const qn=d({},[Ft,zt,H],ye),Xe=O(["mi","mo","mn","ms","mtext"]);let se=d({},Xe);const Ke=O(["annotation-xml"]);let ae=d({},Ke);const Qn=d({},["title","style","font","a","script"]);let Rt=null;const Zn=["application/xhtml+xml","text/html"],Jn="text/html";let y=null,pt=null;const to=a.createElement("form"),qe=function(t){return t instanceof RegExp||t instanceof Function},le=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pt&&pt===t)return;(!t||typeof t!="object")&&(t={}),t=x(t),Rt=Zn.indexOf(t.PARSER_MEDIA_TYPE)===-1?Jn:t.PARSER_MEDIA_TYPE,y=Rt==="application/xhtml+xml"?ye:st,g=Z(t,"ALLOWED_TAGS",qt,{transform:y}),_=Z(t,"ALLOWED_ATTR",Qt,{transform:y}),ie=Z(t,"ALLOWED_NAMESPACES",qn,{transform:ye}),je=Z(t,"ADD_URI_SAFE_ATTR",Ve,{transform:y,base:Ve}),Ye=Z(t,"ADD_DATA_URI_TAGS",$e,{transform:y,base:$e}),it=Z(t,"FORBID_CONTENTS",We,{transform:y}),St=Z(t,"FORBID_TAGS",x({}),{transform:y}),Ue=Z(t,"FORBID_ATTR",x({}),{transform:y}),ut=P(t,"USE_PROFILES")?t.USE_PROFILES&&typeof t.USE_PROFILES=="object"?x(t.USE_PROFILES):t.USE_PROFILES:!1,Fe=t.ALLOW_ARIA_ATTR!==!1,Zt=t.ALLOW_DATA_ATTR!==!1,ze=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Jt=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=t.SAFE_FOR_TEMPLATES||!1,nt=t.SAFE_FOR_XML!==!1,ot=t.WHOLE_DOCUMENT||!1,ct=t.RETURN_DOM||!1,kt=t.RETURN_DOM_FRAGMENT||!1,Ut=t.RETURN_TRUSTED_TYPE||!1,ee=t.FORCE_BODY||!1,He=t.SANITIZE_DOM!==!1,Be=t.SANITIZE_NAMED_PROPS||!1,ne=t.KEEP_CONTENT!==!1,oe=t.IN_PLACE||!1,ke=Wo(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:bn,ft=typeof t.NAMESPACE=="string"?t.NAMESPACE:H,se=we(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>d({},Xe)),ae=we(t,"HTML_INTEGRATION_POINTS",()=>d({},Ke));const e=we(t,"CUSTOM_ELEMENT_HANDLING",()=>Tt(null));if(z=Tt(null),P(e,"tagNameCheck")&&qe(e.tagNameCheck)&&(z.tagNameCheck=e.tagNameCheck),P(e,"attributeNameCheck")&&qe(e.attributeNameCheck)&&(z.attributeNameCheck=e.attributeNameCheck),P(e,"allowCustomizedBuiltInElements")&&typeof e.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),D(z),Y&&(Zt=!1),kt&&(ct=!0),ut&&(g=d({},En),_=Tt(null),ut.html===!0&&(d(g,_n),d(_,yn)),ut.svg===!0&&(d(g,Ae),d(_,Re),d(_,Yt)),ut.svgFilters===!0&&(d(g,be),d(_,Re),d(_,Yt)),ut.mathMl===!0&&(d(g,Se),d(_,An),d(_,Yt))),K.tagCheck=null,K.attributeCheck=null,P(t,"ADD_TAGS")&&(typeof t.ADD_TAGS=="function"?K.tagCheck=t.ADD_TAGS:_t(t.ADD_TAGS)&&(g===qt&&(g=x(g)),d(g,t.ADD_TAGS,y))),P(t,"ADD_ATTR")&&(typeof t.ADD_ATTR=="function"?K.attributeCheck=t.ADD_ATTR:_t(t.ADD_ATTR)&&(_===Qt&&(_=x(_)),d(_,t.ADD_ATTR,y))),P(t,"ADD_FORBID_CONTENTS")&&_t(t.ADD_FORBID_CONTENTS)&&(it===We&&(it=x(it)),d(it,t.ADD_FORBID_CONTENTS,y)),ne&&(g["#text"]=!0),ot&&d(g,["html","head","body"]),g.table&&(d(g,["tbody"]),delete St.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw j('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw j('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const r=N;N=t.TRUSTED_TYPES_POLICY;try{et=lt("")}catch(i){throw N=r,i}}else t.TRUSTED_TYPES_POLICY===null?(N=void 0,et=""):(N===void 0&&(N=zn()),N&&typeof et=="string"&&(et=lt("")));O&&O(t),pt=t},Qe=d({},[...Ae,...be,...Yo]),Ze=d({},[...Se,...$o]),eo=function(t,e,r){return e.namespaceURI===H?t==="svg":e.namespaceURI===Ft?t==="svg"&&(r==="annotation-xml"||se[r]):!!Qe[t]},no=function(t,e,r){return e.namespaceURI===H?t==="math":e.namespaceURI===zt?t==="math"&&ae[r]:!!Ze[t]},oo=function(t,e,r){return e.namespaceURI===zt&&!ae[r]||e.namespaceURI===Ft&&!se[r]?!1:!Ze[t]&&(Qn[t]||!Qe[t])},ro=function(t){const e=Vt(t),r=st(At(t)),i=X(t);let u,f;return i&&v(i)===b.element?(u={namespaceURI:Vt(i)},f=st(At(i))):(u={namespaceURI:ft},f="template"),ie[e]?e===zt?eo(r,u,f):e===Ft?no(r,u,f):e===H?oo(r,u,f):!!(Rt==="application/xhtml+xml"&&ie[e]):!1},q=function(t){Dt(o.removed,{element:t});try{X(t).removeChild(t)}catch{if(yt(t),!X(t))throw j("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Je=function(t,e,r){try{It(t,e)}catch{try{t.removeAttribute(r)}catch{}}},ce=function(t){fe(t);const e=L(t);e&&$(vo(e),i=>{try{yt(i)}catch{}});const r=v(t)===b.element?jt(t):null;if(r)for(let i=r.length-1;i>=0;--i){const u=r[i],f=u&&u.name;typeof f=="string"&&Je(t,u,f)}},mt=function(t,e,r){if(!r)try{r=e.getAttributeNode(t)}catch{r=null}Dt(o.removed,{attribute:r||null,from:e});try{r?It(e,r):e.removeAttribute(t)}catch{try{e.removeAttribute(t)}catch{}}if(t==="is")if(ct||kt)try{q(e)}catch{}else try{e.setAttribute(t,"")}catch{}},tn=function(t){const e=jt(t);if(e)for(let r=e.length-1;r>=0;--r){const i=e[r],u=i&&i.name;typeof u!="string"||_[y(u)]||Je(t,i,u)}},ue=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[t];for(;i.length>0;){const u=i.pop();if(e(u)===!1)continue;if(r&&v(u)===b.element){const m=$t(u);Q(m)&&i.push(m)}const f=L(u);if(f)for(let m=f.length-1;m>=0;--m)i.push(f[m])}},fe=function(t){ue(t,e=>{v(e)===b.element&&tn(e)})},pe=function(t){const e=[];return ue(t,r=>{e.push(r)},!0),e},io=function(t,e){const r=_e();$(pe(t),i=>{v(i)===b.element&&Ee(r,i)}),$(e,i=>{v(i)===b.element&&!Ct(r,i)&&tn(i)})},en=function(t,e){let r=!1;return $(o.removed,i=>{i.element&&(r=r||i.element===t,fe(i.element))}),io(t,e),r},so=8,ao=function(t,e){const r=rt;let i=null;const u=()=>(i||(i=_e(),$(e,f=>{Ee(i,f)})),i);for(let f=0;;f++){const m=pe(t),S=[t];let B=!1;if($(m,C=>{v(C)===b.documentFragment?Dt(S,C):!B&&!Ct(r,C)&&(B=Ct(u(),C))}),!B)return;if(f>=so)throw j("the tree kept changing during in-place sanitization; refusing to return it");$(S,(C,I)=>{lo(C,I>0,t,u())})}},lo=function(t,e,r,i){const u=me(t);let f;for(;f=u.nextNode();)!Ct(i,f)||Ct(rt,f)||(e&&U(T.uponSanitizeShadowNode,f,null),he(f,r),Te(f,r),Q(f.content)&&wt(f.content))},co=function(t){rt&&Ee(rt,t)},nn=function(t,e){return nt?t==="patchsrc"?!0:t==="for"&&e!=="label"&&e!=="output":!1},uo=function(t){nt&&ue(t,e=>{const r=v(e);if(r===b.processingInstruction||r===b.comment&&w(Sn,e.data)){try{yt(e)}catch{}return!1}if(r===b.element){const i=e,u=y(At(e));try{i.hasAttribute&&i.hasAttribute("patchsrc")&&i.removeAttribute("patchsrc"),i.hasAttribute&&i.hasAttribute("for")&&nn("for",u)&&i.removeAttribute("for")}catch{}}return!0})},on=function(t){let e=null,r=null;if(ee)t="<remove></remove>"+t;else{const f=dn(t,/^[\r\n\t ]+/);r=f&&f[0]}Rt==="application/xhtml+xml"&&ft===H&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const i=N?lt(t):t;if(ft===H)try{e=new G().parseFromString(i,Rt)}catch{}if(!e||!e.documentElement){e=Kt.createDocument(ft,"template",null);try{e.documentElement.innerHTML=re?et:i}catch{}}const u=e.body||e.documentElement;return t&&r&&u.insertBefore(a.createTextNode(r),u.childNodes[0]||null),ft===H?Bn.call(e,ot?"html":"body")[0]:ot?e.documentElement:u},me=function(t){const e=Mt?Mt(t):t.ownerDocument;return xe.call(e||t,t,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT|A.SHOW_PROCESSING_INSTRUCTION|A.SHOW_CDATA_SECTION,null)},Ht=function(t){return t=Lt(t,Wn," "),t=Lt(t,Yn," "),t=Lt(t,$n," "),t},de=function(t){var e;rn(t);const r=(e=t.querySelectorAll)===null||e===void 0?void 0:e.call(t,"template");r&&$(r,i=>{Q(i.content)&&de(i.content)})},rn=function(t){t.normalize();const e=Mt?Mt(t):t.ownerDocument,r=xe.call(e||t,t,A.SHOW_TEXT|A.SHOW_COMMENT|A.SHOW_CDATA_SECTION|A.SHOW_PROCESSING_INSTRUCTION,null);let i=r.nextNode();for(;i;)i.data=Ht(i.data),i=r.nextNode()},Bt=function(t){const e=at?at(t):null;return typeof e!="string"||y(e)!=="form"?!1:typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||t.attributes!==jt(t)||typeof t.removeAttribute!="function"||typeof t.removeAttributeNode!="function"||typeof t.getAttributeNode!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function"||t.nodeType!==tt(t)||t.childNodes!==L(t)},Q=function(t){if(!tt||typeof t!="object"||t===null)return!1;try{return tt(t)===b.documentFragment}catch{return!1}},Ot=function(t){if(!tt||typeof t!="object"||t===null)return!1;try{return typeof tt(t)=="number"}catch{return!1}};function U(s,t,e){s.length!==0&&$(s,r=>{r.call(o,t,e,pt)})}const fo=function(t,e){return!!(nt&&t.hasChildNodes()&&!Ot(t.firstElementChild)&&w(Oe,t.textContent)&&w(Oe,t.innerHTML)||nt&&nr[e]&&v(t)===b.element&&Vt(t)===H&&(Ot(t.firstElementChild)||typeof t.textContent=="string"&&w(Oe,t.textContent))||t.nodeType===b.processingInstruction||nt&&t.nodeType===b.comment&&w(Sn,t.data))},Gt=function(t,e){if(t instanceof RegExp)return w(t,e);if(t instanceof Function){for(var r=arguments.length,i=new Array(r>2?r-2:0),u=2;u<r;u++)i[u-2]=arguments[u];return!!t(e,...i)}return!1},po=function(t,e,r){if(!St[e]&&ln(e)&&Gt(z.tagNameCheck,e))return!1;if(ne&&!it[e]&&!it[st(e)]){const i=X(t),u=L(t);if(u&&i){const f=u.length;for(let m=f-1;m>=0;--m){const S=t===r?Et(u[m],!0):u[m];i.insertBefore(S,J(t))}}}return q(t),!0},sn=function(t,e,r,i){return t.length===0?e:e===r||e===i?x(e):e},dt=function(t,e){return t===e||X(t)!==null?!1:(oe&&fe(t),!0)},he=function(t,e){if(co(t),U(T.beforeSanitizeElements,t,null),dt(t,e))return!0;if(Bt(t))return q(t),!0;const r=y(At(t));if(g=sn(T.uponSanitizeElement,g,qt,xt),U(T.uponSanitizeElement,t,{tagName:r,allowedTags:g}),dt(t,e))return!0;if(fo(t,r))return q(t),!0;if(St[r]||!(K.tagCheck instanceof Function&&K.tagCheck(r))&&!g[r]){const i=po(t,r,e);return i===!1&&(U(T.afterSanitizeElements,t,null),dt(t,e))?!0:i}if(v(t)===b.element&&!ro(t)||(r==="noscript"||r==="noembed"||r==="noframes")&&w(er,t.innerHTML))return q(t),!0;if(Y&&t.nodeType===b.text){const i=Ht(t.textContent);t.textContent!==i&&(Dt(o.removed,{element:t.cloneNode()}),t.textContent=i)}return U(T.afterSanitizeElements,t,null),dt(t,e)},an=function(t,e,r){if(Ue[e]||nn(e,t)||He&&(e==="id"||e==="name")&&(r in a||r in to))return!1;const i=_[e]||K.attributeCheck instanceof Function&&K.attributeCheck(e,t);return Zt&&w(jn,e)||Fe&&w(Vn,e)?!0:i?je[e]||w(ke,Lt(r,ve,""))||(e==="src"||e==="xlink:href"||e==="href")&&t!=="script"&&hn(r,"data:")===0&&Ye[t]||ze&&!w(Xn,Lt(r,ve,""))?!0:!r:ln(t)&&Gt(z.tagNameCheck,t)&&Gt(z.attributeNameCheck,e,t)||e==="is"&&z.allowCustomizedBuiltInElements&&Gt(z.tagNameCheck,r)},mo=d({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ln=function(t){return!mo[st(t)]&&w(Kn,t)},ho=function(t,e,r,i){if(N&&typeof W=="object"&&typeof W.getAttributeType=="function"&&!r)switch(W.getAttributeType(t,e)){case"TrustedHTML":return lt(i);case"TrustedScriptURL":return Fn(i)}return i},To=function(t,e,r,i){try{return r?t.setAttributeNS(r,e,i):t.setAttribute(e,i),Bt(t)?(q(t),!1):!0}catch{return mt(e,t),!1}},cn=function(t,e){return nt&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,e)?!0:st(t)==="attributename"&&dn(e,"href")!==null},Te=function(t,e){if(U(T.beforeSanitizeAttributes,t,null),dt(t,e))return;const r=t.attributes;if(!r||Bt(t))return;_=sn(T.uponSanitizeAttribute,_,Qt,vt);const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let u=r.length;const f=y(t.nodeName);for(;u--;){const m=r[u],S=m.name,B=m.namespaceURI,C=m.value,I=y(S),ht=C;let M=S==="value"?ht:Uo(ht),un=!1;if(i.attrName=I,i.attrValue=M,i.keepAttr=!0,i.forceKeepAttr=void 0,U(T.uponSanitizeAttribute,t,i),M=i.attrValue,Be&&(I==="id"||I==="name")&&hn(M,Ge)!==0&&(mt(S,t,m),M=Ge+M,un=!0),cn(S,M)){mt(S,t,m);continue}if(!i.forceKeepAttr){if(!i.keepAttr){mt(S,t,m);continue}if(!Jt&&w(Rn,M)){mt(S,t,m);continue}if(Y&&(M=Ht(M)),!an(f,I,M)){mt(S,t,m);continue}M=ho(f,I,B,M),M!==ht&&To(t,S,B,M)&&un&&mn(o.removed)}}U(T.afterSanitizeAttributes,t,null),dt(t,e)},wt=function(t){let e=null;const r=me(t);for(U(T.beforeSanitizeShadowDOM,t,null);e=r.nextNode();)if(U(T.uponSanitizeShadowNode,e,null),he(e,t),Te(e,t),Q(e.content)&&wt(e.content),v(e)===b.element){const i=$t(e);Q(i)&&(ge(i),wt(i))}Y&&rn(t),U(T.afterSanitizeShadowDOM,t,null)},ge=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const r=e.pop();if(r.shadow){wt(r.shadow);continue}const i=r.node,u=v(i)===b.element,f=L(i);if(f)for(let m=f.length-1;m>=0;--m)e.push({node:f[m],shadow:null});if(u){const m=at?at(i):null;if(typeof m=="string"&&y(m)==="template"){const S=i.content;Q(S)&&e.push({node:S,shadow:null})}}if(u){const m=$t(i);Q(m)&&e.push({node:null,shadow:m},{node:m,shadow:null})}}};return o.sanitize=function(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,r=null,i=null,u=null;if(re=!s,re&&(s="<!-->"),typeof s!="string"&&!Ot(s)&&(s=Bo(s),typeof s!="string"))throw j("dirty is not a string, aborting");if(!o.isSupported)return s;te?(g=xt,_=vt):le(t),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(g=x(g)),T.uponSanitizeAttribute.length>0&&(_=x(_)),o.removed=[];const f=oe&&typeof s!="string"&&Ot(s);let m=[];const S=rt;if(f){uo(s);const I=At(s);if(typeof I=="string"){const ht=y(I);if(!g[ht]||St[ht])throw ce(s),j("root node is forbidden and cannot be sanitized in-place")}if(Bt(s))throw ce(s),j("root node is clobbered and cannot be sanitized in-place");m=pe(s),rt=_e()}else if(Ot(s))e=on("<!---->"),r=e.ownerDocument.importNode(s,!0),r.nodeType===b.element&&r.nodeName==="BODY"||r.nodeName==="HTML"?e=r:e.appendChild(r),ge(e);else{if(!ct&&!Y&&!ot&&s.indexOf("<")===-1)return N&&Ut?lt(s):s;if(e=on(s),!e)return ct?null:Ut?et:""}e&&ee&&q(e.firstChild);const B=f?s:e;try{f&&ge(s);const I=me(B);for(;i=I.nextNode();)he(i,B),Te(i,B),Q(i.content)&&wt(i.content);f&&ao(s,m)}catch(I){throw f&&(ce(s),en(s,m)),I}finally{rt=S}if(f){if(en(s,m))throw j("a node selected for removal could not be safely returned; refusing to sanitize in place");return Y&&de(s),s}if(ct){if(Y&&de(e),kt)for(u=Hn.call(e.ownerDocument);e.firstChild;)u.appendChild(e.firstChild);else u=e;return(_.shadowroot||_.shadowrootmode)&&(u=Gn.call(l,u,!0)),u}let C=ot?e.outerHTML:e.innerHTML;return ot&&g["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&w(Jo,e.ownerDocument.doctype.name)&&(C="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
|
|
3
|
+
`+C),Y&&(C=Ht(C)),N&&Ut?lt(C):C},o.setConfig=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};le(s),te=!0,xt=g,vt=_},o.clearConfig=function(){pt=null,te=!1,xt=null,vt=null,N=Xt,et=""},o.isValidAttribute=function(s,t,e){pt||le({});const r=y(s),i=y(t);return typeof e=="string"&&(cn(t,e)||!Jt&&w(Rn,e))?!1:an(r,i,e)},o.addHook=function(s,t){typeof t=="function"&&P(T,s)&&Dt(T[s],t)},o.removeHook=function(s,t){if(P(T,s)){if(t!==void 0){const e=xo(T[s],t);return e===-1?void 0:ko(T[s],e,1)[0]}return mn(T[s])}},o.removeHooks=function(s){P(T,s)&&(T[s]=[])},o.removeAllHooks=function(){T=On()},o}var yr=In();const Mn="/mail/brief/compose/{-$outboxMessageId}",Pn="/mail/flagged/compose/{-$outboxMessageId}",xn="/mail/outbox/compose/{-$outboxMessageId}",vn="/mail/$mailboxId/compose/{-$outboxMessageId}";function kn(){const n=Wt({from:Mn,shouldThrow:!1}),o=Wt({from:Pn,shouldThrow:!1}),a=Wt({from:xn,shouldThrow:!1}),l=Wt({from:vn,shouldThrow:!1});return n??o??a??l}function Ar(){return kn()!==void 0}function br(){return kn()?.outboxMessageId}function ir(n,o,a){return n==="flagged"?{to:Pn,params:{outboxMessageId:a}}:n==="outbox"?{to:xn,params:{outboxMessageId:a}}:n==="mailbox"&&o?{to:vn,params:{mailboxId:o,outboxMessageId:a}}:{to:Mn,params:{outboxMessageId:a}}}function Ne(){const n=go(),o=Oo(),{list:a,mailboxId:l}=wo();return V.useCallback((c,p)=>{n({...ir(a,l,c),search:_o,hash:p?.keepPanels?!0:o,replace:p?.replace??!1})},[n,o,a,l])}function Sr(){const n=Ne();return V.useCallback(()=>n(void 0),[n])}function Rr(){const n=Ne();return V.useCallback(o=>n(o),[n])}function Or(){const n=Ne();return V.useCallback(o=>n(o,{replace:!0,keepPanels:!0}),[n])}function wr(){return Do()}const sr=new Set(["rfc822","global"]),ar=n=>n.mediaType.toUpperCase()==="MESSAGE"&&sr.has(n.mediaSubtype.toLowerCase()),Un=(n,o)=>n.partPath.startsWith(`${o}.`),lr=n=>{const o=n.filter(ar);return n.filter(a=>!o.some(l=>Un(a,l.partPath)))},Dr=(n,o)=>n.filter(a=>Un(a,o)),cr=n=>{const o=lr(n).filter(c=>!c.isMultipart&&c.disposition!=="attachment"&&c.mediaType==="TEXT"&&c.contentUrl.length>0),a=o.find(c=>c.mediaSubtype.toUpperCase()==="HTML");if(a)return{kind:"html",contentUrl:a.contentUrl};const l=o.find(c=>c.mediaSubtype.toUpperCase()==="PLAIN");return l?{kind:"text",contentUrl:l.contentUrl}:null},Le={all:["messages"],detail:n=>[...Le.all,"detail",n],body:n=>[...Le.detail(n),"body"]};class gt extends Error{reason;status;retryAfterSeconds;constructor(o,a,l,c){super(a),this.name="BodyFetchError",this.reason=o,this.status=l,this.retryAfterSeconds=c}}const ur=n=>{const o=Number.parseInt(n??"",10);return!Number.isFinite(o)||o<=0?1:Math.min(o,30)},fr=8,pr="x-remit-403-reason",mr=(n,o)=>{const a=o?.trim()??"";return n===401?"auth":n===403?a.length>0?"auth":"body-missing":n===404?"body-missing":"generic"},dr=(n,o)=>(o??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(n):!1,hr=(n,o)=>{const a=(o??"").toLowerCase();return!!(n==="text"&&a.startsWith("text/html"))},Tr=async(n,o,a=async()=>null)=>{const l={},c=await a();c&&(l.Authorization=`Bearer ${c}`);const p=await Ro(n,{headers:l});if(p.status===202)throw new gt("not-ready","Message body is still syncing",202,ur(p.headers.get("Retry-After")));if(!p.ok){const A=p.headers.get(pr),G=mr(p.status,A);throw new gt(G,`Failed to load message body (${p.status} ${p.statusText})`,p.status)}const h=p.headers.get("content-type");if(hr(o,h))throw new gt("content-type-mismatch",`Refusing to render message body — expected ${o}, got Content-Type ${h}`);const F=await p.text();if(dr(F,h))throw new gt("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return F},gr=async(n,o)=>(o.isRetryAfterNotReady&&await n.refetchDescribeMessage(),n.fetchContent(o.contentUrl,o.kind)),Cr=({messageId:n,bodyParts:o,enabled:a=!0})=>{const l=o?cr(o):null,c=Eo(),{getToken:p}=yo(),h=V.useRef(null),F=Ao(),A=V.useRef(!1),G=V.useRef(null),W=n&&l?`${n}:${l.contentUrl}`:null;G.current!==W&&(G.current=W,A.current=!1);const R=bo({queryKey:n?[...Le.body(n),l?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!l)throw new Error("No renderable body part");if(!n)throw new Error("No messageId");const J=A.current;return A.current=!1,gr({fetchContent:(L,X)=>Tr(L,X,p),refetchDescribeMessage:()=>F.refetchQueries({queryKey:So({path:{messageId:n}})})},{contentUrl:l.contentUrl,kind:l.kind,isRetryAfterNotReady:J})},enabled:a&&!!n&&!!l,staleTime:300*1e3,gcTime:1800*1e3,retry:(J,L)=>L instanceof gt&&L.reason==="not-ready"?J<fr:J<1,retryDelay:(J,L)=>L instanceof gt&&L.reason==="not-ready"?(A.current=!0,(L.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),Et=R.isLoading&&!!l,yt=o!==void 0&&l===null;V.useEffect(()=>{Et&&(h.current=performance.now())},[Et]),V.useEffect(()=>{R.isSuccess&&h.current!==null&&(c.recordTiming("message.body.load",Math.round(performance.now()-h.current)),h.current=null)},[R.isSuccess,c]);const It=R.data&&l?{kind:l.kind,body:R.data}:void 0;return{picked:l,data:It,isLoading:Et,hasNoRenderablePart:yt,isError:R.isError,error:R.error,refetch:R.refetch}};export{gt as B,Ar as a,Cr as b,mr as c,br as d,Or as e,wr as f,Rr as g,Dr as h,ar as i,lr as o,yr as p,Sr as u};
|