1import{c as N,j as t,w as M,u as W,Z as K,_ as z,r as h,B as n,P as w,Q as j,a6 as k,a7 as y,U as I,l as O,T as p,i as _,H}from"./core-hTS9yCDP.js";import{a as B,p as r,b as U,d as Q,l as v}from"./index-8-wDQeTJ.js";import{g as V}from"./subscriptionService-BESscsQS.js";import{i as R}from"./premium-D8Ot6Uxi.js";import{L as Y}from"./Lock-C-FrE1JI.js";import{M as Z}from"./Menu-Bi5uzy9h.js";import{T as $}from"./TrendingUp-CnNAR42U.js";import{C as q}from"./Chat-CHI2KB5x.js";import{P as F}from"./Psychology-CIU7Bqjb.js";import{S as J}from"./School-D_Y3ER6a.js";import{V as X}from"./VolumeUp-DK933rfL.js";import{S as tt}from"./Support-DdU4ZkMQ.js";const ot=N(t.jsx("path",{d:"M12.45 16h2.09L9.43 3H7.57L2.46 16h2.09l1.12-3h5.64zm-6.02-5L8.5 5.48 10.57 11zm15.16.59-8.09 8.09L9.83 16l-1.41 1.41 5.09 5.09L23 13z"}),"Spellcheck"),et=({children:E})=>{const l=M(),a=W(),L=K(),x=z(L.breakpoints.down("md")),[u,m]=h.useState(!1),[A,d]=h.useState(null),[T,C]=h.useState(()=>R(B())),D=(()=>{try{return localStorage.getItem("ai_insight_available_today")===new Date().toISOString().slice(0,10)}catch{return!1}})();h.useEffect(()=>{(async()=>{try{const e=U();if(!e){d(null);return}const i=Q(e);if(!(i!=null&&i.user_id)){d(null);return}const s=await V(i.user_id);if(s){const{token_status:S=null}=s;v.debug("â
SidebarDashboardLayout Token status loaded:",S),d(S||null),C(R(s))}}catch(e){v.error("ð¨ Error loading token status:",e),d(null)}})()},[]);const c=T||A==="completed",P=[{text:"Insights",icon:t.jsx($,{}),path:"/dashboard/progress-tracking"},{text:"Every Day Topics",icon:t.jsx(q,{}),path:"/dashboard/every-day-topics"},{text:"Word Practice",icon:t.jsx(ot,{}),path:"/dashboard/word-practice"},{text:"Self Assessment",icon:t.jsx(F,{}),path:"/self-assessment"},{text:"Interactive Course",icon:t.jsx(J,{}),path:"/dashboard/view-lessons"},{text:"Shadowing Coach",icon:t.jsx(X,{}),path:"/shadowing"}],G=[{text:"Get in touch with a Coach",icon:t.jsx(tt,{}),path:"/coach"}],g=()=>{m(!u)},b=o=>{if(o==="/dashboard/progress-tracking")try{const e=new Date().toISOString().slice(0,10);localStorage.setItem("ai_insight_last_seen_date",e),localStorage.removeItem("ai_insight_available_today")}catch{}l(o==="/shadowing"&&!c?"/pricing":o),x&&m(!1)},f=t.jsx(n,{sx:{width:256,height:"100%",backgroundColor:"#f9fafb",display:"flex",flexDirection:"column",borderRight:"1px solid #e5e7eb"},children:t.jsxs(n,{sx:{flexGrow:1,py:2},children:[t.jsx(w,{sx:{px:1},children:P.map(o=>t.jsx(j,{disablePadding:!0,children:t.jsxs(k,{onClick:()=>b(o.path),sx:{mx:1,borderRadius:2,mb:.5,backgroundColor:(()=>{const e=a.pathname===o.path,s=o.path==="/shadowing"&&!c;return e&&!s?r.DARK_GREEN:"transparent"})(),color:(()=>{const e=a.pathname===o.path,s=o.path==="/shadowing"&&!c;return e&&!s?"white":"#374151"})(),"&:hover":{backgroundColor:(()=>{const e=a.pathname===o.path,s=o.path==="/shadowing"&&!c;return e&&!s?r.DARK_GREEN:s?"#f3f4f6":"#e8f8ef"})(),color:(()=>{const e=a.pathname===o.path,s=o.path==="/shadowing"&&!c;return e&&!s?"white":s?"#6b7280":r.DARK_GREEN})()}},children:[t.jsx(y,{sx:{color:(()=>{const e=a.pathname===o.path,s=o.path==="/shadowing"&&!c;return e&&!s?"white":s?"#9ca3af":"#6b7280"})(),minWidth:40},children:o.icon}),t.jsxs(n,{sx:{position:"relative"},children:[t.jsx(I,{primary:o.text,sx:{"& .MuiListItemText-primary":{fontWeight:(()=>{const e=a.pathname===o.path,s=o.path==="/shadowing"&&!c;return e&&!s?600:400})(),fontSize:"0.875rem"}}}),o.text==="Insights"&&D&&t.jsx(n,{sx:{position:"absolute",width:8,height:8,borderRadius:"50%",background:"radial-gradient(circle at 30% 30%, #f87171 0%, #ef4444 70%)",right:-2,top:-2,boxShadow:"0 0 0 0 rgba(239,68,68,0.4)",animation:"aiRedPulse 1.6s ease-out infinite","@keyframes aiRedPulse":{"0%":{boxShadow:"0 0 0 0 rgba(239,68,68,0.45)"},"60%":{boxShadow:"0 0 0 8px rgba(239,68,68,0)"},"100%":{boxShadow:"0 0 0 0 rgba(239,68,68,0)"}}}})]}),o.path==="/shadowing"&&!c&&t.jsx(n,{sx:{ml:1,display:"flex",alignItems:"center",color:"#9ca3af"},children:t.jsx(Y,{sx:{fontSize:16}})})]})},o.text))}),t.jsx(O,{sx:{my:2,mx:2}}),t.jsx(p,{variant:"caption",sx:{px:3,py:1,color:"#6b7280",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Account"}),t.jsx(w,{sx:{px:1},children:G.map(o=>t.jsx(j,{disablePadding:!0,children:t.jsxs(k,{onClick:()=>b(o.path),sx:{mx:1,borderRadius:2,mb:.5,backgroundColor:a.pathname===o.path?r.DARK_GREEN:"transparent",color:a.pathname===o.path?"white":"#374151","&:hover":{backgroundColor:a.pathname===o.path?r.DARK_GREEN:"#e8f8ef",color:a.pathname===o.path?"white":r.DARK_GREEN}},children:[t.jsx(y,{sx:{color:a.pathname===o.path?"white":"#6b7280",minWidth:40},children:o.icon}),t.jsx(I,{primary:o.text,sx:{"& .MuiListItemText-primary":{fontWeight:a.pathname===o.path?600:400,fontSize:"0.875rem"}}})]})},o.text))}),t.jsx(n,{sx:{p:3,mt:2},children:t.jsxs(n,{sx:{p:3,backgroundColor:"rgba(109, 194, 81, 0.1)",borderRadius:2,textAlign:"center"},children:[t.jsx(p,{variant:"subtitle2",sx:{fontWeight:600,color:r.DARK_GREEN,mb:1},children:"Perfect Your Accent"}),t.jsx(p,{variant:"body2",sx:{color:"#6b7280",mb:2,fontSize:"0.75rem"},children:"Practise daily on iPhone and Android"}),t.jsx(_,{variant:"contained",onClick:()=>l("/pricing"),sx:{width:"100%",backgroundColor:r.DARK_GREEN,color:"white",fontWeight:600,textTransform:"none",py:1.5,borderRadius:2,"&:hover":{backgroundColor:r.NEW_LIGHTER_GREEN}},children:"Get the App"})]})})]})});return t.jsxs(n,{sx:{display:"flex",minHeight:"100vh"},children:[t.jsx(H,{variant:"temporary",open:u,onClose:g,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:256}},children:f}),t.jsx(n,{component:"nav",sx:{width:{md:256},flexShrink:{md:0},display:{xs:"none",md:"block"}},children:f}),t.jsxs(n,{component:"main",sx:{flexGrow:1,backgroundColor:r.THEME_BACKROUND_COLOR,minHeight:"100vh",display:"flex",flexDirection:"column"},children:[x&&t.jsx(n,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",justifyContent:"space-between",p:2,backgroundColor:"white",borderBottom:"1px solid #e5e7eb"},children:t.jsx(_,{onClick:g,sx:{color:r.DARK_GREEN,minWidth:"auto",p:1},children:t.jsx(Z,{})})}),t.jsx(n,{sx:{flexGrow:1,p:{xs:2,md:4},maxWidth:"100%",overflow:"auto"},children:E})]})]})},gt=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"}));
1export{et as S,ot as a,gt as b};
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.