1import{r as c,j as e}from"./vendor-react-BBy2ZWQs.js";import{b as w,c as N,d as k,R as C,u as L,e as I,L as n,a as S,O as R,s as x}from"./index-Bj7licZY.js";import{L as P,C as B,a as D,b as O,S as z,P as K,c as Q,H as T,d as U,e as q,U as A,D as E,t as F}from"./vendor-ui-BxcOQNql.js";import{F as W}from"./Footer-DpSQzbZj.js";import"./vendor-misc-UQ56Iyoi.js";import"./vendor-supabase-B4HII3_u.js";const u={mixBlendMode:"lighten",clipPath:"inset(3px 3px 3px 3px)"};function V(){const p=w(),l=N(),h=k(),{user:r}=C.useRouteContext(),{t:a}=L(),[t,b]=c.useState(()=>localStorage.getItem("sidebar-collapsed")==="true"),[m,i]=c.useState(!1),{data:g}=I({queryKey:["notifications-unread"],queryFn:async()=>{const{count:o}=await x.from("notifications").select("*",{count:"exact",head:!0}).is("read_at",null);return o??0},refetchInterval:3e4});function f(){b(o=>{const s=!o;return localStorage.setItem("sidebar-collapsed",String(s)),s})}async function d(){i(!1),await l.cancelQueries(),l.clear(),await x.auth.signOut(),F.success(a("nav.loggedOut")),p.navigate({to:"/auth",replace:!0})}const v=[{to:"/dashboard",label:a("nav.library"),icon:P},{to:"/calendar",label:a("nav.calendar"),icon:B},{to:"/sites",label:a("nav.sites"),icon:D},{to:"/notifications",label:a("nav.notifications"),icon:O,badge:g},{to:"/settings",label:a("nav.settings"),icon:z},{to:"/download",label:a("nav.download"),icon:K},{to:"/how-it-works",label:a("nav.howItWorks"),icon:Q},{to:"/contribute",label:a("nav.contribute"),icon:T},{to:"/report-bug",label:a("nav.reportBug"),icon:U}],y=[{to:"/titles/add",label:a("nav.addTitle"),icon:q},{to:"/import",label:a("nav.import"),icon:A},{to:"/export",label:a("nav.export"),icon:E}],j=(r?.email?.[0]??"U").toUpperCase();return e.jsxs("div",{className:"flex min-h-screen bg-background text-foreground",children:[e.jsxs("aside",{className:"hidden shrink-0 border-r border-border bg-sidebar py-4 md:flex md:flex-col",style:{width:t?52:200,transition:"width 0.2s ease",overflow:"visible"},children:[e.jsxs("div",{className:"mb-2 flex shrink-0 items-center border-b border-border pb-4",style:{padding:t?"12px 0 16px":"0 12px 16px",justifyContent:t?"center":"space-between"},children:[e.jsx(n,{to:"/dashboard",style:{display:t?"none":void 0},children:e.jsx("img",{src:"/Logo RTK.png",alt:"ReadingTK",style:{width:130,height:"auto",...u}})}),t&&e.jsx("img",{src:"/very small logo.png",alt:"RTK",style:{width:28,height:"auto",...u}}),e.jsx("button",{onClick:f,title:a(t?"nav.expand":"nav.collapse"),className:"shrink-0 rounded px-1.5 py-1 text-sm text-muted-foreground hover:bg-sidebar-accent hover:text-foreground",children:t?"»":"«"})]}),e.jsxs("div",{className:"relative border-b border-border",style:{padding:t?"10px 0":"10px 16px",display:"flex",flexDirection:"column",gap:6,alignItems:t?"center":void 0},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{onClick:t?()=>i(o=>!o):void 0,title:t?r?.email:void 0,className:`flex shrink-0 items-center justify-center rounded-full text-[11px] font-bold text-white ${t?"cursor-pointer hover:opacity-80":""}`,style:{width:26,height:26,background:"var(--gradient-primary)"},children:j}),!t&&e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:r?.email})]}),e.jsx("div",{className:"flex justify-center",children:e.jsx(S,{size:t?16:18})}),!t&&e.jsx("button",{onClick:d,className:"w-full rounded border border-border px-2 py-1 text-left text-[11px] text-muted-foreground transition hover:border-destructive hover:text-destructive",children:a("nav.logout")}),t&&m&&e.jsxs("div",{className:"flex flex-col gap-1.5 rounded border border-border bg-card p-2 shadow-xl",style:{position:"fixed",left:60,top:100,minWidth:160,zIndex:1e3},children:[e.jsx("div",{className:"truncate px-1 text-[11px] text-muted-foreground",children:r?.email}),e.jsx("button",{onClick:d,className:"rounded border border-border px-2 py-1 text-left text-[11px] text-muted-foreground transition hover:border-destructive hover:text-destructive",children:a("nav.logout")})]})]}),e.jsxs("nav",{className:"flex flex-1 flex-col gap-0.5 px-2",children:[v.map(o=>{const s=h.pathname.startsWith(o.to);return e.jsxs(n,{to:o.to,title:t?o.label:void 0,className:"flex items-center overflow-hidden whitespace-nowrap rounded text-[13px] font-medium no-underline transition-colors",style:{gap:8,padding:t?"8px 0":"8px 10px",justifyContent:t?"center":void 0,background:s?"var(--color-primary-glow, oklch(0.55 0.18 268 / 0.18))":void 0,color:s?"var(--color-accent, oklch(0.70 0.20 268))":void 0,border:s?"1px solid rgba(28,52,133,0.4)":"1px solid transparent"},children:[e.jsxs("span",{className:"relative shrink-0",style:{width:18,textAlign:"center"},children:[e.jsx(o.icon,{style:{width:15,height:15}}),t&&"badge"in o&&o.badge?e.jsx("span",{className:"absolute -right-1 -top-1 rounded-full bg-accent px-1 text-[9px] font-bold text-accent-foreground",children:o.badge}):null]}),!t&&e.jsxs("span",{className:"flex flex-1 items-center justify-between",children:[o.label,"badge"in o&&o.badge?e.jsx("span",{className:"rounded-full bg-accent px-1.5 py-0.5 text-[10px] font-semibold text-accent-foreground",children:o.badge}):null]})]},o.to)}),e.jsx("div",{className:"mt-2 border-t border-border/40 pt-2",children:y.map(o=>e.jsxs(n,{to:o.to,title:t?o.label:void 0,className:"flex items-center overflow-hidden whitespace-nowrap rounded text-[13px] text-muted-foreground no-underline transition-colors hover:bg-sidebar-accent hover:text-foreground",style:{gap:8,padding:t?"8px 0":"8px 10px",justifyContent:t?"center":void 0},children:[e.jsx("span",{className:"shrink-0",style:{width:18,textAlign:"center"},children:e.jsx(o.icon,{style:{width:15,height:15}})}),!t&&o.label]},o.to))})]})]}),e.jsxs("main",{className:"flex flex-1 flex-col overflow-x-hidden",children:[e.jsx("div",{className:"flex-1",children:e.jsx(R,{})}),e.jsx(W,{})]})]})}export{V as component};
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.