@remit/web-client-dist 0.0.310 → 0.0.311
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/{ErrorState-DiX_zNTK.js → ErrorState-BnQkLG51.js} +1 -1
- package/assets/{OnboardingWizard-r-N3eGPg.js → OnboardingWizard-CRlV4w12.js} +1 -1
- package/assets/{account-form-helpers-BHUowns0.js → account-form-helpers-BeqVh_T2.js} +1 -1
- package/assets/{accounts-B4-7wVt4.js → accounts-B98RfNOy.js} +1 -1
- package/assets/{advanced-Dlyjnb6l.js → advanced-B7t32yk3.js} +1 -1
- package/assets/{appearance-Drfetqy5.js → appearance-DdKiTKpf.js} +1 -1
- package/assets/{avatar-Ci3CMhdo.js → avatar-BRL7rg_o.js} +1 -1
- package/assets/{browser-ponyfill-BhnZT7aq.js → browser-ponyfill-6RnWTcYh.js} +2 -2
- package/assets/{circle-check-BM6iE_RP.js → circle-check-CYydPTdN.js} +1 -1
- package/assets/{confirm-dialog-F7nDmx5t.js → confirm-dialog-DIbYqfat.js} +1 -1
- package/assets/{download-Bg6cLSAV.js → download-DLEDqw0R.js} +1 -1
- package/assets/{filters-CsWlycJW.js → filters-x0P7h-Ub.js} +1 -1
- package/assets/{flagged-CuV2oZw_.js → flagged-BDPGXIn3.js} +1 -1
- package/assets/{folders-Dg7RilCS.js → folders-7p36e-xH.js} +1 -1
- package/assets/{index-BSJKHoKS.js → index-BgEpwwZ1.js} +1 -1
- package/assets/index-Der6CHju.js +1 -0
- package/assets/{index-xOALrEh8.js → index-vBthhplL.js} +65 -65
- package/assets/{kbd-C00o9L4B.js → kbd-BqpSg06H.js} +1 -1
- package/assets/{labels-pEUVx_Ue.js → labels-C7QYU5Yl.js} +1 -1
- package/assets/mail-Khqgk4gG.js +118 -0
- package/assets/{move-options-B2c-WWEl.js → move-options-CSHlm2K-.js} +1 -1
- package/assets/{onboarding-DKy8Q5MV.js → onboarding-DINPCyhf.js} +1 -1
- package/assets/{pencil-CZK87pI9.js → pencil-Cr_WV_aT.js} +1 -1
- package/assets/{rich-text-CoTs3nIc.js → rich-text-CK9ku6ou.js} +1 -1
- package/assets/{senders-p6LBrcYb.js → senders-Duc6-2A0.js} +1 -1
- package/assets/settings-O6iTQjei.js +1 -0
- package/assets/{settings-screen-C7xmJsXG.js → settings-screen-UJjBjmzD.js} +1 -1
- package/assets/{shield-check-CdES_QdC.js → shield-check-Ba6MRuh5.js} +1 -1
- package/assets/{suggested-vips-BQoY6-Yl.js → suggested-vips-CYPl0djC.js} +1 -1
- package/assets/{useDebouncedValue-Ck8McJvG.js → useDebouncedValue-BenM649w.js} +1 -1
- package/assets/{useFilters-DMt8Gx-P.js → useFilters-D0U-Wctv.js} +1 -1
- package/assets/{useLabels-oSXOt6KZ.js → useLabels-CpCaRFPt.js} +1 -1
- package/assets/{useSignature-BQN3IL24.js → useSignature-C7yUh-MN.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/index-dsr8I39S.js +0 -1
- package/assets/mail-Chm12_Xz.js +0 -118
- package/assets/settings-C2TANSwS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{al as E,az as S,au as w,aC as L,ao as _,cM as D,r as b,b0 as x,at as A,av as T,cN as p,aw as k}from"./index-vBthhplL.js";const I={synced:"synced",failed:"failed"},W={uncategorized:"uncategorized",personal:"personal",newsletter:"newsletter",marketing:"marketing",automated:"automated",transactional:"transactional",social:"social"},Z={Lookalike:"Lookalike",Unrelated:"Unrelated"},j={MoveToInbox:"MoveToInbox",MoveToJunk:"MoveToJunk"},ee={Attachment:"attachment"},N=3e4,F=1e3,R="The folder couldn't be created on the mail server. Please try again.",$="The folder was created but the mail server hasn't confirmed it yet, so nothing was attached to it. It's in your folder list — try again in a moment.",B=(e,t)=>new Promise((a,o)=>{if(t?.aborted){o(t.reason);return}const n=setTimeout(()=>{t?.removeEventListener("abort",i),a()},e),i=()=>{clearTimeout(n),o(t?.reason)};t?.addEventListener("abort",i,{once:!0})});async function z({fetchMailboxes:e,mailboxId:t,signal:a,timeoutMs:o=N,pollIntervalMs:n=F,delay:i=B,now:l=Date.now}){const s=l()+o;for(;;){a?.throwIfAborted();const c=(await e()).find(u=>u.mailboxId===t);if(c?.syncStatus===I.synced)return c;if(c?.syncStatus===I.failed)throw new Error(R);if(l()>=s)throw new Error($);await i(n,a)}}function C(e,t){const a=e.trim();return t?`${t.fullPath}${t.hierarchyDelimiter}${a}`:a}const P=(e,t)=>{const a=e.split(t);return a[0]?.toLowerCase()==="inbox"&&(a[0]="INBOX"),a.join(t)};function Y({name:e,delimiter:t,parent:a,existingPaths:o}){const n=e.trim();if(n==="")return"Enter a folder name.";if(n.includes(t))return`A folder name can't contain "${t}".`;const i=P(C(n,a),t);if(o.some(s=>P(s,t)===i))return"A folder with that name already exists."}function te(e){const t=E(),{data:a}=S({...w({path:{accountId:e??""}}),enabled:!!e}),o=L({...D(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:_({path:{accountId:e}})})}}),n=b.useRef(new Map),i=b.useCallback(async(s,r,c)=>{if(!e)throw new Error("No account to create the folder in. Pick messages from a single account first.");const u=a?.items??[],d=r?u.find(h=>h.fullPath===r):void 0;if(r&&!d)throw new Error(`Couldn't find the folder "${r}" to create this one inside.`);const y=d?{fullPath:d.fullPath,hierarchyDelimiter:d.hierarchyDelimiter}:void 0,f=C(s,y);let m=n.current.get(f);if(!m){const h=y?.hierarchyDelimiter??u[0]?.hierarchyDelimiter??"/",v=Y({name:s,delimiter:h,parent:y,existingPaths:u.map(O=>O.fullPath)});if(v)throw new Error(v);m=(await o.mutateAsync({path:{accountId:e},body:{fullPath:f,namespaceType:"personal"}})).mailboxId,n.current.set(f,m)}const M=await z({mailboxId:m,signal:c,fetchMailboxes:async()=>(await t.fetchQuery({...w({path:{accountId:e}}),staleTime:0})).items??[]});return n.current.delete(f),{id:M.mailboxId,label:x(M.fullPath),path:M.fullPath}},[o,e,a,t]);return{createFolder:b.useCallback((s,r)=>i(s,"",r),[i]),createFolderIn:i,mutation:o}}const ae=()=>{const{t:e}=A("mail",{useSuspense:!1});return b.useCallback((t,a)=>e(t,{defaultValue:a}),[e])},oe=100,X=e=>e.trim().toLowerCase()==="inbox",Q=(e,t)=>{const a=`${e.fullPath}${e.hierarchyDelimiter}`;return t.some(o=>o.mailboxId!==e.mailboxId&&o.fullPath.startsWith(a))},U=(e,t)=>t.find(a=>a.mailboxId!=null&&a.mailboxId===e)?.role;function ne(e,t,a){if(X(e.fullPath))return{deletable:!1,reason:"inbox",message:"The inbox can't be deleted."};const o=U(e.mailboxId,a);return o?{deletable:!1,reason:"role",message:`This folder is your ${o} folder. Reassign that role before deleting it.`}:Q(e,t)?{deletable:!1,reason:"children",message:"This folder has subfolders. Delete them first."}:{deletable:!0}}function V(e,t){return e.filter(a=>a.mailboxId!==t)}function ie(e){return{total:e,moved:0,phase:e===0?"moved":"moving"}}function re(e,t){if(e.phase!=="moving")return e;const a=Math.min(e.total,e.moved+Math.max(0,t));return{...e,moved:a,phase:a>=e.total?"moved":"moving"}}function se(e,t){return{...e,phase:"failed",error:t}}function le(e){return`Moved ${e.moved} of ${e.total}`}function ce(e){return e>0?"choose-fate":"confirm-empty"}const q=new Set(["outbox","postvak uit","boîte d'envoi","postausgang","buzón de salida","posta in uscita","送信トレイ","送件匣","发件箱","skrzynka nadawcza"]),G=e=>{const t=x(e.fullPath).trim().toLowerCase();return q.has(t)},g=p.length,J=(e,t)=>{const a=T(t);return[...e.filter(n=>{const i=a.get(n.mailboxId);return i==="drafts"||i==="sent"?!1:!G(n)})].sort((n,i)=>{const l=a.has(n.mailboxId)?p.indexOf(a.get(n.mailboxId)??"inbox"):g,s=a.has(i.mailboxId)?p.indexOf(a.get(i.mailboxId)??"inbox"):g;return l!==s?l-s:x(n.fullPath).localeCompare(x(i.fullPath),void 0,{sensitivity:"base",numeric:!0})})},ue=e=>e[0]?.hierarchyDelimiter??"/",de=({mailboxes:e,folderAppointments:t,currentMailboxId:a,excludeMailboxId:o,translator:n})=>{const i=J(e,t),l=T(t);return(o?V(i,o):i).map(r=>({id:r.mailboxId,label:k(r,l.get(r.mailboxId),n),path:r.fullPath,isCurrent:r.mailboxId===a}))};export{ee as C,Z as D,W as M,j as P,te as a,de as b,ie as c,se as d,re as e,ue as f,oe as g,ne as h,ce as i,le as m,ae as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bV as t,an as r,al as a,r as i,j as s}from"./index-vBthhplL.js";import{O as c}from"./OnboardingWizard-CRlV4w12.js";import"./kbd-BqpSg06H.js";import"./account-form-helpers-BeqVh_T2.js";async function l(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:t()}),e.navigateToInbox()}function y(){const e=r(),o=a(),n=i.useCallback(m=>{l({queryClient:o,recordCompleted:()=>e.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[e,o]);return s.jsx(c,{skipWelcome:!1,onComplete:n})}export{y as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./index-
|
|
1
|
+
import{a}from"./index-vBthhplL.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as wi,r as z,j as M,B as Of,
|
|
1
|
+
import{a as wi,r as z,j as M,B as Of,cX as nu,bX as ru,d as Mf,cY as ep,cZ as tp,N as np,a4 as iu,c_ as rp}from"./index-vBthhplL.js";import{s as Qa,U as ip,c as ou,a as op}from"./mail-Khqgk4gG.js";import{E as Gx}from"./mail-Khqgk4gG.js";import{C as sp}from"./confirm-dialog-DIbYqfat.js";import"./pencil-Cr_WV_aT.js";import"./avatar-BRL7rg_o.js";import"./kbd-BqpSg06H.js";import"./shield-check-Ba6MRuh5.js";import"./account-form-helpers-BeqVh_T2.js";import"./useSignature-C7yUh-MN.js";import"./useDebouncedValue-BenM649w.js";import"./useFilters-D0U-Wctv.js";import"./ErrorState-BnQkLG51.js";import"./format-CKZmh-Ru.js";import"./move-options-CSHlm2K-.js";import"./download-DLEDqw0R.js";import"./useLabels-CpCaRFPt.js";import"./circle-check-CYydPTdN.js";const ap=wi("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const lp=wi("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const up=wi("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);const cp=wi("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);const fp=wi("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]),dp=({language:n,languages:e,onSelect:t,helpText:r})=>{const[i,o]=z.useState(!1),s=z.useRef(null),a=z.useRef(null),l=z.useRef(null),u=z.useId(),c=z.useCallback(h=>{o(!1),h&&a.current?.focus()},[]);z.useEffect(()=>{if(!i)return;const h=g=>{s.current?.contains(g.target)||o(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[i]),z.useEffect(()=>{if(!i)return;const h=l.current?.querySelector('[aria-checked="true"]'),g=l.current?.querySelector('[role="menuitemradio"]');(h??g)?.focus()},[i]);const f=h=>{if(h.key==="Escape"){h.preventDefault(),c(!0);return}const g=[...l.current?.querySelectorAll('[role="menuitemradio"]')??[]],m=g.indexOf(document.activeElement),p=tp(h.key,m,g.length);p!==null&&(h.preventDefault(),g[p]?.focus())},d=h=>{t(h),c(!0)};return M.jsxs("div",{ref:s,className:"relative",children:[M.jsx(Of,{ref:a,variant:"ghost",size:"md","aria-label":`Message language: ${ru(n)}`,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?u:void 0,onClick:()=>o(h=>!h),"data-testid":"compose-language-chip","data-language":n,className:"min-h-11 min-w-11 shrink-0 px-2 font-medium",children:nu(n)}),i&&M.jsxs("div",{ref:l,id:u,role:"menu","aria-label":"Message language",onKeyDown:f,"data-testid":"compose-language-menu",className:"absolute right-0 top-full z-50 mt-1 flex max-h-[60dvh] min-w-56 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg",children:[e.map(h=>M.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":h===n,lang:h,onClick:()=>d(h),className:Mf("flex min-h-11 items-center justify-between gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",h===n&&"bg-accent-2-soft"),children:[ru(h),M.jsx("span",{className:"shrink-0 text-xs text-fg-subtle",children:nu(h)})]},h)),M.jsx("p",{"data-testid":"compose-language-help",className:"border-t border-line px-4 pb-1 pt-2 text-xs text-fg-muted",children:r??ep(navigator.userAgent)})]})]})},hp=({mode:n,onToggle:e})=>M.jsx(Of,{variant:"ghost",size:"md","aria-pressed":n==="plain",title:"Plain text",onClick:e,"data-testid":"compose-mode-toggle",className:Mf("min-h-11 shrink-0",n==="plain"&&"bg-accent-2-soft text-accent-2"),children:"Plain text"});function $(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function jf(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ve=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,gp=Ve&&"documentMode"in document?document.documentMode:null,St=Ve&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$t=Ve&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),vr=!(!Ve||!("InputEvent"in window)||gp)&&"getTargetRanges"in new window.InputEvent("input"),mn=Ve&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Rf=Ve&&/Android/.test(navigator.userAgent),Ti=Ve&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Rf,Pf=Ve&&/^(?=.*Chrome).*/i.test(navigator.userAgent),po=Ve&&Rf&&Pf,Ei=Ve&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&St&&!Pf,pp=0,mp=1,yp=2,Xs=1,Gs=2,Zs=4,Qs=8,_p=16,vs=32,Ss=64,el=128,bp=1,kp=2,xp=3,Cp=4,vp=5,Sp=6,ui=Ti||mn||Ei?" ":"",$n=`
|
|
2
2
|
|
|
3
3
|
`,tl=$t?" ":ui,rn={bold:1,capitalize:1024,code:16,highlight:el,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},wp={directionless:1,unmergeable:2},mo={center:2,end:6,justify:4,left:1,right:3,start:5},Tp={[kp]:"center",[Sp]:"end",[Cp]:"justify",[bp]:"left",[xp]:"right",[vp]:"start"},Ep={normal:0,segmented:2,token:1},Np={[pp]:"normal",[yp]:"segmented",[mp]:"token"},su="$config";function au(){return Ce()._blockCursorElement}function Dp(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-slot")}let If=class no{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new no(this.element,e,this.after)}withAfter(e){return new no(this.element,this.before,e)}withElement(e){return this.element===e?this:new no(e,this.before,this.after)}insertChild(e){const t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&$(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&$(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&$(359),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,r){if(this.element===e)return t===e&&r===0?"before":"after";const i=lu(e,this.element);if(i===null)return"after";const o=Array.prototype.indexOf.call(e.childNodes,i);if(o<0)return"after";if(t===e)return r<=o?"before":"after";const s=lu(e,t);if(s===null)return"after";const a=Array.prototype.indexOf.call(e.childNodes,s);return a>=0&&a<=o?"before":"after"}getInsertionAnchor(){return this.before}};function lu(n,e){let t=e;for(;t!==null&&t.parentNode!==n;)t=t.parentNode;return t}let Lf=class ro extends If{withBefore(e){return new ro(this.element,e,this.after)}withAfter(e){return new ro(this.element,this.before,e)}withElement(e){return this.element===e?this:new ro(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Dp(t);)e=t,t=t.nextSibling;const r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===au()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(Ei||mn||Ti);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,o=ie().createElement("br");if(o.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(o,i),e){const s=ie().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",r.insertBefore(s,o),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=o}getFirstChildOffset(){const e=this.getFirstChild(),t=this.getInsertionAnchor();let r=0;for(let i=this.element.firstChild;i!==null&&i!==e&&i!==t;i=i.nextSibling)r++;return r}resolveChildIndex(e,t,r,i){if(r===this.element){const l=this.getFirstChildOffset(),u=au(),c=this.element.childNodes,f=Math.min(i,c.length);let d=0;for(let h=l;h<f;h++)c[h]!==u&&d++;return[e,Math.min(d,e.getChildrenSize())]}const o=uu(t,r);o.push(i);const s=uu(t,this.element);let a=e.getIndexWithinParent();for(let l=0;l<s.length;l++){const u=o[l],c=s[l];if(u===void 0||u<c)break;if(u>c){a+=1;break}}return[e.getParentOrThrow(),a]}};function uu(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let o=r.previousSibling;o!==null;o=o.previousSibling)i++;t.push(i)}return r!==n&&$(225),t.reverse()}let Bf;try{Bf="0.49.0+prod.esm"}catch{}const Kf=Bf??'"<unknown>+source"';let Ur=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const wn=null;function Wf(n,e=1e3){return n instanceof ea?n.clone():n.size<e?new Map(n):new ea().init(new Map(n),void 0,n.size)}let ea=class qf{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new qf().init(this._old,this._nursery,this._size)}init(e,t,r){return this._old=e,this._nursery=t,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){const t=this._nursery&&this._nursery.get(e);return t!==void 0?t:this._old&&this._old.get(e)}get(e){const t=this.getWithTombstone(e);return t===wn?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){const t=new Map(this._old);for(const[r,i]of this._nursery)i!==wn?t.set(r,i):t.delete(r);this._old=t,this._nursery=void 0}return this._mutable=!1,this}set(e,t){const r=this.getWithTombstone(e);if(r===t)return this;const i=this.getNursery();return r!==wn&&r!==void 0||(this._size++,r===wn&&i.delete(e)),i.set(e,t),this}delete(e){const t=this.has(e);return t&&(this.getNursery().set(e,wn),this._size--),t}getOrInsert(e,t){const r=this.get(e);return r!==void 0?r:(this.set(e,t),t)}getOrInsertComputed(e,t){const r=this.get(e);if(r!==void 0)return r;const i=t(e);return this.set(e,i),i}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const e of this.entries())yield e[0]}*values(){for(const e of this.entries())yield e[1]}*entries(){const e=this._nursery,t=this._old;if(t)for(const r of t){const i=r[0],o=e?e.get(i):void 0;o!==wn&&(o!==void 0&&(r[1]=o),yield r)}if(e)for(const r of e)r[1]===wn||t&&t.has(r[0])||(yield r)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(const[r,i]of this.entries())e(i,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function yo(n,e,t,r,i,o){if(S(n)){let s=n.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===e&&((S(s)||tn(s)&&s.__slots!==null)&&yo(s,a,t,r,i,o),t.has(a)||o.delete(a),i.push(a)),s=s.getNextSibling()}}for(const s of tn(n)&&n.__slots!==null?n.__slots.values():[]){const a=r.get(s);a!==void 0&&In(a)&&a.__slotHost===e&&((S(a)||tn(a)&&a.__slots!==null)&&yo(a,s,t,r,i,o),t.has(s)||o.delete(s),i.push(s))}}let ta=!1,nl=0;function $p(n){nl=n.timeStamp}function ws(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&Lr(n,t)!==void 0}function Fp(n,e,t){const r=Oe(st(t)),i=r&&it(r,t._rootElement);let o=null,s=null;i!==null&&i.anchorNode===n&&(o=i.anchorOffset,s=i.focusOffset);const a=n.nodeValue;a!==null&&Sl(e,a,o,s,!1)}function Ap(n,e,t){if(N(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return ot(e)&&t.isAttached()}function zp(n,e,t){for(let r=n;r&&!mh(r);r=Vn(r)){const i=Lr(r,e);if(i!==void 0){const o=te(i,t);if(o)return Q(o)||!K(r)?void 0:[r,o]}}}function Uf(n,e,t){ta=!0;const r=performance.now()-nl>100;try{yt(n,()=>{const i=A()||(function(f){return f.read("latest",()=>{const d=A();return d!==null?d.clone():null})})(n),o=new Map,s=n._editorState,a=n._blockCursorElement;let l=!1,u="";for(let f=0;f<e.length;f++){const d=e[f],h=d.type,g=d.target,m=zp(g,n,s);if(!m)continue;const[p,y]=m;if(h==="characterData")r&&D(y)&&ot(g)&&Ap(i,g,y)&&Fp(g,y,n);else if(h==="childList"){l=!0;const _=d.addedNodes;for(let C=0;C<_.length;C++){const x=_[C],w=th(x),v=x.parentNode;if(!(v==null||x===a||w!==null||ws(x,v,n)||n._slotsUsed&&K(x)&&x.hasAttribute("data-lexical-slot")||mh(x))){if($t){const T=(K(x)?x.innerText:null)||x.nodeValue;T&&(u+=T)}v.removeChild(x)}}const b=d.removedNodes,k=b.length;if(k>0){let C=0;for(let x=0;x<k;x++){const w=b[x];(ws(w,g,n)||a===w)&&(g.appendChild(w),C++)}k!==C&&o.set(p,y)}}}if(o.size>0)for(const[f,d]of o)d.reconcileObservedMutation(f,n);const c=t.takeRecords();if(c.length>0){for(let f=0;f<c.length;f++){const d=c[f],h=d.addedNodes,g=d.target;for(let m=0;m<h.length;m++){const p=h[m],y=p.parentNode;y==null||p.nodeName!=="BR"||ws(p,g,n)||y.removeChild(p)}}t.takeRecords()}i!==null&&(l&&me(i),$t&&ah(n)&&i.insertRawText(u))})}finally{ta=!1}}function Hf(n){const e=n._observer;e!==null&&Uf(n,e.takeRecords(),e)}function Jf(n){(function(e){nl===0&&st(e).addEventListener("textInput",$p,!0)})(n),n._observer=new MutationObserver((e,t)=>{Uf(n,e,t)})}const cu="latest";let Op=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Rp).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Ni(n,e){return new Op(n,e)}function Di(n,e,t=cu){const r=(t===cu?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function hr(n,e,t){let r;if(Me(),typeof t=="function"){const o=n.getLatest(),s=Di(o,e);if(r=t(s),e.isEqual(s,r))return o}else r=t;const i=n.getWritable();return Yf(i).updateFromKnown(e,r),i}function Mp(n){const e=new Map,t=new Set;for(const{ownNodeConfig:r}of $l(typeof n=="function"?n:n.replace))if(r&&r.stateConfigs)for(const i of r.stateConfigs){let o;"stateConfig"in i?(o=i.stateConfig,i.flat&&t.add(o.key)):o=i,e.set(o.key,o)}return{flatKeys:t,sharedConfigMap:e}}const fu=new Set(["__proto__","constructor","prototype"]);let jp=class Vf{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,o=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:s}=this.sharedNodeState,a=o!==void 0?o:(function(l,u,c){let f=c.size;if(u)for(const d in u){const h=l.get(d);h&&c.has(h)||f++}return f})(s,r,i);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return du(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new Vf(e,t,(function(o,s,a){let l;if(a)for(const[u,c]of Object.entries(a)){if(fu.has(u))continue;const f=o.get(u);f?s.has(f)||s.set(f,f.parse(c)):(l=l||{},l[u]=c)}return l})(t.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:o}=this;i.has(e)||o&&r in o||(o&&(delete o[r],this.unknownState=du(o)),this.size++),i.set(e,t)}updateFromUnknown(e,t){if(fu.has(e))return;const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function Yf(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new jp(e,Xf(e));return e.__state=t,t}function Xf(n){return n.__state?n.__state.sharedNodeState:Zd(Ce(),n.getType()).sharedNodeState}function du(n){if(n)for(const e in n)return n}function Rp(n){return n}function hu(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const o=t?t.getValue(r):r.defaultValue;if(o!==i&&!r.isEqual(o,i))return!0}return!1}function gu(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[o,s]of Object.entries(r))if(!n.has(o)&&(n.add(o),s!==(i?i[o]:void 0)))return!0}return!1}function pu(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function mu(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,a=e.__style,l=n.__state,u=e.__state;return(t===null||t===o)&&(r===null||r===s)&&(i===null||i===a)&&(n.__state===null||l===u||(function(c,f){if(c===f)return!0;const d=new Set;return!(c&&hu(d,c,f)||f&&hu(d,f,c)||c&&gu(d,c,f)||f&&gu(d,f,c))})(l,u))}function yu(n,e){const t=n.mergeWithSibling(e),r=fe()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function _u(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(mu(e,r)){r=yu(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(mu(r,t)){r=yu(r,t);break}break}t.remove()}}else r.remove()}function Ot(n){return bu(n.anchor),bu(n.focus),n}function bu(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),D(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!S(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}const ci=Symbol.for("@lexical/CachedTextSize");function ku(n,e){return ra.read(()=>{let t=0,r=n;for(let i=0;i<e&&r!==null;i++){const o=wt.get(r);if(o===void 0&&$(345,r),S(o)){const s=Se.get(r);if(s!==void 0&&S(s)&&s.__parent!==o.__parent)t+=o.getTextContentSize();else{const a=On.get(r),l=a&&a.__lexicalTextContent;typeof l!="string"&&$(346,o.getType()),t+=l.length}i<e-1&&!o.isInline()&&(t+=2)}else{const s=o[ci];s===void 0&&$(347,o.getType(),r),t+=s}r=o.__next}return t},{editor:ue})}function Gf(n){S(n)||n[ci]===void 0&&(n[ci]=D(n)?n.__text.length:n.getTextContentSize())}const Pp=4;let fi,ue,di,ee="",Te=null,qe=null,Ie=null;function Mt(){return{firstTextKey:Ie,format:Te,style:qe}}function ht(n){n.firstTextKey!==null&&(Te=n.format,qe=n.style,Ie=n.firstTextKey)}function na(n){if(Ie!==null)return;const e=n.__lexicalFirstTextKey;if(e===void 0&&$(348),e===null)return;const t=Se.get(e);D(t)&&(Te=t.getFormat(),qe=t.getStyle(),Ie=e)}let Go,ri,ii,wt,ra,Se,On,ia,hi,Mn,Zt=!1,_o=!1;function fn(n,e){const t=wt.get(n),r=Se.has(n);if(e!==null){const i=ua(n);i.parentNode===e&&e.removeChild(i)}if(!r){if(ue._keyToDOMMap.delete(n),S(t)){const i=Ro(t,wt);oa(i,0,i.length-1,null)}if(t!==void 0){for(const i of at(t).values()){const o=aa(i);fn(i,null),o!==null&&o.remove()}wl(hi,di,Go,t,"destroyed")}}}function oa(n,e,t,r){for(let i=e;i<=t;++i){const o=n[i];o!==void 0&&fn(o,r)}}function Tn(n,e){n.setProperty("text-align",e)}const Ip="40px";function Zf(n,e){const t=fi.theme.indent;if(typeof t=="string"){const r=n.classList.contains(t);e>0&&!r?n.classList.add(t):e<1&&r&&n.classList.remove(t)}n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * var(--lexical-indent-base-value, ${Ip}))`)}function Qf(n,e){const t=n.style;e===0?Tn(t,""):e===1?Tn(t,"left"):e===2?Tn(t,"center"):e===3?Tn(t,"right"):e===4?Tn(t,"justify"):e===5?Tn(t,"start"):e===6&&Tn(t,"end")}function sa(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(Ne(r))return null;const o=r.getParent();return o===null||xe(o)&&o.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function ed(n){const e=ie().createElement("div");return e.setAttribute("data-lexical-slot",n),e.style.display="none",e}function td(n,e,t){e||n.contentEditable==="false"?Ym(t,ue):t.removeAttribute("contenteditable")}function xu(n,e,t){const r=ee,i=Mt();ee="";let o="";const s=Q(n);for(const[a,l]of t){const u=ed(a);td(e,s,u),e.appendChild(u),ee="";const c=Mt();dn(l,xt(n,u,ue)),ht(c),nd(n,a,e,u),o+=ee}return ht(i),ee=r,o}function at(n){return tn(n)&&n.__slots!==null?n.__slots:bh}function nd(n,e,t,r){const i=Mn.$getSlotTargetElement(n,e,t,ue);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}function aa(n){const e=On.get(n);return e!==void 0?e.parentElement:null}function Cu(n,e,t){const r=at(n),i=at(e);for(const[c,f]of r)if(!i.has(c)){const d=aa(f);fn(f,null),d!==null&&d.remove()}const o=ee,s=Mt();let a="",l=null;const u=Q(e);for(const[c,f]of i){const d=r.get(c);let h=d!==void 0?aa(d):null;ee="";const g=Mt();if(h===null){h=ed(c);let m=null;for(const p of t.children)if(!p.hasAttribute("data-lexical-slot")){m=p;break}t.insertBefore(h,m),dn(f,xt(e,h,ue))}else d===f?Gt(f,h):(d!==void 0&&fn(d,h),dn(f,xt(e,h,ue)));if(ht(g),td(t,u,h),nd(e,c,t,h),a+=ee,h.parentElement===t){const m=l===null?t.firstChild:l.nextSibling;m!==h&&t.insertBefore(h,m),l=h}}return ht(s),ee=o,a}function dn(n,e){const t=Se.get(n);if(t===void 0&&$(60),e!==null){const i=wt.get(n);if(i!==void 0){const o=On.get(n);if(o!==void 0){const s=In(i)?i.__slotHost:null,a=In(t)?t.__slotHost:null,l=i.__parent!==t.__parent||s!==a,u=a!==null&&o.parentElement!==e.element;if(l||u)return e.insertChild(o),Gt(n,e.element)}}}const r=Mn.$createDOM(t,ue);if((function(i,o,s){const a=s._keyToDOMMap;nh(o,s,i),a.set(i,o)})(n,r,ue),D(t)?r.setAttribute("data-lexical-text","true"):Q(t)&&(r.setAttribute("data-lexical-decorator","true"),Mo(r,{captureSelection:!0})),S(t)){const i=t.__indent,o=t.__size;sa(r,t),i!==0&&Zf(r,i);const s=at(t),a=s.size>0?xu(t,r,s):"";if(o===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,ee+=a,s.size>0&&(r.__lexicalSlotTextLength=a.length);else{const u=ee,c=o-1;if(la(Ro(t,Se),t,0,c,xt(t,r,ue)),a!==""){const f=r.__lexicalTextContent||"";r.__lexicalTextContent=a+f,ee=u+a+f}s.size>0&&(r.__lexicalSlotTextLength=a.length)}const l=t.__format;l!==0&&Qf(r,l),t.isInline()||rd(null,t,r)}else{const i=t.getTextContent();if(Q(t)){const o=t.decorate(ue,fi);o!==null&&id(n,o),r.contentEditable="false";const s=at(t);s.size>0&&xu(t,r,s)}ee+=i}return e!==null&&e.insertChild(r),Mn.$decorateDOM(t,null,r,ue),Gf(t),wl(hi,di,Go,t,"created"),r}function la(n,e,t,r,i){const o=ee,s=Mt();ee="",Te=null,qe=null,Ie=null;let a=t;for(;a<=r;++a){const u=Mt();dn(n[a],i);const c=Se.get(n[a]);c!==null&&D(c)?Te===null&&(Te=c.getFormat(),qe=c.getStyle(),Ie=c.__key):S(c)&&a<r&&!c.isInline()&&(ee+=$n),ht(u)}const l=ue._keyToDOMMap.get(e.__key);l===void 0&&$(349,e.__key),l.__lexicalTextContent=ee,l.__lexicalFirstTextKey=Ie,ee=o+ee,ht(s)}function rd(n,e,t){const r=xt(e,t,ue),i=r.element.__lexicalLastChildKind??null,o=(function(s,a){if(s){const l=s.__last;if(l){const u=a.get(l);if(u)return Pe(u)?"line-break":Q(u)&&u.isInline()?"decorator":null}return at(s).size>0?null:"empty"}return null})(e,Se);i!==o&&r.setManagedLineBreak(o)}function Lp(n,e,t){var r;Te=null,qe=null,Ie=null,(function(i,o,s){const a=ee,l=i.__size,u=o.__size;ee="";const c=s.element,f=ue._keyToDOMMap.get(o.__key);f===void 0&&$(351,o.__key);const d=u-l;if(!Zt&&Math.abs(d)<=1&&l>=Pp&&i.__first===o.__first&&(d!==0||!ue._cloneNotNeeded.has(i.__key))){const h=f.__lexicalTextContent,g=ia.get(i.__key);if(!Zt&&typeof h=="string"&&g!==void 0){const m=(function(p,y){const _=y.size;if(_===0||_>=p.__size)return null;let b=p.__last,k=null,C=0;for(;b!==null&&C<_;){if(!y.has(b))return null;k=b;const x=Se.get(b);if(x===void 0)return null;b=x.__prev,C++}return C!==_||b!==null&&y.has(b)?null:k})(o,g);if(m!==null){const p=g.size;if(d===0){const y=ku(m,p);let _=m,b=0;for(;_!==null&&b<p;){const v=Se.get(_);if(v===void 0)break;const T=Mt();Gt(_,c),D(v)&&Te===null&&(Te=v.getFormat(),qe=v.getStyle(),Ie=v.__key),ht(T),_=v.__next,b++}let k="";for(_=m,b=0;_!==null&&b<p;){const v=Se.get(_);if(v===void 0)break;let T;if(S(v)){const F=ue._keyToDOMMap.get(_),E=F&&F.__lexicalTextContent;typeof E!="string"&&$(352,v.getType()),T=E}else T=v.getTextContent();k+=T,b<p-1&&S(v)&&!v.isInline()&&(k+=$n),_=v.__next,b++}const C=f.__lexicalSlotTextLength||0,x=C>0?h.slice(C):h,w=x.slice(0,x.length-y)+k;return f.__lexicalTextContent=w,ee=a+w,void vu(o,f,g)}if((function(y,_,b,k,C,x,w,v){if(v!==1&&v!==-1||w!==(v===1?2:1))return!1;const F=w-v;let E=y.__last;for(let ae=0;ae<F-1;ae++){if(E===null)return!1;const Ae=wt.get(E);if(Ae===void 0)return!1;E=Ae.__prev}if(E===null)return!1;const O=Se.get(x),R=wt.get(E);if(O===void 0||R===void 0||O.__prev!==R.__prev)return!1;const I=[];let J=x;for(let ae=0;ae<w;ae++){if(J===null)return!1;I.push(J);const Ae=Se.get(J);J=Ae?Ae.__next:null}const ne=[];J=E;for(let ae=0;ae<F;ae++){if(J===null)return!1;ne.push(J);const Ae=wt.get(J);J=Ae?Ae.__next:null}const X=new Set(ne),Z=new Set(I),L=[];let P=0,W=0;for(;P<F&&W<w;)if(I[W]===ne[P])L.push({key:I[W],kind:"reconcile"}),P++,W++;else if(Z.has(ne[P])){if(X.has(I[W]))return!1;L.push({key:I[W],kind:"create",nextIndex:W}),W++}else L.push({key:ne[P],kind:"destroy"}),P++;for(;P<F;)L.push({key:ne[P++],kind:"destroy"});for(;W<w;)L.push({key:I[W],kind:"create",nextIndex:W}),W++;const ce=ku(E,F);for(const ae of L){const Ae=Mt();if(ae.kind==="reconcile")Gt(ae.key,b.element);else if(ae.kind==="destroy")fn(ae.key,b.element);else{let ft=null;for(let Zn=ae.nextIndex+1;Zn<w;Zn++){const qr=ue._keyToDOMMap.get(I[Zn]);if(qr!==void 0){ft=qr;break}}dn(ae.key,b.withBefore(ft??b.before))}if(ae.kind!=="destroy"){const ft=Se.get(ae.key);ft&&D(ft)&&Te===null&&(Te=ft.getFormat(),qe=ft.getStyle(),Ie=ft.__key)}ht(Ae)}let se="";for(let ae=0;ae<w;ae++){const Ae=Se.get(I[ae]);if(Ae===void 0)return!1;let ft;if(S(Ae)){const Zn=ue._keyToDOMMap.get(I[ae]),qr=Zn&&Zn.__lexicalTextContent;typeof qr!="string"&&$(350,Ae.getType()),ft=qr}else ft=Ae.getTextContent();se+=ft,ae<w-1&&S(Ae)&&!Ae.isInline()&&(se+=$n)}const Fe=k.__lexicalSlotTextLength||0,ct=Fe>0?C.slice(Fe):C;return k.__lexicalTextContent=ct.slice(0,ct.length-ce)+se,!0})(i,0,s,f,h,m,p,d)){const y=f.__lexicalTextContent;return typeof y!="string"&&$(353),ee=a+y,void vu(o,f,g)}}}if(d===0){let m=i.__first,p=0;for(;m!==null;){const y=Se.get(m);if(y===void 0)break;const _=Zt||ii.has(m)||ri.has(m),b=Mt();if(_)Gt(m,c);else{let k,C;if(S(y)){C=On.get(m);const x=C&&C.__lexicalTextContent;typeof x!="string"&&$(354,y.getType()),k=x}else k=y.getTextContent();ee+=k,C!==void 0&&na(C)}D(y)?Te===null&&(Te=y.getFormat(),qe=y.getStyle(),Ie=y.__key):S(y)&&p<u-1&&!y.isInline()&&(ee+=$n),ht(b),m=y.__next,p++}return f.__lexicalTextContent=ee,f.__lexicalFirstTextKey=Ie,void(ee=a+ee)}}if(l===1&&u===1){const h=i.__first,g=o.__first;if(h===g)Gt(h,c);else{const p=ua(h),y=dn(g,null);try{p.parentNode===c?c.replaceChild(y,p):s.insertChild(y)}catch(_){if(typeof _=="object"&&_!=null){const b=`${_.toString()} Parent: ${c.tagName}, new child: {tag: ${y.tagName} key: ${g}}, old child: {tag: ${p.tagName}, key: ${h}}.`;throw new Error(b)}throw _}fn(h,null)}const m=Se.get(g);D(m)&&Te===null&&(Te=m.getFormat(),qe=m.getStyle(),Ie=m.__key)}else{const h=Ro(i,wt),g=Ro(o,Se);if(h.length!==l&&$(227),g.length!==u&&$(228),l===0)u!==0&&la(g,o,0,u-1,s);else if(u===0){if(l!==0){const m=s.after==null&&s.before==null&&at(o).size===0&&s.element.__lexicalLineBreak==null;oa(h,0,l-1,m?null:c),m&&(c.textContent="")}}else(function(m,p,y,_,b,k){const C=_-1,x=b-1;let w,v,T=k.getFirstChild(),F=0,E=0;for(;F<=C&&E<=x;){const I=p[F],J=y[E],ne=Mt();if(I===J)T=Ts(Gt(J,k.element)),F++,E++;else{if(v===void 0&&(v=Su(y,E)),w===void 0)w=Su(p,F);else if(!w.has(I)){F++,ht(ne);continue}if(!v.has(I)){T=Ts(ua(I)),fn(I,k.element),F++,w.delete(I),ht(ne);continue}if(w.has(J)){const Z=Dr(ue,J);Z!==T&&k.withBefore(T??k.before).insertChild(Z),T=Ts(Gt(J,k.element)),F++,E++}else dn(J,k.withBefore(T??k.before)),E++}const X=Se.get(J);X!==null&&D(X)?Te===null&&(Te=X.getFormat(),qe=X.getStyle(),Ie=X.__key):S(X)&&E<=x&&!X.isInline()&&(ee+=$n),ht(ne)}const O=F>C,R=E>x;if(O&&!R){const I=y[x+1],J=I===void 0?null:ue.getElementByKey(I);la(y,m,E,x,k.withBefore(J??k.before))}else R&&!O&&oa(p,F,C,k.element)})(o,h,g,l,u,s)}f.__lexicalTextContent=ee,f.__lexicalFirstTextKey=Ie,ee=a+ee})(n,e,xt(e,t,ue)),xe(e)||(r=e,Te==null||Te===r.__textFormat||_o||r.setTextFormat(Te),(function(i){qe==null||qe===i.__textStyle||_o||i.setTextStyle(qe)})(e))}function vu(n,e,t){const r=e.__lexicalFirstTextKey;if(r!=null){const i=n.__key;let o=r;for(;o!==null;){const s=Se.get(o);if(s===void 0){o=null;break}if(s.__parent===i)break;o=s.__parent}if(o!==null&&!t.has(o)){const s=Se.get(r);if(D(s))return Te=s.getFormat(),void(qe=s.getStyle())}}e.__lexicalFirstTextKey=Ie}function Gt(n,e){const t=wt.get(n);let r=Se.get(n);t!==void 0&&r!==void 0||$(61);const i=Zt||ii.has(n)||ri.has(n),o=Dr(ue,n);if(t===r&&!i){let s;if(S(t)){const a=o.__lexicalTextContent;typeof a!="string"&&$(355,t.getType()),s=a,na(o)}else s=t.getTextContent();return ee+=s,o}if(t!==r&&i&&wl(hi,di,Go,r,"updated"),Mn.$updateDOM(r,t,o,ue)){const s=dn(n,null);return e===null&&$(62),e.replaceChild(s,o),fn(n,null),s}if(S(t)){S(r)||$(334,n);const s=r.__indent;(Zt||s!==t.__indent)&&Zf(o,s);const a=r.__format;(Zt||a!==t.__format)&&Qf(o,a);const l=i&&(at(r).size>0||at(t).size>0)?Cu(t,r,o):"";if(i){const u=ee;if(Lp(t,r,o),Ne(r)||r.isInline()||rd(0,r,o),l!==""){const c=o.__lexicalTextContent||"";o.__lexicalTextContent=l+c,ee=u+l+c,o.__lexicalSlotTextLength=l.length}else(at(r).size>0||at(t).size>0)&&(o.__lexicalSlotTextLength=0)}else{const u=o.__lexicalTextContent;typeof u!="string"&&$(356,t.getType()),ee+=u,na(o)}if((Zt||r.__dir!==t.__dir||r.__parent!==t.__parent)&&(sa(o,r),Ne(r)&&!Zt))for(const u of r.getChildren())S(u)&&sa(Dr(ue,u.getKey()),u)}else{const s=r.getTextContent();if(Q(r)){const a=r.decorate(ue,fi);a!==null&&id(n,a),i&&(at(r).size>0||at(t).size>0)&&Cu(t,r,o)}ee+=s}if(!_o&&Ne(r)){const s=r.getLatest();if(s.__cachedText!==ee){const a=s.getWritable();a.__cachedText=ee,r=a}}return Mn.$decorateDOM(r,t,o,ue),Gf(r),o}function id(n,e){let t=ue._pendingDecorators;const r=ue._decorators;if(t===null){if(r[n]===e)return;t=rh(ue)}t[n]=e}function Ts(n){let e=n.nextSibling;return e!==null&&e===ue._blockCursorElement&&(e=e.nextSibling),e}function Su(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function Bp(n,e,t,r,i,o){ee="",Te=null,qe=null,Ie=null,Zt=r===2,ue=t,fi=t._config,Mn=t._config.dom||$o,di=t._nodes,Go=ue._listeners.mutation,ri=i,ii=o,wt=n._nodeMap,ra=n,Se=e._nodeMap,_o=e._readOnly,On=Wf(t._keyToDOMMap),ia=(function(){const a=new Map,l=u=>{for(const c of u){const f=Se.get(c);if(f===void 0)continue;const d=f.__parent;if(d===null)continue;let h=a.get(d);h===void 0&&(h=new Set,a.set(d,h)),h.add(c)}};return l(ri.keys()),l(ii),a})();const s=new Map;return hi=s,Gt("root",null),ue=void 0,di=void 0,ri=void 0,ii=void 0,wt=void 0,ra=void 0,Se=void 0,fi=void 0,On=void 0,ia=void 0,hi=void 0,Mn=$o,s}function ua(n){const e=On.get(n);return e===void 0&&$(75,n),e}function B(n){return{type:n}}const jt=B("SELECTION_CHANGE_COMMAND"),od=B("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Zo=B("CLICK_COMMAND"),sd=B("BEFORE_INPUT_COMMAND"),ad=B("INPUT_COMMAND"),ld=B("COMPOSITION_START_COMMAND"),ud=B("COMPOSITION_END_COMMAND"),hn=B("DELETE_CHARACTER_COMMAND"),gr=B("INSERT_LINE_BREAK_COMMAND"),jn=B("INSERT_PARAGRAPH_COMMAND"),An=B("CONTROLLED_TEXT_INSERTION_COMMAND"),Pr=B("PASTE_COMMAND"),io=B("REMOVE_TEXT_COMMAND"),Sr=B("DELETE_WORD_COMMAND"),wr=B("DELETE_LINE_COMMAND"),Tt=B("FORMAT_TEXT_COMMAND"),Kp=B("SET_TEXT_FORMAT_COMMAND"),Qo=B("UNDO_COMMAND"),es=B("REDO_COMMAND"),rl=B("KEYDOWN_COMMAND"),il=B("KEY_ARROW_RIGHT_COMMAND"),cd=B("MOVE_TO_END"),ol=B("KEY_ARROW_LEFT_COMMAND"),fd=B("MOVE_TO_START"),sl=B("KEY_ARROW_UP_COMMAND"),al=B("KEY_ARROW_DOWN_COMMAND"),bo=B("KEY_ENTER_COMMAND"),dd=B("KEY_SPACE_COMMAND"),ts=B("KEY_BACKSPACE_COMMAND"),ll=B("KEY_ESCAPE_COMMAND"),ul=B("KEY_DELETE_COMMAND"),cl=B("KEY_TAB_COMMAND"),Wp=B("INSERT_TAB_COMMAND"),qp=B("INDENT_CONTENT_COMMAND"),wu=B("OUTDENT_CONTENT_COMMAND"),hd=B("DROP_COMMAND"),gd=B("FORMAT_ELEMENT_COMMAND"),pd=B("DRAGSTART_COMMAND"),md=B("DRAGOVER_COMMAND"),Up=B("DRAGEND_COMMAND"),$i=B("COPY_COMMAND"),ns=B("CUT_COMMAND"),fl=B("SELECT_ALL_COMMAND"),Hp=B("CLEAR_EDITOR_COMMAND"),Jp=B("CLEAR_HISTORY_COMMAND"),Zr=B("CAN_REDO_COMMAND"),Qr=B("CAN_UNDO_COMMAND"),yd=B("FOCUS_COMMAND"),Vp=B("BLUR_COMMAND"),Yp=B("KEY_MODIFIER_COMMAND");function Xp(n){const e=new Map;return{dispose(){for(const t of e.values())t.dispose();e.clear()},register(t,r){let i=e.get(t);i===void 0&&(i={dispose:n(t,r),holders:new Set},e.set(t,i));const o=()=>{const s=e.get(t);s&&s.holders.delete(o)&&s.holders.size===0&&(e.delete(t),s.dispose())};return i.holders.add(o),o}}}function oi(n,e,t,r){return n.addEventListener(e,t,r),n.removeEventListener.bind(n,e,t,r)}const Vt=Object.freeze({}),ca=[["keydown",function(n,e){const t=e._inputState;t.lastKeyDownTimeStamp=n.timeStamp,t.lastKeyCode=n.key,n.key!=="Backspace"&&gi(t),!e.isComposing()&&j(e,rl,n)}],["pointerdown",function(n,e){const t=Pn(n),r=n.pointerType;Ft(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&yt(e,()=>{jo(t,e)||(e._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(n,e){j(e,ld,n)}],["compositionend",function(n,e){const t=e._inputState;$t?t.compositionPhase="ending-firefox":mn||!Ti&&!Ei?j(e,ud,n):(t.compositionPhase="ending-safari",t.compositionEndData=n.data)}],["input",function(n,e){n.stopPropagation();const t=e._inputState;gi(t),yt(e,()=>{xd(n,e)||e.dispatchCommand(ad,n)},{event:n}),t.unprocessedBeforeInputData=null}],["click",function(n,e){yt(e,()=>{const t=A(),r=Oe(st(e)),i=lt();if(r){if(N(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!Ne(s)&&de().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)&&(r.removeAllRanges(),t.dirty=!0)}else if(n.pointerType==="touch"||n.pointerType==="pen"){const o=it(r,e._rootElement).anchorNode;(K(o)||ot(o))&&me(mi(i,r,e,n))}}if($t&&r!==null&&r.rangeCount===0){const o=e._rootElement;if(o!==null&&n.target===o){const s=n.clientY;let a=o.childNodes.length;for(let u=0;u<o.childNodes.length;u++){const c=o.childNodes[u];if(K(c)){const f=c.getBoundingClientRect();if(s<=(f.top+f.bottom)/2){a=u;break}}}r.setBaseAndExtent(o,a,o,a);const l=mi(i,r,e,n);l!==null?me(l):r.removeAllRanges()}}j(e,Zo,n)})}],["cut",Vt],["copy",Vt],["dragstart",Vt],["dragover",Vt],["dragend",Vt],["paste",Vt],["focus",Vt],["blur",Vt],["drop",Vt]];vr&&ca.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||$t&&ah(r)||i!=="insertCompositionText"&&yt(r,()=>{xd(t,r)||j(r,sd,t)},{event:t})})(n,e)]);const fa=new WeakMap,ko=new WeakMap,Gp=Xp(n=>(n.addEventListener("selectionchange",$u),()=>n.removeEventListener("selectionchange",$u)));function _d(n,e,t,r,i,o){const s=n.anchor,a=n.focus,l=s.getNode(),u=fe();let c;if(o!==void 0)c=o;else{const m=Oe(st(u));c=m!==null?it(m,u._rootElement):null}const f=c!==null?c.anchorNode:null,d=s.key,h=u.getElementByKey(d),g=t.length;return d!==a.key||!D(l)||(!i&&(!vr||u._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||l.isDirty()&&g<2||ih(t))&&s.offset!==a.offset&&!l.isComposing()||_t(l)||l.isDirty()&&g>1||(i||!vr)&&h!==null&&!l.isComposing()&&f!==pn(l,h,u)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!l.isComposing()&&(l.getFormat()!==n.format||l.getStyle()!==n.style)||(function(m,p){if(p.isSegmented())return!0;if(!m.isCollapsed())return!1;const y=m.anchor.offset,_=p.getParentOrThrow(),b=Fo(p);return y===0?!p.canInsertTextBefore()||!_.canInsertTextBefore()&&!p.isComposing()||b||(function(k){const C=k.getPreviousSibling();return(D(C)||S(C)&&C.isInline())&&!C.canInsertTextAfter()})(p):y===p.getTextContentSize()&&(!p.canInsertTextAfter()||!_.canInsertTextAfter()&&!p.isComposing()||b)})(n,l)}function Tu(n,e){return ot(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Eu(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=it(n,e._rootElement),a=e._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,Tu(r,i)&&Tu(o,s)&&!a.postDeleteSelectionToRestore)||yt(e,()=>{if(!t)return void me(null);if(!zi(e,r,o))return;let l=A();if(a.postDeleteSelectionToRestore&&N(l)&&l.isCollapsed()){const u=l.anchor,c=a.postDeleteSelectionToRestore.anchor;(u.key===c.key&&u.offset===c.offset+1||u.offset===1&&c.getNode().is(u.getNode().getPreviousSibling()))&&(l=a.postDeleteSelectionToRestore.clone(),me(l))}if(a.postDeleteSelectionToRestore=null,N(l)){const u=l.anchor,c=u.getNode();if(l.isCollapsed()){n.type==="Range"&&r===o&&(l.dirty=!0);const f=st(e).event,d=f?f.timeStamp:performance.now(),{format:h,style:g,offset:m,key:p,timeStamp:y}=a.collapsedSelectionFormat,_=de(),b=e.isComposing()===!1&&_.getTextContent()==="";if(d<y+200&&u.offset===m&&u.key===p)oo(l,h,g);else if(u.type==="text")D(c)||$(141),bd(l,c);else if(u.type==="element"&&!b){S(c)||$(259);const k=u.getNode();k.isEmpty()?(function(C,x){const w=x.getTextFormat(),v=x.getTextStyle();oo(C,w,v)})(l,k):oo(l,l.format,"")}}else{const f=u.key,d=l.focus.key,h=l.getNodes(),g=h.length,m=l.isBackward(),p=m?s:i,y=m?i:s,_=m?d:f,b=m?f:d;let k=2047,C=!1;for(let x=0;x<g;x++){const w=h[x],v=w.getTextContentSize();if(D(w)&&v!==0&&!(x===0&&w.__key===_&&p===v||x===g-1&&w.__key===b&&y===0)&&(C=!0,k&=w.getFormat(),k===0))break}l.format=C?k:0}}j(e,jt)})}function oo(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function bd(n,e){oo(n,e.getFormat(),e.getStyle())}function kd(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Nu(n){const{lastKeyCode:e}=fe()._inputState;if(n==null||n.length<=1||e==null)return;const t=e.length===1?e:e==="Enter"?`
|
|
4
4
|
`:e==="Tab"?" ":null;if(!t)return;const r=A();if(!N(r)||!r.isCollapsed())return;const i=r.anchor.getNode();if(!D(i))return;const{offset:o}=r.anchor;if(i.getTextContentSize()===o){const s=i.getNextSibling();if(t===`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,d as N,
|
|
1
|
+
import{j as e,d as N,ax as T,r as c,cd as L,c2 as O,w as $,cf as q,az as I,cU as A,al as k,aC as C,cV as M,b2 as P,B as S,S as G,aG as R,X as B}from"./index-vBthhplL.js";import{K as m}from"./kbd-BqpSg06H.js";import{S as Q,a as E}from"./settings-screen-UJjBjmzD.js";import{E as V}from"./ErrorState-BnQkLG51.js";import{u as K}from"./useDebouncedValue-BenM649w.js";import{d as _}from"./format-CKZmh-Ru.js";import"./avatar-BRL7rg_o.js";function D({options:t,active:r,onSelect:x}){return e.jsx("div",{role:"tablist",className:N("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(a=>{const d=a.id===r;return e.jsxs("button",{type:"button",role:"tab","aria-selected":d,onClick:()=>x(a.id),className:N("flex min-h-11 shrink-0 items-center gap-2 rounded-md px-3 text-left text-sm transition-colors lg:min-h-0 lg:px-2 lg:py-1",d?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface-sunken hover:text-fg"),children:[e.jsx("span",{className:"flex-1 truncate",children:a.label}),e.jsx("span",{className:N("text-2xs tabular-nums",d?"text-accent-2":"text-fg-subtle"),children:a.count??"—"})]},a.id)})})}const v={vip:"VIPs",muted:"Muted",blocked:"Blocked"},F=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"VIP"})," senders get priority surface in the daily brief and notification escalation, even when an account is quiet."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Muted"})," senders never notify and stay out of the brief. Their mail still syncs and stays searchable."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Blocked"})," senders never load images and go straight to junk."]}),e.jsxs("p",{children:["Tip: flag from the keyboard on any message — ",e.jsx(m,{children:"v"})," VIP,"," ",e.jsx(m,{children:"m"})," mute, ",e.jsx(m,{children:"b"})," block. Every rule an automation creates shows up here and can be removed."]})]});function H({query:t,onCount:r}){const{data:x,isPending:a,isError:d,error:y}=I(A()),g=k(),i=C({...P(),onSettled:()=>{g.invalidateQueries({queryKey:M()})}}),l=x?.suggestions??[],p=t.trim().toLowerCase(),u=p?l.filter(n=>(n.displayName??"").toLowerCase().includes(p)||n.normalizedEmail.toLowerCase().includes(p)):l;return c.useEffect(()=>{r?.(u.length,l.length)},[r,u.length,l.length]),a?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Loading VIP suggestions…"}):d?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(V,{variant:"inline",title:"Couldn't load VIP suggestions",error:y})}):l.length===0?e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIP suggestions yet. As you reply to senders, they'll appear here. Press ",e.jsx(m,{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(n=>e.jsx(E,{name:n.displayName??n.normalizedEmail,email:n.normalizedEmail,meta:n.replyCount>0?`${n.inboundCount} received · you replied ${n.replyCount}×`:`${n.inboundCount} received · you've never replied`,trailing:e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(G,{className:"size-3.5"}),"aria-busy":i.isPending,onClick:()=>{i.isPending||i.mutate({path:{addressId:n.addressId},body:{flags:{vip:{value:!0,setAt:Date.now(),setBy:"user"}}}})},children:"Add VIP"})},n.addressId))]})}function U({group:t,query:r,onCount:x}){const a=K(r.trim(),300),d=k(),[y,g]=c.useState(null),i=a.length>=2,l=R({query:{q:a,limit:50}}),{data:p,isPending:u,isError:n,error:j}=I({...l,enabled:i}),h=C({...P(),onSuccess:()=>{d.invalidateQueries({queryKey:l.queryKey})}}),f=(p?.items??[]).filter(s=>t==="muted"?s.flags?.muted?.value??!1:s.flags?.blocked?.value??!1);return c.useEffect(()=>{x?.(i?f.length:0,null)},[x,i,f.length]),i?u?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Searching…"}):n?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(V,{variant:"inline",title:"Search failed",error:j})}):f.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No ",v[t].toLowerCase()," senders matching “",a,"”."]}):e.jsx(e.Fragment,{children:f.map(s=>{const o=t==="muted"?s.flags?.muted:s.flags?.blocked,b=o?[`${t}`,o.setAt&&_(o.setAt,{month:"short",year:"numeric"})||null,o.reason?`— ${o.reason}`:null].filter(Boolean).join(" "):t,w=h.isPending&&h.variables?.path.addressId===s.addressId,z=h.isError&&y===s.addressId;return e.jsx(E,{name:s.displayName??s.normalizedEmail,email:s.normalizedEmail,danger:t==="blocked",meta:b,trailing:z?e.jsx(S,{variant:"secondary",size:"sm",onClick:()=>{g(s.addressId),h.mutate({path:{addressId:s.addressId},body:{flags:{[t]:null}}})},children:"Retry"}):e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),"aria-busy":w,"aria-label":`Remove ${t} flag`,onClick:()=>{w||(g(s.addressId),h.mutate({path:{addressId:s.addressId},body:{flags:{[t]:null}}}))}})},s.addressId)})}):e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle space-y-2",children:[e.jsxs("p",{children:["Type 2+ characters to search ",v[t].toLowerCase()," ","senders by name or address."]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Note: a dedicated flagged-address list endpoint is in the backlog. Press ",e.jsx(m,{children:"m"})," on any message to mute its sender; ",e.jsx(m,{children:"b"})," to block."]})]})}function te(){const t=T(),[r,x]=c.useState("vip"),[a,d]=c.useState(""),[y,g]=c.useState(!0),[i,l]=c.useState(0),[p,u]=c.useState({vip:0,muted:null,blocked:null}),n=c.useCallback((s,o)=>{l(s),u(b=>({...b,vip:o}))},[]),j=c.useCallback((s,o)=>{l(s),u(b=>({...b,[r]:s}))},[r]),h=p[r],f=s=>{const o=q[s];o&&t({to:o})};return e.jsx(Q,{items:L,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:F,helpOpen:y,onToggleHelp:()=>g(s=>!s),onSelect:f,onBackToMail:()=>{t({to:"/mail"})},children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[e.jsx(D,{active:r,onSelect:s=>{x(s),d("")},options:["vip","muted","blocked"].map(s=>({id:s,label:v[s],count:p[s]}))}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("div",{className:"border-b border-line px-row-inset py-2",children:e.jsx(O,{icon:e.jsx($,{className:"size-4"}),placeholder:`Filter ${v[r].toLowerCase()} by name or address`,className:"h-8 max-w-sm",value:a,onChange:s=>d(s.target.value)})}),e.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto",children:r==="vip"?e.jsx(H,{query:a,onCount:n}):e.jsx(U,{group:r,query:a,onCount:j})}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-line px-row-inset py-1 text-2xs text-fg-subtle",children:[e.jsx("span",{children:h!=null?`${i} of ${h} flagged senders`:`${i} flagged senders`}),e.jsxs("span",{children:[e.jsx(m,{children:"j"})," ",e.jsx(m,{children:"k"})," navigate · ",e.jsx(m,{children:"⌫"})," remove flag"]})]})]})]})})}export{te as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,bU as o}from"./index-vBthhplL.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as z,r as j,j as e,d as f,B as i,X as N,e as S}from"./index-
|
|
1
|
+
import{a as z,r as j,j as e,d as f,B as i,X as N,e as S}from"./index-vBthhplL.js";import{M as B,C as v,A as w}from"./avatar-BRL7rg_o.js";const h=z("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function L({items:l,activeId:t,title:c,description:n,children:r,help:s,helpOpen:d=!0,flush:o,onSelect:k,onToggleHelp:u,onBackToMail:m}){const[y,x]=j.useState(!1),[b,C]=j.useState(!1),g=!!s&&d,p=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),x(!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"]})}),p]}),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:()=>x(!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?.(),x(!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:()=>x(!1),"aria-label":"Close menu"})]}),p]})]}),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(B,{className:"size-4"}),className:"lg:hidden",onClick:()=>x(!0),"aria-label":"Open settings menu"}),e.jsx("h1",{className:"text-md font-semibold text-fg",children:c}),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":b}),s&&!g&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(v,{className:"size-4"}),className:"hidden ml-auto lg:inline-flex",onClick:u,"aria-label":"Show tips"})]}),s&&b&&e.jsx("div",{className:"border-b border-line bg-surface-sunken px-row-inset py-3 text-xs leading-relaxed text-fg-muted lg:hidden",children:s}),o?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:r}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-2xl px-3 py-5 lg:px-5",children:e.jsx("div",{className:"space-y-5",children:r})})})]}),g&&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 E({name:l,email:t,meta:c,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:[c,n&&e.jsxs("span",{className:"text-fg-muted",children:[" · ",n]})]})]}),s&&e.jsx("div",{className:"shrink-0",children:s})]})}const O={healthy:{tone:"positive",label:"healthy"},error:{tone:"danger",label:"error"},muted:{tone:"neutral",label:"muted"}};function F({label:l,email:t,connector:c,syncLabel:n,state:r,errorDetail:s,trailing:d}){const o=O[r];return e.jsxs("div",{className:f("rounded-sm border border-line bg-surface",r==="muted"&&"opacity-65"),children:[e.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx(w,{name:l,email:t,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:l}),e.jsx(S,{tone:o.tone,dot:!0,children:o.label})]}),e.jsxs("div",{className:"truncate text-xs text-fg-subtle",children:[t," · ",c," · ",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{F as A,L as S,E as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./index-
|
|
1
|
+
import{a as e}from"./index-vBthhplL.js";const c=e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const t=e("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"}]]);const o=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 C,t as R,o as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,
|
|
1
|
+
import{j as t,bW as e}from"./index-vBthhplL.js";const o=()=>t.jsx(e,{to:"/settings/senders",replace:!0});export{o as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./index-
|
|
1
|
+
import{r as o}from"./index-vBthhplL.js";const n=(e,t)=>{const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as M,d as I,
|
|
1
|
+
import{r as c,j as M,d as I,aC as y,cw as L,az as E,cx as z,br as _,cy as k,cz as R,al as D,cA as Y,cB as $,cC as j}from"./index-vBthhplL.js";const J=320,H="cubic-bezier(0.32, 0.9, 0.3, 1)",B=.5,U=.4,K=360;function Q(e){return Math.sign(e)*Math.sqrt(Math.abs(e))*4}function ue({open:e,onClose:t,children:r,dismissLabel:s="Dismiss"}){const i=c.useRef(null),[n,a]=c.useState(K),[l,m]=c.useState(null);c.useLayoutEffect(()=>{const o=i.current;if(!o)return;const p=()=>a(o.offsetHeight);p();const v=new ResizeObserver(p);return v.observe(o),()=>v.disconnect()},[]);const u=c.useRef(null),f=c.useCallback(o=>{o.currentTarget.setPointerCapture(o.pointerId),u.current={startY:o.clientY,lastY:o.clientY,lastT:o.timeStamp,velocity:0,moved:!1},m(0)},[]),b=c.useCallback(o=>{const p=u.current;if(!p)return;const v=o.timeStamp-p.lastT;v>0&&(p.velocity=(o.clientY-p.lastY)/v),p.lastY=o.clientY,p.lastT=o.timeStamp;const S=o.clientY-p.startY;Math.abs(S)>4&&(p.moved=!0);const F=S<0?Q(S):S;m(F)},[]),d=c.useCallback(()=>{const o=u.current;if(u.current=null,!o)return;const p=o.lastY-o.startY,S=o.velocity>B||p>n*U;m(null),S&&t()},[n,t]),h=l!==null,g=e?l??0:n,C=Math.min(Math.max(1-g/n,0),1),O=h?"none":`transform ${J}ms ${H}`;return M.jsxs("div",{className:I("absolute inset-0 z-40 select-none overflow-hidden",e||h?"":"pointer-events-none"),children:[M.jsx("button",{type:"button","aria-label":s,tabIndex:-1,onClick:t,className:I("absolute inset-0 bg-black/40",C>0?"pointer-events-auto":"pointer-events-none"),style:{opacity:C*.6,transition:O.replace("transform","opacity")}}),M.jsxs("div",{ref:i,className:"absolute inset-x-0 bottom-0 flex max-h-[92%] flex-col rounded-t-3xl border-t border-line bg-surface pb-[env(safe-area-inset-bottom,0px)] shadow-2xl shadow-black/30",style:{transform:`translateY(${g}px)`,transition:O},children:[M.jsx("div",{role:"slider","aria-label":"Drag down to dismiss","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(C*100),tabIndex:0,onPointerDown:f,onPointerMove:b,onPointerUp:d,onPointerCancel:d,className:"flex cursor-grab touch-none justify-center pb-1 pt-2.5 active:cursor-grabbing",children:M.jsx("div",{className:"h-1 w-10 rounded-full bg-fg-subtle/40"})}),M.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r})]})]})}const W=1024,q=`(min-width: ${W}px) and (not ((orientation: portrait) and (pointer: coarse)))`,V=e=>{const[t,r]=c.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return c.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const s=window.matchMedia(e),i=n=>r(n.matches);return r(s.matches),s.addEventListener("change",i),()=>s.removeEventListener("change",i)},[e]),t},de=()=>V(q),me=(e,t)=>{if(e.state==="Expired")return"Expired";if(e.scope!=="Temporary"||!e.expiresAt)return"Active";const r=Date.parse(e.expiresAt);return Number.isNaN(r)?"Active":r<=t?"Expired":"Active"},fe=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"})},N=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,i,n]=r,a=new Date(Number(s),Number(i)-1,Number(n),23,59,59,0);if(Number.isNaN(a.getTime()))return;const l=-t.getTimezoneOffset(),m=l>=0?"+":"-",u=Math.abs(l),f=String(Math.floor(u/60)).padStart(2,"0"),b=String(u%60).padStart(2,"0"),d=h=>String(h).padStart(2,"0");return`${a.getFullYear()}-${d(a.getMonth()+1)}-${d(a.getDate())}T${d(a.getHours())}:${d(a.getMinutes())}:${d(a.getSeconds())}${m}${f}:${b}`},x="None",pe=e=>!e.literalClauses.some(t=>t.field==="HasWords"),P=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??x,actionMailboxId:e.moveMailboxId??x}),he=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",ge=({mode:e,ruleScope:t,anchorMessageId:r,clauses:s,matchOperator:i,moveMailboxId:n,until:a})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:i==="all"?"And":"Or",literalClauses:s.map(l=>({field:l.field,value:l.value})),moveMailboxId:n,expiresAt:t==="until"?N(a??""):void 0}),w=(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??x,actionMailboxId:e.moveMailboxId??x,...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{}}),G=new Set(["Complete","Failed"]),A=e=>e!==void 0&&G.has(e),X=1e3,Z=15e3,ee=e=>{const t=Math.max(0,e),r=X*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}},be=e=>{const[t,r]=c.useState(),s=y({...L(),onSuccess:g=>r(g.organizeJobId)}),{mutate:i}=s,n=E({...z({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const C=g.state.data?.state;return A(C)?!1:ee(g.state.dataUpdateCount)}}),a=c.useCallback(g=>{e&&i({path:{accountId:e},body:P(g)})},[e,i]),{refetch:l}=n,m=c.useCallback(()=>{l()},[l]),u=n.data,f=s.isPending?void 0:u,b=f?.state??s.data?.state,d=A(f?.state),h={state:b,matchedCount:f?.matchedCount??0,appliedCount:f?.appliedCount??0,failedCount:f?.failedCount??0,errorMessage:f?.errorMessage??""};return{start:a,refreshStatus:m,progress:h,isStarting:s.isPending,isRunning:!!t&&!d,isDone:d,failure:te(s.error,n.error,!!u)}},ve=["From","Subject","HasWords","ListId","FromDomain"],re=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},Se=(e,t)=>e==="ListId"?re(t):t.trim(),se=e=>e==="all"?"And":"Or",ne=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,s=e.clauses.map(i=>({field:i.field,value:i.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:se(e.matchOperator),literalClauses:s}},ae=e=>e.anchorMessageId!==void 0||!e.literalClauses.some(t=>t.field==="HasWords"),ie=e=>JSON.stringify({anchor:e.anchorMessageId??null,operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),Me=(e,t)=>{const r=ne(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?N(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},ce=350,Ce=(e,t,r)=>{const s=y(_()),{mutateAsync:i}=s,n=ie(t),[a,l]=c.useState(()=>({})),m=c.useRef(t);m.current=t;const u=c.useRef(n),f=ae(t);return c.useEffect(()=>{if(!e||!f||n===a.previewedSignature||n===a.errorSignature)return;const b=setTimeout(()=>{const d=n;u.current=d,i({path:{accountId:e},body:P({...m.current})}).then(h=>{u.current===d&&l({count:h.matchedCount,matchedIds:h.messageIds,previewedSignature:d})}).catch(h=>{u.current===d&&l(g=>({...g,error:h instanceof Error?h.message:"Couldn't count matches.",errorSignature:d}))})},ce);return()=>clearTimeout(b)},[e,f,n,a.previewedSignature,a.errorSignature,i]),f?{count:oe(a,n),matchedIds:a.previewedSignature===n?a.matchedIds??[]:[]}:{count:{status:"error",reason:k},matchedIds:[]}},T=e=>$({path:{accountId:e}}),xe=e=>{const t=E({...R({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},ye=e=>{const t=D(),r=y({...j(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:T(e)})}}),{mutate:s,mutateAsync:i}=r,n=c.useCallback((l,m,u)=>{e&&s({path:{accountId:e},body:w(l,m,u)})},[e,s]),a=c.useCallback(async(l,m,u)=>e?i({path:{accountId:e},body:w(l,m,u)}).then(()=>!0,()=>!1):!1,[e,i]);return{createFilter:n,createFilterAsync:a,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},Oe=e=>{const t=D(),r=y({...Y(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:T(e)})}}),{mutate:s}=r;return{deleteFilter:c.useCallback(n=>{e&&s({path:{accountId:e,filterId:n}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}};export{ue as B,q as D,x as N,ve as S,V as a,P as b,Ce as c,be as d,ye as e,ge as f,pe as g,T as h,Me as i,me as j,fe as k,xe as l,Oe as m,Se as n,he as o,N as p,ne as r,de as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{az as L,cP as p,al as n,aC as l,cQ as d,r as o,cR as c,cS as y,cT as g}from"./index-vBthhplL.js";const u=e=>c({path:{accountId:e}}),f=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}},C=e=>{const a=n(),t=l({...y(),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}},h=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{m as a,C as b,h as c,f as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as y,j as i,B as u,d as m,L as p,
|
|
1
|
+
import{r as y,j as i,B as u,d as m,L as p,al as x,aI as C,az as h,aH as j,aC as L,aN as k,bV as E,b_ as O}from"./index-vBthhplL.js";const t=()=>i.jsx(p,{className:"size-3.5 animate-spin"}),f=(s,n)=>n?i.jsx("span",{className:"sr-only",children:s}):s;function z({actions:s=[],destructive:n,className:l}){const[r,o]=y.useState(!1);return r&&n?.confirm?i.jsxs("div",{className:m("flex items-center gap-2",l),children:[i.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),i.jsx(u,{variant:"secondary",size:"sm",onClick:()=>o(!1),children:n.confirm.cancelLabel??"Cancel"}),i.jsx(u,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?t():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):i.jsxs("div",{className:m("flex items-center gap-2",l),children:[s.map(a=>i.jsx(u,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?t():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:f(a.label,a.iconOnly)},a.label)),n&&i.jsx(u,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?t():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){o(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:f(n.label,n.iconOnly)})]})}const c={html:"",plainText:""},N=s=>{const n=x(),{pushError:l}=C(),{data:r}=h({...j(),staleTime:1/0}),o=y.useMemo(()=>{if(!s||!r)return c;const e=r.accounts.find(b=>b.accountId===s);return e?{html:e.signatureHtml??"",plainText:e.signaturePlainText??""}:c},[s,r]),a=L({...O(),onSuccess:()=>{n.invalidateQueries({queryKey:E()})},onError:e=>{l(k("Couldn't save signature","The signature wasn't saved.",e))}}),g=y.useCallback((e,b)=>{s&&a.mutate({path:{accountId:s},body:{signatureHtml:e,signaturePlainText:b}})},[s,a]);return{signature:o,setSignature:g,isSaving:a.isPending}};export{z as R,N as u};
|
package/index.html
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
} catch (_) {}
|
|
39
39
|
})();
|
|
40
40
|
</script>
|
|
41
|
-
<script type="module" crossorigin src="/assets/index-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-vBthhplL.js"></script>
|
|
42
42
|
<link rel="stylesheet" crossorigin href="/assets/index-C2fo0j9f.css">
|
|
43
43
|
</head>
|
|
44
44
|
<body>
|
package/package.json
CHANGED
package/assets/index-dsr8I39S.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,c4 as o}from"./index-xOALrEh8.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|