1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-vendor-CU95-FUu.css","assets/index-OI6zDfLw.css"])))=>i.map(i=>d[i]); 2import{_ as V}from"./preload-helper-CVfkMyKi.js";import{r as m,j as e,q as k,y as G,a as T,p as X,O as J}from"./react-vendor-DqcybT-d.js";import{a as Y}from"./react-use-vendor-CJoUFLSD.js";import{D as q,a as Q,b as Z,c as ee,d as oe}from"./dialog-B7uJC9AZ.js";import{e as te,u as z,j as F,b as se,k as H,a as re}from"./index-D3wA7ZNy.js";import{N as U,u as ie}from"./Navigation-C58VW5ps.js";import{u as W,S as ne,b as ae,c as ce,d as le,B as g}from"./UserAvatar-Bcp_gZKY.js";import{c as w}from"./utils-core-CshXrHwf.js";import{R as u,r as P}from"./data-auth-DZ_hEUmF.js";import{b0 as de,ax as me,b1 as ue,az as fe,aB as he,aC as pe,b2 as be,A as M,X as A,I as ve}from"./ui-vendor-5BHx923d.js";import{z as ge}from"./toast-vendor-Dp14lGr_.js";import{f as xe,P as j,a as ye}from"./TaskPomodoroControl-ep8rSdLY.js";import{P as $,h as D}from"./local-events-k3zd73Fi.js";import{a as O,P as I,S as C}from"./storage-SYYcyx7g.js";import{a as Ne,d as _e}from"./timeline-BTX8asYj.js";import{u as we,b as je,f as Ee,g as ke,n as Se,h as Le,i as Re,l as Te,m as Pe}from"./PomodoroContext-Uolognxz.js";import{r as Me}from"./sync-D9z6uyJp.js";import{r as Ae}from"./sync-BplikU4t.js";import{s as $e}from"./account-data-bus-CWZsryhz.js";import"./clipboard-vendor-B2Cr_Oxi.js";import"./query-vendor-BtQ0isFW.js";import"./proto-auth-BWHl5-D7.js";import"./rpc-vendor-BxABjo1w.js";import"./proto-common-EUe0fCcm.js";import"./data-core-Bzy81FRe.js";import"./BrandLogo-DXDzumFV.js";import"./MemoPalAvatar-APgTTehW.js";import"./data-app-BSLLZYHu.js";import"./proto-app--hAwIF-L.js";import"./utils-vendor-Ce1ZTWB2.js";import"./ProgressRing-UZfNGyue.js";import"./treemap-KZPCXAKY-D30lYqsz.js";import"./mermaid-vendor-B1Q1DSnS.js";import"./graph-vendor-BwUxIChu.js";import"./lodash-vendor-BcBbsMlu.js";import"./dayjs-vendor-BFfyYi6N.js";import"./markdown-vendor-DXfjQuWh.js";import"./switch-VT33XYC3.js";import"./api-DxC-Lfcm.js";import"./assistant-BiCnNurO.js";const De=({combo:o})=>e.jsx("kbd",{className:"inline-flex min-w-fit items-center rounded-md border border-border/60 bg-background/88 px-2 py-1 font-mono text-[11px] font-medium text-foreground/88",children:o}),Oe=({open:o,onOpenChange:r})=>{const t=te(),a=typeof document<"u"?document.documentElement.lang.startsWith("zh"):!1,l=typeof navigator<"u"?/Mac|iPhone|iPad/.test(navigator.platform):!1,i=l?"â":"Ctrl",n=l?"â¥":"Alt",d=l?"â§":"Shift",s=m.useMemo(()=>a?{title:"å¿«æ·é®",description:"å æé«é¢å¨ä½æ¥è¿é®çï¼æç´¢ã跳转ãèç¦è¾å ¥ãç¼è¾å¨æ ¼å¼åå·²ä¿åæ·å¾ã",global:"å ¨å±",editor:"ç¼è¾å¨",search:"èç¦æç´¢",composer:"èç¦è¾å ¥æ¡",help:"æå¼å¿«æ·é®é¢æ¿",home:t("common.memos"),review:t("common.review"),explore:t("common.explore"),archived:t("common.archived"),attachments:t("common.attachments"),inbox:"æ¶ä»¶ç®±",settings:t("common.settings"),savedShortcuts:"忢已ä¿åæ·å¾ 1-9",save:t("editor.save"),newline:"æ¢è¡",tag:"è¾å ¥æ ç¾å¹¶å¤èµ·èæ³",bold:t("editor.bold"),italic:t("editor.italic"),highlight:t("editor.highlight"),underline:t("editor.underline"),strike:t("editor.strikethrough"),heading1:t("editor.heading-1"),heading2:t("editor.heading-2"),heading3:t("editor.heading-3"),bulletList:t("editor.bullet-list"),orderedList:t("editor.ordered-list"),todo:t("editor.todo"),divider:t("editor.divider"),attachment:"ä¸ä¼ éä»¶",linkMemo:"龿¥å¤å¿å½",location:"éæ©ä½ç½®",focusMode:t("editor.focus-mode"),visibility:"忢èªå·± / æå"}:{title:"Keyboard shortcuts",description:"This pass covers the high-frequency flow: search, navigation, composer focus, editor formatting, and saved shortcuts.",global:"Global",editor:"Editor",search:"Focus search",composer:"Focus composer",help:"Open shortcuts help",home:t("common.memos"),review:t("common.review"),explore:t("common.explore"),archived:t("common.archived"),attachments:t("common.attachments"),inbox:"Inbox",settings:t("common.settings"),savedShortcuts:"Toggle saved shortcut 1-9",save:t("editor.save"),newline:"Insert new line",tag:"Insert tag and open suggestions",bold:t("editor.bold"),italic:t("editor.italic"),highlight:t("editor.highlight"),underline:t("editor.underline"),strike:t("editor.strikethrough"),heading1:t("editor.heading-1"),heading2:t("editor.heading-2"),heading3:t("editor.heading-3"),bulletList:t("editor.bullet-list"),orderedList:t("editor.ordered-list"),todo:t("editor.todo"),divider:t("editor.divider"),attachment:"Upload attachment",linkMemo:"Link memo",location:"Select location",focusMode:t("editor.focus-mode"),visibility:"Cycle Yourself / Friends"},[a,t]),f=[{combo:`${i}+K / /`,description:s.search},{combo:"N",description:s.composer},{combo:"?",description:s.help},{combo:"G H",description:s.home},{combo:"G R",description:s.review},{combo:"G E",description:s.explore},{combo:"G A",description:s.archived},{combo:"G T",description:s.attachments},{combo:"G I",description:s.inbox},{combo:"G S",description:s.settings},{combo:`${n}+1-9`,description:s.savedShortcuts}],p=[{combo:"Enter",description:s.save},{combo:`${d}+Enter`,description:s.newline},{combo:"#",description:s.tag},{combo:`${i}+B`,description:s.bold},{combo:`${i}+I`,description:s.italic}
2,{combo:`${i}+${n}+H`,description:s.highlight},{combo:`${i}+${n}+U`,description:s.underline},{combo:`${i}+${d}+X`,description:s.strike},{combo:`${i}+${n}+1`,description:s.heading1},{combo:`${i}+${n}+2`,description:s.heading2},{combo:`${i}+${n}+3`,description:s.heading3},{combo:`${i}+${d}+8`,description:s.bulletList},{combo:`${i}+${d}+7`,description:s.orderedList},{combo:`${i}+${n}+T`,description:s.todo},{combo:`${i}+${n}+-`,description:s.divider},{combo:`${i}+${d}+U`,description:s.attachment},{combo:`${i}+${n}+K`,description:s.linkMemo},{combo:`${i}+${n}+M`,description:s.location},{combo:`${i}+${n}+F`,description:s.focusMode},{combo:`${i}+${n}+V`,description:s.visibility}];return e.jsx(q,{open:o,onOpenChange:r,children:e.jsxs(Q,{size:"xl",className:"rounded-[1.75rem] border border-border/60 bg-card/96 p-5 shadow-xl",children:[e.jsxs(Z,{className:"pr-8",children:[e.jsx(ee,{children:s.title}),e.jsx(oe,{children:s.description})]}),e.jsx("div",{className:"grid gap-4 lg:grid-cols-2",children:[{title:s.global,items:f},{title:s.editor,items:p}].map(h=>e.jsxs("section",{className:"rounded-[1.35rem] border border-border/52 bg-background/72 p-4",children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:h.title}),e.jsx("div",{className:"mt-3 flex flex-col gap-2.5",children:h.items.map(x=>e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-background/72 px-3 py-2.5",children:[e.jsx(De,{combo:x.combo}),e.jsx("span",{className:"text-right text-sm text-foreground/88",children:x.description})]},`${h.title}-${x.combo}`))})]},h.title))})]})})},Ie=[u.TODO,u.PLANNER,u.JOURNAL,u.HEALTH,u.MOOD],Ce=[u.AUTH,u.EXTENSION_COMPOSE],Be=[{id:"tab-todo",path:u.TODO,title:"æ¸
å",icon:e.jsx(me,{className:"mobile-bottom-nav__icon",strokeWidth:2.1,"aria-hidden":!0})},{id:"tab-planner",path:u.PLANNER,title:"æ¥å",icon:e.jsx(ue,{className:"mobile-bottom-nav__icon",strokeWidth:2.1,"aria-hidden":!0})},{id:"tab-journal",path:u.JOURNAL,title:"å¤å¿å½",icon:e.jsx(fe,{className:"mobile-bottom-nav__icon",strokeWidth:2.1,"aria-hidden":!0})},{id:"tab-health",path:u.HEALTH,title:"è¿å¨",icon:e.jsx(he,{className:"mobile-bottom-nav__icon",strokeWidth:2.1,"aria-hidden":!0})},{id:"tab-mood",path:u.MOOD,title:"å¿æ
",icon:e.jsx(pe,{className:"mobile-bottom-nav__icon",strokeWidth:2.1,"aria-hidden":!0})}],B=o=>Ce.some(r=>o===r||o.startsWith(`${r}/`)),Ke=o=>Ie.some(r=>o===r||o.startsWith(`${r}/`)),ze=()=>{const o=W("md"),r=z(),t=k(),[a,l]=m.useState(!1);if(m.useEffect(()=>{l(!1)},[t.key]),m.useLayoutEffect(()=>{const n=!!r&&!o&&!B(t.pathname);return document.body.classList.toggle("has-mobile-bottom-nav",n),()=>{document.body.classList.remove("has-mobile-bottom-nav")}},[r,o,t.pathname]),!r||o||B(t.pathname))return null;const i=!Ke(t.pathname)||a;return e.jsxs(e.Fragment,{children:[e.jsx("nav",{className:"mobile-bottom-nav","aria-label":"主导èª",children:e.jsxs("div",{className:"mobile-bottom-nav__inner",children:[Be.map(n=>e.jsxs(G,{id:n.id,to:n.path,viewTransition:!0,"aria-label":n.title,className:({isActive:d})=>w("mobile-bottom-nav__item",d&&"mobile-bottom-nav__item--active"),children:[e.jsx("span",{className:"mobile-bottom-nav__glyph",children:n.icon}),e.jsx("span",{className:"mobile-bottom-nav__label",children:n.title})]},n.id)),e.jsxs("button",{type:"button",id:"tab-more","aria-label":"æ´å¤","aria-expanded":a,className:w("mobile-bottom-nav__item",i&&"mobile-bottom-nav__item--active"),onClick:()=>l(!0),children:[e.jsx("span",{className:"mobile-bottom-nav__glyph",children:e.jsx(de,{className:"mobile-bottom-nav__icon",strokeWidth:2.1,"aria-hidden":!0})}),e.jsx("span",{className:"mobile-bottom-nav__label",children:"æ´å¤"})]})]})}),e.jsx(ne,{open:a,onOpenChange:l,children:e.jsxs(ae,{side:"left",className:"mobile-bottom-nav__more-sheet w-80 max-w-full overflow-auto bg-background px-2",children:[e.jsx(ce,{children:e.jsx(le,{className:"sr-only",children:"æ´å¤"})}),e.jsx(U,{className:"pb-4"})]})})]})},Fe=3e4,He=1e4,K=45e3,Ue=2,We=()=>{const o=m.useRef([]),r=m.useRef(Date.now()-K),t=m.useRef(new Set),a=m.useCallback(async()=>
2{if(!O(C)){o.current=[],r.current=Date.now(),t.current.clear();return}const i=Ne(new Date);try{const n=await xe({from:_e(i),days:Ue});o.current=n.events,Ge(n.events,t.current)}catch(n){console.error("Failed to refresh planner reminders:",n)}},[]);return m.useEffect(()=>{a();const l=window.setInterval(()=>{a()},Fe),i=()=>{a()},n=()=>{document.visibilityState==="visible"&&a()};return window.addEventListener("focus",i),window.addEventListener("storage",i),window.addEventListener(I,i),window.addEventListener($,i),document.addEventListener("visibilitychange",n),()=>{window.clearInterval(l),window.removeEventListener("focus",i),window.removeEventListener("storage",i),window.removeEventListener(I,i),window.removeEventListener($,i),document.removeEventListener("visibilitychange",n)}},[a]),m.useEffect(()=>{const l=window.setInterval(()=>{const i=O(C),n=Date.now(),d=Math.max(r.current,n-K);if(r.current=n,!!i)for(const s of o.current){if(s.isAllDay||s.completed)continue;const f=new Date(s.start).getTime(),p=`${s.id}:${s.start}`;t.current.has(p)||f>d&&f<=n&&(t.current.add(p),Ve(s))}},He);return()=>{window.clearInterval(l)}},[]),null};function Ve(o){const r=new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit"}).format(new Date(o.start));if(ge.custom(()=>e.jsxs("div",{className:"pointer-events-auto flex min-w-[280px] max-w-[360px] items-start gap-3 rounded-2xl border border-border/70 bg-card/95 p-4 shadow-xl backdrop-blur-xl",children:[e.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-primary/12 text-primary",children:e.jsx(be,{className:"size-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"æ¥ç¨å¼å§æé"}),e.jsx("p",{className:"mt-1 text-sm font-semibold text-foreground",children:o.title}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[r," · ",D(o.category)]})]})]}),{duration:12e3,position:"top-right"}),typeof window<"u"&&"Notification"in window&&Notification.permission==="granted"){const t=new Notification(o.title,{body:`${r} å¼å§ · ${D(o.category)}`,tag:`${o.id}:${o.start}`});t.onclick=()=>window.focus()}}function Ge(o,r){const t=new Set(o.map(a=>`${a.id}:${a.start}`));for(const a of r)t.has(a)||r.delete(a)}function Xe(){const o=we(),r=o.pendingBreak;m.useEffect(()=>{if(!o.focusMode&&!r)return;const b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b}},[r,o.focusMode]),m.useEffect(()=>{if(!o.focusMode&&!r)return;const b=y=>{if(y.key==="Escape"){if(r){o.dismissPendingBreak();return}o.exitFocusMode()}};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[r,o.dismissPendingBreak,o.exitFocusMode,o.focusMode]);const t=m.useMemo(()=>je(o.stats),[o.stats]),a=m.useMemo(()=>Ee(o.stats),[o.stats]);if(typeof document>"u")return null;if(r){const b=r.phase==="longBreak"?"é¿ä¼":"çä¼";return T.createPortal(e.jsx("div",{className:"pomodoro-focus-overlay pomodoro-focus-overlay--break",role:"dialog","aria-modal":"true","aria-label":"确认è¿å
¥ä¼æ¯",children:e.jsxs("div",{className:"pomodoro-focus-overlay__content",children:[e.jsxs("div",{className:"pomodoro-focus-overlay__badge",children:[e.jsx(j,{phase:r.phase,progress:1,className:"size-4"}),e.jsx("span",{children:"䏿³¨å®æ"})]}),e.jsx("h2",{className:"pomodoro-focus-overlay__title",children:r.taskTitle}),e.jsx("div",{className:"pomodoro-focus-overlay__ring-wrap",children:e.jsxs("div",{className:"pomodoro-focus-overlay__center",children:[e.jsx(j,{phase:r.phase,progress:1,className:"pomodoro-focus-overlay__focus-icon"}),e.jsxs("span",{className:"pomodoro-focus-overlay__clock",children:[r.minutes,":00"]})]})}),e.jsxs("p",{className:"pomodoro-focus-overlay__stats",children:["仿¥ ",t.count," çªè · ",t.focusMinutes," åé",a>1?` · è¿ç» ${a} 天`:""]}),e.jsxs("p",{className:"pomodoro-focus-overlay__hint",children:["æ¯å¦è¿å
¥",b," ",r.minutes," åéï¼ç¡®è®¤åæä¼å¼å§è®¡æ¶ã"]}),e.jsxs("div",{className:"pomodoro-focus-overlay__actions",children:[e.jsxs(g,{size:"lg",className:"rounded-full",onClick:()=>o.startBreak(),children:[e.jsx(M,{className:"size-4"}),"确认è¿å
¥",b]}
2),e.jsx(g,{size:"lg",variant:"outline",className:"rounded-full",onClick:o.dismissPendingBreak,children:"ç¨åå说"}),e.jsxs(g,{size:"lg",variant:"ghost",className:"rounded-full text-muted-foreground",onClick:o.stopSession,children:[e.jsx(A,{className:"size-4"}),"ç»æ"]})]})]})}),document.body)}if(!o.focusMode||!o.session)return null;const l=ke(o.session),i=Se(o.session.phase),n=i==="focus",d=88,s=2*Math.PI*d,f=s*(1-l),p=i==="longBreak"?o.settings.longBreakMinutes:o.settings.shortBreakMinutes,h=Math.max(1,o.settings.longBreakInterval),x=Math.min(o.session.completedFocusCountInCycle,h);return T.createPortal(e.jsx("div",{className:w("pomodoro-focus-overlay",!n&&"pomodoro-focus-overlay--break"),role:"dialog","aria-modal":"true","aria-label":"çªè䏿³¨æ¨¡å¼",children:e.jsxs("div",{className:"pomodoro-focus-overlay__content",children:[e.jsxs("div",{className:"pomodoro-focus-overlay__badge",children:[e.jsx(j,{phase:i,progress:l,className:"size-4"}),e.jsx("span",{children:Le(i)}),o.session.paused?e.jsx("span",{className:"pomodoro-focus-overlay__paused",children:"å·²æå"}):null]}),e.jsx("h2",{className:"pomodoro-focus-overlay__title",children:o.session.taskTitle}),e.jsxs("div",{className:"pomodoro-focus-overlay__ring-wrap",children:[e.jsxs("svg",{viewBox:"0 0 200 200",className:"pomodoro-focus-overlay__ring",children:[e.jsx("circle",{cx:"100",cy:"100",r:d,className:"pomodoro-focus-overlay__ring-track"}),e.jsx("circle",{cx:"100",cy:"100",r:d,className:"pomodoro-focus-overlay__ring-bar",strokeDasharray:s,strokeDashoffset:f})]}),e.jsxs("div",{className:"pomodoro-focus-overlay__center",children:[e.jsx(j,{phase:i,progress:l,className:"pomodoro-focus-overlay__focus-icon"}),e.jsx("span",{className:"pomodoro-focus-overlay__clock",children:Re(o.remainingMs)})]})]}),e.jsx("div",{className:"pomodoro-focus-overlay__cycle","aria-label":`æ¬è½®è¿åº¦ ${x}/${h}`,children:Array.from({length:h},(b,y)=>e.jsx("span",{className:w("pomodoro-focus-overlay__cycle-dot",y<x&&"pomodoro-focus-overlay__cycle-dot--on")},y))}),e.jsxs("p",{className:"pomodoro-focus-overlay__stats",children:["仿¥ ",t.count," çªè · ",t.focusMinutes," åé",a>1?` · è¿ç» ${a} 天`:""]}),e.jsx("p",{className:"pomodoro-focus-overlay__hint",children:n?o.session.paused?"æåä¸ï¼åå¤å¥½äºåç»§ç»":`ç®æ ${o.settings.focusMinutes} åé · Esc éåºå
¨å±`:`${i==="longBreak"?"é¿ä¼":"çä¼"} ${p} åéï¼æ¾æ¾ä¸ä¸å弿`}),e.jsxs("div",{className:"pomodoro-focus-overlay__actions",children:[o.session.paused?e.jsxs(g,{size:"lg",className:"rounded-full",onClick:o.resumeSession,children:[e.jsx(M,{className:"size-4"}),"ç»§ç»"]}):e.jsxs(g,{size:"lg",variant:"secondary",className:"rounded-full",onClick:o.pauseSession,children:[e.jsx(ve,{className:"size-4"}),"æå"]}),n?e.jsx(g,{size:"lg",variant:"outline",className:"rounded-full",onClick:o.completeFocusEarly,children:"宿䏿³¨"}):e.jsx(g,{size:"lg",variant:"outline",className:"rounded-full",onClick:o.skipBreak,children:"è·³è¿ä¼æ¯"}),e.jsx(g,{size:"lg",variant:"ghost",className:"rounded-full",onClick:o.exitFocusMode,children:"éåºå
¨å±"}),e.jsxs(g,{size:"lg",variant:"ghost",className:"rounded-full text-muted-foreground",onClick:o.stopSession,children:[e.jsx(A,{className:"size-4"}),"ç»æ"]})]})]})}),document.body)}const Je="[data-shortcut-target='search']",Ye=o=>{const r=o.split("/");return r.length===4?r[3]:""},qe=o=>{if(!(o instanceof HTMLElement))return!1;if(o.isContentEditable)return!0;const r=o.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"?!0:!!o.closest("[contenteditable='true']")},Qe=o=>Array.from(document.querySelectorAll(o)).find(t=>t.offsetParent!==null&&!t.hasAttribute("disabled"))??null,Ze=()=>{const o=Qe(Je);o&&(o.focus(),o.select())},eo=()=>{const o=F(),r=k(),{shortcuts:t}=se(),{shortcut:a,setShortcut:l}=H(),[i,n]=m.useState(!1),d=m.useRef(!1),s=m.useRef(null);return m.useEffect(()=>()=>{s.current&&window.clearTimeout(s.current)},[]),m.useEffect(()=>{const f=()=>{d.current=!1,s.current&&(window.clearTimeout(s.current),s.current=null)},p=()=>{d.current=!0,s.current&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{d.current=!1,s.current=null},1200)},h=(c,N=0)=>{for(let v=0;v<c;v+=1)window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("memos:activate-composer"))},N+v*140)},x=()=>
2{if(r.pathname!==u.JOURNAL){o(u.JOURNAL),h(6,180);return}h(1)},b=c=>{const N=(()=>{switch(c){case"h":return u.JOURNAL;case"j":return u.JOURNAL;case"r":return u.REVIEW;case"e":return u.EXPLORE;case"a":return u.ARCHIVED;case"t":return u.ATTACHMENTS;case"i":return u.INBOX;case"s":return u.SETTING;default:return}})();N&&o(N)},y=c=>{if(c.defaultPrevented)return;const N=c.target,v=c.key.toLowerCase(),S=qe(N),_=c.metaKey||c.ctrlKey;if(!S&&c.key==="?"){c.preventDefault(),f(),n(E=>!E);return}if(d.current){!c.metaKey&&!c.ctrlKey&&!c.altKey&&(c.preventDefault(),b(v)),f();return}if(!S){if(c.altKey&&!_&&!c.shiftKey&&/^Digit[1-9]$/.test(c.code)){const E=Number(c.code.replace("Digit",""))-1,L=t[E];if(!L)return;c.preventDefault();const R=Ye(L.name);l(a===R?void 0:R);return}if(!c.altKey&&!_&&!c.shiftKey&&v==="g"){c.preventDefault(),p();return}if(v==="/"&&!c.shiftKey&&!c.altKey&&!_||_&&!c.shiftKey&&!c.altKey&&v==="k"){c.preventDefault(),Ze();return}!c.altKey&&!c.shiftKey&&!_&&v==="n"&&(c.preventDefault(),x())}};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y),f()}},[a,r.pathname,o,l,t]),{isHelpOpen:i,setIsHelpOpen:n}},oo=45e3,to=8e3;function so(o){const r=m.useRef(0),t=m.useRef(!1);m.useEffect(()=>{if(!o||o==="anonymous")return;let a=!1;const l=async s=>{if(a||t.current)return;const f=Date.now();if(!(!s?.force&&f-r.current<to)){t.current=!0,r.current=f;try{await Promise.allSettled([Me(o,{seedIfEmpty:s?.seedHabits,broadcast:s?.broadcast}),Te(o,{broadcast:s?.broadcast}),Ae(o,{broadcast:s?.broadcast})])}finally{t.current=!1}}};l({seedHabits:!0,broadcast:!0,force:!0});const i=()=>{document.visibilityState==="visible"&&l({broadcast:!0,force:!0})};document.addEventListener("visibilitychange",i),window.addEventListener("focus",i);const n=window.setInterval(()=>{document.visibilityState==="visible"&&l({broadcast:!0})},oo),d=$e(s=>{s.username===o&&l({broadcast:!1,force:!0})});return()=>{a=!0,document.removeEventListener("visibilitychange",i),window.removeEventListener("focus",i),window.clearInterval(n),d()}},[o])}const ro=m.lazy(()=>V(()=>import("./MemoPalAssistant--itI9V9m.js"),__vite__mapDeps([0,1]))),Vo=()=>{const o=k(),[r]=X(),t=W("md"),a=z(),l=F(),{memoRelatedSetting:i}=re(),{removeFilter:n}=H(),d=m.useMemo(()=>o.pathname,[o.pathname]),s=Y(d),{isHelpOpen:f,setIsHelpOpen:p}=eo();return ie(),so(a?.username),m.useEffect(()=>{if(!a){i.disallowPublicVisibility?P(!0):d===u.ROOT?l(u.EXPLORE):P();return}d===u.ROOT&&l(u.JOURNAL)},[a,d,i.disallowPublicVisibility,l]),m.useEffect(()=>{s!==d&&!r.has("filter")&&n(()=>!0)},[s,d,r,n]),e.jsx(Pe,{children:e.jsxs("div",{className:"w-full min-h-full flex flex-row justify-center items-start md:pl-16",children:[t&&e.jsx("div",{className:w("group fixed top-0 left-0 z-40 flex h-full flex-col items-start justify-start select-none bg-background/70 backdrop-blur-xl","w-16 px-2","border-r border-border/60"),children:e.jsx(U,{className:"py-4 md:pt-6",collapsed:!0})}),e.jsx("main",{className:"w-full h-auto grow shrink flex flex-col justify-start items-center",children:e.jsx(J,{})}),e.jsx(ze,{}),e.jsx(We,{}),a?e.jsxs(e.Fragment,{children:[e.jsx(ye,{}),e.jsx(Xe,{}),e.jsx(m.Suspense,{fallback:null,children:e.jsx(ro,{})})]}):null,e.jsx(Oe,{open:f,onOpenChange:p})]})})};export{Vo as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.