diff --git a/assets/AIChatPage-BEasorm4.js b/assets/AIChatPage-BEasorm4.js deleted file mode 100644 index deabbdea301eb7c481e7a11c598a53c7c777b134..0000000000000000000000000000000000000000 --- a/assets/AIChatPage-BEasorm4.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cvals0ud.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css"])))=>i.map(i=>d[i]); -import{aG as B,u as z,_ as F,h as S,m as C,O as D}from"./index-Cvals0ud.js";import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{B as O}from"./button-CanHmtQ3.js";import{I}from"./input-D6YjrCkj.js";import G from"./ChatMarkdown-Bihf5n-9.js";import{P as H}from"./plus-DUNZAuOT.js";import{S as Y}from"./search-C0dGOTBF.js";import{T as Q}from"./trash-2-DaNTdmd2.js";import{C as W}from"./chevron-left-BVt9k3oq.js";import{S as q}from"./send-DJ3IeuSS.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";function K(r){return r?r instanceof Date?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof r=="object"&&"toDate"in r?r.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(r):""}const he=()=>{const{sessions:r,activeSessionId:a,isLoading:l,loadingSessionId:A,setActiveSessionId:n,createNewSession:b,sendMessage:L,deleteSession:T,getActiveSession:_}=B(),{userProfile:c}=z(),[m,P]=o.useState(""),[i,g]=o.useState(""),[y,j]=o.useState(!1),x=o.useRef(null),h=o.useRef(!0),u=o.useRef(!1),d=_(),p=d?.messages||[],M=p.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),v=l&&a===A&&!M,w=(t="auto")=>{const s=x.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},E=()=>{const t=x.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{h.current=E()};o.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./index-Cvals0ud.js").then(s=>s.b7);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),o.useEffect(()=>{if(!h.current)return;const t=window.requestAnimationFrame(()=>w("auto"));return()=>window.cancelAnimationFrame(t)},[p,v]),o.useEffect(()=>{h.current=!0,w("auto")},[a]);const N=async()=>{if(!(!i.trim()||l||y||u.current)){u.current=!0,j(!0);try{let t=a;t||(t=b(),n(t));const s=i.trim();g(""),await L(t,s)}finally{u.current=!1,j(!1)}}},k=()=>{const t=b();n(t)},$=(t,s)=>{s.stopPropagation(),T(t)},f=r.filter(t=>t.title.toLowerCase().includes(m.toLowerCase())||t.preview.toLowerCase().includes(m.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex md:gap-4 px-0 md:px-4 sm:px-6 xl:px-10 py-0 md:py-6",children:[e.jsxs("div",{className:`${a?"hidden md:flex":"flex"} w-full md:w-80 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 md:w-12 md:h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-xl md:rounded-2xl flex items-center justify-center shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-8 h-8 md:w-10 md:h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm md:text-base font-bold font-display text-[#0a1628]",children:"L.O.L.I."}),e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:"Your AI Math Tutor"})]})]}),e.jsxs("button",{onClick:k,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-3 py-2 rounded-xl text-xs font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-1.5 shrink-0",children:[e.jsx(H,{size:14}),"New Chat"]})]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(I,{type:"text",placeholder:"Search conversations...",value:m,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[f.length," Conversations"]})}),e.jsx(S,{children:f.map(t=>e.jsxs(C.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>n(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${a===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${a===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>$(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${a===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),f.length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-16 h-16 object-contain mx-auto mb-2 opacity-60 drop-shadow-sm grayscale contrast-50"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No conversations found"}),e.jsx("p",{className:"text-xs text-slate-500/60 mt-1",children:"Start a new chat!"})]})]})]}),e.jsx("div",{className:`${a?"flex":"hidden md:flex"} flex-1 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-3 md:p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0 bg-white md:bg-transparent shadow-sm md:shadow-none z-10 relative",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("button",{onClick:()=>n(null),className:"md:hidden p-1.5 -ml-1 text-slate-500 hover:text-slate-800 rounded-lg hover:bg-slate-100",children:e.jsx(W,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628] text-sm md:text-base",children:d?.title}),e.jsx("p",{className:"text-[10px] md:text-xs text-[#5a6578]",children:d?.date})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:d?.topics.map((t,s)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:t},s))})]}),e.jsxs("div",{ref:x,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-4 md:p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(S,{children:p.map(t=>e.jsxs(C.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(G,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:K(t.timestamp)})]}),t.sender==="user"&&e.jsx(D,{src:c?.photo,name:c?.name,gender:c?.gender,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),v&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-3 md:p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2 md:gap-3",children:[e.jsx(I,{type:"text",value:i,onChange:t=>g(t.target.value),onKeyPress:t=>t.key==="Enter"&&N(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx(O,{onClick:N,disabled:!i.trim()||l||y,className:"px-6 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:e.jsx(q,{size:18})})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gradient-to-r from-sky-100 to-cyan-100 rounded-3xl flex items-center justify-center mb-6",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-20 h-20 object-contain drop-shadow-lg"})}),e.jsx("h2",{className:"text-2xl font-bold font-display text-[#0a1628] mb-1",children:"Welcome to L.O.L.I."}),e.jsx("p",{className:"text-sky-600 text-sm font-bold tracking-wide uppercase mb-4",children:"Logical Operations & Learning Intelligence"}),e.jsx("p",{className:"text-[#5a6578] mb-6 max-w-md",children:"Your personal AI math tutor is here to help! Start a new conversation or select one from the sidebar."}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl font-bold shadow-lg hover:shadow-xl transition-all",children:"Start Your First Chat"}),e.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(t=>e.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",t.toLowerCase()]})]},t))})]})})]})};export{he as default}; diff --git a/assets/AIChatPage-DVRbQ5Pz.js b/assets/AIChatPage-DVRbQ5Pz.js new file mode 100644 index 0000000000000000000000000000000000000000..2f046786b3e2c12dc19a8bc673418eea0c61ba76 --- /dev/null +++ b/assets/AIChatPage-DVRbQ5Pz.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css"])))=>i.map(i=>d[i]); +import{aG as B,u as z,_ as F,h as C,m as I,O as H}from"./index-D9TvEOZX.js";import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as O}from"./button-DC8Fz5kC.js";import{I as A}from"./input-7k8DpmeH.js";import W from"./ChatMarkdown-D5DdKmyx.js";import{P as G}from"./plus-BO4Ob0HD.js";import{S as Y}from"./search-DhblJahq.js";import{T as Q}from"./trash-2-BYUCk-BO.js";import{C as q}from"./chevron-left-C7NnvvA7.js";import{S as K}from"./send-Duo9AQbk.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";function U(a){return a?a instanceof Date?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof a=="object"&&"toDate"in a?a.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(a):""}const ue=()=>{const{sessions:a,activeSessionId:o,isLoading:l,loadingSessionId:L,setActiveSessionId:n,createNewSession:c,sendMessage:T,deleteSession:_,getActiveSession:M,sessionsLoaded:g}=B(),{userProfile:m}=z(),[x,P]=r.useState(""),[i,y]=r.useState(""),[j,w]=r.useState(!1),h=r.useRef(null),u=r.useRef(!0),p=r.useRef(!1),d=M(),f=d?.messages||[],D=f.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),v=l&&o===L&&!D,N=(t="auto")=>{const s=h.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},E=()=>{const t=h.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{u.current=E()};r.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./index-D9TvEOZX.js").then(s=>s.b7);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),r.useEffect(()=>{if(g&&a.length===0){const t={id:"welcome-"+Date.now(),sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},s=c(t);n(s)}},[g]),r.useEffect(()=>{if(!u.current)return;const t=window.requestAnimationFrame(()=>N("auto"));return()=>window.cancelAnimationFrame(t)},[f,v]),r.useEffect(()=>{u.current=!0,N("auto")},[o]);const k=async()=>{if(!(!i.trim()||l||j||p.current)){p.current=!0,w(!0);try{let t=o;t||(t=c(),n(t));const s=i.trim();y(""),await T(t,s)}finally{p.current=!1,w(!1)}}},S=()=>{const t={id:"welcome-"+Date.now(),sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},s=c(t);n(s)},$=(t,s)=>{s.stopPropagation(),_(t)},b=a.filter(t=>t.title.toLowerCase().includes(x.toLowerCase())||t.preview.toLowerCase().includes(x.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex md:gap-4 px-0 md:px-4 sm:px-6 xl:px-10 py-0 md:py-6",children:[e.jsxs("div",{className:`${o?"hidden md:flex":"flex"} w-full md:w-80 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 md:w-12 md:h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-xl md:rounded-2xl flex items-center justify-center shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-8 h-8 md:w-10 md:h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm md:text-base font-bold font-display text-[#0a1628]",children:"L.O.L.I."}),e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:"Your AI Math Tutor"})]})]}),e.jsxs("button",{onClick:S,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-3 py-2 rounded-xl text-xs font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-1.5 shrink-0",children:[e.jsx(G,{size:14}),"New Chat"]})]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(A,{type:"text",placeholder:"Search conversations...",value:x,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[b.length," Conversations"]})}),e.jsx(C,{children:b.map(t=>e.jsxs(I.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>n(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${o===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${o===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>$(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${o===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),b.length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-16 h-16 object-contain mx-auto mb-2 opacity-60 drop-shadow-sm grayscale contrast-50"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No conversations found"}),e.jsx("p",{className:"text-xs text-slate-500/60 mt-1",children:"Start a new chat!"})]})]})]}),e.jsx("div",{className:`${o?"flex":"hidden md:flex"} flex-1 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-3 md:p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0 bg-white md:bg-transparent shadow-sm md:shadow-none z-10 relative",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("button",{onClick:()=>n(null),className:"md:hidden p-1.5 -ml-1 text-slate-500 hover:text-slate-800 rounded-lg hover:bg-slate-100",children:e.jsx(q,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628] text-sm md:text-base",children:d?.title}),e.jsx("p",{className:"text-[10px] md:text-xs text-[#5a6578]",children:d?.date})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:d?.topics.map((t,s)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:t},s))})]}),e.jsxs("div",{ref:h,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-4 md:p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(C,{children:f.map(t=>e.jsxs(I.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(W,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:U(t.timestamp)})]}),t.sender==="user"&&e.jsx(H,{src:m?.photo,name:m?.name,gender:m?.gender,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),v&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-3 md:p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2 md:gap-3",children:[e.jsx(A,{type:"text",value:i,onChange:t=>y(t.target.value),onKeyPress:t=>t.key==="Enter"&&k(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx(O,{onClick:k,disabled:!i.trim()||l||j,className:"px-6 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:e.jsx(K,{size:18})})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gradient-to-r from-sky-100 to-cyan-100 rounded-3xl flex items-center justify-center mb-6",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-20 h-20 object-contain drop-shadow-lg"})}),e.jsx("h2",{className:"text-2xl font-bold font-display text-[#0a1628] mb-1",children:"Welcome to L.O.L.I."}),e.jsx("p",{className:"text-sky-600 text-sm font-bold tracking-wide uppercase mb-4",children:"Logical Operations & Learning Intelligence"}),e.jsx("p",{className:"text-[#5a6578] mb-6 max-w-md",children:"Your personal AI math tutor is here to help! Start a new conversation or select one from the sidebar."}),e.jsx("button",{onClick:S,className:"px-6 py-3 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl font-bold shadow-lg hover:shadow-xl transition-all",children:"Start Your First Chat"}),e.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(t=>e.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",t.toLowerCase()]})]},t))})]})})]})};export{ue as default}; diff --git a/assets/AdminDashboard-BAdMO242.js b/assets/AdminDashboard-BjFqWILK.js similarity index 50% rename from assets/AdminDashboard-BAdMO242.js rename to assets/AdminDashboard-BjFqWILK.js index 0522bdcb51f2af7c75314317353efa11a2b870a9..327ca5f2627d7e7398bb5e6f18c50a0d5108ef6d 100644 --- a/assets/AdminDashboard-BAdMO242.js +++ b/assets/AdminDashboard-BjFqWILK.js @@ -1,4 +1,4 @@ -import{j as e,r as l,d as Ss}from"./vendor-react-B4AQeu28.js";import{C as it,S as nt,a as qs}from"./Sidebar-Cd6wJUro.js";import ct from"./ConfirmModal-CzN8U1r6.js";import{e as we,o as Te,g as M,n as Se,j as S,h as _t,m as re,q as V,R as Me,k as Ot,v as Cs,Q as Bt,S as Gt,p as ot,u as cs,L as dt,V as As,y as xt,w as De,U as Pe,G as is,i as qt,W as Hs,X as Ws,Y as Vs,r as Ht,A as Xs,Z as Fe,$ as Wt,B as Vt,T as mt,b as He,H as Xt,a0 as Qt,a1 as Kt,E as Yt,M as Zt,O as Jt}from"./index-Cvals0ud.js";import{B as A}from"./button-CanHmtQ3.js";import{S as J,a as ee,b as Ue,c as se,d as C}from"./select-ClqEN5GF.js";import{I as xe}from"./input-D6YjrCkj.js";import{S as rs}from"./subjects-jEWdBmnZ.js";import{getDocs as F,query as ve,collection as I,orderBy as We,deleteDoc as ea,doc as Es,limit as ns,where as Ve,addDoc as sa,serverTimestamp as ta,updateDoc as ws}from"./vendor-firebase-firestore-CNv3xXal.js";import{U as es}from"./upload-CEq77VjR.js";import{D as fe}from"./LogoutActionButton-C7uxe-Am.js";import{F as Ce,A as _e,N as aa}from"./NotificationDropdown-BA3YDfYB.js";import{T as je}from"./trash-2-DaNTdmd2.js";import{S as Qs}from"./sparkles-Chs7kbc0.js";import{S as Ks,D as ht,a as pt,b as ut,c as gt,e as la}from"./dialog-BkdNfKs4.js";import{D as Ps}from"./download-BJi3JOJ-.js";import{S as zs}from"./shield-check-CtsVo8Il.js";import{S as bt}from"./search-C0dGOTBF.js";import{C as Rs}from"./clock-BsCO0o69.js";import{E as ft,a as ra}from"./eye-gVkJiC2f.js";import{C as jt}from"./chevron-left-BVt9k3oq.js";import{C as vt}from"./chevron-right-DMwHUP8W.js";import{C as Re}from"./circle-alert-lQsWFo4p.js";import{I as wt}from"./info-Nl0vLXXp.js";import{C as ia,a as na}from"./vendor-radix-BPuEd8FG.js";import{C as ca}from"./check-BVDfRV4g.js";import{M as oa}from"./mail-DYnuuzL1.js";import{P as Ys}from"./plus-DUNZAuOT.js";import{S as Nt}from"./save-FkmW81ji.js";import{C as da}from"./chart-column-NTUNS-L9.js";import{u as xa}from"./useQuery-CiaHK9El.js";import{X as Ms}from"./x-cRIR5BcS.js";import{D as ma}from"./dollar-sign-B2IOYAA6.js";import{S as ha}from"./switch-BfAF8D2j.js";import{u as pa,t as ua,a as ga}from"./useSubjectAvailability-Cze5wmtk.js";import{C as ba}from"./chevron-up-CzNRBnCs.js";import{C as fa}from"./circle-help-Bpd0FWyO.js";import{B as ja}from"./bell-oitWfCwK.js";import{R as Zs,B as va,C as wa,X as Na,Y as ya,T as ka,a as Js,P as Sa,d as Ca,b as et}from"./vendor-charts-CAmziV1y.js";import{C as Ns}from"./circle-check-Bi1b5YEO.js";import"./tooltip-ERqatgcd.js";import"./shirt-Dh8-NVGy.js";import"./log-out-CKjuia0o.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";import"./formatDistanceToNow-CnY6T5Ff.js";/** +import{j as e,r,d as Ss}from"./vendor-react-B4AQeu28.js";import{C as it,S as nt,a as qs}from"./Sidebar-BbWXfzk2.js";import ct from"./ConfirmModal-bHzo3ssd.js";import{e as we,o as Te,g as M,n as Se,j as S,h as _t,m as re,q as V,R as Me,k as Ot,v as Cs,Q as Bt,S as Gt,p as ot,u as cs,L as dt,V as As,y as xt,w as De,U as Pe,G as is,i as qt,W as Hs,X as Ws,Y as Vs,r as Ht,A as Qs,Z as Fe,$ as Wt,B as Vt,T as mt,b as He,H as Qt,a0 as Xt,a1 as Kt,E as Yt,M as Zt,O as Jt}from"./index-D9TvEOZX.js";import{B as E}from"./button-DC8Fz5kC.js";import{S as J,a as ee,b as Ue,c as se,d as C}from"./select-C0r1OjMk.js";import{I as xe}from"./input-7k8DpmeH.js";import{S as rs}from"./subjects-BJQJlUBm.js";import{getDocs as F,query as ve,collection as L,orderBy as We,deleteDoc as ea,doc as Es,limit as ns,where as Ve,addDoc as sa,serverTimestamp as ta,updateDoc as ws}from"./vendor-firebase-firestore-CNv3xXal.js";import{U as es}from"./upload-OtZe8H1o.js";import{D as fe}from"./LogoutActionButton-1ArQYuvD.js";import{F as Ce,A as _e,N as aa}from"./NotificationDropdown-BGvkzRtG.js";import{T as je}from"./trash-2-BYUCk-BO.js";import{S as Xs}from"./sparkles-BLpoopVP.js";import{S as Ks,D as ht,a as pt,b as ut,c as gt,e as la}from"./dialog-BXd6FyxO.js";import{D as Ps}from"./download-BC34EYX_.js";import{S as zs}from"./shield-check-MDy66tKm.js";import{S as bt}from"./search-DhblJahq.js";import{C as Rs}from"./clock-BPtF2Ddk.js";import{E as ft,a as ra}from"./eye-C42pNDm-.js";import{C as jt}from"./chevron-left-C7NnvvA7.js";import{C as vt}from"./chevron-right-Jv12kepm.js";import{C as Re}from"./circle-alert-B7tHo7_X.js";import{I as wt}from"./info-Dc8OHnyB.js";import{C as ia,a as na}from"./vendor-radix-C5nwdvGr.js";import{C as ca}from"./check-Ceq9J6wq.js";import{M as oa}from"./mail-BP2vbAZE.js";import{P as Ys}from"./plus-BO4Ob0HD.js";import{S as Nt}from"./save-BUPludiE.js";import{C as da}from"./chart-column-BwIV9b12.js";import{u as xa}from"./useQuery-CpdRUEDx.js";import{X as Ms}from"./x-DM8tXF3P.js";import{D as ma}from"./dollar-sign-Bysazpsk.js";import{S as ha}from"./switch-CJKtscrK.js";import{u as pa,t as ua,a as ga}from"./useSubjectAvailability-BGfavHlp.js";import{C as ba}from"./chevron-up-C5341jJ8.js";import{C as fa}from"./circle-help-BNf4DSN0.js";import{B as ja}from"./bell-Ci_PX33B.js";import{R as Zs,B as va,C as wa,X as Na,Y as ya,T as ka,a as Js,P as Sa,d as Ca,b as et}from"./vendor-charts-CAmziV1y.js";import{C as Ns}from"./circle-check-C6IXGFgm.js";import"./tooltip-B9-3_gHy.js";import"./shirt-BptpMBI2.js";import"./log-out-Bh-BcVV5.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";import"./formatDistanceToNow-2ba72dLM.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. @@ -43,13 +43,13 @@ import{j as e,r as l,d as Ss}from"./vendor-react-B4AQeu28.js";import{C as it,S a * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fa=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],qe=we("user-check",Fa);function kt({className:s,...a}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:Te("w-full caption-bottom text-sm",s),...a})})}function St({className:s,...a}){return e.jsx("thead",{"data-slot":"table-header",className:Te("[&_tr]:border-b",s),...a})}function Ct({className:s,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:Te("[&_tr:last-child]:border-0",s),...a})}function Ie({className:s,...a}){return e.jsx("tr",{"data-slot":"table-row",className:Te("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...a})}function ge({className:s,...a}){return e.jsx("th",{"data-slot":"table-head",className:Te("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a})}function ie({className:s,...a}){return e.jsx("td",{"data-slot":"table-cell",className:Te("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a})}const _a=({onUploadSuccess:s})=>{const[a,n]=l.useState("upload"),[i,r]=l.useState(!1),[o,g]=l.useState(null),[m,w]=l.useState(!1),[f,d]=l.useState(null),[c,p]=l.useState(""),[v,N]=l.useState(""),[D,u]=l.useState("1"),[y,z]=l.useState(0),[T,q]=l.useState(null),[me,he]=l.useState(!1),Ne=l.useRef(null),[_,pe]=l.useState([]),[Q,X]=l.useState(!1),L=l.useCallback(async()=>{X(!0);try{const[h,P]=await Promise.all([F(ve(I(M,"courseMaterials"),We("createdAt","desc"))),F(ve(I(M,"classRecordImports"),We("createdAt","desc")))]),H=[...h.docs.map(Y=>{const G=Y.data();return{id:Y.id,fileName:G.fileName||"Untitled",teacherEmail:G.teacherEmail||"",fileType:G.fileType||"PDF",className:G.className,createdAt:G.createdAt?.toDate?.()||new Date,collection:"courseMaterials"}}),...P.docs.map(Y=>{const G=Y.data();return{id:Y.id,fileName:G.fileName||"Untitled",teacherEmail:G.teacherEmail||"",fileType:G.fileType||"CSV",className:G.className,createdAt:G.createdAt?.toDate?.()||new Date,collection:"classRecordImports"}})].sort((Y,G)=>G.createdAt.getTime()-Y.createdAt.getTime());pe(H)}catch(h){console.error("Failed to load uploaded files:",h)}finally{X(!1)}},[]),te=async(h,P)=>{try{await Se.adminDeleteFile(h,P),S.success("File removed"),L()}catch{try{await ea(Es(M,P,h)),S.success("File removed"),L()}catch{S.error("Failed to delete file")}}};Ss.useEffect(()=>{L()},[L]);const O=l.useCallback(async()=>{he(!0);try{const h=await Se.getRagHealth();q({subjects:h.subjects||{},chunkCount:h.chunkCount||0,lastIngested:h.lastIngested||""})}catch{S.error("Failed to load RAG health status")}finally{he(!1)}},[]);Ss.useEffect(()=>{O()},[O]);const K=h=>{if(h.type!=="application/pdf"){S.error("Only PDF files are allowed");return}if(h.size>50*1024*1024){S.error("File size must be under 50MB");return}if(d(h),c){const P=rs.find(H=>H.id===c);P&&N(P.name)}},ne=l.useCallback(h=>{h.preventDefault(),w(!1);const P=h.dataTransfer.files[0];P&&K(P)},[c]),B=l.useCallback(h=>{h.preventDefault(),w(!0)},[]),ce=l.useCallback(()=>w(!1),[]),x=h=>{p(h);const P=rs.find(H=>H.id===h);P&&N(P.name)},ae=async()=>{if(!f||!c||!v.trim()){S.error("Please select a PDF file, subject, and enter a subject name");return}r(!0),z(0);try{const h=new FormData;h.append("file",f),h.append("subjectId",c),h.append("subjectName",v.trim()),h.append("quarter",D);const P=setInterval(()=>{z(Y=>Math.min(Y+15,85))},300),H=await Se.uploadModulePdf(h);clearInterval(P),z(100),H.success?(S.success(`${f.name} uploaded! ${H.chunkCount??0} chunks indexed.`),d(null),H.chunkCount!==void 0&&s?.(c,H.chunkCount),O(),setTimeout(()=>n("inventory"),1e3)):S.error(H.error||"Upload failed")}catch(h){S.error(h instanceof Error?h.message:"Upload failed")}finally{r(!1),setTimeout(()=>z(0),500)}};return T&&Object.entries(T.subjects).map(([h,P])=>({name:h,chunks:P,storagePath:"",status:P>0?"active":"missing"})).filter(h=>h.chunks>0),e.jsxs("div",{className:"space-y-4 pt-2 xl:pt-4 pb-4 max-w-[1200px] mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-white p-1 rounded-2xl border border-slate-200 shadow-sm",children:[e.jsxs("button",{onClick:()=>n("upload"),className:`flex items-center gap-2 px-5 py-2 rounded-xl text-[12px] font-black transition-all duration-300 ${a==="upload"?"bg-[#9956DE] text-white shadow-lg shadow-purple-200":"text-slate-400 hover:text-purple-600 hover:bg-purple-50"}`,children:[e.jsx(es,{size:14}),"Import"]}),e.jsxs("button",{onClick:()=>n("inventory"),className:`flex items-center gap-2 px-5 py-2 rounded-xl text-[12px] font-black transition-all duration-300 ${a==="inventory"?"bg-[#9956DE] text-white shadow-lg shadow-purple-200":"text-slate-400 hover:text-purple-600 hover:bg-purple-50"}`,children:[e.jsx(fe,{size:14}),"Inventory"]})]}),e.jsx("div",{className:"flex items-center gap-3"})]}),e.jsx(_t,{mode:"wait",children:a==="upload"?e.jsxs(re.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"space-y-4",children:[e.jsxs("div",{className:"bg-white rounded-[24px] border border-slate-200 shadow-sm overflow-hidden group",children:[e.jsxs("div",{className:"p-6 border-b border-slate-50 bg-gradient-to-br from-white to-purple-50/20 relative",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-black text-[#1e293b] tracking-tight",children:"Learning Module Upload"}),e.jsx("p",{className:"text-[11px] text-slate-500 font-medium italic",children:"Provide curriculum context for AI tutoring logic."})]}),e.jsx("div",{className:"w-10 h-10 bg-[#9956DE] rounded-xl flex items-center justify-center text-white shadow-md transition-transform group-hover:scale-110",children:e.jsx(es,{size:20})})]}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{onDrop:ne,onDragOver:B,onDragLeave:ce,onClick:()=>!i&&Ne.current?.click(),className:` + */const Fa=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],qe=we("user-check",Fa);function kt({className:s,...a}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:Te("w-full caption-bottom text-sm",s),...a})})}function St({className:s,...a}){return e.jsx("thead",{"data-slot":"table-header",className:Te("[&_tr]:border-b",s),...a})}function Ct({className:s,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:Te("[&_tr:last-child]:border-0",s),...a})}function Ie({className:s,...a}){return e.jsx("tr",{"data-slot":"table-row",className:Te("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...a})}function ge({className:s,...a}){return e.jsx("th",{"data-slot":"table-head",className:Te("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a})}function ie({className:s,...a}){return e.jsx("td",{"data-slot":"table-cell",className:Te("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a})}const _a=({onUploadSuccess:s})=>{const[a,n]=r.useState("upload"),[i,l]=r.useState(!1),[o,g]=r.useState(null),[m,N]=r.useState(!1),[v,h]=r.useState(null),[c,x]=r.useState(""),[f,w]=r.useState(""),[A,u]=r.useState("1"),[y,D]=r.useState(0),[T,q]=r.useState(null),[me,he]=r.useState(!1),Ne=r.useRef(null),[_,pe]=r.useState([]),[X,Q]=r.useState(!1),U=r.useCallback(async()=>{Q(!0);try{const[p,P]=await Promise.all([F(ve(L(M,"courseMaterials"),We("createdAt","desc"))),F(ve(L(M,"classRecordImports"),We("createdAt","desc")))]),H=[...p.docs.map(Y=>{const G=Y.data();return{id:Y.id,fileName:G.fileName||"Untitled",teacherEmail:G.teacherEmail||"",fileType:G.fileType||"PDF",className:G.className,createdAt:G.createdAt?.toDate?.()||new Date,collection:"courseMaterials"}}),...P.docs.map(Y=>{const G=Y.data();return{id:Y.id,fileName:G.fileName||"Untitled",teacherEmail:G.teacherEmail||"",fileType:G.fileType||"CSV",className:G.className,createdAt:G.createdAt?.toDate?.()||new Date,collection:"classRecordImports"}})].sort((Y,G)=>G.createdAt.getTime()-Y.createdAt.getTime());pe(H)}catch(p){console.error("Failed to load uploaded files:",p)}finally{Q(!1)}},[]),te=async(p,P)=>{try{await Se.adminDeleteFile(p,P),S.success("File removed"),U()}catch{try{await ea(Es(M,P,p)),S.success("File removed"),U()}catch{S.error("Failed to delete file")}}};Ss.useEffect(()=>{U()},[U]);const O=r.useCallback(async()=>{he(!0);try{const p=await Se.getRagHealth();q({subjects:p.subjects||{},chunkCount:p.chunkCount||0,lastIngested:p.lastIngested||""})}catch{S.error("Failed to load RAG health status")}finally{he(!1)}},[]);Ss.useEffect(()=>{O()},[O]);const K=p=>{if(p.type!=="application/pdf"){S.error("Only PDF files are allowed");return}if(p.size>50*1024*1024){S.error("File size must be under 50MB");return}if(h(p),c){const P=rs.find(H=>H.id===c);P&&w(P.name)}},ne=r.useCallback(p=>{p.preventDefault(),N(!1);const P=p.dataTransfer.files[0];P&&K(P)},[c]),B=r.useCallback(p=>{p.preventDefault(),N(!0)},[]),ce=r.useCallback(()=>N(!1),[]),d=p=>{x(p);const P=rs.find(H=>H.id===p);P&&w(P.name)},ae=async()=>{if(!v||!c||!f.trim()){S.error("Please select a PDF file, subject, and enter a subject name");return}l(!0),D(0);try{const p=new FormData;p.append("file",v),p.append("subjectId",c),p.append("subjectName",f.trim()),p.append("quarter",A);const P=setInterval(()=>{D(Y=>Math.min(Y+15,85))},300),H=await Se.uploadModulePdf(p);clearInterval(P),D(100),H.success?(S.success(`${v.name} uploaded! ${H.chunkCount??0} chunks indexed.`),h(null),H.chunkCount!==void 0&&s?.(c,H.chunkCount),O(),setTimeout(()=>n("inventory"),1e3)):S.error(H.error||"Upload failed")}catch(p){S.error(p instanceof Error?p.message:"Upload failed")}finally{l(!1),setTimeout(()=>D(0),500)}};return T&&Object.entries(T.subjects).map(([p,P])=>({name:p,chunks:P,storagePath:"",status:P>0?"active":"missing"})).filter(p=>p.chunks>0),e.jsxs("div",{className:"space-y-4 pt-2 xl:pt-4 pb-4 max-w-[1200px] mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-white p-1 rounded-2xl border border-slate-200 shadow-sm",children:[e.jsxs("button",{onClick:()=>n("upload"),className:`flex items-center gap-2 px-5 py-2 rounded-xl text-[12px] font-black transition-all duration-300 ${a==="upload"?"bg-[#9956DE] text-white shadow-lg shadow-purple-200":"text-slate-400 hover:text-purple-600 hover:bg-purple-50"}`,children:[e.jsx(es,{size:14}),"Import"]}),e.jsxs("button",{onClick:()=>n("inventory"),className:`flex items-center gap-2 px-5 py-2 rounded-xl text-[12px] font-black transition-all duration-300 ${a==="inventory"?"bg-[#9956DE] text-white shadow-lg shadow-purple-200":"text-slate-400 hover:text-purple-600 hover:bg-purple-50"}`,children:[e.jsx(fe,{size:14}),"Inventory"]})]}),e.jsx("div",{className:"flex items-center gap-3"})]}),e.jsx(_t,{mode:"wait",children:a==="upload"?e.jsxs(re.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"space-y-4",children:[e.jsxs("div",{className:"bg-white rounded-[24px] border border-slate-200 shadow-sm overflow-hidden group",children:[e.jsxs("div",{className:"p-6 border-b border-slate-50 bg-gradient-to-br from-white to-purple-50/20 relative",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-black text-[#1e293b] tracking-tight",children:"Learning Module Upload"}),e.jsx("p",{className:"text-[11px] text-slate-500 font-medium italic",children:"Provide curriculum context for AI tutoring logic."})]}),e.jsx("div",{className:"w-10 h-10 bg-[#9956DE] rounded-xl flex items-center justify-center text-white shadow-md transition-transform group-hover:scale-110",children:e.jsx(es,{size:20})})]}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{onDrop:ne,onDragOver:B,onDragLeave:ce,onClick:()=>!i&&Ne.current?.click(),className:` relative border-2 border-dashed rounded-2xl p-6 text-center cursor-pointer transition-all duration-300 group/drop ${m?"border-[#9956DE] bg-purple-50 scale-[0.99]":"border-slate-200 hover:border-[#9956DE] bg-white hover:bg-purple-50/30"} ${i?"cursor-not-allowed opacity-60":""} min-h-[160px] flex flex-col items-center justify-center - `,children:[e.jsx("input",{ref:Ne,type:"file",accept:".pdf",className:"hidden",onChange:h=>h.target.files?.[0]&&K(h.target.files[0])}),f?e.jsxs("div",{className:"flex items-center gap-4 text-left",children:[e.jsx("div",{className:"w-14 h-14 bg-purple-50 rounded-xl flex items-center justify-center text-purple-600 border border-purple-100 shadow-sm shrink-0",children:e.jsx(Ce,{size:28})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{className:"font-black text-[14px] text-[#1e293b] truncate max-w-[300px]",children:f.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] text-purple-500 font-black uppercase",children:[(f.size/1024/1024).toFixed(2)," MB"]}),e.jsx("span",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest italic",children:"PDF Source"})]}),e.jsxs("button",{onClick:h=>{h.stopPropagation(),d(null)},className:"text-[10px] font-black text-rose-500 hover:text-rose-600 mt-1 flex items-center gap-1",children:[e.jsx(je,{size:10})," Replace"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-12 h-12 bg-slate-50 rounded-xl flex items-center justify-center text-slate-300 mb-4 group-hover/drop:text-purple-500 group-hover/drop:bg-purple-50 transition-all",children:e.jsx(es,{size:24})}),e.jsx("h4",{className:"text-[14px] font-black text-[#1e293b]",children:"Drop PDF or click to browse"}),e.jsx("p",{className:"text-[10px] text-slate-400 mt-1 font-medium italic",children:"Max 50MB (SLM, Textbook, Guide)"})]}),y>0&&e.jsx("div",{className:"absolute inset-0 bg-white/95 backdrop-blur-[1px] rounded-2xl flex flex-col items-center justify-center p-8 z-20",children:e.jsxs("div",{className:"w-full max-w-xs space-y-3 text-center",children:[e.jsx("div",{className:"w-12 h-12 bg-[#9956DE] rounded-xl flex items-center justify-center mx-auto mb-2 animate-bounce",children:e.jsx(Qs,{size:24,className:"text-white"})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("h5",{className:"text-sm font-black text-[#1e293b]",children:i?"Analyzing Curriculum...":"Complete!"}),e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Platform Ingestion"})]}),e.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden p-0.5 border border-slate-200 mt-2",children:e.jsx(re.div,{className:"h-full bg-gradient-to-r from-purple-500 to-sky-500 rounded-full",initial:{width:0},animate:{width:`${y}%`},transition:{duration:.3}})})]})})]})})]}),e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Curriculum Subject"}),e.jsxs(J,{value:c,onValueChange:x,disabled:i,children:[e.jsx(ee,{className:"w-full h-10 bg-slate-50/50 border-slate-200 rounded-xl text-[12px] font-bold focus:ring-purple-500/20",children:e.jsx(Ue,{placeholder:"Select subject"})}),e.jsx(se,{className:"rounded-xl border-slate-200",children:rs.map(h=>e.jsx(C,{value:h.id,className:"rounded-lg py-2",children:e.jsxs("div",{className:"flex flex-col items-start",children:[e.jsx("span",{className:"font-black text-[12px]",children:h.name}),e.jsxs("span",{className:"text-[9px] text-slate-400 font-bold uppercase",children:[h.gradeLevel," • ",h.semester]})]})},h.id))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Display Label"}),e.jsx(xe,{value:v,onChange:h=>N(h.target.value),placeholder:"e.g. General Mathematics",disabled:i,className:"h-10 bg-slate-50/50 border-slate-200 rounded-xl text-[12px] font-bold px-4 focus-visible:ring-purple-500/20"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Quarter"}),e.jsxs(J,{value:D,onValueChange:u,disabled:i,children:[e.jsx(ee,{className:"w-full h-10 bg-slate-50/50 border-slate-200 rounded-xl text-[12px] font-bold focus:ring-purple-500/20",children:e.jsx(Ue,{})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"1",className:"rounded-lg text-[12px] font-bold",children:"First Quarter"}),e.jsx(C,{value:"2",className:"rounded-lg text-[12px] font-bold",children:"Second Quarter"}),e.jsx(C,{value:"3",className:"rounded-lg text-[12px] font-bold",children:"Third Quarter"}),e.jsx(C,{value:"4",className:"rounded-lg text-[12px] font-bold",children:"Fourth Quarter"})]})]})]})]}),e.jsx(A,{onClick:ae,disabled:i||!f||!c||!v.trim(),className:"w-full h-12 gap-2 bg-[#9956DE] hover:bg-[#8b5cf6] text-white rounded-2xl shadow-lg shadow-purple-100 transition-all hover:scale-[1.01] active:scale-95 text-[14px] font-black",children:i?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:16,className:"animate-spin"})," Ingesting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{size:16})," Deploy Knowledge Source"]})})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{icon:Qs,color:"bg-purple-50",iconColor:"text-purple-600",title:"Grounding",desc:"Curriculum-pinned logic."},{icon:fe,color:"bg-sky-50",iconColor:"text-sky-600",title:"Indexing",desc:"Millisecond RAG retrieval."},{icon:it,color:"bg-emerald-50",iconColor:"text-emerald-600",title:"Extraction",desc:"Neural chunk parsing."}].map((h,P)=>e.jsxs("div",{className:"bg-white rounded-xl p-3 border border-slate-100 shadow-sm flex items-start gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg ${h.color} flex items-center justify-center shrink-0`,children:e.jsx(h.icon,{size:14,className:h.iconColor})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-[10px] font-black text-[#1e293b] uppercase tracking-wide leading-none",children:h.title}),e.jsx("p",{className:"text-[9px] text-slate-400 leading-tight mt-1 font-medium italic",children:h.desc})]})]},P))})]},"upload-tab"):e.jsx(re.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"space-y-4",children:e.jsx("div",{className:"bg-white rounded-[24px] border border-slate-200 shadow-sm overflow-hidden relative",children:e.jsxs(kt,{className:"w-full text-left border-collapse",children:[e.jsx(St,{children:e.jsxs(Ie,{className:"bg-[#9956DE] hover:bg-[#9956DE] border-b border-[#8b5cf6] sticky top-0 z-20 shadow-sm",children:[e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto",children:"File Name"}),e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto",children:"Uploaded By"}),e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto",children:"Type"}),e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto",children:"Date"}),e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto text-right",children:e.jsx(A,{variant:"ghost",size:"sm",className:"h-8 px-2 bg-white/10 text-white hover:bg-white/20 rounded-lg",onClick:L,disabled:Q,children:e.jsx(Me,{size:12,className:Q?"animate-spin":""})})})]})}),e.jsx(Ct,{className:"divide-y divide-slate-50",children:Q?e.jsx(Ie,{children:e.jsxs(ie,{colSpan:5,className:"h-48 text-center",children:[e.jsx(V,{size:24,className:"animate-spin text-purple-500 mx-auto"}),e.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mt-2",children:"Loading files..."})]})}):_.length===0?e.jsx(Ie,{children:e.jsxs(ie,{colSpan:5,className:"h-48 text-center",children:[e.jsx(Ce,{size:24,className:"text-slate-200 mx-auto"}),e.jsx("p",{className:"text-[12px] font-black text-slate-400 mt-2",children:"No uploaded files found."})]})}):_.map(h=>e.jsxs(Ie,{className:"group hover:bg-purple-50/10 transition-all",children:[e.jsx(ie,{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ce,{size:16,className:"text-purple-500"}),e.jsx("span",{className:"font-bold text-[13px] text-slate-800 truncate max-w-[200px]",children:h.fileName})]})}),e.jsx(ie,{className:"px-6 py-4 text-[12px] text-slate-600",children:h.teacherEmail||"—"}),e.jsx(ie,{className:"px-6 py-4",children:e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[9px] font-black uppercase bg-slate-100 text-slate-600",children:h.fileType})}),e.jsx(ie,{className:"px-6 py-4 text-[12px] text-slate-500",children:h.createdAt.toLocaleDateString()}),e.jsx(ie,{className:"px-6 py-4 text-right",children:e.jsx(A,{variant:"ghost",size:"sm",className:"h-7 px-2 text-slate-400 hover:text-red-500 hover:bg-red-50",onClick:()=>te(h.id,h.collection),children:e.jsx(je,{size:14})})})]},h.id))})]})})},"inventory-tab")})]})};function At(s){return s?s.charAt(0).toUpperCase()+s.slice(1):"Student"}function Ds(s){if(!s||!s.toDate)return new Date().toISOString().replace("T"," ").slice(0,19);const a=s.toDate();return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")} ${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function Oa(){return Ds({toDate:()=>new Date})}function Ba(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const i=Date.now()-a.getTime(),r=Math.floor(i/6e4);if(r<1)return"Just now";if(r<60)return`${r} minute${r!==1?"s":""} ago`;const o=Math.floor(r/60);if(o<24)return`${o} hour${o!==1?"s":""} ago`;const g=Math.floor(o/24);return g<7?`${g} day${g!==1?"s":""} ago`:a.toLocaleDateString()}function Ga(s){const a=(s.grade||"").trim(),n=(s.section||"").trim(),i=[a,n].filter(Boolean).join(" - ");return{id:s.uid,name:s.name||"Unknown",email:s.email||"",role:At(s.role||""),status:s.status||"Active",department:s.department||(s.role?.toLowerCase()==="student"?i||"Student":""),grade:a,section:n,classSectionId:s.classSectionId||void 0,classSection:i,lrn:(s.lrn||"").trim(),gender:s.gender||null,photo:(s.photo||"").trim(),lastLogin:Ba(s.lastLogin),createdAt:s.createdAt||void 0}}function os(s){if(s instanceof ot){try{const a=JSON.parse(s.responseBody);if(a?.detail&&typeof a.detail=="string")return a.detail}catch{}return`Request failed (${s.status}).`}return s instanceof Error?s.message:"Request failed."}async function qa(s={}){try{const a=await Se.getAdminUsers({page:s.page??1,pageSize:s.pageSize??25,search:s.searchQuery,role:s.roleFilter,status:s.statusFilter,grade:s.gradeFilter,section:s.sectionFilter,classSectionId:s.classSectionId});if(!a.success)throw new Error("Failed to load admin users");return{users:(a.users||[]).map(Ga),page:a.page,pageSize:a.pageSize,total:a.total,totalPages:a.totalPages,hasNextPage:a.hasNextPage}}catch(a){throw console.error("[adminService] getAdminUsersPage error:",a),a instanceof Bt?new Error("Loading users timed out. Please refresh and try again."):a instanceof Gt?new Error("Unable to reach the server. Please check your connection and retry."):a instanceof ot&&a.status===504?new Error("Loading users took too long. Try narrowing your filters and retrying."):new Error(os(a))}}async function Ha(s,a){try{await Se.updateAdminUser(s,{...a.name!==void 0?{name:a.name}:{},...a.role!==void 0?{role:a.role}:{},...a.status!==void 0?{status:a.status}:{},...a.department!==void 0?{department:a.department}:{},...a.grade!==void 0?{grade:a.grade}:{},...a.section!==void 0?{section:a.section}:{},...a.lrn!==void 0?{lrn:a.lrn}:{}})}catch(n){throw new Error(os(n))}}async function Wa(s){try{const a=await Se.createAdminUser({name:s.name.trim(),email:s.email.trim().toLowerCase(),password:s.password,confirmPassword:s.confirmPassword,role:s.role,status:s.status,grade:s.grade.trim(),section:s.section.trim(),...s.lrn?.trim()?{lrn:s.lrn.trim()}:{}});if(!a.success||!a.userCreated||!a.uid)throw new Error(a.message||"Failed to create user account.");return{uid:a.uid,userCreated:a.userCreated,emailSent:a.emailSent,resultCode:a.resultCode,message:a.message,warnings:a.warnings??[],emailError:a.emailError}}catch(a){throw new Error(os(a))}}async function Va(s){try{const a=await Se.bulkAdminUsers({action:s.action,userIds:s.userIds??[],excludeUserIds:s.excludeUserIds??[],filters:s.filters,role:s.role,status:s.status,grade:s.grade,section:s.section,lrn:s.lrn,dryRun:s.dryRun,exportFormat:s.exportFormat??"csv"});return{success:a.success,action:a.action,summary:a.summary,results:a.results,warnings:a.warnings||[],exportRows:a.export?.rows||[]}}catch(a){throw new Error(os(a))}}async function Et(){try{if(!Ot.currentUser)return[];const s=ve(I(M,"accessAuditLogs"),We("timestamp","desc"),ns(100)),n=(await F(s)).docs.map(g=>{const m=g.data(),f=m.success!==!1?"Info":"Error",d=m.action||"";let c="System";return m.module==="admin"||d.startsWith("admin_")?c="User":d.includes("login")||d.includes("auth")?c="Auth":(d.includes("upload")||d.includes("course"))&&(c="Content"),{id:g.id,severity:f,timestamp:typeof m.timestamp=="string"?m.timestamp:Ds(m.timestamp),user:{name:(()=>{const v=m.actorName||m.actorEmail||m.teacherEmail||m.teacherId||"SYSTEM";return v==="Unknown"||!v?"SYSTEM":v.includes("@")?v.split("@")[0].replace(/[._-]/g," ").replace(/\b\w/g,D=>D.toUpperCase()):v})(),role:At(m.actorRole||m.role||"System"),avatar:null},action:d,category:c,details:m.description||(m.status?`Status: ${m.status}`:"")}}),i=ve(I(M,"auditLogs"),We("timestampRaw","desc"),ns(50)),o=(await F(i)).docs.map(g=>{const m=g.data(),w=m.user;return{id:`audit-${g.id}`,severity:m.severity||"Info",timestamp:m.timestamp||Ds(m.timestampRaw),user:{name:w?.name||"SYSTEM",role:w?.role||"System",avatar:w?.avatar??null},action:m.action||"",category:m.category||"System",details:m.details||""}});return[...n,...o].sort((g,m)=>m.timestamp.localeCompare(g.timestamp)).slice(0,100)}catch(s){const a=s;return a?.code==="permission-denied"||a?.code==="firestore/permission-denied"?[]:(console.error("[adminService] getAuditLogs error:",s),[])}}async function ys(s,a,n,i,r){await sa(I(M,"auditLogs"),{severity:n,timestamp:Oa(),timestampRaw:ta(),user:r,action:s,category:a,details:i})}async function Xa(){try{const s=await F(I(M,"users"));let a=0,n=0,i=0;const r=new Set;s.docs.forEach(w=>{const f=w.data();f.role==="student"&&(a++,f.overallRisk==="High"&&(i++,r.add(w.id))),f.role==="teacher"&&f.status!=="Inactive"&&n++});try{(await F(I(M,"managedStudents"))).docs.forEach(f=>{const c=f.data().riskStatus;c&&["intervene","critical","at_risk"].includes(c)&&(r.has(f.id)||(i++,r.add(f.id)))})}catch{}let o=0;try{o=(await F(I(M,"classrooms"))).size}catch{}let g=0;try{g=(await F(I(M,"xpActivities"))).size}catch{}let m=0;try{const w=await F(I(M,"progress")),f=[];w.docs.forEach(d=>{const c=d.data();typeof c.averageScore=="number"&&f.push(c.averageScore)}),m=f.length>0?Math.round(f.reduce((d,c)=>d+c,0)/f.length):0}catch{}return{totalStudents:a,activeTeachers:n,totalClasses:o,atRiskStudents:i,avgPerformance:m,aiPredictions:g}}catch(s){return console.error("[adminService] getDashboardStats error:",s),{totalStudents:0,activeTeachers:0,totalClasses:0,atRiskStudents:0,avgPerformance:0,aiPredictions:0}}}async function Qa(s=3){const a=i=>{const r=i.data(),o=r.level||1,g=r.currentXP||0,m=Math.min(100,o*8+Math.round(g/100));return{id:i.id,name:r.name||"Student",avatar:r.photo||r.photoURL||Cs(r.gender||null),class:r.grade||"Math",performance:m,level:o}},n=i=>i.sort((r,o)=>o.level!==r.level?o.level-r.level:o.performance-r.performance).slice(0,s);try{const i=ve(I(M,"users"),Ve("role","==","student"),We("level","desc"),ns(s)),r=await F(i);return n(r.docs.map(a))}catch(i){if(i?.code==="failed-precondition")try{const o=ve(I(M,"users"),Ve("role","==","student"),ns(Math.max(50,s))),g=await F(o);return n(g.docs.map(a))}catch(o){return console.error("[adminService] getTopPerformers fallback error:",o),[]}return console.error("[adminService] getTopPerformers error:",i),[]}}async function Ka(){try{const s=new Date,a=["S","M","T","W","T","F","S"],n=[];for(let r=6;r>=0;r--){const o=new Date(s);o.setDate(o.getDate()-r),n.push({name:a[o.getDay()],ai:0,man:0})}return(await F(I(M,"xpActivities"))).docs.forEach(r=>{const o=r.data(),g=o.timestamp;if(!g?.toDate)return;const m=g.toDate(),w=Math.floor((s.getTime()-m.getTime())/864e5);if(w<0||w>6)return;const f=6-w,d=o.type;d==="lesson_complete"||d==="quiz_complete"?n[f].ai++:n[f].man++}),n}catch(s){return console.error("[adminService] getWeeklyActivity error:",s),[{name:"M",ai:0,man:0},{name:"T",ai:0,man:0},{name:"W",ai:0,man:0},{name:"T",ai:0,man:0},{name:"F",ai:0,man:0},{name:"S",ai:0,man:0},{name:"S",ai:0,man:0}]}}async function Ya(){try{const s=await F(I(M,"progress")),a={"gen-math":{enrolled:0,totalProgress:0},"stats-prob":{enrolled:0,totalProgress:0}};return s.docs.forEach(n=>{const r=n.data().subjects;r&&Object.entries(r).forEach(([o,g])=>{a[o]&&(a[o].enrolled++,a[o].totalProgress+=g?.progress??0)})}),[{name:"General Mathematics",type:"Core",count:a["gen-math"].enrolled,progress:a["gen-math"].enrolled>0?Math.round(a["gen-math"].totalProgress/a["gen-math"].enrolled):0},{name:"Statistics & Probability",type:"Core",count:a["stats-prob"].enrolled,progress:a["stats-prob"].enrolled>0?Math.round(a["stats-prob"].totalProgress/a["stats-prob"].enrolled):0}]}catch(s){return console.error("[adminService] getSubjectBreakdown error:",s),[]}}async function Za(){try{const s=new Set;let a=0;(await F(ve(I(M,"users"),Ve("role","==","student")))).docs.forEach(i=>{i.data().overallRisk==="High"&&(a++,s.add(i.id))});try{(await F(I(M,"managedStudents"))).docs.forEach(r=>{const g=r.data().riskStatus;g&&["intervene","critical","at_risk"].includes(g)&&!s.has(r.id)&&(a++,s.add(r.id))})}catch{}return{subjectName:"General Mathematics",atRiskCount:a}}catch(s){return console.error("[adminService] getPriorityAttention error:",s),{subjectName:"General Mathematics",atRiskCount:0}}}async function Ja(){try{const s=await F(I(M,"progress"));let a=0,n=0,i=0,r=0;return s.docs.forEach(o=>{const m=o.data().averageScore;typeof m=="number"?(a+=m,r++,m>=60?n++:i++):i++}),{avgMastery:r>0?Math.round(a/r):0,passed:n,pending:i}}catch(s){return console.error("[adminService] getGlobalMastery error:",s),{avgMastery:0,passed:0,pending:0}}}async function el(){try{const s=await F(I(M,"progress"));let a=0,n=0,i=0;s.docs.forEach(o=>{const m=o.data().averageScore;if(typeof m!="number"){a++;return}m<50?a++:m<80?n++:i++});const r=a+n+i||1;return{foundational:Math.round(a/r*100),intermediate:Math.round(n/r*100),advanced:Math.round(i/r*100)}}catch(s){return console.error("[adminService] getDifficultyDistribution error:",s),{foundational:0,intermediate:0,advanced:0}}}async function sl(){try{const s=await F(I(M,"users"));let a=0,n=0,i=0,r=0,o=0;const g=new Set;s.docs.forEach(f=>{const d=f.data();d.role==="student"&&(a++,d.overallRisk==="High"&&(i++,g.add(f.id)),d.streak>0&&o++,r+=d.totalXP||0),d.role==="teacher"&&n++});try{(await F(I(M,"managedStudents"))).docs.forEach(d=>{const p=d.data().riskStatus;p&&["intervene","critical","at_risk"].includes(p)&&!g.has(d.id)&&(i++,g.add(d.id))})}catch{}let m=0;try{m=(await F(I(M,"achievements"))).size}catch{}let w=0;try{w=(await F(I(M,"chatSessions"))).size}catch{}return{totalActiveUsers:a+n,totalStudents:a,totalTeachers:n,atRiskStudents:i,achievementsUnlocked:m,totalXPEarned:r,activeStreaks:o,aiTutorSessions:w}}catch(s){return console.error("[adminService] getAnalyticsSummary error:",s),{totalActiveUsers:0,totalStudents:0,totalTeachers:0,atRiskStudents:0,achievementsUnlocked:0,totalXPEarned:0,activeStreaks:0,aiTutorSessions:0}}}const tl=[10,25,50,100],ts=({title:s,value:a,subtitle:n,icon:i,variant:r})=>{const o={blue:"bg-[#5154E7] shadow-blue-200/50",purple:"bg-[#9956DE] shadow-purple-200/50",rose:"bg-[#F43F5E] shadow-rose-200/50",emerald:"bg-[#10B981] shadow-emerald-200/50"};return e.jsxs("div",{className:`relative overflow-hidden rounded-[24px] p-5 text-white shadow-lg transition-all hover:scale-[1.02] ${o[r]}`,children:[e.jsx("div",{className:"absolute -right-4 -top-4 opacity-10",children:e.jsx(i,{size:100})}),e.jsx("div",{className:"absolute right-4 top-4 w-8 h-8 rounded-full bg-white/20 flex items-center justify-center",children:e.jsx(i,{size:16})}),e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] opacity-80",children:s}),e.jsx("h3",{className:"text-2xl font-black mt-2 leading-none",children:a}),e.jsx("p",{className:"text-[10px] font-bold mt-4 opacity-70 uppercase tracking-widest",children:n}),e.jsx("div",{className:"absolute -bottom-8 -left-8 w-20 h-20 bg-white/10 rounded-full blur-2xl"})]})},al=()=>{const{userProfile:s,loading:a}=cs(),[n,i]=l.useState([]),[r,o]=l.useState(!0),[g,m]=l.useState(!1),[w,f]=l.useState(""),[d,c]=l.useState("All Categories"),[p,v]=l.useState("All Severities"),[N,D]=l.useState("All Roles"),[u,y]=l.useState(null),[z,T]=l.useState(1),[q,me]=l.useState(25),he=l.useCallback(async()=>{if(a||!s)return;const x=String(s.role||"").toLowerCase();if(x!=="admin"&&x!=="teacher"){o(!1),m(!0);return}m(!1),o(!0);try{const ae=await Et();i(ae)}catch{S.error("Failed to load audit logs")}finally{o(!1)}},[a,s]);l.useEffect(()=>{he()},[he]);const Ne=n.filter(x=>x.severity==="Info").length;n.filter(x=>x.severity==="Warning").length;const _=n.filter(x=>x.severity==="Error"||x.severity==="Critical").length,pe=x=>{switch(x){case"Info":return e.jsx(wt,{size:14});case"Warning":return e.jsx(xt,{size:14});case"Error":return e.jsx(Ks,{size:14});case"Critical":return e.jsx(Re,{size:14});default:return e.jsx(_e,{size:14})}},Q=x=>{switch(x){case"Info":return"bg-sky-50 text-sky-600 border-sky-100";case"Warning":return"bg-amber-50 text-amber-600 border-amber-100";case"Error":return"bg-rose-50 text-rose-600 border-rose-100";case"Critical":return"bg-red-50 text-red-600 border-red-100 ring-1 ring-red-500";default:return"bg-slate-50 text-slate-600 border-slate-100"}},X={"All Categories":"All Categories",Auth:"Authentication",Data:"Data Operations",User:"User Management",System:"System Engine",Content:"Content Pipeline"},L={"All Severities":"All Severities",Info:"Information",Warning:"Warning",Error:"Error",Critical:"Critical"},te={"All Roles":"All Roles",Admin:"Administrator",Teacher:"Educator",Student:"Student"},O=l.useMemo(()=>n.filter(x=>{const ae=x.action.toLowerCase().includes(w.toLowerCase())||x.details.toLowerCase().includes(w.toLowerCase())||x.user.name.toLowerCase().includes(w.toLowerCase()),h=d==="All Categories"||x.category===d,P=p==="All Severities"||x.severity===p,H=N==="All Roles"||x.user.role===N;return ae&&h&&P&&H}),[n,w,d,p,N]),K=Math.max(Math.ceil(O.length/q),1),ne=l.useMemo(()=>{const x=(z-1)*q;return O.slice(x,x+q)},[O,z,q]);if(l.useEffect(()=>{T(1)},[w,d,p,N]),g)return e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-center p-8 bg-white rounded-[32px] border border-slate-200 mt-8",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-rose-50 flex items-center justify-center mb-6",children:e.jsx(dt,{size:40,className:"text-rose-500"})}),e.jsx("h3",{className:"text-2xl font-black text-[#1e293b]",children:"Access Denied"}),e.jsx("p",{className:"text-slate-400 font-medium max-w-md mx-auto mt-2 uppercase text-[11px] tracking-widest",children:"Security policy restricts audit log visibility to administrative personnel only."})]});const B=O.length===0?0:(z-1)*q+1,ce=Math.min(z*q,O.length);return e.jsxs("div",{className:"flex flex-col min-h-full animate-in fade-in duration-500",children:[e.jsxs("div",{className:"flex-1 space-y-8 pt-6 xl:pt-8 pb-6 px-1 max-w-[1600px] mx-auto w-full",children:[e.jsxs("div",{className:"flex items-center justify-between px-2 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-1.5 h-6 bg-[#9956DE] rounded-full"}),e.jsx("p",{className:"text-[11px] font-black text-slate-400 uppercase tracking-[0.2em]",children:"System Governance Pipeline"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:he,disabled:r,className:"p-2.5 rounded-xl bg-white border border-slate-200 text-slate-400 hover:text-purple-600 shadow-sm transition-all active:scale-95 group",title:"Synchronize logs",children:e.jsx(Me,{size:14,className:r?"animate-spin":"group-hover:rotate-180 transition-transform duration-500"})}),e.jsxs("button",{disabled:!0,className:"flex items-center gap-2 px-4 py-2 bg-white border border-slate-200 text-slate-400 rounded-xl text-[10px] font-black uppercase tracking-widest opacity-60 cursor-not-allowed",children:[e.jsx(Ps,{size:14})," Export Logs"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 shrink-0",children:[e.jsx(ts,{title:"Total Events",value:r?"...":n.length,subtitle:"System-Wide Logs",icon:Ce,variant:"purple"}),e.jsx(ts,{title:"Security Alerts",value:r?"...":_,subtitle:"Critical Incidents",icon:Ks,variant:"rose"}),e.jsx(ts,{title:"Operational Info",value:r?"...":Ne,subtitle:"Routine Pipelines",icon:qe,variant:"blue"}),e.jsx(ts,{title:"System Health",value:_>0?"Compromised":"Healthy",subtitle:"Live Monitoring",icon:zs,variant:_>0?"rose":"emerald"})]})]}),e.jsx("div",{className:"sticky top-0 z-40 -mx-[24px] xl:-mx-[32px] px-[24px] xl:px-[32px] pt-4 pb-4 bg-[#f8fafc] backdrop-blur-sm",children:e.jsxs("div",{className:"flex flex-col xl:flex-row items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 w-full group",children:[e.jsx(bt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-[#9956DE] transition-colors",size:16}),e.jsx(xe,{type:"text",placeholder:"Trace user identity, action strings, or operation details...",className:"pl-11 h-12 bg-white border-slate-200/60 rounded-2xl focus-visible:ring-[#9956DE]/20 focus-visible:border-[#9956DE] transition-all text-sm font-medium shadow-md shadow-slate-200/40",value:w,onChange:x=>f(x.target.value)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 w-full xl:w-auto",children:[e.jsxs(J,{value:d,onValueChange:c,children:[e.jsx(ee,{className:"w-[200px] bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 rounded-xl h-12 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:X[d]||d})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Categories",className:"font-bold",children:"All Categories"}),e.jsx(C,{value:"Auth",className:"font-bold",children:"Authentication"}),e.jsx(C,{value:"Data",className:"font-bold",children:"Data Operations"}),e.jsx(C,{value:"User",className:"font-bold",children:"User Management"}),e.jsx(C,{value:"System",className:"font-bold",children:"System Engine"}),e.jsx(C,{value:"Content",className:"font-bold",children:"Content Pipeline"})]})]}),e.jsxs(J,{value:p,onValueChange:v,children:[e.jsx(ee,{className:"w-[200px] bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 rounded-xl h-12 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:L[p]||p})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Severities",className:"font-bold",children:"All Severities"}),e.jsx(C,{value:"Info",className:"font-bold",children:"Information"}),e.jsx(C,{value:"Warning",className:"font-bold",children:"Warning"}),e.jsx(C,{value:"Error",className:"font-bold",children:"Error"}),e.jsx(C,{value:"Critical",className:"font-bold",children:"Critical"})]})]}),e.jsxs(J,{value:N,onValueChange:D,children:[e.jsx(ee,{className:"w-[200px] bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 rounded-xl h-12 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:te[N]||N})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Roles",className:"font-bold",children:"All Roles"}),e.jsx(C,{value:"Admin",className:"font-bold",children:"Administrator"}),e.jsx(C,{value:"Teacher",className:"font-bold",children:"Educator"}),e.jsx(C,{value:"Student",className:"font-bold",children:"Student"})]})]}),e.jsx(A,{variant:"outline",size:"icon",onClick:()=>{f(""),c("All Categories"),v("All Severities"),D("All Roles")},disabled:!w&&d==="All Categories"&&p==="All Severities"&&N==="All Roles",className:"h-12 w-12 rounded-2xl border-slate-200/60 text-[#9956DE] hover:bg-purple-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all shadow-sm",title:"Reset Filters",children:e.jsx(yt,{size:18})})]})]})}),e.jsx("div",{className:"bg-white rounded-[32px] border border-slate-200/60 shadow-sm shadow-slate-200/40 relative",children:e.jsx("div",{className:"rounded-[32px]",children:e.jsxs("table",{className:"w-full text-left border-collapse min-w-[1000px]",children:[e.jsx("thead",{className:"sticky top-[80px] z-30 bg-[#f8fafc] backdrop-blur-sm shadow-[0_-12px_0_0_#f8fafc]",children:e.jsxs("tr",{className:"border-b border-[#8b5cf6]",children:[e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest whitespace-nowrap rounded-tl-[20px]",children:"Incident Level"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest whitespace-nowrap",children:"Timestamp"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"User Actor"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Action Performed"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Component"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest text-right whitespace-nowrap rounded-tr-[20px]",children:"Review"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:r?Array(10).fill(0).map((x,ae)=>e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"h-20 p-8",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-slate-50 animate-pulse"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"w-32 h-3 bg-slate-50 animate-pulse rounded"}),e.jsx("div",{className:"w-48 h-2 bg-slate-50 animate-pulse rounded"})]})]})})},ae)):ne.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"h-64 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx(As,{size:48,className:"text-slate-100 mb-4"}),e.jsx("p",{className:"text-[16px] font-black text-[#1e293b]",children:"No audit trails captured"}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Try adjusting your tracking filters"})]})})}):ne.map(x=>e.jsxs("tr",{className:"group hover:bg-purple-50/20 transition-colors",children:[e.jsx("td",{className:"px-8 py-5",children:e.jsxs("span",{className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-[9px] font-black uppercase tracking-wider border ${Q(x.severity)}`,children:[pe(x.severity),x.severity]})}),e.jsx("td",{className:"px-8 py-5",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-50 flex items-center justify-center text-slate-400",children:e.jsx(Rs,{size:14})}),e.jsx("span",{className:"text-[13px] font-bold text-[#1e293b]",children:x.timestamp})]})}),e.jsx("td",{className:"px-8 py-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-full bg-slate-50 border border-slate-100 flex items-center justify-center overflow-hidden shrink-0",children:x.user.avatar?e.jsx("img",{src:x.user.avatar,alt:x.user.name,className:"w-full h-full object-cover"}):e.jsx(As,{size:16,className:"text-slate-300"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-black text-[#1e293b] leading-none group-hover:text-[#9956DE] transition-colors truncate",children:x.user.name||"SYSTEM"}),e.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-tighter mt-1",children:x.user.role||"System"})]})]})}),e.jsxs("td",{className:"px-8 py-5",children:[e.jsx("p",{className:"text-sm font-bold text-[#1e293b] truncate max-w-[250px]",title:x.details,children:x.action}),e.jsx("p",{className:"text-[10px] text-slate-400 font-medium truncate max-w-[250px] mt-0.5",children:x.details})]}),e.jsx("td",{className:"px-8 py-5",children:e.jsx("span",{className:"text-[10px] font-black px-2.5 py-1 rounded-lg bg-slate-50 text-slate-600 border border-slate-100 uppercase tracking-widest",children:x.category})}),e.jsx("td",{className:"px-8 py-5 text-right",children:e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:()=>y(x),className:"w-9 h-9 rounded-xl border border-slate-200 flex items-center justify-center text-slate-400 hover:text-[#9956DE] hover:border-[#9956DE]/30 hover:bg-purple-50 transition-all ",children:e.jsx(ft,{size:16})})})})]},x.id))})]})})}),e.jsxs("div",{className:"sticky bottom-0 z-50 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 px-12 py-3 bg-white border-t-2 border-slate-100 shadow-[0_-8px_30px_rgba(0,0,0,0.08)] -mx-[24px] xl:-mx-[32px] w-[calc(100%+48px)] xl:w-[calc(100%+64px)]",children:[e.jsxs("p",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-4",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-[#9956DE] animate-pulse shadow-[0_0_12px_rgba(153,86,222,0.6)]"}),"Showing ",e.jsxs("span",{className:"text-slate-900 font-black border-b-2 border-[#9956DE]/40 pb-0.5",children:[B,"–",ce]}),e.jsx("span",{className:"text-slate-300 font-bold mx-1",children:"/"}),e.jsx("span",{className:"text-slate-900 font-black border-b-2 border-[#9956DE]/40 pb-0.5",children:O.length}),e.jsx("span",{className:"text-slate-400 ml-1",children:"Total System Records"})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs(J,{value:String(q),onValueChange:x=>{me(Number(x)),T(1)},children:[e.jsx(ee,{className:"h-10 w-[140px] bg-white border border-slate-300 text-[11px] font-black uppercase tracking-wider text-slate-900 rounded-xl hover:border-[#9956DE] transition-all px-4 shadow-sm",children:e.jsxs("span",{className:"truncate",children:[q," / Page"]})}),e.jsx(se,{className:"rounded-xl border-slate-200",children:tl.map(x=>e.jsxs(C,{value:String(x),className:"font-bold",children:[x," / Page"]},x))})]}),e.jsxs("div",{className:"flex items-center gap-2 bg-slate-50 p-1.5 rounded-2xl border border-slate-200 shadow-inner",children:[e.jsx(A,{variant:"outline",size:"sm",className:"h-9 w-9 p-0 rounded-xl bg-[#9956DE] border-none text-white hover:bg-[#8b5cf6] hover:scale-105 active:scale-95 disabled:opacity-30 transition-all shadow-lg shadow-purple-200/60",disabled:z<=1||r,onClick:()=>T(x=>Math.max(x-1,1)),children:e.jsx(jt,{size:18,strokeWidth:3})}),e.jsx("div",{className:"px-5 py-2 bg-white rounded-xl shadow-sm border border-slate-200 flex items-center justify-center min-w-[130px]",children:e.jsxs("span",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:["Page ",e.jsx("span",{className:"text-[#9956DE] mx-1",children:z}),e.jsx("span",{className:"text-slate-300 mx-1",children:"OF"}),e.jsx("span",{className:"text-slate-500",children:Math.max(K,1)})]})}),e.jsx(A,{variant:"outline",size:"sm",className:"h-9 w-9 p-0 rounded-xl bg-[#9956DE] border-none text-white hover:bg-[#8b5cf6] hover:scale-105 active:scale-95 disabled:opacity-30 transition-all shadow-lg shadow-purple-200/60",disabled:z>=K||r,onClick:()=>T(x=>Math.min(x+1,K||1)),children:e.jsx(vt,{size:18,strokeWidth:3})})]})]})]}),e.jsx(ht,{open:!!u,onOpenChange:x=>{x||y(null)},children:e.jsxs(pt,{className:"sm:max-w-[600px] rounded-[32px] border-none shadow-2xl p-0 overflow-hidden",children:[e.jsx("div",{className:`h-2 w-full ${u?Q(u.severity).split(" ")[0].replace("bg-","bg-").replace("-50","-500"):"bg-purple-600"}`}),e.jsxs("div",{className:"p-8 space-y-6",children:[e.jsx(ut,{className:"text-left",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-slate-50 flex items-center justify-center text-[#9956DE] border border-slate-100",children:e.jsx(zs,{size:24})}),e.jsxs("div",{children:[e.jsx(gt,{className:"text-xl font-black text-[#1e293b] leading-tight",children:u?.action||"Audit Event Details"}),e.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] mt-1",children:"Platform Operational Integrity Trail"})]})]})}),u&&e.jsxs("div",{className:"grid grid-cols-2 gap-6 bg-slate-50/50 p-6 rounded-2xl border border-slate-100",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Incident Severity"}),e.jsx("p",{className:"text-sm font-black text-[#1e293b]",children:u.severity})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Timestamp"}),e.jsx("p",{className:"text-sm font-black text-[#1e293b]",children:u.timestamp})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Component"}),e.jsx("p",{className:"text-sm font-black text-[#1e293b]",children:u.category})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"User Actor"}),e.jsx("p",{className:"text-sm font-black text-[#1e293b]",children:u?.user.name})]}),e.jsxs("div",{className:"col-span-2 space-y-1 mt-2",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Full Operation Details"}),e.jsx("p",{className:"text-sm font-medium text-[#1e293b] leading-relaxed bg-white p-4 rounded-xl border border-slate-100",children:u.details})]})]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx(A,{onClick:()=>y(null),className:"bg-[#9956DE] hover:bg-[#8b5cf6] text-white rounded-xl px-8 font-black uppercase text-[11px] tracking-widest shadow-lg shadow-purple-100 transition-all",children:"Dismiss Review"})})]})]})})]})},ll=()=>{const[s,a]=l.useState([]),[n,i]=l.useState(0),[r,o]=l.useState(!0),[g,m]=l.useState(null),[w,f]=l.useState(!1),d=l.useCallback(async()=>{o(!0);try{const u=await De("/api/rag/documents");a(u.documents),i(u.total_chunks)}catch(u){console.error("Failed to fetch RAG documents:",u),S.error("Failed to load RAG inventory")}finally{o(!1)}},[]);l.useEffect(()=>{d()},[d]);const c=Ss.useMemo(()=>{const u=new Map;for(const y of s){const z=u.get(y.subject)||[];z.push(y),u.set(y.subject,z)}return Array.from(u.entries()).map(([y,z])=>({subject:y,files:z,totalChunks:z.reduce((T,q)=>T+q.chunk_count,0)}))},[s]),p=async u=>{m(`subject:${u}`);try{const y=await De(`/api/rag/documents/by-subject/${encodeURIComponent(u)}`,{method:"DELETE"});S.success(y.message),await d()}catch(y){S.error(`Failed to delete subject: ${y}`)}finally{m(null)}},v=async u=>{m(`source:${u}`);try{const y=await De(`/api/rag/documents/by-source?source_file=${encodeURIComponent(u)}`,{method:"DELETE"});S.success(y.message),await d()}catch(y){S.error(`Failed to delete source: ${y}`)}finally{m(null)}},N=async()=>{m("purge");try{const u=await De("/api/rag/documents/all",{method:"DELETE"});S.success(u.message),f(!1),await d()}catch(u){S.error(`Purge failed: ${u}`)}finally{m(null)}},D=async()=>{m("reingest");try{await De("/api/admin/reingest-pdf",{method:"POST",body:JSON.stringify({})}),S.success("Re-ingestion triggered. This may take a few minutes."),setTimeout(d,5e3)}catch(u){S.error(`Re-ingestion failed: ${u}`)}finally{m(null)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-100 flex items-center justify-center",children:e.jsx(fe,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-slate-800",children:"RAG Pipeline Manager"}),e.jsx("p",{className:"text-sm text-slate-500",children:"Manage vectorstore content and uploaded files"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"px-4 py-2 bg-indigo-50 rounded-xl text-center",children:[e.jsx("p",{className:"text-xl font-bold text-indigo-600",children:n}),e.jsx("p",{className:"text-[10px] font-bold text-indigo-400 uppercase",children:"Total Chunks"})]}),e.jsxs("div",{className:"px-4 py-2 bg-emerald-50 rounded-xl text-center",children:[e.jsx("p",{className:"text-xl font-bold text-emerald-600",children:c.length}),e.jsx("p",{className:"text-[10px] font-bold text-emerald-400 uppercase",children:"Subjects"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-4 bg-slate-50 rounded-2xl border border-slate-200",children:[e.jsxs(A,{onClick:d,disabled:r,variant:"outline",className:"gap-2",children:[e.jsx(Me,{size:14,className:r?"animate-spin":""}),"Refresh"]}),e.jsxs(A,{onClick:D,disabled:!!g,variant:"outline",className:"gap-2",children:[g==="reingest"?e.jsx(V,{size:14,className:"animate-spin"}):e.jsx(Me,{size:14}),"Re-ingest All PDFs"]}),e.jsx("div",{className:"flex-1"}),w?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-red-600 font-medium flex items-center gap-1",children:[e.jsx(xt,{size:14})," This will delete ALL RAG content"]}),e.jsxs(A,{onClick:N,disabled:g==="purge",className:"bg-red-600 hover:bg-red-700 text-white gap-2",children:[g==="purge"?e.jsx(V,{size:14,className:"animate-spin"}):e.jsx(je,{size:14}),"Confirm Purge"]}),e.jsx(A,{onClick:()=>f(!1),variant:"outline",children:"Cancel"})]}):e.jsxs(A,{onClick:()=>f(!0),variant:"outline",className:"gap-2 text-red-600 border-red-200 hover:bg-red-50",children:[e.jsx(je,{size:14}),"Purge All"]})]}),r?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(V,{size:32,className:"animate-spin text-indigo-500"})}):c.length===0?e.jsxs("div",{className:"text-center py-16 text-slate-500",children:[e.jsx(fe,{size:48,className:"mx-auto mb-3 text-slate-300"}),e.jsx("p",{className:"font-medium",children:"No RAG content found"}),e.jsx("p",{className:"text-sm",children:"Upload PDFs via the Content tab or trigger re-ingestion"})]}):e.jsx("div",{className:"space-y-4",children:c.map(u=>e.jsxs(re.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-white rounded-2xl border border-slate-200 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 bg-slate-50 border-b border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-100 flex items-center justify-center",children:e.jsx(Ce,{size:16,className:"text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-800 capitalize",children:u.subject.replace(/_/g," ")}),e.jsxs("p",{className:"text-xs text-slate-500",children:[u.totalChunks," chunks • ",u.files.length," source file",u.files.length!==1?"s":""]})]})]}),e.jsxs(A,{onClick:()=>p(u.subject),disabled:!!g,variant:"outline",className:"gap-2 text-red-600 border-red-200 hover:bg-red-50 text-xs h-8",children:[g===`subject:${u.subject}`?e.jsx(V,{size:12,className:"animate-spin"}):e.jsx(je,{size:12}),"Remove Subject"]})]}),e.jsx("div",{className:"divide-y divide-slate-100",children:u.files.map(y=>e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 hover:bg-slate-50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ce,{size:14,className:"text-slate-400"}),e.jsx("span",{className:"text-sm text-slate-700 font-medium truncate max-w-[400px]",children:y.source_file}),e.jsxs("span",{className:"text-xs text-slate-400 bg-slate-100 px-2 py-0.5 rounded-full",children:[y.chunk_count," chunks"]})]}),e.jsx("button",{onClick:()=>v(y.source_file),disabled:!!g,className:"p-1.5 rounded-lg text-slate-400 hover:text-red-500 hover:bg-red-50 transition-colors disabled:opacity-50",children:g===`source:${y.source_file}`?e.jsx(V,{size:14,className:"animate-spin"}):e.jsx(je,{size:14})})]},y.source_file))})]},u.subject))})]})};function as({className:s,...a}){return e.jsx(ia,{"data-slot":"checkbox",className:Te("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:e.jsx(na,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:e.jsx(ca,{className:"size-3.5"})})})}const rl=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,il=/[A-Z]/,nl=/[a-z]/,cl=/\d/,ol=/[^A-Za-z0-9]/;function dl(s){const a={};s.name.trim()||(a.name="Name is required.");const n=s.email.trim().toLowerCase();n?rl.test(n)||(a.email="Enter a valid email address."):a.email="Email is required.";const i=s.password;return i.length<8?a.password="Password must be at least 8 characters.":il.test(i)?nl.test(i)?cl.test(i)?ol.test(i)||(a.password="Password must include at least one special character."):a.password="Password must include at least one number.":a.password="Password must include at least one lowercase letter.":a.password="Password must include at least one uppercase letter.",s.confirmPassword?s.confirmPassword!==i&&(a.confirmPassword="Passwords do not match."):a.confirmPassword="Confirm password is required.",s.role.trim()||(a.role="Role is required."),s.status.trim()||(a.status="Status is required."),s.grade.trim()||(a.grade="Grade is required."),s.section.trim()||(a.section="Section is required."),s.role.trim().toLowerCase()==="student"&&!s.lrn.trim()&&(a.lrn="LRN is required for student accounts."),a}function xl(s){return Object.values(s).find(n=>!!n)??null}const at=(s="Student")=>({name:"",email:"",password:"",confirmPassword:"",role:s,status:"Active",department:s==="Teacher"?"Mathematics":s==="Admin"?"System":"",grade:"",section:"",lrn:""}),ml=["10","25","50","100"];function ks(s,a){const n=s.trim();if(!(!n||n===a))return n}function lt(s){const a=String(s??"");return/[",\n]/.test(a)?`"${a.replace(/"/g,'""')}"`:a}const hl=({createIntentRole:s=null,onCreateIntentConsumed:a})=>{const{userProfile:n}=cs(),[i,r]=l.useState([]),[o,g]=l.useState(!0),[m,w]=l.useState(null),[f,d]=l.useState(!1),[c,p]=l.useState(!1),[v,N]=l.useState(null),[D,u]=l.useState(1),[y,z]=l.useState(25),[T,q]=l.useState(0),[me,he]=l.useState(1),[Ne,_]=l.useState(!1),[pe,Q]=l.useState(""),[X,L]=l.useState("All Roles"),[te,O]=l.useState("All Status"),[K,ne]=l.useState("All Sections"),[B,ce]=l.useState(new Set),[x,ae]=l.useState(!1),[h,P]=l.useState(new Set),[H,Y]=l.useState({}),[G,Xe]=l.useState("Student"),[Oe,k]=l.useState("Active"),[$,oe]=l.useState("Grade 11"),[Ae,Ts]=l.useState(""),[ds,Ee]=l.useState(!1),[xs,Be]=l.useState(!1),[$e,Qe]=l.useState(!1),[le,ms]=l.useState(null),[W,$s]=l.useState(null),[hs,Ke]=l.useState({}),[ps,Ye]=l.useState(!1),[Cl,us]=l.useState(!1),[j,de]=l.useState(at()),U=l.useMemo(()=>({search:pe.trim()||void 0,role:ks(X,"All Roles"),status:ks(te,"All Status"),section:ks(K,"All Sections")}),[pe,X,te,K]),ue=l.useCallback(()=>{ce(new Set),ae(!1),P(new Set)},[]),Ze=l.useCallback(t=>x?!h.has(t):B.has(t),[x,h,B]),Z=l.useMemo(()=>x?Math.max(T-h.size,0):B.size,[x,h,B,T]),Ls=l.useMemo(()=>i.length===0?!1:i.every(t=>Ze(t.id)),[i,Ze]),be=l.useMemo(()=>x?[]:Array.from(B).map(t=>H[t]).filter(t=>!!t),[x,B,H]);l.useMemo(()=>Z===0?!1:x?!U.role||U.role.toLowerCase()==="student":be.length!==B.size?!1:be.every(t=>t.role==="Student"),[x,Z,be,B.size,U.role]),l.useMemo(()=>Z===0?!1:x?U.status?.toLowerCase()!=="active":be.length!==B.size?!1:be.some(t=>t.status!=="Active"),[x,Z,be,B.size,U.status]),l.useMemo(()=>Z===0?!1:x?U.status?.toLowerCase()!=="inactive":be.length!==B.size?!1:be.some(t=>t.status!=="Inactive"),[x,Z,be,B.size,U.status]);const ye=l.useCallback(async t=>{g(!0),w(null);try{const b=await qa({page:t,pageSize:y,searchQuery:U.search,roleFilter:U.role,statusFilter:U.status});r(b.users),u(b.total===0?1:b.page),q(b.total),he(b.totalPages||1),_(b.hasNextPage),Y(R=>{const ke={...R};return b.users.forEach(E=>{ke[E.id]=E}),ke})}catch(b){const R=b instanceof Error?b.message:"Failed to load users";w(R),S.error(R)}finally{g(!1)}},[y,U.search,U.role,U.status]);l.useEffect(()=>{ye(D)},[ye,D]);const Us=l.useMemo(()=>{const t=new Set;return i.forEach(b=>{b.section&&t.add(b.section)}),Array.from(t).sort()},[i]),gs=l.useMemo(()=>U.section?i.filter(t=>t.section===U.section):i,[i,U.section]),bs=l.useCallback((t="Student")=>{$s(null),Ke({}),Ye(!1),us(!1),de(at(t)),Ee(!0)},[]);l.useEffect(()=>{s&&(bs(s),a?.())},[s,bs,a]);const Is=l.useCallback(t=>{if(x){P(b=>{const R=new Set(b);return R.has(t)?R.delete(t):R.add(t),R});return}ce(b=>{const R=new Set(b);return R.has(t)?R.delete(t):R.add(t),R})},[x]),Fs=l.useCallback(()=>{if(i.length===0)return;const t=gs.map(b=>b.id);if(x){P(b=>{const R=new Set(b);return t.every(E=>!R.has(E))?t.forEach(E=>R.add(E)):t.forEach(E=>R.delete(E)),R});return}ce(b=>{const R=new Set(b);return t.every(E=>R.has(E))?t.forEach(E=>R.delete(E)):t.forEach(E=>R.add(E)),R})},[i,x]),zt=l.useCallback(()=>{ae(!0),ce(new Set),P(new Set)},[]),_s=l.useCallback(t=>{if(!t.length){S.info("No rows were returned for export.");return}const b=Array.from(t.reduce((Je,vs)=>(Object.keys(vs).forEach(Ft=>Je.add(Ft)),Je),new Set)),R=[b.map(lt).join(","),...t.map(Je=>b.map(vs=>lt(Je[vs])).join(","))].join(` -`),ke=new Blob([R],{type:"text/csv;charset=utf-8;"}),E=URL.createObjectURL(ke),js=document.createElement("a");js.href=E,js.download=`admin-users-export-${Date.now()}.csv`,js.click(),URL.revokeObjectURL(E)},[]),ze=l.useCallback(async(t,b)=>{const R=b.userIds,ke={...U.search?{search:U.search}:{},...U.role?{role:U.role}:{},...U.status?{status:U.status}:{}};if(!R&&Z===0){S.error("Select at least one user before applying a bulk action.");return}p(!0);try{const E=await Va({action:t,...R?{userIds:R}:x?{userIds:[],excludeUserIds:Array.from(h),filters:ke}:{userIds:Array.from(B)},...b.role?{role:b.role}:{},...b.status?{status:b.status}:{},...b.grade?{grade:b.grade}:{},...b.section?{section:b.section}:{},...b.exportFormat?{exportFormat:b.exportFormat}:{}});t==="export"&&_s(E.exportRows),E.summary.failed>0?S.warning(`Completed with partial failures. ${E.summary.succeeded} succeeded, ${E.summary.failed} failed, ${E.summary.skipped} skipped.`):E.summary.succeeded===0&&E.summary.targeted>0?S.error(E.summary.skipped>0?`Action skipped for ${E.summary.skipped} user(s).`:"Action could not be completed. No users were updated."):S.success(`Action completed. ${E.summary.succeeded} user(s) updated.`),E.warnings.length>0&&S.info(E.warnings[0]);try{await ys(b.auditAction,"User",t==="delete"||t==="deactivate"?"Warning":"Info",`${b.auditDetail}; targeted=${E.summary.targeted}, succeeded=${E.summary.succeeded}, failed=${E.summary.failed}, skipped=${E.summary.skipped}`,{name:n?.name||"Admin",role:"Admin",avatar:n?.photo||null})}catch{}b.skipSelectionReset||ue(),await ye(D)}catch(E){S.error(E instanceof Error?E.message:"Bulk action failed")}finally{p(!1)}},[U.search,U.role,U.status,x,h,B,Z,n?.name,n?.photo,ue,ye,D,_s]),fs=l.useCallback(t=>{ms(t),Be(!0)},[]),Dt=l.useCallback(async()=>{if(!(!le||$e)){Qe(!0);try{await ze(le.action,{...le.params||{},auditAction:le.auditAction,auditDetail:le.auditDetail}),Be(!1),ms(null)}finally{Qe(!1)}}},[le,$e,ze]),Os=t=>{$s(t),Ke({}),Ye(!1),us(!1),de({name:t.name,email:t.email,password:"",confirmPassword:"",role:t.role,status:t.status,department:t.department,grade:t.grade||"Grade 11",section:t.section||"",lrn:t.lrn||""}),Ee(!0)},Pt=async()=>{if(!j.name.trim()||!j.email.trim()){S.error("Name and email are required");return}if(!W){const t=dl({name:j.name,email:j.email,password:j.password,confirmPassword:j.confirmPassword,role:j.role,status:j.status,grade:j.grade,section:j.section,lrn:j.lrn}),b=xl(t);if(b){Ke(t),S.error(b);return}}d(!0);try{if(W){const t={name:j.name,role:j.role,status:j.status,grade:j.grade,section:j.section,lrn:j.role==="Student"?j.lrn:void 0};j.role!=="Student"&&(t.department=j.department),await Ha(W.id,t),await ys("User Updated","User","Info",`Updated user: ${j.name} (${W.email})`,{name:n?.name||"Admin",role:"Admin",avatar:n?.photo||null}),S.success("User updated successfully")}else{const t=await Wa({email:j.email,name:j.name,password:j.password,confirmPassword:j.confirmPassword,role:j.role,status:j.status,grade:j.grade,section:j.section,lrn:j.role==="Student"?j.lrn:void 0});await ys("Created New User","User","Info",`Created new ${j.role.toLowerCase()} account: ${j.name} (${j.email}), emailSent=${t.emailSent}`,{name:n?.name||"Admin",role:"Admin",avatar:n?.photo||null}),t.emailSent?S.success("User created and welcome email sent"):(S.warning("User created, but welcome email failed to send"),t.emailError?.message&&S.error(t.emailError.message))}W?await ye(D):(ue(),u(1),await ye(1)),Ee(!1),Ye(!1),us(!1)}finally{d(!1)}},Bs=(t,b)=>{fs({title:"Delete User?",message:`Delete user "${b}"? This cannot be undone.`,confirmText:"Delete",action:"delete",params:{userIds:[t]},auditAction:"User Deleted",auditDetail:`Deleted user account: ${b}`})},Gs=async t=>{if(v||c)return;if(t.status==="Active"){fs({title:"Deactivate User?",message:`Deactivate "${t.name}"? They will lose access until reactivated.`,confirmText:"Deactivate",action:"deactivate",params:{userIds:[t.id]},auditAction:"User Status Changed",auditDetail:`Deactivated user: ${t.email}`});return}N(t.id);try{await ze("activate",{userIds:[t.id],auditAction:"User Status Changed",auditDetail:`Activated user: ${t.email}`,skipSelectionReset:!0})}finally{N(null)}},Rt=async()=>{await ze("change_role",{role:G,auditAction:"Bulk Role Update",auditDetail:`Updated selected users to role ${G}`})},Mt=async()=>{await ze("change_status",{status:Oe,auditAction:"Bulk Status Update",auditDetail:`Updated selected users to status ${Oe}`})},Tt=async()=>{await ze("reset_password_email",{auditAction:"Bulk Password Reset",auditDetail:"Sent password reset emails to selected users"})},$t=async()=>{await ze("export",{exportFormat:"csv",auditAction:"Bulk Export Users",auditDetail:"Exported selected users"})},Lt=()=>{fs({title:"Delete Selected Users?",message:`Delete ${Z} selected user(s)? This action cannot be undone.`,confirmText:"Delete Users",action:"delete",auditAction:"Bulk User Deletion",auditDetail:`Deleted ${Z} selected users`})};i.filter(t=>t.status==="Active").length,i.filter(t=>t.role==="Admin").length,i.filter(t=>t.role==="Teacher").length,i.filter(t=>t.role==="Student").length;const Ut=T===0?0:(D-1)*y+1,It=T===0?0:Math.min(D*y,T);return e.jsxs("div",{className:"flex flex-col animate-in fade-in duration-500",children:[e.jsx("div",{className:"space-y-8 pt-6 xl:pt-8 pb-6 px-1",children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-5 gap-4",children:o&&i.length===0?Array.from({length:5}).map((t,b)=>e.jsxs("div",{className:"bg-white p-5 rounded-[28px] border border-slate-200/60 shadow-sm shadow-slate-200/50 animate-pulse",children:[e.jsx("div",{className:"h-4 w-20 bg-slate-100 rounded-full mb-3"}),e.jsx("div",{className:"h-8 w-12 bg-slate-100 rounded-lg"})]},`stats-skeleton-${b}`)):[{label:"Total Users",value:T,icon:Pe,bg:"bg-[#4f46e5]",shadow:"shadow-indigo-500/20"},{label:"Active Today",value:i.filter(t=>t.status==="Active").length,icon:qe,bg:"bg-[#10b981]",shadow:"shadow-emerald-500/20"},{label:"Admins",value:i.filter(t=>t.role==="Admin").length,icon:As,bg:"bg-[#0ea5e9]",shadow:"shadow-sky-500/20"},{label:"Teachers",value:i.filter(t=>t.role==="Teacher").length,icon:is,bg:"bg-[#8b5cf6]",shadow:"shadow-purple-500/20"},{label:"Students",value:i.filter(t=>t.role==="Student").length,icon:nt,bg:"bg-[#3b82f6]",shadow:"shadow-blue-500/20"}].map((t,b)=>e.jsxs("div",{className:`relative overflow-hidden ${t.bg} ${t.shadow} p-5 rounded-[28px] text-white flex flex-col gap-3 group hover:scale-[1.02] transition-all duration-300 shadow-lg`,children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-700 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-700 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex items-center justify-between",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] opacity-80",children:t.label}),e.jsx("div",{className:"bg-white/20 p-2 rounded-xl backdrop-blur-sm group-hover:bg-white/30 transition-colors",children:e.jsx(t.icon,{size:14})})]}),e.jsx("h3",{className:"relative z-10 text-3xl font-display font-black leading-none tracking-tight",children:t.value})]},b))})}),e.jsx("div",{className:"sticky top-0 z-40 -mx-[24px] xl:-mx-[32px] px-[24px] xl:px-[32px] pt-4 pb-4 bg-[#f8fafc] backdrop-blur-sm",children:e.jsxs("div",{className:"flex flex-col xl:flex-row items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 w-full group",children:[e.jsx(bt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-indigo-500 transition-colors",size:16}),e.jsx(xe,{placeholder:"Search by name, email, or LRN...",className:"pl-11 h-12 bg-white border-slate-200/60 rounded-2xl focus-visible:ring-indigo-500/20 focus-visible:border-indigo-500 transition-all text-sm font-medium shadow-md shadow-slate-200/40",value:pe,onChange:t=>{Q(t.target.value),u(1),ue()}})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 w-full xl:w-auto",children:[e.jsxs(J,{value:X,onValueChange:t=>{L(t),u(1),ue()},children:[e.jsx(ee,{className:"w-[180px] h-12 rounded-xl bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:X==="All Roles"?"All Roles":X==="Admin"?"Administrator":X==="Teacher"?"Educator":X})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Roles",className:"font-bold uppercase tracking-widest text-[10px]",children:"All Roles"}),e.jsx(C,{value:"Admin",className:"font-bold uppercase tracking-widest text-[10px]",children:"Administrator"}),e.jsx(C,{value:"Teacher",className:"font-bold uppercase tracking-widest text-[10px]",children:"Educator"}),e.jsx(C,{value:"Student",className:"font-bold uppercase tracking-widest text-[10px]",children:"Student"})]})]}),e.jsxs(J,{value:te,onValueChange:t=>{O(t),u(1),ue()},children:[e.jsx(ee,{className:"w-[180px] h-12 rounded-xl bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:te==="All Status"?"All Statuses":te})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Status",className:"font-bold uppercase tracking-widest text-[10px]",children:"All Statuses"}),e.jsx(C,{value:"Active",className:"font-bold uppercase tracking-widest text-[10px]",children:"Active"}),e.jsx(C,{value:"Inactive",className:"font-bold uppercase tracking-widest text-[10px]",children:"Inactive"})]})]}),Us.length>0&&e.jsxs(J,{value:K,onValueChange:t=>{ne(t),ue()},children:[e.jsx(ee,{className:"w-[180px] h-12 rounded-xl bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:K==="All Sections"?"All Sections":K})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Sections",className:"font-bold uppercase tracking-widest text-[10px]",children:"All Sections"}),Us.map(t=>e.jsx(C,{value:t,className:"font-bold uppercase tracking-widest text-[10px]",children:t},t))]})]})]}),e.jsx(A,{variant:"outline",size:"icon",onClick:()=>{Q(""),L("All Roles"),O("All Status"),ne("All Sections"),u(1),ue()},disabled:!pe&&X==="All Roles"&&te==="All Status",className:"h-12 w-12 rounded-xl border-slate-200 text-[#9956DE] hover:bg-purple-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all shadow-md shadow-slate-200/40",title:"Reset Filters",children:e.jsx(yt,{size:18})}),e.jsx(A,{variant:"outline",size:"icon",className:"h-12 w-12 rounded-xl border-slate-200 text-slate-500 hover:bg-slate-50 transition-all shadow-md shadow-slate-200/40",onClick:()=>ye(D),disabled:o||c,children:e.jsx(Me,{size:18,className:o?"animate-spin":""})}),e.jsxs(A,{className:"h-12 gap-2 bg-[#9956DE] hover:bg-[#8b5cf6] text-white rounded-xl shadow-lg shadow-purple-200/50 transition-all px-6 font-black uppercase text-[11px] tracking-widest",onClick:()=>bs(),disabled:c,children:[e.jsx(qt,{size:18}),"Add User"]})]})}),Z>0&&e.jsxs("div",{className:"fixed bottom-16 left-1/2 -translate-x-1/2 z-[60] w-[calc(100%-4rem)] max-w-[1100px] bg-[#2d1b69] rounded-2xl p-3 flex flex-col xl:flex-row items-center gap-4 animate-in slide-in-from-bottom-2 duration-300 shadow-2xl shadow-purple-900/50",children:[e.jsxs("div",{className:"flex items-center gap-3 px-3 border-r border-white/10 pr-6",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-purple-500/30 flex items-center justify-center text-white font-black text-xs",children:Z}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black text-purple-300 uppercase tracking-widest leading-none",children:"Selected"}),e.jsx("p",{className:"text-[9px] text-white/60 font-medium mt-1",children:x?"All matching users":`${Z} users chosen`})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-white/5 p-1 rounded-xl",children:[e.jsxs(J,{value:G,onValueChange:t=>Xe(t),children:[e.jsx(ee,{className:"h-8 bg-transparent border-none text-white text-[10px] font-bold min-w-[90px] focus:ring-0",children:e.jsx(Ue,{})}),e.jsxs(se,{className:"rounded-xl",children:[e.jsx(C,{value:"Student",children:"Student"}),e.jsx(C,{value:"Teacher",children:"Teacher"}),e.jsx(C,{value:"Admin",children:"Admin"})]})]}),e.jsx(A,{size:"sm",className:"h-8 bg-purple-600 hover:bg-purple-500 text-[10px] font-black rounded-lg",onClick:()=>void Rt(),children:"Apply Role"})]}),e.jsxs("div",{className:"flex items-center gap-1 bg-white/5 p-1 rounded-xl",children:[e.jsxs(J,{value:Oe,onValueChange:t=>k(t),children:[e.jsx(ee,{className:"h-8 bg-transparent border-none text-white text-[10px] font-bold min-w-[90px] focus:ring-0",children:e.jsx(Ue,{})}),e.jsxs(se,{className:"rounded-xl",children:[e.jsx(C,{value:"Active",children:"Active"}),e.jsx(C,{value:"Inactive",children:"Inactive"})]})]}),e.jsx(A,{size:"sm",className:"h-8 bg-purple-600 hover:bg-purple-500 text-[10px] font-black rounded-lg",onClick:()=>void Mt(),children:"Set Status"})]}),e.jsx("div",{className:"h-6 w-[1px] bg-white/10 mx-1"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(A,{size:"sm",variant:"ghost",className:"h-9 text-white hover:bg-white/10 text-[10px] font-black uppercase tracking-widest gap-2",onClick:()=>void Tt(),children:[e.jsx(oa,{size:14})," Reset Pass"]}),e.jsxs(A,{size:"sm",variant:"ghost",className:"h-9 text-white hover:bg-white/10 text-[10px] font-black uppercase tracking-widest gap-2",onClick:()=>void $t(),children:[e.jsx(Ps,{size:14})," Export"]}),e.jsxs(A,{size:"sm",variant:"ghost",className:"h-9 text-rose-400 hover:bg-rose-500/10 hover:text-rose-300 text-[10px] font-black uppercase tracking-widest gap-2",onClick:Lt,children:[e.jsx(je,{size:14})," Delete"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-4 border-l border-white/10",children:[!x&&Zye(D),disabled:o||c,children:"Retry"})]}):null,e.jsxs("div",{className:"bg-white rounded-[32px] border border-slate-200/60 shadow-sm shadow-slate-200/50 relative",children:[o&&i.length>0&&e.jsx("div",{className:"absolute inset-0 bg-white/40 backdrop-blur-[1px] z-20 flex items-center justify-center",children:e.jsx(V,{className:"animate-spin text-indigo-500",size:32})}),e.jsxs("div",{className:"md:hidden divide-y divide-slate-100",children:[e.jsxs("div",{className:"px-6 py-4 bg-slate-50/50 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-3 text-[10px] font-black text-slate-400 uppercase tracking-widest cursor-pointer",children:[e.jsx(as,{checked:Ls,onCheckedChange:Fs,className:"rounded-md border-slate-300"}),"Select Page"]}),e.jsxs("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:["Page ",D," of ",me]})]}),o&&i.length===0?e.jsx("div",{className:"px-6 py-12 text-center text-slate-400 font-medium",children:"Loading users..."}):i.length>0?gs.map(t=>(t.id,e.jsxs("div",{className:"p-5 space-y-4 group hover:bg-slate-50/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center self-center",children:e.jsx(as,{checked:Ze(t.id),onCheckedChange:()=>Is(t.id),className:"rounded-md border-slate-300"})}),e.jsxs("div",{className:"relative",children:[e.jsxs(Hs,{className:"h-12 w-12 rounded-full border-2 border-white shadow-sm",children:[e.jsx(Ws,{src:t.photo||Cs(t.gender),className:"object-cover"}),e.jsx(Vs,{className:"bg-indigo-50 text-indigo-600 font-bold",children:t.name.charAt(0)})]}),e.jsx("div",{className:`absolute -bottom-1 -right-1 w-4 h-4 rounded-full border-2 border-white shadow-sm ${t.status==="Active"?"bg-emerald-500":"bg-slate-300"}`})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-black text-[#1e293b] truncate text-sm",children:t.name}),e.jsx("p",{className:"text-[11px] font-medium text-slate-400 truncate mt-0.5",children:t.email})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:`text-[9px] font-black uppercase tracking-widest px-2 py-1 rounded-lg ${t.role==="Admin"?"bg-sky-50 text-sky-600":t.role==="Teacher"?"bg-purple-50 text-purple-600":"bg-blue-50 text-blue-600"}`,children:t.role}),e.jsxs("span",{className:"text-[9px] font-black uppercase tracking-widest px-2 py-1 rounded-lg bg-slate-50 text-slate-500",children:[t.grade," • ",t.section||t.department]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(A,{variant:"outline",size:"sm",className:"flex-1 h-9 rounded-xl border-slate-200 text-slate-600 font-bold text-xs gap-2",onClick:()=>Os(t),children:[e.jsx(ss,{size:14})," Edit"]}),e.jsxs(A,{variant:"outline",size:"sm",className:`flex-1 h-9 rounded-xl border-slate-200 font-bold text-xs gap-2 ${t.status==="Active"?"text-slate-600":"text-emerald-600"}`,onClick:()=>Gs(t),disabled:v===t.id||c,children:[v===t.id?e.jsx(V,{size:14,className:"animate-spin"}):t.status==="Active"?e.jsx(st,{size:14}):e.jsx(qe,{size:14}),t.status==="Active"?"Ban":"Active"]}),e.jsx(A,{variant:"outline",size:"icon",className:"h-9 w-9 rounded-xl border-slate-200 text-rose-500 hover:bg-rose-50 hover:border-rose-100",onClick:()=>Bs(t.id,t.name),disabled:c,children:e.jsx(je,{size:14})})]})]},`mobile-${t.id}`))):e.jsxs("div",{className:"px-6 py-20 text-center space-y-4",children:[e.jsx("div",{className:"w-20 h-20 bg-slate-50 rounded-full flex items-center justify-center mx-auto",children:e.jsx(Pe,{size:32,className:"text-slate-300"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-black text-slate-600 uppercase tracking-widest text-sm",children:"No Users Found"}),e.jsx("p",{className:"text-xs text-slate-400 font-medium max-w-[200px] mx-auto leading-relaxed",children:"We couldn't find any users matching your current filters. Try adjusting your search."})]}),e.jsx(A,{variant:"outline",size:"sm",className:"rounded-xl border-slate-200 text-indigo-600 font-bold",onClick:()=>{Q(""),L("All Roles"),O("All Status")},children:"Clear Filters"})]})]}),e.jsx("div",{className:"hidden md:block",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{className:"sticky top-[80px] z-30 bg-[#f8fafc] backdrop-blur-sm shadow-[0_-12px_0_0_#f8fafc]",children:e.jsxs("tr",{className:"border-b border-[#8b5cf6]",children:[e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 w-[60px] rounded-tl-[20px]",children:e.jsx(as,{checked:Ls,onCheckedChange:Fs,className:"rounded-md border-white/50 data-[state=checked]:bg-white data-[state=checked]:text-[#9956DE]"})}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"User Profile"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"Role & Access"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"Status"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"Placement"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"Activity"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-right text-[11px] font-black text-white uppercase tracking-widest rounded-tr-[20px]",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-50",children:o&&i.length===0?e.jsx("tr",{children:e.jsxs("td",{colSpan:7,className:"px-6 py-20 text-center",children:[e.jsx(V,{className:"animate-spin text-indigo-200 mx-auto",size:40}),e.jsx("p",{className:"mt-4 text-[10px] font-black text-slate-300 uppercase tracking-widest",children:"Loading Records..."})]})}):i.length>0?gs.map(t=>{const b=v===t.id;return e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[e.jsx("td",{className:"px-6 py-4 align-middle",children:e.jsx(as,{checked:Ze(t.id),onCheckedChange:()=>Is(t.id),className:"rounded-md border-slate-300 group-hover:border-indigo-400 transition-colors"})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"relative shrink-0",children:e.jsxs(Hs,{className:"h-11 w-11 rounded-full border-2 border-white shadow-sm ring-1 ring-slate-100",children:[e.jsx(Ws,{src:t.photo||Cs(t.gender),className:"object-cover"}),e.jsx(Vs,{className:"bg-indigo-50 text-indigo-600 font-bold text-sm",children:t.name.charAt(0)})]})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-black text-[#1e293b] truncate text-sm leading-tight group-hover:text-indigo-600 transition-colors",children:t.name}),e.jsx("p",{className:"text-[11px] font-medium text-slate-400 truncate mt-0.5",children:t.email})]})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsx("span",{className:` + `,children:[e.jsx("input",{ref:Ne,type:"file",accept:".pdf",className:"hidden",onChange:p=>p.target.files?.[0]&&K(p.target.files[0])}),v?e.jsxs("div",{className:"flex items-center gap-4 text-left",children:[e.jsx("div",{className:"w-14 h-14 bg-purple-50 rounded-xl flex items-center justify-center text-purple-600 border border-purple-100 shadow-sm shrink-0",children:e.jsx(Ce,{size:28})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{className:"font-black text-[14px] text-[#1e293b] truncate max-w-[300px]",children:v.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] text-purple-500 font-black uppercase",children:[(v.size/1024/1024).toFixed(2)," MB"]}),e.jsx("span",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest italic",children:"PDF Source"})]}),e.jsxs("button",{onClick:p=>{p.stopPropagation(),h(null)},className:"text-[10px] font-black text-rose-500 hover:text-rose-600 mt-1 flex items-center gap-1",children:[e.jsx(je,{size:10})," Replace"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-12 h-12 bg-slate-50 rounded-xl flex items-center justify-center text-slate-300 mb-4 group-hover/drop:text-purple-500 group-hover/drop:bg-purple-50 transition-all",children:e.jsx(es,{size:24})}),e.jsx("h4",{className:"text-[14px] font-black text-[#1e293b]",children:"Drop PDF or click to browse"}),e.jsx("p",{className:"text-[10px] text-slate-400 mt-1 font-medium italic",children:"Max 50MB (SLM, Textbook, Guide)"})]}),y>0&&e.jsx("div",{className:"absolute inset-0 bg-white/95 backdrop-blur-[1px] rounded-2xl flex flex-col items-center justify-center p-8 z-20",children:e.jsxs("div",{className:"w-full max-w-xs space-y-3 text-center",children:[e.jsx("div",{className:"w-12 h-12 bg-[#9956DE] rounded-xl flex items-center justify-center mx-auto mb-2 animate-bounce",children:e.jsx(Xs,{size:24,className:"text-white"})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("h5",{className:"text-sm font-black text-[#1e293b]",children:i?"Analyzing Curriculum...":"Complete!"}),e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Platform Ingestion"})]}),e.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden p-0.5 border border-slate-200 mt-2",children:e.jsx(re.div,{className:"h-full bg-gradient-to-r from-purple-500 to-sky-500 rounded-full",initial:{width:0},animate:{width:`${y}%`},transition:{duration:.3}})})]})})]})})]}),e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Curriculum Subject"}),e.jsxs(J,{value:c,onValueChange:d,disabled:i,children:[e.jsx(ee,{className:"w-full h-10 bg-slate-50/50 border-slate-200 rounded-xl text-[12px] font-bold focus:ring-purple-500/20",children:e.jsx(Ue,{placeholder:"Select subject"})}),e.jsx(se,{className:"rounded-xl border-slate-200",children:rs.map(p=>e.jsx(C,{value:p.id,className:"rounded-lg py-2",children:e.jsxs("div",{className:"flex flex-col items-start",children:[e.jsx("span",{className:"font-black text-[12px]",children:p.name}),e.jsxs("span",{className:"text-[9px] text-slate-400 font-bold uppercase",children:[p.gradeLevel," • ",p.semester]})]})},p.id))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Display Label"}),e.jsx(xe,{value:f,onChange:p=>w(p.target.value),placeholder:"e.g. General Mathematics",disabled:i,className:"h-10 bg-slate-50/50 border-slate-200 rounded-xl text-[12px] font-bold px-4 focus-visible:ring-purple-500/20"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Quarter"}),e.jsxs(J,{value:A,onValueChange:u,disabled:i,children:[e.jsx(ee,{className:"w-full h-10 bg-slate-50/50 border-slate-200 rounded-xl text-[12px] font-bold focus:ring-purple-500/20",children:e.jsx(Ue,{})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"1",className:"rounded-lg text-[12px] font-bold",children:"First Quarter"}),e.jsx(C,{value:"2",className:"rounded-lg text-[12px] font-bold",children:"Second Quarter"}),e.jsx(C,{value:"3",className:"rounded-lg text-[12px] font-bold",children:"Third Quarter"}),e.jsx(C,{value:"4",className:"rounded-lg text-[12px] font-bold",children:"Fourth Quarter"})]})]})]})]}),e.jsx(E,{onClick:ae,disabled:i||!v||!c||!f.trim(),className:"w-full h-12 gap-2 bg-[#9956DE] hover:bg-[#8b5cf6] text-white rounded-2xl shadow-lg shadow-purple-100 transition-all hover:scale-[1.01] active:scale-95 text-[14px] font-black",children:i?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:16,className:"animate-spin"})," Ingesting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{size:16})," Deploy Knowledge Source"]})})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{icon:Xs,color:"bg-purple-50",iconColor:"text-purple-600",title:"Grounding",desc:"Curriculum-pinned logic."},{icon:fe,color:"bg-sky-50",iconColor:"text-sky-600",title:"Indexing",desc:"Millisecond RAG retrieval."},{icon:it,color:"bg-emerald-50",iconColor:"text-emerald-600",title:"Extraction",desc:"Neural chunk parsing."}].map((p,P)=>e.jsxs("div",{className:"bg-white rounded-xl p-3 border border-slate-100 shadow-sm flex items-start gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg ${p.color} flex items-center justify-center shrink-0`,children:e.jsx(p.icon,{size:14,className:p.iconColor})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-[10px] font-black text-[#1e293b] uppercase tracking-wide leading-none",children:p.title}),e.jsx("p",{className:"text-[9px] text-slate-400 leading-tight mt-1 font-medium italic",children:p.desc})]})]},P))})]},"upload-tab"):e.jsx(re.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"space-y-4",children:e.jsx("div",{className:"bg-white rounded-[24px] border border-slate-200 shadow-sm overflow-hidden relative",children:e.jsxs(kt,{className:"w-full text-left border-collapse",children:[e.jsx(St,{children:e.jsxs(Ie,{className:"bg-[#9956DE] hover:bg-[#9956DE] border-b border-[#8b5cf6] sticky top-0 z-20 shadow-sm",children:[e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto",children:"File Name"}),e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto",children:"Uploaded By"}),e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto",children:"Type"}),e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto",children:"Date"}),e.jsx(ge,{className:"px-6 py-4 text-[10px] font-black text-white uppercase tracking-widest h-auto text-right",children:e.jsx(E,{variant:"ghost",size:"sm",className:"h-8 px-2 bg-white/10 text-white hover:bg-white/20 rounded-lg",onClick:U,disabled:X,children:e.jsx(Me,{size:12,className:X?"animate-spin":""})})})]})}),e.jsx(Ct,{className:"divide-y divide-slate-50",children:X?e.jsx(Ie,{children:e.jsxs(ie,{colSpan:5,className:"h-48 text-center",children:[e.jsx(V,{size:24,className:"animate-spin text-purple-500 mx-auto"}),e.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mt-2",children:"Loading files..."})]})}):_.length===0?e.jsx(Ie,{children:e.jsxs(ie,{colSpan:5,className:"h-48 text-center",children:[e.jsx(Ce,{size:24,className:"text-slate-200 mx-auto"}),e.jsx("p",{className:"text-[12px] font-black text-slate-400 mt-2",children:"No uploaded files found."})]})}):_.map(p=>e.jsxs(Ie,{className:"group hover:bg-purple-50/10 transition-all",children:[e.jsx(ie,{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ce,{size:16,className:"text-purple-500"}),e.jsx("span",{className:"font-bold text-[13px] text-slate-800 truncate max-w-[200px]",children:p.fileName})]})}),e.jsx(ie,{className:"px-6 py-4 text-[12px] text-slate-600",children:p.teacherEmail||"—"}),e.jsx(ie,{className:"px-6 py-4",children:e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[9px] font-black uppercase bg-slate-100 text-slate-600",children:p.fileType})}),e.jsx(ie,{className:"px-6 py-4 text-[12px] text-slate-500",children:p.createdAt.toLocaleDateString()}),e.jsx(ie,{className:"px-6 py-4 text-right",children:e.jsx(E,{variant:"ghost",size:"sm",className:"h-7 px-2 text-slate-400 hover:text-red-500 hover:bg-red-50",onClick:()=>te(p.id,p.collection),children:e.jsx(je,{size:14})})})]},p.id))})]})})},"inventory-tab")})]})};function At(s){return s?s.charAt(0).toUpperCase()+s.slice(1):"Student"}function Ds(s){if(!s||!s.toDate)return new Date().toISOString().replace("T"," ").slice(0,19);const a=s.toDate();return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")} ${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function Oa(){return Ds({toDate:()=>new Date})}function Ba(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const i=Date.now()-a.getTime(),l=Math.floor(i/6e4);if(l<1)return"Just now";if(l<60)return`${l} minute${l!==1?"s":""} ago`;const o=Math.floor(l/60);if(o<24)return`${o} hour${o!==1?"s":""} ago`;const g=Math.floor(o/24);return g<7?`${g} day${g!==1?"s":""} ago`:a.toLocaleDateString()}function Ga(s){const a=(s.grade||"").trim(),n=(s.section||"").trim(),i=[a,n].filter(Boolean).join(" - ");return{id:s.uid,name:s.name||"Unknown",email:s.email||"",role:At(s.role||""),status:s.status||"Active",department:s.department||(s.role?.toLowerCase()==="student"?i||"Student":""),grade:a,section:n,classSectionId:s.classSectionId||void 0,classSection:i,lrn:(s.lrn||"").trim(),gender:s.gender||null,photo:(s.photo||"").trim(),lastLogin:Ba(s.lastLogin),createdAt:s.createdAt||void 0}}function os(s){if(s instanceof ot){try{const a=JSON.parse(s.responseBody);if(a?.detail&&typeof a.detail=="string")return a.detail}catch{}return`Request failed (${s.status}).`}return s instanceof Error?s.message:"Request failed."}async function qa(s={}){try{const a=await Se.getAdminUsers({page:s.page??1,pageSize:s.pageSize??25,search:s.searchQuery,role:s.roleFilter,status:s.statusFilter,grade:s.gradeFilter,section:s.sectionFilter,classSectionId:s.classSectionId});if(!a.success)throw new Error("Failed to load admin users");return{users:(a.users||[]).map(Ga),page:a.page,pageSize:a.pageSize,total:a.total,totalPages:a.totalPages,hasNextPage:a.hasNextPage}}catch(a){throw console.error("[adminService] getAdminUsersPage error:",a),a instanceof Bt?new Error("Loading users timed out. Please refresh and try again."):a instanceof Gt?new Error("Unable to reach the server. Please check your connection and retry."):a instanceof ot&&a.status===504?new Error("Loading users took too long. Try narrowing your filters and retrying."):new Error(os(a))}}async function Ha(s,a){try{await Se.updateAdminUser(s,{...a.name!==void 0?{name:a.name}:{},...a.role!==void 0?{role:a.role}:{},...a.status!==void 0?{status:a.status}:{},...a.department!==void 0?{department:a.department}:{},...a.grade!==void 0?{grade:a.grade}:{},...a.section!==void 0?{section:a.section}:{},...a.lrn!==void 0?{lrn:a.lrn}:{}})}catch(n){throw new Error(os(n))}}async function Wa(s){try{const a=await Se.createAdminUser({name:s.name.trim(),email:s.email.trim().toLowerCase(),password:s.password,confirmPassword:s.confirmPassword,role:s.role,status:s.status,grade:s.grade.trim(),section:s.section.trim(),...s.lrn?.trim()?{lrn:s.lrn.trim()}:{}});if(!a.success||!a.userCreated||!a.uid)throw new Error(a.message||"Failed to create user account.");return{uid:a.uid,userCreated:a.userCreated,emailSent:a.emailSent,resultCode:a.resultCode,message:a.message,warnings:a.warnings??[],emailError:a.emailError}}catch(a){throw new Error(os(a))}}async function Va(s){try{const a=await Se.bulkAdminUsers({action:s.action,userIds:s.userIds??[],excludeUserIds:s.excludeUserIds??[],filters:s.filters,role:s.role,status:s.status,grade:s.grade,section:s.section,lrn:s.lrn,dryRun:s.dryRun,exportFormat:s.exportFormat??"csv"});return{success:a.success,action:a.action,summary:a.summary,results:a.results,warnings:a.warnings||[],exportRows:a.export?.rows||[]}}catch(a){throw new Error(os(a))}}async function Et(){try{if(!Ot.currentUser)return[];const s=ve(L(M,"accessAuditLogs"),We("timestamp","desc"),ns(100)),n=(await F(s)).docs.map(g=>{const m=g.data(),v=m.success!==!1?"Info":"Error",h=m.action||"";let c="System";return m.module==="admin"||h.startsWith("admin_")?c="User":h.includes("login")||h.includes("auth")?c="Auth":(h.includes("upload")||h.includes("course"))&&(c="Content"),{id:g.id,severity:v,timestamp:typeof m.timestamp=="string"?m.timestamp:Ds(m.timestamp),user:{name:(()=>{const f=m.actorName||m.actorEmail||m.teacherEmail||m.teacherId||"SYSTEM";return f==="Unknown"||!f?"SYSTEM":f.includes("@")?f.split("@")[0].replace(/[._-]/g," ").replace(/\b\w/g,A=>A.toUpperCase()):f})(),role:At(m.actorRole||m.role||"System"),avatar:null},action:h,category:c,details:m.description||(m.status?`Status: ${m.status}`:"")}}),i=ve(L(M,"auditLogs"),We("timestampRaw","desc"),ns(50)),o=(await F(i)).docs.map(g=>{const m=g.data(),N=m.user;return{id:`audit-${g.id}`,severity:m.severity||"Info",timestamp:m.timestamp||Ds(m.timestampRaw),user:{name:N?.name||"SYSTEM",role:N?.role||"System",avatar:N?.avatar??null},action:m.action||"",category:m.category||"System",details:m.details||""}});return[...n,...o].sort((g,m)=>m.timestamp.localeCompare(g.timestamp)).slice(0,100)}catch(s){const a=s;return a?.code==="permission-denied"||a?.code==="firestore/permission-denied"?[]:(console.error("[adminService] getAuditLogs error:",s),[])}}async function ys(s,a,n,i,l){await sa(L(M,"auditLogs"),{severity:n,timestamp:Oa(),timestampRaw:ta(),user:l,action:s,category:a,details:i})}async function Qa(){try{const s=await F(L(M,"users"));let a=0,n=0,i=0;const l=new Set;s.docs.forEach(N=>{const v=N.data();v.role==="student"&&(a++,v.overallRisk==="High"&&(i++,l.add(N.id))),v.role==="teacher"&&v.status!=="Inactive"&&n++});try{(await F(L(M,"managedStudents"))).docs.forEach(v=>{const c=v.data().riskStatus;c&&["intervene","critical","at_risk"].includes(c)&&(l.has(v.id)||(i++,l.add(v.id)))})}catch{}let o=0;try{o=(await F(L(M,"classrooms"))).size}catch{}let g=0;try{g=(await F(L(M,"xpActivities"))).size}catch{}let m=0;try{const N=await F(L(M,"progress")),v=[];N.docs.forEach(h=>{const c=h.data();typeof c.averageScore=="number"&&v.push(c.averageScore)}),m=v.length>0?Math.round(v.reduce((h,c)=>h+c,0)/v.length):0}catch{}return{totalStudents:a,activeTeachers:n,totalClasses:o,atRiskStudents:i,avgPerformance:m,aiPredictions:g}}catch(s){return console.error("[adminService] getDashboardStats error:",s),{totalStudents:0,activeTeachers:0,totalClasses:0,atRiskStudents:0,avgPerformance:0,aiPredictions:0}}}async function Xa(s=3){const a=i=>{const l=i.data(),o=l.level||1,g=l.currentXP||0,m=Math.min(100,o*8+Math.round(g/100));return{id:i.id,name:l.name||"Student",avatar:l.photo||l.photoURL||Cs(l.gender||null),class:l.grade||"Math",performance:m,level:o}},n=i=>i.sort((l,o)=>o.level!==l.level?o.level-l.level:o.performance-l.performance).slice(0,s);try{const i=ve(L(M,"users"),Ve("role","==","student"),We("level","desc"),ns(s)),l=await F(i);return n(l.docs.map(a))}catch(i){if(i?.code==="failed-precondition")try{const o=ve(L(M,"users"),Ve("role","==","student"),ns(Math.max(50,s))),g=await F(o);return n(g.docs.map(a))}catch(o){return console.error("[adminService] getTopPerformers fallback error:",o),[]}return console.error("[adminService] getTopPerformers error:",i),[]}}async function Ka(){try{const s=new Date,a=["S","M","T","W","T","F","S"],n=[];for(let l=6;l>=0;l--){const o=new Date(s);o.setDate(o.getDate()-l),n.push({name:a[o.getDay()],ai:0,man:0})}return(await F(L(M,"xpActivities"))).docs.forEach(l=>{const o=l.data(),g=o.timestamp;if(!g?.toDate)return;const m=g.toDate(),N=Math.floor((s.getTime()-m.getTime())/864e5);if(N<0||N>6)return;const v=6-N,h=o.type;h==="lesson_complete"||h==="quiz_complete"?n[v].ai++:n[v].man++}),n}catch(s){return console.error("[adminService] getWeeklyActivity error:",s),[{name:"M",ai:0,man:0},{name:"T",ai:0,man:0},{name:"W",ai:0,man:0},{name:"T",ai:0,man:0},{name:"F",ai:0,man:0},{name:"S",ai:0,man:0},{name:"S",ai:0,man:0}]}}async function Ya(){try{const s=await F(L(M,"progress")),a={"gen-math":{enrolled:0,totalProgress:0},"stats-prob":{enrolled:0,totalProgress:0}};return s.docs.forEach(n=>{const l=n.data().subjects;l&&Object.entries(l).forEach(([o,g])=>{a[o]&&(a[o].enrolled++,a[o].totalProgress+=g?.progress??0)})}),[{name:"General Mathematics",type:"Core",count:a["gen-math"].enrolled,progress:a["gen-math"].enrolled>0?Math.round(a["gen-math"].totalProgress/a["gen-math"].enrolled):0},{name:"Statistics & Probability",type:"Core",count:a["stats-prob"].enrolled,progress:a["stats-prob"].enrolled>0?Math.round(a["stats-prob"].totalProgress/a["stats-prob"].enrolled):0}]}catch(s){return console.error("[adminService] getSubjectBreakdown error:",s),[]}}async function Za(){try{const s=new Set;let a=0;(await F(ve(L(M,"users"),Ve("role","==","student")))).docs.forEach(i=>{i.data().overallRisk==="High"&&(a++,s.add(i.id))});try{(await F(L(M,"managedStudents"))).docs.forEach(l=>{const g=l.data().riskStatus;g&&["intervene","critical","at_risk"].includes(g)&&!s.has(l.id)&&(a++,s.add(l.id))})}catch{}return{subjectName:"General Mathematics",atRiskCount:a}}catch(s){return console.error("[adminService] getPriorityAttention error:",s),{subjectName:"General Mathematics",atRiskCount:0}}}async function Ja(){try{const s=await F(L(M,"progress"));let a=0,n=0,i=0,l=0;return s.docs.forEach(o=>{const m=o.data().averageScore;typeof m=="number"?(a+=m,l++,m>=60?n++:i++):i++}),{avgMastery:l>0?Math.round(a/l):0,passed:n,pending:i}}catch(s){return console.error("[adminService] getGlobalMastery error:",s),{avgMastery:0,passed:0,pending:0}}}async function el(){try{const s=await F(L(M,"progress"));let a=0,n=0,i=0;s.docs.forEach(o=>{const m=o.data().averageScore;if(typeof m!="number"){a++;return}m<50?a++:m<80?n++:i++});const l=a+n+i||1;return{foundational:Math.round(a/l*100),intermediate:Math.round(n/l*100),advanced:Math.round(i/l*100)}}catch(s){return console.error("[adminService] getDifficultyDistribution error:",s),{foundational:0,intermediate:0,advanced:0}}}async function sl(){try{const s=await F(L(M,"users"));let a=0,n=0,i=0,l=0,o=0;const g=new Set;s.docs.forEach(c=>{const x=c.data();x.role==="student"&&(a++,x.overallRisk==="High"&&(i++,g.add(c.id)),x.streak>0&&o++,l+=x.totalXP||0),x.role==="teacher"&&n++});try{(await F(L(M,"managedStudents"))).docs.forEach(x=>{const w=x.data().riskStatus;w&&["intervene","critical","at_risk"].includes(w)&&!g.has(x.id)&&(i++,g.add(x.id))})}catch{}let m=0;try{m=(await F(L(M,"achievements"))).size}catch{}let N=0;try{N=(await F(L(M,"chatSessions"))).size}catch{}let v=0,h=0;try{const c=await F(L(M,"progress")),x=[];c.docs.forEach(f=>{const A=f.data().quizAttempts;A?.length&&(v+=A.length,A.forEach(u=>{typeof u.score=="number"&&x.push(u.score)}))}),h=x.length>0?Math.round(x.reduce((f,w)=>f+w,0)/x.length):0}catch{}return{totalActiveUsers:a+n,totalStudents:a,totalTeachers:n,atRiskStudents:i,achievementsUnlocked:m,totalXPEarned:l,activeStreaks:o,aiTutorSessions:N,totalQuizzesTaken:v,avgQuizScore:h}}catch(s){return console.error("[adminService] getAnalyticsSummary error:",s),{totalActiveUsers:0,totalStudents:0,totalTeachers:0,atRiskStudents:0,achievementsUnlocked:0,totalXPEarned:0,activeStreaks:0,aiTutorSessions:0,totalQuizzesTaken:0,avgQuizScore:0}}}const tl=[10,25,50,100],ts=({title:s,value:a,subtitle:n,icon:i,variant:l})=>{const o={blue:"bg-[#5154E7] shadow-blue-200/50",purple:"bg-[#9956DE] shadow-purple-200/50",rose:"bg-[#F43F5E] shadow-rose-200/50",emerald:"bg-[#10B981] shadow-emerald-200/50"};return e.jsxs("div",{className:`relative overflow-hidden rounded-[24px] p-5 text-white shadow-lg transition-all hover:scale-[1.02] ${o[l]}`,children:[e.jsx("div",{className:"absolute -right-4 -top-4 opacity-10",children:e.jsx(i,{size:100})}),e.jsx("div",{className:"absolute right-4 top-4 w-8 h-8 rounded-full bg-white/20 flex items-center justify-center",children:e.jsx(i,{size:16})}),e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] opacity-80",children:s}),e.jsx("h3",{className:"text-2xl font-black mt-2 leading-none",children:a}),e.jsx("p",{className:"text-[10px] font-bold mt-4 opacity-70 uppercase tracking-widest",children:n}),e.jsx("div",{className:"absolute -bottom-8 -left-8 w-20 h-20 bg-white/10 rounded-full blur-2xl"})]})},al=()=>{const{userProfile:s,loading:a}=cs(),[n,i]=r.useState([]),[l,o]=r.useState(!0),[g,m]=r.useState(!1),[N,v]=r.useState(""),[h,c]=r.useState("All Categories"),[x,f]=r.useState("All Severities"),[w,A]=r.useState("All Roles"),[u,y]=r.useState(null),[D,T]=r.useState(1),[q,me]=r.useState(25),he=r.useCallback(async()=>{if(a||!s)return;const d=String(s.role||"").toLowerCase();if(d!=="admin"&&d!=="teacher"){o(!1),m(!0);return}m(!1),o(!0);try{const ae=await Et();i(ae)}catch{S.error("Failed to load audit logs")}finally{o(!1)}},[a,s]);r.useEffect(()=>{he()},[he]);const Ne=n.filter(d=>d.severity==="Info").length;n.filter(d=>d.severity==="Warning").length;const _=n.filter(d=>d.severity==="Error"||d.severity==="Critical").length,pe=d=>{switch(d){case"Info":return e.jsx(wt,{size:14});case"Warning":return e.jsx(xt,{size:14});case"Error":return e.jsx(Ks,{size:14});case"Critical":return e.jsx(Re,{size:14});default:return e.jsx(_e,{size:14})}},X=d=>{switch(d){case"Info":return"bg-sky-50 text-sky-600 border-sky-100";case"Warning":return"bg-amber-50 text-amber-600 border-amber-100";case"Error":return"bg-rose-50 text-rose-600 border-rose-100";case"Critical":return"bg-red-50 text-red-600 border-red-100 ring-1 ring-red-500";default:return"bg-slate-50 text-slate-600 border-slate-100"}},Q={"All Categories":"All Categories",Auth:"Authentication",Data:"Data Operations",User:"User Management",System:"System Engine",Content:"Content Pipeline"},U={"All Severities":"All Severities",Info:"Information",Warning:"Warning",Error:"Error",Critical:"Critical"},te={"All Roles":"All Roles",Admin:"Administrator",Teacher:"Educator",Student:"Student"},O=r.useMemo(()=>n.filter(d=>{const ae=d.action.toLowerCase().includes(N.toLowerCase())||d.details.toLowerCase().includes(N.toLowerCase())||d.user.name.toLowerCase().includes(N.toLowerCase()),p=h==="All Categories"||d.category===h,P=x==="All Severities"||d.severity===x,H=w==="All Roles"||d.user.role===w;return ae&&p&&P&&H}),[n,N,h,x,w]),K=Math.max(Math.ceil(O.length/q),1),ne=r.useMemo(()=>{const d=(D-1)*q;return O.slice(d,d+q)},[O,D,q]);if(r.useEffect(()=>{T(1)},[N,h,x,w]),g)return e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-center p-8 bg-white rounded-[32px] border border-slate-200 mt-8",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-rose-50 flex items-center justify-center mb-6",children:e.jsx(dt,{size:40,className:"text-rose-500"})}),e.jsx("h3",{className:"text-2xl font-black text-[#1e293b]",children:"Access Denied"}),e.jsx("p",{className:"text-slate-400 font-medium max-w-md mx-auto mt-2 uppercase text-[11px] tracking-widest",children:"Security policy restricts audit log visibility to administrative personnel only."})]});const B=O.length===0?0:(D-1)*q+1,ce=Math.min(D*q,O.length);return e.jsxs("div",{className:"flex flex-col min-h-full animate-in fade-in duration-500",children:[e.jsxs("div",{className:"flex-1 space-y-8 pt-6 xl:pt-8 pb-6 px-1 max-w-[1600px] mx-auto w-full",children:[e.jsxs("div",{className:"flex items-center justify-between px-2 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-1.5 h-6 bg-[#9956DE] rounded-full"}),e.jsx("p",{className:"text-[11px] font-black text-slate-400 uppercase tracking-[0.2em]",children:"System Governance Pipeline"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:he,disabled:l,className:"p-2.5 rounded-xl bg-white border border-slate-200 text-slate-400 hover:text-purple-600 shadow-sm transition-all active:scale-95 group",title:"Synchronize logs",children:e.jsx(Me,{size:14,className:l?"animate-spin":"group-hover:rotate-180 transition-transform duration-500"})}),e.jsxs("button",{disabled:!0,className:"flex items-center gap-2 px-4 py-2 bg-white border border-slate-200 text-slate-400 rounded-xl text-[10px] font-black uppercase tracking-widest opacity-60 cursor-not-allowed",children:[e.jsx(Ps,{size:14})," Export Logs"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 shrink-0",children:[e.jsx(ts,{title:"Total Events",value:l?"...":n.length,subtitle:"System-Wide Logs",icon:Ce,variant:"purple"}),e.jsx(ts,{title:"Security Alerts",value:l?"...":_,subtitle:"Critical Incidents",icon:Ks,variant:"rose"}),e.jsx(ts,{title:"Operational Info",value:l?"...":Ne,subtitle:"Routine Pipelines",icon:qe,variant:"blue"}),e.jsx(ts,{title:"System Health",value:_>0?"Compromised":"Healthy",subtitle:"Live Monitoring",icon:zs,variant:_>0?"rose":"emerald"})]})]}),e.jsx("div",{className:"sticky top-0 z-40 -mx-[24px] xl:-mx-[32px] px-[24px] xl:px-[32px] pt-4 pb-4 bg-[#f8fafc] backdrop-blur-sm",children:e.jsxs("div",{className:"flex flex-col xl:flex-row items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 w-full group",children:[e.jsx(bt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-[#9956DE] transition-colors",size:16}),e.jsx(xe,{type:"text",placeholder:"Trace user identity, action strings, or operation details...",className:"pl-11 h-12 bg-white border-slate-200/60 rounded-2xl focus-visible:ring-[#9956DE]/20 focus-visible:border-[#9956DE] transition-all text-sm font-medium shadow-md shadow-slate-200/40",value:N,onChange:d=>v(d.target.value)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 w-full xl:w-auto",children:[e.jsxs(J,{value:h,onValueChange:c,children:[e.jsx(ee,{className:"w-[200px] bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 rounded-xl h-12 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:Q[h]||h})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Categories",className:"font-bold",children:"All Categories"}),e.jsx(C,{value:"Auth",className:"font-bold",children:"Authentication"}),e.jsx(C,{value:"Data",className:"font-bold",children:"Data Operations"}),e.jsx(C,{value:"User",className:"font-bold",children:"User Management"}),e.jsx(C,{value:"System",className:"font-bold",children:"System Engine"}),e.jsx(C,{value:"Content",className:"font-bold",children:"Content Pipeline"})]})]}),e.jsxs(J,{value:x,onValueChange:f,children:[e.jsx(ee,{className:"w-[200px] bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 rounded-xl h-12 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:U[x]||x})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Severities",className:"font-bold",children:"All Severities"}),e.jsx(C,{value:"Info",className:"font-bold",children:"Information"}),e.jsx(C,{value:"Warning",className:"font-bold",children:"Warning"}),e.jsx(C,{value:"Error",className:"font-bold",children:"Error"}),e.jsx(C,{value:"Critical",className:"font-bold",children:"Critical"})]})]}),e.jsxs(J,{value:w,onValueChange:A,children:[e.jsx(ee,{className:"w-[200px] bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 rounded-xl h-12 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:te[w]||w})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Roles",className:"font-bold",children:"All Roles"}),e.jsx(C,{value:"Admin",className:"font-bold",children:"Administrator"}),e.jsx(C,{value:"Teacher",className:"font-bold",children:"Educator"}),e.jsx(C,{value:"Student",className:"font-bold",children:"Student"})]})]}),e.jsx(E,{variant:"outline",size:"icon",onClick:()=>{v(""),c("All Categories"),f("All Severities"),A("All Roles")},disabled:!N&&h==="All Categories"&&x==="All Severities"&&w==="All Roles",className:"h-12 w-12 rounded-2xl border-slate-200/60 text-[#9956DE] hover:bg-purple-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all shadow-sm",title:"Reset Filters",children:e.jsx(yt,{size:18})})]})]})}),e.jsx("div",{className:"bg-white rounded-[32px] border border-slate-200/60 shadow-sm shadow-slate-200/40 relative",children:e.jsx("div",{className:"rounded-[32px]",children:e.jsxs("table",{className:"w-full text-left border-collapse min-w-[1000px]",children:[e.jsx("thead",{className:"sticky top-[80px] z-30 bg-[#f8fafc] backdrop-blur-sm shadow-[0_-12px_0_0_#f8fafc]",children:e.jsxs("tr",{className:"border-b border-[#8b5cf6]",children:[e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest whitespace-nowrap rounded-tl-[20px]",children:"Incident Level"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest whitespace-nowrap",children:"Timestamp"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"User Actor"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Action Performed"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Component"}),e.jsx("th",{className:"bg-[#9956DE] px-8 py-5 text-[11px] font-black text-white uppercase tracking-widest text-right whitespace-nowrap rounded-tr-[20px]",children:"Review"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:l?Array(10).fill(0).map((d,ae)=>e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"h-20 p-8",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-slate-50 animate-pulse"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"w-32 h-3 bg-slate-50 animate-pulse rounded"}),e.jsx("div",{className:"w-48 h-2 bg-slate-50 animate-pulse rounded"})]})]})})},ae)):ne.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"h-64 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx(As,{size:48,className:"text-slate-100 mb-4"}),e.jsx("p",{className:"text-[16px] font-black text-[#1e293b]",children:"No audit trails captured"}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Try adjusting your tracking filters"})]})})}):ne.map(d=>e.jsxs("tr",{className:"group hover:bg-purple-50/20 transition-colors",children:[e.jsx("td",{className:"px-8 py-5",children:e.jsxs("span",{className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-[9px] font-black uppercase tracking-wider border ${X(d.severity)}`,children:[pe(d.severity),d.severity]})}),e.jsx("td",{className:"px-8 py-5",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-50 flex items-center justify-center text-slate-400",children:e.jsx(Rs,{size:14})}),e.jsx("span",{className:"text-[13px] font-bold text-[#1e293b]",children:d.timestamp})]})}),e.jsx("td",{className:"px-8 py-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-full bg-slate-50 border border-slate-100 flex items-center justify-center overflow-hidden shrink-0",children:d.user.avatar?e.jsx("img",{src:d.user.avatar,alt:d.user.name,className:"w-full h-full object-cover"}):e.jsx(As,{size:16,className:"text-slate-300"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-black text-[#1e293b] leading-none group-hover:text-[#9956DE] transition-colors truncate",children:d.user.name||"SYSTEM"}),e.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-tighter mt-1",children:d.user.role||"System"})]})]})}),e.jsxs("td",{className:"px-8 py-5",children:[e.jsx("p",{className:"text-sm font-bold text-[#1e293b] truncate max-w-[250px]",title:d.details,children:d.action}),e.jsx("p",{className:"text-[10px] text-slate-400 font-medium truncate max-w-[250px] mt-0.5",children:d.details})]}),e.jsx("td",{className:"px-8 py-5",children:e.jsx("span",{className:"text-[10px] font-black px-2.5 py-1 rounded-lg bg-slate-50 text-slate-600 border border-slate-100 uppercase tracking-widest",children:d.category})}),e.jsx("td",{className:"px-8 py-5 text-right",children:e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:()=>y(d),className:"w-9 h-9 rounded-xl border border-slate-200 flex items-center justify-center text-slate-400 hover:text-[#9956DE] hover:border-[#9956DE]/30 hover:bg-purple-50 transition-all ",children:e.jsx(ft,{size:16})})})})]},d.id))})]})})}),e.jsxs("div",{className:"sticky bottom-0 z-50 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 px-12 py-3 bg-white border-t-2 border-slate-100 shadow-[0_-8px_30px_rgba(0,0,0,0.08)] -mx-[24px] xl:-mx-[32px] w-[calc(100%+48px)] xl:w-[calc(100%+64px)]",children:[e.jsxs("p",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-4",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-[#9956DE] animate-pulse shadow-[0_0_12px_rgba(153,86,222,0.6)]"}),"Showing ",e.jsxs("span",{className:"text-slate-900 font-black border-b-2 border-[#9956DE]/40 pb-0.5",children:[B,"–",ce]}),e.jsx("span",{className:"text-slate-300 font-bold mx-1",children:"/"}),e.jsx("span",{className:"text-slate-900 font-black border-b-2 border-[#9956DE]/40 pb-0.5",children:O.length}),e.jsx("span",{className:"text-slate-400 ml-1",children:"Total System Records"})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs(J,{value:String(q),onValueChange:d=>{me(Number(d)),T(1)},children:[e.jsx(ee,{className:"h-10 w-[140px] bg-white border border-slate-300 text-[11px] font-black uppercase tracking-wider text-slate-900 rounded-xl hover:border-[#9956DE] transition-all px-4 shadow-sm",children:e.jsxs("span",{className:"truncate",children:[q," / Page"]})}),e.jsx(se,{className:"rounded-xl border-slate-200",children:tl.map(d=>e.jsxs(C,{value:String(d),className:"font-bold",children:[d," / Page"]},d))})]}),e.jsxs("div",{className:"flex items-center gap-2 bg-slate-50 p-1.5 rounded-2xl border border-slate-200 shadow-inner",children:[e.jsx(E,{variant:"outline",size:"sm",className:"h-9 w-9 p-0 rounded-xl bg-[#9956DE] border-none text-white hover:bg-[#8b5cf6] hover:scale-105 active:scale-95 disabled:opacity-30 transition-all shadow-lg shadow-purple-200/60",disabled:D<=1||l,onClick:()=>T(d=>Math.max(d-1,1)),children:e.jsx(jt,{size:18,strokeWidth:3})}),e.jsx("div",{className:"px-5 py-2 bg-white rounded-xl shadow-sm border border-slate-200 flex items-center justify-center min-w-[130px]",children:e.jsxs("span",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:["Page ",e.jsx("span",{className:"text-[#9956DE] mx-1",children:D}),e.jsx("span",{className:"text-slate-300 mx-1",children:"OF"}),e.jsx("span",{className:"text-slate-500",children:Math.max(K,1)})]})}),e.jsx(E,{variant:"outline",size:"sm",className:"h-9 w-9 p-0 rounded-xl bg-[#9956DE] border-none text-white hover:bg-[#8b5cf6] hover:scale-105 active:scale-95 disabled:opacity-30 transition-all shadow-lg shadow-purple-200/60",disabled:D>=K||l,onClick:()=>T(d=>Math.min(d+1,K||1)),children:e.jsx(vt,{size:18,strokeWidth:3})})]})]})]}),e.jsx(ht,{open:!!u,onOpenChange:d=>{d||y(null)},children:e.jsxs(pt,{className:"sm:max-w-[600px] rounded-[32px] border-none shadow-2xl p-0 overflow-hidden",children:[e.jsx("div",{className:`h-2 w-full ${u?X(u.severity).split(" ")[0].replace("bg-","bg-").replace("-50","-500"):"bg-purple-600"}`}),e.jsxs("div",{className:"p-8 space-y-6",children:[e.jsx(ut,{className:"text-left",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-slate-50 flex items-center justify-center text-[#9956DE] border border-slate-100",children:e.jsx(zs,{size:24})}),e.jsxs("div",{children:[e.jsx(gt,{className:"text-xl font-black text-[#1e293b] leading-tight",children:u?.action||"Audit Event Details"}),e.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] mt-1",children:"Platform Operational Integrity Trail"})]})]})}),u&&e.jsxs("div",{className:"grid grid-cols-2 gap-6 bg-slate-50/50 p-6 rounded-2xl border border-slate-100",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Incident Severity"}),e.jsx("p",{className:"text-sm font-black text-[#1e293b]",children:u.severity})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Timestamp"}),e.jsx("p",{className:"text-sm font-black text-[#1e293b]",children:u.timestamp})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Component"}),e.jsx("p",{className:"text-sm font-black text-[#1e293b]",children:u.category})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"User Actor"}),e.jsx("p",{className:"text-sm font-black text-[#1e293b]",children:u?.user.name})]}),e.jsxs("div",{className:"col-span-2 space-y-1 mt-2",children:[e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Full Operation Details"}),e.jsx("p",{className:"text-sm font-medium text-[#1e293b] leading-relaxed bg-white p-4 rounded-xl border border-slate-100",children:u.details})]})]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx(E,{onClick:()=>y(null),className:"bg-[#9956DE] hover:bg-[#8b5cf6] text-white rounded-xl px-8 font-black uppercase text-[11px] tracking-widest shadow-lg shadow-purple-100 transition-all",children:"Dismiss Review"})})]})]})})]})},ll=()=>{const[s,a]=r.useState([]),[n,i]=r.useState(0),[l,o]=r.useState(!0),[g,m]=r.useState(null),[N,v]=r.useState(!1),h=r.useCallback(async()=>{o(!0);try{const u=await De("/api/rag/documents");a(u.documents),i(u.total_chunks)}catch(u){console.error("Failed to fetch RAG documents:",u),S.error("Failed to load RAG inventory")}finally{o(!1)}},[]);r.useEffect(()=>{h()},[h]);const c=Ss.useMemo(()=>{const u=new Map;for(const y of s){const D=u.get(y.subject)||[];D.push(y),u.set(y.subject,D)}return Array.from(u.entries()).map(([y,D])=>({subject:y,files:D,totalChunks:D.reduce((T,q)=>T+q.chunk_count,0)}))},[s]),x=async u=>{m(`subject:${u}`);try{const y=await De(`/api/rag/documents/by-subject/${encodeURIComponent(u)}`,{method:"DELETE"});S.success(y.message),await h()}catch(y){S.error(`Failed to delete subject: ${y}`)}finally{m(null)}},f=async u=>{m(`source:${u}`);try{const y=await De(`/api/rag/documents/by-source?source_file=${encodeURIComponent(u)}`,{method:"DELETE"});S.success(y.message),await h()}catch(y){S.error(`Failed to delete source: ${y}`)}finally{m(null)}},w=async()=>{m("purge");try{const u=await De("/api/rag/documents/all",{method:"DELETE"});S.success(u.message),v(!1),await h()}catch(u){S.error(`Purge failed: ${u}`)}finally{m(null)}},A=async()=>{m("reingest");try{await De("/api/admin/reingest-pdf",{method:"POST",body:JSON.stringify({})}),S.success("Re-ingestion triggered. This may take a few minutes."),setTimeout(h,5e3)}catch(u){S.error(`Re-ingestion failed: ${u}`)}finally{m(null)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-100 flex items-center justify-center",children:e.jsx(fe,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-slate-800",children:"RAG Pipeline Manager"}),e.jsx("p",{className:"text-sm text-slate-500",children:"Manage vectorstore content and uploaded files"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"px-4 py-2 bg-indigo-50 rounded-xl text-center",children:[e.jsx("p",{className:"text-xl font-bold text-indigo-600",children:n}),e.jsx("p",{className:"text-[10px] font-bold text-indigo-400 uppercase",children:"Total Chunks"})]}),e.jsxs("div",{className:"px-4 py-2 bg-emerald-50 rounded-xl text-center",children:[e.jsx("p",{className:"text-xl font-bold text-emerald-600",children:c.length}),e.jsx("p",{className:"text-[10px] font-bold text-emerald-400 uppercase",children:"Subjects"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-4 bg-slate-50 rounded-2xl border border-slate-200",children:[e.jsxs(E,{onClick:h,disabled:l,variant:"outline",className:"gap-2",children:[e.jsx(Me,{size:14,className:l?"animate-spin":""}),"Refresh"]}),e.jsxs(E,{onClick:A,disabled:!!g,variant:"outline",className:"gap-2",children:[g==="reingest"?e.jsx(V,{size:14,className:"animate-spin"}):e.jsx(Me,{size:14}),"Re-ingest All PDFs"]}),e.jsx("div",{className:"flex-1"}),N?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-red-600 font-medium flex items-center gap-1",children:[e.jsx(xt,{size:14})," This will delete ALL RAG content"]}),e.jsxs(E,{onClick:w,disabled:g==="purge",className:"bg-red-600 hover:bg-red-700 text-white gap-2",children:[g==="purge"?e.jsx(V,{size:14,className:"animate-spin"}):e.jsx(je,{size:14}),"Confirm Purge"]}),e.jsx(E,{onClick:()=>v(!1),variant:"outline",children:"Cancel"})]}):e.jsxs(E,{onClick:()=>v(!0),variant:"outline",className:"gap-2 text-red-600 border-red-200 hover:bg-red-50",children:[e.jsx(je,{size:14}),"Purge All"]})]}),l?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(V,{size:32,className:"animate-spin text-indigo-500"})}):c.length===0?e.jsxs("div",{className:"text-center py-16 text-slate-500",children:[e.jsx(fe,{size:48,className:"mx-auto mb-3 text-slate-300"}),e.jsx("p",{className:"font-medium",children:"No RAG content found"}),e.jsx("p",{className:"text-sm",children:"Upload PDFs via the Content tab or trigger re-ingestion"})]}):e.jsx("div",{className:"space-y-4",children:c.map(u=>e.jsxs(re.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-white rounded-2xl border border-slate-200 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 bg-slate-50 border-b border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-100 flex items-center justify-center",children:e.jsx(Ce,{size:16,className:"text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-800 capitalize",children:u.subject.replace(/_/g," ")}),e.jsxs("p",{className:"text-xs text-slate-500",children:[u.totalChunks," chunks • ",u.files.length," source file",u.files.length!==1?"s":""]})]})]}),e.jsxs(E,{onClick:()=>x(u.subject),disabled:!!g,variant:"outline",className:"gap-2 text-red-600 border-red-200 hover:bg-red-50 text-xs h-8",children:[g===`subject:${u.subject}`?e.jsx(V,{size:12,className:"animate-spin"}):e.jsx(je,{size:12}),"Remove Subject"]})]}),e.jsx("div",{className:"divide-y divide-slate-100",children:u.files.map(y=>e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 hover:bg-slate-50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ce,{size:14,className:"text-slate-400"}),e.jsx("span",{className:"text-sm text-slate-700 font-medium truncate max-w-[400px]",children:y.source_file}),e.jsxs("span",{className:"text-xs text-slate-400 bg-slate-100 px-2 py-0.5 rounded-full",children:[y.chunk_count," chunks"]})]}),e.jsx("button",{onClick:()=>f(y.source_file),disabled:!!g,className:"p-1.5 rounded-lg text-slate-400 hover:text-red-500 hover:bg-red-50 transition-colors disabled:opacity-50",children:g===`source:${y.source_file}`?e.jsx(V,{size:14,className:"animate-spin"}):e.jsx(je,{size:14})})]},y.source_file))})]},u.subject))})]})};function as({className:s,...a}){return e.jsx(ia,{"data-slot":"checkbox",className:Te("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:e.jsx(na,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:e.jsx(ca,{className:"size-3.5"})})})}const rl=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,il=/[A-Z]/,nl=/[a-z]/,cl=/\d/,ol=/[^A-Za-z0-9]/;function dl(s){const a={};s.name.trim()||(a.name="Name is required.");const n=s.email.trim().toLowerCase();n?rl.test(n)||(a.email="Enter a valid email address."):a.email="Email is required.";const i=s.password;return i.length<8?a.password="Password must be at least 8 characters.":il.test(i)?nl.test(i)?cl.test(i)?ol.test(i)||(a.password="Password must include at least one special character."):a.password="Password must include at least one number.":a.password="Password must include at least one lowercase letter.":a.password="Password must include at least one uppercase letter.",s.confirmPassword?s.confirmPassword!==i&&(a.confirmPassword="Passwords do not match."):a.confirmPassword="Confirm password is required.",s.role.trim()||(a.role="Role is required."),s.status.trim()||(a.status="Status is required."),s.grade.trim()||(a.grade="Grade is required."),s.section.trim()||(a.section="Section is required."),s.role.trim().toLowerCase()==="student"&&!s.lrn.trim()&&(a.lrn="LRN is required for student accounts."),a}function xl(s){return Object.values(s).find(n=>!!n)??null}const at=(s="Student")=>({name:"",email:"",password:"",confirmPassword:"",role:s,status:"Active",department:s==="Teacher"?"Mathematics":s==="Admin"?"System":"",grade:"",section:"",lrn:""}),ml=["10","25","50","100"];function ks(s,a){const n=s.trim();if(!(!n||n===a))return n}function lt(s){const a=String(s??"");return/[",\n]/.test(a)?`"${a.replace(/"/g,'""')}"`:a}const hl=({createIntentRole:s=null,onCreateIntentConsumed:a})=>{const{userProfile:n}=cs(),[i,l]=r.useState([]),[o,g]=r.useState(!0),[m,N]=r.useState(null),[v,h]=r.useState(!1),[c,x]=r.useState(!1),[f,w]=r.useState(null),[A,u]=r.useState(1),[y,D]=r.useState(25),[T,q]=r.useState(0),[me,he]=r.useState(1),[Ne,_]=r.useState(!1),[pe,X]=r.useState(""),[Q,U]=r.useState("All Roles"),[te,O]=r.useState("All Status"),[K,ne]=r.useState("All Sections"),[B,ce]=r.useState(new Set),[d,ae]=r.useState(!1),[p,P]=r.useState(new Set),[H,Y]=r.useState({}),[G,Qe]=r.useState("Student"),[Oe,k]=r.useState("Active"),[$,oe]=r.useState("Grade 11"),[Ae,Ts]=r.useState(""),[ds,Ee]=r.useState(!1),[xs,Be]=r.useState(!1),[$e,Xe]=r.useState(!1),[le,ms]=r.useState(null),[W,$s]=r.useState(null),[hs,Ke]=r.useState({}),[ps,Ye]=r.useState(!1),[Cl,us]=r.useState(!1),[j,de]=r.useState(at()),I=r.useMemo(()=>({search:pe.trim()||void 0,role:ks(Q,"All Roles"),status:ks(te,"All Status"),section:ks(K,"All Sections")}),[pe,Q,te,K]),ue=r.useCallback(()=>{ce(new Set),ae(!1),P(new Set)},[]),Ze=r.useCallback(t=>d?!p.has(t):B.has(t),[d,p,B]),Z=r.useMemo(()=>d?Math.max(T-p.size,0):B.size,[d,p,B,T]),Ls=r.useMemo(()=>i.length===0?!1:i.every(t=>Ze(t.id)),[i,Ze]),be=r.useMemo(()=>d?[]:Array.from(B).map(t=>H[t]).filter(t=>!!t),[d,B,H]);r.useMemo(()=>Z===0?!1:d?!I.role||I.role.toLowerCase()==="student":be.length!==B.size?!1:be.every(t=>t.role==="Student"),[d,Z,be,B.size,I.role]),r.useMemo(()=>Z===0?!1:d?I.status?.toLowerCase()!=="active":be.length!==B.size?!1:be.some(t=>t.status!=="Active"),[d,Z,be,B.size,I.status]),r.useMemo(()=>Z===0?!1:d?I.status?.toLowerCase()!=="inactive":be.length!==B.size?!1:be.some(t=>t.status!=="Inactive"),[d,Z,be,B.size,I.status]);const ye=r.useCallback(async t=>{g(!0),N(null);try{const b=await qa({page:t,pageSize:y,searchQuery:I.search,roleFilter:I.role,statusFilter:I.status});l(b.users),u(b.total===0?1:b.page),q(b.total),he(b.totalPages||1),_(b.hasNextPage),Y(R=>{const ke={...R};return b.users.forEach(z=>{ke[z.id]=z}),ke})}catch(b){const R=b instanceof Error?b.message:"Failed to load users";N(R),S.error(R)}finally{g(!1)}},[y,I.search,I.role,I.status]);r.useEffect(()=>{ye(A)},[ye,A]);const Us=r.useMemo(()=>{const t=new Set;return i.forEach(b=>{b.section&&t.add(b.section)}),Array.from(t).sort()},[i]),gs=r.useMemo(()=>I.section?i.filter(t=>t.section===I.section):i,[i,I.section]),bs=r.useCallback((t="Student")=>{$s(null),Ke({}),Ye(!1),us(!1),de(at(t)),Ee(!0)},[]);r.useEffect(()=>{s&&(bs(s),a?.())},[s,bs,a]);const Is=r.useCallback(t=>{if(d){P(b=>{const R=new Set(b);return R.has(t)?R.delete(t):R.add(t),R});return}ce(b=>{const R=new Set(b);return R.has(t)?R.delete(t):R.add(t),R})},[d]),Fs=r.useCallback(()=>{if(i.length===0)return;const t=gs.map(b=>b.id);if(d){P(b=>{const R=new Set(b);return t.every(z=>!R.has(z))?t.forEach(z=>R.add(z)):t.forEach(z=>R.delete(z)),R});return}ce(b=>{const R=new Set(b);return t.every(z=>R.has(z))?t.forEach(z=>R.delete(z)):t.forEach(z=>R.add(z)),R})},[i,d]),zt=r.useCallback(()=>{ae(!0),ce(new Set),P(new Set)},[]),_s=r.useCallback(t=>{if(!t.length){S.info("No rows were returned for export.");return}const b=Array.from(t.reduce((Je,vs)=>(Object.keys(vs).forEach(Ft=>Je.add(Ft)),Je),new Set)),R=[b.map(lt).join(","),...t.map(Je=>b.map(vs=>lt(Je[vs])).join(","))].join(` +`),ke=new Blob([R],{type:"text/csv;charset=utf-8;"}),z=URL.createObjectURL(ke),js=document.createElement("a");js.href=z,js.download=`admin-users-export-${Date.now()}.csv`,js.click(),URL.revokeObjectURL(z)},[]),ze=r.useCallback(async(t,b)=>{const R=b.userIds,ke={...I.search?{search:I.search}:{},...I.role?{role:I.role}:{},...I.status?{status:I.status}:{}};if(!R&&Z===0){S.error("Select at least one user before applying a bulk action.");return}x(!0);try{const z=await Va({action:t,...R?{userIds:R}:d?{userIds:[],excludeUserIds:Array.from(p),filters:ke}:{userIds:Array.from(B)},...b.role?{role:b.role}:{},...b.status?{status:b.status}:{},...b.grade?{grade:b.grade}:{},...b.section?{section:b.section}:{},...b.exportFormat?{exportFormat:b.exportFormat}:{}});t==="export"&&_s(z.exportRows),z.summary.failed>0?S.warning(`Completed with partial failures. ${z.summary.succeeded} succeeded, ${z.summary.failed} failed, ${z.summary.skipped} skipped.`):z.summary.succeeded===0&&z.summary.targeted>0?S.error(z.summary.skipped>0?`Action skipped for ${z.summary.skipped} user(s).`:"Action could not be completed. No users were updated."):S.success(`Action completed. ${z.summary.succeeded} user(s) updated.`),z.warnings.length>0&&S.info(z.warnings[0]);try{await ys(b.auditAction,"User",t==="delete"||t==="deactivate"?"Warning":"Info",`${b.auditDetail}; targeted=${z.summary.targeted}, succeeded=${z.summary.succeeded}, failed=${z.summary.failed}, skipped=${z.summary.skipped}`,{name:n?.name||"Admin",role:"Admin",avatar:n?.photo||null})}catch{}b.skipSelectionReset||ue(),await ye(A)}catch(z){S.error(z instanceof Error?z.message:"Bulk action failed")}finally{x(!1)}},[I.search,I.role,I.status,d,p,B,Z,n?.name,n?.photo,ue,ye,A,_s]),fs=r.useCallback(t=>{ms(t),Be(!0)},[]),Dt=r.useCallback(async()=>{if(!(!le||$e)){Xe(!0);try{await ze(le.action,{...le.params||{},auditAction:le.auditAction,auditDetail:le.auditDetail}),Be(!1),ms(null)}finally{Xe(!1)}}},[le,$e,ze]),Os=t=>{$s(t),Ke({}),Ye(!1),us(!1),de({name:t.name,email:t.email,password:"",confirmPassword:"",role:t.role,status:t.status,department:t.department,grade:t.grade||"Grade 11",section:t.section||"",lrn:t.lrn||""}),Ee(!0)},Pt=async()=>{if(!j.name.trim()||!j.email.trim()){S.error("Name and email are required");return}if(!W){const t=dl({name:j.name,email:j.email,password:j.password,confirmPassword:j.confirmPassword,role:j.role,status:j.status,grade:j.grade,section:j.section,lrn:j.lrn}),b=xl(t);if(b){Ke(t),S.error(b);return}}h(!0);try{if(W){const t={name:j.name,role:j.role,status:j.status,grade:j.grade,section:j.section,lrn:j.role==="Student"?j.lrn:void 0};j.role!=="Student"&&(t.department=j.department),await Ha(W.id,t),await ys("User Updated","User","Info",`Updated user: ${j.name} (${W.email})`,{name:n?.name||"Admin",role:"Admin",avatar:n?.photo||null}),S.success("User updated successfully")}else{const t=await Wa({email:j.email,name:j.name,password:j.password,confirmPassword:j.confirmPassword,role:j.role,status:j.status,grade:j.grade,section:j.section,lrn:j.role==="Student"?j.lrn:void 0});await ys("Created New User","User","Info",`Created new ${j.role.toLowerCase()} account: ${j.name} (${j.email}), emailSent=${t.emailSent}`,{name:n?.name||"Admin",role:"Admin",avatar:n?.photo||null}),t.emailSent?S.success("User created and welcome email sent"):(S.warning("User created, but welcome email failed to send"),t.emailError?.message&&S.error(t.emailError.message))}W?await ye(A):(ue(),u(1),await ye(1)),Ee(!1),Ye(!1),us(!1)}finally{h(!1)}},Bs=(t,b)=>{fs({title:"Delete User?",message:`Delete user "${b}"? This cannot be undone.`,confirmText:"Delete",action:"delete",params:{userIds:[t]},auditAction:"User Deleted",auditDetail:`Deleted user account: ${b}`})},Gs=async t=>{if(f||c)return;if(t.status==="Active"){fs({title:"Deactivate User?",message:`Deactivate "${t.name}"? They will lose access until reactivated.`,confirmText:"Deactivate",action:"deactivate",params:{userIds:[t.id]},auditAction:"User Status Changed",auditDetail:`Deactivated user: ${t.email}`});return}w(t.id);try{await ze("activate",{userIds:[t.id],auditAction:"User Status Changed",auditDetail:`Activated user: ${t.email}`,skipSelectionReset:!0})}finally{w(null)}},Rt=async()=>{await ze("change_role",{role:G,auditAction:"Bulk Role Update",auditDetail:`Updated selected users to role ${G}`})},Mt=async()=>{await ze("change_status",{status:Oe,auditAction:"Bulk Status Update",auditDetail:`Updated selected users to status ${Oe}`})},Tt=async()=>{await ze("reset_password_email",{auditAction:"Bulk Password Reset",auditDetail:"Sent password reset emails to selected users"})},$t=async()=>{await ze("export",{exportFormat:"csv",auditAction:"Bulk Export Users",auditDetail:"Exported selected users"})},Lt=()=>{fs({title:"Delete Selected Users?",message:`Delete ${Z} selected user(s)? This action cannot be undone.`,confirmText:"Delete Users",action:"delete",auditAction:"Bulk User Deletion",auditDetail:`Deleted ${Z} selected users`})};i.filter(t=>t.status==="Active").length,i.filter(t=>t.role==="Admin").length,i.filter(t=>t.role==="Teacher").length,i.filter(t=>t.role==="Student").length;const Ut=T===0?0:(A-1)*y+1,It=T===0?0:Math.min(A*y,T);return e.jsxs("div",{className:"flex flex-col animate-in fade-in duration-500",children:[e.jsx("div",{className:"space-y-8 pt-6 xl:pt-8 pb-6 px-1",children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-5 gap-4",children:o&&i.length===0?Array.from({length:5}).map((t,b)=>e.jsxs("div",{className:"bg-white p-5 rounded-[28px] border border-slate-200/60 shadow-sm shadow-slate-200/50 animate-pulse",children:[e.jsx("div",{className:"h-4 w-20 bg-slate-100 rounded-full mb-3"}),e.jsx("div",{className:"h-8 w-12 bg-slate-100 rounded-lg"})]},`stats-skeleton-${b}`)):[{label:"Total Users",value:T,icon:Pe,bg:"bg-[#4f46e5]",shadow:"shadow-indigo-500/20"},{label:"Active Today",value:i.filter(t=>t.status==="Active").length,icon:qe,bg:"bg-[#10b981]",shadow:"shadow-emerald-500/20"},{label:"Admins",value:i.filter(t=>t.role==="Admin").length,icon:As,bg:"bg-[#0ea5e9]",shadow:"shadow-sky-500/20"},{label:"Teachers",value:i.filter(t=>t.role==="Teacher").length,icon:is,bg:"bg-[#8b5cf6]",shadow:"shadow-purple-500/20"},{label:"Students",value:i.filter(t=>t.role==="Student").length,icon:nt,bg:"bg-[#3b82f6]",shadow:"shadow-blue-500/20"}].map((t,b)=>e.jsxs("div",{className:`relative overflow-hidden ${t.bg} ${t.shadow} p-5 rounded-[28px] text-white flex flex-col gap-3 group hover:scale-[1.02] transition-all duration-300 shadow-lg`,children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-700 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-700 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex items-center justify-between",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] opacity-80",children:t.label}),e.jsx("div",{className:"bg-white/20 p-2 rounded-xl backdrop-blur-sm group-hover:bg-white/30 transition-colors",children:e.jsx(t.icon,{size:14})})]}),e.jsx("h3",{className:"relative z-10 text-3xl font-display font-black leading-none tracking-tight",children:t.value})]},b))})}),e.jsx("div",{className:"sticky top-0 z-40 -mx-[24px] xl:-mx-[32px] px-[24px] xl:px-[32px] pt-4 pb-4 bg-[#f8fafc] backdrop-blur-sm",children:e.jsxs("div",{className:"flex flex-col xl:flex-row items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 w-full group",children:[e.jsx(bt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-indigo-500 transition-colors",size:16}),e.jsx(xe,{placeholder:"Search by name, email, or LRN...",className:"pl-11 h-12 bg-white border-slate-200/60 rounded-2xl focus-visible:ring-indigo-500/20 focus-visible:border-indigo-500 transition-all text-sm font-medium shadow-md shadow-slate-200/40",value:pe,onChange:t=>{X(t.target.value),u(1),ue()}})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 w-full xl:w-auto",children:[e.jsxs(J,{value:Q,onValueChange:t=>{U(t),u(1),ue()},children:[e.jsx(ee,{className:"w-[180px] h-12 rounded-xl bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:Q==="All Roles"?"All Roles":Q==="Admin"?"Administrator":Q==="Teacher"?"Educator":Q})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Roles",className:"font-bold uppercase tracking-widest text-[10px]",children:"All Roles"}),e.jsx(C,{value:"Admin",className:"font-bold uppercase tracking-widest text-[10px]",children:"Administrator"}),e.jsx(C,{value:"Teacher",className:"font-bold uppercase tracking-widest text-[10px]",children:"Educator"}),e.jsx(C,{value:"Student",className:"font-bold uppercase tracking-widest text-[10px]",children:"Student"})]})]}),e.jsxs(J,{value:te,onValueChange:t=>{O(t),u(1),ue()},children:[e.jsx(ee,{className:"w-[180px] h-12 rounded-xl bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:te==="All Status"?"All Statuses":te})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Status",className:"font-bold uppercase tracking-widest text-[10px]",children:"All Statuses"}),e.jsx(C,{value:"Active",className:"font-bold uppercase tracking-widest text-[10px]",children:"Active"}),e.jsx(C,{value:"Inactive",className:"font-bold uppercase tracking-widest text-[10px]",children:"Inactive"})]})]}),Us.length>0&&e.jsxs(J,{value:K,onValueChange:t=>{ne(t),ue()},children:[e.jsx(ee,{className:"w-[180px] h-12 rounded-xl bg-white border border-slate-200 hover:border-[#9956DE] transition-all focus:ring-2 focus:ring-[#9956DE]/10 text-[10px] font-black uppercase tracking-widest text-slate-900 shadow-md shadow-slate-200/40 px-4",children:e.jsx("span",{className:"truncate",children:K==="All Sections"?"All Sections":K})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"All Sections",className:"font-bold uppercase tracking-widest text-[10px]",children:"All Sections"}),Us.map(t=>e.jsx(C,{value:t,className:"font-bold uppercase tracking-widest text-[10px]",children:t},t))]})]})]}),e.jsx(E,{variant:"outline",size:"icon",onClick:()=>{X(""),U("All Roles"),O("All Status"),ne("All Sections"),u(1),ue()},disabled:!pe&&Q==="All Roles"&&te==="All Status",className:"h-12 w-12 rounded-xl border-slate-200 text-[#9956DE] hover:bg-purple-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all shadow-md shadow-slate-200/40",title:"Reset Filters",children:e.jsx(yt,{size:18})}),e.jsx(E,{variant:"outline",size:"icon",className:"h-12 w-12 rounded-xl border-slate-200 text-slate-500 hover:bg-slate-50 transition-all shadow-md shadow-slate-200/40",onClick:()=>ye(A),disabled:o||c,children:e.jsx(Me,{size:18,className:o?"animate-spin":""})}),e.jsxs(E,{className:"h-12 gap-2 bg-[#9956DE] hover:bg-[#8b5cf6] text-white rounded-xl shadow-lg shadow-purple-200/50 transition-all px-6 font-black uppercase text-[11px] tracking-widest",onClick:()=>bs(),disabled:c,children:[e.jsx(qt,{size:18}),"Add User"]})]})}),Z>0&&e.jsxs("div",{className:"fixed bottom-16 left-1/2 -translate-x-1/2 z-[60] w-[calc(100%-4rem)] max-w-[1100px] bg-[#2d1b69] rounded-2xl p-3 flex flex-col xl:flex-row items-center gap-4 animate-in slide-in-from-bottom-2 duration-300 shadow-2xl shadow-purple-900/50",children:[e.jsxs("div",{className:"flex items-center gap-3 px-3 border-r border-white/10 pr-6",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-purple-500/30 flex items-center justify-center text-white font-black text-xs",children:Z}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black text-purple-300 uppercase tracking-widest leading-none",children:"Selected"}),e.jsx("p",{className:"text-[9px] text-white/60 font-medium mt-1",children:d?"All matching users":`${Z} users chosen`})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-white/5 p-1 rounded-xl",children:[e.jsxs(J,{value:G,onValueChange:t=>Qe(t),children:[e.jsx(ee,{className:"h-8 bg-transparent border-none text-white text-[10px] font-bold min-w-[90px] focus:ring-0",children:e.jsx(Ue,{})}),e.jsxs(se,{className:"rounded-xl",children:[e.jsx(C,{value:"Student",children:"Student"}),e.jsx(C,{value:"Teacher",children:"Teacher"}),e.jsx(C,{value:"Admin",children:"Admin"})]})]}),e.jsx(E,{size:"sm",className:"h-8 bg-purple-600 hover:bg-purple-500 text-[10px] font-black rounded-lg",onClick:()=>void Rt(),children:"Apply Role"})]}),e.jsxs("div",{className:"flex items-center gap-1 bg-white/5 p-1 rounded-xl",children:[e.jsxs(J,{value:Oe,onValueChange:t=>k(t),children:[e.jsx(ee,{className:"h-8 bg-transparent border-none text-white text-[10px] font-bold min-w-[90px] focus:ring-0",children:e.jsx(Ue,{})}),e.jsxs(se,{className:"rounded-xl",children:[e.jsx(C,{value:"Active",children:"Active"}),e.jsx(C,{value:"Inactive",children:"Inactive"})]})]}),e.jsx(E,{size:"sm",className:"h-8 bg-purple-600 hover:bg-purple-500 text-[10px] font-black rounded-lg",onClick:()=>void Mt(),children:"Set Status"})]}),e.jsx("div",{className:"h-6 w-[1px] bg-white/10 mx-1"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(E,{size:"sm",variant:"ghost",className:"h-9 text-white hover:bg-white/10 text-[10px] font-black uppercase tracking-widest gap-2",onClick:()=>void Tt(),children:[e.jsx(oa,{size:14})," Reset Pass"]}),e.jsxs(E,{size:"sm",variant:"ghost",className:"h-9 text-white hover:bg-white/10 text-[10px] font-black uppercase tracking-widest gap-2",onClick:()=>void $t(),children:[e.jsx(Ps,{size:14})," Export"]}),e.jsxs(E,{size:"sm",variant:"ghost",className:"h-9 text-rose-400 hover:bg-rose-500/10 hover:text-rose-300 text-[10px] font-black uppercase tracking-widest gap-2",onClick:Lt,children:[e.jsx(je,{size:14})," Delete"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-4 border-l border-white/10",children:[!d&&Zye(A),disabled:o||c,children:"Retry"})]}):null,e.jsxs("div",{className:"bg-white rounded-[32px] border border-slate-200/60 shadow-sm shadow-slate-200/50 relative",children:[o&&i.length>0&&e.jsx("div",{className:"absolute inset-0 bg-white/40 backdrop-blur-[1px] z-20 flex items-center justify-center",children:e.jsx(V,{className:"animate-spin text-indigo-500",size:32})}),e.jsxs("div",{className:"md:hidden divide-y divide-slate-100",children:[e.jsxs("div",{className:"px-6 py-4 bg-slate-50/50 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-3 text-[10px] font-black text-slate-400 uppercase tracking-widest cursor-pointer",children:[e.jsx(as,{checked:Ls,onCheckedChange:Fs,className:"rounded-md border-slate-300"}),"Select Page"]}),e.jsxs("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:["Page ",A," of ",me]})]}),o&&i.length===0?e.jsx("div",{className:"px-6 py-12 text-center text-slate-400 font-medium",children:"Loading users..."}):i.length>0?gs.map(t=>(t.id,e.jsxs("div",{className:"p-5 space-y-4 group hover:bg-slate-50/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center self-center",children:e.jsx(as,{checked:Ze(t.id),onCheckedChange:()=>Is(t.id),className:"rounded-md border-slate-300"})}),e.jsxs("div",{className:"relative",children:[e.jsxs(Hs,{className:"h-12 w-12 rounded-full border-2 border-white shadow-sm",children:[e.jsx(Ws,{src:t.photo||Cs(t.gender),className:"object-cover"}),e.jsx(Vs,{className:"bg-indigo-50 text-indigo-600 font-bold",children:t.name.charAt(0)})]}),e.jsx("div",{className:`absolute -bottom-1 -right-1 w-4 h-4 rounded-full border-2 border-white shadow-sm ${t.status==="Active"?"bg-emerald-500":"bg-slate-300"}`})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-black text-[#1e293b] truncate text-sm",children:t.name}),e.jsx("p",{className:"text-[11px] font-medium text-slate-400 truncate mt-0.5",children:t.email})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:`text-[9px] font-black uppercase tracking-widest px-2 py-1 rounded-lg ${t.role==="Admin"?"bg-sky-50 text-sky-600":t.role==="Teacher"?"bg-purple-50 text-purple-600":"bg-blue-50 text-blue-600"}`,children:t.role}),e.jsxs("span",{className:"text-[9px] font-black uppercase tracking-widest px-2 py-1 rounded-lg bg-slate-50 text-slate-500",children:[t.grade," • ",t.section||t.department]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(E,{variant:"outline",size:"sm",className:"flex-1 h-9 rounded-xl border-slate-200 text-slate-600 font-bold text-xs gap-2",onClick:()=>Os(t),children:[e.jsx(ss,{size:14})," Edit"]}),e.jsxs(E,{variant:"outline",size:"sm",className:`flex-1 h-9 rounded-xl border-slate-200 font-bold text-xs gap-2 ${t.status==="Active"?"text-slate-600":"text-emerald-600"}`,onClick:()=>Gs(t),disabled:f===t.id||c,children:[f===t.id?e.jsx(V,{size:14,className:"animate-spin"}):t.status==="Active"?e.jsx(st,{size:14}):e.jsx(qe,{size:14}),t.status==="Active"?"Ban":"Active"]}),e.jsx(E,{variant:"outline",size:"icon",className:"h-9 w-9 rounded-xl border-slate-200 text-rose-500 hover:bg-rose-50 hover:border-rose-100",onClick:()=>Bs(t.id,t.name),disabled:c,children:e.jsx(je,{size:14})})]})]},`mobile-${t.id}`))):e.jsxs("div",{className:"px-6 py-20 text-center space-y-4",children:[e.jsx("div",{className:"w-20 h-20 bg-slate-50 rounded-full flex items-center justify-center mx-auto",children:e.jsx(Pe,{size:32,className:"text-slate-300"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-black text-slate-600 uppercase tracking-widest text-sm",children:"No Users Found"}),e.jsx("p",{className:"text-xs text-slate-400 font-medium max-w-[200px] mx-auto leading-relaxed",children:"We couldn't find any users matching your current filters. Try adjusting your search."})]}),e.jsx(E,{variant:"outline",size:"sm",className:"rounded-xl border-slate-200 text-indigo-600 font-bold",onClick:()=>{X(""),U("All Roles"),O("All Status")},children:"Clear Filters"})]})]}),e.jsx("div",{className:"hidden md:block",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{className:"sticky top-[80px] z-30 bg-[#f8fafc] backdrop-blur-sm shadow-[0_-12px_0_0_#f8fafc]",children:e.jsxs("tr",{className:"border-b border-[#8b5cf6]",children:[e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 w-[60px] rounded-tl-[20px]",children:e.jsx(as,{checked:Ls,onCheckedChange:Fs,className:"rounded-md border-white/50 data-[state=checked]:bg-white data-[state=checked]:text-[#9956DE]"})}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"User Profile"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"Role & Access"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"Status"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"Placement"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-[11px] font-black text-white uppercase tracking-widest",children:"Activity"}),e.jsx("th",{className:"bg-[#9956DE] px-6 py-4 text-right text-[11px] font-black text-white uppercase tracking-widest rounded-tr-[20px]",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-50",children:o&&i.length===0?e.jsx("tr",{children:e.jsxs("td",{colSpan:7,className:"px-6 py-20 text-center",children:[e.jsx(V,{className:"animate-spin text-indigo-200 mx-auto",size:40}),e.jsx("p",{className:"mt-4 text-[10px] font-black text-slate-300 uppercase tracking-widest",children:"Loading Records..."})]})}):i.length>0?gs.map(t=>{const b=f===t.id;return e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[e.jsx("td",{className:"px-6 py-4 align-middle",children:e.jsx(as,{checked:Ze(t.id),onCheckedChange:()=>Is(t.id),className:"rounded-md border-slate-300 group-hover:border-indigo-400 transition-colors"})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"relative shrink-0",children:e.jsxs(Hs,{className:"h-11 w-11 rounded-full border-2 border-white shadow-sm ring-1 ring-slate-100",children:[e.jsx(Ws,{src:t.photo||Cs(t.gender),className:"object-cover"}),e.jsx(Vs,{className:"bg-indigo-50 text-indigo-600 font-bold text-sm",children:t.name.charAt(0)})]})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-black text-[#1e293b] truncate text-sm leading-tight group-hover:text-indigo-600 transition-colors",children:t.name}),e.jsx("p",{className:"text-[11px] font-medium text-slate-400 truncate mt-0.5",children:t.email})]})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsx("span",{className:` text-[9px] font-black px-2 py-0.5 rounded-lg uppercase tracking-wider ${t.role==="Admin"?"bg-sky-50 text-sky-600":""} ${t.role==="Teacher"?"bg-purple-50 text-purple-600":""} @@ -57,8 +57,8 @@ import{j as e,r as l,d as Ss}from"./vendor-react-B4AQeu28.js";import{C as it,S a `,children:t.role})}),t.lrn&&e.jsxs("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-tighter ml-0.5",children:["LRN: ",t.lrn]})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("span",{className:` inline-flex items-center gap-1.5 px-3 py-1.5 rounded-2xl text-[10px] font-black uppercase tracking-wider border ${t.status==="Active"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-slate-50 text-slate-400 border-slate-100"} - `,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t.status==="Active"?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),t.status]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{className:"text-xs font-black text-slate-600",children:t.grade||"N/A"}),e.jsx("p",{className:"text-[10px] font-medium text-slate-400",children:t.role==="Student"?t.classSection||t.section||"Unassigned":t.department})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{className:"text-[10px] font-black text-slate-600 uppercase tracking-tighter",children:t.lastLogin?"Recent Activity":"Inactive Account"}),e.jsx("p",{className:"text-[10px] font-medium text-slate-400",children:t.lastLogin||"No login history"})]})}),e.jsx("td",{className:"px-6 py-4 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(A,{variant:"ghost",size:"icon",onClick:()=>Os(t),className:"h-9 w-9 rounded-xl text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 transition-all",title:"Edit User",children:e.jsx(ss,{size:16})}),e.jsx(A,{variant:"ghost",size:"icon",onClick:()=>Gs(t),disabled:b||c,className:`h-9 w-9 rounded-xl transition-all ${t.status==="Active"?"text-slate-400 hover:text-amber-600 hover:bg-amber-50":"text-slate-400 hover:text-emerald-600 hover:bg-emerald-50"}`,title:t.status==="Active"?"Deactivate":"Activate",children:b?e.jsx(V,{size:16,className:"animate-spin"}):t.status==="Active"?e.jsx(st,{size:16}):e.jsx(qe,{size:16})}),e.jsx(A,{variant:"ghost",size:"icon",onClick:()=>Bs(t.id,t.name),disabled:c,className:"h-9 w-9 rounded-xl text-slate-400 hover:text-rose-600 hover:bg-rose-50 transition-all",title:"Delete User",children:e.jsx(je,{size:16})})]})})]},t.id)}):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"px-6 py-32 text-center",children:e.jsxs("div",{className:"max-w-xs mx-auto space-y-6",children:[e.jsx("div",{className:"w-24 h-24 bg-slate-50 rounded-[32px] flex items-center justify-center mx-auto shadow-sm shadow-slate-100 group-hover:scale-110 transition-transform duration-500",children:e.jsx(Pe,{size:40,className:"text-slate-200"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-sm font-black text-slate-600 uppercase tracking-widest",children:"No matching users"}),e.jsx("p",{className:"text-xs text-slate-400 font-medium leading-relaxed",children:"We couldn't find any results for your current query. Try broadening your search or clearing filters."})]}),e.jsx(A,{variant:"outline",size:"sm",className:"rounded-xl border-slate-200 text-indigo-600 font-bold px-6 h-10 hover:bg-indigo-50",onClick:()=>{Q(""),L("All Roles"),O("All Status")},children:"Reset Filters"})]})})})})]})})]}),e.jsxs("div",{className:"sticky bottom-0 z-50 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 px-12 py-3 bg-white border-t-2 border-slate-100 shadow-[0_-8px_30px_rgba(0,0,0,0.08)] -mx-[24px] xl:-mx-[32px] w-[calc(100%+48px)] xl:w-[calc(100%+64px)]",children:[e.jsxs("p",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-4",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-[#9956DE] animate-pulse shadow-[0_0_12px_rgba(153,86,222,0.6)]"}),"Showing ",e.jsxs("span",{className:"text-slate-900 font-black border-b-2 border-[#9956DE]/40 pb-0.5",children:[Ut,"–",It]}),e.jsx("span",{className:"text-slate-300 font-bold mx-1",children:"/"}),e.jsx("span",{className:"text-slate-900 font-black border-b-2 border-[#9956DE]/40 pb-0.5",children:T}),e.jsx("span",{className:"text-slate-400 ml-1",children:"Total System Records"})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs(J,{value:String(y),onValueChange:t=>{const b=Number(t);Number.isNaN(b)||(z(b),u(1),ue())},children:[e.jsx(ee,{className:"h-10 w-[140px] bg-white border border-slate-300 text-[11px] font-black uppercase tracking-wider text-slate-900 rounded-xl hover:border-[#9956DE] transition-all px-4 shadow-sm",children:e.jsxs("span",{className:"truncate",children:[y," / Page"]})}),e.jsx(se,{className:"rounded-xl border-slate-200",children:ml.map(t=>e.jsxs(C,{value:t,className:"font-bold",children:[t," / Page"]},t))})]}),e.jsxs("div",{className:"flex items-center gap-2 bg-slate-50 p-1.5 rounded-2xl border border-slate-200 shadow-inner",children:[e.jsx(A,{variant:"outline",size:"sm",className:"h-9 w-9 p-0 rounded-xl bg-[#9956DE] border-none text-white hover:bg-[#8b5cf6] hover:scale-105 active:scale-95 disabled:opacity-30 transition-all shadow-lg shadow-purple-200/60",disabled:D<=1||o||c,onClick:()=>u(t=>Math.max(t-1,1)),children:e.jsx(jt,{size:18,strokeWidth:3})}),e.jsx("div",{className:"px-5 py-2 bg-white rounded-xl shadow-sm border border-slate-200 flex items-center justify-center min-w-[130px]",children:e.jsxs("span",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:["Page ",e.jsx("span",{className:"text-[#9956DE] mx-1",children:D}),e.jsx("span",{className:"text-slate-300 mx-1",children:"OF"}),e.jsx("span",{className:"text-slate-500",children:Math.max(me,1)})]})}),e.jsx(A,{variant:"outline",size:"sm",className:"h-9 w-9 p-0 rounded-xl bg-[#9956DE] border-none text-white hover:bg-[#8b5cf6] hover:scale-105 active:scale-95 disabled:opacity-30 transition-all shadow-lg shadow-purple-200/60",disabled:!Ne||o||c||D>=me,onClick:()=>u(t=>Math.min(t+1,me||1)),children:e.jsx(vt,{size:18,strokeWidth:3})})]})]})]}),e.jsx(ht,{open:ds,onOpenChange:t=>!f&&Ee(t),children:e.jsxs(pt,{className:"sm:max-w-[850px] rounded-[32px] border-none shadow-2xl p-0 overflow-hidden [&>button:last-child]:hidden",children:[e.jsx("div",{className:`h-2 w-full bg-gradient-to-r ${W?"from-indigo-600 to-purple-600":"from-emerald-600 to-indigo-600"}`}),e.jsxs("div",{className:"p-8 space-y-8",children:[e.jsx(ut,{className:"text-left",children:e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx("div",{className:`w-14 h-14 rounded-2xl flex items-center justify-center shadow-lg transition-transform duration-500 hover:rotate-3 ${W?"bg-indigo-100 text-indigo-700 shadow-indigo-200/50":"bg-emerald-100 text-emerald-700 shadow-emerald-200/50"}`,children:W?e.jsx(ss,{size:28,className:"drop-shadow-sm"}):e.jsx(Ys,{size:28,className:"drop-shadow-sm"})}),e.jsxs("div",{children:[e.jsx(gt,{className:"text-2xl font-display font-black text-[#1e293b] leading-tight",children:W?"Edit User Access":"Onboard New User"}),e.jsxs("p",{className:"text-[11px] font-black text-slate-400 uppercase tracking-[0.2em] mt-1 flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-indigo-500 animate-pulse"}),W?"User Identity Management":"System Enrollment Pipeline"]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-6",children:[e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[11px] font-black text-indigo-600 uppercase tracking-[0.15em] pb-1 border-b border-indigo-50",children:"Identity Details"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Full Name"}),e.jsxs("div",{className:"relative group",children:[e.jsx(xe,{value:j.name,onChange:t=>{de({...j,name:t.target.value}),hs.name&&Ke(b=>({...b,name:void 0}))},placeholder:"Enter full name",className:`h-12 rounded-xl bg-slate-50 border-slate-200 focus-visible:ring-indigo-500/20 focus-visible:border-indigo-500 transition-all font-bold text-[#1e293b] ${hs.name?"border-rose-300 bg-rose-50/20":""}`}),hs.name&&e.jsx(Re,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-rose-500"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Email Address"}),e.jsx(xe,{type:"email",value:j.email,onChange:t=>{W||de({...j,email:t.target.value})},readOnly:!!W,placeholder:"name@example.com",className:`h-12 rounded-xl bg-slate-50 border-slate-200 focus-visible:ring-indigo-500/20 focus-visible:border-indigo-500 transition-all font-bold text-[#1e293b] ${W?"opacity-60 grayscale bg-slate-100":""}`})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Access Role"}),e.jsxs(J,{value:j.role,onValueChange:t=>{de({...j,role:t,lrn:t==="Student"?j.lrn:""})},children:[e.jsx(ee,{className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-black text-[#1e293b]",children:e.jsx(Ue,{placeholder:"Role"})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"Student",className:"font-bold",children:"Student"}),e.jsx(C,{value:"Teacher",className:"font-bold",children:"Teacher"}),e.jsx(C,{value:"Admin",className:"font-bold",children:"Admin"})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Status"}),e.jsxs(J,{value:j.status,onValueChange:t=>de({...j,status:t}),children:[e.jsx(ee,{className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-black text-[#1e293b]",children:e.jsx(Ue,{placeholder:"Status"})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"Active",className:"font-bold",children:"Active"}),e.jsx(C,{value:"Inactive",className:"font-bold",children:"Inactive"})]})]})]})]})]})}),e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[11px] font-black text-indigo-600 uppercase tracking-[0.15em] pb-1 border-b border-indigo-50",children:"Contextual Assignment"}),j.role==="Student"?e.jsxs("div",{className:"space-y-4 animate-in fade-in slide-in-from-right-4 duration-500",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Grade Level"}),e.jsx(xe,{value:j.grade,onChange:t=>de({...j,grade:t.target.value}),placeholder:"Grade 11",className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-bold"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Section"}),e.jsx(xe,{value:j.section,onChange:t=>de({...j,section:t.target.value}),placeholder:"STEM A",className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-bold"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"LRN (Learner Reference Number)"}),e.jsx(xe,{value:j.lrn,onChange:t=>de({...j,lrn:t.target.value}),placeholder:"12-digit number",className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-black tracking-widest"})]})]}):e.jsxs("div",{className:"space-y-1.5 animate-in fade-in slide-in-from-right-4 duration-500",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Department / Office"}),e.jsx(xe,{value:j.department,onChange:t=>de({...j,department:t.target.value}),placeholder:"e.g. Mathematics Department",className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-bold"})]}),!W&&e.jsxs("div",{className:"space-y-1.5 pt-2",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Initial Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(xe,{type:ps?"text":"password",value:j.password,onChange:t=>de({...j,password:t.target.value}),className:"h-12 rounded-xl bg-slate-50 border-slate-200 pr-10 font-black tracking-widest"}),e.jsx("button",{type:"button",onClick:()=>Ye(!ps),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:ps?e.jsx(ft,{size:16}):e.jsx(ra,{size:16})})]})]})]})})]}),e.jsxs(la,{className:"grid grid-cols-2 gap-3 pt-6 border-t border-slate-100",children:[e.jsx(A,{variant:"outline",className:`h-12 rounded-xl font-black uppercase tracking-widest text-[10px] transition-all border-2 ${W?"border-indigo-600/50 text-indigo-600 hover:bg-indigo-50":"border-emerald-600/50 text-emerald-600 hover:bg-emerald-50"}`,onClick:()=>Ee(!1),disabled:f,children:"Cancel"}),e.jsx(A,{onClick:Pt,className:`h-12 rounded-xl font-black uppercase tracking-widest gap-3 text-[10px] shadow-lg transition-all active:scale-95 ${W?"bg-indigo-600 hover:bg-indigo-700 shadow-indigo-500/25":"bg-emerald-600 hover:bg-emerald-700 shadow-emerald-500/25"}`,disabled:f,children:f?e.jsx(V,{size:16,className:"animate-spin"}):W?e.jsxs(e.Fragment,{children:[e.jsx(Nt,{size:16})," Save Changes"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ys,{size:16})," Onboard User"]})})]})]})]})}),e.jsx(ct,{isOpen:xs,zIndexClass:"z-[70]",onClose:()=>{$e||(Be(!1),ms(null))},onConfirm:Dt,title:le?.title||"Confirm Action",message:le?.message||"Proceed with this action?",confirmText:$e?"Processing...":le?.confirmText||"Confirm",cancelText:"Cancel",type:"danger",icon:"delete"})]})},Ge=({icon:s,title:a,subtitle:n})=>e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-slate-50 border border-slate-100 flex items-center justify-center",children:s}),e.jsx("p",{className:"text-[11px] font-black text-slate-500 uppercase tracking-widest",children:a}),n&&e.jsx("p",{className:"text-[10px] text-slate-400 font-medium max-w-xs leading-relaxed",children:n})]}),pl=()=>{const[s,a]=l.useState("30d"),[n,i]=l.useState(null),[r,o]=l.useState(!0),g=()=>{o(!0),sl().then(i).catch(console.error).finally(()=>o(!1))};l.useEffect(()=>{g()},[]);const m={"7d":"7 Days","30d":"30 Days","90d":"90 Days","12m":"12 Months"},w=[{label:"Total Active Users",value:r?null:(n?.totalActiveUsers??0).toLocaleString(),icon:Pe,bg:"bg-[#4f46e5]",shadow:"shadow-indigo-500/20"},{label:"Completion Rate",value:"N/A",icon:Ht,bg:"bg-[#10b981]",shadow:"shadow-emerald-500/20"},{label:"Session Duration",value:"N/A",icon:Rs,bg:"bg-[#8b5cf6]",shadow:"shadow-purple-500/20"},{label:"At-Risk Students",value:r?null:(n?.atRiskStudents??0).toString(),icon:_e,bg:"bg-[#f43f5e]",shadow:"shadow-rose-500/20"}],f=[{label:"Achievements Unlocked",icon:Xs,color:"text-rose-600",bg:"bg-rose-50",border:"border-rose-100",value:r?null:(n?.achievementsUnlocked??0).toLocaleString()},{label:"XP Earned (Platform)",icon:Fe,color:"text-violet-600",bg:"bg-violet-50",border:"border-violet-100",value:r?null:(n?.totalXPEarned??0)>=1e6?`${((n?.totalXPEarned??0)/1e6).toFixed(1)}M`:(n?.totalXPEarned??0)>=1e3?`${Math.round((n?.totalXPEarned??0)/1e3)}K`:(n?.totalXPEarned??0).toLocaleString()},{label:"Active Streaks",icon:Wt,color:"text-orange-600",bg:"bg-orange-50",border:"border-orange-100",value:r?null:(n?.activeStreaks??0).toLocaleString()},{label:"AI Tutor Sessions",icon:Vt,color:"text-sky-600",bg:"bg-sky-50",border:"border-sky-100",value:r?null:(n?.aiTutorSessions??0).toLocaleString()}];return e.jsxs("div",{className:"space-y-6 pt-6 xl:pt-8 pb-10 max-w-[1600px] mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-1.5 h-6 bg-[#9956DE] rounded-full"}),e.jsx("p",{className:"text-[11px] font-black text-slate-400 uppercase tracking-[0.2em]",children:"Platform Analytics"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center bg-white rounded-xl p-1 shadow-sm border border-slate-200/60",children:Object.entries(m).map(([d,c])=>e.jsx("button",{onClick:()=>a(d),disabled:!0,title:"Range selection unavailable",className:`px-3 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all ${s===d?"bg-[#9956DE] text-white shadow-sm":"text-slate-500 hover:bg-slate-50"} opacity-50 cursor-not-allowed`,children:c},d))}),e.jsx("button",{onClick:g,disabled:r,title:"Refresh data",className:"p-2.5 rounded-xl bg-white border border-slate-200 text-slate-400 hover:text-[#9956DE] shadow-sm transition-all active:scale-95",children:e.jsx(Me,{size:14,className:r?"animate-spin":""})}),e.jsxs(A,{variant:"outline",disabled:!0,title:"Export unavailable",className:"h-9 px-4 gap-2 rounded-xl border-slate-200 text-[10px] font-black uppercase tracking-widest text-slate-400 opacity-50 cursor-not-allowed shadow-sm",children:[e.jsx(Ps,{size:14}),"Export"]})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:w.map((d,c)=>{const p=d.icon;return e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.3,delay:c*.05},className:`relative overflow-hidden ${d.bg} ${d.shadow} p-5 rounded-[28px] text-white flex flex-col gap-3 group hover:scale-[1.02] transition-all duration-300 shadow-lg`,children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-700 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-700 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex items-center justify-between",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] opacity-80",children:d.label}),e.jsx("div",{className:"bg-white/20 p-2 rounded-xl backdrop-blur-sm group-hover:bg-white/30 transition-colors",children:e.jsx(p,{size:14})})]}),r?e.jsx("div",{className:"relative z-10 flex items-center gap-2",children:e.jsx(V,{size:18,className:"animate-spin opacity-60"})}):e.jsx("h3",{className:"relative z-10 text-3xl font-display font-black leading-none tracking-tight",children:d.value})]},d.label)})}),!r&&!n?.totalActiveUsers&&e.jsxs(re.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"flex items-center gap-3 bg-amber-50 border border-amber-100 rounded-2xl px-5 py-3",children:[e.jsx(fe,{size:16,className:"text-amber-600 shrink-0"}),e.jsx("p",{className:"text-[10px] font-black text-amber-700 uppercase tracking-widest",children:"Limited data — KPIs populate as platform usage grows. Charts require time-series data."})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-5",children:[e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.1},className:"xl:col-span-8 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-50 text-indigo-600 flex items-center justify-center border border-indigo-100",children:e.jsx(mt,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Performance Trends"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Students vs. Teacher Targets"})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-indigo-400"}),e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Students"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-purple-400"}),e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Targets"})]})]})]}),e.jsx(Ge,{icon:e.jsx(da,{size:22,className:"text-slate-300"}),title:"No performance data yet",subtitle:"Trend charts will generate as students complete quizzes and assessments."})]}),e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.15},className:"xl:col-span-4 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-purple-50 text-purple-600 flex items-center justify-center border border-purple-100",children:e.jsx(Pa,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Grade Distribution"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Current Term"})]})]}),e.jsx(Ge,{icon:e.jsx(fe,{size:22,className:"text-slate-300"}),title:"No grade data",subtitle:"Import quiz results to see grade breakdowns."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-5",children:[e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.2},className:"xl:col-span-7 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-sky-50 text-sky-600 flex items-center justify-center border border-sky-100",children:e.jsx(He,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Subject Engagement"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Enrollment & Completion"})]})]}),e.jsx("div",{className:"rounded-2xl border border-slate-200/60 overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50/80",children:[e.jsx("th",{className:"text-left text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3",children:"Subject"}),e.jsx("th",{className:"text-right text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3",children:"Enrolled"}),e.jsx("th",{className:"text-right text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3",children:"Completion"}),e.jsx("th",{className:"text-right text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3",children:"Avg. Score"}),e.jsx("th",{className:"text-left text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3 w-32",children:"Progress"})]})}),e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-4 py-8",children:e.jsx(Ge,{icon:e.jsx(fe,{size:20,className:"text-slate-300"}),title:"No subject data available",subtitle:"Import class enrollment records to view engagement."})})})})]})})]}),e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.25},className:"xl:col-span-5 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-orange-50 text-orange-600 flex items-center justify-center border border-orange-100",children:e.jsx(Xt,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Weekly Activity"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Sessions Per Day"})]})]}),e.jsx(Ge,{icon:e.jsx(_e,{size:22,className:"text-slate-300"}),title:"No session activity yet",subtitle:"Student logins and session data will appear here."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-5",children:[e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.3},className:"xl:col-span-5 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-rose-50 text-rose-600 flex items-center justify-center border border-rose-100",children:e.jsx(Xs,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Gamification Overview"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Engagement Metrics"})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:f.map(d=>{const c=d.icon;return e.jsxs("div",{className:`${d.bg} border ${d.border} rounded-2xl p-4 group hover:scale-[1.02] transition-all duration-200`,children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsx(c,{size:18,className:d.color})}),r?e.jsx("div",{className:"w-12 h-5 bg-white/60 rounded-lg mt-1 mb-1 animate-pulse"}):e.jsx("p",{className:"text-xl font-black text-[#1e293b] leading-none",children:d.value}),e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mt-2",children:d.label})]},d.label)})})]}),e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.35},className:"xl:col-span-7 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 text-emerald-600 flex items-center justify-center border border-emerald-100",children:e.jsx(is,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Top Performing Classes"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Ranked by Average Score"})]})]}),e.jsx(Ge,{icon:e.jsx(fe,{size:22,className:"text-slate-300"}),title:"No class data yet",subtitle:"Import class and student records to see top performers."})]})]})]})};async function ul(){return De("/api/admin/ai-monitoring/summary")}async function gl(){return De("/api/admin/ai-monitoring/refresh",{method:"POST"})}function bl(){const s=Qt(),{data:a,isLoading:n,isError:i,error:r}=xa({queryKey:["ai-monitoring"],queryFn:ul,refetchInterval:3e4,staleTime:15e3});return{data:a,isLoading:n,isError:i,error:r,refetch:async()=>{await gl(),s.invalidateQueries({queryKey:["ai-monitoring"]})}}}const ls=({title:s,value:a,subValue:n,icon:i,badge:r,gradient:o="from-slate-800 to-slate-900"})=>e.jsxs("div",{className:`relative rounded-xl bg-gradient-to-br ${o} p-5 text-white shadow-lg overflow-hidden`,children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-white/60 uppercase tracking-wide",children:s}),e.jsx("p",{className:"text-2xl font-bold",children:a}),n&&e.jsx("p",{className:"text-xs text-white/50",children:n})]}),e.jsx("div",{className:"rounded-lg bg-white/10 p-2",children:i})]}),r&&e.jsx("span",{className:"absolute top-2 right-2 rounded-full bg-amber-400/90 px-2 py-0.5 text-[10px] font-semibold text-amber-900",children:r})]}),fl=({promoExpiresUtc:s,daysUntilPromoEnds:a,fullPriceInputRate:n,fullPriceOutputRate:i})=>{const[r,o]=l.useState(!1),g=l.useMemo(()=>{if(!s)return a;const m=new Date(s).getTime()-Date.now();return Math.max(0,Math.ceil(m/(1e3*60*60*24)))},[s,a]);return r?null:e.jsxs("div",{className:"relative rounded-lg border border-amber-300/50 bg-amber-50 px-4 py-3 text-sm text-amber-900",children:[e.jsx("button",{onClick:()=>o(!0),className:"absolute top-2 right-2 rounded p-1 hover:bg-amber-200/50","aria-label":"Dismiss",children:e.jsx(Ms,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"flex items-start gap-2 pr-6",children:[e.jsx(Fe,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-600"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold",children:"DeepSeek V4 Pro is currently 75% OFF"})," ","(cache-miss: $0.435/1M, output: $0.87/1M). Sale ends May 31, 2026 at 15:59 UTC — ",e.jsxs("strong",{children:[g," days remaining"]}),".",e.jsx("br",{}),e.jsxs("span",{className:"text-amber-700",children:["Full price after sale: $",n,"/1M input · $",i,"/1M output."]})]})]})]})},rt=({title:s,feature:a})=>a?e.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-2",children:s}),e.jsx("p",{className:"text-lg font-bold text-slate-900",children:a.featureName}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-slate-600",children:[e.jsxs("span",{children:["$",a.monthlyCost.toFixed(4)]}),e.jsx("span",{className:"text-slate-300",children:"|"}),e.jsxs("span",{children:[a.totalRequests.toLocaleString()," reqs"]}),e.jsx("span",{className:"text-slate-300",children:"|"}),e.jsxs("span",{children:[(a.cacheHitRate*100).toFixed(0),"% cache"]})]})]}):null,jl=({features:s})=>{const a=[...s].sort((n,i)=>i.monthlyCost-n.monthlyCost);return e.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-3",children:"Resource Breakdown"}),e.jsx("div",{className:"space-y-2",children:a.map(n=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"truncate font-medium text-slate-700",children:n.featureName}),e.jsxs("span",{className:"text-xs text-slate-500",children:["$",n.monthlyCost.toFixed(4)]})]}),e.jsx("div",{className:"mt-1 h-1.5 w-full rounded-full bg-slate-100 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-indigo-500",style:{width:`${Math.min(n.costShare,100)}%`}})})]}),e.jsxs("span",{className:"text-xs text-slate-400 w-10 text-right",children:[n.costShare.toFixed(0),"%"]})]},n.featureId))})]})},vl=({open:s,onClose:a,features:n})=>s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:a,children:e.jsxs("div",{className:"relative w-full max-w-2xl max-h-[80vh] overflow-y-auto rounded-xl bg-white p-6 shadow-xl",onClick:i=>i.stopPropagation(),children:[e.jsx("button",{onClick:a,className:"absolute top-3 right-3 rounded p-1 hover:bg-slate-100","aria-label":"Close",children:e.jsx(Ms,{className:"h-5 w-5 text-slate-500"})}),e.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-4",children:"AI Feature Directory"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-left text-xs text-slate-500 uppercase",children:[e.jsx("th",{className:"pb-2",children:"Feature"}),e.jsx("th",{className:"pb-2",children:"Model"}),e.jsx("th",{className:"pb-2 text-right",children:"Cost"}),e.jsx("th",{className:"pb-2 text-right",children:"Requests"}),e.jsx("th",{className:"pb-2 text-right",children:"Cache Hit"})]})}),e.jsx("tbody",{children:n.map(i=>e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("td",{className:"py-2 font-medium text-slate-800",children:i.featureName}),e.jsx("td",{className:"py-2 text-slate-600",children:i.modelId}),e.jsxs("td",{className:"py-2 text-right",children:["$",i.monthlyCost.toFixed(4)]}),e.jsx("td",{className:"py-2 text-right",children:i.totalRequests.toLocaleString()}),e.jsxs("td",{className:"py-2 text-right",children:[(i.cacheHitRate*100).toFixed(0),"%"]})]},i.featureId))})]})]})}):null,wl=({pricingMeta:s})=>{const[a,n]=l.useState(!1);return e.jsxs("div",{className:"relative inline-block",children:[e.jsx("button",{onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),className:"rounded p-1 text-slate-400 hover:text-slate-600","aria-label":"Pricing info",children:e.jsx(wt,{className:"h-4 w-4"})}),a&&e.jsxs("div",{className:"absolute bottom-full left-1/2 z-50 mb-2 w-64 -translate-x-1/2 rounded-lg border border-slate-200 bg-white p-3 text-xs shadow-lg",children:[e.jsx("p",{className:"font-semibold text-slate-800 mb-1",children:s.isPromotional?"Promotional Pricing (75% OFF)":"Standard Pricing"}),e.jsxs("div",{className:"space-y-1 text-slate-600",children:[e.jsxs("p",{children:["Input (cache miss): ",e.jsxs("strong",{children:["$",s.currentInputCacheMissRate,"/1M"]})]}),e.jsxs("p",{children:["Output: ",e.jsxs("strong",{children:["$",s.currentOutputRate,"/1M"]})]}),s.isPromotional&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"my-1 border-slate-100"}),e.jsxs("p",{className:"text-slate-400",children:["Full price: $",s.fullPriceInputRate,"/1M in · $",s.fullPriceOutputRate,"/1M out"]})]})]})]})]})},Nl=()=>{const{data:s,isLoading:a,refetch:n}=bl(),[i,r]=l.useState(!1),[o,g]=l.useState(!1),m=async()=>{g(!0);try{await n()}finally{g(!1)}};if(a||!s)return e.jsxs("div",{className:"space-y-5 p-1",children:[e.jsx("div",{className:"h-[72px] w-full rounded-xl bg-slate-100 animate-pulse"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"h-4 w-48 rounded bg-slate-100 animate-pulse"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"h-8 w-24 rounded-lg bg-slate-100 animate-pulse"}),e.jsx("div",{className:"h-8 w-20 rounded-lg bg-slate-100 animate-pulse"})]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((d,c)=>e.jsx("div",{className:"h-[120px] rounded-xl bg-gradient-to-br from-slate-100 to-slate-50 animate-pulse"},c))}),e.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:Array.from({length:3}).map((d,c)=>e.jsx("div",{className:"h-[130px] rounded-xl border border-slate-100 bg-slate-50/50 animate-pulse"},c))}),e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-white p-5 space-y-4",children:[e.jsx("div",{className:"h-4 w-40 rounded bg-slate-100 animate-pulse"}),Array.from({length:5}).map((d,c)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-3 w-28 rounded bg-slate-100 animate-pulse"}),e.jsx("div",{className:"flex-1 h-2 rounded-full bg-slate-100 animate-pulse"}),e.jsx("div",{className:"h-3 w-16 rounded bg-slate-100 animate-pulse"})]},c))]})]});const w=s.features.find(d=>d.isTopSpending),f=s.features.find(d=>d.isMostActive);return e.jsxs("div",{className:"space-y-5 p-1",children:[s.promotionalPricingActive&&e.jsx(fl,{promoExpiresUtc:s.pricingMeta.promoExpiresUtc,daysUntilPromoEnds:s.pricingMeta.daysUntilPromoEnds,fullPriceInputRate:s.pricingMeta.fullPriceInputRate,fullPriceOutputRate:s.pricingMeta.fullPriceOutputRate}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wl,{pricingMeta:s.pricingMeta}),e.jsxs("span",{className:"text-xs text-slate-400",children:["Last updated: ",new Date(s.lastUpdated).toLocaleTimeString()]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>r(!0),className:"inline-flex items-center gap-1.5 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-xs font-medium text-slate-700 hover:bg-slate-50",children:[e.jsx(Ta,{className:"h-3.5 w-3.5"})," Directory"]}),e.jsxs("button",{onClick:m,disabled:o,className:"inline-flex items-center gap-1.5 rounded-lg bg-indigo-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:[e.jsx(Me,{className:`h-3.5 w-3.5 ${o?"animate-spin":""}`})," Refresh"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(ls,{title:"Monthly Cost",value:`$${s.monthlyCost.toFixed(2)}`,subValue:`Would be ~$${s.estimatedCostAfterPromo.toFixed(2)} at full price`,icon:e.jsx(ma,{className:"h-5 w-5"}),gradient:"from-emerald-600 to-emerald-800"}),e.jsx(ls,{title:"Active Engine",value:s.activeEngine,subValue:s.engineTier,icon:e.jsx(it,{className:"h-5 w-5"}),badge:s.promotionalPricingActive?"75% OFF until May 31":void 0,gradient:"from-indigo-600 to-indigo-800"}),e.jsx(ls,{title:"Total Requests",value:s.totalUsage.toLocaleString(),subValue:s.billingCycleLabel,icon:e.jsx(_e,{className:"h-5 w-5"}),gradient:"from-violet-600 to-violet-800"}),e.jsx(ls,{title:"Cache Efficiency",value:`${(s.cacheHitRate*100).toFixed(1)}%`,subValue:"Cache hits: $0.003625/1M vs miss: $0.435/1M",icon:e.jsx(fe,{className:"h-5 w-5"}),gradient:"from-sky-600 to-sky-800"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsx(rt,{title:"Top Spending",feature:w}),e.jsx(rt,{title:"Most Active",feature:f}),e.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-2",children:"Cost Breakdown"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:"Cache Hit"}),e.jsxs("span",{className:"font-medium",children:["$",s.costBreakdown.cacheHitCost.toFixed(6)]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:"Cache Miss"}),e.jsxs("span",{className:"font-medium",children:["$",s.costBreakdown.cacheMissCost.toFixed(6)]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:"Output"}),e.jsxs("span",{className:"font-medium",children:["$",s.costBreakdown.outputCost.toFixed(6)]})]})]})]})]}),e.jsx(jl,{features:s.features}),e.jsx(vl,{open:i,onClose:()=>r(!1),features:s.features})]})},Le=rs.map(s=>({id:s.id,name:s.name,code:s.code,gradeLevel:s.gradeLevel,semester:s.semester,color:s.color})),yl=()=>{const{userProfile:s}=cs(),{availability:a,loading:n,error:i}=pa(),[r,o]=l.useState(null),[g,m]=l.useState({}),w=l.useCallback(async(c,p)=>{if(!s?.uid){S.error("You must be logged in as admin to change availability");return}o(c);try{await ua(c,p,s.uid),S.success(`${Le.find(v=>v.id===c)?.name||c} is now ${p?"available":"locked"}`)}catch(v){S.error("Failed to update subject availability"),console.error(v)}finally{o(null)}},[s?.uid]),f=l.useCallback((c,p)=>{m(v=>({...v,[c]:p}))},[]),d=l.useCallback(async c=>{if(!s?.uid){S.error("You must be logged in as admin");return}const p=g[c]?.trim()||null;o(c);try{await ga(c,p,s.uid),S.success("PDF path updated")}catch(v){S.error("Failed to update PDF path"),console.error(v)}finally{o(null)}},[g,s?.uid]);return e.jsxs("div",{className:"flex flex-col min-h-full space-y-8 pt-6 xl:pt-8 animate-in fade-in slide-in-from-bottom-4 duration-700 pb-6",children:[n&&e.jsx("div",{className:"flex items-center justify-end px-2",children:e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 bg-indigo-50 text-indigo-600 rounded-2xl border border-indigo-100 animate-pulse",children:[e.jsx(V,{size:16,className:"animate-spin"}),e.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Syncing Subject Cloud Data..."})]})}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Total Subjects",value:Le.length,icon:He,bg:"bg-[#4f46e5]",shadow:"shadow-indigo-500/20"},{label:"Available",value:Le.filter(c=>a[c.id]?.available!==!1).length,icon:La,bg:"bg-[#10b981]",shadow:"shadow-emerald-500/20"},{label:"Locked",value:Le.filter(c=>a[c.id]?.available===!1).length,icon:dt,bg:"bg-[#ef4444]",shadow:"shadow-rose-500/20"},{label:"RAG Sources",value:Le.filter(c=>a[c.id]?.pdfPath).length,icon:Ce,bg:"bg-[#8b5cf6]",shadow:"shadow-purple-500/20"}].map((c,p)=>e.jsxs("div",{className:`relative overflow-hidden ${c.bg} ${c.shadow} p-5 rounded-[28px] text-white flex flex-col gap-3 group hover:scale-[1.02] transition-all duration-300 shadow-lg`,children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-700 ease-out"}),e.jsxs("div",{className:"relative z-10 flex items-center justify-between",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] opacity-80",children:c.label}),e.jsx("div",{className:"bg-white/20 p-2 rounded-xl backdrop-blur-sm",children:e.jsx(c.icon,{size:14})})]}),e.jsx("h3",{className:"relative z-10 text-3xl font-display font-black leading-none tracking-tight",children:c.value})]},p))}),i&&e.jsxs("div",{className:"rounded-2xl border border-rose-200 bg-rose-50 px-6 py-4 flex items-center gap-3 animate-in shake duration-500",children:[e.jsx(Re,{className:"text-rose-600",size:20}),e.jsx("p",{className:"text-sm font-bold text-rose-700",children:i})]}),e.jsx("div",{className:"bg-white rounded-[32px] border border-slate-200/60 shadow-sm shadow-slate-200/50 overflow-hidden relative",children:e.jsxs(kt,{className:"w-full text-left border-collapse",children:[e.jsx(St,{children:e.jsxs(Ie,{className:"bg-[#9956DE] hover:bg-[#9956DE] border-b border-[#8b5cf6] sticky top-0 z-20 shadow-md",children:[e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Subject Identity"}),e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Grade / Semester"}),e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Access Status"}),e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Toggle Access"}),e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"RAG Resource Mapping"})]})}),e.jsx(Ct,{className:"divide-y divide-slate-50",children:Le.map(c=>{const p=a[c.id],v=p?.available??!0,N=g[c.id]??p?.pdfPath??"",D=p?.lastUpdated,u=r===c.id;return e.jsxs(Ie,{className:"group hover:bg-slate-50/50 transition-all",children:[e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-2xl bg-gradient-to-br ${c.color} flex items-center justify-center text-white shadow-lg shadow-indigo-100 group-hover:scale-110 transition-transform duration-500`,children:e.jsx(He,{size:20,className:"drop-shadow-sm"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-black text-[#1e293b] truncate text-sm leading-tight group-hover:text-indigo-600 transition-colors",children:c.name}),e.jsx("p",{className:"text-[11px] font-black text-slate-400 uppercase tracking-tighter mt-1",children:c.code})]})]})}),e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-black text-slate-700 uppercase tracking-wide",children:c.gradeLevel}),e.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-tight",children:c.semester})]})}),e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("span",{className:` + `,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t.status==="Active"?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),t.status]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{className:"text-xs font-black text-slate-600",children:t.grade||"N/A"}),e.jsx("p",{className:"text-[10px] font-medium text-slate-400",children:t.role==="Student"?t.classSection||t.section||"Unassigned":t.department})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{className:"text-[10px] font-black text-slate-600 uppercase tracking-tighter",children:t.lastLogin?"Recent Activity":"Inactive Account"}),e.jsx("p",{className:"text-[10px] font-medium text-slate-400",children:t.lastLogin||"No login history"})]})}),e.jsx("td",{className:"px-6 py-4 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(E,{variant:"ghost",size:"icon",onClick:()=>Os(t),className:"h-9 w-9 rounded-xl text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 transition-all",title:"Edit User",children:e.jsx(ss,{size:16})}),e.jsx(E,{variant:"ghost",size:"icon",onClick:()=>Gs(t),disabled:b||c,className:`h-9 w-9 rounded-xl transition-all ${t.status==="Active"?"text-slate-400 hover:text-amber-600 hover:bg-amber-50":"text-slate-400 hover:text-emerald-600 hover:bg-emerald-50"}`,title:t.status==="Active"?"Deactivate":"Activate",children:b?e.jsx(V,{size:16,className:"animate-spin"}):t.status==="Active"?e.jsx(st,{size:16}):e.jsx(qe,{size:16})}),e.jsx(E,{variant:"ghost",size:"icon",onClick:()=>Bs(t.id,t.name),disabled:c,className:"h-9 w-9 rounded-xl text-slate-400 hover:text-rose-600 hover:bg-rose-50 transition-all",title:"Delete User",children:e.jsx(je,{size:16})})]})})]},t.id)}):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"px-6 py-32 text-center",children:e.jsxs("div",{className:"max-w-xs mx-auto space-y-6",children:[e.jsx("div",{className:"w-24 h-24 bg-slate-50 rounded-[32px] flex items-center justify-center mx-auto shadow-sm shadow-slate-100 group-hover:scale-110 transition-transform duration-500",children:e.jsx(Pe,{size:40,className:"text-slate-200"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-sm font-black text-slate-600 uppercase tracking-widest",children:"No matching users"}),e.jsx("p",{className:"text-xs text-slate-400 font-medium leading-relaxed",children:"We couldn't find any results for your current query. Try broadening your search or clearing filters."})]}),e.jsx(E,{variant:"outline",size:"sm",className:"rounded-xl border-slate-200 text-indigo-600 font-bold px-6 h-10 hover:bg-indigo-50",onClick:()=>{X(""),U("All Roles"),O("All Status")},children:"Reset Filters"})]})})})})]})})]}),e.jsxs("div",{className:"sticky bottom-0 z-50 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 px-12 py-3 bg-white border-t-2 border-slate-100 shadow-[0_-8px_30px_rgba(0,0,0,0.08)] -mx-[24px] xl:-mx-[32px] w-[calc(100%+48px)] xl:w-[calc(100%+64px)]",children:[e.jsxs("p",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-4",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-[#9956DE] animate-pulse shadow-[0_0_12px_rgba(153,86,222,0.6)]"}),"Showing ",e.jsxs("span",{className:"text-slate-900 font-black border-b-2 border-[#9956DE]/40 pb-0.5",children:[Ut,"–",It]}),e.jsx("span",{className:"text-slate-300 font-bold mx-1",children:"/"}),e.jsx("span",{className:"text-slate-900 font-black border-b-2 border-[#9956DE]/40 pb-0.5",children:T}),e.jsx("span",{className:"text-slate-400 ml-1",children:"Total System Records"})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs(J,{value:String(y),onValueChange:t=>{const b=Number(t);Number.isNaN(b)||(D(b),u(1),ue())},children:[e.jsx(ee,{className:"h-10 w-[140px] bg-white border border-slate-300 text-[11px] font-black uppercase tracking-wider text-slate-900 rounded-xl hover:border-[#9956DE] transition-all px-4 shadow-sm",children:e.jsxs("span",{className:"truncate",children:[y," / Page"]})}),e.jsx(se,{className:"rounded-xl border-slate-200",children:ml.map(t=>e.jsxs(C,{value:t,className:"font-bold",children:[t," / Page"]},t))})]}),e.jsxs("div",{className:"flex items-center gap-2 bg-slate-50 p-1.5 rounded-2xl border border-slate-200 shadow-inner",children:[e.jsx(E,{variant:"outline",size:"sm",className:"h-9 w-9 p-0 rounded-xl bg-[#9956DE] border-none text-white hover:bg-[#8b5cf6] hover:scale-105 active:scale-95 disabled:opacity-30 transition-all shadow-lg shadow-purple-200/60",disabled:A<=1||o||c,onClick:()=>u(t=>Math.max(t-1,1)),children:e.jsx(jt,{size:18,strokeWidth:3})}),e.jsx("div",{className:"px-5 py-2 bg-white rounded-xl shadow-sm border border-slate-200 flex items-center justify-center min-w-[130px]",children:e.jsxs("span",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:["Page ",e.jsx("span",{className:"text-[#9956DE] mx-1",children:A}),e.jsx("span",{className:"text-slate-300 mx-1",children:"OF"}),e.jsx("span",{className:"text-slate-500",children:Math.max(me,1)})]})}),e.jsx(E,{variant:"outline",size:"sm",className:"h-9 w-9 p-0 rounded-xl bg-[#9956DE] border-none text-white hover:bg-[#8b5cf6] hover:scale-105 active:scale-95 disabled:opacity-30 transition-all shadow-lg shadow-purple-200/60",disabled:!Ne||o||c||A>=me,onClick:()=>u(t=>Math.min(t+1,me||1)),children:e.jsx(vt,{size:18,strokeWidth:3})})]})]})]}),e.jsx(ht,{open:ds,onOpenChange:t=>!v&&Ee(t),children:e.jsxs(pt,{className:"sm:max-w-[850px] rounded-[32px] border-none shadow-2xl p-0 overflow-hidden [&>button:last-child]:hidden",children:[e.jsx("div",{className:`h-2 w-full bg-gradient-to-r ${W?"from-indigo-600 to-purple-600":"from-emerald-600 to-indigo-600"}`}),e.jsxs("div",{className:"p-8 space-y-8",children:[e.jsx(ut,{className:"text-left",children:e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx("div",{className:`w-14 h-14 rounded-2xl flex items-center justify-center shadow-lg transition-transform duration-500 hover:rotate-3 ${W?"bg-indigo-100 text-indigo-700 shadow-indigo-200/50":"bg-emerald-100 text-emerald-700 shadow-emerald-200/50"}`,children:W?e.jsx(ss,{size:28,className:"drop-shadow-sm"}):e.jsx(Ys,{size:28,className:"drop-shadow-sm"})}),e.jsxs("div",{children:[e.jsx(gt,{className:"text-2xl font-display font-black text-[#1e293b] leading-tight",children:W?"Edit User Access":"Onboard New User"}),e.jsxs("p",{className:"text-[11px] font-black text-slate-400 uppercase tracking-[0.2em] mt-1 flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-indigo-500 animate-pulse"}),W?"User Identity Management":"System Enrollment Pipeline"]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-6",children:[e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[11px] font-black text-indigo-600 uppercase tracking-[0.15em] pb-1 border-b border-indigo-50",children:"Identity Details"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Full Name"}),e.jsxs("div",{className:"relative group",children:[e.jsx(xe,{value:j.name,onChange:t=>{de({...j,name:t.target.value}),hs.name&&Ke(b=>({...b,name:void 0}))},placeholder:"Enter full name",className:`h-12 rounded-xl bg-slate-50 border-slate-200 focus-visible:ring-indigo-500/20 focus-visible:border-indigo-500 transition-all font-bold text-[#1e293b] ${hs.name?"border-rose-300 bg-rose-50/20":""}`}),hs.name&&e.jsx(Re,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-rose-500"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Email Address"}),e.jsx(xe,{type:"email",value:j.email,onChange:t=>{W||de({...j,email:t.target.value})},readOnly:!!W,placeholder:"name@example.com",className:`h-12 rounded-xl bg-slate-50 border-slate-200 focus-visible:ring-indigo-500/20 focus-visible:border-indigo-500 transition-all font-bold text-[#1e293b] ${W?"opacity-60 grayscale bg-slate-100":""}`})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Access Role"}),e.jsxs(J,{value:j.role,onValueChange:t=>{de({...j,role:t,lrn:t==="Student"?j.lrn:""})},children:[e.jsx(ee,{className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-black text-[#1e293b]",children:e.jsx(Ue,{placeholder:"Role"})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"Student",className:"font-bold",children:"Student"}),e.jsx(C,{value:"Teacher",className:"font-bold",children:"Teacher"}),e.jsx(C,{value:"Admin",className:"font-bold",children:"Admin"})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Status"}),e.jsxs(J,{value:j.status,onValueChange:t=>de({...j,status:t}),children:[e.jsx(ee,{className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-black text-[#1e293b]",children:e.jsx(Ue,{placeholder:"Status"})}),e.jsxs(se,{className:"rounded-xl border-slate-200",children:[e.jsx(C,{value:"Active",className:"font-bold",children:"Active"}),e.jsx(C,{value:"Inactive",className:"font-bold",children:"Inactive"})]})]})]})]})]})}),e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[11px] font-black text-indigo-600 uppercase tracking-[0.15em] pb-1 border-b border-indigo-50",children:"Contextual Assignment"}),j.role==="Student"?e.jsxs("div",{className:"space-y-4 animate-in fade-in slide-in-from-right-4 duration-500",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Grade Level"}),e.jsx(xe,{value:j.grade,onChange:t=>de({...j,grade:t.target.value}),placeholder:"Grade 11",className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-bold"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Section"}),e.jsx(xe,{value:j.section,onChange:t=>de({...j,section:t.target.value}),placeholder:"STEM A",className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-bold"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"LRN (Learner Reference Number)"}),e.jsx(xe,{value:j.lrn,onChange:t=>de({...j,lrn:t.target.value}),placeholder:"12-digit number",className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-black tracking-widest"})]})]}):e.jsxs("div",{className:"space-y-1.5 animate-in fade-in slide-in-from-right-4 duration-500",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Department / Office"}),e.jsx(xe,{value:j.department,onChange:t=>de({...j,department:t.target.value}),placeholder:"e.g. Mathematics Department",className:"h-12 rounded-xl bg-slate-50 border-slate-200 font-bold"})]}),!W&&e.jsxs("div",{className:"space-y-1.5 pt-2",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Initial Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(xe,{type:ps?"text":"password",value:j.password,onChange:t=>de({...j,password:t.target.value}),className:"h-12 rounded-xl bg-slate-50 border-slate-200 pr-10 font-black tracking-widest"}),e.jsx("button",{type:"button",onClick:()=>Ye(!ps),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:ps?e.jsx(ft,{size:16}):e.jsx(ra,{size:16})})]})]})]})})]}),e.jsxs(la,{className:"grid grid-cols-2 gap-3 pt-6 border-t border-slate-100",children:[e.jsx(E,{variant:"outline",className:`h-12 rounded-xl font-black uppercase tracking-widest text-[10px] transition-all border-2 ${W?"border-indigo-600/50 text-indigo-600 hover:bg-indigo-50":"border-emerald-600/50 text-emerald-600 hover:bg-emerald-50"}`,onClick:()=>Ee(!1),disabled:v,children:"Cancel"}),e.jsx(E,{onClick:Pt,className:`h-12 rounded-xl font-black uppercase tracking-widest gap-3 text-[10px] shadow-lg transition-all active:scale-95 ${W?"bg-indigo-600 hover:bg-indigo-700 shadow-indigo-500/25":"bg-emerald-600 hover:bg-emerald-700 shadow-emerald-500/25"}`,disabled:v,children:v?e.jsx(V,{size:16,className:"animate-spin"}):W?e.jsxs(e.Fragment,{children:[e.jsx(Nt,{size:16})," Save Changes"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ys,{size:16})," Onboard User"]})})]})]})]})}),e.jsx(ct,{isOpen:xs,zIndexClass:"z-[70]",onClose:()=>{$e||(Be(!1),ms(null))},onConfirm:Dt,title:le?.title||"Confirm Action",message:le?.message||"Proceed with this action?",confirmText:$e?"Processing...":le?.confirmText||"Confirm",cancelText:"Cancel",type:"danger",icon:"delete"})]})},Ge=({icon:s,title:a,subtitle:n})=>e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-slate-50 border border-slate-100 flex items-center justify-center",children:s}),e.jsx("p",{className:"text-[11px] font-black text-slate-500 uppercase tracking-widest",children:a}),n&&e.jsx("p",{className:"text-[10px] text-slate-400 font-medium max-w-xs leading-relaxed",children:n})]}),pl=()=>{const[s,a]=r.useState("30d"),[n,i]=r.useState(null),[l,o]=r.useState(!0),g=()=>{o(!0),sl().then(i).catch(console.error).finally(()=>o(!1))};r.useEffect(()=>{g()},[]);const m={"7d":"7 Days","30d":"30 Days","90d":"90 Days","12m":"12 Months"},N=[{label:"Total Active Users",value:l?null:(n?.totalActiveUsers??0).toLocaleString(),icon:Pe,bg:"bg-[#4f46e5]",shadow:"shadow-indigo-500/20"},{label:"Avg. Quiz Score",value:l?null:`${n?.avgQuizScore??0}%`,icon:Ht,bg:"bg-[#10b981]",shadow:"shadow-emerald-500/20"},{label:"Quizzes Taken",value:l?null:(n?.totalQuizzesTaken??0).toLocaleString(),icon:Rs,bg:"bg-[#8b5cf6]",shadow:"shadow-purple-500/20"},{label:"At-Risk Students",value:l?null:(n?.atRiskStudents??0).toString(),icon:_e,bg:"bg-[#f43f5e]",shadow:"shadow-rose-500/20"}],v=[{label:"Achievements Unlocked",icon:Qs,color:"text-rose-600",bg:"bg-rose-50",border:"border-rose-100",value:l?null:(n?.achievementsUnlocked??0).toLocaleString()},{label:"XP Earned (Platform)",icon:Fe,color:"text-violet-600",bg:"bg-violet-50",border:"border-violet-100",value:l?null:(n?.totalXPEarned??0)>=1e6?`${((n?.totalXPEarned??0)/1e6).toFixed(1)}M`:(n?.totalXPEarned??0)>=1e3?`${Math.round((n?.totalXPEarned??0)/1e3)}K`:(n?.totalXPEarned??0).toLocaleString()},{label:"Active Streaks",icon:Wt,color:"text-orange-600",bg:"bg-orange-50",border:"border-orange-100",value:l?null:(n?.activeStreaks??0).toLocaleString()},{label:"AI Tutor Sessions",icon:Vt,color:"text-sky-600",bg:"bg-sky-50",border:"border-sky-100",value:l?null:(n?.aiTutorSessions??0).toLocaleString()}];return e.jsxs("div",{className:"space-y-6 pt-6 xl:pt-8 pb-10 max-w-[1600px] mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-1.5 h-6 bg-[#9956DE] rounded-full"}),e.jsx("p",{className:"text-[11px] font-black text-slate-400 uppercase tracking-[0.2em]",children:"Platform Analytics"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center bg-white rounded-xl p-1 shadow-sm border border-slate-200/60",children:Object.entries(m).map(([h,c])=>e.jsx("button",{onClick:()=>a(h),disabled:!0,title:"Range selection unavailable",className:`px-3 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all ${s===h?"bg-[#9956DE] text-white shadow-sm":"text-slate-500 hover:bg-slate-50"} opacity-50 cursor-not-allowed`,children:c},h))}),e.jsx("button",{onClick:g,disabled:l,title:"Refresh data",className:"p-2.5 rounded-xl bg-white border border-slate-200 text-slate-400 hover:text-[#9956DE] shadow-sm transition-all active:scale-95",children:e.jsx(Me,{size:14,className:l?"animate-spin":""})}),e.jsxs(E,{variant:"outline",disabled:!0,title:"Export unavailable",className:"h-9 px-4 gap-2 rounded-xl border-slate-200 text-[10px] font-black uppercase tracking-widest text-slate-400 opacity-50 cursor-not-allowed shadow-sm",children:[e.jsx(Ps,{size:14}),"Export"]})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:N.map((h,c)=>{const x=h.icon;return e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.3,delay:c*.05},className:`relative overflow-hidden ${h.bg} ${h.shadow} p-5 rounded-[28px] text-white flex flex-col gap-3 group hover:scale-[1.02] transition-all duration-300 shadow-lg`,children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-700 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-700 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex items-center justify-between",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] opacity-80",children:h.label}),e.jsx("div",{className:"bg-white/20 p-2 rounded-xl backdrop-blur-sm group-hover:bg-white/30 transition-colors",children:e.jsx(x,{size:14})})]}),l?e.jsx("div",{className:"relative z-10 flex items-center gap-2",children:e.jsx(V,{size:18,className:"animate-spin opacity-60"})}):e.jsx("h3",{className:"relative z-10 text-3xl font-display font-black leading-none tracking-tight",children:h.value})]},h.label)})}),!l&&!n?.totalActiveUsers&&e.jsxs(re.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"flex items-center gap-3 bg-amber-50 border border-amber-100 rounded-2xl px-5 py-3",children:[e.jsx(fe,{size:16,className:"text-amber-600 shrink-0"}),e.jsx("p",{className:"text-[10px] font-black text-amber-700 uppercase tracking-widest",children:"Limited data — KPIs populate as platform usage grows. Charts require time-series data."})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-5",children:[e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.1},className:"xl:col-span-8 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-50 text-indigo-600 flex items-center justify-center border border-indigo-100",children:e.jsx(mt,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Performance Trends"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Students vs. Teacher Targets"})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-indigo-400"}),e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Students"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-purple-400"}),e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Targets"})]})]})]}),e.jsx(Ge,{icon:e.jsx(da,{size:22,className:"text-slate-300"}),title:"No performance data yet",subtitle:"Trend charts will generate as students complete quizzes and assessments."})]}),e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.15},className:"xl:col-span-4 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-purple-50 text-purple-600 flex items-center justify-center border border-purple-100",children:e.jsx(Pa,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Grade Distribution"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Current Term"})]})]}),e.jsx(Ge,{icon:e.jsx(fe,{size:22,className:"text-slate-300"}),title:"No grade data",subtitle:"Import quiz results to see grade breakdowns."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-5",children:[e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.2},className:"xl:col-span-7 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-sky-50 text-sky-600 flex items-center justify-center border border-sky-100",children:e.jsx(He,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Subject Engagement"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Enrollment & Completion"})]})]}),e.jsx("div",{className:"rounded-2xl border border-slate-200/60 overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50/80",children:[e.jsx("th",{className:"text-left text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3",children:"Subject"}),e.jsx("th",{className:"text-right text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3",children:"Enrolled"}),e.jsx("th",{className:"text-right text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3",children:"Completion"}),e.jsx("th",{className:"text-right text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3",children:"Avg. Score"}),e.jsx("th",{className:"text-left text-[10px] font-black text-slate-400 uppercase tracking-widest px-5 py-3 w-32",children:"Progress"})]})}),e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-4 py-8",children:e.jsx(Ge,{icon:e.jsx(fe,{size:20,className:"text-slate-300"}),title:"No subject data available",subtitle:"Import class enrollment records to view engagement."})})})})]})})]}),e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.25},className:"xl:col-span-5 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-orange-50 text-orange-600 flex items-center justify-center border border-orange-100",children:e.jsx(Qt,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Weekly Activity"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Sessions Per Day"})]})]}),e.jsx(Ge,{icon:e.jsx(_e,{size:22,className:"text-slate-300"}),title:"No session activity yet",subtitle:"Student logins and session data will appear here."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-5",children:[e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.3},className:"xl:col-span-5 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-rose-50 text-rose-600 flex items-center justify-center border border-rose-100",children:e.jsx(Qs,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Gamification Overview"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Engagement Metrics"})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:v.map(h=>{const c=h.icon;return e.jsxs("div",{className:`${h.bg} border ${h.border} rounded-2xl p-4 group hover:scale-[1.02] transition-all duration-200`,children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsx(c,{size:18,className:h.color})}),l?e.jsx("div",{className:"w-12 h-5 bg-white/60 rounded-lg mt-1 mb-1 animate-pulse"}):e.jsx("p",{className:"text-xl font-black text-[#1e293b] leading-none",children:h.value}),e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mt-2",children:h.label})]},h.label)})})]}),e.jsxs(re.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35,delay:.35},className:"xl:col-span-7 bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/40",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 text-emerald-600 flex items-center justify-center border border-emerald-100",children:e.jsx(is,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-black text-[#1e293b] tracking-tight",children:"Top Performing Classes"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-0.5",children:"Ranked by Average Score"})]})]}),e.jsx(Ge,{icon:e.jsx(fe,{size:22,className:"text-slate-300"}),title:"No class data yet",subtitle:"Import class and student records to see top performers."})]})]})]})};async function ul(){return De("/api/admin/ai-monitoring/summary")}async function gl(){return De("/api/admin/ai-monitoring/refresh",{method:"POST"})}function bl(){const s=Xt(),{data:a,isLoading:n,isError:i,error:l}=xa({queryKey:["ai-monitoring"],queryFn:ul,refetchInterval:3e4,staleTime:15e3});return{data:a,isLoading:n,isError:i,error:l,refetch:async()=>{await gl(),s.invalidateQueries({queryKey:["ai-monitoring"]})}}}const ls=({title:s,value:a,subValue:n,icon:i,badge:l,gradient:o="from-slate-800 to-slate-900"})=>e.jsxs("div",{className:`relative rounded-xl bg-gradient-to-br ${o} p-5 text-white shadow-lg overflow-hidden`,children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-white/60 uppercase tracking-wide",children:s}),e.jsx("p",{className:"text-2xl font-bold",children:a}),n&&e.jsx("p",{className:"text-xs text-white/50",children:n})]}),e.jsx("div",{className:"rounded-lg bg-white/10 p-2",children:i})]}),l&&e.jsx("span",{className:"absolute top-2 right-2 rounded-full bg-amber-400/90 px-2 py-0.5 text-[10px] font-semibold text-amber-900",children:l})]}),fl=({promoExpiresUtc:s,daysUntilPromoEnds:a,fullPriceInputRate:n,fullPriceOutputRate:i})=>{const[l,o]=r.useState(!1),g=r.useMemo(()=>{if(!s)return a;const m=new Date(s).getTime()-Date.now();return Math.max(0,Math.ceil(m/(1e3*60*60*24)))},[s,a]);return l?null:e.jsxs("div",{className:"relative rounded-lg border border-amber-300/50 bg-amber-50 px-4 py-3 text-sm text-amber-900",children:[e.jsx("button",{onClick:()=>o(!0),className:"absolute top-2 right-2 rounded p-1 hover:bg-amber-200/50","aria-label":"Dismiss",children:e.jsx(Ms,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"flex items-start gap-2 pr-6",children:[e.jsx(Fe,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-600"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold",children:"DeepSeek V4 Pro is currently 75% OFF"})," ","(cache-miss: $0.435/1M, output: $0.87/1M). Sale ends May 31, 2026 at 15:59 UTC — ",e.jsxs("strong",{children:[g," days remaining"]}),".",e.jsx("br",{}),e.jsxs("span",{className:"text-amber-700",children:["Full price after sale: $",n,"/1M input · $",i,"/1M output."]})]})]})]})},rt=({title:s,feature:a})=>a?e.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-2",children:s}),e.jsx("p",{className:"text-lg font-bold text-slate-900",children:a.featureName}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-slate-600",children:[e.jsxs("span",{children:["$",a.monthlyCost.toFixed(4)]}),e.jsx("span",{className:"text-slate-300",children:"|"}),e.jsxs("span",{children:[a.totalRequests.toLocaleString()," reqs"]}),e.jsx("span",{className:"text-slate-300",children:"|"}),e.jsxs("span",{children:[(a.cacheHitRate*100).toFixed(0),"% cache"]})]})]}):null,jl=({features:s})=>{const a=[...s].sort((n,i)=>i.monthlyCost-n.monthlyCost);return e.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-3",children:"Resource Breakdown"}),e.jsx("div",{className:"space-y-2",children:a.map(n=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"truncate font-medium text-slate-700",children:n.featureName}),e.jsxs("span",{className:"text-xs text-slate-500",children:["$",n.monthlyCost.toFixed(4)]})]}),e.jsx("div",{className:"mt-1 h-1.5 w-full rounded-full bg-slate-100 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-indigo-500",style:{width:`${Math.min(n.costShare,100)}%`}})})]}),e.jsxs("span",{className:"text-xs text-slate-400 w-10 text-right",children:[n.costShare.toFixed(0),"%"]})]},n.featureId))})]})},vl=({open:s,onClose:a,features:n})=>s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:a,children:e.jsxs("div",{className:"relative w-full max-w-2xl max-h-[80vh] overflow-y-auto rounded-xl bg-white p-6 shadow-xl",onClick:i=>i.stopPropagation(),children:[e.jsx("button",{onClick:a,className:"absolute top-3 right-3 rounded p-1 hover:bg-slate-100","aria-label":"Close",children:e.jsx(Ms,{className:"h-5 w-5 text-slate-500"})}),e.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-4",children:"AI Feature Directory"}),e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-left text-xs text-slate-500 uppercase",children:[e.jsx("th",{className:"pb-2",children:"Feature"}),e.jsx("th",{className:"pb-2",children:"Model"}),e.jsx("th",{className:"pb-2 text-right",children:"Cost"}),e.jsx("th",{className:"pb-2 text-right",children:"Requests"}),e.jsx("th",{className:"pb-2 text-right",children:"Cache Hit"})]})}),e.jsx("tbody",{children:n.map(i=>e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("td",{className:"py-2 font-medium text-slate-800",children:i.featureName}),e.jsx("td",{className:"py-2 text-slate-600",children:i.modelId}),e.jsxs("td",{className:"py-2 text-right",children:["$",i.monthlyCost.toFixed(4)]}),e.jsx("td",{className:"py-2 text-right",children:i.totalRequests.toLocaleString()}),e.jsxs("td",{className:"py-2 text-right",children:[(i.cacheHitRate*100).toFixed(0),"%"]})]},i.featureId))})]})]})}):null,wl=({pricingMeta:s})=>{const[a,n]=r.useState(!1);return e.jsxs("div",{className:"relative inline-block",children:[e.jsx("button",{onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),className:"rounded p-1 text-slate-400 hover:text-slate-600","aria-label":"Pricing info",children:e.jsx(wt,{className:"h-4 w-4"})}),a&&e.jsxs("div",{className:"absolute bottom-full left-1/2 z-50 mb-2 w-64 -translate-x-1/2 rounded-lg border border-slate-200 bg-white p-3 text-xs shadow-lg",children:[e.jsx("p",{className:"font-semibold text-slate-800 mb-1",children:s.isPromotional?"Promotional Pricing (75% OFF)":"Standard Pricing"}),e.jsxs("div",{className:"space-y-1 text-slate-600",children:[e.jsxs("p",{children:["Input (cache miss): ",e.jsxs("strong",{children:["$",s.currentInputCacheMissRate,"/1M"]})]}),e.jsxs("p",{children:["Output: ",e.jsxs("strong",{children:["$",s.currentOutputRate,"/1M"]})]}),s.isPromotional&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"my-1 border-slate-100"}),e.jsxs("p",{className:"text-slate-400",children:["Full price: $",s.fullPriceInputRate,"/1M in · $",s.fullPriceOutputRate,"/1M out"]})]})]})]})]})},Nl=()=>{const{data:s,isLoading:a,refetch:n}=bl(),[i,l]=r.useState(!1),[o,g]=r.useState(!1),m=async()=>{g(!0);try{await n()}finally{g(!1)}};if(a||!s)return e.jsxs("div",{className:"space-y-5 p-1",children:[e.jsx("div",{className:"h-[72px] w-full rounded-xl bg-slate-100 animate-pulse"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"h-4 w-48 rounded bg-slate-100 animate-pulse"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"h-8 w-24 rounded-lg bg-slate-100 animate-pulse"}),e.jsx("div",{className:"h-8 w-20 rounded-lg bg-slate-100 animate-pulse"})]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((h,c)=>e.jsx("div",{className:"h-[120px] rounded-xl bg-gradient-to-br from-slate-100 to-slate-50 animate-pulse"},c))}),e.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:Array.from({length:3}).map((h,c)=>e.jsx("div",{className:"h-[130px] rounded-xl border border-slate-100 bg-slate-50/50 animate-pulse"},c))}),e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-white p-5 space-y-4",children:[e.jsx("div",{className:"h-4 w-40 rounded bg-slate-100 animate-pulse"}),Array.from({length:5}).map((h,c)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-3 w-28 rounded bg-slate-100 animate-pulse"}),e.jsx("div",{className:"flex-1 h-2 rounded-full bg-slate-100 animate-pulse"}),e.jsx("div",{className:"h-3 w-16 rounded bg-slate-100 animate-pulse"})]},c))]})]});const N=s.features.find(h=>h.isTopSpending),v=s.features.find(h=>h.isMostActive);return e.jsxs("div",{className:"space-y-5 p-1",children:[s.promotionalPricingActive&&e.jsx(fl,{promoExpiresUtc:s.pricingMeta.promoExpiresUtc,daysUntilPromoEnds:s.pricingMeta.daysUntilPromoEnds,fullPriceInputRate:s.pricingMeta.fullPriceInputRate,fullPriceOutputRate:s.pricingMeta.fullPriceOutputRate}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wl,{pricingMeta:s.pricingMeta}),e.jsxs("span",{className:"text-xs text-slate-400",children:["Last updated: ",new Date(s.lastUpdated).toLocaleTimeString()]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>l(!0),className:"inline-flex items-center gap-1.5 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-xs font-medium text-slate-700 hover:bg-slate-50",children:[e.jsx(Ta,{className:"h-3.5 w-3.5"})," Directory"]}),e.jsxs("button",{onClick:m,disabled:o,className:"inline-flex items-center gap-1.5 rounded-lg bg-indigo-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:[e.jsx(Me,{className:`h-3.5 w-3.5 ${o?"animate-spin":""}`})," Refresh"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(ls,{title:"Monthly Cost",value:`$${s.monthlyCost.toFixed(2)}`,subValue:`Would be ~$${s.estimatedCostAfterPromo.toFixed(2)} at full price`,icon:e.jsx(ma,{className:"h-5 w-5"}),gradient:"from-emerald-600 to-emerald-800"}),e.jsx(ls,{title:"Active Engine",value:s.activeEngine,subValue:s.engineTier,icon:e.jsx(it,{className:"h-5 w-5"}),badge:s.promotionalPricingActive?"75% OFF until May 31":void 0,gradient:"from-indigo-600 to-indigo-800"}),e.jsx(ls,{title:"Total Requests",value:s.totalUsage.toLocaleString(),subValue:s.billingCycleLabel,icon:e.jsx(_e,{className:"h-5 w-5"}),gradient:"from-violet-600 to-violet-800"}),e.jsx(ls,{title:"Cache Efficiency",value:`${(s.cacheHitRate*100).toFixed(1)}%`,subValue:"Cache hits: $0.003625/1M vs miss: $0.435/1M",icon:e.jsx(fe,{className:"h-5 w-5"}),gradient:"from-sky-600 to-sky-800"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsx(rt,{title:"Top Spending",feature:N}),e.jsx(rt,{title:"Most Active",feature:v}),e.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-2",children:"Cost Breakdown"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:"Cache Hit"}),e.jsxs("span",{className:"font-medium",children:["$",s.costBreakdown.cacheHitCost.toFixed(6)]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:"Cache Miss"}),e.jsxs("span",{className:"font-medium",children:["$",s.costBreakdown.cacheMissCost.toFixed(6)]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:"Output"}),e.jsxs("span",{className:"font-medium",children:["$",s.costBreakdown.outputCost.toFixed(6)]})]})]})]})]}),e.jsx(jl,{features:s.features}),e.jsx(vl,{open:i,onClose:()=>l(!1),features:s.features})]})},Le=rs.map(s=>({id:s.id,name:s.name,code:s.code,gradeLevel:s.gradeLevel,semester:s.semester,color:s.color})),yl=()=>{const{userProfile:s}=cs(),{availability:a,loading:n,error:i}=pa(),[l,o]=r.useState(null),[g,m]=r.useState({}),N=r.useCallback(async(c,x)=>{if(!s?.uid){S.error("You must be logged in as admin to change availability");return}o(c);try{await ua(c,x,s.uid),S.success(`${Le.find(f=>f.id===c)?.name||c} is now ${x?"available":"locked"}`)}catch(f){S.error("Failed to update subject availability"),console.error(f)}finally{o(null)}},[s?.uid]),v=r.useCallback((c,x)=>{m(f=>({...f,[c]:x}))},[]),h=r.useCallback(async c=>{if(!s?.uid){S.error("You must be logged in as admin");return}const x=g[c]?.trim()||null;o(c);try{await ga(c,x,s.uid),S.success("PDF path updated")}catch(f){S.error("Failed to update PDF path"),console.error(f)}finally{o(null)}},[g,s?.uid]);return e.jsxs("div",{className:"flex flex-col min-h-full space-y-8 pt-6 xl:pt-8 animate-in fade-in slide-in-from-bottom-4 duration-700 pb-6",children:[n&&e.jsx("div",{className:"flex items-center justify-end px-2",children:e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 bg-indigo-50 text-indigo-600 rounded-2xl border border-indigo-100 animate-pulse",children:[e.jsx(V,{size:16,className:"animate-spin"}),e.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Syncing Subject Cloud Data..."})]})}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Total Subjects",value:Le.length,icon:He,bg:"bg-[#4f46e5]",shadow:"shadow-indigo-500/20"},{label:"Available",value:Le.filter(c=>a[c.id]?.available!==!1).length,icon:La,bg:"bg-[#10b981]",shadow:"shadow-emerald-500/20"},{label:"Locked",value:Le.filter(c=>a[c.id]?.available===!1).length,icon:dt,bg:"bg-[#ef4444]",shadow:"shadow-rose-500/20"},{label:"RAG Sources",value:Le.filter(c=>a[c.id]?.pdfPath).length,icon:Ce,bg:"bg-[#8b5cf6]",shadow:"shadow-purple-500/20"}].map((c,x)=>e.jsxs("div",{className:`relative overflow-hidden ${c.bg} ${c.shadow} p-5 rounded-[28px] text-white flex flex-col gap-3 group hover:scale-[1.02] transition-all duration-300 shadow-lg`,children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-700 ease-out"}),e.jsxs("div",{className:"relative z-10 flex items-center justify-between",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] opacity-80",children:c.label}),e.jsx("div",{className:"bg-white/20 p-2 rounded-xl backdrop-blur-sm",children:e.jsx(c.icon,{size:14})})]}),e.jsx("h3",{className:"relative z-10 text-3xl font-display font-black leading-none tracking-tight",children:c.value})]},x))}),i&&e.jsxs("div",{className:"rounded-2xl border border-rose-200 bg-rose-50 px-6 py-4 flex items-center gap-3 animate-in shake duration-500",children:[e.jsx(Re,{className:"text-rose-600",size:20}),e.jsx("p",{className:"text-sm font-bold text-rose-700",children:i})]}),e.jsx("div",{className:"bg-white rounded-[32px] border border-slate-200/60 shadow-sm shadow-slate-200/50 overflow-hidden relative",children:e.jsxs(kt,{className:"w-full text-left border-collapse",children:[e.jsx(St,{children:e.jsxs(Ie,{className:"bg-[#9956DE] hover:bg-[#9956DE] border-b border-[#8b5cf6] sticky top-0 z-20 shadow-md",children:[e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Subject Identity"}),e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Grade / Semester"}),e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Access Status"}),e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"Toggle Access"}),e.jsx(ge,{className:"px-6 py-5 text-[11px] font-black text-white uppercase tracking-widest",children:"RAG Resource Mapping"})]})}),e.jsx(Ct,{className:"divide-y divide-slate-50",children:Le.map(c=>{const x=a[c.id],f=x?.available??!0,w=g[c.id]??x?.pdfPath??"",A=x?.lastUpdated,u=l===c.id;return e.jsxs(Ie,{className:"group hover:bg-slate-50/50 transition-all",children:[e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-2xl bg-gradient-to-br ${c.color} flex items-center justify-center text-white shadow-lg shadow-indigo-100 group-hover:scale-110 transition-transform duration-500`,children:e.jsx(He,{size:20,className:"drop-shadow-sm"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-black text-[#1e293b] truncate text-sm leading-tight group-hover:text-indigo-600 transition-colors",children:c.name}),e.jsx("p",{className:"text-[11px] font-black text-slate-400 uppercase tracking-tighter mt-1",children:c.code})]})]})}),e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-black text-slate-700 uppercase tracking-wide",children:c.gradeLevel}),e.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-tight",children:c.semester})]})}),e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("span",{className:` inline-flex items-center gap-1.5 px-3 py-1.5 rounded-2xl text-[10px] font-black uppercase tracking-wider border - ${v?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-slate-50 text-slate-400 border-slate-100"} - `,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${v?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),v?"Available":"Locked"]}),D&&e.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-tighter ml-1 flex items-center gap-1",children:[e.jsx(Rs,{size:10}),"Updated: ",D.toLocaleString()]})]})}),e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ha,{checked:v,onCheckedChange:y=>w(c.id,y),disabled:u,className:"data-[state=checked]:bg-emerald-500 data-[state=unchecked]:bg-slate-200","aria-label":`Toggle ${c.name} availability`}),u&&e.jsx(V,{size:16,className:"animate-spin text-indigo-500"})]})}),e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 group/input",children:[e.jsx(Ce,{size:14,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within/input:text-indigo-500 transition-colors"}),e.jsx(xe,{value:N,onChange:y=>f(c.id,y.target.value),placeholder:"Firebase path (e.g., rag/calculus.pdf)",className:"pl-10 h-10 text-xs font-bold rounded-xl bg-slate-50/50 border-slate-200 focus-visible:ring-indigo-500/20 focus-visible:border-indigo-500 transition-all",disabled:u})]}),e.jsx(A,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-xl text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 transition-all",onClick:()=>d(c.id),disabled:u,title:"Save PDF Path",children:u?e.jsx(V,{size:18,className:"animate-spin text-indigo-500"}):e.jsx(Nt,{size:18})})]})})]},c.id)})})]})})]})},kl=()=>{const[s,a]=l.useState([]),[n,i]=l.useState([]),[r,o]=l.useState(!0),[g,m]=l.useState(null),[w,f]=l.useState({});l.useEffect(()=>{d()},[]);const d=async()=>{o(!0);try{const v=(await F(I(M,"classrooms"))).docs.map(z=>({id:z.id,...z.data()}));a(v);const N=ve(I(M,"users"),Ve("role","==","teacher")),u=(await F(N)).docs.map(z=>{const T=z.data();return{uid:z.id,name:T.name||T.displayName||"Teacher",email:T.email||""}});i(u);const y={};v.forEach(z=>{z.managerId&&(y[z.id]=z.managerId)}),f(y)}catch{S.error("Failed to load class data")}finally{o(!1)}},c=async p=>{const v=w[p];if(!v){S.error("Select a teacher first");return}const N=n.find(D=>D.uid===v);if(N){m(p);try{await ws(Es(M,"classrooms",p),{managerId:N.uid,managerName:N.name});const D=Es(M,"classSectionOwnership",p),u=await F(ve(I(M,"classSectionOwnership"),Ve("classSectionId","==",p)));if(u.docs.length>0)await ws(u.docs[0].ref,{managerId:N.uid,managerName:N.name});else try{await ws(D,{managerId:N.uid,managerName:N.name})}catch{}a(y=>y.map(z=>z.id===p?{...z,managerId:N.uid,managerName:N.name}:z)),S.success(`Assigned ${N.name} as manager`)}catch{S.error("Failed to assign manager")}finally{m(null)}}};return r?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"w-8 h-8 border-2 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx("div",{className:"bg-white rounded-xl p-5 border border-slate-200 shadow-sm",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-50 flex items-center justify-center",children:e.jsx(nt,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[24px] font-bold text-slate-900",children:s.length}),e.jsx("p",{className:"text-[12px] text-slate-500 font-medium",children:"Total Classes"})]})]})}),e.jsx("div",{className:"bg-white rounded-xl p-5 border border-slate-200 shadow-sm",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-emerald-50 flex items-center justify-center",children:e.jsx(qe,{className:"w-5 h-5 text-emerald-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[24px] font-bold text-slate-900",children:s.filter(p=>p.managerId).length}),e.jsx("p",{className:"text-[12px] text-slate-500 font-medium",children:"With Manager"})]})]})}),e.jsx("div",{className:"bg-white rounded-xl p-5 border border-slate-200 shadow-sm",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-50 flex items-center justify-center",children:e.jsx(Pe,{className:"w-5 h-5 text-amber-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[24px] font-bold text-slate-900",children:s.filter(p=>!p.managerId).length}),e.jsx("p",{className:"text-[12px] text-slate-500 font-medium",children:"Unassigned"})]})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsx("h3",{className:"text-[15px] font-bold text-slate-900",children:"All Classes"})}),e.jsx("div",{className:"divide-y divide-slate-100",children:s.length===0?e.jsx("div",{className:"px-6 py-12 text-center text-slate-500 text-[13px]",children:"No classes found."}):s.map(p=>e.jsxs("div",{className:"px-6 py-4 flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[14px] font-semibold text-slate-900 truncate",children:p.name}),e.jsxs("p",{className:"text-[12px] text-slate-500",children:[p.gradeLevel||""," ",p.section?`• ${p.section}`:""," ",p.studentCount?`• ${p.studentCount} students`:""]}),p.managerName&&e.jsxs("p",{className:"text-[11px] text-emerald-600 font-medium mt-0.5",children:["Manager: ",p.managerName]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:w[p.id]||"",onChange:v=>f(N=>({...N,[p.id]:v.target.value})),className:"appearance-none bg-slate-50 border border-slate-200 text-slate-700 text-[12px] font-semibold rounded-lg pl-3 pr-8 py-2 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100 w-[220px]",children:[e.jsx("option",{value:"",children:"Select teacher..."}),n.map(v=>e.jsxs("option",{value:v.uid,children:[v.name," (",v.email,")"]},v.uid))]}),e.jsx(ba,{className:"w-3.5 h-3.5 text-slate-400 absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsx("button",{onClick:()=>c(p.id),disabled:!w[p.id]||g===p.id,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-[12px] font-bold rounded-lg disabled:opacity-50 transition-colors whitespace-nowrap",children:g===p.id?"...":"Assign"})]})]},p.id))})]})]})},Sl=({isOpen:s,onClose:a})=>s?e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 sm:p-6",children:[e.jsx("div",{className:"absolute inset-0 bg-slate-900/40 backdrop-blur-sm animate-in fade-in duration-300",onClick:a}),e.jsxs("div",{className:"relative bg-white w-full max-w-4xl rounded-[40px] shadow-2xl border border-slate-200 overflow-hidden animate-in zoom-in slide-in-from-bottom-8 duration-500",children:[e.jsxs("div",{className:"px-10 pt-10 pb-6 flex items-center justify-between border-b border-slate-50 bg-slate-50/50",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-[#1e293b] uppercase tracking-wider",children:"How It Works: Subject Governance"}),e.jsx("p",{className:"text-[11px] font-black text-indigo-500 uppercase tracking-[0.2em] mt-1",children:"Platform Curriculum Protocol & RAG Workflow"})]}),e.jsx("button",{onClick:a,className:"w-12 h-12 rounded-2xl flex items-center justify-center bg-white text-slate-400 hover:text-rose-500 hover:bg-rose-50 transition-all border border-slate-200 shadow-sm group",children:e.jsx(Ms,{size:20,className:"group-hover:rotate-90 transition-transform duration-300"})})]}),e.jsx("div",{className:"p-12",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-12 relative",children:[e.jsx("div",{className:"absolute top-12 left-0 right-0 h-0.5 border-t-2 border-dashed border-indigo-100 hidden md:block z-0",style:{left:"10%",right:"10%"}}),[{step:"1",title:"Define Identity",desc:"Assign subject codes and grade levels in the core registry.",icon:He,color:"text-indigo-600",bg:"bg-indigo-50"},{step:"2",title:"Map RAG Source",desc:"Link Firebase PDF paths to the AI Knowledge Base.",icon:Fe,color:"text-amber-600",bg:"bg-amber-50"},{step:"3",title:"Global Toggle",desc:"Enable or lock subject access across all dashboards instantly.",icon:Kt,color:"text-emerald-600",bg:"bg-emerald-50"},{step:"4",title:"Audit Sync",desc:"Every modification is logged and synced to the cloud registry.",icon:zs,color:"text-purple-600",bg:"bg-purple-50"}].map((n,i)=>e.jsxs("div",{className:"flex-1 flex flex-col items-center text-center group relative z-10",children:[e.jsxs("div",{className:`relative mb-6 w-24 h-24 ${n.bg} rounded-[32px] flex items-center justify-center transition-all duration-500 group-hover:scale-110 group-hover:rotate-3 shadow-lg shadow-indigo-100/20`,children:[e.jsx(n.icon,{size:36,className:`${n.color} drop-shadow-sm`}),e.jsx("div",{className:"absolute -top-3 -left-3 bg-[#9956DE] text-white text-[12px] font-black w-10 h-10 rounded-2xl flex items-center justify-center shadow-lg border-2 border-white",children:n.step})]}),e.jsx("h4",{className:"text-sm font-black text-[#1e293b] uppercase tracking-wide mb-2",children:n.title}),e.jsx("p",{className:"text-xs text-slate-400 font-bold leading-relaxed max-w-[180px]",children:n.desc})]},i))]})}),e.jsxs("div",{className:"px-12 py-6 bg-slate-50/50 border-t border-slate-100 flex items-center justify-center gap-4",children:[e.jsx("div",{className:"flex -space-x-2",children:[1,2,3].map(n=>e.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-white bg-indigo-100 flex items-center justify-center",children:e.jsx("div",{className:"w-4 h-4 rounded-full bg-indigo-500 animate-pulse"})},n))}),e.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Platform Governance Active & Monitored"})]})]})]}):null,Nr=({onLogout:s,onOpenProfile:a,onOpenSettings:n})=>{const{userProfile:i}=cs(),[r,o]=l.useState("Overview"),[g,m]=l.useState(!1),[w,f]=l.useState(!1),[d,c]=l.useState(!1),[p,v]=l.useState(null),[N,D]=l.useState(null),[u,y]=l.useState([]),[z,T]=l.useState([]),[q,me]=l.useState(!0),[he,Ne]=l.useState([]),[_,pe]=l.useState(null),[Q,X]=l.useState([]),[L,te]=l.useState(null),[O,K]=l.useState(null),[ne,B]=l.useState(null),[ce,x]=l.useState(!1),{unreadCount:ae}=Yt(),[h,P]=l.useState(!1),[H,Y]=l.useState(!1),G=k=>(r===k||(o(k),k==="Subjects"&&(Y(!0),setTimeout(()=>Y(!1),2e3))),!0),Xe=k=>{G(k)&&c(!1)};l.useEffect(()=>{if(r!=="Overview"||!i)return;const k=String(i.role||"").toLowerCase(),$=k==="admin"||k==="teacher";let oe=!1;return me(!0),Promise.all([Xa(),$?Et():Promise.resolve([]),Qa(3),Ka(),Ya(),Za(),Ja(),el(),Se.getInferenceMetrics().catch(()=>null)]).then(([Ae,Ts,ds,Ee,xs,Be,$e,Qe,le])=>{oe||(D(Ae),y(Ts.slice(0,4)),T(ds),Ne(Ee),X(xs),te(Be),K($e),B(Qe),le&&pe(le.metrics))}).catch(console.error).finally(()=>{oe||me(!1)}),()=>{oe=!0}},[r,i]);const Oe=[{label:"Active Teachers",value:(N?.activeTeachers??0).toString(),icon:is,color:"bg-teal-100",iconColor:"text-teal-600"},{label:"Total Classes",value:(N?.totalClasses??0).toString(),icon:He,color:"bg-indigo-100",iconColor:"text-indigo-600"},{label:"XP Events",value:(N?.aiPredictions??0).toLocaleString(),icon:Fe,color:"bg-amber-100",iconColor:"text-amber-600"},{label:"At-Risk Alerts",value:(N?.atRiskStudents??0).toString(),icon:Re,color:"bg-rose-100",iconColor:"text-rose-600"}];return e.jsxs("div",{className:"flex h-screen w-full bg-[#f8fafc] overflow-hidden font-body",children:[e.jsx("div",{className:"hidden lg:block",children:e.jsx(qs,{activeTab:r,setActiveTab:Xe,userRole:"admin",onOpenSettings:()=>n?.(),onLogout:()=>m(!0),sidebarCollapsed:w,setSidebarCollapsed:f})}),d&&e.jsxs(e.Fragment,{children:[e.jsx("button",{"aria-label":"Close navigation",className:"fixed inset-0 z-40 bg-slate-900/40 backdrop-blur-[1px] lg:hidden",onClick:()=>c(!1)}),e.jsx("div",{className:"fixed inset-y-0 left-0 z-50 p-3 lg:hidden",children:e.jsx(qs,{mode:"mobile",onRequestClose:()=>c(!1),activeTab:r,setActiveTab:Xe,userRole:"admin",onOpenSettings:()=>n?.(),onLogout:()=>{m(!0),c(!1)},sidebarCollapsed:!1})})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("header",{className:"bg-transparent border-b border-[#e2e8f0]/40 px-[24px] xl:px-[32px] pt-[24px] pb-[16px] flex-shrink-0 z-30",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-4 mb-0",children:[e.jsxs("div",{className:"flex-1 flex items-start gap-3",children:[e.jsx("button",{type:"button",onClick:()=>c(!0),className:"lg:hidden mt-1 p-2 rounded-lg border border-[#dde3eb] bg-white text-[#5a6578] hover:bg-[#edf1f7] transition-colors","aria-label":"Open navigation",children:e.jsx(Zt,{size:18})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-[26px] font-bold text-[#1e293b] tracking-tight leading-tight",children:[r==="Overview"&&"Admin Dashboard",r==="Content"&&"Content",r==="Audit Log"&&"Audit Log",r==="User Management"&&"User Management",r==="Analytics"&&"Analytics",r==="AI Monitoring"&&"AI Monitoring",r==="Subjects"&&"Curriculum Control",r==="Class Management"&&"Class Management"]}),e.jsxs("p",{className:"text-[13px] text-[#64748b] mt-1",children:[r==="Overview"&&"System Overview & Management",r==="Content"&&"Upload PDFs for AI-powered content.",r==="Audit Log"&&"Monitor system activity and security.",r==="User Management"&&"Manage all user accounts and roles.",r==="Analytics"&&"Detailed system performance metrics.",r==="AI Monitoring"&&"Platform AI usage and system health.",r==="Subjects"&&"Manage academic subjects, availability, and RAG knowledge sources.",r==="Class Management"&&"Assign section managers and manage class rosters."]})]}),r==="Overview"&&e.jsxs("div",{className:"hidden xl:flex items-center gap-2 ml-4 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#4f46e5]/10 border border-[#4f46e5]/20 rounded-lg",children:[e.jsx(Pe,{size:13,className:"text-[#4f46e5]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#4f46e5]",children:[(N?.totalStudents??0).toLocaleString()," students"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#0ea5e9]/10 border border-[#0ea5e9]/20 rounded-lg",children:[e.jsx(is,{size:13,className:"text-[#0ea5e9]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#0ea5e9]",children:[N?.activeTeachers??0," teachers"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[e.jsx(Fe,{size:13,className:"text-amber-600"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-amber-600",children:[(N?.aiPredictions??0).toLocaleString()," XP events"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[r==="Subjects"&&e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>P(!0),className:"relative w-10 h-10 flex items-center justify-center bg-indigo-600 hover:bg-indigo-700 rounded-full shadow-lg shadow-indigo-200 text-white transition-all cursor-pointer hover:scale-110 active:scale-95 animate-in zoom-in duration-300","aria-label":"How it works",children:e.jsx(fa,{size:20})}),H&&e.jsxs("div",{className:"absolute top-12 left-1/2 -translate-x-1/2 px-3 py-1.5 bg-[#1e293b] text-white text-[10px] font-black uppercase tracking-widest rounded-lg shadow-xl whitespace-nowrap animate-in fade-in slide-in-from-top-2 duration-300 z-50",children:["How It Works?",e.jsx("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-[#1e293b] rotate-45"})]})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>x(!ce),className:"relative w-10 h-10 flex items-center justify-center bg-white/60 hover:bg-white/80 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50 text-[#64748b] hover:text-[#1e293b] transition-colors cursor-pointer hover:scale-[1.02]","aria-label":"View notifications",children:[e.jsx(ja,{size:18}),ae>0&&e.jsx("span",{className:"absolute top-2.5 right-2.5 w-2 h-2 bg-rose-500 rounded-full border border-white"})]}),e.jsx(aa,{isOpen:ce,onClose:()=>x(!1),onViewAll:()=>G("Audit Log")})]}),e.jsxs("div",{onClick:a,className:"flex items-center gap-2 bg-white/60 px-4 py-2 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50 cursor-pointer hover:bg-white/80 transition-colors h-10 hover:scale-[1.02]",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-indigo-100 overflow-hidden shrink-0",children:e.jsx(Jt,{src:i?.photo,name:i?.name||"Admin",gender:i?.gender,className:"w-full h-full object-cover"})}),e.jsx("span",{className:"text-[13px] font-semibold text-[#1e293b]",children:i?.name||"Admin"})]})]})]})}),e.jsxs("main",{className:`flex-1 overflow-y-auto px-[24px] xl:px-[32px] scrollbar-hide ${["User Management","Audit Log"].includes(r)?"pb-0":"pb-[32px]"}`,children:[r==="Overview"&&e.jsxs("div",{className:"max-w-[1600px] mx-auto space-y-8 pt-6 xl:pt-8",children:[e.jsxs("div",{className:"grid grid-cols-12 gap-6 h-[170px]",children:[e.jsxs("div",{className:"col-span-12 xl:col-span-4 h-full bg-gradient-to-br from-[#4f46e5] to-[#7c3aed] rounded-[28px] p-6 relative overflow-hidden shadow-sm shadow-indigo-500/10 group",children:[e.jsx("div",{className:"absolute -top-24 -right-24 w-64 h-64 bg-white/10 rounded-full blur-3xl group-hover:bg-white/20 transition-all duration-1000"}),e.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-white/70 text-[10px] font-black uppercase tracking-[0.2em] mb-1.5",children:"Platform Overview"}),e.jsx("p",{className:"text-white text-4xl font-display font-black tracking-tighter leading-none",children:q?"...":(N?.totalStudents??0).toLocaleString()}),e.jsx("p",{className:"text-white/80 text-xs font-medium mt-1",children:"Total Active Students"})]}),e.jsxs("div",{className:"flex items-center gap-2 py-1 px-3 bg-white/10 backdrop-blur-md rounded-full w-fit border border-white/10",children:[e.jsx(mt,{size:12,className:"text-emerald-400"}),e.jsxs("span",{className:"text-white text-[10px] font-bold tracking-wide",children:[N?.activeTeachers??0," teachers · ",N?.totalClasses??0," classes"]})]})]}),e.jsx("div",{className:"absolute -bottom-6 -right-6 opacity-10 group-hover:scale-110 group-hover:rotate-6 transition-all duration-700 pointer-events-none",children:e.jsx(Pe,{size:140,className:"text-white"})})]}),e.jsx("div",{className:"col-span-12 xl:col-span-8 h-full bg-white border border-slate-200/60 rounded-[28px] px-2 py-5 flex items-center shadow-sm shadow-slate-200/50",children:e.jsx("div",{className:"grid grid-cols-4 w-full h-full",children:Oe.map((k,$)=>e.jsxs("div",{className:`flex flex-col justify-center px-8 ${$!==3?"border-r border-slate-100":""}`,children:[e.jsx("div",{className:`w-10 h-10 ${k.color} rounded-xl flex items-center justify-center mb-3 shadow-sm`,children:e.jsx(k.icon,{size:20,className:k.iconColor})}),e.jsx("p",{className:"text-[24px] font-display font-black text-[#1e293b] leading-tight tracking-tight",children:q?"...":k.value}),e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-[0.15em] mt-0.5",children:k.label})]},$))})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-6 min-h-[330px]",children:[e.jsxs("div",{className:"col-span-12 xl:col-span-5 bg-white rounded-[28px] border border-slate-200/60 p-6 flex flex-col shadow-sm shadow-slate-200/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[16px] font-bold text-[#1e293b]",children:"System Performance"}),e.jsx("p",{className:"text-[11px] text-slate-400 font-medium",children:"AI vs Manual Activity"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-slate-50 rounded-lg",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-[#6366f1]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-wider",children:"AI"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-slate-50 rounded-lg",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-slate-200"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-wider",children:"Manual"})]})]})]}),e.jsx("div",{className:"flex-1 w-full min-h-[200px]",children:e.jsx(Zs,{width:"100%",height:"100%",children:e.jsxs(va,{data:he,margin:{top:0,right:0,left:-20,bottom:0},children:[e.jsx(wa,{strokeDasharray:"4 4",vertical:!1,stroke:"#f1f5f9"}),e.jsx(Na,{dataKey:"name",axisLine:!1,tickLine:!1,tick:{fontSize:9,fontWeight:800,fill:"#cbd5e1"},dy:10}),e.jsx(ya,{axisLine:!1,tickLine:!1,tick:{fontSize:9,fontWeight:800,fill:"#cbd5e1"}}),e.jsx(ka,{contentStyle:{borderRadius:"12px",border:"none",boxShadow:"0 15px 20px -5px rgb(0 0 0 / 0.1)",padding:"10px"},cursor:{fill:"#f8fafc"}}),e.jsx(Js,{dataKey:"ai",fill:"#6366f1",radius:[4,4,0,0],barSize:12}),e.jsx(Js,{dataKey:"man",fill:"#e2e8f0",radius:[4,4,0,0],barSize:12})]})})})]}),e.jsxs("div",{className:"col-span-12 xl:col-span-4 bg-white rounded-[28px] border border-slate-200/60 p-6 flex flex-col shadow-sm shadow-slate-200/50 group",children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[16px] font-bold text-[#1e293b]",children:"AI Model Status"}),e.jsx("p",{className:"text-[11px] text-slate-400 font-medium",children:"Success Rate"})]}),e.jsx("div",{className:"w-9 h-9 bg-indigo-50 rounded-xl flex items-center justify-center",children:e.jsx(_e,{size:16,className:"text-indigo-600"})})]}),e.jsx("div",{className:"flex items-baseline gap-2 mb-4",children:_?(()=>{const k=_.requests_ok+_.requests_error,$=k>0?Math.round(_.requests_ok/k*100):100,oe=$>=90;return e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-[38px] font-display font-black text-indigo-600 tracking-tighter leading-none",children:[$,"%"]}),e.jsx("span",{className:`text-[10px] font-black px-2 py-0.5 rounded-full uppercase tracking-wider ${oe?"text-emerald-500 bg-emerald-50":"text-amber-500 bg-amber-50"}`,children:oe?"Optimal":`${_.requests_error} errors`})]})})():e.jsx("span",{className:"text-[38px] font-display font-black text-indigo-600 tracking-tighter leading-none",children:"..."})}),e.jsx("div",{className:"flex-1 flex flex-col justify-center gap-3",children:_&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-3 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-indigo-500 rounded-full",style:{width:`${Math.round(_.requests_ok/(_.requests_ok+_.requests_error||1)*100)}%`}})})}),e.jsxs("div",{className:"flex justify-between text-[10px] font-bold text-slate-400",children:[e.jsxs("span",{children:[_.requests_ok.toLocaleString()," OK"]}),e.jsxs("span",{children:[_.requests_error.toLocaleString()," failed"]})]}),e.jsxs("p",{className:"text-[10px] text-slate-400",children:[_.requests_total.toLocaleString()," total attempts · ",_.retries_total.toLocaleString()," retries"]})]})}),e.jsxs("button",{onClick:()=>o("AI Monitoring"),className:"w-full mt-4 py-3 bg-slate-50 text-[#1e293b] text-[11px] font-black uppercase tracking-[0.15em] rounded-xl hover:bg-indigo-600 hover:text-white transition-all flex items-center justify-center gap-2.5 group/btn",children:["Health Check ",e.jsx(Ea,{size:14,className:"group-hover/btn:translate-x-0.5 group-hover/btn:-translate-y-0.5 transition-transform"})]})]}),e.jsxs("div",{className:"col-span-12 xl:col-span-3 flex flex-col gap-4",children:[e.jsx("h3",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] pl-2",children:"Top Performers"}),e.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[q?e.jsx("div",{className:"flex-1 flex items-center justify-center bg-white rounded-[28px] border border-slate-100",children:e.jsx(V,{size:24,className:"animate-spin text-slate-200"})}):z.slice(0,2).map((k,$)=>e.jsxs("div",{className:`relative rounded-[28px] border p-4 shadow-sm shadow-slate-200/50 transition-all cursor-pointer group overflow-hidden ${$===0?"bg-gradient-to-br from-emerald-50 to-white border-emerald-200/50":"bg-gradient-to-br from-indigo-50 to-white border-indigo-200/50"}`,children:[e.jsx("div",{className:`absolute -top-12 -right-12 w-32 h-32 rounded-full blur-2xl opacity-20 transition-all duration-700 group-hover:scale-125 ${$===0?"bg-emerald-400":"bg-indigo-400"}`}),e.jsxs("div",{className:"flex items-center gap-3 relative z-10",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("div",{className:`p-[3px] rounded-[20px] shadow-sm ${$===0?"bg-gradient-to-tr from-emerald-500 to-emerald-200":"bg-gradient-to-tr from-indigo-500 to-indigo-200"}`,children:e.jsx("img",{src:k.avatar,alt:"",className:"w-11 h-11 rounded-[17px] object-cover bg-white"})}),e.jsx("div",{className:`absolute -top-2 -right-2 w-6 h-6 text-[10px] font-black rounded-full flex items-center justify-center border-2 border-white shadow-md ${$===0?"bg-emerald-500 text-white":"bg-indigo-500 text-white"}`,children:$===0?e.jsx(tt,{size:16,className:"text-amber-500"}):e.jsx(tt,{size:16,className:"text-slate-400"})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:`text-[13px] font-black truncate transition-colors ${$===0?"text-emerald-900 group-hover:text-emerald-600":"text-indigo-900 group-hover:text-indigo-600"}`,children:k.name}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:e.jsx("span",{className:`text-[8px] font-black uppercase tracking-widest px-1.5 py-0.5 rounded-md ${$===0?"bg-emerald-500/10 text-emerald-600":"bg-indigo-500/10 text-indigo-600"}`,children:k.class})})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:`text-xl font-display font-black leading-none ${$===0?"text-emerald-600":"text-indigo-600"}`,children:[k.performance,"%"]}),e.jsx("p",{className:"text-[7px] font-black text-slate-400 uppercase tracking-tighter mt-1",children:"Mastery"})]})]})]},k.id)),e.jsx("button",{onClick:()=>o("Analytics"),className:"mt-auto py-2.5 text-[10px] font-black text-indigo-600 uppercase tracking-[0.2em] text-center bg-white border border-slate-200/60 rounded-xl hover:bg-slate-50 transition-all shadow-sm shadow-slate-200/50",children:"All Rankings"})]})]})]}),e.jsxs("div",{className:"flex flex-col xl:flex-row gap-6 pb-8 items-stretch",children:[e.jsxs("div",{className:"w-full xl:w-1/3 flex flex-col gap-6",children:[e.jsxs("div",{className:"bg-[#1e293b] rounded-[28px] p-6 text-white shadow-sm shadow-slate-900/10 relative overflow-hidden group min-h-[190px] flex flex-col justify-between shrink-0",children:[e.jsx("div",{className:"absolute -bottom-10 -right-10 opacity-5 group-hover:scale-110 group-hover:-rotate-12 transition-all duration-700 pointer-events-none",children:(L?.atRiskCount??0)>0?e.jsx(Re,{size:200}):e.jsx(Ns,{size:200})}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:`w-10 h-10 ${(L?.atRiskCount??0)>0?"bg-rose-500 shadow-rose-500/20":"bg-emerald-500 shadow-emerald-500/20"} rounded-xl flex items-center justify-center mb-4 shadow-lg`,children:(L?.atRiskCount??0)>0?e.jsx(Re,{size:18,className:"text-white"}):e.jsx(Ns,{size:18,className:"text-white"})}),e.jsxs("div",{className:"px-2.5 py-1 bg-white/10 backdrop-blur-md rounded-full border border-white/10 flex items-center gap-2",children:[e.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${(L?.atRiskCount??0)>0?"bg-rose-500 animate-pulse":"bg-emerald-400"}`}),e.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:(L?.atRiskCount??0)>0?"Urgent":"All Clear"})]})]}),e.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] mb-0.5",children:(L?.atRiskCount??0)>0?"Priority Attention":"Status"}),e.jsx("h3",{className:"text-xl font-display font-black tracking-tight leading-tight",children:(L?.atRiskCount??0)>0?L?.subjectName:"No At-Risk Students"})]}),e.jsxs("div",{className:"relative z-10 pt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-slate-400",children:(L?.atRiskCount??0)>0?`${L.atRiskCount} At-Risk Student${L.atRiskCount!==1?"s":""}`:"All students on track"}),(L?.atRiskCount??0)>0&&e.jsx("button",{onClick:()=>o("Analytics"),className:"text-[10px] font-black uppercase tracking-widest text-indigo-400 hover:text-indigo-300 transition-colors",children:"Review"})]})]}),e.jsxs("div",{className:"bg-white rounded-[28px] border border-slate-200/60 p-7 flex flex-col items-center justify-center shadow-sm shadow-slate-200/50 relative overflow-hidden flex-1",children:[e.jsxs("div",{className:"absolute top-7 left-8",children:[e.jsx("h3",{className:"text-[14px] font-bold text-[#1e293b]",children:"Global Mastery"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-medium",children:"Average performance"})]}),e.jsxs("div",{className:"relative w-40 h-40 mt-6",children:[e.jsx(Zs,{width:"100%",height:"100%",children:e.jsx(Sa,{children:e.jsxs(Ca,{data:[{name:"Mastery",value:O?.avgMastery??0},{name:"Remaining",value:100-(O?.avgMastery??0)}],cx:"50%",cy:"50%",innerRadius:55,outerRadius:75,paddingAngle:8,dataKey:"value",startAngle:90,endAngle:450,stroke:"none",children:[e.jsx(et,{fill:"#6366f1"}),e.jsx(et,{fill:"#f1f5f9"})]})})}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsxs("span",{className:"text-[36px] font-display font-black text-[#1e293b] leading-none",children:[O?.avgMastery??0,"%"]}),e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-[0.1em] mt-1",children:"Overall"})]})]}),e.jsxs("div",{className:"mt-8 flex items-center gap-12",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xl font-display font-black text-indigo-600 leading-none",children:(O?.passed??0).toLocaleString()}),e.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mt-1",children:"Passed"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xl font-display font-black text-slate-300 leading-none",children:(O?.pending??0).toLocaleString()}),e.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mt-1",children:"Pending"})]})]}),e.jsx("div",{className:"absolute bottom-0 left-0 w-full h-1 bg-gradient-to-r from-indigo-500/20 to-purple-500/20"})]})]}),e.jsxs("div",{className:"w-full xl:w-2/3 flex flex-col gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[28px] border border-slate-200/60 shadow-sm shadow-slate-200/50 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-slate-50 flex items-center justify-between bg-slate-50/30",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#1e293b]",children:"Subject Breakdown"}),e.jsx("p",{className:"text-[11px] text-slate-400 font-medium",children:"Core vs STEM performance"})]}),e.jsx("button",{onClick:()=>{const k=["Subject,Category,Enrolled,Progress%",...Q.map(Ae=>`${Ae.name},${Ae.type},${Ae.count},${Ae.progress}`)].join(` -`),$=new Blob([k],{type:"text/csv"}),oe=document.createElement("a");oe.href=URL.createObjectURL($),oe.download="subject-breakdown.csv",oe.click()},className:"px-3 py-1.5 bg-white border border-slate-200 text-[10px] font-black text-[#1e293b] uppercase tracking-widest rounded-lg hover:bg-slate-50 transition-all",children:"Export"})]}),e.jsx("div",{className:"flex-1 overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50/20",children:[e.jsx("th",{className:"px-6 py-3 text-[9px] font-black text-slate-300 uppercase tracking-[0.2em]",children:"Subject"}),e.jsx("th",{className:"px-6 py-3 text-[9px] font-black text-slate-300 uppercase tracking-[0.2em]",children:"Category"}),e.jsx("th",{className:"px-6 py-3 text-[9px] font-black text-slate-300 uppercase tracking-[0.2em] text-center",children:"Enrolled"}),e.jsx("th",{className:"px-6 py-3 text-[9px] font-black text-slate-300 uppercase tracking-[0.2em]",children:"Progress"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-50/60",children:Q.map((k,$)=>e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[13px] font-bold text-[#1e293b] group-hover:text-indigo-600 transition-colors",children:k.name}),e.jsx("span",{className:"text-[9px] font-medium text-slate-400",children:"Semester 1"})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:`text-[8px] font-black px-2 py-0.5 rounded-md uppercase tracking-wider ${k.type==="STEM"?"bg-indigo-50 text-indigo-600 border border-indigo-100":"bg-slate-100 text-slate-500 border border-slate-200"}`,children:k.type})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx("span",{className:"text-[12px] font-bold text-slate-600",children:k.count})}),e.jsx("td",{className:"px-6 py-4 min-w-[180px]",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 h-1.5 bg-slate-100 rounded-full overflow-hidden p-[1px]",children:e.jsx("div",{className:`h-full rounded-full ${k.progress>80?"bg-indigo-500":k.progress>60?"bg-indigo-400":"bg-rose-400"} transition-all duration-1000`,style:{width:`${k.progress}%`}})}),e.jsxs("span",{className:"text-[11px] font-black text-[#1e293b] w-8",children:[k.progress,"%"]})]})})]},$))})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#1e293b]",children:"Activity"}),e.jsx("div",{className:"w-7 h-7 bg-slate-50 rounded-lg flex items-center justify-center",children:e.jsx(_e,{size:14,className:"text-slate-400"})})]}),e.jsx("div",{className:"space-y-5",children:u.slice(0,3).map((k,$)=>e.jsxs("div",{className:"flex gap-3 group",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-indigo-50 flex items-center justify-center shrink-0 group-hover:scale-110 transition-transform",children:e.jsx(Ns,{size:14,className:"text-indigo-600"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[12px] font-bold text-[#1e293b] truncate leading-tight group-hover:text-indigo-600 transition-colors",children:k.action}),e.jsx("p",{className:"text-[10px] font-medium text-slate-400 truncate mt-0.5",children:k.details})]})]},$))})]}),e.jsxs("div",{className:"bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#1e293b]",children:"Load"}),e.jsx("div",{className:"w-7 h-7 bg-slate-50 rounded-lg flex items-center justify-center",children:e.jsx(Fe,{size:14,className:"text-slate-400"})})]}),e.jsx("div",{className:"space-y-5",children:[{label:"Foundational",color:"bg-emerald-400",val:ne?.foundational??0},{label:"Intermediate",color:"bg-indigo-400",val:ne?.intermediate??0},{label:"Advanced",color:"bg-rose-400",val:ne?.advanced??0}].map((k,$)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-[0.15em]",children:k.label}),e.jsxs("span",{className:"text-[11px] font-black text-[#1e293b]",children:[k.val,"%"]})]}),e.jsx("div",{className:"h-1.5 bg-slate-50 rounded-full overflow-hidden p-[1px]",children:e.jsx("div",{className:`h-full rounded-full ${k.color}`,style:{width:`${k.val}%`}})})]},$))})]})]})]})]})]}),r==="Content"&&e.jsx(_a,{}),r==="RAG Manager"&&e.jsx(ll,{}),r==="Audit Log"&&e.jsx(al,{}),r==="User Management"&&e.jsx(hl,{createIntentRole:p,onCreateIntentConsumed:()=>v(null)}),r==="Analytics"&&e.jsx(pl,{}),r==="AI Monitoring"&&e.jsx(Nl,{}),r==="Class Management"&&e.jsx(kl,{}),r==="Subjects"&&e.jsx(yl,{})]})]}),e.jsx(Sl,{isOpen:h,onClose:()=>P(!1)}),e.jsx(ct,{isOpen:g,onClose:()=>m(!1),onConfirm:s,title:"Logout Confirmation",message:"Are you sure you want to log out? This will end your current session.",confirmText:"Logout",cancelText:"Cancel"})]})};export{Nr as default}; + ${f?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-slate-50 text-slate-400 border-slate-100"} + `,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${f?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),f?"Available":"Locked"]}),A&&e.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-tighter ml-1 flex items-center gap-1",children:[e.jsx(Rs,{size:10}),"Updated: ",A.toLocaleString()]})]})}),e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ha,{checked:f,onCheckedChange:y=>N(c.id,y),disabled:u,className:"data-[state=checked]:bg-emerald-500 data-[state=unchecked]:bg-slate-200","aria-label":`Toggle ${c.name} availability`}),u&&e.jsx(V,{size:16,className:"animate-spin text-indigo-500"})]})}),e.jsx(ie,{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 group/input",children:[e.jsx(Ce,{size:14,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within/input:text-indigo-500 transition-colors"}),e.jsx(xe,{value:w,onChange:y=>v(c.id,y.target.value),placeholder:"Firebase path (e.g., rag/calculus.pdf)",className:"pl-10 h-10 text-xs font-bold rounded-xl bg-slate-50/50 border-slate-200 focus-visible:ring-indigo-500/20 focus-visible:border-indigo-500 transition-all",disabled:u})]}),e.jsx(E,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-xl text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 transition-all",onClick:()=>h(c.id),disabled:u,title:"Save PDF Path",children:u?e.jsx(V,{size:18,className:"animate-spin text-indigo-500"}):e.jsx(Nt,{size:18})})]})})]},c.id)})})]})})]})},kl=()=>{const[s,a]=r.useState([]),[n,i]=r.useState([]),[l,o]=r.useState(!0),[g,m]=r.useState(null),[N,v]=r.useState({});r.useEffect(()=>{h()},[]);const h=async()=>{o(!0);try{const f=(await F(L(M,"classrooms"))).docs.map(D=>({id:D.id,...D.data()}));a(f);const w=ve(L(M,"users"),Ve("role","==","teacher")),u=(await F(w)).docs.map(D=>{const T=D.data();return{uid:D.id,name:T.name||T.displayName||"Teacher",email:T.email||""}});i(u);const y={};f.forEach(D=>{D.managerId&&(y[D.id]=D.managerId)}),v(y)}catch{S.error("Failed to load class data")}finally{o(!1)}},c=async x=>{const f=N[x];if(!f){S.error("Select a teacher first");return}const w=n.find(A=>A.uid===f);if(w){m(x);try{await ws(Es(M,"classrooms",x),{managerId:w.uid,managerName:w.name});const A=Es(M,"classSectionOwnership",x),u=await F(ve(L(M,"classSectionOwnership"),Ve("classSectionId","==",x)));if(u.docs.length>0)await ws(u.docs[0].ref,{managerId:w.uid,managerName:w.name});else try{await ws(A,{managerId:w.uid,managerName:w.name})}catch{}a(y=>y.map(D=>D.id===x?{...D,managerId:w.uid,managerName:w.name}:D)),S.success(`Assigned ${w.name} as manager`)}catch{S.error("Failed to assign manager")}finally{m(null)}}};return l?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"w-8 h-8 border-2 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx("div",{className:"bg-white rounded-xl p-5 border border-slate-200 shadow-sm",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-50 flex items-center justify-center",children:e.jsx(nt,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[24px] font-bold text-slate-900",children:s.length}),e.jsx("p",{className:"text-[12px] text-slate-500 font-medium",children:"Total Classes"})]})]})}),e.jsx("div",{className:"bg-white rounded-xl p-5 border border-slate-200 shadow-sm",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-emerald-50 flex items-center justify-center",children:e.jsx(qe,{className:"w-5 h-5 text-emerald-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[24px] font-bold text-slate-900",children:s.filter(x=>x.managerId).length}),e.jsx("p",{className:"text-[12px] text-slate-500 font-medium",children:"With Manager"})]})]})}),e.jsx("div",{className:"bg-white rounded-xl p-5 border border-slate-200 shadow-sm",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-50 flex items-center justify-center",children:e.jsx(Pe,{className:"w-5 h-5 text-amber-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[24px] font-bold text-slate-900",children:s.filter(x=>!x.managerId).length}),e.jsx("p",{className:"text-[12px] text-slate-500 font-medium",children:"Unassigned"})]})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsx("h3",{className:"text-[15px] font-bold text-slate-900",children:"All Classes"})}),e.jsx("div",{className:"divide-y divide-slate-100",children:s.length===0?e.jsx("div",{className:"px-6 py-12 text-center text-slate-500 text-[13px]",children:"No classes found."}):s.map(x=>e.jsxs("div",{className:"px-6 py-4 flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[14px] font-semibold text-slate-900 truncate",children:x.name}),e.jsxs("p",{className:"text-[12px] text-slate-500",children:[x.gradeLevel||""," ",x.section?`• ${x.section}`:""," ",x.studentCount?`• ${x.studentCount} students`:""]}),x.managerName&&e.jsxs("p",{className:"text-[11px] text-emerald-600 font-medium mt-0.5",children:["Manager: ",x.managerName]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:N[x.id]||"",onChange:f=>v(w=>({...w,[x.id]:f.target.value})),className:"appearance-none bg-slate-50 border border-slate-200 text-slate-700 text-[12px] font-semibold rounded-lg pl-3 pr-8 py-2 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100 w-[220px]",children:[e.jsx("option",{value:"",children:"Select teacher..."}),n.map(f=>e.jsxs("option",{value:f.uid,children:[f.name," (",f.email,")"]},f.uid))]}),e.jsx(ba,{className:"w-3.5 h-3.5 text-slate-400 absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsx("button",{onClick:()=>c(x.id),disabled:!N[x.id]||g===x.id,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-[12px] font-bold rounded-lg disabled:opacity-50 transition-colors whitespace-nowrap",children:g===x.id?"...":"Assign"})]})]},x.id))})]})]})},Sl=({isOpen:s,onClose:a})=>s?e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 sm:p-6",children:[e.jsx("div",{className:"absolute inset-0 bg-slate-900/40 backdrop-blur-sm animate-in fade-in duration-300",onClick:a}),e.jsxs("div",{className:"relative bg-white w-full max-w-4xl rounded-[40px] shadow-2xl border border-slate-200 overflow-hidden animate-in zoom-in slide-in-from-bottom-8 duration-500",children:[e.jsxs("div",{className:"px-10 pt-10 pb-6 flex items-center justify-between border-b border-slate-50 bg-slate-50/50",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-[#1e293b] uppercase tracking-wider",children:"How It Works: Subject Governance"}),e.jsx("p",{className:"text-[11px] font-black text-indigo-500 uppercase tracking-[0.2em] mt-1",children:"Platform Curriculum Protocol & RAG Workflow"})]}),e.jsx("button",{onClick:a,className:"w-12 h-12 rounded-2xl flex items-center justify-center bg-white text-slate-400 hover:text-rose-500 hover:bg-rose-50 transition-all border border-slate-200 shadow-sm group",children:e.jsx(Ms,{size:20,className:"group-hover:rotate-90 transition-transform duration-300"})})]}),e.jsx("div",{className:"p-12",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-12 relative",children:[e.jsx("div",{className:"absolute top-12 left-0 right-0 h-0.5 border-t-2 border-dashed border-indigo-100 hidden md:block z-0",style:{left:"10%",right:"10%"}}),[{step:"1",title:"Define Identity",desc:"Assign subject codes and grade levels in the core registry.",icon:He,color:"text-indigo-600",bg:"bg-indigo-50"},{step:"2",title:"Map RAG Source",desc:"Link Firebase PDF paths to the AI Knowledge Base.",icon:Fe,color:"text-amber-600",bg:"bg-amber-50"},{step:"3",title:"Global Toggle",desc:"Enable or lock subject access across all dashboards instantly.",icon:Kt,color:"text-emerald-600",bg:"bg-emerald-50"},{step:"4",title:"Audit Sync",desc:"Every modification is logged and synced to the cloud registry.",icon:zs,color:"text-purple-600",bg:"bg-purple-50"}].map((n,i)=>e.jsxs("div",{className:"flex-1 flex flex-col items-center text-center group relative z-10",children:[e.jsxs("div",{className:`relative mb-6 w-24 h-24 ${n.bg} rounded-[32px] flex items-center justify-center transition-all duration-500 group-hover:scale-110 group-hover:rotate-3 shadow-lg shadow-indigo-100/20`,children:[e.jsx(n.icon,{size:36,className:`${n.color} drop-shadow-sm`}),e.jsx("div",{className:"absolute -top-3 -left-3 bg-[#9956DE] text-white text-[12px] font-black w-10 h-10 rounded-2xl flex items-center justify-center shadow-lg border-2 border-white",children:n.step})]}),e.jsx("h4",{className:"text-sm font-black text-[#1e293b] uppercase tracking-wide mb-2",children:n.title}),e.jsx("p",{className:"text-xs text-slate-400 font-bold leading-relaxed max-w-[180px]",children:n.desc})]},i))]})}),e.jsxs("div",{className:"px-12 py-6 bg-slate-50/50 border-t border-slate-100 flex items-center justify-center gap-4",children:[e.jsx("div",{className:"flex -space-x-2",children:[1,2,3].map(n=>e.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-white bg-indigo-100 flex items-center justify-center",children:e.jsx("div",{className:"w-4 h-4 rounded-full bg-indigo-500 animate-pulse"})},n))}),e.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Platform Governance Active & Monitored"})]})]})]}):null,Nr=({onLogout:s,onOpenProfile:a,onOpenSettings:n})=>{const{userProfile:i}=cs(),[l,o]=r.useState("Overview"),[g,m]=r.useState(!1),[N,v]=r.useState(!1),[h,c]=r.useState(!1),[x,f]=r.useState(null),[w,A]=r.useState(null),[u,y]=r.useState([]),[D,T]=r.useState([]),[q,me]=r.useState(!0),[he,Ne]=r.useState([]),[_,pe]=r.useState(null),[X,Q]=r.useState([]),[U,te]=r.useState(null),[O,K]=r.useState(null),[ne,B]=r.useState(null),[ce,d]=r.useState(!1),{unreadCount:ae}=Yt(),[p,P]=r.useState(!1),[H,Y]=r.useState(!1),G=k=>(l===k||(o(k),k==="Subjects"&&(Y(!0),setTimeout(()=>Y(!1),2e3))),!0),Qe=k=>{G(k)&&c(!1)};r.useEffect(()=>{if(l!=="Overview"||!i)return;const k=String(i.role||"").toLowerCase(),$=k==="admin"||k==="teacher";let oe=!1;return me(!0),Promise.all([Qa(),$?Et():Promise.resolve([]),Xa(3),Ka(),Ya(),Za(),Ja(),el(),Se.getInferenceMetrics().catch(()=>null)]).then(([Ae,Ts,ds,Ee,xs,Be,$e,Xe,le])=>{oe||(A(Ae),y(Ts.slice(0,4)),T(ds),Ne(Ee),Q(xs),te(Be),K($e),B(Xe),le&&pe(le.metrics))}).catch(console.error).finally(()=>{oe||me(!1)}),()=>{oe=!0}},[l,i]);const Oe=[{label:"Active Teachers",value:(w?.activeTeachers??0).toString(),icon:is,color:"bg-teal-100",iconColor:"text-teal-600"},{label:"Total Classes",value:(w?.totalClasses??0).toString(),icon:He,color:"bg-indigo-100",iconColor:"text-indigo-600"},{label:"XP Events",value:(w?.aiPredictions??0).toLocaleString(),icon:Fe,color:"bg-amber-100",iconColor:"text-amber-600"},{label:"At-Risk Alerts",value:(w?.atRiskStudents??0).toString(),icon:Re,color:"bg-rose-100",iconColor:"text-rose-600"}];return e.jsxs("div",{className:"flex h-screen w-full bg-[#f8fafc] overflow-hidden font-body",children:[e.jsx("div",{className:"hidden lg:block",children:e.jsx(qs,{activeTab:l,setActiveTab:Qe,userRole:"admin",onOpenSettings:()=>n?.(),onLogout:()=>m(!0),sidebarCollapsed:N,setSidebarCollapsed:v})}),h&&e.jsxs(e.Fragment,{children:[e.jsx("button",{"aria-label":"Close navigation",className:"fixed inset-0 z-40 bg-slate-900/40 backdrop-blur-[1px] lg:hidden",onClick:()=>c(!1)}),e.jsx("div",{className:"fixed inset-y-0 left-0 z-50 p-3 lg:hidden",children:e.jsx(qs,{mode:"mobile",onRequestClose:()=>c(!1),activeTab:l,setActiveTab:Qe,userRole:"admin",onOpenSettings:()=>n?.(),onLogout:()=>{m(!0),c(!1)},sidebarCollapsed:!1})})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("header",{className:"bg-transparent border-b border-[#e2e8f0]/40 px-[24px] xl:px-[32px] pt-[24px] pb-[16px] flex-shrink-0 z-30",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-4 mb-0",children:[e.jsxs("div",{className:"flex-1 flex items-start gap-3",children:[e.jsx("button",{type:"button",onClick:()=>c(!0),className:"lg:hidden mt-1 p-2 rounded-lg border border-[#dde3eb] bg-white text-[#5a6578] hover:bg-[#edf1f7] transition-colors","aria-label":"Open navigation",children:e.jsx(Zt,{size:18})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-[26px] font-bold text-[#1e293b] tracking-tight leading-tight",children:[l==="Overview"&&"Admin Dashboard",l==="Content"&&"Content",l==="Audit Log"&&"Audit Log",l==="User Management"&&"User Management",l==="Analytics"&&"Analytics",l==="AI Monitoring"&&"AI Monitoring",l==="Subjects"&&"Curriculum Control",l==="Class Management"&&"Class Management"]}),e.jsxs("p",{className:"text-[13px] text-[#64748b] mt-1",children:[l==="Overview"&&"System Overview & Management",l==="Content"&&"Upload PDFs for AI-powered content.",l==="Audit Log"&&"Monitor system activity and security.",l==="User Management"&&"Manage all user accounts and roles.",l==="Analytics"&&"Detailed system performance metrics.",l==="AI Monitoring"&&"Platform AI usage and system health.",l==="Subjects"&&"Manage academic subjects, availability, and RAG knowledge sources.",l==="Class Management"&&"Assign section managers and manage class rosters."]})]}),l==="Overview"&&e.jsxs("div",{className:"hidden xl:flex items-center gap-2 ml-4 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#4f46e5]/10 border border-[#4f46e5]/20 rounded-lg",children:[e.jsx(Pe,{size:13,className:"text-[#4f46e5]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#4f46e5]",children:[(w?.totalStudents??0).toLocaleString()," students"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#0ea5e9]/10 border border-[#0ea5e9]/20 rounded-lg",children:[e.jsx(is,{size:13,className:"text-[#0ea5e9]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#0ea5e9]",children:[w?.activeTeachers??0," teachers"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[e.jsx(Fe,{size:13,className:"text-amber-600"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-amber-600",children:[(w?.aiPredictions??0).toLocaleString()," XP events"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[l==="Subjects"&&e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>P(!0),className:"relative w-10 h-10 flex items-center justify-center bg-indigo-600 hover:bg-indigo-700 rounded-full shadow-lg shadow-indigo-200 text-white transition-all cursor-pointer hover:scale-110 active:scale-95 animate-in zoom-in duration-300","aria-label":"How it works",children:e.jsx(fa,{size:20})}),H&&e.jsxs("div",{className:"absolute top-12 left-1/2 -translate-x-1/2 px-3 py-1.5 bg-[#1e293b] text-white text-[10px] font-black uppercase tracking-widest rounded-lg shadow-xl whitespace-nowrap animate-in fade-in slide-in-from-top-2 duration-300 z-50",children:["How It Works?",e.jsx("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-[#1e293b] rotate-45"})]})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>d(!ce),className:"relative w-10 h-10 flex items-center justify-center bg-white/60 hover:bg-white/80 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50 text-[#64748b] hover:text-[#1e293b] transition-colors cursor-pointer hover:scale-[1.02]","aria-label":"View notifications",children:[e.jsx(ja,{size:18}),ae>0&&e.jsx("span",{className:"absolute top-2.5 right-2.5 w-2 h-2 bg-rose-500 rounded-full border border-white"})]}),e.jsx(aa,{isOpen:ce,onClose:()=>d(!1),onViewAll:()=>G("Audit Log")})]}),e.jsxs("div",{onClick:a,className:"flex items-center gap-2 bg-white/60 px-4 py-2 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50 cursor-pointer hover:bg-white/80 transition-colors h-10 hover:scale-[1.02]",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-indigo-100 overflow-hidden shrink-0",children:e.jsx(Jt,{src:i?.photo,name:i?.name||"Admin",gender:i?.gender,className:"w-full h-full object-cover"})}),e.jsx("span",{className:"text-[13px] font-semibold text-[#1e293b]",children:i?.name||"Admin"})]})]})]})}),e.jsxs("main",{className:`flex-1 overflow-y-auto px-[24px] xl:px-[32px] scrollbar-hide ${["User Management","Audit Log"].includes(l)?"pb-0":"pb-[32px]"}`,children:[l==="Overview"&&e.jsxs("div",{className:"max-w-[1600px] mx-auto space-y-8 pt-6 xl:pt-8",children:[e.jsxs("div",{className:"grid grid-cols-12 gap-6 h-[170px]",children:[e.jsxs("div",{className:"col-span-12 xl:col-span-4 h-full bg-gradient-to-br from-[#4f46e5] to-[#7c3aed] rounded-[28px] p-6 relative overflow-hidden shadow-sm shadow-indigo-500/10 group",children:[e.jsx("div",{className:"absolute -top-24 -right-24 w-64 h-64 bg-white/10 rounded-full blur-3xl group-hover:bg-white/20 transition-all duration-1000"}),e.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-white/70 text-[10px] font-black uppercase tracking-[0.2em] mb-1.5",children:"Platform Overview"}),e.jsx("p",{className:"text-white text-4xl font-display font-black tracking-tighter leading-none",children:q?"...":(w?.totalStudents??0).toLocaleString()}),e.jsx("p",{className:"text-white/80 text-xs font-medium mt-1",children:"Total Active Students"})]}),e.jsxs("div",{className:"flex items-center gap-2 py-1 px-3 bg-white/10 backdrop-blur-md rounded-full w-fit border border-white/10",children:[e.jsx(mt,{size:12,className:"text-emerald-400"}),e.jsxs("span",{className:"text-white text-[10px] font-bold tracking-wide",children:[w?.activeTeachers??0," teachers · ",w?.totalClasses??0," classes"]})]})]}),e.jsx("div",{className:"absolute -bottom-6 -right-6 opacity-10 group-hover:scale-110 group-hover:rotate-6 transition-all duration-700 pointer-events-none",children:e.jsx(Pe,{size:140,className:"text-white"})})]}),e.jsx("div",{className:"col-span-12 xl:col-span-8 h-full bg-white border border-slate-200/60 rounded-[28px] px-2 py-5 flex items-center shadow-sm shadow-slate-200/50",children:e.jsx("div",{className:"grid grid-cols-4 w-full h-full",children:Oe.map((k,$)=>e.jsxs("div",{className:`flex flex-col justify-center px-8 ${$!==3?"border-r border-slate-100":""}`,children:[e.jsx("div",{className:`w-10 h-10 ${k.color} rounded-xl flex items-center justify-center mb-3 shadow-sm`,children:e.jsx(k.icon,{size:20,className:k.iconColor})}),e.jsx("p",{className:"text-[24px] font-display font-black text-[#1e293b] leading-tight tracking-tight",children:q?"...":k.value}),e.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-[0.15em] mt-0.5",children:k.label})]},$))})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-6 min-h-[330px]",children:[e.jsxs("div",{className:"col-span-12 xl:col-span-5 bg-white rounded-[28px] border border-slate-200/60 p-6 flex flex-col shadow-sm shadow-slate-200/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[16px] font-bold text-[#1e293b]",children:"System Performance"}),e.jsx("p",{className:"text-[11px] text-slate-400 font-medium",children:"AI vs Manual Activity"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-slate-50 rounded-lg",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-[#6366f1]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-wider",children:"AI"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-slate-50 rounded-lg",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-slate-200"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-wider",children:"Manual"})]})]})]}),e.jsx("div",{className:"flex-1 w-full min-h-[200px]",children:e.jsx(Zs,{width:"100%",height:"100%",children:e.jsxs(va,{data:he,margin:{top:0,right:0,left:-20,bottom:0},children:[e.jsx(wa,{strokeDasharray:"4 4",vertical:!1,stroke:"#f1f5f9"}),e.jsx(Na,{dataKey:"name",axisLine:!1,tickLine:!1,tick:{fontSize:9,fontWeight:800,fill:"#cbd5e1"},dy:10}),e.jsx(ya,{axisLine:!1,tickLine:!1,tick:{fontSize:9,fontWeight:800,fill:"#cbd5e1"}}),e.jsx(ka,{contentStyle:{borderRadius:"12px",border:"none",boxShadow:"0 15px 20px -5px rgb(0 0 0 / 0.1)",padding:"10px"},cursor:{fill:"#f8fafc"}}),e.jsx(Js,{dataKey:"ai",fill:"#6366f1",radius:[4,4,0,0],barSize:12}),e.jsx(Js,{dataKey:"man",fill:"#e2e8f0",radius:[4,4,0,0],barSize:12})]})})})]}),e.jsxs("div",{className:"col-span-12 xl:col-span-4 bg-white rounded-[28px] border border-slate-200/60 p-6 flex flex-col shadow-sm shadow-slate-200/50 group",children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[16px] font-bold text-[#1e293b]",children:"AI Model Status"}),e.jsx("p",{className:"text-[11px] text-slate-400 font-medium",children:"Success Rate"})]}),e.jsx("div",{className:"w-9 h-9 bg-indigo-50 rounded-xl flex items-center justify-center",children:e.jsx(_e,{size:16,className:"text-indigo-600"})})]}),e.jsx("div",{className:"flex items-baseline gap-2 mb-4",children:_?(()=>{const k=_.requests_ok+_.requests_error,$=k>0?Math.round(_.requests_ok/k*100):100,oe=$>=90;return e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-[38px] font-display font-black text-indigo-600 tracking-tighter leading-none",children:[$,"%"]}),e.jsx("span",{className:`text-[10px] font-black px-2 py-0.5 rounded-full uppercase tracking-wider ${oe?"text-emerald-500 bg-emerald-50":"text-amber-500 bg-amber-50"}`,children:oe?"Optimal":`${_.requests_error} errors`})]})})():e.jsx("span",{className:"text-[38px] font-display font-black text-indigo-600 tracking-tighter leading-none",children:"..."})}),e.jsx("div",{className:"flex-1 flex flex-col justify-center gap-3",children:_&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-3 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-indigo-500 rounded-full",style:{width:`${Math.round(_.requests_ok/(_.requests_ok+_.requests_error||1)*100)}%`}})})}),e.jsxs("div",{className:"flex justify-between text-[10px] font-bold text-slate-400",children:[e.jsxs("span",{children:[_.requests_ok.toLocaleString()," OK"]}),e.jsxs("span",{children:[_.requests_error.toLocaleString()," failed"]})]}),e.jsxs("p",{className:"text-[10px] text-slate-400",children:[_.requests_total.toLocaleString()," total attempts · ",_.retries_total.toLocaleString()," retries"]})]})}),e.jsxs("button",{onClick:()=>o("AI Monitoring"),className:"w-full mt-4 py-3 bg-slate-50 text-[#1e293b] text-[11px] font-black uppercase tracking-[0.15em] rounded-xl hover:bg-indigo-600 hover:text-white transition-all flex items-center justify-center gap-2.5 group/btn",children:["Health Check ",e.jsx(Ea,{size:14,className:"group-hover/btn:translate-x-0.5 group-hover/btn:-translate-y-0.5 transition-transform"})]})]}),e.jsxs("div",{className:"col-span-12 xl:col-span-3 flex flex-col gap-4",children:[e.jsx("h3",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] pl-2",children:"Top Performers"}),e.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[q?e.jsx("div",{className:"flex-1 flex items-center justify-center bg-white rounded-[28px] border border-slate-100",children:e.jsx(V,{size:24,className:"animate-spin text-slate-200"})}):D.slice(0,2).map((k,$)=>e.jsxs("div",{className:`relative rounded-[28px] border p-4 shadow-sm shadow-slate-200/50 transition-all cursor-pointer group overflow-hidden ${$===0?"bg-gradient-to-br from-emerald-50 to-white border-emerald-200/50":"bg-gradient-to-br from-indigo-50 to-white border-indigo-200/50"}`,children:[e.jsx("div",{className:`absolute -top-12 -right-12 w-32 h-32 rounded-full blur-2xl opacity-20 transition-all duration-700 group-hover:scale-125 ${$===0?"bg-emerald-400":"bg-indigo-400"}`}),e.jsxs("div",{className:"flex items-center gap-3 relative z-10",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("div",{className:`p-[3px] rounded-[20px] shadow-sm ${$===0?"bg-gradient-to-tr from-emerald-500 to-emerald-200":"bg-gradient-to-tr from-indigo-500 to-indigo-200"}`,children:e.jsx("img",{src:k.avatar,alt:"",className:"w-11 h-11 rounded-[17px] object-cover bg-white"})}),e.jsx("div",{className:`absolute -top-2 -right-2 w-6 h-6 text-[10px] font-black rounded-full flex items-center justify-center border-2 border-white shadow-md ${$===0?"bg-emerald-500 text-white":"bg-indigo-500 text-white"}`,children:$===0?e.jsx(tt,{size:16,className:"text-amber-500"}):e.jsx(tt,{size:16,className:"text-slate-400"})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:`text-[13px] font-black truncate transition-colors ${$===0?"text-emerald-900 group-hover:text-emerald-600":"text-indigo-900 group-hover:text-indigo-600"}`,children:k.name}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:e.jsx("span",{className:`text-[8px] font-black uppercase tracking-widest px-1.5 py-0.5 rounded-md ${$===0?"bg-emerald-500/10 text-emerald-600":"bg-indigo-500/10 text-indigo-600"}`,children:k.class})})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:`text-xl font-display font-black leading-none ${$===0?"text-emerald-600":"text-indigo-600"}`,children:[k.performance,"%"]}),e.jsx("p",{className:"text-[7px] font-black text-slate-400 uppercase tracking-tighter mt-1",children:"Mastery"})]})]})]},k.id)),e.jsx("button",{onClick:()=>o("Analytics"),className:"mt-auto py-2.5 text-[10px] font-black text-indigo-600 uppercase tracking-[0.2em] text-center bg-white border border-slate-200/60 rounded-xl hover:bg-slate-50 transition-all shadow-sm shadow-slate-200/50",children:"All Rankings"})]})]})]}),e.jsxs("div",{className:"flex flex-col xl:flex-row gap-6 pb-8 items-stretch",children:[e.jsxs("div",{className:"w-full xl:w-1/3 flex flex-col gap-6",children:[e.jsxs("div",{className:"bg-[#1e293b] rounded-[28px] p-6 text-white shadow-sm shadow-slate-900/10 relative overflow-hidden group min-h-[190px] flex flex-col justify-between shrink-0",children:[e.jsx("div",{className:"absolute -bottom-10 -right-10 opacity-5 group-hover:scale-110 group-hover:-rotate-12 transition-all duration-700 pointer-events-none",children:(U?.atRiskCount??0)>0?e.jsx(Re,{size:200}):e.jsx(Ns,{size:200})}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:`w-10 h-10 ${(U?.atRiskCount??0)>0?"bg-rose-500 shadow-rose-500/20":"bg-emerald-500 shadow-emerald-500/20"} rounded-xl flex items-center justify-center mb-4 shadow-lg`,children:(U?.atRiskCount??0)>0?e.jsx(Re,{size:18,className:"text-white"}):e.jsx(Ns,{size:18,className:"text-white"})}),e.jsxs("div",{className:"px-2.5 py-1 bg-white/10 backdrop-blur-md rounded-full border border-white/10 flex items-center gap-2",children:[e.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${(U?.atRiskCount??0)>0?"bg-rose-500 animate-pulse":"bg-emerald-400"}`}),e.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:(U?.atRiskCount??0)>0?"Urgent":"All Clear"})]})]}),e.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] mb-0.5",children:(U?.atRiskCount??0)>0?"Priority Attention":"Status"}),e.jsx("h3",{className:"text-xl font-display font-black tracking-tight leading-tight",children:(U?.atRiskCount??0)>0?U?.subjectName:"No At-Risk Students"})]}),e.jsxs("div",{className:"relative z-10 pt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-slate-400",children:(U?.atRiskCount??0)>0?`${U.atRiskCount} At-Risk Student${U.atRiskCount!==1?"s":""}`:"All students on track"}),(U?.atRiskCount??0)>0&&e.jsx("button",{onClick:()=>o("Analytics"),className:"text-[10px] font-black uppercase tracking-widest text-indigo-400 hover:text-indigo-300 transition-colors",children:"Review"})]})]}),e.jsxs("div",{className:"bg-white rounded-[28px] border border-slate-200/60 p-7 flex flex-col items-center justify-center shadow-sm shadow-slate-200/50 relative overflow-hidden flex-1",children:[e.jsxs("div",{className:"absolute top-7 left-8",children:[e.jsx("h3",{className:"text-[14px] font-bold text-[#1e293b]",children:"Global Mastery"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-medium",children:"Average performance"})]}),e.jsxs("div",{className:"relative w-40 h-40 mt-6",children:[e.jsx(Zs,{width:"100%",height:"100%",children:e.jsx(Sa,{children:e.jsxs(Ca,{data:[{name:"Mastery",value:O?.avgMastery??0},{name:"Remaining",value:100-(O?.avgMastery??0)}],cx:"50%",cy:"50%",innerRadius:55,outerRadius:75,paddingAngle:8,dataKey:"value",startAngle:90,endAngle:450,stroke:"none",children:[e.jsx(et,{fill:"#6366f1"}),e.jsx(et,{fill:"#f1f5f9"})]})})}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsxs("span",{className:"text-[36px] font-display font-black text-[#1e293b] leading-none",children:[O?.avgMastery??0,"%"]}),e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-[0.1em] mt-1",children:"Overall"})]})]}),e.jsxs("div",{className:"mt-8 flex items-center gap-12",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xl font-display font-black text-indigo-600 leading-none",children:(O?.passed??0).toLocaleString()}),e.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mt-1",children:"Passed"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xl font-display font-black text-slate-300 leading-none",children:(O?.pending??0).toLocaleString()}),e.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mt-1",children:"Pending"})]})]}),e.jsx("div",{className:"absolute bottom-0 left-0 w-full h-1 bg-gradient-to-r from-indigo-500/20 to-purple-500/20"})]})]}),e.jsxs("div",{className:"w-full xl:w-2/3 flex flex-col gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[28px] border border-slate-200/60 shadow-sm shadow-slate-200/50 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-slate-50 flex items-center justify-between bg-slate-50/30",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#1e293b]",children:"Subject Breakdown"}),e.jsx("p",{className:"text-[11px] text-slate-400 font-medium",children:"Core vs STEM performance"})]}),e.jsx("button",{onClick:()=>{const k=["Subject,Category,Enrolled,Progress%",...X.map(Ae=>`${Ae.name},${Ae.type},${Ae.count},${Ae.progress}`)].join(` +`),$=new Blob([k],{type:"text/csv"}),oe=document.createElement("a");oe.href=URL.createObjectURL($),oe.download="subject-breakdown.csv",oe.click()},className:"px-3 py-1.5 bg-white border border-slate-200 text-[10px] font-black text-[#1e293b] uppercase tracking-widest rounded-lg hover:bg-slate-50 transition-all",children:"Export"})]}),e.jsx("div",{className:"flex-1 overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50/20",children:[e.jsx("th",{className:"px-6 py-3 text-[9px] font-black text-slate-300 uppercase tracking-[0.2em]",children:"Subject"}),e.jsx("th",{className:"px-6 py-3 text-[9px] font-black text-slate-300 uppercase tracking-[0.2em]",children:"Category"}),e.jsx("th",{className:"px-6 py-3 text-[9px] font-black text-slate-300 uppercase tracking-[0.2em] text-center",children:"Enrolled"}),e.jsx("th",{className:"px-6 py-3 text-[9px] font-black text-slate-300 uppercase tracking-[0.2em]",children:"Progress"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-50/60",children:X.map((k,$)=>e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[13px] font-bold text-[#1e293b] group-hover:text-indigo-600 transition-colors",children:k.name}),e.jsx("span",{className:"text-[9px] font-medium text-slate-400",children:"Semester 1"})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:`text-[8px] font-black px-2 py-0.5 rounded-md uppercase tracking-wider ${k.type==="STEM"?"bg-indigo-50 text-indigo-600 border border-indigo-100":"bg-slate-100 text-slate-500 border border-slate-200"}`,children:k.type})}),e.jsx("td",{className:"px-6 py-4 text-center",children:e.jsx("span",{className:"text-[12px] font-bold text-slate-600",children:k.count})}),e.jsx("td",{className:"px-6 py-4 min-w-[180px]",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 h-1.5 bg-slate-100 rounded-full overflow-hidden p-[1px]",children:e.jsx("div",{className:`h-full rounded-full ${k.progress>80?"bg-indigo-500":k.progress>60?"bg-indigo-400":"bg-rose-400"} transition-all duration-1000`,style:{width:`${k.progress}%`}})}),e.jsxs("span",{className:"text-[11px] font-black text-[#1e293b] w-8",children:[k.progress,"%"]})]})})]},$))})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#1e293b]",children:"Activity"}),e.jsx("div",{className:"w-7 h-7 bg-slate-50 rounded-lg flex items-center justify-center",children:e.jsx(_e,{size:14,className:"text-slate-400"})})]}),e.jsx("div",{className:"space-y-5",children:u.slice(0,3).map((k,$)=>e.jsxs("div",{className:"flex gap-3 group",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-indigo-50 flex items-center justify-center shrink-0 group-hover:scale-110 transition-transform",children:e.jsx(Ns,{size:14,className:"text-indigo-600"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[12px] font-bold text-[#1e293b] truncate leading-tight group-hover:text-indigo-600 transition-colors",children:k.action}),e.jsx("p",{className:"text-[10px] font-medium text-slate-400 truncate mt-0.5",children:k.details})]})]},$))})]}),e.jsxs("div",{className:"bg-white rounded-[28px] border border-slate-200/60 p-6 shadow-sm shadow-slate-200/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#1e293b]",children:"Load"}),e.jsx("div",{className:"w-7 h-7 bg-slate-50 rounded-lg flex items-center justify-center",children:e.jsx(Fe,{size:14,className:"text-slate-400"})})]}),e.jsx("div",{className:"space-y-5",children:[{label:"Foundational",color:"bg-emerald-400",val:ne?.foundational??0},{label:"Intermediate",color:"bg-indigo-400",val:ne?.intermediate??0},{label:"Advanced",color:"bg-rose-400",val:ne?.advanced??0}].map((k,$)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-[0.15em]",children:k.label}),e.jsxs("span",{className:"text-[11px] font-black text-[#1e293b]",children:[k.val,"%"]})]}),e.jsx("div",{className:"h-1.5 bg-slate-50 rounded-full overflow-hidden p-[1px]",children:e.jsx("div",{className:`h-full rounded-full ${k.color}`,style:{width:`${k.val}%`}})})]},$))})]})]})]})]})]}),l==="Content"&&e.jsx(_a,{}),l==="RAG Manager"&&e.jsx(ll,{}),l==="Audit Log"&&e.jsx(al,{}),l==="User Management"&&e.jsx(hl,{createIntentRole:x,onCreateIntentConsumed:()=>f(null)}),l==="Analytics"&&e.jsx(pl,{}),l==="AI Monitoring"&&e.jsx(Nl,{}),l==="Class Management"&&e.jsx(kl,{}),l==="Subjects"&&e.jsx(yl,{})]})]}),e.jsx(Sl,{isOpen:p,onClose:()=>P(!1)}),e.jsx(ct,{isOpen:g,onClose:()=>m(!1),onConfirm:s,title:"Logout Confirmation",message:"Are you sure you want to log out? This will end your current session.",confirmText:"Logout",cancelText:"Cancel"})]})};export{Nr as default}; diff --git a/assets/AssessmentPage-D20un3MW.js b/assets/AssessmentPage-BN48M30u.js similarity index 93% rename from assets/AssessmentPage-D20un3MW.js rename to assets/AssessmentPage-BN48M30u.js index 3b52db2b4dbbfb4dd63ce150494c3acdf9d564bd..6d553690b94ac288acb3ee3dcd9dacb8ce263642 100644 --- a/assets/AssessmentPage-D20un3MW.js +++ b/assets/AssessmentPage-BN48M30u.js @@ -1,7 +1,7 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pipelineService-B7G_svsh.js","assets/index-Cvals0ud.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css"])))=>i.map(i=>d[i]); -import{e as V,_ as M,m as i,Z,h as G,T as H,F as W,r as X}from"./index-Cvals0ud.js";import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as K}from"./button-CanHmtQ3.js";import{s as ee}from"./diagnosticService-ByxEbtPN.js";import{M as te}from"./maximize-2-Dsjc-Cqw.js";import{X as se}from"./x-cRIR5BcS.js";import{C as ne}from"./clock-BsCO0o69.js";import{C as re}from"./circle-check-big-6fwaSN-C.js";import{C as ae}from"./chevron-right-DMwHUP8W.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pipelineService-CMil_uZC.js","assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css"])))=>i.map(i=>d[i]); +import{e as V,_ as M,m as i,Z,h as G,T as H,F as W,r as X}from"./index-D9TvEOZX.js";import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as K}from"./button-DC8Fz5kC.js";import{s as ee}from"./diagnosticService-Bx7r3sIn.js";import{M as te}from"./maximize-2-hozD_NZl.js";import{X as se}from"./x-DM8tXF3P.js";import{C as ne}from"./clock-BPtF2Ddk.js";import{C as re}from"./circle-check-big-yn5lhjQR.js";import{C as ae}from"./chevron-right-Jv12kepm.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ie=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],le=V("minimize-2",ie),Se=({testId:T,questions:f,userName:$,onComplete:B,onCancel:L})=>{const[h,_]=r.useState("testing"),[a,S]=r.useState(0),[o,b]=r.useState(null),[u,E]=r.useState(()=>{try{const t=sessionStorage.getItem("mathpulse_diagnostic_responses");return t?JSON.parse(t):[]}catch{return[]}}),[g,k]=r.useState([]),[x,z]=r.useState(0),[C,D]=r.useState(null),[A,w]=r.useState(!1),c=r.useRef(null),F=r.useRef(Date.now()),p=r.useRef(!1),d=f.length,l=f[a],P=Math.round((a+(o?1:0))/d*100),v=t=>t==="easy"?60:t==="hard"?120:90,[q]=r.useState(Array.from({length:10},(t,s)=>({id:s,size:Math.random()*80+30,x:Math.random()*100,y:Math.random()*100,duration:Math.random()*20+15,delay:Math.random()*-20,color:["bg-purple-500/10","bg-blue-500/10","bg-cyan-500/10","bg-emerald-500/10"][Math.floor(Math.random()*4)]})));r.useEffect(()=>{const t=v(l?.difficulty||"medium");return F.current=Date.now(),p.current=!1,z(t),c.current&&clearInterval(c.current),c.current=setInterval(()=>{const s=Math.floor((Date.now()-F.current)/1e3),n=Math.max(0,t-s);z(n),n<=0&&!p.current&&(p.current=!0,clearInterval(c.current))},250),()=>{c.current&&clearInterval(c.current)}},[a]),r.useEffect(()=>{if(x===0&&p.current&&h==="testing"){const t=v(l?.difficulty||"medium"),s=[...u,{question_id:l.question_id,student_answer:o||"",time_spent_seconds:t}],n=[...g,!1];k(n),E(s),b(null),am+1):I(s)}},[x]);const O=r.useCallback(()=>{const t=document.getElementById("assessment-container");t&&(document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen().then(()=>{w(!1)}).catch(s=>{console.error("Exit fullscreen error:",s)}):t.requestFullscreen().then(()=>{w(!0)}).catch(s=>{console.error("Fullscreen error:",s)}))},[]);r.useEffect(()=>{const t=()=>{w(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)},[]);const Q=t=>{b(t)},U=()=>{if(!o)return;c.current&&clearInterval(c.current);const t=v(l?.difficulty||"medium")-x,s=[...g,!0],n=[...u,{question_id:l.question_id,student_answer:o,time_spent_seconds:t}];k(s),E(n),b(null),am+1):I(n)},I=async t=>{_("submitting"),D(null);try{sessionStorage.setItem("mathpulse_diagnostic_responses",JSON.stringify(t))}catch{}try{const s=await ee(T,t);sessionStorage.removeItem("mathpulse_diagnostic"),sessionStorage.removeItem("mathpulse_diagnostic_responses"),_("results");try{const{emitPipelineEvent:n,getStudentContext:m}=await M(async()=>{const{emitPipelineEvent:j,getStudentContext:N}=await import("./pipelineService-B7G_svsh.js");return{emitPipelineEvent:j,getStudentContext:N}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),{auth:R}=await M(async()=>{const{auth:j}=await import("./index-Cvals0ud.js").then(N=>N.b6);return{auth:j}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])),y=m();y&&R.currentUser&&n({student_id:R.currentUser.uid,event_type:"diagnostic",event_data:{overall_score:s.overall_score_percent,mastery_summary:s.mastery_summary},occurred_at:new Date().toISOString(),class_id:y.classId,teacher_id:y.teacherId})}catch{}setTimeout(()=>{B({overallRisk:s.overall_risk,overallScorePercent:s.overall_score_percent,intervention:s.recommended_intervention,xpEarned:s.xp_earned,badgeUnlocked:s.badge_unlocked})},3e3)}catch(s){const n=s instanceof Error?s.message:"Submission failed. Your answers are saved locally.";D(n)}},Y=t=>{const s=Math.floor(t/60),n=t%60;return`${s}:${n.toString().padStart(2,"0")}`},J=["A","B","C","D"];return e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-md flex items-center justify-center p-4 sm:p-6 overflow-hidden",children:e.jsxs("div",{id:"assessment-container",className:"bg-white/95 backdrop-blur-xl border border-white/20 rounded-3xl shadow-[0_0_50px_rgba(0,0,0,0.3)] w-full max-w-4xl h-[95vh] sm:h-[90vh] md:h-[85vh] flex flex-col relative z-10 overflow-hidden transition-all duration-300",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none z-0 overflow-hidden",children:q.map(t=>e.jsx(i.div,{className:`absolute rounded-full blur-3xl ${t.color.replace("/10","/30")}`,style:{width:t.size*1.5,height:t.size*1.5,left:`${t.x}%`,top:`${t.y}%`},animate:{x:[0,Math.random()*100-50,0],y:[0,Math.random()*100-50,0],scale:[1,1.3,1]},transition:{duration:t.duration,repeat:1/0,ease:"linear",delay:t.delay}},t.id))}),e.jsxs(i.div,{className:"shrink-0 text-white border-b border-white/10 shadow-md relative z-10",style:{backgroundColor:"#9956DE"},children:[e.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-5 md:p-6",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[e.jsx("h2",{className:"text-lg sm:text-xl md:text-2xl font-bold truncate",children:"Diagnostic Assessment"}),e.jsxs("p",{className:"text-white/80 text-xs sm:text-sm font-medium truncate",children:[l.domain," • ",l.difficulty]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:O,className:"w-9 h-9 sm:w-10 sm:h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",title:A?"Exit Fullscreen":"Enter Fullscreen",children:A?e.jsx(le,{size:18}):e.jsx(te,{size:18})}),e.jsx("button",{onClick:L,className:"w-9 h-9 sm:w-10 sm:h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",children:e.jsx(se,{size:20})})]})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 md:px-6 pb-3 sm:pb-4 md:pb-5",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"bg-white/20 px-3 py-1 rounded-full flex items-center gap-1",children:[e.jsx(Z,{size:16}),e.jsxs("span",{className:"font-bold text-sm",children:[u.length," / ",d]})]})}),e.jsxs("div",{className:`flex items-center gap-1 px-3 py-1 rounded-full ${x<=10?"bg-red-500/80 animate-pulse":"bg-white/20"}`,children:[e.jsx(ne,{size:16}),e.jsx("span",{className:"font-bold text-sm",children:Y(x)})]})]}),e.jsxs("div",{className:"px-4 sm:px-5 md:px-6 pb-3 sm:pb-4 md:pb-5",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Question ",a+1," of ",d]}),e.jsxs("span",{className:"text-sm font-bold",children:[P,"%"]})]}),e.jsx("div",{className:"flex items-center gap-1",children:f.map((t,s)=>{let n="bg-white/30";return s{const s=l.options[t];if(!s)return null;const n=o===t;let m="bg-[#edf1f7] hover:bg-[#dde3eb] border-[#dde3eb]";return n&&(m="bg-purple-50 border-[#9956DE]"),e.jsx(i.button,{whileHover:{scale:1.01},whileTap:{scale:.99},onClick:()=>Q(t),className:`w-full text-left p-2.5 sm:p-3 md:p-4 rounded-xl border-2 transition-all ${m} cursor-pointer shadow-sm hover:shadow-md flex items-center min-h-[3rem] sm:min-h-[4rem] md:min-h-[5rem]`,children:e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 w-full min-w-0",children:[e.jsx("div",{className:`w-8 h-8 sm:w-10 sm:h-10 rounded-xl shrink-0 flex items-center justify-center font-bold text-sm sm:text-base ${n?"bg-[#9956DE] text-white shadow-inner":"bg-white text-[#0a1628] shadow-sm"}`,children:t}),e.jsx("span",{className:"font-semibold text-[#0a1628] text-xs sm:text-sm md:text-base break-words",children:s}),n&&e.jsx(re,{size:18,className:"ml-auto text-[#9956DE] flex-shrink-0"})]})},t)})})]},a)})}),e.jsx("div",{className:"p-4 sm:p-5 md:p-6 bg-[#edf1f7] border-t border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm text-[#5a6578]",children:o?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{size:16}),"Ready for the next one!"]}):e.jsx("span",{children:x<=10?`Auto-skipping in ${x}s...`:"Select an answer to continue"})}),e.jsxs(K,{onClick:U,disabled:!o,className:`font-bold px-6 py-2.5 sm:py-3 rounded-xl flex items-center gap-2 transition-all shadow-md hover:shadow-lg text-sm ${o?"bg-[#9956DE] hover:bg-[#8850CE] text-white shadow-[#9956DE]/20":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[a=d*.7?"bg-gradient-to-br from-[#75D06A] to-[#6ED1CF]":"bg-gradient-to-br from-[#FFB356] to-[#FF8B8B]"}`,children:u.length>=d*.7?e.jsx(W,{size:48,className:"text-white"}):e.jsx(X,{size:48,className:"text-white"})}),e.jsx("h2",{className:"text-3xl font-bold font-display text-[#0a1628] mb-2",children:"Assessment Complete!"}),e.jsxs("p",{className:"text-[#5a6578] mb-6",children:["Great job, ",$,"! Your personalized learning path is ready."]}),e.jsxs("div",{className:"bg-gradient-to-br from-[#1FA7E1]/10 to-[#6ED1CF]/10 rounded-2xl p-5 mb-5",children:[e.jsxs("div",{className:"text-sm text-[#5a6578] mb-2",children:["You answered ",u.length," questions"]}),e.jsx("div",{className:"text-xs text-[#5a6578]",children:"Results will be available shortly..."})]}),e.jsx("p",{className:"text-xs text-slate-400 mb-4",children:"Redirecting to dashboard..."})]})})]})})};export{Se as default}; + */const ie=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],le=V("minimize-2",ie),Se=({testId:T,questions:f,userName:$,onComplete:B,onCancel:L})=>{const[h,_]=r.useState("testing"),[a,S]=r.useState(0),[o,b]=r.useState(null),[u,E]=r.useState(()=>{try{const t=sessionStorage.getItem("mathpulse_diagnostic_responses");return t?JSON.parse(t):[]}catch{return[]}}),[g,k]=r.useState([]),[x,z]=r.useState(0),[C,D]=r.useState(null),[A,w]=r.useState(!1),c=r.useRef(null),F=r.useRef(Date.now()),p=r.useRef(!1),d=f.length,l=f[a],P=Math.round((a+(o?1:0))/d*100),v=t=>t==="easy"?60:t==="hard"?120:90,[q]=r.useState(Array.from({length:10},(t,s)=>({id:s,size:Math.random()*80+30,x:Math.random()*100,y:Math.random()*100,duration:Math.random()*20+15,delay:Math.random()*-20,color:["bg-purple-500/10","bg-blue-500/10","bg-cyan-500/10","bg-emerald-500/10"][Math.floor(Math.random()*4)]})));r.useEffect(()=>{const t=v(l?.difficulty||"medium");return F.current=Date.now(),p.current=!1,z(t),c.current&&clearInterval(c.current),c.current=setInterval(()=>{const s=Math.floor((Date.now()-F.current)/1e3),n=Math.max(0,t-s);z(n),n<=0&&!p.current&&(p.current=!0,clearInterval(c.current))},250),()=>{c.current&&clearInterval(c.current)}},[a]),r.useEffect(()=>{if(x===0&&p.current&&h==="testing"){const t=v(l?.difficulty||"medium"),s=[...u,{question_id:l.question_id,student_answer:o||"",time_spent_seconds:t}],n=[...g,!1];k(n),E(s),b(null),am+1):I(s)}},[x]);const O=r.useCallback(()=>{const t=document.getElementById("assessment-container");t&&(document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen().then(()=>{w(!1)}).catch(s=>{console.error("Exit fullscreen error:",s)}):t.requestFullscreen().then(()=>{w(!0)}).catch(s=>{console.error("Fullscreen error:",s)}))},[]);r.useEffect(()=>{const t=()=>{w(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)},[]);const Q=t=>{b(t)},U=()=>{if(!o)return;c.current&&clearInterval(c.current);const t=v(l?.difficulty||"medium")-x,s=[...g,!0],n=[...u,{question_id:l.question_id,student_answer:o,time_spent_seconds:t}];k(s),E(n),b(null),am+1):I(n)},I=async t=>{_("submitting"),D(null);try{sessionStorage.setItem("mathpulse_diagnostic_responses",JSON.stringify(t))}catch{}try{const s=await ee(T,t);sessionStorage.removeItem("mathpulse_diagnostic"),sessionStorage.removeItem("mathpulse_diagnostic_responses"),_("results");try{const{emitPipelineEvent:n,getStudentContext:m}=await M(async()=>{const{emitPipelineEvent:j,getStudentContext:N}=await import("./pipelineService-CMil_uZC.js");return{emitPipelineEvent:j,getStudentContext:N}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),{auth:R}=await M(async()=>{const{auth:j}=await import("./index-D9TvEOZX.js").then(N=>N.b6);return{auth:j}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])),y=m();y&&R.currentUser&&n({student_id:R.currentUser.uid,event_type:"diagnostic",event_data:{overall_score:s.overall_score_percent,mastery_summary:s.mastery_summary},occurred_at:new Date().toISOString(),class_id:y.classId,teacher_id:y.teacherId})}catch{}setTimeout(()=>{B({overallRisk:s.overall_risk,overallScorePercent:s.overall_score_percent,intervention:s.recommended_intervention,xpEarned:s.xp_earned,badgeUnlocked:s.badge_unlocked})},3e3)}catch(s){const n=s instanceof Error?s.message:"Submission failed. Your answers are saved locally.";D(n)}},Y=t=>{const s=Math.floor(t/60),n=t%60;return`${s}:${n.toString().padStart(2,"0")}`},J=["A","B","C","D"];return e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-md flex items-center justify-center p-4 sm:p-6 overflow-hidden",children:e.jsxs("div",{id:"assessment-container",className:"bg-white/95 backdrop-blur-xl border border-white/20 rounded-3xl shadow-[0_0_50px_rgba(0,0,0,0.3)] w-full max-w-4xl h-[95vh] sm:h-[90vh] md:h-[85vh] flex flex-col relative z-10 overflow-hidden transition-all duration-300",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none z-0 overflow-hidden",children:q.map(t=>e.jsx(i.div,{className:`absolute rounded-full blur-3xl ${t.color.replace("/10","/30")}`,style:{width:t.size*1.5,height:t.size*1.5,left:`${t.x}%`,top:`${t.y}%`},animate:{x:[0,Math.random()*100-50,0],y:[0,Math.random()*100-50,0],scale:[1,1.3,1]},transition:{duration:t.duration,repeat:1/0,ease:"linear",delay:t.delay}},t.id))}),e.jsxs(i.div,{className:"shrink-0 text-white border-b border-white/10 shadow-md relative z-10",style:{backgroundColor:"#9956DE"},children:[e.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-5 md:p-6",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[e.jsx("h2",{className:"text-lg sm:text-xl md:text-2xl font-bold truncate",children:"Diagnostic Assessment"}),e.jsxs("p",{className:"text-white/80 text-xs sm:text-sm font-medium truncate",children:[l.domain," • ",l.difficulty]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:O,className:"w-9 h-9 sm:w-10 sm:h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",title:A?"Exit Fullscreen":"Enter Fullscreen",children:A?e.jsx(le,{size:18}):e.jsx(te,{size:18})}),e.jsx("button",{onClick:L,className:"w-9 h-9 sm:w-10 sm:h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",children:e.jsx(se,{size:20})})]})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 md:px-6 pb-3 sm:pb-4 md:pb-5",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"bg-white/20 px-3 py-1 rounded-full flex items-center gap-1",children:[e.jsx(Z,{size:16}),e.jsxs("span",{className:"font-bold text-sm",children:[u.length," / ",d]})]})}),e.jsxs("div",{className:`flex items-center gap-1 px-3 py-1 rounded-full ${x<=10?"bg-red-500/80 animate-pulse":"bg-white/20"}`,children:[e.jsx(ne,{size:16}),e.jsx("span",{className:"font-bold text-sm",children:Y(x)})]})]}),e.jsxs("div",{className:"px-4 sm:px-5 md:px-6 pb-3 sm:pb-4 md:pb-5",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Question ",a+1," of ",d]}),e.jsxs("span",{className:"text-sm font-bold",children:[P,"%"]})]}),e.jsx("div",{className:"flex items-center gap-1",children:f.map((t,s)=>{let n="bg-white/30";return s{const s=l.options[t];if(!s)return null;const n=o===t;let m="bg-[#edf1f7] hover:bg-[#dde3eb] border-[#dde3eb]";return n&&(m="bg-purple-50 border-[#9956DE]"),e.jsx(i.button,{whileHover:{scale:1.01},whileTap:{scale:.99},onClick:()=>Q(t),className:`w-full text-left p-2.5 sm:p-3 md:p-4 rounded-xl border-2 transition-all ${m} cursor-pointer shadow-sm hover:shadow-md flex items-center min-h-[3rem] sm:min-h-[4rem] md:min-h-[5rem]`,children:e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 w-full min-w-0",children:[e.jsx("div",{className:`w-8 h-8 sm:w-10 sm:h-10 rounded-xl shrink-0 flex items-center justify-center font-bold text-sm sm:text-base ${n?"bg-[#9956DE] text-white shadow-inner":"bg-white text-[#0a1628] shadow-sm"}`,children:t}),e.jsx("span",{className:"font-semibold text-[#0a1628] text-xs sm:text-sm md:text-base break-words",children:s}),n&&e.jsx(re,{size:18,className:"ml-auto text-[#9956DE] flex-shrink-0"})]})},t)})})]},a)})}),e.jsx("div",{className:"p-4 sm:p-5 md:p-6 bg-[#edf1f7] border-t border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm text-[#5a6578]",children:o?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{size:16}),"Ready for the next one!"]}):e.jsx("span",{children:x<=10?`Auto-skipping in ${x}s...`:"Select an answer to continue"})}),e.jsxs(K,{onClick:U,disabled:!o,className:`font-bold px-6 py-2.5 sm:py-3 rounded-xl flex items-center gap-2 transition-all shadow-md hover:shadow-lg text-sm ${o?"bg-[#9956DE] hover:bg-[#8850CE] text-white shadow-[#9956DE]/20":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[a=d*.7?"bg-gradient-to-br from-[#75D06A] to-[#6ED1CF]":"bg-gradient-to-br from-[#FFB356] to-[#FF8B8B]"}`,children:u.length>=d*.7?e.jsx(W,{size:48,className:"text-white"}):e.jsx(X,{size:48,className:"text-white"})}),e.jsx("h2",{className:"text-3xl font-bold font-display text-[#0a1628] mb-2",children:"Assessment Complete!"}),e.jsxs("p",{className:"text-[#5a6578] mb-6",children:["Great job, ",$,"! Your personalized learning path is ready."]}),e.jsxs("div",{className:"bg-gradient-to-br from-[#1FA7E1]/10 to-[#6ED1CF]/10 rounded-2xl p-5 mb-5",children:[e.jsxs("div",{className:"text-sm text-[#5a6578] mb-2",children:["You answered ",u.length," questions"]}),e.jsx("div",{className:"text-xs text-[#5a6578]",children:"Results will be available shortly..."})]}),e.jsx("p",{className:"text-xs text-slate-400 mb-4",children:"Redirecting to dashboard..."})]})})]})})};export{Se as default}; diff --git a/assets/AvatarShop-DteqBGRd.js b/assets/AvatarShop-D_3LCLIt.js similarity index 97% rename from assets/AvatarShop-DteqBGRd.js rename to assets/AvatarShop-D_3LCLIt.js index abc7428f17960ada1a0c996f25c6b34f80a1c179..38a7a72dab6f40270632cdec6d37354231c22dbd 100644 --- a/assets/AvatarShop-DteqBGRd.js +++ b/assets/AvatarShop-D_3LCLIt.js @@ -1,4 +1,4 @@ -import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{e as se,L as ae,g as re,f as oe}from"./vendor-radix-BPuEd8FG.js";import{e as S,u as le,L as w,a6 as R,m as y,h as ie,j as c,aO as ne,aP as ce}from"./index-Cvals0ud.js";import{u as de}from"./useFeatureAccess-BtwbTJw1.js";import{T as me,a as ue,b as xe}from"./tooltip-ERqatgcd.js";import{C as pe}from"./CompositeAvatar-Col05lJc.js";import{M as j}from"./avatarData-BuQSOXo3.js";import{S as O}from"./save-FkmW81ji.js";import{S as V}from"./sparkles-Chs7kbc0.js";import{S as fe}from"./shirt-Dh8-NVGy.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/** +import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{e as se,L as ae,g as re,f as oe}from"./vendor-radix-C5nwdvGr.js";import{e as S,u as le,L as w,a6 as R,m as y,h as ie,j as c,aO as ne,aP as ce}from"./index-D9TvEOZX.js";import{u as de}from"./useFeatureAccess-B5wpJDpf.js";import{T as me,a as ue,b as xe}from"./tooltip-B9-3_gHy.js";import{C as pe}from"./CompositeAvatar-Col05lJc.js";import{M as j}from"./avatarData-BuQSOXo3.js";import{S as O}from"./save-BUPludiE.js";import{S as V}from"./sparkles-BLpoopVP.js";import{S as fe}from"./shirt-BptpMBI2.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatMarkdown-Bihf5n-9.js b/assets/ChatMarkdown-D5DdKmyx.js similarity index 94% rename from assets/ChatMarkdown-Bihf5n-9.js rename to assets/ChatMarkdown-D5DdKmyx.js index 1cc18ac6b83d9ebc3f3d4bec896708c6c6dead48..2a9f8cbfc9de1a4e27128ec9dba51c2f74fe65c9 100644 --- a/assets/ChatMarkdown-Bihf5n-9.js +++ b/assets/ChatMarkdown-D5DdKmyx.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]); -import{b5 as d,_ as c}from"./index-Cvals0ud.js";import{r as m,j as r}from"./vendor-react-B4AQeu28.js";import{M as h,r as x,a as y}from"./vendor-markdown-yqZQ_iQm.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";let a=null;const p=()=>(a||(a=c(()=>import("./vendor-markdown-yqZQ_iQm.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),a),M=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=d(l);return r.jsx("div",{className:"chat-markdown",children:r.jsx(h,{remarkPlugins:[y],rehypePlugins:[x],components:{a:({href:e,children:s})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:s}),code:e=>{const{inline:s,className:o,children:n,...i}=e;return r.jsx("code",{className:`${s?"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 text-sm":"block bg-gray-100 dark:bg-gray-900 rounded p-3 overflow-x-auto my-2"} ${o||""}`,...i,children:n})},blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),h1:({children:e})=>r.jsx("h1",{className:"text-2xl font-bold my-2",children:e}),h2:({children:e})=>r.jsx("h2",{className:"text-xl font-bold my-2",children:e}),h3:({children:e})=>r.jsx("h3",{className:"text-lg font-bold my-2",children:e}),h4:({children:e})=>r.jsx("h4",{className:"text-base font-bold my-2",children:e}),h5:({children:e})=>r.jsx("h5",{className:"text-sm font-bold my-2",children:e}),h6:({children:e})=>r.jsx("h6",{className:"text-xs font-bold my-2",children:e}),ul:({children:e})=>r.jsx("ul",{className:"list-disc list-inside my-2",children:e}),ol:({children:e})=>r.jsx("ol",{className:"list-decimal list-inside my-2",children:e}),li:({children:e})=>r.jsx("li",{className:"ml-2",children:e}),hr:()=>r.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:e})=>r.jsx("p",{className:"my-1",children:e})},children:t})})};export{M as default}; +import{b5 as d,_ as c}from"./index-D9TvEOZX.js";import{r as m,j as r}from"./vendor-react-B4AQeu28.js";import{M as h,r as x,a as y}from"./vendor-markdown-yqZQ_iQm.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";let a=null;const p=()=>(a||(a=c(()=>import("./vendor-markdown-yqZQ_iQm.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),a),M=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=d(l);return r.jsx("div",{className:"chat-markdown",children:r.jsx(h,{remarkPlugins:[y],rehypePlugins:[x],components:{a:({href:e,children:s})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:s}),code:e=>{const{inline:s,className:o,children:n,...i}=e;return r.jsx("code",{className:`${s?"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 text-sm":"block bg-gray-100 dark:bg-gray-900 rounded p-3 overflow-x-auto my-2"} ${o||""}`,...i,children:n})},blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),h1:({children:e})=>r.jsx("h1",{className:"text-2xl font-bold my-2",children:e}),h2:({children:e})=>r.jsx("h2",{className:"text-xl font-bold my-2",children:e}),h3:({children:e})=>r.jsx("h3",{className:"text-lg font-bold my-2",children:e}),h4:({children:e})=>r.jsx("h4",{className:"text-base font-bold my-2",children:e}),h5:({children:e})=>r.jsx("h5",{className:"text-sm font-bold my-2",children:e}),h6:({children:e})=>r.jsx("h6",{className:"text-xs font-bold my-2",children:e}),ul:({children:e})=>r.jsx("ul",{className:"list-disc list-inside my-2",children:e}),ol:({children:e})=>r.jsx("ol",{className:"list-decimal list-inside my-2",children:e}),li:({children:e})=>r.jsx("li",{className:"ml-2",children:e}),hr:()=>r.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:e})=>r.jsx("p",{className:"my-1",children:e})},children:t})})};export{M as default}; diff --git a/assets/CompetencyRadarChart-uhr-7kWw.js b/assets/CompetencyRadarChart-lijh1wQQ.js similarity index 97% rename from assets/CompetencyRadarChart-uhr-7kWw.js rename to assets/CompetencyRadarChart-lijh1wQQ.js index c22a8b4c24963475bd191f74acd62fe810af6b60..2463bcd4fe7d872334190a3a842011e5011436a3 100644 --- a/assets/CompetencyRadarChart-uhr-7kWw.js +++ b/assets/CompetencyRadarChart-lijh1wQQ.js @@ -1 +1 @@ -import{r as g,j as t}from"./vendor-react-B4AQeu28.js";import{g as A,ad as I,u as B,m as L,B as O,R as W,b as H}from"./index-Cvals0ud.js";import{collection as R,getDocs as q,query as K,orderBy as U,limit as $,Timestamp as G,getDoc as J,doc as V}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as X,s as Y}from"./subjects-jEWdBmnZ.js";import{S as Z}from"./sparkles-Chs7kbc0.js";import{R as ee,f as te,g as se,h as ne,i as ae,j as oe,T as re}from"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-NTUNS-L9.js";const P=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];async function ie(a){try{const r=R(A,"users",a,"quizResults"),d=K(r,U("timestamp","desc"),$(500)),l=await q(d);return l.empty?F(a):l.docs.map(s=>{const e=s.data();return{quizId:s.id,moduleId:e.moduleId||"",subjectId:e.subjectId||"",score:typeof e.score=="number"?e.score:0,totalQuestions:e.totalQuestions||0,correctAnswers:e.correctAnswers||0,questionType:e.questionType||"multiple_choice",timestamp:e.timestamp instanceof G||e.timestamp?.toDate?e.timestamp.toDate():new Date,timeSpent:e.timeSpent||0}})}catch(r){return console.error("[competencyService] fetchQuizResults failed, falling back:",r),F(a)}}async function F(a){const r=await J(V(A,"progress",a));return r.exists()?(r.data().quizAttempts||[]).map((s,e)=>({quizId:String(s.quizId||`attempt-${e}`),moduleId:String(s.moduleId||s.quizId||""),subjectId:String(s.subjectId||""),score:typeof s.score=="number"?s.score:0,totalQuestions:s.totalQuestions||0,correctAnswers:typeof s.correctAnswers=="number"?s.correctAnswers:0,questionType:s.questionType||"multiple_choice",timestamp:s.completedAt?new Date(s.completedAt):new Date,timeSpent:s.timeSpent||0})):[]}async function ce(a){try{const r=R(A,"users",a,"moduleProgress"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,subjectId:e.subjectId||"",sessionsCompleted:e.sessionsCompleted||0,lastActive:e.lastActive?e.lastActive instanceof G?e.lastActive.toDate():new Date(e.lastActive):new Date,moduleTitle:e.moduleTitle||s.id,lessonsCompleted:e.lessonsCompleted||[],quizzesCompleted:e.quizzesCompleted||[]}}),l}catch(r){return console.error("[competencyService] fetchModuleProgress failed:",r),{}}}function _(a,r,d,l){const s=r.filter(p=>p.moduleId===a),e=s.length>0?s.reduce((p,b)=>p+b.score,0)/s.length:0,h=["identification","multiple_choice"],u=s.filter(p=>h.includes(p.questionType)),i=u.length>0?u.reduce((p,b)=>p+b.score,0)/u.length:e*.9,o=["word_problem","equation_based","enumeration"],n=s.filter(p=>o.includes(p.questionType)),c=n.length>0?n.reduce((p,b)=>p+b.score,0)/n.length:e*.85,m=d,f=m?.lessonsCompleted?.length||0,N=m?.quizzesCompleted?.length||0,D=m?.sessionsCompleted||0,y=l.find(p=>p.id===a),x=y?.lessons?.length||1,C=y?.quizzes?.length||1,z=Math.min(100,f/x*100),k=Math.min(100,N/C*100),v=Math.min(100,(z+k+D*5)/2.5);if(s.length<2){const p=v>50?60+v*.3:v*.8;return{overallMastery:e,conceptGrasp:i,application:c,engagement:v,consistency:Math.min(100,p)}}const w=s.map(p=>p.score),M=w.reduce((p,b)=>p+b,0)/w.length,E=w.reduce((p,b)=>p+Math.pow(b-M,2),0)/w.length,j=Math.sqrt(E)/Math.max(M,1),S=Math.max(0,Math.min(100,(1-j)*100));return{overallMastery:Math.round(e),conceptGrasp:Math.round(i),application:Math.round(c),engagement:Math.round(v),consistency:Math.round(S)}}async function le(a){try{const r=R(A,"users",a,"competencyMatrix"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,moduleName:e.moduleName||s.id,overallMastery:e.overallMastery??0,conceptGrasp:e.conceptGrasp??0,application:e.application??0,engagement:e.engagement??0,consistency:e.consistency??0,computedAt:e.computedAt?.toDate?.()||new Date}}),l}catch(r){return console.error("[competencyService] fetchCachedCompetencyMatrix failed:",r),{}}}const Q=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}];function de(a){const[r,d]=g.useState([]),[l,s]=g.useState([]),[e,h]=g.useState("N/A"),[u,i]=g.useState(!0),[o,n]=g.useState(null),[c,m]=g.useState(!1),f=g.useRef(0),N=g.useCallback(async(y,x)=>{if(x!==f.current)return;const z=X(null)[0]??"gen-math",k=Y.find(j=>j.id===z)?.modules||[],v=k.map((j,S)=>({id:j.id,name:j.title.length>15?j.title.substring(0,15).trim()+"...":j.title,color:P[S%P.length]})),w=await le(a);if(x!==f.current)return;if(Object.keys(w).length>0){ue(w,v,d,h),m(!1),i(!1);return}const M=await ie(a),E=await ce(a);if(x!==f.current)return;const T=M.length>0;m(!T),pe(M,E,v,k,d,h),i(!1)},[a]),D=g.useCallback(async()=>{if(!a){i(!1);return}const y=++f.current;i(!0),n(null);try{const x=await new Promise(C=>{const z=I(a,k=>{z(),C(k)})});if(y!==f.current)return;await N(x,y)}catch(x){console.error("[useCompetencyMatrix] Failed to load:",x),y===f.current&&(n("Failed to load competency data. Please try again."),i(!1))}},[a,N]);return g.useEffect(()=>{if(!a)return;const y=I(a,x=>{const C=++f.current;N(x,C)});return()=>y()},[a,N]),{data:r,modulesList:l,topModule:e,loading:u,error:o,isEmpty:c,refresh:D}}function ue(a,r,d,l){let s=-1,e="N/A";const h=Q.map(u=>{const i={metric:u.label,fullMark:100};return r.forEach(o=>{const n=a[o.id];n&&(u.key==="progress"?i[o.id]=n.overallMastery:u.key==="concept"?i[o.id]=n.conceptGrasp:u.key==="application"?i[o.id]=n.application:u.key==="engagement"?i[o.id]=n.engagement:u.key==="consistency"&&(i[o.id]=n.consistency))}),i});r.forEach(u=>{const i=a[u.id];if(i){const o=(i.overallMastery+i.conceptGrasp+i.application+i.engagement+i.consistency)/5;o>s&&(s=o,e=u.name)}}),l(e),d(h)}function pe(a,r,d,l,s,e){let h=-1,u="N/A";const i=Q.map(o=>{const n={metric:o.label,fullMark:100};return l.forEach(c=>{const m=r[c.id],f=_(c.id,a,m??{moduleId:c.id,sessionsCompleted:0,moduleTitle:c.title,lessonsCompleted:[],quizzesCompleted:[]},l);o.key==="progress"?n[c.id]=f.overallMastery:o.key==="concept"?n[c.id]=f.conceptGrasp:o.key==="application"?n[c.id]=f.application:o.key==="engagement"?n[c.id]=f.engagement:o.key==="consistency"&&(n[c.id]=f.consistency)}),n});l.forEach(o=>{const n=r[o.id],c=_(o.id,a,n??{moduleId:o.id,sessionsCompleted:0,moduleTitle:o.title,lessonsCompleted:[],quizzesCompleted:[]},l),m=(c.overallMastery+c.conceptGrasp+c.application+c.engagement+c.consistency)/5;m>h&&(h=m,u=d.find(f=>f.id===o.id)?.name||"N/A")}),e(u),s(i)}const ze=()=>{const{userProfile:a}=B(),{data:r,modulesList:d,topModule:l,loading:s,error:e,isEmpty:h,refresh:u}=de(a?.uid??""),[i,o]=g.useState(!1);return t.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white rounded-[16px] border border-slate-200 shadow-sm p-6 lg:p-8 group",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.jsx("div",{className:"absolute -right-12 -bottom-12 w-32 h-32 bg-[#9956DE]/5 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-6 relative z-10 gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center shadow-[0_4px_12px_rgba(168,85,247,0.2)]",children:t.jsx(O,{size:20,className:"text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-[15px] font-bold text-slate-900",children:"Competency Matrix"}),t.jsx("p",{className:"text-[12px] text-slate-500",children:"Realtime performance across modules"})]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[!s&&!h&&!e&&t.jsxs("div",{className:"flex items-center gap-2 bg-[#f5f3ff] border border-[#e0e7ff] px-3 py-1.5 rounded-full",children:[t.jsx(Z,{size:12,className:"text-amber-500"}),t.jsx("span",{className:"text-[11px] font-bold text-[#9956DE] uppercase tracking-wider",children:l})]}),!s&&t.jsx("button",{onClick:u,className:"w-8 h-8 rounded-full bg-white border border-slate-200 flex items-center justify-center hover:bg-[#f5f3ff] hover:border-[#9956DE]/30 transition-colors shadow-sm",title:"Refresh",children:t.jsx(W,{size:13,className:"text-slate-400"})})]})]}),t.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-[#9956DE]/20 border-t-[#9956DE] rounded-full animate-spin"}),t.jsx("p",{className:"text-[13px] text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):h||e?t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4",children:[t.jsx("div",{className:"w-14 h-14 rounded-[16px] bg-gradient-to-br from-slate-100 to-slate-50 flex items-center justify-center border border-slate-200",children:t.jsx(H,{size:24,className:"text-slate-400"})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-[13px] font-semibold text-slate-600 mb-1",children:e?"Unable to load competency data":"No activity yet"}),t.jsx("p",{className:"text-[12px] text-slate-400 max-w-[260px]",children:e||"Complete quizzes and lessons to see your competency matrix here."})]}),e&&t.jsx("button",{onClick:u,className:"px-4 py-2 text-[12px] font-semibold bg-[#9956DE] text-white rounded-full hover:bg-[#8b45d1] transition-colors shadow-md",children:"Try Again"})]}):t.jsx(ee,{width:"100%",height:"100%",children:t.jsxs(te,{cx:"50%",cy:"50%",outerRadius:i?"75%":"70%",data:r,children:[t.jsx(se,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),t.jsx(ne,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600}}),t.jsx(ae,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),d.map(n=>t.jsx(oe,{name:n.name,dataKey:n.id,stroke:n.color,strokeWidth:2,fill:n.color,fillOpacity:.3,dot:{r:3,fill:"#fff",stroke:n.color,strokeWidth:2},activeDot:{r:5,fill:n.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},n.id)),t.jsx(re,{cursor:!1,content:({active:n,payload:c})=>n&&c&&c.length?t.jsxs("div",{className:"bg-white/95 backdrop-blur-[12px] shadow-[0_8px_24px_rgba(0,0,0,0.12)] border border-slate-100 rounded-[12px] p-4",children:[t.jsx("p",{className:"font-bold text-slate-800 text-[13px] mb-2",children:c[0].payload.metric}),t.jsx("div",{className:"flex flex-col gap-1.5",children:c.map(m=>t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:m.stroke}}),t.jsx("span",{className:"text-[11px] font-semibold text-slate-600 truncate max-w-[120px]",children:String(m.name)})]}),t.jsxs("span",{className:"text-[13px] font-bold",style:{color:m.stroke},children:[Math.round(m.value),"%"]})]},m.name))})]}):null})]})})}),!s&&!h&&!e&&d.length>0&&t.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 mt-4 relative z-10",children:d.map(n=>t.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-50 px-2.5 py-1 rounded-full border border-slate-100",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-wider",children:n.name.length>15?n.name.substring(0,12)+"...":n.name})]},n.id))})]})};export{ze as CompetencyRadarChart}; +import{r as g,j as t}from"./vendor-react-B4AQeu28.js";import{g as A,ad as I,u as B,m as L,B as O,R as W,b as H}from"./index-D9TvEOZX.js";import{collection as R,getDocs as q,query as K,orderBy as U,limit as $,Timestamp as G,getDoc as J,doc as V}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as X,s as Y}from"./subjects-BJQJlUBm.js";import{S as Z}from"./sparkles-BLpoopVP.js";import{R as ee,f as te,g as se,h as ne,i as ae,j as oe,T as re}from"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-BwIV9b12.js";const P=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];async function ie(a){try{const r=R(A,"users",a,"quizResults"),d=K(r,U("timestamp","desc"),$(500)),l=await q(d);return l.empty?F(a):l.docs.map(s=>{const e=s.data();return{quizId:s.id,moduleId:e.moduleId||"",subjectId:e.subjectId||"",score:typeof e.score=="number"?e.score:0,totalQuestions:e.totalQuestions||0,correctAnswers:e.correctAnswers||0,questionType:e.questionType||"multiple_choice",timestamp:e.timestamp instanceof G||e.timestamp?.toDate?e.timestamp.toDate():new Date,timeSpent:e.timeSpent||0}})}catch(r){return console.error("[competencyService] fetchQuizResults failed, falling back:",r),F(a)}}async function F(a){const r=await J(V(A,"progress",a));return r.exists()?(r.data().quizAttempts||[]).map((s,e)=>({quizId:String(s.quizId||`attempt-${e}`),moduleId:String(s.moduleId||s.quizId||""),subjectId:String(s.subjectId||""),score:typeof s.score=="number"?s.score:0,totalQuestions:s.totalQuestions||0,correctAnswers:typeof s.correctAnswers=="number"?s.correctAnswers:0,questionType:s.questionType||"multiple_choice",timestamp:s.completedAt?new Date(s.completedAt):new Date,timeSpent:s.timeSpent||0})):[]}async function ce(a){try{const r=R(A,"users",a,"moduleProgress"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,subjectId:e.subjectId||"",sessionsCompleted:e.sessionsCompleted||0,lastActive:e.lastActive?e.lastActive instanceof G?e.lastActive.toDate():new Date(e.lastActive):new Date,moduleTitle:e.moduleTitle||s.id,lessonsCompleted:e.lessonsCompleted||[],quizzesCompleted:e.quizzesCompleted||[]}}),l}catch(r){return console.error("[competencyService] fetchModuleProgress failed:",r),{}}}function _(a,r,d,l){const s=r.filter(p=>p.moduleId===a),e=s.length>0?s.reduce((p,b)=>p+b.score,0)/s.length:0,h=["identification","multiple_choice"],u=s.filter(p=>h.includes(p.questionType)),i=u.length>0?u.reduce((p,b)=>p+b.score,0)/u.length:e*.9,o=["word_problem","equation_based","enumeration"],n=s.filter(p=>o.includes(p.questionType)),c=n.length>0?n.reduce((p,b)=>p+b.score,0)/n.length:e*.85,m=d,f=m?.lessonsCompleted?.length||0,N=m?.quizzesCompleted?.length||0,D=m?.sessionsCompleted||0,y=l.find(p=>p.id===a),x=y?.lessons?.length||1,C=y?.quizzes?.length||1,z=Math.min(100,f/x*100),k=Math.min(100,N/C*100),v=Math.min(100,(z+k+D*5)/2.5);if(s.length<2){const p=v>50?60+v*.3:v*.8;return{overallMastery:e,conceptGrasp:i,application:c,engagement:v,consistency:Math.min(100,p)}}const w=s.map(p=>p.score),M=w.reduce((p,b)=>p+b,0)/w.length,E=w.reduce((p,b)=>p+Math.pow(b-M,2),0)/w.length,j=Math.sqrt(E)/Math.max(M,1),S=Math.max(0,Math.min(100,(1-j)*100));return{overallMastery:Math.round(e),conceptGrasp:Math.round(i),application:Math.round(c),engagement:Math.round(v),consistency:Math.round(S)}}async function le(a){try{const r=R(A,"users",a,"competencyMatrix"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,moduleName:e.moduleName||s.id,overallMastery:e.overallMastery??0,conceptGrasp:e.conceptGrasp??0,application:e.application??0,engagement:e.engagement??0,consistency:e.consistency??0,computedAt:e.computedAt?.toDate?.()||new Date}}),l}catch(r){return console.error("[competencyService] fetchCachedCompetencyMatrix failed:",r),{}}}const Q=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}];function de(a){const[r,d]=g.useState([]),[l,s]=g.useState([]),[e,h]=g.useState("N/A"),[u,i]=g.useState(!0),[o,n]=g.useState(null),[c,m]=g.useState(!1),f=g.useRef(0),N=g.useCallback(async(y,x)=>{if(x!==f.current)return;const z=X(null)[0]??"gen-math",k=Y.find(j=>j.id===z)?.modules||[],v=k.map((j,S)=>({id:j.id,name:j.title.length>15?j.title.substring(0,15).trim()+"...":j.title,color:P[S%P.length]})),w=await le(a);if(x!==f.current)return;if(Object.keys(w).length>0){ue(w,v,d,h),m(!1),i(!1);return}const M=await ie(a),E=await ce(a);if(x!==f.current)return;const T=M.length>0;m(!T),pe(M,E,v,k,d,h),i(!1)},[a]),D=g.useCallback(async()=>{if(!a){i(!1);return}const y=++f.current;i(!0),n(null);try{const x=await new Promise(C=>{const z=I(a,k=>{z(),C(k)})});if(y!==f.current)return;await N(x,y)}catch(x){console.error("[useCompetencyMatrix] Failed to load:",x),y===f.current&&(n("Failed to load competency data. Please try again."),i(!1))}},[a,N]);return g.useEffect(()=>{if(!a)return;const y=I(a,x=>{const C=++f.current;N(x,C)});return()=>y()},[a,N]),{data:r,modulesList:l,topModule:e,loading:u,error:o,isEmpty:c,refresh:D}}function ue(a,r,d,l){let s=-1,e="N/A";const h=Q.map(u=>{const i={metric:u.label,fullMark:100};return r.forEach(o=>{const n=a[o.id];n&&(u.key==="progress"?i[o.id]=n.overallMastery:u.key==="concept"?i[o.id]=n.conceptGrasp:u.key==="application"?i[o.id]=n.application:u.key==="engagement"?i[o.id]=n.engagement:u.key==="consistency"&&(i[o.id]=n.consistency))}),i});r.forEach(u=>{const i=a[u.id];if(i){const o=(i.overallMastery+i.conceptGrasp+i.application+i.engagement+i.consistency)/5;o>s&&(s=o,e=u.name)}}),l(e),d(h)}function pe(a,r,d,l,s,e){let h=-1,u="N/A";const i=Q.map(o=>{const n={metric:o.label,fullMark:100};return l.forEach(c=>{const m=r[c.id],f=_(c.id,a,m??{moduleId:c.id,sessionsCompleted:0,moduleTitle:c.title,lessonsCompleted:[],quizzesCompleted:[]},l);o.key==="progress"?n[c.id]=f.overallMastery:o.key==="concept"?n[c.id]=f.conceptGrasp:o.key==="application"?n[c.id]=f.application:o.key==="engagement"?n[c.id]=f.engagement:o.key==="consistency"&&(n[c.id]=f.consistency)}),n});l.forEach(o=>{const n=r[o.id],c=_(o.id,a,n??{moduleId:o.id,sessionsCompleted:0,moduleTitle:o.title,lessonsCompleted:[],quizzesCompleted:[]},l),m=(c.overallMastery+c.conceptGrasp+c.application+c.engagement+c.consistency)/5;m>h&&(h=m,u=d.find(f=>f.id===o.id)?.name||"N/A")}),e(u),s(i)}const ze=()=>{const{userProfile:a}=B(),{data:r,modulesList:d,topModule:l,loading:s,error:e,isEmpty:h,refresh:u}=de(a?.uid??""),[i,o]=g.useState(!1);return t.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white rounded-[16px] border border-slate-200 shadow-sm p-6 lg:p-8 group",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.jsx("div",{className:"absolute -right-12 -bottom-12 w-32 h-32 bg-[#9956DE]/5 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-6 relative z-10 gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center shadow-[0_4px_12px_rgba(168,85,247,0.2)]",children:t.jsx(O,{size:20,className:"text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-[15px] font-bold text-slate-900",children:"Competency Matrix"}),t.jsx("p",{className:"text-[12px] text-slate-500",children:"Realtime performance across modules"})]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[!s&&!h&&!e&&t.jsxs("div",{className:"flex items-center gap-2 bg-[#f5f3ff] border border-[#e0e7ff] px-3 py-1.5 rounded-full",children:[t.jsx(Z,{size:12,className:"text-amber-500"}),t.jsx("span",{className:"text-[11px] font-bold text-[#9956DE] uppercase tracking-wider",children:l})]}),!s&&t.jsx("button",{onClick:u,className:"w-8 h-8 rounded-full bg-white border border-slate-200 flex items-center justify-center hover:bg-[#f5f3ff] hover:border-[#9956DE]/30 transition-colors shadow-sm",title:"Refresh",children:t.jsx(W,{size:13,className:"text-slate-400"})})]})]}),t.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-[#9956DE]/20 border-t-[#9956DE] rounded-full animate-spin"}),t.jsx("p",{className:"text-[13px] text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):h||e?t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4",children:[t.jsx("div",{className:"w-14 h-14 rounded-[16px] bg-gradient-to-br from-slate-100 to-slate-50 flex items-center justify-center border border-slate-200",children:t.jsx(H,{size:24,className:"text-slate-400"})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-[13px] font-semibold text-slate-600 mb-1",children:e?"Unable to load competency data":"No activity yet"}),t.jsx("p",{className:"text-[12px] text-slate-400 max-w-[260px]",children:e||"Complete quizzes and lessons to see your competency matrix here."})]}),e&&t.jsx("button",{onClick:u,className:"px-4 py-2 text-[12px] font-semibold bg-[#9956DE] text-white rounded-full hover:bg-[#8b45d1] transition-colors shadow-md",children:"Try Again"})]}):t.jsx(ee,{width:"100%",height:"100%",children:t.jsxs(te,{cx:"50%",cy:"50%",outerRadius:i?"75%":"70%",data:r,children:[t.jsx(se,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),t.jsx(ne,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600}}),t.jsx(ae,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),d.map(n=>t.jsx(oe,{name:n.name,dataKey:n.id,stroke:n.color,strokeWidth:2,fill:n.color,fillOpacity:.3,dot:{r:3,fill:"#fff",stroke:n.color,strokeWidth:2},activeDot:{r:5,fill:n.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},n.id)),t.jsx(re,{cursor:!1,content:({active:n,payload:c})=>n&&c&&c.length?t.jsxs("div",{className:"bg-white/95 backdrop-blur-[12px] shadow-[0_8px_24px_rgba(0,0,0,0.12)] border border-slate-100 rounded-[12px] p-4",children:[t.jsx("p",{className:"font-bold text-slate-800 text-[13px] mb-2",children:c[0].payload.metric}),t.jsx("div",{className:"flex flex-col gap-1.5",children:c.map(m=>t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:m.stroke}}),t.jsx("span",{className:"text-[11px] font-semibold text-slate-600 truncate max-w-[120px]",children:String(m.name)})]}),t.jsxs("span",{className:"text-[13px] font-bold",style:{color:m.stroke},children:[Math.round(m.value),"%"]})]},m.name))})]}):null})]})})}),!s&&!h&&!e&&d.length>0&&t.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 mt-4 relative z-10",children:d.map(n=>t.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-50 px-2.5 py-1 rounded-full border border-slate-100",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-wider",children:n.name.length>15?n.name.substring(0,12)+"...":n.name})]},n.id))})]})};export{ze as CompetencyRadarChart}; diff --git a/assets/ConfirmModal-CzN8U1r6.js b/assets/ConfirmModal-bHzo3ssd.js similarity index 91% rename from assets/ConfirmModal-CzN8U1r6.js rename to assets/ConfirmModal-bHzo3ssd.js index 1316af75feab49395ab4520f96843d05b6d29133..09b43b491364108f7e7e3d6ec0dc4c3f1330ddea 100644 --- a/assets/ConfirmModal-CzN8U1r6.js +++ b/assets/ConfirmModal-bHzo3ssd.js @@ -1 +1 @@ -import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-CanHmtQ3.js";import{h as u,m as r,y as f}from"./index-Cvals0ud.js";import{X as y}from"./x-cRIR5BcS.js";import{T as j}from"./trash-2-DaNTdmd2.js";import{L as w}from"./log-out-CKjuia0o.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const O=({isOpen:s,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:m="warning",icon:x="warning",zIndexClass:g="z-50"})=>{const b=()=>{switch(x){case"logout":return e.jsx(w,{size:32});case"delete":return e.jsx(j,{size:32});case"warning":default:return e.jsx(f,{size:32})}},o=(()=>{switch(m){case"danger":return{iconBg:"bg-red-100",iconColor:"text-red-600",buttonBg:"bg-red-600 hover:bg-red-700",buttonText:"text-white"};case"warning":return{iconBg:"bg-rose-100",iconColor:"text-rose-600",buttonBg:"bg-rose-600 hover:bg-rose-700",buttonText:"text-white"};case"info":default:return{iconBg:"bg-sky-100",iconColor:"text-sky-600",buttonBg:"bg-sky-600 hover:bg-sky-700",buttonText:"text-white"}}})(),p=async()=>{try{await n(),t()}catch{}};return e.jsx(u,{children:s&&e.jsx(e.Fragment,{children:e.jsx(r.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${g} flex items-center justify-center p-4`,children:e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:h=>h.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl max-w-md w-full overflow-hidden border border-[#dde3eb]",children:[e.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-xl transition-colors z-10",children:e.jsx(y,{size:20})}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(r.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",damping:15},className:`w-20 h-20 ${o.iconBg} rounded-full flex items-center justify-center mx-auto mb-6 ${o.iconColor}`,children:b()}),e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] mb-3",children:a}),e.jsx("p",{className:"text-[#5a6578] mb-8 leading-relaxed",children:l}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(i,{onClick:t,variant:"outline",size:"lg",className:"flex-1 h-12 rounded-xl border-[#dde3eb] hover:border-[#d1cec6] hover:bg-[#edf1f7] font-bold",children:d}),e.jsx(i,{onClick:p,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${o.buttonBg} ${o.buttonText} transition-colors shadow-lg`,children:c})]})]})]})})})})};export{O as default}; +import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-DC8Fz5kC.js";import{h as u,m as r,y as f}from"./index-D9TvEOZX.js";import{X as y}from"./x-DM8tXF3P.js";import{T as j}from"./trash-2-BYUCk-BO.js";import{L as w}from"./log-out-Bh-BcVV5.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const O=({isOpen:s,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:m="warning",icon:x="warning",zIndexClass:g="z-50"})=>{const b=()=>{switch(x){case"logout":return e.jsx(w,{size:32});case"delete":return e.jsx(j,{size:32});case"warning":default:return e.jsx(f,{size:32})}},o=(()=>{switch(m){case"danger":return{iconBg:"bg-red-100",iconColor:"text-red-600",buttonBg:"bg-red-600 hover:bg-red-700",buttonText:"text-white"};case"warning":return{iconBg:"bg-rose-100",iconColor:"text-rose-600",buttonBg:"bg-rose-600 hover:bg-rose-700",buttonText:"text-white"};case"info":default:return{iconBg:"bg-sky-100",iconColor:"text-sky-600",buttonBg:"bg-sky-600 hover:bg-sky-700",buttonText:"text-white"}}})(),p=async()=>{try{await n(),t()}catch{}};return e.jsx(u,{children:s&&e.jsx(e.Fragment,{children:e.jsx(r.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${g} flex items-center justify-center p-4`,children:e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:h=>h.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl max-w-md w-full overflow-hidden border border-[#dde3eb]",children:[e.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-xl transition-colors z-10",children:e.jsx(y,{size:20})}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(r.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",damping:15},className:`w-20 h-20 ${o.iconBg} rounded-full flex items-center justify-center mx-auto mb-6 ${o.iconColor}`,children:b()}),e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] mb-3",children:a}),e.jsx("p",{className:"text-[#5a6578] mb-8 leading-relaxed",children:l}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(i,{onClick:t,variant:"outline",size:"lg",className:"flex-1 h-12 rounded-xl border-[#dde3eb] hover:border-[#d1cec6] hover:bg-[#edf1f7] font-bold",children:d}),e.jsx(i,{onClick:p,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${o.buttonBg} ${o.buttonText} transition-colors shadow-lg`,children:c})]})]})]})})})})};export{O as default}; diff --git a/assets/DiagnosticBreakdown-CfJCo5qL.js b/assets/DiagnosticBreakdown-DT8To33g.js similarity index 97% rename from assets/DiagnosticBreakdown-CfJCo5qL.js rename to assets/DiagnosticBreakdown-DT8To33g.js index d6693477c23150978f369f931580da72d91bd425..04bc4e5d17e6f2213fbdaa71bcdd61385240043e 100644 --- a/assets/DiagnosticBreakdown-CfJCo5qL.js +++ b/assets/DiagnosticBreakdown-DT8To33g.js @@ -1 +1 @@ -import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as y,doc as _}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as k,w as Z,B as H,Z as J,y as C,T as W,r as S,m,h as Y}from"./index-Cvals0ud.js";import{X as G}from"./x-cRIR5BcS.js";import{C as A}from"./clock-BsCO0o69.js";import{L as T,C as K}from"./lightbulb-BO_q6pvi.js";import{C as q}from"./circle-check-Bi1b5YEO.js";import{C as D}from"./chart-column-NTUNS-L9.js";import{a as O,C as V}from"./chevron-up-CzNRBnCs.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const ge=({userId:d,mode:h,isOpen:c=!0,onClose:p})=>{const[o,P]=i.useState([]),[B,$]=i.useState({}),[r,R]=i.useState({}),[a,E]=i.useState(null),[L,x]=i.useState(!0),[Q,j]=i.useState(!0),[g,z]=i.useState(null);i.useEffect(()=>{!d||!c||M()},[d,c]);const M=async()=>{x(!0);try{const s=await y(_(k,"diagnosticResults",d));if(!s.exists()){x(!1);return}const t=s.data(),U=t.responses||[];$(t.domainScores||{}),R(t.riskProfile||{});const b=t.testId;let v={};if(b){const l=await y(_(k,"diagnosticSessions",b));if(l.exists()){const X=l.data();for(const w of X.questions||[])v[w.question_id]=w.question_text}}P(U.map(l=>({...l,question_text:v[l.question_id]}))),x(!1),j(!0);try{const l=await Z("/api/diagnostic/analyze",{method:"POST",body:JSON.stringify({user_id:d})});l.success&&E(l.analysis)}catch(l){console.error("[DiagnosticBreakdown] AI analysis failed:",l)}finally{j(!1)}}catch(s){console.error("[DiagnosticBreakdown] Failed to load data:",s),x(!1),j(!1)}},u=o.filter(s=>s.is_correct).length,n=o.length,f=o.reduce((s,t)=>s+t.time_spent_seconds,0),F=n>0?Math.round(f/n):0,I=n>0?Math.round(u/n*100):0;if(!c)return null;const N=e.jsxs("div",{className:`${h==="fullscreen"?"min-h-screen bg-gradient-to-br from-slate-50 via-white to-indigo-50/30":""} flex flex-col`,children:[e.jsx("div",{className:"top-0 z-10 bg-white border-b border-slate-200/60 px-6 py-4",children:e.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-200",children:e.jsx(H,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold text-slate-900",children:"Diagnostic Assessment Breakdown"}),e.jsx("p",{className:"text-xs text-slate-500",children:"AI-powered analysis of your performance"})]})]}),e.jsx("button",{onClick:p,className:"p-2 hover:bg-slate-100 rounded-xl transition-colors",title:"Close",children:e.jsx(G,{className:"w-5 h-5 text-slate-500"})})]})}),e.jsx("div",{className:"max-w-6xl mx-auto w-full px-6 py-8 space-y-8",children:L?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-32 bg-slate-100 rounded-2xl animate-pulse"},s))}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl p-5 text-white shadow-lg shadow-indigo-200/50",children:[e.jsx("p",{className:"text-indigo-200 text-xs font-medium uppercase",children:"Score"}),e.jsxs("p",{className:"text-3xl font-black mt-1",children:[I,"%"]}),e.jsxs("p",{className:"text-indigo-200 text-sm",children:[u,"/",n," correct"]})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(A,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Avg Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[F,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"per question"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(J,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Total Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[Math.floor(f/60),"m ",f%60,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"assessment duration"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(C,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Risk"})]}),e.jsx("p",{className:`text-2xl font-bold ${r.overall_risk==="high"||r.overall_risk==="critical"?"text-red-600":r.overall_risk==="moderate"?"text-amber-600":"text-emerald-600"}`,children:(r.overall_risk||"unknown").charAt(0).toUpperCase()+(r.overall_risk||"unknown").slice(1)}),e.jsx("p",{className:"text-xs text-slate-400",children:"risk level"})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100 bg-gradient-to-r from-amber-50 to-orange-50",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"w-5 h-5 text-amber-500"}),e.jsx("h2",{className:"font-bold text-slate-800",children:"AI Analysis"})]})}),e.jsx("div",{className:"p-6",children:Q?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-5/6"})]}):a?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-slate-700 leading-relaxed",children:a.overall_summary}),e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-sky-800 text-sm mb-2 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"})," Timing Patterns"]}),e.jsx("p",{className:"text-sm text-sky-700",children:a.time_analysis.insight}),a.time_analysis.slow_questions.length>0&&e.jsxs("p",{className:"text-xs text-sky-600 mt-2",children:[e.jsx("span",{className:"font-medium",children:"Took longest on:"})," ",a.time_analysis.slow_questions.join(", ")]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.strength_areas.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-emerald-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4"})," Strengths"]}),e.jsx("ul",{className:"space-y-2",children:a.strength_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx(q,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]}),a.weakness_areas.length>0&&e.jsxs("div",{className:"border border-red-100 bg-red-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-red-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"})," Weak Areas"]}),e.jsx("ul",{className:"space-y-2",children:a.weakness_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-red-700 flex items-start gap-2",children:[e.jsx(C,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]})]}),a.answer_patterns.common_mistakes.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("h3",{className:"font-semibold text-amber-800 text-sm mb-2",children:"Answer Patterns"}),e.jsx("p",{className:"text-sm text-amber-700 mb-2",children:a.answer_patterns.description}),e.jsx("ul",{className:"space-y-1",children:a.answer_patterns.common_mistakes.map((s,t)=>e.jsxs("li",{className:"text-xs text-amber-600",children:["• ",s]},t))})]}),a.recommendations.length>0&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-indigo-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(T,{className:"w-4 h-4"})," Recommendations"]}),e.jsx("ol",{className:"space-y-2",children:a.recommendations.map((s,t)=>e.jsxs("li",{className:"text-sm text-indigo-700",children:[e.jsxs("span",{className:"font-medium",children:[t+1,". ",s.action]}),e.jsxs("span",{className:"text-indigo-500 text-xs ml-2",children:["— ",s.reason]})]},t))})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-slate-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"})," Performance by Difficulty"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Easy"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.easy_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Medium"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.medium_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Hard"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.hard_performance})]})]})]})]}):e.jsx("p",{className:"text-slate-500 text-sm",children:"Analysis unavailable."})})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(D,{className:"w-5 h-5 text-indigo-500"})," Domain Scores"]})}),e.jsx("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Object.entries(B).map(([s,t])=>e.jsxs("div",{className:"border border-slate-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-2",children:s}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsxs("span",{className:"text-2xl font-black text-slate-800",children:[t.percentage,"%"]}),e.jsxs("span",{className:"text-xs text-slate-400 mb-1",children:[t.correct,"/",t.total]})]}),e.jsx("div",{className:"mt-2 h-2 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${t.percentage>=80?"bg-emerald-500":t.percentage>=60?"bg-amber-500":"bg-red-500"}`,style:{width:`${t.percentage}%`}})}),e.jsx("p",{className:`text-xs mt-1 font-medium ${t.mastery_level==="mastered"?"text-emerald-600":t.mastery_level==="developing"?"text-amber-600":"text-red-600"}`,children:t.mastery_level})]},s))})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5 text-indigo-500"})," Question-by-Question Breakdown"]})}),e.jsx("div",{className:"divide-y divide-slate-50",children:o.map((s,t)=>e.jsxs("div",{className:"px-6 py-3 hover:bg-slate-50/50 transition-colors",children:[e.jsxs("button",{onClick:()=>z(g===t?null:t),className:"w-full flex items-center gap-3 text-left",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0 ${s.is_correct?"bg-emerald-100 text-emerald-600":"bg-red-100 text-red-600"}`,children:s.is_correct?e.jsx(q,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700 truncate",children:["Q",t+1,". ",s.question_text||`${s.topic} (${s.domain})`]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[e.jsx("span",{className:"text-xs text-slate-400",children:s.difficulty}),e.jsxs("span",{className:"text-xs text-slate-400",children:[s.time_spent_seconds,"s"]}),e.jsx("span",{className:"text-xs text-slate-400",children:s.domain})]})]}),g===t?e.jsx(O,{className:"w-4 h-4 text-slate-400"}):e.jsx(V,{className:"w-4 h-4 text-slate-400"})]}),g===t&&e.jsxs(m.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"ml-10 mt-2 pb-2 space-y-2",children:[s.question_text&&e.jsx("p",{className:"text-sm text-slate-600",children:s.question_text}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[e.jsxs("span",{className:s.is_correct?"text-emerald-600":"text-red-600",children:["Your answer: ",e.jsx("strong",{children:s.student_answer||"—"})]}),!s.is_correct&&e.jsxs("span",{className:"text-emerald-600",children:["Correct: ",e.jsx("strong",{children:s.correct_answer})]}),e.jsxs("span",{className:"text-slate-500",children:["Time: ",s.time_spent_seconds,"s"]}),e.jsxs("span",{className:"text-slate-500",children:["Bloom: ",s.bloom_level]})]})]})]},t))})]}),e.jsx("div",{className:"flex justify-center pb-8",children:e.jsx("button",{onClick:p,className:"px-8 py-3 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-lg shadow-indigo-200 transition-all",children:h==="fullscreen"?"Continue to Dashboard":"Close"})})]})})]});return h==="modal"?e.jsx(Y,{children:c&&e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",onClick:p,children:e.jsx(m.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"bg-white rounded-2xl shadow-xl w-full max-w-5xl max-h-[90vh] overflow-y-auto will-change-transform",onClick:s=>s.stopPropagation(),children:N})})}):e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 z-50 overflow-y-auto bg-gradient-to-br from-slate-50 via-white to-indigo-50/30",children:N})};export{ge as default}; +import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as y,doc as _}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as k,w as Z,B as H,Z as J,y as C,T as W,r as S,m,h as Y}from"./index-D9TvEOZX.js";import{X as G}from"./x-DM8tXF3P.js";import{C as A}from"./clock-BPtF2Ddk.js";import{L as T,C as K}from"./lightbulb-CVSZ487_.js";import{C as q}from"./circle-check-C6IXGFgm.js";import{C as D}from"./chart-column-BwIV9b12.js";import{a as O,C as V}from"./chevron-up-C5341jJ8.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const ge=({userId:d,mode:h,isOpen:c=!0,onClose:p})=>{const[o,P]=i.useState([]),[B,$]=i.useState({}),[r,R]=i.useState({}),[a,E]=i.useState(null),[L,x]=i.useState(!0),[Q,j]=i.useState(!0),[g,z]=i.useState(null);i.useEffect(()=>{!d||!c||M()},[d,c]);const M=async()=>{x(!0);try{const s=await y(_(k,"diagnosticResults",d));if(!s.exists()){x(!1);return}const t=s.data(),U=t.responses||[];$(t.domainScores||{}),R(t.riskProfile||{});const b=t.testId;let v={};if(b){const l=await y(_(k,"diagnosticSessions",b));if(l.exists()){const X=l.data();for(const w of X.questions||[])v[w.question_id]=w.question_text}}P(U.map(l=>({...l,question_text:v[l.question_id]}))),x(!1),j(!0);try{const l=await Z("/api/diagnostic/analyze",{method:"POST",body:JSON.stringify({user_id:d})});l.success&&E(l.analysis)}catch(l){console.error("[DiagnosticBreakdown] AI analysis failed:",l)}finally{j(!1)}}catch(s){console.error("[DiagnosticBreakdown] Failed to load data:",s),x(!1),j(!1)}},u=o.filter(s=>s.is_correct).length,n=o.length,f=o.reduce((s,t)=>s+t.time_spent_seconds,0),F=n>0?Math.round(f/n):0,I=n>0?Math.round(u/n*100):0;if(!c)return null;const N=e.jsxs("div",{className:`${h==="fullscreen"?"min-h-screen bg-gradient-to-br from-slate-50 via-white to-indigo-50/30":""} flex flex-col`,children:[e.jsx("div",{className:"top-0 z-10 bg-white border-b border-slate-200/60 px-6 py-4",children:e.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-200",children:e.jsx(H,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold text-slate-900",children:"Diagnostic Assessment Breakdown"}),e.jsx("p",{className:"text-xs text-slate-500",children:"AI-powered analysis of your performance"})]})]}),e.jsx("button",{onClick:p,className:"p-2 hover:bg-slate-100 rounded-xl transition-colors",title:"Close",children:e.jsx(G,{className:"w-5 h-5 text-slate-500"})})]})}),e.jsx("div",{className:"max-w-6xl mx-auto w-full px-6 py-8 space-y-8",children:L?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-32 bg-slate-100 rounded-2xl animate-pulse"},s))}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl p-5 text-white shadow-lg shadow-indigo-200/50",children:[e.jsx("p",{className:"text-indigo-200 text-xs font-medium uppercase",children:"Score"}),e.jsxs("p",{className:"text-3xl font-black mt-1",children:[I,"%"]}),e.jsxs("p",{className:"text-indigo-200 text-sm",children:[u,"/",n," correct"]})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(A,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Avg Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[F,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"per question"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(J,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Total Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[Math.floor(f/60),"m ",f%60,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"assessment duration"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(C,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Risk"})]}),e.jsx("p",{className:`text-2xl font-bold ${r.overall_risk==="high"||r.overall_risk==="critical"?"text-red-600":r.overall_risk==="moderate"?"text-amber-600":"text-emerald-600"}`,children:(r.overall_risk||"unknown").charAt(0).toUpperCase()+(r.overall_risk||"unknown").slice(1)}),e.jsx("p",{className:"text-xs text-slate-400",children:"risk level"})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100 bg-gradient-to-r from-amber-50 to-orange-50",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"w-5 h-5 text-amber-500"}),e.jsx("h2",{className:"font-bold text-slate-800",children:"AI Analysis"})]})}),e.jsx("div",{className:"p-6",children:Q?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-5/6"})]}):a?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-slate-700 leading-relaxed",children:a.overall_summary}),e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-sky-800 text-sm mb-2 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"})," Timing Patterns"]}),e.jsx("p",{className:"text-sm text-sky-700",children:a.time_analysis.insight}),a.time_analysis.slow_questions.length>0&&e.jsxs("p",{className:"text-xs text-sky-600 mt-2",children:[e.jsx("span",{className:"font-medium",children:"Took longest on:"})," ",a.time_analysis.slow_questions.join(", ")]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.strength_areas.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-emerald-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4"})," Strengths"]}),e.jsx("ul",{className:"space-y-2",children:a.strength_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx(q,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]}),a.weakness_areas.length>0&&e.jsxs("div",{className:"border border-red-100 bg-red-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-red-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"})," Weak Areas"]}),e.jsx("ul",{className:"space-y-2",children:a.weakness_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-red-700 flex items-start gap-2",children:[e.jsx(C,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]})]}),a.answer_patterns.common_mistakes.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("h3",{className:"font-semibold text-amber-800 text-sm mb-2",children:"Answer Patterns"}),e.jsx("p",{className:"text-sm text-amber-700 mb-2",children:a.answer_patterns.description}),e.jsx("ul",{className:"space-y-1",children:a.answer_patterns.common_mistakes.map((s,t)=>e.jsxs("li",{className:"text-xs text-amber-600",children:["• ",s]},t))})]}),a.recommendations.length>0&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-indigo-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(T,{className:"w-4 h-4"})," Recommendations"]}),e.jsx("ol",{className:"space-y-2",children:a.recommendations.map((s,t)=>e.jsxs("li",{className:"text-sm text-indigo-700",children:[e.jsxs("span",{className:"font-medium",children:[t+1,". ",s.action]}),e.jsxs("span",{className:"text-indigo-500 text-xs ml-2",children:["— ",s.reason]})]},t))})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-slate-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"})," Performance by Difficulty"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Easy"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.easy_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Medium"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.medium_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Hard"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.hard_performance})]})]})]})]}):e.jsx("p",{className:"text-slate-500 text-sm",children:"Analysis unavailable."})})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(D,{className:"w-5 h-5 text-indigo-500"})," Domain Scores"]})}),e.jsx("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Object.entries(B).map(([s,t])=>e.jsxs("div",{className:"border border-slate-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-2",children:s}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsxs("span",{className:"text-2xl font-black text-slate-800",children:[t.percentage,"%"]}),e.jsxs("span",{className:"text-xs text-slate-400 mb-1",children:[t.correct,"/",t.total]})]}),e.jsx("div",{className:"mt-2 h-2 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${t.percentage>=80?"bg-emerald-500":t.percentage>=60?"bg-amber-500":"bg-red-500"}`,style:{width:`${t.percentage}%`}})}),e.jsx("p",{className:`text-xs mt-1 font-medium ${t.mastery_level==="mastered"?"text-emerald-600":t.mastery_level==="developing"?"text-amber-600":"text-red-600"}`,children:t.mastery_level})]},s))})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5 text-indigo-500"})," Question-by-Question Breakdown"]})}),e.jsx("div",{className:"divide-y divide-slate-50",children:o.map((s,t)=>e.jsxs("div",{className:"px-6 py-3 hover:bg-slate-50/50 transition-colors",children:[e.jsxs("button",{onClick:()=>z(g===t?null:t),className:"w-full flex items-center gap-3 text-left",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0 ${s.is_correct?"bg-emerald-100 text-emerald-600":"bg-red-100 text-red-600"}`,children:s.is_correct?e.jsx(q,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700 truncate",children:["Q",t+1,". ",s.question_text||`${s.topic} (${s.domain})`]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[e.jsx("span",{className:"text-xs text-slate-400",children:s.difficulty}),e.jsxs("span",{className:"text-xs text-slate-400",children:[s.time_spent_seconds,"s"]}),e.jsx("span",{className:"text-xs text-slate-400",children:s.domain})]})]}),g===t?e.jsx(O,{className:"w-4 h-4 text-slate-400"}):e.jsx(V,{className:"w-4 h-4 text-slate-400"})]}),g===t&&e.jsxs(m.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"ml-10 mt-2 pb-2 space-y-2",children:[s.question_text&&e.jsx("p",{className:"text-sm text-slate-600",children:s.question_text}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[e.jsxs("span",{className:s.is_correct?"text-emerald-600":"text-red-600",children:["Your answer: ",e.jsx("strong",{children:s.student_answer||"—"})]}),!s.is_correct&&e.jsxs("span",{className:"text-emerald-600",children:["Correct: ",e.jsx("strong",{children:s.correct_answer})]}),e.jsxs("span",{className:"text-slate-500",children:["Time: ",s.time_spent_seconds,"s"]}),e.jsxs("span",{className:"text-slate-500",children:["Bloom: ",s.bloom_level]})]})]})]},t))})]}),e.jsx("div",{className:"flex justify-center pb-8",children:e.jsx("button",{onClick:p,className:"px-8 py-3 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-lg shadow-indigo-200 transition-all",children:h==="fullscreen"?"Continue to Dashboard":"Close"})})]})})]});return h==="modal"?e.jsx(Y,{children:c&&e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",onClick:p,children:e.jsx(m.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"bg-white rounded-2xl shadow-xl w-full max-w-5xl max-h-[90vh] overflow-y-auto will-change-transform",onClick:s=>s.stopPropagation(),children:N})})}):e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 z-50 overflow-y-auto bg-gradient-to-br from-slate-50 via-white to-indigo-50/30",children:N})};export{ge as default}; diff --git a/assets/FloatingAITutor-B4EaVyaw.js b/assets/FloatingAITutor-CZxAq5Ld.js similarity index 92% rename from assets/FloatingAITutor-B4EaVyaw.js rename to assets/FloatingAITutor-CZxAq5Ld.js index f4e57d6c0804c375d11612d513a427a114f92bfa..b1b0a3e232a772d6ccdb21c1b7e03c3117d14a75 100644 --- a/assets/FloatingAITutor-B4EaVyaw.js +++ b/assets/FloatingAITutor-CZxAq5Ld.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-Bihf5n-9.js","assets/index-Cvals0ud.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css"])))=>i.map(i=>d[i]); -import{aG as C,_ as y,m as b,N as A}from"./index-Cvals0ud.js";import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{M}from"./maximize-2-Dsjc-Cqw.js";import{M as w}from"./minus-XCv3x7RR.js";import{X as g}from"./x-cRIR5BcS.js";import{S as L}from"./send-DJ3IeuSS.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const E=i.lazy(()=>y(()=>import("./ChatMarkdown-Bihf5n-9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));function O(a){return a?a instanceof Date?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof a=="object"&&"toDate"in a?a.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(a):""}const Q=({constraintsRef:a,onFullScreen:j})=>{const{activeSessionId:r,setActiveSessionId:v,createNewSession:N,getActiveSession:k,sendMessage:I,isLoading:o}=C(),[s,l]=i.useState(!1),[c,u]=i.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[n,m]=i.useState(""),h=i.useRef(null);i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",c?"1":"0")},[c]),i.useEffect(()=>{s&&y(async()=>{const{warmupBackend:t}=await import("./index-Cvals0ud.js").then(d=>d.b7);return{warmupBackend:t}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),i.useEffect(()=>{if(s&&!r){const t={id:"1",sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},d=N(t);v(d)}},[s]);const x=k()?.messages||[],S=()=>{h.current?.scrollIntoView({behavior:"smooth"})};i.useEffect(()=>{S()},[x]);const p=async()=>{if(!n.trim()||!r||o)return;const t=n.trim();m(""),await I(r,t)},_=()=>{j()},f=()=>{l(!1),u(!0)},z=()=>{u(!1)};return e.jsxs("div",{className:"pointer-events-none flex flex-col items-end",children:[e.jsxs("div",{className:`pointer-events-auto mb-4 w-80 bg-[#f7f9fc] rounded-3xl shadow-2xl border border-[#dde3eb] flex flex-col overflow-hidden transition-all duration-300 origin-bottom-right select-none ${s?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{"--max-h":s?"32rem":"0",willChange:"transform, opacity"},children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),e.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",e.jsx("br",{}),"Learning Intelligence"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:_,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(M,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:f,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(w,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>l(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(g,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[x.map(t=>e.jsx("div",{className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${t.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}):e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(E,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:O(t.timestamp)})]})},t.id)),o&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb] rounded-2xl px-4 py-2.5 max-w-[75%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})}),e.jsx("div",{ref:h})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:"ai-tutor-input",name:"ai-tutor-input","aria-label":"Ask AI tutor a question",type:"text",value:n,onChange:t=>m(t.target.value),onKeyPress:t=>t.key==="Enter"&&p(),placeholder:"Ask me anything...",className:"flex-1 px-4 py-2.5 rounded-xl border border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-500 text-sm bg-[#f7f9fc]"}),e.jsx("button",{type:"button","aria-label":"Send message",onClick:p,className:"p-2.5 bg-sky-600 hover:bg-sky-700 text-white rounded-xl transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!n.trim()||o,children:e.jsx(L,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:c?e.jsx(b.button,{type:"button",onClick:z,whileHover:{scale:1.08},whileTap:{scale:.95},transition:{duration:.15,ease:"easeOut"},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",style:{willChange:"transform"},children:e.jsx(A,{size:14})}):e.jsxs("div",{className:"relative group",children:[!s&&e.jsxs("div",{className:"absolute right-full mr-4 top-1/2 -translate-y-1/2 px-4 py-2 bg-slate-800 text-white text-sm rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap shadow-xl z-50",children:["Hello! I'm L.O.L.I., how may I help you?",e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -right-1 w-3 h-3 bg-slate-800 rotate-45"})]}),!s&&e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:f,className:"absolute -top-2 -left-2 z-10 h-6 w-6 rounded-full bg-white text-slate-700 border border-slate-200 shadow-md hover:bg-slate-100 transition-colors flex items-center justify-center",children:e.jsx(w,{size:12})}),e.jsx(b.button,{type:"button",onClick:()=>l(!s),whileHover:{scale:1.1},whileTap:{scale:.9},transition:{duration:.15,ease:"easeOut"},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":s?"Close AI tutor chat":"Open AI tutor chat",style:{willChange:"transform"},children:s?e.jsx(g,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{Q as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-D5DdKmyx.js","assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css"])))=>i.map(i=>d[i]); +import{aG as C,_ as y,m as b,N as A}from"./index-D9TvEOZX.js";import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{M}from"./maximize-2-hozD_NZl.js";import{M as w}from"./minus-VA5XFKbP.js";import{X as g}from"./x-DM8tXF3P.js";import{S as L}from"./send-Duo9AQbk.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const E=i.lazy(()=>y(()=>import("./ChatMarkdown-D5DdKmyx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));function O(a){return a?a instanceof Date?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof a=="object"&&"toDate"in a?a.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(a):""}const Q=({constraintsRef:a,onFullScreen:j})=>{const{activeSessionId:r,setActiveSessionId:v,createNewSession:N,getActiveSession:k,sendMessage:I,isLoading:o}=C(),[s,l]=i.useState(!1),[c,u]=i.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[n,m]=i.useState(""),h=i.useRef(null);i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",c?"1":"0")},[c]),i.useEffect(()=>{s&&y(async()=>{const{warmupBackend:t}=await import("./index-D9TvEOZX.js").then(d=>d.b7);return{warmupBackend:t}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),i.useEffect(()=>{if(s&&!r){const t={id:"1",sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},d=N(t);v(d)}},[s]);const x=k()?.messages||[],S=()=>{h.current?.scrollIntoView({behavior:"smooth"})};i.useEffect(()=>{S()},[x]);const p=async()=>{if(!n.trim()||!r||o)return;const t=n.trim();m(""),await I(r,t)},_=()=>{j()},f=()=>{l(!1),u(!0)},z=()=>{u(!1)};return e.jsxs("div",{className:"pointer-events-none flex flex-col items-end",children:[e.jsxs("div",{className:`pointer-events-auto mb-4 w-80 bg-[#f7f9fc] rounded-3xl shadow-2xl border border-[#dde3eb] flex flex-col overflow-hidden transition-all duration-300 origin-bottom-right select-none ${s?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{"--max-h":s?"32rem":"0",willChange:"transform, opacity"},children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),e.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",e.jsx("br",{}),"Learning Intelligence"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:_,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(M,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:f,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(w,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>l(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(g,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[x.map(t=>e.jsx("div",{className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${t.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}):e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(E,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:O(t.timestamp)})]})},t.id)),o&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb] rounded-2xl px-4 py-2.5 max-w-[75%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})}),e.jsx("div",{ref:h})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:"ai-tutor-input",name:"ai-tutor-input","aria-label":"Ask AI tutor a question",type:"text",value:n,onChange:t=>m(t.target.value),onKeyPress:t=>t.key==="Enter"&&p(),placeholder:"Ask me anything...",className:"flex-1 px-4 py-2.5 rounded-xl border border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-500 text-sm bg-[#f7f9fc]"}),e.jsx("button",{type:"button","aria-label":"Send message",onClick:p,className:"p-2.5 bg-sky-600 hover:bg-sky-700 text-white rounded-xl transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!n.trim()||o,children:e.jsx(L,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:c?e.jsx(b.button,{type:"button",onClick:z,whileHover:{scale:1.08},whileTap:{scale:.95},transition:{duration:.15,ease:"easeOut"},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",style:{willChange:"transform"},children:e.jsx(A,{size:14})}):e.jsxs("div",{className:"relative group",children:[!s&&e.jsxs("div",{className:"absolute right-full mr-4 top-1/2 -translate-y-1/2 px-4 py-2 bg-slate-800 text-white text-sm rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap shadow-xl z-50",children:["Hello! I'm L.O.L.I., how may I help you?",e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -right-1 w-3 h-3 bg-slate-800 rotate-45"})]}),!s&&e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:f,className:"absolute -top-2 -left-2 z-10 h-6 w-6 rounded-full bg-white text-slate-700 border border-slate-200 shadow-md hover:bg-slate-100 transition-colors flex items-center justify-center",children:e.jsx(w,{size:12})}),e.jsx(b.button,{type:"button",onClick:()=>l(!s),whileHover:{scale:1.1},whileTap:{scale:.9},transition:{duration:.15,ease:"easeOut"},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":s?"Close AI tutor chat":"Open AI tutor chat",style:{willChange:"transform"},children:s?e.jsx(g,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{Q as default}; diff --git a/assets/GradesPage-CQwtFuyq.js b/assets/GradesPage-CQwtFuyq.js new file mode 100644 index 0000000000000000000000000000000000000000..1d563c73db8749db0bdb2e1861148f8439dc9a92 --- /dev/null +++ b/assets/GradesPage-CQwtFuyq.js @@ -0,0 +1,3 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DiagnosticBreakdown-DT8To33g.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-D9TvEOZX.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css","assets/x-DM8tXF3P.js","assets/clock-BPtF2Ddk.js","assets/lightbulb-CVSZ487_.js","assets/circle-check-C6IXGFgm.js","assets/chart-column-BwIV9b12.js","assets/chevron-up-C5341jJ8.js"])))=>i.map(i=>d[i]); +import{u as re,aH as le,aI as ne,ad as oe,g as S,H as ie,A as ce,r as O,T as F,B as de,_ as me}from"./index-D9TvEOZX.js";import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{B as k}from"./button-DC8Fz5kC.js";import{g as xe,S as _,s as pe}from"./subjects-BJQJlUBm.js";import{u as ue}from"./useCurriculum-CNtxEkAg.js";import{getDoc as A,doc as z}from"./vendor-firebase-firestore-CNv3xXal.js";import{D as he}from"./download-BC34EYX_.js";import{C as be}from"./circle-check-C6IXGFgm.js";import{C as ge}from"./circle-alert-B7tHo7_X.js";import{F as q}from"./funnel-eKLw0u3T.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-BwIV9b12.js";const fe=o.lazy(()=>me(()=>import("./DiagnosticBreakdown-DT8To33g.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),$e=()=>{const{currentUser:d,userProfile:C}=re(),[u,E]=o.useState("all"),[b,H]=o.useState("all"),[V,w]=o.useState(!0),[g,Y]=o.useState(null),[M,K]=o.useState([]),[m,W]=o.useState(null),[T,v]=o.useState(!1),[p,J]=o.useState(null),L=C?.grade,P=xe(L),R=new Set(P),{isLoading:X}=ue(L);o.useEffect(()=>{},[X]);const D=s=>{if(s==null)return"N/A";const t=s instanceof Date?s:new Date(s);return Number.isNaN(t.getTime())?"N/A":t.toISOString().split("T")[0]};o.useEffect(()=>{if(!d)return;w(!0);const s=le(d.uid,a=>{Y(a),w(!1)}),t=ne(d.uid,a=>{K(a),w(!1)}),r=oe(d.uid,a=>{J(a)});return()=>{s(),t(),r()}},[d]),o.useEffect(()=>{d?.uid&&(async()=>{try{let s=0,t="Unknown",r=[],a="";const l=await A(z(S,"users",d.uid,"dashboardSummary","heroBannerModal"));if(l.exists()){const n=l.data();n.status==="ready"&&(s=n.latestScorePercent||0,t=n.latestRiskLevel||"Unknown",r=n.weaknesses||[],a=n.recommendation||"")}else{const n=await A(z(S,"users",d.uid));if(n.exists()){const i=n.data();(i.initialAssessmentCompleted||i.hasCompletedInitialAssessment)&&(t=i.atRiskSubjects?.length>0?"Moderate":"Low",r=i.atRiskSubjects||[])}}const x=await A(z(S,"diagnosticResults",d.uid,"cache","analysis"));if(x.exists()){const n=x.data(),i=n.recommendations||[];i.length>0&&(a=i.map(c=>c.action).join(". ")+".");const j=n.weakness_areas||[];j.length>0&&(r=j.map(c=>c.domain))}(s>0||t!=="Unknown"||r.length>0)&&W({score:s,riskLevel:t,weaknesses:r,recommendation:a||"Continue with your personalized learning path."})}catch{}})()},[d?.uid]);const N=g?.averageScore?Math.round(g.averageScore):p?.averageScore?Math.round(p.averageScore):0,Z=Math.max(g?.quizzesCompleted??0,p?.quizAttempts?.length??0),ee=N>0?N.toString():"—",se={"gen-math":"indigo","stats-prob":"violet"},$={indigo:{dot:"bg-indigo-500",bar:"bg-indigo-500"},violet:{dot:"bg-violet-500",bar:"bg-violet-500"},fuchsia:{dot:"bg-fuchsia-500",bar:"bg-fuchsia-500"},purple:{dot:"bg-purple-500",bar:"bg-purple-500"},slate:{dot:"bg-slate-500",bar:"bg-slate-500"}},U=_.reduce((s,t)=>(s[t.id]={label:t.name,color:se[t.id]||"slate"},s),{}),h=_.filter(s=>R.has(s.id)).map(s=>s.name),B=Object.entries(p?.subjects??{}).filter(([s])=>R.has(s)).map(([s,t])=>{const r=U[s]||{label:s,color:"slate"},a=(p?.quizAttempts||[]).filter(x=>{const n=t?.modulesProgress||{};return Object.values(n).some(i=>i.quizzesCompleted?.includes(x.quizId))}),l=a.length>0?Math.round(a.reduce((x,n)=>x+n.score,0)/a.length):Math.round(t?.progress??0);return{subject:r.label,average:l,quizzes:a.length||t?.completedModules||0,color:r.color}}),te=P.map(s=>{const t=U[s]||{label:s,color:"slate"},r=g?.subjectPerformance?.[t.label],a=r?.avgScore?Math.round(r.avgScore):0;return{subject:t.label,average:a,quizzes:r?.count||0,color:t.color}}),I=B.length>0?B:te,Q=o.useMemo(()=>{if(!p?.quizAttempts?.length)return[];const s=new Map;return pe.forEach(t=>{const a=_.find(l=>l.id===t.id)?.name||t.title;t.modules.forEach(l=>{l.quizzes.forEach(x=>{s.set(x.id,{title:x.title,subject:a})})})}),p.quizAttempts.map((t,r)=>{const a=s.get(t.quizId),l=t.completedAt instanceof Date?t.completedAt:new Date(t.completedAt);return{id:1e4+r,title:a?.title||t.quizId.replace(/-/g," ").replace(/\b\w/g,x=>x.toUpperCase()),subject:a?.subject||"General Mathematics",score:Math.round(t.score),date:D(l),type:"quiz",status:t.score>=80?"Excellent":t.score>=60?"Passing":"Needs Review",_timestamp:l.getTime()}})},[p?.quizAttempts]),G=o.useMemo(()=>{const s=M.slice().map((a,l)=>({id:l+1,title:a.title||`Assessment ${l+1}`,subject:a.subject||"General",score:a.score,date:a.completedAt?D(a.completedAt.toDate()):"N/A",type:a.type==="practice"?"practice":(a.type==="diagnostic","quiz"),status:a.score>=80?"Excellent":a.score>=60?"Passing":"Needs Review",_timestamp:a.completedAt?.toDate?.()?.getTime()??0})),t=new Set(s.map(a=>a.title.toLowerCase())),r=Q.filter(a=>!t.has(a.title.toLowerCase()));return[...s,...r].sort((a,l)=>(l._timestamp||0)-(a._timestamp||0)).slice(0,20).filter(a=>h.includes(a.subject))},[M,Q,h]),f=G.filter(s=>{if(!h.includes(s.subject))return!1;const t=u==="all"||s.subject===u,r=b==="all"||s.type===b;return t&&r});o.useEffect(()=>{u!=="all"&&(h.includes(u)||E("all"))},[h,u]);const ae=()=>{const s=c=>{const y=String(c??"");return/[",\n]/.test(y)?`"${y.replace(/"/g,'""')}"`:y},t=[],r=C?.name||d?.displayName||d?.email||"Student",a=new Date().toISOString().split("T")[0];t.push("Grade Report"),t.push(`Student,${s(r)}`),t.push(`Export Date,${s(a)}`),t.push(`Subject Filter,${s(u)}`),t.push(`Type Filter,${s(b)}`),t.push(""),t.push("Subject Performance"),t.push("Subject,Average Score"),I.forEach(c=>{t.push([s(c.subject),s(c.average)].join(","))}),t.push(""),t.push("Recent Quizzes"),t.push("Title,Subject,Score,Date,Type,Status"),f.length===0?t.push("No quiz data available for the selected filters"):f.forEach(c=>{t.push([s(c.title),s(c.subject),s(c.score),s(c.date),s(c.type),s(c.status)].join(","))});const l=t.join(` +`),x=new Blob([l],{type:"text/csv;charset=utf-8;"}),n=window.URL.createObjectURL(x),i=document.createElement("a"),j=r.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";i.href=n,i.setAttribute("download",`grade-report-${j}-${a}.csv`),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)};return V?e.jsx("div",{className:"p-8 flex justify-center items-center h-full",children:e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-6 lg:space-y-8 max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-white p-5 sm:p-6 rounded-[1.5rem] sm:rounded-[2rem] shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] border border-slate-50",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black text-slate-800 tracking-tight",children:"Assessment"}),e.jsx("p",{className:"text-slate-400 font-bold mt-1 text-[13px]",children:"Review your performance across subjects"})]}),e.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[e.jsxs(k,{variant:"outline",className:"flex-1 sm:flex-none border-slate-200 text-slate-500 font-bold rounded-xl h-11 px-5 hover:bg-slate-50 hover:text-slate-700",children:[e.jsx(ie,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Quarter"]}),e.jsxs(k,{className:"flex-1 sm:flex-none bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl h-11 px-5 shadow-[0_8px_20px_-8px_rgba(79,70,229,0.5)] hover:-translate-y-0.5 transition-all",onClick:ae,children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 sm:gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-indigo-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-indigo-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-indigo-100 text-indigo-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(ce,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"GEN. AVE."}),e.jsx("span",{className:"hidden sm:inline",children:"General Average"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsxs("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:[ee,N>0?"%":""]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-emerald-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-emerald-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-emerald-100 text-emerald-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(O,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Weakest"}),e.jsx("span",{className:"hidden sm:inline",children:"Weakest Subject"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-lg sm:text-2xl font-display font-black text-slate-800 truncate",children:m?.weaknesses?.[0]||"—"})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-violet-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-violet-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-violet-100 text-violet-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(F,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Quizzes"}),e.jsx("span",{className:"hidden sm:inline",children:"Quizzes Completed"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:Z})})]})]})]}),m&&e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 p-6 shadow-sm cursor-pointer hover:shadow-md hover:border-indigo-200 transition-all",onClick:()=>v(!0),role:"button",tabIndex:0,onKeyDown:s=>{s.key==="Enter"&&v(!0)},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-indigo-100 rounded-xl flex items-center justify-center",children:e.jsx(de,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-800",children:"Diagnostic Assessment Results"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Your initial competency evaluation"})]})]}),e.jsxs("span",{className:`px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5 ${m.riskLevel==="Low"?"bg-emerald-100 text-emerald-700":m.riskLevel==="High"||m.riskLevel==="At Risk"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700"}`,children:[m.riskLevel==="Low"?e.jsx(be,{size:12}):e.jsx(ge,{size:12}),m.riskLevel]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[m.score>0&&e.jsxs("div",{className:"bg-slate-50 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase mb-1",children:"Score"}),e.jsxs("p",{className:"text-2xl font-black text-slate-800",children:[m.score,"%"]})]}),m.weaknesses.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-amber-600 uppercase mb-2",children:"Focus Areas"}),e.jsx("ul",{className:"space-y-1",children:m.weaknesses.map((s,t)=>e.jsxs("li",{className:"text-sm text-amber-800 flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),s]},t))})]}),m.recommendation&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-indigo-600 uppercase mb-2",children:"Recommendation"}),e.jsx("p",{className:"text-sm text-indigo-800",children:m.recommendation})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-[1.5rem] sm:rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full w-full",children:[e.jsxs("div",{className:"p-5 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 sm:gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black text-xl text-slate-800",children:"Recent Assessments"}),e.jsx("p",{className:"text-slate-400 font-bold text-[13px] mt-1",children:"Your latest quiz and practice results"})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:u,onChange:s=>E(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),h.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(q,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:b,onChange:s=>H(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"quiz",children:"Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(q,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]})]}),e.jsx("div",{className:"overflow-x-auto no-scrollbar flex-1 px-4 sm:px-6 pb-4 -mx-4 sm:mx-0",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 mb-4 whitespace-nowrap md:whitespace-normal",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Assessment"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent min-w-[120px]",children:"Subject"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right border-b border-transparent",children:"Score"})]})}),e.jsx("tbody",{children:f.length>0?f.map(s=>e.jsxs("tr",{className:"group hover:bg-slate-50/70 transition-colors",children:[e.jsxs("td",{className:"px-4 py-4 rounded-l-2xl",children:[e.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:s.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:s.date})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:"inline-flex flex-col gap-1 items-start",children:e.jsx("span",{className:"text-[13px] font-bold text-slate-600 truncate max-w-[140px] block",children:s.subject})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-[11px] font-bold uppercase tracking-wide ${s.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:s.type==="practice"?"Practice":"Quiz"})}),e.jsx("td",{className:"px-4 py-4 text-right rounded-r-2xl",children:e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-xl text-[13px] font-black ${s.score>=80?"bg-emerald-100 text-emerald-700":s.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[s.score,"%"]})})]},s.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4",children:e.jsx(O,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-slate-500 font-bold text-sm",children:"No recent assessments match the selected filters."})]})})})})]})})]})}),e.jsxs("div",{className:"space-y-6 lg:space-y-8 flex flex-col",children:[e.jsxs("div",{className:"bg-white rounded-[1.5rem] sm:rounded-[2rem] border border-slate-100 p-5 sm:p-8 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)]",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("h3",{className:"font-display font-black text-lg text-slate-800",children:"Subject Performance"})}),e.jsx("div",{className:"space-y-7",children:I.map((s,t)=>{const r=$[s.color]||$.slate;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[14px] font-bold text-slate-800 flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${r.dot} group-hover:scale-125 transition-transform`}),s.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[s.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[s.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${r.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(s.average,5)}%`},children:e.jsx("div",{className:"absolute inset-0 bg-white/20 w-1/2 -skew-x-12 translate-x-[-100%] group-hover:animate-[shimmer_1.5s_ease-out]"})})})]},t)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[1.5rem] sm:rounded-[2rem] p-5 sm:p-8 shadow-[0_12px_30px_-10px_rgba(79,70,229,0.5)] text-white overflow-hidden group",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full blur-3xl -mt-10 -mr-10 group-hover:bg-white/20 transition-all duration-700 ease-in-out"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-indigo-400/30 rounded-full blur-2xl -mb-10 -ml-10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center mb-5 backdrop-blur-sm border border-white/20 shadow-sm group-hover:scale-110 transition-transform",children:e.jsx(F,{className:"w-6 h-6 text-white"})}),e.jsx("h3",{className:"text-2xl font-display font-black tracking-tight mb-2 leading-tight",children:"Keep up the momentum!"}),e.jsxs("p",{className:"text-white/80 text-[13px] font-medium leading-relaxed mb-8 max-w-[90%]",children:["You've completed ",e.jsx("span",{className:"font-black text-white",children:G.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(k,{onClick:()=>{sessionStorage.setItem("mathpulse_modules_tab","practice"),window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Modules"}}))},className:"w-full bg-white text-indigo-600 hover:bg-slate-50 border-0 font-black h-12 rounded-xl shadow-[0_8px_16px_rgba(0,0,0,0.15)] hover:shadow-[0_8px_24px_rgba(0,0,0,0.2)] hover:-translate-y-0.5 transition-all",children:"Start Practice Session"})]})]})]})]}),T&&d?.uid&&e.jsx(o.Suspense,{fallback:null,children:e.jsx(fe,{userId:d.uid,mode:"modal",isOpen:T,onClose:()=>v(!1)})})]})};export{$e as default}; diff --git a/assets/GradesPage-Dm_kgSLp.js b/assets/GradesPage-Dm_kgSLp.js deleted file mode 100644 index 0b94188d1602b43937f781942513853bc743cacf..0000000000000000000000000000000000000000 --- a/assets/GradesPage-Dm_kgSLp.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DiagnosticBreakdown-CfJCo5qL.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-Cvals0ud.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css","assets/x-cRIR5BcS.js","assets/clock-BsCO0o69.js","assets/lightbulb-BO_q6pvi.js","assets/circle-check-Bi1b5YEO.js","assets/chart-column-NTUNS-L9.js","assets/chevron-up-CzNRBnCs.js"])))=>i.map(i=>d[i]); -import{u as ae,aH as re,aI as le,ad as ne,g as y,H as oe,A as ie,r as U,T as I,B as de,_ as ce}from"./index-Cvals0ud.js";import{r as d,j as e}from"./vendor-react-B4AQeu28.js";import{B as S}from"./button-CanHmtQ3.js";import{g as me,S as Q}from"./subjects-jEWdBmnZ.js";import{u as xe}from"./useCurriculum-BAkeEYG2.js";import{getDoc as k,doc as _}from"./vendor-firebase-firestore-CNv3xXal.js";import{D as pe}from"./download-BJi3JOJ-.js";import{C as ue}from"./circle-check-Bi1b5YEO.js";import{C as he}from"./circle-alert-lQsWFo4p.js";import{F as G}from"./funnel-aw0mPVdH.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-NTUNS-L9.js";const be=d.lazy(()=>ce(()=>import("./DiagnosticBreakdown-CfJCo5qL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),De=()=>{const{currentUser:i,userProfile:A}=ae(),[x,C]=d.useState("all"),[h,O]=d.useState("all"),[F,j]=d.useState(!0),[b,H]=d.useState(null),[V,Y]=d.useState([]),[c,K]=d.useState(null),[T,w]=d.useState(!1),[R,W]=d.useState(null),z=A?.grade,E=me(z),L=new Set(E),{isLoading:J}=xe(z);d.useEffect(()=>{},[J]);const X=s=>{if(s==null)return"N/A";const t=s instanceof Date?s:new Date(s);return Number.isNaN(t.getTime())?"N/A":t.toISOString().split("T")[0]};d.useEffect(()=>{if(!i)return;j(!0);const s=re(i.uid,r=>{H(r),j(!1)}),t=le(i.uid,r=>{Y(r),j(!1)}),a=ne(i.uid,r=>{W(r)});return()=>{s(),t(),a()}},[i]),d.useEffect(()=>{i?.uid&&(async()=>{try{let s=0,t="Unknown",a=[],r="";const p=await k(_(y,"users",i.uid,"dashboardSummary","heroBannerModal"));if(p.exists()){const l=p.data();l.status==="ready"&&(s=l.latestScorePercent||0,t=l.latestRiskLevel||"Unknown",a=l.weaknesses||[],r=l.recommendation||"")}else{const l=await k(_(y,"users",i.uid));if(l.exists()){const n=l.data();(n.initialAssessmentCompleted||n.hasCompletedInitialAssessment)&&(t=n.atRiskSubjects?.length>0?"Moderate":"Low",a=n.atRiskSubjects||[])}}const m=await k(_(y,"diagnosticResults",i.uid,"cache","analysis"));if(m.exists()){const l=m.data(),n=l.recommendations||[];n.length>0&&(r=n.map(o=>o.action).join(". ")+".");const f=l.weakness_areas||[];f.length>0&&(a=f.map(o=>o.domain))}(s>0||t!=="Unknown"||a.length>0)&&K({score:s,riskLevel:t,weaknesses:a,recommendation:r||"Continue with your personalized learning path."})}catch{}})()},[i?.uid]);const v=b?.averageScore?Math.round(b.averageScore):0,Z=b?.quizzesCompleted??0,q=v>0?v.toString():"—",ee={"gen-math":"indigo","stats-prob":"violet"},P={indigo:{dot:"bg-indigo-500",bar:"bg-indigo-500"},violet:{dot:"bg-violet-500",bar:"bg-violet-500"},fuchsia:{dot:"bg-fuchsia-500",bar:"bg-fuchsia-500"},purple:{dot:"bg-purple-500",bar:"bg-purple-500"},slate:{dot:"bg-slate-500",bar:"bg-slate-500"}},D=Q.reduce((s,t)=>(s[t.id]={label:t.name,color:ee[t.id]||"slate"},s),{}),u=Q.filter(s=>L.has(s.id)).map(s=>s.name),M=Object.entries(R?.subjects??{}).filter(([s])=>L.has(s)).map(([s,t])=>{const a=D[s]||{label:s,color:"slate"},r=(R?.quizAttempts||[]).filter(m=>{const l=t?.modulesProgress||{};return Object.values(l).some(n=>n.quizzesCompleted?.includes(m.quizId))}),p=r.length>0?Math.round(r.reduce((m,l)=>m+l.score,0)/r.length):Math.round(t?.progress??0);return{subject:a.label,average:p,quizzes:r.length||t?.completedModules||0,color:a.color}}),se=E.map(s=>{const t=D[s]||{label:s,color:"slate"},a=b?.subjectPerformance?.[t.label],r=a?.avgScore?Math.round(a.avgScore):0;return{subject:t.label,average:r,quizzes:a?.count||0,color:t.color}}),$=M.length>0?M:se,B=V.slice().sort((s,t)=>{const a=s.completedAt?.toDate?.()?.getTime()??0;return(t.completedAt?.toDate?.()?.getTime()??0)-a}).slice(0,10).map((s,t)=>({id:t+1,title:s.title||`Assessment ${t+1}`,subject:s.subject||"General",score:s.score,date:s.completedAt?X(s.completedAt.toDate()):"N/A",type:s.type==="practice"?"practice":(s.type==="diagnostic","module"),status:s.score>=80?"Excellent":s.score>=60?"Passing":"Needs Review"})).filter(s=>u.includes(s.subject)),g=B.filter(s=>{if(!u.includes(s.subject))return!1;const t=x==="all"||s.subject===x,a=h==="all"||s.type===h;return t&&a});d.useEffect(()=>{x!=="all"&&(u.includes(x)||C("all"))},[u,x]);const te=()=>{const s=o=>{const N=String(o??"");return/[",\n]/.test(N)?`"${N.replace(/"/g,'""')}"`:N},t=[],a=A?.name||i?.displayName||i?.email||"Student",r=new Date().toISOString().split("T")[0];t.push("Grade Report"),t.push(`Student,${s(a)}`),t.push(`Export Date,${s(r)}`),t.push(`Subject Filter,${s(x)}`),t.push(`Type Filter,${s(h)}`),t.push(""),t.push("Subject Performance"),t.push("Subject,Average Score"),$.forEach(o=>{t.push([s(o.subject),s(o.average)].join(","))}),t.push(""),t.push("Recent Quizzes"),t.push("Title,Subject,Score,Date,Type,Status"),g.length===0?t.push("No quiz data available for the selected filters"):g.forEach(o=>{t.push([s(o.title),s(o.subject),s(o.score),s(o.date),s(o.type),s(o.status)].join(","))});const p=t.join(` -`),m=new Blob([p],{type:"text/csv;charset=utf-8;"}),l=window.URL.createObjectURL(m),n=document.createElement("a"),f=a.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";n.href=l,n.setAttribute("download",`grade-report-${f}-${r}.csv`),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(l)};return F?e.jsx("div",{className:"p-8 flex justify-center items-center h-full",children:e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-6 lg:space-y-8 max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-white p-5 sm:p-6 rounded-[1.5rem] sm:rounded-[2rem] shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] border border-slate-50",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black text-slate-800 tracking-tight",children:"Assessment"}),e.jsx("p",{className:"text-slate-400 font-bold mt-1 text-[13px]",children:"Review your performance across subjects"})]}),e.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[e.jsxs(S,{variant:"outline",className:"flex-1 sm:flex-none border-slate-200 text-slate-500 font-bold rounded-xl h-11 px-5 hover:bg-slate-50 hover:text-slate-700",children:[e.jsx(oe,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Quarter"]}),e.jsxs(S,{className:"flex-1 sm:flex-none bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl h-11 px-5 shadow-[0_8px_20px_-8px_rgba(79,70,229,0.5)] hover:-translate-y-0.5 transition-all",onClick:te,children:[e.jsx(pe,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 sm:gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-indigo-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-indigo-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-indigo-100 text-indigo-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(ie,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"GEN. AVE."}),e.jsx("span",{className:"hidden sm:inline",children:"General Average"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsxs("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:[q,v>0?"%":""]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-emerald-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-emerald-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-emerald-100 text-emerald-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(U,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Weakest"}),e.jsx("span",{className:"hidden sm:inline",children:"Weakest Subject"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-lg sm:text-2xl font-display font-black text-slate-800 truncate",children:c?.weaknesses?.[0]||"—"})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-violet-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm:h-32 bg-violet-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-violet-100 text-violet-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(I,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Quizzes"}),e.jsx("span",{className:"hidden sm:inline",children:"Quizzes Completed"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:Z})})]})]})]}),c&&e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 p-6 shadow-sm cursor-pointer hover:shadow-md hover:border-indigo-200 transition-all",onClick:()=>w(!0),role:"button",tabIndex:0,onKeyDown:s=>{s.key==="Enter"&&w(!0)},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-indigo-100 rounded-xl flex items-center justify-center",children:e.jsx(de,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-800",children:"Diagnostic Assessment Results"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Your initial competency evaluation"})]})]}),e.jsxs("span",{className:`px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5 ${c.riskLevel==="Low"?"bg-emerald-100 text-emerald-700":c.riskLevel==="High"||c.riskLevel==="At Risk"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700"}`,children:[c.riskLevel==="Low"?e.jsx(ue,{size:12}):e.jsx(he,{size:12}),c.riskLevel]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[c.score>0&&e.jsxs("div",{className:"bg-slate-50 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase mb-1",children:"Score"}),e.jsxs("p",{className:"text-2xl font-black text-slate-800",children:[c.score,"%"]})]}),c.weaknesses.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-amber-600 uppercase mb-2",children:"Focus Areas"}),e.jsx("ul",{className:"space-y-1",children:c.weaknesses.map((s,t)=>e.jsxs("li",{className:"text-sm text-amber-800 flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),s]},t))})]}),c.recommendation&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-indigo-600 uppercase mb-2",children:"Recommendation"}),e.jsx("p",{className:"text-sm text-indigo-800",children:c.recommendation})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-[1.5rem] sm:rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full w-full",children:[e.jsxs("div",{className:"p-5 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 sm:gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black text-xl text-slate-800",children:"Recent Assessments"}),e.jsx("p",{className:"text-slate-400 font-bold text-[13px] mt-1",children:"Your latest quiz and practice results"})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:x,onChange:s=>C(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),u.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(G,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:h,onChange:s=>O(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"module",children:"Module Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(G,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]})]}),e.jsx("div",{className:"overflow-x-auto no-scrollbar flex-1 px-4 sm:px-6 pb-4 -mx-4 sm:mx-0",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 mb-4 whitespace-nowrap md:whitespace-normal",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Assessment"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent min-w-[120px]",children:"Subject"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right border-b border-transparent",children:"Score"})]})}),e.jsx("tbody",{children:g.length>0?g.map(s=>e.jsxs("tr",{className:"group hover:bg-slate-50/70 transition-colors",children:[e.jsxs("td",{className:"px-4 py-4 rounded-l-2xl",children:[e.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:s.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:s.date})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:"inline-flex flex-col gap-1 items-start",children:e.jsx("span",{className:"text-[13px] font-bold text-slate-600 truncate max-w-[140px] block",children:s.subject})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-[11px] font-bold uppercase tracking-wide ${s.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:s.type==="practice"?"Practice":"Quiz"})}),e.jsx("td",{className:"px-4 py-4 text-right rounded-r-2xl",children:e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-xl text-[13px] font-black ${s.score>=80?"bg-emerald-100 text-emerald-700":s.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[s.score,"%"]})})]},s.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4",children:e.jsx(U,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-slate-500 font-bold text-sm",children:"No recent assessments match the selected filters."})]})})})})]})})]})}),e.jsxs("div",{className:"space-y-6 lg:space-y-8 flex flex-col",children:[e.jsxs("div",{className:"bg-white rounded-[1.5rem] sm:rounded-[2rem] border border-slate-100 p-5 sm:p-8 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)]",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("h3",{className:"font-display font-black text-lg text-slate-800",children:"Subject Performance"})}),e.jsx("div",{className:"space-y-7",children:$.map((s,t)=>{const a=P[s.color]||P.slate;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[14px] font-bold text-slate-800 flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${a.dot} group-hover:scale-125 transition-transform`}),s.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[s.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[s.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${a.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(s.average,5)}%`},children:e.jsx("div",{className:"absolute inset-0 bg-white/20 w-1/2 -skew-x-12 translate-x-[-100%] group-hover:animate-[shimmer_1.5s_ease-out]"})})})]},t)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[1.5rem] sm:rounded-[2rem] p-5 sm:p-8 shadow-[0_12px_30px_-10px_rgba(79,70,229,0.5)] text-white overflow-hidden group",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full blur-3xl -mt-10 -mr-10 group-hover:bg-white/20 transition-all duration-700 ease-in-out"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-indigo-400/30 rounded-full blur-2xl -mb-10 -ml-10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center mb-5 backdrop-blur-sm border border-white/20 shadow-sm group-hover:scale-110 transition-transform",children:e.jsx(I,{className:"w-6 h-6 text-white"})}),e.jsx("h3",{className:"text-2xl font-display font-black tracking-tight mb-2 leading-tight",children:"Keep up the momentum!"}),e.jsxs("p",{className:"text-white/80 text-[13px] font-medium leading-relaxed mb-8 max-w-[90%]",children:["You've completed ",e.jsx("span",{className:"font-black text-white",children:B.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(S,{onClick:()=>{sessionStorage.setItem("mathpulse_modules_tab","practice"),window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Modules"}}))},className:"w-full bg-white text-indigo-600 hover:bg-slate-50 border-0 font-black h-12 rounded-xl shadow-[0_8px_16px_rgba(0,0,0,0.15)] hover:shadow-[0_8px_24px_rgba(0,0,0,0.2)] hover:-translate-y-0.5 transition-all",children:"Start Practice Session"})]})]})]})]}),T&&i?.uid&&e.jsx(d.Suspense,{fallback:null,children:e.jsx(be,{userId:i.uid,mode:"modal",isOpen:T,onClose:()=>w(!1)})})]})};export{De as default}; diff --git a/assets/HeroBanner-DjkOT5_A.js b/assets/HeroBanner-DGpjukPy.js similarity index 98% rename from assets/HeroBanner-DjkOT5_A.js rename to assets/HeroBanner-DGpjukPy.js index 7f2ec228a98fc2a756cad31dc718843707b5f7cf..daf515d7e7c4cc79b59fbafebb562eb58aedc7c5 100644 --- a/assets/HeroBanner-DjkOT5_A.js +++ b/assets/HeroBanner-DGpjukPy.js @@ -1,3 +1,3 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-CbAKGmA6.js","assets/vendor-react-B4AQeu28.js","assets/avatarData-BuQSOXo3.js"])))=>i.map(i=>d[i]); -import{T as R,g as b,a3 as M,h as _,m as f,a4 as E,A as G,B as S,r as z,Z as Y,a as F,_ as Q}from"./index-Cvals0ud.js";import{j as e,r as m}from"./vendor-react-B4AQeu28.js";import{D as W,a as q,S as V}from"./dialog-BkdNfKs4.js";import{R as K,L as X,C as U,X as Z,Y as O,T as I,e as J}from"./vendor-charts-CAmziV1y.js";import{collection as v,query as w,limit as N,orderBy as k,getDocs as A,getDoc as L,doc as C}from"./vendor-firebase-firestore-CNv3xXal.js";import{X as ee}from"./x-cRIR5BcS.js";import{C as H}from"./circle-alert-lQsWFo4p.js";import{C as se}from"./circle-check-Bi1b5YEO.js";import{S as te}from"./sparkles-Chs7kbc0.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-markdown-yqZQ_iQm.js";const ae=({history:s})=>{if(s.length===0)return e.jsxs("div",{className:"text-center py-12 text-slate-400",children:[e.jsx(R,{className:"w-12 h-12 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"Complete more assessments to see your progress history."})]});const a=s.map(r=>({date:new Date(r.completedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"}),score:r.percentage,level:r.proficiencyLevel}));return e.jsx("div",{className:"w-full",children:e.jsx(K,{width:"100%",height:250,children:e.jsxs(X,{data:a,margin:{top:10,right:20,left:0,bottom:5},children:[e.jsx(U,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),e.jsx(Z,{dataKey:"date",tick:{fontSize:12,fill:"#64748b"}}),e.jsx(O,{domain:[0,100],tick:{fontSize:12,fill:"#64748b"}}),e.jsx(I,{contentStyle:{borderRadius:"12px",border:"1px solid #e2e8f0",boxShadow:"0 4px 12px rgba(0,0,0,0.08)"}}),e.jsx(J,{type:"monotone",dataKey:"score",stroke:"#0ea5e9",strokeWidth:3,dot:{fill:"#0ea5e9",strokeWidth:2,r:5},activeDot:{r:7,fill:"#0284c7"}})]})})})};async function re(s){const a=v(b,"assessmentResults",s,"attempts"),r=w(a,k("completedAt","desc"),N(10));return(await A(r)).docs.map(i=>{const n=i.data();return{attemptId:n.attemptId,score:n.score,totalQuestions:n.totalQuestions,percentage:n.percentage,completedAt:n.completedAt?.toDate?.()?.toISOString()||n.completedAt,proficiencyLevel:n.proficiencyLevel}})}async function le(s){const a=v(b,"assessmentResults",s,"attempts"),r=w(a,k("completedAt","desc"),N(1)),c=await A(r);if(c.empty)return null;const n=c.docs[0].data();return{...n,completedAt:n.completedAt?.toDate?.()?.toISOString()||n.completedAt}}const oe={Beginner:"bg-amber-100 text-amber-700 border-amber-300",Developing:"bg-blue-100 text-blue-700 border-blue-300",Proficient:"bg-emerald-100 text-emerald-700 border-emerald-300",Advanced:"bg-violet-100 text-violet-700 border-violet-300"},ne=({result:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-gradient-to-br from-sky-500 to-teal-600 rounded-xl p-6 text-white",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sky-200 text-sm font-medium",children:"Total Score"}),e.jsxs("p",{className:"text-4xl font-bold",children:[s.score,"/",s.totalQuestions]}),e.jsxs("p",{className:"text-sky-200 text-sm mt-1",children:[s.percentage,"% Correct"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-sky-200 text-sm font-medium",children:"Proficiency"}),e.jsx("span",{className:`inline-block mt-1 px-3 py-1 rounded-full text-sm font-semibold border ${oe[s.proficiencyLevel]}`,children:s.proficiencyLevel})]})]})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-sky-500"}),"Competency Breakdown"]}),e.jsx("div",{className:"space-y-2",children:s.competencyBreakdown.map((a,r)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-slate-700",children:a.topic}),e.jsxs("p",{className:"text-xs text-slate-500",children:[a.correctAnswers,"/",a.totalQuestions," correct"]})]}),e.jsx("div",{className:"w-20 h-2 bg-slate-200 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${a.accuracyPercent>=70?"bg-emerald-500":"bg-red-400"}`,style:{width:`${a.accuracyPercent}%`}})}),e.jsxs("span",{className:"text-sm font-semibold text-slate-600 w-10 text-right",children:[a.accuracyPercent,"%"]})]},r))})]}),s.aiNarrative&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(te,{className:"w-4 h-4 text-amber-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm text-amber-800 leading-relaxed",children:s.aiNarrative})]})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4 text-sky-500"}),"Question Breakdown"]}),e.jsx("div",{className:"space-y-3",children:s.answers.map((a,r)=>e.jsxs("div",{className:`p-4 rounded-xl border-2 ${a.isCorrect?"border-emerald-200 bg-emerald-50/30":"border-red-200 bg-red-50/30"}`,children:[e.jsxs("p",{className:"text-sm font-medium text-slate-800 mb-2",children:["Q",r+1,". ",a.questionText]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("span",{className:"text-slate-500",children:["Your answer: ",e.jsx("span",{className:a.isCorrect?"text-emerald-600 font-medium":"text-red-500 font-medium",children:a.userAnswer||"—"})]}),!a.isCorrect&&e.jsxs("span",{className:"text-slate-500",children:["Correct: ",e.jsx("span",{className:"text-emerald-600 font-medium",children:a.correctAnswer})]})]}),a.explanation&&e.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed",children:a.explanation})]},r))})]})]}),ie=({summary:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-2xl p-4 flex items-center gap-4 flex-1",children:[e.jsxs("div",{className:"w-12 h-12 bg-sky-500 rounded-full flex items-center justify-center text-white font-bold text-lg shadow-sm",children:[s.latestScorePercent,"%"]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-slate-500",children:"Latest Score"}),e.jsx("p",{className:"text-slate-800 font-bold",children:s.headline})]})]}),s.latestRiskLevel&&e.jsxs("div",{className:`px-4 py-2 rounded-full text-sm font-semibold flex items-center gap-2 +import{T as R,g as b,a3 as M,h as _,m as f,a4 as E,A as G,B as S,r as z,Z as Y,a as F,_ as Q}from"./index-D9TvEOZX.js";import{j as e,r as m}from"./vendor-react-B4AQeu28.js";import{D as W,a as q,S as V}from"./dialog-BXd6FyxO.js";import{R as K,L as X,C as U,X as Z,Y as O,T as I,e as J}from"./vendor-charts-CAmziV1y.js";import{collection as v,query as w,limit as N,orderBy as k,getDocs as A,getDoc as L,doc as C}from"./vendor-firebase-firestore-CNv3xXal.js";import{X as ee}from"./x-DM8tXF3P.js";import{C as H}from"./circle-alert-B7tHo7_X.js";import{C as se}from"./circle-check-C6IXGFgm.js";import{S as te}from"./sparkles-BLpoopVP.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-markdown-yqZQ_iQm.js";const ae=({history:s})=>{if(s.length===0)return e.jsxs("div",{className:"text-center py-12 text-slate-400",children:[e.jsx(R,{className:"w-12 h-12 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"Complete more assessments to see your progress history."})]});const a=s.map(r=>({date:new Date(r.completedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"}),score:r.percentage,level:r.proficiencyLevel}));return e.jsx("div",{className:"w-full",children:e.jsx(K,{width:"100%",height:250,children:e.jsxs(X,{data:a,margin:{top:10,right:20,left:0,bottom:5},children:[e.jsx(U,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),e.jsx(Z,{dataKey:"date",tick:{fontSize:12,fill:"#64748b"}}),e.jsx(O,{domain:[0,100],tick:{fontSize:12,fill:"#64748b"}}),e.jsx(I,{contentStyle:{borderRadius:"12px",border:"1px solid #e2e8f0",boxShadow:"0 4px 12px rgba(0,0,0,0.08)"}}),e.jsx(J,{type:"monotone",dataKey:"score",stroke:"#0ea5e9",strokeWidth:3,dot:{fill:"#0ea5e9",strokeWidth:2,r:5},activeDot:{r:7,fill:"#0284c7"}})]})})})};async function re(s){const a=v(b,"assessmentResults",s,"attempts"),r=w(a,k("completedAt","desc"),N(10));return(await A(r)).docs.map(i=>{const n=i.data();return{attemptId:n.attemptId,score:n.score,totalQuestions:n.totalQuestions,percentage:n.percentage,completedAt:n.completedAt?.toDate?.()?.toISOString()||n.completedAt,proficiencyLevel:n.proficiencyLevel}})}async function le(s){const a=v(b,"assessmentResults",s,"attempts"),r=w(a,k("completedAt","desc"),N(1)),c=await A(r);if(c.empty)return null;const n=c.docs[0].data();return{...n,completedAt:n.completedAt?.toDate?.()?.toISOString()||n.completedAt}}const oe={Beginner:"bg-amber-100 text-amber-700 border-amber-300",Developing:"bg-blue-100 text-blue-700 border-blue-300",Proficient:"bg-emerald-100 text-emerald-700 border-emerald-300",Advanced:"bg-violet-100 text-violet-700 border-violet-300"},ne=({result:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-gradient-to-br from-sky-500 to-teal-600 rounded-xl p-6 text-white",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sky-200 text-sm font-medium",children:"Total Score"}),e.jsxs("p",{className:"text-4xl font-bold",children:[s.score,"/",s.totalQuestions]}),e.jsxs("p",{className:"text-sky-200 text-sm mt-1",children:[s.percentage,"% Correct"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-sky-200 text-sm font-medium",children:"Proficiency"}),e.jsx("span",{className:`inline-block mt-1 px-3 py-1 rounded-full text-sm font-semibold border ${oe[s.proficiencyLevel]}`,children:s.proficiencyLevel})]})]})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-sky-500"}),"Competency Breakdown"]}),e.jsx("div",{className:"space-y-2",children:s.competencyBreakdown.map((a,r)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-slate-700",children:a.topic}),e.jsxs("p",{className:"text-xs text-slate-500",children:[a.correctAnswers,"/",a.totalQuestions," correct"]})]}),e.jsx("div",{className:"w-20 h-2 bg-slate-200 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${a.accuracyPercent>=70?"bg-emerald-500":"bg-red-400"}`,style:{width:`${a.accuracyPercent}%`}})}),e.jsxs("span",{className:"text-sm font-semibold text-slate-600 w-10 text-right",children:[a.accuracyPercent,"%"]})]},r))})]}),s.aiNarrative&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(te,{className:"w-4 h-4 text-amber-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm text-amber-800 leading-relaxed",children:s.aiNarrative})]})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4 text-sky-500"}),"Question Breakdown"]}),e.jsx("div",{className:"space-y-3",children:s.answers.map((a,r)=>e.jsxs("div",{className:`p-4 rounded-xl border-2 ${a.isCorrect?"border-emerald-200 bg-emerald-50/30":"border-red-200 bg-red-50/30"}`,children:[e.jsxs("p",{className:"text-sm font-medium text-slate-800 mb-2",children:["Q",r+1,". ",a.questionText]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("span",{className:"text-slate-500",children:["Your answer: ",e.jsx("span",{className:a.isCorrect?"text-emerald-600 font-medium":"text-red-500 font-medium",children:a.userAnswer||"—"})]}),!a.isCorrect&&e.jsxs("span",{className:"text-slate-500",children:["Correct: ",e.jsx("span",{className:"text-emerald-600 font-medium",children:a.correctAnswer})]})]}),a.explanation&&e.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed",children:a.explanation})]},r))})]})]}),ie=({summary:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-2xl p-4 flex items-center gap-4 flex-1",children:[e.jsxs("div",{className:"w-12 h-12 bg-sky-500 rounded-full flex items-center justify-center text-white font-bold text-lg shadow-sm",children:[s.latestScorePercent,"%"]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-slate-500",children:"Latest Score"}),e.jsx("p",{className:"text-slate-800 font-bold",children:s.headline})]})]}),s.latestRiskLevel&&e.jsxs("div",{className:`px-4 py-2 rounded-full text-sm font-semibold flex items-center gap-2 ${s.latestRiskLevel==="At Risk"?"bg-red-100 text-red-700":s.latestRiskLevel==="Needs Attention"?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"}`,children:[s.latestRiskLevel==="At Risk"?e.jsx(V,{className:"w-4 h-4"}):s.latestRiskLevel==="Needs Attention"?e.jsx(H,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"}),s.latestRiskLevel]})]}),e.jsx("div",{className:"bg-slate-50 p-5 rounded-2xl border border-slate-100",children:e.jsx("p",{className:"text-slate-700 leading-relaxed",children:s.summary})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.strengths?.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-emerald-800 mb-3 flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Strengths"]}),e.jsx("ul",{className:"space-y-2",children:s.strengths.map((a,r)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]}),s.weaknesses?.length>0&&e.jsxs("div",{className:"border border-amber-100 bg-amber-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-amber-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Focus Areas"]}),e.jsx("ul",{className:"space-y-2",children:s.weaknesses.map((a,r)=>e.jsxs("li",{className:"text-sm text-amber-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]})]}),s.recommendation&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50 to-purple-50 rounded-xl p-5 border border-indigo-100",children:[e.jsxs("h4",{className:"font-semibold text-indigo-900 mb-2 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-indigo-500"}),"Recommended Next Step"]}),e.jsx("p",{className:"text-sm text-indigo-800 leading-relaxed",children:s.recommendation})]})]}),de=({heroBannerSummary:s,latestResult:a,loading:r})=>r?e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-32 bg-slate-200 rounded-xl"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-slate-200 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-5/6"})]})]}):!s&&!a?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-sky-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(S,{className:"w-8 h-8 text-sky-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Let's personalize your learning"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Complete your diagnostic assessment so I can understand your strengths, weak areas, and the best next lessons for you."})]}):s?.status==="ready"?e.jsx(ie,{summary:s}):a?e.jsx(ne,{result:a}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(H,{className:"w-8 h-8 text-amber-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Your learning summary is being prepared"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Please try opening this again in a moment."})]});async function ce(s){const a=await L(C(b,"competencyProfiles",s)).catch(()=>null);if(a?.exists()){const t=a.data(),l=t.primaryStrength?[t.primaryStrength]:[],o=t.primaryWeakness?[t.primaryWeakness]:[];return{status:"ready",headline:t.overallScore>=70?"Good job — keep it up!":"Let's build your foundation",summary:o.length>0?`Focus on strengthening ${o[0]} to improve your overall performance.`:"Keep practicing to maintain and expand your skills.",strengths:l,weaknesses:o,recommendation:t.suggestedModule?`Start with the ${t.suggestedModule} module.`:"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:t.overallScore||0,latestRiskLevel:t.overallScore>=70?"Low":t.overallScore>=50?"Moderate":"High",updatedAt:t.updatedAt?.toDate?.()||new Date}}const r=await A(w(v(b,"assessments",s,"attempts"),k("completedAt","desc"),N(1))).catch(()=>null);if(r&&!r.empty){const t=r.docs[0].data(),l=t.rawScore||t.overallScorePercent||0,o=t.proficiencyProfile;return{status:"ready",headline:l>=70?"Good job — keep it up!":"Let's build your foundation",summary:o?.weaknesses?.length>0?`Focus on strengthening ${o.weaknesses[0]} to improve.`:l>=70?"You have a solid foundation!":"With practice, you'll build confidence.",strengths:o?.strengths||[],weaknesses:o?.weaknesses||[],recommendation:o?.suggestedStartingModule?`Start with ${o.suggestedStartingModule}.`:"Follow your personalized learning path.",latestAssessmentId:t.assessmentId||"",latestScorePercent:l,latestRiskLevel:l>=70?"Low":l>=50?"Moderate":"High",updatedAt:t.completedAt?.toDate?.()||new Date}}const c=await L(C(b,"diagnosticResults",s)).catch(()=>null);if(c?.exists()){const t=c.data(),l=t.overallScorePercent||t.overall_score_percent||0,o=t.riskProfile?.weak_domains||[];return{status:"ready",headline:l>=70?"Good job — keep it up!":"Let's build your foundation",summary:o.length>0?`Areas to focus on: ${o.join(", ")}.`:"Assessment completed. Follow your learning path.",strengths:[],weaknesses:o,recommendation:t.recommended_intervention||"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:l,latestRiskLevel:t.overall_risk||(l>=70?"Low":"Moderate"),updatedAt:t.completedAt?.toDate?.()||new Date}}const i=await A(w(v(b,"users",s,"assessments"),k("completedAt","desc"),N(5))).catch(()=>null);if(i&&!i.empty){const t=i.docs.map(p=>p.data()),l=t[0],o=l.score||l.scorePercent||0,x=t.length,j=Math.round(t.reduce((p,u)=>p+(u.score||u.scorePercent||0),0)/x);return{status:"ready",headline:o>=70?"Good job — keep it up!":"Let's build your foundation",summary:`You've completed ${x} diagnostic assessment${x>1?"s":""}. Your latest score is ${o}% (average: ${j}%).`,strengths:[],weaknesses:l.risk==="At Risk"||l.risk==="High"?[l.subject||"General Mathematics"]:[],recommendation:"Continue with your personalized learning path to strengthen weak areas.",latestAssessmentId:l.testId||"",latestScorePercent:o,latestRiskLevel:l.risk||(o>=70?"Low":o>=50?"Moderate":"High"),updatedAt:l.completedAt?.toDate?.()||new Date}}const n=await L(C(b,"users",s)).catch(()=>null);if(n?.exists()){const t=n.data();if(t.initialAssessmentCompleted||t.hasCompletedInitialAssessment){const l=t.atRiskSubjects||[];return{status:"ready",headline:"Assessment Complete! ✓",summary:l.length>0?`Areas to focus on: ${l.join(", ")}. Follow your personalized learning path to improve.`:"Your diagnostic assessment is complete. Your personalized learning path is ready.",strengths:[],weaknesses:l,recommendation:"Continue with your recommended lessons to strengthen your skills.",latestAssessmentId:"",latestScorePercent:0,latestRiskLevel:l.length>0?"Moderate":"Low",updatedAt:t.assessmentCompletedAt?.toDate?.()||new Date}}}return null}const me=({isOpen:s,onClose:a,studentId:r,latestResult:c,heroBannerSummary:i})=>{const[n,t]=m.useState("latest"),[l,o]=m.useState(c||null),[x,j]=m.useState([]),[p,u]=m.useState(!1),[g,y]=m.useState(null);m.useEffect(()=>{if(s&&r&&!i){const d=M(r,h=>{y(h)});return()=>d()}},[s,r,i]);const $=i||g;m.useEffect(()=>{s&&r&&(u(!0),(async()=>{try{const[h,T]=await Promise.all([c?Promise.resolve(c):le(r),re(r)]);if(o(h),j(T),!i&&!g){const D=await E(r);if(D)y(D);else{const P=await ce(r);P&&y(P)}}}catch(h){console.error("[AssessmentResultsModal] fetch error:",h)}finally{u(!1)}})())},[s,r,c]);const B=[{key:"latest",label:"Last Results",icon:e.jsx(G,{className:"w-4 h-4"})},{key:"history",label:"History & Trends",icon:e.jsx(R,{className:"w-4 h-4"})}];return e.jsx(W,{open:s,onOpenChange:d=>!d&&a(),children:e.jsxs(q,{className:"max-w-2xl max-h-[85vh] overflow-y-auto p-0 bg-white rounded-2xl shadow-2xl border-0",children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-white border-b border-slate-200 rounded-t-2xl px-6 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-800",children:"Assessment Results"}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-slate-100 transition-colors",children:e.jsx(ee,{className:"w-5 h-5 text-slate-400"})})]}),e.jsx("div",{className:"flex gap-1 bg-slate-100 p-1 rounded-lg",children:B.map(d=>e.jsxs("button",{onClick:()=>t(d.key),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${n===d.key?"bg-white text-sky-600 shadow-sm":"text-slate-600 hover:text-slate-800"}`,children:[d.icon,d.label]},d.key))})]}),e.jsx("div",{className:"px-6 py-5",children:e.jsxs(_,{mode:"wait",children:[n==="latest"&&e.jsx(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:e.jsx(de,{heroBannerSummary:$,latestResult:l,loading:p})},"latest"),n==="history"&&e.jsxs(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:[e.jsx(ae,{history:x}),x.length>0&&e.jsxs("div",{className:"mt-6 space-y-2",children:[e.jsx("h3",{className:"font-semibold text-slate-800 mb-3",children:"All Attempts"}),x.map((d,h)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700",children:["Attempt ",x.length-h]}),e.jsx("p",{className:"text-xs text-slate-500",children:new Date(d.completedAt).toLocaleDateString()})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-sm font-semibold text-sky-600",children:[d.percentage,"%"]}),e.jsx("p",{className:"text-xs text-slate-500",children:d.proficiencyLevel})]})]},h))]})]},"history")]})})]})})},xe=m.lazy(()=>Q(()=>import("./DashboardAvatar-CbAKGmA6.js"),__vite__mapDeps([0,1,2]))),Ce=({userName:s="Student",userLevel:a=1,avatarLayers:r,onContinueLearning:c,showAssessmentTooltip:i,onOpenAssessment:n,studentId:t,assessmentCompleted:l=!1})=>{const[o,x]=m.useState(!1),[j,p]=m.useState(null);m.useEffect(()=>{if(!o||!t)return;const g=M(t,y=>{p(y)});return()=>g()},[o,t]),m.useEffect(()=>{o||p(null)},[o]);const u=()=>{const g=new Date().getHours();return g<12?"Good Morning":g<18?"Good Afternoon":"Good Evening"};return e.jsxs(f.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},className:"relative w-full mt-0 rounded-2xl md:rounded-[2rem] p-5 md:p-6 lg:p-8 bg-gradient-to-br from-white via-sky-50/50 to-white border border-slate-200/80 card-elevated-lg",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-2xl md:rounded-[2rem] pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/50 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 bg-sky-100/40 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-64 h-64 bg-rose-100/30 rounded-full blur-3xl translate-y-1/2 -translate-x-1/4"}),e.jsx("div",{className:"absolute inset-0 bg-dot-pattern opacity-40"})]}),e.jsx("div",{className:"relative z-10 flex flex-col md:flex-row min-h-[140px] lg:min-h-[160px] items-start md:items-center justify-between gap-4 md:gap-6 pb-0",children:e.jsxs("div",{className:"flex-1 w-full md:w-auto min-w-0 pr-0 md:pr-40 lg:pr-[280px] pb-2 md:pb-0 py-1",children:[e.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-2 mb-3 md:mb-2",children:[e.jsx("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-sky-100 border border-sky-200",children:e.jsxs("span",{className:"text-xs md:text-sm font-body font-bold text-sky-700",children:["Level ",a]})}),e.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[e.jsx(Y,{size:14,className:"inline -mt-0.5 text-rose-500 mr-1"}),e.jsx("span",{className:"text-xs md:text-sm font-body font-bold text-rose-700",children:"Active"})]})]}),e.jsxs("h1",{className:"text-2xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[u(),", ",s,"!"]}),e.jsx("p",{className:"text-slate-500 mb-2 md:mb-1 text-sm md:text-sm font-body font-bold pr-[155px] md:pr-0",children:"Today is a great day to move one step forward in math mastery."}),e.jsx("p",{className:"text-xs md:text-xs text-slate-400 font-body mb-5 md:mb-4 pr-[150px] md:pr-0",children:"Focus on your next recommended lesson and keep your momentum."}),e.jsxs(f.button,{onClick:c,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 md:mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-3 md:py-2 rounded-xl font-body font-bold text-base md:text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex justify-center md:justify-start items-center gap-2 group w-auto md:w-auto",children:["Continue Learning",e.jsx(F,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:n,className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-amber-300 relative transition-all group-hover:bg-amber-50 group-hover:border-amber-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-amber-500",children:e.jsx(S,{size:16})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-amber-900 leading-tight",children:["Don't forget to take the",e.jsx("br",{}),"Initial Assessment!"]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-amber-300 border-b-amber-300 rotate-45 group-hover:bg-amber-50 group-hover:border-r-amber-400 group-hover:border-b-amber-400 transition-colors"})]})}),l&&!i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:()=>window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Grades"}})),className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-teal-300 relative transition-all group-hover:bg-teal-50 group-hover:border-teal-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 bg-teal-100 rounded-full flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"text-teal-600",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-teal-900 leading-tight",children:["Assessment Complete!",e.jsx("br",{}),e.jsx("span",{className:"text-[10px] lg:text-[11px] font-normal text-teal-700",children:"View results & history"})]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-teal-300 border-b-teal-300 rotate-45 group-hover:bg-teal-50 group-hover:border-r-teal-400 group-hover:border-b-teal-400 transition-colors"})]})}),o&&t&&e.jsx(me,{isOpen:o,onClose:()=>x(!1),studentId:t,heroBannerSummary:j}),e.jsx("div",{className:"absolute right-0 bottom-0 lg:right-10 w-[160px] md:w-[150px] lg:w-[270px] pointer-events-none z-20",style:{clipPath:"inset(-100% -50% 0 -50%)"},children:e.jsx("div",{className:"relative w-full aspect-[4/5] translate-y-[10%] md:translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:e.jsx(m.Suspense,{fallback:e.jsx("div",{className:"w-full h-full scale-[1.15] md:scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:e.jsx(xe,{layers:r,className:"w-full h-full scale-[1.35] md:scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})};export{Ce as default}; diff --git a/assets/InitialAssessmentModal-CA2dqFPM.js b/assets/InitialAssessmentModal-BhFH_8YX.js similarity index 94% rename from assets/InitialAssessmentModal-CA2dqFPM.js rename to assets/InitialAssessmentModal-BhFH_8YX.js index 30e6ca26202c14465202fd6e50ab6d2fa8f60fda..af8f4a7bba7ab3cd9af2eab598a9c3ec0d348d6c 100644 --- a/assets/InitialAssessmentModal-CA2dqFPM.js +++ b/assets/InitialAssessmentModal-BhFH_8YX.js @@ -1 +1 @@ -import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{B as j}from"./button-CanHmtQ3.js";import{g as y}from"./diagnosticService-ByxEbtPN.js";import{updateDoc as N,doc as v,serverTimestamp as w}from"./vendor-firebase-firestore-CNv3xXal.js";import{m as o,B as k,y as C,q as L,g as z}from"./index-Cvals0ud.js";import{X as S}from"./x-cRIR5BcS.js";import{C as A}from"./circle-check-big-6fwaSN-C.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const H=({isOpen:n,onClose:d,onDismiss:m,userId:c,strand:x,gradeLevel:p,onAssessmentStart:u,onAssessmentComplete:I})=>{const[t,a]=l.useState(!1),[r,i]=l.useState(null),h=async()=>{a(!0),i(null);try{const s=await y(x,p);sessionStorage.setItem("mathpulse_diagnostic",JSON.stringify({testId:s.test_id,questions:s.questions,totalItems:s.total_items,estimatedMinutes:s.estimated_minutes})),u(s.test_id,s.questions)}catch(s){const b=s instanceof Error?s.message:"Failed to load assessment";i(b),a(!1)}},f=()=>{sessionStorage.setItem("mathpulse_iar_session_dismissed","true"),d()},g=async()=>{try{await N(v(z,"users",c),{assessmentDismissed:!0,assessmentDismissedAt:w()})}catch(s){console.error("[diagnostic] Failed to save dismiss state:",s)}m()};return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:s=>s.stopPropagation(),children:e.jsxs(o.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"bg-white rounded-2xl shadow-2xl max-w-[44rem] w-full flex flex-col overflow-hidden pointer-events-auto",onClick:s=>s.stopPropagation(),style:{willChange:"transform, opacity"},children:[e.jsxs("div",{className:"px-5 py-3 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600",children:e.jsx(k,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-[#0a1628] leading-tight",children:"Initial Assessment"}),e.jsx("p",{className:"text-[11px] text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsx("button",{onClick:f,"aria-label":"Close assessment modal",className:"ml-auto w-8 h-8 rounded-lg flex items-center justify-center text-[#5a6578] hover:bg-[#dde3eb] hover:text-[#0a1628] transition-colors",children:e.jsx(S,{size:18})})]}),e.jsx("div",{className:"p-5 text-center space-y-3",children:e.jsxs(o.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut"},children:[e.jsx("div",{className:"w-20 h-20 bg-purple-50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx("svg",{className:"w-9 h-9 text-purple-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}),e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[13px] text-[#5a6578] max-w-[24rem] mx-auto leading-relaxed",children:"To personalize your learning path, complete a DepEd competency-based SHS diagnostic (15 items, around 11.6 minutes)."}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5 max-w-[28rem] mx-auto text-left mt-4",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(A,{size:14,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(C,{size:14,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Spot areas that need more attention early."})]})]}),r&&e.jsx("div",{className:"mt-3 p-2.5 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("p",{className:"text-xs text-red-700",children:r})}),e.jsxs("div",{className:"pt-3 space-y-2.5",children:[e.jsx(j,{onClick:h,disabled:t,className:"bg-gradient-to-r from-purple-600 to-purple-500 hover:from-purple-700 hover:to-purple-600 text-white px-5 py-3 rounded-xl text-sm font-bold shadow-lg shadow-purple-200 w-full max-w-[380px] mx-auto",children:t?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:16,className:"animate-spin mr-2"}),"Crafting your assessment..."]}):"Start Assessment"}),t&&e.jsx("p",{className:"text-[10px] text-slate-400 max-w-[24rem] mx-auto text-center leading-relaxed",children:"This may take up to 90 seconds while AI generates your personalized test."}),!t&&e.jsx("button",{onClick:g,disabled:t,className:"block mx-auto text-xs text-slate-500 hover:text-[#5a6578] transition-colors font-medium disabled:opacity-40",children:"Skip for now"})]})]})})]})}):null};export{H as default}; +import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{B as j}from"./button-DC8Fz5kC.js";import{g as y}from"./diagnosticService-Bx7r3sIn.js";import{updateDoc as N,doc as v,serverTimestamp as w}from"./vendor-firebase-firestore-CNv3xXal.js";import{m as o,B as k,y as C,q as L,g as z}from"./index-D9TvEOZX.js";import{X as S}from"./x-DM8tXF3P.js";import{C as A}from"./circle-check-big-yn5lhjQR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const H=({isOpen:n,onClose:d,onDismiss:m,userId:c,strand:x,gradeLevel:p,onAssessmentStart:u,onAssessmentComplete:I})=>{const[t,a]=l.useState(!1),[r,i]=l.useState(null),h=async()=>{a(!0),i(null);try{const s=await y(x,p);sessionStorage.setItem("mathpulse_diagnostic",JSON.stringify({testId:s.test_id,questions:s.questions,totalItems:s.total_items,estimatedMinutes:s.estimated_minutes})),u(s.test_id,s.questions)}catch(s){const b=s instanceof Error?s.message:"Failed to load assessment";i(b),a(!1)}},f=()=>{sessionStorage.setItem("mathpulse_iar_session_dismissed","true"),d()},g=async()=>{try{await N(v(z,"users",c),{assessmentDismissed:!0,assessmentDismissedAt:w()})}catch(s){console.error("[diagnostic] Failed to save dismiss state:",s)}m()};return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:s=>s.stopPropagation(),children:e.jsxs(o.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"bg-white rounded-2xl shadow-2xl max-w-[44rem] w-full flex flex-col overflow-hidden pointer-events-auto",onClick:s=>s.stopPropagation(),style:{willChange:"transform, opacity"},children:[e.jsxs("div",{className:"px-5 py-3 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600",children:e.jsx(k,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-[#0a1628] leading-tight",children:"Initial Assessment"}),e.jsx("p",{className:"text-[11px] text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsx("button",{onClick:f,"aria-label":"Close assessment modal",className:"ml-auto w-8 h-8 rounded-lg flex items-center justify-center text-[#5a6578] hover:bg-[#dde3eb] hover:text-[#0a1628] transition-colors",children:e.jsx(S,{size:18})})]}),e.jsx("div",{className:"p-5 text-center space-y-3",children:e.jsxs(o.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut"},children:[e.jsx("div",{className:"w-20 h-20 bg-purple-50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx("svg",{className:"w-9 h-9 text-purple-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}),e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[13px] text-[#5a6578] max-w-[24rem] mx-auto leading-relaxed",children:"To personalize your learning path, complete a DepEd competency-based SHS diagnostic (15 items, around 11.6 minutes)."}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5 max-w-[28rem] mx-auto text-left mt-4",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(A,{size:14,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(C,{size:14,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Spot areas that need more attention early."})]})]}),r&&e.jsx("div",{className:"mt-3 p-2.5 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("p",{className:"text-xs text-red-700",children:r})}),e.jsxs("div",{className:"pt-3 space-y-2.5",children:[e.jsx(j,{onClick:h,disabled:t,className:"bg-gradient-to-r from-purple-600 to-purple-500 hover:from-purple-700 hover:to-purple-600 text-white px-5 py-3 rounded-xl text-sm font-bold shadow-lg shadow-purple-200 w-full max-w-[380px] mx-auto",children:t?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:16,className:"animate-spin mr-2"}),"Crafting your assessment..."]}):"Start Assessment"}),t&&e.jsx("p",{className:"text-[10px] text-slate-400 max-w-[24rem] mx-auto text-center leading-relaxed",children:"This may take up to 90 seconds while AI generates your personalized test."}),!t&&e.jsx("button",{onClick:g,disabled:t,className:"block mx-auto text-xs text-slate-500 hover:text-[#5a6578] transition-colors font-medium disabled:opacity-40",children:"Skip for now"})]})]})})]})}):null};export{H as default}; diff --git a/assets/LeaderboardPage-Bn0migR8.js b/assets/LeaderboardPage-CiOks7x8.js similarity index 98% rename from assets/LeaderboardPage-Bn0migR8.js rename to assets/LeaderboardPage-CiOks7x8.js index 995006be8d106d659e756652d047d1e4e57f76bb..412cab228dc8eef2808712c3fddbc9bb2ff1d342 100644 --- a/assets/LeaderboardPage-Bn0migR8.js +++ b/assets/LeaderboardPage-CiOks7x8.js @@ -1,4 +1,4 @@ -import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as O,aK as W,h as q,m as n,b as y,r as P,A as k,F as m,T as E,q as _,a6 as T,a7 as H,$ as U,u as $,aL as K,R as G,L as Q,D as X}from"./index-Cvals0ud.js";import{X as V}from"./x-cRIR5BcS.js";import{C as Z}from"./clock-BsCO0o69.js";import{u as J}from"./useFeatureAccess-BtwbTJw1.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/** +import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as O,aK as W,h as q,m as n,b as y,r as P,A as k,F as m,T as E,q as _,a6 as T,a7 as H,$ as U,u as $,aL as K,R as G,L as Q,D as X}from"./index-D9TvEOZX.js";import{X as V}from"./x-DM8tXF3P.js";import{C as Z}from"./clock-BPtF2Ddk.js";import{u as J}from"./useFeatureAccess-B5wpJDpf.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/LearningPath-B9zcHS9G.js b/assets/LearningPath-k1DxhELm.js similarity index 87% rename from assets/LearningPath-B9zcHS9G.js rename to assets/LearningPath-k1DxhELm.js index d6ee30c18da5284f689b94d4fea01be4addf0956..4ad53d1d77af6d51fbe764b28af3c462a86fda20 100644 --- a/assets/LearningPath-B9zcHS9G.js +++ b/assets/LearningPath-k1DxhELm.js @@ -1 +1 @@ -import{r as p,d as g,j as r}from"./vendor-react-B4AQeu28.js";import{u as b,ab as j,ac as N,z as k,b as P,a as I}from"./index-Cvals0ud.js";import{M as v}from"./ModuleFolderCard-EpvEJfz8.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-Cze5wmtk.js";import"./deepseekRagService-Bke9fSTt.js";import"./clock-BsCO0o69.js";import"./bell-oitWfCwK.js";import"./info-Nl0vLXXp.js";const Y=({onNavigateToModules:m,atRiskSubjects:l=[],priorityTopics:o=[],modules:i})=>{const{userProfile:d}=b(),[x,h]=p.useState(null),a=g.useMemo(()=>{const e=o.length>0?o:l.map(s=>j(s)).filter(s=>s!==null),t=new Set;return e.filter(s=>t.has(s)?!1:(t.add(s),!0))},[o,l]),u=g.useMemo(()=>{if(a.length===0)return i.slice(0,3);const e=new Map(a.map((t,s)=>[N[t],s]));return[...i].sort((t,s)=>{const n=e.get(t.id)??Number.POSITIVE_INFINITY,w=e.get(s.id)??Number.POSITIVE_INFINITY;return n-w}).slice(0,3)},[i,a]);p.useEffect(()=>{d?.uid&&k(d.uid).then(h).catch(console.error)},[d?.uid]);const c=u.slice(0,3).map(e=>{const t=x?.subjects?.[e.subject]?.modulesProgress?.[e.id],s=e.lessons.length,n=t?.progress??(s>0?Math.round((t?.lessonsCompleted?.length||0)/s*100):0);return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),f=c.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-4 md:mb-6 px-1",children:[r.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[r.jsx("div",{className:"w-8 h-8 md:w-10 md:h-10 shrink-0 rounded-xl md:rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:r.jsx(P,{className:"w-4 h-4 md:w-5 md:h-5",strokeWidth:2.5})}),r.jsx("h2",{className:"font-display font-black text-lg md:text-[24px] text-slate-800 tracking-tight whitespace-nowrap",children:f})]}),r.jsxs("button",{onClick:()=>m?.(),className:"text-primary font-bold text-xs md:text-sm flex shrink-0 items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-3 py-1.5 md:px-4 md:py-2 rounded-lg md:rounded-xl hover:bg-primary/20 whitespace-nowrap",children:["View All ",r.jsx(I,{className:"w-3.5 h-3.5 md:w-4 md:h-4"})]})]}),r.jsx("div",{className:"flex overflow-x-auto snap-x snap-mandatory scrollbar-hide -mx-4 px-4 pb-4 gap-4 md:grid md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 md:gap-6 md:pb-0 md:mx-0 md:px-0 md:overflow-visible",children:c.map((e,t)=>r.jsx("div",{className:"w-[72vw] max-w-[260px] h-[220px] shrink-0 snap-center md:min-w-0 md:max-w-none md:w-auto md:shrink md:h-auto",children:r.jsx(v,{module:e,index:t,onClick:()=>m?.(e.id),isAtRisk:a.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0})},e.id))})]})};export{Y as default}; +import{r as p,d as g,j as r}from"./vendor-react-B4AQeu28.js";import{u as b,ab as j,ac as N,z as k,b as P,a as I}from"./index-D9TvEOZX.js";import{M as v}from"./ModuleFolderCard-B6KU22sy.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-BGfavHlp.js";import"./deepseekRagService-Bke9fSTt.js";import"./clock-BPtF2Ddk.js";import"./bell-Ci_PX33B.js";import"./info-Dc8OHnyB.js";const Y=({onNavigateToModules:m,atRiskSubjects:l=[],priorityTopics:o=[],modules:i})=>{const{userProfile:d}=b(),[x,h]=p.useState(null),a=g.useMemo(()=>{const e=o.length>0?o:l.map(s=>j(s)).filter(s=>s!==null),t=new Set;return e.filter(s=>t.has(s)?!1:(t.add(s),!0))},[o,l]),u=g.useMemo(()=>{if(a.length===0)return i.slice(0,3);const e=new Map(a.map((t,s)=>[N[t],s]));return[...i].sort((t,s)=>{const n=e.get(t.id)??Number.POSITIVE_INFINITY,w=e.get(s.id)??Number.POSITIVE_INFINITY;return n-w}).slice(0,3)},[i,a]);p.useEffect(()=>{d?.uid&&k(d.uid).then(h).catch(console.error)},[d?.uid]);const c=u.slice(0,3).map(e=>{const t=x?.subjects?.[e.subject]?.modulesProgress?.[e.id],s=e.lessons.length,n=t?.progress??(s>0?Math.round((t?.lessonsCompleted?.length||0)/s*100):0);return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),f=c.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-4 md:mb-6 px-1",children:[r.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[r.jsx("div",{className:"w-8 h-8 md:w-10 md:h-10 shrink-0 rounded-xl md:rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:r.jsx(P,{className:"w-4 h-4 md:w-5 md:h-5",strokeWidth:2.5})}),r.jsx("h2",{className:"font-display font-black text-lg md:text-[24px] text-slate-800 tracking-tight whitespace-nowrap",children:f})]}),r.jsxs("button",{onClick:()=>m?.(),className:"text-primary font-bold text-xs md:text-sm flex shrink-0 items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-3 py-1.5 md:px-4 md:py-2 rounded-lg md:rounded-xl hover:bg-primary/20 whitespace-nowrap",children:["View All ",r.jsx(I,{className:"w-3.5 h-3.5 md:w-4 md:h-4"})]})]}),r.jsx("div",{className:"flex overflow-x-auto snap-x snap-mandatory scrollbar-hide -mx-4 px-4 pb-4 gap-4 md:grid md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 md:gap-6 md:pb-0 md:mx-0 md:px-0 md:overflow-visible",children:c.map((e,t)=>r.jsx("div",{className:"w-[72vw] max-w-[260px] h-[220px] shrink-0 snap-center md:min-w-0 md:max-w-none md:w-auto md:shrink md:h-auto",children:r.jsx(v,{module:e,index:t,onClick:()=>m?.(e.id),isAtRisk:a.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0})},e.id))})]})};export{Y as default}; diff --git a/assets/LoginPage-B5PKWXul.js b/assets/LoginPage-BIAu03dx.js similarity index 97% rename from assets/LoginPage-B5PKWXul.js rename to assets/LoginPage-BIAu03dx.js index 7781c24e8c194216c7ddc2eddd57f67288f3540a..09753460263d8b182764a6408455a88c568fa82c 100644 --- a/assets/LoginPage-B5PKWXul.js +++ b/assets/LoginPage-BIAu03dx.js @@ -1 +1 @@ -import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as je}from"./button-CanHmtQ3.js";import{I as L}from"./input-D6YjrCkj.js";import{m as i,B as we,T as Ne,A as ke,U as Q,L as X,a as K,G as Se,b as Pe,s as ee,c as Ae,d as te}from"./index-Cvals0ud.js";import{S as Me}from"./sparkles-Chs7kbc0.js";import{M as Re}from"./mail-DYnuuzL1.js";import{E as Ce,a as Ee}from"./eye-gVkJiC2f.js";import{S as Te}from"./shield-check-CtsVo8Il.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const se="/assets/shader-bg-DA7bEbBA.mp4",Le=[{id:"length",label:"At least 8 characters",test:a=>a.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:a=>/[A-Z]/.test(a)&&/[a-z]/.test(a)},{id:"number",label:"Contains at least one number",test:a=>/\d/.test(a)},{id:"special",label:"Contains at least one special character",test:a=>/[^A-Za-z0-9]/.test(a)}],I="Use at least 8 characters with uppercase, lowercase, number, and special character.",Ie=a=>{const c=typeof a=="object"&&a!==null?a:null,o=a instanceof Error?a.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:o};const n=o.match(/auth\/[a-z-]+/i);return{code:n?n[0].toLowerCase():"",message:o}},ze=a=>a.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ae=(a,c)=>{const{code:o,message:n}=Ie(a),h=ze(n);return o==="auth/invalid-credential"||o==="auth/wrong-password"||o==="auth/user-not-found"?"Invalid email or password. Please check your credentials and try again.":o==="auth/email-already-in-use"?"This email is already registered. Please sign in instead.":o==="auth/weak-password"||o==="auth/password-does-not-meet-requirements"?h?`Password does not meet signup requirements. ${h}`:`Password does not meet signup requirements. ${I}`:o==="auth/too-many-requests"?"Access to this account has been temporarily disabled due to many failed login attempts. You can immediately restore it by resetting your password or you can try again later.":o==="auth/network-request-failed"?"Network error. Please check your internet connection and try again.":o.startsWith("auth/")?h||c:n.includes("Firebase:")||n.includes("auth/")?c:n||c},et=()=>{const a={"Grade 11":["Academic","Tech-Pro"]},[c,o]=s.useState(""),[n,h]=s.useState(""),[S,re]=s.useState(!1),[l,z]=s.useState(!1),[P,ie]=s.useState(""),[y,D]=s.useState("student"),[b,De]=s.useState("Grade 11"),[v,B]=s.useState(a["Grade 11"][0]),[_,x]=s.useState(!1),[f,u]=s.useState(null),[oe,le]=s.useState(!1),[ne,ce]=s.useState(!1),[A,de]=s.useState(16),[q,V]=s.useState("primary"),[O,M]=s.useState(0),R=s.useRef(null),C=s.useRef(null),j=oe&&ne,g=s.useRef("primary"),w=s.useRef(0),N=s.useRef(!1),F=1.1,G=.34,U=t=>{const r=Math.max(0,Math.min(1,t));Math.abs(w.current-r)<.02||(w.current=r,M(r))},$=t=>{!Number.isFinite(t)||t<=0||Math.abs(A-t)>.05&&de(t)},E=s.useMemo(()=>Le.map(t=>({...t,met:t.test(n)})),[n]),W=s.useMemo(()=>E.every(t=>t.met),[E]),me=s.useMemo(()=>{if(!l||!f)return!1;const t=f.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[f,l]),ue=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)},pe=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)};s.useEffect(()=>{if(!j)return;const t=R.current,r=C.current;if(!t||!r)return;let d=!1,m=0;g.current="primary",V("primary"),N.current=!1,w.current=0,M(0),t.loop=!1,r.loop=!1,t.currentTime=0,r.currentTime=0,r.pause(),t.play().catch(()=>{});const k=()=>{if(d)return;const p=g.current==="primary"?t:r,Z=g.current==="primary"?r:t,ge=Number.isFinite(p.duration)&&p.duration>0?p.duration:A,T=Math.max(ge-p.currentTime,0);if(T<=F){N.current||(N.current=!0,Z.currentTime=0,Z.play().catch(()=>{}));const ve=1-T/F;if(U(ve),T<=.03||p.ended){p.pause(),p.currentTime=0;const J=g.current==="primary"?"secondary":"primary";g.current=J,V(J),N.current=!1,w.current=0,M(0)}}else U(0);m=window.requestAnimationFrame(k)};return m=window.requestAnimationFrame(k),()=>{d=!0,m&&window.cancelAnimationFrame(m)}},[A,j]);const Y=j?G*(1-O):0,H=j?G*O:0,xe=q==="primary"?Y:H,ye=q==="secondary"?Y:H;s.useEffect(()=>{const t=a[b]||[];t.length>0&&!t.includes(v)&&B(t[0])},[b,v]);const he=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:Se,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:Pe,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:Te,color:"rose"}],be=async(t,r,d)=>{u(null),x(!0),o(t),h(r),D(d),z(!1);try{ee(d),await te(t,r)}catch(m){u(ae(m,"Demo sign-in failed. Please try again.")),x(!1)}},fe=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!P.trim()){u("Please enter your name"),x(!1);return}if(y==="student"&&!b){u("Please select a grade level"),x(!1);return}if(y==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!W){u(`Password does not meet signup requirements. ${I}`),x(!1);return}ee(y),await Ae(c,n,P,y,y==="student"?{grade:b,section:v}:{department:"Mathematics"})}else await te(c,n)}catch(r){const d=l?`Sign-up failed. ${I}`:"Sign-in failed. Please check your credentials and try again.";u(ae(r,d)),x(!1)}};return e.jsxs("div",{className:"min-h-screen w-full flex items-center justify-center px-4 sm:px-6 py-8 overflow-y-auto relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>le(!0),onLoadedMetadata:ue,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":xe},src:se}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>ce(!0),onLoadedMetadata:pe,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":ye},src:se}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(i.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col items-center lg:items-start justify-center space-y-5 lg:space-y-8 text-center lg:text-left",children:[e.jsxs(i.div,{className:"flex items-center justify-center lg:justify-start gap-2.5",children:[e.jsx(i.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_final_logo.png",alt:"MathPulse AI Logo",className:"w-10 h-10 lg:w-16 lg:h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl lg:text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Me,{size:12,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body font-medium tracking-wide",children:"Powered by Machine Learning"})]})]})]}),e.jsxs(i.div,{className:"space-y-3 lg:space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-3xl sm:text-4xl lg:text-5xl xl:text-[3.4rem] font-display font-extrabold leading-[1.1] tracking-tight text-slate-900",children:["Transform Your",e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-sky-600 via-cyan-500 to-sky-500 bg-clip-text text-transparent",children:"Math Journey"})]}),e.jsx("p",{className:"text-sm lg:text-base text-slate-500 leading-relaxed max-w-md mx-auto lg:mx-0 font-body",children:"AI-powered predictive system designed to identify at-risk students and provide personalized learning recommendations."})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2 lg:gap-3",children:[{icon:we,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ne,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:ke,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,r)=>{const d=t.icon,m={sky:"border-sky-200/60 hover:border-sky-300",rose:"border-rose-200/60 hover:border-rose-300",emerald:"border-emerald-200/60 hover:border-emerald-300"},k={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},p={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(i.div,{className:`bg-white/80 backdrop-blur-xl border ${m[t.color]} rounded-xl p-3 lg:p-4 transition-all cursor-pointer group shadow-md shadow-slate-900/[0.04]`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+r*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-7 h-7 lg:w-9 lg:h-9 rounded-lg ${p[t.color]} flex items-center justify-center mx-auto lg:mx-0 mb-2 lg:mb-3`,children:e.jsx(d,{size:15,className:k[t.color]})}),e.jsx("h3",{className:"text-xs lg:text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-[10px] lg:text-xs text-slate-400 font-body",children:t.desc})]},r)})})]}),e.jsx(i.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.15,ease:[.22,1,.36,1]},className:"relative flex justify-center lg:justify-end",children:e.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-6 sm:p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)] max-h-[85vh] overflow-y-auto",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-purple-500 via-pink-500 to-sky-500"}),e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-80 h-80 bg-gradient-to-br from-purple-400/20 to-pink-400/20 rounded-full blur-[60px] pointer-events-none"}),e.jsxs("div",{className:"text-center mb-4 relative",children:[e.jsx(i.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:l?"Create Account":"Welcome Back"}),e.jsx(i.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:l?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:fe,className:"space-y-3 mb-4 relative",children:[f&&!me&&e.jsx(i.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-rose-50 border border-rose-200 text-rose-600 px-4 py-3 rounded-lg text-sm font-body",children:f}),l&&e.jsxs(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"text",placeholder:"Your Name",value:P,onChange:t=>ie(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),l&&e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.45},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Account Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{role:"student",label:"Student"},{role:"teacher",label:"Teacher"}].map(t=>{const r=y===t.role;return e.jsx("button",{type:"button",onClick:()=>D(t.role),className:`rounded-lg border px-3 py-2.5 text-sm font-body font-semibold transition-all ${r?"border-sky-400 bg-sky-50 text-sky-700":"border-slate-200 bg-slate-50 text-slate-500 hover:border-slate-300"}`,children:t.label},t.role)})})]}),l&&y==="student"&&e.jsx(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-3",children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:v,onChange:t=>B(t.target.value),className:"w-full pl-11 pr-4 py-2.5 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:(a[b]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]})}),e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.5},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"email",placeholder:"your.email@school.edu",value:c,onChange:t=>o(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.6},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(X,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:S?"text":"password",placeholder:"••••••••",value:n,onChange:t=>h(t.target.value),className:"w-full pl-11 pr-11 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0,minLength:l?8:6}),e.jsx(i.button,{type:"button",onClick:()=>re(!S),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:S?e.jsx(Ce,{size:16}):e.jsx(Ee,{size:16})})]}),l&&n.length>0&&!W&&e.jsxs("div",{className:"mt-2 rounded-lg border border-sky-100/80 bg-sky-50/70 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] font-body font-semibold uppercase tracking-wider text-slate-600",children:"Password requirements"}),e.jsx("ul",{className:"mt-2 space-y-1",children:E.map(t=>e.jsxs("li",{className:`flex items-center gap-2 text-[11px] font-body ${t.met?"text-emerald-700":"text-slate-500"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${t.met?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{children:t.label})]},t.id))})]})]}),e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(je,{type:"submit",disabled:_,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-500 hover:to-pink-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-purple-600/25 hover:shadow-pink-500/35 hover:scale-[1.02] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(i.span,{className:"absolute inset-0 bg-gradient-to-r from-white/0 via-white/15 to-white/0",animate:{x:["-100%","100%"]},transition:{duration:3,repeat:1/0,repeatDelay:2}}),e.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[_?"Please wait...":l?"Create Account":"Sign In",e.jsx(K,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{z(!l),u(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:l?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!l&&e.jsxs(i.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.85},className:"mb-4 relative",children:[e.jsxs("div",{className:"relative flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-[10px] font-body font-semibold text-slate-400 uppercase tracking-widest",children:"Quick Demo Access"}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:he.map(t=>{const r=t.icon,d={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},m={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(i.button,{type:"button",onClick:()=>be(t.email,t.password,t.role),className:"group flex items-center gap-3 w-full px-4 py-2.5 rounded-lg bg-slate-50/80 border border-slate-200/70 hover:border-sky-300 hover:bg-sky-50/80 hover:shadow-sm transition-all text-left",whileHover:{scale:1.01},whileTap:{scale:.99},children:[e.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center shrink-0 ${d[t.color]}`,children:e.jsx(r,{size:15,className:m[t.color]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-body font-semibold text-slate-700 group-hover:text-sky-600 transition-colors",children:[t.label," Account"]}),e.jsx("p",{className:"text-[10px] text-slate-400 font-body truncate",children:t.email})]}),e.jsx(K,{size:14,className:"text-slate-300 group-hover:text-sky-500 group-hover:translate-x-0.5 transition-all shrink-0"})]},t.label)})})]}),e.jsxs(i.p,{className:"text-xs text-slate-400 text-center mt-4 font-body relative",initial:{opacity:0},animate:{opacity:1},transition:{delay:1},children:[e.jsx(X,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{et as default}; +import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as je}from"./button-DC8Fz5kC.js";import{I as L}from"./input-7k8DpmeH.js";import{m as i,B as we,T as Ne,A as ke,U as Q,L as X,a as K,G as Se,b as Pe,s as ee,c as Ae,d as te}from"./index-D9TvEOZX.js";import{S as Me}from"./sparkles-BLpoopVP.js";import{M as Re}from"./mail-BP2vbAZE.js";import{E as Ce,a as Ee}from"./eye-C42pNDm-.js";import{S as Te}from"./shield-check-MDy66tKm.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const se="/assets/shader-bg-DA7bEbBA.mp4",Le=[{id:"length",label:"At least 8 characters",test:a=>a.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:a=>/[A-Z]/.test(a)&&/[a-z]/.test(a)},{id:"number",label:"Contains at least one number",test:a=>/\d/.test(a)},{id:"special",label:"Contains at least one special character",test:a=>/[^A-Za-z0-9]/.test(a)}],I="Use at least 8 characters with uppercase, lowercase, number, and special character.",Ie=a=>{const c=typeof a=="object"&&a!==null?a:null,o=a instanceof Error?a.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:o};const n=o.match(/auth\/[a-z-]+/i);return{code:n?n[0].toLowerCase():"",message:o}},ze=a=>a.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ae=(a,c)=>{const{code:o,message:n}=Ie(a),h=ze(n);return o==="auth/invalid-credential"||o==="auth/wrong-password"||o==="auth/user-not-found"?"Invalid email or password. Please check your credentials and try again.":o==="auth/email-already-in-use"?"This email is already registered. Please sign in instead.":o==="auth/weak-password"||o==="auth/password-does-not-meet-requirements"?h?`Password does not meet signup requirements. ${h}`:`Password does not meet signup requirements. ${I}`:o==="auth/too-many-requests"?"Access to this account has been temporarily disabled due to many failed login attempts. You can immediately restore it by resetting your password or you can try again later.":o==="auth/network-request-failed"?"Network error. Please check your internet connection and try again.":o.startsWith("auth/")?h||c:n.includes("Firebase:")||n.includes("auth/")?c:n||c},et=()=>{const a={"Grade 11":["Academic","Tech-Pro"]},[c,o]=s.useState(""),[n,h]=s.useState(""),[S,re]=s.useState(!1),[l,z]=s.useState(!1),[P,ie]=s.useState(""),[y,D]=s.useState("student"),[b,De]=s.useState("Grade 11"),[v,B]=s.useState(a["Grade 11"][0]),[_,x]=s.useState(!1),[f,u]=s.useState(null),[oe,le]=s.useState(!1),[ne,ce]=s.useState(!1),[A,de]=s.useState(16),[q,V]=s.useState("primary"),[O,M]=s.useState(0),R=s.useRef(null),C=s.useRef(null),j=oe&&ne,g=s.useRef("primary"),w=s.useRef(0),N=s.useRef(!1),F=1.1,G=.34,U=t=>{const r=Math.max(0,Math.min(1,t));Math.abs(w.current-r)<.02||(w.current=r,M(r))},$=t=>{!Number.isFinite(t)||t<=0||Math.abs(A-t)>.05&&de(t)},E=s.useMemo(()=>Le.map(t=>({...t,met:t.test(n)})),[n]),W=s.useMemo(()=>E.every(t=>t.met),[E]),me=s.useMemo(()=>{if(!l||!f)return!1;const t=f.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[f,l]),ue=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)},pe=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)};s.useEffect(()=>{if(!j)return;const t=R.current,r=C.current;if(!t||!r)return;let d=!1,m=0;g.current="primary",V("primary"),N.current=!1,w.current=0,M(0),t.loop=!1,r.loop=!1,t.currentTime=0,r.currentTime=0,r.pause(),t.play().catch(()=>{});const k=()=>{if(d)return;const p=g.current==="primary"?t:r,Z=g.current==="primary"?r:t,ge=Number.isFinite(p.duration)&&p.duration>0?p.duration:A,T=Math.max(ge-p.currentTime,0);if(T<=F){N.current||(N.current=!0,Z.currentTime=0,Z.play().catch(()=>{}));const ve=1-T/F;if(U(ve),T<=.03||p.ended){p.pause(),p.currentTime=0;const J=g.current==="primary"?"secondary":"primary";g.current=J,V(J),N.current=!1,w.current=0,M(0)}}else U(0);m=window.requestAnimationFrame(k)};return m=window.requestAnimationFrame(k),()=>{d=!0,m&&window.cancelAnimationFrame(m)}},[A,j]);const Y=j?G*(1-O):0,H=j?G*O:0,xe=q==="primary"?Y:H,ye=q==="secondary"?Y:H;s.useEffect(()=>{const t=a[b]||[];t.length>0&&!t.includes(v)&&B(t[0])},[b,v]);const he=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:Se,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:Pe,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:Te,color:"rose"}],be=async(t,r,d)=>{u(null),x(!0),o(t),h(r),D(d),z(!1);try{ee(d),await te(t,r)}catch(m){u(ae(m,"Demo sign-in failed. Please try again.")),x(!1)}},fe=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!P.trim()){u("Please enter your name"),x(!1);return}if(y==="student"&&!b){u("Please select a grade level"),x(!1);return}if(y==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!W){u(`Password does not meet signup requirements. ${I}`),x(!1);return}ee(y),await Ae(c,n,P,y,y==="student"?{grade:b,section:v}:{department:"Mathematics"})}else await te(c,n)}catch(r){const d=l?`Sign-up failed. ${I}`:"Sign-in failed. Please check your credentials and try again.";u(ae(r,d)),x(!1)}};return e.jsxs("div",{className:"min-h-screen w-full flex items-center justify-center px-4 sm:px-6 py-8 overflow-y-auto relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>le(!0),onLoadedMetadata:ue,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":xe},src:se}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>ce(!0),onLoadedMetadata:pe,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":ye},src:se}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(i.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col items-center lg:items-start justify-center space-y-5 lg:space-y-8 text-center lg:text-left",children:[e.jsxs(i.div,{className:"flex items-center justify-center lg:justify-start gap-2.5",children:[e.jsx(i.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_final_logo.png",alt:"MathPulse AI Logo",className:"w-10 h-10 lg:w-16 lg:h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl lg:text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Me,{size:12,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body font-medium tracking-wide",children:"Powered by Machine Learning"})]})]})]}),e.jsxs(i.div,{className:"space-y-3 lg:space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-3xl sm:text-4xl lg:text-5xl xl:text-[3.4rem] font-display font-extrabold leading-[1.1] tracking-tight text-slate-900",children:["Transform Your",e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-sky-600 via-cyan-500 to-sky-500 bg-clip-text text-transparent",children:"Math Journey"})]}),e.jsx("p",{className:"text-sm lg:text-base text-slate-500 leading-relaxed max-w-md mx-auto lg:mx-0 font-body",children:"AI-powered predictive system designed to identify at-risk students and provide personalized learning recommendations."})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2 lg:gap-3",children:[{icon:we,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ne,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:ke,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,r)=>{const d=t.icon,m={sky:"border-sky-200/60 hover:border-sky-300",rose:"border-rose-200/60 hover:border-rose-300",emerald:"border-emerald-200/60 hover:border-emerald-300"},k={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},p={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(i.div,{className:`bg-white/80 backdrop-blur-xl border ${m[t.color]} rounded-xl p-3 lg:p-4 transition-all cursor-pointer group shadow-md shadow-slate-900/[0.04]`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+r*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-7 h-7 lg:w-9 lg:h-9 rounded-lg ${p[t.color]} flex items-center justify-center mx-auto lg:mx-0 mb-2 lg:mb-3`,children:e.jsx(d,{size:15,className:k[t.color]})}),e.jsx("h3",{className:"text-xs lg:text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-[10px] lg:text-xs text-slate-400 font-body",children:t.desc})]},r)})})]}),e.jsx(i.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.15,ease:[.22,1,.36,1]},className:"relative flex justify-center lg:justify-end",children:e.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-6 sm:p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)] max-h-[85vh] overflow-y-auto",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-purple-500 via-pink-500 to-sky-500"}),e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-80 h-80 bg-gradient-to-br from-purple-400/20 to-pink-400/20 rounded-full blur-[60px] pointer-events-none"}),e.jsxs("div",{className:"text-center mb-4 relative",children:[e.jsx(i.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:l?"Create Account":"Welcome Back"}),e.jsx(i.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:l?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:fe,className:"space-y-3 mb-4 relative",children:[f&&!me&&e.jsx(i.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-rose-50 border border-rose-200 text-rose-600 px-4 py-3 rounded-lg text-sm font-body",children:f}),l&&e.jsxs(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"text",placeholder:"Your Name",value:P,onChange:t=>ie(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),l&&e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.45},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Account Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{role:"student",label:"Student"},{role:"teacher",label:"Teacher"}].map(t=>{const r=y===t.role;return e.jsx("button",{type:"button",onClick:()=>D(t.role),className:`rounded-lg border px-3 py-2.5 text-sm font-body font-semibold transition-all ${r?"border-sky-400 bg-sky-50 text-sky-700":"border-slate-200 bg-slate-50 text-slate-500 hover:border-slate-300"}`,children:t.label},t.role)})})]}),l&&y==="student"&&e.jsx(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-3",children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:v,onChange:t=>B(t.target.value),className:"w-full pl-11 pr-4 py-2.5 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:(a[b]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]})}),e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.5},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"email",placeholder:"your.email@school.edu",value:c,onChange:t=>o(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),e.jsxs(i.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.6},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(X,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:S?"text":"password",placeholder:"••••••••",value:n,onChange:t=>h(t.target.value),className:"w-full pl-11 pr-11 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0,minLength:l?8:6}),e.jsx(i.button,{type:"button",onClick:()=>re(!S),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:S?e.jsx(Ce,{size:16}):e.jsx(Ee,{size:16})})]}),l&&n.length>0&&!W&&e.jsxs("div",{className:"mt-2 rounded-lg border border-sky-100/80 bg-sky-50/70 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] font-body font-semibold uppercase tracking-wider text-slate-600",children:"Password requirements"}),e.jsx("ul",{className:"mt-2 space-y-1",children:E.map(t=>e.jsxs("li",{className:`flex items-center gap-2 text-[11px] font-body ${t.met?"text-emerald-700":"text-slate-500"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${t.met?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{children:t.label})]},t.id))})]})]}),e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(je,{type:"submit",disabled:_,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-500 hover:to-pink-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-purple-600/25 hover:shadow-pink-500/35 hover:scale-[1.02] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(i.span,{className:"absolute inset-0 bg-gradient-to-r from-white/0 via-white/15 to-white/0",animate:{x:["-100%","100%"]},transition:{duration:3,repeat:1/0,repeatDelay:2}}),e.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[_?"Please wait...":l?"Create Account":"Sign In",e.jsx(K,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{z(!l),u(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:l?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!l&&e.jsxs(i.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.85},className:"mb-4 relative",children:[e.jsxs("div",{className:"relative flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-[10px] font-body font-semibold text-slate-400 uppercase tracking-widest",children:"Quick Demo Access"}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:he.map(t=>{const r=t.icon,d={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},m={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(i.button,{type:"button",onClick:()=>be(t.email,t.password,t.role),className:"group flex items-center gap-3 w-full px-4 py-2.5 rounded-lg bg-slate-50/80 border border-slate-200/70 hover:border-sky-300 hover:bg-sky-50/80 hover:shadow-sm transition-all text-left",whileHover:{scale:1.01},whileTap:{scale:.99},children:[e.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center shrink-0 ${d[t.color]}`,children:e.jsx(r,{size:15,className:m[t.color]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-body font-semibold text-slate-700 group-hover:text-sky-600 transition-colors",children:[t.label," Account"]}),e.jsx("p",{className:"text-[10px] text-slate-400 font-body truncate",children:t.email})]}),e.jsx(K,{size:14,className:"text-slate-300 group-hover:text-sky-500 group-hover:translate-x-0.5 transition-all shrink-0"})]},t.label)})})]}),e.jsxs(i.p,{className:"text-xs text-slate-400 text-center mt-4 font-body relative",initial:{opacity:0},animate:{opacity:1},transition:{delay:1},children:[e.jsx(X,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{et as default}; diff --git a/assets/LogoutActionButton-C7uxe-Am.js b/assets/LogoutActionButton-1ArQYuvD.js similarity index 94% rename from assets/LogoutActionButton-C7uxe-Am.js rename to assets/LogoutActionButton-1ArQYuvD.js index d25e1444d19684ff845400591f22712077fc1b9d..dbf38033dcb52c19a915826575864d52a50b2a23 100644 --- a/assets/LogoutActionButton-C7uxe-Am.js +++ b/assets/LogoutActionButton-1ArQYuvD.js @@ -1,4 +1,4 @@ -import{e,m as r,o as l}from"./index-Cvals0ud.js";import{j as t}from"./vendor-react-B4AQeu28.js";import{L as n}from"./log-out-CKjuia0o.js";/** +import{e,m as r,o as l}from"./index-D9TvEOZX.js";import{j as t}from"./vendor-react-B4AQeu28.js";import{L as n}from"./log-out-Bh-BcVV5.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ModuleFolderCard-EpvEJfz8.js b/assets/ModuleFolderCard-B6KU22sy.js similarity index 97% rename from assets/ModuleFolderCard-EpvEJfz8.js rename to assets/ModuleFolderCard-B6KU22sy.js index 767ef8fa10532217122e804b53f051ab52e0074c..4b9da40fca34d99ed6a488c25d7254cbc4c7e16b 100644 --- a/assets/ModuleFolderCard-EpvEJfz8.js +++ b/assets/ModuleFolderCard-B6KU22sy.js @@ -1,4 +1,4 @@ -import{j as e,r as h}from"./vendor-react-B4AQeu28.js";import{u as j}from"./useSubjectAvailability-Cze5wmtk.js";import{a as y}from"./deepseekRagService-Bke9fSTt.js";import{e as u,m as N,b as k,y as _,G as B}from"./index-Cvals0ud.js";import{C as z}from"./clock-BsCO0o69.js";import{B as A}from"./bell-oitWfCwK.js";import{I as M}from"./info-Nl0vLXXp.js";/** +import{j as e,r as h}from"./vendor-react-B4AQeu28.js";import{u as j}from"./useSubjectAvailability-BGfavHlp.js";import{a as y}from"./deepseekRagService-Bke9fSTt.js";import{e as u,m as N,b as k,y as _,G as B}from"./index-D9TvEOZX.js";import{C as z}from"./clock-BPtF2Ddk.js";import{B as A}from"./bell-Ci_PX33B.js";import{I as M}from"./info-Dc8OHnyB.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ModulesPage--JtlKiDc.js b/assets/ModulesPage--JtlKiDc.js new file mode 100644 index 0000000000000000000000000000000000000000..bff3bb0a893ebf0bcb7bb8dd271f9e15100e43c9 --- /dev/null +++ b/assets/ModulesPage--JtlKiDc.js @@ -0,0 +1,199 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css"])))=>i.map(i=>d[i]); +import{r as a,j as e,b as vt,d as je,c as sa}from"./vendor-react-B4AQeu28.js";import{u as aa}from"./useQuery-CpdRUEDx.js";import{doc as kt,onSnapshot as as,getDoc as Yt,runTransaction as ra,serverTimestamp as na,query as la,where as ia,collection as oa}from"./vendor-firebase-firestore-CNv3xXal.js";import{e as ae,g as tt,ae as ca,_ as Ft,m as S,Z as Xe,h as ot,$ as rs,b as Fe,C as wt,M as da,a as ht,T as At,r as et,a7 as $s,R as Bs,F as ns,w as $t,u as Bt,A as Tt,o as It,y as Hs,ad as us,af as ma,ag as ps,ah as xa,q as qs,ai as ua,L as Os,B as pa,aj as ha,ak as Qs,al as fa,am as ba,an as ga,ab as ya,x as wa,ao as hs,ap as ja,aq as fs,G as va,j as ut,a9 as Na,ac as ka}from"./index-D9TvEOZX.js";import{M as Kt}from"./ModuleFolderCard-B6KU22sy.js";import{B as Me}from"./button-DC8Fz5kC.js";import{triggerQuizSubmitted as Sa}from"./automationService-BZunccIA.js";import{e as Ca,g as za,A as Zt,V as Ma,c as _a,P as Jt,L as Aa}from"./quizService-BthGydmr.js";import Ws from"./ScientificCalculator-DPFBENLI.js";import{C as Rt}from"./check-Ceq9J6wq.js";import{X as Je}from"./x-DM8tXF3P.js";import{C as Nt}from"./clock-BPtF2Ddk.js";import{V as es,a as ts,M as Us,b as Gs}from"./volume-x-DPfTjI9k.js";import{C as ss}from"./chevron-left-C7NnvvA7.js";import{C as it}from"./chevron-right-Jv12kepm.js";import{C as Ut,L as jt}from"./lightbulb-CVSZ487_.js";import{C as ft}from"./circle-check-big-yn5lhjQR.js";import{C as Ea}from"./circle-help-BNf4DSN0.js";import{logLessonView as Ta}from"./trackingService-bDpHteof.js";import{C as Pa}from"./clipboard-check-DEpL_ccN.js";import{s as Dt,S as bs}from"./subjects-BJQJlUBm.js";import{C as Xs}from"./circle-check-C6IXGFgm.js";import{C as La}from"./chart-column-BwIV9b12.js";import{D as Ia}from"./dollar-sign-Bysazpsk.js";import gs from"./confetti.module-C94ZD2ww.js";import{G as Da}from"./gift-Cuw3Q8xP.js";import{u as Ra}from"./useCurriculum-CNtxEkAg.js";import{w as Fa}from"./moduleWatchService-C7S4gD7U.js";import{S as $a}from"./search-DhblJahq.js";import{F as Ba}from"./funnel-eKLw0u3T.js";import{S as Ha}from"./sparkles-BLpoopVP.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-BGfavHlp.js";import"./deepseekRagService-Bke9fSTt.js";import"./bell-Ci_PX33B.js";import"./info-Dc8OHnyB.js";import"./chevron-up-C5341jJ8.js";/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qa=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],Oa=ae("binary",qa);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qa=[["path",{d:"M15 13a3 3 0 1 0-6 0",key:"10j68g"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}]],ys=ae("book-user",Qa);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wa=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],ws=ae("bookmark",Wa);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ua=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],js=ae("box",Ua);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ga=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],vs=ae("braces",Ga);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xa=[["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}],["circle",{cx:"18.5",cy:"5.5",r:".5",fill:"currentColor",key:"lysivs"}],["circle",{cx:"11.5",cy:"11.5",r:".5",fill:"currentColor",key:"byv1b8"}],["circle",{cx:"7.5",cy:"16.5",r:".5",fill:"currentColor",key:"nkw3mc"}],["circle",{cx:"17.5",cy:"14.5",r:".5",fill:"currentColor",key:"1gjh6j"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}]],Va=ae("chart-scatter",Xa);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ya=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],Ka=ae("circle-play",Ya);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Za=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ns=ae("circle",Za);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ja=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],er=ae("crosshair",Ja);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 16h.01",key:"18s6g9"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M12 12h.01",key:"1mp3jc"}]],sr=ae("dice-5",tr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ar=[["circle",{cx:"12",cy:"6",r:"1",key:"1bh7o1"}],["line",{x1:"5",x2:"19",y1:"12",y2:"12",key:"13b5wn"}],["circle",{cx:"12",cy:"18",r:"1",key:"lqb9t5"}]],Gt=ae("divide",ar);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rr=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],nr=ae("flask-conical",rr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lr=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],ks=ae("hash",lr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ir=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"m12 13-1-1 2-2-3-3 2-2",key:"xjdxli"}]],Vs=ae("heart-crack",ir);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const or=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],cr=ae("key",or);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dr=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],mr=ae("notebook-pen",dr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xr=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],Ss=ae("percent",xr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ur=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],pr=ae("ruler",ur);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hr=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M14 15H9v-5",key:"pi4jk9"}],["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M21 3 9 15",key:"15kdhq"}]],fr=ae("scaling",hr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const br=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],Cs=ae("sigma",br);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],Xt=ae("square-function",gr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],zs=ae("square",yr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wr=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],jr=ae("timer",wr);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vr=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],Ms=ae("triangle",vr);function Nr(t){let s=t>>>0;return()=>{s+=1831565813;let n=Math.imul(s^s>>>15,s|1);return n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function kr(t,s){const n=[...t],i=Nr(s);for(let l=n.length-1;l>0;l--){const c=Math.floor(i()*(l+1));[n[l],n[c]]=[n[c],n[l]]}return n}function ls(t){const s=t??new Date;return new Intl.DateTimeFormat("en-CA",{timeZone:"Asia/Manila",year:"numeric",month:"2-digit",day:"2-digit"}).format(s)}function is(t){const s=new Date,n=new Intl.DateTimeFormat("en-US",{timeZone:"Asia/Manila",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(s),i=l=>parseInt(n.find(c=>c.type===l)?.value??"0",10);return new Date(i("year"),i("month")-1,i("day"),i("hour"),i("minute"),i("second"))}function os(t){const s=is(),n=s.getFullYear(),i=(s.getDay()+6)%7,l=new Date(s);l.setDate(s.getDate()-i+3);const c=new Date(l.getFullYear(),0,1),r=Math.floor((l.getTime()-c.getTime())/(1440*60*1e3)),d=Math.floor(r/7)+1;return n*100+d}function cs(t){return(is().getDay()+6)%7}function Sr(t){const s=new Date,n=480*60*1e3,i=s.getTime()+n,c=(new Date(i).getUTCDay()+6)%7,r=c===0?7:7-c,x=i-i%(1440*60*1e3)+r*24*60*60*1e3;return new Date(x-n)}const Cr=[{id:"xp_50",label:"+50 XP Boost",description:"Bonus XP on your next quiz",icon:"⚡",type:"xp",value:50,rarity:"common",color:"#4ade80"},{id:"xp_100",label:"+100 XP Boost",description:"Double bonus XP reward",icon:"🌟",type:"xp",value:100,rarity:"rare",color:"#facc15"},{id:"xp_200",label:"+200 XP Epic Boost",description:"Massive XP surge",icon:"💥",type:"xp",value:200,rarity:"epic",color:"#f97316"},{id:"streak_shield",label:"Streak Shield",description:"Protects streak if you miss a day",icon:"🛡️",type:"streak_shield",value:1,rarity:"rare",color:"#60a5fa"},{id:"hint_x3",label:"3 Hint Tokens",description:"Use in-quiz hints",icon:"💡",type:"hint_token",value:3,rarity:"common",color:"#a78bfa"},{id:"hint_x5",label:"5 Hint Tokens",description:"More hints to use",icon:"🔦",type:"hint_token",value:5,rarity:"rare",color:"#8b5cf6"},{id:"xp_mult_1h",label:"1-Hour XP ×1.5",description:"1.5× XP for all quizzes for 1 hour",icon:"⏰",type:"xp_multiplier",value:60,rarity:"epic",color:"#ec4899"},{id:"xp_mult_30m",label:"30-Min XP ×2",description:"2× XP for 30 minutes",icon:"🚀",type:"xp_multiplier",value:30,rarity:"epic",color:"#e11d48"},{id:"xp_75",label:"+75 XP Boost",description:"Solid XP reward",icon:"✨",type:"xp",value:75,rarity:"common",color:"#34d399"},{id:"hint_x2",label:"2 Hint Tokens",description:"Quick hint pack",icon:"🕯️",type:"hint_token",value:2,rarity:"common",color:"#7c3aed"},{id:"xp_streak_150",label:"+150 XP + Streak Save",description:"XP boost + streak protection combo",icon:"🔥",type:"xp",value:150,rarity:"epic",color:"#dc2626"},{id:"xp_25",label:"+25 XP Starter",description:"Small but reliable XP",icon:"🌱",type:"xp",value:25,rarity:"common",color:"#86efac"},{id:"hint_x1",label:"1 Hint Token",description:"A single lifeline",icon:"🔍",type:"hint_token",value:1,rarity:"common",color:"#c4b5fd"},{id:"streak_shield2",label:"2 Streak Shields",description:"Double streak protection",icon:"🏰",type:"streak_shield",value:2,rarity:"epic",color:"#3b82f6"},{id:"xp_120",label:"+120 XP Power Surge",description:"Strong XP reward for the day",icon:"⚡",type:"xp",value:120,rarity:"rare",color:"#16a34a"},{id:"hint_x4",label:"4 Hint Tokens",description:"Generous hint pack",icon:"📚",type:"hint_token",value:4,rarity:"rare",color:"#9333ea"}];function zr(t){return kr(Cr,t).slice(0,7).map((i,l)=>({...i,day:l}))}function ds(){return zr(os())}function Mr(){const t=ds(),s=cs();return t[s]}function _r(t){const[s,n]=a.useState({extraHintsEnabled:!1,hintTokens:0,totalHintsAvailable:0,loading:!0});return a.useEffect(()=>{if(!t){n({extraHintsEnabled:!1,hintTokens:0,totalHintsAvailable:0,loading:!1});return}const i=kt(tt,"users",t);return as(i,c=>{if(!c.exists()){n({extraHintsEnabled:!1,hintTokens:0,totalHintsAvailable:0,loading:!1});return}const r=c.data(),d=r?.extraHintsEnabled===!0,x=r?.hintTokens||0,f=d?x+3:x;n({extraHintsEnabled:d,hintTokens:x,totalHintsAvailable:f,loading:!1})},c=>{console.error("[useExtraHints] snapshot error:",c),n({extraHintsEnabled:!1,hintTokens:0,totalHintsAvailable:0,loading:!1})})},[t]),s}const _s=` + @keyframes score-pop { + 0% { transform: scale(1); } + 50% { transform: scale(1.4); } + 100% { transform: scale(1); } + } + @keyframes overlay-slide-up { + 0% { transform: translateY(40px) scale(0.85); opacity: 0; } + 100% { transform: translateY(0) scale(1); opacity: 1; } + } + @keyframes confetti-fall { + 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; } + 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } + } + .animate-score-pop { animation: score-pop 0.5s ease-out forwards; } + .animate-overlay-slide-up { animation: overlay-slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; } + .confetti-piece { + position: absolute; + width: 10px; + height: 10px; + animation: confetti-fall linear forwards; + } +`,Ar=({viewportHeight:t})=>e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden flex justify-between bg-slate-900/5",children:je.useMemo(()=>[...Array(40)].map((s,n)=>({id:n,left:`${Math.random()*100}%`,duration:.6+Math.random()*.4,delay:Math.random()*.4})),[t]).map(s=>e.jsx(S.div,{className:"absolute w-0.5 h-16 bg-blue-400/30 rounded-full",style:{left:s.left,top:"-10%"},animate:{y:[0,t*1.2]},transition:{duration:s.duration,ease:"linear",delay:s.delay}},s.id))}),Er=()=>{const t=je.useMemo(()=>[...Array(60)].map((s,n)=>({id:n,left:`${Math.random()*100}%`,backgroundColor:["#75D06A","#6ED1CF","#9956DE","#FB96BB","#FFB356"][n%5],duration:2+Math.random()*2,delay:Math.random()*.5,size:6+Math.random()*8,borderRadius:Math.random()>.5?"50%":"2px"})),[]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden",children:t.map(s=>e.jsx("div",{className:"confetti-piece",style:{left:s.left,top:"-10%",backgroundColor:s.backgroundColor,width:s.size,height:s.size,borderRadius:s.borderRadius,animationDuration:`${s.duration}s`,animationDelay:`${s.delay}s`}},s.id))})},Tr=({viewportHeight:t,viewportWidth:s})=>{const n=je.useMemo(()=>[...Array(30)].map((i,l)=>({id:l,xShift:(Math.random()-.5)*s*.8,yShift:(Math.random()-.5)*t*.8,scale:Math.random()*1.5+.5,duration:2+Math.random()*1.5,delay:Math.random()*.35})),[t,s]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden flex items-center justify-center",children:n.map(i=>e.jsx(S.div,{className:"absolute w-2 h-2 bg-amber-400 rounded-full shadow-[0_0_10px_rgba(251,191,36,0.5)]",style:{left:"50%",top:"50%"},animate:{y:[0,i.yShift],x:[0,i.xShift],scale:[0,i.scale,0],opacity:[0,1,0]},transition:{duration:i.duration,ease:"easeOut",delay:i.delay}},i.id))})},As=({value:t,label:s,delay:n=0,icon:i})=>{const[l,c]=je.useState(0);return je.useEffect(()=>{if(t<=0)return;const r=1e3,d=30,x=Math.abs(Math.floor(r/d));let f=0;const M=setTimeout(()=>{const u=setInterval(()=>{f+=Math.max(1,Math.floor(t/d)),f>=t?(c(t),clearInterval(u)):c(f)},x);return()=>clearInterval(u)},n);return()=>clearTimeout(M)},[t,n]),t<0?null:e.jsxs(S.div,{initial:{opacity:0,transform:"translateX(-20px)"},animate:{opacity:1,transform:"translateX(0)"},transition:{delay:n/1e3,duration:.5},className:"flex items-center justify-between bg-slate-50 border border-slate-100 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-slate-500 font-bold uppercase tracking-wider text-[10px]",children:[i,s]}),e.jsxs("div",{className:"text-xl font-black text-purple-600 tabular-nums",children:["+",l]})]})};function Pr(t){if(t.questionType==="multiple_choice"&&t.options&&t.options.length>0){const s=t.options.findIndex(n=>n.trim().toLowerCase()===t.correctAnswer.trim().toLowerCase());return{id:t.id,question:t.question,options:t.options,correctAnswer:s>=0?s:0,correctAnswerText:t.correctAnswer,explanation:t.explanation,questionType:t.questionType,points:t.points,difficulty:t.difficulty,topic:t.topic,bloomLevel:t.bloomLevel}}return{id:t.id,question:t.question,options:[],correctAnswer:-1,correctAnswerText:t.correctAnswer,explanation:t.explanation,questionType:t.questionType,points:t.points,difficulty:t.difficulty,topic:t.topic,bloomLevel:t.bloomLevel}}function Es(t){return t.replace(/²/g,"^2").replace(/³/g,"^3").replace(/⁻¹/g,"^-1").replace(/⁰/g,"^0").replace(/¹/g,"^1").replace(/⁴/g,"^4").replace(/⁵/g,"^5").replace(/⁶/g,"^6").replace(/⁷/g,"^7").replace(/⁸/g,"^8").replace(/⁹/g,"^9").replace(/π/g,"pi").replace(/√/g,"sqrt").replace(/×/g,"*").replace(/÷/g,"/").replace(/\s+/g,"").toLowerCase().trim()}function Lr(t,s,n){const i=l=>l.trim().toLowerCase().replace(/\s+/g," ");switch(n){case"identification":return i(t)===i(s);case"enumeration":{const l=t.split(",").map(r=>i(r)).filter(Boolean).sort(),c=s.split(",").map(r=>i(r)).filter(Boolean).sort();return JSON.stringify(l)===JSON.stringify(c)}case"word_problem":case"equation_based":{const l=Es(t),c=Es(s);if(l===c)return!0;const r=parseFloat(t.replace(/[^\d.\-]/g,"")),d=parseFloat(s.replace(/[^\d.\-]/g,""));return!isNaN(r)&&!isNaN(d)?Math.abs(r-d)<=.01:i(t)===i(s)}default:return i(t)===i(s)}}const Ys=({quiz:t,onClose:s,onComplete:n,onQuizEnd:i,studentId:l,atRiskSubjects:c=[]})=>{const[r,d]=a.useState(0),[x,f]=a.useState(null),[M,u]=a.useState(""),[N,m]=a.useState(!1),[p,k]=a.useState(!1),[y,W]=a.useState(!1),[j,E]=a.useState(0),[_,D]=a.useState(0),[b,I]=a.useState(1),[B,se]=a.useState([]),[C,re]=a.useState([]),[ge,Oe]=a.useState(Date.now()),[oe,Qe]=a.useState(!1),[Se,G]=a.useState(!1),[ve,We]=a.useState(null),[_e,Ve]=a.useState(0),[$e,Ue]=a.useState(0),[h,A]=a.useState(!1),[T,X]=a.useState(!1),[$,Z]=a.useState(!0),[le,Ae]=a.useState(!1),[fe,be]=a.useState({width:1280,height:720});a.useEffect(()=>{const v=()=>be({width:window.innerWidth,height:window.innerHeight});return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const[Te,F]=a.useState(0),[ee,ue]=a.useState({}),[Be,st]=a.useState(!1),[St,bt]=a.useState(!1),[Ge,Ct]=a.useState(!1),{totalHintsAvailable:Ne}=_r(l||null),[ce,at]=a.useState(5),[rt,ct]=a.useState(15),zt=ce+Ne,[He,Ye]=a.useState(null),[Ke,o]=a.useState(!1),[P,Q]=a.useState(900*1e3),[de,U]=a.useState([]),[q,me]=a.useState(0),[Pe,Ee]=a.useState(null),[xe]=a.useState(()=>t.loadedQuestions&&t.loadedQuestions.length>0?t.loadedQuestions.map(Pr):Array.from({length:t.questions},(v,w)=>({id:`q${w+1}`,question:Ir(t.subject,w),options:Dr(t.subject,w),correctAnswer:Rr(t.subject,w),explanation:Fr(t.subject,w,t.difficulty)})));a.useEffect(()=>{ue({}),U([]),at(5),ct(15),F(0),E(0),D(0),I(1)},[t.id]);const ne=xe[r];a.useEffect(()=>{const v=parseInt(t.duration)||10;Ve(v*60);const w=setInterval(()=>{Ve(V=>V<=1?(clearInterval(w),ke(),0):V-1)},1e3);return()=>clearInterval(w)},[]),a.useEffect(()=>{rt===0&&!He&&(Ye(Date.now()),o(!0))},[rt,He]),a.useEffect(()=>{if(!Ke||!He)return;const v=setInterval(()=>{const w=Date.now()-He,V=Math.max(0,900*1e3-w);Q(V)},1e3);return()=>clearInterval(v)},[Ke,He]);const[Le,gt]=a.useState(Array.from({length:15},(v,w)=>({id:w,size:Math.random()*120+40,x:Math.random()*100,y:Math.random()*100,duration:Math.random()*20+15,delay:Math.random()*-20,color:["bg-purple-500/10","bg-blue-500/10","bg-cyan-500/10","bg-emerald-500/10"][Math.floor(Math.random()*4)]}))),Ze=v=>{if($)try{const w=window.AudioContext||window.webkitAudioContext;if(!w)return;const V=new w,R=V.currentTime,H=(Ce,Ie,ye,ze=.1,we="sine")=>{const pe=V.createOscillator(),mt=V.createGain();pe.type=we,pe.frequency.value=Ce,mt.gain.setValueAtTime(0,Ie),mt.gain.linearRampToValueAtTime(ze,Ie+.05),mt.gain.exponentialRampToValueAtTime(.001,Ie+ye),pe.connect(mt),mt.connect(V.destination),pe.start(Ie),pe.stop(Ie+ye)};v==="correct"?(H(880,R,.1,.1,"sine"),H(1108.73,R+.1,.2,.1,"sine")):v==="incorrect"?(H(300,R,.2,.05,"sawtooth"),H(250,R+.15,.3,.05,"sawtooth")):v==="combo"?(H(440,R,.1,.05,"square"),H(554.37,R+.1,.1,.05,"square"),H(659.25,R+.2,.1,.05,"square"),H(880,R+.3,.4,.05,"square")):v==="complete"&&(H(523.25,R,.1,.1),H(659.25,R+.15,.1,.1),H(783.99,R+.3,.1,.1),H(1046.5,R+.45,.5,.1))}catch{}},ke=()=>{Qe(!0),qt()},Pt=()=>{i?.(t,C),s()},Lt=()=>{if(ce<=0||p)return;const v=ee[r]||[],w=ne.options.filter(R=>R!==ne.correctAnswerText).filter(R=>!v.includes(R));if(w.length===0)return;const V=w[Math.floor(Math.random()*w.length)];ue(R=>({...R,[r]:[...v,V]})),at(R=>Math.max(0,R-1)),Ze("correct")},Mt=v=>{p||L||(f(v),setTimeout(()=>{dt(v)},150))},dt=v=>{const w=ne.questionType!=null&&ne.questionType!=="multiple_choice",V=v!==void 0?v:x;if(w){if(!M.trim())return}else if(V===null)return;const R=w?Lr(M,ne.correctAnswerText||"",ne.questionType||""):V===ne.correctAnswer,H=w?M:String(V),Ce=Math.round((Date.now()-ge)/1e3);re(pe=>[...pe,{questionId:ne.id,answer:H,correct:R,timeSpent:Ce}]);const Ie=[...B];if(Ie[r]=R?1:0,se(Ie),m(R),k(!0),!R){bt(!0),Ze("incorrect"),setTimeout(()=>bt(!1),500),ct(pe=>Math.max(0,pe-1)),D(0),I(1),setTimeout(()=>{nt()},1500);return}Ze("correct");const ze=(ee[r]||[]).length>0?5:10;F(pe=>pe+ze),E(j+1);const we=_+1;D(we),we===2?Ee("streak"):we===3&&b<2?Ee("multiplier2"):we===5&&b<3&&Ee("multiplier3"),we>0&&we%3===0&&Ze("combo"),we>=5?I(3):we>=3?I(2):I(1),Ft(()=>import("./confetti.module-C94ZD2ww.js"),[]).then(pe=>{pe.default({particleCount:30,spread:40,colors:["#75D06A","#6ED1CF"],origin:{y:.6}})}),Ct(!0),setTimeout(()=>{Ct(!1),Ee(null),setTimeout(()=>nt(),300)},1500)},nt=()=>{if(r{const v=Math.round(j/xe.length*100);let w=t.xpReward;v>=90?w=Math.round(w*1.5):v>=80&&(w=Math.round(w*1.25));const V=parseInt(t.duration)*60;_e>V*.5&&(w=Math.round(w*1.2)),Ue(w);const R=V-_e;l&&Sa({lrn:l,quizId:t.id,subject:t.subject,score:v,totalQuestions:xe.length,correctAnswers:j,timeSpentSeconds:R}).catch(H=>console.error("[WARN] Automation: quiz pipeline failed:",H)),t.source==="ai_generated"&&l?Ca(l,t.id,t.generatedQuizId,t.subject,t.source,v,w,R,C,xe.map(H=>({topic:H.topic||t.subject,difficulty:H.difficulty||"medium",bloomLevel:H.bloomLevel||"understand"}))).catch(H=>console.error("[WARN] Quiz result save failed:",H)):l&&ca(l,t.id,t.subject,v,C.map(H=>({questionId:H.questionId,selectedAnswer:H.answer,isCorrect:H.correct})),R).catch(H=>console.error("[WARN] Practice quiz persist failed:",H)),l&&Ft(async()=>{const{saveAssessmentResult:H}=await import("./index-D9TvEOZX.js").then(Ce=>Ce.b9);return{saveAssessmentResult:H}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({saveAssessmentResult:H})=>{H({uid:l,testId:t.id,title:t.title||t.id,subject:t.subject||"General Mathematics",type:t.source==="ai_generated"?"quiz":"practice",score:v,totalQuestions:xe.length,risk:v<60?"High":"Low",intervention:"",xpEarned:w,badgeUnlocked:""}).catch(Ce=>console.error("[WARN] Assessment record save failed:",Ce))}),Ze("complete"),n?.(v,w)},L=q{document.fullscreenElement?(document.exitFullscreen().catch(()=>{}),Ae(!1)):(document.documentElement.requestFullscreen().catch(()=>{}),Ae(!0))};if(oe){const v=Math.round(j/xe.length*100),w=v>=80,V=v>=50&&v<80,R=v<50,H=document.getElementById("modal-root"),Ce=e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-900/50 backdrop-blur-sm",children:[e.jsx("style",{children:_s}),w&&e.jsx(Er,{}),V&&e.jsx(Tr,{viewportHeight:fe.height,viewportWidth:fe.width}),R&&e.jsx(Ar,{viewportHeight:fe.height}),e.jsxs(S.div,{initial:{opacity:0,scale:.8,y:40},animate:{opacity:1,scale:1,y:0},transition:{type:"spring",damping:18,stiffness:200},className:"w-full max-w-xs sm:max-w-sm bg-white border-2 border-slate-200 shadow-[0_25px_60px_rgba(0,0,0,0.15)] rounded-[2rem] p-4 sm:p-5 text-center relative z-10",children:[e.jsx(S.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",damping:12,stiffness:150,delay:.2},className:"mb-3",children:e.jsx("img",{src:"/mascot/modules_avatar.png",alt:"Mascot",className:"w-16 h-16 sm:w-20 sm:h-20 mx-auto drop-shadow-xl animate-mascot-float"})}),e.jsx(S.h2,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},className:`text-xl sm:text-2xl font-black uppercase tracking-tight mb-1 drop-shadow-sm ${w?"text-emerald-500":V?"text-amber-500":"text-rose-500"}`,children:w?"EXCELLENT!":V?"GOOD JOB!":"KEEP TRYING!"}),e.jsxs("p",{className:"text-slate-400 font-bold text-[10px] mb-3 uppercase tracking-widest",children:["Quiz Complete • Score: ",j,"/",xe.length]}),e.jsx(S.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"bg-slate-50/50 rounded-xl p-3 mb-4 border border-slate-100 flex flex-col gap-2",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-slate-400 text-[9px] font-black uppercase tracking-widest text-left mb-1.5 ml-1",children:"Performance Details"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(As,{value:j,label:"Correct Answers",delay:500,icon:e.jsx(Rt,{className:"h-3 w-3 text-emerald-500"})}),e.jsx(As,{value:$e,label:"Total XP Earned",delay:800,icon:e.jsx(Xe,{className:"h-3 w-3 text-amber-500"})}),e.jsxs(S.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:1.2,duration:.4},className:"flex items-center justify-between pt-1.5 mt-1 border-t border-slate-100",children:[e.jsx("span",{className:"text-slate-400 text-[9px] font-black uppercase tracking-widest",children:"Final Accuracy"}),e.jsxs("span",{className:"text-lg font-black text-slate-800 tabular-nums",children:[v,"%"]})]})]})]})}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Me,{size:"lg",onClick:()=>{d(0),me(0),f(null),u(""),E(0),D(0),I(1),se([]),re([]),F(0),Qe(!1),k(!1),W(!1),Oe(Date.now()),ue({}),U([]),st(!1),at(5),G(!1)},className:"w-full h-10 sm:h-11 rounded-2xl text-xs font-black bg-white hover:bg-slate-50 text-purple-600 border-2 border-purple-100",children:"RETAKE QUIZ"}),e.jsx(Me,{size:"lg",onClick:s,className:"w-full h-10 sm:h-11 rounded-2xl text-xs font-black bg-purple-600 hover:bg-purple-700 text-white shadow-lg shadow-purple-200",children:"FINISH"})]})]})]});return vt.createPortal(Ce,H)}return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:_s}),h&&vt.createPortal(e.jsx(S.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"fixed right-6 top-1/2 -translate-y-1/2 z-[9999] w-64",children:e.jsxs("div",{className:"bg-white rounded-2xl p-3 border border-slate-200 shadow-[0_10px_40px_rgba(0,0,0,0.3)]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[e.jsxs("h4",{className:"text-xs font-bold text-[#0a1628] flex items-center gap-2",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-purple-600",children:[e.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),e.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"})]}),"Calculator"]}),e.jsx("button",{onClick:()=>A(!1),className:"w-6 h-6 rounded-full bg-slate-100 flex items-center justify-center text-slate-500 hover:text-slate-800 hover:bg-slate-200 transition-colors",children:e.jsx(Je,{size:12})})]}),e.jsx(Ws,{isOpen:!0,onClose:()=>A(!1),inline:!0})]})}),document.getElementById("modal-root")),Ke&&vt.createPortal(e.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-900/50",children:e.jsxs(S.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-[2rem] p-6 max-w-xs w-full text-center border-2 border-rose-200 shadow-[0_25px_60px_rgba(0,0,0,0.15)]",children:[e.jsx(S.div,{animate:{scale:[1,1.1,1]},transition:{duration:1,repeat:1/0},className:"text-6xl mb-4",children:e.jsx(Vs,{className:"w-10 h-10 text-rose-500"})}),e.jsx("h2",{className:"text-2xl font-black text-slate-800 mb-3",children:"Out of Lives!"}),e.jsx("p",{className:"text-slate-500 text-sm mb-4",children:"Your hearts have run out. You can wait for them to refill or head back and review your lessons in the meantime."}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2 text-rose-500 font-bold",children:[e.jsx("img",{src:"/icons/quiz_heart.png",alt:"Hearts",className:"w-5 h-5"}),e.jsx("span",{children:"0 / 15 hearts"})]}),e.jsxs("p",{className:"text-slate-400 text-xs mb-4",children:["Next heart in: ",e.jsxs("span",{className:"font-bold text-slate-600",children:[Math.floor(P/6e4),":",Math.floor(P%6e4/1e3).toString().padStart(2,"0")]})," (15 minutes per heart)"]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Me,{onClick:Pt,className:"w-full py-3 bg-rose-500 hover:bg-rose-600 text-white font-bold rounded-full",children:"Exit Quiz"}),e.jsx(Me,{onClick:()=>{o(!1)},className:"w-full py-3 bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold rounded-full",children:"Review Lessons"})]})]})}),document.getElementById("modal-root")),e.jsx(ot,{children:Ge&&N&&e.jsx(S.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{type:"spring",damping:20,stiffness:300},className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[200] pointer-events-none flex flex-col items-center justify-center",children:e.jsxs("div",{className:"bg-white/95 backdrop-blur-xl border border-slate-200 rounded-[2rem] p-6 md:p-8 shadow-[0_30px_80px_rgba(0,0,0,0.15)] flex flex-col items-center min-w-[280px] md:min-w-[320px]",children:[e.jsx("img",{src:"/mascot/modules_avatar.png",alt:"Mascot",className:"w-24 h-24 md:w-32 md:h-32 mb-4 drop-shadow-[0_10px_20px_rgba(0,0,0,0.15)]"}),e.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4 uppercase tracking-widest text-emerald-500",children:"Correct!"}),e.jsxs("div",{className:"flex flex-col items-center gap-3 w-full justify-center",children:[e.jsx("div",{className:"flex items-center gap-2 bg-emerald-500/20 text-emerald-400 px-4 py-2 rounded-full font-bold border border-emerald-500/30",children:e.jsxs("span",{children:["+ ",(ee[r]||[]).length>0?5:10," XP"]})}),Pe==="streak"&&e.jsxs("div",{className:"flex items-center gap-2 bg-orange-500/20 text-orange-400 px-4 py-1.5 rounded-full text-sm font-bold border border-orange-500/30",children:[e.jsx(rs,{size:14})," Streak Started!"]}),Pe==="multiplier2"&&e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-1.5 rounded-full text-sm font-bold border border-amber-500/30",children:[e.jsx(Xe,{size:14})," Multiplier ×2!"]}),Pe==="multiplier3"&&e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-1.5 rounded-full text-sm font-bold border border-amber-500/30",children:[e.jsx(Xe,{size:14})," Multiplier ×3!"]})]})]})},"round-result")}),e.jsxs("div",{className:"fixed inset-0 z-[100] h-screen w-full flex flex-col bg-slate-50 overflow-hidden",children:[e.jsxs("header",{className:"relative shrink-0 flex flex-col items-center justify-start px-4 pt-4 sm:pt-6 pb-6 z-[60] shadow-md overflow-hidden bg-gradient-to-r from-purple-600 to-indigo-400 rounded-b-[32px] sm:rounded-b-[40px] min-h-[110px] sm:min-h-[130px]",children:[e.jsxs("div",{className:"absolute inset-0 z-0 pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 w-64 h-64 bg-white opacity-10 rounded-full -translate-x-1/2 -translate-y-1/2 blur-2xl"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-80 h-80 bg-white opacity-10 rounded-full translate-x-1/3 translate-y-1/3 blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-7xl flex items-center justify-between relative z-10 mb-3 sm:mb-4 md:mb-6",children:[e.jsx("div",{className:"flex-1 flex items-center gap-1 sm:gap-2",children:e.jsxs("div",{className:"flex items-center gap-1 bg-white/20 px-2 py-1 sm:px-3 sm:py-1.5 rounded-full text-white text-xs sm:text-sm font-bold",children:[e.jsx(Nt,{size:14,className:"shrink-0"})," ",$r(_e)]})}),e.jsxs("div",{className:"relative flex items-center justify-center bg-purple-900/40 backdrop-blur-md px-2 sm:px-5 md:px-8 py-2 sm:py-3 rounded-full border border-white/10 gap-1.5 sm:gap-3 md:gap-4 shadow-inner",children:[e.jsx("div",{className:"hidden sm:block w-3 h-3 md:w-4 md:h-4 rounded-full bg-yellow-400 shrink-0 shadow-[0_0_10px_rgba(250,204,21,0.6)]"}),e.jsxs("div",{className:"flex flex-col items-start justify-center",children:[e.jsx("span",{className:"hidden sm:block text-[9px] md:text-[11px] font-black text-purple-200 uppercase tracking-widest leading-none mb-0.5",children:"Try It Yourself!"}),e.jsx("span",{className:"font-bold text-white tracking-wide text-xs sm:text-sm md:text-lg leading-none truncate max-w-[90px] sm:max-w-[180px] md:max-w-[300px]",children:t.title||t.subject})]})]}),e.jsxs("div",{className:"flex-1 flex justify-end gap-1 sm:gap-2 md:gap-3 relative pointer-events-auto",children:[e.jsxs("button",{onClick:()=>Z(!$),className:"w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 rounded-full bg-purple-900/20 text-white flex items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:[$?e.jsx(es,{size:16,className:"sm:hidden"}):e.jsx(ts,{size:16,className:"sm:hidden"}),$?e.jsx(es,{size:20,className:"hidden sm:block"}):e.jsx(ts,{size:20,className:"hidden sm:block"})]}),e.jsx("button",{onClick:Ot,className:"hidden sm:flex w-10 h-10 md:w-12 md:h-12 rounded-full bg-purple-900/20 text-white items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:le?e.jsx(Us,{size:20}):e.jsx(Gs,{size:20})}),e.jsxs("button",{onClick:()=>X(!0),className:"w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 rounded-full bg-purple-900/20 text-white flex items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:[e.jsx(Je,{size:18,className:"sm:hidden"}),e.jsx(Je,{size:20,className:"hidden sm:block"})]})]})]}),e.jsx("div",{className:"w-full max-w-[50rem] flex items-center justify-center px-4 z-10",children:e.jsx("div",{className:"w-full flex items-center gap-2 sm:gap-3",children:xe.map((v,w)=>{let V=w<=r?"bg-white shadow-[0_0_8px_rgba(255,255,255,0.8)]":"bg-white/20";return e.jsx("div",{className:`h-1.5 sm:h-2 rounded-full flex-1 transition-all ${V}`},w)})})})]}),e.jsxs("div",{className:"w-full max-w-[54rem] mx-auto shrink-0 flex items-center justify-between px-2 sm:px-4 md:px-6 py-2 sm:py-3 z-[50] relative mt-4 sm:mt-6 md:mt-8",children:[e.jsxs("button",{onClick:()=>me(v=>Math.max(0,v-1)),disabled:q===0,className:`w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 shrink-0 rounded-full flex items-center justify-center shadow-md border-2 transition-all ${q===0?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-white text-purple-600 border-purple-100 hover:bg-purple-50 hover:border-purple-200 hover:scale-105 active:scale-95"}`,children:[e.jsx(ss,{size:18,className:"sm:hidden"}),e.jsx(ss,{size:24,className:"hidden sm:block"})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1.5 sm:gap-3 md:gap-5 flex-1 mx-1 sm:mx-2",children:[e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 md:gap-3 px-2.5 sm:px-5 md:px-10 py-1.5 sm:py-2 rounded-full bg-white shadow-md border border-slate-200/60 text-rose-500 font-extrabold text-xs sm:text-sm md:text-base",children:[e.jsx("img",{src:"/icons/quiz_heart.png",alt:"Hearts",className:"w-4 h-4 sm:w-5 sm:h-5 object-contain"})," ",rt]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 md:gap-3 px-2.5 sm:px-5 md:px-10 py-1.5 sm:py-2 rounded-full bg-white shadow-md border border-slate-200/60 text-yellow-500 font-extrabold text-xs sm:text-sm md:text-base",children:[e.jsx("img",{src:"/icons/quiz_key.png",alt:"Keys",className:"w-4 h-4 sm:w-5 sm:h-5 object-contain"})," ",ce]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-3 md:gap-4 px-2 sm:px-3 py-1 sm:py-1.5 pl-2.5 sm:pl-4 md:pl-6 rounded-full bg-white shadow-md border border-slate-200/60",children:[e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 text-orange-500 font-extrabold text-xs sm:text-sm md:text-base",children:[e.jsx("img",{src:"/icons/quiz_streak.png",alt:"Streak",className:"w-4 h-4 sm:w-5 sm:h-5 object-contain"})," ",_]}),e.jsxs("div",{className:"bg-emerald-100 text-emerald-800 px-2 sm:px-3 md:px-4 py-1 sm:py-1.5 rounded-full font-bold text-xs sm:text-sm md:text-base shadow-inner border border-emerald-200/50 whitespace-nowrap",children:["+ ",Te," pts"]})]})]}),e.jsxs("button",{onClick:()=>me(v=>Math.min(r,v+1)),disabled:q>=r,className:`w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 shrink-0 rounded-full flex items-center justify-center shadow-md border-2 transition-all ${q>=r?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-white text-purple-600 border-purple-100 hover:bg-purple-50 hover:border-purple-200 hover:scale-105 active:scale-95"}`,children:[e.jsx(it,{size:18,className:"sm:hidden"}),e.jsx(it,{size:24,className:"hidden sm:block"})]})]}),e.jsx("main",{className:"flex-1 overflow-y-auto w-full px-4 sm:px-6 pt-0 pb-6 flex flex-col items-center relative z-10",children:e.jsxs(S.div,{initial:{opacity:0,x:20},animate:St?{x:[-10,10,-10,10,0],scale:[1,1.01,1],opacity:1}:{opacity:1,x:0},className:"w-full max-w-3xl flex flex-col mt-2",children:[e.jsxs("div",{className:"bg-white rounded-3xl shadow-lg border-t-[6px] border-purple-500 p-4 sm:p-6 md:p-8 text-center flex flex-col items-center mb-4 sm:mb-6 w-full relative overflow-hidden",children:[e.jsxs("div",{className:"bg-slate-100 text-slate-600 px-3 sm:px-4 py-1 sm:py-1.5 rounded-full text-[10px] sm:text-[11px] md:text-xs font-black uppercase tracking-widest mb-3 sm:mb-4 flex items-center shadow-sm",children:["Q",q+1," of ",xe.length]}),e.jsx("h2",{className:"text-base sm:text-xl md:text-2xl font-extrabold text-[#0a1628] leading-tight w-full",children:J.question.includes("___")?e.jsx("span",{children:J.question.split("___").map((v,w,V)=>e.jsxs(je.Fragment,{children:[v,wu(R.target.value),onKeyDown:R=>{R.key==="Enter"&&!p&&dt()},className:`inline-block w-24 mx-2 border-b-4 outline-none text-center bg-transparent font-bold ${L?"border-slate-300 text-slate-500":"border-[#7C3AED] text-[#7C3AED] focus:border-[#75D06A]"}`})]},w))}):J.question})]}),e.jsxs("div",{className:"w-full flex flex-col items-center",children:[J.questionType==="multiple_choice"||!J.questionType?e.jsx("div",{className:"w-full grid grid-cols-1 sm:grid-cols-2 gap-2.5 sm:gap-3 md:gap-5",children:(J.options||[]).map((v,w)=>{const V=ee[r]||[],R=V.includes(v),H=V.length,Ce=(J.options||[]).length-1,Ie=Ce>0&&H>=Ce;let ye="bg-white hover:bg-slate-50 border-transparent text-slate-700 hover:border-slate-200",ze=!1;if(Ie){ze=!0;const we=J.options?.[J.correctAnswer];v===we?ye="bg-emerald-50 border-emerald-400 text-emerald-800":C[q]?.answer===String(w)?ye="bg-rose-50 border-rose-400 text-rose-800 opacity-80":ye="bg-slate-100 border-slate-200 text-slate-400 opacity-40 line-through"}else if(R)ye="bg-slate-100 border-slate-200 text-slate-400 opacity-40 line-through cursor-not-allowed";else if(L){const we=w===J.correctAnswer,pe=q===r&&(x===w||ve===w)||q{ze||L||R||Mt(w)},className:`p-3 sm:p-4 md:p-5 rounded-2xl shadow-sm border-[3px] font-extrabold text-sm sm:text-base md:text-lg text-left transition-all flex items-center justify-between ${ye} ${ze||L||R?"cursor-default":"hover:shadow-md hover:-translate-y-0.5 active:translate-y-0"}`,children:[e.jsx("span",{className:"truncate pr-4",children:v}),R&&e.jsx(Ut,{size:20,className:"text-slate-400 shrink-0"}),L&&w===J.correctAnswer&&e.jsx(ft,{size:22,className:"text-emerald-500 shrink-0"}),L&&x===w&&w!==J.correctAnswer&&e.jsx(Ut,{size:22,className:"text-rose-500 shrink-0"})]},w)})}):e.jsx("div",{className:"w-full max-w-2xl mx-auto flex flex-col gap-4",children:!J.question.includes("___")&&e.jsx("input",{type:"text",disabled:L,value:q===r?M:"",onChange:v=>u(v.target.value),onKeyDown:v=>{v.key==="Enter"&&!p&&dt()},placeholder:"Type your answer here...",className:`w-full p-3 sm:p-4 md:p-5 rounded-2xl border-[3px] font-extrabold text-base sm:text-lg text-center outline-none transition-colors ${L?N?"border-emerald-400 text-emerald-700 bg-emerald-50":"border-rose-400 text-rose-700 bg-rose-50":"border-slate-200 focus:border-[#7C3AED] bg-white text-slate-800"}`})}),L&&y&&e.jsxs("div",{className:"w-full max-w-3xl mt-6 flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:J.topic||t?.subject||"General Math"}),e.jsxs("p",{className:"text-sm text-slate-500",children:["Question ",q+1," Explanation"]})]}),e.jsx("img",{src:"/icons/default-module-avatar.png",alt:"Module Avatar",className:"w-12 h-12 rounded-full object-cover border-2 border-slate-200"})]}),L&&y&&e.jsx(S.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"w-full mt-4 space-y-4 max-w-3xl",children:e.jsxs("div",{className:`border-2 rounded-2xl p-5 flex items-start gap-4 ${(q===r?N:C[q]?.correct)?"bg-emerald-50 border-emerald-200":"bg-rose-50 border-rose-200"}`,children:[(q===r?N:C[q]?.correct)?e.jsx(ft,{size:28,className:"text-emerald-500 shrink-0 mt-0.5"}):e.jsx(Ut,{size:28,className:"text-rose-500 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:`font-extrabold text-lg mb-1 ${(q===r?N:C[q]?.correct)?"text-emerald-700":"text-rose-700"}`,children:(q===r?N:C[q]?.correct)?"Correct!":"Incorrect"}),e.jsx("p",{className:`text-base leading-relaxed ${(q===r?N:C[q]?.correct)?"text-emerald-800":"text-rose-800"}`,children:J.explanation||`Correct Answer: ${J.correctAnswerText||J.options?.[J.correctAnswer]}`})]})]})})]})]},q)}),e.jsx("footer",{className:"shrink-0 relative z-[60] flex flex-col items-center justify-center p-4 sm:p-6 bg-gradient-to-r from-purple-600 to-indigo-400 rounded-t-[32px] sm:rounded-t-[40px] shadow-[0_-10px_40px_rgba(0,0,0,0.15)]",children:(()=>{const v=(ee[r]||[]).length,w=(ne.options||[]).length-1,V=w>0&&v>=w;return V||L&&!N?e.jsxs("button",{onClick:nt,className:"bg-orange-500 hover:bg-orange-600 text-white font-extrabold text-sm sm:text-base md:text-lg px-5 sm:px-8 py-3 sm:py-4 rounded-full flex items-center justify-center gap-2 sm:gap-3 shadow-xl hover:scale-[1.02] active:scale-[0.98] transition-all w-full max-w-md mx-auto",children:[r{const H=zt>0&&!p&&!V;return e.jsxs("button",{onClick:Lt,disabled:!H,className:"bg-white hover:bg-slate-50 disabled:opacity-70 disabled:cursor-not-allowed text-slate-700 font-bold px-4 sm:px-6 md:px-8 py-2.5 sm:py-3 md:py-3.5 rounded-full flex items-center gap-1.5 sm:gap-2 text-sm sm:text-base shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx("img",{src:"/icons/quiz_key.png",alt:"Key",className:"w-4 h-4 sm:w-5 sm:h-5 object-contain"})," Hint"]})})(),L&&e.jsxs("button",{onClick:()=>W(!0),className:"bg-white hover:bg-slate-50 text-slate-700 font-bold px-4 sm:px-6 md:px-8 py-2.5 sm:py-3 md:py-3.5 rounded-full flex items-center gap-1.5 sm:gap-2 text-sm sm:text-base shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx(Fe,{size:16,className:"sm:hidden"}),e.jsx(Fe,{size:20,className:"hidden sm:block"})," Explain"]}),e.jsx("button",{onClick:()=>A(H=>!H),className:`w-11 h-11 sm:w-12 sm:h-12 rounded-full flex items-center justify-center shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200 ${h?"bg-purple-100 text-purple-600 border-purple-300":"bg-white hover:bg-slate-50 text-slate-700"}`,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),e.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"}),e.jsx("path",{d:"M16 10h.01"}),e.jsx("path",{d:"M12 10h.01"}),e.jsx("path",{d:"M8 10h.01"}),e.jsx("path",{d:"M12 14h.01"}),e.jsx("path",{d:"M8 14h.01"}),e.jsx("path",{d:"M12 18h.01"}),e.jsx("path",{d:"M8 18h.01"}),e.jsx("line",{x1:"16",x2:"16",y1:"14",y2:"18"})]})})]}):qme(r),className:"bg-white text-slate-700 font-extrabold text-sm sm:text-base md:text-lg px-4 sm:px-6 md:px-8 py-2.5 sm:py-3 md:py-4 rounded-full inline-flex items-center gap-1.5 sm:gap-2 md:gap-3 shadow-lg hover:bg-slate-50 transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx(it,{size:16,className:"sm:hidden"}),e.jsx(it,{size:20,className:"hidden sm:block"}),"Back to Current Question"]}):null})()})]}),T&&e.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:e.jsxs(S.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-2xl p-6 w-full max-w-[320px] shadow-2xl border border-slate-200 flex flex-col items-center gap-4",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 text-center",children:"Leave this quiz?"}),e.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Your progress will be reset and you'll need to start over."}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("button",{onClick:()=>X(!1),className:"w-full py-3 bg-[#9956DE] hover:bg-[#8544c7] text-white font-bold rounded-full transition-colors",children:"Stay"}),e.jsx("button",{onClick:()=>{X(!1),s()},className:"w-full py-3 bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold rounded-full transition-colors",children:"Leave Quiz"})]})]})})]})};function Ir(t,s){const n={"Pre-Calculus":["What is the domain of the function f(x) = √(x - 2)?","Solve for x: 2^x = 16","What is the period of the function y = sin(2x)?","Find the inverse of f(x) = 3x + 5","What is the value of log₂(32)?","Simplify: (x² - 9) / (x - 3)","What is the range of f(x) = |x| - 3?","If f(x) = 2x + 1 and g(x) = x², find f(g(2)).","What is the amplitude of y = 3cos(x)?","Solve: log₃(x) = 4"],"General Mathematics":["Simplify: (2x + 3)(x - 4)","What is 15% of 240?","Solve: 3x + 7 = 22","What is the value of 5! (5 factorial)?","Convert 0.75 to a fraction","What is 25% of 360?","Simplify: 12/18","What is the GCD of 24 and 36?","Convert 3/8 to a decimal","If a shirt costs $40 and is 20% off, what is the sale price?","What is 2/3 + 1/4?","Calculate: 15% tip on a $80 bill","Simplify: 45/60","What fraction is equivalent to 0.125?","If 30% of a number is 45, what is the number?"],"Statistics and Probability":["What is the probability of rolling a 6 on a fair die?","Calculate the mean of: 4, 7, 9, 12, 15","What is the median of: 2, 5, 8, 11, 14?","In a bag with 5 red and 3 blue balls, what is P(red)?","What is the range of: 10, 15, 20, 25, 30?","What is the mode of: 3, 5, 5, 7, 8, 5, 9?","What is the standard deviation concept?","P(A) = 0.3, P(B) = 0.5, events independent. P(A and B) = ?","What is the median of: 4, 7, 10, 13?","How many ways can you arrange 3 books?"],"Basic Calculus":["Find the derivative of f(x) = 3x²","What is the limit of (x² - 4)/(x - 2) as x → 2?","Integrate: ∫ 2x dx","Find f'(x) if f(x) = 5x³ - 2x","What is the derivative of sin(x)?","Find the derivative of f(x) = eˣ + 3x","What is ∫ cos(x) dx?","Find the derivative of f(x) = ln(x)","What is the limit of 1/x as x → ∞?","Find f'(x) if f(x) = x⁴ - 2x² + 1"]},i=Ht(t),l=n[i]||n["General Mathematics"];return l[s%l.length]}function Ht(t){const s=t.toLowerCase();return s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("statistic")||s.includes("probability")?"Statistics and Probability":s.includes("calculus")&&!s.includes("pre")?"Basic Calculus":s.includes("general")||s.includes("math")||s.includes("algebra")||s.includes("fraction")||s.includes("percent")||s.includes("ratio")||s.includes("geometry")?"General Mathematics":s.includes("derivative")||s.includes("integral")||s.includes("limit")?"Basic Calculus":s.includes("trig")||s.includes("function")||s.includes("log")?"Pre-Calculus":s.includes("mean")||s.includes("median")||s.includes("data")?"Statistics and Probability":"General Mathematics"}function Dr(t,s){const n={"Pre-Calculus":[["x ≥ 2","x ≤ 2","x ≥ 0","All real numbers"],["x = 2","x = 4","x = 8","x = 16"],["π","2π","π/2","4π"],["f⁻¹(x) = (x - 5)/3","f⁻¹(x) = 3x - 5","f⁻¹(x) = x/3 - 5","f⁻¹(x) = (x + 5)/3"],["4","5","6","7"],["x + 3","x - 3","x² + 3","(x + 3)(x - 3)"],["y ≥ -3","y ≥ 0","All real numbers","y > -3"],["9","5","7","3"],["1","2","3","1/3"],["12","27","64","81"]],"General Mathematics":[["2x² - 5x - 12","2x² + 5x - 12","2x² - 8x + 12","2x² - 5x + 12"],["36","32","28","24"],["x = 5","x = 4","x = 6","x = 7"],["120","24","60","720"],["3/4","1/2","2/3","4/5"],["90","80","100","72"],["2/3","3/4","4/6","6/9"],["12","6","8","4"],["0.375","0.38","0.35","0.325"],["$32","$28","$30","$36"],["11/12","3/7","5/6","2/3"],["$12","$10","$15","$8"],["3/4","2/3","4/5","9/12"],["1/8","1/4","1/5","1/6"],["150","135","120","160"]],"Statistics and Probability":[["1/6","1/3","1/2","2/3"],["9.4","8.5","10.2","7.8"],["8","9","7","10"],["5/8","3/8","1/2","2/5"],["20","15","25","30"],["5","3","7","8"],["Spread of data from the mean","The highest value","The average","The middle value"],["0.15","0.8","0.35","0.2"],["8.5","7","10","9"],["6","3","9","12"]],"Basic Calculus":[["6x","3x","9x²","6x²"],["4","2","0","undefined"],["x² + C","2x² + C","x²/2 + C","2x + C"],["15x² - 2","15x² - 2x","5x² - 2","15x - 2"],["cos(x)","-cos(x)","tan(x)","-sin(x)"],["eˣ + 3","eˣ + 3x","xeˣ + 3","eˣ"],["sin(x) + C","-sin(x) + C","tan(x) + C","-cos(x) + C"],["1/x","x","ln(x)","-1/x²"],["0","1","∞","undefined"],["4x³ - 4x","4x³ - 2x","x³ - 4x","4x⁴ - 4x²"]]},i=Ht(t),l=n[i]||n["General Mathematics"];return l[s%l.length]}function Rr(t,s){const n={"Pre-Calculus":[0,1,0,0,1,0,0,0,2,3],"General Mathematics":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Statistics and Probability":[0,0,0,0,0,0,0,0,0,0],"Basic Calculus":[0,0,0,0,0,0,0,0,0,0]},i=Ht(t),l=n[i]||n["General Mathematics"];return l[s%l.length]}function Fr(t,s,n){const i={"Pre-Calculus":["The expression under the square root must be non-negative: x - 2 ≥ 0, so x ≥ 2.","Since 2⁴ = 16, we get x = 4.","The period of sin(kx) is 2π/k. Here k = 2, so period = 2π/2 = π.","To find the inverse: y = 3x + 5 → x = 3y + 5 → y = (x - 5)/3.","Since 2⁵ = 32, log₂(32) = 5.","(x² - 9)/(x - 3) = (x+3)(x-3)/(x-3) = x + 3 (for x ≠ 3).","The absolute value |x| ≥ 0 for all x, so |x| - 3 ≥ -3. The range is y ≥ -3.","g(2) = 4, then f(4) = 2(4) + 1 = 9.","The amplitude of y = Acos(x) is |A|. Here A = 3, so amplitude = 3.","log₃(x) = 4 means 3⁴ = x, so x = 81."],"General Mathematics":["(2x + 3)(x - 4) = 2x² - 8x + 3x - 12 = 2x² - 5x - 12","15% of 240 = 0.15 × 240 = 36","3x + 7 = 22 → 3x = 15 → x = 5","5! = 5 × 4 × 3 × 2 × 1 = 120","0.75 = 75/100 = 3/4 after simplifying by dividing both by 25","25% of 360 = 0.25 × 360 = 90","12/18 = (12÷6)/(18÷6) = 2/3","Factors of 24: {1,2,3,4,6,8,12,24}. Factors of 36: {1,2,3,4,6,9,12,18,36}. GCD = 12","3 ÷ 8 = 0.375","20% off $40 = $40 × 0.80 = $32","2/3 + 1/4 = 8/12 + 3/12 = 11/12","15% of $80 = 0.15 × 80 = $12","45/60 = (45÷15)/(60÷15) = 3/4","0.125 = 125/1000 = 1/8","30% × N = 45 → N = 45/0.30 = 150"],"Statistics and Probability":["A fair die has 6 outcomes, each equally likely. P(6) = 1/6.","Mean = (4 + 7 + 9 + 12 + 15) / 5 = 47/5 = 9.4","Sorted: 2, 5, 8, 11, 14. The middle value is 8.","P(red) = 5/(5+3) = 5/8","Range = max - min = 30 - 10 = 20","The value 5 appears 3 times, more than any other value. Mode = 5.","Standard deviation measures how spread out data points are from the mean.","For independent events: P(A and B) = P(A) × P(B) = 0.3 × 0.5 = 0.15","For even-count dataset {4,7,10,13}: median = (7+10)/2 = 8.5","3 books can be arranged in 3! = 3 × 2 × 1 = 6 ways."],"Basic Calculus":["Using the power rule: d/dx[3x²] = 3 × 2x = 6x","Factor: (x²-4)/(x-2) = (x+2)(x-2)/(x-2) = x+2. As x→2: 2+2 = 4","∫ 2x dx = 2 × x²/2 + C = x² + C","f'(x) = 5 × 3x² - 2 = 15x² - 2","The derivative of sin(x) is cos(x). This is a fundamental trigonometric derivative.","d/dx[eˣ + 3x] = eˣ + 3. The derivative of eˣ is eˣ and of 3x is 3.","∫ cos(x) dx = sin(x) + C. Integration is the reverse of differentiation.","The derivative of ln(x) is 1/x. This is a fundamental logarithmic derivative.","As x → ∞, 1/x approaches 0. The function gets infinitely close to zero.","f'(x) = 4x³ - 4x using the power rule on each term."]},l=Ht(t),c=i[l]||i["General Mathematics"];return c[s%c.length]}function $r(t){const s=Math.floor(t/60),n=t%60;return`${s}:${n.toString().padStart(2,"0")}`}const Ts=({value:t,label:s,delay:n=0,icon:i})=>{const[l,c]=je.useState(0);return je.useEffect(()=>{if(t<=0)return;const r=1e3,d=30,x=Math.abs(Math.floor(r/d));let f=0;const M=setTimeout(()=>{const u=setInterval(()=>{f+=Math.max(1,Math.floor(t/d)),f>=t?(c(t),clearInterval(u)):c(f)},x);return()=>clearInterval(u)},n);return()=>clearTimeout(M)},[t,n]),t<0?null:e.jsxs(S.div,{initial:{opacity:0,transform:"translateX(-20px)"},animate:{opacity:1,transform:"translateX(0)"},transition:{delay:n/1e3,duration:.5},className:"flex items-center justify-between bg-slate-50 border border-slate-100 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-slate-500 font-bold uppercase tracking-wider text-[10px]",children:[i,s]}),e.jsxs("div",{className:"text-xl font-black text-purple-600 tabular-nums",children:["+",l]})]})},Br=({viewportHeight:t})=>{const s=je.useMemo(()=>[...Array(40)].map((n,i)=>({id:i,left:`${Math.random()*100}%`,duration:.6+Math.random()*.4,delay:Math.random()*.4})),[t]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden flex justify-between",children:s.map(n=>e.jsx(S.div,{className:"absolute w-0.5 h-16 bg-blue-400/40 rounded-full",style:{left:n.left,top:"-10%"},animate:{y:[0,t*1.2]},transition:{duration:n.duration,ease:"linear",delay:n.delay}},n.id))})},Hr=({viewportHeight:t,viewportWidth:s})=>{const n=je.useMemo(()=>[...Array(30)].map((i,l)=>({id:l,xShift:(Math.random()-.5)*s*.8,yShift:(Math.random()-.5)*t*.8,scale:Math.random()*1.5+.5,duration:2+Math.random()*1.5,delay:Math.random()*.35})),[t,s]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden flex items-center justify-center",children:n.map(i=>e.jsx(S.div,{className:"absolute w-2 h-2 bg-amber-400 rounded-full shadow-[0_0_10px_rgba(251,191,36,0.6)]",style:{left:"50%",top:"50%"},animate:{y:[0,i.yShift],x:[0,i.xShift],scale:[0,i.scale,0],opacity:[0,1,0]},transition:{duration:i.duration,ease:"easeOut",delay:i.delay}},i.id))})},qr=()=>{const t=je.useMemo(()=>[...Array(60)].map((s,n)=>({id:n,left:`${Math.random()*100}%`,backgroundColor:["#75D06A","#6ED1CF","#9956DE","#FB96BB","#FFB356"][n%5],duration:2+Math.random()*2,delay:Math.random()*.5,size:6+Math.random()*8,borderRadius:Math.random()>.5?"50%":"2px"})),[]);return e.jsxs("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden",children:[e.jsx("style",{children:` + @keyframes confetti-fall { + 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; } + 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } + } + .confetti-piece { + animation-name: confetti-fall; + animation-timing-function: linear; + animation-fill-mode: forwards; + } + `}),t.map(s=>e.jsx("div",{className:"confetti-piece absolute",style:{left:s.left,top:"-10%",backgroundColor:s.backgroundColor,width:s.size,height:s.size,borderRadius:s.borderRadius,animationDuration:`${s.duration}s`,animationDelay:`${s.delay}s`}},s.id))]})},Or=({lesson:t,questions:s,onComplete:n,onBack:i})=>{const[l,c]=a.useState(0),[r,d]=a.useState(0),[x,f]=a.useState(null),[M,u]=a.useState(""),[N,m]=a.useState(!1),[p,k]=a.useState(!1),[y,W]=a.useState(0),[j,E]=a.useState(0),[_,D]=a.useState(0),[b,I]=a.useState(!1),[B,se]=a.useState([]),[C,re]=a.useState(!1),[ge,Oe]=a.useState(!1),[oe,Qe]=a.useState(null),[Se,G]=a.useState(null),[ve,We]=a.useState(!1),[_e,Ve]=a.useState(!1),[$e,Ue]=a.useState(!1),[h,A]=a.useState(!1),[T,X]=a.useState(!1),[$,Z]=a.useState(typeof window<"u"?window.innerHeight:800),[le,Ae]=a.useState(typeof window<"u"?window.innerWidth:1200),[fe,be]=a.useState([]),[Te]=a.useState(Date.now()),[F,ee]=a.useState(0),[ue,Be]=a.useState(!1),[st,St]=a.useState(!0),[bt,Ge]=a.useState(!1),[Ct,Ne]=a.useState(!1),[ce,at]=a.useState(!1),[rt,ct]=a.useState(!1),[zt,He]=a.useState(0),[Ye,Ke]=a.useState({}),[o,P]=a.useState(5),[Q,de]=a.useState(15),[U,q]=a.useState(null),[me,Pe]=a.useState(!1),[Ee,xe]=a.useState(900*1e3),[ne,Le]=a.useState({}),[gt,Ze]=a.useState({}),[ke,Pt]=a.useState(!1),[Lt,Mt]=a.useState(!1),[dt,nt]=a.useState(null),[qt]=a.useState(Array.from({length:15},(g,z)=>({id:z,size:Math.random()*120+60,x:Math.random()*100,y:Math.random()*100,duration:Math.random()*25+15,delay:Math.random()*-20,color:["bg-white/5","bg-indigo-300/10","bg-sky-300/10","bg-purple-300/10"][Math.floor(Math.random()*4)]}))),L=s[r],J=r{if(st)try{const z=window.AudioContext||window.webkitAudioContext;if(!z)return;const O=new z,K=O.currentTime,he=(te,Y,ie,De=.1,yt="sine")=>{const lt=O.createOscillator(),xt=O.createGain();lt.type=yt,lt.frequency.value=te,xt.gain.setValueAtTime(0,Y),xt.gain.linearRampToValueAtTime(De,Y+.05),xt.gain.exponentialRampToValueAtTime(.001,Y+ie),lt.connect(xt),xt.connect(O.destination),lt.start(Y),lt.stop(Y+ie)};g==="correct"?(he(880,K,.1,.1,"sine"),he(1108.73,K+.1,.2,.1,"sine")):g==="incorrect"?(he(300,K,.2,.05,"sawtooth"),he(250,K+.15,.3,.05,"sawtooth")):g==="streak"?(he(440,K,.1,.05,"square"),he(554.37,K+.1,.1,.05,"square"),he(659.25,K+.2,.1,.05,"square"),he(880,K+.3,.4,.05,"square")):g==="complete"&&(he(523.25,K,.1,.1),he(659.25,K+.15,.1,.1),he(783.99,K+.3,.1,.1),he(1046.5,K+.45,.5,.1))}catch{}};a.useEffect(()=>{const g=()=>{Z(window.innerHeight),Ae(window.innerWidth)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),a.useEffect(()=>{if(L?.type==="multiple-choice"&&L.options){const g=L.options.map((z,O)=>({id:`${L.id}-${O}`,text:z}));for(let z=g.length-1;z>0;z--){const O=Math.floor(Math.random()*(z+1));[g[z],g[O]]=[g[O],g[z]]}se(g)}else se([])},[l,L]),a.useEffect(()=>{Ne(!1),at(!1)},[l]);const V=()=>{document.fullscreenElement?(document.exitFullscreen().catch(()=>{}),Ge(!1)):(document.documentElement.requestFullscreen().catch(()=>{}),Ge(!0))},R=()=>at(g=>!g);a.useEffect(()=>{const g=z=>{z.key==="Enter"&&(!N&&H()?ye():N&&ze())};return window.addEventListener("keypress",g),()=>window.removeEventListener("keypress",g)},[N,x,M]),a.useEffect(()=>{Q===0&&!U&&(q(Date.now()),Pe(!0))},[Q,U]),a.useEffect(()=>{if(!me||!U)return;const g=setInterval(()=>{const z=Date.now()-U,O=Math.max(0,900*1e3-z);xe(O)},1e3);return()=>clearInterval(g)},[me,U]);const H=()=>L.type==="fill-in-blank"?M.trim().length>0:x!==null,Ce=()=>{if(o<=0||N||ne[l]||ce)return;const g=Ye[l]||[],z=B.filter(K=>K.text!==L.correctAnswer).filter(K=>!g.includes(K.text));if(z.length===0)return;const O=z[Math.floor(Math.random()*z.length)];Ke(K=>({...K,[l]:[...g,O.text]})),P(K=>Math.max(0,K-1)),He(K=>Math.max(0,K-5)),w("correct")},Ie=()=>{ne[l]||N||ce||(Le(g=>({...g,[l]:!0})),Ne(!0))},ye=g=>{if(C||rie.id===x);O=Y?Y.text:""}else{re(!1);return}z=O===L.correctAnswer}if(!z){Pt(!0),w("incorrect"),setTimeout(()=>Pt(!1),500),de(ie=>Math.max(0,ie-1)),E(0);const Y=[...gt[l]||[],O];if(Ze(ie=>({...ie,[l]:Y})),L.type==="multiple-choice"||L.type==="true-false"){const ie=L.options?L.options.length-1:1;Y.length>=ie&&(k(!1),m(!0),be(De=>{const yt=[...De];return yt[r]=!1,yt}))}else Y.length>=3&&(k(!1),m(!0),be(ie=>{const De=[...ie];return De[r]=!1,De}));re(!1);return}k(!0),m(!0),be(Y=>{const ie=[...Y];return ie[r]=!0,ie});const he=(Ye[l]||[]).length>0?5:10;He(Y=>Y+he),W(Y=>Y+1);const te=j+1;if(E(te),D(Math.max(_,te)),te===2?nt("streak"):te===3&&xs<2?nt("multiplier2"):te===5&&xs<3&&nt("multiplier3"),te>0&&te%3===0){const Y=te*5;ee(ie=>ie+Y),w("streak")}else w("correct");ct(!0),setTimeout(()=>{ct(!1),nt(null),setTimeout(()=>ze(),500)},1200),Ft(()=>import("./confetti.module-C94ZD2ww.js"),[]).then(Y=>{Y.default({particleCount:30,spread:40,colors:["#75D06A","#6ED1CF"],origin:{y:.6}})}).finally(()=>re(!1))},ze=()=>{lg+1),d(g=>g+1),m(!1),f(null),u(""),k(!1)):we()},we=()=>{const g=Math.round(y/s.length*100);I(!0),g>=80||(g>=50?(A(!0),setTimeout(()=>A(!1),5e3)):(Ue(!0),setTimeout(()=>Ue(!1),5e3))),w("complete")},pe=v==="quiz"?{gradient:"bg-gradient-to-br from-[#7274ED] via-[#9956DE] to-[#7274ED]"}:{gradient:"bg-gradient-to-br from-[#75D06A] via-[#6ED1CF] to-[#75D06A]"},Qt=(()=>{const g=Ot.toLowerCase();return g.includes("geometry")||g.includes("shape")?[Ms,Ns,zs,js,pr,fr]:g.includes("algebra")||g.includes("equation")?[Je,Gt,vs,Xt,wt,Ss]:g.includes("calculus")||g.includes("derivative")||g.includes("integral")?[Cs,Xt,At,wt,Gt,vs]:g.includes("statistics")||g.includes("probability")?[et,At,js,Ns,Ms,zs]:[wt,Cs,Gt,Ss,Xt,Oa]})();Qt[0];const xs=Math.min(2,1+j*.1);if(b){const g=Math.round(y/s.length*100),z=g>=80,O=g>=50&&g<80,K=v==="quiz"?100:50,he=Math.round(y/s.length*100),te=K+he+F,Y=document.getElementById("modal-root"),ie=e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-900/40",children:[h&&e.jsx(Hr,{viewportHeight:$,viewportWidth:le}),$e&&e.jsx(Br,{viewportHeight:$}),z&&e.jsx(qr,{}),e.jsxs(S.div,{initial:{opacity:0,scale:.8,y:40},animate:{opacity:1,scale:1,y:0},transition:{type:"spring",damping:18,stiffness:200},className:"w-full max-w-xs sm:max-w-sm bg-white border-2 border-slate-200 shadow-[0_25px_60px_rgba(0,0,0,0.15)] rounded-[2rem] p-4 sm:p-5 text-center relative z-10",children:[e.jsx(S.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",damping:12,stiffness:150,delay:.2},className:"mb-3",children:e.jsx("img",{src:"/mascot/modules_avatar.png",alt:"Mascot",className:"w-16 h-16 sm:w-20 sm:h-20 mx-auto drop-shadow-xl"})}),e.jsx(S.h2,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},className:`text-xl sm:text-2xl font-black uppercase tracking-tight mb-1 drop-shadow-sm ${z?"text-emerald-500":O?"text-amber-500":"text-rose-500"}`,children:z?"EXCELLENT!":O?"GOOD JOB!":"KEEP TRYING!"}),e.jsxs("p",{className:"text-slate-400 font-bold text-[10px] mb-3 uppercase tracking-widest",children:["Quiz Complete • Score: ",y,"/",s.length]}),e.jsx(S.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"bg-slate-50/50 rounded-xl p-3 mb-4 border border-slate-100 flex flex-col gap-2",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-slate-400 text-[9px] font-black uppercase tracking-widest text-left mb-1.5 ml-1",children:"Performance Details"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ts,{value:y,label:"Correct Answers",delay:500,icon:e.jsx(Rt,{size:14,className:"h-3 w-3 text-emerald-500"})}),e.jsx(Ts,{value:te,label:"Total XP Earned",delay:800,icon:e.jsx(Xe,{size:14,className:"h-3 w-3 text-amber-500"})}),e.jsxs(S.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:1.2,duration:.4},className:"flex items-center justify-between pt-1.5 mt-1 border-t border-slate-100",children:[e.jsx("span",{className:"text-slate-400 text-[9px] font-black uppercase tracking-widest",children:"Final Accuracy"}),e.jsxs("span",{className:"text-lg font-black text-slate-800 tabular-nums",children:[g,"%"]})]})]})]})}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Me,{size:"lg",onClick:()=>{c(0),d(0),f(null),u(""),W(0),E(0),D(0),He(0),be([]),m(!1),k(!1),I(!1),Ke({}),Le({}),Ze({}),X(!1)},className:"w-full h-10 sm:h-11 rounded-2xl text-xs font-black bg-white hover:bg-slate-50 text-purple-600 border-2 border-purple-100",children:"RETAKE QUIZ"}),e.jsx(Me,{size:"lg",onClick:()=>n(g,te),className:"w-full h-10 sm:h-11 rounded-2xl text-xs font-black bg-purple-600 hover:bg-purple-700 text-white shadow-lg shadow-purple-200",children:"BACK TO MODULE"})]})]})]});return vt.createPortal(ie,Y)}return e.jsxs(e.Fragment,{children:[Lt&&vt.createPortal(e.jsx(S.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"fixed right-6 top-1/2 -translate-y-1/2 z-[9999] w-64",children:e.jsxs("div",{className:"bg-white rounded-2xl p-3 border border-slate-200 shadow-[0_10px_40px_rgba(0,0,0,0.2)]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[e.jsxs("h4",{className:"text-xs font-bold text-[#0a1628] flex items-center gap-2",children:[e.jsx(wt,{size:14,className:"text-purple-600"})," Calculator"]}),e.jsx("button",{onClick:()=>Mt(!1),className:"w-6 h-6 rounded-full bg-slate-100 flex items-center justify-center text-slate-500 hover:text-slate-800 hover:bg-slate-200 transition-colors",children:e.jsx(Je,{size:12})})]}),e.jsx(Ws,{isOpen:!0,onClose:()=>Mt(!1),inline:!0})]})}),document.getElementById("modal-root")),me&&vt.createPortal(e.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-900/50",children:e.jsxs(S.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-[2rem] p-6 max-w-xs w-full text-center border-2 border-rose-200 shadow-[0_25px_60px_rgba(0,0,0,0.15)]",children:[e.jsx(S.div,{animate:{scale:[1,1.1,1]},transition:{duration:1,repeat:1/0},className:"text-6xl mb-4",children:e.jsx(Vs,{className:"w-10 h-10 text-rose-500"})}),e.jsx("h2",{className:"text-2xl font-black text-slate-800 mb-3",children:"Out of Lives!"}),e.jsx("p",{className:"text-slate-500 text-sm mb-4",children:"Your hearts have run out. You can wait for them to refill or head back and review your lessons in the meantime."}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2 text-rose-500 font-bold",children:[e.jsx("img",{src:"/icons/quiz_heart.png",alt:"Hearts",className:"w-5 h-5"}),e.jsx("span",{children:"0 / 15 hearts"})]}),e.jsxs("p",{className:"text-slate-400 text-xs mb-4",children:["Next heart in: ",e.jsxs("span",{className:"font-bold text-slate-600",children:[Math.floor(Ee/6e4),":",Math.floor(Ee%6e4/1e3).toString().padStart(2,"0")]})," (15 minutes per heart)"]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Me,{onClick:i,className:"w-full py-3 bg-rose-500 hover:bg-rose-600 text-white font-bold rounded-full",children:"Exit Quiz"}),e.jsx(Me,{onClick:()=>{Pe(!1)},className:"w-full py-3 bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold rounded-full",children:"Review Lessons"})]})]})}),document.getElementById("modal-root")),e.jsxs(ot,{children:[ve&&Se&&e.jsx(S.div,{initial:{y:-20,opacity:0},animate:{y:0,opacity:1},exit:{y:-20,opacity:0},transition:{type:"spring",damping:20,stiffness:300},className:"fixed top-24 left-1/2 -translate-x-1/2 z-[75] pointer-events-none",style:{willChange:"transform, opacity"},children:e.jsx("div",{className:"bg-white/90 px-4 py-2 rounded-2xl shadow-xl font-bold text-sm",children:Se})},"popup"),rt&&e.jsx(S.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{type:"spring",damping:20,stiffness:300},className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[100] pointer-events-none flex flex-col items-center justify-center",children:e.jsxs("div",{className:"bg-white/95 backdrop-blur-xl border border-slate-200 rounded-[2rem] p-6 md:p-8 shadow-[0_30px_80px_rgba(0,0,0,0.15)] flex flex-col items-center min-w-[280px] md:min-w-[320px]",children:[e.jsx("img",{src:"/mascot/modules_avatar.png",alt:"Mascot",className:"w-24 h-24 md:w-32 md:h-32 mb-4 drop-shadow-[0_10px_20px_rgba(0,0,0,0.15)]"}),e.jsx("h2",{className:`text-3xl md:text-4xl font-black mb-4 uppercase tracking-widest ${p?"text-emerald-500":"text-rose-500"}`,children:p?"Correct!":"Incorrect"}),p?e.jsxs("div",{className:"flex flex-col items-center gap-3 w-full justify-center",children:[e.jsx("div",{className:"flex items-center gap-2 bg-emerald-500/20 text-emerald-400 px-4 py-2 rounded-full font-bold border border-emerald-500/30",children:e.jsxs("span",{children:["+ ",(Ye[l]||[]).length>0?5:10," XP"]})}),dt==="streak"&&e.jsxs("div",{className:"flex items-center gap-2 bg-orange-500/20 text-orange-400 px-4 py-1.5 rounded-full text-sm font-bold border border-orange-500/30",children:[e.jsx(rs,{size:14})," Streak Started!"]}),dt==="multiplier2"&&e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-1.5 rounded-full text-sm font-bold border border-amber-500/30",children:[e.jsx(Xe,{size:14})," Multiplier ×2!"]}),dt==="multiplier3"&&e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-1.5 rounded-full text-sm font-bold border border-amber-500/30",children:[e.jsx(Xe,{size:14})," Multiplier ×3!"]})]}):e.jsxs("div",{className:"bg-rose-500/20 border border-rose-500/30 text-rose-400 font-bold px-5 py-2 rounded-xl text-center",children:["Correct: ",L.correctAnswer]})]})},"round-result")]}),e.jsxs("div",{className:"fixed inset-0 z-50 h-screen w-full flex flex-col bg-slate-50 overflow-hidden",children:[e.jsxs("header",{className:`relative shrink-0 flex flex-col items-center justify-start px-4 pt-4 sm:pt-6 pb-6 z-[60] shadow-md overflow-hidden ${pe.gradient} rounded-b-[32px] sm:rounded-b-[40px] min-h-[110px] sm:min-h-[130px]`,children:[e.jsxs("div",{className:"absolute inset-0 z-0 pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 w-64 h-64 bg-white opacity-10 rounded-full -translate-x-1/2 -translate-y-1/2 blur-2xl"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-80 h-80 bg-white opacity-10 rounded-full translate-x-1/3 translate-y-1/3 blur-3xl"}),Qt.map((g,z)=>e.jsx("div",{className:"absolute text-white/10",style:{top:`${10+z*15}%`,left:`${10+z*25%80}%`,transform:`rotate(${z*45}deg) scale(${1+z%3*.2})`},children:e.jsx(g,{size:48+z%2*32})},z))]}),e.jsxs("div",{className:"w-full max-w-7xl flex items-start justify-between relative z-10 mb-4 sm:mb-6",children:[e.jsx("div",{className:"flex-1 pointer-events-none"}),e.jsxs("div",{className:"relative flex items-center justify-center bg-purple-900/40 backdrop-blur-md px-6 sm:px-8 py-3 rounded-full border border-white/10 gap-3 sm:gap-4 shadow-inner",children:[e.jsx("div",{className:"w-3 h-3 sm:w-4 sm:h-4 rounded-full bg-yellow-400 shrink-0 shadow-[0_0_10px_rgba(250,204,21,0.6)]"}),e.jsxs("div",{className:"flex flex-col items-start justify-center",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] font-black text-purple-200 uppercase tracking-widest leading-none mb-1",children:"Try It Yourself!"}),e.jsxs("span",{className:"font-bold text-white tracking-wide text-base sm:text-lg leading-none truncate max-w-[200px] sm:max-w-[300px]",children:["LESSON ",t.id||"1"]})]})]}),e.jsxs("div",{className:"flex-1 flex justify-end gap-2 sm:gap-3 relative pointer-events-auto",children:[e.jsx("button",{onClick:()=>St(!st),className:"w-10 h-10 sm:w-12 sm:h-12 rounded-full bg-purple-900/20 text-white flex items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:st?e.jsx(es,{size:20}):e.jsx(ts,{size:20})}),e.jsx("button",{onClick:V,className:"hidden sm:flex w-10 h-10 sm:w-12 sm:h-12 rounded-full bg-purple-900/20 text-white items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:bt?e.jsx(Us,{size:20}):e.jsx(Gs,{size:20})}),e.jsx("button",{onClick:()=>Be(!0),className:"w-10 h-10 sm:w-12 sm:h-12 rounded-full bg-purple-900/20 text-white flex items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:e.jsx(da,{size:20})})]})]}),e.jsx("div",{className:"w-full max-w-[50rem] flex items-center justify-center px-4 z-10",children:e.jsx("div",{className:"w-full flex items-center gap-2 sm:gap-3",children:s.map((g,z)=>e.jsx("div",{className:`h-1.5 sm:h-2 rounded-full flex-1 transition-all ${z<=l?"bg-white shadow-[0_0_8px_rgba(255,255,255,0.8)]":"bg-white/20"}`},z))})})]}),e.jsx(ot,{children:ue&&e.jsx(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>Be(!1),children:e.jsxs(S.div,{onClick:g=>g.stopPropagation(),initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},className:"bg-white rounded-[2rem] p-6 sm:p-8 max-w-xs w-full shadow-2xl flex flex-col gap-4 text-center",children:[e.jsx("h2",{className:"text-xl font-black text-slate-800",children:"Are you sure you want to leave?"}),e.jsx("p",{className:"text-sm text-slate-500",children:"Your progress won't be saved."}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Me,{onClick:()=>Be(!1),className:"w-full py-3 rounded-full bg-[#9956DE] hover:bg-[#8544c7] text-white font-bold",children:"Stay"}),e.jsx(Me,{onClick:()=>{Be(!1),i()},className:"w-full py-3 rounded-full bg-slate-100 hover:bg-slate-200 text-slate-600 font-bold",children:"Leave"})]})]})})}),e.jsxs("div",{className:"w-full max-w-[54rem] mx-auto shrink-0 flex items-center justify-between px-4 sm:px-6 py-2 sm:py-3 z-[50] relative mt-4",children:[e.jsx("button",{onClick:()=>d(g=>Math.max(0,g-1)),disabled:r===0,className:`w-10 h-10 sm:w-12 sm:h-12 shrink-0 rounded-full flex items-center justify-center shadow-md border-2 transition-all ${r===0?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-white text-purple-600 border-purple-100 hover:bg-purple-50 hover:border-purple-200 hover:scale-105 active:scale-95"}`,children:e.jsx(ss,{size:24})}),e.jsxs("div",{className:"flex items-center justify-center gap-3 sm:gap-5 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 px-8 sm:px-10 py-2 rounded-full bg-white shadow-md border border-slate-200/60 text-rose-500 font-extrabold text-sm sm:text-base",children:[e.jsx("img",{src:"/icons/quiz_heart.png",alt:"Hearts",className:"w-5 h-5 object-contain"}),Q]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 px-8 sm:px-10 py-2 rounded-full bg-white shadow-md border border-slate-200/60 text-yellow-500 font-extrabold text-sm sm:text-base",children:[e.jsx("img",{src:"/icons/quiz_key.png",alt:"Keys",className:"w-5 h-5 object-contain"}),o]}),e.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 px-3 py-1.5 pl-5 sm:pl-6 rounded-full bg-white shadow-md border border-slate-200/60",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-orange-500 font-extrabold text-sm sm:text-base",children:[e.jsx("img",{src:"/icons/quiz_streak.png",alt:"Streak",className:"w-5 h-5 object-contain"})," ",j]}),e.jsxs("div",{className:"bg-emerald-100 text-emerald-800 px-4 py-1.5 rounded-full font-bold text-sm sm:text-base shadow-inner border border-emerald-200/50",children:["+ ",zt," pts"]})]})]}),e.jsx("button",{onClick:()=>d(g=>Math.min(l,g+1)),disabled:r>=l,className:`w-10 h-10 sm:w-12 sm:h-12 shrink-0 rounded-full flex items-center justify-center shadow-md border-2 transition-all ${r>=l?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-white text-purple-600 border-purple-100 hover:bg-purple-50 hover:border-purple-200 hover:scale-105 active:scale-95"}`,children:e.jsx(it,{size:24})})]}),e.jsx("main",{className:"flex-1 overflow-y-auto w-full px-4 sm:px-6 pt-0 pb-6 flex flex-col items-center relative z-10",children:e.jsxs(S.div,{initial:{opacity:0,x:20},animate:ke?{x:[-10,10,-10,10,0],scale:[1,1.01,1],opacity:1}:{opacity:1,x:0},className:"w-full max-w-3xl flex flex-col mt-2",children:[e.jsxs("div",{className:"bg-white rounded-3xl shadow-lg border-t-[6px] border-purple-500 p-6 sm:p-8 text-center flex flex-col items-center mb-6 w-full relative overflow-hidden",children:[(()=>{const z=[{label:"New",color:"bg-blue-100 text-blue-700",icon:e.jsx($s,{size:14,className:"mr-1.5"})},{label:"Learning",color:"bg-amber-100 text-amber-700",icon:e.jsx(At,{size:14,className:"mr-1.5"})},{label:"Retry",color:"bg-rose-100 text-rose-700",icon:e.jsx(Bs,{size:14,className:"mr-1.5"})},{label:"Mastered",color:"bg-emerald-100 text-emerald-700",icon:e.jsx(ns,{size:14,className:"mr-1.5"})}][r%4];return e.jsxs("div",{className:`${z.color} px-4 py-1.5 rounded-full text-[11px] sm:text-xs font-black uppercase tracking-widest mb-6 flex items-center shadow-sm`,children:[z.icon," ",z.label]})})(),e.jsx("h2",{className:"text-xl sm:text-2xl font-extrabold text-[#0a1628] leading-tight w-full",children:L.question.includes("___")?e.jsx("span",{children:L.question.split("___").map((g,z,O)=>e.jsxs(je.Fragment,{children:[g,z0,value:M,onChange:K=>u(K.target.value),className:`inline-block w-24 mx-2 border-b-4 outline-none text-center bg-transparent font-bold ${J?fe[r]?"border-[#75D06A] text-[#75D06A]":"border-rose-500 text-rose-500":"border-[#7C3AED] text-[#7C3AED] focus:border-[#75D06A]"}`})]},z))}):L.question})]}),e.jsxs("div",{className:"w-full flex flex-col items-center",children:[(L.type==="multiple-choice"||L.type==="true-false")&&e.jsx("div",{className:"w-full grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-5",children:(L.type==="true-false"?["True","False"]:B).map((g,z)=>{const O=typeof g=="string"?g:g.text,K=typeof g=="string"?`${L.id}-${z}`:g.id,te=(gt[r]||[]).includes(O),Y=ne[r]||ce,ie=Ye[l]||[],De=ie.includes(O),yt=ie.length,lt=B.filter(ta=>ta.text!==L.correctAnswer).length,xt=r===l&<>0&&yt>=lt;let Re="bg-white hover:bg-slate-50 border-transparent text-slate-700 hover:border-slate-200",Wt=!1;return xt?(Wt=!0,O===L.correctAnswer?Re="bg-emerald-50 border-emerald-400 text-emerald-800":te?Re="bg-rose-50 border-rose-400 text-rose-800 opacity-80":Re="bg-slate-100 border-slate-200 text-slate-400 opacity-40 line-through"):De?Re="bg-slate-100 border-slate-200 text-slate-400 opacity-40 line-through cursor-not-allowed":Y?O===L.correctAnswer?Re="bg-emerald-50 border-emerald-400 text-emerald-800 shadow-[0_0_15px_rgba(16,185,129,0.2)] scale-[1.02] z-10":Re="bg-slate-50 border-slate-200 text-slate-400 opacity-60":J?O===L.correctAnswer?Re="bg-emerald-50 border-emerald-400 text-emerald-800 shadow-[0_0_15px_rgba(16,185,129,0.2)] scale-[1.02] z-10":te?Re="bg-rose-50 border-rose-400 text-rose-800 opacity-60":Re="bg-slate-50 border-slate-200 text-slate-400 opacity-60":te?Re="bg-rose-50 border-rose-400 text-rose-800 opacity-60":x===K&&(Re="bg-purple-50 border-[#9956DE] text-[#9956DE]"),e.jsxs("button",{disabled:Wt||J||te||Y||De,onClick:()=>{Wt||J||C||te||Y||De||(f(K),ye(O))},className:`p-4 sm:p-5 rounded-2xl shadow-sm border-[3px] font-extrabold text-base sm:text-lg text-left transition-all flex items-center justify-between ${Re} ${J||Y||De?"cursor-default":"hover:shadow-md hover:-translate-y-0.5 active:translate-y-0"}`,children:[e.jsx("span",{className:"truncate pr-4",children:O}),De&&e.jsx(Je,{size:20,className:"text-slate-400 shrink-0"}),Y&&O===L.correctAnswer&&e.jsx(Rt,{size:24,className:"text-emerald-500 shrink-0"}),J&&O===L.correctAnswer&&!Y&&e.jsx(Rt,{size:24,className:"text-emerald-500 shrink-0"}),(J||te)&&te&&e.jsx(Je,{size:24,className:"text-rose-500 shrink-0"})]},K)})}),ce&&e.jsx(S.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"w-full mt-6 space-y-4 max-w-3xl",children:e.jsxs("div",{className:"border-2 rounded-2xl p-5 flex items-start gap-4 bg-sky-50 border-sky-200",children:[e.jsx("img",{src:"/mascot/modules_avatar.png",className:"w-10 h-10 shrink-0",alt:"AI Explain"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-extrabold text-lg mb-1 text-sky-700",children:"Explanation"}),e.jsx("p",{className:"text-base leading-relaxed text-sky-800",children:L.explanation||`The correct answer is: ${L.correctAnswer}`})]})]})})]})]},r)}),e.jsxs("footer",{className:`shrink-0 relative z-[60] flex flex-col items-center justify-center p-4 sm:p-6 ${pe.gradient} rounded-t-[32px] sm:rounded-t-[40px] shadow-[0_-10px_40px_rgba(0,0,0,0.15)]`,children:[e.jsx("div",{className:"absolute inset-0 z-0 pointer-events-none opacity-20",children:Qt.slice(0,3).map((g,z)=>e.jsx("div",{className:"absolute text-white",style:{top:`${20+z*20}%`,left:`${20+z*30}%`,transform:`rotate(${z*30}deg) scale(1.5)`},children:e.jsx(g,{size:32})},z))}),e.jsx("div",{className:"relative z-10 flex flex-col gap-3",children:rd(l),className:"bg-white text-slate-700 font-extrabold text-lg px-6 sm:px-8 py-3 sm:py-4 rounded-full flex items-center gap-2 sm:gap-3 shadow-lg hover:bg-slate-50 transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx(it,{size:20,className:"sm:w-6 sm:h-6"}),"Back to Current Question"]})]}):e.jsx(e.Fragment,{children:(()=>{const g=(Ye[l]||[]).length,z=B.filter(te=>te.text!==L.correctAnswer).length,O=z>0&&g>=z,K=N&&!p||ne[l]||ce||O;if(ce)return e.jsxs("button",{onClick:ze,className:"bg-orange-500 hover:bg-orange-600 text-white font-extrabold text-lg px-8 py-4 rounded-full flex items-center justify-center gap-3 shadow-xl hover:scale-[1.02] active:scale-[0.98] transition-all w-full",children:[l0&&!N&&!ne[l]&&!ce&&!O;return e.jsxs("div",{className:"flex flex-wrap justify-center gap-3 sm:gap-4",children:[e.jsxs("button",{onClick:Ce,disabled:!he,className:"bg-white hover:bg-slate-50 disabled:opacity-70 disabled:cursor-not-allowed text-slate-700 font-bold px-6 sm:px-8 py-3 sm:py-3.5 rounded-full flex items-center gap-2 shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx("img",{src:"/icons/quiz_key.png",alt:"Hint",className:"w-5 h-5 object-contain"}),"Hint"]}),e.jsxs("button",{onClick:Ie,disabled:ne[l]||N||ce,className:"bg-white hover:bg-slate-50 disabled:opacity-70 disabled:cursor-not-allowed text-slate-700 font-bold px-6 sm:px-8 py-3 sm:py-3.5 rounded-full flex items-center gap-2 shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx(Ea,{size:18,className:"text-purple-500"}),"Reveal"]}),e.jsxs("button",{onClick:R,className:"bg-white hover:bg-slate-50 text-slate-700 font-bold px-6 sm:px-8 py-3 sm:py-3.5 rounded-full flex items-center gap-2 shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx("img",{src:"/mascot/modules_avatar.png",className:"w-5 h-5 drop-shadow-sm",alt:"AI Explain"}),"Explain"]}),e.jsx("button",{onClick:()=>Mt(te=>!te),className:`w-11 h-11 sm:w-12 sm:h-12 rounded-full flex items-center justify-center shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200 ${Lt?"bg-purple-100 text-purple-600 border-purple-300":"bg-white hover:bg-slate-50 text-slate-700"}`,children:e.jsx(wt,{size:20})})]})})()})})]})]})]})},Qr=[{id:1,type:"multiple-choice",question:"What is the value of π (pi) to two decimal places?",options:["3.12","3.14","3.16","3.18"],correctAnswer:"3.14",explanation:"π ≈ 3.14159..., so to two decimal places it is 3.14."},{id:2,type:"true-false",question:"The sum of angles in a triangle is 180 degrees.",correctAnswer:"True",explanation:"The interior angles of any Euclidean triangle sum to 180°."},{id:3,type:"fill-in-blank",question:"If 2x + 5 = 13, then x = ___.",correctAnswer:"4",explanation:"2x = 13 - 5 = 8 → x = 4."},{id:4,type:"multiple-choice",question:"Which of the following is a prime number?",options:["9","15","17","21"],correctAnswer:"17",explanation:"17 is only divisible by 1 and itself. 9=3×3, 15=3×5, 21=3×7."},{id:5,type:"true-false",question:"The slope of a horizontal line is zero.",correctAnswer:"True",explanation:"A horizontal line has no rise, so rise/run = 0."},{id:6,type:"fill-in-blank",question:"The square root of 144 is ___.",correctAnswer:"12",explanation:"12 × 12 = 144, so √144 = 12."}];async function Wr(t){const{lessonTitle:s,topic:n,subjectId:i,competencyCode:l,questionCount:c=6}=t,r=Gr(i)||"General Mathematics",d=t.lessonId?Math.abs(t.lessonId.split("").reduce((x,f)=>Math.imul(31,x)+f.charCodeAt(0)|0,0))%1e6:Math.floor(Math.random()*1e6);try{const x=await $t("/api/quiz/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topic:n||s,subject:r,lessonTitle:s,questionCount:c,questionTypes:["multiple-choice","true-false","fill-in-blank"],difficulty:"medium",competencyCode:l,varianceSeed:d})});return!x.questions||x.questions.length===0?(console.warn("[lessonQuizService] API returned empty questions, using fallback"),Ps(c)):x.questions.map(f=>({id:f.id,type:f.type,question:f.question,options:f.options||void 0,correctAnswer:f.correctAnswer,explanation:f.explanation}))}catch(x){return console.error("[lessonQuizService] Failed to generate quiz via API:",x),console.warn("[lessonQuizService] Using fallback questions"),Ps(c)}}function Ur(t){return 6}function Gr(t){if(!t)return null;const s=t.toLowerCase();return s.includes("gen-math")||s.includes("gen_math")?"General Mathematics":s.includes("stats")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre_calc")?"Pre-Calculus":s.includes("basic-calc")||s.includes("basic_calc")||s.includes("calculus")?"Basic Calculus":null}function Ps(t){const s=[...Qr].sort(()=>Math.random()-.5);return s.slice(0,Math.min(t,s.length)).map((n,i)=>({...n,id:i+1}))}const Xr="rag_lesson_";function ms(t){return`${Xr}${t}`}function Vr(t){try{const s=sessionStorage.getItem(ms(t));if(s)return JSON.parse(s)}catch{}return null}function Yr(t,s){try{sessionStorage.setItem(ms(t),JSON.stringify(s))}catch{}}function Kr(t,s,n=!0){const[i,l]=a.useState([]),[c,r]=a.useState(!0),[d,x]=a.useState(null),[f,M]=a.useState([]),[u,N]=a.useState("low"),[m,p]=a.useState(0),[k,y]=a.useState(!1),[W,j]=a.useState(void 0),[E,_]=a.useState(!1),D=a.useCallback(async()=>{if(!n||!t)return;const I=Vr(t);if(I){l(I.sections),M(I.sources),N(I.retrievalBand),p(I.retrievalConfidence),y(I.needsReview),j(I.activeModel),r(!1),x(null),_(!1);return}r(!0),x(null),_(!1);try{const se=(await Ft(()=>import("./vendor-firebase-auth-T_wvTOvf.js"),__vite__mapDeps([4,3])).then(re=>re.getAuth().currentUser))?.uid,C=await za({...s,lessonId:t,userId:se});l(C.sections),M(C.sources||[]),N(C.retrievalBand),p(C.retrievalConfidence),y(C.needsReview),j(C.activeModel),Yr(t,C),x(null),_(!1)}catch(B){const se=B.status||B.response?.status,C=B.body||B.response;let re="Failed to load lesson content.",ge=!1;se===404&&C?.error==="no_curriculum_context"?(re=C.message||"Lesson source PDF not found or not yet ingested.",ge=!0):se===401?re="Please sign in again to access lessons.":navigator.onLine||(re="No internet connection. Please try again when online.",ge=!0),x(re),_(ge),l([])}finally{r(!1)}},[t,n,JSON.stringify(s)]);a.useEffect(()=>{D()},[D]);const b=a.useCallback(()=>{t&&sessionStorage.removeItem(ms(t)),r(!0),x(null),D()},[D,t]);return{sections:i,isLoading:c,error:d,retry:b,sources:f,retrievalBand:u,retrievalConfidence:m,needsReview:k,activeModel:W,isOffline:E}}const Ks=/[=×÷±√∑∫π²³%]/,Zr=/^(Definition|Formula|Note|Reminder|Important|Example|Key Concept|Concept|Rule|Theorem|Property|Step)s?\s*:/i;function pt(t){return t.replace(/\b([A-Z][a-zA-Z\s]{2,30}?)\s+(is|are|refers to|defined as|means)\b/g,(s,n,i)=>`**${n.trim()}** ${i}`).replace(/"([^"]{3,40})"/g,(s,n)=>`**${n}**`)}function Vt(t){if(!t?.trim())return null;const s=t.split(` +`),n=[];let i=[],l=[],c=[],r=0;const d=()=>{if(i.length===0)return;const p=i.join(" ").trim();if(!p){i=[];return}const k=p.match(/[^.!?]+[.!?]+["']?/g)||[p],y=[];let W=[],j=0;for(const E of k)W.push(E),j+=E.length,j>220&&(y.push(W),W=[],j=0);W.length&&y.push(W);for(const E of y){const _=pt(E.join(" ").trim());n.push(e.jsx("p",{className:"lesson-body-text text-slate-700 leading-[1.8] text-[1rem] font-body",children:qe(_)},r++))}i=[]},x=()=>{l.length!==0&&(n.push(e.jsx("ul",{className:"space-y-2.5 my-1 pl-1",children:l.map((p,k)=>e.jsxs("li",{className:"flex items-start gap-3 text-slate-700 text-[0.95rem] leading-[1.75] font-body",children:[e.jsx("span",{className:"mt-[0.5rem] w-2 h-2 rounded-full bg-[#1a85a4] flex-shrink-0"}),e.jsx("span",{children:qe(pt(p))})]},k))},r++)),l=[])},f=()=>{c.length!==0&&(n.push(e.jsx("ol",{className:"space-y-2.5 my-1 list-none pl-1",children:c.map((p,k)=>e.jsxs("li",{className:"flex items-start gap-3 text-slate-700 text-[0.95rem] leading-[1.75] font-body",children:[e.jsx("span",{className:"mt-0.5 min-w-[1.5rem] h-[1.5rem] rounded-full bg-[#1a85a4] text-white text-[0.7rem] font-bold flex items-center justify-center flex-shrink-0",children:k+1}),e.jsx("span",{children:qe(pt(p))})]},k))},r++)),c=[])},M=p=>/^[\-•\*]\s+/.test(p.trim()),u=p=>/^\d+[\.\)]\s+/.test(p.trim()),N=p=>Ks.test(p)&&p.trim().length<120,m=p=>{const k=p.toLowerCase();return/formula|theorem|property|rule/.test(k)?{bg:"bg-amber-50",border:"border-amber-300",text:"text-amber-900",label:"FORMULA"}:/definition|concept|key/.test(k)?{bg:"bg-blue-50",border:"border-blue-300",text:"text-blue-900",label:"DEFINITION"}:/note|reminder|important/.test(k)?{bg:"bg-rose-50",border:"border-rose-300",text:"text-rose-900",label:"NOTE"}:/example|step/.test(k)?{bg:"bg-emerald-50",border:"border-emerald-300",text:"text-emerald-900",label:"EXAMPLE"}:{bg:"bg-slate-50",border:"border-slate-300",text:"text-slate-800",label:"TIP"}};for(const p of s){const k=p.trimEnd(),y=k.trim();if(y===""){x(),f(),d();continue}const W=y.match(Zr);if(W){x(),f(),d();const j=W[1],E=y.slice(W[0].length).trim(),_=m(j);n.push(e.jsxs("div",{className:`rounded-xl px-4 py-3.5 border-l-4 ${_.bg} ${_.border} my-1`,children:[e.jsxs("p",{className:`text-[0.75rem] font-black uppercase tracking-widest mb-1.5 ${_.text} opacity-80 font-display`,children:[_.label," ",j]}),e.jsx("p",{className:`text-[0.95rem] leading-[1.75] font-semibold font-body ${_.text}`,children:qe(E)})]},r++));continue}if(M(y)){d(),f(),l.push(y.replace(/^[\-•\*]\s+/,""));continue}if(u(y)){d(),x(),c.push(y.replace(/^\d+[\.\)]\s+/,""));continue}if(N(y)&&!/[a-z]{5,}/.test(y)){x(),f(),d(),n.push(e.jsx("div",{className:"lesson-formula-box my-3",children:y},r++));continue}if(y.endsWith(":")&&y.length<80&&!y.startsWith(" ")){x(),f(),d(),n.push(e.jsx("p",{className:"lesson-section-heading text-[#1a85a4] text-[1.05rem] mt-5 mb-1 border-b-2 border-[#1a85a4]/20 pb-1.5",children:qe(y)},r++));continue}x(),f(),i.push(k)}return x(),f(),d(),e.jsx("div",{className:"space-y-3",children:n})}function qe(t){const s=[],n=/(\*\*(.+?)\*\*|\*(.+?)\*|`(.+?)`|==(.+?)==)/g;let i=0,l,c=0;for(;(l=n.exec(t))!==null;)l.index>i&&s.push(e.jsx(je.Fragment,{children:t.slice(i,l.index)},c++)),l[2]?s.push(e.jsx("strong",{className:"font-extrabold text-[#1a85a4] bg-[#e0f4fa] px-1 py-0.5 rounded-md font-body",children:l[2]},c++)):l[3]?s.push(e.jsx("em",{className:"italic text-slate-500 font-body",children:l[3]},c++)):l[4]?s.push(e.jsx("code",{className:"px-1.5 py-0.5 bg-slate-100 rounded text-[0.85em] font-mono text-[#e66a5e] border border-slate-200 font-semibold",children:l[4]},c++)):l[5]&&s.push(e.jsx("mark",{className:"bg-[#fff3cd] text-[#92400e] px-1 py-0.5 rounded-md font-bold border-b-2 border-[#fbbf24]",children:l[5]},c++)),i=l.index+l[0].length;return i0?e.jsx(e.Fragment,{children:s}):t}function Jr(t){if(!t?.trim())return{welcome:"",objectives:[]};const s=t.split(` +`).map(d=>d.trim()).filter(Boolean),n=/^(\d+[\.\)]\s+|[-•*]\s+|(Identify|Write|Set|Use|Apply|Solve|Compute|Calculate|Determine|Understand|Describe|Explain|Analyze|Evaluate|Create|Define|Distinguish|Compare|Illustrate|Demonstrate|Perform|Simplify|Represent|Model|Interpret|Recognize|Classify|Construct|Derive|Formulate|Graph|Sketch|Verify|Prove|Estimate|Approximate|Convert|Translate|Predict|Justify|Generalize|Extend|Develop|Explore|Investigate|Discover|Observe|Measure|Record|Report|Present|Communicate|Collaborate|Reflect|Review|Summarize|Conclude|Infer|Hypothesize|Test|Experiment|Design|Plan|Implement|Evaluate|Assess|Monitor|Adjust|Improve|Optimize|Innovate|Create|Produce|Publish|Share|Teach|Learn|Practice|Apply|Transfer|Connect|Integrate|Synthesize|Analyze|Evaluate|Create)\b)/i,i=/^(Example:|e\.g\.|For example:|Sample:|\()/i,l=[],c=[];let r=!1;for(let d=0;d0&&t.callouts.map((p,k)=>e.jsxs("div",{className:`lesson-callout-headsup flex items-start gap-3.5 ${p.type==="tip"?"!bg-gradient-to-r !from-emerald-50 !to-teal-50 !border-emerald-400":""}`,children:[e.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5 shadow-sm ${p.type==="tip"?"bg-emerald-500":"bg-amber-500"}`,children:e.jsx(jt,{size:16,className:"text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] mb-1 ${p.type==="tip"?"text-emerald-600":"text-amber-600"}`,children:p.type==="tip"?"Tip":p.type==="important"?"Heads Up":"Note"}),e.jsx("p",{className:"font-body text-[0.95rem] text-slate-700 leading-[1.75] font-medium",children:p.text})]})]},k)),(!t.callouts||t.callouts.length===0)&&e.jsxs("div",{className:"lesson-callout-headsup flex items-start gap-3.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-amber-500 flex items-center justify-center flex-shrink-0 mt-0.5 shadow-sm",children:e.jsx(jt,{size:16,className:"text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] mb-1 text-amber-600",children:"Heads Up"}),e.jsxs("p",{className:"font-body text-[0.95rem] text-slate-700 leading-[1.75] font-medium",children:["This lesson has ",7," sections and takes about 20 minutes to complete. Grab a pen — you might want to take notes along the way!"]})]})]}),N.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(ft,{size:20,className:"text-violet-500"}),e.jsx("h3",{className:"lesson-section-heading text-[1.05rem]",style:{color:"#7c3aed"},children:"What you'll learn"})]}),e.jsx("div",{className:"space-y-2.5",children:N.map((p,k)=>{const y=Ls[k%Ls.length];return e.jsxs("div",{className:`rounded-xl border-2 px-4 py-3.5 flex items-start gap-3.5 ${y.bg} ${y.border} shadow-sm`,children:[e.jsx("span",{className:`mt-0.5 min-w-[1.75rem] h-7 rounded-full ${y.num} text-white text-[0.7rem] font-black flex items-center justify-center flex-shrink-0 shadow-sm`,children:k+1}),e.jsxs("div",{children:[e.jsx("p",{className:`font-body text-[0.95rem] font-semibold leading-snug ${y.text}`,children:qe(pt(p.text))}),p.example&&e.jsx("p",{className:`text-xs mt-1 ${y.ex} font-mono font-semibold`,children:p.example})]})]},k)})})]})]})}case"key_concepts":return e.jsxs("div",{className:"space-y-4",children:[t.content?.trim()?e.jsx("div",{className:"mb-4",children:Vt(t.content)}):e.jsx("p",{className:"text-slate-400 text-sm italic mb-4",children:"Key concepts are being compiled. Review the curriculum sources below for reference material."}),t.callouts&&t.callouts.length>0&&e.jsx("div",{className:"space-y-3",children:t.callouts.map((u,N)=>e.jsxs("div",{className:`rounded-xl border-2 px-5 py-4 flex items-start gap-3.5 shadow-sm ${u.type==="important"?"bg-rose-50 border-rose-300":u.type==="tip"?"bg-emerald-50 border-emerald-300":"bg-amber-50 border-amber-300"}`,children:[e.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5 shadow-sm ${u.type==="important"?"bg-rose-500":u.type==="tip"?"bg-emerald-500":"bg-amber-500"}`,children:e.jsx(jt,{size:16,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("p",{className:`lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] mb-1 ${u.type==="important"?"text-rose-500":u.type==="tip"?"text-emerald-600":"text-amber-600"}`,children:u.type==="important"?"Important":u.type==="tip"?"Tip":"Note"}),e.jsx("p",{className:"font-body text-[0.95rem] text-slate-700 leading-[1.75] font-medium",children:qe(u.text)})]})]},N))})]});case"video":return e.jsxs("div",{className:"space-y-4",children:[t.content?.trim()?e.jsx("p",{className:"text-slate-600 text-sm",children:t.content}):e.jsx("p",{className:"text-slate-400 text-sm italic",children:"Video explanation loading..."}),e.jsx(Ma,{videos:t.videos||[],topic:l.title})]});case"worked_examples":return e.jsx("div",{className:"space-y-5",children:t.examples&&t.examples.length>0?t.examples.map((u,N)=>e.jsxs("div",{className:"bg-gradient-to-br from-rose-50 via-orange-50 to-amber-50 rounded-2xl p-5 border-2 border-rose-200 shadow-md",children:[e.jsxs("div",{className:"flex items-start gap-3.5 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-rose-500 to-orange-500 rounded-xl flex items-center justify-center flex-shrink-0 shadow-md",children:e.jsx(wt,{size:18,className:"text-white"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] text-rose-400 mb-1",children:["Example ",N+1]}),e.jsx("p",{className:"font-body font-bold text-slate-800 text-[1rem] leading-snug",children:u.problem})]})]}),u.steps.length>0&&e.jsxs("div",{className:"ml-14 space-y-2.5 mb-3",children:[e.jsx("p",{className:"lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] text-slate-400 mb-1.5",children:"Solution"}),u.steps.map((m,p)=>Ks.test(m)&&m.length<100&&!/[a-z]{6,}/.test(m)?e.jsx("div",{className:"lesson-formula-box",children:m},p):e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"mt-0.5 min-w-[1.5rem] h-[1.5rem] rounded-full bg-white border-2 border-rose-300 text-rose-500 text-[0.65rem] font-black flex items-center justify-center flex-shrink-0 shadow-sm",children:p+1}),e.jsx("p",{className:"font-body text-slate-700 text-[0.95rem] leading-[1.75]",children:qe(m)})]},p))]}),u.answer&&e.jsxs("div",{className:"ml-14 flex items-center gap-3 mt-3 pt-3 border-t-2 border-rose-200",children:[e.jsx("div",{className:"px-3.5 py-1.5 bg-gradient-to-r from-rose-500 to-orange-500 rounded-lg text-white text-[0.65rem] font-black uppercase tracking-widest flex-shrink-0 shadow-sm",children:"Answer"}),e.jsx("p",{className:"font-body text-slate-800 text-[0.95rem] font-bold",children:u.answer})]})]},N)):e.jsx("p",{className:"text-slate-400 text-sm italic",children:"No worked examples available for this lesson."})});case"important_notes":return e.jsx("div",{className:"space-y-3",children:t.bulletPoints&&t.bulletPoints.length>0?t.bulletPoints.map((u,N)=>{const m=u.match(/^(Note|Important|Remember|Warning|Tip|Key|Formula|Rule)\s*:/i);if(m){const p=m[1],k=u.slice(m[0].length).trim(),y=/note|important|warning|remember/i.test(p);return e.jsxs("div",{className:`rounded-xl px-5 py-4 border-l-4 flex items-start gap-3.5 shadow-sm ${y?"bg-rose-50 border-rose-400":"bg-amber-50 border-amber-400"}`,children:[e.jsx(jt,{size:18,className:`mt-0.5 flex-shrink-0 ${y?"text-rose-500":"text-amber-500"}`}),e.jsxs("div",{children:[e.jsx("p",{className:`lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] mb-1 ${y?"text-rose-500":"text-amber-600"}`,children:p}),e.jsx("p",{className:"font-body text-[0.95rem] text-slate-700 leading-[1.75] font-medium",children:qe(pt(k))})]})]},N)}return e.jsxs("div",{className:"flex items-start gap-3.5 p-4 rounded-xl bg-slate-50 border-2 border-slate-200 hover:border-[#1a85a4]/40 hover:bg-[#f0fbff] transition-colors",children:[e.jsx("div",{className:"mt-0.5 w-6 h-6 rounded-full bg-[#1a85a4] flex items-center justify-center flex-shrink-0 shadow-sm",children:e.jsx("span",{className:"text-white text-[0.65rem] font-black",children:N+1})}),e.jsx("p",{className:"font-body text-slate-700 text-[0.95rem] leading-[1.75] font-medium",children:qe(pt(u))})]},N)}):e.jsx("p",{className:"text-slate-400 text-sm italic",children:"No notes available for this lesson."})});case"try_it_yourself":return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex flex-col items-center text-center gap-3 py-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center shadow-lg",style:{background:"#9956DE"},children:e.jsx(ft,{size:32,className:"text-white"})}),e.jsx("h3",{className:"text-xl font-black",style:{color:"#9956DE"},children:"Try It Yourself"}),e.jsx("p",{className:"text-slate-500 text-sm max-w-xs leading-relaxed",children:"Now it's your turn! Try applying what you've learned. You can practice with the exercises at the end of this module."})]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-xl px-4 py-3 border",style:{background:"#f5eeff",borderColor:"#d4aaff"},children:[e.jsx(jt,{size:16,className:"mt-0.5 shrink-0",style:{color:"#9956DE"}}),e.jsxs("p",{className:"text-sm",style:{color:"#7a3db8"},children:[e.jsx("span",{className:"font-bold",children:"Tip:"})," Complete the practice quizzes after this lesson to reinforce your learning!"]})]}),c&&e.jsx("div",{className:"bg-white rounded-2xl p-5 border border-slate-200 shadow-sm",children:r?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-emerald-100 rounded-xl flex items-center justify-center",children:e.jsx(ft,{size:20,className:"text-emerald-600"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-bold text-emerald-700",children:["Quiz Complete",typeof d=="number"&&e.jsxs("span",{className:"ml-2 text-emerald-600",children:[d,"%"]})]}),e.jsx("p",{className:"text-xs text-emerald-600/80",children:"Great job! You can now complete this lesson."})]})]}):e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest mb-1",style:{color:"#9956DE"},children:"Practice Quiz"}),e.jsx("p",{className:"font-bold text-slate-800 text-sm",children:c.title}),e.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:[c.questions," questions · ",c.duration]})]}),e.jsx("button",{onClick:x,className:"w-full sm:w-auto px-6 py-2.5 rounded-xl bg-[#1a85a4] text-white text-sm font-black hover:bg-[#126b84] transition-colors shadow-md uppercase tracking-wide",children:"Start Practice"})]})}),!c&&e.jsxs("button",{onClick:M,className:"w-full flex items-center justify-between gap-4 text-white rounded-2xl px-6 py-4 shadow-lg transition-all hover:shadow-xl hover:scale-[1.01] active:scale-[0.99] group",style:{background:"#9956DE"},onMouseEnter:u=>u.currentTarget.style.background="#8744cc",onMouseLeave:u=>u.currentTarget.style.background="#9956DE",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center shrink-0",children:e.jsx(Ka,{size:22,className:"text-white"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"font-black text-sm uppercase tracking-wide",children:"Start Practice Quiz"}),e.jsx("p",{className:"text-white/80 text-xs mt-0.5",children:"10 questions · AI-generated"})]})]}),e.jsx(ht,{size:20,className:"text-white/80 group-hover:translate-x-1 transition-transform"})]})]});case"summary":return e.jsx("div",{className:"space-y-3",children:t.content?.trim()?Vt(t.content):e.jsx("p",{className:"text-slate-400 text-sm italic",children:"Summary is being prepared. Review the lesson sections above to reinforce your understanding."})});default:return e.jsx("p",{className:"text-slate-500 text-sm italic",children:"Section content not available."})}}const _t=[{type:"introduction",label:"Intro",helper:"Welcome note",icon:Nt,accent:"from-[#1a85a4] to-[#126b84]",tint:"bg-[#1a85a4] text-white border-transparent",tabBg:"bg-[#1a85a4]"},{type:"key_concepts",label:"Concepts",helper:"Core ideas",icon:cr,accent:"from-[#fbab41] to-[#e0983a]",tint:"bg-[#fbab41] text-white border-transparent",tabBg:"bg-[#fbab41]"},{type:"video",label:"Video",helper:"Watch and learn",icon:jt,accent:"from-[#e66a5e] to-[#ce5e53]",tint:"bg-[#e66a5e] text-white border-transparent",tabBg:"bg-[#e66a5e]"},{type:"worked_examples",label:"Examples",helper:"Guided solving",icon:Pa,accent:"from-[#7ec16d] to-[#71ad62]",tint:"bg-[#7ec16d] text-white border-transparent",tabBg:"bg-[#7ec16d]"},{type:"important_notes",label:"Notes",helper:"Key reminders",icon:mr,accent:"from-[#9a67d0] to-[#8a5cc0]",tint:"bg-[#9a67d0] text-white border-transparent",tabBg:"bg-[#9a67d0]"},{type:"try_it_yourself",label:"Practice",helper:"Try it yourself",icon:et,accent:"from-[#eb74a6] to-[#d46895]",tint:"bg-[#eb74a6] text-white border-transparent",tabBg:"bg-[#eb74a6]"},{type:"summary",label:"Summary",helper:"Wrap-up",icon:Tt,accent:"from-[#48bca6] to-[#40a794]",tint:"bg-[#48bca6] text-white border-transparent",tabBg:"bg-[#48bca6]"}],an=({lesson:t,lessonCompletionXP:s=10,practiceQuiz:n,practiceQuizCompleted:i=!1,practiceQuizScore:l,initialSection:c=0,onStartPractice:r,onBack:d,onComplete:x,onProgressUpdate:f,onTryItQuizComplete:M,onContinueLearning:u})=>{const{userProfile:N}=Bt(),[m,p]=a.useState(0),[k,y]=a.useState(1),[W,j]=a.useState(!1),[E,_]=a.useState(null),[D,b]=a.useState(!1),[I,B]=a.useState(null),[se,C]=a.useState(!1);a.useEffect(()=>{!D||I||(C(!0),Wr({lessonId:t.id?.toString()||"unknown",lessonTitle:t.title,topic:t.title,subjectId:t.subjectId,competencyCode:t.competencyCode,questionCount:10}).then(F=>B(F)).catch(F=>{console.error("[LessonViewer] Quiz generation failed:",F),b(!1)}).finally(()=>C(!1)))},[D,I,t]);const[re,ge]=a.useState(!1),Oe={topic:t.title,subject:t.subject||"General Mathematics",quarter:t.quarter||1,lessonTitle:t.title,moduleId:t.subjectId,lessonId:t.id,competencyCode:t.competencyCode,learnerLevel:"Grade 11-12",storagePath:t.storagePath},{sections:oe,isLoading:Qe,error:Se,retry:G,sources:ve,retrievalBand:We,activeModel:_e,isOffline:Ve}=Kr(t.id,Oe,!0),[$e,Ue]=a.useState(null);a.useEffect(()=>{if(oe.length>0){const F=oe.find(ee=>ee.type==="introduction");if(F?.title){const ue=F.title.replace(/^Introduction\s+(to|-|:|—)\s+/i,"").replace(/\s*[-:—]\s*Introduction$/i,"").replace(/\s+Introduction$/i,"").trim();ue&&ue.toLowerCase()!=="introduction"&&Ue(ue)}}},[oe]),a.useEffect(()=>{oe.length>0&&N?.uid&&t.id&&Ta(N.uid,t.id,$e||t.title).catch(()=>{})},[oe.length,N?.uid,t.id,$e,t.title]);const h=oe.length||_t.length;if(a.useEffect(()=>{c>=0&&c{const F=oe.findIndex(ee=>ee.type==="try_it_yourself");c===-1&&F>=0&&p(F)},[oe,c]),a.useEffect(()=>{const F=h>0?(m+1)/h*100:0;f?.(F)},[m,h,f]),Qe)return e.jsx(en,{});if(Se&&oe.length===0)return e.jsx(tn,{message:Se,onRetry:G,isOffline:Ve});const A=String(t.id||"").match(/\d+/);if(A&&A[0],D)return se||!I?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl p-6 flex flex-col items-center gap-3 shadow-xl",children:[e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"}),e.jsx("p",{className:"font-bold text-slate-700",children:"Generating Quiz..."})]})}):e.jsx(Or,{lesson:{id:parseInt(String(t.id||"1").replace(/\D/g,"")||"1"),title:t.title,duration:"15 min",type:"quiz",completed:!1,locked:!1},questions:I,onBack:()=>{b(!1),B(null)},onComplete:F=>{const ee=Math.round(F/(I?.length||10)*100);M?.(ee),ge(!0),b(!1),B(null)}});const T=oe[m]||{type:"introduction",title:"Loading...",content:"Lesson content is loading. Please wait a moment."},X=()=>{mF+1)):(!n||i)&&j(!0)},$=()=>{m>0&&(y(-1),p(F=>F-1))},Z=F=>{x(void 0,void 0,F)},le=!!(n&&!i||!re),Ae=_t[m]||_t[0],fe=Ae.icon,be=e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-slate-50 overflow-hidden font-sans",children:[e.jsx("header",{className:"flex-none bg-transparent px-3 sm:px-6 pt-2 sm:pt-3 md:pt-4 pb-2 sm:pb-3 sm:py-4 relative z-40",children:e.jsxs("div",{className:"max-w-[90rem] mx-auto flex items-center justify-between gap-2 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0 flex-1",children:[e.jsx("button",{onClick:d,className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full bg-white border border-slate-200 hover:bg-slate-50 flex items-center justify-center text-slate-600 transition-colors flex-shrink-0 shadow-sm","aria-label":"Go back",children:e.jsx(Zt,{size:16})}),e.jsxs("div",{className:"min-w-0 flex flex-col justify-center flex-1",children:[e.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 sm:gap-2 text-[9px] sm:text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-0.5",children:[e.jsx(Fe,{size:10}),e.jsx("span",{children:"NOTEBOOK"}),_e&&e.jsx("span",{className:"text-slate-400 bg-slate-100 px-1.5 py-0.5 rounded font-mono",children:_e.split("/").pop()}),We==="high"&&e.jsx("span",{className:"text-emerald-600 bg-emerald-50 px-1.5 py-0.5 rounded text-[10px] font-semibold border border-emerald-200",children:"DepEd Source"})]}),e.jsxs("div",{className:"flex sm:hidden items-center gap-1 text-[9px] font-bold text-slate-400 uppercase tracking-widest mb-0.5",children:[e.jsx(Fe,{size:9}),e.jsx("span",{children:"Notebook"}),We==="high"&&e.jsx("span",{className:"text-emerald-600 bg-emerald-50 px-1 py-0.5 rounded text-[8px] font-semibold border border-emerald-200 leading-none",children:"DepEd"})]}),e.jsx("h1",{className:"font-bold text-slate-800 text-xs sm:text-sm truncate",children:t.title})]})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 flex-shrink-0",children:[e.jsxs("div",{className:"text-right hidden sm:block",children:[e.jsx("p",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-wider",children:"Progress"}),e.jsxs("p",{className:"text-sm font-bold text-slate-800",children:[Math.round((m+1)/h*100),"%"]})]}),e.jsx("div",{className:"w-12 sm:w-24 md:w-32 h-1.5 sm:h-2 bg-slate-200 rounded-full overflow-hidden",children:e.jsx(S.div,{className:"h-full bg-[#7ec16d] rounded-full",animate:{width:`${(m+1)/h*100}%`},transition:{duration:.25}})})]})]})}),e.jsx("main",{className:"flex-1 overflow-hidden px-2 sm:px-5 pb-2 relative flex justify-center min-h-0",children:e.jsxs("div",{className:"w-full max-w-[90rem] h-full relative flex md:pl-16 pt-10 sm:pt-10 md:pt-0",children:[e.jsx("div",{className:"hidden md:flex absolute left-0 top-8 bottom-8 w-20 flex-col justify-between z-0 py-2",children:_t.map((F,ee)=>{const ue=ee===m,Be=F.icon;return e.jsxs("button",{onClick:()=>{y(ee>m?1:-1),p(ee)},className:It("group relative flex items-center justify-start pl-4 rounded-l-[1.5rem] transition-all duration-300 shadow-sm border-r-0 flex-shrink-0",F.tabBg,ue?"w-24 h-20 -translate-x-4 shadow-xl z-20 brightness-105":"w-16 h-16 hover:w-24 hover:h-20 hover:-translate-x-4 hover:brightness-110 opacity-90 hover:opacity-100 z-10"),"aria-label":`Go to ${F.label} section`,children:[e.jsx("div",{className:It("transition-all duration-300 rounded-xl",ue?"bg-white/30 p-2.5":"bg-white/20 p-2 group-hover:bg-white/30 group-hover:p-2.5"),children:e.jsx(Be,{size:ue?24:20,className:"text-white transition-transform duration-300 group-hover:scale-110"})}),e.jsxs("div",{className:"absolute right-full mr-3 px-3 py-1.5 bg-slate-800 text-white text-xs font-bold rounded-lg opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity whitespace-nowrap z-[100] shadow-xl border border-slate-700/50",children:[e.jsx("div",{className:"absolute top-1/2 -right-1 -translate-y-1/2 w-2 h-2 bg-slate-800 rotate-45 border-r border-t border-slate-700/50"}),F.label]})]},F.type)})}),e.jsx("div",{className:"md:hidden absolute left-0 right-0 top-0 z-30 bg-slate-100/95 backdrop-blur-sm",children:e.jsx("div",{className:"flex gap-0.8 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden px-1",children:_t.map((F,ee)=>{const ue=ee===m,Be=F.icon;return e.jsxs("button",{onClick:()=>{y(ee>m?1:-1),p(ee)},className:It("flex items-center gap-1.5 px-3 py-2 rounded-t-lg transition-all duration-200 shrink-0 text-[11px] font-bold touch-manipulation min-h-[2.5rem]",ue?`${F.tabBg} text-white shadow-md`:"bg-slate-200/80 text-slate-500"),children:[e.jsx(Be,{size:14}),e.jsx("span",{children:F.label})]},F.type)})})}),e.jsxs("div",{className:It("flex-1 min-w-0 rounded-none sm:rounded-lg shadow-2xl flex flex-col overflow-visible relative z-10 transition-colors duration-500",Ae.tabBg),children:[e.jsxs("div",{className:"px-3 sm:px-6 py-2 sm:py-3.5 flex items-center gap-2 sm:gap-4 text-white",children:[e.jsx("div",{className:"bg-white/20 p-1 sm:p-2 rounded-lg sm:rounded-xl shrink-0",children:e.jsx(fe,{size:16,className:"text-white"})}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx("h2",{className:"lesson-section-heading text-sm sm:text-xl md:text-2xl truncate",title:T.title,children:T.title}),e.jsx("p",{className:"text-white/90 text-[10px] sm:text-xs font-medium truncate mt-0.5 font-body",title:t.title,children:t.title})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 bg-[#fdfdfd] rounded-lg sm:rounded-[1.5rem] m-1 mt-0 relative overflow-hidden shadow-inner flex flex-col",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-30",style:{backgroundImage:"linear-gradient(transparent 95%, #cbd5e1 95%)",backgroundSize:"100% 40px",backgroundPosition:"0 0"}}),e.jsx("div",{className:"absolute top-0 bottom-0 left-8 sm:left-12 md:left-16 w-[2px] bg-rose-300/60 pointer-events-none z-0"}),e.jsx("div",{className:"relative z-10 flex-1 min-h-0 overflow-y-auto px-3 sm:px-5 md:pl-20 md:pr-10 py-2 sm:py-6",children:e.jsx(ot,{mode:"wait",children:e.jsxs(S.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"bg-white/90 backdrop-blur-sm rounded-xl sm:rounded-[1.5rem] p-4 sm:p-6 md:p-8 shadow-sm border border-slate-100/50 font-body",children:e.jsx(sn,{section:T,sectionIndex:m,onShowSolution:F=>_(E===F?null:F),expandedIndex:E,lesson:t,practiceQuiz:n,practiceQuizCompleted:i,practiceQuizScore:l,onStartPractice:r,lessonSpecificTopic:$e,onStartTryItQuiz:()=>b(!0)})}),ve.length>0&&(N?.role==="admin"||N?.role==="teacher")&&e.jsxs("details",{className:"rounded-xl border border-slate-200 bg-white/90 backdrop-blur-sm px-4 py-3 text-xs text-slate-500 shadow-sm",children:[e.jsxs("summary",{className:"cursor-pointer font-semibold text-slate-600 hover:text-slate-800",children:[ve.length," source",ve.length>1?"s":""," used"]}),e.jsx("div",{className:"mt-2 space-y-1 pl-2",children:ve.slice(0,3).map((F,ee)=>e.jsxs("p",{className:"font-mono truncate",children:[F.source_file," p.",F.page," (",Math.round((F.score||0)*100),"%)"]},ee))})]})]},m)})},m)]})]})]})}),e.jsx("footer",{className:"bg-slate-50 border-t border-slate-100 px-3 sm:px-6 flex-shrink-0 relative z-50 w-full flex justify-center items-center py-1.5 sm:py-3",children:e.jsxs("div",{className:"w-full max-w-[90rem] flex flex-col items-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-4 sm:gap-8 w-full md:ml-16",children:[e.jsxs(Me,{onClick:$,disabled:m===0,variant:"outline",className:"px-4 sm:px-5 py-2 sm:py-2 rounded-full font-bold text-xs sm:text-sm bg-white border-slate-200 text-slate-600 shadow-sm disabled:opacity-40 hover:bg-slate-50 transition-colors flex items-center gap-1 sm:gap-2 min-w-[2.5rem] min-h-[2.5rem] touch-manipulation",children:[e.jsx(Zt,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Previous"})]}),e.jsxs("p",{className:"text-xs sm:text-sm text-slate-500 font-bold tabular-nums",children:[m+1," / ",h]}),e.jsx(Me,{onClick:X,disabled:m===h-1&&le,className:"px-5 sm:px-7 py-2 sm:py-2 rounded-full font-bold text-xs sm:text-sm bg-[#7ec16d] text-white hover:bg-[#6ab359] shadow-md transition-colors disabled:opacity-40 flex items-center gap-1 sm:gap-2 min-w-[2.5rem] min-h-[2.5rem] touch-manipulation",children:m===h-1?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"Complete"}),e.jsx(ft,{size:14})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"Next"}),e.jsx(ht,{size:14})]})})]}),m===h-1&&le&&e.jsx("p",{className:"text-center text-[10px] sm:text-xs font-semibold text-amber-600 mt-2 sm:mt-3 md:ml-16",children:re?"Complete the practice quiz first to unlock lesson completion.":"Complete the Try It Yourself quiz first to unlock lesson completion."})]})}),e.jsx(ot,{children:W&&e.jsx(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-[100] flex items-center justify-center bg-slate-900/40 backdrop-blur-sm p-4",children:e.jsxs(S.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-[2rem] p-8 max-w-sm w-full text-center shadow-2xl",children:[e.jsx("div",{className:"w-20 h-20 bg-[#7ec16d] rounded-full flex items-center justify-center mx-auto mb-5 shadow-lg",children:e.jsx(ft,{size:40,className:"text-white"})}),e.jsx("h2",{className:"text-2xl font-black text-slate-800 mb-2",children:"Lesson Complete!"}),e.jsxs("p",{className:"text-slate-500 text-sm mb-6 leading-relaxed",children:["Great job finishing ",e.jsx("strong",{className:"text-slate-700",children:t.title}),"."]}),e.jsxs("div",{className:"bg-emerald-50 rounded-2xl p-4 mb-6 border border-emerald-100",children:[e.jsx("div",{className:"flex items-center justify-center mb-1",children:e.jsx(Tt,{className:"text-[#7ec16d]",size:22})}),e.jsx("p",{className:"text-xs text-[#7ec16d] font-bold uppercase tracking-wider mb-0.5",children:"XP Earned"}),e.jsxs("p",{className:"text-3xl font-black text-[#7ec16d]",children:["+",s]})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("button",{onClick:()=>Z(!0),disabled:le,className:"w-full py-3 rounded-xl font-bold text-sm bg-[#1a85a4] text-white hover:bg-[#126b84] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Continue to Next Lesson"}),e.jsx("button",{onClick:()=>Z(!1),className:"w-full py-3 rounded-xl font-bold text-sm bg-slate-100 text-slate-600 hover:bg-slate-200 transition-colors",children:"Back to Modules"})]})]})})})]}),Te=document.getElementById("modal-root")||document.body;return sa.createPortal(be,Te)},rn={maxRetries:2,timeoutMs:9e4,baseBackoffMs:2e3},Zs=async t=>$t("/api/practice/generate",{method:"POST",body:JSON.stringify(t)},rn),nn=async t=>$t("/api/practice/submit",{method:"POST",body:JSON.stringify(t)}),ln=async t=>$t(`/api/practice/stats/${t}`,{method:"GET"}),on=({module:t,onBack:s,onEarnXP:n,isInQuizMode:i=!1,setIsInQuizMode:l})=>{const[r,d]=a.useState(null),{userProfile:x}=Bt(),[f,M]=a.useState(null),[u,N]=a.useState(!1),[m,p]=a.useState(null);a.useEffect(()=>{if(!x?.uid)return;(async()=>{try{const[A,T]=await Promise.all([Yt(kt(tt,"diagnosticResults",x.uid)),Yt(kt(tt,"competencyProfiles",x.uid))]),X=A.exists()&&A.data()?.status==="completed",$=T.exists()&&(T.data()?.overallScore??0)>0;N(X||$)}catch{N(!1)}})()},[x?.uid]);const k=a.useRef(n);a.useEffect(()=>{k.current=n},[n]);const y=a.useRef(r);a.useEffect(()=>{y.current=r},[r]),a.useEffect(()=>{try{const h=sessionStorage.getItem(`mathpulse_module_${t.id}_selectedLesson`);if(h){const{lessonId:A}=JSON.parse(h),T=t.lessons.find(X=>X.id===A);T&&d({lesson:T,type:"lesson"})}}catch{}},[]),a.useEffect(()=>{if(r?.type==="lesson"&&r.lesson)try{sessionStorage.setItem(`mathpulse_module_${t.id}_selectedLesson`,JSON.stringify({lessonId:r.lesson.id}))}catch{}else if(r===null)try{sessionStorage.removeItem(`mathpulse_module_${t.id}_selectedLesson`)}catch{}},[r,t.id]);const W=a.useMemo(()=>{const h=Number(t.id.split("-").pop());return Number.isFinite(h)&&h>0?h:1},[t.id]),j=a.useMemo(()=>{const h=t.subjectId;return h||(Dt.find(T=>T.modules.some(X=>X.id===t.id))?.id??null)},[t.id]),E=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];a.useMemo(()=>{const h=t.subjectAccentColor;if(h)return h;const T=(j?Dt.find($=>$.id===j):null)?.modules?.findIndex($=>$.id===t.id)??0,X=T>=0?T:0;return E[X%E.length]},[t,t.id,j]),a.useEffect(()=>{if(x?.uid)return us(x.uid,M)},[x?.uid]),a.useEffect(()=>{if(!r||r.type!=="quiz"||!x?.uid)return;let h=!1;const T=Dt.find(X=>X.modules.some($=>$.id===t.id))?.title??"General Mathematics";return(async()=>{try{const X=await Zs({userId:x.uid,subject:T,competency:r.quiz.title.replace(/^(Practice Quiz|Module Quiz):\s*/i,""),difficulty:r.quiz.type==="module"?"Challenge":"Practice",count:r.quiz.questions||5});if(h)return;const $=X.questions.filter(Z=>Z.options?.length&&Z.correct_index>=0&&Z.correct_index({id:Z.id||"q-"+le,questionType:"multiple_choice",question:Z.question,options:Z.options,correctAnswer:Z.options[Z.correct_index],bloomLevel:Z.bloomsLevel?.toLowerCase()||"understand",difficulty:"medium",topic:r.quiz.title,subject:T,points:10,explanation:Z.explanation||""}));p($)}catch(X){console.error("[ModuleDetailView] Quiz generation failed:",X);const $=r.quiz.questions||5,Z=Array.from({length:$}).map((le,Ae)=>{const fe=Math.floor(Math.random()*20)+2,be=Math.floor(Math.random()*20)+2,Te=(fe+be).toString();return{id:"fallback-"+Ae,questionType:"multiple_choice",question:`Compute: ${fe} + ${be}`,options:[Te,(fe*be).toString(),Math.abs(fe-be).toString(),(fe+be+1).toString()],correctAnswer:Te,bloomLevel:"remember",difficulty:"easy",topic:r.quiz.title,subject:T,points:10,explanation:`${fe} + ${be} = ${Te}`}});h||p(Z)}})(),()=>{h=!0}},[r,x?.uid,t.id]);const _=a.useMemo(()=>j?f?.subjects?.[j]?.modulesProgress?.[t.id]??null:null,[t.id,j,f?.subjects]),[D,b]=a.useState(null),I=a.useMemo(()=>{const h=_?.lessonsCompleted??[];return new Set(h)},[_?.lessonsCompleted]),B=a.useMemo(()=>{const h=_?.quizzesCompleted??[];return new Set(h)},[_?.quizzesCompleted]),se=_?.lessonsCompleted?.length??t.lessons.filter(h=>h.completed).length,C=_?.quizzesCompleted?.length??t.quizzes.filter(h=>h.completed).length,re=_?.progress??t.progress,ge=t.lessons.length+t.quizzes.length,Oe=se+C;t.lessons.length&&se/t.lessons.length*100,t.quizzes.length&&C/t.quizzes.length*100;const oe=(h,A)=>{const T=f?.lessons?.[h]?.score;return typeof T=="number"&&Number.isFinite(T)?Math.max(0,Math.min(100,T)):A?100:0},Qe=a.useMemo(()=>{if(!ge)return 0;const h=t.lessons.reduce((T,X)=>{const $=I.has(X.id)||X.completed;return T+oe(X.id,$)},0),A=C*100;return Math.round((h+A)/ge)},[I,C,t.lessons,t.quizzes.length,ge,f?.lessons]),Se=re>0?re:Qe,G=a.useMemo(()=>{const h=t.quizzes.find(T=>T.type==="final"||/module\s+quiz|general\s+quiz/i.test(T.title));if(h)return h;const A=t.quizzes.find(T=>T.isStandalone===!0);return A||(t.quizzes.length?t.quizzes[0]:null)},[t.quizzes]),ve=a.useMemo(()=>{const h=new Map;t.lessons.forEach(T=>{h.set(T.id,[])});const A=t.lessons.length;return A===0||t.quizzes.forEach((T,X)=>{if(G?.id===T.id)return;const $=Math.min(X,A-1),Z=t.lessons[$];if(!Z)return;const le=h.get(Z.id)??[];le.push(T),h.set(Z.id,le)}),h},[t.lessons,t.quizzes,G?.id]),We=a.useMemo(()=>Math.max(1,Math.ceil(t.lessons.length/2)),[t.lessons.length]),_e=a.useCallback(()=>{d(null),b(null)},[]),Ve=a.useCallback(()=>{const h=y.current?.type==="lesson"?y.current.lesson:null;if(!h)return;const A={id:`${h.id}-practice`,title:`Practice Quiz: ${h.title}`,questions:Ur(),duration:h.duration,completed:!1,locked:!1,type:"practice"};b(h),d({type:"quiz",quiz:A})},[]),$e=a.useCallback((h,A,T)=>{const X=y.current;if(X?.type!=="lesson"||!X.lesson)return;const $=X.lesson,Z=10;if(k.current?.(Z,`Completed "${$.title}"`),x?.uid&&j&&(async()=>{try{await ma(x.uid,j,t.id,$.id,0,Z),await ps(x.uid,j,t.id,t.lessons.length,t.quizzes.length)}catch(le){console.error("[LessonComplete] Failed to persist progress:",le)}})(),T){const le=t.lessons.findIndex(Ae=>Ae.id===$.id);le!==-1&&le0?d({type:"quiz",quiz:t.quizzes[0]}):d(null)}else d(null)},[j,t.id,t.lessons.length,t.quizzes.length]),Ue=a.useCallback(h=>{if(!x?.uid||!y.current||y.current.type!=="lesson")return;const A=y.current.lesson.id;(async()=>{try{await xa(x.uid,A,h)}catch(T){console.warn("[ModuleDetailView] Failed to persist lesson progress:",T)}})()},[x?.uid,t.id]);if(r)if(r.type==="lesson"){const h=ve.get(r.lesson.id)?.[0]??null,A=h?B.has(h.id)||h.completed:!1;return e.jsx(an,{lesson:r.lesson,lessonCompletionXP:10,practiceQuiz:h,practiceQuizCompleted:A,initialSection:r.returnFromQuiz?-1:0,onBack:_e,onStartPractice:Ve,onProgressUpdate:Ue,onComplete:$e})}else return m?e.jsx(Ys,{quiz:{id:r.quiz.id,title:r.quiz.title,subject:Dt.find(h=>h.modules.some(A=>A.id===t.id))?.title||"Mathematics",difficulty:"Medium",questions:m.length,duration:r.quiz.duration||"15 min",xpReward:50,type:"practice",completed:r.quiz.completed,locked:!1,loadedQuestions:m,source:"ai_generated"},onClose:()=>{p(null),D?(d({type:"lesson",lesson:D,returnFromQuiz:!0}),b(null)):d(null),l&&l(!1)},onComplete:(h,A)=>{x?.uid&&j&&(async()=>{try{await ua(x.uid,j,t.id,r.quiz.id,h,[],0,A),await ps(x.uid,j,t.id,t.lessons.length,t.quizzes.length),await us(x.uid,M)}catch(T){console.warn("[Quiz] Progress persist failed:",T)}n&&n(A??0,"Quiz Complete! +"+(A??0)+" XP")})()},studentId:x?.uid}):e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl p-6 flex flex-col items-center gap-3 shadow-xl",children:[e.jsx(qs,{size:36,className:"animate-spin text-indigo-600"}),e.jsx("p",{className:"font-bold text-slate-700",children:"Generating Quiz..."}),e.jsxs("p",{className:"text-sm text-slate-500",children:["AI is crafting questions for ",r.quiz.title]})]})});return e.jsxs("div",{className:"h-full overflow-y-auto scrollbar-hide px-4 md:px-6 lg:px-10 py-4 md:py-6 lg:py-8 relative",children:[e.jsx("div",{className:"relative mb-4 lg:mb-6 xl:mb-8 w-full lg:w-max",children:e.jsxs("button",{onClick:s,className:"flex items-center gap-2 px-4 py-2.5 rounded-full bg-white/80 backdrop-blur-xl border border-slate-200/60 text-slate-600 hover:text-indigo-600 font-bold text-sm tracking-wide transition-all hover:-translate-x-1 shadow-sm hover:shadow-md",children:[e.jsx(Zt,{size:18}),"Back"]})}),e.jsxs(S.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:`relative mb-6 lg:mb-8 rounded-[2rem] ${t.accentColor} shadow-[0_20px_40px_-15px_rgba(0,0,0,0.3)] shrink-0 overflow-hidden`,children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 pointer-events-none z-0"}),e.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none module-detail-grid-pattern"}),e.jsx("div",{className:"absolute top-0 right-0 w-[400px] h-[400px] bg-sky-500/20 blur-[100px] rounded-full pointer-events-none"}),e.jsxs("div",{className:"relative p-5 md:p-6 lg:p-8 flex flex-col md:flex-row md:items-center justify-between gap-3 md:gap-5",children:[e.jsxs("div",{className:"flex-1 text-white",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2 md:mb-2.5",children:[e.jsxs("div",{className:"px-2.5 py-0.5 bg-white/10 backdrop-blur-md rounded-full text-[10px] font-black uppercase tracking-widest text-[#f8fafc] border border-white/20 shadow-sm flex items-center gap-1",children:[e.jsx(ws,{size:12})," Chapter ",t.id.split("-").pop()||"1"]}),e.jsxs("div",{className:"px-2.5 py-0.5 bg-white/10 backdrop-blur-md rounded-full text-[10px] font-black uppercase tracking-widest text-emerald-400 border border-emerald-400/30",children:["Lv ",W]})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("span",{className:"flex lg:hidden text-white/80 shrink-0",children:e.jsx(Fe,{size:18,strokeWidth:1.5})}),e.jsx("h1",{className:"text-lg md:text-2xl lg:text-3xl font-display font-black text-white tracking-[-0.02em] leading-tight",children:t.title})]}),e.jsx("p",{className:"text-slate-300 text-xs md:text-sm max-w-2xl font-medium leading-relaxed mb-3",children:t.description}),e.jsxs("div",{className:"bg-black/20 backdrop-blur-md rounded-xl p-2 md:p-3 border border-white/10 max-w-xl",children:[e.jsxs("div",{className:"flex justify-between items-end gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Tt,{size:16,className:"text-emerald-400"}),e.jsx("span",{className:"text-[11px] md:text-xs font-black text-white uppercase tracking-wider",children:"Module Mastery"})]}),e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsxs("span",{className:"text-[10px] md:text-xs font-bold text-slate-400",children:[Oe,"/",ge]}),e.jsxs("span",{className:"text-base md:text-lg font-black text-white shrink-0 leading-none",children:[Math.round(Se),"%"]})]})]}),e.jsx("div",{className:"h-2 bg-black/40 rounded-full overflow-hidden shadow-inner ring-1 ring-white/10 p-0.5 mt-2",children:e.jsx(S.div,{initial:{width:0},animate:{width:`${Se}%`},transition:{duration:1.5,ease:"easeOut",delay:.2},className:`h-full rounded-full relative ${Se===100?"bg-gradient-to-r from-emerald-400 to-teal-300":t.accentColor}`,children:e.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=')] opacity-30 mix-blend-overlay"})})})]})]}),e.jsxs("div",{className:"hidden lg:flex w-32 h-32 bg-white/5 rounded-2xl border border-white/10 backdrop-blur-md items-center justify-center transform rotate-[-3deg] shadow-2xl relative group hover:rotate-0 transition-all duration-500 shrink-0",children:[e.jsx("div",{className:`absolute inset-0 opacity-40 rounded-2xl ${t.progress===100?"bg-gradient-to-br from-emerald-400 to-teal-600":t.accentColor}`}),Se===100?e.jsx(ns,{size:56,className:"text-white drop-shadow-xl z-10 scale-100 group-hover:scale-110 transition-transform duration-500",strokeWidth:1}):e.jsx(Fe,{size:56,className:"text-white drop-shadow-xl z-10 scale-100 group-hover:scale-110 transition-transform duration-500",strokeWidth:1}),e.jsx(S.div,{animate:{y:[-5,5,-5],rotate:[-10,10,-10]},transition:{duration:4,repeat:1/0},className:"absolute top-4 left-4 text-emerald-300 z-20",children:e.jsx($s,{size:16,fill:"currentColor"})}),e.jsx(S.div,{animate:{y:[5,-5,5],rotate:[10,-10,10]},transition:{duration:3.5,repeat:1/0},className:"absolute bottom-6 right-4 text-sky-300 z-20",children:e.jsx(ks,{size:18})})]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto pr-2 pb-8 scrollbar-hide",children:e.jsxs("div",{className:"relative rounded-[2rem] border border-slate-200 bg-white/90 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none bg-[radial-gradient(circle_at_top_right,rgba(153,86,222,0.08),transparent_45%),radial-gradient(circle_at_bottom_left,rgba(31,167,225,0.08),transparent_45%)]"}),e.jsxs("div",{className:"relative z-10 px-4 sm:px-6 md:px-8 py-5 md:py-6 border-b border-slate-200/70 bg-white/70 backdrop-blur-sm flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("h2",{className:"font-display font-black text-xl md:text-2xl text-slate-800 flex items-center gap-3",children:[e.jsx(Fe,{size:24,className:"text-sky-500"}),"Study Journey"]}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("div",{className:"text-xs md:text-sm font-bold bg-sky-100 text-sky-700 px-3 py-1 rounded-full shadow-sm border border-sky-200/50",children:["Lessons ",se,"/",t.lessons.length]}),e.jsxs("div",{className:"text-xs md:text-sm font-bold bg-rose-100 text-rose-700 px-3 py-1 rounded-full shadow-sm border border-rose-200/50",children:["Quizzes ",C,"/",t.quizzes.length]})]})]}),e.jsxs("div",{className:"relative z-10 px-3 md:px-6 lg:px-8 py-4 md:py-6 space-y-4 md:space-y-5",children:[t.lessons.map((h,A)=>{const T=I.has(h.id)||h.completed,X=oe(h.id,T),$=E[A%E.length];return e.jsxs(je.Fragment,{children:[e.jsxs(S.div,{initial:{opacity:0,y:14},animate:{opacity:1,y:0},transition:{delay:A*.05},className:`relative rounded-[1.5rem] border overflow-hidden group transition-all duration-500 mb-4 md:mb-6 ${h.locked?"border-slate-200 opacity-65 saturate-50":"border-slate-200/80 hover:border-slate-300 hover:shadow-[0_16px_40px_-15px_rgba(0,0,0,0.12)] hover:-translate-y-0.5"}`,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[6px] z-20 bg-slate-100 overflow-hidden",children:e.jsx(S.div,{initial:{width:0},animate:{width:`${Math.max(2,X)}%`},transition:{duration:1.2,ease:"easeOut",delay:.1+A*.05},className:"h-full relative",style:{backgroundColor:$},children:e.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=')] opacity-30 mix-blend-overlay"})})}),e.jsx("div",{className:"absolute inset-0 bg-white transition-opacity duration-500 group-hover:opacity-90",style:{backgroundImage:`linear-gradient(to right, ${$}44 0%, ${$}11 50%, white 100%)`}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.2] pointer-events-none",style:{backgroundImage:`radial-gradient(circle at 2px 2px, ${$} 1.5px, transparent 0)`,backgroundSize:"24px 24px"}}),e.jsx("div",{className:"absolute -top-12 -left-10 h-40 w-40 rounded-full blur-[32px] pointer-events-none transition-transform duration-700 group-hover:scale-[1.3] group-hover:translate-x-4",style:{backgroundColor:`${$}22`}}),e.jsx("div",{className:"absolute -bottom-8 right-8 h-32 w-32 rounded-full blur-2xl pointer-events-none transition-transform duration-700 group-hover:scale-125 group-hover:-translate-y-4",style:{backgroundColor:`${$}11`}}),e.jsx("div",{className:"absolute right-4 top-4 opacity-10 pointer-events-none transition-all duration-500 group-hover:rotate-12 group-hover:scale-110 drop-shadow-sm",style:{color:$},children:e.jsx(ks,{size:56,strokeWidth:1})}),e.jsx("div",{className:"absolute right-16 bottom-5 opacity-10 pointer-events-none transition-all duration-500 group-hover:-rotate-6 group-hover:-translate-y-2 drop-shadow-sm",style:{color:$},children:e.jsx(Fe,{size:40,strokeWidth:1})}),e.jsxs("div",{className:"relative z-10 p-3 md:p-5 pt-5 md:pt-6 space-y-3 md:space-y-4",children:[e.jsxs("button",{type:"button",onClick:()=>!h.locked&&d({lesson:h,type:"lesson"}),className:`w-full text-left flex flex-wrap items-center justify-between gap-2 md:gap-3 rounded-2xl px-3 md:px-5 py-3 md:py-4 transition shadow-sm ${h.locked?"cursor-not-allowed border border-slate-200 bg-white/70":"cursor-pointer bg-white hover:bg-slate-50"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-4 min-w-0",children:[e.jsx("div",{className:`w-10 h-10 md:w-12 md:h-12 rounded-full flex items-center justify-center shrink-0 transition-colors shadow-sm ${h.locked?"bg-slate-100 text-slate-400":"text-white"}`,style:h.locked?{}:T?{backgroundColor:"#0ea5e9"}:{backgroundColor:$},children:h.locked?e.jsx(Os,{size:16}):T?e.jsx(Xs,{size:20}):e.jsx(_a,{size:18,className:"ml-0.5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"text-[10px] md:text-[12px] font-black uppercase tracking-wider text-slate-500 mb-0.5",children:["Lesson ",A+1]}),e.jsx("h3",{className:"font-bold text-[14px] md:text-[18px] text-[#0a1628] leading-tight line-clamp-2",children:h.title})]})]}),e.jsx("div",{className:"flex items-center justify-end shrink-0",children:e.jsxs("span",{className:"inline-flex items-center gap-1 text-slate-500 text-[11px] md:text-sm font-semibold bg-slate-100/80 px-2 md:px-3 py-1 md:py-1.5 rounded-lg md:rounded-xl",children:[e.jsx(Nt,{size:12}),h.duration]})})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 md:gap-3 px-0.5 md:px-1",children:[e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full bg-white px-3 md:px-4 py-1 md:py-1.5 text-[11px] md:text-[12px] font-bold shadow-sm transition hover:-translate-y-0.5",style:{color:$},children:[e.jsx(Fe,{size:12})," Study Materials"]}),e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full bg-white px-3 md:px-4 py-1 md:py-1.5 text-[11px] md:text-[12px] font-bold shadow-sm transition hover:-translate-y-0.5",style:{color:$},children:[e.jsx(ws,{size:12})," Quiz"]})]})]})]}),G&&A===We-1&&e.jsxs(S.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{delay:.15+A*.03},className:"mt-4 md:mt-6 mb-4 md:mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-4 mb-4 md:mb-6",children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-[10px] md:text-xs font-bold text-indigo-400 uppercase tracking-widest text-center",children:"mid-module checkpoint"}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),e.jsxs("div",{className:"relative rounded-[1.5rem] bg-[#533ab6] p-3 md:p-5 shadow-lg overflow-hidden group transition-all hover:shadow-xl hover:-translate-y-1",children:[e.jsx("div",{className:"absolute right-2 md:right-10 top-1/2 -translate-y-1/2 text-white/5 text-[80px] md:text-[140px] font-black font-display pointer-events-none group-hover:scale-110 transition-transform duration-500",children:"?"}),e.jsxs("div",{className:"relative z-10 flex flex-wrap items-center gap-3 md:gap-5",children:[e.jsx("div",{className:"w-12 h-12 md:w-14 md:h-14 rounded-[12px] md:rounded-[14px] bg-white/10 backdrop-blur-md border border-white/10 shrink-0 flex items-center justify-center shadow-inner",children:e.jsx(et,{size:22,className:"text-rose-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[9px] md:text-[11px] font-black uppercase tracking-widest text-[#a3b1ee] mb-0.5 md:mb-1 drop-shadow-sm",children:"COMPETENCY CHECK · General Quiz"}),e.jsx("h3",{className:"font-display font-medium text-[16px] md:text-[22px] text-white leading-tight mb-1 md:mb-2 tracking-tight",children:G.title}),e.jsxs("p",{className:"text-[11px] md:text-xs font-semibold text-white/80 flex flex-wrap items-center gap-2 md:gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Jt,{size:11})," ",G.questions," Qs"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Nt,{size:11})," ",G.duration]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-amber-300 drop-shadow-md",children:[e.jsx(Xe,{size:11,className:"fill-amber-300"})," +50 XP"]})]})]}),e.jsx("button",{type:"button",onClick:()=>!G.locked&&(d({quiz:G,type:"quiz"}),l&&l(!0)),className:`px-4 md:px-6 py-2 md:py-2.5 rounded-xl text-[11px] md:text-sm font-bold tracking-wider transition-all backdrop-blur-sm self-center shrink-0 ${G.locked?"bg-white/5 text-white/30 border border-white/10 cursor-not-allowed":u&&(B.has(G.id)||G.completed)?"bg-white/20 text-white border border-white/40 hover:bg-white/30 shadow-sm":"bg-transparent text-white border border-white/40 hover:bg-white/10 shadow-sm"}`,children:u&&(B.has(G.id)||G.completed)?"REVIEW":"START"})]})]})]})]},h.id)}),t.lessons.length===0&&G&&e.jsxs("div",{className:"relative rounded-[1.5rem] bg-[#533ab6] p-5 shadow-lg overflow-hidden group",children:[e.jsx("div",{className:"absolute right-4 md:right-10 top-1/2 -translate-y-1/2 text-white/5 text-[140px] font-black font-display pointer-events-none group-hover:scale-110 transition-transform duration-500",children:"?"}),e.jsxs("div",{className:"relative z-10 flex flex-wrap items-center justify-between gap-4 md:gap-5",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx("div",{className:"w-14 h-14 rounded-[14px] bg-white/10 backdrop-blur-md border border-white/10 shrink-0 flex items-center justify-center shadow-inner",children:e.jsx(et,{size:28,className:"text-rose-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] md:text-[11px] font-black uppercase tracking-widest text-[#a3b1ee] mb-1 drop-shadow-sm",children:"COMPETENCY CHECK · General Quiz"}),e.jsx("h3",{className:"font-display font-medium text-[20px] md:text-[22px] text-white leading-tight mb-2 tracking-tight",children:G.title}),e.jsxs("p",{className:"text-xs font-semibold text-white/80 flex items-center gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Jt,{size:12})," ",G.questions," Qs"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Nt,{size:12})," ",G.duration]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-amber-300 drop-shadow-md",children:[e.jsx(Xe,{size:12,className:"fill-amber-300"})," +50 XP"]})]})]})]}),e.jsx("button",{type:"button",onClick:()=>!G.locked&&(d({quiz:G,type:"quiz"}),l&&l(!0)),className:`px-6 py-2.5 rounded-xl text-xs md:text-sm font-bold tracking-wider transition-all backdrop-blur-sm self-center shrink-0 ${G.locked?"bg-white/5 text-white/30 border border-white/10 cursor-not-allowed":u&&(B.has(G.id)||G.completed)?"bg-white/20 text-white border border-white/40 hover:bg-white/30 shadow-sm":"bg-transparent text-white border border-white/40 hover:bg-white/10 shadow-sm"}`,children:u&&(B.has(G.id)||G.completed)?"REVIEW":"START"})]})]})]})]})})]})},cn={"Patterns, Relations, and Functions":{icon:At,bg:"bg-indigo-500"},"Financial Mathematics":{icon:Ia,bg:"bg-emerald-500"},"Logic and Mathematical Reasoning":{icon:pa,bg:"bg-purple-500"},"Random Variables":{icon:sr,bg:"bg-orange-500"},"Normal Distribution":{icon:La,bg:"bg-sky-500"},"Sampling and Estimation":{icon:er,bg:"bg-teal-500"},"Hypothesis Testing":{icon:nr,bg:"bg-rose-500"},"Correlation and Regression":{icon:Va,bg:"bg-amber-500"}};function dn(t){return cn[t]||{icon:Jt,bg:"bg-slate-500"}}const mn=({userId:t,onStartQuiz:s,searchQuery:n="",allowedSubjectIds:i})=>{const{userProfile:l}=Bt(),[c,r]=a.useState("all"),[d,x]=a.useState("Medium"),[f,M]=a.useState(null),[u,N]=a.useState(!1),[m,p]=a.useState(null),k=a.useMemo(()=>!i||i.length===0?bs:bs.filter(b=>i.includes(b.id)),[i]),y=a.useMemo(()=>k.flatMap(b=>b.topics.map(I=>({id:I.id,name:I.name,unit:I.unit,subject:b.name,subjectId:b.id}))),[k]),W=a.useMemo(()=>y.filter(b=>{const I=c==="all"||b.subject===c,B=!n||b.name.toLowerCase().includes(n.toLowerCase())||b.unit.toLowerCase().includes(n.toLowerCase())||b.subject.toLowerCase().includes(n.toLowerCase());return I&&B}),[y,c,n]);a.useEffect(()=>{t&&(N(!0),ln(t).then(M).catch(console.error).finally(()=>N(!1)))},[t]);const j=f?.quizzesCompleted??0,E=f?.totalXPEarned??l?.totalXP??0,_=f?.averageScore??0,D=a.useCallback(async b=>{if(!(!t||m)){p(b.id);try{const I={Easy:"Practice",Medium:"Challenge",Hard:"Mastery"},B=await Zs({userId:t,subject:b.subject,competency:b.name,difficulty:I[d],count:5}),se={id:B.session_id,title:`Practice Quiz: ${b.name} (AI)`,subject:b.subject,difficulty:d,questions:B.questions.length,duration:"10 min",xpReward:d==="Hard"?75:d==="Medium"?50:25,type:"practice",loadedQuestions:B.questions.map(C=>({id:C.id,questionType:"multiple_choice",question:C.question,options:C.options,correctAnswer:C.options[C.correct_index],bloomLevel:["remember","understand","apply","analyze"].includes(C.bloomsLevel?.toLowerCase()||"")?C.bloomsLevel.toLowerCase():"understand",difficulty:d.toLowerCase(),topic:b.name,subject:b.subject,points:10,explanation:C.explanation})),generatedQuizId:B.session_id,source:"ai_generated",completed:!1,locked:!1};s?.(se)}catch(I){console.error("Failed to generate practice quiz:",I)}finally{p(null)}}},[t,d,m,s]);return e.jsxs("div",{className:"px-4 sm:px-6 xl:px-10 py-4 sm:py-6",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2 sm:gap-4 mb-6",children:[e.jsxs(S.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-sky-700 to-sky-500 rounded-xl sm:rounded-2xl p-3 sm:p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-1 sm:mb-3 gap-1 sm:gap-0",children:[e.jsxs("div",{className:"w-8 h-8 sm:w-12 sm:h-12 bg-white/20 rounded-lg sm:rounded-xl flex items-center justify-center shrink-0",children:[e.jsx(Tt,{size:16,className:"sm:hidden"}),e.jsx(Tt,{size:24,className:"hidden sm:block"})]}),e.jsx("span",{className:"text-xl sm:text-3xl font-bold",children:j})]}),e.jsx("p",{className:"text-[10px] sm:text-sm font-medium text-sky-100 leading-tight",children:"Quizzes Completed"})]}),e.jsxs(S.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-rose-500 to-rose-600 rounded-xl sm:rounded-2xl p-3 sm:p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-1 sm:mb-3 gap-1 sm:gap-0",children:[e.jsxs("div",{className:"w-8 h-8 sm:w-12 sm:h-12 bg-white/20 rounded-lg sm:rounded-xl flex items-center justify-center shrink-0",children:[e.jsx(Xe,{size:16,className:"sm:hidden"}),e.jsx(Xe,{size:24,className:"hidden sm:block"})]}),e.jsx("span",{className:"text-xl sm:text-3xl font-bold",children:E.toLocaleString()})]}),e.jsx("p",{className:"text-[10px] sm:text-sm font-medium text-cyan-100 leading-tight",children:"Total XP Earned"})]}),e.jsxs(S.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-indigo-600 to-indigo-700 rounded-xl sm:rounded-2xl p-3 sm:p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-1 sm:mb-3 gap-1 sm:gap-0",children:[e.jsxs("div",{className:"w-8 h-8 sm:w-12 sm:h-12 bg-white/20 rounded-lg sm:rounded-xl flex items-center justify-center shrink-0",children:[e.jsx(et,{size:16,className:"sm:hidden"}),e.jsx(et,{size:24,className:"hidden sm:block"})]}),e.jsxs("span",{className:"text-xl sm:text-3xl font-bold",children:[Math.round(_),"%"]})]}),e.jsx("p",{className:"text-[10px] sm:text-sm font-medium text-sky-100 leading-tight",children:"Average Score"})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 mb-6",children:[e.jsxs("select",{value:c,onChange:b=>r(b.target.value),className:"w-full sm:w-auto px-3 sm:px-4 py-2 sm:py-2.5 bg-white border-2 border-[#dde3eb] rounded-xl text-xs sm:text-sm font-bold text-[#0a1628] focus:border-indigo-600 focus:outline-none",children:[e.jsx("option",{value:"all",children:"All Subjects"}),k.map(b=>e.jsx("option",{value:b.name,children:b.name},b.id))]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 bg-white rounded-xl p-1 shadow-sm",children:[e.jsx("span",{className:"px-2 text-xs font-bold text-slate-400",children:"Difficulty:"}),["Easy","Medium","Hard"].map(b=>e.jsx("button",{onClick:()=>x(b),className:`px-3 py-1.5 rounded-lg text-xs font-bold transition-all whitespace-nowrap ${d===b?b==="Easy"?"bg-green-500 text-white shadow-sm":b==="Medium"?"bg-orange-500 text-white shadow-sm":"bg-red-500 text-white shadow-sm":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:b},b))]})]}),m&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl p-6 flex flex-col items-center gap-3 shadow-xl",children:[e.jsx(qs,{size:36,className:"animate-spin text-indigo-600"}),e.jsx("p",{className:"font-bold text-slate-700",children:"Generating Quiz..."}),e.jsx("p",{className:"text-sm text-slate-500",children:"AI is crafting questions from curriculum"})]})}),e.jsxs("div",{className:"pr-2 pb-4 rounded-[2rem] border border-slate-200 shadow-inner relative",style:{backgroundImage:"radial-gradient(#CBD5E1 1px, transparent 1px)",backgroundSize:"24px 24px",backgroundPosition:"-12px -12px",backgroundColor:"#FAFAFA"},children:[e.jsx("div",{className:"absolute left-12 top-0 bottom-0 w-0.5 bg-rose-200/60 pointer-events-none z-0"}),e.jsx("div",{className:"absolute left-[54px] top-0 bottom-0 w-px bg-rose-100/40 pointer-events-none z-0"}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-5 p-4 md:p-6 relative z-10",children:W.map((b,I)=>e.jsx(S.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:I*.03},onClick:()=>D(b),className:`bg-white/90 backdrop-blur-sm rounded-2xl p-4 md:p-5 border-2 relative select-none transition-all duration-300 ${m===b.id?"border-indigo-300 opacity-80 cursor-wait":m?"border-slate-200 opacity-60 cursor-not-allowed":"border-slate-200 shadow-sm hover:border-indigo-300 hover:shadow-md cursor-pointer"} group`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3 md:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 md:gap-4 flex-1",children:[(()=>{const{icon:B,bg:se}=dn(b.unit);return e.jsx("div",{className:`w-10 h-10 md:w-12 md:h-12 rounded-xl flex items-center justify-center shrink-0 shadow-sm transform group-hover:rotate-3 transition-transform ${se} text-white`,children:e.jsx(B,{size:18})})})(),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsxs("span",{className:`px-2 py-0.5 rounded-[6px] text-[9px] md:text-[10px] font-black uppercase tracking-wider ${d==="Easy"?"bg-green-100 text-green-700":d==="Medium"?"bg-orange-100 text-orange-700":"bg-red-100 text-red-700"}`,children:["AI ","•"," ",d]}),e.jsx("span",{className:"w-1.5 h-1.5 md:w-2 md:h-2 rounded-full bg-emerald-500 animate-pulse"})]}),e.jsx("h3",{className:"font-bold text-[14px] md:text-[16px] leading-tight mb-1 md:mb-1.5 text-[#0a1628] transition-colors",children:b.name}),e.jsxs("p",{className:"text-[11px] md:text-[12px] text-slate-500 mb-1.5 line-clamp-1",children:[b.subject," — ",b.unit]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-3 text-[11px] md:text-[12px] font-bold text-slate-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{size:12})," 5 Qs"]}),e.jsx("span",{className:"hidden sm:inline",children:"•"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Nt,{size:12})," 10 min"]}),e.jsx("span",{className:"hidden sm:inline",children:"•"}),e.jsxs("span",{className:"flex items-center gap-1 text-rose-500",children:[e.jsx(ns,{size:12})," +",d==="Hard"?75:d==="Medium"?50:25," XP"]})]})]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx("div",{className:`px-3 py-1.5 md:px-4 md:py-2 rounded-xl text-[11px] md:text-[12px] font-black uppercase tracking-wider shadow-sm transition-all ${m===b.id?"bg-indigo-100 text-indigo-600":"bg-indigo-500 text-white group-hover:bg-indigo-600 shadow-indigo-200"}`,children:m===b.id?"Loading...":"Start"})})]})},b.id))}),W.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-slate-500 relative z-10",children:[e.jsx(et,{size:48,className:"mb-3"}),e.jsx("p",{className:"font-medium",children:"No topics found"}),e.jsx("p",{className:"text-sm",children:"Try adjusting your filters or search query"})]})]})]})},xn=` + @keyframes head-sway { + 0%, 100% { transform: rotate(-2deg) translateY(0); } + 50% { transform: rotate(2deg) translateY(-2px); } + } + @keyframes horn-left-wiggle { + 0%, 100% { transform: rotate(-4deg); } + 50% { transform: rotate(4deg); } + } + @keyframes horn-right-wiggle { + 0%, 100% { transform: rotate(4deg); } + 50% { transform: rotate(-4deg); } + } + @keyframes blink { + 0%, 90%, 100% { transform: scaleY(1); } + 95% { transform: scaleY(0.1); } + } + @keyframes mouth-talk { + 0%, 100% { transform: scaleY(1) scaleX(1); } + 25% { transform: scaleY(1.1) scaleX(0.98); } + 50% { transform: scaleY(0.9) scaleX(1.02); } + 75% { transform: scaleY(1.05) scaleX(0.98); } + } + .animate-head-sway { + transform-origin: 50% 75%; + animation: head-sway 4s ease-in-out infinite; + } + .animate-horn-left { + transform-origin: 50% 45%; + animation: horn-left-wiggle 4s ease-in-out infinite; + } + .animate-horn-right { + transform-origin: 50% 45%; + animation: horn-right-wiggle 4s ease-in-out infinite; + } + .animate-blink { + transform-origin: 50% 45%; + animation: blink 3.7s ease-in-out infinite; + } + .animate-mouth { + transform-origin: 50% 55%; + animation: mouth-talk 3s ease-in-out infinite; + } +`,Is=({assessmentDismissed:t,initialAssessmentCompleted:s})=>{const n="absolute inset-0 w-full h-full object-contain",[i,l]=a.useState(!1);a.useEffect(()=>{t&&!s&&!sessionStorage.getItem("mathpulse_assessment_reminder_shown")?l(!0):l(!1)},[t,s]);const c=()=>{sessionStorage.setItem("mathpulse_assessment_reminder_shown","true"),l(!1),window.dispatchEvent(new CustomEvent("mathpulse:open-assessment"))};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:xn}),e.jsxs("div",{className:"relative w-full h-[250px] flex items-end justify-center drop-shadow-sm select-none pointer-events-none",children:[i&&e.jsxs(S.div,{initial:{opacity:0,scale:.8,x:10},animate:{opacity:1,scale:1,x:0},className:"absolute top-0 right-0 z-50 max-w-[180px] bg-white rounded-2xl shadow-lg border border-[#dde3eb] p-3 cursor-pointer pointer-events-auto",onClick:c,children:[e.jsx("p",{className:"text-[11px] font-bold text-[#0a1628] leading-snug",children:"Psst! Complete your assessment for a personalized path!"}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-purple-500 rounded-full animate-pulse"}),e.jsx("span",{className:"text-[10px] text-[#5a6578] font-medium",children:"Tap to start"})]}),e.jsx("div",{className:"absolute -bottom-2 left-4 w-3 h-3 bg-white border-r border-b border-[#dde3eb] rotate-45"})]}),e.jsx("img",{src:"/mascot/modules_avatar_body.png",alt:"Desk setup",className:`${n} z-10`}),e.jsxs("div",{className:`${n} z-20 animate-head-sway`,children:[e.jsx("img",{src:"/mascot/modules_left_horn.png",alt:"Left Horn",className:`${n} z-0 animate-horn-left`}),e.jsx("img",{src:"/mascot/modules_right_horn.png",alt:"Right Horn",className:`${n} z-0 animate-horn-right`}),e.jsx("img",{src:"/mascot/modules_head.png",alt:"Mascot Head",className:`${n} z-[1]`}),e.jsx("img",{src:"/mascot/modules_eyes.png",alt:"Eyes",className:`${n} z-[2] animate-blink`}),e.jsx("img",{src:"/mascot/modules_mouth.png",alt:"Mouth",className:`${n} z-[3] animate-mouth`})]})]})]})},Ds={common:"bg-slate-100 text-slate-500",rare:"bg-blue-50 text-blue-500",epic:"bg-amber-50 text-amber-500"},Rs=["bg-[#1FA7E1]/80 text-white","bg-[#9956DE]/80 text-white","bg-[#FFB356]/90 text-white","bg-[#7274ED]/80 text-white","bg-[#1FA7E1]/80 text-white","bg-[#9956DE]/80 text-white","bg-gradient-to-r from-[#FFB356] to-[#FF8C00] text-white"],un=({isOpen:t,onClose:s,onClaim:n,weekRewards:i,todayReward:l,canClaim:c,isClaiming:r,claimedDays:d,currentDayIndex:x,timeUntilReset:f})=>{const[M,u]=a.useState(!1);if(!t)return null;const N=()=>{if(!c||M)return;u(!0),l?.rarity==="epic"?gs({particleCount:150,spread:80,origin:{y:.6},colors:["#FFD700","#FFA500","#FF8C00","#FF6B6B","#4ade80"]}):gs({particleCount:100,spread:70,origin:{y:.6},colors:["#FFD700","#FFA500","#FF8C00"]}),setTimeout(()=>{u(!1),n()},1200)},m=E=>E+1,p=E=>E===x,k=E=>d.includes(E),y=E=>E>x,W=i.slice(0,6),j=i[6];return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-8",children:[e.jsx(ot,{children:t&&e.jsx(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-slate-900/60 backdrop-blur-sm",onClick:s})}),e.jsxs(S.div,{initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},className:"relative w-full max-w-[420px] bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] shadow-2xl flex flex-col items-center p-5 overflow-visible",children:[e.jsxs("div",{className:"absolute -top-6 w-[85%] h-12 bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] rounded-xl shadow-lg flex items-center justify-center z-20",children:[e.jsx("div",{className:"absolute -left-2.5 -z-10 w-5 h-8 bg-[#633299] rounded-l-full rotate-12 top-1.5"}),e.jsx("div",{className:"absolute -right-2.5 -z-10 w-5 h-8 bg-[#10709b] rounded-r-full -rotate-12 top-1.5"}),e.jsx("h2",{className:"text-white font-black text-lg tracking-wide uppercase drop-shadow-sm font-display",children:"Daily Rewards"})]}),e.jsx("button",{onClick:s,className:"absolute -right-3 -top-3 w-8 h-8 bg-white hover:bg-slate-100 border border-slate-200 text-slate-500 hover:text-slate-800 rounded-full flex items-center justify-center z-30 shadow-md transition-transform hover:scale-105 active:scale-95",children:e.jsx(Je,{size:16,strokeWidth:3})}),e.jsxs("div",{className:"mt-6 mb-2 text-center w-full",children:[e.jsx("h3",{className:"text-xl font-bold text-slate-800 font-display mt-2",children:"Welcome Back!"}),e.jsx("p",{className:"text-slate-500 font-medium text-xs mt-0.5",children:"Claim your daily reward for today."})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 w-full mb-5 relative z-10",children:[W.map((E,_)=>{const D=m(_),b=k(_),I=p(_),B=y(_);return e.jsxs("div",{className:`relative rounded-xl flex flex-col overflow-hidden border-[1.5px] transition-all ${I&&!b?"border-amber-400 shadow-[0_0_15px_rgba(251,191,36,0.25)] scale-105 z-10 bg-amber-50":b?"border-[#dde3eb] bg-slate-200/50":"border-[#dde3eb] bg-white"}`,children:[e.jsxs("div",{className:`py-0.5 text-center font-black text-[10px] uppercase tracking-wider ${I&&!b?"bg-amber-400 text-amber-900":Rs[_]}`,children:["Day ",D]}),e.jsx("div",{className:"absolute top-5 right-1 z-10",children:e.jsx("span",{className:`text-[8px] font-bold uppercase px-1 rounded ${Ds[E.rarity]}`,children:E.rarity})}),e.jsxs("div",{className:"flex-1 p-2 flex flex-col items-center justify-center relative min-h-[75px]",children:[b&&e.jsxs(S.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",bounce:.5},className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"w-12 h-12 rounded-full bg-emerald-200/50"})}),e.jsxs("div",{className:"relative w-14 h-14 rounded-full border-[3px] border-emerald-500 bg-emerald-100 flex items-center justify-center transform -rotate-12 shadow-lg",children:[e.jsx(Xs,{className:"w-8 h-8 text-emerald-600"}),e.jsx("div",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 bg-emerald-500 rounded-md px-2 py-0.5 border-2 border-emerald-300 shadow-md",children:e.jsx("span",{className:"text-[9px] font-black text-white uppercase tracking-wider leading-none whitespace-nowrap",children:"Claimed"})})]})]}),B&&e.jsx("div",{className:"absolute top-1 right-1 bg-slate-200 rounded-full p-0.5 z-10",children:e.jsx(Os,{size:8,className:"text-slate-400"})}),e.jsxs("div",{className:`flex flex-col items-center transition-all w-full ${b?"opacity-30 grayscale":""}`,children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center border-2 mb-1",style:{backgroundColor:E.color+"20",borderColor:E.color+"40"},children:e.jsx("span",{className:"text-lg",children:E.icon})}),e.jsx("div",{className:`font-black text-xs leading-none mt-0.5 text-center ${I?"text-amber-600":b?"text-slate-500":"text-slate-600"}`,children:E.label})]})]})]},E.id)}),j&&e.jsxs("div",{className:`col-span-3 relative rounded-xl flex flex-col overflow-hidden border-[1.5px] transition-all mt-1 ${p(6)&&!k(6)?"border-amber-400 shadow-[0_0_20px_rgba(251,191,36,0.3)] scale-[1.02] z-10 bg-amber-50":k(6)?"border-[#dde3eb] bg-slate-200/50":"border-[#dde3eb] bg-white"}`,children:[e.jsx("div",{className:`py-1 text-center font-black text-[10px] uppercase tracking-widest ${p(6)&&!k(6)?"bg-amber-400 text-amber-900":Rs[6]}`,children:"Day 7 • Epic Reward"}),e.jsx("div",{className:"absolute top-6 right-2 z-10",children:e.jsx("span",{className:`text-[8px] font-bold uppercase px-1.5 py-0.5 rounded ${Ds[j.rarity]}`,children:j.rarity})}),e.jsxs("div",{className:"flex items-center justify-center gap-5 p-3 relative",children:[k(6)&&e.jsxs(S.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",bounce:.5},className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-rose-200/50"})}),e.jsxs("div",{className:"relative w-20 h-20 rounded-full border-[4px] border-rose-500 bg-rose-100 flex items-center justify-center transform rotate-12 shadow-lg",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"Claimed",className:"w-14 h-14 object-contain drop-shadow-md"}),e.jsx("div",{className:"absolute -bottom-3 left-1/2 -translate-x-1/2 bg-rose-500 rounded-md px-2.5 py-1 border-2 border-rose-300 shadow-md",children:e.jsx("span",{className:"text-[10px] font-black text-white uppercase tracking-wider leading-none whitespace-nowrap",children:"Claimed"})})]})]}),e.jsxs("div",{className:`flex items-center justify-center gap-5 w-full transition-all ${k(6)?"opacity-30 grayscale":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center border-2 shadow-sm mb-0.5",style:{backgroundColor:j.color+"20",borderColor:j.color+"40"},children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx("span",{className:`font-black text-sm ${p(6)?"text-amber-600":"text-slate-600"}`,children:j.label})]}),j.rarity==="epic"&&e.jsxs("div",{className:"relative mt-1",children:[e.jsx("div",{className:"w-14 h-14 bg-purple-50 rounded-xl flex items-center justify-center border-2 border-purple-200 shadow-sm",children:e.jsx(Da,{className:"w-8 h-8 text-purple-500 drop-shadow-md"})}),e.jsx("div",{className:"absolute -right-5 -bottom-4 w-14 h-14 bg-white rounded-xl p-1 border-2 border-amber-300 shadow-lg transform rotate-[-5deg]",children:e.jsx("img",{src:"/avatar/crown_thumbnail.png",alt:"Crown",className:"w-full h-full object-contain drop-shadow-md"})})]})]})]})]})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2 text-xs text-slate-400",children:[e.jsx(jr,{size:14}),e.jsx("span",{className:"font-mono font-medium",children:f}),e.jsx("span",{children:"until next reset"})]}),e.jsx(S.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:N,disabled:!c||r||M,className:`w-[85%] py-3 rounded-full font-black text-base tracking-wide uppercase shadow-lg transition-all mt-2 ${!c||r||M?"bg-slate-200 text-slate-400 cursor-not-allowed border border-slate-300":"bg-gradient-to-r from-[#FFB356] to-[#FF8C00] text-white hover:from-[#FFA500] hover:to-[#FF7F00] border-b-4 border-[#e67e00]"}`,children:r||M?"Claiming...":c?"Claim!":"Claimed"})]})]})};function pn(t){const[s,n]=a.useState({difficulty:"normal",loading:!0});return a.useEffect(()=>{if(!t){n({difficulty:"normal",loading:!1});return}const i=kt(tt,"users",t);return as(i,c=>{if(!c.exists()){n({difficulty:"normal",loading:!1});return}const d=c.data()?.moduleDifficulty||"normal";n({difficulty:["normal","easier","remedial"].includes(d)?d:"normal",loading:!1})},c=>{console.error("[useModuleDifficulty] snapshot error:",c),n({difficulty:"normal",loading:!1})})},[t]),s}function hn(t,s){return s==="normal"?t:s==="easier"?t.filter(n=>{const i=n.tags||[],l=n.difficulty||"";return i.some(c=>["foundation","basic","introductory"].includes(c.toLowerCase()))||["foundation","basic","introductory"].includes(l.toLowerCase())||!i.includes("advanced")&&!l.toLowerCase().includes("advanced")}):s==="remedial"?t.filter(n=>{const i=n.tags||[],l=n.difficulty||"";return i.some(c=>["remedial","review","catch-up"].includes(c.toLowerCase()))||["remedial","review","catch-up"].includes(l.toLowerCase())}):t}const fn=new Set([7,14,30,60,100]),Et={lastClaimedDate:"",lastClaimedWeekSeed:0,claimedDays:[],currentStreak:0,longestStreak:0,totalClaimed:0,hintTokens:0,streakShields:0,activeMultiplier:null};function bn(t){if(t<=0)return"00:00:00";const s=Math.floor(t/1e3),n=Math.floor(s/3600),i=Math.floor(s%3600/60),l=s%60;return`${String(n).padStart(2,"0")}:${String(i).padStart(2,"0")}:${String(l).padStart(2,"0")}`}function gn(){const t=is();return t.setDate(t.getDate()-1),ls(t)}function Js(t){return t?new Date(t.expiresAt).getTime()>Date.now():!1}function ea(t){return kt(tt,"users",t,"dailyRewards",t)}function yn(t){return kt(tt,"users",t)}async function Fs(t){try{const s=ea(t),n=await Yt(s);if(!n.exists())return{...Et};const i=n.data(),l=os();return i.lastClaimedWeekSeed&&i.lastClaimedWeekSeed!==l?{...i,claimedDays:[],lastClaimedWeekSeed:l}:{...Et,...i,activeMultiplier:i.activeMultiplier&&Js(i.activeMultiplier)?i.activeMultiplier:null}}catch(s){return console.error("[dailyRewardService] Error getting state:",s),{...Et}}}function wn(t){const s=ls();return t.lastClaimedDate!==s}async function jn(t){const s=ls(),n=os(),i=cs(),c=ds()[i];if(!c)throw new Error(`No reward found for day index ${i}`);try{const r=await ra(tt,async x=>{const f=ea(t),M=yn(t),u=await x.get(f),N=await x.get(M);let m;if(u.exists()?m={...Et,...u.data()}:(m={...Et,lastClaimedWeekSeed:n},x.set(f,m)),m.lastClaimedWeekSeed!==n&&(m.claimedDays=[],m.lastClaimedWeekSeed=n),m.lastClaimedDate===s)return{code:"ALREADY_CLAIMED",state:m};let p=m.currentStreak,k=!1;if(!m.lastClaimedDate||m.currentStreak===0)p=1;else{const _=gn();m.lastClaimedDate===_?p=m.currentStreak+1:m.streakShields>0?(m.streakShields-=1,p=m.currentStreak+1,k=!0):p=1}const y=Math.max(m.longestStreak,p);let W=0,j=1;switch(c.type){case"xp":{const _=typeof c.value=="number"?c.value:parseInt(c.value,10)||0;j=Js(m.activeMultiplier)?m.activeMultiplier?.multiplier??1:1,W=Math.floor(_*j);break}case"hint_token":{const _=typeof c.value=="number"?c.value:parseInt(c.value,10)||0;m.hintTokens+=_;break}case"streak_shield":{const _=typeof c.value=="number"?c.value:parseInt(c.value,10)||0;m.streakShields+=_;break}case"xp_multiplier":{const _=typeof c.value=="number"?c.value:parseInt(c.value,10)||60,D=c.id.includes("2")?2:1.5,b=new Date;b.setMinutes(b.getMinutes()+_),m.activeMultiplier={multiplier:D,expiresAt:b.toISOString()};break}case"badge_unlock":break}const E=[...m.claimedDays,i];return m.lastClaimedDate=s,m.currentStreak=p,m.longestStreak=y,m.totalClaimed+=1,x.set(f,m,{merge:!0}),N.exists()&&x.update(M,{hintTokens:m.hintTokens,streakShields:m.streakShields,activeMultiplier:m.activeMultiplier,lastClaimedDate:m.lastClaimedDate,updatedAt:na()}),{code:"SUCCESS",state:m,newClaimedDays:E,newStreak:p,newLongestStreak:y,xpAwarded:W,multiplierApplied:j,streakPreserved:k}});if(r.code==="ALREADY_CLAIMED")return{success:!1,reward:c,dayIndex:i,streakAfter:r.state.currentStreak,longestStreakAfter:r.state.longestStreak,hintTokensAfter:r.state.hintTokens,streakShieldsAfter:r.state.streakShields,streakPreserved:!1,xpAwarded:0,multiplierApplied:1,isMilestone:!1,error:"Already claimed today"};if(r.xpAwarded>0)try{await ha(t,r.xpAwarded,"daily_reward",`Daily Reward Day ${i+1}! +${r.xpAwarded} XP`)}catch(x){console.error("[dailyRewardService] Error awarding XP:",x)}if(c.type==="badge_unlock"&&typeof c.value=="string")try{await Qs(t,c.value)}catch(x){console.error("[dailyRewardService] Error unlocking avatar item:",x)}const d=fn.has(r.newStreak);return{success:!0,reward:c,dayIndex:i,streakAfter:r.newStreak,longestStreakAfter:r.newLongestStreak,hintTokensAfter:r.state.hintTokens,streakShieldsAfter:r.state.streakShields,streakPreserved:r.streakPreserved,xpAwarded:r.xpAwarded,multiplierApplied:r.multiplierApplied,isMilestone:d}}catch(r){throw console.error("[dailyRewardService] Error claiming daily reward:",r),r}}function vn(t){const[s,n]=a.useState(null),[i,l]=a.useState(!1),[c,r]=a.useState(!1),[d,x]=a.useState(null),[f,M]=a.useState(null),[u,N]=a.useState("00:00:00"),m=a.useRef(null),p=a.useMemo(()=>ds(),[]),k=a.useMemo(()=>Mr(),[]),y=a.useCallback(async()=>{if(!t){n(null);return}try{M(null);const D=await Fs(t);n(D)}catch(D){const b=D instanceof Error?D.message:"Failed to load rewards";M(b),console.error("[useDailyReward] refresh error:",D)}},[t]);a.useEffect(()=>{y()},[y]),a.useEffect(()=>{const D=()=>{const I=Sr().getTime()-Date.now();N(bn(I))};return D(),m.current=setInterval(D,1e3),()=>{m.current&&(clearInterval(m.current),m.current=null)}},[]);const W=a.useMemo(()=>!s||i?!1:wn(s),[s,i]),j=a.useMemo(()=>!s?.activeMultiplier||new Date(s.activeMultiplier.expiresAt).getTime()<=Date.now()?null:s.activeMultiplier,[s?.activeMultiplier]),E=a.useCallback(async()=>{if(!(!t||!W)){l(!0),M(null);try{const D=await jn(t);if(x(D),D.success){r(!0);const b=await Fs(t);n(b)}else M(D.error||"Claim failed")}catch(D){const b=D instanceof Error?D.message:"Claim failed";M(b),console.error("[useDailyReward] claim error:",D)}finally{l(!1)}}},[t,W]),_=a.useCallback(()=>{r(!1)},[]);return{weekRewards:p,todayReward:k,canClaim:W,isClaiming:i,claimedDays:s?.claimedDays??[],currentStreak:s?.currentStreak??0,longestStreak:s?.longestStreak??0,totalClaimed:s?.totalClaimed??0,hintTokens:s?.hintTokens??0,streakShields:s?.streakShields??0,activeMultiplier:j,timeUntilReset:u,showModal:c,lastClaimResult:d,error:f,claim:E,dismissModal:_,refresh:y}}const Nn=["all","Q1","Q2","Q3","Q4"],hl=({onEarnXP:t,atRiskSubjects:s=[],priorityTopics:n=[],initialModuleId:i=null,isInQuizMode:l=!1,setIsInQuizMode:c,hasCompletedDiagnostic:r=!1})=>{const{userProfile:d,currentUser:x}=Bt(),[f,M]=a.useState(()=>{const o=sessionStorage.getItem("mathpulse_modules_tab");return o==="practice"||o==="recommended"||o==="teacher_uploaded"?(sessionStorage.removeItem("mathpulse_modules_tab"),o):"modules"}),u=d,N=u?.grade,m=fa(N);Ra(m);const[p,k]=a.useState(""),[y,W]=a.useState("all"),[j,E]=a.useState("all"),[_,D]=a.useState("all"),[b,I]=a.useState(!1),[B,se]=a.useState(null),[C,re]=a.useState(null),ge=a.useMemo(()=>{const o=u?.learnerCurriculumAssignments?.subjects??u?.assignedSubjects??u?.curriculumAssignedSubjects??[];return Array.isArray(o)?o:[]},[u]),{difficulty:Oe}=pn(x?.uid||null),oe=a.useMemo(()=>{const o=ba(m,ge);return hn(o,Oe)},[m,ge,Oe]),Qe=i&&oe.find(o=>o.id===i)||null,[Se,G]=a.useState(Qe),[ve,We]=a.useState(null),_e=je.useRef(null),[Ve,$e]=a.useState(null),[Ue,h]=a.useState(!1),[A,T]=a.useState(null),[X,$]=a.useState(!1),[Z,le]=a.useState([]),[Ae,fe]=a.useState(!1);a.useEffect(()=>{if(f!=="teacher_uploaded"||!tt)return;fe(!0);const o=as(la(oa(tt,"modules"),ia("moduleType","==","teacher_uploaded")),P=>{const Q=x?.uid,de=P.docs.map(U=>({...U.data(),moduleId:U.id})).filter(U=>!U.assignedTo||U.assignedTo===Q);le(de),fe(!1)},P=>{console.error("Error fetching teacher modules:",P),fe(!1)});return()=>o()},[f,x?.uid]);const[be,Te]=a.useState(!1),{weekRewards:F,todayReward:ee,canClaim:ue,isClaiming:Be,claimedDays:st,timeUntilReset:St,claim:bt,lastClaimResult:Ge}=vn(d?.uid??null);a.useEffect(()=>{if(!d?.uid)return;let o=!1;const P=async U=>{o||(ue||U)&&Te(!0)},Q=U=>{U.detail?.tab==="Modules"&&P(!0)},de=setTimeout(()=>P(),500);return window.addEventListener("mathpulse:navigate",Q),()=>{o=!0,clearTimeout(de),window.removeEventListener("mathpulse:navigate",Q)}},[d?.uid,ue]);const Ct=async()=>{if(d?.uid)try{await bt(),Ge?.success&&(Na({userId:d.uid,type:"daily_checkin",title:"Daily Reward Claimed!",message:`You earned ${Ge.reward.label} and kept your streak alive!`,metadata:{rewardId:Ge.reward.id,streakDay:Ge.dayIndex+1}}).catch(console.error),Ge.reward.rarity==="epic"&&Qs(d.uid,"acc_crown").then(()=>ut.success("Epic reward unlocked!")).catch(console.error)),setTimeout(()=>Te(!1),1e3)}catch(o){const P=o instanceof Error?o.message:"";console.error("Failed to claim daily reward:",o),P.includes("Already claimed")?ut.info("You already claimed your reward today!"):ut.error("Failed to claim daily reward. Please try again.")}};a.useEffect(()=>{if(i){const o=oe.find(P=>P.id===i);o&&G(o)}},[i,oe]),a.useEffect(()=>{d?.uid&&($(!0),ga(d.uid).then(o=>{T(o)}).catch(o=>{console.error("Failed to load competency profile:",o)}).finally(()=>{$(!1)}))},[d?.uid]);const Ne=a.useMemo(()=>{const o=n.length>0?n:s.map(Q=>ya(Q)).filter(Q=>Q!==null),P=new Set;return o.filter(Q=>P.has(Q)?!1:(P.add(Q),!0))},[n,s]),{data:ce=[]}=aa({queryKey:wa.modules(m,Ne),enabled:!0,staleTime:600*1e3,gcTime:1800*1e3,queryFn:async()=>{const o=oe;if(Ne.length===0)return o;const P=new Map(Ne.map((Q,de)=>[ka[Q],de]));return[...o].sort((Q,de)=>{const U=P.get(Q.id)??Number.POSITIVE_INFINITY,q=P.get(de.id)??Number.POSITIVE_INFINITY;return U-q})}}),at=a.useMemo(()=>{const o=new Set;return ce.forEach(P=>o.add(P.competency_group)),Array.from(o)},[ce]),rt=a.useMemo(()=>{const o=p.trim().toLowerCase(),P=ce.filter(Q=>{const de=!o||Q.title.toLowerCase().includes(o),U=!o||Q.description.toLowerCase().includes(o),q=!o||Q.lessons.some(Le=>Le.title.toLowerCase().includes(o)),me=!o||Q.quizzes.some(Le=>Le.title.toLowerCase().includes(o)),Pe=o?Q.competencies.some(Le=>Le.outcome.toLowerCase().includes(o)||Le.code.toLowerCase().includes(o)):!0,Ee=y==="all"||Q.subjectId===y,xe=j==="all"||Q.quarter===j,ne=_==="all"||Q.competency_group===_;return(de||U||q||me||Pe)&&Ee&&xe&&ne});if(A?.competencies){const Q=new Set(Object.entries(A.competencies).filter(([,U])=>U.score<50).map(([U])=>U)),de=new Set(Object.entries(A.competencies).filter(([,U])=>U.score>=80).map(([U])=>U));return P.sort((U,q)=>{const me=U.competencies.map(ke=>ke.code),Pe=q.competencies.map(ke=>ke.code),Ee=me.some(ke=>Q.has(ke))?1:0,xe=Pe.some(ke=>Q.has(ke))?1:0,ne=me.some(ke=>de.has(ke))?1:0,Le=Pe.some(ke=>de.has(ke))?1:0,gt=Ee*2+ne;return xe*2+Le-gt})}return P},[ce,p,y,j,_,A]),ct=a.useMemo(()=>{const o=j==="all"?"All Quarters":j,P=y==="all"?"All Subjects":hs[y]?.label??"Subject";return`${m} · ${P} · ${o}`},[m,y,j]),zt=a.useMemo(()=>{const o=new Set(ce.map(P=>P.subjectId));return Array.from(o)},[ce]),He=()=>{W("all"),E("all"),D("all"),k("")};a.useEffect(()=>{f!=="recommended"||Ne.length===0||(h(!0),ja({weakTopics:Ne.map(o=>fs[o]),subject:y!=="all"?y:"General Mathematics",userId:d?.uid}).then(o=>{$e(o.curriculumContext),h(!1)}).catch(()=>h(!1)))},[f,Ne]);const Ye=(o,P)=>{t&&t(P,`Quiz Completed! +${P} XP`)},Ke=async o=>{if(x?.uid)try{await Fa(x.uid,o),ut.success("You'll be notified when this module becomes available.")}catch{ut.error("Could not subscribe. Try again later.")}};return a.useEffect(()=>{c&&c(!!ve)},[ve,c]),ve?e.jsx(Ys,{quiz:ve,onClose:()=>{_e.current=null,We(null)},onComplete:Ye,onQuizEnd:_e.current??void 0,studentId:d?.uid}):Se?e.jsx(on,{module:Se,onBack:()=>G(null),onEarnXP:t,isInQuizMode:l,setIsInQuizMode:c}):C?e.jsxs("div",{className:"h-full overflow-y-auto px-4 sm:px-6 xl:px-10 pb-8 scrollbar-hide scroll-smooth relative",children:[e.jsxs("button",{onClick:()=>re(null),className:"mb-4 inline-flex items-center gap-2 text-sm font-bold text-slate-600 hover:text-slate-900 transition-colors",children:[e.jsx(ht,{className:"rotate-180",size:16}),"Back to Modules"]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-[#F08386]/30 p-6 md:p-8",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("span",{className:"px-2 py-1 rounded-md bg-[#F08386]/12 border border-[#F08386]/30 text-[#F08386] text-xs font-bold",children:"Teacher Upload"}),C.quarter&&e.jsx("span",{className:"px-2 py-1 rounded-md bg-slate-100 text-slate-600 text-xs",children:C.quarter})]}),e.jsx("h1",{className:"text-2xl md:text-3xl font-display font-black text-slate-900 mb-2",children:C.title}),e.jsxs("p",{className:"text-sm text-slate-600 mb-6",children:[C.subject," · ",C.gradeLevel]}),C.summary&&e.jsx("p",{className:"text-slate-700 text-base leading-relaxed mb-6",children:C.summary}),C.learningObjectives?.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-2",children:"Learning Objectives"}),e.jsx("ul",{className:"list-disc list-inside space-y-1 text-slate-700",children:C.learningObjectives.map((o,P)=>e.jsx("li",{children:o},P))})]}),C.sections?.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-3",children:"Sections"}),e.jsx("div",{className:"space-y-3",children:C.sections.map((o,P)=>e.jsxs("div",{className:"border border-slate-200 rounded-xl p-4",children:[e.jsx("h3",{className:"text-sm font-bold text-slate-800 mb-1",children:o.title}),e.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:o.content})]},P))})]}),C.practice?.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-3",children:"Practice Questions"}),e.jsx("div",{className:"space-y-3",children:C.practice.map((o,P)=>e.jsxs("div",{className:"border border-slate-200 rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-bold text-slate-800 mb-2",children:o.question}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-2",children:o.options.map((Q,de)=>e.jsxs("div",{className:"text-xs text-slate-600 bg-slate-50 rounded-lg px-3 py-2",children:[Q.label,". ",Q.text]},de))}),e.jsxs("p",{className:"text-xs text-emerald-700 font-semibold",children:["Answer: ",o.answer]}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:o.explanation})]},P))})]})]})]}):e.jsxs("div",{className:"h-full overflow-y-auto px-4 sm:px-6 xl:px-10 pb-8 scrollbar-hide scroll-smooth relative",onScroll:o=>I(o.currentTarget.scrollTop>100),children:[e.jsx(un,{isOpen:be,onClose:()=>Te(!1),onClaim:Ct,weekRewards:F,todayReward:ee,canClaim:ue,isClaiming:Be,claimedDays:st,currentDayIndex:cs(),timeUntilReset:St}),e.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center py-4 md:py-6 gap-4 md:gap-6",children:[e.jsxs("div",{className:"flex-1 max-w-3xl",children:[e.jsx("h1",{className:"text-[28px] md:text-[44px] font-display font-black text-[#202124] tracking-tight leading-[1.1] mb-3 md:mb-4",children:"Curriculum Modules"}),e.jsx("p",{className:"text-[#3c4043] text-[13px] md:text-[17px] leading-relaxed md:leading-[1.7] md:pr-10",children:"MathPulse AI loads modules directly from DepEd Strengthened SHS curriculum guides with AI-powered RAG lesson generation. Currently available: General Mathematics, Business Mathematics, and Statistics & Probability. Pre-Calculus and Basic Calculus modules are coming soon once teaching module PDFs are sourced."}),e.jsx("div",{className:"mt-4 flex items-center gap-3",children:e.jsx("div",{className:"inline-flex items-center rounded-full border border-sky-200 bg-sky-50 px-4 py-2 text-sm font-bold text-sky-900",children:ct})})]}),e.jsx("div",{className:"hidden lg:flex flex-shrink-0 items-center justify-end w-[350px]",children:e.jsx(Is,{assessmentDismissed:d?.assessmentDismissed,initialAssessmentCompleted:d?.initialAssessmentCompleted})})]}),e.jsxs("div",{className:`sticky top-0 z-30 -mx-4 px-4 sm:-mx-6 sm:px-6 xl:-mx-10 xl:px-10 pt-3 pb-3 space-y-3 transition-colors duration-300 ${b?"bg-[#f8faff] border-b border-[#dde3eb] shadow-sm":"bg-transparent"}`,children:[e.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-3 w-full",children:[e.jsxs("div",{className:"relative flex-1 w-full",children:[e.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-[#5f6368]",children:e.jsx($a,{size:16,strokeWidth:2.5})}),e.jsx("input",{id:"modules-search",name:"modules-search","aria-label":"Search modules",type:"text",value:p,onChange:o=>k(o.target.value),placeholder:"Search modules, lessons, or assessments...",className:"w-full pl-10 pr-10 py-2 rounded-xl border border-[#dadce0] bg-white text-[#202124] text-[13px] font-medium focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all shadow-sm"}),!1]}),e.jsxs("div",{className:"flex flex-row overflow-x-auto no-scrollbar items-center gap-2 w-full lg:w-auto shrink-0 -mx-4 px-4 sm:mx-0 sm:px-0 pb-1 sm:pb-0",children:[e.jsxs("select",{value:y,onChange:o=>W(o.target.value),className:"shrink-0 rounded-xl border border-slate-200 bg-white pl-3 pr-8 py-2 text-xs font-semibold text-slate-700 focus:border-sky-400 focus:outline-none shadow-sm","aria-label":"Subject",children:[e.jsx("option",{value:"all",children:"All Subjects"}),zt.map(o=>e.jsx("option",{value:o,children:hs[o].label},o))]}),e.jsx("select",{value:j,onChange:o=>E(o.target.value),className:"shrink-0 rounded-xl border border-slate-200 bg-white pl-3 pr-8 py-2 text-xs font-semibold text-slate-700 focus:border-sky-400 focus:outline-none shadow-sm","aria-label":"Quarter",children:Nn.map(o=>e.jsx("option",{value:o,children:o==="all"?"All Quarters":o},o))}),e.jsxs("select",{value:_,onChange:o=>D(o.target.value),className:"shrink-0 rounded-xl border border-slate-200 bg-white pl-3 pr-8 py-2 text-xs font-semibold text-slate-700 focus:border-sky-400 focus:outline-none shadow-sm","aria-label":"Competency Group",children:[e.jsx("option",{value:"all",children:"All Competencies"}),at.map(o=>e.jsx("option",{value:o,children:o},o))]}),e.jsxs("button",{type:"button",onClick:He,className:"inline-flex shrink-0 items-center justify-center gap-1.5 rounded-xl border border-slate-200 bg-white px-3 py-2 text-xs font-bold text-slate-700 transition-colors hover:bg-slate-50 shadow-sm",children:[e.jsx(Ba,{size:14}),"Reset"]})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-3 mt-2",children:[e.jsx("div",{className:"flex items-center bg-slate-100/80 p-1 rounded-full border border-slate-200/60 shadow-inner gap-1 overflow-x-auto no-scrollbar w-full md:w-auto",children:[{id:"modules",label:"Modules",icon:Fe,color:"text-[#1FA7E1]"},{id:"recommended",label:"Recommended",icon:At,color:"text-[#75D06A]"},{id:"practice",label:"Practice",icon:et,color:"text-[#FFB356]"},{id:"teacher_uploaded",label:"Teacher Uploaded",icon:va,color:"text-[#F08386]"}].map(o=>{const P=f===o.id;return e.jsxs("button",{onClick:()=>M(o.id),className:`relative flex items-center gap-1.5 px-4 py-1.5 rounded-full text-[13px] font-bold transition-all duration-300 flex-shrink-0 ${P?"shadow-sm":"text-slate-500 hover:text-slate-700 hover:bg-slate-200/50"}`,children:[P&&e.jsx(S.div,{layoutId:"modulesTabBackground",className:"absolute inset-0 bg-white rounded-full shadow-[0_2px_15px_-3px_rgba(0,0,0,0.1)] border border-slate-100",transition:{type:"spring",bounce:.2,duration:.6}}),e.jsxs("span",{className:`relative z-10 flex items-center gap-1.5 ${P?o.color:""}`,children:[e.jsx(o.icon,{size:15,strokeWidth:P?2.5:2}),o.label]})]},o.id)})}),e.jsxs("div",{className:"flex items-center gap-2 ml-1",children:[f==="modules"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500",children:e.jsx(Aa,{size:15,strokeWidth:2.5})}),e.jsx("span",{className:"font-display font-black text-[15px] text-slate-700 tracking-tight whitespace-nowrap",children:"DepEd Strengthened SHS Modules"})]}),f==="recommended"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#75D06A]/10 flex items-center justify-center",children:e.jsx(Ha,{size:15,className:"text-[#75D06A]"})}),e.jsx("span",{className:"font-display font-black text-[15px] text-slate-700 tracking-tight whitespace-nowrap",children:"Suggested Next"})]}),f==="practice"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#FFB356]/10 flex items-center justify-center",children:e.jsx(et,{size:15,className:"text-[#FFB356]"})}),e.jsx("span",{className:"font-display font-black text-[15px] text-slate-700 tracking-tight whitespace-nowrap",children:"Practice Center"})]}),f==="teacher_uploaded"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#F08386]/15 border border-[#F08386]/30 flex items-center justify-center text-[#F08386]",children:e.jsx(ys,{size:15,strokeWidth:2.5})}),e.jsx("span",{className:"font-display font-black text-[15px] text-slate-700 tracking-tight whitespace-nowrap",children:"Teacher Uploaded Modules"})]})]})]})]}),e.jsx("div",{className:"flex lg:hidden items-center justify-center w-full mt-2 mb-2",children:e.jsx(Is,{assessmentDismissed:d?.assessmentDismissed,initialAssessmentCompleted:d?.initialAssessmentCompleted})}),e.jsxs("div",{className:"pt-4",children:[Ne.length>0&&e.jsxs("div",{className:"mb-4 rounded-2xl border border-amber-300 bg-amber-50 px-5 py-4 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"inline-flex items-center gap-2 text-sm font-black text-amber-900",children:[e.jsx(Hs,{size:15}),"Assessment Focus Areas"]}),e.jsx("p",{className:"mt-1 text-sm text-amber-900/80",children:"Modules are currently prioritized by your latest diagnostic needs."})]}),e.jsxs("button",{type:"button",onClick:()=>M("recommended"),className:"inline-flex items-center gap-1.5 rounded-xl bg-amber-600 px-3 py-2 text-xs font-bold text-white transition-colors hover:bg-amber-700",children:["View Recommended",e.jsx(ht,{size:14})]})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:Ne.map((o,P)=>e.jsxs("span",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-amber-900 shadow-sm",children:[P+1,". ",fs[o]]},o))})]}),e.jsx(ot,{mode:"wait",children:e.jsx(S.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},className:"pb-8 mt-4",children:f==="practice"?e.jsx(mn,{userId:d?.uid??"",onStartQuiz:o=>{_e.current=async(P,Q)=>{if(!(!d?.uid||!P.generatedQuizId))try{const de=new Map((P.loadedQuestions||[]).map(me=>[me.id,me])),U=Q.map(me=>{const Ee=de.get(me.questionId)?.options?.findIndex(xe=>xe.trim().toLowerCase()===me.answer.trim().toLowerCase())??0;return{question_id:me.questionId,selected_index:Ee}}),q=await nn({session_id:P.generatedQuizId,userId:d.uid,answers:U});ut.success(`Score: ${q.score_percent}% | Correct: ${q.correct_count}/${q.total} | +${q.xp_earned} XP`)}catch(de){console.error(de),ut.error("Failed to submit quiz results")}},We(o)},searchQuery:p}):f==="teacher_uploaded"?Ae?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mt-6",children:[1,2,3].map(o=>e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 p-6 animate-pulse",children:[e.jsx("div",{className:"h-4 bg-slate-200 rounded w-3/4 mb-4"}),e.jsx("div",{className:"h-3 bg-slate-100 rounded w-1/2 mb-3"}),e.jsx("div",{className:"h-3 bg-slate-100 rounded w-5/6"})]},o))}):Z.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"w-16 h-16 bg-[#F08386]/10 rounded-2xl flex items-center justify-center mx-auto mb-4",children:e.jsx(ys,{size:32,className:"text-[#F08386]"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"No Teacher-Uploaded Modules Yet"}),e.jsx("p",{className:"text-slate-500 text-sm",children:"Your teachers haven't uploaded any custom modules yet."})]}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 mt-6",children:Z.map(o=>e.jsxs("div",{className:"bg-white rounded-2xl border border-[#F08386]/30 p-6 hover:border-[#F08386]/60 hover:shadow-md transition-all cursor-pointer",onClick:()=>re(o),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"px-2 py-1 rounded-md bg-[#F08386]/12 border border-[#F08386]/30 text-[#F08386] text-xs font-bold",children:"Teacher Upload"}),o.quarter&&e.jsx("span",{className:"px-2 py-1 rounded-md bg-slate-100 text-slate-600 text-xs",children:o.quarter})]}),e.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-2 line-clamp-2",children:o.title}),e.jsxs("p",{className:"text-sm text-slate-600 mb-3",children:[o.subject," · ",o.gradeLevel]}),o.summary&&e.jsx("p",{className:"text-xs text-slate-500 line-clamp-3",children:o.summary})]},o.moduleId))}):f==="modules"?e.jsx(kn,{modules:rt,onSelectModule:G,onPreviewSources:se,isAtRisk:Ne.length>0&&r,weakTopics:u?.assessmentResults?.weakTopics||[],onNotifyMe:Ke}):e.jsx(Sn,{modules:rt,fullPool:ce,onSelectModule:G,onPreviewSources:se,isAtRisk:Ne.length>0&&r,learningPathContext:Ve,learningPathLoading:Ue,weakTopics:u?.assessmentResults?.weakTopics||[],onNotifyMe:Ke})},f)})]}),e.jsx(ot,{children:B&&e.jsxs(S.aside,{initial:{opacity:0,x:24},animate:{opacity:1,x:0},exit:{opacity:0,x:24},transition:{duration:.25},className:"fixed inset-y-0 right-0 z-[80] w-full max-w-xl border-l border-slate-200 bg-white p-6 shadow-2xl",children:[e.jsxs("div",{className:"mb-4 flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-wide text-sky-700",children:"Curriculum Preview"}),e.jsx("h3",{className:"mt-1 text-xl font-black text-slate-900",children:B.title}),e.jsxs("p",{className:"mt-1 text-sm text-slate-600",children:[B.active_grade_level," · ",B.subject," · ",B.quarter]})]}),e.jsx("button",{type:"button",onClick:()=>se(null),className:"rounded-lg border border-slate-200 p-2 text-slate-500 hover:bg-slate-50",children:e.jsx(Je,{size:16})})]}),e.jsxs("div",{className:"space-y-4 overflow-y-auto pr-1",children:[e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-4",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500",children:"Competency Group"}),e.jsx("p",{className:"mt-1 text-sm font-semibold text-slate-800",children:B.competency_group})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500",children:"Performance Standard"}),e.jsx("p",{className:"mt-1 text-sm text-slate-700",children:B.performance_standard})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500",children:"Competencies"}),e.jsx("div",{className:"mt-2 space-y-2",children:B.competencies.map(o=>e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-slate-50 p-3",children:[e.jsx("p",{className:"text-xs font-black text-slate-600",children:o.code}),e.jsx("p",{className:"mt-1 text-sm text-slate-700",children:o.outcome})]},o.code))})]})]})]})})]})},kn=({modules:t,onSelectModule:s,onPreviewSources:n,isAtRisk:i=!1,weakTopics:l=[],onNotifyMe:c})=>e.jsx("div",{className:"pr-2 space-y-8",children:e.jsx("div",{children:t.length===0?e.jsxs("div",{className:"bg-white rounded-2xl border border-[#dde3eb] p-8 text-center",children:[e.jsx("p",{className:"text-slate-700 font-semibold",children:"No matching modules found."}),e.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"If modules are not yet available for your selected view, this area will unlock after assessment sync and content rollout."})]}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-3 md:gap-6",children:t.map((r,d)=>{const x=l.some(f=>r.content_domain&&r.content_domain.toLowerCase().includes(f.toLowerCase())||r.title&&r.title.toLowerCase().includes(f.toLowerCase())||r.competency_group&&r.competency_group.toLowerCase().includes(f.toLowerCase())||r.subject&&r.subject.toLowerCase().includes(f.toLowerCase()));return e.jsx(Kt,{module:r,index:d,onClick:()=>s(r),onPreviewSources:()=>n(r),isAtRisk:i,isRecommended:x,onNotifyMe:c},r.id)})})})}),Sn=({modules:t,fullPool:s,onSelectModule:n,onPreviewSources:i,isAtRisk:l=!1,learningPathContext:c=null,learningPathLoading:r=!1,weakTopics:d=[],onNotifyMe:x})=>{const f=t.filter(u=>u.progress>0&&u.progress<100),M=(t.length>0?t:s).filter(u=>u.progress===0).slice(0,6);return e.jsxs("div",{className:"pr-2 space-y-10",children:[r&&e.jsxs("div",{className:"mb-6 rounded-2xl border border-sky-200 bg-sky-50 px-5 py-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 rounded-full border-2 border-sky-400 border-t-transparent animate-spin flex-shrink-0"}),e.jsx("p",{className:"text-sm font-semibold text-sky-800",children:"Building your personalized learning path from DepEd curriculum..."})]}),c&&!r&&e.jsxs("div",{className:"mb-6 rounded-2xl border border-indigo-200 bg-gradient-to-br from-indigo-50 to-purple-50 px-5 py-4 shadow-sm",children:[e.jsxs("p",{className:"text-xs font-black uppercase tracking-wide text-indigo-700 mb-2 flex items-center gap-1.5",children:[e.jsx(Fe,{size:14})," Your Personalized Learning Path"]}),e.jsx("pre",{className:"whitespace-pre-wrap text-sm text-indigo-900 font-medium leading-relaxed font-sans",children:c})]}),f.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-[#FF8B8B]/10 flex items-center justify-center shadow-inner",children:e.jsx(rs,{size:20,className:"text-[#FF8B8B]"})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Continue This Module"})]}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-3 md:gap-6",children:f.slice(0,4).map((u,N)=>{const m=d.some(p=>u.content_domain&&u.content_domain.toLowerCase().includes(p.toLowerCase())||u.title&&u.title.toLowerCase().includes(p.toLowerCase())||u.competency_group&&u.competency_group.toLowerCase().includes(p.toLowerCase())||u.subject&&u.subject.toLowerCase().includes(p.toLowerCase()));return e.jsx(Kt,{module:u,index:N,onClick:()=>n(u),onPreviewSources:()=>i(u),isAtRisk:l,badgeLabel:"In Progress",isRecommended:m,onNotifyMe:x},u.id)})})]}),e.jsx("div",{children:M.length===0?e.jsx("div",{className:"bg-white rounded-2xl border border-[#dde3eb] p-8 text-center text-slate-500 font-medium",children:"You are all caught up. Practice more quizzes to unlock additional recommendations."}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-3 md:gap-6",children:M.map((u,N)=>{const m=d.some(p=>u.content_domain&&u.content_domain.toLowerCase().includes(p.toLowerCase())||u.title&&u.title.toLowerCase().includes(p.toLowerCase())||u.competency_group&&u.competency_group.toLowerCase().includes(p.toLowerCase())||u.subject&&u.subject.toLowerCase().includes(p.toLowerCase()));return e.jsx(Kt,{module:u,index:N,onClick:()=>n(u),onPreviewSources:()=>i(u),isAtRisk:l,badgeLabel:"Start",isRecommended:m,onNotifyMe:x},u.id)})})})]})};export{hl as default}; diff --git a/assets/ModulesPage-BBA7i5Vh.js b/assets/ModulesPage-BBA7i5Vh.js deleted file mode 100644 index 6fbdc4d36b9ae5702ece7585e78263ff13e74dfb..0000000000000000000000000000000000000000 --- a/assets/ModulesPage-BBA7i5Vh.js +++ /dev/null @@ -1,199 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-core-D7GXCeNu.js"])))=>i.map(i=>d[i]); -import{r as a,j as e,b as vt,d as je,c as ra}from"./vendor-react-B4AQeu28.js";import{u as la}from"./useQuery-CiaHK9El.js";import{doc as kt,onSnapshot as ss,getDoc as Vt,runTransaction as na,serverTimestamp as ia,query as oa,where as ca,collection as da}from"./vendor-firebase-firestore-CNv3xXal.js";import{e as ae,g as tt,ae as ma,m as k,Z as Xe,h as st,$ as as,b as Fe,_ as rs,C as wt,M as xa,a as ht,T as At,r as et,a7 as $s,R as Bs,F as ls,w as Rt,k as ua,u as $t,A as Tt,o as Lt,y as qs,ad as us,af as pa,ag as ps,ah as ha,q as Hs,ai as fa,L as Os,B as ba,aj as ga,ak as Qs,al as ya,am as wa,an as ja,ab as va,x as Na,ao as hs,ap as ka,aq as fs,G as Sa,j as ut,a9 as Ca,ac as za}from"./index-Cvals0ud.js";import{M as Yt}from"./ModuleFolderCard-EpvEJfz8.js";import{B as ze}from"./button-CanHmtQ3.js";import{triggerQuizSubmitted as Ma}from"./automationService-bOdf9kmP.js";import{c as _a,b as Ws,A as Kt,P as Zt,L as Aa}from"./quizService-ADP3v46Q.js";import Us from"./ScientificCalculator-BU0JSvVT.js";import{C as Ft}from"./check-BVDfRV4g.js";import{X as Je}from"./x-cRIR5BcS.js";import{C as Nt}from"./clock-BsCO0o69.js";import{V as Jt,a as es,M as Gs,b as Xs}from"./volume-x-D_pMIkOs.js";import{C as ts}from"./chevron-left-BVt9k3oq.js";import{C as ot}from"./chevron-right-DMwHUP8W.js";import{C as Wt,L as jt}from"./lightbulb-BO_q6pvi.js";import{C as ft}from"./circle-check-big-6fwaSN-C.js";import{C as Ea}from"./circle-help-Bpd0FWyO.js";import{logLessonView as Ta}from"./trackingService-C4dB8FTD.js";import{C as Pa}from"./clipboard-check-Dml7qHk3.js";import{s as Dt,S as bs}from"./subjects-jEWdBmnZ.js";import{C as Vs}from"./circle-check-Bi1b5YEO.js";import{C as Ia}from"./chart-column-NTUNS-L9.js";import{D as La}from"./dollar-sign-B2IOYAA6.js";import gs from"./confetti.module-C94ZD2ww.js";import{G as Da}from"./gift-NZiFoj7A.js";import{u as Fa}from"./useCurriculum-BAkeEYG2.js";import{w as Ra}from"./moduleWatchService-NMv-sVdb.js";import{S as $a}from"./search-C0dGOTBF.js";import{F as Ba}from"./funnel-aw0mPVdH.js";import{S as qa}from"./sparkles-Chs7kbc0.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-Cze5wmtk.js";import"./deepseekRagService-Bke9fSTt.js";import"./bell-oitWfCwK.js";import"./info-Nl0vLXXp.js";import"./chevron-up-CzNRBnCs.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ha=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],Oa=ae("binary",Ha);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qa=[["path",{d:"M15 13a3 3 0 1 0-6 0",key:"10j68g"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}]],ys=ae("book-user",Qa);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wa=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],ws=ae("bookmark",Wa);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ua=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],js=ae("box",Ua);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ga=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],vs=ae("braces",Ga);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xa=[["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}],["circle",{cx:"18.5",cy:"5.5",r:".5",fill:"currentColor",key:"lysivs"}],["circle",{cx:"11.5",cy:"11.5",r:".5",fill:"currentColor",key:"byv1b8"}],["circle",{cx:"7.5",cy:"16.5",r:".5",fill:"currentColor",key:"nkw3mc"}],["circle",{cx:"17.5",cy:"14.5",r:".5",fill:"currentColor",key:"1gjh6j"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}]],Va=ae("chart-scatter",Xa);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ya=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],Ka=ae("circle-play",Ya);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Za=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ns=ae("circle",Za);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ja=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],er=ae("crosshair",Ja);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 16h.01",key:"18s6g9"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M12 12h.01",key:"1mp3jc"}]],sr=ae("dice-5",tr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ar=[["circle",{cx:"12",cy:"6",r:"1",key:"1bh7o1"}],["line",{x1:"5",x2:"19",y1:"12",y2:"12",key:"13b5wn"}],["circle",{cx:"12",cy:"18",r:"1",key:"lqb9t5"}]],Ut=ae("divide",ar);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rr=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],lr=ae("flask-conical",rr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nr=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],ks=ae("hash",nr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ir=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"m12 13-1-1 2-2-3-3 2-2",key:"xjdxli"}]],Ys=ae("heart-crack",ir);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const or=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],cr=ae("key",or);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dr=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],mr=ae("notebook-pen",dr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xr=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],Ss=ae("percent",xr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ur=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],pr=ae("ruler",ur);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hr=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M14 15H9v-5",key:"pi4jk9"}],["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M21 3 9 15",key:"15kdhq"}]],fr=ae("scaling",hr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const br=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],Cs=ae("sigma",br);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],Gt=ae("square-function",gr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],zs=ae("square",yr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wr=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],jr=ae("timer",wr);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vr=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],Ms=ae("triangle",vr);function Nr(t){let s=t>>>0;return()=>{s+=1831565813;let l=Math.imul(s^s>>>15,s|1);return l^=l+Math.imul(l^l>>>7,l|61),((l^l>>>14)>>>0)/4294967296}}function kr(t,s){const l=[...t],i=Nr(s);for(let n=l.length-1;n>0;n--){const o=Math.floor(i()*(n+1));[l[n],l[o]]=[l[o],l[n]]}return l}function ns(t){const s=t??new Date;return new Intl.DateTimeFormat("en-CA",{timeZone:"Asia/Manila",year:"numeric",month:"2-digit",day:"2-digit"}).format(s)}function is(t){const s=new Date,l=new Intl.DateTimeFormat("en-US",{timeZone:"Asia/Manila",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(s),i=n=>parseInt(l.find(o=>o.type===n)?.value??"0",10);return new Date(i("year"),i("month")-1,i("day"),i("hour"),i("minute"),i("second"))}function os(t){const s=is(),l=s.getFullYear(),i=(s.getDay()+6)%7,n=new Date(s);n.setDate(s.getDate()-i+3);const o=new Date(n.getFullYear(),0,1),r=Math.floor((n.getTime()-o.getTime())/(1440*60*1e3)),d=Math.floor(r/7)+1;return l*100+d}function cs(t){return(is().getDay()+6)%7}function Sr(t){const s=new Date,l=480*60*1e3,i=s.getTime()+l,o=(new Date(i).getUTCDay()+6)%7,r=o===0?7:7-o,x=i-i%(1440*60*1e3)+r*24*60*60*1e3;return new Date(x-l)}const Cr=[{id:"xp_50",label:"+50 XP Boost",description:"Bonus XP on your next quiz",icon:"⚡",type:"xp",value:50,rarity:"common",color:"#4ade80"},{id:"xp_100",label:"+100 XP Boost",description:"Double bonus XP reward",icon:"🌟",type:"xp",value:100,rarity:"rare",color:"#facc15"},{id:"xp_200",label:"+200 XP Epic Boost",description:"Massive XP surge",icon:"💥",type:"xp",value:200,rarity:"epic",color:"#f97316"},{id:"streak_shield",label:"Streak Shield",description:"Protects streak if you miss a day",icon:"🛡️",type:"streak_shield",value:1,rarity:"rare",color:"#60a5fa"},{id:"hint_x3",label:"3 Hint Tokens",description:"Use in-quiz hints",icon:"💡",type:"hint_token",value:3,rarity:"common",color:"#a78bfa"},{id:"hint_x5",label:"5 Hint Tokens",description:"More hints to use",icon:"🔦",type:"hint_token",value:5,rarity:"rare",color:"#8b5cf6"},{id:"xp_mult_1h",label:"1-Hour XP ×1.5",description:"1.5× XP for all quizzes for 1 hour",icon:"⏰",type:"xp_multiplier",value:60,rarity:"epic",color:"#ec4899"},{id:"xp_mult_30m",label:"30-Min XP ×2",description:"2× XP for 30 minutes",icon:"🚀",type:"xp_multiplier",value:30,rarity:"epic",color:"#e11d48"},{id:"xp_75",label:"+75 XP Boost",description:"Solid XP reward",icon:"✨",type:"xp",value:75,rarity:"common",color:"#34d399"},{id:"hint_x2",label:"2 Hint Tokens",description:"Quick hint pack",icon:"🕯️",type:"hint_token",value:2,rarity:"common",color:"#7c3aed"},{id:"xp_streak_150",label:"+150 XP + Streak Save",description:"XP boost + streak protection combo",icon:"🔥",type:"xp",value:150,rarity:"epic",color:"#dc2626"},{id:"xp_25",label:"+25 XP Starter",description:"Small but reliable XP",icon:"🌱",type:"xp",value:25,rarity:"common",color:"#86efac"},{id:"hint_x1",label:"1 Hint Token",description:"A single lifeline",icon:"🔍",type:"hint_token",value:1,rarity:"common",color:"#c4b5fd"},{id:"streak_shield2",label:"2 Streak Shields",description:"Double streak protection",icon:"🏰",type:"streak_shield",value:2,rarity:"epic",color:"#3b82f6"},{id:"xp_120",label:"+120 XP Power Surge",description:"Strong XP reward for the day",icon:"⚡",type:"xp",value:120,rarity:"rare",color:"#16a34a"},{id:"hint_x4",label:"4 Hint Tokens",description:"Generous hint pack",icon:"📚",type:"hint_token",value:4,rarity:"rare",color:"#9333ea"}];function zr(t){return kr(Cr,t).slice(0,7).map((i,n)=>({...i,day:n}))}function ds(){return zr(os())}function Mr(){const t=ds(),s=cs();return t[s]}function _r(t){const[s,l]=a.useState({extraHintsEnabled:!1,hintTokens:0,totalHintsAvailable:0,loading:!0});return a.useEffect(()=>{if(!t){l({extraHintsEnabled:!1,hintTokens:0,totalHintsAvailable:0,loading:!1});return}const i=kt(tt,"users",t);return ss(i,o=>{if(!o.exists()){l({extraHintsEnabled:!1,hintTokens:0,totalHintsAvailable:0,loading:!1});return}const r=o.data(),d=r?.extraHintsEnabled===!0,x=r?.hintTokens||0,f=d?x+3:x;l({extraHintsEnabled:d,hintTokens:x,totalHintsAvailable:f,loading:!1})},o=>{console.error("[useExtraHints] snapshot error:",o),l({extraHintsEnabled:!1,hintTokens:0,totalHintsAvailable:0,loading:!1})})},[t]),s}const _s=` - @keyframes score-pop { - 0% { transform: scale(1); } - 50% { transform: scale(1.4); } - 100% { transform: scale(1); } - } - @keyframes overlay-slide-up { - 0% { transform: translateY(40px) scale(0.85); opacity: 0; } - 100% { transform: translateY(0) scale(1); opacity: 1; } - } - @keyframes confetti-fall { - 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; } - 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } - } - .animate-score-pop { animation: score-pop 0.5s ease-out forwards; } - .animate-overlay-slide-up { animation: overlay-slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; } - .confetti-piece { - position: absolute; - width: 10px; - height: 10px; - animation: confetti-fall linear forwards; - } -`,Ar=({viewportHeight:t})=>e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden flex justify-between bg-slate-900/5",children:je.useMemo(()=>[...Array(40)].map((s,l)=>({id:l,left:`${Math.random()*100}%`,duration:.6+Math.random()*.4,delay:Math.random()*.4})),[t]).map(s=>e.jsx(k.div,{className:"absolute w-0.5 h-16 bg-blue-400/30 rounded-full",style:{left:s.left,top:"-10%"},animate:{y:[0,t*1.2]},transition:{duration:s.duration,ease:"linear",delay:s.delay}},s.id))}),Er=()=>{const t=je.useMemo(()=>[...Array(60)].map((s,l)=>({id:l,left:`${Math.random()*100}%`,backgroundColor:["#75D06A","#6ED1CF","#9956DE","#FB96BB","#FFB356"][l%5],duration:2+Math.random()*2,delay:Math.random()*.5,size:6+Math.random()*8,borderRadius:Math.random()>.5?"50%":"2px"})),[]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden",children:t.map(s=>e.jsx("div",{className:"confetti-piece",style:{left:s.left,top:"-10%",backgroundColor:s.backgroundColor,width:s.size,height:s.size,borderRadius:s.borderRadius,animationDuration:`${s.duration}s`,animationDelay:`${s.delay}s`}},s.id))})},Tr=({viewportHeight:t,viewportWidth:s})=>{const l=je.useMemo(()=>[...Array(30)].map((i,n)=>({id:n,xShift:(Math.random()-.5)*s*.8,yShift:(Math.random()-.5)*t*.8,scale:Math.random()*1.5+.5,duration:2+Math.random()*1.5,delay:Math.random()*.35})),[t,s]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden flex items-center justify-center",children:l.map(i=>e.jsx(k.div,{className:"absolute w-2 h-2 bg-amber-400 rounded-full shadow-[0_0_10px_rgba(251,191,36,0.5)]",style:{left:"50%",top:"50%"},animate:{y:[0,i.yShift],x:[0,i.xShift],scale:[0,i.scale,0],opacity:[0,1,0]},transition:{duration:i.duration,ease:"easeOut",delay:i.delay}},i.id))})},As=({value:t,label:s,delay:l=0,icon:i})=>{const[n,o]=je.useState(0);return je.useEffect(()=>{if(t<=0)return;const r=1e3,d=30,x=Math.abs(Math.floor(r/d));let f=0;const M=setTimeout(()=>{const u=setInterval(()=>{f+=Math.max(1,Math.floor(t/d)),f>=t?(o(t),clearInterval(u)):o(f)},x);return()=>clearInterval(u)},l);return()=>clearTimeout(M)},[t,l]),t<0?null:e.jsxs(k.div,{initial:{opacity:0,transform:"translateX(-20px)"},animate:{opacity:1,transform:"translateX(0)"},transition:{delay:l/1e3,duration:.5},className:"flex items-center justify-between bg-slate-50 border border-slate-100 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-slate-500 font-bold uppercase tracking-wider text-[10px]",children:[i,s]}),e.jsxs("div",{className:"text-xl font-black text-purple-600 tabular-nums",children:["+",n]})]})};function Pr(t){if(t.questionType==="multiple_choice"&&t.options&&t.options.length>0){const s=t.options.findIndex(l=>l.trim().toLowerCase()===t.correctAnswer.trim().toLowerCase());return{id:t.id,question:t.question,options:t.options,correctAnswer:s>=0?s:0,correctAnswerText:t.correctAnswer,explanation:t.explanation,questionType:t.questionType,points:t.points,difficulty:t.difficulty,topic:t.topic,bloomLevel:t.bloomLevel}}return{id:t.id,question:t.question,options:[],correctAnswer:-1,correctAnswerText:t.correctAnswer,explanation:t.explanation,questionType:t.questionType,points:t.points,difficulty:t.difficulty,topic:t.topic,bloomLevel:t.bloomLevel}}function Es(t){return t.replace(/²/g,"^2").replace(/³/g,"^3").replace(/⁻¹/g,"^-1").replace(/⁰/g,"^0").replace(/¹/g,"^1").replace(/⁴/g,"^4").replace(/⁵/g,"^5").replace(/⁶/g,"^6").replace(/⁷/g,"^7").replace(/⁸/g,"^8").replace(/⁹/g,"^9").replace(/π/g,"pi").replace(/√/g,"sqrt").replace(/×/g,"*").replace(/÷/g,"/").replace(/\s+/g,"").toLowerCase().trim()}function Ir(t,s,l){const i=n=>n.trim().toLowerCase().replace(/\s+/g," ");switch(l){case"identification":return i(t)===i(s);case"enumeration":{const n=t.split(",").map(r=>i(r)).filter(Boolean).sort(),o=s.split(",").map(r=>i(r)).filter(Boolean).sort();return JSON.stringify(n)===JSON.stringify(o)}case"word_problem":case"equation_based":{const n=Es(t),o=Es(s);if(n===o)return!0;const r=parseFloat(t.replace(/[^\d.\-]/g,"")),d=parseFloat(s.replace(/[^\d.\-]/g,""));return!isNaN(r)&&!isNaN(d)?Math.abs(r-d)<=.01:i(t)===i(s)}default:return i(t)===i(s)}}const Ks=({quiz:t,onClose:s,onComplete:l,onQuizEnd:i,studentId:n,atRiskSubjects:o=[]})=>{const[r,d]=a.useState(0),[x,f]=a.useState(null),[M,u]=a.useState(""),[v,m]=a.useState(!1),[p,S]=a.useState(!1),[y,W]=a.useState(!1),[j,E]=a.useState(0),[_,D]=a.useState(0),[b,L]=a.useState(1),[B,se]=a.useState([]),[C,re]=a.useState([]),[ge,He]=a.useState(Date.now()),[ce,Oe]=a.useState(!1),[Se,U]=a.useState(!1),[ve,Qe]=a.useState(null),[Me,Ve]=a.useState(0),[Re,We]=a.useState(0),[h,A]=a.useState(!1),[T,G]=a.useState(!1),[$,K]=a.useState(!0),[ne,_e]=a.useState(!1),[fe,be]=a.useState({width:1280,height:720});a.useEffect(()=>{const N=()=>be({width:window.innerWidth,height:window.innerHeight});return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]);const[Ee,R]=a.useState(0),[ee,xe]=a.useState({}),[$e,at]=a.useState(!1),[St,bt]=a.useState(!1),[Ue,Ct]=a.useState(!1),{totalHintsAvailable:Ne}=_r(n||null),[de,rt]=a.useState(5),[lt,ct]=a.useState(15),zt=de+Ne,[Be,Ye]=a.useState(null),[Ke,c]=a.useState(!1),[P,Q]=a.useState(900*1e3),[ie,Z]=a.useState([]),[q,me]=a.useState(0),[Te,Ae]=a.useState(null),[ue]=a.useState(()=>t.loadedQuestions&&t.loadedQuestions.length>0?t.loadedQuestions.map(Pr):Array.from({length:t.questions},(N,w)=>({id:`q${w+1}`,question:Lr(t.subject,w),options:Dr(t.subject,w),correctAnswer:Fr(t.subject,w),explanation:Rr(t.subject,w,t.difficulty)})));a.useEffect(()=>{xe({}),Z([]),rt(5),ct(15),R(0),E(0),D(0),L(1)},[t.id]);const le=ue[r];a.useEffect(()=>{const N=parseInt(t.duration)||10;Ve(N*60);const w=setInterval(()=>{Ve(X=>X<=1?(clearInterval(w),ke(),0):X-1)},1e3);return()=>clearInterval(w)},[]),a.useEffect(()=>{lt===0&&!Be&&(Ye(Date.now()),c(!0))},[lt,Be]),a.useEffect(()=>{if(!Ke||!Be)return;const N=setInterval(()=>{const w=Date.now()-Be,X=Math.max(0,900*1e3-w);Q(X)},1e3);return()=>clearInterval(N)},[Ke,Be]);const[Pe,gt]=a.useState(Array.from({length:15},(N,w)=>({id:w,size:Math.random()*120+40,x:Math.random()*100,y:Math.random()*100,duration:Math.random()*20+15,delay:Math.random()*-20,color:["bg-purple-500/10","bg-blue-500/10","bg-cyan-500/10","bg-emerald-500/10"][Math.floor(Math.random()*4)]}))),Ze=N=>{if($)try{const w=window.AudioContext||window.webkitAudioContext;if(!w)return;const X=new w,F=X.currentTime,H=(Ge,Ie,ye,Ce=.1,we="sine")=>{const pe=X.createOscillator(),mt=X.createGain();pe.type=we,pe.frequency.value=Ge,mt.gain.setValueAtTime(0,Ie),mt.gain.linearRampToValueAtTime(Ce,Ie+.05),mt.gain.exponentialRampToValueAtTime(.001,Ie+ye),pe.connect(mt),mt.connect(X.destination),pe.start(Ie),pe.stop(Ie+ye)};N==="correct"?(H(880,F,.1,.1,"sine"),H(1108.73,F+.1,.2,.1,"sine")):N==="incorrect"?(H(300,F,.2,.05,"sawtooth"),H(250,F+.15,.3,.05,"sawtooth")):N==="combo"?(H(440,F,.1,.05,"square"),H(554.37,F+.1,.1,.05,"square"),H(659.25,F+.2,.1,.05,"square"),H(880,F+.3,.4,.05,"square")):N==="complete"&&(H(523.25,F,.1,.1),H(659.25,F+.15,.1,.1),H(783.99,F+.3,.1,.1),H(1046.5,F+.45,.5,.1))}catch{}},ke=()=>{Oe(!0),qt()},Pt=()=>{i?.(t,C),s()},It=()=>{if(de<=0||p)return;const N=ee[r]||[],w=le.options.filter(F=>F!==le.correctAnswerText).filter(F=>!N.includes(F));if(w.length===0)return;const X=w[Math.floor(Math.random()*w.length)];xe(F=>({...F,[r]:[...N,X]})),rt(F=>Math.max(0,F-1)),Ze("correct")},Mt=N=>{p||I||(f(N),setTimeout(()=>{dt(N)},150))},dt=N=>{const w=le.questionType!=null&&le.questionType!=="multiple_choice",X=N!==void 0?N:x;if(w){if(!M.trim())return}else if(X===null)return;const F=w?Ir(M,le.correctAnswerText||"",le.questionType||""):X===le.correctAnswer,H=w?M:String(X),Ge=Math.round((Date.now()-ge)/1e3);re(pe=>[...pe,{questionId:le.id,answer:H,correct:F,timeSpent:Ge}]);const Ie=[...B];if(Ie[r]=F?1:0,se(Ie),m(F),S(!0),!F){bt(!0),Ze("incorrect"),setTimeout(()=>bt(!1),500),ct(pe=>Math.max(0,pe-1)),D(0),L(1),setTimeout(()=>{nt()},1500);return}Ze("correct");const Ce=(ee[r]||[]).length>0?5:10;R(pe=>pe+Ce),E(j+1);const we=_+1;D(we),we===2?Ae("streak"):we===3&&b<2?Ae("multiplier2"):we===5&&b<3&&Ae("multiplier3"),we>0&&we%3===0&&Ze("combo"),we>=5?L(3):we>=3?L(2):L(1),rs(()=>import("./confetti.module-C94ZD2ww.js"),[]).then(pe=>{pe.default({particleCount:30,spread:40,colors:["#75D06A","#6ED1CF"],origin:{y:.6}})}),Ct(!0),setTimeout(()=>{Ct(!1),Ae(null),setTimeout(()=>nt(),300)},1500)},nt=()=>{if(r{const N=Math.round(j/ue.length*100);let w=t.xpReward;N>=90?w=Math.round(w*1.5):N>=80&&(w=Math.round(w*1.25));const X=parseInt(t.duration)*60;Me>X*.5&&(w=Math.round(w*1.2)),We(w);const F=X-Me;n&&Ma({lrn:n,quizId:t.id,subject:t.subject,score:N,totalQuestions:ue.length,correctAnswers:j,timeSpentSeconds:F}).catch(H=>console.error("[WARN] Automation: quiz pipeline failed:",H)),t.source==="ai_generated"&&n?_a(n,t.id,t.generatedQuizId,t.subject,t.source,N,w,F,C,ue.map(H=>({topic:H.topic||t.subject,difficulty:H.difficulty||"medium",bloomLevel:H.bloomLevel||"understand"}))).catch(H=>console.error("[WARN] Quiz result save failed:",H)):n&&ma(n,t.id,t.subject,N,C.map(H=>({questionId:H.questionId,selectedAnswer:H.answer,isCorrect:H.correct})),F).catch(H=>console.error("[WARN] Practice quiz persist failed:",H)),Ze("complete"),l?.(N,w)},I=q{document.fullscreenElement?(document.exitFullscreen().catch(()=>{}),_e(!1)):(document.documentElement.requestFullscreen().catch(()=>{}),_e(!0))};if(ce){const N=Math.round(j/ue.length*100),w=N>=80,X=N>=50&&N<80,F=N<50,H=document.getElementById("modal-root"),Ge=e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-900/50 backdrop-blur-sm",children:[e.jsx("style",{children:_s}),w&&e.jsx(Er,{}),X&&e.jsx(Tr,{viewportHeight:fe.height,viewportWidth:fe.width}),F&&e.jsx(Ar,{viewportHeight:fe.height}),e.jsxs(k.div,{initial:{opacity:0,scale:.8,y:40},animate:{opacity:1,scale:1,y:0},transition:{type:"spring",damping:18,stiffness:200},className:"w-full max-w-xs sm:max-w-sm bg-white border-2 border-slate-200 shadow-[0_25px_60px_rgba(0,0,0,0.15)] rounded-[2rem] p-4 sm:p-5 text-center relative z-10",children:[e.jsx(k.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",damping:12,stiffness:150,delay:.2},className:"mb-3",children:e.jsx("img",{src:"/mascot/modules_avatar.png",alt:"Mascot",className:"w-16 h-16 sm:w-20 sm:h-20 mx-auto drop-shadow-xl animate-mascot-float"})}),e.jsx(k.h2,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},className:`text-xl sm:text-2xl font-black uppercase tracking-tight mb-1 drop-shadow-sm ${w?"text-emerald-500":X?"text-amber-500":"text-rose-500"}`,children:w?"EXCELLENT!":X?"GOOD JOB!":"KEEP TRYING!"}),e.jsxs("p",{className:"text-slate-400 font-bold text-[10px] mb-3 uppercase tracking-widest",children:["Quiz Complete • Score: ",j,"/",ue.length]}),e.jsx(k.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"bg-slate-50/50 rounded-xl p-3 mb-4 border border-slate-100 flex flex-col gap-2",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-slate-400 text-[9px] font-black uppercase tracking-widest text-left mb-1.5 ml-1",children:"Performance Details"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(As,{value:j,label:"Correct Answers",delay:500,icon:e.jsx(Ft,{className:"h-3 w-3 text-emerald-500"})}),e.jsx(As,{value:Re,label:"Total XP Earned",delay:800,icon:e.jsx(Xe,{className:"h-3 w-3 text-amber-500"})}),e.jsxs(k.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:1.2,duration:.4},className:"flex items-center justify-between pt-1.5 mt-1 border-t border-slate-100",children:[e.jsx("span",{className:"text-slate-400 text-[9px] font-black uppercase tracking-widest",children:"Final Accuracy"}),e.jsxs("span",{className:"text-lg font-black text-slate-800 tabular-nums",children:[N,"%"]})]})]})]})}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(ze,{size:"lg",onClick:()=>{d(0),me(0),f(null),u(""),E(0),D(0),L(1),se([]),re([]),R(0),Oe(!1),S(!1),W(!1),He(Date.now()),xe({}),Z([]),at(!1),rt(5),U(!1)},className:"w-full h-10 sm:h-11 rounded-2xl text-xs font-black bg-white hover:bg-slate-50 text-purple-600 border-2 border-purple-100",children:"RETAKE QUIZ"}),e.jsx(ze,{size:"lg",onClick:s,className:"w-full h-10 sm:h-11 rounded-2xl text-xs font-black bg-purple-600 hover:bg-purple-700 text-white shadow-lg shadow-purple-200",children:"FINISH"})]})]})]});return vt.createPortal(Ge,H)}return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:_s}),h&&vt.createPortal(e.jsx(k.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"fixed right-6 top-1/2 -translate-y-1/2 z-[9999] w-64",children:e.jsxs("div",{className:"bg-white rounded-2xl p-3 border border-slate-200 shadow-[0_10px_40px_rgba(0,0,0,0.3)]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[e.jsxs("h4",{className:"text-xs font-bold text-[#0a1628] flex items-center gap-2",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-purple-600",children:[e.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),e.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"})]}),"Calculator"]}),e.jsx("button",{onClick:()=>A(!1),className:"w-6 h-6 rounded-full bg-slate-100 flex items-center justify-center text-slate-500 hover:text-slate-800 hover:bg-slate-200 transition-colors",children:e.jsx(Je,{size:12})})]}),e.jsx(Us,{isOpen:!0,onClose:()=>A(!1),inline:!0})]})}),document.getElementById("modal-root")),Ke&&vt.createPortal(e.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-900/50",children:e.jsxs(k.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-[2rem] p-6 max-w-xs w-full text-center border-2 border-rose-200 shadow-[0_25px_60px_rgba(0,0,0,0.15)]",children:[e.jsx(k.div,{animate:{scale:[1,1.1,1]},transition:{duration:1,repeat:1/0},className:"text-6xl mb-4",children:e.jsx(Ys,{className:"w-10 h-10 text-rose-500"})}),e.jsx("h2",{className:"text-2xl font-black text-slate-800 mb-3",children:"Out of Lives!"}),e.jsx("p",{className:"text-slate-500 text-sm mb-4",children:"Your hearts have run out. You can wait for them to refill or head back and review your lessons in the meantime."}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2 text-rose-500 font-bold",children:[e.jsx("img",{src:"/icons/quiz_heart.png",alt:"Hearts",className:"w-5 h-5"}),e.jsx("span",{children:"0 / 15 hearts"})]}),e.jsxs("p",{className:"text-slate-400 text-xs mb-4",children:["Next heart in: ",e.jsxs("span",{className:"font-bold text-slate-600",children:[Math.floor(P/6e4),":",Math.floor(P%6e4/1e3).toString().padStart(2,"0")]})," (15 minutes per heart)"]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(ze,{onClick:Pt,className:"w-full py-3 bg-rose-500 hover:bg-rose-600 text-white font-bold rounded-full",children:"Exit Quiz"}),e.jsx(ze,{onClick:()=>{c(!1)},className:"w-full py-3 bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold rounded-full",children:"Review Lessons"})]})]})}),document.getElementById("modal-root")),e.jsx(st,{children:Ue&&v&&e.jsx(k.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{type:"spring",damping:20,stiffness:300},className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[200] pointer-events-none flex flex-col items-center justify-center",children:e.jsxs("div",{className:"bg-white/95 backdrop-blur-xl border border-slate-200 rounded-[2rem] p-6 md:p-8 shadow-[0_30px_80px_rgba(0,0,0,0.15)] flex flex-col items-center min-w-[280px] md:min-w-[320px]",children:[e.jsx("img",{src:"/mascot/modules_avatar.png",alt:"Mascot",className:"w-24 h-24 md:w-32 md:h-32 mb-4 drop-shadow-[0_10px_20px_rgba(0,0,0,0.15)]"}),e.jsx("h2",{className:"text-3xl md:text-4xl font-black mb-4 uppercase tracking-widest text-emerald-500",children:"Correct!"}),e.jsxs("div",{className:"flex flex-col items-center gap-3 w-full justify-center",children:[e.jsx("div",{className:"flex items-center gap-2 bg-emerald-500/20 text-emerald-400 px-4 py-2 rounded-full font-bold border border-emerald-500/30",children:e.jsxs("span",{children:["+ ",(ee[r]||[]).length>0?5:10," XP"]})}),Te==="streak"&&e.jsxs("div",{className:"flex items-center gap-2 bg-orange-500/20 text-orange-400 px-4 py-1.5 rounded-full text-sm font-bold border border-orange-500/30",children:[e.jsx(as,{size:14})," Streak Started!"]}),Te==="multiplier2"&&e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-1.5 rounded-full text-sm font-bold border border-amber-500/30",children:[e.jsx(Xe,{size:14})," Multiplier ×2!"]}),Te==="multiplier3"&&e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-1.5 rounded-full text-sm font-bold border border-amber-500/30",children:[e.jsx(Xe,{size:14})," Multiplier ×3!"]})]})]})},"round-result")}),e.jsxs("div",{className:"fixed inset-0 z-[100] h-screen w-full flex flex-col bg-slate-50 overflow-hidden",children:[e.jsxs("header",{className:"relative shrink-0 flex flex-col items-center justify-start px-4 pt-4 sm:pt-6 pb-6 z-[60] shadow-md overflow-hidden bg-gradient-to-r from-purple-600 to-indigo-400 rounded-b-[32px] sm:rounded-b-[40px] min-h-[110px] sm:min-h-[130px]",children:[e.jsxs("div",{className:"absolute inset-0 z-0 pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 w-64 h-64 bg-white opacity-10 rounded-full -translate-x-1/2 -translate-y-1/2 blur-2xl"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-80 h-80 bg-white opacity-10 rounded-full translate-x-1/3 translate-y-1/3 blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-7xl flex items-center justify-between relative z-10 mb-3 sm:mb-4 md:mb-6",children:[e.jsx("div",{className:"flex-1 flex items-center gap-1 sm:gap-2",children:e.jsxs("div",{className:"flex items-center gap-1 bg-white/20 px-2 py-1 sm:px-3 sm:py-1.5 rounded-full text-white text-xs sm:text-sm font-bold",children:[e.jsx(Nt,{size:14,className:"shrink-0"})," ",$r(Me)]})}),e.jsxs("div",{className:"relative flex items-center justify-center bg-purple-900/40 backdrop-blur-md px-2 sm:px-5 md:px-8 py-2 sm:py-3 rounded-full border border-white/10 gap-1.5 sm:gap-3 md:gap-4 shadow-inner",children:[e.jsx("div",{className:"hidden sm:block w-3 h-3 md:w-4 md:h-4 rounded-full bg-yellow-400 shrink-0 shadow-[0_0_10px_rgba(250,204,21,0.6)]"}),e.jsxs("div",{className:"flex flex-col items-start justify-center",children:[e.jsx("span",{className:"hidden sm:block text-[9px] md:text-[11px] font-black text-purple-200 uppercase tracking-widest leading-none mb-0.5",children:"Try It Yourself!"}),e.jsx("span",{className:"font-bold text-white tracking-wide text-xs sm:text-sm md:text-lg leading-none truncate max-w-[90px] sm:max-w-[180px] md:max-w-[300px]",children:t.title||t.subject})]})]}),e.jsxs("div",{className:"flex-1 flex justify-end gap-1 sm:gap-2 md:gap-3 relative pointer-events-auto",children:[e.jsxs("button",{onClick:()=>K(!$),className:"w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 rounded-full bg-purple-900/20 text-white flex items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:[$?e.jsx(Jt,{size:16,className:"sm:hidden"}):e.jsx(es,{size:16,className:"sm:hidden"}),$?e.jsx(Jt,{size:20,className:"hidden sm:block"}):e.jsx(es,{size:20,className:"hidden sm:block"})]}),e.jsx("button",{onClick:Ht,className:"hidden sm:flex w-10 h-10 md:w-12 md:h-12 rounded-full bg-purple-900/20 text-white items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:ne?e.jsx(Gs,{size:20}):e.jsx(Xs,{size:20})}),e.jsxs("button",{onClick:()=>G(!0),className:"w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 rounded-full bg-purple-900/20 text-white flex items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:[e.jsx(Je,{size:18,className:"sm:hidden"}),e.jsx(Je,{size:20,className:"hidden sm:block"})]})]})]}),e.jsx("div",{className:"w-full max-w-[50rem] flex items-center justify-center px-4 z-10",children:e.jsx("div",{className:"w-full flex items-center gap-2 sm:gap-3",children:ue.map((N,w)=>{let X=w<=r?"bg-white shadow-[0_0_8px_rgba(255,255,255,0.8)]":"bg-white/20";return e.jsx("div",{className:`h-1.5 sm:h-2 rounded-full flex-1 transition-all ${X}`},w)})})})]}),e.jsxs("div",{className:"w-full max-w-[54rem] mx-auto shrink-0 flex items-center justify-between px-2 sm:px-4 md:px-6 py-2 sm:py-3 z-[50] relative mt-4 sm:mt-6 md:mt-8",children:[e.jsxs("button",{onClick:()=>me(N=>Math.max(0,N-1)),disabled:q===0,className:`w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 shrink-0 rounded-full flex items-center justify-center shadow-md border-2 transition-all ${q===0?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-white text-purple-600 border-purple-100 hover:bg-purple-50 hover:border-purple-200 hover:scale-105 active:scale-95"}`,children:[e.jsx(ts,{size:18,className:"sm:hidden"}),e.jsx(ts,{size:24,className:"hidden sm:block"})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1.5 sm:gap-3 md:gap-5 flex-1 mx-1 sm:mx-2",children:[e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 md:gap-3 px-2.5 sm:px-5 md:px-10 py-1.5 sm:py-2 rounded-full bg-white shadow-md border border-slate-200/60 text-rose-500 font-extrabold text-xs sm:text-sm md:text-base",children:[e.jsx("img",{src:"/icons/quiz_heart.png",alt:"Hearts",className:"w-4 h-4 sm:w-5 sm:h-5 object-contain"})," ",lt]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 md:gap-3 px-2.5 sm:px-5 md:px-10 py-1.5 sm:py-2 rounded-full bg-white shadow-md border border-slate-200/60 text-yellow-500 font-extrabold text-xs sm:text-sm md:text-base",children:[e.jsx("img",{src:"/icons/quiz_key.png",alt:"Keys",className:"w-4 h-4 sm:w-5 sm:h-5 object-contain"})," ",de]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-3 md:gap-4 px-2 sm:px-3 py-1 sm:py-1.5 pl-2.5 sm:pl-4 md:pl-6 rounded-full bg-white shadow-md border border-slate-200/60",children:[e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 text-orange-500 font-extrabold text-xs sm:text-sm md:text-base",children:[e.jsx("img",{src:"/icons/quiz_streak.png",alt:"Streak",className:"w-4 h-4 sm:w-5 sm:h-5 object-contain"})," ",_]}),e.jsxs("div",{className:"bg-emerald-100 text-emerald-800 px-2 sm:px-3 md:px-4 py-1 sm:py-1.5 rounded-full font-bold text-xs sm:text-sm md:text-base shadow-inner border border-emerald-200/50 whitespace-nowrap",children:["+ ",Ee," pts"]})]})]}),e.jsxs("button",{onClick:()=>me(N=>Math.min(r,N+1)),disabled:q>=r,className:`w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 shrink-0 rounded-full flex items-center justify-center shadow-md border-2 transition-all ${q>=r?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-white text-purple-600 border-purple-100 hover:bg-purple-50 hover:border-purple-200 hover:scale-105 active:scale-95"}`,children:[e.jsx(ot,{size:18,className:"sm:hidden"}),e.jsx(ot,{size:24,className:"hidden sm:block"})]})]}),e.jsx("main",{className:"flex-1 overflow-y-auto w-full px-4 sm:px-6 pt-0 pb-6 flex flex-col items-center relative z-10",children:e.jsxs(k.div,{initial:{opacity:0,x:20},animate:St?{x:[-10,10,-10,10,0],scale:[1,1.01,1],opacity:1}:{opacity:1,x:0},className:"w-full max-w-3xl flex flex-col mt-2",children:[e.jsxs("div",{className:"bg-white rounded-3xl shadow-lg border-t-[6px] border-purple-500 p-4 sm:p-6 md:p-8 text-center flex flex-col items-center mb-4 sm:mb-6 w-full relative overflow-hidden",children:[e.jsxs("div",{className:"bg-slate-100 text-slate-600 px-3 sm:px-4 py-1 sm:py-1.5 rounded-full text-[10px] sm:text-[11px] md:text-xs font-black uppercase tracking-widest mb-3 sm:mb-4 flex items-center shadow-sm",children:["Q",q+1," of ",ue.length]}),e.jsx("h2",{className:"text-base sm:text-xl md:text-2xl font-extrabold text-[#0a1628] leading-tight w-full",children:J.question.includes("___")?e.jsx("span",{children:J.question.split("___").map((N,w,X)=>e.jsxs(je.Fragment,{children:[N,wu(F.target.value),onKeyDown:F=>{F.key==="Enter"&&!p&&dt()},className:`inline-block w-24 mx-2 border-b-4 outline-none text-center bg-transparent font-bold ${I?"border-slate-300 text-slate-500":"border-[#7C3AED] text-[#7C3AED] focus:border-[#75D06A]"}`})]},w))}):J.question})]}),e.jsxs("div",{className:"w-full flex flex-col items-center",children:[J.questionType==="multiple_choice"||!J.questionType?e.jsx("div",{className:"w-full grid grid-cols-1 sm:grid-cols-2 gap-2.5 sm:gap-3 md:gap-5",children:(J.options||[]).map((N,w)=>{const X=ee[r]||[],F=X.includes(N),H=X.length,Ge=(J.options||[]).length-1,Ie=Ge>0&&H>=Ge;let ye="bg-white hover:bg-slate-50 border-transparent text-slate-700 hover:border-slate-200",Ce=!1;if(Ie){Ce=!0;const we=J.options?.[J.correctAnswer];N===we?ye="bg-emerald-50 border-emerald-400 text-emerald-800":C[q]?.answer===String(w)?ye="bg-rose-50 border-rose-400 text-rose-800 opacity-80":ye="bg-slate-100 border-slate-200 text-slate-400 opacity-40 line-through"}else if(F)ye="bg-slate-100 border-slate-200 text-slate-400 opacity-40 line-through cursor-not-allowed";else if(I){const we=w===J.correctAnswer,pe=q===r&&(x===w||ve===w)||q{Ce||I||F||Mt(w)},className:`p-3 sm:p-4 md:p-5 rounded-2xl shadow-sm border-[3px] font-extrabold text-sm sm:text-base md:text-lg text-left transition-all flex items-center justify-between ${ye} ${Ce||I||F?"cursor-default":"hover:shadow-md hover:-translate-y-0.5 active:translate-y-0"}`,children:[e.jsx("span",{className:"truncate pr-4",children:N}),F&&e.jsx(Wt,{size:20,className:"text-slate-400 shrink-0"}),I&&w===J.correctAnswer&&e.jsx(ft,{size:22,className:"text-emerald-500 shrink-0"}),I&&x===w&&w!==J.correctAnswer&&e.jsx(Wt,{size:22,className:"text-rose-500 shrink-0"})]},w)})}):e.jsx("div",{className:"w-full max-w-2xl mx-auto flex flex-col gap-4",children:!J.question.includes("___")&&e.jsx("input",{type:"text",disabled:I,value:q===r?M:"",onChange:N=>u(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!p&&dt()},placeholder:"Type your answer here...",className:`w-full p-3 sm:p-4 md:p-5 rounded-2xl border-[3px] font-extrabold text-base sm:text-lg text-center outline-none transition-colors ${I?v?"border-emerald-400 text-emerald-700 bg-emerald-50":"border-rose-400 text-rose-700 bg-rose-50":"border-slate-200 focus:border-[#7C3AED] bg-white text-slate-800"}`})}),I&&y&&e.jsxs("div",{className:"w-full max-w-3xl mt-6 flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:J.topic||t?.subject||"General Math"}),e.jsxs("p",{className:"text-sm text-slate-500",children:["Question ",q+1," Explanation"]})]}),e.jsx("img",{src:"/icons/default-module-avatar.png",alt:"Module Avatar",className:"w-12 h-12 rounded-full object-cover border-2 border-slate-200"})]}),I&&y&&e.jsx(k.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"w-full mt-4 space-y-4 max-w-3xl",children:e.jsxs("div",{className:`border-2 rounded-2xl p-5 flex items-start gap-4 ${(q===r?v:C[q]?.correct)?"bg-emerald-50 border-emerald-200":"bg-rose-50 border-rose-200"}`,children:[(q===r?v:C[q]?.correct)?e.jsx(ft,{size:28,className:"text-emerald-500 shrink-0 mt-0.5"}):e.jsx(Wt,{size:28,className:"text-rose-500 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:`font-extrabold text-lg mb-1 ${(q===r?v:C[q]?.correct)?"text-emerald-700":"text-rose-700"}`,children:(q===r?v:C[q]?.correct)?"Correct!":"Incorrect"}),e.jsx("p",{className:`text-base leading-relaxed ${(q===r?v:C[q]?.correct)?"text-emerald-800":"text-rose-800"}`,children:J.explanation||`Correct Answer: ${J.correctAnswerText||J.options?.[J.correctAnswer]}`})]})]})})]})]},q)}),e.jsx("footer",{className:"shrink-0 relative z-[60] flex flex-col items-center justify-center p-4 sm:p-6 bg-gradient-to-r from-purple-600 to-indigo-400 rounded-t-[32px] sm:rounded-t-[40px] shadow-[0_-10px_40px_rgba(0,0,0,0.15)]",children:(()=>{const N=(ee[r]||[]).length,w=(le.options||[]).length-1,X=w>0&&N>=w;return X||I&&!v?e.jsxs("button",{onClick:nt,className:"bg-orange-500 hover:bg-orange-600 text-white font-extrabold text-sm sm:text-base md:text-lg px-5 sm:px-8 py-3 sm:py-4 rounded-full flex items-center justify-center gap-2 sm:gap-3 shadow-xl hover:scale-[1.02] active:scale-[0.98] transition-all w-full max-w-md mx-auto",children:[r{const H=zt>0&&!p&&!X;return e.jsxs("button",{onClick:It,disabled:!H,className:"bg-white hover:bg-slate-50 disabled:opacity-70 disabled:cursor-not-allowed text-slate-700 font-bold px-4 sm:px-6 md:px-8 py-2.5 sm:py-3 md:py-3.5 rounded-full flex items-center gap-1.5 sm:gap-2 text-sm sm:text-base shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx("img",{src:"/icons/quiz_key.png",alt:"Key",className:"w-4 h-4 sm:w-5 sm:h-5 object-contain"})," Hint"]})})(),I&&e.jsxs("button",{onClick:()=>W(!0),className:"bg-white hover:bg-slate-50 text-slate-700 font-bold px-4 sm:px-6 md:px-8 py-2.5 sm:py-3 md:py-3.5 rounded-full flex items-center gap-1.5 sm:gap-2 text-sm sm:text-base shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx(Fe,{size:16,className:"sm:hidden"}),e.jsx(Fe,{size:20,className:"hidden sm:block"})," Explain"]}),e.jsx("button",{onClick:()=>A(H=>!H),className:`w-11 h-11 sm:w-12 sm:h-12 rounded-full flex items-center justify-center shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200 ${h?"bg-purple-100 text-purple-600 border-purple-300":"bg-white hover:bg-slate-50 text-slate-700"}`,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}),e.jsx("line",{x1:"8",x2:"16",y1:"6",y2:"6"}),e.jsx("path",{d:"M16 10h.01"}),e.jsx("path",{d:"M12 10h.01"}),e.jsx("path",{d:"M8 10h.01"}),e.jsx("path",{d:"M12 14h.01"}),e.jsx("path",{d:"M8 14h.01"}),e.jsx("path",{d:"M12 18h.01"}),e.jsx("path",{d:"M8 18h.01"}),e.jsx("line",{x1:"16",x2:"16",y1:"14",y2:"18"})]})})]}):qme(r),className:"bg-white text-slate-700 font-extrabold text-sm sm:text-base md:text-lg px-4 sm:px-6 md:px-8 py-2.5 sm:py-3 md:py-4 rounded-full inline-flex items-center gap-1.5 sm:gap-2 md:gap-3 shadow-lg hover:bg-slate-50 transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx(ot,{size:16,className:"sm:hidden"}),e.jsx(ot,{size:20,className:"hidden sm:block"}),"Back to Current Question"]}):null})()})]}),T&&e.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:e.jsxs(k.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-2xl p-6 w-full max-w-[320px] shadow-2xl border border-slate-200 flex flex-col items-center gap-4",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 text-center",children:"Leave this quiz?"}),e.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Your progress will be reset and you'll need to start over."}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("button",{onClick:()=>G(!1),className:"w-full py-3 bg-[#9956DE] hover:bg-[#8544c7] text-white font-bold rounded-full transition-colors",children:"Stay"}),e.jsx("button",{onClick:()=>{G(!1),s()},className:"w-full py-3 bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold rounded-full transition-colors",children:"Leave Quiz"})]})]})})]})};function Lr(t,s){const l={"Pre-Calculus":["What is the domain of the function f(x) = √(x - 2)?","Solve for x: 2^x = 16","What is the period of the function y = sin(2x)?","Find the inverse of f(x) = 3x + 5","What is the value of log₂(32)?","Simplify: (x² - 9) / (x - 3)","What is the range of f(x) = |x| - 3?","If f(x) = 2x + 1 and g(x) = x², find f(g(2)).","What is the amplitude of y = 3cos(x)?","Solve: log₃(x) = 4"],"General Mathematics":["Simplify: (2x + 3)(x - 4)","What is 15% of 240?","Solve: 3x + 7 = 22","What is the value of 5! (5 factorial)?","Convert 0.75 to a fraction","What is 25% of 360?","Simplify: 12/18","What is the GCD of 24 and 36?","Convert 3/8 to a decimal","If a shirt costs $40 and is 20% off, what is the sale price?","What is 2/3 + 1/4?","Calculate: 15% tip on a $80 bill","Simplify: 45/60","What fraction is equivalent to 0.125?","If 30% of a number is 45, what is the number?"],"Statistics and Probability":["What is the probability of rolling a 6 on a fair die?","Calculate the mean of: 4, 7, 9, 12, 15","What is the median of: 2, 5, 8, 11, 14?","In a bag with 5 red and 3 blue balls, what is P(red)?","What is the range of: 10, 15, 20, 25, 30?","What is the mode of: 3, 5, 5, 7, 8, 5, 9?","What is the standard deviation concept?","P(A) = 0.3, P(B) = 0.5, events independent. P(A and B) = ?","What is the median of: 4, 7, 10, 13?","How many ways can you arrange 3 books?"],"Basic Calculus":["Find the derivative of f(x) = 3x²","What is the limit of (x² - 4)/(x - 2) as x → 2?","Integrate: ∫ 2x dx","Find f'(x) if f(x) = 5x³ - 2x","What is the derivative of sin(x)?","Find the derivative of f(x) = eˣ + 3x","What is ∫ cos(x) dx?","Find the derivative of f(x) = ln(x)","What is the limit of 1/x as x → ∞?","Find f'(x) if f(x) = x⁴ - 2x² + 1"]},i=Bt(t),n=l[i]||l["General Mathematics"];return n[s%n.length]}function Bt(t){const s=t.toLowerCase();return s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("statistic")||s.includes("probability")?"Statistics and Probability":s.includes("calculus")&&!s.includes("pre")?"Basic Calculus":s.includes("general")||s.includes("math")||s.includes("algebra")||s.includes("fraction")||s.includes("percent")||s.includes("ratio")||s.includes("geometry")?"General Mathematics":s.includes("derivative")||s.includes("integral")||s.includes("limit")?"Basic Calculus":s.includes("trig")||s.includes("function")||s.includes("log")?"Pre-Calculus":s.includes("mean")||s.includes("median")||s.includes("data")?"Statistics and Probability":"General Mathematics"}function Dr(t,s){const l={"Pre-Calculus":[["x ≥ 2","x ≤ 2","x ≥ 0","All real numbers"],["x = 2","x = 4","x = 8","x = 16"],["π","2π","π/2","4π"],["f⁻¹(x) = (x - 5)/3","f⁻¹(x) = 3x - 5","f⁻¹(x) = x/3 - 5","f⁻¹(x) = (x + 5)/3"],["4","5","6","7"],["x + 3","x - 3","x² + 3","(x + 3)(x - 3)"],["y ≥ -3","y ≥ 0","All real numbers","y > -3"],["9","5","7","3"],["1","2","3","1/3"],["12","27","64","81"]],"General Mathematics":[["2x² - 5x - 12","2x² + 5x - 12","2x² - 8x + 12","2x² - 5x + 12"],["36","32","28","24"],["x = 5","x = 4","x = 6","x = 7"],["120","24","60","720"],["3/4","1/2","2/3","4/5"],["90","80","100","72"],["2/3","3/4","4/6","6/9"],["12","6","8","4"],["0.375","0.38","0.35","0.325"],["$32","$28","$30","$36"],["11/12","3/7","5/6","2/3"],["$12","$10","$15","$8"],["3/4","2/3","4/5","9/12"],["1/8","1/4","1/5","1/6"],["150","135","120","160"]],"Statistics and Probability":[["1/6","1/3","1/2","2/3"],["9.4","8.5","10.2","7.8"],["8","9","7","10"],["5/8","3/8","1/2","2/5"],["20","15","25","30"],["5","3","7","8"],["Spread of data from the mean","The highest value","The average","The middle value"],["0.15","0.8","0.35","0.2"],["8.5","7","10","9"],["6","3","9","12"]],"Basic Calculus":[["6x","3x","9x²","6x²"],["4","2","0","undefined"],["x² + C","2x² + C","x²/2 + C","2x + C"],["15x² - 2","15x² - 2x","5x² - 2","15x - 2"],["cos(x)","-cos(x)","tan(x)","-sin(x)"],["eˣ + 3","eˣ + 3x","xeˣ + 3","eˣ"],["sin(x) + C","-sin(x) + C","tan(x) + C","-cos(x) + C"],["1/x","x","ln(x)","-1/x²"],["0","1","∞","undefined"],["4x³ - 4x","4x³ - 2x","x³ - 4x","4x⁴ - 4x²"]]},i=Bt(t),n=l[i]||l["General Mathematics"];return n[s%n.length]}function Fr(t,s){const l={"Pre-Calculus":[0,1,0,0,1,0,0,0,2,3],"General Mathematics":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Statistics and Probability":[0,0,0,0,0,0,0,0,0,0],"Basic Calculus":[0,0,0,0,0,0,0,0,0,0]},i=Bt(t),n=l[i]||l["General Mathematics"];return n[s%n.length]}function Rr(t,s,l){const i={"Pre-Calculus":["The expression under the square root must be non-negative: x - 2 ≥ 0, so x ≥ 2.","Since 2⁴ = 16, we get x = 4.","The period of sin(kx) is 2π/k. Here k = 2, so period = 2π/2 = π.","To find the inverse: y = 3x + 5 → x = 3y + 5 → y = (x - 5)/3.","Since 2⁵ = 32, log₂(32) = 5.","(x² - 9)/(x - 3) = (x+3)(x-3)/(x-3) = x + 3 (for x ≠ 3).","The absolute value |x| ≥ 0 for all x, so |x| - 3 ≥ -3. The range is y ≥ -3.","g(2) = 4, then f(4) = 2(4) + 1 = 9.","The amplitude of y = Acos(x) is |A|. Here A = 3, so amplitude = 3.","log₃(x) = 4 means 3⁴ = x, so x = 81."],"General Mathematics":["(2x + 3)(x - 4) = 2x² - 8x + 3x - 12 = 2x² - 5x - 12","15% of 240 = 0.15 × 240 = 36","3x + 7 = 22 → 3x = 15 → x = 5","5! = 5 × 4 × 3 × 2 × 1 = 120","0.75 = 75/100 = 3/4 after simplifying by dividing both by 25","25% of 360 = 0.25 × 360 = 90","12/18 = (12÷6)/(18÷6) = 2/3","Factors of 24: {1,2,3,4,6,8,12,24}. Factors of 36: {1,2,3,4,6,9,12,18,36}. GCD = 12","3 ÷ 8 = 0.375","20% off $40 = $40 × 0.80 = $32","2/3 + 1/4 = 8/12 + 3/12 = 11/12","15% of $80 = 0.15 × 80 = $12","45/60 = (45÷15)/(60÷15) = 3/4","0.125 = 125/1000 = 1/8","30% × N = 45 → N = 45/0.30 = 150"],"Statistics and Probability":["A fair die has 6 outcomes, each equally likely. P(6) = 1/6.","Mean = (4 + 7 + 9 + 12 + 15) / 5 = 47/5 = 9.4","Sorted: 2, 5, 8, 11, 14. The middle value is 8.","P(red) = 5/(5+3) = 5/8","Range = max - min = 30 - 10 = 20","The value 5 appears 3 times, more than any other value. Mode = 5.","Standard deviation measures how spread out data points are from the mean.","For independent events: P(A and B) = P(A) × P(B) = 0.3 × 0.5 = 0.15","For even-count dataset {4,7,10,13}: median = (7+10)/2 = 8.5","3 books can be arranged in 3! = 3 × 2 × 1 = 6 ways."],"Basic Calculus":["Using the power rule: d/dx[3x²] = 3 × 2x = 6x","Factor: (x²-4)/(x-2) = (x+2)(x-2)/(x-2) = x+2. As x→2: 2+2 = 4","∫ 2x dx = 2 × x²/2 + C = x² + C","f'(x) = 5 × 3x² - 2 = 15x² - 2","The derivative of sin(x) is cos(x). This is a fundamental trigonometric derivative.","d/dx[eˣ + 3x] = eˣ + 3. The derivative of eˣ is eˣ and of 3x is 3.","∫ cos(x) dx = sin(x) + C. Integration is the reverse of differentiation.","The derivative of ln(x) is 1/x. This is a fundamental logarithmic derivative.","As x → ∞, 1/x approaches 0. The function gets infinitely close to zero.","f'(x) = 4x³ - 4x using the power rule on each term."]},n=Bt(t),o=i[n]||i["General Mathematics"];return o[s%o.length]}function $r(t){const s=Math.floor(t/60),l=t%60;return`${s}:${l.toString().padStart(2,"0")}`}function Br(){return e.jsxs("div",{className:"rounded-2xl bg-slate-900 shadow-lg",children:[e.jsx("div",{className:"w-full rounded-t-2xl bg-slate-800 animate-pulse",style:{position:"relative",paddingBottom:"56.25%",height:0}}),e.jsxs("div",{className:"px-4 py-3 bg-slate-800 rounded-b-2xl space-y-2",children:[e.jsx("div",{className:"h-4 bg-slate-700 rounded w-3/4 animate-pulse"}),e.jsx("div",{className:"h-3 bg-slate-700 rounded w-1/2 animate-pulse"})]})]})}const qr=({videos:t,topic:s})=>{const[l,i]=a.useState(0);if(!t||t.length===0)return e.jsx(Br,{});const n=t[l],o=t.filter((r,d)=>d!==l);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(st,{mode:"wait",children:e.jsxs(k.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"rounded-2xl bg-slate-900 shadow-lg",style:{overflow:"visible"},children:[e.jsx("div",{className:"w-full rounded-t-xl",style:{position:"relative",paddingBottom:"40%",height:0,overflow:"hidden"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${n.videoId}?rel=0&modestbranding=1`,title:n.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none"}})}),e.jsxs("div",{className:"px-4 py-3 bg-slate-800 rounded-b-2xl",children:[e.jsx("p",{className:"text-slate-200 text-sm font-medium truncate",children:n.title}),e.jsx("p",{className:"text-slate-400 text-xs mt-0.5",children:n.channelTitle})]})]},n.videoId)}),o.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-slate-500 font-medium uppercase tracking-wide",children:"More videos"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:o.slice(0,2).map(r=>{const d=t.findIndex(x=>x.videoId===r.videoId);return e.jsxs("button",{onClick:()=>i(d),className:"group text-left rounded-xl overflow-hidden border border-slate-200 hover:border-rose-300 hover:shadow-md transition-all duration-200 bg-white",children:[e.jsxs("div",{className:"relative aspect-video",children:[e.jsx("img",{src:r.thumbnailUrl,alt:r.title,loading:"lazy",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 rounded-full bg-white/90 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity shadow-sm",children:e.jsx(Ws,{size:14,className:"text-rose-500 ml-0.5"})})})]}),e.jsxs("div",{className:"p-2.5",children:[e.jsx("p",{className:"text-slate-700 text-xs font-medium line-clamp-2 leading-snug",children:r.title}),e.jsx("p",{className:"text-slate-400 text-[10px] mt-0.5 truncate",children:r.channelTitle})]})]},r.videoId)})})]})]})},Ts=({value:t,label:s,delay:l=0,icon:i})=>{const[n,o]=je.useState(0);return je.useEffect(()=>{if(t<=0)return;const r=1e3,d=30,x=Math.abs(Math.floor(r/d));let f=0;const M=setTimeout(()=>{const u=setInterval(()=>{f+=Math.max(1,Math.floor(t/d)),f>=t?(o(t),clearInterval(u)):o(f)},x);return()=>clearInterval(u)},l);return()=>clearTimeout(M)},[t,l]),t<0?null:e.jsxs(k.div,{initial:{opacity:0,transform:"translateX(-20px)"},animate:{opacity:1,transform:"translateX(0)"},transition:{delay:l/1e3,duration:.5},className:"flex items-center justify-between bg-slate-50 border border-slate-100 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-slate-500 font-bold uppercase tracking-wider text-[10px]",children:[i,s]}),e.jsxs("div",{className:"text-xl font-black text-purple-600 tabular-nums",children:["+",n]})]})},Hr=({viewportHeight:t})=>{const s=je.useMemo(()=>[...Array(40)].map((l,i)=>({id:i,left:`${Math.random()*100}%`,duration:.6+Math.random()*.4,delay:Math.random()*.4})),[t]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden flex justify-between",children:s.map(l=>e.jsx(k.div,{className:"absolute w-0.5 h-16 bg-blue-400/40 rounded-full",style:{left:l.left,top:"-10%"},animate:{y:[0,t*1.2]},transition:{duration:l.duration,ease:"linear",delay:l.delay}},l.id))})},Or=({viewportHeight:t,viewportWidth:s})=>{const l=je.useMemo(()=>[...Array(30)].map((i,n)=>({id:n,xShift:(Math.random()-.5)*s*.8,yShift:(Math.random()-.5)*t*.8,scale:Math.random()*1.5+.5,duration:2+Math.random()*1.5,delay:Math.random()*.35})),[t,s]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden flex items-center justify-center",children:l.map(i=>e.jsx(k.div,{className:"absolute w-2 h-2 bg-amber-400 rounded-full shadow-[0_0_10px_rgba(251,191,36,0.6)]",style:{left:"50%",top:"50%"},animate:{y:[0,i.yShift],x:[0,i.xShift],scale:[0,i.scale,0],opacity:[0,1,0]},transition:{duration:i.duration,ease:"easeOut",delay:i.delay}},i.id))})},Qr=()=>{const t=je.useMemo(()=>[...Array(60)].map((s,l)=>({id:l,left:`${Math.random()*100}%`,backgroundColor:["#75D06A","#6ED1CF","#9956DE","#FB96BB","#FFB356"][l%5],duration:2+Math.random()*2,delay:Math.random()*.5,size:6+Math.random()*8,borderRadius:Math.random()>.5?"50%":"2px"})),[]);return e.jsxs("div",{className:"absolute inset-0 pointer-events-none z-[250] overflow-hidden",children:[e.jsx("style",{children:` - @keyframes confetti-fall { - 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; } - 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } - } - .confetti-piece { - animation-name: confetti-fall; - animation-timing-function: linear; - animation-fill-mode: forwards; - } - `}),t.map(s=>e.jsx("div",{className:"confetti-piece absolute",style:{left:s.left,top:"-10%",backgroundColor:s.backgroundColor,width:s.size,height:s.size,borderRadius:s.borderRadius,animationDuration:`${s.duration}s`,animationDelay:`${s.delay}s`}},s.id))]})},Wr=({lesson:t,questions:s,onComplete:l,onBack:i})=>{const[n,o]=a.useState(0),[r,d]=a.useState(0),[x,f]=a.useState(null),[M,u]=a.useState(""),[v,m]=a.useState(!1),[p,S]=a.useState(!1),[y,W]=a.useState(0),[j,E]=a.useState(0),[_,D]=a.useState(0),[b,L]=a.useState(!1),[B,se]=a.useState([]),[C,re]=a.useState(!1),[ge,He]=a.useState(!1),[ce,Oe]=a.useState(null),[Se,U]=a.useState(null),[ve,Qe]=a.useState(!1),[Me,Ve]=a.useState(!1),[Re,We]=a.useState(!1),[h,A]=a.useState(!1),[T,G]=a.useState(!1),[$,K]=a.useState(typeof window<"u"?window.innerHeight:800),[ne,_e]=a.useState(typeof window<"u"?window.innerWidth:1200),[fe,be]=a.useState([]),[Ee]=a.useState(Date.now()),[R,ee]=a.useState(0),[xe,$e]=a.useState(!1),[at,St]=a.useState(!0),[bt,Ue]=a.useState(!1),[Ct,Ne]=a.useState(!1),[de,rt]=a.useState(!1),[lt,ct]=a.useState(!1),[zt,Be]=a.useState(0),[Ye,Ke]=a.useState({}),[c,P]=a.useState(5),[Q,ie]=a.useState(15),[Z,q]=a.useState(null),[me,Te]=a.useState(!1),[Ae,ue]=a.useState(900*1e3),[le,Pe]=a.useState({}),[gt,Ze]=a.useState({}),[ke,Pt]=a.useState(!1),[It,Mt]=a.useState(!1),[dt,nt]=a.useState(null),[qt]=a.useState(Array.from({length:15},(g,z)=>({id:z,size:Math.random()*120+60,x:Math.random()*100,y:Math.random()*100,duration:Math.random()*25+15,delay:Math.random()*-20,color:["bg-white/5","bg-indigo-300/10","bg-sky-300/10","bg-purple-300/10"][Math.floor(Math.random()*4)]}))),I=s[r],J=r{if(at)try{const z=window.AudioContext||window.webkitAudioContext;if(!z)return;const O=new z,Y=O.currentTime,he=(te,V,oe,Le=.1,yt="sine")=>{const it=O.createOscillator(),xt=O.createGain();it.type=yt,it.frequency.value=te,xt.gain.setValueAtTime(0,V),xt.gain.linearRampToValueAtTime(Le,V+.05),xt.gain.exponentialRampToValueAtTime(.001,V+oe),it.connect(xt),xt.connect(O.destination),it.start(V),it.stop(V+oe)};g==="correct"?(he(880,Y,.1,.1,"sine"),he(1108.73,Y+.1,.2,.1,"sine")):g==="incorrect"?(he(300,Y,.2,.05,"sawtooth"),he(250,Y+.15,.3,.05,"sawtooth")):g==="streak"?(he(440,Y,.1,.05,"square"),he(554.37,Y+.1,.1,.05,"square"),he(659.25,Y+.2,.1,.05,"square"),he(880,Y+.3,.4,.05,"square")):g==="complete"&&(he(523.25,Y,.1,.1),he(659.25,Y+.15,.1,.1),he(783.99,Y+.3,.1,.1),he(1046.5,Y+.45,.5,.1))}catch{}};a.useEffect(()=>{const g=()=>{K(window.innerHeight),_e(window.innerWidth)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),a.useEffect(()=>{if(I?.type==="multiple-choice"&&I.options){const g=I.options.map((z,O)=>({id:`${I.id}-${O}`,text:z}));for(let z=g.length-1;z>0;z--){const O=Math.floor(Math.random()*(z+1));[g[z],g[O]]=[g[O],g[z]]}se(g)}else se([])},[n,I]),a.useEffect(()=>{Ne(!1),rt(!1)},[n]);const X=()=>{document.fullscreenElement?(document.exitFullscreen().catch(()=>{}),Ue(!1)):(document.documentElement.requestFullscreen().catch(()=>{}),Ue(!0))},F=()=>rt(g=>!g);a.useEffect(()=>{const g=z=>{z.key==="Enter"&&(!v&&H()?ye():v&&Ce())};return window.addEventListener("keypress",g),()=>window.removeEventListener("keypress",g)},[v,x,M]),a.useEffect(()=>{Q===0&&!Z&&(q(Date.now()),Te(!0))},[Q,Z]),a.useEffect(()=>{if(!me||!Z)return;const g=setInterval(()=>{const z=Date.now()-Z,O=Math.max(0,900*1e3-z);ue(O)},1e3);return()=>clearInterval(g)},[me,Z]);const H=()=>I.type==="fill-in-blank"?M.trim().length>0:x!==null,Ge=()=>{if(c<=0||v||le[n]||de)return;const g=Ye[n]||[],z=B.filter(Y=>Y.text!==I.correctAnswer).filter(Y=>!g.includes(Y.text));if(z.length===0)return;const O=z[Math.floor(Math.random()*z.length)];Ke(Y=>({...Y,[n]:[...g,O.text]})),P(Y=>Math.max(0,Y-1)),Be(Y=>Math.max(0,Y-5)),w("correct")},Ie=()=>{le[n]||v||de||(Pe(g=>({...g,[n]:!0})),Ne(!0))},ye=g=>{if(C||roe.id===x);O=V?V.text:""}else{re(!1);return}z=O===I.correctAnswer}if(!z){Pt(!0),w("incorrect"),setTimeout(()=>Pt(!1),500),ie(oe=>Math.max(0,oe-1)),E(0);const V=[...gt[n]||[],O];if(Ze(oe=>({...oe,[n]:V})),I.type==="multiple-choice"||I.type==="true-false"){const oe=I.options?I.options.length-1:1;V.length>=oe&&(S(!1),m(!0),be(Le=>{const yt=[...Le];return yt[r]=!1,yt}))}else V.length>=3&&(S(!1),m(!0),be(oe=>{const Le=[...oe];return Le[r]=!1,Le}));re(!1);return}S(!0),m(!0),be(V=>{const oe=[...V];return oe[r]=!0,oe});const he=(Ye[n]||[]).length>0?5:10;Be(V=>V+he),W(V=>V+1);const te=j+1;if(E(te),D(Math.max(_,te)),te===2?nt("streak"):te===3&&xs<2?nt("multiplier2"):te===5&&xs<3&&nt("multiplier3"),te>0&&te%3===0){const V=te*5;ee(oe=>oe+V),w("streak")}else w("correct");ct(!0),setTimeout(()=>{ct(!1),nt(null),setTimeout(()=>Ce(),500)},1200),rs(()=>import("./confetti.module-C94ZD2ww.js"),[]).then(V=>{V.default({particleCount:30,spread:40,colors:["#75D06A","#6ED1CF"],origin:{y:.6}})}).finally(()=>re(!1))},Ce=()=>{ng+1),d(g=>g+1),m(!1),f(null),u(""),S(!1)):we()},we=()=>{const g=Math.round(y/s.length*100);L(!0),g>=80||(g>=50?(A(!0),setTimeout(()=>A(!1),5e3)):(We(!0),setTimeout(()=>We(!1),5e3))),w("complete")},pe=N==="quiz"?{gradient:"bg-gradient-to-br from-[#7274ED] via-[#9956DE] to-[#7274ED]"}:{gradient:"bg-gradient-to-br from-[#75D06A] via-[#6ED1CF] to-[#75D06A]"},Ot=(()=>{const g=Ht.toLowerCase();return g.includes("geometry")||g.includes("shape")?[Ms,Ns,zs,js,pr,fr]:g.includes("algebra")||g.includes("equation")?[Je,Ut,vs,Gt,wt,Ss]:g.includes("calculus")||g.includes("derivative")||g.includes("integral")?[Cs,Gt,At,wt,Ut,vs]:g.includes("statistics")||g.includes("probability")?[et,At,js,Ns,Ms,zs]:[wt,Cs,Ut,Ss,Gt,Oa]})();Ot[0];const xs=Math.min(2,1+j*.1);if(b){const g=Math.round(y/s.length*100),z=g>=80,O=g>=50&&g<80,Y=N==="quiz"?100:50,he=Math.round(y/s.length*100),te=Y+he+R,V=document.getElementById("modal-root"),oe=e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-900/40",children:[h&&e.jsx(Or,{viewportHeight:$,viewportWidth:ne}),Re&&e.jsx(Hr,{viewportHeight:$}),z&&e.jsx(Qr,{}),e.jsxs(k.div,{initial:{opacity:0,scale:.8,y:40},animate:{opacity:1,scale:1,y:0},transition:{type:"spring",damping:18,stiffness:200},className:"w-full max-w-xs sm:max-w-sm bg-white border-2 border-slate-200 shadow-[0_25px_60px_rgba(0,0,0,0.15)] rounded-[2rem] p-4 sm:p-5 text-center relative z-10",children:[e.jsx(k.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",damping:12,stiffness:150,delay:.2},className:"mb-3",children:e.jsx("img",{src:"/mascot/modules_avatar.png",alt:"Mascot",className:"w-16 h-16 sm:w-20 sm:h-20 mx-auto drop-shadow-xl"})}),e.jsx(k.h2,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},className:`text-xl sm:text-2xl font-black uppercase tracking-tight mb-1 drop-shadow-sm ${z?"text-emerald-500":O?"text-amber-500":"text-rose-500"}`,children:z?"EXCELLENT!":O?"GOOD JOB!":"KEEP TRYING!"}),e.jsxs("p",{className:"text-slate-400 font-bold text-[10px] mb-3 uppercase tracking-widest",children:["Quiz Complete • Score: ",y,"/",s.length]}),e.jsx(k.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"bg-slate-50/50 rounded-xl p-3 mb-4 border border-slate-100 flex flex-col gap-2",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-slate-400 text-[9px] font-black uppercase tracking-widest text-left mb-1.5 ml-1",children:"Performance Details"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ts,{value:y,label:"Correct Answers",delay:500,icon:e.jsx(Ft,{size:14,className:"h-3 w-3 text-emerald-500"})}),e.jsx(Ts,{value:te,label:"Total XP Earned",delay:800,icon:e.jsx(Xe,{size:14,className:"h-3 w-3 text-amber-500"})}),e.jsxs(k.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:1.2,duration:.4},className:"flex items-center justify-between pt-1.5 mt-1 border-t border-slate-100",children:[e.jsx("span",{className:"text-slate-400 text-[9px] font-black uppercase tracking-widest",children:"Final Accuracy"}),e.jsxs("span",{className:"text-lg font-black text-slate-800 tabular-nums",children:[g,"%"]})]})]})]})}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(ze,{size:"lg",onClick:()=>{o(0),d(0),f(null),u(""),W(0),E(0),D(0),Be(0),be([]),m(!1),S(!1),L(!1),Ke({}),Pe({}),Ze({}),G(!1)},className:"w-full h-10 sm:h-11 rounded-2xl text-xs font-black bg-white hover:bg-slate-50 text-purple-600 border-2 border-purple-100",children:"RETAKE QUIZ"}),e.jsx(ze,{size:"lg",onClick:()=>l(g,te),className:"w-full h-10 sm:h-11 rounded-2xl text-xs font-black bg-purple-600 hover:bg-purple-700 text-white shadow-lg shadow-purple-200",children:"BACK TO MODULE"})]})]})]});return vt.createPortal(oe,V)}return e.jsxs(e.Fragment,{children:[It&&vt.createPortal(e.jsx(k.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"fixed right-6 top-1/2 -translate-y-1/2 z-[9999] w-64",children:e.jsxs("div",{className:"bg-white rounded-2xl p-3 border border-slate-200 shadow-[0_10px_40px_rgba(0,0,0,0.2)]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[e.jsxs("h4",{className:"text-xs font-bold text-[#0a1628] flex items-center gap-2",children:[e.jsx(wt,{size:14,className:"text-purple-600"})," Calculator"]}),e.jsx("button",{onClick:()=>Mt(!1),className:"w-6 h-6 rounded-full bg-slate-100 flex items-center justify-center text-slate-500 hover:text-slate-800 hover:bg-slate-200 transition-colors",children:e.jsx(Je,{size:12})})]}),e.jsx(Us,{isOpen:!0,onClose:()=>Mt(!1),inline:!0})]})}),document.getElementById("modal-root")),me&&vt.createPortal(e.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-900/50",children:e.jsxs(k.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-[2rem] p-6 max-w-xs w-full text-center border-2 border-rose-200 shadow-[0_25px_60px_rgba(0,0,0,0.15)]",children:[e.jsx(k.div,{animate:{scale:[1,1.1,1]},transition:{duration:1,repeat:1/0},className:"text-6xl mb-4",children:e.jsx(Ys,{className:"w-10 h-10 text-rose-500"})}),e.jsx("h2",{className:"text-2xl font-black text-slate-800 mb-3",children:"Out of Lives!"}),e.jsx("p",{className:"text-slate-500 text-sm mb-4",children:"Your hearts have run out. You can wait for them to refill or head back and review your lessons in the meantime."}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2 text-rose-500 font-bold",children:[e.jsx("img",{src:"/icons/quiz_heart.png",alt:"Hearts",className:"w-5 h-5"}),e.jsx("span",{children:"0 / 15 hearts"})]}),e.jsxs("p",{className:"text-slate-400 text-xs mb-4",children:["Next heart in: ",e.jsxs("span",{className:"font-bold text-slate-600",children:[Math.floor(Ae/6e4),":",Math.floor(Ae%6e4/1e3).toString().padStart(2,"0")]})," (15 minutes per heart)"]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(ze,{onClick:i,className:"w-full py-3 bg-rose-500 hover:bg-rose-600 text-white font-bold rounded-full",children:"Exit Quiz"}),e.jsx(ze,{onClick:()=>{Te(!1)},className:"w-full py-3 bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold rounded-full",children:"Review Lessons"})]})]})}),document.getElementById("modal-root")),e.jsxs(st,{children:[ve&&Se&&e.jsx(k.div,{initial:{y:-20,opacity:0},animate:{y:0,opacity:1},exit:{y:-20,opacity:0},transition:{type:"spring",damping:20,stiffness:300},className:"fixed top-24 left-1/2 -translate-x-1/2 z-[75] pointer-events-none",style:{willChange:"transform, opacity"},children:e.jsx("div",{className:"bg-white/90 px-4 py-2 rounded-2xl shadow-xl font-bold text-sm",children:Se})},"popup"),lt&&e.jsx(k.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{type:"spring",damping:20,stiffness:300},className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[100] pointer-events-none flex flex-col items-center justify-center",children:e.jsxs("div",{className:"bg-white/95 backdrop-blur-xl border border-slate-200 rounded-[2rem] p-6 md:p-8 shadow-[0_30px_80px_rgba(0,0,0,0.15)] flex flex-col items-center min-w-[280px] md:min-w-[320px]",children:[e.jsx("img",{src:"/mascot/modules_avatar.png",alt:"Mascot",className:"w-24 h-24 md:w-32 md:h-32 mb-4 drop-shadow-[0_10px_20px_rgba(0,0,0,0.15)]"}),e.jsx("h2",{className:`text-3xl md:text-4xl font-black mb-4 uppercase tracking-widest ${p?"text-emerald-500":"text-rose-500"}`,children:p?"Correct!":"Incorrect"}),p?e.jsxs("div",{className:"flex flex-col items-center gap-3 w-full justify-center",children:[e.jsx("div",{className:"flex items-center gap-2 bg-emerald-500/20 text-emerald-400 px-4 py-2 rounded-full font-bold border border-emerald-500/30",children:e.jsxs("span",{children:["+ ",(Ye[n]||[]).length>0?5:10," XP"]})}),dt==="streak"&&e.jsxs("div",{className:"flex items-center gap-2 bg-orange-500/20 text-orange-400 px-4 py-1.5 rounded-full text-sm font-bold border border-orange-500/30",children:[e.jsx(as,{size:14})," Streak Started!"]}),dt==="multiplier2"&&e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-1.5 rounded-full text-sm font-bold border border-amber-500/30",children:[e.jsx(Xe,{size:14})," Multiplier ×2!"]}),dt==="multiplier3"&&e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-1.5 rounded-full text-sm font-bold border border-amber-500/30",children:[e.jsx(Xe,{size:14})," Multiplier ×3!"]})]}):e.jsxs("div",{className:"bg-rose-500/20 border border-rose-500/30 text-rose-400 font-bold px-5 py-2 rounded-xl text-center",children:["Correct: ",I.correctAnswer]})]})},"round-result")]}),e.jsxs("div",{className:"fixed inset-0 z-50 h-screen w-full flex flex-col bg-slate-50 overflow-hidden",children:[e.jsxs("header",{className:`relative shrink-0 flex flex-col items-center justify-start px-4 pt-4 sm:pt-6 pb-6 z-[60] shadow-md overflow-hidden ${pe.gradient} rounded-b-[32px] sm:rounded-b-[40px] min-h-[110px] sm:min-h-[130px]`,children:[e.jsxs("div",{className:"absolute inset-0 z-0 pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 w-64 h-64 bg-white opacity-10 rounded-full -translate-x-1/2 -translate-y-1/2 blur-2xl"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-80 h-80 bg-white opacity-10 rounded-full translate-x-1/3 translate-y-1/3 blur-3xl"}),Ot.map((g,z)=>e.jsx("div",{className:"absolute text-white/10",style:{top:`${10+z*15}%`,left:`${10+z*25%80}%`,transform:`rotate(${z*45}deg) scale(${1+z%3*.2})`},children:e.jsx(g,{size:48+z%2*32})},z))]}),e.jsxs("div",{className:"w-full max-w-7xl flex items-start justify-between relative z-10 mb-4 sm:mb-6",children:[e.jsx("div",{className:"flex-1 pointer-events-none"}),e.jsxs("div",{className:"relative flex items-center justify-center bg-purple-900/40 backdrop-blur-md px-6 sm:px-8 py-3 rounded-full border border-white/10 gap-3 sm:gap-4 shadow-inner",children:[e.jsx("div",{className:"w-3 h-3 sm:w-4 sm:h-4 rounded-full bg-yellow-400 shrink-0 shadow-[0_0_10px_rgba(250,204,21,0.6)]"}),e.jsxs("div",{className:"flex flex-col items-start justify-center",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] font-black text-purple-200 uppercase tracking-widest leading-none mb-1",children:"Try It Yourself!"}),e.jsxs("span",{className:"font-bold text-white tracking-wide text-base sm:text-lg leading-none truncate max-w-[200px] sm:max-w-[300px]",children:["LESSON ",t.id||"1"]})]})]}),e.jsxs("div",{className:"flex-1 flex justify-end gap-2 sm:gap-3 relative pointer-events-auto",children:[e.jsx("button",{onClick:()=>St(!at),className:"w-10 h-10 sm:w-12 sm:h-12 rounded-full bg-purple-900/20 text-white flex items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:at?e.jsx(Jt,{size:20}):e.jsx(es,{size:20})}),e.jsx("button",{onClick:X,className:"hidden sm:flex w-10 h-10 sm:w-12 sm:h-12 rounded-full bg-purple-900/20 text-white items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:bt?e.jsx(Gs,{size:20}):e.jsx(Xs,{size:20})}),e.jsx("button",{onClick:()=>$e(!0),className:"w-10 h-10 sm:w-12 sm:h-12 rounded-full bg-purple-900/20 text-white flex items-center justify-center hover:bg-purple-900/40 transition-colors shadow-sm border border-white/10",children:e.jsx(xa,{size:20})})]})]}),e.jsx("div",{className:"w-full max-w-[50rem] flex items-center justify-center px-4 z-10",children:e.jsx("div",{className:"w-full flex items-center gap-2 sm:gap-3",children:s.map((g,z)=>e.jsx("div",{className:`h-1.5 sm:h-2 rounded-full flex-1 transition-all ${z<=n?"bg-white shadow-[0_0_8px_rgba(255,255,255,0.8)]":"bg-white/20"}`},z))})})]}),e.jsx(st,{children:xe&&e.jsx(k.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>$e(!1),children:e.jsxs(k.div,{onClick:g=>g.stopPropagation(),initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},className:"bg-white rounded-[2rem] p-6 sm:p-8 max-w-xs w-full shadow-2xl flex flex-col gap-4 text-center",children:[e.jsx("h2",{className:"text-xl font-black text-slate-800",children:"Are you sure you want to leave?"}),e.jsx("p",{className:"text-sm text-slate-500",children:"Your progress won't be saved."}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(ze,{onClick:()=>$e(!1),className:"w-full py-3 rounded-full bg-[#9956DE] hover:bg-[#8544c7] text-white font-bold",children:"Stay"}),e.jsx(ze,{onClick:()=>{$e(!1),i()},className:"w-full py-3 rounded-full bg-slate-100 hover:bg-slate-200 text-slate-600 font-bold",children:"Leave"})]})]})})}),e.jsxs("div",{className:"w-full max-w-[54rem] mx-auto shrink-0 flex items-center justify-between px-4 sm:px-6 py-2 sm:py-3 z-[50] relative mt-4",children:[e.jsx("button",{onClick:()=>d(g=>Math.max(0,g-1)),disabled:r===0,className:`w-10 h-10 sm:w-12 sm:h-12 shrink-0 rounded-full flex items-center justify-center shadow-md border-2 transition-all ${r===0?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-white text-purple-600 border-purple-100 hover:bg-purple-50 hover:border-purple-200 hover:scale-105 active:scale-95"}`,children:e.jsx(ts,{size:24})}),e.jsxs("div",{className:"flex items-center justify-center gap-3 sm:gap-5 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 px-8 sm:px-10 py-2 rounded-full bg-white shadow-md border border-slate-200/60 text-rose-500 font-extrabold text-sm sm:text-base",children:[e.jsx("img",{src:"/icons/quiz_heart.png",alt:"Hearts",className:"w-5 h-5 object-contain"}),Q]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 px-8 sm:px-10 py-2 rounded-full bg-white shadow-md border border-slate-200/60 text-yellow-500 font-extrabold text-sm sm:text-base",children:[e.jsx("img",{src:"/icons/quiz_key.png",alt:"Keys",className:"w-5 h-5 object-contain"}),c]}),e.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 px-3 py-1.5 pl-5 sm:pl-6 rounded-full bg-white shadow-md border border-slate-200/60",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-orange-500 font-extrabold text-sm sm:text-base",children:[e.jsx("img",{src:"/icons/quiz_streak.png",alt:"Streak",className:"w-5 h-5 object-contain"})," ",j]}),e.jsxs("div",{className:"bg-emerald-100 text-emerald-800 px-4 py-1.5 rounded-full font-bold text-sm sm:text-base shadow-inner border border-emerald-200/50",children:["+ ",zt," pts"]})]})]}),e.jsx("button",{onClick:()=>d(g=>Math.min(n,g+1)),disabled:r>=n,className:`w-10 h-10 sm:w-12 sm:h-12 shrink-0 rounded-full flex items-center justify-center shadow-md border-2 transition-all ${r>=n?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-white text-purple-600 border-purple-100 hover:bg-purple-50 hover:border-purple-200 hover:scale-105 active:scale-95"}`,children:e.jsx(ot,{size:24})})]}),e.jsx("main",{className:"flex-1 overflow-y-auto w-full px-4 sm:px-6 pt-0 pb-6 flex flex-col items-center relative z-10",children:e.jsxs(k.div,{initial:{opacity:0,x:20},animate:ke?{x:[-10,10,-10,10,0],scale:[1,1.01,1],opacity:1}:{opacity:1,x:0},className:"w-full max-w-3xl flex flex-col mt-2",children:[e.jsxs("div",{className:"bg-white rounded-3xl shadow-lg border-t-[6px] border-purple-500 p-6 sm:p-8 text-center flex flex-col items-center mb-6 w-full relative overflow-hidden",children:[(()=>{const z=[{label:"New",color:"bg-blue-100 text-blue-700",icon:e.jsx($s,{size:14,className:"mr-1.5"})},{label:"Learning",color:"bg-amber-100 text-amber-700",icon:e.jsx(At,{size:14,className:"mr-1.5"})},{label:"Retry",color:"bg-rose-100 text-rose-700",icon:e.jsx(Bs,{size:14,className:"mr-1.5"})},{label:"Mastered",color:"bg-emerald-100 text-emerald-700",icon:e.jsx(ls,{size:14,className:"mr-1.5"})}][r%4];return e.jsxs("div",{className:`${z.color} px-4 py-1.5 rounded-full text-[11px] sm:text-xs font-black uppercase tracking-widest mb-6 flex items-center shadow-sm`,children:[z.icon," ",z.label]})})(),e.jsx("h2",{className:"text-xl sm:text-2xl font-extrabold text-[#0a1628] leading-tight w-full",children:I.question.includes("___")?e.jsx("span",{children:I.question.split("___").map((g,z,O)=>e.jsxs(je.Fragment,{children:[g,z0,value:M,onChange:Y=>u(Y.target.value),className:`inline-block w-24 mx-2 border-b-4 outline-none text-center bg-transparent font-bold ${J?fe[r]?"border-[#75D06A] text-[#75D06A]":"border-rose-500 text-rose-500":"border-[#7C3AED] text-[#7C3AED] focus:border-[#75D06A]"}`})]},z))}):I.question})]}),e.jsxs("div",{className:"w-full flex flex-col items-center",children:[(I.type==="multiple-choice"||I.type==="true-false")&&e.jsx("div",{className:"w-full grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-5",children:(I.type==="true-false"?["True","False"]:B).map((g,z)=>{const O=typeof g=="string"?g:g.text,Y=typeof g=="string"?`${I.id}-${z}`:g.id,te=(gt[r]||[]).includes(O),V=le[r]||de,oe=Ye[n]||[],Le=oe.includes(O),yt=oe.length,it=B.filter(aa=>aa.text!==I.correctAnswer).length,xt=r===n&&it>0&&yt>=it;let De="bg-white hover:bg-slate-50 border-transparent text-slate-700 hover:border-slate-200",Qt=!1;return xt?(Qt=!0,O===I.correctAnswer?De="bg-emerald-50 border-emerald-400 text-emerald-800":te?De="bg-rose-50 border-rose-400 text-rose-800 opacity-80":De="bg-slate-100 border-slate-200 text-slate-400 opacity-40 line-through"):Le?De="bg-slate-100 border-slate-200 text-slate-400 opacity-40 line-through cursor-not-allowed":V?O===I.correctAnswer?De="bg-emerald-50 border-emerald-400 text-emerald-800 shadow-[0_0_15px_rgba(16,185,129,0.2)] scale-[1.02] z-10":De="bg-slate-50 border-slate-200 text-slate-400 opacity-60":J?O===I.correctAnswer?De="bg-emerald-50 border-emerald-400 text-emerald-800 shadow-[0_0_15px_rgba(16,185,129,0.2)] scale-[1.02] z-10":te?De="bg-rose-50 border-rose-400 text-rose-800 opacity-60":De="bg-slate-50 border-slate-200 text-slate-400 opacity-60":te?De="bg-rose-50 border-rose-400 text-rose-800 opacity-60":x===Y&&(De="bg-purple-50 border-[#9956DE] text-[#9956DE]"),e.jsxs("button",{disabled:Qt||J||te||V||Le,onClick:()=>{Qt||J||C||te||V||Le||(f(Y),ye(O))},className:`p-4 sm:p-5 rounded-2xl shadow-sm border-[3px] font-extrabold text-base sm:text-lg text-left transition-all flex items-center justify-between ${De} ${J||V||Le?"cursor-default":"hover:shadow-md hover:-translate-y-0.5 active:translate-y-0"}`,children:[e.jsx("span",{className:"truncate pr-4",children:O}),Le&&e.jsx(Je,{size:20,className:"text-slate-400 shrink-0"}),V&&O===I.correctAnswer&&e.jsx(Ft,{size:24,className:"text-emerald-500 shrink-0"}),J&&O===I.correctAnswer&&!V&&e.jsx(Ft,{size:24,className:"text-emerald-500 shrink-0"}),(J||te)&&te&&e.jsx(Je,{size:24,className:"text-rose-500 shrink-0"})]},Y)})}),de&&e.jsx(k.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"w-full mt-6 space-y-4 max-w-3xl",children:e.jsxs("div",{className:"border-2 rounded-2xl p-5 flex items-start gap-4 bg-sky-50 border-sky-200",children:[e.jsx("img",{src:"/mascot/modules_avatar.png",className:"w-10 h-10 shrink-0",alt:"AI Explain"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-extrabold text-lg mb-1 text-sky-700",children:"Explanation"}),e.jsx("p",{className:"text-base leading-relaxed text-sky-800",children:I.explanation||`The correct answer is: ${I.correctAnswer}`})]})]})})]})]},r)}),e.jsxs("footer",{className:`shrink-0 relative z-[60] flex flex-col items-center justify-center p-4 sm:p-6 ${pe.gradient} rounded-t-[32px] sm:rounded-t-[40px] shadow-[0_-10px_40px_rgba(0,0,0,0.15)]`,children:[e.jsx("div",{className:"absolute inset-0 z-0 pointer-events-none opacity-20",children:Ot.slice(0,3).map((g,z)=>e.jsx("div",{className:"absolute text-white",style:{top:`${20+z*20}%`,left:`${20+z*30}%`,transform:`rotate(${z*30}deg) scale(1.5)`},children:e.jsx(g,{size:32})},z))}),e.jsx("div",{className:"relative z-10 flex flex-col gap-3",children:rd(n),className:"bg-white text-slate-700 font-extrabold text-lg px-6 sm:px-8 py-3 sm:py-4 rounded-full flex items-center gap-2 sm:gap-3 shadow-lg hover:bg-slate-50 transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx(ot,{size:20,className:"sm:w-6 sm:h-6"}),"Back to Current Question"]})]}):e.jsx(e.Fragment,{children:(()=>{const g=(Ye[n]||[]).length,z=B.filter(te=>te.text!==I.correctAnswer).length,O=z>0&&g>=z,Y=v&&!p||le[n]||de||O;if(de)return e.jsxs("button",{onClick:Ce,className:"bg-orange-500 hover:bg-orange-600 text-white font-extrabold text-lg px-8 py-4 rounded-full flex items-center justify-center gap-3 shadow-xl hover:scale-[1.02] active:scale-[0.98] transition-all w-full",children:[n0&&!v&&!le[n]&&!de&&!O;return e.jsxs("div",{className:"flex flex-wrap justify-center gap-3 sm:gap-4",children:[e.jsxs("button",{onClick:Ge,disabled:!he,className:"bg-white hover:bg-slate-50 disabled:opacity-70 disabled:cursor-not-allowed text-slate-700 font-bold px-6 sm:px-8 py-3 sm:py-3.5 rounded-full flex items-center gap-2 shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx("img",{src:"/icons/quiz_key.png",alt:"Hint",className:"w-5 h-5 object-contain"}),"Hint"]}),e.jsxs("button",{onClick:Ie,disabled:le[n]||v||de,className:"bg-white hover:bg-slate-50 disabled:opacity-70 disabled:cursor-not-allowed text-slate-700 font-bold px-6 sm:px-8 py-3 sm:py-3.5 rounded-full flex items-center gap-2 shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx(Ea,{size:18,className:"text-purple-500"}),"Reveal"]}),e.jsxs("button",{onClick:F,className:"bg-white hover:bg-slate-50 text-slate-700 font-bold px-6 sm:px-8 py-3 sm:py-3.5 rounded-full flex items-center gap-2 shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200",children:[e.jsx("img",{src:"/mascot/modules_avatar.png",className:"w-5 h-5 drop-shadow-sm",alt:"AI Explain"}),"Explain"]}),e.jsx("button",{onClick:()=>Mt(te=>!te),className:`w-11 h-11 sm:w-12 sm:h-12 rounded-full flex items-center justify-center shadow-lg transition-transform hover:scale-105 active:scale-95 border border-slate-200 ${It?"bg-purple-100 text-purple-600 border-purple-300":"bg-white hover:bg-slate-50 text-slate-700"}`,children:e.jsx(wt,{size:20})})]})})()})})]})]})]})},Ur=[{id:1,type:"multiple-choice",question:"What is the value of π (pi) to two decimal places?",options:["3.12","3.14","3.16","3.18"],correctAnswer:"3.14",explanation:"π ≈ 3.14159..., so to two decimal places it is 3.14."},{id:2,type:"true-false",question:"The sum of angles in a triangle is 180 degrees.",correctAnswer:"True",explanation:"The interior angles of any Euclidean triangle sum to 180°."},{id:3,type:"fill-in-blank",question:"If 2x + 5 = 13, then x = ___.",correctAnswer:"4",explanation:"2x = 13 - 5 = 8 → x = 4."},{id:4,type:"multiple-choice",question:"Which of the following is a prime number?",options:["9","15","17","21"],correctAnswer:"17",explanation:"17 is only divisible by 1 and itself. 9=3×3, 15=3×5, 21=3×7."},{id:5,type:"true-false",question:"The slope of a horizontal line is zero.",correctAnswer:"True",explanation:"A horizontal line has no rise, so rise/run = 0."},{id:6,type:"fill-in-blank",question:"The square root of 144 is ___.",correctAnswer:"12",explanation:"12 × 12 = 144, so √144 = 12."}];async function Gr(t){const{lessonTitle:s,topic:l,subjectId:i,competencyCode:n,questionCount:o=6}=t,r=Vr(i)||"General Mathematics",d=t.lessonId?Math.abs(t.lessonId.split("").reduce((x,f)=>Math.imul(31,x)+f.charCodeAt(0)|0,0))%1e6:Math.floor(Math.random()*1e6);try{const x=await Rt("/api/quiz/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topic:l||s,subject:r,lessonTitle:s,questionCount:o,questionTypes:["multiple-choice","true-false","fill-in-blank"],difficulty:"medium",competencyCode:n,varianceSeed:d})});return!x.questions||x.questions.length===0?(console.warn("[lessonQuizService] API returned empty questions, using fallback"),Ps(o)):x.questions.map(f=>({id:f.id,type:f.type,question:f.question,options:f.options||void 0,correctAnswer:f.correctAnswer,explanation:f.explanation}))}catch(x){return console.error("[lessonQuizService] Failed to generate quiz via API:",x),console.warn("[lessonQuizService] Using fallback questions"),Ps(o)}}function Xr(t){return 6}function Vr(t){if(!t)return null;const s=t.toLowerCase();return s.includes("gen-math")||s.includes("gen_math")?"General Mathematics":s.includes("stats")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre_calc")?"Pre-Calculus":s.includes("basic-calc")||s.includes("basic_calc")||s.includes("calculus")?"Basic Calculus":null}function Ps(t){const s=[...Ur].sort(()=>Math.random()-.5);return s.slice(0,Math.min(t,s.length)).map((l,i)=>({...l,id:i+1}))}const Yr="https://deign86-mathpulse-api-v3test.hf.space";async function Zs(t,s,l=!1){const i={"Content-Type":"application/json",...s?.headers||{}},n=ua.currentUser;if(n)try{const r=await n.getIdToken(l);r&&(i.Authorization=`Bearer ${r}`)}catch(r){throw console.error("[lessonService] Failed to get Firebase ID token:",r),new Error("Authentication failed. Please sign in again.")}const o=await fetch(`${Yr}${t}`,{...s,headers:i});if(o.status===401&&n&&!l)return Zs(t,s,!0);if(!o.ok){let r;try{r=await o.json()}catch{r=await o.text()}const d=new Error(typeof r=="object"?JSON.stringify(r):r);throw d.status=o.status,d.body=r,d}return o.json()}async function Kr(t){return Zs("/api/rag/lesson",{method:"POST",body:JSON.stringify(t)})}const Zr="rag_lesson_";function ms(t){return`${Zr}${t}`}function Jr(t){try{const s=sessionStorage.getItem(ms(t));if(s)return JSON.parse(s)}catch{}return null}function el(t,s){try{sessionStorage.setItem(ms(t),JSON.stringify(s))}catch{}}function tl(t,s,l=!0){const[i,n]=a.useState([]),[o,r]=a.useState(!0),[d,x]=a.useState(null),[f,M]=a.useState([]),[u,v]=a.useState("low"),[m,p]=a.useState(0),[S,y]=a.useState(!1),[W,j]=a.useState(void 0),[E,_]=a.useState(!1),D=a.useCallback(async()=>{if(!l||!t)return;const L=Jr(t);if(L){n(L.sections),M(L.sources),v(L.retrievalBand),p(L.retrievalConfidence),y(L.needsReview),j(L.activeModel),r(!1),x(null),_(!1);return}r(!0),x(null),_(!1);try{const se=(await rs(()=>import("./vendor-firebase-auth-T_wvTOvf.js"),__vite__mapDeps([0,1])).then(re=>re.getAuth().currentUser))?.uid,C=await Kr({...s,lessonId:t,userId:se});n(C.sections),M(C.sources||[]),v(C.retrievalBand),p(C.retrievalConfidence),y(C.needsReview),j(C.activeModel),el(t,C),x(null),_(!1)}catch(B){const se=B.status||B.response?.status,C=B.body||B.response;let re="Failed to load lesson content.",ge=!1;se===404&&C?.error==="no_curriculum_context"?(re=C.message||"Lesson source PDF not found or not yet ingested.",ge=!0):se===401?re="Please sign in again to access lessons.":navigator.onLine||(re="No internet connection. Please try again when online.",ge=!0),x(re),_(ge),n([])}finally{r(!1)}},[t,l,JSON.stringify(s)]);a.useEffect(()=>{D()},[D]);const b=a.useCallback(()=>{t&&sessionStorage.removeItem(ms(t)),r(!0),x(null),D()},[D,t]);return{sections:i,isLoading:o,error:d,retry:b,sources:f,retrievalBand:u,retrievalConfidence:m,needsReview:S,activeModel:W,isOffline:E}}const Js=/[=×÷±√∑∫π²³%]/,sl=/^(Definition|Formula|Note|Reminder|Important|Example|Key Concept|Concept|Rule|Theorem|Property|Step)s?\s*:/i;function pt(t){return t.replace(/\b([A-Z][a-zA-Z\s]{2,30}?)\s+(is|are|refers to|defined as|means)\b/g,(s,l,i)=>`**${l.trim()}** ${i}`).replace(/"([^"]{3,40})"/g,(s,l)=>`**${l}**`)}function Xt(t){if(!t?.trim())return null;const s=t.split(` -`),l=[];let i=[],n=[],o=[],r=0;const d=()=>{if(i.length===0)return;const p=i.join(" ").trim();if(!p){i=[];return}const S=p.match(/[^.!?]+[.!?]+["']?/g)||[p],y=[];let W=[],j=0;for(const E of S)W.push(E),j+=E.length,j>220&&(y.push(W),W=[],j=0);W.length&&y.push(W);for(const E of y){const _=pt(E.join(" ").trim());l.push(e.jsx("p",{className:"lesson-body-text text-slate-700 leading-[1.8] text-[1rem] font-body",children:qe(_)},r++))}i=[]},x=()=>{n.length!==0&&(l.push(e.jsx("ul",{className:"space-y-2.5 my-1 pl-1",children:n.map((p,S)=>e.jsxs("li",{className:"flex items-start gap-3 text-slate-700 text-[0.95rem] leading-[1.75] font-body",children:[e.jsx("span",{className:"mt-[0.5rem] w-2 h-2 rounded-full bg-[#1a85a4] flex-shrink-0"}),e.jsx("span",{children:qe(pt(p))})]},S))},r++)),n=[])},f=()=>{o.length!==0&&(l.push(e.jsx("ol",{className:"space-y-2.5 my-1 list-none pl-1",children:o.map((p,S)=>e.jsxs("li",{className:"flex items-start gap-3 text-slate-700 text-[0.95rem] leading-[1.75] font-body",children:[e.jsx("span",{className:"mt-0.5 min-w-[1.5rem] h-[1.5rem] rounded-full bg-[#1a85a4] text-white text-[0.7rem] font-bold flex items-center justify-center flex-shrink-0",children:S+1}),e.jsx("span",{children:qe(pt(p))})]},S))},r++)),o=[])},M=p=>/^[\-•\*]\s+/.test(p.trim()),u=p=>/^\d+[\.\)]\s+/.test(p.trim()),v=p=>Js.test(p)&&p.trim().length<120,m=p=>{const S=p.toLowerCase();return/formula|theorem|property|rule/.test(S)?{bg:"bg-amber-50",border:"border-amber-300",text:"text-amber-900",label:"FORMULA"}:/definition|concept|key/.test(S)?{bg:"bg-blue-50",border:"border-blue-300",text:"text-blue-900",label:"DEFINITION"}:/note|reminder|important/.test(S)?{bg:"bg-rose-50",border:"border-rose-300",text:"text-rose-900",label:"NOTE"}:/example|step/.test(S)?{bg:"bg-emerald-50",border:"border-emerald-300",text:"text-emerald-900",label:"EXAMPLE"}:{bg:"bg-slate-50",border:"border-slate-300",text:"text-slate-800",label:"TIP"}};for(const p of s){const S=p.trimEnd(),y=S.trim();if(y===""){x(),f(),d();continue}const W=y.match(sl);if(W){x(),f(),d();const j=W[1],E=y.slice(W[0].length).trim(),_=m(j);l.push(e.jsxs("div",{className:`rounded-xl px-4 py-3.5 border-l-4 ${_.bg} ${_.border} my-1`,children:[e.jsxs("p",{className:`text-[0.75rem] font-black uppercase tracking-widest mb-1.5 ${_.text} opacity-80 font-display`,children:[_.label," ",j]}),e.jsx("p",{className:`text-[0.95rem] leading-[1.75] font-semibold font-body ${_.text}`,children:qe(E)})]},r++));continue}if(M(y)){d(),f(),n.push(y.replace(/^[\-•\*]\s+/,""));continue}if(u(y)){d(),x(),o.push(y.replace(/^\d+[\.\)]\s+/,""));continue}if(v(y)&&!/[a-z]{5,}/.test(y)){x(),f(),d(),l.push(e.jsx("div",{className:"lesson-formula-box my-3",children:y},r++));continue}if(y.endsWith(":")&&y.length<80&&!y.startsWith(" ")){x(),f(),d(),l.push(e.jsx("p",{className:"lesson-section-heading text-[#1a85a4] text-[1.05rem] mt-5 mb-1 border-b-2 border-[#1a85a4]/20 pb-1.5",children:qe(y)},r++));continue}x(),f(),i.push(S)}return x(),f(),d(),e.jsx("div",{className:"space-y-3",children:l})}function qe(t){const s=[],l=/(\*\*(.+?)\*\*|\*(.+?)\*|`(.+?)`|==(.+?)==)/g;let i=0,n,o=0;for(;(n=l.exec(t))!==null;)n.index>i&&s.push(e.jsx(je.Fragment,{children:t.slice(i,n.index)},o++)),n[2]?s.push(e.jsx("strong",{className:"font-extrabold text-[#1a85a4] bg-[#e0f4fa] px-1 py-0.5 rounded-md font-body",children:n[2]},o++)):n[3]?s.push(e.jsx("em",{className:"italic text-slate-500 font-body",children:n[3]},o++)):n[4]?s.push(e.jsx("code",{className:"px-1.5 py-0.5 bg-slate-100 rounded text-[0.85em] font-mono text-[#e66a5e] border border-slate-200 font-semibold",children:n[4]},o++)):n[5]&&s.push(e.jsx("mark",{className:"bg-[#fff3cd] text-[#92400e] px-1 py-0.5 rounded-md font-bold border-b-2 border-[#fbbf24]",children:n[5]},o++)),i=n.index+n[0].length;return i0?e.jsx(e.Fragment,{children:s}):t}function al(t){if(!t?.trim())return{welcome:"",objectives:[]};const s=t.split(` -`).map(d=>d.trim()).filter(Boolean),l=/^(\d+[\.\)]\s+|[-•*]\s+|(Identify|Write|Set|Use|Apply|Solve|Compute|Calculate|Determine|Understand|Describe|Explain|Analyze|Evaluate|Create|Define|Distinguish|Compare|Illustrate|Demonstrate|Perform|Simplify|Represent|Model|Interpret|Recognize|Classify|Construct|Derive|Formulate|Graph|Sketch|Verify|Prove|Estimate|Approximate|Convert|Translate|Predict|Justify|Generalize|Extend|Develop|Explore|Investigate|Discover|Observe|Measure|Record|Report|Present|Communicate|Collaborate|Reflect|Review|Summarize|Conclude|Infer|Hypothesize|Test|Experiment|Design|Plan|Implement|Evaluate|Assess|Monitor|Adjust|Improve|Optimize|Innovate|Create|Produce|Publish|Share|Teach|Learn|Practice|Apply|Transfer|Connect|Integrate|Synthesize|Analyze|Evaluate|Create)\b)/i,i=/^(Example:|e\.g\.|For example:|Sample:|\()/i,n=[],o=[];let r=!1;for(let d=0;d0&&t.callouts.map((p,S)=>e.jsxs("div",{className:`lesson-callout-headsup flex items-start gap-3.5 ${p.type==="tip"?"!bg-gradient-to-r !from-emerald-50 !to-teal-50 !border-emerald-400":""}`,children:[e.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5 shadow-sm ${p.type==="tip"?"bg-emerald-500":"bg-amber-500"}`,children:e.jsx(jt,{size:16,className:"text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] mb-1 ${p.type==="tip"?"text-emerald-600":"text-amber-600"}`,children:p.type==="tip"?"Tip":p.type==="important"?"Heads Up":"Note"}),e.jsx("p",{className:"font-body text-[0.95rem] text-slate-700 leading-[1.75] font-medium",children:p.text})]})]},S)),(!t.callouts||t.callouts.length===0)&&e.jsxs("div",{className:"lesson-callout-headsup flex items-start gap-3.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-amber-500 flex items-center justify-center flex-shrink-0 mt-0.5 shadow-sm",children:e.jsx(jt,{size:16,className:"text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] mb-1 text-amber-600",children:"Heads Up"}),e.jsxs("p",{className:"font-body text-[0.95rem] text-slate-700 leading-[1.75] font-medium",children:["This lesson has ",7," sections and takes about 20 minutes to complete. Grab a pen — you might want to take notes along the way!"]})]})]}),v.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(ft,{size:20,className:"text-violet-500"}),e.jsx("h3",{className:"lesson-section-heading text-[1.05rem]",style:{color:"#7c3aed"},children:"What you'll learn"})]}),e.jsx("div",{className:"space-y-2.5",children:v.map((p,S)=>{const y=Is[S%Is.length];return e.jsxs("div",{className:`rounded-xl border-2 px-4 py-3.5 flex items-start gap-3.5 ${y.bg} ${y.border} shadow-sm`,children:[e.jsx("span",{className:`mt-0.5 min-w-[1.75rem] h-7 rounded-full ${y.num} text-white text-[0.7rem] font-black flex items-center justify-center flex-shrink-0 shadow-sm`,children:S+1}),e.jsxs("div",{children:[e.jsx("p",{className:`font-body text-[0.95rem] font-semibold leading-snug ${y.text}`,children:qe(pt(p.text))}),p.example&&e.jsx("p",{className:`text-xs mt-1 ${y.ex} font-mono font-semibold`,children:p.example})]})]},S)})})]})]})}case"key_concepts":return e.jsxs("div",{className:"space-y-4",children:[t.content?.trim()?e.jsx("div",{className:"mb-4",children:Xt(t.content)}):e.jsx("p",{className:"text-slate-400 text-sm italic mb-4",children:"Key concepts are being compiled. Review the curriculum sources below for reference material."}),t.callouts&&t.callouts.length>0&&e.jsx("div",{className:"space-y-3",children:t.callouts.map((u,v)=>e.jsxs("div",{className:`rounded-xl border-2 px-5 py-4 flex items-start gap-3.5 shadow-sm ${u.type==="important"?"bg-rose-50 border-rose-300":u.type==="tip"?"bg-emerald-50 border-emerald-300":"bg-amber-50 border-amber-300"}`,children:[e.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5 shadow-sm ${u.type==="important"?"bg-rose-500":u.type==="tip"?"bg-emerald-500":"bg-amber-500"}`,children:e.jsx(jt,{size:16,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("p",{className:`lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] mb-1 ${u.type==="important"?"text-rose-500":u.type==="tip"?"text-emerald-600":"text-amber-600"}`,children:u.type==="important"?"Important":u.type==="tip"?"Tip":"Note"}),e.jsx("p",{className:"font-body text-[0.95rem] text-slate-700 leading-[1.75] font-medium",children:qe(u.text)})]})]},v))})]});case"video":return e.jsxs("div",{className:"space-y-4",children:[t.content?.trim()?e.jsx("p",{className:"text-slate-600 text-sm",children:t.content}):e.jsx("p",{className:"text-slate-400 text-sm italic",children:"Video explanation loading..."}),e.jsx(qr,{videos:t.videos||[],topic:n.title})]});case"worked_examples":return e.jsx("div",{className:"space-y-5",children:t.examples&&t.examples.length>0?t.examples.map((u,v)=>e.jsxs("div",{className:"bg-gradient-to-br from-rose-50 via-orange-50 to-amber-50 rounded-2xl p-5 border-2 border-rose-200 shadow-md",children:[e.jsxs("div",{className:"flex items-start gap-3.5 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-rose-500 to-orange-500 rounded-xl flex items-center justify-center flex-shrink-0 shadow-md",children:e.jsx(wt,{size:18,className:"text-white"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] text-rose-400 mb-1",children:["Example ",v+1]}),e.jsx("p",{className:"font-body font-bold text-slate-800 text-[1rem] leading-snug",children:u.problem})]})]}),u.steps.length>0&&e.jsxs("div",{className:"ml-14 space-y-2.5 mb-3",children:[e.jsx("p",{className:"lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] text-slate-400 mb-1.5",children:"Solution"}),u.steps.map((m,p)=>Js.test(m)&&m.length<100&&!/[a-z]{6,}/.test(m)?e.jsx("div",{className:"lesson-formula-box",children:m},p):e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"mt-0.5 min-w-[1.5rem] h-[1.5rem] rounded-full bg-white border-2 border-rose-300 text-rose-500 text-[0.65rem] font-black flex items-center justify-center flex-shrink-0 shadow-sm",children:p+1}),e.jsx("p",{className:"font-body text-slate-700 text-[0.95rem] leading-[1.75]",children:qe(m)})]},p))]}),u.answer&&e.jsxs("div",{className:"ml-14 flex items-center gap-3 mt-3 pt-3 border-t-2 border-rose-200",children:[e.jsx("div",{className:"px-3.5 py-1.5 bg-gradient-to-r from-rose-500 to-orange-500 rounded-lg text-white text-[0.65rem] font-black uppercase tracking-widest flex-shrink-0 shadow-sm",children:"Answer"}),e.jsx("p",{className:"font-body text-slate-800 text-[0.95rem] font-bold",children:u.answer})]})]},v)):e.jsx("p",{className:"text-slate-400 text-sm italic",children:"No worked examples available for this lesson."})});case"important_notes":return e.jsx("div",{className:"space-y-3",children:t.bulletPoints&&t.bulletPoints.length>0?t.bulletPoints.map((u,v)=>{const m=u.match(/^(Note|Important|Remember|Warning|Tip|Key|Formula|Rule)\s*:/i);if(m){const p=m[1],S=u.slice(m[0].length).trim(),y=/note|important|warning|remember/i.test(p);return e.jsxs("div",{className:`rounded-xl px-5 py-4 border-l-4 flex items-start gap-3.5 shadow-sm ${y?"bg-rose-50 border-rose-400":"bg-amber-50 border-amber-400"}`,children:[e.jsx(jt,{size:18,className:`mt-0.5 flex-shrink-0 ${y?"text-rose-500":"text-amber-500"}`}),e.jsxs("div",{children:[e.jsx("p",{className:`lesson-section-heading text-[0.65rem] uppercase tracking-[0.2em] mb-1 ${y?"text-rose-500":"text-amber-600"}`,children:p}),e.jsx("p",{className:"font-body text-[0.95rem] text-slate-700 leading-[1.75] font-medium",children:qe(pt(S))})]})]},v)}return e.jsxs("div",{className:"flex items-start gap-3.5 p-4 rounded-xl bg-slate-50 border-2 border-slate-200 hover:border-[#1a85a4]/40 hover:bg-[#f0fbff] transition-colors",children:[e.jsx("div",{className:"mt-0.5 w-6 h-6 rounded-full bg-[#1a85a4] flex items-center justify-center flex-shrink-0 shadow-sm",children:e.jsx("span",{className:"text-white text-[0.65rem] font-black",children:v+1})}),e.jsx("p",{className:"font-body text-slate-700 text-[0.95rem] leading-[1.75] font-medium",children:qe(pt(u))})]},v)}):e.jsx("p",{className:"text-slate-400 text-sm italic",children:"No notes available for this lesson."})});case"try_it_yourself":return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex flex-col items-center text-center gap-3 py-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center shadow-lg",style:{background:"#9956DE"},children:e.jsx(ft,{size:32,className:"text-white"})}),e.jsx("h3",{className:"text-xl font-black",style:{color:"#9956DE"},children:"Try It Yourself"}),e.jsx("p",{className:"text-slate-500 text-sm max-w-xs leading-relaxed",children:"Now it's your turn! Try applying what you've learned. You can practice with the exercises at the end of this module."})]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-xl px-4 py-3 border",style:{background:"#f5eeff",borderColor:"#d4aaff"},children:[e.jsx(jt,{size:16,className:"mt-0.5 shrink-0",style:{color:"#9956DE"}}),e.jsxs("p",{className:"text-sm",style:{color:"#7a3db8"},children:[e.jsx("span",{className:"font-bold",children:"Tip:"})," Complete the practice quizzes after this lesson to reinforce your learning!"]})]}),o&&e.jsx("div",{className:"bg-white rounded-2xl p-5 border border-slate-200 shadow-sm",children:r?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-emerald-100 rounded-xl flex items-center justify-center",children:e.jsx(ft,{size:20,className:"text-emerald-600"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-bold text-emerald-700",children:["Quiz Complete",typeof d=="number"&&e.jsxs("span",{className:"ml-2 text-emerald-600",children:[d,"%"]})]}),e.jsx("p",{className:"text-xs text-emerald-600/80",children:"Great job! You can now complete this lesson."})]})]}):e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest mb-1",style:{color:"#9956DE"},children:"Practice Quiz"}),e.jsx("p",{className:"font-bold text-slate-800 text-sm",children:o.title}),e.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:[o.questions," questions · ",o.duration]})]}),e.jsx("button",{onClick:x,className:"w-full sm:w-auto px-6 py-2.5 rounded-xl bg-[#1a85a4] text-white text-sm font-black hover:bg-[#126b84] transition-colors shadow-md uppercase tracking-wide",children:"Start Practice"})]})}),!o&&e.jsxs("button",{onClick:M,className:"w-full flex items-center justify-between gap-4 text-white rounded-2xl px-6 py-4 shadow-lg transition-all hover:shadow-xl hover:scale-[1.01] active:scale-[0.99] group",style:{background:"#9956DE"},onMouseEnter:u=>u.currentTarget.style.background="#8744cc",onMouseLeave:u=>u.currentTarget.style.background="#9956DE",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center shrink-0",children:e.jsx(Ka,{size:22,className:"text-white"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"font-black text-sm uppercase tracking-wide",children:"Start Practice Quiz"}),e.jsx("p",{className:"text-white/80 text-xs mt-0.5",children:"10 questions · AI-generated"})]})]}),e.jsx(ht,{size:20,className:"text-white/80 group-hover:translate-x-1 transition-transform"})]})]});case"summary":return e.jsx("div",{className:"space-y-3",children:t.content?.trim()?Xt(t.content):e.jsx("p",{className:"text-slate-400 text-sm italic",children:"Summary is being prepared. Review the lesson sections above to reinforce your understanding."})});default:return e.jsx("p",{className:"text-slate-500 text-sm italic",children:"Section content not available."})}}const _t=[{type:"introduction",label:"Intro",helper:"Welcome note",icon:Nt,accent:"from-[#1a85a4] to-[#126b84]",tint:"bg-[#1a85a4] text-white border-transparent",tabBg:"bg-[#1a85a4]"},{type:"key_concepts",label:"Concepts",helper:"Core ideas",icon:cr,accent:"from-[#fbab41] to-[#e0983a]",tint:"bg-[#fbab41] text-white border-transparent",tabBg:"bg-[#fbab41]"},{type:"video",label:"Video",helper:"Watch and learn",icon:jt,accent:"from-[#e66a5e] to-[#ce5e53]",tint:"bg-[#e66a5e] text-white border-transparent",tabBg:"bg-[#e66a5e]"},{type:"worked_examples",label:"Examples",helper:"Guided solving",icon:Pa,accent:"from-[#7ec16d] to-[#71ad62]",tint:"bg-[#7ec16d] text-white border-transparent",tabBg:"bg-[#7ec16d]"},{type:"important_notes",label:"Notes",helper:"Key reminders",icon:mr,accent:"from-[#9a67d0] to-[#8a5cc0]",tint:"bg-[#9a67d0] text-white border-transparent",tabBg:"bg-[#9a67d0]"},{type:"try_it_yourself",label:"Practice",helper:"Try it yourself",icon:et,accent:"from-[#eb74a6] to-[#d46895]",tint:"bg-[#eb74a6] text-white border-transparent",tabBg:"bg-[#eb74a6]"},{type:"summary",label:"Summary",helper:"Wrap-up",icon:Tt,accent:"from-[#48bca6] to-[#40a794]",tint:"bg-[#48bca6] text-white border-transparent",tabBg:"bg-[#48bca6]"}],il=({lesson:t,lessonCompletionXP:s=10,practiceQuiz:l,practiceQuizCompleted:i=!1,practiceQuizScore:n,initialSection:o=0,onStartPractice:r,onBack:d,onComplete:x,onProgressUpdate:f,onTryItQuizComplete:M,onContinueLearning:u})=>{const{userProfile:v}=$t(),[m,p]=a.useState(0),[S,y]=a.useState(1),[W,j]=a.useState(!1),[E,_]=a.useState(null),[D,b]=a.useState(!1),[L,B]=a.useState(null),[se,C]=a.useState(!1);a.useEffect(()=>{!D||L||(C(!0),Gr({lessonId:t.id?.toString()||"unknown",lessonTitle:t.title,topic:t.title,subjectId:t.subjectId,competencyCode:t.competencyCode,questionCount:10}).then(R=>B(R)).catch(R=>{console.error("[LessonViewer] Quiz generation failed:",R),b(!1)}).finally(()=>C(!1)))},[D,L,t]);const[re,ge]=a.useState(!1),He={topic:t.title,subject:t.subject||"General Mathematics",quarter:t.quarter||1,lessonTitle:t.title,moduleId:t.subjectId,lessonId:t.id,competencyCode:t.competencyCode,learnerLevel:"Grade 11-12",storagePath:t.storagePath},{sections:ce,isLoading:Oe,error:Se,retry:U,sources:ve,retrievalBand:Qe,activeModel:Me,isOffline:Ve}=tl(t.id,He,!0),[Re,We]=a.useState(null);a.useEffect(()=>{if(ce.length>0){const R=ce.find(ee=>ee.type==="introduction");if(R?.title){const xe=R.title.replace(/^Introduction\s+(to|-|:|—)\s+/i,"").replace(/\s*[-:—]\s*Introduction$/i,"").replace(/\s+Introduction$/i,"").trim();xe&&xe.toLowerCase()!=="introduction"&&We(xe)}}},[ce]),a.useEffect(()=>{ce.length>0&&v?.uid&&t.id&&Ta(v.uid,t.id,Re||t.title).catch(()=>{})},[ce.length,v?.uid,t.id,Re,t.title]);const h=ce.length||_t.length;if(a.useEffect(()=>{o>=0&&o{const R=ce.findIndex(ee=>ee.type==="try_it_yourself");o===-1&&R>=0&&p(R)},[ce,o]),a.useEffect(()=>{const R=h>0?(m+1)/h*100:0;f?.(R)},[m,h,f]),Oe)return e.jsx(rl,{});if(Se&&ce.length===0)return e.jsx(ll,{message:Se,onRetry:U,isOffline:Ve});const A=String(t.id||"").match(/\d+/);if(A&&A[0],D)return se||!L?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl p-6 flex flex-col items-center gap-3 shadow-xl",children:[e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"}),e.jsx("p",{className:"font-bold text-slate-700",children:"Generating Quiz..."})]})}):e.jsx(Wr,{lesson:{id:parseInt(String(t.id||"1").replace(/\D/g,"")||"1"),title:t.title,duration:"15 min",type:"quiz",completed:!1,locked:!1},questions:L,onBack:()=>{b(!1),B(null)},onComplete:R=>{const ee=Math.round(R/(L?.length||10)*100);M?.(ee),ge(!0),b(!1),B(null)}});const T=ce[m]||{type:"introduction",title:"Loading...",content:"Lesson content is loading. Please wait a moment."},G=()=>{mR+1)):(!l||i)&&j(!0)},$=()=>{m>0&&(y(-1),p(R=>R-1))},K=R=>{x(void 0,void 0,R)},ne=!!(l&&!i||!re),_e=_t[m]||_t[0],fe=_e.icon,be=e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-slate-50 overflow-hidden font-sans",children:[e.jsx("header",{className:"flex-none bg-transparent px-3 sm:px-6 pt-2 sm:pt-3 md:pt-4 pb-2 sm:pb-3 sm:py-4 relative z-40",children:e.jsxs("div",{className:"max-w-[90rem] mx-auto flex items-center justify-between gap-2 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0 flex-1",children:[e.jsx("button",{onClick:d,className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full bg-white border border-slate-200 hover:bg-slate-50 flex items-center justify-center text-slate-600 transition-colors flex-shrink-0 shadow-sm","aria-label":"Go back",children:e.jsx(Kt,{size:16})}),e.jsxs("div",{className:"min-w-0 flex flex-col justify-center flex-1",children:[e.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 sm:gap-2 text-[9px] sm:text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-0.5",children:[e.jsx(Fe,{size:10}),e.jsx("span",{children:"NOTEBOOK"}),Me&&e.jsx("span",{className:"text-slate-400 bg-slate-100 px-1.5 py-0.5 rounded font-mono",children:Me.split("/").pop()}),Qe==="high"&&e.jsx("span",{className:"text-emerald-600 bg-emerald-50 px-1.5 py-0.5 rounded text-[10px] font-semibold border border-emerald-200",children:"DepEd Source"})]}),e.jsxs("div",{className:"flex sm:hidden items-center gap-1 text-[9px] font-bold text-slate-400 uppercase tracking-widest mb-0.5",children:[e.jsx(Fe,{size:9}),e.jsx("span",{children:"Notebook"}),Qe==="high"&&e.jsx("span",{className:"text-emerald-600 bg-emerald-50 px-1 py-0.5 rounded text-[8px] font-semibold border border-emerald-200 leading-none",children:"DepEd"})]}),e.jsx("h1",{className:"font-bold text-slate-800 text-xs sm:text-sm truncate",children:t.title})]})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 flex-shrink-0",children:[e.jsxs("div",{className:"text-right hidden sm:block",children:[e.jsx("p",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-wider",children:"Progress"}),e.jsxs("p",{className:"text-sm font-bold text-slate-800",children:[Math.round((m+1)/h*100),"%"]})]}),e.jsx("div",{className:"w-12 sm:w-24 md:w-32 h-1.5 sm:h-2 bg-slate-200 rounded-full overflow-hidden",children:e.jsx(k.div,{className:"h-full bg-[#7ec16d] rounded-full",animate:{width:`${(m+1)/h*100}%`},transition:{duration:.25}})})]})]})}),e.jsx("main",{className:"flex-1 overflow-hidden px-2 sm:px-5 pb-2 relative flex justify-center min-h-0",children:e.jsxs("div",{className:"w-full max-w-[90rem] h-full relative flex md:pl-16 pt-10 sm:pt-10 md:pt-0",children:[e.jsx("div",{className:"hidden md:flex absolute left-0 top-8 bottom-8 w-20 flex-col justify-between z-0 py-2",children:_t.map((R,ee)=>{const xe=ee===m,$e=R.icon;return e.jsxs("button",{onClick:()=>{y(ee>m?1:-1),p(ee)},className:Lt("group relative flex items-center justify-start pl-4 rounded-l-[1.5rem] transition-all duration-300 shadow-sm border-r-0 flex-shrink-0",R.tabBg,xe?"w-24 h-20 -translate-x-4 shadow-xl z-20 brightness-105":"w-16 h-16 hover:w-24 hover:h-20 hover:-translate-x-4 hover:brightness-110 opacity-90 hover:opacity-100 z-10"),"aria-label":`Go to ${R.label} section`,children:[e.jsx("div",{className:Lt("transition-all duration-300 rounded-xl",xe?"bg-white/30 p-2.5":"bg-white/20 p-2 group-hover:bg-white/30 group-hover:p-2.5"),children:e.jsx($e,{size:xe?24:20,className:"text-white transition-transform duration-300 group-hover:scale-110"})}),e.jsxs("div",{className:"absolute right-full mr-3 px-3 py-1.5 bg-slate-800 text-white text-xs font-bold rounded-lg opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity whitespace-nowrap z-[100] shadow-xl border border-slate-700/50",children:[e.jsx("div",{className:"absolute top-1/2 -right-1 -translate-y-1/2 w-2 h-2 bg-slate-800 rotate-45 border-r border-t border-slate-700/50"}),R.label]})]},R.type)})}),e.jsx("div",{className:"md:hidden absolute left-0 right-0 top-0 z-30 bg-slate-100/95 backdrop-blur-sm",children:e.jsx("div",{className:"flex gap-0.8 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden px-1",children:_t.map((R,ee)=>{const xe=ee===m,$e=R.icon;return e.jsxs("button",{onClick:()=>{y(ee>m?1:-1),p(ee)},className:Lt("flex items-center gap-1.5 px-3 py-2 rounded-t-lg transition-all duration-200 shrink-0 text-[11px] font-bold touch-manipulation min-h-[2.5rem]",xe?`${R.tabBg} text-white shadow-md`:"bg-slate-200/80 text-slate-500"),children:[e.jsx($e,{size:14}),e.jsx("span",{children:R.label})]},R.type)})})}),e.jsxs("div",{className:Lt("flex-1 min-w-0 rounded-none sm:rounded-lg shadow-2xl flex flex-col overflow-visible relative z-10 transition-colors duration-500",_e.tabBg),children:[e.jsxs("div",{className:"px-3 sm:px-6 py-2 sm:py-3.5 flex items-center gap-2 sm:gap-4 text-white",children:[e.jsx("div",{className:"bg-white/20 p-1 sm:p-2 rounded-lg sm:rounded-xl shrink-0",children:e.jsx(fe,{size:16,className:"text-white"})}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx("h2",{className:"lesson-section-heading text-sm sm:text-xl md:text-2xl truncate",title:T.title,children:T.title}),e.jsx("p",{className:"text-white/90 text-[10px] sm:text-xs font-medium truncate mt-0.5 font-body",title:t.title,children:t.title})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 bg-[#fdfdfd] rounded-lg sm:rounded-[1.5rem] m-1 mt-0 relative overflow-hidden shadow-inner flex flex-col",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-30",style:{backgroundImage:"linear-gradient(transparent 95%, #cbd5e1 95%)",backgroundSize:"100% 40px",backgroundPosition:"0 0"}}),e.jsx("div",{className:"absolute top-0 bottom-0 left-8 sm:left-12 md:left-16 w-[2px] bg-rose-300/60 pointer-events-none z-0"}),e.jsx("div",{className:"relative z-10 flex-1 min-h-0 overflow-y-auto px-3 sm:px-5 md:pl-20 md:pr-10 py-2 sm:py-6",children:e.jsx(st,{mode:"wait",children:e.jsxs(k.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"bg-white/90 backdrop-blur-sm rounded-xl sm:rounded-[1.5rem] p-4 sm:p-6 md:p-8 shadow-sm border border-slate-100/50 font-body",children:e.jsx(nl,{section:T,sectionIndex:m,onShowSolution:R=>_(E===R?null:R),expandedIndex:E,lesson:t,practiceQuiz:l,practiceQuizCompleted:i,practiceQuizScore:n,onStartPractice:r,lessonSpecificTopic:Re,onStartTryItQuiz:()=>b(!0)})}),ve.length>0&&(v?.role==="admin"||v?.role==="teacher")&&e.jsxs("details",{className:"rounded-xl border border-slate-200 bg-white/90 backdrop-blur-sm px-4 py-3 text-xs text-slate-500 shadow-sm",children:[e.jsxs("summary",{className:"cursor-pointer font-semibold text-slate-600 hover:text-slate-800",children:[ve.length," source",ve.length>1?"s":""," used"]}),e.jsx("div",{className:"mt-2 space-y-1 pl-2",children:ve.slice(0,3).map((R,ee)=>e.jsxs("p",{className:"font-mono truncate",children:[R.source_file," p.",R.page," (",Math.round((R.score||0)*100),"%)"]},ee))})]})]},m)})},m)]})]})]})}),e.jsx("footer",{className:"bg-slate-50 border-t border-slate-100 px-3 sm:px-6 flex-shrink-0 relative z-50 w-full flex justify-center items-center py-1.5 sm:py-3",children:e.jsxs("div",{className:"w-full max-w-[90rem] flex flex-col items-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-4 sm:gap-8 w-full md:ml-16",children:[e.jsxs(ze,{onClick:$,disabled:m===0,variant:"outline",className:"px-4 sm:px-5 py-2 sm:py-2 rounded-full font-bold text-xs sm:text-sm bg-white border-slate-200 text-slate-600 shadow-sm disabled:opacity-40 hover:bg-slate-50 transition-colors flex items-center gap-1 sm:gap-2 min-w-[2.5rem] min-h-[2.5rem] touch-manipulation",children:[e.jsx(Kt,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Previous"})]}),e.jsxs("p",{className:"text-xs sm:text-sm text-slate-500 font-bold tabular-nums",children:[m+1," / ",h]}),e.jsx(ze,{onClick:G,disabled:m===h-1&&ne,className:"px-5 sm:px-7 py-2 sm:py-2 rounded-full font-bold text-xs sm:text-sm bg-[#7ec16d] text-white hover:bg-[#6ab359] shadow-md transition-colors disabled:opacity-40 flex items-center gap-1 sm:gap-2 min-w-[2.5rem] min-h-[2.5rem] touch-manipulation",children:m===h-1?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"Complete"}),e.jsx(ft,{size:14})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"Next"}),e.jsx(ht,{size:14})]})})]}),m===h-1&&ne&&e.jsx("p",{className:"text-center text-[10px] sm:text-xs font-semibold text-amber-600 mt-2 sm:mt-3 md:ml-16",children:re?"Complete the practice quiz first to unlock lesson completion.":"Complete the Try It Yourself quiz first to unlock lesson completion."})]})}),e.jsx(st,{children:W&&e.jsx(k.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-[100] flex items-center justify-center bg-slate-900/40 backdrop-blur-sm p-4",children:e.jsxs(k.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-[2rem] p-8 max-w-sm w-full text-center shadow-2xl",children:[e.jsx("div",{className:"w-20 h-20 bg-[#7ec16d] rounded-full flex items-center justify-center mx-auto mb-5 shadow-lg",children:e.jsx(ft,{size:40,className:"text-white"})}),e.jsx("h2",{className:"text-2xl font-black text-slate-800 mb-2",children:"Lesson Complete!"}),e.jsxs("p",{className:"text-slate-500 text-sm mb-6 leading-relaxed",children:["Great job finishing ",e.jsx("strong",{className:"text-slate-700",children:t.title}),"."]}),e.jsxs("div",{className:"bg-emerald-50 rounded-2xl p-4 mb-6 border border-emerald-100",children:[e.jsx("div",{className:"flex items-center justify-center mb-1",children:e.jsx(Tt,{className:"text-[#7ec16d]",size:22})}),e.jsx("p",{className:"text-xs text-[#7ec16d] font-bold uppercase tracking-wider mb-0.5",children:"XP Earned"}),e.jsxs("p",{className:"text-3xl font-black text-[#7ec16d]",children:["+",s]})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("button",{onClick:()=>K(!0),disabled:ne,className:"w-full py-3 rounded-xl font-bold text-sm bg-[#1a85a4] text-white hover:bg-[#126b84] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Continue to Next Lesson"}),e.jsx("button",{onClick:()=>K(!1),className:"w-full py-3 rounded-xl font-bold text-sm bg-slate-100 text-slate-600 hover:bg-slate-200 transition-colors",children:"Back to Modules"})]})]})})})]}),Ee=document.getElementById("modal-root")||document.body;return ra.createPortal(be,Ee)},ol={maxRetries:2,timeoutMs:9e4,baseBackoffMs:2e3},ea=async t=>Rt("/api/practice/generate",{method:"POST",body:JSON.stringify(t)},ol),cl=async t=>Rt("/api/practice/submit",{method:"POST",body:JSON.stringify(t)}),dl=async t=>Rt(`/api/practice/stats/${t}`,{method:"GET"}),ml=({module:t,onBack:s,onEarnXP:l,isInQuizMode:i=!1,setIsInQuizMode:n})=>{const[r,d]=a.useState(null),{userProfile:x}=$t(),[f,M]=a.useState(null),[u,v]=a.useState(!1),[m,p]=a.useState(null);a.useEffect(()=>{if(!x?.uid)return;(async()=>{try{const[A,T]=await Promise.all([Vt(kt(tt,"diagnosticResults",x.uid)),Vt(kt(tt,"competencyProfiles",x.uid))]),G=A.exists()&&A.data()?.status==="completed",$=T.exists()&&(T.data()?.overallScore??0)>0;v(G||$)}catch{v(!1)}})()},[x?.uid]);const S=a.useRef(l);a.useEffect(()=>{S.current=l},[l]);const y=a.useRef(r);a.useEffect(()=>{y.current=r},[r]),a.useEffect(()=>{try{const h=sessionStorage.getItem(`mathpulse_module_${t.id}_selectedLesson`);if(h){const{lessonId:A}=JSON.parse(h),T=t.lessons.find(G=>G.id===A);T&&d({lesson:T,type:"lesson"})}}catch{}},[]),a.useEffect(()=>{if(r?.type==="lesson"&&r.lesson)try{sessionStorage.setItem(`mathpulse_module_${t.id}_selectedLesson`,JSON.stringify({lessonId:r.lesson.id}))}catch{}else if(r===null)try{sessionStorage.removeItem(`mathpulse_module_${t.id}_selectedLesson`)}catch{}},[r,t.id]);const W=a.useMemo(()=>{const h=Number(t.id.split("-").pop());return Number.isFinite(h)&&h>0?h:1},[t.id]),j=a.useMemo(()=>{const h=t.subjectId;return h||(Dt.find(T=>T.modules.some(G=>G.id===t.id))?.id??null)},[t.id]),E=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];a.useMemo(()=>{const h=t.subjectAccentColor;if(h)return h;const T=(j?Dt.find($=>$.id===j):null)?.modules?.findIndex($=>$.id===t.id)??0,G=T>=0?T:0;return E[G%E.length]},[t,t.id,j]),a.useEffect(()=>{if(x?.uid)return us(x.uid,M)},[x?.uid]),a.useEffect(()=>{if(!r||r.type!=="quiz"||!x?.uid)return;let h=!1;const T=Dt.find(G=>G.modules.some($=>$.id===t.id))?.title??"General Mathematics";return(async()=>{try{const G=await ea({userId:x.uid,subject:T,competency:r.quiz.title.replace(/^(Practice Quiz|Module Quiz):\s*/i,""),difficulty:r.quiz.type==="module"?"Challenge":"Practice",count:r.quiz.questions||5});if(h)return;const $=G.questions.filter(K=>K.options?.length&&K.correct_index>=0&&K.correct_index({id:K.id||"q-"+ne,questionType:"multiple_choice",question:K.question,options:K.options,correctAnswer:K.options[K.correct_index],bloomLevel:K.bloomsLevel?.toLowerCase()||"understand",difficulty:"medium",topic:r.quiz.title,subject:T,points:10,explanation:K.explanation||""}));p($)}catch(G){console.error("[ModuleDetailView] Quiz generation failed:",G);const $=r.quiz.questions||5,K=Array.from({length:$}).map((ne,_e)=>{const fe=Math.floor(Math.random()*20)+2,be=Math.floor(Math.random()*20)+2,Ee=(fe+be).toString();return{id:"fallback-"+_e,questionType:"multiple_choice",question:`Compute: ${fe} + ${be}`,options:[Ee,(fe*be).toString(),Math.abs(fe-be).toString(),(fe+be+1).toString()],correctAnswer:Ee,bloomLevel:"remember",difficulty:"easy",topic:r.quiz.title,subject:T,points:10,explanation:`${fe} + ${be} = ${Ee}`}});h||p(K)}})(),()=>{h=!0}},[r,x?.uid,t.id]);const _=a.useMemo(()=>j?f?.subjects?.[j]?.modulesProgress?.[t.id]??null:null,[t.id,j,f?.subjects]),[D,b]=a.useState(null),L=a.useMemo(()=>{const h=_?.lessonsCompleted??[];return new Set(h)},[_?.lessonsCompleted]),B=a.useMemo(()=>{const h=_?.quizzesCompleted??[];return new Set(h)},[_?.quizzesCompleted]),se=_?.lessonsCompleted?.length??t.lessons.filter(h=>h.completed).length,C=_?.quizzesCompleted?.length??t.quizzes.filter(h=>h.completed).length,re=_?.progress??t.progress,ge=t.lessons.length+t.quizzes.length,He=se+C;t.lessons.length&&se/t.lessons.length*100,t.quizzes.length&&C/t.quizzes.length*100;const ce=(h,A)=>{const T=f?.lessons?.[h]?.score;return typeof T=="number"&&Number.isFinite(T)?Math.max(0,Math.min(100,T)):A?100:0},Oe=a.useMemo(()=>{if(!ge)return 0;const h=t.lessons.reduce((T,G)=>{const $=L.has(G.id)||G.completed;return T+ce(G.id,$)},0),A=C*100;return Math.round((h+A)/ge)},[L,C,t.lessons,t.quizzes.length,ge,f?.lessons]),Se=re>0?re:Oe,U=a.useMemo(()=>{const h=t.quizzes.find(T=>T.type==="final"||/module\s+quiz|general\s+quiz/i.test(T.title));if(h)return h;const A=t.quizzes.find(T=>T.isStandalone===!0);return A||(t.quizzes.length?t.quizzes[0]:null)},[t.quizzes]),ve=a.useMemo(()=>{const h=new Map;t.lessons.forEach(T=>{h.set(T.id,[])});const A=t.lessons.length;return A===0||t.quizzes.forEach((T,G)=>{if(U?.id===T.id)return;const $=Math.min(G,A-1),K=t.lessons[$];if(!K)return;const ne=h.get(K.id)??[];ne.push(T),h.set(K.id,ne)}),h},[t.lessons,t.quizzes,U?.id]),Qe=a.useMemo(()=>Math.max(1,Math.ceil(t.lessons.length/2)),[t.lessons.length]),Me=a.useCallback(()=>{d(null),b(null)},[]),Ve=a.useCallback(()=>{const h=y.current?.type==="lesson"?y.current.lesson:null;if(!h)return;const A={id:`${h.id}-practice`,title:`Practice Quiz: ${h.title}`,questions:Xr(),duration:h.duration,completed:!1,locked:!1,type:"practice"};b(h),d({type:"quiz",quiz:A})},[]),Re=a.useCallback((h,A,T)=>{const G=y.current;if(G?.type!=="lesson"||!G.lesson)return;const $=G.lesson,K=10;if(S.current?.(K,`Completed "${$.title}"`),x?.uid&&j&&(async()=>{try{await pa(x.uid,j,t.id,$.id,0,K),await ps(x.uid,j,t.id,t.lessons.length,t.quizzes.length)}catch(ne){console.error("[LessonComplete] Failed to persist progress:",ne)}})(),T){const ne=t.lessons.findIndex(_e=>_e.id===$.id);ne!==-1&&ne0?d({type:"quiz",quiz:t.quizzes[0]}):d(null)}else d(null)},[j,t.id,t.lessons.length,t.quizzes.length]),We=a.useCallback(h=>{if(!x?.uid||!y.current||y.current.type!=="lesson")return;const A=y.current.lesson.id;(async()=>{try{await ha(x.uid,A,h)}catch(T){console.warn("[ModuleDetailView] Failed to persist lesson progress:",T)}})()},[x?.uid,t.id]);if(r)if(r.type==="lesson"){const h=ve.get(r.lesson.id)?.[0]??null,A=h?B.has(h.id)||h.completed:!1;return e.jsx(il,{lesson:r.lesson,lessonCompletionXP:10,practiceQuiz:h,practiceQuizCompleted:A,initialSection:r.returnFromQuiz?-1:0,onBack:Me,onStartPractice:Ve,onProgressUpdate:We,onComplete:Re})}else return m?e.jsx(Ks,{quiz:{id:r.quiz.id,title:r.quiz.title,subject:Dt.find(h=>h.modules.some(A=>A.id===t.id))?.title||"Mathematics",difficulty:"Medium",questions:m.length,duration:r.quiz.duration||"15 min",xpReward:50,type:"practice",completed:r.quiz.completed,locked:!1,loadedQuestions:m,source:"ai_generated"},onClose:()=>{p(null),D?(d({type:"lesson",lesson:D,returnFromQuiz:!0}),b(null)):d(null),n&&n(!1)},onComplete:(h,A)=>{x?.uid&&j&&(async()=>{try{await fa(x.uid,j,t.id,r.quiz.id,h,[],0,A),await ps(x.uid,j,t.id,t.lessons.length,t.quizzes.length),await us(x.uid,M)}catch(T){console.warn("[Quiz] Progress persist failed:",T)}l&&l(A??0,"Quiz Complete! +"+(A??0)+" XP")})()},studentId:x?.uid}):e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl p-6 flex flex-col items-center gap-3 shadow-xl",children:[e.jsx(Hs,{size:36,className:"animate-spin text-indigo-600"}),e.jsx("p",{className:"font-bold text-slate-700",children:"Generating Quiz..."}),e.jsxs("p",{className:"text-sm text-slate-500",children:["AI is crafting questions for ",r.quiz.title]})]})});return e.jsxs("div",{className:"h-full overflow-y-auto scrollbar-hide px-4 md:px-6 lg:px-10 py-4 md:py-6 lg:py-8 relative",children:[e.jsx("div",{className:"relative mb-4 lg:mb-6 xl:mb-8 w-full lg:w-max",children:e.jsxs("button",{onClick:s,className:"flex items-center gap-2 px-4 py-2.5 rounded-full bg-white/80 backdrop-blur-xl border border-slate-200/60 text-slate-600 hover:text-indigo-600 font-bold text-sm tracking-wide transition-all hover:-translate-x-1 shadow-sm hover:shadow-md",children:[e.jsx(Kt,{size:18}),"Back"]})}),e.jsxs(k.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:`relative mb-6 lg:mb-8 rounded-[2rem] ${t.accentColor} shadow-[0_20px_40px_-15px_rgba(0,0,0,0.3)] shrink-0 overflow-hidden`,children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 pointer-events-none z-0"}),e.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none module-detail-grid-pattern"}),e.jsx("div",{className:"absolute top-0 right-0 w-[400px] h-[400px] bg-sky-500/20 blur-[100px] rounded-full pointer-events-none"}),e.jsxs("div",{className:"relative p-5 md:p-6 lg:p-8 flex flex-col md:flex-row md:items-center justify-between gap-3 md:gap-5",children:[e.jsxs("div",{className:"flex-1 text-white",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2 md:mb-2.5",children:[e.jsxs("div",{className:"px-2.5 py-0.5 bg-white/10 backdrop-blur-md rounded-full text-[10px] font-black uppercase tracking-widest text-[#f8fafc] border border-white/20 shadow-sm flex items-center gap-1",children:[e.jsx(ws,{size:12})," Chapter ",t.id.split("-").pop()||"1"]}),e.jsxs("div",{className:"px-2.5 py-0.5 bg-white/10 backdrop-blur-md rounded-full text-[10px] font-black uppercase tracking-widest text-emerald-400 border border-emerald-400/30",children:["Lv ",W]})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("span",{className:"flex lg:hidden text-white/80 shrink-0",children:e.jsx(Fe,{size:18,strokeWidth:1.5})}),e.jsx("h1",{className:"text-lg md:text-2xl lg:text-3xl font-display font-black text-white tracking-[-0.02em] leading-tight",children:t.title})]}),e.jsx("p",{className:"text-slate-300 text-xs md:text-sm max-w-2xl font-medium leading-relaxed mb-3",children:t.description}),e.jsxs("div",{className:"bg-black/20 backdrop-blur-md rounded-xl p-2 md:p-3 border border-white/10 max-w-xl",children:[e.jsxs("div",{className:"flex justify-between items-end gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Tt,{size:16,className:"text-emerald-400"}),e.jsx("span",{className:"text-[11px] md:text-xs font-black text-white uppercase tracking-wider",children:"Module Mastery"})]}),e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsxs("span",{className:"text-[10px] md:text-xs font-bold text-slate-400",children:[He,"/",ge]}),e.jsxs("span",{className:"text-base md:text-lg font-black text-white shrink-0 leading-none",children:[Math.round(Se),"%"]})]})]}),e.jsx("div",{className:"h-2 bg-black/40 rounded-full overflow-hidden shadow-inner ring-1 ring-white/10 p-0.5 mt-2",children:e.jsx(k.div,{initial:{width:0},animate:{width:`${Se}%`},transition:{duration:1.5,ease:"easeOut",delay:.2},className:`h-full rounded-full relative ${Se===100?"bg-gradient-to-r from-emerald-400 to-teal-300":t.accentColor}`,children:e.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=')] opacity-30 mix-blend-overlay"})})})]})]}),e.jsxs("div",{className:"hidden lg:flex w-32 h-32 bg-white/5 rounded-2xl border border-white/10 backdrop-blur-md items-center justify-center transform rotate-[-3deg] shadow-2xl relative group hover:rotate-0 transition-all duration-500 shrink-0",children:[e.jsx("div",{className:`absolute inset-0 opacity-40 rounded-2xl ${t.progress===100?"bg-gradient-to-br from-emerald-400 to-teal-600":t.accentColor}`}),Se===100?e.jsx(ls,{size:56,className:"text-white drop-shadow-xl z-10 scale-100 group-hover:scale-110 transition-transform duration-500",strokeWidth:1}):e.jsx(Fe,{size:56,className:"text-white drop-shadow-xl z-10 scale-100 group-hover:scale-110 transition-transform duration-500",strokeWidth:1}),e.jsx(k.div,{animate:{y:[-5,5,-5],rotate:[-10,10,-10]},transition:{duration:4,repeat:1/0},className:"absolute top-4 left-4 text-emerald-300 z-20",children:e.jsx($s,{size:16,fill:"currentColor"})}),e.jsx(k.div,{animate:{y:[5,-5,5],rotate:[10,-10,10]},transition:{duration:3.5,repeat:1/0},className:"absolute bottom-6 right-4 text-sky-300 z-20",children:e.jsx(ks,{size:18})})]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto pr-2 pb-8 scrollbar-hide",children:e.jsxs("div",{className:"relative rounded-[2rem] border border-slate-200 bg-white/90 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none bg-[radial-gradient(circle_at_top_right,rgba(153,86,222,0.08),transparent_45%),radial-gradient(circle_at_bottom_left,rgba(31,167,225,0.08),transparent_45%)]"}),e.jsxs("div",{className:"relative z-10 px-4 sm:px-6 md:px-8 py-5 md:py-6 border-b border-slate-200/70 bg-white/70 backdrop-blur-sm flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("h2",{className:"font-display font-black text-xl md:text-2xl text-slate-800 flex items-center gap-3",children:[e.jsx(Fe,{size:24,className:"text-sky-500"}),"Study Journey"]}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("div",{className:"text-xs md:text-sm font-bold bg-sky-100 text-sky-700 px-3 py-1 rounded-full shadow-sm border border-sky-200/50",children:["Lessons ",se,"/",t.lessons.length]}),e.jsxs("div",{className:"text-xs md:text-sm font-bold bg-rose-100 text-rose-700 px-3 py-1 rounded-full shadow-sm border border-rose-200/50",children:["Quizzes ",C,"/",t.quizzes.length]})]})]}),e.jsxs("div",{className:"relative z-10 px-3 md:px-6 lg:px-8 py-4 md:py-6 space-y-4 md:space-y-5",children:[t.lessons.map((h,A)=>{const T=L.has(h.id)||h.completed,G=ce(h.id,T),$=E[A%E.length];return e.jsxs(je.Fragment,{children:[e.jsxs(k.div,{initial:{opacity:0,y:14},animate:{opacity:1,y:0},transition:{delay:A*.05},className:`relative rounded-[1.5rem] border overflow-hidden group transition-all duration-500 mb-4 md:mb-6 ${h.locked?"border-slate-200 opacity-65 saturate-50":"border-slate-200/80 hover:border-slate-300 hover:shadow-[0_16px_40px_-15px_rgba(0,0,0,0.12)] hover:-translate-y-0.5"}`,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[6px] z-20 bg-slate-100 overflow-hidden",children:e.jsx(k.div,{initial:{width:0},animate:{width:`${Math.max(2,G)}%`},transition:{duration:1.2,ease:"easeOut",delay:.1+A*.05},className:"h-full relative",style:{backgroundColor:$},children:e.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=')] opacity-30 mix-blend-overlay"})})}),e.jsx("div",{className:"absolute inset-0 bg-white transition-opacity duration-500 group-hover:opacity-90",style:{backgroundImage:`linear-gradient(to right, ${$}44 0%, ${$}11 50%, white 100%)`}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.2] pointer-events-none",style:{backgroundImage:`radial-gradient(circle at 2px 2px, ${$} 1.5px, transparent 0)`,backgroundSize:"24px 24px"}}),e.jsx("div",{className:"absolute -top-12 -left-10 h-40 w-40 rounded-full blur-[32px] pointer-events-none transition-transform duration-700 group-hover:scale-[1.3] group-hover:translate-x-4",style:{backgroundColor:`${$}22`}}),e.jsx("div",{className:"absolute -bottom-8 right-8 h-32 w-32 rounded-full blur-2xl pointer-events-none transition-transform duration-700 group-hover:scale-125 group-hover:-translate-y-4",style:{backgroundColor:`${$}11`}}),e.jsx("div",{className:"absolute right-4 top-4 opacity-10 pointer-events-none transition-all duration-500 group-hover:rotate-12 group-hover:scale-110 drop-shadow-sm",style:{color:$},children:e.jsx(ks,{size:56,strokeWidth:1})}),e.jsx("div",{className:"absolute right-16 bottom-5 opacity-10 pointer-events-none transition-all duration-500 group-hover:-rotate-6 group-hover:-translate-y-2 drop-shadow-sm",style:{color:$},children:e.jsx(Fe,{size:40,strokeWidth:1})}),e.jsxs("div",{className:"relative z-10 p-3 md:p-5 pt-5 md:pt-6 space-y-3 md:space-y-4",children:[e.jsxs("button",{type:"button",onClick:()=>!h.locked&&d({lesson:h,type:"lesson"}),className:`w-full text-left flex flex-wrap items-center justify-between gap-2 md:gap-3 rounded-2xl px-3 md:px-5 py-3 md:py-4 transition shadow-sm ${h.locked?"cursor-not-allowed border border-slate-200 bg-white/70":"cursor-pointer bg-white hover:bg-slate-50"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-4 min-w-0",children:[e.jsx("div",{className:`w-10 h-10 md:w-12 md:h-12 rounded-full flex items-center justify-center shrink-0 transition-colors shadow-sm ${h.locked?"bg-slate-100 text-slate-400":"text-white"}`,style:h.locked?{}:T?{backgroundColor:"#0ea5e9"}:{backgroundColor:$},children:h.locked?e.jsx(Os,{size:16}):T?e.jsx(Vs,{size:20}):e.jsx(Ws,{size:18,className:"ml-0.5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"text-[10px] md:text-[12px] font-black uppercase tracking-wider text-slate-500 mb-0.5",children:["Lesson ",A+1]}),e.jsx("h3",{className:"font-bold text-[14px] md:text-[18px] text-[#0a1628] leading-tight line-clamp-2",children:h.title})]})]}),e.jsx("div",{className:"flex items-center justify-end shrink-0",children:e.jsxs("span",{className:"inline-flex items-center gap-1 text-slate-500 text-[11px] md:text-sm font-semibold bg-slate-100/80 px-2 md:px-3 py-1 md:py-1.5 rounded-lg md:rounded-xl",children:[e.jsx(Nt,{size:12}),h.duration]})})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 md:gap-3 px-0.5 md:px-1",children:[e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full bg-white px-3 md:px-4 py-1 md:py-1.5 text-[11px] md:text-[12px] font-bold shadow-sm transition hover:-translate-y-0.5",style:{color:$},children:[e.jsx(Fe,{size:12})," Study Materials"]}),e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full bg-white px-3 md:px-4 py-1 md:py-1.5 text-[11px] md:text-[12px] font-bold shadow-sm transition hover:-translate-y-0.5",style:{color:$},children:[e.jsx(ws,{size:12})," Quiz"]})]})]})]}),U&&A===Qe-1&&e.jsxs(k.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{delay:.15+A*.03},className:"mt-4 md:mt-6 mb-4 md:mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-4 mb-4 md:mb-6",children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-[10px] md:text-xs font-bold text-indigo-400 uppercase tracking-widest text-center",children:"mid-module checkpoint"}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),e.jsxs("div",{className:"relative rounded-[1.5rem] bg-[#533ab6] p-3 md:p-5 shadow-lg overflow-hidden group transition-all hover:shadow-xl hover:-translate-y-1",children:[e.jsx("div",{className:"absolute right-2 md:right-10 top-1/2 -translate-y-1/2 text-white/5 text-[80px] md:text-[140px] font-black font-display pointer-events-none group-hover:scale-110 transition-transform duration-500",children:"?"}),e.jsxs("div",{className:"relative z-10 flex flex-wrap items-center gap-3 md:gap-5",children:[e.jsx("div",{className:"w-12 h-12 md:w-14 md:h-14 rounded-[12px] md:rounded-[14px] bg-white/10 backdrop-blur-md border border-white/10 shrink-0 flex items-center justify-center shadow-inner",children:e.jsx(et,{size:22,className:"text-rose-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[9px] md:text-[11px] font-black uppercase tracking-widest text-[#a3b1ee] mb-0.5 md:mb-1 drop-shadow-sm",children:"COMPETENCY CHECK · General Quiz"}),e.jsx("h3",{className:"font-display font-medium text-[16px] md:text-[22px] text-white leading-tight mb-1 md:mb-2 tracking-tight",children:U.title}),e.jsxs("p",{className:"text-[11px] md:text-xs font-semibold text-white/80 flex flex-wrap items-center gap-2 md:gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Zt,{size:11})," ",U.questions," Qs"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Nt,{size:11})," ",U.duration]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-amber-300 drop-shadow-md",children:[e.jsx(Xe,{size:11,className:"fill-amber-300"})," +50 XP"]})]})]}),e.jsx("button",{type:"button",onClick:()=>!U.locked&&(d({quiz:U,type:"quiz"}),n&&n(!0)),className:`px-4 md:px-6 py-2 md:py-2.5 rounded-xl text-[11px] md:text-sm font-bold tracking-wider transition-all backdrop-blur-sm self-center shrink-0 ${U.locked?"bg-white/5 text-white/30 border border-white/10 cursor-not-allowed":u&&(B.has(U.id)||U.completed)?"bg-white/20 text-white border border-white/40 hover:bg-white/30 shadow-sm":"bg-transparent text-white border border-white/40 hover:bg-white/10 shadow-sm"}`,children:u&&(B.has(U.id)||U.completed)?"REVIEW":"START"})]})]})]})]},h.id)}),t.lessons.length===0&&U&&e.jsxs("div",{className:"relative rounded-[1.5rem] bg-[#533ab6] p-5 shadow-lg overflow-hidden group",children:[e.jsx("div",{className:"absolute right-4 md:right-10 top-1/2 -translate-y-1/2 text-white/5 text-[140px] font-black font-display pointer-events-none group-hover:scale-110 transition-transform duration-500",children:"?"}),e.jsxs("div",{className:"relative z-10 flex flex-wrap items-center justify-between gap-4 md:gap-5",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx("div",{className:"w-14 h-14 rounded-[14px] bg-white/10 backdrop-blur-md border border-white/10 shrink-0 flex items-center justify-center shadow-inner",children:e.jsx(et,{size:28,className:"text-rose-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] md:text-[11px] font-black uppercase tracking-widest text-[#a3b1ee] mb-1 drop-shadow-sm",children:"COMPETENCY CHECK · General Quiz"}),e.jsx("h3",{className:"font-display font-medium text-[20px] md:text-[22px] text-white leading-tight mb-2 tracking-tight",children:U.title}),e.jsxs("p",{className:"text-xs font-semibold text-white/80 flex items-center gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Zt,{size:12})," ",U.questions," Qs"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Nt,{size:12})," ",U.duration]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-amber-300 drop-shadow-md",children:[e.jsx(Xe,{size:12,className:"fill-amber-300"})," +50 XP"]})]})]})]}),e.jsx("button",{type:"button",onClick:()=>!U.locked&&(d({quiz:U,type:"quiz"}),n&&n(!0)),className:`px-6 py-2.5 rounded-xl text-xs md:text-sm font-bold tracking-wider transition-all backdrop-blur-sm self-center shrink-0 ${U.locked?"bg-white/5 text-white/30 border border-white/10 cursor-not-allowed":u&&(B.has(U.id)||U.completed)?"bg-white/20 text-white border border-white/40 hover:bg-white/30 shadow-sm":"bg-transparent text-white border border-white/40 hover:bg-white/10 shadow-sm"}`,children:u&&(B.has(U.id)||U.completed)?"REVIEW":"START"})]})]})]})]})})]})},xl={"Patterns, Relations, and Functions":{icon:At,bg:"bg-indigo-500"},"Financial Mathematics":{icon:La,bg:"bg-emerald-500"},"Logic and Mathematical Reasoning":{icon:ba,bg:"bg-purple-500"},"Random Variables":{icon:sr,bg:"bg-orange-500"},"Normal Distribution":{icon:Ia,bg:"bg-sky-500"},"Sampling and Estimation":{icon:er,bg:"bg-teal-500"},"Hypothesis Testing":{icon:lr,bg:"bg-rose-500"},"Correlation and Regression":{icon:Va,bg:"bg-amber-500"}};function ul(t){return xl[t]||{icon:Zt,bg:"bg-slate-500"}}const pl=({userId:t,onStartQuiz:s,searchQuery:l="",allowedSubjectIds:i})=>{const{userProfile:n}=$t(),[o,r]=a.useState("all"),[d,x]=a.useState("Medium"),[f,M]=a.useState(null),[u,v]=a.useState(!1),[m,p]=a.useState(null),S=a.useMemo(()=>!i||i.length===0?bs:bs.filter(b=>i.includes(b.id)),[i]),y=a.useMemo(()=>S.flatMap(b=>b.topics.map(L=>({id:L.id,name:L.name,unit:L.unit,subject:b.name,subjectId:b.id}))),[S]),W=a.useMemo(()=>y.filter(b=>{const L=o==="all"||b.subject===o,B=!l||b.name.toLowerCase().includes(l.toLowerCase())||b.unit.toLowerCase().includes(l.toLowerCase())||b.subject.toLowerCase().includes(l.toLowerCase());return L&&B}),[y,o,l]);a.useEffect(()=>{t&&(v(!0),dl(t).then(M).catch(console.error).finally(()=>v(!1)))},[t]);const j=f?.quizzesCompleted??0,E=f?.totalXPEarned??n?.totalXP??0,_=f?.averageScore??0,D=a.useCallback(async b=>{if(!(!t||m)){p(b.id);try{const L={Easy:"Practice",Medium:"Challenge",Hard:"Mastery"},B=await ea({userId:t,subject:b.subject,competency:b.name,difficulty:L[d],count:5}),se={id:B.session_id,title:`Practice Quiz: ${b.name} (AI)`,subject:b.subject,difficulty:d,questions:B.questions.length,duration:"10 min",xpReward:d==="Hard"?75:d==="Medium"?50:25,type:"practice",loadedQuestions:B.questions.map(C=>({id:C.id,questionType:"multiple_choice",question:C.question,options:C.options,correctAnswer:C.options[C.correct_index],bloomLevel:["remember","understand","apply","analyze"].includes(C.bloomsLevel?.toLowerCase()||"")?C.bloomsLevel.toLowerCase():"understand",difficulty:d.toLowerCase(),topic:b.name,subject:b.subject,points:10,explanation:C.explanation})),generatedQuizId:B.session_id,source:"ai_generated",completed:!1,locked:!1};s?.(se)}catch(L){console.error("Failed to generate practice quiz:",L)}finally{p(null)}}},[t,d,m,s]);return e.jsxs("div",{className:"px-4 sm:px-6 xl:px-10 py-4 sm:py-6",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2 sm:gap-4 mb-6",children:[e.jsxs(k.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-sky-700 to-sky-500 rounded-xl sm:rounded-2xl p-3 sm:p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-1 sm:mb-3 gap-1 sm:gap-0",children:[e.jsxs("div",{className:"w-8 h-8 sm:w-12 sm:h-12 bg-white/20 rounded-lg sm:rounded-xl flex items-center justify-center shrink-0",children:[e.jsx(Tt,{size:16,className:"sm:hidden"}),e.jsx(Tt,{size:24,className:"hidden sm:block"})]}),e.jsx("span",{className:"text-xl sm:text-3xl font-bold",children:j})]}),e.jsx("p",{className:"text-[10px] sm:text-sm font-medium text-sky-100 leading-tight",children:"Quizzes Completed"})]}),e.jsxs(k.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-rose-500 to-rose-600 rounded-xl sm:rounded-2xl p-3 sm:p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-1 sm:mb-3 gap-1 sm:gap-0",children:[e.jsxs("div",{className:"w-8 h-8 sm:w-12 sm:h-12 bg-white/20 rounded-lg sm:rounded-xl flex items-center justify-center shrink-0",children:[e.jsx(Xe,{size:16,className:"sm:hidden"}),e.jsx(Xe,{size:24,className:"hidden sm:block"})]}),e.jsx("span",{className:"text-xl sm:text-3xl font-bold",children:E.toLocaleString()})]}),e.jsx("p",{className:"text-[10px] sm:text-sm font-medium text-cyan-100 leading-tight",children:"Total XP Earned"})]}),e.jsxs(k.div,{whileHover:{scale:1.02},className:"bg-gradient-to-br from-indigo-600 to-indigo-700 rounded-xl sm:rounded-2xl p-3 sm:p-5 text-white shadow-lg",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-1 sm:mb-3 gap-1 sm:gap-0",children:[e.jsxs("div",{className:"w-8 h-8 sm:w-12 sm:h-12 bg-white/20 rounded-lg sm:rounded-xl flex items-center justify-center shrink-0",children:[e.jsx(et,{size:16,className:"sm:hidden"}),e.jsx(et,{size:24,className:"hidden sm:block"})]}),e.jsxs("span",{className:"text-xl sm:text-3xl font-bold",children:[Math.round(_),"%"]})]}),e.jsx("p",{className:"text-[10px] sm:text-sm font-medium text-sky-100 leading-tight",children:"Average Score"})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 mb-6",children:[e.jsxs("select",{value:o,onChange:b=>r(b.target.value),className:"w-full sm:w-auto px-3 sm:px-4 py-2 sm:py-2.5 bg-white border-2 border-[#dde3eb] rounded-xl text-xs sm:text-sm font-bold text-[#0a1628] focus:border-indigo-600 focus:outline-none",children:[e.jsx("option",{value:"all",children:"All Subjects"}),S.map(b=>e.jsx("option",{value:b.name,children:b.name},b.id))]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 bg-white rounded-xl p-1 shadow-sm",children:[e.jsx("span",{className:"px-2 text-xs font-bold text-slate-400",children:"Difficulty:"}),["Easy","Medium","Hard"].map(b=>e.jsx("button",{onClick:()=>x(b),className:`px-3 py-1.5 rounded-lg text-xs font-bold transition-all whitespace-nowrap ${d===b?b==="Easy"?"bg-green-500 text-white shadow-sm":b==="Medium"?"bg-orange-500 text-white shadow-sm":"bg-red-500 text-white shadow-sm":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:b},b))]})]}),m&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl p-6 flex flex-col items-center gap-3 shadow-xl",children:[e.jsx(Hs,{size:36,className:"animate-spin text-indigo-600"}),e.jsx("p",{className:"font-bold text-slate-700",children:"Generating Quiz..."}),e.jsx("p",{className:"text-sm text-slate-500",children:"AI is crafting questions from curriculum"})]})}),e.jsxs("div",{className:"pr-2 pb-4 rounded-[2rem] border border-slate-200 shadow-inner relative",style:{backgroundImage:"radial-gradient(#CBD5E1 1px, transparent 1px)",backgroundSize:"24px 24px",backgroundPosition:"-12px -12px",backgroundColor:"#FAFAFA"},children:[e.jsx("div",{className:"absolute left-12 top-0 bottom-0 w-0.5 bg-rose-200/60 pointer-events-none z-0"}),e.jsx("div",{className:"absolute left-[54px] top-0 bottom-0 w-px bg-rose-100/40 pointer-events-none z-0"}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-5 p-4 md:p-6 relative z-10",children:W.map((b,L)=>e.jsx(k.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:L*.03},onClick:()=>D(b),className:`bg-white/90 backdrop-blur-sm rounded-2xl p-4 md:p-5 border-2 relative select-none transition-all duration-300 ${m===b.id?"border-indigo-300 opacity-80 cursor-wait":m?"border-slate-200 opacity-60 cursor-not-allowed":"border-slate-200 shadow-sm hover:border-indigo-300 hover:shadow-md cursor-pointer"} group`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3 md:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 md:gap-4 flex-1",children:[(()=>{const{icon:B,bg:se}=ul(b.unit);return e.jsx("div",{className:`w-10 h-10 md:w-12 md:h-12 rounded-xl flex items-center justify-center shrink-0 shadow-sm transform group-hover:rotate-3 transition-transform ${se} text-white`,children:e.jsx(B,{size:18})})})(),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsxs("span",{className:`px-2 py-0.5 rounded-[6px] text-[9px] md:text-[10px] font-black uppercase tracking-wider ${d==="Easy"?"bg-green-100 text-green-700":d==="Medium"?"bg-orange-100 text-orange-700":"bg-red-100 text-red-700"}`,children:["AI ","•"," ",d]}),e.jsx("span",{className:"w-1.5 h-1.5 md:w-2 md:h-2 rounded-full bg-emerald-500 animate-pulse"})]}),e.jsx("h3",{className:"font-bold text-[14px] md:text-[16px] leading-tight mb-1 md:mb-1.5 text-[#0a1628] transition-colors",children:b.name}),e.jsxs("p",{className:"text-[11px] md:text-[12px] text-slate-500 mb-1.5 line-clamp-1",children:[b.subject," — ",b.unit]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-3 text-[11px] md:text-[12px] font-bold text-slate-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{size:12})," 5 Qs"]}),e.jsx("span",{className:"hidden sm:inline",children:"•"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Nt,{size:12})," 10 min"]}),e.jsx("span",{className:"hidden sm:inline",children:"•"}),e.jsxs("span",{className:"flex items-center gap-1 text-rose-500",children:[e.jsx(ls,{size:12})," +",d==="Hard"?75:d==="Medium"?50:25," XP"]})]})]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx("div",{className:`px-3 py-1.5 md:px-4 md:py-2 rounded-xl text-[11px] md:text-[12px] font-black uppercase tracking-wider shadow-sm transition-all ${m===b.id?"bg-indigo-100 text-indigo-600":"bg-indigo-500 text-white group-hover:bg-indigo-600 shadow-indigo-200"}`,children:m===b.id?"Loading...":"Start"})})]})},b.id))}),W.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-slate-500 relative z-10",children:[e.jsx(et,{size:48,className:"mb-3"}),e.jsx("p",{className:"font-medium",children:"No topics found"}),e.jsx("p",{className:"text-sm",children:"Try adjusting your filters or search query"})]})]})]})},hl=` - @keyframes head-sway { - 0%, 100% { transform: rotate(-2deg) translateY(0); } - 50% { transform: rotate(2deg) translateY(-2px); } - } - @keyframes horn-left-wiggle { - 0%, 100% { transform: rotate(-4deg); } - 50% { transform: rotate(4deg); } - } - @keyframes horn-right-wiggle { - 0%, 100% { transform: rotate(4deg); } - 50% { transform: rotate(-4deg); } - } - @keyframes blink { - 0%, 90%, 100% { transform: scaleY(1); } - 95% { transform: scaleY(0.1); } - } - @keyframes mouth-talk { - 0%, 100% { transform: scaleY(1) scaleX(1); } - 25% { transform: scaleY(1.1) scaleX(0.98); } - 50% { transform: scaleY(0.9) scaleX(1.02); } - 75% { transform: scaleY(1.05) scaleX(0.98); } - } - .animate-head-sway { - transform-origin: 50% 75%; - animation: head-sway 4s ease-in-out infinite; - } - .animate-horn-left { - transform-origin: 50% 45%; - animation: horn-left-wiggle 4s ease-in-out infinite; - } - .animate-horn-right { - transform-origin: 50% 45%; - animation: horn-right-wiggle 4s ease-in-out infinite; - } - .animate-blink { - transform-origin: 50% 45%; - animation: blink 3.7s ease-in-out infinite; - } - .animate-mouth { - transform-origin: 50% 55%; - animation: mouth-talk 3s ease-in-out infinite; - } -`,Ls=({assessmentDismissed:t,initialAssessmentCompleted:s})=>{const l="absolute inset-0 w-full h-full object-contain",[i,n]=a.useState(!1);a.useEffect(()=>{t&&!s&&!sessionStorage.getItem("mathpulse_assessment_reminder_shown")?n(!0):n(!1)},[t,s]);const o=()=>{sessionStorage.setItem("mathpulse_assessment_reminder_shown","true"),n(!1),window.dispatchEvent(new CustomEvent("mathpulse:open-assessment"))};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:hl}),e.jsxs("div",{className:"relative w-full h-[250px] flex items-end justify-center drop-shadow-sm select-none pointer-events-none",children:[i&&e.jsxs(k.div,{initial:{opacity:0,scale:.8,x:10},animate:{opacity:1,scale:1,x:0},className:"absolute top-0 right-0 z-50 max-w-[180px] bg-white rounded-2xl shadow-lg border border-[#dde3eb] p-3 cursor-pointer pointer-events-auto",onClick:o,children:[e.jsx("p",{className:"text-[11px] font-bold text-[#0a1628] leading-snug",children:"Psst! Complete your assessment for a personalized path!"}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-purple-500 rounded-full animate-pulse"}),e.jsx("span",{className:"text-[10px] text-[#5a6578] font-medium",children:"Tap to start"})]}),e.jsx("div",{className:"absolute -bottom-2 left-4 w-3 h-3 bg-white border-r border-b border-[#dde3eb] rotate-45"})]}),e.jsx("img",{src:"/mascot/modules_avatar_body.png",alt:"Desk setup",className:`${l} z-10`}),e.jsxs("div",{className:`${l} z-20 animate-head-sway`,children:[e.jsx("img",{src:"/mascot/modules_left_horn.png",alt:"Left Horn",className:`${l} z-0 animate-horn-left`}),e.jsx("img",{src:"/mascot/modules_right_horn.png",alt:"Right Horn",className:`${l} z-0 animate-horn-right`}),e.jsx("img",{src:"/mascot/modules_head.png",alt:"Mascot Head",className:`${l} z-[1]`}),e.jsx("img",{src:"/mascot/modules_eyes.png",alt:"Eyes",className:`${l} z-[2] animate-blink`}),e.jsx("img",{src:"/mascot/modules_mouth.png",alt:"Mouth",className:`${l} z-[3] animate-mouth`})]})]})]})},Ds={common:"bg-slate-100 text-slate-500",rare:"bg-blue-50 text-blue-500",epic:"bg-amber-50 text-amber-500"},Fs=["bg-[#1FA7E1]/80 text-white","bg-[#9956DE]/80 text-white","bg-[#FFB356]/90 text-white","bg-[#7274ED]/80 text-white","bg-[#1FA7E1]/80 text-white","bg-[#9956DE]/80 text-white","bg-gradient-to-r from-[#FFB356] to-[#FF8C00] text-white"],fl=({isOpen:t,onClose:s,onClaim:l,weekRewards:i,todayReward:n,canClaim:o,isClaiming:r,claimedDays:d,currentDayIndex:x,timeUntilReset:f})=>{const[M,u]=a.useState(!1);if(!t)return null;const v=()=>{if(!o||M)return;u(!0),n?.rarity==="epic"?gs({particleCount:150,spread:80,origin:{y:.6},colors:["#FFD700","#FFA500","#FF8C00","#FF6B6B","#4ade80"]}):gs({particleCount:100,spread:70,origin:{y:.6},colors:["#FFD700","#FFA500","#FF8C00"]}),setTimeout(()=>{u(!1),l()},1200)},m=E=>E+1,p=E=>E===x,S=E=>d.includes(E),y=E=>E>x,W=i.slice(0,6),j=i[6];return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-8",children:[e.jsx(st,{children:t&&e.jsx(k.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-slate-900/60 backdrop-blur-sm",onClick:s})}),e.jsxs(k.div,{initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},className:"relative w-full max-w-[420px] bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] shadow-2xl flex flex-col items-center p-5 overflow-visible",children:[e.jsxs("div",{className:"absolute -top-6 w-[85%] h-12 bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] rounded-xl shadow-lg flex items-center justify-center z-20",children:[e.jsx("div",{className:"absolute -left-2.5 -z-10 w-5 h-8 bg-[#633299] rounded-l-full rotate-12 top-1.5"}),e.jsx("div",{className:"absolute -right-2.5 -z-10 w-5 h-8 bg-[#10709b] rounded-r-full -rotate-12 top-1.5"}),e.jsx("h2",{className:"text-white font-black text-lg tracking-wide uppercase drop-shadow-sm font-display",children:"Daily Rewards"})]}),e.jsx("button",{onClick:s,className:"absolute -right-3 -top-3 w-8 h-8 bg-white hover:bg-slate-100 border border-slate-200 text-slate-500 hover:text-slate-800 rounded-full flex items-center justify-center z-30 shadow-md transition-transform hover:scale-105 active:scale-95",children:e.jsx(Je,{size:16,strokeWidth:3})}),e.jsxs("div",{className:"mt-6 mb-2 text-center w-full",children:[e.jsx("h3",{className:"text-xl font-bold text-slate-800 font-display mt-2",children:"Welcome Back!"}),e.jsx("p",{className:"text-slate-500 font-medium text-xs mt-0.5",children:"Claim your daily reward for today."})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 w-full mb-5 relative z-10",children:[W.map((E,_)=>{const D=m(_),b=S(_),L=p(_),B=y(_);return e.jsxs("div",{className:`relative rounded-xl flex flex-col overflow-hidden border-[1.5px] transition-all ${L&&!b?"border-amber-400 shadow-[0_0_15px_rgba(251,191,36,0.25)] scale-105 z-10 bg-amber-50":b?"border-[#dde3eb] bg-slate-200/50":"border-[#dde3eb] bg-white"}`,children:[e.jsxs("div",{className:`py-0.5 text-center font-black text-[10px] uppercase tracking-wider ${L&&!b?"bg-amber-400 text-amber-900":Fs[_]}`,children:["Day ",D]}),e.jsx("div",{className:"absolute top-5 right-1 z-10",children:e.jsx("span",{className:`text-[8px] font-bold uppercase px-1 rounded ${Ds[E.rarity]}`,children:E.rarity})}),e.jsxs("div",{className:"flex-1 p-2 flex flex-col items-center justify-center relative min-h-[75px]",children:[b&&e.jsxs(k.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",bounce:.5},className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"w-12 h-12 rounded-full bg-emerald-200/50"})}),e.jsxs("div",{className:"relative w-14 h-14 rounded-full border-[3px] border-emerald-500 bg-emerald-100 flex items-center justify-center transform -rotate-12 shadow-lg",children:[e.jsx(Vs,{className:"w-8 h-8 text-emerald-600"}),e.jsx("div",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 bg-emerald-500 rounded-md px-2 py-0.5 border-2 border-emerald-300 shadow-md",children:e.jsx("span",{className:"text-[9px] font-black text-white uppercase tracking-wider leading-none whitespace-nowrap",children:"Claimed"})})]})]}),B&&e.jsx("div",{className:"absolute top-1 right-1 bg-slate-200 rounded-full p-0.5 z-10",children:e.jsx(Os,{size:8,className:"text-slate-400"})}),e.jsxs("div",{className:`flex flex-col items-center transition-all w-full ${b?"opacity-30 grayscale":""}`,children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center border-2 mb-1",style:{backgroundColor:E.color+"20",borderColor:E.color+"40"},children:e.jsx("span",{className:"text-lg",children:E.icon})}),e.jsx("div",{className:`font-black text-xs leading-none mt-0.5 text-center ${L?"text-amber-600":b?"text-slate-500":"text-slate-600"}`,children:E.label})]})]})]},E.id)}),j&&e.jsxs("div",{className:`col-span-3 relative rounded-xl flex flex-col overflow-hidden border-[1.5px] transition-all mt-1 ${p(6)&&!S(6)?"border-amber-400 shadow-[0_0_20px_rgba(251,191,36,0.3)] scale-[1.02] z-10 bg-amber-50":S(6)?"border-[#dde3eb] bg-slate-200/50":"border-[#dde3eb] bg-white"}`,children:[e.jsx("div",{className:`py-1 text-center font-black text-[10px] uppercase tracking-widest ${p(6)&&!S(6)?"bg-amber-400 text-amber-900":Fs[6]}`,children:"Day 7 • Epic Reward"}),e.jsx("div",{className:"absolute top-6 right-2 z-10",children:e.jsx("span",{className:`text-[8px] font-bold uppercase px-1.5 py-0.5 rounded ${Ds[j.rarity]}`,children:j.rarity})}),e.jsxs("div",{className:"flex items-center justify-center gap-5 p-3 relative",children:[S(6)&&e.jsxs(k.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",bounce:.5},className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-rose-200/50"})}),e.jsxs("div",{className:"relative w-20 h-20 rounded-full border-[4px] border-rose-500 bg-rose-100 flex items-center justify-center transform rotate-12 shadow-lg",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"Claimed",className:"w-14 h-14 object-contain drop-shadow-md"}),e.jsx("div",{className:"absolute -bottom-3 left-1/2 -translate-x-1/2 bg-rose-500 rounded-md px-2.5 py-1 border-2 border-rose-300 shadow-md",children:e.jsx("span",{className:"text-[10px] font-black text-white uppercase tracking-wider leading-none whitespace-nowrap",children:"Claimed"})})]})]}),e.jsxs("div",{className:`flex items-center justify-center gap-5 w-full transition-all ${S(6)?"opacity-30 grayscale":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center border-2 shadow-sm mb-0.5",style:{backgroundColor:j.color+"20",borderColor:j.color+"40"},children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx("span",{className:`font-black text-sm ${p(6)?"text-amber-600":"text-slate-600"}`,children:j.label})]}),j.rarity==="epic"&&e.jsxs("div",{className:"relative mt-1",children:[e.jsx("div",{className:"w-14 h-14 bg-purple-50 rounded-xl flex items-center justify-center border-2 border-purple-200 shadow-sm",children:e.jsx(Da,{className:"w-8 h-8 text-purple-500 drop-shadow-md"})}),e.jsx("div",{className:"absolute -right-5 -bottom-4 w-14 h-14 bg-white rounded-xl p-1 border-2 border-amber-300 shadow-lg transform rotate-[-5deg]",children:e.jsx("img",{src:"/avatar/crown_thumbnail.png",alt:"Crown",className:"w-full h-full object-contain drop-shadow-md"})})]})]})]})]})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2 text-xs text-slate-400",children:[e.jsx(jr,{size:14}),e.jsx("span",{className:"font-mono font-medium",children:f}),e.jsx("span",{children:"until next reset"})]}),e.jsx(k.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:v,disabled:!o||r||M,className:`w-[85%] py-3 rounded-full font-black text-base tracking-wide uppercase shadow-lg transition-all mt-2 ${!o||r||M?"bg-slate-200 text-slate-400 cursor-not-allowed border border-slate-300":"bg-gradient-to-r from-[#FFB356] to-[#FF8C00] text-white hover:from-[#FFA500] hover:to-[#FF7F00] border-b-4 border-[#e67e00]"}`,children:r||M?"Claiming...":o?"Claim!":"Claimed"})]})]})};function bl(t){const[s,l]=a.useState({difficulty:"normal",loading:!0});return a.useEffect(()=>{if(!t){l({difficulty:"normal",loading:!1});return}const i=kt(tt,"users",t);return ss(i,o=>{if(!o.exists()){l({difficulty:"normal",loading:!1});return}const d=o.data()?.moduleDifficulty||"normal";l({difficulty:["normal","easier","remedial"].includes(d)?d:"normal",loading:!1})},o=>{console.error("[useModuleDifficulty] snapshot error:",o),l({difficulty:"normal",loading:!1})})},[t]),s}function gl(t,s){return s==="normal"?t:s==="easier"?t.filter(l=>{const i=l.tags||[],n=l.difficulty||"";return i.some(o=>["foundation","basic","introductory"].includes(o.toLowerCase()))||["foundation","basic","introductory"].includes(n.toLowerCase())||!i.includes("advanced")&&!n.toLowerCase().includes("advanced")}):s==="remedial"?t.filter(l=>{const i=l.tags||[],n=l.difficulty||"";return i.some(o=>["remedial","review","catch-up"].includes(o.toLowerCase()))||["remedial","review","catch-up"].includes(n.toLowerCase())}):t}const yl=new Set([7,14,30,60,100]),Et={lastClaimedDate:"",lastClaimedWeekSeed:0,claimedDays:[],currentStreak:0,longestStreak:0,totalClaimed:0,hintTokens:0,streakShields:0,activeMultiplier:null};function wl(t){if(t<=0)return"00:00:00";const s=Math.floor(t/1e3),l=Math.floor(s/3600),i=Math.floor(s%3600/60),n=s%60;return`${String(l).padStart(2,"0")}:${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function jl(){const t=is();return t.setDate(t.getDate()-1),ns(t)}function ta(t){return t?new Date(t.expiresAt).getTime()>Date.now():!1}function sa(t){return kt(tt,"users",t,"dailyRewards",t)}function vl(t){return kt(tt,"users",t)}async function Rs(t){try{const s=sa(t),l=await Vt(s);if(!l.exists())return{...Et};const i=l.data(),n=os();return i.lastClaimedWeekSeed&&i.lastClaimedWeekSeed!==n?{...i,claimedDays:[],lastClaimedWeekSeed:n}:{...Et,...i,activeMultiplier:i.activeMultiplier&&ta(i.activeMultiplier)?i.activeMultiplier:null}}catch(s){return console.error("[dailyRewardService] Error getting state:",s),{...Et}}}function Nl(t){const s=ns();return t.lastClaimedDate!==s}async function kl(t){const s=ns(),l=os(),i=cs(),o=ds()[i];if(!o)throw new Error(`No reward found for day index ${i}`);try{const r=await na(tt,async x=>{const f=sa(t),M=vl(t),u=await x.get(f),v=await x.get(M);let m;if(u.exists()?m={...Et,...u.data()}:(m={...Et,lastClaimedWeekSeed:l},x.set(f,m)),m.lastClaimedWeekSeed!==l&&(m.claimedDays=[],m.lastClaimedWeekSeed=l),m.lastClaimedDate===s)return{code:"ALREADY_CLAIMED",state:m};let p=m.currentStreak,S=!1;if(!m.lastClaimedDate||m.currentStreak===0)p=1;else{const _=jl();m.lastClaimedDate===_?p=m.currentStreak+1:m.streakShields>0?(m.streakShields-=1,p=m.currentStreak+1,S=!0):p=1}const y=Math.max(m.longestStreak,p);let W=0,j=1;switch(o.type){case"xp":{const _=typeof o.value=="number"?o.value:parseInt(o.value,10)||0;j=ta(m.activeMultiplier)?m.activeMultiplier?.multiplier??1:1,W=Math.floor(_*j);break}case"hint_token":{const _=typeof o.value=="number"?o.value:parseInt(o.value,10)||0;m.hintTokens+=_;break}case"streak_shield":{const _=typeof o.value=="number"?o.value:parseInt(o.value,10)||0;m.streakShields+=_;break}case"xp_multiplier":{const _=typeof o.value=="number"?o.value:parseInt(o.value,10)||60,D=o.id.includes("2")?2:1.5,b=new Date;b.setMinutes(b.getMinutes()+_),m.activeMultiplier={multiplier:D,expiresAt:b.toISOString()};break}case"badge_unlock":break}const E=[...m.claimedDays,i];return m.lastClaimedDate=s,m.currentStreak=p,m.longestStreak=y,m.totalClaimed+=1,x.set(f,m,{merge:!0}),v.exists()&&x.update(M,{hintTokens:m.hintTokens,streakShields:m.streakShields,activeMultiplier:m.activeMultiplier,lastClaimedDate:m.lastClaimedDate,updatedAt:ia()}),{code:"SUCCESS",state:m,newClaimedDays:E,newStreak:p,newLongestStreak:y,xpAwarded:W,multiplierApplied:j,streakPreserved:S}});if(r.code==="ALREADY_CLAIMED")return{success:!1,reward:o,dayIndex:i,streakAfter:r.state.currentStreak,longestStreakAfter:r.state.longestStreak,hintTokensAfter:r.state.hintTokens,streakShieldsAfter:r.state.streakShields,streakPreserved:!1,xpAwarded:0,multiplierApplied:1,isMilestone:!1,error:"Already claimed today"};if(r.xpAwarded>0)try{await ga(t,r.xpAwarded,"daily_reward",`Daily Reward Day ${i+1}! +${r.xpAwarded} XP`)}catch(x){console.error("[dailyRewardService] Error awarding XP:",x)}if(o.type==="badge_unlock"&&typeof o.value=="string")try{await Qs(t,o.value)}catch(x){console.error("[dailyRewardService] Error unlocking avatar item:",x)}const d=yl.has(r.newStreak);return{success:!0,reward:o,dayIndex:i,streakAfter:r.newStreak,longestStreakAfter:r.newLongestStreak,hintTokensAfter:r.state.hintTokens,streakShieldsAfter:r.state.streakShields,streakPreserved:r.streakPreserved,xpAwarded:r.xpAwarded,multiplierApplied:r.multiplierApplied,isMilestone:d}}catch(r){throw console.error("[dailyRewardService] Error claiming daily reward:",r),r}}function Sl(t){const[s,l]=a.useState(null),[i,n]=a.useState(!1),[o,r]=a.useState(!1),[d,x]=a.useState(null),[f,M]=a.useState(null),[u,v]=a.useState("00:00:00"),m=a.useRef(null),p=a.useMemo(()=>ds(),[]),S=a.useMemo(()=>Mr(),[]),y=a.useCallback(async()=>{if(!t){l(null);return}try{M(null);const D=await Rs(t);l(D)}catch(D){const b=D instanceof Error?D.message:"Failed to load rewards";M(b),console.error("[useDailyReward] refresh error:",D)}},[t]);a.useEffect(()=>{y()},[y]),a.useEffect(()=>{const D=()=>{const L=Sr().getTime()-Date.now();v(wl(L))};return D(),m.current=setInterval(D,1e3),()=>{m.current&&(clearInterval(m.current),m.current=null)}},[]);const W=a.useMemo(()=>!s||i?!1:Nl(s),[s,i]),j=a.useMemo(()=>!s?.activeMultiplier||new Date(s.activeMultiplier.expiresAt).getTime()<=Date.now()?null:s.activeMultiplier,[s?.activeMultiplier]),E=a.useCallback(async()=>{if(!(!t||!W)){n(!0),M(null);try{const D=await kl(t);if(x(D),D.success){r(!0);const b=await Rs(t);l(b)}else M(D.error||"Claim failed")}catch(D){const b=D instanceof Error?D.message:"Claim failed";M(b),console.error("[useDailyReward] claim error:",D)}finally{n(!1)}}},[t,W]),_=a.useCallback(()=>{r(!1)},[]);return{weekRewards:p,todayReward:S,canClaim:W,isClaiming:i,claimedDays:s?.claimedDays??[],currentStreak:s?.currentStreak??0,longestStreak:s?.longestStreak??0,totalClaimed:s?.totalClaimed??0,hintTokens:s?.hintTokens??0,streakShields:s?.streakShields??0,activeMultiplier:j,timeUntilReset:u,showModal:o,lastClaimResult:d,error:f,claim:E,dismissModal:_,refresh:y}}const Cl=["all","Q1","Q2","Q3","Q4"],yn=({onEarnXP:t,atRiskSubjects:s=[],priorityTopics:l=[],initialModuleId:i=null,isInQuizMode:n=!1,setIsInQuizMode:o,hasCompletedDiagnostic:r=!1})=>{const{userProfile:d,currentUser:x}=$t(),[f,M]=a.useState(()=>{const c=sessionStorage.getItem("mathpulse_modules_tab");return c==="practice"||c==="recommended"||c==="teacher_uploaded"?(sessionStorage.removeItem("mathpulse_modules_tab"),c):"modules"}),u=d,v=u?.grade,m=ya(v);Fa(m);const[p,S]=a.useState(""),[y,W]=a.useState("all"),[j,E]=a.useState("all"),[_,D]=a.useState("all"),[b,L]=a.useState(!1),[B,se]=a.useState(null),[C,re]=a.useState(null),ge=a.useMemo(()=>{const c=u?.learnerCurriculumAssignments?.subjects??u?.assignedSubjects??u?.curriculumAssignedSubjects??[];return Array.isArray(c)?c:[]},[u]),{difficulty:He}=bl(x?.uid||null),ce=a.useMemo(()=>{const c=wa(m,ge);return gl(c,He)},[m,ge,He]),Oe=i&&ce.find(c=>c.id===i)||null,[Se,U]=a.useState(Oe),[ve,Qe]=a.useState(null),Me=je.useRef(null),[Ve,Re]=a.useState(null),[We,h]=a.useState(!1),[A,T]=a.useState(null),[G,$]=a.useState(!1),[K,ne]=a.useState([]),[_e,fe]=a.useState(!1);a.useEffect(()=>{if(f!=="teacher_uploaded"||!tt)return;fe(!0);const c=ss(oa(da(tt,"modules"),ca("moduleType","==","teacher_uploaded")),P=>{const Q=P.docs.map(ie=>({...ie.data(),moduleId:ie.id}));ne(Q),fe(!1)},P=>{console.error("Error fetching teacher modules:",P),fe(!1)});return()=>c()},[f]);const[be,Ee]=a.useState(!1),{weekRewards:R,todayReward:ee,canClaim:xe,isClaiming:$e,claimedDays:at,timeUntilReset:St,claim:bt,lastClaimResult:Ue}=Sl(d?.uid??null);a.useEffect(()=>{if(!d?.uid)return;let c=!1;const P=async Z=>{c||(xe||Z)&&Ee(!0)},Q=Z=>{Z.detail?.tab==="Modules"&&P(!0)},ie=setTimeout(()=>P(),500);return window.addEventListener("mathpulse:navigate",Q),()=>{c=!0,clearTimeout(ie),window.removeEventListener("mathpulse:navigate",Q)}},[d?.uid,xe]);const Ct=async()=>{if(d?.uid)try{await bt(),Ue?.success&&(Ca({userId:d.uid,type:"daily_checkin",title:"Daily Reward Claimed!",message:`You earned ${Ue.reward.label} and kept your streak alive!`,metadata:{rewardId:Ue.reward.id,streakDay:Ue.dayIndex+1}}).catch(console.error),Ue.reward.rarity==="epic"&&Qs(d.uid,"acc_crown").then(()=>ut.success("Epic reward unlocked!")).catch(console.error)),setTimeout(()=>Ee(!1),1e3)}catch(c){const P=c instanceof Error?c.message:"";console.error("Failed to claim daily reward:",c),P.includes("Already claimed")?ut.info("You already claimed your reward today!"):ut.error("Failed to claim daily reward. Please try again.")}};a.useEffect(()=>{if(i){const c=ce.find(P=>P.id===i);c&&U(c)}},[i,ce]),a.useEffect(()=>{d?.uid&&($(!0),ja(d.uid).then(c=>{T(c)}).catch(c=>{console.error("Failed to load competency profile:",c)}).finally(()=>{$(!1)}))},[d?.uid]);const Ne=a.useMemo(()=>{const c=l.length>0?l:s.map(Q=>va(Q)).filter(Q=>Q!==null),P=new Set;return c.filter(Q=>P.has(Q)?!1:(P.add(Q),!0))},[l,s]),{data:de=[]}=la({queryKey:Na.modules(m,Ne),enabled:!0,staleTime:600*1e3,gcTime:1800*1e3,queryFn:async()=>{const c=ce;if(Ne.length===0)return c;const P=new Map(Ne.map((Q,ie)=>[za[Q],ie]));return[...c].sort((Q,ie)=>{const Z=P.get(Q.id)??Number.POSITIVE_INFINITY,q=P.get(ie.id)??Number.POSITIVE_INFINITY;return Z-q})}}),rt=a.useMemo(()=>{const c=new Set;return de.forEach(P=>c.add(P.competency_group)),Array.from(c)},[de]),lt=a.useMemo(()=>{const c=p.trim().toLowerCase(),P=de.filter(Q=>{const ie=!c||Q.title.toLowerCase().includes(c),Z=!c||Q.description.toLowerCase().includes(c),q=!c||Q.lessons.some(Pe=>Pe.title.toLowerCase().includes(c)),me=!c||Q.quizzes.some(Pe=>Pe.title.toLowerCase().includes(c)),Te=c?Q.competencies.some(Pe=>Pe.outcome.toLowerCase().includes(c)||Pe.code.toLowerCase().includes(c)):!0,Ae=y==="all"||Q.subjectId===y,ue=j==="all"||Q.quarter===j,le=_==="all"||Q.competency_group===_;return(ie||Z||q||me||Te)&&Ae&&ue&&le});if(A?.competencies){const Q=new Set(Object.entries(A.competencies).filter(([,Z])=>Z.score<50).map(([Z])=>Z)),ie=new Set(Object.entries(A.competencies).filter(([,Z])=>Z.score>=80).map(([Z])=>Z));return P.sort((Z,q)=>{const me=Z.competencies.map(ke=>ke.code),Te=q.competencies.map(ke=>ke.code),Ae=me.some(ke=>Q.has(ke))?1:0,ue=Te.some(ke=>Q.has(ke))?1:0,le=me.some(ke=>ie.has(ke))?1:0,Pe=Te.some(ke=>ie.has(ke))?1:0,gt=Ae*2+le;return ue*2+Pe-gt})}return P},[de,p,y,j,_,A]),ct=a.useMemo(()=>{const c=j==="all"?"All Quarters":j,P=y==="all"?"All Subjects":hs[y]?.label??"Subject";return`${m} · ${P} · ${c}`},[m,y,j]),zt=a.useMemo(()=>{const c=new Set(de.map(P=>P.subjectId));return Array.from(c)},[de]),Be=()=>{W("all"),E("all"),D("all"),S("")};a.useEffect(()=>{f!=="recommended"||Ne.length===0||(h(!0),ka({weakTopics:Ne.map(c=>fs[c]),subject:y!=="all"?y:"General Mathematics",userId:d?.uid}).then(c=>{Re(c.curriculumContext),h(!1)}).catch(()=>h(!1)))},[f,Ne]);const Ye=(c,P)=>{t&&t(P,`Quiz Completed! +${P} XP`)},Ke=async c=>{if(x?.uid)try{await Ra(x.uid,c),ut.success("You'll be notified when this module becomes available.")}catch{ut.error("Could not subscribe. Try again later.")}};return a.useEffect(()=>{o&&o(!!ve)},[ve,o]),ve?e.jsx(Ks,{quiz:ve,onClose:()=>{Me.current=null,Qe(null)},onComplete:Ye,onQuizEnd:Me.current??void 0,studentId:d?.uid}):Se?e.jsx(ml,{module:Se,onBack:()=>U(null),onEarnXP:t,isInQuizMode:n,setIsInQuizMode:o}):C?e.jsxs("div",{className:"h-full overflow-y-auto px-4 sm:px-6 xl:px-10 pb-8 scrollbar-hide scroll-smooth relative",children:[e.jsxs("button",{onClick:()=>re(null),className:"mb-4 inline-flex items-center gap-2 text-sm font-bold text-slate-600 hover:text-slate-900 transition-colors",children:[e.jsx(ht,{className:"rotate-180",size:16}),"Back to Modules"]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-[#F08386]/30 p-6 md:p-8",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("span",{className:"px-2 py-1 rounded-md bg-[#F08386]/12 border border-[#F08386]/30 text-[#F08386] text-xs font-bold",children:"Teacher Upload"}),C.quarter&&e.jsx("span",{className:"px-2 py-1 rounded-md bg-slate-100 text-slate-600 text-xs",children:C.quarter})]}),e.jsx("h1",{className:"text-2xl md:text-3xl font-display font-black text-slate-900 mb-2",children:C.title}),e.jsxs("p",{className:"text-sm text-slate-600 mb-6",children:[C.subject," · ",C.gradeLevel]}),C.summary&&e.jsx("p",{className:"text-slate-700 text-base leading-relaxed mb-6",children:C.summary}),C.learningObjectives?.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-2",children:"Learning Objectives"}),e.jsx("ul",{className:"list-disc list-inside space-y-1 text-slate-700",children:C.learningObjectives.map((c,P)=>e.jsx("li",{children:c},P))})]}),C.sections?.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-3",children:"Sections"}),e.jsx("div",{className:"space-y-3",children:C.sections.map((c,P)=>e.jsxs("div",{className:"border border-slate-200 rounded-xl p-4",children:[e.jsx("h3",{className:"text-sm font-bold text-slate-800 mb-1",children:c.title}),e.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:c.content})]},P))})]}),C.practice?.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-3",children:"Practice Questions"}),e.jsx("div",{className:"space-y-3",children:C.practice.map((c,P)=>e.jsxs("div",{className:"border border-slate-200 rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-bold text-slate-800 mb-2",children:c.question}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-2",children:c.options.map((Q,ie)=>e.jsxs("div",{className:"text-xs text-slate-600 bg-slate-50 rounded-lg px-3 py-2",children:[Q.label,". ",Q.text]},ie))}),e.jsxs("p",{className:"text-xs text-emerald-700 font-semibold",children:["Answer: ",c.answer]}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:c.explanation})]},P))})]})]})]}):e.jsxs("div",{className:"h-full overflow-y-auto px-4 sm:px-6 xl:px-10 pb-8 scrollbar-hide scroll-smooth relative",onScroll:c=>L(c.currentTarget.scrollTop>100),children:[e.jsx(fl,{isOpen:be,onClose:()=>Ee(!1),onClaim:Ct,weekRewards:R,todayReward:ee,canClaim:xe,isClaiming:$e,claimedDays:at,currentDayIndex:cs(),timeUntilReset:St}),e.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center py-4 md:py-6 gap-4 md:gap-6",children:[e.jsxs("div",{className:"flex-1 max-w-3xl",children:[e.jsx("h1",{className:"text-[28px] md:text-[44px] font-display font-black text-[#202124] tracking-tight leading-[1.1] mb-3 md:mb-4",children:"Curriculum Modules"}),e.jsx("p",{className:"text-[#3c4043] text-[13px] md:text-[17px] leading-relaxed md:leading-[1.7] md:pr-10",children:"MathPulse AI loads modules directly from DepEd Strengthened SHS curriculum guides with AI-powered RAG lesson generation. Currently available: General Mathematics, Business Mathematics, and Statistics & Probability. Pre-Calculus and Basic Calculus modules are coming soon once teaching module PDFs are sourced."}),e.jsx("div",{className:"mt-4 flex items-center gap-3",children:e.jsx("div",{className:"inline-flex items-center rounded-full border border-sky-200 bg-sky-50 px-4 py-2 text-sm font-bold text-sky-900",children:ct})})]}),e.jsx("div",{className:"hidden lg:flex flex-shrink-0 items-center justify-end w-[350px]",children:e.jsx(Ls,{assessmentDismissed:d?.assessmentDismissed,initialAssessmentCompleted:d?.initialAssessmentCompleted})})]}),e.jsxs("div",{className:`sticky top-0 z-30 -mx-4 px-4 sm:-mx-6 sm:px-6 xl:-mx-10 xl:px-10 pt-3 pb-3 space-y-3 transition-colors duration-300 ${b?"bg-[#f8faff] border-b border-[#dde3eb] shadow-sm":"bg-transparent"}`,children:[e.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-3 w-full",children:[e.jsxs("div",{className:"relative flex-1 w-full",children:[e.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-[#5f6368]",children:e.jsx($a,{size:16,strokeWidth:2.5})}),e.jsx("input",{id:"modules-search",name:"modules-search","aria-label":"Search modules",type:"text",value:p,onChange:c=>S(c.target.value),placeholder:"Search modules, lessons, or assessments...",className:"w-full pl-10 pr-10 py-2 rounded-xl border border-[#dadce0] bg-white text-[#202124] text-[13px] font-medium focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all shadow-sm"}),!1]}),e.jsxs("div",{className:"flex flex-row overflow-x-auto no-scrollbar items-center gap-2 w-full lg:w-auto shrink-0 -mx-4 px-4 sm:mx-0 sm:px-0 pb-1 sm:pb-0",children:[e.jsxs("select",{value:y,onChange:c=>W(c.target.value),className:"shrink-0 rounded-xl border border-slate-200 bg-white pl-3 pr-8 py-2 text-xs font-semibold text-slate-700 focus:border-sky-400 focus:outline-none shadow-sm","aria-label":"Subject",children:[e.jsx("option",{value:"all",children:"All Subjects"}),zt.map(c=>e.jsx("option",{value:c,children:hs[c].label},c))]}),e.jsx("select",{value:j,onChange:c=>E(c.target.value),className:"shrink-0 rounded-xl border border-slate-200 bg-white pl-3 pr-8 py-2 text-xs font-semibold text-slate-700 focus:border-sky-400 focus:outline-none shadow-sm","aria-label":"Quarter",children:Cl.map(c=>e.jsx("option",{value:c,children:c==="all"?"All Quarters":c},c))}),e.jsxs("select",{value:_,onChange:c=>D(c.target.value),className:"shrink-0 rounded-xl border border-slate-200 bg-white pl-3 pr-8 py-2 text-xs font-semibold text-slate-700 focus:border-sky-400 focus:outline-none shadow-sm","aria-label":"Competency Group",children:[e.jsx("option",{value:"all",children:"All Competencies"}),rt.map(c=>e.jsx("option",{value:c,children:c},c))]}),e.jsxs("button",{type:"button",onClick:Be,className:"inline-flex shrink-0 items-center justify-center gap-1.5 rounded-xl border border-slate-200 bg-white px-3 py-2 text-xs font-bold text-slate-700 transition-colors hover:bg-slate-50 shadow-sm",children:[e.jsx(Ba,{size:14}),"Reset"]})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-3 mt-2",children:[e.jsx("div",{className:"flex items-center bg-slate-100/80 p-1 rounded-full border border-slate-200/60 shadow-inner gap-1 overflow-x-auto no-scrollbar w-full md:w-auto",children:[{id:"modules",label:"Modules",icon:Fe,color:"text-[#1FA7E1]"},{id:"recommended",label:"Recommended",icon:At,color:"text-[#75D06A]"},{id:"practice",label:"Practice",icon:et,color:"text-[#FFB356]"},{id:"teacher_uploaded",label:"Teacher Uploaded",icon:Sa,color:"text-[#F08386]"}].map(c=>{const P=f===c.id;return e.jsxs("button",{onClick:()=>M(c.id),className:`relative flex items-center gap-1.5 px-4 py-1.5 rounded-full text-[13px] font-bold transition-all duration-300 flex-shrink-0 ${P?"shadow-sm":"text-slate-500 hover:text-slate-700 hover:bg-slate-200/50"}`,children:[P&&e.jsx(k.div,{layoutId:"modulesTabBackground",className:"absolute inset-0 bg-white rounded-full shadow-[0_2px_15px_-3px_rgba(0,0,0,0.1)] border border-slate-100",transition:{type:"spring",bounce:.2,duration:.6}}),e.jsxs("span",{className:`relative z-10 flex items-center gap-1.5 ${P?c.color:""}`,children:[e.jsx(c.icon,{size:15,strokeWidth:P?2.5:2}),c.label]})]},c.id)})}),e.jsxs("div",{className:"flex items-center gap-2 ml-1",children:[f==="modules"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500",children:e.jsx(Aa,{size:15,strokeWidth:2.5})}),e.jsx("span",{className:"font-display font-black text-[15px] text-slate-700 tracking-tight whitespace-nowrap",children:"DepEd Strengthened SHS Modules"})]}),f==="recommended"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#75D06A]/10 flex items-center justify-center",children:e.jsx(qa,{size:15,className:"text-[#75D06A]"})}),e.jsx("span",{className:"font-display font-black text-[15px] text-slate-700 tracking-tight whitespace-nowrap",children:"Suggested Next"})]}),f==="practice"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#FFB356]/10 flex items-center justify-center",children:e.jsx(et,{size:15,className:"text-[#FFB356]"})}),e.jsx("span",{className:"font-display font-black text-[15px] text-slate-700 tracking-tight whitespace-nowrap",children:"Practice Center"})]}),f==="teacher_uploaded"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#F08386]/15 border border-[#F08386]/30 flex items-center justify-center text-[#F08386]",children:e.jsx(ys,{size:15,strokeWidth:2.5})}),e.jsx("span",{className:"font-display font-black text-[15px] text-slate-700 tracking-tight whitespace-nowrap",children:"Teacher Uploaded Modules"})]})]})]})]}),e.jsx("div",{className:"flex lg:hidden items-center justify-center w-full mt-2 mb-2",children:e.jsx(Ls,{assessmentDismissed:d?.assessmentDismissed,initialAssessmentCompleted:d?.initialAssessmentCompleted})}),e.jsxs("div",{className:"pt-4",children:[Ne.length>0&&e.jsxs("div",{className:"mb-4 rounded-2xl border border-amber-300 bg-amber-50 px-5 py-4 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"inline-flex items-center gap-2 text-sm font-black text-amber-900",children:[e.jsx(qs,{size:15}),"Assessment Focus Areas"]}),e.jsx("p",{className:"mt-1 text-sm text-amber-900/80",children:"Modules are currently prioritized by your latest diagnostic needs."})]}),e.jsxs("button",{type:"button",onClick:()=>M("recommended"),className:"inline-flex items-center gap-1.5 rounded-xl bg-amber-600 px-3 py-2 text-xs font-bold text-white transition-colors hover:bg-amber-700",children:["View Recommended",e.jsx(ht,{size:14})]})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:Ne.map((c,P)=>e.jsxs("span",{className:"rounded-full bg-white px-3 py-1 text-xs font-semibold text-amber-900 shadow-sm",children:[P+1,". ",fs[c]]},c))})]}),e.jsx(st,{mode:"wait",children:e.jsx(k.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},className:"pb-8 mt-4",children:f==="practice"?e.jsx(pl,{userId:d?.uid??"",onStartQuiz:c=>{Me.current=async(P,Q)=>{if(!(!d?.uid||!P.generatedQuizId))try{const ie=new Map((P.loadedQuestions||[]).map(me=>[me.id,me])),Z=Q.map(me=>{const Ae=ie.get(me.questionId)?.options?.findIndex(ue=>ue.trim().toLowerCase()===me.answer.trim().toLowerCase())??0;return{question_id:me.questionId,selected_index:Ae}}),q=await cl({session_id:P.generatedQuizId,userId:d.uid,answers:Z});ut.success(`Score: ${q.score_percent}% | Correct: ${q.correct_count}/${q.total} | +${q.xp_earned} XP`)}catch(ie){console.error(ie),ut.error("Failed to submit quiz results")}},Qe(c)},searchQuery:p}):f==="teacher_uploaded"?_e?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mt-6",children:[1,2,3].map(c=>e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 p-6 animate-pulse",children:[e.jsx("div",{className:"h-4 bg-slate-200 rounded w-3/4 mb-4"}),e.jsx("div",{className:"h-3 bg-slate-100 rounded w-1/2 mb-3"}),e.jsx("div",{className:"h-3 bg-slate-100 rounded w-5/6"})]},c))}):K.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"w-16 h-16 bg-[#F08386]/10 rounded-2xl flex items-center justify-center mx-auto mb-4",children:e.jsx(ys,{size:32,className:"text-[#F08386]"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"No Teacher-Uploaded Modules Yet"}),e.jsx("p",{className:"text-slate-500 text-sm",children:"Your teachers haven't uploaded any custom modules yet."})]}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 mt-6",children:K.map(c=>e.jsxs("div",{className:"bg-white rounded-2xl border border-[#F08386]/30 p-6 hover:border-[#F08386]/60 hover:shadow-md transition-all cursor-pointer",onClick:()=>re(c),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"px-2 py-1 rounded-md bg-[#F08386]/12 border border-[#F08386]/30 text-[#F08386] text-xs font-bold",children:"Teacher Upload"}),c.quarter&&e.jsx("span",{className:"px-2 py-1 rounded-md bg-slate-100 text-slate-600 text-xs",children:c.quarter})]}),e.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-2 line-clamp-2",children:c.title}),e.jsxs("p",{className:"text-sm text-slate-600 mb-3",children:[c.subject," · ",c.gradeLevel]}),c.summary&&e.jsx("p",{className:"text-xs text-slate-500 line-clamp-3",children:c.summary})]},c.moduleId))}):f==="modules"?e.jsx(zl,{modules:lt,onSelectModule:U,onPreviewSources:se,isAtRisk:Ne.length>0&&r,weakTopics:u?.assessmentResults?.weakTopics||[],onNotifyMe:Ke}):e.jsx(Ml,{modules:lt,fullPool:de,onSelectModule:U,onPreviewSources:se,isAtRisk:Ne.length>0&&r,learningPathContext:Ve,learningPathLoading:We,weakTopics:u?.assessmentResults?.weakTopics||[],onNotifyMe:Ke})},f)})]}),e.jsx(st,{children:B&&e.jsxs(k.aside,{initial:{opacity:0,x:24},animate:{opacity:1,x:0},exit:{opacity:0,x:24},transition:{duration:.25},className:"fixed inset-y-0 right-0 z-[80] w-full max-w-xl border-l border-slate-200 bg-white p-6 shadow-2xl",children:[e.jsxs("div",{className:"mb-4 flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-wide text-sky-700",children:"Curriculum Preview"}),e.jsx("h3",{className:"mt-1 text-xl font-black text-slate-900",children:B.title}),e.jsxs("p",{className:"mt-1 text-sm text-slate-600",children:[B.active_grade_level," · ",B.subject," · ",B.quarter]})]}),e.jsx("button",{type:"button",onClick:()=>se(null),className:"rounded-lg border border-slate-200 p-2 text-slate-500 hover:bg-slate-50",children:e.jsx(Je,{size:16})})]}),e.jsxs("div",{className:"space-y-4 overflow-y-auto pr-1",children:[e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-4",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500",children:"Competency Group"}),e.jsx("p",{className:"mt-1 text-sm font-semibold text-slate-800",children:B.competency_group})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500",children:"Performance Standard"}),e.jsx("p",{className:"mt-1 text-sm text-slate-700",children:B.performance_standard})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500",children:"Competencies"}),e.jsx("div",{className:"mt-2 space-y-2",children:B.competencies.map(c=>e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-slate-50 p-3",children:[e.jsx("p",{className:"text-xs font-black text-slate-600",children:c.code}),e.jsx("p",{className:"mt-1 text-sm text-slate-700",children:c.outcome})]},c.code))})]})]})]})})]})},zl=({modules:t,onSelectModule:s,onPreviewSources:l,isAtRisk:i=!1,weakTopics:n=[],onNotifyMe:o})=>e.jsx("div",{className:"pr-2 space-y-8",children:e.jsx("div",{children:t.length===0?e.jsxs("div",{className:"bg-white rounded-2xl border border-[#dde3eb] p-8 text-center",children:[e.jsx("p",{className:"text-slate-700 font-semibold",children:"No matching modules found."}),e.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"If modules are not yet available for your selected view, this area will unlock after assessment sync and content rollout."})]}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-3 md:gap-6",children:t.map((r,d)=>{const x=n.some(f=>r.content_domain&&r.content_domain.toLowerCase().includes(f.toLowerCase())||r.title&&r.title.toLowerCase().includes(f.toLowerCase())||r.competency_group&&r.competency_group.toLowerCase().includes(f.toLowerCase())||r.subject&&r.subject.toLowerCase().includes(f.toLowerCase()));return e.jsx(Yt,{module:r,index:d,onClick:()=>s(r),onPreviewSources:()=>l(r),isAtRisk:i,isRecommended:x,onNotifyMe:o},r.id)})})})}),Ml=({modules:t,fullPool:s,onSelectModule:l,onPreviewSources:i,isAtRisk:n=!1,learningPathContext:o=null,learningPathLoading:r=!1,weakTopics:d=[],onNotifyMe:x})=>{const f=t.filter(u=>u.progress>0&&u.progress<100),M=(t.length>0?t:s).filter(u=>u.progress===0).slice(0,6);return e.jsxs("div",{className:"pr-2 space-y-10",children:[r&&e.jsxs("div",{className:"mb-6 rounded-2xl border border-sky-200 bg-sky-50 px-5 py-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 rounded-full border-2 border-sky-400 border-t-transparent animate-spin flex-shrink-0"}),e.jsx("p",{className:"text-sm font-semibold text-sky-800",children:"Building your personalized learning path from DepEd curriculum..."})]}),o&&!r&&e.jsxs("div",{className:"mb-6 rounded-2xl border border-indigo-200 bg-gradient-to-br from-indigo-50 to-purple-50 px-5 py-4 shadow-sm",children:[e.jsxs("p",{className:"text-xs font-black uppercase tracking-wide text-indigo-700 mb-2 flex items-center gap-1.5",children:[e.jsx(Fe,{size:14})," Your Personalized Learning Path"]}),e.jsx("pre",{className:"whitespace-pre-wrap text-sm text-indigo-900 font-medium leading-relaxed font-sans",children:o})]}),f.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-[#FF8B8B]/10 flex items-center justify-center shadow-inner",children:e.jsx(as,{size:20,className:"text-[#FF8B8B]"})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Continue This Module"})]}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-3 md:gap-6",children:f.slice(0,4).map((u,v)=>{const m=d.some(p=>u.content_domain&&u.content_domain.toLowerCase().includes(p.toLowerCase())||u.title&&u.title.toLowerCase().includes(p.toLowerCase())||u.competency_group&&u.competency_group.toLowerCase().includes(p.toLowerCase())||u.subject&&u.subject.toLowerCase().includes(p.toLowerCase()));return e.jsx(Yt,{module:u,index:v,onClick:()=>l(u),onPreviewSources:()=>i(u),isAtRisk:n,badgeLabel:"In Progress",isRecommended:m,onNotifyMe:x},u.id)})})]}),e.jsx("div",{children:M.length===0?e.jsx("div",{className:"bg-white rounded-2xl border border-[#dde3eb] p-8 text-center text-slate-500 font-medium",children:"You are all caught up. Practice more quizzes to unlock additional recommendations."}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-3 md:gap-6",children:M.map((u,v)=>{const m=d.some(p=>u.content_domain&&u.content_domain.toLowerCase().includes(p.toLowerCase())||u.title&&u.title.toLowerCase().includes(p.toLowerCase())||u.competency_group&&u.competency_group.toLowerCase().includes(p.toLowerCase())||u.subject&&u.subject.toLowerCase().includes(p.toLowerCase()));return e.jsx(Yt,{module:u,index:v,onClick:()=>l(u),onPreviewSources:()=>i(u),isAtRisk:n,badgeLabel:"Start",isRecommended:m,onNotifyMe:x},u.id)})})})]})};export{yn as default}; diff --git a/assets/NotificationDropdown-BA3YDfYB.js b/assets/NotificationDropdown-BGvkzRtG.js similarity index 94% rename from assets/NotificationDropdown-BA3YDfYB.js rename to assets/NotificationDropdown-BGvkzRtG.js index 0dc24da11826a0f631d0a9c0bafc5af6023684a5..020b6623a5252ac5748048e9122d6191b6efef02 100644 --- a/assets/NotificationDropdown-BA3YDfYB.js +++ b/assets/NotificationDropdown-BGvkzRtG.js @@ -1,4 +1,4 @@ -import{e as n,E as b,u as N,h as w,m as j,a as g,U as k}from"./index-Cvals0ud.js";import{r as _,j as e}from"./vendor-react-B4AQeu28.js";import"./vendor-firebase-firestore-CNv3xXal.js";import{C as y,f as v}from"./formatDistanceToNow-CnY6T5Ff.js";import{B as o}from"./bell-oitWfCwK.js";import{C}from"./circle-check-Bi1b5YEO.js";import{C as A}from"./circle-alert-lQsWFo4p.js";import{S as z}from"./sparkles-Chs7kbc0.js";/** +import{e as n,E as b,u as N,h as w,m as j,a as g,U as k}from"./index-D9TvEOZX.js";import{r as _,j as e}from"./vendor-react-B4AQeu28.js";import"./vendor-firebase-firestore-CNv3xXal.js";import{C as y,f as v}from"./formatDistanceToNow-2ba72dLM.js";import{B as o}from"./bell-Ci_PX33B.js";import{C}from"./circle-check-C6IXGFgm.js";import{C as A}from"./circle-alert-B7tHo7_X.js";import{S as z}from"./sparkles-BLpoopVP.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ProfileModal-B9i8i5JC.js b/assets/ProfileModal-DLL5dyEP.js similarity index 96% rename from assets/ProfileModal-B9i8i5JC.js rename to assets/ProfileModal-DLL5dyEP.js index 3c9c4fab685eeeb34df7d532c23d96ff54c29067..05685578936aac8313a6b252240cef17fb1a6923 100644 --- a/assets/ProfileModal-B9i8i5JC.js +++ b/assets/ProfileModal-DLL5dyEP.js @@ -1,4 +1,4 @@ -import{r,j as e}from"./vendor-react-B4AQeu28.js";import{e as U,h as R,m as k,U as u,A as x,b as w,H as _,a1 as D,aL as T,aU as B,j as $}from"./index-Cvals0ud.js";import{B as b}from"./button-CanHmtQ3.js";import{I as d}from"./input-D6YjrCkj.js";import{S as q,a as G,c as V,d as p}from"./select-ClqEN5GF.js";import{P as X,M as z,V as C}from"./ProfilePictureUploader-BLdgrysh.js";import{X as Y}from"./x-cRIR5BcS.js";import{M as H}from"./mail-DYnuuzL1.js";import{C as L}from"./circle-help-Bpd0FWyO.js";import{S as K}from"./save-FkmW81ji.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-CzNRBnCs.js";import"./check-BVDfRV4g.js";import"./minus-XCv3x7RR.js";import"./plus-DUNZAuOT.js";import"./upload-CEq77VjR.js";/** +import{r,j as e}from"./vendor-react-B4AQeu28.js";import{e as U,h as R,m as k,U as u,A as x,b as w,H as _,a1 as D,aL as T,aU as B,j as $}from"./index-D9TvEOZX.js";import{B as b}from"./button-DC8Fz5kC.js";import{I as d}from"./input-7k8DpmeH.js";import{S as q,a as G,c as V,d as p}from"./select-C0r1OjMk.js";import{P as X,M as z,V as C}from"./ProfilePictureUploader-CvsZs9bx.js";import{X as Y}from"./x-DM8tXF3P.js";import{M as H}from"./mail-BP2vbAZE.js";import{C as L}from"./circle-help-BNf4DSN0.js";import{S as K}from"./save-BUPludiE.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-C5341jJ8.js";import"./check-Ceq9J6wq.js";import"./minus-VA5XFKbP.js";import"./plus-BO4Ob0HD.js";import"./upload-OtZe8H1o.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ProfilePictureUploader-BLdgrysh.js b/assets/ProfilePictureUploader-CvsZs9bx.js similarity index 98% rename from assets/ProfilePictureUploader-BLdgrysh.js rename to assets/ProfilePictureUploader-CvsZs9bx.js index 4605c2b256964080747ae5e72dfa11d7180051c4..0f971e9fab0d410c6ceb764c40f725e63fcc1b27 100644 --- a/assets/ProfilePictureUploader-BLdgrysh.js +++ b/assets/ProfilePictureUploader-CvsZs9bx.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-Cvals0ud.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css"])))=>i.map(i=>d[i]); -import{e as V,o as B,k as K,J as ge,_ as $,b3 as we,u as xe,W as ye,X as be,Y as Ce,h as Pe,m as J,j as Q}from"./index-Cvals0ud.js";import{g as Re,r as x,j as p}from"./vendor-react-B4AQeu28.js";import{_ as Ee,o as b,p as Se,q as _e,r as ze,s as De}from"./vendor-radix-BPuEd8FG.js";import{B as ee}from"./button-CanHmtQ3.js";import{updateProfile as Me}from"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-core-D7GXCeNu.js";import{r as Ae,u as Te,a as Ne}from"./vendor-firebase-storage-Bi7H_66d.js";import{X as je}from"./x-cRIR5BcS.js";import{M as Ue}from"./minus-XCv3x7RR.js";import{P as Fe}from"./plus-DUNZAuOT.js";import{U as Ie}from"./upload-CEq77VjR.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css"])))=>i.map(i=>d[i]); +import{e as V,o as B,k as K,J as ge,_ as $,b3 as we,u as xe,W as ye,X as be,Y as Ce,h as Pe,m as J,j as Q}from"./index-D9TvEOZX.js";import{g as Re,r as x,j as p}from"./vendor-react-B4AQeu28.js";import{_ as Ee,o as b,p as Se,q as _e,r as ze,s as De}from"./vendor-radix-C5nwdvGr.js";import{B as ee}from"./button-DC8Fz5kC.js";import{updateProfile as Me}from"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-core-D7GXCeNu.js";import{r as Ae,u as Te,a as Ne}from"./vendor-firebase-storage-Bi7H_66d.js";import{X as je}from"./x-DM8tXF3P.js";import{M as Ue}from"./minus-VA5XFKbP.js";import{P as Fe}from"./plus-BO4Ob0HD.js";import{U as Ie}from"./upload-OtZe8H1o.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. @@ -107,4 +107,4 @@ import{e as V,o as B,k as K,J as ge,_ as $,b3 as we,u as xe,W as ye,X as be,Y as border-left: 0; border-right: 0; } -`,nt=1,at=3,st=1,ct=(function(a){Ee(o,a);function o(){var e=a!==null&&a.apply(this,arguments)||this;return e.cropperRef=x.createRef(),e.imageRef=x.createRef(),e.videoRef=x.createRef(),e.containerPosition={x:0,y:0},e.containerRef=null,e.styleRef=null,e.containerRect=null,e.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},e.dragStartPosition={x:0,y:0},e.dragStartCrop={x:0,y:0},e.gestureZoomStart=0,e.gestureRotationStart=0,e.isTouching=!1,e.lastPinchDistance=0,e.lastPinchRotation=0,e.rafDragTimeout=null,e.rafPinchTimeout=null,e.wheelTimer=null,e.currentDoc=typeof document<"u"?document:null,e.currentWindow=typeof window<"u"?window:null,e.resizeObserver=null,e.previousCropSize=null,e.isInitialized=!1,e.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},e.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!e.containerRef)){var t=!0;e.resizeObserver=new window.ResizeObserver(function(r){if(t){t=!1;return}e.computeSizes()}),e.resizeObserver.observe(e.containerRef)}},e.preventZoomSafari=function(t){return t.preventDefault()},e.cleanEvents=function(){e.currentDoc&&(e.currentDoc.removeEventListener("mousemove",e.onMouseMove),e.currentDoc.removeEventListener("mouseup",e.onDragStopped),e.currentDoc.removeEventListener("touchmove",e.onTouchMove),e.currentDoc.removeEventListener("touchend",e.onDragStopped),e.currentDoc.removeEventListener("gesturechange",e.onGestureChange),e.currentDoc.removeEventListener("gestureend",e.onGestureEnd),e.currentDoc.removeEventListener("scroll",e.onScroll))},e.clearScrollEvent=function(){e.containerRef&&e.containerRef.removeEventListener("wheel",e.onWheel),e.wheelTimer&&clearTimeout(e.wheelTimer)},e.onMediaLoad=function(){var t=e.computeSizes();t&&(e.previousCropSize=t,e.emitCropData(),e.setInitialCrop(t),e.isInitialized=!0),e.props.onMediaLoaded&&e.props.onMediaLoaded(e.mediaSize)},e.setInitialCrop=function(t){if(e.props.initialCroppedAreaPercentages){var r=et(e.props.initialCroppedAreaPercentages,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=r.crop,n=r.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}else if(e.props.initialCroppedAreaPixels){var s=rt(e.props.initialCroppedAreaPixels,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=s.crop,n=s.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}},e.computeSizes=function(){var t,r,i,n,s,c,l=e.imageRef.current||e.videoRef.current;if(l&&e.containerRef){e.containerRect=e.containerRef.getBoundingClientRect(),e.saveContainerPosition();var u=e.containerRect.width/e.containerRect.height,h=((t=e.imageRef.current)===null||t===void 0?void 0:t.naturalWidth)||((r=e.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,d=((i=e.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((n=e.videoRef.current)===null||n===void 0?void 0:n.videoHeight)||0,m=l.offsetWidthw?{width:e.containerRect.height*w,height:e.containerRect.height}:{width:e.containerRect.width,height:e.containerRect.width/w};break;case"horizontal-cover":v={width:e.containerRect.width,height:e.containerRect.width/w};break;case"vertical-cover":v={width:e.containerRect.height*w,height:e.containerRect.height};break}else v={width:l.offsetWidth,height:l.offsetHeight};e.mediaSize=b(b({},v),{naturalWidth:h,naturalHeight:d}),e.props.setMediaSize&&e.props.setMediaSize(e.mediaSize);var f=e.props.cropSize?e.props.cropSize:Xe(e.mediaSize.width,e.mediaSize.height,e.containerRect.width,e.containerRect.height,e.props.aspect,e.props.rotation);return(((s=e.state.cropSize)===null||s===void 0?void 0:s.height)!==f.height||((c=e.state.cropSize)===null||c===void 0?void 0:c.width)!==f.width)&&e.props.onCropSizeChange&&e.props.onCropSizeChange(f),e.setState({cropSize:f},e.recomputeCropPosition),e.props.setCropSize&&e.props.setCropSize(f),f}},e.saveContainerPosition=function(){if(e.containerRef){var t=e.containerRef.getBoundingClientRect();e.containerPosition={x:t.left,y:t.top}}},e.onMouseDown=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("mousemove",e.onMouseMove),e.currentDoc.addEventListener("mouseup",e.onDragStopped),e.saveContainerPosition(),e.onDragStart(o.getMousePoint(t)))},e.onMouseMove=function(t){return e.onDrag(o.getMousePoint(t))},e.onScroll=function(t){e.currentDoc&&(t.preventDefault(),e.saveContainerPosition())},e.onTouchStart=function(t){e.currentDoc&&(e.isTouching=!0,!(e.props.onTouchRequest&&!e.props.onTouchRequest(t))&&(e.currentDoc.addEventListener("touchmove",e.onTouchMove,{passive:!1}),e.currentDoc.addEventListener("touchend",e.onDragStopped),e.saveContainerPosition(),t.touches.length===2?e.onPinchStart(t):t.touches.length===1&&e.onDragStart(o.getTouchPoint(t.touches[0]))))},e.onTouchMove=function(t){t.preventDefault(),t.touches.length===2?e.onPinchMove(t):t.touches.length===1&&e.onDrag(o.getTouchPoint(t.touches[0]))},e.onGestureStart=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("gesturechange",e.onGestureChange),e.currentDoc.addEventListener("gestureend",e.onGestureEnd),e.gestureZoomStart=e.props.zoom,e.gestureRotationStart=e.props.rotation)},e.onGestureChange=function(t){if(t.preventDefault(),!e.isTouching){var r=o.getMousePoint(t),i=e.gestureZoomStart-1+t.scale;if(e.setNewZoom(i,r,{shouldUpdatePosition:!0}),e.props.onRotationChange){var n=e.gestureRotationStart+t.rotation;e.props.onRotationChange(n)}}},e.onGestureEnd=function(t){e.cleanEvents()},e.onDragStart=function(t){var r,i,n=t.x,s=t.y;e.dragStartPosition={x:n,y:s},e.dragStartCrop=b({},e.props.crop),(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r)},e.onDrag=function(t){var r=t.x,i=t.y;e.currentWindow&&(e.rafDragTimeout&&e.currentWindow.cancelAnimationFrame(e.rafDragTimeout),e.rafDragTimeout=e.currentWindow.requestAnimationFrame(function(){if(e.state.cropSize&&!(r===void 0||i===void 0)){var n=r-e.dragStartPosition.x,s=i-e.dragStartPosition.y,c={x:e.dragStartCrop.x+n,y:e.dragStartCrop.y+s},l=e.props.restrictPosition?N(c,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):c;e.props.onCropChange(l)}}))},e.onDragStopped=function(){var t,r;e.isTouching=!1,e.cleanEvents(),e.emitCropData(),(r=(t=e.props).onInteractionEnd)===null||r===void 0||r.call(t)},e.onWheel=function(t){if(e.currentWindow&&!(e.props.onWheelRequest&&!e.props.onWheelRequest(t))){t.preventDefault();var r=o.getMousePoint(t),i=Ye(t).pixelY,n=e.props.zoom-i*e.props.zoomSpeed/200;e.setNewZoom(n,r,{shouldUpdatePosition:!0}),e.state.hasWheelJustStarted||e.setState({hasWheelJustStarted:!0},function(){var s,c;return(c=(s=e.props).onInteractionStart)===null||c===void 0?void 0:c.call(s)}),e.wheelTimer&&clearTimeout(e.wheelTimer),e.wheelTimer=e.currentWindow.setTimeout(function(){return e.setState({hasWheelJustStarted:!1},function(){var s,c;return(c=(s=e.props).onInteractionEnd)===null||c===void 0?void 0:c.call(s)})},250)}},e.getPointOnContainer=function(t,r){var i=t.x,n=t.y;if(!e.containerRect)throw new Error("The Cropper is not mounted");return{x:e.containerRect.width/2-(i-r.x),y:e.containerRect.height/2-(n-r.y)}},e.getPointOnMedia=function(t){var r=t.x,i=t.y,n=e.props,s=n.crop,c=n.zoom;return{x:(r+s.x)/c,y:(i+s.y)/c}},e.setNewZoom=function(t,r,i){var n=i===void 0?{}:i,s=n.shouldUpdatePosition,c=s===void 0?!0:s;if(!(!e.state.cropSize||!e.props.onZoomChange)){var l=O(t,e.props.minZoom,e.props.maxZoom);if(c){var u=e.getPointOnContainer(r,e.containerPosition),h=e.getPointOnMedia(u),d={x:h.x*l-u.x,y:h.y*l-u.y},m=e.props.restrictPosition?N(d,e.mediaSize,e.state.cropSize,l,e.props.rotation):d;e.props.onCropChange(m)}e.props.onZoomChange(l)}},e.getCropData=function(){if(!e.state.cropSize)return null;var t=e.props.restrictPosition?N(e.props.crop,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):e.props.crop;return Ke(t,e.mediaSize,e.state.cropSize,e.getAspect(),e.props.zoom,e.props.rotation,e.props.restrictPosition)},e.emitCropData=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropComplete&&e.props.onCropComplete(r,i),e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.emitCropAreaChange=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.recomputeCropPosition=function(){var t,r;if(e.state.cropSize){var i=e.props.crop;if(e.isInitialized&&(!((t=e.previousCropSize)===null||t===void 0)&&t.width)&&(!((r=e.previousCropSize)===null||r===void 0)&&r.height)){var n=Math.abs(e.previousCropSize.width-e.state.cropSize.width)>1e-6||Math.abs(e.previousCropSize.height-e.state.cropSize.height)>1e-6;if(n){var s=e.state.cropSize.width/e.previousCropSize.width,c=e.state.cropSize.height/e.previousCropSize.height;i={x:e.props.crop.x*s,y:e.props.crop.y*c}}}var l=e.props.restrictPosition?N(i,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):i;e.previousCropSize=e.state.cropSize,e.props.onCropChange(l),e.emitCropData()}},e.onKeyDown=function(t){var r,i,n=e.props,s=n.crop,c=n.onCropChange,l=n.keyboardStep,u=n.zoom,h=n.rotation,d=l;if(e.state.cropSize){t.shiftKey&&(d*=.2);var m=b({},s);switch(t.key){case"ArrowUp":m.y-=d,t.preventDefault();break;case"ArrowDown":m.y+=d,t.preventDefault();break;case"ArrowLeft":m.x-=d,t.preventDefault();break;case"ArrowRight":m.x+=d,t.preventDefault();break;default:return}e.props.restrictPosition&&(m=N(m,e.mediaSize,e.state.cropSize,u,h)),t.repeat||(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r),c(m)}},e.onKeyUp=function(t){var r,i;switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault();break;default:return}e.emitCropData(),(i=(r=e.props).onInteractionEnd)===null||i===void 0||i.call(r)},e}return o.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=it,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},o.prototype.componentWillUnmount=function(){var e,t;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((t=this.styleRef.parentNode)===null||t===void 0||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},o.prototype.componentDidUpdate=function(e){var t,r,i,n,s,c,l,u,h;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((t=e.cropSize)===null||t===void 0?void 0:t.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((i=e.cropSize)===null||i===void 0?void 0:i.width)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.width)?this.computeSizes():(((s=e.crop)===null||s===void 0?void 0:s.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&((h=this.videoRef.current)===null||h===void 0||h.load());var d=this.getObjectFit();d!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:d},this.computeSizes)},o.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},o.prototype.getObjectFit=function(){var e,t,r,i;if(this.props.objectFit==="cover"){var n=this.imageRef.current||this.videoRef.current;if(n&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,c=((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((t=this.videoRef.current)===null||t===void 0?void 0:t.videoWidth)||0,l=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,u=c/l;return uArray.isArray(e)?e:Array.isArray(o)?o:[t,r],[e,o,t,r]);return p.jsxs(Se,{"data-slot":"slider",defaultValue:o,value:e,min:t,max:r,className:B("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...i,children:[p.jsx(_e,{"data-slot":"slider-track",className:B("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:p.jsx(ze,{"data-slot":"slider-range",className:B("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:n.length},(s,c)=>p.jsx(De,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},c))]})}const de=["image/png","image/jpeg","image/webp"],he=2*1024*1024,fe=256,ut=a=>{const o=a.normalize("NFKD").toLowerCase(),e=o.lastIndexOf("."),t=e>0?o.slice(0,e):o,r=e>0?o.slice(e).replace(/[^.a-z0-9]/g,""):"";return`${t.replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"profile-picture"}${r}`},pt=(a,o,e=Date.now())=>`profile-pictures/${a}/${e}-${ut(o)}`,me=a=>de.includes(a.type)?a.size>he?"Profile pictures must be 2MB or smaller.":a.name.trim()?null:"Please choose a valid image file.":"Only PNG, JPEG, and WebP images are allowed.",dt=a=>new Promise((o,e)=>{const t=URL.createObjectURL(a),r=new Image,i=setTimeout(()=>{URL.revokeObjectURL(t),e(new Error("Image loading timed out. Please try a different file."))},15e3);r.onload=()=>{clearTimeout(i),URL.revokeObjectURL(t),o(r)},r.onerror=()=>{clearTimeout(i),URL.revokeObjectURL(t),e(new Error("Unable to read the selected image. Please try another file."))},r.crossOrigin="anonymous",r.src=t}),ue=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the image for upload."));return}t(i)},o,e)}),ht=async(a,o=fe)=>{const e=await dt(a),t=document.createElement("canvas");t.width=o,t.height=o;const r=t.getContext("2d");if(!r)throw new Error("Your browser cannot process image uploads right now.");const i=e.naturalWidth||e.width,n=e.naturalHeight||e.height,s=Math.min(i,n),c=Math.max(0,(i-s)/2),l=Math.max(0,(n-s)/2);r.clearRect(0,0,o,o),r.drawImage(e,c,l,s,s,0,0,o,o);try{return await ue(t,"image/webp",.9)}catch{return await ue(t,"image/jpeg",.9)}},j=(a,o,e)=>{let t;const r=new Promise((i,n)=>{t=setTimeout(()=>n(new Error(`${e} timed out after ${Math.round(o/1e3)}s`)),o)});return Promise.race([a,r]).finally(()=>clearTimeout(t))},ft=async(a,o,e)=>{const t=we.options.projectId;if(!t)throw new Error("Firebase project ID is not configured.");const r=await a.getIdToken(),i=`https://firestore.googleapis.com/v1/projects/${t}/databases/(default)/documents/users/${o}?updateMask.fieldPaths=photo&updateMask.fieldPaths=updatedAt`,n=await fetch(i,{method:"PATCH",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({fields:{photo:{stringValue:e},updatedAt:{timestampValue:new Date().toISOString()}}})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(`Firestore REST update failed (${n.status}): ${s}`)}},mt=async({file:a,uid:o,currentUser:e=K.currentUser,syncFirestore:t=!0})=>{const r=me(a);if(r)throw new Error(r);const i=e??K.currentUser;if(!i)throw new Error("You need to be signed in to change your profile picture.");const n=o||i.uid;if(!n)throw new Error("Unable to determine which profile should be updated.");if(i.uid!==n)throw new Error("The signed-in user does not match the profile being edited.");const s=await j(ht(a,fe),2e4,"Image processing"),c=pt(n,a.name),l=Ae(ge,c),u=await j(Te(l,s,{contentType:s.type||"image/webp",cacheControl:"public, max-age=31536000, immutable"}),3e4,"Storage upload"),h=await j(Ne(u.ref),1e4,"Download URL retrieval");try{await j(Me(i,{photoURL:h}),1e4,"Auth profile update")}catch(d){console.warn("[PROFILE UPLOAD] Auth profile update failed (non-fatal):",d)}if(t){try{await j(ft(i,n,h),1e4,"Firestore profile sync")}catch(d){console.error("[PROFILE UPLOAD] Firestore REST sync failed:",d),console.warn("[PROFILE UPLOAD] Photo was uploaded but the database record may be stale. It will refresh on next login.")}try{const{doc:d,updateDoc:m}=await $(async()=>{const{doc:v,updateDoc:f}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{doc:v,updateDoc:f}},__vite__mapDeps([0,1])),{db:w}=await $(async()=>{const{db:v}=await import("./index-Cvals0ud.js").then(f=>f.b6);return{db:v}},__vite__mapDeps([2,3,0,1,4,5,6,7,8,9,10,11]));await m(d(w,"leaderboard",n),{photo:h}).catch(()=>$(async()=>{const{setDoc:v}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{setDoc:v}},__vite__mapDeps([0,1])).then(({setDoc:v})=>v(d(w,"leaderboard",n),{photo:h},{merge:!0})))}catch{}}return h},vt=a=>`${(a/(1024*1024)).toFixed(1)} MB`,gt=a=>{const o=(a||"").trim();return o?o.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(""):"U"},wt=a=>new Promise((o,e)=>{const t=new Image;t.onload=()=>o(t),t.onerror=()=>e(new Error("Unable to load the image for cropping.")),t.src=a}),pe=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the cropped image."));return}t(i)},o,e)}),xt=async(a,o,e)=>{const t=await wt(a),r=document.createElement("canvas"),i=640;r.width=i,r.height=i;const n=r.getContext("2d");if(!n)throw new Error("Your browser cannot process the selected image right now.");n.clearRect(0,0,i,i),n.drawImage(t,o.x,o.y,o.width,o.height,0,0,i,i);let s;try{s=await pe(r,"image/webp",.92)}catch{s=await pe(r,"image/jpeg",.92)}if(!s)throw new Error("Could not create an image from the cropped area.");const c=s.type==="image/webp"?"webp":"jpg",u=`${e.name.replace(/\.[^/.]+$/,"")||"profile-picture"}-cropped.${c}`;return new File([s],u,{type:s.type,lastModified:Date.now()})},Nt=({uid:a,photoURL:o,displayName:e,className:t="",onUploaded:r,syncFirestore:i=!0})=>{const{currentUser:n,refreshProfile:s}=xe(),[c,l]=x.useState(null),[u,h]=x.useState(null),[d,m]=x.useState({x:0,y:0}),[w,v]=x.useState(1),[f,R]=x.useState(null),[y,g]=x.useState(""),[E,_]=x.useState(!1),P=x.useRef(null);x.useEffect(()=>{if(!c){h(null);return}const C=URL.createObjectURL(c);return h(C),()=>URL.revokeObjectURL(C)},[c]);const k=u||o||"",W=x.useMemo(()=>`${de.map(S=>S.replace("image/","").toUpperCase()).join(", ")} up to ${vt(he)}. The image will be cropped to a circular avatar.`,[]),D=()=>{l(null),m({x:0,y:0}),v(1),R(null),g(""),P.current&&(P.current.value="")},z=C=>{const S=C.target.files?.[0]||null;if(!S)return;const M=me(S);if(M){g(M),l(null),C.target.value="";return}g(""),l(S),m({x:0,y:0}),v(1),R(null)},T=async()=>{if(!c){g("Choose an image before saving.");return}_(!0),g("");const C=6e4;let S;try{const M=(async()=>{const I=u&&f?await xt(u,f,c):c,Z=a||n?.uid;return mt({file:I,uid:Z,currentUser:n,syncFirestore:i})})(),F=new Promise((I,Z)=>{S=setTimeout(()=>Z(new Error("Upload timed out. Please check your connection and try again.")),C)}),ve=await Promise.race([M,F]);r?.(ve),s().catch(I=>console.warn("[ProfilePictureUploader] refreshProfile failed:",I)),Q.success("Profile picture updated."),D()}catch(M){const F=M instanceof Error?M.message:"Failed to update your profile picture.";g(F),Q.error(F)}finally{clearTimeout(S),_(!1)}},U=()=>{P.current?.click()};return p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:`flex items-center gap-4 rounded-xl border border-slate-200 bg-white p-4 shadow-sm ${t}`,children:[p.jsxs("div",{className:"relative cursor-pointer group",onClick:U,role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&U(),"aria-label":"Change profile picture",children:[p.jsxs(ye,{className:"size-16 sm:size-20 ring-4 ring-sky-50 shadow-sm transition-transform duration-200 group-hover:scale-105",children:[p.jsx(be,{src:k,alt:`${e||"User"} profile picture`}),p.jsx(Ce,{className:"bg-gradient-to-br from-sky-600 to-cyan-500 text-lg font-semibold text-white",children:gt(e)})]}),p.jsx("span",{className:"absolute -right-1 -top-1 inline-flex items-center justify-center rounded-full bg-slate-900 p-1.5 text-white shadow-md transition-colors group-hover:bg-slate-700",children:p.jsx(Oe,{size:14})})]}),p.jsxs("div",{className:"space-y-1 flex-1",children:[p.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Profile picture"}),p.jsx("p",{className:"text-xs text-slate-500",children:"Click your avatar to upload a new photo."}),y&&p.jsx("p",{className:"text-xs font-medium text-rose-600 mt-1",children:y})]}),p.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:z,className:"sr-only","aria-label":"Choose profile picture"})]}),p.jsx(Pe,{children:u&&p.jsxs(p.Fragment,{children:[p.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[60]",onClick:D}),p.jsx(J.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",duration:.5,bounce:.3},className:"fixed inset-0 z-[60] flex items-center justify-center p-4 sm:p-6",onClick:C=>C.stopPropagation(),children:p.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg overflow-hidden flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-100",children:[p.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Update profile picture"}),p.jsx("button",{onClick:D,className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors","aria-label":"Close modal",children:p.jsx(je,{size:20})})]}),p.jsxs("div",{className:"p-4 sm:p-6 bg-slate-50 flex flex-col items-center",children:[p.jsx("div",{className:"relative h-[350px] sm:h-[450px] w-[350px] sm:w-[450px] mx-auto overflow-hidden rounded-xl bg-slate-100 ring-1 ring-inset ring-slate-200 shadow-inner",children:p.jsx(ct,{image:u,crop:d,zoom:w,aspect:1,cropShape:"round",showGrid:!1,objectFit:"cover",restrictPosition:!0,onCropChange:m,onZoomChange:v,onCropComplete:(C,S)=>R(S),style:{containerStyle:{backgroundColor:"#f8fafc"}}})}),p.jsxs("div",{className:"mt-6 w-full max-w-xs flex items-center gap-4",children:[p.jsx(Ue,{size:18,className:"text-slate-500"}),p.jsx(lt,{value:[w],min:1,max:3,step:.05,onValueChange:C=>v(C[0]||1),"aria-label":"Profile picture zoom",className:"flex-1 cursor-pointer"}),p.jsx(Fe,{size:18,className:"text-slate-500"})]}),p.jsx("p",{className:"mt-4 text-xs text-slate-500 text-center",children:W})]}),p.jsxs("div",{className:"p-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-white",children:[p.jsx(ee,{type:"button",variant:"ghost",onClick:D,disabled:E,className:"font-medium text-slate-600 hover:text-slate-900 hover:bg-slate-100 px-5",children:"Cancel"}),p.jsx(ee,{type:"button",onClick:T,disabled:E||!c,className:"bg-sky-600 hover:bg-sky-700 text-white min-w-[120px] gap-2 shadow-sm",children:E?p.jsxs(p.Fragment,{children:[p.jsx(Ie,{size:16,className:"animate-pulse"}),"Saving..."]}):"Save picture"})]})]})})]})})]})};export{At as M,Nt as P,Tt as V}; +`,nt=1,at=3,st=1,ct=(function(a){Ee(o,a);function o(){var e=a!==null&&a.apply(this,arguments)||this;return e.cropperRef=x.createRef(),e.imageRef=x.createRef(),e.videoRef=x.createRef(),e.containerPosition={x:0,y:0},e.containerRef=null,e.styleRef=null,e.containerRect=null,e.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},e.dragStartPosition={x:0,y:0},e.dragStartCrop={x:0,y:0},e.gestureZoomStart=0,e.gestureRotationStart=0,e.isTouching=!1,e.lastPinchDistance=0,e.lastPinchRotation=0,e.rafDragTimeout=null,e.rafPinchTimeout=null,e.wheelTimer=null,e.currentDoc=typeof document<"u"?document:null,e.currentWindow=typeof window<"u"?window:null,e.resizeObserver=null,e.previousCropSize=null,e.isInitialized=!1,e.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},e.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!e.containerRef)){var t=!0;e.resizeObserver=new window.ResizeObserver(function(r){if(t){t=!1;return}e.computeSizes()}),e.resizeObserver.observe(e.containerRef)}},e.preventZoomSafari=function(t){return t.preventDefault()},e.cleanEvents=function(){e.currentDoc&&(e.currentDoc.removeEventListener("mousemove",e.onMouseMove),e.currentDoc.removeEventListener("mouseup",e.onDragStopped),e.currentDoc.removeEventListener("touchmove",e.onTouchMove),e.currentDoc.removeEventListener("touchend",e.onDragStopped),e.currentDoc.removeEventListener("gesturechange",e.onGestureChange),e.currentDoc.removeEventListener("gestureend",e.onGestureEnd),e.currentDoc.removeEventListener("scroll",e.onScroll))},e.clearScrollEvent=function(){e.containerRef&&e.containerRef.removeEventListener("wheel",e.onWheel),e.wheelTimer&&clearTimeout(e.wheelTimer)},e.onMediaLoad=function(){var t=e.computeSizes();t&&(e.previousCropSize=t,e.emitCropData(),e.setInitialCrop(t),e.isInitialized=!0),e.props.onMediaLoaded&&e.props.onMediaLoaded(e.mediaSize)},e.setInitialCrop=function(t){if(e.props.initialCroppedAreaPercentages){var r=et(e.props.initialCroppedAreaPercentages,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=r.crop,n=r.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}else if(e.props.initialCroppedAreaPixels){var s=rt(e.props.initialCroppedAreaPixels,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=s.crop,n=s.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}},e.computeSizes=function(){var t,r,i,n,s,c,l=e.imageRef.current||e.videoRef.current;if(l&&e.containerRef){e.containerRect=e.containerRef.getBoundingClientRect(),e.saveContainerPosition();var u=e.containerRect.width/e.containerRect.height,h=((t=e.imageRef.current)===null||t===void 0?void 0:t.naturalWidth)||((r=e.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,d=((i=e.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((n=e.videoRef.current)===null||n===void 0?void 0:n.videoHeight)||0,m=l.offsetWidthw?{width:e.containerRect.height*w,height:e.containerRect.height}:{width:e.containerRect.width,height:e.containerRect.width/w};break;case"horizontal-cover":v={width:e.containerRect.width,height:e.containerRect.width/w};break;case"vertical-cover":v={width:e.containerRect.height*w,height:e.containerRect.height};break}else v={width:l.offsetWidth,height:l.offsetHeight};e.mediaSize=b(b({},v),{naturalWidth:h,naturalHeight:d}),e.props.setMediaSize&&e.props.setMediaSize(e.mediaSize);var f=e.props.cropSize?e.props.cropSize:Xe(e.mediaSize.width,e.mediaSize.height,e.containerRect.width,e.containerRect.height,e.props.aspect,e.props.rotation);return(((s=e.state.cropSize)===null||s===void 0?void 0:s.height)!==f.height||((c=e.state.cropSize)===null||c===void 0?void 0:c.width)!==f.width)&&e.props.onCropSizeChange&&e.props.onCropSizeChange(f),e.setState({cropSize:f},e.recomputeCropPosition),e.props.setCropSize&&e.props.setCropSize(f),f}},e.saveContainerPosition=function(){if(e.containerRef){var t=e.containerRef.getBoundingClientRect();e.containerPosition={x:t.left,y:t.top}}},e.onMouseDown=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("mousemove",e.onMouseMove),e.currentDoc.addEventListener("mouseup",e.onDragStopped),e.saveContainerPosition(),e.onDragStart(o.getMousePoint(t)))},e.onMouseMove=function(t){return e.onDrag(o.getMousePoint(t))},e.onScroll=function(t){e.currentDoc&&(t.preventDefault(),e.saveContainerPosition())},e.onTouchStart=function(t){e.currentDoc&&(e.isTouching=!0,!(e.props.onTouchRequest&&!e.props.onTouchRequest(t))&&(e.currentDoc.addEventListener("touchmove",e.onTouchMove,{passive:!1}),e.currentDoc.addEventListener("touchend",e.onDragStopped),e.saveContainerPosition(),t.touches.length===2?e.onPinchStart(t):t.touches.length===1&&e.onDragStart(o.getTouchPoint(t.touches[0]))))},e.onTouchMove=function(t){t.preventDefault(),t.touches.length===2?e.onPinchMove(t):t.touches.length===1&&e.onDrag(o.getTouchPoint(t.touches[0]))},e.onGestureStart=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("gesturechange",e.onGestureChange),e.currentDoc.addEventListener("gestureend",e.onGestureEnd),e.gestureZoomStart=e.props.zoom,e.gestureRotationStart=e.props.rotation)},e.onGestureChange=function(t){if(t.preventDefault(),!e.isTouching){var r=o.getMousePoint(t),i=e.gestureZoomStart-1+t.scale;if(e.setNewZoom(i,r,{shouldUpdatePosition:!0}),e.props.onRotationChange){var n=e.gestureRotationStart+t.rotation;e.props.onRotationChange(n)}}},e.onGestureEnd=function(t){e.cleanEvents()},e.onDragStart=function(t){var r,i,n=t.x,s=t.y;e.dragStartPosition={x:n,y:s},e.dragStartCrop=b({},e.props.crop),(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r)},e.onDrag=function(t){var r=t.x,i=t.y;e.currentWindow&&(e.rafDragTimeout&&e.currentWindow.cancelAnimationFrame(e.rafDragTimeout),e.rafDragTimeout=e.currentWindow.requestAnimationFrame(function(){if(e.state.cropSize&&!(r===void 0||i===void 0)){var n=r-e.dragStartPosition.x,s=i-e.dragStartPosition.y,c={x:e.dragStartCrop.x+n,y:e.dragStartCrop.y+s},l=e.props.restrictPosition?N(c,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):c;e.props.onCropChange(l)}}))},e.onDragStopped=function(){var t,r;e.isTouching=!1,e.cleanEvents(),e.emitCropData(),(r=(t=e.props).onInteractionEnd)===null||r===void 0||r.call(t)},e.onWheel=function(t){if(e.currentWindow&&!(e.props.onWheelRequest&&!e.props.onWheelRequest(t))){t.preventDefault();var r=o.getMousePoint(t),i=Ye(t).pixelY,n=e.props.zoom-i*e.props.zoomSpeed/200;e.setNewZoom(n,r,{shouldUpdatePosition:!0}),e.state.hasWheelJustStarted||e.setState({hasWheelJustStarted:!0},function(){var s,c;return(c=(s=e.props).onInteractionStart)===null||c===void 0?void 0:c.call(s)}),e.wheelTimer&&clearTimeout(e.wheelTimer),e.wheelTimer=e.currentWindow.setTimeout(function(){return e.setState({hasWheelJustStarted:!1},function(){var s,c;return(c=(s=e.props).onInteractionEnd)===null||c===void 0?void 0:c.call(s)})},250)}},e.getPointOnContainer=function(t,r){var i=t.x,n=t.y;if(!e.containerRect)throw new Error("The Cropper is not mounted");return{x:e.containerRect.width/2-(i-r.x),y:e.containerRect.height/2-(n-r.y)}},e.getPointOnMedia=function(t){var r=t.x,i=t.y,n=e.props,s=n.crop,c=n.zoom;return{x:(r+s.x)/c,y:(i+s.y)/c}},e.setNewZoom=function(t,r,i){var n=i===void 0?{}:i,s=n.shouldUpdatePosition,c=s===void 0?!0:s;if(!(!e.state.cropSize||!e.props.onZoomChange)){var l=O(t,e.props.minZoom,e.props.maxZoom);if(c){var u=e.getPointOnContainer(r,e.containerPosition),h=e.getPointOnMedia(u),d={x:h.x*l-u.x,y:h.y*l-u.y},m=e.props.restrictPosition?N(d,e.mediaSize,e.state.cropSize,l,e.props.rotation):d;e.props.onCropChange(m)}e.props.onZoomChange(l)}},e.getCropData=function(){if(!e.state.cropSize)return null;var t=e.props.restrictPosition?N(e.props.crop,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):e.props.crop;return Ke(t,e.mediaSize,e.state.cropSize,e.getAspect(),e.props.zoom,e.props.rotation,e.props.restrictPosition)},e.emitCropData=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropComplete&&e.props.onCropComplete(r,i),e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.emitCropAreaChange=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.recomputeCropPosition=function(){var t,r;if(e.state.cropSize){var i=e.props.crop;if(e.isInitialized&&(!((t=e.previousCropSize)===null||t===void 0)&&t.width)&&(!((r=e.previousCropSize)===null||r===void 0)&&r.height)){var n=Math.abs(e.previousCropSize.width-e.state.cropSize.width)>1e-6||Math.abs(e.previousCropSize.height-e.state.cropSize.height)>1e-6;if(n){var s=e.state.cropSize.width/e.previousCropSize.width,c=e.state.cropSize.height/e.previousCropSize.height;i={x:e.props.crop.x*s,y:e.props.crop.y*c}}}var l=e.props.restrictPosition?N(i,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):i;e.previousCropSize=e.state.cropSize,e.props.onCropChange(l),e.emitCropData()}},e.onKeyDown=function(t){var r,i,n=e.props,s=n.crop,c=n.onCropChange,l=n.keyboardStep,u=n.zoom,h=n.rotation,d=l;if(e.state.cropSize){t.shiftKey&&(d*=.2);var m=b({},s);switch(t.key){case"ArrowUp":m.y-=d,t.preventDefault();break;case"ArrowDown":m.y+=d,t.preventDefault();break;case"ArrowLeft":m.x-=d,t.preventDefault();break;case"ArrowRight":m.x+=d,t.preventDefault();break;default:return}e.props.restrictPosition&&(m=N(m,e.mediaSize,e.state.cropSize,u,h)),t.repeat||(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r),c(m)}},e.onKeyUp=function(t){var r,i;switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault();break;default:return}e.emitCropData(),(i=(r=e.props).onInteractionEnd)===null||i===void 0||i.call(r)},e}return o.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=it,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},o.prototype.componentWillUnmount=function(){var e,t;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((t=this.styleRef.parentNode)===null||t===void 0||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},o.prototype.componentDidUpdate=function(e){var t,r,i,n,s,c,l,u,h;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((t=e.cropSize)===null||t===void 0?void 0:t.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((i=e.cropSize)===null||i===void 0?void 0:i.width)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.width)?this.computeSizes():(((s=e.crop)===null||s===void 0?void 0:s.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&((h=this.videoRef.current)===null||h===void 0||h.load());var d=this.getObjectFit();d!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:d},this.computeSizes)},o.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},o.prototype.getObjectFit=function(){var e,t,r,i;if(this.props.objectFit==="cover"){var n=this.imageRef.current||this.videoRef.current;if(n&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,c=((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((t=this.videoRef.current)===null||t===void 0?void 0:t.videoWidth)||0,l=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,u=c/l;return uArray.isArray(e)?e:Array.isArray(o)?o:[t,r],[e,o,t,r]);return p.jsxs(Se,{"data-slot":"slider",defaultValue:o,value:e,min:t,max:r,className:B("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...i,children:[p.jsx(_e,{"data-slot":"slider-track",className:B("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:p.jsx(ze,{"data-slot":"slider-range",className:B("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:n.length},(s,c)=>p.jsx(De,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},c))]})}const de=["image/png","image/jpeg","image/webp"],he=2*1024*1024,fe=256,ut=a=>{const o=a.normalize("NFKD").toLowerCase(),e=o.lastIndexOf("."),t=e>0?o.slice(0,e):o,r=e>0?o.slice(e).replace(/[^.a-z0-9]/g,""):"";return`${t.replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"profile-picture"}${r}`},pt=(a,o,e=Date.now())=>`profile-pictures/${a}/${e}-${ut(o)}`,me=a=>de.includes(a.type)?a.size>he?"Profile pictures must be 2MB or smaller.":a.name.trim()?null:"Please choose a valid image file.":"Only PNG, JPEG, and WebP images are allowed.",dt=a=>new Promise((o,e)=>{const t=URL.createObjectURL(a),r=new Image,i=setTimeout(()=>{URL.revokeObjectURL(t),e(new Error("Image loading timed out. Please try a different file."))},15e3);r.onload=()=>{clearTimeout(i),URL.revokeObjectURL(t),o(r)},r.onerror=()=>{clearTimeout(i),URL.revokeObjectURL(t),e(new Error("Unable to read the selected image. Please try another file."))},r.crossOrigin="anonymous",r.src=t}),ue=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the image for upload."));return}t(i)},o,e)}),ht=async(a,o=fe)=>{const e=await dt(a),t=document.createElement("canvas");t.width=o,t.height=o;const r=t.getContext("2d");if(!r)throw new Error("Your browser cannot process image uploads right now.");const i=e.naturalWidth||e.width,n=e.naturalHeight||e.height,s=Math.min(i,n),c=Math.max(0,(i-s)/2),l=Math.max(0,(n-s)/2);r.clearRect(0,0,o,o),r.drawImage(e,c,l,s,s,0,0,o,o);try{return await ue(t,"image/webp",.9)}catch{return await ue(t,"image/jpeg",.9)}},j=(a,o,e)=>{let t;const r=new Promise((i,n)=>{t=setTimeout(()=>n(new Error(`${e} timed out after ${Math.round(o/1e3)}s`)),o)});return Promise.race([a,r]).finally(()=>clearTimeout(t))},ft=async(a,o,e)=>{const t=we.options.projectId;if(!t)throw new Error("Firebase project ID is not configured.");const r=await a.getIdToken(),i=`https://firestore.googleapis.com/v1/projects/${t}/databases/(default)/documents/users/${o}?updateMask.fieldPaths=photo&updateMask.fieldPaths=updatedAt`,n=await fetch(i,{method:"PATCH",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({fields:{photo:{stringValue:e},updatedAt:{timestampValue:new Date().toISOString()}}})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(`Firestore REST update failed (${n.status}): ${s}`)}},mt=async({file:a,uid:o,currentUser:e=K.currentUser,syncFirestore:t=!0})=>{const r=me(a);if(r)throw new Error(r);const i=e??K.currentUser;if(!i)throw new Error("You need to be signed in to change your profile picture.");const n=o||i.uid;if(!n)throw new Error("Unable to determine which profile should be updated.");if(i.uid!==n)throw new Error("The signed-in user does not match the profile being edited.");const s=await j(ht(a,fe),2e4,"Image processing"),c=pt(n,a.name),l=Ae(ge,c),u=await j(Te(l,s,{contentType:s.type||"image/webp",cacheControl:"public, max-age=31536000, immutable"}),3e4,"Storage upload"),h=await j(Ne(u.ref),1e4,"Download URL retrieval");try{await j(Me(i,{photoURL:h}),1e4,"Auth profile update")}catch(d){console.warn("[PROFILE UPLOAD] Auth profile update failed (non-fatal):",d)}if(t){try{await j(ft(i,n,h),1e4,"Firestore profile sync")}catch(d){console.error("[PROFILE UPLOAD] Firestore REST sync failed:",d),console.warn("[PROFILE UPLOAD] Photo was uploaded but the database record may be stale. It will refresh on next login.")}try{const{doc:d,updateDoc:m}=await $(async()=>{const{doc:v,updateDoc:f}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{doc:v,updateDoc:f}},__vite__mapDeps([0,1])),{db:w}=await $(async()=>{const{db:v}=await import("./index-D9TvEOZX.js").then(f=>f.b6);return{db:v}},__vite__mapDeps([2,3,0,1,4,5,6,7,8,9,10,11]));await m(d(w,"leaderboard",n),{photo:h}).catch(()=>$(async()=>{const{setDoc:v}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{setDoc:v}},__vite__mapDeps([0,1])).then(({setDoc:v})=>v(d(w,"leaderboard",n),{photo:h},{merge:!0})))}catch{}}return h},vt=a=>`${(a/(1024*1024)).toFixed(1)} MB`,gt=a=>{const o=(a||"").trim();return o?o.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(""):"U"},wt=a=>new Promise((o,e)=>{const t=new Image;t.onload=()=>o(t),t.onerror=()=>e(new Error("Unable to load the image for cropping.")),t.src=a}),pe=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the cropped image."));return}t(i)},o,e)}),xt=async(a,o,e)=>{const t=await wt(a),r=document.createElement("canvas"),i=640;r.width=i,r.height=i;const n=r.getContext("2d");if(!n)throw new Error("Your browser cannot process the selected image right now.");n.clearRect(0,0,i,i),n.drawImage(t,o.x,o.y,o.width,o.height,0,0,i,i);let s;try{s=await pe(r,"image/webp",.92)}catch{s=await pe(r,"image/jpeg",.92)}if(!s)throw new Error("Could not create an image from the cropped area.");const c=s.type==="image/webp"?"webp":"jpg",u=`${e.name.replace(/\.[^/.]+$/,"")||"profile-picture"}-cropped.${c}`;return new File([s],u,{type:s.type,lastModified:Date.now()})},Nt=({uid:a,photoURL:o,displayName:e,className:t="",onUploaded:r,syncFirestore:i=!0})=>{const{currentUser:n,refreshProfile:s}=xe(),[c,l]=x.useState(null),[u,h]=x.useState(null),[d,m]=x.useState({x:0,y:0}),[w,v]=x.useState(1),[f,R]=x.useState(null),[y,g]=x.useState(""),[E,_]=x.useState(!1),P=x.useRef(null);x.useEffect(()=>{if(!c){h(null);return}const C=URL.createObjectURL(c);return h(C),()=>URL.revokeObjectURL(C)},[c]);const k=u||o||"",W=x.useMemo(()=>`${de.map(S=>S.replace("image/","").toUpperCase()).join(", ")} up to ${vt(he)}. The image will be cropped to a circular avatar.`,[]),D=()=>{l(null),m({x:0,y:0}),v(1),R(null),g(""),P.current&&(P.current.value="")},z=C=>{const S=C.target.files?.[0]||null;if(!S)return;const M=me(S);if(M){g(M),l(null),C.target.value="";return}g(""),l(S),m({x:0,y:0}),v(1),R(null)},T=async()=>{if(!c){g("Choose an image before saving.");return}_(!0),g("");const C=6e4;let S;try{const M=(async()=>{const I=u&&f?await xt(u,f,c):c,Z=a||n?.uid;return mt({file:I,uid:Z,currentUser:n,syncFirestore:i})})(),F=new Promise((I,Z)=>{S=setTimeout(()=>Z(new Error("Upload timed out. Please check your connection and try again.")),C)}),ve=await Promise.race([M,F]);r?.(ve),s().catch(I=>console.warn("[ProfilePictureUploader] refreshProfile failed:",I)),Q.success("Profile picture updated."),D()}catch(M){const F=M instanceof Error?M.message:"Failed to update your profile picture.";g(F),Q.error(F)}finally{clearTimeout(S),_(!1)}},U=()=>{P.current?.click()};return p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:`flex items-center gap-4 rounded-xl border border-slate-200 bg-white p-4 shadow-sm ${t}`,children:[p.jsxs("div",{className:"relative cursor-pointer group",onClick:U,role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&U(),"aria-label":"Change profile picture",children:[p.jsxs(ye,{className:"size-16 sm:size-20 ring-4 ring-sky-50 shadow-sm transition-transform duration-200 group-hover:scale-105",children:[p.jsx(be,{src:k,alt:`${e||"User"} profile picture`}),p.jsx(Ce,{className:"bg-gradient-to-br from-sky-600 to-cyan-500 text-lg font-semibold text-white",children:gt(e)})]}),p.jsx("span",{className:"absolute -right-1 -top-1 inline-flex items-center justify-center rounded-full bg-slate-900 p-1.5 text-white shadow-md transition-colors group-hover:bg-slate-700",children:p.jsx(Oe,{size:14})})]}),p.jsxs("div",{className:"space-y-1 flex-1",children:[p.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Profile picture"}),p.jsx("p",{className:"text-xs text-slate-500",children:"Click your avatar to upload a new photo."}),y&&p.jsx("p",{className:"text-xs font-medium text-rose-600 mt-1",children:y})]}),p.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:z,className:"sr-only","aria-label":"Choose profile picture"})]}),p.jsx(Pe,{children:u&&p.jsxs(p.Fragment,{children:[p.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[60]",onClick:D}),p.jsx(J.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",duration:.5,bounce:.3},className:"fixed inset-0 z-[60] flex items-center justify-center p-4 sm:p-6",onClick:C=>C.stopPropagation(),children:p.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg overflow-hidden flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-100",children:[p.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Update profile picture"}),p.jsx("button",{onClick:D,className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors","aria-label":"Close modal",children:p.jsx(je,{size:20})})]}),p.jsxs("div",{className:"p-4 sm:p-6 bg-slate-50 flex flex-col items-center",children:[p.jsx("div",{className:"relative h-[350px] sm:h-[450px] w-[350px] sm:w-[450px] mx-auto overflow-hidden rounded-xl bg-slate-100 ring-1 ring-inset ring-slate-200 shadow-inner",children:p.jsx(ct,{image:u,crop:d,zoom:w,aspect:1,cropShape:"round",showGrid:!1,objectFit:"cover",restrictPosition:!0,onCropChange:m,onZoomChange:v,onCropComplete:(C,S)=>R(S),style:{containerStyle:{backgroundColor:"#f8fafc"}}})}),p.jsxs("div",{className:"mt-6 w-full max-w-xs flex items-center gap-4",children:[p.jsx(Ue,{size:18,className:"text-slate-500"}),p.jsx(lt,{value:[w],min:1,max:3,step:.05,onValueChange:C=>v(C[0]||1),"aria-label":"Profile picture zoom",className:"flex-1 cursor-pointer"}),p.jsx(Fe,{size:18,className:"text-slate-500"})]}),p.jsx("p",{className:"mt-4 text-xs text-slate-500 text-center",children:W})]}),p.jsxs("div",{className:"p-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-white",children:[p.jsx(ee,{type:"button",variant:"ghost",onClick:D,disabled:E,className:"font-medium text-slate-600 hover:text-slate-900 hover:bg-slate-100 px-5",children:"Cancel"}),p.jsx(ee,{type:"button",onClick:T,disabled:E||!c,className:"bg-sky-600 hover:bg-sky-700 text-white min-w-[120px] gap-2 shadow-sm",children:E?p.jsxs(p.Fragment,{children:[p.jsx(Ie,{size:16,className:"animate-pulse"}),"Saving..."]}):"Save picture"})]})]})})]})})]})};export{At as M,Nt as P,Tt as V}; diff --git a/assets/QuizBattlePage-Cgo4YrpT.js b/assets/QuizBattlePage-BFj3_Zrn.js similarity index 72% rename from assets/QuizBattlePage-Cgo4YrpT.js rename to assets/QuizBattlePage-BFj3_Zrn.js index 6e7761a9a64bef38a4c676c7ce33b724a1ecf087..f42c327324722e965283268a427cbd162d4f6bca 100644 --- a/assets/QuizBattlePage-Cgo4YrpT.js +++ b/assets/QuizBattlePage-BFj3_Zrn.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pipelineService-B7G_svsh.js","assets/index-Cvals0ud.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css"])))=>i.map(i=>d[i]); -import{e as ma,o as u,m as y,g as et,aM as De,k as st,aN as q,_ as xa,$ as Oa,r as At,M as Ha,N as Te,U as ge,h as Ze,q as Ke,u as Va,F as gt,a2 as wt,a7 as vt,a6 as Jt}from"./index-Cvals0ud.js";import{r as i,j as e,d as Ft}from"./vendor-react-B4AQeu28.js";import{q as jt}from"./quiz_battle_avatar-BXHPSput.js";import{g as Ua,s as ea}from"./subjects-jEWdBmnZ.js";import{doc as Wa,getDoc as Ya,where as ta,orderBy as pa,limit as zt,getDocs as Ct,query as It,collection as Bt}from"./vendor-firebase-firestore-CNv3xXal.js";import{a4 as L,a5 as ha,a6 as ba,a7 as _e,a8 as Xa}from"./vendor-firebase-core-D7GXCeNu.js";import{B as A}from"./button-CanHmtQ3.js";import{e as Ga,f as Za}from"./vendor-radix-BPuEd8FG.js";import{S as Me,a as Fe,b as Ee,c as Re,d as de}from"./select-ClqEN5GF.js";import{I as Ka}from"./input-D6YjrCkj.js";import{S as Ja}from"./switch-BfAF8D2j.js";import{H as es,S as xe,C as aa}from"./skeleton-2ST8J4tA.js";import{V as fa,a as ga,M as ts,b as as}from"./volume-x-D_pMIkOs.js";import{C as ss}from"./CompositeAvatar-Col05lJc.js";import{S as Je}from"./sparkles-Chs7kbc0.js";import{C as yt}from"./check-BVDfRV4g.js";import{C as Ue}from"./chevron-right-DMwHUP8W.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-NTUNS-L9.js";import"./chevron-up-CzNRBnCs.js";import"./avatarData-BuQSOXo3.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pipelineService-CMil_uZC.js","assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css"])))=>i.map(i=>d[i]); +import{e as ma,o as u,m as y,g as et,aM as De,k as st,aN as q,_ as xa,$ as Oa,r as At,M as Ha,N as Te,U as ge,h as Ze,q as Ke,u as Va,F as gt,a2 as wt,a7 as vt,a6 as Jt}from"./index-D9TvEOZX.js";import{r as i,j as e,d as Ft}from"./vendor-react-B4AQeu28.js";import{q as jt}from"./quiz_battle_avatar-BXHPSput.js";import{g as Ua,s as ea}from"./subjects-BJQJlUBm.js";import{doc as Wa,getDoc as Ya,where as ta,orderBy as pa,limit as zt,getDocs as Ct,query as It,collection as Bt}from"./vendor-firebase-firestore-CNv3xXal.js";import{a4 as L,a5 as ha,a6 as ba,a7 as _e,a8 as Xa}from"./vendor-firebase-core-D7GXCeNu.js";import{B as A}from"./button-DC8Fz5kC.js";import{e as Ga,f as Za}from"./vendor-radix-C5nwdvGr.js";import{S as Me,a as Fe,b as Ee,c as Re,d as de}from"./select-C0r1OjMk.js";import{I as Ka}from"./input-7k8DpmeH.js";import{S as Ja}from"./switch-CJKtscrK.js";import{H as es,S as xe,C as aa}from"./skeleton-DpSy2iSj.js";import{V as fa,a as ga,M as ts,b as as}from"./volume-x-DPfTjI9k.js";import{C as ss}from"./CompositeAvatar-Col05lJc.js";import{S as Je}from"./sparkles-BLpoopVP.js";import{C as yt}from"./check-Ceq9J6wq.js";import{C as Ue}from"./chevron-right-Jv12kepm.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-BwIV9b12.js";import"./chevron-up-C5341jJ8.js";import"./avatarData-BuQSOXo3.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. @@ -9,7 +9,7 @@ import{e as ma,o as u,m as y,g as et,aM as De,k as st,aN as q,_ as xa,$ as Oa,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ns=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],os=ma("pause",ns),We=({width:a,x:s,delay:n,duration:c})=>{const d=["#9956DE","#7274ED","#1FA7E1","#6ED1CF","#75D06A","#FFB356","#FF8B8B","#FB96BB"],l=d[Math.floor(Math.random()*d.length)],w=Math.floor(Math.random()*10)+1;return e.jsx(y.div,{style:{"--x":`${s}`,"--width":`${a}`,"--aspect-ratio":`${w}`,"--background":`linear-gradient(${l}cc, transparent)`},className:"absolute left-[var(--x)] top-0 [aspect-ratio:1/var(--aspect-ratio)] [background:var(--background)] [width:var(--width)]",initial:{y:"100cqmax",x:"-50%"},animate:{y:"-100%",x:"-50%"},transition:{duration:c,delay:n,repeat:Number.POSITIVE_INFINITY,ease:"linear"}})},ra=({children:a,perspective:s=100,className:n,bgVideo:c,beamsPerSide:d=6,beamSize:l=4,beamDelayMax:w=1.5,beamDelayMin:C=0,beamDuration:g=4,gridColor:N="rgba(100, 116, 139, 0.08)",...b})=>{const j=i.useCallback(()=>{const S=[],Y=Math.floor(100/l)/d;for(let O=0;Oj(),[j]),m=i.useMemo(()=>j(),[j]),v=i.useMemo(()=>j(),[j]),W=i.useMemo(()=>j(),[j]);return e.jsxs("div",{className:u("relative w-full h-full",n),...b,children:[c?e.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"pointer-events-none absolute inset-0 w-full h-full object-cover -z-10",src:c}):e.jsxs("div",{style:{"--perspective":`${s}px`,"--grid-color":N,"--beam-size":`${l}%`},className:"pointer-events-none absolute inset-0 overflow-hidden [clip-path:inset(0)] [container-type:size] [perspective:var(--perspective)] [transform-style:preserve-3d] -z-10 bg-[#42389d]",children:[e.jsx("div",{className:"absolute [transform-style:preserve-3d] [background-size:var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,_var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] [container-type:inline-size] [height:100cqmax] [transform-origin:50%_0%] [transform:rotateX(-90deg)] [width:100cqi]",children:h.map((S,R)=>e.jsx(We,{width:`${l}%`,x:`${S.x*l}%`,delay:S.delay,duration:g},`top-${R}`))}),e.jsx("div",{className:"absolute top-full [transform-style:preserve-3d] [background-size:var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,_var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] [container-type:inline-size] [height:100cqmax] [transform-origin:50%_0%] [transform:rotateX(-90deg)] [width:100cqi]",children:v.map((S,R)=>e.jsx(We,{width:`${l}%`,x:`${S.x*l}%`,delay:S.delay,duration:g},`bottom-${R}`))}),e.jsx("div",{className:"absolute left-0 top-0 [transform-style:preserve-3d] [background-size:var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,_var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] [container-type:inline-size] [height:100cqmax] [transform-origin:0%_0%] [transform:rotate(90deg)_rotateX(-90deg)] [width:100cqh]",children:W.map((S,R)=>e.jsx(We,{width:`${l}%`,x:`${S.x*l}%`,delay:S.delay,duration:g},`left-${R}`))}),e.jsx("div",{className:"absolute right-0 top-0 [transform-style:preserve-3d] [background-size:var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,_var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] [container-type:inline-size] [height:100cqmax] [width:100cqh] [transform-origin:100%_0%] [transform:rotate(-90deg)_rotateX(-90deg)]",children:m.map((S,R)=>e.jsx(We,{width:`${l}%`,x:`${S.x*l}%`,delay:S.delay,duration:g},`right-${R}`))})]}),e.jsx("div",{className:"relative z-10 w-full h-full",children:a})]})},ls=15e3,is="mathpulse.quizBattle.local",na="".toLowerCase()==="true",rt=typeof window<"u",tt=()=>rt&&!1,Et=()=>{const a=st.currentUser?.uid;return a||"local-student"},wa=a=>`${is}.${a}`,Pe=a=>{const s={stats:Se(a),history:[],queueStatus:"idle"};if(!rt)return s;try{const n=window.localStorage.getItem(wa(a));if(!n)return s;const c=JSON.parse(n),d=Array.isArray(c.history)?c.history.map(w=>Mt(w.matchId||"local-match",w)):[];return{stats:c.stats?{...Se(a),...c.stats,userId:a,updatedAt:at(c.stats.updatedAt)}:Se(a),history:d,queueStatus:c.queueStatus==="queued"||c.queueStatus==="matched"?c.queueStatus:"idle"}}catch(n){return console.error("Error reading local Quiz Battle fallback store:",n),s}},va=(a,s)=>{if(rt)try{window.localStorage.setItem(wa(a),JSON.stringify(s))}catch(n){console.error("Error writing local Quiz Battle fallback store:",n)}},ja=a=>{const s=a||{},n=typeof s.code=="string"?s.code:"";return n?n.startsWith("functions/")?n.replace("functions/",""):n:""},ne=a=>{if(!tt())return!1;const s=ja(a);if(["internal","not-found","unavailable","deadline-exceeded"].includes(s))return!0;const n=a||{},c=(typeof n.message=="string"?n.message:a instanceof Error?a.message:"").toLowerCase();return c?c.includes("cors policy")||c.includes("no access-control-allow-origin")||c.includes("failed to fetch")||c.includes("network error")||c.includes("err_failed"):!1},Ye=(a,s)=>Math.floor(Math.random()*(s-a+1))+a,ds=(a,s)=>{const n=Math.max(3,a),c=s==="easy"?0:s==="medium"?1:s==="hard"?2:1,d=Ye(Math.max(0,n-3-c),n),l=Ye(Math.max(0,n-4+c),n),w=Math.min(n,Math.max(0,d)),C=Math.min(n,Math.max(0,l)),g=Math.max(0,Math.min(100,w/n*100+Ye(-8,6))),N=Ye(1800,6200);return{scoreFor:w,scoreAgainst:C,accuracy:g,averageResponseMs:N}},cs=a=>{const s=Et(),n=Pe(s),c=`local-bot-${Date.now()}-${Math.random().toString(16).slice(2,8)}`,d=ds(a.rounds,a.botDifficulty),l=d.scoreFor>d.scoreAgainst?"win":d.scoreFor0?m/h*100:0,averageAccuracy:h>0?(n.stats.averageAccuracy*n.stats.matchesPlayed+d.accuracy)/h:d.accuracy,averageResponseMs:h>0?Math.round((n.stats.averageResponseMs*n.stats.matchesPlayed+d.averageResponseMs)/h):d.averageResponseMs,currentStreak:S,bestStreak:R,favoriteTopicId:a.topicId,leaderboardScore:n.stats.leaderboardScore+j.xpEarned,updatedAt:w};va(s,{stats:Y,history:[j,...n.history].slice(0,50),queueStatus:"idle"});try{xa(async()=>{const{emitPipelineEvent:O,getStudentContext:M}=await import("./pipelineService-B7G_svsh.js");return{emitPipelineEvent:O,getStudentContext:M}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({emitPipelineEvent:O,getStudentContext:M})=>{const D=M();D&&O({student_id:s,event_type:"battle",event_data:{battle_id:c,topic:a.topicId,score:d.accuracy,won:l==="win",total_questions:a.rounds,correct_answers:d.scoreFor},occurred_at:new Date().toISOString(),class_id:D.classId,teacher_id:D.teacherId})}).catch(()=>{})}catch{}return{success:!0,matchId:c,status:"ready",botDifficulty:a.botDifficulty}},ya=a=>{const s=Et(),n=Pe(s);va(s,{...n,queueStatus:a})},us=()=>Math.random().toString(36).slice(2,8).toUpperCase(),Rt=a=>{const s=Et();return{roomId:`local-room-${Date.now()}`,roomCode:a||us(),ownerStudentId:s,participantIds:[s],participantCount:1,status:"waiting",subjectId:"gen-math",topicId:"functions",difficulty:"medium",rounds:5,timePerQuestionSec:30,isOwner:!0}},Na=()=>rt&&!!st.currentUser?.uid&&!!De,ka=(a,s,n)=>`quizBattlePresence/${a}/${s}/${n}`,ms=async(a,s)=>{if(!Na()||!s.trim()||!De)return;const n=st.currentUser?.uid;if(!n)return;const c=ha(De,ka(a,s,n));try{await ba(c,{studentId:n,scope:a,resourceId:s,online:!0,heartbeatAt:_e(),updatedAt:_e()}),await Xa(c).update({online:!1,updatedAt:_e(),disconnectedAt:_e()})}catch(d){console.warn("Realtime presence connect failed:",d)}},xs=async(a,s)=>{if(!Na()||!s.trim()||!De)return;const n=st.currentUser?.uid;if(!n)return;const c=ha(De,ka(a,s,n));try{await ba(c,{studentId:n,scope:a,resourceId:s,online:!1,updatedAt:_e(),disconnectedAt:_e()})}catch(d){console.warn("Realtime presence disconnect failed:",d)}},V=(a,s)=>{const n=`Unable to continue while ${a}. Please try again.`;if(s instanceof Error&&s.message.startsWith("Timed out while"))return s.message;const c=s||{},d=ja(s),l=typeof c.message=="string"?c.message.trim():"";return d==="unauthenticated"?"Your session has expired. Sign in again before starting a battle.":d==="permission-denied"?"Only student accounts can access Quiz Battle matchmaking.":d==="invalid-argument"?l||"Battle setup is invalid. Review the selected options and try again.":d==="already-exists"?l||"This room is already full. Try another room code.":d==="failed-precondition"?l||"Battle state changed. Please refresh and continue.":d==="unavailable"||d==="internal"||d==="not-found"||d==="deadline-exceeded"?/question generation temporarily unavailable/i.test(l)?l:"Quiz Battle service is temporarily unavailable. Please retry in a moment.":n},$=async(a,s,n=ls)=>{let c;try{return await Promise.race([s,new Promise((d,l)=>{c=setTimeout(()=>{l(new Error(`Timed out while ${a}. Please try again.`))},n)})])}finally{c&&clearTimeout(c)}},at=a=>{if(!a)return new Date;if(a instanceof Date)return a;if(typeof a=="string"){const s=Date.parse(a);return Number.isNaN(s)?new Date:new Date(s)}if(typeof a=="number")return new Date(a);if(typeof a=="object"){const s=a;if(typeof s.toDate=="function")return s.toDate();if(typeof s.seconds=="number")return new Date(s.seconds*1e3)}return new Date},ps=()=>({mode:"online",subjectId:"gen-math",topicId:"",difficulty:"medium",rounds:5,timePerQuestionSec:30,queueType:"public_matchmaking",botDifficulty:"medium",adaptiveBot:!1}),hs=a=>{const s=[];return a.subjectId.trim()||s.push({field:"subjectId",message:"Choose a category before starting."}),a.topicId.trim()||s.push({field:"topicId",message:"Choose a strand or topic before starting."}),(a.rounds<3||a.rounds>20)&&s.push({field:"rounds",message:"Questions must be between 3 and 20."}),(a.timePerQuestionSec<10||a.timePerQuestionSec>180)&&s.push({field:"timePerQuestionSec",message:"Timer must be between 10s and 180s."}),a.mode==="bot"&&a.queueType!=="public_matchmaking"&&s.push({field:"queueType",message:"Bot battles use instant start and do not support private room mode."}),s},Se=a=>({userId:a,matchesPlayed:0,wins:0,losses:0,draws:0,winRate:0,averageAccuracy:0,averageResponseMs:0,bestStreak:0,currentStreak:0,favoriteTopicId:void 0,leaderboardScore:0,updatedAt:new Date}),bs=async a=>{try{const s=Wa(et,"studentBattleStats",a),n=await Ya(s),c=tt()?Pe(a).stats:null;if(!n.exists())return c&&c.matchesPlayed>0?c:Se(a);const d=n.data(),l={...Se(a),...d,userId:a,updatedAt:at(d.updatedAt)};return c&&c.matchesPlayed>l.matchesPlayed?c:l}catch(s){if(console.error("Error loading battle stats:",s),tt()){const n=Pe(a).stats;if(n.matchesPlayed>0)return n}return Se(a)}},Mt=(a,s)=>({matchId:s.matchId||a,mode:s.mode||"online",status:s.status||"completed",subjectId:s.subjectId||"gen-math",topicId:s.topicId||"unknown-topic",difficulty:s.difficulty||"medium",rounds:s.rounds||0,timePerQuestionSec:s.timePerQuestionSec||0,scoreFor:s.scoreFor||0,scoreAgainst:s.scoreAgainst||0,outcome:s.outcome||"draw",accuracy:s.accuracy||0,averageResponseMs:s.averageResponseMs||0,bestStreak:s.bestStreak||0,xpEarned:s.xpEarned||0,opponentName:s.opponentName||"Unknown opponent",opponentType:s.opponentType||"student",createdAt:at(s.createdAt),endedAt:at(s.endedAt)}),fs=async(a,s={})=>{const n=s.limitCount||25,c=tt()?Pe(a).history:[],d=w=>w.filter(g=>!(s.mode&&s.mode!=="all"&&g.mode!==s.mode||s.subjectId&&g.subjectId!==s.subjectId||s.startDate&&g.endedAts.endDate)).sort((g,N)=>N.endedAt.getTime()-g.endedAt.getTime()).slice(0,n),l=w=>{if(c.length===0)return d(w);const C=new Map;return[...c,...w].forEach(g=>{C.set(g.matchId,g)}),d(Array.from(C.values()))};try{const w=[ta("studentId","==",a),pa("endedAt","desc"),zt(n)],g=(await Ct(It(Bt(et,"quizBattleHistory"),...w))).docs.map(N=>Mt(N.id,N.data()));return l(g)}catch(w){try{const g=(await Ct(It(Bt(et,"quizBattleHistory"),ta("studentId","==",a),zt(n)))).docs.map(N=>Mt(N.id,N.data())).sort((N,b)=>b.endedAt.getTime()-N.endedAt.getTime());return l(g)}catch(C){return console.error("Error loading battle history:",w,C),d(c)}}},gs=async a=>{const s=L(q,"quizBattleJoinQueue");try{return(await $("joining Quiz Battle matchmaking queue",s({setup:a}))).data}catch(n){if(ne(n))return ya("queued"),{success:!0,status:"queued",queueEntryId:`local-queue-${Date.now()}`};throw new Error(V("joining Quiz Battle matchmaking queue",n))}},oa=async()=>{const a=L(q,"quizBattleLeaveQueue");try{return(await $("leaving Quiz Battle matchmaking queue",a({}))).data}catch(s){if(ne(s))return ya("idle"),{success:!0,status:"idle"};throw new Error(V("leaving Quiz Battle matchmaking queue",s))}},ws=async a=>{const s=L(q,"quizBattleCreatePrivateRoom");try{return(await $("creating Quiz Battle private room",s({setup:a}))).data}catch(n){if(ne(n))return{success:!0,room:Rt()};throw new Error(V("creating Quiz Battle private room",n))}},vs=async a=>{const s=L(q,"quizBattleJoinPrivateRoom");try{return(await $("joining Quiz Battle private room",s({roomCode:a}),2e4)).data}catch(n){if(ne(n))return{success:!0,room:Rt(a.trim().toUpperCase()||void 0)};throw new Error(V("joining Quiz Battle private room",n))}},js=async a=>{const s=L(q,"quizBattleGetPrivateRoomState");try{return(await $("loading Quiz Battle private room state",s(a),2e4)).data}catch(n){if(ne(n))return{success:!0,room:Rt(a.roomCode?.trim().toUpperCase()||void 0)};throw new Error(V("loading Quiz Battle private room state",n))}},ys=async(a={})=>{const s=L(q,"quizBattleLeavePrivateRoom");try{return(await $("leaving Quiz Battle private room",s(a),2e4)).data}catch(n){if(ne(n))return{success:!0,status:"idle"};throw new Error(V("leaving Quiz Battle private room",n))}},la=async()=>{const a=L(q,"quizBattleResumeSession");try{return(await $("resuming Quiz Battle session",a({}),2e4)).data}catch(s){if(ne(s))return{success:!0,sessionType:"idle"};throw new Error(V("resuming Quiz Battle session",s))}},Ns=async(a,s)=>{if(!s.trim())return;const n=L(q,"quizBattleHeartbeat");await ms(a,s);try{await $("sending Quiz Battle heartbeat",n({scope:a,resourceId:s}),12e3)}catch(c){if(!ne(c))throw new Error(V("sending Quiz Battle heartbeat",c))}},ks=async a=>{const s=L(q,"quizBattleCreateBotMatch");try{return(await $("starting Quiz Battle bot match",s({setup:a}))).data}catch(n){if(ne(n))return cs(a);throw new Error(V("starting Quiz Battle bot match",n))}},_s=async a=>{const s=L(q,"quizBattleGetGenerationAudit");return(await $("verifying Quiz Battle generation metadata",s({matchId:a}),2e4)).data},re=async a=>{const s=L(q,"quizBattleStartMatch");try{const c=(await $("starting Quiz Battle match",s({matchId:a}),2e4)).data.match;if(c.mode==="online")try{const d=await _s(a);if(na&&!d.isAiSource)throw new Error(`Quiz Battle generation audit failed: expected AI source, got "${d.questionSetSource||"unknown"}".`)}catch(d){if(d instanceof Error&&d.message.startsWith("Quiz Battle generation audit failed"))throw d;if(console.warn("Quiz Battle generation audit unavailable:",d),na)throw new Error("Unable to verify Quiz Battle generation metadata. Please retry in a moment.")}return c}catch(n){throw new Error(V("starting Quiz Battle match",n))}},Nt=async a=>{const s=L(q,"quizBattleGetMatchState");try{return(await $("loading Quiz Battle match state",s({matchId:a}),2e4)).data.match}catch(n){throw new Error(V("loading Quiz Battle match state",n))}},Ss=async a=>{const s=L(q,"quizBattleSubmitAnswer");try{return(await $("submitting Quiz Battle answer",s({...a,idempotencyKey:a.idempotencyKey||`client-${Date.now()}-${Math.random().toString(16).slice(2,8)}`}),2e4)).data}catch(n){throw new Error(V("submitting Quiz Battle answer",n))}},As=async a=>{const s=L(q,"quizBattleRequestRematch");try{return(await $("creating Quiz Battle rematch",s({matchId:a}),2e4)).data}catch(n){throw new Error(V("creating Quiz Battle rematch",n))}},zs=async(a=20)=>{try{const s=It(Bt(et,"studentBattleLeaderboard"),pa("leaderboardScore","desc"),zt(a));return(await Ct(s)).docs.map((c,d)=>{const l=c.data();return{userId:l.userId||c.id,displayName:l.displayName||"Student",photo:l.photo,rank:l.rank||d+1,leaderboardScore:l.leaderboardScore||0,winRate:l.winRate||0,bestStreak:l.bestStreak||0}})}catch(s){return console.error("Error loading Quiz Battle leaderboard:",s),[]}};function pe({className:a,...s}){return e.jsx("div",{"data-slot":"card",className:u("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",a),...s})}function he({className:a,...s}){return e.jsx("div",{"data-slot":"card-header",className:u("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a),...s})}function be({className:a,...s}){return e.jsx("h4",{"data-slot":"card-title",className:u("leading-none",a),...s})}function Ne({className:a,...s}){return e.jsx("p",{"data-slot":"card-description",className:u("text-muted-foreground",a),...s})}function Xe({className:a,...s}){return e.jsx("div",{"data-slot":"card-content",className:u("px-6 [&:last-child]:pb-6",a),...s})}function Cs({className:a,...s}){return e.jsx(Ga,{"data-slot":"tabs",className:u("flex flex-col gap-2",a),...s})}function ke({className:a,...s}){return e.jsx(Za,{"data-slot":"tabs-content",className:u("flex-1 outline-none",a),...s})}const _a=Ft.memo(({playerRoundStreak:a,playerVisualMultiplier:s,liveXpEarned:n,activeMatch:c,subjects:d,battleSoundEnabled:l,onToggleSound:w,isFullscreen:C,onToggleFullscreen:g,isDesignPauseAvailable:N,onTogglePause:b})=>e.jsxs("header",{className:"flex items-center justify-between shrink-0 h-14 sm:h-16 relative gap-2 sm:gap-4",children:[e.jsx("div",{className:"flex items-center min-w-0",children:e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 md:gap-4 px-2.5 sm:px-4 py-1.5 sm:py-2 md:px-5 md:py-2.5 rounded-full bg-white/5 border border-white/10 backdrop-blur-md min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 text-amber-400 font-bold text-xs sm:text-sm shrink-0",children:[e.jsx(Oa,{className:"w-3 h-3 sm:w-4 sm:h-4"})," ",a]}),e.jsx("div",{className:"w-px h-3 sm:h-4 bg-white/10 shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 text-violet-300 font-bold text-xs sm:text-sm shrink-0",children:[e.jsx(At,{className:"w-3 h-3 sm:w-4 sm:h-4"})," ",s.toFixed(2),"x"]}),e.jsx("div",{className:"w-px h-3 sm:h-4 bg-white/10 shrink-0"}),e.jsxs(y.div,{animate:n>0?{scale:[1,1.25,1]}:{},transition:{duration:.35},className:"flex flex-col items-center text-emerald-400 bg-emerald-500/10 px-2 sm:px-3 py-0.5 rounded-full border border-emerald-500/20 font-bold shadow-[0_0_10px_rgba(16,185,129,0.15)] shrink-0",children:[e.jsxs("span",{className:"text-xs sm:text-sm leading-none tabular-nums",children:[n," pts"]}),e.jsx("span",{className:"hidden sm:block text-[8px] leading-none text-emerald-500/70 uppercase tracking-widest font-black whitespace-nowrap",children:"Battle Score"})]},n)]})}),e.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 hidden md:flex items-center gap-3 bg-black/20 px-5 py-2 rounded-full border border-white/5 min-w-0 max-w-[48%]",children:[e.jsx("div",{className:"w-3.5 h-3.5 rounded-sm bg-orange-400 shadow-[0_0_10px_rgba(251,146,60,0.5)] shrink-0"}),e.jsx("div",{className:"flex flex-col items-start justify-center -space-y-0.5 min-w-0",children:(()=>{if(!c?.topicId)return e.jsx("span",{className:"font-bold text-white/90 tracking-wide text-sm leading-none truncate",children:"Practice Match"});for(const j of d){const h=j.modules?.find(m=>m.id===c.topicId);if(h)return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[9px] font-black text-white/40 uppercase tracking-widest leading-none",children:j.title}),e.jsx("span",{className:"font-bold text-white/90 tracking-wide text-sm leading-none pt-1 truncate",children:h.title})]})}return e.jsx("span",{className:"font-bold text-white/90 tracking-wide text-sm leading-none truncate",children:c.topicId.split("-").map(j=>j.charAt(0).toUpperCase()+j.slice(1)).join(" ")})})()})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-3",children:[e.jsx(A,{variant:"outline",size:"icon",className:"h-9 w-9 sm:h-12 sm:w-12 rounded-full border-white/20 bg-black/20 hover:bg-white/10 text-white",onClick:w,children:l?e.jsx(fa,{className:"h-4 w-4 sm:h-5 sm:w-5"}):e.jsx(ga,{className:"h-4 w-4 sm:h-5 sm:w-5"})}),e.jsx(A,{variant:"outline",size:"icon",className:"hidden sm:flex h-12 w-12 rounded-full border-white/20 bg-black/20 hover:bg-white/10 text-white",onClick:g,children:C?e.jsx(ts,{className:"h-5 w-5"}):e.jsx(as,{className:"h-5 w-5"})}),e.jsx(A,{variant:"outline",size:"icon",className:u("h-9 w-9 sm:h-12 sm:w-12 rounded-full border-white/20 text-white",N?"bg-black/20 hover:bg-white/10":"bg-black/10 opacity-50 cursor-not-allowed"),onClick:b,disabled:!N,children:e.jsx(Ha,{className:"h-4 w-4 sm:h-5 sm:w-5"})})]})]}));_a.displayName="BattleHeader";const Sa=Ft.memo(({studentProfile:a,activeMatch:s,scorePulseTarget:n,quizBattleAvatar:c})=>e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 w-full xl:max-w-[1400px] mx-auto px-2 sm:px-4 md:px-8 shrink-0 h-28 sm:h-32 md:h-48 flex justify-between items-end pb-0 pointer-events-none z-30",children:[e.jsxs("div",{className:"flex items-end gap-1.5 sm:gap-3 md:gap-6 relative pointer-events-auto",children:[e.jsx("div",{className:"relative w-16 h-16 sm:w-28 sm:h-28 md:w-40 md:h-40 rounded-t-[40px] flex items-end",children:e.jsx(ss,{layers:a?.avatarLayers||{},className:"w-full h-full object-contain origin-bottom scale-[1.15]"})}),e.jsxs("div",{className:"bg-black/40 backdrop-blur-xl border border-white/20 rounded-xl sm:rounded-2xl px-2 sm:px-4 py-2 sm:py-3 md:px-5 shadow-[0_8px_30px_rgba(0,0,0,0.5)] flex items-center gap-1.5 sm:gap-3 md:gap-4 mb-2 sm:mb-4 max-w-[130px] sm:max-w-[220px] md:max-w-[280px]",children:[e.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[e.jsx("span",{className:"text-white font-black text-xs sm:text-base md:text-lg truncate tracking-wide",children:a?.name||"Player"}),e.jsxs("span",{className:"text-[9px] sm:text-xs md:text-sm text-white/50 font-bold uppercase tracking-wider",children:["Level ",a?.level||1]})]}),e.jsx("div",{className:"h-6 sm:h-10 w-px bg-white/20"}),e.jsxs("div",{className:"flex flex-col items-center justify-center shrink-0 w-6 sm:w-10 md:w-12",children:[e.jsx(y.span,{animate:n==="player"?{scale:[1,1.4,1],color:["#fff","#34d399","#fff"]}:{},transition:{duration:.5},className:"text-lg sm:text-2xl md:text-3xl font-black text-white leading-none",children:s.scoreFor}),e.jsx("span",{className:"text-[7px] sm:text-[9px] md:text-[10px] text-emerald-400 font-bold uppercase tracking-widest mt-0.5 sm:mt-1 leading-none",children:"Score"})]})]})]}),e.jsxs("div",{className:"flex items-end gap-1.5 sm:gap-3 md:gap-6 relative flex-row-reverse pointer-events-auto",children:[e.jsx("div",{className:"relative w-16 h-16 sm:w-28 sm:h-28 md:w-40 md:h-40 bg-[#1a2030] rounded-t-[40px] flex items-end justify-center border-t-4 border-slate-700/50 shadow-inner",children:s.mode==="bot"?e.jsx(Te,{className:"h-8 w-8 sm:h-16 sm:w-16 md:h-20 md:w-20 text-rose-400 mb-3 sm:mb-6 drop-shadow-xl",strokeWidth:1.5}):e.jsx(ge,{className:"h-8 w-8 sm:h-16 sm:w-16 md:h-20 md:w-20 text-slate-500 mb-3 sm:mb-6 drop-shadow-xl",strokeWidth:1.5})}),e.jsxs("div",{className:"bg-black/40 backdrop-blur-xl border border-white/20 rounded-xl sm:rounded-2xl px-2 sm:px-4 py-2 sm:py-3 md:px-5 shadow-[0_8px_30px_rgba(0,0,0,0.5)] flex items-center gap-1.5 sm:gap-3 md:gap-4 mb-2 sm:mb-4 flex-row-reverse text-right max-w-[130px] sm:max-w-[220px] md:max-w-[280px]",children:[e.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[e.jsx("span",{className:"text-white font-black text-xs sm:text-base md:text-lg truncate tracking-wide",children:s.opponentName||"Anonymous"}),e.jsx("span",{className:"text-[9px] sm:text-xs md:text-sm text-rose-400 font-bold uppercase tracking-wider",children:s.mode==="bot"?"System Bot":"Challenger"})]}),e.jsx("div",{className:"h-6 sm:h-10 w-px bg-white/20"}),e.jsxs("div",{className:"flex flex-col items-center justify-center shrink-0 w-6 sm:w-10 md:w-12",children:[e.jsx(y.span,{animate:n==="opponent"?{scale:[1,1.4,1],color:["#fff","#fb7185","#fff"]}:{},transition:{duration:.5},className:"text-lg sm:text-2xl md:text-3xl font-black text-white leading-none",children:s.scoreAgainst}),e.jsx("span",{className:"text-[7px] sm:text-[9px] md:text-[10px] text-rose-400 font-bold uppercase tracking-widest mt-0.5 sm:mt-1 leading-none",children:"Score"})]})]})]})]}));Sa.displayName="BattleFooter";const Aa=Ft.memo(({activeMatch:a,roundSecondsLeft:s,lastRoundResult:n,selectedOptionIndex:c,roundLocked:d,answerSubmitting:l,designPauseActive:w,onOptionSelect:C,floatingMomentum:g,lastRoundMomentumDelta:N,studentProfile:b,quizBattleAvatar:j})=>e.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center gap-4 md:gap-6 w-full min-h-0 overflow-y-auto pt-4 pb-28 z-20 no-scrollbar",children:[e.jsxs("div",{className:u("relative bg-[#1e2536] border shadow-[0_20px_60px_rgba(0,0,0,0.4)] rounded-[1.5rem] p-5 md:p-6 w-full max-w-4xl text-center flex flex-col items-center",s<=3?"border-rose-400/50":"border-white/10"),children:[e.jsxs("div",{className:"absolute -top-3.5 bg-[#2f3547] border border-white/10 text-white/80 px-4 py-1 rounded-full text-xs font-black shadow-lg uppercase tracking-wider",children:[a.currentRound," / ",a.totalRounds]}),e.jsx(Ze,{children:g&&g.tone==="positive"&&e.jsx(y.div,{initial:{opacity:0,y:14,scale:.92},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.9},className:u("absolute -top-12 rounded-full border px-3 py-1 text-[10px] font-black uppercase tracking-[0.15em] backdrop-blur-lg",g.tone==="positive"?"border-emerald-300/70 bg-emerald-500/20 text-emerald-100":g.tone==="negative"?"border-rose-300/70 bg-rose-500/20 text-rose-100":"border-slate-300/50 bg-slate-500/20 text-slate-100"),children:g.label},g.id)}),e.jsx("p",{className:"text-base sm:text-lg md:text-xl text-white font-extrabold leading-tight tracking-tight mt-1 min-h-[40px] flex items-center justify-center",children:a.currentQuestion?.prompt}),typeof window<"u"&&window.location.search.includes("debug=true")&&a.currentQuestion?.varianceApplied&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2 justify-center",children:a.currentQuestion.varianceApplied.map(h=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-medium bg-blue-500/20 text-blue-200 border border-blue-400/30",children:h.replace(/_/g," ")},h))})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 md:gap-4 w-full max-w-4xl px-4",children:a.currentQuestion?.choices.map((h,m)=>{const v=c===m,W=l||d,S=!!n&&n.roundNumber===a.currentRound,R=S&&n.correctOptionIndex===m;let Y=-1;if(S)if(a.mode==="bot")if(n.botCorrect)Y=n.correctOptionIndex;else{const D=[0,1,2,3].filter(z=>z!==n.correctOptionIndex);Y=D[n.roundNumber%D.length]}else Y=typeof n.botSelectedIndex=="number"?n.botSelectedIndex:-1;const O=Y===m;let M="bg-[#1e2433] hover:bg-[#283042] border-[#2f384e] text-white shadow-[0_6px_0_rgba(15,20,30,0.5)]";return S?R?M="bg-emerald-500 text-emerald-950 border-emerald-400 shadow-[0_6px_0_rgba(5,150,105,1)]":v?M="bg-rose-500 text-white border-rose-400 shadow-[0_6px_0_rgba(225,29,72,1)]":M="bg-[#1e2433] opacity-40 border-[#2f384e] shadow-[0_6px_0_rgba(15,20,30,0.5)] text-white":v&&(M="bg-indigo-500 text-white border-indigo-400 shadow-[0_6px_0_rgba(79,70,229,1)]"),e.jsxs(y.button,{whileTap:{y:8,scale:.98},whileHover:!S&&!W?{scale:1.02}:{},disabled:W||d||w,onClick:()=>C(m),className:u("relative h-16 md:h-20 rounded-2xl md:rounded-3xl font-black text-base md:text-lg pl-6 pr-20 border-[2px] border-b-[4px] flex items-center justify-start text-left transition-all disabled:cursor-not-allowed",M,v&&!S?"ring-[4px] ring-white/20 ring-offset-[4px] ring-offset-[#0B0F19]":"",s<=3&&!W&&!S?"shadow-[0_0_0_2px_rgba(251,113,133,0.45),0_6px_0_rgba(127,29,29,1)]":""),children:[e.jsx("span",{className:"mr-3 md:mr-4 text-xs md:text-sm opacity-60 bg-black/20 px-3 py-1 rounded-full",children:String.fromCharCode(65+m)}),e.jsx("span",{className:"line-clamp-2",children:h}),e.jsxs("div",{className:"absolute right-3 md:right-4 flex items-center gap-1.5 md:gap-2",children:[O&&e.jsx(y.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},className:"w-8 h-8 md:w-10 md:h-10 rounded-full border-[3px] border-[#0B0F19] overflow-hidden bg-rose-500 shadow-lg flex items-center justify-center z-10",children:a.mode==="bot"?e.jsx(Te,{className:"w-4 h-4 md:w-5 md:h-5 text-white"}):e.jsx(ge,{className:"w-4 h-4 md:w-5 md:h-5 text-white"})}),v&&e.jsx(y.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},className:"w-8 h-8 md:w-10 md:h-10 rounded-full border-[3px] border-[#0B0F19] overflow-hidden bg-indigo-200 shadow-lg z-20",children:e.jsx("img",{src:b?.photo||j,alt:"You",className:"w-full h-full object-cover"})})]})]},m)})}),e.jsx(Ze,{children:d&&!n&&a.mode==="online"&&e.jsxs(y.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"mt-4 flex flex-col items-center gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white/70 font-semibold bg-black/30 px-6 py-2 rounded-full border border-white/10",children:[e.jsx(Ke,{className:"w-4 h-4 animate-spin text-amber-400"}),"Waiting for opponent..."]}),e.jsx("p",{className:"text-white/30 text-[11px] mt-1",children:"Choices locked until round resolves"})]})}),e.jsx(Ze,{children:n?.studentCorrect&&e.jsx(y.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{type:"spring",damping:20,stiffness:300},className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[100] pointer-events-none flex flex-col items-center justify-center",children:e.jsxs("div",{className:"bg-[#1e2433]/95 backdrop-blur-xl border border-white/10 rounded-[2rem] p-6 md:p-8 shadow-[0_30px_80px_rgba(0,0,0,0.6)] flex flex-col items-center min-w-[280px] md:min-w-[320px]",children:[e.jsx("img",{src:j,alt:"Mascot",className:"w-24 h-24 md:w-32 md:h-32 mb-4 drop-shadow-xl"}),e.jsx("h2",{className:u("text-3xl md:text-4xl font-black mb-4 uppercase tracking-widest",n.studentCorrect?"text-emerald-400":"text-rose-400"),children:n.studentCorrect?"Correct!":"Incorrect"}),n.studentCorrect?e.jsxs("div",{className:"flex items-center gap-3 w-full justify-center",children:[e.jsx("div",{className:"flex items-center gap-2 bg-emerald-500/20 text-emerald-400 px-4 py-2 rounded-2xl font-bold border border-emerald-500/30",children:e.jsx("span",{children:"+ 10 XP"})}),N!==null&&N>0&&e.jsx("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-2 rounded-2xl font-bold border border-amber-500/30",children:e.jsxs("span",{children:["+ ",N," ",e.jsx(Je,{className:"w-4 h-4 inline"})]})})]}):e.jsxs("div",{className:"bg-rose-500/20 border border-rose-500/30 text-rose-400 font-bold px-5 py-2 rounded-xl text-center",children:["Correct: ",String.fromCharCode(65+n.correctOptionIndex)]})]})})})]}));Aa.displayName="BattleActiveContent";const kt={width:1280,height:720},_t=` + */const ns=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],os=ma("pause",ns),We=({width:a,x:s,delay:n,duration:c})=>{const d=["#9956DE","#7274ED","#1FA7E1","#6ED1CF","#75D06A","#FFB356","#FF8B8B","#FB96BB"],l=d[Math.floor(Math.random()*d.length)],w=Math.floor(Math.random()*10)+1;return e.jsx(y.div,{style:{"--x":`${s}`,"--width":`${a}`,"--aspect-ratio":`${w}`,"--background":`linear-gradient(${l}cc, transparent)`},className:"absolute left-[var(--x)] top-0 [aspect-ratio:1/var(--aspect-ratio)] [background:var(--background)] [width:var(--width)]",initial:{y:"100cqmax",x:"-50%"},animate:{y:"-100%",x:"-50%"},transition:{duration:c,delay:n,repeat:Number.POSITIVE_INFINITY,ease:"linear"}})},ra=({children:a,perspective:s=100,className:n,bgVideo:c,beamsPerSide:d=6,beamSize:l=4,beamDelayMax:w=1.5,beamDelayMin:C=0,beamDuration:g=4,gridColor:N="rgba(100, 116, 139, 0.08)",...b})=>{const j=i.useCallback(()=>{const S=[],Y=Math.floor(100/l)/d;for(let O=0;Oj(),[j]),m=i.useMemo(()=>j(),[j]),v=i.useMemo(()=>j(),[j]),W=i.useMemo(()=>j(),[j]);return e.jsxs("div",{className:u("relative w-full h-full",n),...b,children:[c?e.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"pointer-events-none absolute inset-0 w-full h-full object-cover -z-10",src:c}):e.jsxs("div",{style:{"--perspective":`${s}px`,"--grid-color":N,"--beam-size":`${l}%`},className:"pointer-events-none absolute inset-0 overflow-hidden [clip-path:inset(0)] [container-type:size] [perspective:var(--perspective)] [transform-style:preserve-3d] -z-10 bg-[#42389d]",children:[e.jsx("div",{className:"absolute [transform-style:preserve-3d] [background-size:var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,_var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] [container-type:inline-size] [height:100cqmax] [transform-origin:50%_0%] [transform:rotateX(-90deg)] [width:100cqi]",children:h.map((S,R)=>e.jsx(We,{width:`${l}%`,x:`${S.x*l}%`,delay:S.delay,duration:g},`top-${R}`))}),e.jsx("div",{className:"absolute top-full [transform-style:preserve-3d] [background-size:var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,_var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] [container-type:inline-size] [height:100cqmax] [transform-origin:50%_0%] [transform:rotateX(-90deg)] [width:100cqi]",children:v.map((S,R)=>e.jsx(We,{width:`${l}%`,x:`${S.x*l}%`,delay:S.delay,duration:g},`bottom-${R}`))}),e.jsx("div",{className:"absolute left-0 top-0 [transform-style:preserve-3d] [background-size:var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,_var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] [container-type:inline-size] [height:100cqmax] [transform-origin:0%_0%] [transform:rotate(90deg)_rotateX(-90deg)] [width:100cqh]",children:W.map((S,R)=>e.jsx(We,{width:`${l}%`,x:`${S.x*l}%`,delay:S.delay,duration:g},`left-${R}`))}),e.jsx("div",{className:"absolute right-0 top-0 [transform-style:preserve-3d] [background-size:var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,_var(--grid-color)_0_1px,_transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] [container-type:inline-size] [height:100cqmax] [width:100cqh] [transform-origin:100%_0%] [transform:rotate(-90deg)_rotateX(-90deg)]",children:m.map((S,R)=>e.jsx(We,{width:`${l}%`,x:`${S.x*l}%`,delay:S.delay,duration:g},`right-${R}`))})]}),e.jsx("div",{className:"relative z-10 w-full h-full",children:a})]})},ls=15e3,is="mathpulse.quizBattle.local",na="".toLowerCase()==="true",rt=typeof window<"u",tt=()=>rt&&!1,Et=()=>{const a=st.currentUser?.uid;return a||"local-student"},wa=a=>`${is}.${a}`,Pe=a=>{const s={stats:Se(a),history:[],queueStatus:"idle"};if(!rt)return s;try{const n=window.localStorage.getItem(wa(a));if(!n)return s;const c=JSON.parse(n),d=Array.isArray(c.history)?c.history.map(w=>Mt(w.matchId||"local-match",w)):[];return{stats:c.stats?{...Se(a),...c.stats,userId:a,updatedAt:at(c.stats.updatedAt)}:Se(a),history:d,queueStatus:c.queueStatus==="queued"||c.queueStatus==="matched"?c.queueStatus:"idle"}}catch(n){return console.error("Error reading local Quiz Battle fallback store:",n),s}},va=(a,s)=>{if(rt)try{window.localStorage.setItem(wa(a),JSON.stringify(s))}catch(n){console.error("Error writing local Quiz Battle fallback store:",n)}},ja=a=>{const s=a||{},n=typeof s.code=="string"?s.code:"";return n?n.startsWith("functions/")?n.replace("functions/",""):n:""},ne=a=>{if(!tt())return!1;const s=ja(a);if(["internal","not-found","unavailable","deadline-exceeded"].includes(s))return!0;const n=a||{},c=(typeof n.message=="string"?n.message:a instanceof Error?a.message:"").toLowerCase();return c?c.includes("cors policy")||c.includes("no access-control-allow-origin")||c.includes("failed to fetch")||c.includes("network error")||c.includes("err_failed"):!1},Ye=(a,s)=>Math.floor(Math.random()*(s-a+1))+a,ds=(a,s)=>{const n=Math.max(3,a),c=s==="easy"?0:s==="medium"?1:s==="hard"?2:1,d=Ye(Math.max(0,n-3-c),n),l=Ye(Math.max(0,n-4+c),n),w=Math.min(n,Math.max(0,d)),C=Math.min(n,Math.max(0,l)),g=Math.max(0,Math.min(100,w/n*100+Ye(-8,6))),N=Ye(1800,6200);return{scoreFor:w,scoreAgainst:C,accuracy:g,averageResponseMs:N}},cs=a=>{const s=Et(),n=Pe(s),c=`local-bot-${Date.now()}-${Math.random().toString(16).slice(2,8)}`,d=ds(a.rounds,a.botDifficulty),l=d.scoreFor>d.scoreAgainst?"win":d.scoreFor0?m/h*100:0,averageAccuracy:h>0?(n.stats.averageAccuracy*n.stats.matchesPlayed+d.accuracy)/h:d.accuracy,averageResponseMs:h>0?Math.round((n.stats.averageResponseMs*n.stats.matchesPlayed+d.averageResponseMs)/h):d.averageResponseMs,currentStreak:S,bestStreak:R,favoriteTopicId:a.topicId,leaderboardScore:n.stats.leaderboardScore+j.xpEarned,updatedAt:w};va(s,{stats:Y,history:[j,...n.history].slice(0,50),queueStatus:"idle"});try{xa(async()=>{const{emitPipelineEvent:O,getStudentContext:M}=await import("./pipelineService-CMil_uZC.js");return{emitPipelineEvent:O,getStudentContext:M}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({emitPipelineEvent:O,getStudentContext:M})=>{const D=M();D&&O({student_id:s,event_type:"battle",event_data:{battle_id:c,topic:a.topicId,score:d.accuracy,won:l==="win",total_questions:a.rounds,correct_answers:d.scoreFor},occurred_at:new Date().toISOString(),class_id:D.classId,teacher_id:D.teacherId})}).catch(()=>{})}catch{}return{success:!0,matchId:c,status:"ready",botDifficulty:a.botDifficulty}},ya=a=>{const s=Et(),n=Pe(s);va(s,{...n,queueStatus:a})},us=()=>Math.random().toString(36).slice(2,8).toUpperCase(),Rt=a=>{const s=Et();return{roomId:`local-room-${Date.now()}`,roomCode:a||us(),ownerStudentId:s,participantIds:[s],participantCount:1,status:"waiting",subjectId:"gen-math",topicId:"functions",difficulty:"medium",rounds:5,timePerQuestionSec:30,isOwner:!0}},Na=()=>rt&&!!st.currentUser?.uid&&!!De,ka=(a,s,n)=>`quizBattlePresence/${a}/${s}/${n}`,ms=async(a,s)=>{if(!Na()||!s.trim()||!De)return;const n=st.currentUser?.uid;if(!n)return;const c=ha(De,ka(a,s,n));try{await ba(c,{studentId:n,scope:a,resourceId:s,online:!0,heartbeatAt:_e(),updatedAt:_e()}),await Xa(c).update({online:!1,updatedAt:_e(),disconnectedAt:_e()})}catch(d){console.warn("Realtime presence connect failed:",d)}},xs=async(a,s)=>{if(!Na()||!s.trim()||!De)return;const n=st.currentUser?.uid;if(!n)return;const c=ha(De,ka(a,s,n));try{await ba(c,{studentId:n,scope:a,resourceId:s,online:!1,updatedAt:_e(),disconnectedAt:_e()})}catch(d){console.warn("Realtime presence disconnect failed:",d)}},V=(a,s)=>{const n=`Unable to continue while ${a}. Please try again.`;if(s instanceof Error&&s.message.startsWith("Timed out while"))return s.message;const c=s||{},d=ja(s),l=typeof c.message=="string"?c.message.trim():"";return d==="unauthenticated"?"Your session has expired. Sign in again before starting a battle.":d==="permission-denied"?"Only student accounts can access Quiz Battle matchmaking.":d==="invalid-argument"?l||"Battle setup is invalid. Review the selected options and try again.":d==="already-exists"?l||"This room is already full. Try another room code.":d==="failed-precondition"?l||"Battle state changed. Please refresh and continue.":d==="unavailable"||d==="internal"||d==="not-found"||d==="deadline-exceeded"?/question generation temporarily unavailable/i.test(l)?l:"Quiz Battle service is temporarily unavailable. Please retry in a moment.":n},$=async(a,s,n=ls)=>{let c;try{return await Promise.race([s,new Promise((d,l)=>{c=setTimeout(()=>{l(new Error(`Timed out while ${a}. Please try again.`))},n)})])}finally{c&&clearTimeout(c)}},at=a=>{if(!a)return new Date;if(a instanceof Date)return a;if(typeof a=="string"){const s=Date.parse(a);return Number.isNaN(s)?new Date:new Date(s)}if(typeof a=="number")return new Date(a);if(typeof a=="object"){const s=a;if(typeof s.toDate=="function")return s.toDate();if(typeof s.seconds=="number")return new Date(s.seconds*1e3)}return new Date},ps=()=>({mode:"online",subjectId:"gen-math",topicId:"",difficulty:"medium",rounds:5,timePerQuestionSec:30,queueType:"public_matchmaking",botDifficulty:"medium",adaptiveBot:!1}),hs=a=>{const s=[];return a.subjectId.trim()||s.push({field:"subjectId",message:"Choose a category before starting."}),a.topicId.trim()||s.push({field:"topicId",message:"Choose a strand or topic before starting."}),(a.rounds<3||a.rounds>20)&&s.push({field:"rounds",message:"Questions must be between 3 and 20."}),(a.timePerQuestionSec<10||a.timePerQuestionSec>180)&&s.push({field:"timePerQuestionSec",message:"Timer must be between 10s and 180s."}),a.mode==="bot"&&a.queueType!=="public_matchmaking"&&s.push({field:"queueType",message:"Bot battles use instant start and do not support private room mode."}),s},Se=a=>({userId:a,matchesPlayed:0,wins:0,losses:0,draws:0,winRate:0,averageAccuracy:0,averageResponseMs:0,bestStreak:0,currentStreak:0,favoriteTopicId:void 0,leaderboardScore:0,updatedAt:new Date}),bs=async a=>{try{const s=Wa(et,"studentBattleStats",a),n=await Ya(s),c=tt()?Pe(a).stats:null;if(!n.exists())return c&&c.matchesPlayed>0?c:Se(a);const d=n.data(),l={...Se(a),...d,userId:a,updatedAt:at(d.updatedAt)};return c&&c.matchesPlayed>l.matchesPlayed?c:l}catch(s){if(console.error("Error loading battle stats:",s),tt()){const n=Pe(a).stats;if(n.matchesPlayed>0)return n}return Se(a)}},Mt=(a,s)=>({matchId:s.matchId||a,mode:s.mode||"online",status:s.status||"completed",subjectId:s.subjectId||"gen-math",topicId:s.topicId||"unknown-topic",difficulty:s.difficulty||"medium",rounds:s.rounds||0,timePerQuestionSec:s.timePerQuestionSec||0,scoreFor:s.scoreFor||0,scoreAgainst:s.scoreAgainst||0,outcome:s.outcome||"draw",accuracy:s.accuracy||0,averageResponseMs:s.averageResponseMs||0,bestStreak:s.bestStreak||0,xpEarned:s.xpEarned||0,opponentName:s.opponentName||"Unknown opponent",opponentType:s.opponentType||"student",createdAt:at(s.createdAt),endedAt:at(s.endedAt)}),fs=async(a,s={})=>{const n=s.limitCount||25,c=tt()?Pe(a).history:[],d=w=>w.filter(g=>!(s.mode&&s.mode!=="all"&&g.mode!==s.mode||s.subjectId&&g.subjectId!==s.subjectId||s.startDate&&g.endedAts.endDate)).sort((g,N)=>N.endedAt.getTime()-g.endedAt.getTime()).slice(0,n),l=w=>{if(c.length===0)return d(w);const C=new Map;return[...c,...w].forEach(g=>{C.set(g.matchId,g)}),d(Array.from(C.values()))};try{const w=[ta("studentId","==",a),pa("endedAt","desc"),zt(n)],g=(await Ct(It(Bt(et,"quizBattleHistory"),...w))).docs.map(N=>Mt(N.id,N.data()));return l(g)}catch(w){try{const g=(await Ct(It(Bt(et,"quizBattleHistory"),ta("studentId","==",a),zt(n)))).docs.map(N=>Mt(N.id,N.data())).sort((N,b)=>b.endedAt.getTime()-N.endedAt.getTime());return l(g)}catch(C){return console.error("Error loading battle history:",w,C),d(c)}}},gs=async a=>{const s=L(q,"quizBattleJoinQueue");try{return(await $("joining Quiz Battle matchmaking queue",s({setup:a}))).data}catch(n){if(ne(n))return ya("queued"),{success:!0,status:"queued",queueEntryId:`local-queue-${Date.now()}`};throw new Error(V("joining Quiz Battle matchmaking queue",n))}},oa=async()=>{const a=L(q,"quizBattleLeaveQueue");try{return(await $("leaving Quiz Battle matchmaking queue",a({}))).data}catch(s){if(ne(s))return ya("idle"),{success:!0,status:"idle"};throw new Error(V("leaving Quiz Battle matchmaking queue",s))}},ws=async a=>{const s=L(q,"quizBattleCreatePrivateRoom");try{return(await $("creating Quiz Battle private room",s({setup:a}))).data}catch(n){if(ne(n))return{success:!0,room:Rt()};throw new Error(V("creating Quiz Battle private room",n))}},vs=async a=>{const s=L(q,"quizBattleJoinPrivateRoom");try{return(await $("joining Quiz Battle private room",s({roomCode:a}),2e4)).data}catch(n){if(ne(n))return{success:!0,room:Rt(a.trim().toUpperCase()||void 0)};throw new Error(V("joining Quiz Battle private room",n))}},js=async a=>{const s=L(q,"quizBattleGetPrivateRoomState");try{return(await $("loading Quiz Battle private room state",s(a),2e4)).data}catch(n){if(ne(n))return{success:!0,room:Rt(a.roomCode?.trim().toUpperCase()||void 0)};throw new Error(V("loading Quiz Battle private room state",n))}},ys=async(a={})=>{const s=L(q,"quizBattleLeavePrivateRoom");try{return(await $("leaving Quiz Battle private room",s(a),2e4)).data}catch(n){if(ne(n))return{success:!0,status:"idle"};throw new Error(V("leaving Quiz Battle private room",n))}},la=async()=>{const a=L(q,"quizBattleResumeSession");try{return(await $("resuming Quiz Battle session",a({}),2e4)).data}catch(s){if(ne(s))return{success:!0,sessionType:"idle"};throw new Error(V("resuming Quiz Battle session",s))}},Ns=async(a,s)=>{if(!s.trim())return;const n=L(q,"quizBattleHeartbeat");await ms(a,s);try{await $("sending Quiz Battle heartbeat",n({scope:a,resourceId:s}),12e3)}catch(c){if(!ne(c))throw new Error(V("sending Quiz Battle heartbeat",c))}},ks=async a=>{const s=L(q,"quizBattleCreateBotMatch");try{return(await $("starting Quiz Battle bot match",s({setup:a}))).data}catch(n){if(ne(n))return cs(a);throw new Error(V("starting Quiz Battle bot match",n))}},_s=async a=>{const s=L(q,"quizBattleGetGenerationAudit");return(await $("verifying Quiz Battle generation metadata",s({matchId:a}),2e4)).data},re=async a=>{const s=L(q,"quizBattleStartMatch");try{const c=(await $("starting Quiz Battle match",s({matchId:a}),2e4)).data.match;if(c.mode==="online")try{const d=await _s(a);if(na&&!d.isAiSource)throw new Error(`Quiz Battle generation audit failed: expected AI source, got "${d.questionSetSource||"unknown"}".`)}catch(d){if(d instanceof Error&&d.message.startsWith("Quiz Battle generation audit failed"))throw d;if(console.warn("Quiz Battle generation audit unavailable:",d),na)throw new Error("Unable to verify Quiz Battle generation metadata. Please retry in a moment.")}return c}catch(n){throw new Error(V("starting Quiz Battle match",n))}},Nt=async a=>{const s=L(q,"quizBattleGetMatchState");try{return(await $("loading Quiz Battle match state",s({matchId:a}),2e4)).data.match}catch(n){throw new Error(V("loading Quiz Battle match state",n))}},Ss=async a=>{const s=L(q,"quizBattleSubmitAnswer");try{return(await $("submitting Quiz Battle answer",s({...a,idempotencyKey:a.idempotencyKey||`client-${Date.now()}-${Math.random().toString(16).slice(2,8)}`}),2e4)).data}catch(n){throw new Error(V("submitting Quiz Battle answer",n))}},As=async a=>{const s=L(q,"quizBattleRequestRematch");try{return(await $("creating Quiz Battle rematch",s({matchId:a}),2e4)).data}catch(n){throw new Error(V("creating Quiz Battle rematch",n))}},zs=async(a=20)=>{try{const s=It(Bt(et,"studentBattleLeaderboard"),pa("leaderboardScore","desc"),zt(a));return(await Ct(s)).docs.map((c,d)=>{const l=c.data();return{userId:l.userId||c.id,displayName:l.displayName||"Student",photo:l.photo,rank:l.rank||d+1,leaderboardScore:l.leaderboardScore||0,winRate:l.winRate||0,bestStreak:l.bestStreak||0}})}catch(s){return console.error("Error loading Quiz Battle leaderboard:",s),[]}};function pe({className:a,...s}){return e.jsx("div",{"data-slot":"card",className:u("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",a),...s})}function he({className:a,...s}){return e.jsx("div",{"data-slot":"card-header",className:u("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a),...s})}function be({className:a,...s}){return e.jsx("h4",{"data-slot":"card-title",className:u("leading-none",a),...s})}function Ne({className:a,...s}){return e.jsx("p",{"data-slot":"card-description",className:u("text-muted-foreground",a),...s})}function Xe({className:a,...s}){return e.jsx("div",{"data-slot":"card-content",className:u("px-6 [&:last-child]:pb-6",a),...s})}function Cs({className:a,...s}){return e.jsx(Ga,{"data-slot":"tabs",className:u("flex flex-col gap-2",a),...s})}function ke({className:a,...s}){return e.jsx(Za,{"data-slot":"tabs-content",className:u("flex-1 outline-none",a),...s})}const _a=Ft.memo(({playerRoundStreak:a,playerVisualMultiplier:s,liveXpEarned:n,activeMatch:c,subjects:d,battleSoundEnabled:l,onToggleSound:w,isFullscreen:C,onToggleFullscreen:g,isDesignPauseAvailable:N,onTogglePause:b})=>e.jsxs("header",{className:"flex items-center justify-between shrink-0 h-14 sm:h-16 relative gap-2 sm:gap-4",children:[e.jsx("div",{className:"flex items-center min-w-0",children:e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 md:gap-4 px-2.5 sm:px-4 py-1.5 sm:py-2 md:px-5 md:py-2.5 rounded-full bg-white/5 border border-white/10 backdrop-blur-md min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 text-amber-400 font-bold text-xs sm:text-sm shrink-0",children:[e.jsx(Oa,{className:"w-3 h-3 sm:w-4 sm:h-4"})," ",a]}),e.jsx("div",{className:"w-px h-3 sm:h-4 bg-white/10 shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 text-violet-300 font-bold text-xs sm:text-sm shrink-0",children:[e.jsx(At,{className:"w-3 h-3 sm:w-4 sm:h-4"})," ",s.toFixed(2),"x"]}),e.jsx("div",{className:"w-px h-3 sm:h-4 bg-white/10 shrink-0"}),e.jsxs(y.div,{animate:n>0?{scale:[1,1.25,1]}:{},transition:{duration:.35},className:"flex flex-col items-center text-emerald-400 bg-emerald-500/10 px-2 sm:px-3 py-0.5 rounded-full border border-emerald-500/20 font-bold shadow-[0_0_10px_rgba(16,185,129,0.15)] shrink-0",children:[e.jsxs("span",{className:"text-xs sm:text-sm leading-none tabular-nums",children:[n," pts"]}),e.jsx("span",{className:"hidden sm:block text-[8px] leading-none text-emerald-500/70 uppercase tracking-widest font-black whitespace-nowrap",children:"Battle Score"})]},n)]})}),e.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 hidden md:flex items-center gap-3 bg-black/20 px-5 py-2 rounded-full border border-white/5 min-w-0 max-w-[48%]",children:[e.jsx("div",{className:"w-3.5 h-3.5 rounded-sm bg-orange-400 shadow-[0_0_10px_rgba(251,146,60,0.5)] shrink-0"}),e.jsx("div",{className:"flex flex-col items-start justify-center -space-y-0.5 min-w-0",children:(()=>{if(!c?.topicId)return e.jsx("span",{className:"font-bold text-white/90 tracking-wide text-sm leading-none truncate",children:"Practice Match"});for(const j of d){const h=j.modules?.find(m=>m.id===c.topicId);if(h)return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[9px] font-black text-white/40 uppercase tracking-widest leading-none",children:j.title}),e.jsx("span",{className:"font-bold text-white/90 tracking-wide text-sm leading-none pt-1 truncate",children:h.title})]})}return e.jsx("span",{className:"font-bold text-white/90 tracking-wide text-sm leading-none truncate",children:c.topicId.split("-").map(j=>j.charAt(0).toUpperCase()+j.slice(1)).join(" ")})})()})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-3",children:[e.jsx(A,{variant:"outline",size:"icon",className:"h-9 w-9 sm:h-12 sm:w-12 rounded-full border-white/20 bg-black/20 hover:bg-white/10 text-white",onClick:w,children:l?e.jsx(fa,{className:"h-4 w-4 sm:h-5 sm:w-5"}):e.jsx(ga,{className:"h-4 w-4 sm:h-5 sm:w-5"})}),e.jsx(A,{variant:"outline",size:"icon",className:"hidden sm:flex h-12 w-12 rounded-full border-white/20 bg-black/20 hover:bg-white/10 text-white",onClick:g,children:C?e.jsx(ts,{className:"h-5 w-5"}):e.jsx(as,{className:"h-5 w-5"})}),e.jsx(A,{variant:"outline",size:"icon",className:u("h-9 w-9 sm:h-12 sm:w-12 rounded-full border-white/20 text-white",N?"bg-black/20 hover:bg-white/10":"bg-black/10 opacity-50 cursor-not-allowed"),onClick:b,disabled:!N,children:e.jsx(Ha,{className:"h-4 w-4 sm:h-5 sm:w-5"})})]})]}));_a.displayName="BattleHeader";const Sa=Ft.memo(({studentProfile:a,activeMatch:s,scorePulseTarget:n,quizBattleAvatar:c})=>e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 w-full xl:max-w-[1400px] mx-auto px-2 sm:px-4 md:px-8 shrink-0 h-28 sm:h-32 md:h-48 flex justify-between items-end pb-0 pointer-events-none z-30",children:[e.jsxs("div",{className:"flex items-end gap-1.5 sm:gap-3 md:gap-6 relative pointer-events-auto",children:[e.jsx("div",{className:"relative w-16 h-16 sm:w-28 sm:h-28 md:w-40 md:h-40 rounded-t-[40px] flex items-end",children:e.jsx(ss,{layers:a?.avatarLayers||{},className:"w-full h-full object-contain origin-bottom scale-[1.15]"})}),e.jsxs("div",{className:"bg-black/40 backdrop-blur-xl border border-white/20 rounded-xl sm:rounded-2xl px-2 sm:px-4 py-2 sm:py-3 md:px-5 shadow-[0_8px_30px_rgba(0,0,0,0.5)] flex items-center gap-1.5 sm:gap-3 md:gap-4 mb-2 sm:mb-4 max-w-[130px] sm:max-w-[220px] md:max-w-[280px]",children:[e.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[e.jsx("span",{className:"text-white font-black text-xs sm:text-base md:text-lg truncate tracking-wide",children:a?.name||"Player"}),e.jsxs("span",{className:"text-[9px] sm:text-xs md:text-sm text-white/50 font-bold uppercase tracking-wider",children:["Level ",a?.level||1]})]}),e.jsx("div",{className:"h-6 sm:h-10 w-px bg-white/20"}),e.jsxs("div",{className:"flex flex-col items-center justify-center shrink-0 w-6 sm:w-10 md:w-12",children:[e.jsx(y.span,{animate:n==="player"?{scale:[1,1.4,1],color:["#fff","#34d399","#fff"]}:{},transition:{duration:.5},className:"text-lg sm:text-2xl md:text-3xl font-black text-white leading-none",children:s.scoreFor}),e.jsx("span",{className:"text-[7px] sm:text-[9px] md:text-[10px] text-emerald-400 font-bold uppercase tracking-widest mt-0.5 sm:mt-1 leading-none",children:"Score"})]})]})]}),e.jsxs("div",{className:"flex items-end gap-1.5 sm:gap-3 md:gap-6 relative flex-row-reverse pointer-events-auto",children:[e.jsx("div",{className:"relative w-16 h-16 sm:w-28 sm:h-28 md:w-40 md:h-40 bg-[#1a2030] rounded-t-[40px] flex items-end justify-center border-t-4 border-slate-700/50 shadow-inner",children:s.mode==="bot"?e.jsx(Te,{className:"h-8 w-8 sm:h-16 sm:w-16 md:h-20 md:w-20 text-rose-400 mb-3 sm:mb-6 drop-shadow-xl",strokeWidth:1.5}):e.jsx(ge,{className:"h-8 w-8 sm:h-16 sm:w-16 md:h-20 md:w-20 text-slate-500 mb-3 sm:mb-6 drop-shadow-xl",strokeWidth:1.5})}),e.jsxs("div",{className:"bg-black/40 backdrop-blur-xl border border-white/20 rounded-xl sm:rounded-2xl px-2 sm:px-4 py-2 sm:py-3 md:px-5 shadow-[0_8px_30px_rgba(0,0,0,0.5)] flex items-center gap-1.5 sm:gap-3 md:gap-4 mb-2 sm:mb-4 flex-row-reverse text-right max-w-[130px] sm:max-w-[220px] md:max-w-[280px]",children:[e.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[e.jsx("span",{className:"text-white font-black text-xs sm:text-base md:text-lg truncate tracking-wide",children:s.opponentName||"Anonymous"}),e.jsx("span",{className:"text-[9px] sm:text-xs md:text-sm text-rose-400 font-bold uppercase tracking-wider",children:s.mode==="bot"?"System Bot":"Challenger"})]}),e.jsx("div",{className:"h-6 sm:h-10 w-px bg-white/20"}),e.jsxs("div",{className:"flex flex-col items-center justify-center shrink-0 w-6 sm:w-10 md:w-12",children:[e.jsx(y.span,{animate:n==="opponent"?{scale:[1,1.4,1],color:["#fff","#fb7185","#fff"]}:{},transition:{duration:.5},className:"text-lg sm:text-2xl md:text-3xl font-black text-white leading-none",children:s.scoreAgainst}),e.jsx("span",{className:"text-[7px] sm:text-[9px] md:text-[10px] text-rose-400 font-bold uppercase tracking-widest mt-0.5 sm:mt-1 leading-none",children:"Score"})]})]})]})]}));Sa.displayName="BattleFooter";const Aa=Ft.memo(({activeMatch:a,roundSecondsLeft:s,lastRoundResult:n,selectedOptionIndex:c,roundLocked:d,answerSubmitting:l,designPauseActive:w,onOptionSelect:C,floatingMomentum:g,lastRoundMomentumDelta:N,studentProfile:b,quizBattleAvatar:j})=>e.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center gap-4 md:gap-6 w-full min-h-0 overflow-y-auto pt-4 pb-28 z-20 no-scrollbar",children:[e.jsxs("div",{className:u("relative bg-[#1e2536] border shadow-[0_20px_60px_rgba(0,0,0,0.4)] rounded-[1.5rem] p-5 md:p-6 w-full max-w-4xl text-center flex flex-col items-center",s<=3?"border-rose-400/50":"border-white/10"),children:[e.jsxs("div",{className:"absolute -top-3.5 bg-[#2f3547] border border-white/10 text-white/80 px-4 py-1 rounded-full text-xs font-black shadow-lg uppercase tracking-wider",children:[a.currentRound," / ",a.totalRounds]}),e.jsx(Ze,{children:g&&g.tone==="positive"&&e.jsx(y.div,{initial:{opacity:0,y:14,scale:.92},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.9},className:u("absolute -top-12 rounded-full border px-3 py-1 text-[10px] font-black uppercase tracking-[0.15em] backdrop-blur-lg",g.tone==="positive"?"border-emerald-300/70 bg-emerald-500/20 text-emerald-100":g.tone==="negative"?"border-rose-300/70 bg-rose-500/20 text-rose-100":"border-slate-300/50 bg-slate-500/20 text-slate-100"),children:g.label},g.id)}),e.jsx("p",{className:"text-base sm:text-lg md:text-xl text-white font-extrabold leading-tight tracking-tight mt-1 min-h-[40px] flex items-center justify-center",children:a.currentQuestion?.prompt}),typeof window<"u"&&window.location.search.includes("debug=true")&&a.currentQuestion?.varianceApplied&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2 justify-center",children:a.currentQuestion.varianceApplied.map(h=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-medium bg-blue-500/20 text-blue-200 border border-blue-400/30",children:h.replace(/_/g," ")},h))})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 md:gap-4 w-full max-w-4xl px-4",children:a.currentQuestion?.choices.map((h,m)=>{const v=c===m,W=l||d,S=!!n&&n.roundNumber===a.currentRound,R=S&&n.correctOptionIndex===m;let Y=-1;if(S)if(a.mode==="bot")if(n.botCorrect)Y=n.correctOptionIndex;else{const D=[0,1,2,3].filter(z=>z!==n.correctOptionIndex);Y=D[n.roundNumber%D.length]}else Y=typeof n.botSelectedIndex=="number"?n.botSelectedIndex:-1;const O=Y===m;let M="bg-[#1e2433] hover:bg-[#283042] border-[#2f384e] text-white shadow-[0_6px_0_rgba(15,20,30,0.5)]";return S?R?M="bg-emerald-500 text-emerald-950 border-emerald-400 shadow-[0_6px_0_rgba(5,150,105,1)]":v?M="bg-rose-500 text-white border-rose-400 shadow-[0_6px_0_rgba(225,29,72,1)]":M="bg-[#1e2433] opacity-40 border-[#2f384e] shadow-[0_6px_0_rgba(15,20,30,0.5)] text-white":v&&(M="bg-indigo-500 text-white border-indigo-400 shadow-[0_6px_0_rgba(79,70,229,1)]"),e.jsxs(y.button,{whileTap:{y:8,scale:.98},whileHover:!S&&!W?{scale:1.02}:{},disabled:W||d||w,onClick:()=>C(m),className:u("relative h-16 md:h-20 rounded-2xl md:rounded-3xl font-black text-base md:text-lg pl-6 pr-20 border-[2px] border-b-[4px] flex items-center justify-start text-left transition-all disabled:cursor-not-allowed",M,v&&!S?"ring-[4px] ring-white/20 ring-offset-[4px] ring-offset-[#0B0F19]":"",s<=3&&!W&&!S?"shadow-[0_0_0_2px_rgba(251,113,133,0.45),0_6px_0_rgba(127,29,29,1)]":""),children:[e.jsx("span",{className:"mr-3 md:mr-4 text-xs md:text-sm opacity-60 bg-black/20 px-3 py-1 rounded-full",children:String.fromCharCode(65+m)}),e.jsx("span",{className:"line-clamp-2",children:h}),e.jsxs("div",{className:"absolute right-3 md:right-4 flex items-center gap-1.5 md:gap-2",children:[O&&e.jsx(y.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},className:"w-8 h-8 md:w-10 md:h-10 rounded-full border-[3px] border-[#0B0F19] overflow-hidden bg-rose-500 shadow-lg flex items-center justify-center z-10",children:a.mode==="bot"?e.jsx(Te,{className:"w-4 h-4 md:w-5 md:h-5 text-white"}):e.jsx(ge,{className:"w-4 h-4 md:w-5 md:h-5 text-white"})}),v&&e.jsx(y.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},className:"w-8 h-8 md:w-10 md:h-10 rounded-full border-[3px] border-[#0B0F19] overflow-hidden bg-indigo-200 shadow-lg z-20",children:e.jsx("img",{src:b?.photo||j,alt:"You",className:"w-full h-full object-cover"})})]})]},m)})}),e.jsx(Ze,{children:d&&!n&&a.mode==="online"&&e.jsxs(y.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"mt-4 flex flex-col items-center gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white/70 font-semibold bg-black/30 px-6 py-2 rounded-full border border-white/10",children:[e.jsx(Ke,{className:"w-4 h-4 animate-spin text-amber-400"}),"Waiting for opponent..."]}),e.jsx("p",{className:"text-white/30 text-[11px] mt-1",children:"Choices locked until round resolves"})]})}),e.jsx(Ze,{children:n?.studentCorrect&&e.jsx(y.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{type:"spring",damping:20,stiffness:300},className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[100] pointer-events-none flex flex-col items-center justify-center",children:e.jsxs("div",{className:"bg-[#1e2433]/95 backdrop-blur-xl border border-white/10 rounded-[2rem] p-6 md:p-8 shadow-[0_30px_80px_rgba(0,0,0,0.6)] flex flex-col items-center min-w-[280px] md:min-w-[320px]",children:[e.jsx("img",{src:j,alt:"Mascot",className:"w-24 h-24 md:w-32 md:h-32 mb-4 drop-shadow-xl"}),e.jsx("h2",{className:u("text-3xl md:text-4xl font-black mb-4 uppercase tracking-widest",n.studentCorrect?"text-emerald-400":"text-rose-400"),children:n.studentCorrect?"Correct!":"Incorrect"}),n.studentCorrect?e.jsxs("div",{className:"flex items-center gap-3 w-full justify-center",children:[e.jsx("div",{className:"flex items-center gap-2 bg-emerald-500/20 text-emerald-400 px-4 py-2 rounded-2xl font-bold border border-emerald-500/30",children:e.jsx("span",{children:"+ 10 XP"})}),N!==null&&N>0&&e.jsx("div",{className:"flex items-center gap-2 bg-amber-500/20 text-amber-400 px-4 py-2 rounded-2xl font-bold border border-amber-500/30",children:e.jsxs("span",{children:["+ ",N," ",e.jsx(Je,{className:"w-4 h-4 inline"})]})})]}):e.jsxs("div",{className:"bg-rose-500/20 border border-rose-500/30 text-rose-400 font-bold px-5 py-2 rounded-xl text-center",children:["Correct: ",String.fromCharCode(65+n.correctOptionIndex)]})]})})})]}));Aa.displayName="BattleActiveContent";const kt={width:1280,height:720},_t=` @keyframes mascot-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-24px) rotate(3deg); } @@ -103,4 +103,4 @@ import{e as ma,o as u,m as y,g as et,aM as De,k as st,aN as q,_ as xa,$ as Oa,r .animate-reward-pop { animation: reward-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; } .animate-score-pop { animation: score-pop 0.5s ease-out forwards; } .animate-overlay-slide-up { animation: overlay-slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; } -`,Is=300*1e3,Bs=({viewportHeight:a})=>e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[50] overflow-hidden flex justify-between bg-slate-900/10",children:i.useMemo(()=>[...Array(40)].map((s,n)=>({id:n,left:`${Math.random()*100}%`,duration:.6+Math.random()*.4,delay:Math.random()*.4})),[a]).map(s=>e.jsx(y.div,{className:"absolute w-0.5 h-16 bg-blue-300/40 rounded-full e-left-top",style:{"--left":s.left,"--top":"-10%"},animate:{y:[0,a*1.2]},transition:{duration:s.duration,ease:"linear",delay:s.delay}},s.id))}),Ms=({viewportHeight:a,viewportWidth:s})=>{const n=i.useMemo(()=>[...Array(30)].map((c,d)=>({id:d,xShift:(Math.random()-.5)*s*.8,yShift:(Math.random()-.5)*a*.8,scale:Math.random()*1.5+.5,duration:2+Math.random()*1.5,delay:Math.random()*.35})),[a,s]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[50] overflow-hidden flex items-center justify-center",children:n.map(c=>e.jsx(y.div,{className:"absolute w-2 h-2 bg-amber-400 rounded-full shadow-[0_0_10px_rgba(251,191,36,0.8)] e-left-top",style:{"--left":"50%","--top":"50%"},animate:{y:[0,c.yShift],x:[0,c.xShift],scale:[0,c.scale,0],opacity:[0,1,0]},transition:{duration:c.duration,ease:"easeOut",delay:c.delay}},c.id))})},ia=({value:a,label:s,delay:n=0,icon:c})=>{const[d,l]=i.useState(0);return i.useEffect(()=>{if(a<=0)return;const w=1e3,C=30,g=Math.abs(Math.floor(w/C));let N=0;const b=setTimeout(()=>{const j=setInterval(()=>{N+=Math.max(1,Math.floor(a/C)),N>=a?(l(a),clearInterval(j)):l(N)},g);return()=>clearInterval(j)},n);return()=>clearTimeout(b)},[a,n]),a<=0?null:e.jsxs(y.div,{initial:{opacity:0,transform:"translateX(-20px)"},animate:{opacity:1,transform:"translateX(0)"},transition:{delay:n/1e3,duration:.5},className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-white/80 font-bold uppercase tracking-wider text-sm",children:[c,s]}),e.jsxs("div",{className:"text-2xl font-black text-amber-400 tabular-nums",children:["+",d]})]})},fe="border border-border bg-card text-card-foreground shadow-sm dark:border-[#2b3140] dark:bg-[#181d27] dark:text-[#f5f7fb] dark:shadow-[0_12px_24px_rgba(0,0,0,0.22)]",Fs=a=>a<=0?"--":`${(a/1e3).toFixed(2)}s`,Es=a=>a==="win"?"Win":a==="loss"?"Loss":"Draw",Ge=(a,s,n)=>Math.max(s,Math.min(n,a)),da=a=>{const s=Math.floor(a/60),n=a%60;return`${s}:${String(n).padStart(2,"0")}`},Rs=a=>{const s=a.trim().split(/\s+/).filter(Boolean).slice(0,2);return s.length===0?"ST":s.map(n=>n[0]?.toUpperCase()||"").join("")},ca=(a,s)=>a?a.eventType==="round_started"?`Round ${a.roundNumber} started.`:a.eventType==="answer_locked"?a.lockedByStudentId&&s&&a.lockedByStudentId===s?`Round ${a.roundNumber}: your answer is locked.`:`Round ${a.roundNumber}: opponent answer locked.`:a.eventType==="round_result"?`Round ${a.roundNumber} resolved.`:"Match completed.":null;let St=null;const ua=()=>{if(typeof window>"u")return null;if(!St){const a=window.AudioContext||window.webkitAudioContext;a&&(St=new a)}return St},dr=()=>{const{userProfile:a,userRole:s}=Va(),n=a,[c,d]=i.useState("hub"),[l,w]=i.useState(ps),[C,g]=i.useState([]),[N,b]=i.useState({status:"idle"}),[j,h]=i.useState(!1),[m,v]=i.useState(null),[W,S]=i.useState(""),[R,Y]=i.useState(null),[O,M]=i.useState(0),[D,z]=i.useState(null),[J,Tt]=i.useState(()=>typeof window>"u"?!0:window.localStorage.getItem("quiz_battle_sound_enabled")!=="0"),[ce,za]=i.useState(()=>{if(typeof window>"u")return .7;const t=Number(window.localStorage.getItem("quiz_battle_sound_volume")||"0.7");return Number.isFinite(t)?Ge(t,0,1):.7}),[Dt,I]=i.useState("connected"),[we,Ca]=i.useState("all"),[Pt,nt]=i.useState(!0),[ee,ot]=i.useState(null),[lt,it]=i.useState([]),[Ia,Qt]=i.useState(!1),[qt,Ba]=i.useState([]),[dt,Ts]=i.useState("full"),[Lt,Ds]=i.useState(!0),[r,_]=i.useState(null),[ve,X]=i.useState(null),[G,Ae]=i.useState(!1),[P,ze]=i.useState(0),[Z,K]=i.useState(!1),[F,ct]=i.useState(!1),[Ma,Fa]=i.useState(!1),[ut,Ea]=i.useState(kt),[B,te]=i.useState(null),[Ra,mt]=i.useState(!1),[Qe,xt]=i.useState(null),[Ta,pt]=i.useState(null),[Da,qe]=i.useState(null),$t=i.useRef(""),ht=i.useRef(null),je=i.useRef(null),oe=i.useRef(0),Ot=i.useRef(""),Ce=i.useRef(0),bt=i.useRef(0),Le=i.useRef(null),Ie=i.useRef(null),$e=i.useRef(-1),ft=!1,le=i.useMemo(()=>{const t=Ua(n?.grade);return ea.filter(o=>t.includes(o.id))},[n?.grade]),Pa=i.useMemo(()=>(le.find(o=>o.id===l.subjectId)?.modules||[]).map(o=>({value:o.id,label:o.title})),[le,l.subjectId]),H=i.useMemo(()=>{const t=r?.roundResults||[];let o=0;return t.forEach(p=>{o=p.studentCorrect?o+1:0}),o},[r?.roundResults]),Qa=i.useMemo(()=>{const t=Math.max(0,H-1)*.12;return Number((1+Math.min(.72,t)).toFixed(2))},[H]),qa=i.useMemo(()=>{if(!r)return 0;if(r.status==="completed")return r.xpEarned||0;const t=r.roundResults||[];let o=0,p=0;for(const x of t)if(x.studentCorrect){o++;const k=o>=2?Math.min(25,(o-1)*5):0;p+=10+k}else o=0;return p},[r?.status,r?.xpEarned,r?.roundResults]),Ht=i.useMemo(()=>{const t=r?.roundResults||[];let o=0;return t.forEach(p=>{o=p.botCorrect?o+1:0}),o},[r?.roundResults]);i.useMemo(()=>{const t=Math.max(0,Ht-1)*.1;return Number((1+Math.min(.5,t)).toFixed(2))},[Ht]),i.useMemo(()=>H>=5?{label:"Inferno",badgeClass:"text-amber-300 border-amber-300/50 bg-amber-500/20 shadow-[0_0_18px_rgba(251,191,36,0.35)]"}:H>=3?{label:"Heating Up",badgeClass:"text-orange-300 border-orange-300/50 bg-orange-500/15 shadow-[0_0_16px_rgba(249,115,22,0.3)]"}:B?.studentCorrect?{label:"Steady",badgeClass:"text-emerald-300 border-emerald-300/40 bg-emerald-500/15 shadow-[0_0_14px_rgba(16,185,129,0.25)]"}:{label:"Rebuild",badgeClass:"text-slate-300 border-slate-300/30 bg-slate-500/15 shadow-[0_0_14px_rgba(148,163,184,0.2)]"},[B?.studentCorrect,H]);const ie=i.useMemo(()=>{if(!B)return null;const t=B.studentCorrect?12:-8,o=B.studentCorrect&&!B.botCorrect?6:0,p=B.studentCorrect?Math.max(0,(H-1)*2):0;return t+o+p},[B,H]),Q=i.useCallback(t=>{if(!(!J||ce<=0||typeof window>"u"))try{const o=ua();if(!o)return;o.state==="suspended"&&o.resume().catch(()=>{});const x={tick:{notes:[740],duration:.06,type:"triangle",volume:.03},lock:{notes:[520],duration:.08,type:"square",volume:.04},result:{notes:[660,720],duration:.08,type:"sine",volume:.04},win:{notes:[920,1040,1180],duration:.12,type:"triangle",volume:.05},loss:{notes:[260,220],duration:.14,type:"sawtooth",volume:.045},streak:{notes:[780,920],duration:.09,type:"triangle",volume:.045},multiplier:{notes:[660,880,1120],duration:.08,type:"triangle",volume:.05}}[t],k=o.currentTime,T=.07,f=Ge(x.volume*ce,.004,.08);x.notes.forEach((E,se)=>{const me=o.createOscillator(),Be=o.createGain(),ye=k+se*T;me.type=x.type,me.frequency.setValueAtTime(E,ye),Be.gain.setValueAtTime(1e-4,ye),Be.gain.exponentialRampToValueAtTime(f,ye+.012),Be.gain.exponentialRampToValueAtTime(1e-4,ye+x.duration),me.connect(Be),Be.connect(o.destination),me.start(ye),me.stop(ye+x.duration+.02)})}catch(o){console.warn("Battle tone playback skipped or blocked:",o)}},[J,ce]),Vt=i.useCallback(async t=>{if(!(!t||typeof window>"u"))try{await window.navigator.clipboard.writeText(t),Y(t),window.setTimeout(()=>{Y(o=>o===t?null:o)},1600)}catch{b({status:"error",message:"Unable to copy room code automatically. Please copy it manually."})}},[]),Ut=i.useCallback(()=>{},[ft]),Wt=i.useCallback(t=>{h(!1),v(null),_(null),M(0),z(null),b({status:"error",message:t}),d("setup")},[]),ae=i.useCallback(async()=>{if(!n?.uid)return null;const[t,o]=await Promise.all([bs(n.uid),fs(n.uid,{mode:we,limitCount:8})]);return{stats:t,history:o}},[we,n?.uid]);i.useEffect(()=>{if(le.length===0)return;const o=le.some(k=>k.id===l.subjectId)?l.subjectId:le[0].id,p=le.find(k=>k.id===o),x=p?.modules?.[0]?.id||"";w(k=>{const T=p?.modules?.some(f=>f.id===k.topicId)?k.topicId:x;return k.subjectId===o&&k.topicId===T?k:{...k,subjectId:o,topicId:T}})},[le,l.subjectId]),i.useEffect(()=>{if(!n?.uid){ot(null),it([]),nt(!1);return}let t=!0;return nt(!0),(async()=>{const p=await ae();t&&(p&&(ot(p.stats),it(p.history)),nt(!1))})(),()=>{t=!1}},[ae,n?.uid]);const Oe=i.useMemo(()=>we==="all"?lt:lt.filter(t=>t.mode===we),[lt,we]),Yt=i.useMemo(()=>qt.map((t,o)=>{const p=t.rank||o+1,x=t.userId===n?.uid,k=`Student-${t.userId.slice(-4).toUpperCase()}`,T=dt==="full"?t.displayName:dt==="initials"?Rs(t.displayName):k,f=Math.floor(t.leaderboardScore/25)*25,E=Lt||x?`${t.leaderboardScore} pts`:`${f}-${f+24} pts`;return{...t,rank:p,isSelf:x,displayName:T,scoreLabel:E}}),[qt,dt,Lt,n?.uid]);i.useEffect(()=>{if(c!=="leaderboard"&&c!=="hub")return;let t=!0;return Qt(!0),(async()=>{const p=await zs(20);t&&(Ba(p),Qt(!1))})(),()=>{t=!1}},[c]);const He=i.useCallback(async()=>{if(n?.uid)try{const t=await la();if(t.sessionType==="match"&&t.match){let o=t.match;if(t.match.mode==="bot"&&t.match.status==="ready")try{o=await re(t.match.matchId),Ce.current=0}catch(p){const x=p;h(!1),v(null),_(null),d("setup"),I(typeof window<"u"&&window.navigator.onLine?"connected":"disconnected"),b({status:"error",message:x?.message||"Unable to resume bot battle. Please start a new match."});return}h(!1),v(t.room||null),_(o),z(t.queue?.expiresAtMs||o.expiresAtMs||null),d("battle"),I("connected");return}if(t.sessionType==="room"&&t.room){h(!1),v(t.room),_(o=>o?.mode==="bot"?o:null),z(null),I("connected");return}if(t.sessionType==="queue"){h(!0),v(null),_(o=>o?.mode==="bot"?o:null),z(t.queue?.expiresAtMs||null),I("connected");return}h(!1),v(null),_(o=>o?.mode==="bot"?o:null),z(null),I("connected")}catch(t){console.warn("Quiz Battle session resume failed:",t),I("reconnecting")}},[n?.uid]);i.useEffect(()=>{n?.uid&&He()},[n?.uid,He]),i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("quiz_battle_sound_enabled",J?"1":"0")},[J]),i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("quiz_battle_sound_volume",ce.toFixed(2))},[ce]),i.useEffect(()=>{if(typeof window>"u")return;const t=()=>{const o=window.innerWidth,p=window.innerHeight;Ea({width:Number.isFinite(o)&&o>0?o:kt.width,height:Number.isFinite(p)&&p>0?p:kt.height})};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),i.useEffect(()=>{if(typeof document>"u")return;const t=()=>{Fa(!!document.fullscreenElement)};return t(),document.addEventListener("fullscreenchange",t),()=>{document.removeEventListener("fullscreenchange",t)}},[]),i.useEffect(()=>{const t=D!==null;if(!(j||m&&(m.status==="waiting"||m.status==="ready")||t)){M(0);return}const o=()=>{if(!D){M(x=>x+1);return}M(Math.max(0,Math.ceil((D-Date.now())/1e3)))};o();const p=window.setInterval(o,1e3);return()=>{window.clearInterval(p)}},[j,m?.status,m?.roomId,D]),i.useEffect(()=>{if(!D)return;const t=window.setInterval(()=>{D-Date.now()<=0&&(window.clearInterval(t),(async()=>{try{(j||!m)&&await oa()}catch{}finally{Wt("Public matchmaking timed out after 5 minutes. Please start again.")}})())},1e3);return()=>{window.clearInterval(t)}},[m,Wt,j,D]),i.useEffect(()=>{if(typeof window>"u")return;I(window.navigator.onLine?"connected":"disconnected");const t=()=>{I("reconnecting"),He()},o=()=>{I("disconnected")};return window.addEventListener("online",t),window.addEventListener("offline",o),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",o)}},[He]),i.useEffect(()=>{const t=r?.mode==="online"&&(r.status==="ready"||r.status==="in_progress"),o=r?.mode==="bot"&&r.status==="ready",p=!!(m&&(m.status==="waiting"||m.status==="ready"));if(o||(Ce.current=0),!j&&!p&&!t&&!o||F)return;let x=!1;const k=async()=>{try{if(r?.mode==="bot"&&r.status==="ready"){const f=await re(r.matchId);if(x)return;_(f),I("connected"),z(f.expiresAtMs||null),Ce.current=0,f.status==="in_progress"&&b({status:"queued",message:"Practice bot match started."});return}if(r?.mode==="online"){if(r.status==="ready"){const se=await re(r.matchId);if(x)return;_(se),I("connected"),z(se.expiresAtMs||null),se.status==="in_progress"&&b({status:"queued",message:"Match started. Round timer is live."});return}const f=await Nt(r.matchId);if(x)return;const E=f.roundResults.filter(se=>se.roundNumber>$e.current).sort((se,me)=>se.roundNumber-me.roundNumber)[0];E?($e.current=E.roundNumber,te(E),xt(f)):(_(f),f.status==="completed"&&(h(!1),v(null),z(null)),f.status==="cancelled"&&r.status==="in_progress"&&(mt(!0),K(!1))),I("connected");return}if(m?.roomId){const f=await js({roomId:m.roomId});if(x)return;if(v(f.room),f.match){const E=await re(f.match.matchId);if(x)return;_(E),v(f.room),h(!1),z(E.expiresAtMs||null),d("battle"),I("connected"),b({status:"queued",message:E.status==="ready"?"Opponent connected. Waiting for synchronized start...":"Private room match started."})}return}if(j){const f=await la();if(x)return;if(f.sessionType==="match"&&f.match){const E=await re(f.match.matchId);if(x)return;_(E),v(f.room||null),h(!1),z(E.expiresAtMs||null),d("battle"),I("connected"),b({status:"queued",message:"Opponent found. Preparing synchronized start..."});return}if(f.sessionType==="room"&&f.room){h(!1),v(f.room),z(null),I("connected");return}I("connected")}}catch(f){if(!x){if(console.warn("Quiz Battle sync poll failed:",f),r?.mode==="bot"&&r.status==="ready"&&(Ce.current+=1,Ce.current>=3)){const E=f;h(!1),v(null),_(null),d("setup"),b({status:"error",message:E?.message||"Unable to start bot battle. Please try again."}),I("disconnected");return}I("reconnecting")}}};k();const T=window.setInterval(()=>{k()},3e3);return()=>{x=!0,window.clearInterval(T)}},[r?.matchId,r?.mode,r?.status,m?.roomId,m?.status,F,j]);const ue=i.useMemo(()=>r?.mode==="online"&&(r.status==="ready"||r.status==="in_progress")?{scope:"match",resourceId:r.matchId}:m&&(m.status==="waiting"||m.status==="ready")?{scope:"room",resourceId:m.roomId}:j&&n?.uid?{scope:"queue",resourceId:n.uid}:null,[r,m,j,n?.uid]);i.useEffect(()=>{if(!ue)return;let t=!1;const o=async()=>{try{await Ns(ue.scope,ue.resourceId),t||I("connected")}catch(x){t||(console.warn("Quiz Battle heartbeat failed:",x),I("reconnecting"))}};o();const p=window.setInterval(()=>{o()},8e3);return()=>{t=!0,window.clearInterval(p),xs(ue.scope,ue.resourceId)}},[ue?.scope,ue?.resourceId]),i.useEffect(()=>{if(!r||r.status!=="in_progress"){K(!1),je.current=null,oe.current=0;return}je.current=null,oe.current=0;const t=r.roundDeadlineAtMs?Math.max(0,Math.ceil((r.roundDeadlineAtMs-Date.now())/1e3)):r.timePerQuestionSec;ze(t),X(null),K(!1)},[r?.matchId,r?.status,r?.currentRound,r?.timePerQuestionSec]),i.useEffect(()=>{F&&(!r||r.status!=="in_progress")&&ct(!1)},[r?.matchId,r?.status,F]),i.useEffect(()=>{const t=r?.lifecycle;if(!t?.eventType)return;const o=`${t.eventType}:${t.sequence}`;$t.current!==o&&($t.current=o,t.eventType==="answer_locked"?Q("lock"):t.eventType==="round_result"&&Q("result"))},[r?.lifecycle?.eventType,r?.lifecycle?.sequence,Q]),i.useEffect(()=>{!r||r.status!=="completed"||Ot.current!==r.matchId&&(Ot.current=r.matchId,Q(r.outcome==="loss"?"loss":"win"),r.outcome==="win"&&xa(()=>import("./confetti.module-C94ZD2ww.js"),[]).then(t=>{t.default({particleCount:110,spread:78,origin:{y:.62},ticks:160})}).catch(()=>{}))},[r?.matchId,r?.status,r?.outcome,Q]),i.useEffect(()=>{if(!r||r.status!=="in_progress"||Z||G||F){ht.current=null;return}P<=3&&P>0&&ht.current!==P&&(ht.current=P,Q("tick"))},[r?.status,P,Z,G,F,Q]),i.useEffect(()=>{if(!r||r.status!=="in_progress"){bt.current=0;return}H>bt.current&&H>=2&&Q(H>=4?"multiplier":"streak"),bt.current=H},[r?.matchId,r?.status,H,Q]),i.useEffect(()=>{if(!r){Le.current=null,qe(null);return}const t=Le.current;if(!t||t.matchId!==r.matchId){Le.current={matchId:r.matchId,scoreFor:r.scoreFor,scoreAgainst:r.scoreAgainst},qe(null);return}if(r.scoreFor!==t.scoreFor||r.scoreAgainst!==t.scoreAgainst){const o=r.scoreFor>t.scoreFor?"player":"opponent";qe(o),Ie.current&&window.clearTimeout(Ie.current),Ie.current=window.setTimeout(()=>{qe(null)},850)}Le.current={matchId:r.matchId,scoreFor:r.scoreFor,scoreAgainst:r.scoreAgainst}},[r?.matchId,r?.scoreAgainst,r?.scoreFor]),i.useEffect(()=>()=>{Ie.current&&window.clearTimeout(Ie.current)},[]),i.useEffect(()=>{if(!B?.studentCorrect||ie===null||ie<=0){pt(null);return}const t=ie>0?"positive":ie<0?"negative":"neutral";pt({id:Date.now(),label:`${ie>=0?"+":""}${ie} Momentum`,tone:t});const o=window.setTimeout(()=>{pt(null)},1400);return()=>{window.clearTimeout(o)}},[ie,B]),i.useEffect(()=>{if(B&&Qe){B.studentCorrect?Q("win"):Q("loss");const t=window.setTimeout(()=>{_(Qe),te(null),X(null),K(!1),xt(null),Qe.status==="completed"&&(h(!1),v(null),ae(),$e.current=-1)},1500);return()=>window.clearTimeout(t)}},[B,Qe,Q,ae]);const Ve=i.useCallback(async t=>{if(!r||r.status!=="in_progress"||Z||F)return;Ae(!0);const o=window.setTimeout(()=>{Ae(!1),b({status:"error",message:"Submission took too long. Syncing latest match state now..."}),Nt(r.matchId).then(p=>{_(p),p.status==="completed"&&(h(!1),v(null),z(null))}).catch(()=>{})},12e3);try{const p=r.roundDeadlineAtMs?Ge(r.timePerQuestionSec*1e3-Math.max(0,r.roundDeadlineAtMs-Date.now()),0,r.timePerQuestionSec*1e3):Math.max(0,(r.timePerQuestionSec-P)*1e3),x=await Ss({matchId:r.matchId,roundNumber:r.currentRound,selectedOptionIndex:t,responseMs:p});je.current=null,oe.current=0,x.roundResult?($e.current=x.roundResult.roundNumber,te(x.roundResult),xt(x.match)):(_(x.match),te(null),x.match.mode==="online"&&x.match.status==="in_progress"?(K(!0),b({status:"queued",message:"Answer locked. Waiting for opponent to finish the round..."})):X(null)),x.match.status==="completed"&&(h(!1),v(null),z(null),ae(),b({status:"queued",message:x.completion?`Match finished (${x.completion.outcome.toUpperCase()}) +${x.completion.xpEarned} XP`:"Match finished. Results saved."}))}catch(p){const k=p?.message||"Unable to submit answer right now. Please try again.";if(t===null||k.includes("Round timer elapsed")||k.includes("Expected round")||k.includes("Match is not currently active"))try{const f=await Nt(r.matchId),E=f.currentRound!==r.currentRound;if(_(f),X(null),K(!1),E||f.status==="completed"?(je.current=null,oe.current=0):t===null&&(oe.current=Date.now()+3e3),f.status==="completed"){h(!1),v(null),z(null),ae(),b({status:"queued",message:"Match finished. Results synchronized."});return}b({status:"queued",message:"Round timed out. Synced to the latest battle state."});return}catch{}t===null&&(oe.current=Date.now()+3e3),b({status:"error",message:k})}finally{window.clearTimeout(o),Ae(!1)}},[r,F,ae,Z,P]);i.useEffect(()=>{if(!r||r.status!=="in_progress"||F||G||Z)return;const t=r.roundDeadlineAtMs?Math.max(0,Math.ceil((r.roundDeadlineAtMs-Date.now())/1e3)):P;if(r.roundDeadlineAtMs&&t!==P&&ze(t),ve===null?t<=1:t<=0){if(je.current===r.currentRound&&Date.now(){r.roundDeadlineAtMs?ze(Math.max(0,Math.ceil((r.roundDeadlineAtMs-Date.now())/1e3))):ze(x=>Math.max(0,x-1))},1e3);return()=>{window.clearTimeout(p)}},[r,G,F,Z,P,ve,Ve]);const Xt=i.useCallback(async()=>{if(!(!r||r.mode!=="bot")){Ae(!0),b({status:"validating"});try{const t=await As(r.matchId),o=await re(t.matchId);_(o),v(null),h(!1),z(null),te(null),X(null),K(!1),d("battle"),b({status:"queued",message:`Rematch ready (${t.botDifficulty}). Good luck!`})}catch(t){b({status:"error",message:t?.message||"Unable to start rematch right now."})}finally{Ae(!1)}}},[r]);if(s!=="student")return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:_t}),e.jsx("div",{className:"px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:e.jsx(pe,{className:u(fe,"max-w-2xl"),children:e.jsxs(he,{children:[e.jsx(be,{children:"Quiz Battle is student-only"}),e.jsx(Ne,{className:"text-muted-foreground dark:text-[#aab3c7]",children:"Your account role does not have access to this module."})]})})})]});const Gt=t=>{g([]),b({status:"idle"}),ct(!1),h(!1),v(null),S(""),_(null),te(null),X(null),K(!1),z(null),w(o=>({...o,mode:t,queueType:t==="online"?o.queueType:"public_matchmaking"})),M(0),d("setup")},Zt=async()=>{b({status:"validating"});try{m?.roomId?await ys({roomId:m.roomId}):await oa(),h(!1),v(null),_(t=>!t||t.mode!=="online"?t:t.status==="ready"||t.status==="cancelled"?null:t),S(""),M(0),z(null),b({status:"queued",message:m?.roomId?"Private room cancelled.":"Left matchmaking queue."})}catch(t){b({status:"error",message:t?.message||"Unable to cancel this online session right now. Please try again."})}},La=async()=>{b({status:"validating"});const t=hs(l);if(t.length>0){g(t),b({status:"error",message:"Fix the highlighted setup fields before starting."});return}g([]);try{if(l.mode==="online"){if(l.queueType==="private_room"){const k=W.trim().toUpperCase(),T=k?await vs(k):await ws(l);if(h(!1),v(T.room),S(""),z(T.match?.expiresAtMs||null),T.match){const f=await re(T.match.matchId);_(f),te(null),X(null),K(!1),d("battle"),z(f.expiresAtMs||null),b({status:"queued",message:f.status==="ready"?`Room ${T.room.roomCode} linked. Waiting for synchronized start...`:"Private room match started."});return}_(null),z(null),b({status:"queued",message:k?"Joined private room. Waiting for opponent...":"Private room created. Share code:"});return}const x=await gs(l);if(x.status==="matched"&&x.matchId){const k=await re(x.matchId);h(!1),v(null),_(k),te(null),X(null),K(!1),d("battle"),z(k.expiresAtMs||null),b({status:"queued",message:"Opponent found. Preparing synchronized start..."});return}h(!0),v(null),_(null),z(x.expiresAtMs||Date.now()+Is),M(0),b({status:"queued",message:"Joined matchmaking queue. Waiting for an opponent..."});return}const o=await ks(l),p=await re(o.matchId);h(!1),v(null),_(p),te(null),X(null),K(!1),ze(p.timePerQuestionSec),z(null),d("battle"),b({status:"queued",message:`Bot match ${o.matchId.slice(0,8)} live (${o.botDifficulty}).`}),ae().then(x=>{x&&(ot(x.stats),it(x.history))})}catch(o){h(!1),b({status:"error",message:o?.message||"Unable to start battle. Please try again."})}},U=t=>C.find(o=>o.field===t)?.message;ee?.winRate;const Kt=!!(l.mode==="online"&&m&&(m.status==="waiting"||m.status==="ready")&&(!r||r.status!=="completed")),$a=!!(j||m&&(m.status==="waiting"||m.status==="ready")&&(!r||r.status==="ready"||r.status==="cancelled"));return r&&(r.status==="in_progress"||r.status==="completed")?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:_t}),e.jsxs("div",{className:"fixed inset-0 z-[100] bg-[#0B0F19] text-white flex flex-col overflow-hidden",children:[r.status==="completed"&&r.outcome==="loss"&&e.jsx(Bs,{viewportHeight:ut.height}),r.status==="completed"&&r.outcome==="draw"&&e.jsx(Ms,{viewportHeight:ut.height,viewportWidth:ut.width}),e.jsx("div",{className:"absolute inset-0 z-0 opacity-40",children:e.jsx(ra,{children:e.jsx("div",{className:"h-full w-full"})})}),e.jsx(Ze,{children:Ra&&e.jsx(y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-[120] bg-black/70 backdrop-blur-md flex flex-col items-center justify-center px-6",children:e.jsxs(y.div,{initial:{opacity:0,transform:"translateY(40px) scale(0.85)"},animate:{opacity:1,transform:"translateY(0) scale(1)"},transition:{type:"spring",damping:18,stiffness:250,delay:.1},className:"bg-[#1e2433] border border-white/10 rounded-[2rem] p-8 flex flex-col items-center gap-5 max-w-sm w-full shadow-[0_30px_80px_rgba(0,0,0,0.6)]",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-24 h-24 rounded-full bg-[#1a2030] border-4 border-rose-500/50 overflow-hidden flex items-end justify-center shadow-xl",children:r.mode==="bot"?e.jsx(Te,{className:"h-16 w-16 text-rose-400 mb-2",strokeWidth:1.5}):e.jsx(ge,{className:"h-14 w-14 text-slate-500 mb-2",strokeWidth:1.5})}),e.jsx(y.div,{initial:{opacity:0,transform:"scale(0.5) translateX(-10px)"},animate:{opacity:1,transform:"scale(1) translateX(0)"},transition:{delay:.4,type:"spring",stiffness:300},className:"absolute -top-2 left-full ml-2 bg-white text-slate-900 text-xs font-black px-3 py-1.5 rounded-2xl rounded-bl-none whitespace-nowrap shadow-lg",children:"I give up!"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-black text-white mb-1",children:"Opponent Surrendered"}),e.jsxs("p",{className:"text-white/50 text-sm",children:[e.jsx("span",{className:"font-bold text-white/70",children:r.opponentName||"Your opponent"})," left the match. You win!"]})]}),e.jsxs("div",{className:"flex flex-col gap-3 w-full",children:[e.jsxs(A,{size:"lg",className:"w-full h-12 bg-emerald-500 hover:bg-emerald-400 text-white font-black rounded-xl",onClick:()=>{mt(!1),_(null),v(null),h(!1),b({status:"idle"}),d("hub"),ae()},children:[e.jsx(gt,{size:14,className:"inline mr-1"}),"Claim Victory"]}),e.jsx(A,{size:"lg",variant:"outline",className:"w-full h-12 border-white/20 text-white/70 hover:bg-white/10 rounded-xl",onClick:()=>{mt(!1),_(null),v(null),h(!1),b({status:"idle"}),d("hub")},children:"Back to Arena"})]})]})})}),F&&e.jsx("div",{className:"absolute inset-0 z-[110] bg-black/60 backdrop-blur-md flex items-center justify-center",children:e.jsxs(pe,{className:"w-full max-w-sm border-border/50 bg-[#181d27] shadow-[0_20px_50px_rgba(0,0,0,0.5)]",children:[e.jsxs(he,{className:"text-center",children:[e.jsx(be,{className:"text-3xl font-black text-white",children:"PAUSED"}),e.jsx(Ne,{className:"text-base text-muted-foreground mt-2",children:r.mode==="online"?"Online match - timer continues in the background! Hurry!":"Bot match - round timer frozen."})]}),e.jsxs(Xe,{className:"flex flex-col gap-3",children:[e.jsx(A,{variant:"default",size:"lg",className:"w-full text-lg h-12",onClick:Ut,children:"Resume Match"}),e.jsx(A,{variant:"outline",size:"lg",className:"w-full text-lg h-12 border-rose-500/20 text-rose-500 hover:bg-rose-500/10",onClick:()=>{ct(!1),_(null),v(null),h(!1),b({status:"idle"}),d("setup")},children:"Leave Match"})]})]})}),e.jsxs("div",{className:"relative z-10 flex flex-col h-full w-full max-w-[1400px] mx-auto px-4 md:px-8 py-4",children:[e.jsx(_a,{playerRoundStreak:H,playerVisualMultiplier:Qa,liveXpEarned:qa,activeMatch:r,subjects:ea,battleSoundEnabled:J,onToggleSound:()=>Tt(t=>!t),isFullscreen:Ma,onToggleFullscreen:()=>{typeof document>"u"||(document.fullscreenElement?document.exitFullscreen().catch(t=>{console.warn("Fullscreen mode unavailable or blocked by browser (exit):",t)}):document.documentElement.requestFullscreen().catch(t=>{console.warn("Fullscreen mode unavailable or blocked by browser (enter):",t)}))},isDesignPauseAvailable:ft,onTogglePause:Ut}),r.status==="in_progress"?e.jsx("div",{className:"shrink-0 w-full max-w-4xl mx-auto h-2 bg-white/10 rounded-full overflow-hidden mt-6 mb-4",children:e.jsx(y.div,{className:"h-full",animate:{width:`${Math.max(0,P/r.timePerQuestionSec*100)}%`,backgroundColor:P>Math.floor(r.timePerQuestionSec/2)?"#10b981":P>3?"#f59e0b":"#ef4444"},transition:{duration:1,ease:"linear"}})}):e.jsx("div",{className:"shrink-0 h-6 md:h-10 w-full"}),e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center w-full min-h-0 relative",children:r.status==="completed"?e.jsx("div",{className:"fixed inset-0 z-[200] flex flex-col items-center justify-center bg-slate-900/50 backdrop-blur-md px-4",children:e.jsxs(y.div,{initial:{opacity:0,scale:.9,y:10},animate:{opacity:1,scale:1,y:0},className:"w-full max-w-sm sm:max-w-md bg-[#161a25]/90 border border-white/20 shadow-[0_30px_80px_rgba(0,0,0,0.8)] rounded-[1.5rem] p-6 text-center",children:[e.jsx("h2",{className:u("text-3xl font-black uppercase tracking-widest drop-shadow-md mb-2",r.outcome==="win"?"text-emerald-400":r.outcome==="loss"?"text-rose-400":"text-amber-400"),children:r.outcome==="win"?"VICTORY!":r.outcome==="loss"?"DEFEAT":"DRAW MATCH"}),e.jsxs("p",{className:"text-white/80 font-bold text-sm mb-4 uppercase tracking-widest",children:["Final Score: ",r.scoreFor," - ",r.scoreAgainst]}),e.jsxs("div",{className:"bg-black/50 rounded-xl p-4 mb-5 border border-white/5 flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-white/40 text-[10px] font-black uppercase tracking-widest text-left mb-2",children:"Battle Score"}),(()=>{const t=r.roundResults||[];let o=0,p=0,x=0;for(const k of t)if(k.studentCorrect){o++;const T=o>=2?Math.min(15,(o-1)*5):0;p+=10,x+=T}else o=0;return e.jsxs(e.Fragment,{children:[e.jsx(ia,{value:p,label:"Correct Answers",delay:300,icon:e.jsx(yt,{className:"h-3 w-3 text-emerald-400"})}),e.jsx(ia,{value:x,label:"Streak Bonus",delay:900,icon:e.jsx(Je,{className:"h-3 w-3 text-amber-400"})}),e.jsxs(y.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:1.5,duration:.4},className:"flex items-center justify-between pt-1 mt-1 border-t border-white/5",children:[e.jsx("span",{className:"text-white/50 text-xs font-bold uppercase tracking-widest",children:"Total"}),e.jsxs("span",{className:"text-base font-black text-white/80",children:[p+x," pts"]})]})]})})()]}),e.jsx("div",{className:"w-full h-px bg-white/10"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white/40 text-[10px] font-black uppercase tracking-widest text-left mb-2",children:"Match Reward"}),e.jsxs(y.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:2,duration:.5,type:"spring"},className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-white/70 text-sm font-bold",children:r.outcome==="win"?"Victory Reward":r.outcome==="draw"?"Draw Reward":"Participation Reward"}),e.jsxs("span",{className:"text-2xl font-black text-amber-400 drop-shadow-md",children:["+",r.xpEarned||(r.outcome==="win"?80:r.outcome==="draw"?55:35)," XP"]})]}),e.jsx("p",{className:"text-white/25 text-[9px] mt-1 text-right uppercase tracking-widest",children:"Credited to your profile"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 justify-center",children:[e.jsx(A,{size:"lg",onClick:()=>{_(null),v(null),h(!1),d("hub")},className:"w-full h-12 rounded-xl text-sm font-black bg-white/10 hover:bg-white/20 text-white border border-white/20",children:"BACK TO ARENA"}),r.mode==="bot"&&e.jsx(A,{size:"lg",onClick:()=>void Xt(),disabled:G,className:"w-full h-12 rounded-xl text-sm font-black bg-violet-600 hover:bg-violet-500 text-white border-b-2 border-violet-800 active:border-b-0 active:translate-y-[2px]",children:"REMATCH"})]})]})}):e.jsx(Aa,{activeMatch:r,roundSecondsLeft:P,lastRoundResult:B,selectedOptionIndex:ve,roundLocked:Z,answerSubmitting:G,designPauseActive:F,onOptionSelect:t=>{B&&B.roundNumber===r.currentRound||G||Z||(ua()?.resume().catch(()=>{}),Q("lock"),X(t),Ve(t))},floatingMomentum:Ta,lastRoundMomentumDelta:ie,studentProfile:n,quizBattleAvatar:jt})}),e.jsx(Sa,{studentProfile:n,activeMatch:r,scorePulseTarget:Da,quizBattleAvatar:jt})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("style",{children:_t}),e.jsx(ra,{bgVideo:"/videos/warp_bg.mp4",className:"-mx-3 lg:-mx-4 -mt-3 lg:-mt-4 -mb-8 px-4 sm:px-6 xl:px-10 py-6 sm:py-8 min-h-[calc(100vh-3.5rem)] !w-auto overflow-hidden relative",children:e.jsx("div",{className:"h-full flex flex-col max-w-[1400px] mx-auto w-full",children:e.jsx(y.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.24,ease:[.22,1,.36,1]},className:"space-y-3 lg:space-y-4",children:e.jsxs(Cs,{value:c,onValueChange:t=>d(t),children:[e.jsx(ke,{value:"hub",className:"mt-0 outline-none",children:e.jsx(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-5",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_300px] xl:grid-cols-[1fr_320px] gap-6 sm:gap-8 lg:gap-10",children:[e.jsxs("div",{className:"space-y-3 lg:space-y-4",children:[e.jsxs("div",{className:"relative select-none isolate bg-indigo-600 rounded-[2rem] shadow-[0_20px_45px_-15px_rgba(0,0,0,0.3)] shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 pointer-events-none z-0 rounded-[2rem]"}),e.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none rounded-[2rem] overflow-hidden repeating-stripe-bg"}),e.jsx("div",{className:"absolute top-0 right-0 w-[400px] h-[400px] bg-sky-500/20 blur-[100px] rounded-full pointer-events-none"}),e.jsxs("div",{className:"relative z-10 flex flex-col md:flex-row items-center justify-between p-6 lg:p-8 h-full min-h-[140px] lg:min-h-[160px]",children:[e.jsx("div",{className:"flex-1 space-y-3 w-full pr-0 md:pr-[240px] lg:pr-[280px]",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"flex items-center gap-3 text-3xl sm:text-4xl lg:text-[46px] font-black tracking-tight text-white mb-2 sm:mb-4",children:[e.jsx(wt,{className:"h-8 w-8 sm:h-10 sm:w-10 lg:h-12 lg:w-12 text-[#d1abff]",strokeWidth:2.5}),"Quiz Battle"]}),e.jsx("p",{className:"text-base sm:text-lg lg:text-xl text-white mt-1.5 sm:mt-2 max-w-2xl leading-relaxed",children:"Timed student duels with synchronized rounds, instant feedback, and progression rewards."}),e.jsxs("p",{className:"text-xs lg:text-sm font-semibold uppercase tracking-[0.15em] text-[#8a7fbc] mt-3",children:["Connection: ",e.jsx("span",{className:Dt==="connected"?"text-emerald-400":"text-amber-400",children:Dt})]})]})}),e.jsx("div",{className:"hidden md:block absolute right-[-5px] lg:right-[-15px] top-0 lg:top-[5px] w-[200px] lg:w-[260px] shrink-0 pointer-events-none z-20",children:e.jsx("img",{src:jt,alt:"Mascot",className:"w-full h-full object-contain animate-mascot-float"})})]})]}),e.jsxs("div",{className:"pt-4 lg:pt-6",children:[e.jsxs("h2",{className:"flex items-center gap-2 pb-4 text-xl lg:text-2xl font-black tracking-wide uppercase text-white drop-shadow-[0_0_12px_rgba(255,255,255,0.4)]",children:[e.jsx(wt,{className:"h-6 w-6 lg:h-8 lg:w-8 text-amber-400 drop-shadow-[0_0_8px_rgba(251,191,36,0.9)]"})," BATTLE MODES"]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-2 gap-3 sm:gap-4 lg:gap-6 relative z-10 w-full mb-2",children:[e.jsxs(y.button,{type:"button",onClick:()=>Gt("online"),whileHover:{scale:1.025},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:15},className:"w-full h-[170px] sm:h-[245px] lg:h-[265px] bg-[#8A3FD3] rounded-[22px] border-none relative text-left shadow-[0_8px_30px_rgba(138,63,211,0.2)] hover:shadow-[0_12px_45px_rgba(138,63,211,0.4)] block flex-col group",children:[e.jsx("div",{className:"absolute inset-0 rounded-[22px] shadow-[inset_0_6px_15px_rgba(255,255,255,0.4)] pointer-events-none z-40"}),e.jsxs("div",{className:"absolute top-4 -left-4 z-20 w-[100px] h-[40px] opacity-100",children:[e.jsx("svg",{viewBox:"0 0 100 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full block drop-shadow-md",children:e.jsx("path",{d:"M0 0 H94 Q100 0 100 6 V34 Q100 40 94 40 H0 L14 20 Z",fill:"#b91c1c"})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-end pr-3 font-black text-[13px] text-white tracking-[0.3px] opacity-100 font-nunito",children:"VS Player"})]}),e.jsxs("div",{className:"rounded-[22px] overflow-hidden relative isolate h-full flex flex-col justify-end",children:[e.jsx("div",{className:"absolute top-0 -left-[150%] w-[100%] h-full bg-gradient-to-r from-transparent via-white/40 to-transparent -skew-x-12 z-50 pointer-events-none transition-all duration-0 group-hover:duration-[800ms] ease-in-out group-hover:left-[150%]"}),e.jsxs("div",{className:"flex-1 w-full flex items-end justify-center relative pt-2 pointer-events-none",children:[e.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[50px] sm:h-[95px] bg-[#662AA8] rounded-[50%_50%_0_0/100%_100%_0_0] scale-[1.05] z-0"}),e.jsxs("div",{className:"relative z-10 flex items-center justify-center mb-[2px] h-[80px] sm:h-[140px] w-full",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"",className:"h-[120%] sm:h-[125%] object-contain relative z-20 origin-bottom right-[-10px] sm:right-[-15px] drop-shadow-[0_12px_15px_rgba(0,0,0,0.3)] animate-avatar-left"}),e.jsx("div",{className:"relative z-30 flex flex-col items-center mx-[-20px] scale-[1.1] animate-vs-pulse",children:e.jsxs("span",{className:"font-black italic text-[28px] sm:text-[40px] text-gray-200 tracking-tighter leading-none drop-shadow-[-2px_3px_0px_rgba(0,0,0,0.8)] webkit-text-stroke",children:[e.jsx("span",{className:"text-gray-300",children:"V"}),e.jsx("span",{className:"text-gray-400",children:"S"})]})}),e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"",className:"h-[120%] sm:h-[125%] object-contain relative z-10 scale-x-[-1] origin-bottom left-[-20px] drop-shadow-[0_12px_15px_rgba(0,0,0,0.3)] animate-avatar-right"})]})]}),e.jsx("div",{className:"relative z-10 w-full px-3 sm:px-5 py-2 sm:py-4 text-center bg-[#662AA8]",children:e.jsx("p",{className:"text-[10px] sm:text-[13px] font-bold text-white leading-[1.4] font-nunito",children:"Queue or room-code match with another student."})})]})]}),e.jsxs(y.button,{type:"button",onClick:()=>Gt("bot"),whileHover:{scale:1.025},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:15},className:"w-full h-[170px] sm:h-[245px] lg:h-[265px] bg-[#1FA7E1] rounded-[22px] border-none relative text-left shadow-[0_8px_30px_rgba(31,167,225,0.2)] hover:shadow-[0_12px_45px_rgba(31,167,225,0.4)] block flex-col group",children:[e.jsx("div",{className:"absolute inset-0 rounded-[22px] shadow-[inset_0_6px_15px_rgba(255,255,255,0.4)] pointer-events-none z-40"}),e.jsxs("div",{className:"absolute top-4 -left-4 z-20 w-[100px] h-[40px] opacity-100",children:[e.jsx("svg",{viewBox:"0 0 100 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full block drop-shadow-md",children:e.jsx("path",{d:"M0 0 H94 Q100 0 100 6 V34 Q100 40 94 40 H0 L14 20 Z",fill:"#b91c1c"})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-end pr-3 font-black text-[13px] text-white tracking-[0.3px] opacity-100 font-nunito",children:"VS Bot"})]}),e.jsxs("div",{className:"rounded-[22px] overflow-hidden relative isolate h-full flex flex-col justify-end",children:[e.jsx("div",{className:"absolute top-0 -left-[150%] w-[100%] h-full bg-gradient-to-r from-transparent via-white/40 to-transparent -skew-x-12 z-50 pointer-events-none transition-all duration-0 group-hover:duration-[800ms] ease-in-out group-hover:left-[150%]"}),e.jsxs("div",{className:"flex-1 w-full flex items-end justify-center relative pt-2 pointer-events-none",children:[e.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[50px] sm:h-[95px] bg-[#127DA6] rounded-[50%_50%_0_0/100%_100%_0_0] scale-[1.05] z-0"}),e.jsxs("div",{className:"relative z-10 flex items-end justify-center mb-[2px] h-[85px] sm:h-[145px] w-full",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"",className:"absolute opacity-40 blur-[1px] h-full object-contain origin-bottom -translate-x-[30px] sm:-translate-x-[60px] scale-[0.80] sm:scale-[0.85] animate-ghost-left"}),e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"",className:"absolute opacity-40 blur-[1px] h-full object-contain origin-bottom translate-x-[30px] sm:translate-x-[60px] scale-[0.80] sm:scale-[0.85] animate-ghost-right"}),e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"VS Bot",className:"relative opacity-100 scale-100 h-[105%] sm:h-[115%] object-contain drop-shadow-[0_15px_15px_rgba(0,0,0,0.3)] z-20 origin-bottom animate-main-avatar"})]})]}),e.jsx("div",{className:"relative z-10 w-full px-3 sm:px-5 py-2 sm:py-4 text-center bg-[#127DA6]",children:e.jsx("p",{className:"text-[10px] sm:text-[13px] font-bold text-white leading-[1.4] font-nunito",children:"Instant solo duel with selectable bot difficulty."})})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3 lg:space-y-4 flex flex-col h-full justify-between",children:[e.jsx("div",{onClick:()=>d("leaderboard"),className:"relative w-full bg-[#3b3a82] dark:bg-[#2b2b5f] rounded-[24px] overflow-hidden flex flex-col shadow-[0_8px_30px_rgba(59,58,130,0.3)] cursor-pointer group mb-4",children:e.jsxs("div",{className:"relative w-full h-[190px] flex flex-col items-center justify-end pt-8",children:[e.jsxs("div",{className:"absolute top-[25px] w-full flex justify-center items-end px-2 z-10 gap-3",children:[e.jsx(vt,{strokeWidth:0,fill:"currentColor",className:"w-[32px] h-[32px] text-[#fcd34d] -rotate-[15deg] mb-2 drop-shadow-[0_0_15px_rgba(252,211,77,0.8)]"}),e.jsx("div",{className:"z-10 animate-star-float",children:e.jsx(vt,{strokeWidth:0,fill:"currentColor",className:"w-[48px] h-[48px] text-[#fcd34d] drop-shadow-[0_0_25px_rgba(252,211,77,0.9)]"})}),e.jsx(vt,{strokeWidth:0,fill:"currentColor",className:"w-[32px] h-[32px] text-[#fcd34d] rotate-[15deg] mb-2 drop-shadow-[0_0_15px_rgba(252,211,77,0.8)]"})]}),e.jsx("div",{className:"absolute bottom-[50px] left-1/2 -translate-x-1/2 w-[220px] h-[160px] bg-gradient-to-t from-white/20 to-transparent blur-[2px] z-0 pointer-events-none",style:{clipPath:"polygon(25% 0, 75% 0, 100% 100%, 0% 100%)"}}),e.jsxs("div",{className:"flex items-end justify-center z-10 relative px-4 bottom-[35px]",children:[e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx("div",{className:"w-[75px] h-[14px] bg-[#D44747] rounded-t-[3px] border-x-[1.5px] border-white/90"}),e.jsxs("div",{className:"w-[65px] h-[45px] bg-[#FE6464] flex flex-col items-center justify-center gap-2 border-x-[1.5px] border-white/90",children:[e.jsx("div",{className:"w-8 h-1.5 bg-white/90 rounded-full mt-1"}),e.jsx("div",{className:"w-8 h-1.5 bg-white/90 rounded-full"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-20 -mx-1",children:[e.jsx("div",{className:"w-[90px] h-[16px] bg-[#F39029] rounded-t-[3px] border-x-[1.5px] border-white/90"}),e.jsxs("div",{className:"w-[80px] h-[65px] bg-[#FFA23A] flex flex-col items-center justify-center gap-2.5 border-x-[1.5px] border-white/90",children:[e.jsx("div",{className:"w-10 h-1.5 bg-white/90 rounded-full mt-1"}),e.jsx("div",{className:"w-10 h-1.5 bg-white/90 rounded-full"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx("div",{className:"w-[75px] h-[14px] bg-[#D44747] rounded-t-[3px] border-x-[1.5px] border-white/90"}),e.jsxs("div",{className:"w-[65px] h-[45px] bg-[#FE6464] flex flex-col items-center justify-center gap-2 border-x-[1.5px] border-white/90",children:[e.jsx("div",{className:"w-8 h-1.5 bg-white/90 rounded-full mt-1"}),e.jsx("div",{className:"w-8 h-1.5 bg-white/90 rounded-full"})]})]})]}),e.jsxs("div",{className:"absolute bottom-[2px] w-full flex justify-center z-30",children:[e.jsx("div",{className:"absolute top-[10px] w-full h-[35px] bg-[#8E1010] z-0"}),e.jsxs("div",{className:"relative w-[85%] h-[50px] bg-[#C62828] z-10 flex flex-col items-center justify-center rounded-[3px] shadow-[0_4px_10px_rgba(0,0,0,0.2)]",children:[e.jsx("h3",{className:"text-[18px] font-black text-white tracking-wide leading-none font-nunito mt-0.5",children:"Hall of Fame"}),e.jsx("span",{className:"text-[10px] font-bold text-white/90 tracking-wide mt-1",children:"View Page >"})]})]})]})}),e.jsxs("div",{className:"relative w-full bg-[#3b3a82] dark:bg-[#2b2b5f] rounded-[24px] overflow-hidden flex flex-col shadow-[0_8px_30px_rgba(59,58,130,0.3)]",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between px-5 pt-5 pb-3 relative z-10",children:[e.jsx("h3",{className:"text-[20px] font-black text-white tracking-wide leading-none drop-shadow-md font-nunito",children:"My Stats"}),e.jsx(A,{className:"bg-[#7C51A8] hover:bg-[#6b4494] text-white font-bold text-[10px] tracking-widest uppercase rounded-full px-4 h-[28px] border border-white/10 shadow-md transition-transform active:scale-95",onClick:()=>d("stats"),children:"View Stats >"})]}),e.jsxs("div",{className:"relative z-10 w-full overflow-hidden pb-6",children:[e.jsx("div",{className:"absolute left-0 top-0 bottom-6 w-8 bg-gradient-to-r from-[#3b3a82] dark:from-[#2b2b5f] to-transparent z-20 pointer-events-none"}),e.jsx("div",{className:"absolute right-0 top-0 bottom-6 w-8 bg-gradient-to-l from-[#3b3a82] dark:from-[#2b2b5f] to-transparent z-20 pointer-events-none"}),e.jsx(y.div,{className:"flex w-max",animate:{x:["0%","-33.333333%"]},transition:{ease:"linear",duration:15,repeat:1/0},children:[1,2,3].map(t=>e.jsx("div",{className:"flex gap-3 pr-3",children:[{key:"totalXP",bg:"from-[#FF7B88] to-[#FF5C70]",shadow:"shadow-[0_4px_15px_rgba(255,92,112,0.4),inset_0_1px_1px_rgba(255,255,255,0.4)]",icon:Je,value:n?.currentXP||0,label:"Total XP"},{key:"winRate",bg:"from-[#B467FF] to-[#9D44FF]",shadow:"shadow-[0_4px_15px_rgba(157,68,255,0.4),inset_0_1px_1px_rgba(255,255,255,0.4)]",icon:gt,value:`${Math.round(ee?.winRate||0)} %`,label:"Win Rate"},{key:"matches",bg:"from-[#4DB9E9] to-[#2DA1D8]",shadow:"shadow-[0_4px_15px_rgba(45,161,216,0.4),inset_0_1px_1px_rgba(255,255,255,0.4)]",icon:At,value:ee?.matchesPlayed||0,label:"Matches"},{key:"response",bg:"from-[#48DA94] to-[#2BBF7B]",shadow:"shadow-[0_4px_15px_rgba(43,191,123,0.4),inset_0_1px_1px_rgba(255,255,255,0.4)]",icon:sa,value:ee?.averageResponseMs?`${(ee.averageResponseMs/1e3).toFixed(0)}s`:"0s",label:"Response"}].map(o=>e.jsxs("div",{className:u("w-[90px] sm:w-[100px] shrink-0 aspect-square rounded-[16px] bg-gradient-to-br p-3 flex flex-col justify-between relative overflow-hidden group",o.bg,o.shadow),children:[e.jsx("div",{className:"absolute -bottom-6 -right-6 text-white/10 transition-transform duration-500 group-hover:scale-110",children:e.jsx(o.icon,{className:"w-20 h-20"})}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center relative z-10 shadow-[inset_0_1px_3px_rgba(255,255,255,0.5)]",children:e.jsx(o.icon,{className:"w-4 h-4 text-white"})}),e.jsxs("div",{className:"relative z-10 flex flex-col",children:[e.jsx("h4",{className:"text-[14px] sm:text-[16px] lg:text-[18px] font-black text-white leading-none tracking-tight drop-shadow-sm",children:o.value}),e.jsx("p",{className:"text-[8px] sm:text-[9px] font-extrabold text-white/80 uppercase tracking-widest mt-1 truncate",children:o.label})]})]},o.key))},t))})]})]}),e.jsxs(pe,{className:u(fe,"rounded-[18px] flex flex-col min-h-[200px]"),children:[e.jsxs(he,{className:"pb-0 pt-3 px-4 flex flex-row items-center justify-between",children:[e.jsxs(be,{className:"text-[14px] font-black flex items-center gap-2 text-[#2e2b5e] dark:text-[#f5f7fb]",children:[e.jsx(es,{className:"h-[16px] w-[16px] text-[#2e2b5e] dark:text-[#9e8fff]"})," Match History"]}),e.jsx(A,{variant:"link",size:"sm",className:"h-auto p-0 text-[12px] font-semibold text-muted-foreground dark:text-[#95a0bb] hover:text-primary transition-colors",onClick:()=>d("history"),children:"View All"})]}),e.jsxs(Xe,{className:"space-y-1.5 px-4 pt-1 pb-3 overflow-y-auto",children:[e.jsx("div",{className:"text-[11px] text-muted-foreground dark:text-[#8b95ad] mb-1.5 leading-relaxed",children:"Your recent student battles only."}),Pt?e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"h-10 w-full rounded-xl bg-muted dark:bg-[#2a3143]"}),e.jsx(xe,{className:"h-10 w-full rounded-xl bg-muted dark:bg-[#2a3143]"})]}):Oe.length===0?e.jsx("p",{className:"text-xs text-center text-muted-foreground dark:text-[#a8b2c9] py-2",children:"No battle history yet."}):Oe.slice(0,3).map(t=>{const o=t.outcome==="win",p=t.outcome==="loss",x=t.opponentName.split(" ").map(k=>k[0]).join("").substring(0,2).toUpperCase()||"OP";return e.jsxs("div",{className:"group relative overflow-hidden rounded-[14px] border border-muted-foreground/15 bg-white dark:bg-[#11151d] dark:border-[#2f3547] p-2 shadow-sm transition-all hover:scale-[1.01] hover:shadow-md",children:[e.jsx("div",{className:u("absolute inset-y-0 right-0 w-[55%] pointer-events-none opacity-[0.2] dark:opacity-[0.25] mix-blend-multiply dark:mix-blend-screen transition-all",o?"bg-gradient-to-l from-emerald-500 via-emerald-500/40 to-transparent":p?"bg-gradient-to-l from-rose-500 via-rose-500/40 to-transparent":"bg-gradient-to-l from-amber-400 via-amber-400/40 to-transparent")}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 w-full",children:[e.jsx("div",{className:u("w-9 h-9 rounded-full flex items-center justify-center font-black text-[12px] tracking-wide text-white flex-shrink-0 shadow-inner",o?"bg-[#34d399] dark:bg-[#15803d]":p?"bg-[#fb7185] dark:bg-[#be123c]":"bg-[#fbbf24] dark:bg-[#b45309]"),children:x}),e.jsxs("div",{className:"flex-grow min-w-0 flex flex-col justify-center",children:[e.jsxs("p",{className:"text-[13px] font-extrabold text-[#36326e] dark:text-[#e4e7f1] truncate leading-tight",children:["vs ",t.opponentName]}),e.jsxs("p",{className:"text-[10px] font-bold text-muted-foreground/60 dark:text-[#7f88a3] truncate flex items-center gap-1 mt-0.5",children:[t.subjectId," ",e.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/30"})," ",t.difficulty||"Medium"," ",e.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/30"})," ",t.rounds||"5"," rnds"]})]}),e.jsxs("div",{className:"text-right flex flex-col items-end justify-center pl-2 flex-shrink-0",children:[e.jsxs("p",{className:"tabular-nums text-[16px] leading-[1.1] font-black text-[#2e2b5e] dark:text-[#f5f7fb] tracking-tighter",children:[t.scoreFor,e.jsx("span",{className:"text-muted-foreground/40 mx-[1px]",children:"-"}),t.scoreAgainst]}),e.jsx("p",{className:u("text-[9px] font-black uppercase tracking-[0.1em]",o?"text-emerald-500 dark:text-emerald-400":p?"text-rose-500 dark:text-rose-400":"text-amber-500 dark:text-amber-400"),children:t.outcome})]})]})]},t.matchId)})]})]})]})]})},"hub")}),e.jsx(ke,{value:"setup",className:"mt-0 outline-none",children:e.jsxs(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"w-full space-y-6",children:[e.jsxs(y.div,{className:u(fe,"relative overflow-hidden rounded-[24px] mb-6 shadow-lg",l.mode==="online"?"border-purple-500/20 shadow-[0_0_40px_-10px_rgba(138,63,211,0.2)]":"border-sky-500/20 shadow-[0_0_40px_-10px_rgba(31,167,225,0.2)]"),whileHover:{scale:1.01},transition:{type:"spring",stiffness:300,damping:20},children:[e.jsx("div",{className:u("pointer-events-none absolute inset-0 bg-gradient-to-r",l.mode==="online"?"from-purple-500/20 via-fuchsia-500/10 to-purple-600/5 dark:from-purple-500/20 dark:via-fuchsia-500/10 dark:to-purple-900/10":"from-sky-500/20 via-cyan-500/10 to-sky-600/5 dark:from-sky-500/20 dark:via-cyan-500/10 dark:to-sky-900/10")}),e.jsx("div",{className:u("pointer-events-none absolute -top-24 -right-24 h-64 w-64 rounded-full blur-3xl animate-orb-pulse",l.mode==="online"?"bg-purple-400/20":"bg-sky-400/20")}),e.jsx("div",{className:u("pointer-events-none absolute -bottom-12 -left-12 h-40 w-40 rounded-full blur-2xl animate-orb-pulse-delayed",l.mode==="online"?"bg-fuchsia-400/30":"bg-cyan-400/30")}),e.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAiLz4KPHBhdGggZD0iTTAgMEgxdjFIMHoiIGZpbGw9IiM2MzY2ZjEiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPgo8L3N2Zz4=')] opacity-30 dark:opacity-10 mix-blend-overlay"}),e.jsxs("div",{className:"relative p-6 sm:p-8 md:px-10 flex items-center gap-5 sm:gap-8 z-10",children:[e.jsx(A,{variant:"ghost",onClick:()=>d("hub"),className:u("h-12 w-12 sm:h-14 sm:w-14 p-0 rounded-full hover:scale-105 transition-all backdrop-blur-md shadow-lg shrink-0 flex items-center justify-center group",l.mode==="online"?"bg-white/50 dark:bg-black/40 hover:bg-white/80 dark:hover:bg-black/60 border border-purple-500/30":"bg-white/50 dark:bg-black/40 hover:bg-white/80 dark:hover:bg-black/60 border border-sky-500/30"),children:e.jsx(Ue,{className:u("h-6 w-6 sm:h-8 sm:w-8 rotate-180 transition-transform group-hover:-translate-x-0.5",l.mode==="online"?"text-purple-800 dark:text-purple-300":"text-sky-800 dark:text-sky-300")})}),e.jsxs("div",{children:[e.jsxs("h2",{className:u("flex items-center gap-3 text-3xl sm:text-4xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-br drop-shadow-sm",l.mode==="online"?"from-purple-600 to-fuchsia-500 dark:from-purple-300 dark:to-fuchsia-200":"from-sky-600 to-cyan-500 dark:from-sky-300 dark:to-cyan-200"),children:[e.jsx("div",{className:u("p-2 rounded-2xl shadow-inner border animate-icon-bob",l.mode==="online"?"bg-purple-100 dark:bg-purple-900/50 border-purple-200 dark:border-purple-700/50":"bg-sky-100 dark:bg-sky-900/50 border-sky-200 dark:border-sky-700/50"),children:l.mode==="online"?e.jsx(ge,{className:"h-8 w-8 text-purple-600 dark:text-purple-400 drop-shadow-[0_0_8px_rgba(138,63,211,0.5)]"}):e.jsx(Te,{className:"h-8 w-8 text-sky-600 dark:text-sky-400 drop-shadow-[0_0_8px_rgba(31,167,225,0.5)]"})}),l.mode==="online"?"1v1 Online":"1v1 vs Bot"]}),e.jsx("p",{className:u("text-[10px] sm:text-[12px] font-black uppercase tracking-[0.2em] mt-1.5 drop-shadow-sm",l.mode==="online"?"text-purple-600/80 dark:text-purple-400/80":"text-sky-600/80 dark:text-sky-400/80"),children:l.mode==="online"?"CHALLENGE YOUR SCHOOLMATES AND PROVE YOUR SKILLS.":"CHALLENGE THE AI AND SHARPEN YOUR SKILLS."})]})]})]}),e.jsx("div",{className:"rounded-[24px] border border-white/40 bg-white/85 dark:border-white/10 dark:bg-black/80 backdrop-blur-xl p-5 sm:p-7 shadow-xl",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-10",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[11px] font-black uppercase tracking-[0.12em] ml-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:"Category"}),e.jsxs(Me,{value:l.subjectId,onValueChange:t=>w(o=>({...o,subjectId:t})),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white/60 text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50",U("subjectId")&&"border-rose-400"),children:e.jsx(Ee,{placeholder:"Select category"})}),e.jsx(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:le.map(t=>e.jsx(de,{value:t.id,className:"rounded-lg",children:t.title},t.id))})]}),U("subjectId")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300 ml-1",children:U("subjectId")})]}),e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[11px] font-black uppercase tracking-[0.12em] ml-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:"Strand / Topic Group"}),e.jsxs(Me,{value:l.topicId,onValueChange:t=>w(o=>({...o,topicId:t})),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white/60 text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50",U("topicId")&&"border-rose-400"),children:e.jsx(Ee,{placeholder:"Select topic group"})}),e.jsx(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:Pa.map(t=>e.jsx(de,{value:t.value,className:"rounded-lg",children:t.label},t.value))})]}),U("topicId")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300 ml-1",children:U("topicId")})]}),e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[11px] font-black uppercase tracking-[0.12em] ml-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:l.mode==="online"?"Difficulty":"Bot Difficulty"}),e.jsxs(Me,{value:l.mode==="bot"?l.adaptiveBot?"adaptive":l.botDifficulty:l.difficulty,onValueChange:t=>w(o=>o.mode==="bot"?{...o,botDifficulty:t,adaptiveBot:t==="adaptive"}:{...o,difficulty:t}),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white/60 text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50"),children:e.jsx(Ee,{})}),e.jsxs(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:[e.jsx(de,{value:"easy",className:"rounded-lg",children:"Easy"}),e.jsx(de,{value:"medium",className:"rounded-lg",children:"Medium"}),e.jsx(de,{value:"hard",className:"rounded-lg",children:"Hard"}),l.mode==="bot"&&e.jsx(de,{value:"adaptive",className:"rounded-lg",children:"Adaptive"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[10px] sm:text-[11px] font-black uppercase tracking-[0.12em] ml-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:"Questions"}),e.jsxs(Me,{value:String(l.rounds),onValueChange:t=>w(o=>({...o,rounds:Number(t)})),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white/60 text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50",U("rounds")&&"border-rose-400"),children:e.jsx(Ee,{})}),e.jsx(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:[3,5,7,10,12,15].map(t=>e.jsx(de,{value:String(t),className:"rounded-lg",children:t},t))})]}),U("rounds")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300 ml-1",children:U("rounds")})]}),e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[10px] sm:text-[11px] font-black uppercase tracking-[0.12em] ml-1 line-clamp-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:"Time / Q"}),e.jsxs(Me,{value:String(l.timePerQuestionSec),onValueChange:t=>w(o=>({...o,timePerQuestionSec:Number(t)})),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white/60 text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50",U("timePerQuestionSec")&&"border-rose-400"),children:e.jsx(Ee,{})}),e.jsx(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:[15,20,30,45,60,90].map(t=>e.jsxs(de,{value:String(t),className:"rounded-lg",children:[t," sec"]},t))})]}),U("timePerQuestionSec")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300 ml-1",children:U("timePerQuestionSec")})]})]})]}),e.jsxs("div",{className:"flex flex-col justify-between space-y-6",children:[e.jsxs("div",{className:"space-y-5",children:[l.mode==="online"&&e.jsxs("div",{className:"space-y-3 rounded-2xl border border-[#8A3FD3]/20 bg-[#8A3FD3]/5 dark:border-[#8A3FD3]/20 p-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[11px] font-black uppercase tracking-[0.12em] text-[#8A3FD3] dark:text-[#a35ceb] ml-1",children:"Online Match Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{value:"public_matchmaking",label:"Public Queue"},{value:"private_room",label:"Private Room"}].map(t=>e.jsx(A,{type:"button",variant:l.queueType===t.value?"default":"outline",className:u("rounded-xl h-11 transition-all border-none font-bold text-xs",l.queueType===t.value?"bg-[#8A3FD3] hover:bg-[#7b35c0] text-white shadow-md shadow-[#8A3FD3]/30":"bg-white/50 hover:bg-white/80 dark:bg-black/30 dark:hover:bg-black/50 text-[#8A3FD3] dark:text-[#d3a8ff]"),onClick:()=>w(o=>({...o,queueType:t.value})),children:t.label},t.value))})]}),l.queueType==="private_room"&&e.jsxs(y.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"pt-2 space-y-2",children:[e.jsx("label",{className:"text-[11px] font-black uppercase tracking-[0.12em] text-[#8A3FD3] dark:text-[#a35ceb] ml-1",children:"Room Code (optional)"}),e.jsx(Ka,{value:W,onChange:t=>S(t.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6)),placeholder:"Leave blank to create a room",className:"rounded-xl h-12 text-center text-lg uppercase font-bold tracking-[0.25em] border-[#8A3FD3]/30 bg-white/80 dark:bg-black/50 dark:border-[#8A3FD3]/20 focus-visible:ring-[#8A3FD3]/50 shadow-inner",maxLength:6}),e.jsx("div",{className:"rounded-xl border border-[#8A3FD3]/30 bg-[#8A3FD3]/10 px-3 py-3 text-[12px] font-semibold text-[#6620a2] leading-snug dark:border-[#8A3FD3]/30 dark:bg-[#8A3FD3]/10 dark:text-[#d3a8ff]",children:"Enter a room code to join an existing battle, or leave it blank to create a new room and share your code."})]})]}),e.jsxs("label",{className:u("flex flex-col sm:flex-row sm:items-center justify-between rounded-[16px] border bg-white/50 p-4 transition-colors cursor-pointer shadow-sm dark:bg-black/50 group",l.mode==="online"?"border-[#8A3FD3]/20 hover:bg-[#8A3FD3]/5 dark:border-[#8A3FD3]/20 dark:hover:bg-[#8A3FD3]/10":"border-[#1FA7E1]/20 hover:bg-[#1FA7E1]/5 dark:border-[#1FA7E1]/20 dark:hover:bg-[#1FA7E1]/10"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:u("h-11 w-11 rounded-full flex items-center justify-center group-hover:scale-110 transition-transform",l.mode==="online"?"bg-[#8A3FD3]/10 text-[#8A3FD3] dark:text-[#c48bfc]":"bg-[#1FA7E1]/10 text-[#1FA7E1] dark:text-[#7ad8ff]"),children:J?e.jsx(fa,{className:"h-5 w-5"}):e.jsx(ga,{className:"h-5 w-5 opacity-60"})}),e.jsxs("div",{className:"mb-3 sm:mb-0",children:[e.jsx("p",{className:"text-sm font-bold text-slate-800 dark:text-slate-200",children:"Battle Sounds"}),e.jsx("p",{className:"text-xs font-medium text-slate-500 dark:text-slate-400",children:"Cues for countdowns and results."})]})]}),e.jsx(Ja,{checked:J,onCheckedChange:Tt})]}),e.jsxs(y.div,{initial:!1,animate:{opacity:J?1:.45,y:J?0:-2},className:u("rounded-[16px] border bg-white/40 p-4 shadow-sm dark:bg-black/40",l.mode==="online"?"border-[#8A3FD3]/20 dark:border-[#8A3FD3]/20":"border-[#1FA7E1]/20 dark:border-[#1FA7E1]/20"),children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-[0.14em] text-slate-700 dark:text-slate-200",children:"SFX Volume"}),e.jsxs("p",{className:"text-xs font-bold text-slate-500 dark:text-slate-400",children:[Math.round(ce*100),"%"]})]}),e.jsx("input",{type:"range",min:0,max:100,step:1,value:Math.round(ce*100),disabled:!J,onChange:t=>{const o=Ge(Number(t.target.value)/100,0,1);za(o)},onMouseUp:()=>Q("tick"),onTouchEnd:()=>Q("tick"),className:"h-2 w-full cursor-pointer accent-violet-500 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Battle sound effects volume"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{"aria-live":"polite",className:"min-h-[24px] text-sm font-medium",children:[N.status==="queued"&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:u("inline-flex items-center gap-1 text-[13px] font-bold px-3 py-1.5 rounded-lg",l.mode==="online"?"text-[#8A3FD3] bg-[#8A3FD3]/10":"text-[#1FA7E1] bg-[#1FA7E1]/10"),children:N.message}),l.mode==="online"&&l.queueType==="private_room"&&m?.roomCode&&e.jsxs(A,{type:"button",variant:"outline",className:u("h-8 rounded-full border-emerald-500/50 bg-emerald-50 px-4 text-xs font-black uppercase tracking-[0.16em] text-emerald-900 shadow-sm hover:bg-emerald-100 hover:scale-105 transition-all dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-300 dark:hover:bg-emerald-500/20",R===m.roomCode&&"scale-105 bg-emerald-200 dark:bg-emerald-500/30"),onClick:()=>void Vt(m.roomCode),"aria-label":`Copy room code ${m.roomCode}`,children:[R===m.roomCode?e.jsx(yt,{className:"h-4 w-4"}):e.jsx(aa,{className:"h-4 w-4"}),m.roomCode]}),(j||Kt)&&O>0&&e.jsxs("span",{className:u("inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-bold animate-pulse",l.mode==="online"?"bg-[#8A3FD3]/10 text-[#8A3FD3]":"bg-[#1FA7E1]/10 text-[#1FA7E1]"),children:["Waiting ",da(O)]})]}),N.status==="error"&&e.jsx("span",{className:"inline-flex items-center gap-1.5 text-[13px] font-bold text-rose-600 dark:text-rose-400 bg-rose-50 dark:bg-rose-500/10 px-3 py-1.5 rounded-lg border border-rose-200 dark:border-rose-500/20",children:N.message}),N.status==="validating"&&e.jsxs("span",{className:u("inline-flex items-center gap-2 font-bold px-3 py-1.5 rounded-lg",l.mode==="online"?"text-[#8A3FD3] bg-[#8A3FD3]/10":"text-[#1FA7E1] bg-[#1FA7E1]/10"),children:[e.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Validating..."]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[$a&&e.jsx(A,{type:"button",variant:"outline",onClick:Zt,disabled:N.status==="validating",className:"rounded-xl h-14 flex-1 sm:flex-none border-slate-300 hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800 font-bold px-6",children:m?"Cancel room":"Leave queue"}),e.jsx(A,{type:"button",onClick:La,disabled:N.status==="validating"||j||Kt,className:u("rounded-xl h-14 flex-1 px-8 font-black uppercase tracking-wide text-sm shadow-xl hover:scale-[1.02] active:scale-95 transition-all text-white border-0",l.mode==="online"?"bg-[#8A3FD3] hover:bg-[#7b35c0] shadow-[#8A3FD3]/40":"bg-[#1FA7E1] hover:bg-[#1a95c9] shadow-[#1FA7E1]/40"),children:N.status==="validating"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(Ke,{className:"h-5 w-5 animate-spin"})," Starting..."]}):l.mode==="online"&&l.queueType==="private_room"?W.trim()?"Join Room":"Create Room":"Start Battle"})]})]})]})]})})]},"setup")}),e.jsx(ke,{value:"battle",className:"mt-0 outline-none",children:e.jsx(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:r?e.jsxs(pe,{className:u(fe,"rounded-[18px]"),children:[e.jsxs(he,{children:[e.jsxs(be,{className:"text-base flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2",children:[r.mode==="bot"?e.jsx(Te,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}):e.jsx(ge,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"vs ",r.opponentName]}),e.jsxs("div",{className:"inline-flex items-center gap-2",children:[ft,e.jsxs("span",{className:"text-sm font-bold tabular-nums",children:[r.scoreFor," - ",r.scoreAgainst]})]})]}),e.jsx(Ne,{className:"text-muted-foreground dark:text-[#b2bad0]",children:r.status==="completed"?`Completed in ${r.totalRounds} rounds.`:r.status==="ready"?r.mode==="online"?"Waiting for both players to confirm and start together.":"Finalizing practice bot session start.":`Round ${r.currentRound} of ${r.totalRounds}${F?" (paused for design)":""}`}),ca(r.lifecycle,n?.uid)&&e.jsx("p",{className:"text-xs font-medium text-muted-foreground dark:text-[#9aa4be]",children:ca(r.lifecycle,n?.uid)})]}),e.jsxs(Xe,{className:"space-y-4",children:[r.status==="ready"&&e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-4 dark:border-[#2f3547] dark:bg-[#11151d] flex flex-col gap-3",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:r.mode==="online"?"Waiting for both players to lock in start...":"Starting practice bot round..."}),r.mode==="online"&&r.expiresAtMs&&e.jsxs("p",{className:"text-xs font-medium text-muted-foreground dark:text-[#9aa4be]",children:["Public match expires in ",e.jsx("span",{className:"font-semibold tabular-nums",children:da(O)})," if the synchronized start does not happen."]}),e.jsx(A,{variant:"outline",size:"sm",className:"w-full text-rose-500 border-rose-200 hover:bg-rose-50 dark:border-rose-900 dark:hover:bg-rose-900/30",onClick:()=>{_(null),v(null),h(!1),b({status:"idle"}),d("setup")},children:"Force Cancel"})]}),r.status==="in_progress"&&r.currentQuestion&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl border border-border bg-muted/40 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Time left: ",e.jsxs("span",{className:"font-semibold tabular-nums",children:[P,"s"]}),F?" (paused)":""]}),F&&e.jsx("p",{className:"mt-1 text-[11px] font-medium text-amber-700 dark:text-amber-300",children:"Design pause keeps this battle screen static while you edit UI."})]}),e.jsx("p",{className:"text-lg font-bold text-foreground dark:text-[#f5f7fb]",children:r.currentQuestion.prompt}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:r.currentQuestion.choices.map((t,o)=>e.jsxs(A,{type:"button",variant:ve===o?"default":"outline",onClick:()=>X(o),disabled:G||Z||F,className:u("h-auto min-h-[48px] justify-start text-left font-medium px-4 py-3 rounded-xl whitespace-normal",ve===o?"ring-2 ring-primary ring-offset-2 dark:ring-offset-[#0B0F19]":""),children:[e.jsxs("span",{className:"mr-2 font-semibold",children:[String.fromCharCode(65+o),"."]}),t]},o))}),e.jsx("div",{className:"flex justify-end",children:e.jsx(A,{type:"button",onClick:()=>void Ve(ve),disabled:G||Z||F,className:"rounded-xl",children:F?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4"})," Paused for design"]}):G?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Submitting..."]}):Z?"Waiting for opponent...":"Lock Answer"})})]}),B&&e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:["Last round: ",B.studentCorrect?"Correct":"Incorrect"," · ",r.mode==="bot"?"Bot":"Opponent"," ",B.botCorrect?"Correct":"Incorrect"]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Correct option: ",String.fromCharCode(65+B.correctOptionIndex)]})]}),r.status==="completed"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:u("rounded-2xl border p-4",r.outcome==="win"?"border-emerald-300 bg-emerald-50 dark:border-emerald-400/40 dark:bg-emerald-900/20":r.outcome==="loss"?"border-rose-300 bg-rose-50 dark:border-rose-400/40 dark:bg-rose-900/20":"border-amber-300 bg-amber-50 dark:border-amber-400/40 dark:bg-amber-900/20"),children:[e.jsx("p",{className:"text-lg font-black tracking-wide text-foreground dark:text-[#ecf0fb]",children:r.outcome==="win"?"Victory!":r.outcome==="loss"?"Match Complete":"Draw Match"}),e.jsxs("p",{className:"mt-1 text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:["Final Score: ",r.scoreFor," - ",r.scoreAgainst]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["XP Earned: +",r.xpBreakdown?.totalXPAwarded??r.xpEarned??0,r.xpBreakdown&&e.jsxs("span",{className:"block",children:["Base: +",r.xpBreakdown.baseMatchXP," + Performance: +",r.xpBreakdown.performanceXP]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(A,{type:"button",variant:"outline",onClick:()=>{_(null),v(null),h(!1),d("setup")},className:"rounded-xl",children:"Start New Match"}),r.mode==="bot"&&e.jsx(A,{type:"button",onClick:()=>void Xt(),disabled:G,className:"rounded-xl",children:"Rematch"})]})]})]})]}):m?e.jsxs(pe,{className:u(fe,"rounded-[18px]"),children:[e.jsxs(he,{children:[e.jsxs(be,{className:"text-base flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"Private Room Lobby"]}),e.jsxs(Ne,{className:"text-muted-foreground dark:text-[#b2bad0]",children:["Room ",m.roomCode," · ",m.participantCount,"/2 students connected."]})]}),e.jsx(Xe,{className:"space-y-3",children:e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:m.status==="ready"?"Opponent connected. Syncing start...":"Waiting for another student to join this room."}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Share room code ",m.roomCode," with your classmate."]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-end gap-2",children:[(m.status==="waiting"||m.status==="ready")&&e.jsx(A,{type:"button",variant:"outline",className:"h-8 rounded-lg",onClick:Zt,disabled:N.status==="validating",children:"Cancel room"}),e.jsxs(A,{type:"button",variant:"outline",className:"h-8 rounded-lg",onClick:()=>void Vt(m.roomCode),children:[R===m.roomCode?e.jsx(yt,{className:"h-4 w-4"}):e.jsx(aa,{className:"h-4 w-4"}),R===m.roomCode?"Copied":"Copy code"]})]})]})})]}):j?e.jsx(pe,{className:u(fe,"rounded-[18px]"),children:e.jsxs(he,{children:[e.jsxs(be,{className:"text-base flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"Public Matchmaking"]}),e.jsx(Ne,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Searching for a student with the same setup..."})]})}):e.jsx(pe,{className:u(fe,"rounded-[18px]"),children:e.jsxs(he,{children:[e.jsxs(be,{className:"text-base flex items-center gap-2",children:[e.jsx(wt,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"No active battle"]}),e.jsx(Ne,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Start from Setup to create a bot match, private room, or public queue session."})]})})},"battle")}),e.jsx(ke,{value:"history",className:"mt-0 outline-none",children:e.jsxs(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:[e.jsxs(y.div,{className:"relative overflow-hidden rounded-[24px] mb-6 bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl",whileHover:{scale:1.01},transition:{type:"spring",stiffness:300,damping:20},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-emerald-500/10 via-teal-500/5 to-transparent"}),e.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 h-64 w-64 rounded-full bg-emerald-500/20 blur-3xl animate-orb-pulse"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-12 -left-12 h-40 w-40 rounded-full bg-teal-500/20 blur-2xl animate-orb-pulse-delayed"}),e.jsx("div",{className:"relative z-10 p-6 sm:p-8 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(A,{variant:"ghost",onClick:()=>d("hub"),className:"h-12 w-12 p-0 rounded-full bg-white/10 hover:bg-white/20 hover:scale-105 transition-all backdrop-blur-md border border-white/10 shadow-[0_0_15px_rgba(16,185,129,0.15)] shrink-0",children:e.jsx(Ue,{className:"h-6 w-6 rotate-180 text-emerald-300"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"flex items-center gap-3 text-3xl sm:text-4xl font-black tracking-tight text-white drop-shadow-md",children:[e.jsx("div",{className:"bg-emerald-500/20 p-2 rounded-2xl shadow-inner border border-emerald-500/30",children:e.jsxs("div",{className:"relative w-8 h-8 flex items-center justify-center",children:[e.jsx("div",{className:"absolute w-5 h-6 bg-emerald-500/30 border border-emerald-400/50 rounded-sm -rotate-12 translate-x-1 shadow-sm"}),e.jsx("div",{className:"absolute w-5 h-6 bg-teal-400/50 border border-teal-300/60 rounded-sm rotate-6 -translate-x-1 shadow-md backdrop-blur-sm"}),e.jsxs("div",{className:"absolute w-5 h-6 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-sm shadow-[0_0_15px_rgba(52,211,153,0.8)] z-10 flex flex-col items-center justify-center gap-[3px]",children:[e.jsx("div",{className:"w-2.5 h-[2px] bg-white/90 rounded-full"}),e.jsx("div",{className:"w-3 h-[2px] bg-white/90 rounded-full"}),e.jsx("div",{className:"w-2 h-[2px] bg-white/90 rounded-full"})]})]})}),"Matches History"]}),e.jsx("p",{className:"text-[12px] font-black text-white/60 mt-2 tracking-[0.1em] uppercase",children:"Review your past duels and track your progress."})]})]})})]}),e.jsxs("div",{className:"relative isolate w-full",children:[e.jsx("div",{className:"absolute top-[-10%] right-[-5%] w-[400px] h-[400px] bg-blue-500/20 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsx("div",{className:"absolute bottom-[-10%] left-[-5%] w-[350px] h-[350px] bg-teal-500/20 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsxs("div",{className:"rounded-[24px] bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl p-6 sm:p-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-xl font-black text-white tracking-wide leading-none drop-shadow-md",children:"Match History"}),e.jsx("p",{className:"text-sm font-semibold text-white/60 mt-2",children:"Your recent student battles only."})]}),e.jsx("div",{className:"flex gap-2 mb-6",children:[{value:"all",label:"All"},{value:"online",label:"Online"},{value:"bot",label:"Bot"}].map(t=>e.jsx(A,{type:"button",variant:"outline",onClick:()=>Ca(t.value),className:u("rounded-full h-9 px-5 border transition-all font-bold tracking-wide",we===t.value?"bg-emerald-500/20 border-emerald-500/50 text-emerald-300 shadow-[0_0_15px_rgba(16,185,129,0.2)]":"bg-white/5 border-white/10 text-white/70 hover:bg-white/10 hover:text-white"),children:t.label},t.value))}),e.jsx("div",{className:"space-y-4",children:Pt?e.jsxs("div",{className:"space-y-3",children:[e.jsx(xe,{className:"h-[76px] w-full rounded-2xl bg-white/5 border border-white/10"}),e.jsx(xe,{className:"h-[76px] w-full rounded-2xl bg-white/5 border border-white/10"})]}):Oe.length===0?e.jsx("p",{className:"text-sm text-white/50 py-4",children:"No matches in this filter yet."}):Oe.map(t=>{const o=t.outcome==="win",p=t.outcome==="loss";return e.jsxs("div",{className:"relative overflow-hidden rounded-[20px] bg-white/5 border border-white/10 p-5 flex items-center justify-between shadow-lg transition-all hover:bg-white/10 hover:shadow-xl",children:[e.jsx("div",{className:u("absolute inset-y-0 left-0 w-3/4 pointer-events-none z-0",o?"bg-gradient-to-r from-emerald-500/50 via-emerald-500/10 to-transparent":p?"bg-gradient-to-r from-rose-500/50 via-rose-500/10 to-transparent":"bg-gradient-to-r from-amber-500/50 via-amber-500/10 to-transparent")}),e.jsxs("div",{className:"relative z-10 pl-2",children:[e.jsxs("p",{className:"text-base sm:text-lg font-black text-white drop-shadow-md",children:["vs ",t.opponentName]}),e.jsxs("p",{className:"text-[13px] font-bold text-white/60 tabular-nums mt-0.5",children:[t.scoreFor,"-",t.scoreAgainst," ",e.jsx("span",{className:"mx-1",children:"•"})," ",t.accuracy.toFixed(0),"% ",e.jsx("span",{className:"mx-1",children:"•"})," +",t.xpEarned," XP"]})]}),e.jsx("div",{className:"relative z-10",children:e.jsx("span",{className:u("text-sm font-black uppercase tracking-[0.1em] rounded-full px-4 py-1.5 border shadow-sm",o?"text-emerald-300 border-emerald-500/30 bg-emerald-500/10 shadow-[0_0_15px_rgba(16,185,129,0.15)]":p?"text-rose-300 border-rose-500/30 bg-rose-500/10 shadow-[0_0_15px_rgba(244,63,94,0.15)]":"text-amber-300 border-amber-500/30 bg-amber-500/10 shadow-[0_0_15px_rgba(245,158,11,0.15)]"),children:Es(t.outcome)})})]},t.matchId)})})]})]})]},"history")}),e.jsx(ke,{value:"stats",className:"mt-0 outline-none",children:e.jsxs(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:[e.jsxs(y.div,{className:"relative overflow-hidden rounded-[24px] mb-6 bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl",whileHover:{scale:1.01},transition:{type:"spring",stiffness:300,damping:20},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-indigo-500/10 via-purple-500/5 to-transparent"}),e.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 h-64 w-64 rounded-full bg-indigo-500/20 blur-3xl animate-orb-pulse"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-12 -left-12 h-40 w-40 rounded-full bg-purple-500/20 blur-2xl animate-orb-pulse-delayed"}),e.jsx("div",{className:"relative z-10 p-6 sm:p-8 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(A,{variant:"ghost",onClick:()=>d("hub"),className:"h-12 w-12 p-0 rounded-full bg-white/10 hover:bg-white/20 hover:scale-105 transition-all backdrop-blur-md border border-white/10 shadow-[0_0_15px_rgba(99,102,241,0.15)] shrink-0",children:e.jsx(Ue,{className:"h-6 w-6 rotate-180 text-indigo-300"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"flex items-center gap-3 text-3xl sm:text-4xl font-black tracking-tight text-white drop-shadow-md",children:[e.jsx("div",{className:"bg-indigo-500/20 p-2 rounded-2xl shadow-inner border border-indigo-500/30 animate-icon-bob",children:e.jsxs("div",{className:"relative w-8 h-8 flex items-end justify-center gap-1 pb-1",children:[e.jsx("div",{className:"w-1.5 h-3 bg-indigo-300 rounded-t-[2px] shadow-[0_0_8px_rgba(165,180,252,0.8)]"}),e.jsx("div",{className:"w-1.5 h-6 bg-purple-400 rounded-t-[2px] shadow-[0_0_12px_rgba(192,132,252,0.9)]"}),e.jsx("div",{className:"w-1.5 h-4 bg-indigo-400 rounded-t-[2px] shadow-[0_0_8px_rgba(129,140,248,0.8)]"})]})}),"My Statistics"]}),e.jsx("p",{className:"text-[12px] font-black text-white/60 mt-2 tracking-[0.1em] uppercase",children:"Analyzing your battlefield performance."})]})]})})]}),e.jsxs("div",{className:"relative isolate w-full",children:[e.jsx("div",{className:"absolute top-[0%] left-[10%] w-[350px] h-[350px] bg-indigo-500/30 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsx("div",{className:"absolute bottom-[0%] right-[10%] w-[300px] h-[300px] bg-purple-500/30 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsx("div",{className:"rounded-[24px] bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl p-6 sm:p-8",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4 sm:gap-6",children:[{label:"WINS",value:ee?.wins??0,icon:gt,textColor:"text-rose-400",gradient:"radial-gradient(circle at 10% 90%, rgba(244,63,94,0.35) 0%, transparent 70%)"},{label:"CURRENT STREAK",value:ee?.currentStreak??0,icon:Je,textColor:"text-purple-400",gradient:"radial-gradient(circle at 10% 90%, rgba(168,85,247,0.35) 0%, transparent 70%)"},{label:"AVG ACCURACY",value:`${(ee?.averageAccuracy||0).toFixed(1)}%`,icon:At,textColor:"text-blue-400",gradient:"radial-gradient(circle at 10% 90%, rgba(59,130,246,0.35) 0%, transparent 70%)"},{label:"AVG RESPONSE",value:Fs(ee?.averageResponseMs||0),icon:sa,textColor:"text-teal-400",gradient:"radial-gradient(circle at 10% 90%, rgba(20,184,166,0.35) 0%, transparent 70%)"}].map(t=>e.jsxs("div",{className:"relative overflow-hidden rounded-[20px] bg-white/5 border border-white/10 shadow-lg min-h-[160px] flex flex-col justify-between p-6 transition-transform hover:scale-105",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none z-0 mix-blend-screen",style:{background:t.gradient}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("p",{className:u("text-[11px] font-black uppercase tracking-[0.15em] mb-3",t.textColor),children:t.label}),e.jsx("p",{className:"text-4xl sm:text-5xl font-black text-white tabular-nums tracking-tighter drop-shadow-md",children:t.value})]}),e.jsx("div",{className:"relative z-10 mt-6 flex justify-start",children:e.jsx(t.icon,{className:u("h-5 w-5 drop-shadow-md",t.textColor)})})]},t.label))})})]})]},"stats")}),e.jsx(ke,{value:"leaderboard",className:"mt-0 outline-none",children:e.jsxs(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:[e.jsxs(y.div,{className:"relative overflow-hidden rounded-[24px] mb-6 bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl",whileHover:{scale:1.01},transition:{type:"spring",stiffness:300,damping:20},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-amber-500/10 via-orange-500/5 to-transparent"}),e.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 h-64 w-64 rounded-full bg-amber-500/20 blur-3xl animate-orb-pulse"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-12 -left-12 h-40 w-40 rounded-full bg-orange-500/20 blur-2xl animate-orb-pulse-delayed"}),e.jsx("div",{className:"relative z-10 p-6 sm:p-8 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(A,{variant:"ghost",onClick:()=>d("hub"),className:"h-12 w-12 p-0 rounded-full bg-white/10 hover:bg-white/20 hover:scale-105 transition-all backdrop-blur-md border border-white/10 shadow-[0_0_15px_rgba(245,158,11,0.15)] shrink-0",children:e.jsx(Ue,{className:"h-6 w-6 rotate-180 text-amber-300"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"flex items-center gap-3 text-3xl sm:text-4xl font-black tracking-tight text-white drop-shadow-md",children:[e.jsx(y.div,{animate:{scale:[1,1.1,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"bg-amber-500/20 p-2 rounded-2xl shadow-inner border border-amber-500/30",children:e.jsx(Jt,{className:"h-8 w-8 text-amber-400 drop-shadow-[0_0_12px_rgba(245,158,11,0.8)]"})}),"Hall of Fame"]}),e.jsx("p",{className:"text-[12px] font-black text-white/60 mt-2 tracking-[0.1em] uppercase",children:"The top-ranked minds across the globe."})]})]})})]}),e.jsxs("div",{className:"relative isolate w-full",children:[e.jsx("div",{className:"absolute top-[20%] left-[20%] w-[400px] h-[400px] bg-orange-500/20 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[350px] h-[350px] bg-pink-500/20 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsxs("div",{className:"rounded-[24px] bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl p-6 sm:p-8",children:[e.jsxs("div",{className:"mb-8 flex items-start gap-3",children:[e.jsx(Jt,{className:"h-8 w-8 text-amber-400 drop-shadow-[0_0_12px_rgba(245,158,11,0.6)] shrink-0"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-white tracking-wide leading-none drop-shadow-md",children:"Hall of Fame"}),e.jsx("p",{className:"text-sm font-semibold text-white/60 mt-2",children:"Student-only ranking using trusted backend aggregates."})]})]}),Ia?e.jsxs("div",{className:"space-y-4",children:[e.jsx(xe,{className:"h-[80px] w-full rounded-2xl bg-white/5 border border-white/10"}),e.jsx(xe,{className:"h-[80px] w-full rounded-2xl bg-white/5 border border-white/10"}),e.jsx(xe,{className:"h-[80px] w-full rounded-2xl bg-white/5 border border-white/10"})]}):Yt.length===0?e.jsx("p",{className:"text-sm text-white/50",children:"No leaderboard entries yet. Finish a battle to place on the board."}):e.jsx("div",{className:"space-y-6",children:e.jsx("div",{className:"space-y-3",children:Yt.map(t=>e.jsxs("div",{className:u("relative overflow-hidden rounded-[20px] p-5 flex items-center justify-between shadow-lg transition-all hover:scale-[1.01] group",t.isSelf?"bg-amber-500/10 border border-amber-500/40 shadow-[0_0_20px_rgba(245,158,11,0.15)]":"bg-white/5 border border-white/10 hover:bg-white/10"),children:[t.isSelf&&e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-amber-500/20 to-transparent pointer-events-none -z-10"}),e.jsxs("div",{className:"relative z-10 flex flex-col gap-1.5",children:[e.jsxs("h4",{className:u("text-lg sm:text-xl font-black drop-shadow-md",t.isSelf?"text-amber-400":"text-white"),children:["#",t.rank," ",t.displayName,t.isSelf?" (You)":""]}),e.jsxs("p",{className:"text-[13px] font-bold text-white/60",children:["Win rate ",t.winRate.toFixed(1),"% ",e.jsx("span",{className:"mx-1",children:"•"})," Best streak ",t.bestStreak]})]}),e.jsx("div",{className:"relative z-10 text-xl sm:text-2xl font-black text-white tabular-nums drop-shadow-md",children:t.scoreLabel})]},t.userId))})})]})]})]},"leaderboard")})]})})})})]})};export{dr as default}; +`,Is=300*1e3,Bs=({viewportHeight:a})=>e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[50] overflow-hidden flex justify-between bg-slate-900/10",children:i.useMemo(()=>[...Array(40)].map((s,n)=>({id:n,left:`${Math.random()*100}%`,duration:.6+Math.random()*.4,delay:Math.random()*.4})),[a]).map(s=>e.jsx(y.div,{className:"absolute w-0.5 h-16 bg-blue-300/40 rounded-full e-left-top",style:{"--left":s.left,"--top":"-10%"},animate:{y:[0,a*1.2]},transition:{duration:s.duration,ease:"linear",delay:s.delay}},s.id))}),Ms=({viewportHeight:a,viewportWidth:s})=>{const n=i.useMemo(()=>[...Array(30)].map((c,d)=>({id:d,xShift:(Math.random()-.5)*s*.8,yShift:(Math.random()-.5)*a*.8,scale:Math.random()*1.5+.5,duration:2+Math.random()*1.5,delay:Math.random()*.35})),[a,s]);return e.jsx("div",{className:"absolute inset-0 pointer-events-none z-[50] overflow-hidden flex items-center justify-center",children:n.map(c=>e.jsx(y.div,{className:"absolute w-2 h-2 bg-amber-400 rounded-full shadow-[0_0_10px_rgba(251,191,36,0.8)] e-left-top",style:{"--left":"50%","--top":"50%"},animate:{y:[0,c.yShift],x:[0,c.xShift],scale:[0,c.scale,0],opacity:[0,1,0]},transition:{duration:c.duration,ease:"easeOut",delay:c.delay}},c.id))})},ia=({value:a,label:s,delay:n=0,icon:c})=>{const[d,l]=i.useState(0);return i.useEffect(()=>{if(a<=0)return;const w=1e3,C=30,g=Math.abs(Math.floor(w/C));let N=0;const b=setTimeout(()=>{const j=setInterval(()=>{N+=Math.max(1,Math.floor(a/C)),N>=a?(l(a),clearInterval(j)):l(N)},g);return()=>clearInterval(j)},n);return()=>clearTimeout(b)},[a,n]),a<=0?null:e.jsxs(y.div,{initial:{opacity:0,transform:"translateX(-20px)"},animate:{opacity:1,transform:"translateX(0)"},transition:{delay:n/1e3,duration:.5},className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-white/80 font-bold uppercase tracking-wider text-sm",children:[c,s]}),e.jsxs("div",{className:"text-2xl font-black text-amber-400 tabular-nums",children:["+",d]})]})},fe="border border-border bg-card text-card-foreground shadow-sm dark:border-[#2b3140] dark:bg-[#181d27] dark:text-[#f5f7fb] dark:shadow-[0_12px_24px_rgba(0,0,0,0.22)]",Fs=a=>a<=0?"--":`${(a/1e3).toFixed(2)}s`,Es=a=>a==="win"?"Win":a==="loss"?"Loss":"Draw",Ge=(a,s,n)=>Math.max(s,Math.min(n,a)),da=a=>{const s=Math.floor(a/60),n=a%60;return`${s}:${String(n).padStart(2,"0")}`},Rs=a=>{const s=a.trim().split(/\s+/).filter(Boolean).slice(0,2);return s.length===0?"ST":s.map(n=>n[0]?.toUpperCase()||"").join("")},ca=(a,s)=>a?a.eventType==="round_started"?`Round ${a.roundNumber} started.`:a.eventType==="answer_locked"?a.lockedByStudentId&&s&&a.lockedByStudentId===s?`Round ${a.roundNumber}: your answer is locked.`:`Round ${a.roundNumber}: opponent answer locked.`:a.eventType==="round_result"?`Round ${a.roundNumber} resolved.`:"Match completed.":null;let St=null;const ua=()=>{if(typeof window>"u")return null;if(!St){const a=window.AudioContext||window.webkitAudioContext;a&&(St=new a)}return St},dr=()=>{const{userProfile:a,userRole:s}=Va(),n=a,[c,d]=i.useState("hub"),[l,w]=i.useState(ps),[C,g]=i.useState([]),[N,b]=i.useState({status:"idle"}),[j,h]=i.useState(!1),[m,v]=i.useState(null),[W,S]=i.useState(""),[R,Y]=i.useState(null),[O,M]=i.useState(0),[D,z]=i.useState(null),[J,Tt]=i.useState(()=>typeof window>"u"?!0:window.localStorage.getItem("quiz_battle_sound_enabled")!=="0"),[ce,za]=i.useState(()=>{if(typeof window>"u")return .7;const t=Number(window.localStorage.getItem("quiz_battle_sound_volume")||"0.7");return Number.isFinite(t)?Ge(t,0,1):.7}),[Dt,I]=i.useState("connected"),[we,Ca]=i.useState("all"),[Pt,nt]=i.useState(!0),[ee,ot]=i.useState(null),[lt,it]=i.useState([]),[Ia,Qt]=i.useState(!1),[qt,Ba]=i.useState([]),[dt,Ts]=i.useState("full"),[Lt,Ds]=i.useState(!0),[r,_]=i.useState(null),[ve,X]=i.useState(null),[G,Ae]=i.useState(!1),[P,ze]=i.useState(0),[Z,K]=i.useState(!1),[F,ct]=i.useState(!1),[Ma,Fa]=i.useState(!1),[ut,Ea]=i.useState(kt),[B,te]=i.useState(null),[Ra,mt]=i.useState(!1),[Qe,xt]=i.useState(null),[Ta,pt]=i.useState(null),[Da,qe]=i.useState(null),$t=i.useRef(""),ht=i.useRef(null),je=i.useRef(null),oe=i.useRef(0),Ot=i.useRef(""),Ce=i.useRef(0),bt=i.useRef(0),Le=i.useRef(null),Ie=i.useRef(null),$e=i.useRef(-1),ft=!1,le=i.useMemo(()=>{const t=Ua(n?.grade);return ea.filter(o=>t.includes(o.id))},[n?.grade]),Pa=i.useMemo(()=>(le.find(o=>o.id===l.subjectId)?.modules||[]).map(o=>({value:o.id,label:o.title})),[le,l.subjectId]),H=i.useMemo(()=>{const t=r?.roundResults||[];let o=0;return t.forEach(p=>{o=p.studentCorrect?o+1:0}),o},[r?.roundResults]),Qa=i.useMemo(()=>{const t=Math.max(0,H-1)*.12;return Number((1+Math.min(.72,t)).toFixed(2))},[H]),qa=i.useMemo(()=>{if(!r)return 0;if(r.status==="completed")return r.xpEarned||0;const t=r.roundResults||[];let o=0,p=0;for(const x of t)if(x.studentCorrect){o++;const k=o>=2?Math.min(25,(o-1)*5):0;p+=10+k}else o=0;return p},[r?.status,r?.xpEarned,r?.roundResults]),Ht=i.useMemo(()=>{const t=r?.roundResults||[];let o=0;return t.forEach(p=>{o=p.botCorrect?o+1:0}),o},[r?.roundResults]);i.useMemo(()=>{const t=Math.max(0,Ht-1)*.1;return Number((1+Math.min(.5,t)).toFixed(2))},[Ht]),i.useMemo(()=>H>=5?{label:"Inferno",badgeClass:"text-amber-300 border-amber-300/50 bg-amber-500/20 shadow-[0_0_18px_rgba(251,191,36,0.35)]"}:H>=3?{label:"Heating Up",badgeClass:"text-orange-300 border-orange-300/50 bg-orange-500/15 shadow-[0_0_16px_rgba(249,115,22,0.3)]"}:B?.studentCorrect?{label:"Steady",badgeClass:"text-emerald-300 border-emerald-300/40 bg-emerald-500/15 shadow-[0_0_14px_rgba(16,185,129,0.25)]"}:{label:"Rebuild",badgeClass:"text-slate-300 border-slate-300/30 bg-slate-500/15 shadow-[0_0_14px_rgba(148,163,184,0.2)]"},[B?.studentCorrect,H]);const ie=i.useMemo(()=>{if(!B)return null;const t=B.studentCorrect?12:-8,o=B.studentCorrect&&!B.botCorrect?6:0,p=B.studentCorrect?Math.max(0,(H-1)*2):0;return t+o+p},[B,H]),Q=i.useCallback(t=>{if(!(!J||ce<=0||typeof window>"u"))try{const o=ua();if(!o)return;o.state==="suspended"&&o.resume().catch(()=>{});const x={tick:{notes:[740],duration:.06,type:"triangle",volume:.03},lock:{notes:[520],duration:.08,type:"square",volume:.04},result:{notes:[660,720],duration:.08,type:"sine",volume:.04},win:{notes:[920,1040,1180],duration:.12,type:"triangle",volume:.05},loss:{notes:[260,220],duration:.14,type:"sawtooth",volume:.045},streak:{notes:[780,920],duration:.09,type:"triangle",volume:.045},multiplier:{notes:[660,880,1120],duration:.08,type:"triangle",volume:.05}}[t],k=o.currentTime,T=.07,f=Ge(x.volume*ce,.004,.08);x.notes.forEach((E,se)=>{const me=o.createOscillator(),Be=o.createGain(),ye=k+se*T;me.type=x.type,me.frequency.setValueAtTime(E,ye),Be.gain.setValueAtTime(1e-4,ye),Be.gain.exponentialRampToValueAtTime(f,ye+.012),Be.gain.exponentialRampToValueAtTime(1e-4,ye+x.duration),me.connect(Be),Be.connect(o.destination),me.start(ye),me.stop(ye+x.duration+.02)})}catch(o){console.warn("Battle tone playback skipped or blocked:",o)}},[J,ce]),Vt=i.useCallback(async t=>{if(!(!t||typeof window>"u"))try{await window.navigator.clipboard.writeText(t),Y(t),window.setTimeout(()=>{Y(o=>o===t?null:o)},1600)}catch{b({status:"error",message:"Unable to copy room code automatically. Please copy it manually."})}},[]),Ut=i.useCallback(()=>{},[ft]),Wt=i.useCallback(t=>{h(!1),v(null),_(null),M(0),z(null),b({status:"error",message:t}),d("setup")},[]),ae=i.useCallback(async()=>{if(!n?.uid)return null;const[t,o]=await Promise.all([bs(n.uid),fs(n.uid,{mode:we,limitCount:8})]);return{stats:t,history:o}},[we,n?.uid]);i.useEffect(()=>{if(le.length===0)return;const o=le.some(k=>k.id===l.subjectId)?l.subjectId:le[0].id,p=le.find(k=>k.id===o),x=p?.modules?.[0]?.id||"";w(k=>{const T=p?.modules?.some(f=>f.id===k.topicId)?k.topicId:x;return k.subjectId===o&&k.topicId===T?k:{...k,subjectId:o,topicId:T}})},[le,l.subjectId]),i.useEffect(()=>{if(!n?.uid){ot(null),it([]),nt(!1);return}let t=!0;return nt(!0),(async()=>{const p=await ae();t&&(p&&(ot(p.stats),it(p.history)),nt(!1))})(),()=>{t=!1}},[ae,n?.uid]);const Oe=i.useMemo(()=>we==="all"?lt:lt.filter(t=>t.mode===we),[lt,we]),Yt=i.useMemo(()=>qt.map((t,o)=>{const p=t.rank||o+1,x=t.userId===n?.uid,k=`Student-${t.userId.slice(-4).toUpperCase()}`,T=dt==="full"?t.displayName:dt==="initials"?Rs(t.displayName):k,f=Math.floor(t.leaderboardScore/25)*25,E=Lt||x?`${t.leaderboardScore} pts`:`${f}-${f+24} pts`;return{...t,rank:p,isSelf:x,displayName:T,scoreLabel:E}}),[qt,dt,Lt,n?.uid]);i.useEffect(()=>{if(c!=="leaderboard"&&c!=="hub")return;let t=!0;return Qt(!0),(async()=>{const p=await zs(20);t&&(Ba(p),Qt(!1))})(),()=>{t=!1}},[c]);const He=i.useCallback(async()=>{if(n?.uid)try{const t=await la();if(t.sessionType==="match"&&t.match){let o=t.match;if(t.match.mode==="bot"&&t.match.status==="ready")try{o=await re(t.match.matchId),Ce.current=0}catch(p){const x=p;h(!1),v(null),_(null),d("setup"),I(typeof window<"u"&&window.navigator.onLine?"connected":"disconnected"),b({status:"error",message:x?.message||"Unable to resume bot battle. Please start a new match."});return}h(!1),v(t.room||null),_(o),z(t.queue?.expiresAtMs||o.expiresAtMs||null),d("battle"),I("connected");return}if(t.sessionType==="room"&&t.room){h(!1),v(t.room),_(o=>o?.mode==="bot"?o:null),z(null),I("connected");return}if(t.sessionType==="queue"){h(!0),v(null),_(o=>o?.mode==="bot"?o:null),z(t.queue?.expiresAtMs||null),I("connected");return}h(!1),v(null),_(o=>o?.mode==="bot"?o:null),z(null),I("connected")}catch(t){console.warn("Quiz Battle session resume failed:",t),I("reconnecting")}},[n?.uid]);i.useEffect(()=>{n?.uid&&He()},[n?.uid,He]),i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("quiz_battle_sound_enabled",J?"1":"0")},[J]),i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("quiz_battle_sound_volume",ce.toFixed(2))},[ce]),i.useEffect(()=>{if(typeof window>"u")return;const t=()=>{const o=window.innerWidth,p=window.innerHeight;Ea({width:Number.isFinite(o)&&o>0?o:kt.width,height:Number.isFinite(p)&&p>0?p:kt.height})};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),i.useEffect(()=>{if(typeof document>"u")return;const t=()=>{Fa(!!document.fullscreenElement)};return t(),document.addEventListener("fullscreenchange",t),()=>{document.removeEventListener("fullscreenchange",t)}},[]),i.useEffect(()=>{const t=D!==null;if(!(j||m&&(m.status==="waiting"||m.status==="ready")||t)){M(0);return}const o=()=>{if(!D){M(x=>x+1);return}M(Math.max(0,Math.ceil((D-Date.now())/1e3)))};o();const p=window.setInterval(o,1e3);return()=>{window.clearInterval(p)}},[j,m?.status,m?.roomId,D]),i.useEffect(()=>{if(!D)return;const t=window.setInterval(()=>{D-Date.now()<=0&&(window.clearInterval(t),(async()=>{try{(j||!m)&&await oa()}catch{}finally{Wt("Public matchmaking timed out after 5 minutes. Please start again.")}})())},1e3);return()=>{window.clearInterval(t)}},[m,Wt,j,D]),i.useEffect(()=>{if(typeof window>"u")return;I(window.navigator.onLine?"connected":"disconnected");const t=()=>{I("reconnecting"),He()},o=()=>{I("disconnected")};return window.addEventListener("online",t),window.addEventListener("offline",o),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",o)}},[He]),i.useEffect(()=>{const t=r?.mode==="online"&&(r.status==="ready"||r.status==="in_progress"),o=r?.mode==="bot"&&r.status==="ready",p=!!(m&&(m.status==="waiting"||m.status==="ready"));if(o||(Ce.current=0),!j&&!p&&!t&&!o||F)return;let x=!1;const k=async()=>{try{if(r?.mode==="bot"&&r.status==="ready"){const f=await re(r.matchId);if(x)return;_(f),I("connected"),z(f.expiresAtMs||null),Ce.current=0,f.status==="in_progress"&&b({status:"queued",message:"Practice bot match started."});return}if(r?.mode==="online"){if(r.status==="ready"){const se=await re(r.matchId);if(x)return;_(se),I("connected"),z(se.expiresAtMs||null),se.status==="in_progress"&&b({status:"queued",message:"Match started. Round timer is live."});return}const f=await Nt(r.matchId);if(x)return;const E=f.roundResults.filter(se=>se.roundNumber>$e.current).sort((se,me)=>se.roundNumber-me.roundNumber)[0];E?($e.current=E.roundNumber,te(E),xt(f)):(_(f),f.status==="completed"&&(h(!1),v(null),z(null)),f.status==="cancelled"&&r.status==="in_progress"&&(mt(!0),K(!1))),I("connected");return}if(m?.roomId){const f=await js({roomId:m.roomId});if(x)return;if(v(f.room),f.match){const E=await re(f.match.matchId);if(x)return;_(E),v(f.room),h(!1),z(E.expiresAtMs||null),d("battle"),I("connected"),b({status:"queued",message:E.status==="ready"?"Opponent connected. Waiting for synchronized start...":"Private room match started."})}return}if(j){const f=await la();if(x)return;if(f.sessionType==="match"&&f.match){const E=await re(f.match.matchId);if(x)return;_(E),v(f.room||null),h(!1),z(E.expiresAtMs||null),d("battle"),I("connected"),b({status:"queued",message:"Opponent found. Preparing synchronized start..."});return}if(f.sessionType==="room"&&f.room){h(!1),v(f.room),z(null),I("connected");return}I("connected")}}catch(f){if(!x){if(console.warn("Quiz Battle sync poll failed:",f),r?.mode==="bot"&&r.status==="ready"&&(Ce.current+=1,Ce.current>=3)){const E=f;h(!1),v(null),_(null),d("setup"),b({status:"error",message:E?.message||"Unable to start bot battle. Please try again."}),I("disconnected");return}I("reconnecting")}}};k();const T=window.setInterval(()=>{k()},3e3);return()=>{x=!0,window.clearInterval(T)}},[r?.matchId,r?.mode,r?.status,m?.roomId,m?.status,F,j]);const ue=i.useMemo(()=>r?.mode==="online"&&(r.status==="ready"||r.status==="in_progress")?{scope:"match",resourceId:r.matchId}:m&&(m.status==="waiting"||m.status==="ready")?{scope:"room",resourceId:m.roomId}:j&&n?.uid?{scope:"queue",resourceId:n.uid}:null,[r,m,j,n?.uid]);i.useEffect(()=>{if(!ue)return;let t=!1;const o=async()=>{try{await Ns(ue.scope,ue.resourceId),t||I("connected")}catch(x){t||(console.warn("Quiz Battle heartbeat failed:",x),I("reconnecting"))}};o();const p=window.setInterval(()=>{o()},8e3);return()=>{t=!0,window.clearInterval(p),xs(ue.scope,ue.resourceId)}},[ue?.scope,ue?.resourceId]),i.useEffect(()=>{if(!r||r.status!=="in_progress"){K(!1),je.current=null,oe.current=0;return}je.current=null,oe.current=0;const t=r.roundDeadlineAtMs?Math.max(0,Math.ceil((r.roundDeadlineAtMs-Date.now())/1e3)):r.timePerQuestionSec;ze(t),X(null),K(!1)},[r?.matchId,r?.status,r?.currentRound,r?.timePerQuestionSec]),i.useEffect(()=>{F&&(!r||r.status!=="in_progress")&&ct(!1)},[r?.matchId,r?.status,F]),i.useEffect(()=>{const t=r?.lifecycle;if(!t?.eventType)return;const o=`${t.eventType}:${t.sequence}`;$t.current!==o&&($t.current=o,t.eventType==="answer_locked"?Q("lock"):t.eventType==="round_result"&&Q("result"))},[r?.lifecycle?.eventType,r?.lifecycle?.sequence,Q]),i.useEffect(()=>{!r||r.status!=="completed"||Ot.current!==r.matchId&&(Ot.current=r.matchId,Q(r.outcome==="loss"?"loss":"win"),r.outcome==="win"&&xa(()=>import("./confetti.module-C94ZD2ww.js"),[]).then(t=>{t.default({particleCount:110,spread:78,origin:{y:.62},ticks:160})}).catch(()=>{}))},[r?.matchId,r?.status,r?.outcome,Q]),i.useEffect(()=>{if(!r||r.status!=="in_progress"||Z||G||F){ht.current=null;return}P<=3&&P>0&&ht.current!==P&&(ht.current=P,Q("tick"))},[r?.status,P,Z,G,F,Q]),i.useEffect(()=>{if(!r||r.status!=="in_progress"){bt.current=0;return}H>bt.current&&H>=2&&Q(H>=4?"multiplier":"streak"),bt.current=H},[r?.matchId,r?.status,H,Q]),i.useEffect(()=>{if(!r){Le.current=null,qe(null);return}const t=Le.current;if(!t||t.matchId!==r.matchId){Le.current={matchId:r.matchId,scoreFor:r.scoreFor,scoreAgainst:r.scoreAgainst},qe(null);return}if(r.scoreFor!==t.scoreFor||r.scoreAgainst!==t.scoreAgainst){const o=r.scoreFor>t.scoreFor?"player":"opponent";qe(o),Ie.current&&window.clearTimeout(Ie.current),Ie.current=window.setTimeout(()=>{qe(null)},850)}Le.current={matchId:r.matchId,scoreFor:r.scoreFor,scoreAgainst:r.scoreAgainst}},[r?.matchId,r?.scoreAgainst,r?.scoreFor]),i.useEffect(()=>()=>{Ie.current&&window.clearTimeout(Ie.current)},[]),i.useEffect(()=>{if(!B?.studentCorrect||ie===null||ie<=0){pt(null);return}const t=ie>0?"positive":ie<0?"negative":"neutral";pt({id:Date.now(),label:`${ie>=0?"+":""}${ie} Momentum`,tone:t});const o=window.setTimeout(()=>{pt(null)},1400);return()=>{window.clearTimeout(o)}},[ie,B]),i.useEffect(()=>{if(B&&Qe){B.studentCorrect?Q("win"):Q("loss");const t=window.setTimeout(()=>{_(Qe),te(null),X(null),K(!1),xt(null),Qe.status==="completed"&&(h(!1),v(null),ae(),$e.current=-1)},1500);return()=>window.clearTimeout(t)}},[B,Qe,Q,ae]);const Ve=i.useCallback(async t=>{if(!r||r.status!=="in_progress"||Z||F)return;Ae(!0);const o=window.setTimeout(()=>{Ae(!1),b({status:"error",message:"Submission took too long. Syncing latest match state now..."}),Nt(r.matchId).then(p=>{_(p),p.status==="completed"&&(h(!1),v(null),z(null))}).catch(()=>{})},12e3);try{const p=r.roundDeadlineAtMs?Ge(r.timePerQuestionSec*1e3-Math.max(0,r.roundDeadlineAtMs-Date.now()),0,r.timePerQuestionSec*1e3):Math.max(0,(r.timePerQuestionSec-P)*1e3),x=await Ss({matchId:r.matchId,roundNumber:r.currentRound,selectedOptionIndex:t,responseMs:p});je.current=null,oe.current=0,x.roundResult?($e.current=x.roundResult.roundNumber,te(x.roundResult),xt(x.match)):(_(x.match),te(null),x.match.mode==="online"&&x.match.status==="in_progress"?(K(!0),b({status:"queued",message:"Answer locked. Waiting for opponent to finish the round..."})):X(null)),x.match.status==="completed"&&(h(!1),v(null),z(null),ae(),b({status:"queued",message:x.completion?`Match finished (${x.completion.outcome.toUpperCase()}) +${x.completion.xpEarned} XP`:"Match finished. Results saved."}))}catch(p){const k=p?.message||"Unable to submit answer right now. Please try again.";if(t===null||k.includes("Round timer elapsed")||k.includes("Expected round")||k.includes("Match is not currently active"))try{const f=await Nt(r.matchId),E=f.currentRound!==r.currentRound;if(_(f),X(null),K(!1),E||f.status==="completed"?(je.current=null,oe.current=0):t===null&&(oe.current=Date.now()+3e3),f.status==="completed"){h(!1),v(null),z(null),ae(),b({status:"queued",message:"Match finished. Results synchronized."});return}b({status:"queued",message:"Round timed out. Synced to the latest battle state."});return}catch{}t===null&&(oe.current=Date.now()+3e3),b({status:"error",message:k})}finally{window.clearTimeout(o),Ae(!1)}},[r,F,ae,Z,P]);i.useEffect(()=>{if(!r||r.status!=="in_progress"||F||G||Z)return;const t=r.roundDeadlineAtMs?Math.max(0,Math.ceil((r.roundDeadlineAtMs-Date.now())/1e3)):P;if(r.roundDeadlineAtMs&&t!==P&&ze(t),ve===null?t<=1:t<=0){if(je.current===r.currentRound&&Date.now(){r.roundDeadlineAtMs?ze(Math.max(0,Math.ceil((r.roundDeadlineAtMs-Date.now())/1e3))):ze(x=>Math.max(0,x-1))},1e3);return()=>{window.clearTimeout(p)}},[r,G,F,Z,P,ve,Ve]);const Xt=i.useCallback(async()=>{if(!(!r||r.mode!=="bot")){Ae(!0),b({status:"validating"});try{const t=await As(r.matchId),o=await re(t.matchId);_(o),v(null),h(!1),z(null),te(null),X(null),K(!1),d("battle"),b({status:"queued",message:`Rematch ready (${t.botDifficulty}). Good luck!`})}catch(t){b({status:"error",message:t?.message||"Unable to start rematch right now."})}finally{Ae(!1)}}},[r]);if(s!=="student")return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:_t}),e.jsx("div",{className:"px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:e.jsx(pe,{className:u(fe,"max-w-2xl"),children:e.jsxs(he,{children:[e.jsx(be,{children:"Quiz Battle is student-only"}),e.jsx(Ne,{className:"text-muted-foreground dark:text-[#aab3c7]",children:"Your account role does not have access to this module."})]})})})]});const Gt=t=>{g([]),b({status:"idle"}),ct(!1),h(!1),v(null),S(""),_(null),te(null),X(null),K(!1),z(null),w(o=>({...o,mode:t,queueType:t==="online"?o.queueType:"public_matchmaking"})),M(0),d("setup")},Zt=async()=>{b({status:"validating"});try{m?.roomId?await ys({roomId:m.roomId}):await oa(),h(!1),v(null),_(t=>!t||t.mode!=="online"?t:t.status==="ready"||t.status==="cancelled"?null:t),S(""),M(0),z(null),b({status:"queued",message:m?.roomId?"Private room cancelled.":"Left matchmaking queue."})}catch(t){b({status:"error",message:t?.message||"Unable to cancel this online session right now. Please try again."})}},La=async()=>{b({status:"validating"});const t=hs(l);if(t.length>0){g(t),b({status:"error",message:"Fix the highlighted setup fields before starting."});return}g([]);try{if(l.mode==="online"){if(l.queueType==="private_room"){const k=W.trim().toUpperCase(),T=k?await vs(k):await ws(l);if(h(!1),v(T.room),S(""),z(T.match?.expiresAtMs||null),T.match){const f=await re(T.match.matchId);_(f),te(null),X(null),K(!1),d("battle"),z(f.expiresAtMs||null),b({status:"queued",message:f.status==="ready"?`Room ${T.room.roomCode} linked. Waiting for synchronized start...`:"Private room match started."});return}_(null),z(null),b({status:"queued",message:k?"Joined private room. Waiting for opponent...":"Private room created. Share code:"});return}const x=await gs(l);if(x.status==="matched"&&x.matchId){const k=await re(x.matchId);h(!1),v(null),_(k),te(null),X(null),K(!1),d("battle"),z(k.expiresAtMs||null),b({status:"queued",message:"Opponent found. Preparing synchronized start..."});return}h(!0),v(null),_(null),z(x.expiresAtMs||Date.now()+Is),M(0),b({status:"queued",message:"Joined matchmaking queue. Waiting for an opponent..."});return}const o=await ks(l),p=await re(o.matchId);h(!1),v(null),_(p),te(null),X(null),K(!1),ze(p.timePerQuestionSec),z(null),d("battle"),b({status:"queued",message:`Bot match ${o.matchId.slice(0,8)} live (${o.botDifficulty}).`}),ae().then(x=>{x&&(ot(x.stats),it(x.history))})}catch(o){h(!1),b({status:"error",message:o?.message||"Unable to start battle. Please try again."})}},U=t=>C.find(o=>o.field===t)?.message;ee?.winRate;const Kt=!!(l.mode==="online"&&m&&(m.status==="waiting"||m.status==="ready")&&(!r||r.status!=="completed")),$a=!!(j||m&&(m.status==="waiting"||m.status==="ready")&&(!r||r.status==="ready"||r.status==="cancelled"));return r&&(r.status==="in_progress"||r.status==="completed")?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:_t}),e.jsxs("div",{className:"fixed inset-0 z-[100] bg-[#0B0F19] text-white flex flex-col overflow-hidden",children:[r.status==="completed"&&r.outcome==="loss"&&e.jsx(Bs,{viewportHeight:ut.height}),r.status==="completed"&&r.outcome==="draw"&&e.jsx(Ms,{viewportHeight:ut.height,viewportWidth:ut.width}),e.jsx("div",{className:"absolute inset-0 z-0 opacity-40",children:e.jsx(ra,{children:e.jsx("div",{className:"h-full w-full"})})}),e.jsx(Ze,{children:Ra&&e.jsx(y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-[120] bg-black/70 backdrop-blur-md flex flex-col items-center justify-center px-6",children:e.jsxs(y.div,{initial:{opacity:0,transform:"translateY(40px) scale(0.85)"},animate:{opacity:1,transform:"translateY(0) scale(1)"},transition:{type:"spring",damping:18,stiffness:250,delay:.1},className:"bg-[#1e2433] border border-white/10 rounded-[2rem] p-8 flex flex-col items-center gap-5 max-w-sm w-full shadow-[0_30px_80px_rgba(0,0,0,0.6)]",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-24 h-24 rounded-full bg-[#1a2030] border-4 border-rose-500/50 overflow-hidden flex items-end justify-center shadow-xl",children:r.mode==="bot"?e.jsx(Te,{className:"h-16 w-16 text-rose-400 mb-2",strokeWidth:1.5}):e.jsx(ge,{className:"h-14 w-14 text-slate-500 mb-2",strokeWidth:1.5})}),e.jsx(y.div,{initial:{opacity:0,transform:"scale(0.5) translateX(-10px)"},animate:{opacity:1,transform:"scale(1) translateX(0)"},transition:{delay:.4,type:"spring",stiffness:300},className:"absolute -top-2 left-full ml-2 bg-white text-slate-900 text-xs font-black px-3 py-1.5 rounded-2xl rounded-bl-none whitespace-nowrap shadow-lg",children:"I give up!"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-black text-white mb-1",children:"Opponent Surrendered"}),e.jsxs("p",{className:"text-white/50 text-sm",children:[e.jsx("span",{className:"font-bold text-white/70",children:r.opponentName||"Your opponent"})," left the match. You win!"]})]}),e.jsxs("div",{className:"flex flex-col gap-3 w-full",children:[e.jsxs(A,{size:"lg",className:"w-full h-12 bg-emerald-500 hover:bg-emerald-400 text-white font-black rounded-xl",onClick:()=>{mt(!1),_(null),v(null),h(!1),b({status:"idle"}),d("hub"),ae()},children:[e.jsx(gt,{size:14,className:"inline mr-1"}),"Claim Victory"]}),e.jsx(A,{size:"lg",variant:"outline",className:"w-full h-12 border-white/20 text-white/70 hover:bg-white/10 rounded-xl",onClick:()=>{mt(!1),_(null),v(null),h(!1),b({status:"idle"}),d("hub")},children:"Back to Arena"})]})]})})}),F&&e.jsx("div",{className:"absolute inset-0 z-[110] bg-black/60 backdrop-blur-md flex items-center justify-center",children:e.jsxs(pe,{className:"w-full max-w-sm border-border/50 bg-[#181d27] shadow-[0_20px_50px_rgba(0,0,0,0.5)]",children:[e.jsxs(he,{className:"text-center",children:[e.jsx(be,{className:"text-3xl font-black text-white",children:"PAUSED"}),e.jsx(Ne,{className:"text-base text-muted-foreground mt-2",children:r.mode==="online"?"Online match - timer continues in the background! Hurry!":"Bot match - round timer frozen."})]}),e.jsxs(Xe,{className:"flex flex-col gap-3",children:[e.jsx(A,{variant:"default",size:"lg",className:"w-full text-lg h-12",onClick:Ut,children:"Resume Match"}),e.jsx(A,{variant:"outline",size:"lg",className:"w-full text-lg h-12 border-rose-500/20 text-rose-500 hover:bg-rose-500/10",onClick:()=>{ct(!1),_(null),v(null),h(!1),b({status:"idle"}),d("setup")},children:"Leave Match"})]})]})}),e.jsxs("div",{className:"relative z-10 flex flex-col h-full w-full max-w-[1400px] mx-auto px-4 md:px-8 py-4",children:[e.jsx(_a,{playerRoundStreak:H,playerVisualMultiplier:Qa,liveXpEarned:qa,activeMatch:r,subjects:ea,battleSoundEnabled:J,onToggleSound:()=>Tt(t=>!t),isFullscreen:Ma,onToggleFullscreen:()=>{typeof document>"u"||(document.fullscreenElement?document.exitFullscreen().catch(t=>{console.warn("Fullscreen mode unavailable or blocked by browser (exit):",t)}):document.documentElement.requestFullscreen().catch(t=>{console.warn("Fullscreen mode unavailable or blocked by browser (enter):",t)}))},isDesignPauseAvailable:ft,onTogglePause:Ut}),r.status==="in_progress"?e.jsx("div",{className:"shrink-0 w-full max-w-4xl mx-auto h-2 bg-white/10 rounded-full overflow-hidden mt-6 mb-4",children:e.jsx(y.div,{className:"h-full",animate:{width:`${Math.max(0,P/r.timePerQuestionSec*100)}%`,backgroundColor:P>Math.floor(r.timePerQuestionSec/2)?"#10b981":P>3?"#f59e0b":"#ef4444"},transition:{duration:1,ease:"linear"}})}):e.jsx("div",{className:"shrink-0 h-6 md:h-10 w-full"}),e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center w-full min-h-0 relative",children:r.status==="completed"?e.jsx("div",{className:"fixed inset-0 z-[200] flex flex-col items-center justify-center bg-slate-900/50 backdrop-blur-md px-4",children:e.jsxs(y.div,{initial:{opacity:0,scale:.9,y:10},animate:{opacity:1,scale:1,y:0},className:"w-full max-w-sm sm:max-w-md bg-[#161a25]/90 border border-white/20 shadow-[0_30px_80px_rgba(0,0,0,0.8)] rounded-[1.5rem] p-6 text-center",children:[e.jsx("h2",{className:u("text-3xl font-black uppercase tracking-widest drop-shadow-md mb-2",r.outcome==="win"?"text-emerald-400":r.outcome==="loss"?"text-rose-400":"text-amber-400"),children:r.outcome==="win"?"VICTORY!":r.outcome==="loss"?"DEFEAT":"DRAW MATCH"}),e.jsxs("p",{className:"text-white/80 font-bold text-sm mb-4 uppercase tracking-widest",children:["Final Score: ",r.scoreFor," - ",r.scoreAgainst]}),e.jsxs("div",{className:"bg-black/50 rounded-xl p-4 mb-5 border border-white/5 flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-white/40 text-[10px] font-black uppercase tracking-widest text-left mb-2",children:"Battle Score"}),(()=>{const t=r.roundResults||[];let o=0,p=0,x=0;for(const k of t)if(k.studentCorrect){o++;const T=o>=2?Math.min(15,(o-1)*5):0;p+=10,x+=T}else o=0;return e.jsxs(e.Fragment,{children:[e.jsx(ia,{value:p,label:"Correct Answers",delay:300,icon:e.jsx(yt,{className:"h-3 w-3 text-emerald-400"})}),e.jsx(ia,{value:x,label:"Streak Bonus",delay:900,icon:e.jsx(Je,{className:"h-3 w-3 text-amber-400"})}),e.jsxs(y.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:1.5,duration:.4},className:"flex items-center justify-between pt-1 mt-1 border-t border-white/5",children:[e.jsx("span",{className:"text-white/50 text-xs font-bold uppercase tracking-widest",children:"Total"}),e.jsxs("span",{className:"text-base font-black text-white/80",children:[p+x," pts"]})]})]})})()]}),e.jsx("div",{className:"w-full h-px bg-white/10"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white/40 text-[10px] font-black uppercase tracking-widest text-left mb-2",children:"Match Reward"}),e.jsxs(y.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:2,duration:.5,type:"spring"},className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-white/70 text-sm font-bold",children:r.outcome==="win"?"Victory Reward":r.outcome==="draw"?"Draw Reward":"Participation Reward"}),e.jsxs("span",{className:"text-2xl font-black text-amber-400 drop-shadow-md",children:["+",r.xpEarned||(r.outcome==="win"?80:r.outcome==="draw"?55:35)," XP"]})]}),e.jsx("p",{className:"text-white/25 text-[9px] mt-1 text-right uppercase tracking-widest",children:"Credited to your profile"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 justify-center",children:[e.jsx(A,{size:"lg",onClick:()=>{_(null),v(null),h(!1),d("hub")},className:"w-full h-12 rounded-xl text-sm font-black bg-white/10 hover:bg-white/20 text-white border border-white/20",children:"BACK TO ARENA"}),r.mode==="bot"&&e.jsx(A,{size:"lg",onClick:()=>void Xt(),disabled:G,className:"w-full h-12 rounded-xl text-sm font-black bg-violet-600 hover:bg-violet-500 text-white border-b-2 border-violet-800 active:border-b-0 active:translate-y-[2px]",children:"REMATCH"})]})]})}):e.jsx(Aa,{activeMatch:r,roundSecondsLeft:P,lastRoundResult:B,selectedOptionIndex:ve,roundLocked:Z,answerSubmitting:G,designPauseActive:F,onOptionSelect:t=>{B&&B.roundNumber===r.currentRound||G||Z||(ua()?.resume().catch(()=>{}),Q("lock"),X(t),Ve(t))},floatingMomentum:Ta,lastRoundMomentumDelta:ie,studentProfile:n,quizBattleAvatar:jt})}),e.jsx(Sa,{studentProfile:n,activeMatch:r,scorePulseTarget:Da,quizBattleAvatar:jt})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("style",{children:_t}),e.jsx(ra,{bgVideo:"/videos/warp_bg.mp4",className:"-mx-3 lg:-mx-4 -mt-3 lg:-mt-4 -mb-8 px-4 sm:px-6 xl:px-10 py-6 sm:py-8 min-h-[calc(100vh-3.5rem)] !w-auto overflow-hidden relative",children:e.jsx("div",{className:"h-full flex flex-col max-w-[1400px] mx-auto w-full",children:e.jsx(y.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.24,ease:[.22,1,.36,1]},className:"space-y-3 lg:space-y-4",children:e.jsxs(Cs,{value:c,onValueChange:t=>d(t),children:[e.jsx(ke,{value:"hub",className:"mt-0 outline-none",children:e.jsx(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-5",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_300px] xl:grid-cols-[1fr_320px] gap-6 sm:gap-8 lg:gap-10",children:[e.jsxs("div",{className:"space-y-3 lg:space-y-4",children:[e.jsxs("div",{className:"relative select-none isolate bg-indigo-600 rounded-[2rem] shadow-[0_20px_45px_-15px_rgba(0,0,0,0.3)] shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 pointer-events-none z-0 rounded-[2rem]"}),e.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none rounded-[2rem] overflow-hidden repeating-stripe-bg"}),e.jsx("div",{className:"absolute top-0 right-0 w-[400px] h-[400px] bg-sky-500/20 blur-[100px] rounded-full pointer-events-none"}),e.jsxs("div",{className:"relative z-10 flex flex-col md:flex-row items-center justify-between p-6 lg:p-8 h-full min-h-[140px] lg:min-h-[160px]",children:[e.jsx("div",{className:"flex-1 space-y-3 w-full pr-0 md:pr-[240px] lg:pr-[280px]",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"flex items-center gap-3 text-3xl sm:text-4xl lg:text-[46px] font-black tracking-tight text-white mb-2 sm:mb-4",children:[e.jsx(wt,{className:"h-8 w-8 sm:h-10 sm:w-10 lg:h-12 lg:w-12 text-[#d1abff]",strokeWidth:2.5}),"Quiz Battle"]}),e.jsx("p",{className:"text-base sm:text-lg lg:text-xl text-white mt-1.5 sm:mt-2 max-w-2xl leading-relaxed",children:"Timed student duels with synchronized rounds, instant feedback, and progression rewards."}),e.jsxs("p",{className:"text-xs lg:text-sm font-semibold uppercase tracking-[0.15em] text-[#8a7fbc] mt-3",children:["Connection: ",e.jsx("span",{className:Dt==="connected"?"text-emerald-400":"text-amber-400",children:Dt})]})]})}),e.jsx("div",{className:"hidden md:block absolute right-[-5px] lg:right-[-15px] top-0 lg:top-[5px] w-[200px] lg:w-[260px] shrink-0 pointer-events-none z-20",children:e.jsx("img",{src:jt,alt:"Mascot",className:"w-full h-full object-contain animate-mascot-float"})})]})]}),e.jsxs("div",{className:"pt-4 lg:pt-6",children:[e.jsxs("h2",{className:"flex items-center gap-2 pb-4 text-xl lg:text-2xl font-black tracking-wide uppercase text-white drop-shadow-[0_0_12px_rgba(255,255,255,0.4)]",children:[e.jsx(wt,{className:"h-6 w-6 lg:h-8 lg:w-8 text-amber-400 drop-shadow-[0_0_8px_rgba(251,191,36,0.9)]"})," BATTLE MODES"]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-2 gap-3 sm:gap-4 lg:gap-6 relative z-10 w-full mb-2",children:[e.jsxs(y.button,{type:"button",onClick:()=>Gt("online"),whileHover:{scale:1.025},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:15},className:"w-full h-[170px] sm:h-[245px] lg:h-[265px] bg-[#8A3FD3] rounded-[22px] border-none relative text-left shadow-[0_8px_30px_rgba(138,63,211,0.2)] hover:shadow-[0_12px_45px_rgba(138,63,211,0.4)] block flex-col group",children:[e.jsx("div",{className:"absolute inset-0 rounded-[22px] shadow-[inset_0_6px_15px_rgba(255,255,255,0.4)] pointer-events-none z-40"}),e.jsxs("div",{className:"absolute top-4 -left-4 z-20 w-[100px] h-[40px] opacity-100",children:[e.jsx("svg",{viewBox:"0 0 100 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full block drop-shadow-md",children:e.jsx("path",{d:"M0 0 H94 Q100 0 100 6 V34 Q100 40 94 40 H0 L14 20 Z",fill:"#b91c1c"})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-end pr-3 font-black text-[13px] text-white tracking-[0.3px] opacity-100 font-nunito",children:"VS Player"})]}),e.jsxs("div",{className:"rounded-[22px] overflow-hidden relative isolate h-full flex flex-col justify-end",children:[e.jsx("div",{className:"absolute top-0 -left-[150%] w-[100%] h-full bg-gradient-to-r from-transparent via-white/40 to-transparent -skew-x-12 z-50 pointer-events-none transition-all duration-0 group-hover:duration-[800ms] ease-in-out group-hover:left-[150%]"}),e.jsxs("div",{className:"flex-1 w-full flex items-end justify-center relative pt-2 pointer-events-none",children:[e.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[50px] sm:h-[95px] bg-[#662AA8] rounded-[50%_50%_0_0/100%_100%_0_0] scale-[1.05] z-0"}),e.jsxs("div",{className:"relative z-10 flex items-center justify-center mb-[2px] h-[80px] sm:h-[140px] w-full",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"",className:"h-[120%] sm:h-[125%] object-contain relative z-20 origin-bottom right-[-10px] sm:right-[-15px] drop-shadow-[0_12px_15px_rgba(0,0,0,0.3)] animate-avatar-left"}),e.jsx("div",{className:"relative z-30 flex flex-col items-center mx-[-20px] scale-[1.1] animate-vs-pulse",children:e.jsxs("span",{className:"font-black italic text-[28px] sm:text-[40px] text-gray-200 tracking-tighter leading-none drop-shadow-[-2px_3px_0px_rgba(0,0,0,0.8)] webkit-text-stroke",children:[e.jsx("span",{className:"text-gray-300",children:"V"}),e.jsx("span",{className:"text-gray-400",children:"S"})]})}),e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"",className:"h-[120%] sm:h-[125%] object-contain relative z-10 scale-x-[-1] origin-bottom left-[-20px] drop-shadow-[0_12px_15px_rgba(0,0,0,0.3)] animate-avatar-right"})]})]}),e.jsx("div",{className:"relative z-10 w-full px-3 sm:px-5 py-2 sm:py-4 text-center bg-[#662AA8]",children:e.jsx("p",{className:"text-[10px] sm:text-[13px] font-bold text-white leading-[1.4] font-nunito",children:"Queue or room-code match with another student."})})]})]}),e.jsxs(y.button,{type:"button",onClick:()=>Gt("bot"),whileHover:{scale:1.025},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:15},className:"w-full h-[170px] sm:h-[245px] lg:h-[265px] bg-[#1FA7E1] rounded-[22px] border-none relative text-left shadow-[0_8px_30px_rgba(31,167,225,0.2)] hover:shadow-[0_12px_45px_rgba(31,167,225,0.4)] block flex-col group",children:[e.jsx("div",{className:"absolute inset-0 rounded-[22px] shadow-[inset_0_6px_15px_rgba(255,255,255,0.4)] pointer-events-none z-40"}),e.jsxs("div",{className:"absolute top-4 -left-4 z-20 w-[100px] h-[40px] opacity-100",children:[e.jsx("svg",{viewBox:"0 0 100 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full block drop-shadow-md",children:e.jsx("path",{d:"M0 0 H94 Q100 0 100 6 V34 Q100 40 94 40 H0 L14 20 Z",fill:"#b91c1c"})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-end pr-3 font-black text-[13px] text-white tracking-[0.3px] opacity-100 font-nunito",children:"VS Bot"})]}),e.jsxs("div",{className:"rounded-[22px] overflow-hidden relative isolate h-full flex flex-col justify-end",children:[e.jsx("div",{className:"absolute top-0 -left-[150%] w-[100%] h-full bg-gradient-to-r from-transparent via-white/40 to-transparent -skew-x-12 z-50 pointer-events-none transition-all duration-0 group-hover:duration-[800ms] ease-in-out group-hover:left-[150%]"}),e.jsxs("div",{className:"flex-1 w-full flex items-end justify-center relative pt-2 pointer-events-none",children:[e.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[50px] sm:h-[95px] bg-[#127DA6] rounded-[50%_50%_0_0/100%_100%_0_0] scale-[1.05] z-0"}),e.jsxs("div",{className:"relative z-10 flex items-end justify-center mb-[2px] h-[85px] sm:h-[145px] w-full",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"",className:"absolute opacity-40 blur-[1px] h-full object-contain origin-bottom -translate-x-[30px] sm:-translate-x-[60px] scale-[0.80] sm:scale-[0.85] animate-ghost-left"}),e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"",className:"absolute opacity-40 blur-[1px] h-full object-contain origin-bottom translate-x-[30px] sm:translate-x-[60px] scale-[0.80] sm:scale-[0.85] animate-ghost-right"}),e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"VS Bot",className:"relative opacity-100 scale-100 h-[105%] sm:h-[115%] object-contain drop-shadow-[0_15px_15px_rgba(0,0,0,0.3)] z-20 origin-bottom animate-main-avatar"})]})]}),e.jsx("div",{className:"relative z-10 w-full px-3 sm:px-5 py-2 sm:py-4 text-center bg-[#127DA6]",children:e.jsx("p",{className:"text-[10px] sm:text-[13px] font-bold text-white leading-[1.4] font-nunito",children:"Instant solo duel with selectable bot difficulty."})})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3 lg:space-y-4 flex flex-col h-full justify-between",children:[e.jsx("div",{onClick:()=>d("leaderboard"),className:"relative w-full bg-[#3b3a82] dark:bg-[#2b2b5f] rounded-[24px] overflow-hidden flex flex-col shadow-[0_8px_30px_rgba(59,58,130,0.3)] cursor-pointer group mb-4",children:e.jsxs("div",{className:"relative w-full h-[190px] flex flex-col items-center justify-end pt-8",children:[e.jsxs("div",{className:"absolute top-[25px] w-full flex justify-center items-end px-2 z-10 gap-3",children:[e.jsx(vt,{strokeWidth:0,fill:"currentColor",className:"w-[32px] h-[32px] text-[#fcd34d] -rotate-[15deg] mb-2 drop-shadow-[0_0_15px_rgba(252,211,77,0.8)]"}),e.jsx("div",{className:"z-10 animate-star-float",children:e.jsx(vt,{strokeWidth:0,fill:"currentColor",className:"w-[48px] h-[48px] text-[#fcd34d] drop-shadow-[0_0_25px_rgba(252,211,77,0.9)]"})}),e.jsx(vt,{strokeWidth:0,fill:"currentColor",className:"w-[32px] h-[32px] text-[#fcd34d] rotate-[15deg] mb-2 drop-shadow-[0_0_15px_rgba(252,211,77,0.8)]"})]}),e.jsx("div",{className:"absolute bottom-[50px] left-1/2 -translate-x-1/2 w-[220px] h-[160px] bg-gradient-to-t from-white/20 to-transparent blur-[2px] z-0 pointer-events-none",style:{clipPath:"polygon(25% 0, 75% 0, 100% 100%, 0% 100%)"}}),e.jsxs("div",{className:"flex items-end justify-center z-10 relative px-4 bottom-[35px]",children:[e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx("div",{className:"w-[75px] h-[14px] bg-[#D44747] rounded-t-[3px] border-x-[1.5px] border-white/90"}),e.jsxs("div",{className:"w-[65px] h-[45px] bg-[#FE6464] flex flex-col items-center justify-center gap-2 border-x-[1.5px] border-white/90",children:[e.jsx("div",{className:"w-8 h-1.5 bg-white/90 rounded-full mt-1"}),e.jsx("div",{className:"w-8 h-1.5 bg-white/90 rounded-full"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-20 -mx-1",children:[e.jsx("div",{className:"w-[90px] h-[16px] bg-[#F39029] rounded-t-[3px] border-x-[1.5px] border-white/90"}),e.jsxs("div",{className:"w-[80px] h-[65px] bg-[#FFA23A] flex flex-col items-center justify-center gap-2.5 border-x-[1.5px] border-white/90",children:[e.jsx("div",{className:"w-10 h-1.5 bg-white/90 rounded-full mt-1"}),e.jsx("div",{className:"w-10 h-1.5 bg-white/90 rounded-full"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx("div",{className:"w-[75px] h-[14px] bg-[#D44747] rounded-t-[3px] border-x-[1.5px] border-white/90"}),e.jsxs("div",{className:"w-[65px] h-[45px] bg-[#FE6464] flex flex-col items-center justify-center gap-2 border-x-[1.5px] border-white/90",children:[e.jsx("div",{className:"w-8 h-1.5 bg-white/90 rounded-full mt-1"}),e.jsx("div",{className:"w-8 h-1.5 bg-white/90 rounded-full"})]})]})]}),e.jsxs("div",{className:"absolute bottom-[2px] w-full flex justify-center z-30",children:[e.jsx("div",{className:"absolute top-[10px] w-full h-[35px] bg-[#8E1010] z-0"}),e.jsxs("div",{className:"relative w-[85%] h-[50px] bg-[#C62828] z-10 flex flex-col items-center justify-center rounded-[3px] shadow-[0_4px_10px_rgba(0,0,0,0.2)]",children:[e.jsx("h3",{className:"text-[18px] font-black text-white tracking-wide leading-none font-nunito mt-0.5",children:"Hall of Fame"}),e.jsx("span",{className:"text-[10px] font-bold text-white/90 tracking-wide mt-1",children:"View Page >"})]})]})]})}),e.jsxs("div",{className:"relative w-full bg-[#3b3a82] dark:bg-[#2b2b5f] rounded-[24px] overflow-hidden flex flex-col shadow-[0_8px_30px_rgba(59,58,130,0.3)]",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between px-5 pt-5 pb-3 relative z-10",children:[e.jsx("h3",{className:"text-[20px] font-black text-white tracking-wide leading-none drop-shadow-md font-nunito",children:"My Stats"}),e.jsx(A,{className:"bg-[#7C51A8] hover:bg-[#6b4494] text-white font-bold text-[10px] tracking-widest uppercase rounded-full px-4 h-[28px] border border-white/10 shadow-md transition-transform active:scale-95",onClick:()=>d("stats"),children:"View Stats >"})]}),e.jsxs("div",{className:"relative z-10 w-full overflow-hidden pb-6",children:[e.jsx("div",{className:"absolute left-0 top-0 bottom-6 w-8 bg-gradient-to-r from-[#3b3a82] dark:from-[#2b2b5f] to-transparent z-20 pointer-events-none"}),e.jsx("div",{className:"absolute right-0 top-0 bottom-6 w-8 bg-gradient-to-l from-[#3b3a82] dark:from-[#2b2b5f] to-transparent z-20 pointer-events-none"}),e.jsx(y.div,{className:"flex w-max",animate:{x:["0%","-33.333333%"]},transition:{ease:"linear",duration:15,repeat:1/0},children:[1,2,3].map(t=>e.jsx("div",{className:"flex gap-3 pr-3",children:[{key:"totalXP",bg:"from-[#FF7B88] to-[#FF5C70]",shadow:"shadow-[0_4px_15px_rgba(255,92,112,0.4),inset_0_1px_1px_rgba(255,255,255,0.4)]",icon:Je,value:n?.currentXP||0,label:"Total XP"},{key:"winRate",bg:"from-[#B467FF] to-[#9D44FF]",shadow:"shadow-[0_4px_15px_rgba(157,68,255,0.4),inset_0_1px_1px_rgba(255,255,255,0.4)]",icon:gt,value:`${Math.round(ee?.winRate||0)} %`,label:"Win Rate"},{key:"matches",bg:"from-[#4DB9E9] to-[#2DA1D8]",shadow:"shadow-[0_4px_15px_rgba(45,161,216,0.4),inset_0_1px_1px_rgba(255,255,255,0.4)]",icon:At,value:ee?.matchesPlayed||0,label:"Matches"},{key:"response",bg:"from-[#48DA94] to-[#2BBF7B]",shadow:"shadow-[0_4px_15px_rgba(43,191,123,0.4),inset_0_1px_1px_rgba(255,255,255,0.4)]",icon:sa,value:ee?.averageResponseMs?`${(ee.averageResponseMs/1e3).toFixed(0)}s`:"0s",label:"Response"}].map(o=>e.jsxs("div",{className:u("w-[90px] sm:w-[100px] shrink-0 aspect-square rounded-[16px] bg-gradient-to-br p-3 flex flex-col justify-between relative overflow-hidden group",o.bg,o.shadow),children:[e.jsx("div",{className:"absolute -bottom-6 -right-6 text-white/10 transition-transform duration-500 group-hover:scale-110",children:e.jsx(o.icon,{className:"w-20 h-20"})}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center relative z-10 shadow-[inset_0_1px_3px_rgba(255,255,255,0.5)]",children:e.jsx(o.icon,{className:"w-4 h-4 text-white"})}),e.jsxs("div",{className:"relative z-10 flex flex-col",children:[e.jsx("h4",{className:"text-[14px] sm:text-[16px] lg:text-[18px] font-black text-white leading-none tracking-tight drop-shadow-sm",children:o.value}),e.jsx("p",{className:"text-[8px] sm:text-[9px] font-extrabold text-white/80 uppercase tracking-widest mt-1 truncate",children:o.label})]})]},o.key))},t))})]})]}),e.jsxs(pe,{className:u(fe,"rounded-[18px] flex flex-col min-h-[200px]"),children:[e.jsxs(he,{className:"pb-0 pt-3 px-4 flex flex-row items-center justify-between",children:[e.jsxs(be,{className:"text-[14px] font-black flex items-center gap-2 text-[#2e2b5e] dark:text-[#f5f7fb]",children:[e.jsx(es,{className:"h-[16px] w-[16px] text-[#2e2b5e] dark:text-[#9e8fff]"})," Match History"]}),e.jsx(A,{variant:"link",size:"sm",className:"h-auto p-0 text-[12px] font-semibold text-muted-foreground dark:text-[#95a0bb] hover:text-primary transition-colors",onClick:()=>d("history"),children:"View All"})]}),e.jsxs(Xe,{className:"space-y-1.5 px-4 pt-1 pb-3 overflow-y-auto",children:[e.jsx("div",{className:"text-[11px] text-muted-foreground dark:text-[#8b95ad] mb-1.5 leading-relaxed",children:"Your recent student battles only."}),Pt?e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"h-10 w-full rounded-xl bg-muted dark:bg-[#2a3143]"}),e.jsx(xe,{className:"h-10 w-full rounded-xl bg-muted dark:bg-[#2a3143]"})]}):Oe.length===0?e.jsx("p",{className:"text-xs text-center text-muted-foreground dark:text-[#a8b2c9] py-2",children:"No battle history yet."}):Oe.slice(0,3).map(t=>{const o=t.outcome==="win",p=t.outcome==="loss",x=t.opponentName.split(" ").map(k=>k[0]).join("").substring(0,2).toUpperCase()||"OP";return e.jsxs("div",{className:"group relative overflow-hidden rounded-[14px] border border-muted-foreground/15 bg-white dark:bg-[#11151d] dark:border-[#2f3547] p-2 shadow-sm transition-all hover:scale-[1.01] hover:shadow-md",children:[e.jsx("div",{className:u("absolute inset-y-0 right-0 w-[55%] pointer-events-none opacity-[0.2] dark:opacity-[0.25] mix-blend-multiply dark:mix-blend-screen transition-all",o?"bg-gradient-to-l from-emerald-500 via-emerald-500/40 to-transparent":p?"bg-gradient-to-l from-rose-500 via-rose-500/40 to-transparent":"bg-gradient-to-l from-amber-400 via-amber-400/40 to-transparent")}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 w-full",children:[e.jsx("div",{className:u("w-9 h-9 rounded-full flex items-center justify-center font-black text-[12px] tracking-wide text-white flex-shrink-0 shadow-inner",o?"bg-[#34d399] dark:bg-[#15803d]":p?"bg-[#fb7185] dark:bg-[#be123c]":"bg-[#fbbf24] dark:bg-[#b45309]"),children:x}),e.jsxs("div",{className:"flex-grow min-w-0 flex flex-col justify-center",children:[e.jsxs("p",{className:"text-[13px] font-extrabold text-[#36326e] dark:text-[#e4e7f1] truncate leading-tight",children:["vs ",t.opponentName]}),e.jsxs("p",{className:"text-[10px] font-bold text-muted-foreground/60 dark:text-[#7f88a3] truncate flex items-center gap-1 mt-0.5",children:[t.subjectId," ",e.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/30"})," ",t.difficulty||"Medium"," ",e.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/30"})," ",t.rounds||"5"," rnds"]})]}),e.jsxs("div",{className:"text-right flex flex-col items-end justify-center pl-2 flex-shrink-0",children:[e.jsxs("p",{className:"tabular-nums text-[16px] leading-[1.1] font-black text-[#2e2b5e] dark:text-[#f5f7fb] tracking-tighter",children:[t.scoreFor,e.jsx("span",{className:"text-muted-foreground/40 mx-[1px]",children:"-"}),t.scoreAgainst]}),e.jsx("p",{className:u("text-[9px] font-black uppercase tracking-[0.1em]",o?"text-emerald-500 dark:text-emerald-400":p?"text-rose-500 dark:text-rose-400":"text-amber-500 dark:text-amber-400"),children:t.outcome})]})]})]},t.matchId)})]})]})]})]})},"hub")}),e.jsx(ke,{value:"setup",className:"mt-0 outline-none",children:e.jsxs(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"w-full space-y-6",children:[e.jsxs(y.div,{className:u(fe,"relative overflow-hidden rounded-[24px] mb-6 shadow-lg",l.mode==="online"?"border-purple-500/20 shadow-[0_0_40px_-10px_rgba(138,63,211,0.2)]":"border-sky-500/20 shadow-[0_0_40px_-10px_rgba(31,167,225,0.2)]"),whileHover:{scale:1.01},transition:{type:"spring",stiffness:300,damping:20},children:[e.jsx("div",{className:u("pointer-events-none absolute inset-0 bg-gradient-to-r",l.mode==="online"?"from-purple-500/20 via-fuchsia-500/10 to-purple-600/5 dark:from-purple-500/20 dark:via-fuchsia-500/10 dark:to-purple-900/10":"from-sky-500/20 via-cyan-500/10 to-sky-600/5 dark:from-sky-500/20 dark:via-cyan-500/10 dark:to-sky-900/10")}),e.jsx("div",{className:u("pointer-events-none absolute -top-24 -right-24 h-64 w-64 rounded-full blur-3xl animate-orb-pulse",l.mode==="online"?"bg-purple-400/20":"bg-sky-400/20")}),e.jsx("div",{className:u("pointer-events-none absolute -bottom-12 -left-12 h-40 w-40 rounded-full blur-2xl animate-orb-pulse-delayed",l.mode==="online"?"bg-fuchsia-400/30":"bg-cyan-400/30")}),e.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAiLz4KPHBhdGggZD0iTTAgMEgxdjFIMHoiIGZpbGw9IiM2MzY2ZjEiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPgo8L3N2Zz4=')] opacity-30 dark:opacity-10 mix-blend-overlay"}),e.jsxs("div",{className:"relative p-6 sm:p-8 md:px-10 flex items-center gap-5 sm:gap-8 z-10",children:[e.jsx(A,{variant:"ghost",onClick:()=>d("hub"),className:u("h-12 w-12 sm:h-14 sm:w-14 p-0 rounded-full hover:scale-105 transition-all backdrop-blur-md shadow-lg shrink-0 flex items-center justify-center group",l.mode==="online"?"bg-white/50 dark:bg-black/40 hover:bg-white/80 dark:hover:bg-black/60 border border-purple-500/30":"bg-white/50 dark:bg-black/40 hover:bg-white/80 dark:hover:bg-black/60 border border-sky-500/30"),children:e.jsx(Ue,{className:u("h-6 w-6 sm:h-8 sm:w-8 rotate-180 transition-transform group-hover:-translate-x-0.5",l.mode==="online"?"text-purple-800 dark:text-purple-300":"text-sky-800 dark:text-sky-300")})}),e.jsxs("div",{children:[e.jsxs("h2",{className:u("flex items-center gap-3 text-3xl sm:text-4xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-br drop-shadow-sm",l.mode==="online"?"from-purple-600 to-fuchsia-500 dark:from-purple-300 dark:to-fuchsia-200":"from-sky-600 to-cyan-500 dark:from-sky-300 dark:to-cyan-200"),children:[e.jsx("div",{className:u("p-2 rounded-2xl shadow-inner border animate-icon-bob",l.mode==="online"?"bg-purple-100 dark:bg-purple-900/50 border-purple-200 dark:border-purple-700/50":"bg-sky-100 dark:bg-sky-900/50 border-sky-200 dark:border-sky-700/50"),children:l.mode==="online"?e.jsx(ge,{className:"h-8 w-8 text-purple-600 dark:text-purple-400 drop-shadow-[0_0_8px_rgba(138,63,211,0.5)]"}):e.jsx(Te,{className:"h-8 w-8 text-sky-600 dark:text-sky-400 drop-shadow-[0_0_8px_rgba(31,167,225,0.5)]"})}),l.mode==="online"?"1v1 Online":"1v1 vs Bot"]}),e.jsx("p",{className:u("text-[10px] sm:text-[12px] font-black uppercase tracking-[0.2em] mt-1.5 drop-shadow-sm",l.mode==="online"?"text-purple-600/80 dark:text-purple-400/80":"text-sky-600/80 dark:text-sky-400/80"),children:l.mode==="online"?"CHALLENGE YOUR SCHOOLMATES AND PROVE YOUR SKILLS.":"CHALLENGE THE AI AND SHARPEN YOUR SKILLS."})]})]})]}),e.jsx("div",{className:"rounded-[24px] border border-white/40 bg-white/85 dark:border-white/10 dark:bg-black/80 backdrop-blur-xl p-5 sm:p-7 shadow-xl",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-10",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[11px] font-black uppercase tracking-[0.12em] ml-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:"Category"}),e.jsxs(Me,{value:l.subjectId,onValueChange:t=>w(o=>({...o,subjectId:t})),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50",U("subjectId")&&"border-rose-400"),children:e.jsx(Ee,{placeholder:"Select category"})}),e.jsx(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:le.map(t=>e.jsx(de,{value:t.id,className:"rounded-lg",children:t.title},t.id))})]}),U("subjectId")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300 ml-1",children:U("subjectId")})]}),e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[11px] font-black uppercase tracking-[0.12em] ml-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:"Strand / Topic Group"}),e.jsxs(Me,{value:l.topicId,onValueChange:t=>w(o=>({...o,topicId:t})),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50",U("topicId")&&"border-rose-400"),children:e.jsx(Ee,{placeholder:"Select topic group"})}),e.jsx(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:Pa.map(t=>e.jsx(de,{value:t.value,className:"rounded-lg",children:t.label},t.value))})]}),U("topicId")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300 ml-1",children:U("topicId")})]}),e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[11px] font-black uppercase tracking-[0.12em] ml-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:l.mode==="online"?"Difficulty":"Bot Difficulty"}),e.jsxs(Me,{value:l.mode==="bot"?l.adaptiveBot?"adaptive":l.botDifficulty:l.difficulty,onValueChange:t=>w(o=>o.mode==="bot"?{...o,botDifficulty:t,adaptiveBot:t==="adaptive"}:{...o,difficulty:t}),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50"),children:e.jsx(Ee,{})}),e.jsxs(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:[e.jsx(de,{value:"easy",className:"rounded-lg",children:"Easy"}),e.jsx(de,{value:"medium",className:"rounded-lg",children:"Medium"}),e.jsx(de,{value:"hard",className:"rounded-lg",children:"Hard"}),l.mode==="bot"&&e.jsx(de,{value:"adaptive",className:"rounded-lg",children:"Adaptive"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[10px] sm:text-[11px] font-black uppercase tracking-[0.12em] ml-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:"Questions"}),e.jsxs(Me,{value:String(l.rounds),onValueChange:t=>w(o=>({...o,rounds:Number(t)})),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50",U("rounds")&&"border-rose-400"),children:e.jsx(Ee,{})}),e.jsx(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:[3,5,7,10,12,15].map(t=>e.jsx(de,{value:String(t),className:"rounded-lg",children:t},t))})]}),U("rounds")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300 ml-1",children:U("rounds")})]}),e.jsxs("div",{className:"space-y-1.5 group",children:[e.jsx("label",{className:u("text-[10px] sm:text-[11px] font-black uppercase tracking-[0.12em] ml-1 line-clamp-1",l.mode==="online"?"text-[#8A3FD3] dark:text-[#a35ceb]":"text-[#1FA7E1] dark:text-[#4bc1f2]"),children:"Time / Q"}),e.jsxs(Me,{value:String(l.timePerQuestionSec),onValueChange:t=>w(o=>({...o,timePerQuestionSec:Number(t)})),children:[e.jsx(Fe,{className:u("rounded-xl h-11 border-white/20 bg-white text-slate-800 dark:bg-black/50 dark:text-white dark:border-white/10 transition-colors shadow-inner",l.mode==="online"?"hover:border-[#8A3FD3]/50":"hover:border-[#1FA7E1]/50",U("timePerQuestionSec")&&"border-rose-400"),children:e.jsx(Ee,{})}),e.jsx(Re,{className:"rounded-xl backdrop-blur-xl bg-white/90 dark:bg-[#1a1f2e]/90",children:[15,20,30,45,60,90].map(t=>e.jsxs(de,{value:String(t),className:"rounded-lg",children:[t," sec"]},t))})]}),U("timePerQuestionSec")&&e.jsx("p",{className:"text-xs text-destructive dark:text-rose-300 ml-1",children:U("timePerQuestionSec")})]})]})]}),e.jsxs("div",{className:"flex flex-col justify-between space-y-6",children:[e.jsxs("div",{className:"space-y-5",children:[l.mode==="online"&&e.jsxs("div",{className:"space-y-3 rounded-2xl border border-[#8A3FD3]/20 bg-[#8A3FD3]/5 dark:border-[#8A3FD3]/20 p-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[11px] font-black uppercase tracking-[0.12em] text-[#8A3FD3] dark:text-[#a35ceb] ml-1",children:"Online Match Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{value:"public_matchmaking",label:"Public Queue"},{value:"private_room",label:"Private Room"}].map(t=>e.jsx(A,{type:"button",variant:l.queueType===t.value?"default":"outline",className:u("rounded-xl h-11 transition-all border-none font-bold text-xs",l.queueType===t.value?"bg-[#8A3FD3] hover:bg-[#7b35c0] text-white shadow-md shadow-[#8A3FD3]/30":"bg-white/50 hover:bg-white/80 dark:bg-black/30 dark:hover:bg-black/50 text-[#8A3FD3] dark:text-[#d3a8ff]"),onClick:()=>w(o=>({...o,queueType:t.value})),children:t.label},t.value))})]}),l.queueType==="private_room"&&e.jsxs(y.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"pt-2 space-y-2",children:[e.jsx("label",{className:"text-[11px] font-black uppercase tracking-[0.12em] text-[#8A3FD3] dark:text-[#a35ceb] ml-1",children:"Room Code (optional)"}),e.jsx(Ka,{value:W,onChange:t=>S(t.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6)),placeholder:"Leave blank to create a room",className:"rounded-xl h-12 text-center text-lg uppercase font-bold tracking-[0.25em] border-[#8A3FD3]/30 bg-white/80 dark:bg-black/50 dark:border-[#8A3FD3]/20 focus-visible:ring-[#8A3FD3]/50 shadow-inner",maxLength:6}),e.jsx("div",{className:"rounded-xl border border-[#8A3FD3]/30 bg-[#8A3FD3]/10 px-3 py-3 text-[12px] font-semibold text-[#6620a2] leading-snug dark:border-[#8A3FD3]/30 dark:bg-[#8A3FD3]/10 dark:text-[#d3a8ff]",children:"Enter a room code to join an existing battle, or leave it blank to create a new room and share your code."})]})]}),e.jsxs("label",{className:u("flex flex-col sm:flex-row sm:items-center justify-between rounded-[16px] border bg-white/50 p-4 transition-colors cursor-pointer shadow-sm dark:bg-black/50 group",l.mode==="online"?"border-[#8A3FD3]/20 hover:bg-[#8A3FD3]/5 dark:border-[#8A3FD3]/20 dark:hover:bg-[#8A3FD3]/10":"border-[#1FA7E1]/20 hover:bg-[#1FA7E1]/5 dark:border-[#1FA7E1]/20 dark:hover:bg-[#1FA7E1]/10"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:u("h-11 w-11 rounded-full flex items-center justify-center group-hover:scale-110 transition-transform",l.mode==="online"?"bg-[#8A3FD3]/10 text-[#8A3FD3] dark:text-[#c48bfc]":"bg-[#1FA7E1]/10 text-[#1FA7E1] dark:text-[#7ad8ff]"),children:J?e.jsx(fa,{className:"h-5 w-5"}):e.jsx(ga,{className:"h-5 w-5 opacity-60"})}),e.jsxs("div",{className:"mb-3 sm:mb-0",children:[e.jsx("p",{className:"text-sm font-bold text-slate-800 dark:text-slate-200",children:"Battle Sounds"}),e.jsx("p",{className:"text-xs font-medium text-slate-500 dark:text-slate-400",children:"Cues for countdowns and results."})]})]}),e.jsx(Ja,{checked:J,onCheckedChange:Tt})]}),e.jsxs(y.div,{initial:!1,animate:{opacity:J?1:.45,y:J?0:-2},className:u("rounded-[16px] border bg-white/40 p-4 shadow-sm dark:bg-black/40",l.mode==="online"?"border-[#8A3FD3]/20 dark:border-[#8A3FD3]/20":"border-[#1FA7E1]/20 dark:border-[#1FA7E1]/20"),children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-[0.14em] text-slate-700 dark:text-slate-200",children:"SFX Volume"}),e.jsxs("p",{className:"text-xs font-bold text-slate-500 dark:text-slate-400",children:[Math.round(ce*100),"%"]})]}),e.jsx("input",{type:"range",min:0,max:100,step:1,value:Math.round(ce*100),disabled:!J,onChange:t=>{const o=Ge(Number(t.target.value)/100,0,1);za(o)},onMouseUp:()=>Q("tick"),onTouchEnd:()=>Q("tick"),className:"h-2 w-full cursor-pointer accent-violet-500 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Battle sound effects volume"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{"aria-live":"polite",className:"min-h-[24px] text-sm font-medium",children:[N.status==="queued"&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:u("inline-flex items-center gap-1 text-[13px] font-bold px-3 py-1.5 rounded-lg",l.mode==="online"?"text-[#8A3FD3] bg-[#8A3FD3]/10":"text-[#1FA7E1] bg-[#1FA7E1]/10"),children:N.message}),l.mode==="online"&&l.queueType==="private_room"&&m?.roomCode&&e.jsxs(A,{type:"button",variant:"outline",className:u("h-8 rounded-full border-emerald-500/50 bg-emerald-50 px-4 text-xs font-black uppercase tracking-[0.16em] text-emerald-900 shadow-sm hover:bg-emerald-100 hover:scale-105 transition-all dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-300 dark:hover:bg-emerald-500/20",R===m.roomCode&&"scale-105 bg-emerald-200 dark:bg-emerald-500/30"),onClick:()=>void Vt(m.roomCode),"aria-label":`Copy room code ${m.roomCode}`,children:[R===m.roomCode?e.jsx(yt,{className:"h-4 w-4"}):e.jsx(aa,{className:"h-4 w-4"}),m.roomCode]}),(j||Kt)&&O>0&&e.jsxs("span",{className:u("inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-bold animate-pulse",l.mode==="online"?"bg-[#8A3FD3]/10 text-[#8A3FD3]":"bg-[#1FA7E1]/10 text-[#1FA7E1]"),children:["Waiting ",da(O)]})]}),N.status==="error"&&e.jsx("span",{className:"inline-flex items-center gap-1.5 text-[13px] font-bold text-rose-600 dark:text-rose-400 bg-rose-50 dark:bg-rose-500/10 px-3 py-1.5 rounded-lg border border-rose-200 dark:border-rose-500/20",children:N.message}),N.status==="validating"&&e.jsxs("span",{className:u("inline-flex items-center gap-2 font-bold px-3 py-1.5 rounded-lg",l.mode==="online"?"text-[#8A3FD3] bg-[#8A3FD3]/10":"text-[#1FA7E1] bg-[#1FA7E1]/10"),children:[e.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Validating..."]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[$a&&e.jsx(A,{type:"button",variant:"outline",onClick:Zt,disabled:N.status==="validating",className:"rounded-xl h-14 flex-1 sm:flex-none border-slate-300 hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800 font-bold px-6",children:m?"Cancel room":"Leave queue"}),e.jsx(A,{type:"button",onClick:La,disabled:N.status==="validating"||j||Kt,className:u("rounded-xl h-14 flex-1 px-8 font-black uppercase tracking-wide text-sm shadow-xl hover:scale-[1.02] active:scale-95 transition-all text-white border-0",l.mode==="online"?"bg-[#8A3FD3] hover:bg-[#7b35c0] shadow-[#8A3FD3]/40":"bg-[#1FA7E1] hover:bg-[#1a95c9] shadow-[#1FA7E1]/40"),children:N.status==="validating"?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(Ke,{className:"h-5 w-5 animate-spin"})," Starting..."]}):l.mode==="online"&&l.queueType==="private_room"?W.trim()?"Join Room":"Create Room":"Start Battle"})]})]})]})]})})]},"setup")}),e.jsx(ke,{value:"battle",className:"mt-0 outline-none",children:e.jsx(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:r?e.jsxs(pe,{className:u(fe,"rounded-[18px]"),children:[e.jsxs(he,{children:[e.jsxs(be,{className:"text-base flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2",children:[r.mode==="bot"?e.jsx(Te,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}):e.jsx(ge,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"vs ",r.opponentName]}),e.jsxs("div",{className:"inline-flex items-center gap-2",children:[ft,e.jsxs("span",{className:"text-sm font-bold tabular-nums",children:[r.scoreFor," - ",r.scoreAgainst]})]})]}),e.jsx(Ne,{className:"text-muted-foreground dark:text-[#b2bad0]",children:r.status==="completed"?`Completed in ${r.totalRounds} rounds.`:r.status==="ready"?r.mode==="online"?"Waiting for both players to confirm and start together.":"Finalizing practice bot session start.":`Round ${r.currentRound} of ${r.totalRounds}${F?" (paused for design)":""}`}),ca(r.lifecycle,n?.uid)&&e.jsx("p",{className:"text-xs font-medium text-muted-foreground dark:text-[#9aa4be]",children:ca(r.lifecycle,n?.uid)})]}),e.jsxs(Xe,{className:"space-y-4",children:[r.status==="ready"&&e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-4 dark:border-[#2f3547] dark:bg-[#11151d] flex flex-col gap-3",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:r.mode==="online"?"Waiting for both players to lock in start...":"Starting practice bot round..."}),r.mode==="online"&&r.expiresAtMs&&e.jsxs("p",{className:"text-xs font-medium text-muted-foreground dark:text-[#9aa4be]",children:["Public match expires in ",e.jsx("span",{className:"font-semibold tabular-nums",children:da(O)})," if the synchronized start does not happen."]}),e.jsx(A,{variant:"outline",size:"sm",className:"w-full text-rose-500 border-rose-200 hover:bg-rose-50 dark:border-rose-900 dark:hover:bg-rose-900/30",onClick:()=>{_(null),v(null),h(!1),b({status:"idle"}),d("setup")},children:"Force Cancel"})]}),r.status==="in_progress"&&r.currentQuestion&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl border border-border bg-muted/40 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Time left: ",e.jsxs("span",{className:"font-semibold tabular-nums",children:[P,"s"]}),F?" (paused)":""]}),F&&e.jsx("p",{className:"mt-1 text-[11px] font-medium text-amber-700 dark:text-amber-300",children:"Design pause keeps this battle screen static while you edit UI."})]}),e.jsx("p",{className:"text-lg font-bold text-foreground dark:text-[#f5f7fb]",children:r.currentQuestion.prompt}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:r.currentQuestion.choices.map((t,o)=>e.jsxs(A,{type:"button",variant:ve===o?"default":"outline",onClick:()=>X(o),disabled:G||Z||F,className:u("h-auto min-h-[48px] justify-start text-left font-medium px-4 py-3 rounded-xl whitespace-normal",ve===o?"ring-2 ring-primary ring-offset-2 dark:ring-offset-[#0B0F19]":""),children:[e.jsxs("span",{className:"mr-2 font-semibold",children:[String.fromCharCode(65+o),"."]}),t]},o))}),e.jsx("div",{className:"flex justify-end",children:e.jsx(A,{type:"button",onClick:()=>void Ve(ve),disabled:G||Z||F,className:"rounded-xl",children:F?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4"})," Paused for design"]}):G?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Submitting..."]}):Z?"Waiting for opponent...":"Lock Answer"})})]}),B&&e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:["Last round: ",B.studentCorrect?"Correct":"Incorrect"," · ",r.mode==="bot"?"Bot":"Opponent"," ",B.botCorrect?"Correct":"Incorrect"]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Correct option: ",String.fromCharCode(65+B.correctOptionIndex)]})]}),r.status==="completed"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:u("rounded-2xl border p-4",r.outcome==="win"?"border-emerald-300 bg-emerald-50 dark:border-emerald-400/40 dark:bg-emerald-900/20":r.outcome==="loss"?"border-rose-300 bg-rose-50 dark:border-rose-400/40 dark:bg-rose-900/20":"border-amber-300 bg-amber-50 dark:border-amber-400/40 dark:bg-amber-900/20"),children:[e.jsx("p",{className:"text-lg font-black tracking-wide text-foreground dark:text-[#ecf0fb]",children:r.outcome==="win"?"Victory!":r.outcome==="loss"?"Match Complete":"Draw Match"}),e.jsxs("p",{className:"mt-1 text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:["Final Score: ",r.scoreFor," - ",r.scoreAgainst]}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["XP Earned: +",r.xpBreakdown?.totalXPAwarded??r.xpEarned??0,r.xpBreakdown&&e.jsxs("span",{className:"block",children:["Base: +",r.xpBreakdown.baseMatchXP," + Performance: +",r.xpBreakdown.performanceXP]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(A,{type:"button",variant:"outline",onClick:()=>{_(null),v(null),h(!1),d("setup")},className:"rounded-xl",children:"Start New Match"}),r.mode==="bot"&&e.jsx(A,{type:"button",onClick:()=>void Xt(),disabled:G,className:"rounded-xl",children:"Rematch"})]})]})]})]}):m?e.jsxs(pe,{className:u(fe,"rounded-[18px]"),children:[e.jsxs(he,{children:[e.jsxs(be,{className:"text-base flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"Private Room Lobby"]}),e.jsxs(Ne,{className:"text-muted-foreground dark:text-[#b2bad0]",children:["Room ",m.roomCode," · ",m.participantCount,"/2 students connected."]})]}),e.jsx(Xe,{className:"space-y-3",children:e.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3 dark:border-[#2f3547] dark:bg-[#11151d]",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground dark:text-[#ecf0fb]",children:m.status==="ready"?"Opponent connected. Syncing start...":"Waiting for another student to join this room."}),e.jsxs("p",{className:"text-xs text-muted-foreground dark:text-[#9aa4be]",children:["Share room code ",m.roomCode," with your classmate."]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-end gap-2",children:[(m.status==="waiting"||m.status==="ready")&&e.jsx(A,{type:"button",variant:"outline",className:"h-8 rounded-lg",onClick:Zt,disabled:N.status==="validating",children:"Cancel room"}),e.jsxs(A,{type:"button",variant:"outline",className:"h-8 rounded-lg",onClick:()=>void Vt(m.roomCode),children:[R===m.roomCode?e.jsx(yt,{className:"h-4 w-4"}):e.jsx(aa,{className:"h-4 w-4"}),R===m.roomCode?"Copied":"Copy code"]})]})]})})]}):j?e.jsx(pe,{className:u(fe,"rounded-[18px]"),children:e.jsxs(he,{children:[e.jsxs(be,{className:"text-base flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"Public Matchmaking"]}),e.jsx(Ne,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Searching for a student with the same setup..."})]})}):e.jsx(pe,{className:u(fe,"rounded-[18px]"),children:e.jsxs(he,{children:[e.jsxs(be,{className:"text-base flex items-center gap-2",children:[e.jsx(wt,{className:"h-4 w-4 text-primary dark:text-[#9e8fff]"}),"No active battle"]}),e.jsx(Ne,{className:"text-muted-foreground dark:text-[#b2bad0]",children:"Start from Setup to create a bot match, private room, or public queue session."})]})})},"battle")}),e.jsx(ke,{value:"history",className:"mt-0 outline-none",children:e.jsxs(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:[e.jsxs(y.div,{className:"relative overflow-hidden rounded-[24px] mb-6 bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl",whileHover:{scale:1.01},transition:{type:"spring",stiffness:300,damping:20},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-emerald-500/10 via-teal-500/5 to-transparent"}),e.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 h-64 w-64 rounded-full bg-emerald-500/20 blur-3xl animate-orb-pulse"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-12 -left-12 h-40 w-40 rounded-full bg-teal-500/20 blur-2xl animate-orb-pulse-delayed"}),e.jsx("div",{className:"relative z-10 p-6 sm:p-8 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(A,{variant:"ghost",onClick:()=>d("hub"),className:"h-12 w-12 p-0 rounded-full bg-white/10 hover:bg-white/20 hover:scale-105 transition-all backdrop-blur-md border border-white/10 shadow-[0_0_15px_rgba(16,185,129,0.15)] shrink-0",children:e.jsx(Ue,{className:"h-6 w-6 rotate-180 text-emerald-300"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"flex items-center gap-3 text-3xl sm:text-4xl font-black tracking-tight text-white drop-shadow-md",children:[e.jsx("div",{className:"bg-emerald-500/20 p-2 rounded-2xl shadow-inner border border-emerald-500/30",children:e.jsxs("div",{className:"relative w-8 h-8 flex items-center justify-center",children:[e.jsx("div",{className:"absolute w-5 h-6 bg-emerald-500/30 border border-emerald-400/50 rounded-sm -rotate-12 translate-x-1 shadow-sm"}),e.jsx("div",{className:"absolute w-5 h-6 bg-teal-400/50 border border-teal-300/60 rounded-sm rotate-6 -translate-x-1 shadow-md backdrop-blur-sm"}),e.jsxs("div",{className:"absolute w-5 h-6 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-sm shadow-[0_0_15px_rgba(52,211,153,0.8)] z-10 flex flex-col items-center justify-center gap-[3px]",children:[e.jsx("div",{className:"w-2.5 h-[2px] bg-white/90 rounded-full"}),e.jsx("div",{className:"w-3 h-[2px] bg-white/90 rounded-full"}),e.jsx("div",{className:"w-2 h-[2px] bg-white/90 rounded-full"})]})]})}),"Matches History"]}),e.jsx("p",{className:"text-[12px] font-black text-white/60 mt-2 tracking-[0.1em] uppercase",children:"Review your past duels and track your progress."})]})]})})]}),e.jsxs("div",{className:"relative isolate w-full",children:[e.jsx("div",{className:"absolute top-[-10%] right-[-5%] w-[400px] h-[400px] bg-blue-500/20 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsx("div",{className:"absolute bottom-[-10%] left-[-5%] w-[350px] h-[350px] bg-teal-500/20 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsxs("div",{className:"rounded-[24px] bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl p-6 sm:p-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-xl font-black text-white tracking-wide leading-none drop-shadow-md",children:"Match History"}),e.jsx("p",{className:"text-sm font-semibold text-white/60 mt-2",children:"Your recent student battles only."})]}),e.jsx("div",{className:"flex gap-2 mb-6",children:[{value:"all",label:"All"},{value:"online",label:"Online"},{value:"bot",label:"Bot"}].map(t=>e.jsx(A,{type:"button",variant:"outline",onClick:()=>Ca(t.value),className:u("rounded-full h-9 px-5 border transition-all font-bold tracking-wide",we===t.value?"bg-emerald-500/20 border-emerald-500/50 text-emerald-300 shadow-[0_0_15px_rgba(16,185,129,0.2)]":"bg-white/5 border-white/10 text-white/70 hover:bg-white/10 hover:text-white"),children:t.label},t.value))}),e.jsx("div",{className:"space-y-4",children:Pt?e.jsxs("div",{className:"space-y-3",children:[e.jsx(xe,{className:"h-[76px] w-full rounded-2xl bg-white/5 border border-white/10"}),e.jsx(xe,{className:"h-[76px] w-full rounded-2xl bg-white/5 border border-white/10"})]}):Oe.length===0?e.jsx("p",{className:"text-sm text-white/50 py-4",children:"No matches in this filter yet."}):Oe.map(t=>{const o=t.outcome==="win",p=t.outcome==="loss";return e.jsxs("div",{className:"relative overflow-hidden rounded-[20px] bg-white/5 border border-white/10 p-5 flex items-center justify-between shadow-lg transition-all hover:bg-white/10 hover:shadow-xl",children:[e.jsx("div",{className:u("absolute inset-y-0 left-0 w-3/4 pointer-events-none z-0",o?"bg-gradient-to-r from-emerald-500/50 via-emerald-500/10 to-transparent":p?"bg-gradient-to-r from-rose-500/50 via-rose-500/10 to-transparent":"bg-gradient-to-r from-amber-500/50 via-amber-500/10 to-transparent")}),e.jsxs("div",{className:"relative z-10 pl-2",children:[e.jsxs("p",{className:"text-base sm:text-lg font-black text-white drop-shadow-md",children:["vs ",t.opponentName]}),e.jsxs("p",{className:"text-[13px] font-bold text-white/60 tabular-nums mt-0.5",children:[t.scoreFor,"-",t.scoreAgainst," ",e.jsx("span",{className:"mx-1",children:"•"})," ",t.accuracy.toFixed(0),"% ",e.jsx("span",{className:"mx-1",children:"•"})," +",t.xpEarned," XP"]})]}),e.jsx("div",{className:"relative z-10",children:e.jsx("span",{className:u("text-sm font-black uppercase tracking-[0.1em] rounded-full px-4 py-1.5 border shadow-sm",o?"text-emerald-300 border-emerald-500/30 bg-emerald-500/10 shadow-[0_0_15px_rgba(16,185,129,0.15)]":p?"text-rose-300 border-rose-500/30 bg-rose-500/10 shadow-[0_0_15px_rgba(244,63,94,0.15)]":"text-amber-300 border-amber-500/30 bg-amber-500/10 shadow-[0_0_15px_rgba(245,158,11,0.15)]"),children:Es(t.outcome)})})]},t.matchId)})})]})]})]},"history")}),e.jsx(ke,{value:"stats",className:"mt-0 outline-none",children:e.jsxs(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:[e.jsxs(y.div,{className:"relative overflow-hidden rounded-[24px] mb-6 bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl",whileHover:{scale:1.01},transition:{type:"spring",stiffness:300,damping:20},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-indigo-500/10 via-purple-500/5 to-transparent"}),e.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 h-64 w-64 rounded-full bg-indigo-500/20 blur-3xl animate-orb-pulse"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-12 -left-12 h-40 w-40 rounded-full bg-purple-500/20 blur-2xl animate-orb-pulse-delayed"}),e.jsx("div",{className:"relative z-10 p-6 sm:p-8 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(A,{variant:"ghost",onClick:()=>d("hub"),className:"h-12 w-12 p-0 rounded-full bg-white/10 hover:bg-white/20 hover:scale-105 transition-all backdrop-blur-md border border-white/10 shadow-[0_0_15px_rgba(99,102,241,0.15)] shrink-0",children:e.jsx(Ue,{className:"h-6 w-6 rotate-180 text-indigo-300"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"flex items-center gap-3 text-3xl sm:text-4xl font-black tracking-tight text-white drop-shadow-md",children:[e.jsx("div",{className:"bg-indigo-500/20 p-2 rounded-2xl shadow-inner border border-indigo-500/30 animate-icon-bob",children:e.jsxs("div",{className:"relative w-8 h-8 flex items-end justify-center gap-1 pb-1",children:[e.jsx("div",{className:"w-1.5 h-3 bg-indigo-300 rounded-t-[2px] shadow-[0_0_8px_rgba(165,180,252,0.8)]"}),e.jsx("div",{className:"w-1.5 h-6 bg-purple-400 rounded-t-[2px] shadow-[0_0_12px_rgba(192,132,252,0.9)]"}),e.jsx("div",{className:"w-1.5 h-4 bg-indigo-400 rounded-t-[2px] shadow-[0_0_8px_rgba(129,140,248,0.8)]"})]})}),"My Statistics"]}),e.jsx("p",{className:"text-[12px] font-black text-white/60 mt-2 tracking-[0.1em] uppercase",children:"Analyzing your battlefield performance."})]})]})})]}),e.jsxs("div",{className:"relative isolate w-full",children:[e.jsx("div",{className:"absolute top-[0%] left-[10%] w-[350px] h-[350px] bg-indigo-500/30 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsx("div",{className:"absolute bottom-[0%] right-[10%] w-[300px] h-[300px] bg-purple-500/30 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsx("div",{className:"rounded-[24px] bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl p-6 sm:p-8",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4 sm:gap-6",children:[{label:"WINS",value:ee?.wins??0,icon:gt,textColor:"text-rose-400",gradient:"radial-gradient(circle at 10% 90%, rgba(244,63,94,0.35) 0%, transparent 70%)"},{label:"CURRENT STREAK",value:ee?.currentStreak??0,icon:Je,textColor:"text-purple-400",gradient:"radial-gradient(circle at 10% 90%, rgba(168,85,247,0.35) 0%, transparent 70%)"},{label:"AVG ACCURACY",value:`${(ee?.averageAccuracy||0).toFixed(1)}%`,icon:At,textColor:"text-blue-400",gradient:"radial-gradient(circle at 10% 90%, rgba(59,130,246,0.35) 0%, transparent 70%)"},{label:"AVG RESPONSE",value:Fs(ee?.averageResponseMs||0),icon:sa,textColor:"text-teal-400",gradient:"radial-gradient(circle at 10% 90%, rgba(20,184,166,0.35) 0%, transparent 70%)"}].map(t=>e.jsxs("div",{className:"relative overflow-hidden rounded-[20px] bg-white/5 border border-white/10 shadow-lg min-h-[160px] flex flex-col justify-between p-6 transition-transform hover:scale-105",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none z-0 mix-blend-screen",style:{background:t.gradient}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("p",{className:u("text-[11px] font-black uppercase tracking-[0.15em] mb-3",t.textColor),children:t.label}),e.jsx("p",{className:"text-4xl sm:text-5xl font-black text-white tabular-nums tracking-tighter drop-shadow-md",children:t.value})]}),e.jsx("div",{className:"relative z-10 mt-6 flex justify-start",children:e.jsx(t.icon,{className:u("h-5 w-5 drop-shadow-md",t.textColor)})})]},t.label))})})]})]},"stats")}),e.jsx(ke,{value:"leaderboard",className:"mt-0 outline-none",children:e.jsxs(y.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},className:"space-y-4",children:[e.jsxs(y.div,{className:"relative overflow-hidden rounded-[24px] mb-6 bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl",whileHover:{scale:1.01},transition:{type:"spring",stiffness:300,damping:20},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-amber-500/10 via-orange-500/5 to-transparent"}),e.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 h-64 w-64 rounded-full bg-amber-500/20 blur-3xl animate-orb-pulse"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-12 -left-12 h-40 w-40 rounded-full bg-orange-500/20 blur-2xl animate-orb-pulse-delayed"}),e.jsx("div",{className:"relative z-10 p-6 sm:p-8 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(A,{variant:"ghost",onClick:()=>d("hub"),className:"h-12 w-12 p-0 rounded-full bg-white/10 hover:bg-white/20 hover:scale-105 transition-all backdrop-blur-md border border-white/10 shadow-[0_0_15px_rgba(245,158,11,0.15)] shrink-0",children:e.jsx(Ue,{className:"h-6 w-6 rotate-180 text-amber-300"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"flex items-center gap-3 text-3xl sm:text-4xl font-black tracking-tight text-white drop-shadow-md",children:[e.jsx(y.div,{animate:{scale:[1,1.1,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"bg-amber-500/20 p-2 rounded-2xl shadow-inner border border-amber-500/30",children:e.jsx(Jt,{className:"h-8 w-8 text-amber-400 drop-shadow-[0_0_12px_rgba(245,158,11,0.8)]"})}),"Hall of Fame"]}),e.jsx("p",{className:"text-[12px] font-black text-white/60 mt-2 tracking-[0.1em] uppercase",children:"The top-ranked minds across the globe."})]})]})})]}),e.jsxs("div",{className:"relative isolate w-full",children:[e.jsx("div",{className:"absolute top-[20%] left-[20%] w-[400px] h-[400px] bg-orange-500/20 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[350px] h-[350px] bg-pink-500/20 rounded-full blur-[120px] pointer-events-none -z-10"}),e.jsxs("div",{className:"rounded-[24px] bg-white/5 border border-white/10 shadow-2xl backdrop-blur-3xl p-6 sm:p-8",children:[e.jsxs("div",{className:"mb-8 flex items-start gap-3",children:[e.jsx(Jt,{className:"h-8 w-8 text-amber-400 drop-shadow-[0_0_12px_rgba(245,158,11,0.6)] shrink-0"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-white tracking-wide leading-none drop-shadow-md",children:"Hall of Fame"}),e.jsx("p",{className:"text-sm font-semibold text-white/60 mt-2",children:"Student-only ranking using trusted backend aggregates."})]})]}),Ia?e.jsxs("div",{className:"space-y-4",children:[e.jsx(xe,{className:"h-[80px] w-full rounded-2xl bg-white/5 border border-white/10"}),e.jsx(xe,{className:"h-[80px] w-full rounded-2xl bg-white/5 border border-white/10"}),e.jsx(xe,{className:"h-[80px] w-full rounded-2xl bg-white/5 border border-white/10"})]}):Yt.length===0?e.jsx("p",{className:"text-sm text-white/50",children:"No leaderboard entries yet. Finish a battle to place on the board."}):e.jsx("div",{className:"space-y-6",children:e.jsx("div",{className:"space-y-3",children:Yt.map(t=>e.jsxs("div",{className:u("relative overflow-hidden rounded-[20px] p-5 flex items-center justify-between shadow-lg transition-all hover:scale-[1.01] group",t.isSelf?"bg-amber-500/10 border border-amber-500/40 shadow-[0_0_20px_rgba(245,158,11,0.15)]":"bg-white/5 border border-white/10 hover:bg-white/10"),children:[t.isSelf&&e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-amber-500/20 to-transparent pointer-events-none -z-10"}),e.jsxs("div",{className:"relative z-10 flex flex-col gap-1.5",children:[e.jsxs("h4",{className:u("text-lg sm:text-xl font-black drop-shadow-md",t.isSelf?"text-amber-400":"text-white"),children:["#",t.rank," ",t.displayName,t.isSelf?" (You)":""]}),e.jsxs("p",{className:"text-[13px] font-bold text-white/60",children:["Win rate ",t.winRate.toFixed(1),"% ",e.jsx("span",{className:"mx-1",children:"•"})," Best streak ",t.bestStreak]})]}),e.jsx("div",{className:"relative z-10 text-xl sm:text-2xl font-black text-white tabular-nums drop-shadow-md",children:t.scoreLabel})]},t.userId))})})]})]})]},"leaderboard")})]})})})})]})};export{dr as default}; diff --git a/assets/RewardsModal-BADS4F50.js b/assets/RewardsModal-CfWUlD5I.js similarity index 98% rename from assets/RewardsModal-BADS4F50.js rename to assets/RewardsModal-CfWUlD5I.js index bd1912607129bbfdeb7a79d2cbaecb505c4275f2..bdf9f5ec7ff7c2f97f48a12400f9fbb0f90b621f 100644 --- a/assets/RewardsModal-BADS4F50.js +++ b/assets/RewardsModal-CfWUlD5I.js @@ -1 +1 @@ -import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as F,doc as S}from"./vendor-firebase-firestore-CNv3xXal.js";import{aQ as g,A as u,aR as U,aS as P,U as $,H as B,i as R,D as I,a1 as T,T as j,aT as q,a6 as N,R as H,V as L,a2 as M,$ as v,a7 as w,B as G,Z as X,r as Q,F as V,G as Z,b as K,aK as W,g as J}from"./index-Cvals0ud.js";import{X as O}from"./x-cRIR5BcS.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const Y={BookOpen:K,GraduationCap:Z,Trophy:V,Target:Q,Zap:X,Brain:G,Star:w,Flame:v,Swords:M,Shield:L,RefreshCw:H,Crown:N,Sun:q,TrendingUp:j,Globe:T,User:I,UserPlus:R,Calendar:B,Users:$,Compass:P,Heart:U,Award:u},me=({isOpen:o,onClose:c,userLevel:n,currentXP:x,xpToNextLevel:m,totalXP:p,userId:d})=>{const[y,b]=i.useState(!0),[k,_]=i.useState(new Set),[E,C]=i.useState({});i.useEffect(()=>{if(!o||!d)return;(async()=>{b(!0);try{const t=await W(d);_(new Set(t.map(a=>a.id)));const l=await F(S(J,"progress",d));l.exists()&&C(l.data())}catch(t){console.error("Error loading achievements:",t)}finally{b(!1)}})()},[o,d]);const D=s=>{const{condition:t,threshold:l}=s,a=E;let r=0,f=l??1;switch(t){case"lesson_complete":r=a.totalLessonsCompleted||0;break;case"quiz_complete":r=a.totalQuizzesCompleted||0;break;case"battle_win":case"battle_undefeated":r=a.battleWins||0;break;case"mastery_10":case"social_streak_30":case"social_daily_return":r=a.consecutiveDaysActive||0;break;case"mastery_xp":r=p;break;case"explore_friend_added":case"social_friend":case"explore_social":r=a.friendsAdded||0;break;case"perfect_score":{r=(a.quizAttempts||[]).filter(z=>z.score===100).length;break}default:return}return{progress:Math.min(r,f),total:f}},h=g.map(s=>{const t=Y[s.icon.name]??u,l=k.has(s.id),a=D(s);return{id:s.id,icon:t,title:s.title,description:s.description,progress:a?.progress,total:a?.total,unlocked:l,color:l?s.iconColor:"text-slate-500",bgColor:l?s.iconColor.replace("text-","bg-").replace("-500","/10").replace("-400","/10").replace("-600","/10"):"bg-slate-100"}}),A=h.filter(s=>s.unlocked).length;return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-2 sm:p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:c}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[90vh] sm:max-h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-4 md:p-6 text-white relative flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_14%_12%,rgba(251,150,187,0.35),transparent_42%),radial-gradient(circle_at_80%_80%,rgba(117,208,106,0.25),transparent_38%)]"}),e.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-display font-bold",children:"Rewards & Achievements"}),e.jsxs("p",{className:"text-white/90 text-sm font-body",children:[A," / ",g.length," Achievements Unlocked"]})]}),e.jsx("button",{onClick:c,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(O,{size:24})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 md:gap-3 relative z-10",children:[e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(N,{size:16,className:"text-[#FFB356]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Level"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:n})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(w,{size:16,className:"text-[#6ED1CF]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:p.toLocaleString()})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(v,{size:16,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Daily Rewards"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:"Check-in"})]})]}),e.jsxs("div",{className:"mt-4 relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n+1]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex justify-between items-center mb-1",children:e.jsxs("span",{className:"text-xs text-white/90",children:[x," / ",m," XP"]})}),e.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500 e-w",style:{"--w":`${x/m*100}%`}})})]})]})]}),e.jsx("div",{className:"p-4 md:p-6 overflow-y-auto flex-1",children:y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-[#9956DE] border-t-transparent rounded-full"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628] mb-4",children:"Achievements"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:h.map(s=>{const t=s.icon;return e.jsx("div",{className:`${s.unlocked?"bg-white border-[#9956DE]/25":"bg-[#edf1f7] border-[#dde3eb]"} border-2 rounded-xl p-4 transition-all ${s.unlocked?"shadow-md":"opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-12 h-12 ${s.bgColor} rounded-xl flex items-center justify-center flex-shrink-0`,children:e.jsx(t,{size:24,className:s.color})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:`text-sm font-bold ${s.unlocked?"text-[#0a1628]":"text-slate-500"} font-body`,children:s.title}),s.unlocked&&e.jsx("span",{className:"px-2 py-0.5 bg-[#75D06A] text-white text-[9px] font-bold rounded-full",children:"Unlocked"})]}),e.jsx("p",{className:`text-xs ${s.unlocked?"text-[#5a6578]":"text-slate-500"} mb-2`,children:s.description}),s.progress!==void 0&&s.total!==void 0&&!s.unlocked&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-[10px] text-slate-500",children:"Progress"}),e.jsxs("span",{className:"text-[10px] font-bold text-[#5a6578]",children:[s.progress," / ",s.total]})]}),e.jsx("div",{className:"h-1.5 bg-[#dde3eb] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#7274ED] to-[#1FA7E1] rounded-full transition-all e-w",style:{"--w":`${s.progress/s.total*100}%`}})})]})]})]})},s.id)})})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:e.jsx(j,{size:16,className:"text-white"})}),e.jsx("h3",{className:"text-base font-display font-bold text-[#0a1628]",children:"How to Earn XP"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[{activity:"Complete a video lesson",xp:50},{activity:"Complete exercises",xp:100},{activity:"Perfect quiz score",xp:150},{activity:"Finish a quiz",xp:75},{activity:"Daily check-in",xp:"20-100"}].map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-[#1FA7E1] rounded-full"}),e.jsxs("span",{className:"text-xs text-[#5a6578] font-body",children:[s.activity,":"]}),e.jsxs("span",{className:"text-xs font-bold text-[#7274ED]",children:["+",s.xp," XP"]})]},t))})]})]})})]})]}):null};export{me as default}; +import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as F,doc as S}from"./vendor-firebase-firestore-CNv3xXal.js";import{aQ as g,A as u,aR as U,aS as P,U as $,H as B,i as R,D as I,a1 as T,T as j,aT as q,a6 as N,R as H,V as L,a2 as M,$ as v,a7 as w,B as G,Z as X,r as Q,F as V,G as Z,b as K,aK as W,g as J}from"./index-D9TvEOZX.js";import{X as O}from"./x-DM8tXF3P.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const Y={BookOpen:K,GraduationCap:Z,Trophy:V,Target:Q,Zap:X,Brain:G,Star:w,Flame:v,Swords:M,Shield:L,RefreshCw:H,Crown:N,Sun:q,TrendingUp:j,Globe:T,User:I,UserPlus:R,Calendar:B,Users:$,Compass:P,Heart:U,Award:u},me=({isOpen:o,onClose:c,userLevel:n,currentXP:x,xpToNextLevel:m,totalXP:p,userId:d})=>{const[y,b]=i.useState(!0),[k,_]=i.useState(new Set),[E,C]=i.useState({});i.useEffect(()=>{if(!o||!d)return;(async()=>{b(!0);try{const t=await W(d);_(new Set(t.map(a=>a.id)));const l=await F(S(J,"progress",d));l.exists()&&C(l.data())}catch(t){console.error("Error loading achievements:",t)}finally{b(!1)}})()},[o,d]);const D=s=>{const{condition:t,threshold:l}=s,a=E;let r=0,f=l??1;switch(t){case"lesson_complete":r=a.totalLessonsCompleted||0;break;case"quiz_complete":r=a.totalQuizzesCompleted||0;break;case"battle_win":case"battle_undefeated":r=a.battleWins||0;break;case"mastery_10":case"social_streak_30":case"social_daily_return":r=a.consecutiveDaysActive||0;break;case"mastery_xp":r=p;break;case"explore_friend_added":case"social_friend":case"explore_social":r=a.friendsAdded||0;break;case"perfect_score":{r=(a.quizAttempts||[]).filter(z=>z.score===100).length;break}default:return}return{progress:Math.min(r,f),total:f}},h=g.map(s=>{const t=Y[s.icon.name]??u,l=k.has(s.id),a=D(s);return{id:s.id,icon:t,title:s.title,description:s.description,progress:a?.progress,total:a?.total,unlocked:l,color:l?s.iconColor:"text-slate-500",bgColor:l?s.iconColor.replace("text-","bg-").replace("-500","/10").replace("-400","/10").replace("-600","/10"):"bg-slate-100"}}),A=h.filter(s=>s.unlocked).length;return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-2 sm:p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:c}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[90vh] sm:max-h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-4 md:p-6 text-white relative flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_14%_12%,rgba(251,150,187,0.35),transparent_42%),radial-gradient(circle_at_80%_80%,rgba(117,208,106,0.25),transparent_38%)]"}),e.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-display font-bold",children:"Rewards & Achievements"}),e.jsxs("p",{className:"text-white/90 text-sm font-body",children:[A," / ",g.length," Achievements Unlocked"]})]}),e.jsx("button",{onClick:c,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(O,{size:24})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 md:gap-3 relative z-10",children:[e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(N,{size:16,className:"text-[#FFB356]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Level"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:n})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(w,{size:16,className:"text-[#6ED1CF]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:p.toLocaleString()})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(v,{size:16,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Daily Rewards"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:"Check-in"})]})]}),e.jsxs("div",{className:"mt-4 relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n+1]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex justify-between items-center mb-1",children:e.jsxs("span",{className:"text-xs text-white/90",children:[x," / ",m," XP"]})}),e.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500 e-w",style:{"--w":`${x/m*100}%`}})})]})]})]}),e.jsx("div",{className:"p-4 md:p-6 overflow-y-auto flex-1",children:y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-[#9956DE] border-t-transparent rounded-full"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628] mb-4",children:"Achievements"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:h.map(s=>{const t=s.icon;return e.jsx("div",{className:`${s.unlocked?"bg-white border-[#9956DE]/25":"bg-[#edf1f7] border-[#dde3eb]"} border-2 rounded-xl p-4 transition-all ${s.unlocked?"shadow-md":"opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-12 h-12 ${s.bgColor} rounded-xl flex items-center justify-center flex-shrink-0`,children:e.jsx(t,{size:24,className:s.color})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:`text-sm font-bold ${s.unlocked?"text-[#0a1628]":"text-slate-500"} font-body`,children:s.title}),s.unlocked&&e.jsx("span",{className:"px-2 py-0.5 bg-[#75D06A] text-white text-[9px] font-bold rounded-full",children:"Unlocked"})]}),e.jsx("p",{className:`text-xs ${s.unlocked?"text-[#5a6578]":"text-slate-500"} mb-2`,children:s.description}),s.progress!==void 0&&s.total!==void 0&&!s.unlocked&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-[10px] text-slate-500",children:"Progress"}),e.jsxs("span",{className:"text-[10px] font-bold text-[#5a6578]",children:[s.progress," / ",s.total]})]}),e.jsx("div",{className:"h-1.5 bg-[#dde3eb] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#7274ED] to-[#1FA7E1] rounded-full transition-all e-w",style:{"--w":`${s.progress/s.total*100}%`}})})]})]})]})},s.id)})})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:e.jsx(j,{size:16,className:"text-white"})}),e.jsx("h3",{className:"text-base font-display font-bold text-[#0a1628]",children:"How to Earn XP"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[{activity:"Complete a video lesson",xp:50},{activity:"Complete exercises",xp:100},{activity:"Perfect quiz score",xp:150},{activity:"Finish a quiz",xp:75},{activity:"Daily check-in",xp:"20-100"}].map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-[#1FA7E1] rounded-full"}),e.jsxs("span",{className:"text-xs text-[#5a6578] font-body",children:[s.activity,":"]}),e.jsxs("span",{className:"text-xs font-bold text-[#7274ED]",children:["+",s.xp," XP"]})]},t))})]})]})})]})]}):null};export{me as default}; diff --git a/assets/RightSidebar-DwQhbcAS.js b/assets/RightSidebar-rcM5VnyM.js similarity index 97% rename from assets/RightSidebar-DwQhbcAS.js rename to assets/RightSidebar-rcM5VnyM.js index 93b53ee274722a88e3b42c1e2fb286b08acca3e0..70af6a260ec13b1fc4b493e3047d588b450f80a5 100644 --- a/assets/RightSidebar-DwQhbcAS.js +++ b/assets/RightSidebar-rcM5VnyM.js @@ -1 +1 @@ -import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{q as S}from"./quiz_battle_avatar-BXHPSput.js";import{h as q,m as c,Z as _,a2 as B,a5 as P,F as W,a6 as v,a7 as X,q as Y,D as k}from"./index-Cvals0ud.js";import{C as M}from"./circle-check-big-6fwaSN-C.js";import{T as O,a as Z,b as H}from"./tooltip-ERqatgcd.js";import{C as T}from"./chevron-right-DMwHUP8W.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const E=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(B,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Topic Explorer",subtitle:"Dive into a new math topic today",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx(_,{size:24,className:"text-white"}),buttonText:"Explore",actionType:"explore",avatarText:"Knowledge is power!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],J=({onNavigateToQuizBattle:s,userPhoto:a})=>{const[x,m]=o.useState(0);o.useEffect(()=>{const r=setInterval(()=>{m(l=>(l+1)%E.length)},5e3);return()=>clearInterval(r)},[]);const t=E[x];return e.jsx("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(q,{mode:"wait",children:e.jsxs(c.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:S,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:r=>{r.stopPropagation(),t.actionType==="quiz-battle"&&s&&s()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[a?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:a,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(_,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})})})},K=s=>{if(s>=1e3){const a=s/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${s}`},G=({entry:s,rank:a,isYou:x,userPhoto:m,rankColor:t})=>{const r=x?s?.photo||m:s?.photo,l=x?"You":s?.name||"---",h=s?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(c.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(v,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${t.border} z-10 relative overflow-hidden ${t.shadow} bg-white`,children:r?e.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${t.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:l}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${t.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[K(h)," XP"]})]})]})},ce=({currentUserId:s,onOpenRewards:a,onOpenLeaderboard:x,onNavigateToModules:m,onNavigateToQuizBattle:t,userLevel:r,userPhoto:l,currentXP:h,xpToNextLevel:f})=>{const N=h/f*100,[$,D]=o.useState([]),[F,u]=o.useState(!0),[y,g]=o.useState(null),p=o.useRef(null),n=o.useRef(null);o.useEffect(()=>{if(!s){u(!1);return}u(!0),g(null);const d=P(b=>{D(b),u(!1),g(null),n.current&&(clearTimeout(n.current),n.current=null)},s,!1,"all",3);return p.current=d,n.current=setTimeout(()=>{u(!1),g("Leaderboard data unavailable")},15e3),()=>{n.current&&(clearTimeout(n.current),n.current=null),p.current&&(p.current(),p.current=null)}},[s]);const i=$.slice(0,3);i.some(d=>d.userId===s);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],A=["74px","54px","38px"],L=["w-[78px]","w-[70px]","w-[70px]"],w=(d,b,C,R,j)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(G,{entry:d,rank:C,isYou:R==="You",userPhoto:l,rankColor:z[j]}),e.jsxs(c.div,{initial:{height:0},animate:{height:A[b]},transition:{delay:.2+b*.1,duration:.5,ease:"easeOut"},className:`${L[b]} bg-gradient-to-b ${z[j].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${j===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:C}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(W,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(T,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(v,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs("button",{onClick:d=>{d.stopPropagation(),m?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(X,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[h," XP"]})]})}),e.jsx(H,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(N),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(c.div,{initial:{width:0},animate:{width:`${N}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(J,{onNavigateToQuizBattle:t,userPhoto:l})}),e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:x,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(v,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(T,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:F?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(Y,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):y||i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:y||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[w(i[1],1,2,i[1]?.name||"---",1),w(i[0],0,1,i[0]?.name||"---",0),w(i[2],2,3,i[2]?.name||"---",2)]})})]})]})};export{ce as default}; +import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{q as S}from"./quiz_battle_avatar-BXHPSput.js";import{h as q,m as c,Z as _,a2 as B,a5 as P,F as W,a6 as v,a7 as X,q as Y,D as k}from"./index-D9TvEOZX.js";import{C as M}from"./circle-check-big-yn5lhjQR.js";import{T as O,a as Z,b as H}from"./tooltip-B9-3_gHy.js";import{C as T}from"./chevron-right-Jv12kepm.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const E=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(B,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Topic Explorer",subtitle:"Dive into a new math topic today",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx(_,{size:24,className:"text-white"}),buttonText:"Explore",actionType:"explore",avatarText:"Knowledge is power!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],J=({onNavigateToQuizBattle:s,userPhoto:a})=>{const[x,m]=o.useState(0);o.useEffect(()=>{const r=setInterval(()=>{m(l=>(l+1)%E.length)},5e3);return()=>clearInterval(r)},[]);const t=E[x];return e.jsx("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(q,{mode:"wait",children:e.jsxs(c.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:S,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:r=>{r.stopPropagation(),t.actionType==="quiz-battle"&&s&&s()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[a?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:a,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(_,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})})})},K=s=>{if(s>=1e3){const a=s/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${s}`},G=({entry:s,rank:a,isYou:x,userPhoto:m,rankColor:t})=>{const r=x?s?.photo||m:s?.photo,l=x?"You":s?.name||"---",h=s?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(c.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(v,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${t.border} z-10 relative overflow-hidden ${t.shadow} bg-white`,children:r?e.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${t.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:l}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${t.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[K(h)," XP"]})]})]})},ce=({currentUserId:s,onOpenRewards:a,onOpenLeaderboard:x,onNavigateToModules:m,onNavigateToQuizBattle:t,userLevel:r,userPhoto:l,currentXP:h,xpToNextLevel:f})=>{const N=h/f*100,[$,D]=o.useState([]),[F,u]=o.useState(!0),[y,g]=o.useState(null),p=o.useRef(null),n=o.useRef(null);o.useEffect(()=>{if(!s){u(!1);return}u(!0),g(null);const d=P(b=>{D(b),u(!1),g(null),n.current&&(clearTimeout(n.current),n.current=null)},s,!1,"all",3);return p.current=d,n.current=setTimeout(()=>{u(!1),g("Leaderboard data unavailable")},15e3),()=>{n.current&&(clearTimeout(n.current),n.current=null),p.current&&(p.current(),p.current=null)}},[s]);const i=$.slice(0,3);i.some(d=>d.userId===s);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],A=["74px","54px","38px"],L=["w-[78px]","w-[70px]","w-[70px]"],w=(d,b,C,R,j)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(G,{entry:d,rank:C,isYou:R==="You",userPhoto:l,rankColor:z[j]}),e.jsxs(c.div,{initial:{height:0},animate:{height:A[b]},transition:{delay:.2+b*.1,duration:.5,ease:"easeOut"},className:`${L[b]} bg-gradient-to-b ${z[j].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${j===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:C}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(W,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(T,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(v,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs("button",{onClick:d=>{d.stopPropagation(),m?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(X,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[h," XP"]})]})}),e.jsx(H,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(N),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(c.div,{initial:{width:0},animate:{width:`${N}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(J,{onNavigateToQuizBattle:t,userPhoto:l})}),e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:x,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(v,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(T,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:F?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(Y,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):y||i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:y||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[w(i[1],1,2,i[1]?.name||"---",1),w(i[0],0,1,i[0]?.name||"---",0),w(i[2],2,3,i[2]?.name||"---",2)]})})]})]})};export{ce as default}; diff --git a/assets/ScientificCalculator-BU0JSvVT.js b/assets/ScientificCalculator-DPFBENLI.js similarity index 98% rename from assets/ScientificCalculator-BU0JSvVT.js rename to assets/ScientificCalculator-DPFBENLI.js index 32fd5c2244a2cfa3f2537525d703b3c7e749276e..a152461fbfdaf5a80d222ea1efca8f84948f2789 100644 --- a/assets/ScientificCalculator-BU0JSvVT.js +++ b/assets/ScientificCalculator-DPFBENLI.js @@ -1,4 +1,4 @@ -import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{e as Z,n as de,h as U,m as ue}from"./index-Cvals0ud.js";import{a as fe,C as pe}from"./chevron-up-CzNRBnCs.js";import{X as be}from"./x-cRIR5BcS.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/** +import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{e as Z,n as de,h as U,m as ue}from"./index-D9TvEOZX.js";import{a as fe,C as pe}from"./chevron-up-C5341jJ8.js";import{X as be}from"./x-DM8tXF3P.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SettingsModal-BN7tm0SJ.js b/assets/SettingsModal-D8CZHr4j.js similarity index 96% rename from assets/SettingsModal-BN7tm0SJ.js rename to assets/SettingsModal-D8CZHr4j.js index 98204f86985b8a1314d19ec593d11bb5189bad49..83f0b23f66d58add89c41d00533668058063a2a5 100644 --- a/assets/SettingsModal-BN7tm0SJ.js +++ b/assets/SettingsModal-D8CZHr4j.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cvals0ud.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css"])))=>i.map(i=>d[i]); -import{e as U,u as Me,aV as Le,aW as De,aX as qe,aY as Ie,aZ as Fe,a_ as Ve,D as Oe,V as He,a1 as Ge,b as Ue,h as $e,m as H,L as Be,F as Xe,a2 as Ye,$ as Qe,_ as G,j as d,a$ as We,aU as Je,b0 as Ke,b1 as Ze,b2 as es}from"./index-Cvals0ud.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{S as ss,a as ts,b as as,c as ns,d as te}from"./select-ClqEN5GF.js";import{B as p}from"./button-CanHmtQ3.js";import{I as n}from"./input-D6YjrCkj.js";import{S as x}from"./switch-BfAF8D2j.js";import je from"./ConfirmModal-CzN8U1r6.js";import{P as is,M as rs,V as ls}from"./ProfilePictureUploader-BLdgrysh.js";import{B as ge}from"./bell-oitWfCwK.js";import{D as ve}from"./download-BJi3JOJ-.js";import{X as Ne}from"./x-cRIR5BcS.js";import{C as cs}from"./circle-help-Bpd0FWyO.js";import{G as os}from"./gift-NZiFoj7A.js";import{C as ds}from"./chart-column-NTUNS-L9.js";import{M as xs}from"./megaphone-BGcgznHr.js";import{C as ms}from"./clock-BsCO0o69.js";import{T as hs}from"./trash-2-DaNTdmd2.js";import{E as us,a as bs}from"./eye-gVkJiC2f.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-CzNRBnCs.js";import"./check-BVDfRV4g.js";import"./log-out-CKjuia0o.js";import"./minus-XCv3x7RR.js";import"./plus-DUNZAuOT.js";import"./upload-CEq77VjR.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css"])))=>i.map(i=>d[i]); +import{e as U,u as Me,aV as Le,aW as De,aX as qe,aY as Ie,aZ as Fe,a_ as Ve,D as Oe,V as He,a1 as Ge,b as Ue,h as $e,m as H,L as Be,F as Xe,a2 as Ye,$ as Qe,_ as G,j as d,a$ as We,aU as Je,b0 as Ke,b1 as Ze,b2 as es}from"./index-D9TvEOZX.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{S as ss,a as ts,b as as,c as ns,d as te}from"./select-C0r1OjMk.js";import{B as p}from"./button-DC8Fz5kC.js";import{I as n}from"./input-7k8DpmeH.js";import{S as x}from"./switch-CJKtscrK.js";import je from"./ConfirmModal-bHzo3ssd.js";import{P as is,M as rs,V as ls}from"./ProfilePictureUploader-CvsZs9bx.js";import{B as ge}from"./bell-Ci_PX33B.js";import{D as ve}from"./download-BC34EYX_.js";import{X as Ne}from"./x-DM8tXF3P.js";import{C as cs}from"./circle-help-BNf4DSN0.js";import{G as os}from"./gift-Cuw3Q8xP.js";import{C as ds}from"./chart-column-BwIV9b12.js";import{M as xs}from"./megaphone-Bl3_WN0I.js";import{C as ms}from"./clock-BPtF2Ddk.js";import{T as hs}from"./trash-2-BYUCk-BO.js";import{E as us,a as bs}from"./eye-C42pNDm-.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-C5341jJ8.js";import"./check-Ceq9J6wq.js";import"./log-out-Bh-BcVV5.js";import"./minus-VA5XFKbP.js";import"./plus-BO4Ob0HD.js";import"./upload-OtZe8H1o.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. @@ -19,4 +19,4 @@ import{e as U,u as Me,aV as Le,aW as De,aX as qe,aY as Ie,aZ as Fe,a_ as Ve,D as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ns=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ks=U("smartphone",Ns),ws=()=>{const{userProfile:m,userRole:y}=Me(),[r,z]=a.useState(Le),[R,_]=a.useState(De),[k,T]=a.useState(!1),[D,E]=a.useState(null);a.useEffect(()=>{if(!m?.uid)return;(async()=>{T(!0),E(null);try{if(y==="teacher"){const u=await Fe(m.uid);z(u)}if(y==="admin"){const u=await Ve();_(u)}}catch(u){E(u instanceof Error?u.message:"Failed to load settings")}finally{T(!1)}})()},[m?.uid,y]);const o=a.useCallback(async g=>{if(!m?.uid)return;const u=await qe(m.uid,g);z(u)},[m?.uid]),M=a.useCallback(async g=>{const u=await Ie(g);_(u)},[]);return{teacherPrefs:r,adminConfig:R,loading:k,error:D,saveTeacherPrefs:o,saveAdminConfig:M}},ae=()=>JSON.parse(JSON.stringify(We)),rt=({isOpen:m,onClose:y,profileData:r,onSave:z,settingsData:R,onSaveSettings:_,onApplySettingsPreview:k,onExportData:T,onClearCache:D,onResetData:E})=>{const o=r?.role||"student",{teacherPrefs:M,adminConfig:g,saveTeacherPrefs:u,saveAdminConfig:ke}=ws(),[b,ne]=a.useState("account"),[l,h]=a.useState({}),[i,ie]=a.useState(ae()),[w,C]=a.useState(M),[j,$]=a.useState(g),[B,re]=a.useState(!1),[q,le]=a.useState(!1),[X,ce]=a.useState(!1),[Y,oe]=a.useState(!1),[de,Cs]=a.useState(!1),[we,I]=a.useState(!1),[Ce,F]=a.useState(!1),[Se,P]=a.useState(!1),[L,xe]=a.useState(""),[f,Ae]=a.useState(null),[v,me]=a.useState(!1),[Q,he]=a.useState(!1),[W,ue]=a.useState(""),[V,be]=a.useState(""),J=a.useRef(!1),K=a.useRef(ae());a.useEffect(()=>{if(!m){J.current=!1;return}if(J.current)return;J.current=!0;const s=R?JSON.parse(JSON.stringify(R)):ae();K.current=s,h({uid:r?.uid,name:r?.name||"",email:r?.email||"",phone:r?.phone||"",photo:r?.photo||"",avatarLayers:r?.avatarLayers,role:r?.role,gender:r?.gender,lrn:r?.lrn||"",grade:r?.grade||"",section:r?.section||"",school:r?.school||"",department:r?.department||"",subject:r?.subject||"",yearsOfExperience:r?.yearsOfExperience||"",qualification:r?.qualification||"",position:r?.position||""}),ie(s),C(M),$(g)},[m,r,R,M,g]),a.useEffect(()=>{m&&k?.(i)},[m,i,k]),a.useEffect(()=>{if(!m)return;const s=t=>{t.key==="Escape"&&(k?.(K.current),y())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[m,y,k]);const Z=a.useMemo(()=>{const s=[{id:"account",label:"Account",icon:Oe},{id:"notifications",label:"Notifications",icon:ge},{id:"appearance",label:"Appearance",icon:js}];return o==="student"&&(s.push({id:"privacy",label:"Privacy & Security",icon:He}),s.push({id:"learning",label:"Learning",icon:Ge})),o==="teacher"&&s.push({id:"teaching",label:"Teaching",icon:Ue}),o==="admin"&&s.push({id:"system",label:"System",icon:vs}),s.push({id:"data",label:"Data & Storage",icon:ve}),s},[o]),c=s=>{ie(t=>s(t))},ee=s=>{Ae(s),xe(""),he(!1),s==="password"&&ue(""),s==="email"&&be(l.email||""),P(!0)},fe=async()=>{if(!L.trim()){d.error("Current password is required");return}me(!0);try{if(f==="password"){if(W.length<8){d.error("New password must be at least 8 characters");return}await Ke(L,W),d.success("Password updated")}else if(f==="email"){if(!V.includes("@")){d.error("Enter a valid email");return}await Ze(L,V),h(s=>({...s,email:V})),d.success("Email updated")}else if(f==="delete"){await es(L,l.uid||""),d.success("Account deleted"),y();return}P(!1)}catch(s){d.error(s instanceof Error?s.message:"Authentication failed")}finally{me(!1)}},Ee=async()=>{const s=Je({name:l.name,phone:l.phone});if(s){d.error(s);return}re(!0);try{z&&await z(l),_&&await _(i),o==="teacher"&&await u(w),o==="admin"&&await ke(j),y()}catch(t){d.error(t instanceof Error?t.message:"Failed to save settings")}finally{re(!1)}},se=()=>{P(!1),I(!1),F(!1),k?.(K.current),y()},Pe=async()=>{if(!(!T||X)){ce(!0);try{await T()}catch(s){d.error(s instanceof Error?s.message:"Failed to export data")}finally{ce(!1)}}},ze=async()=>{if(!(!D||Y)){oe(!0);try{await D()}catch(s){d.error(s instanceof Error?s.message:"Failed to clear cache")}finally{oe(!1)}}},Re=async()=>{if(!(!E||q)){I(!1),le(!0);try{await E(),d.success("Testing data reset completed")}catch(s){d.error(s instanceof Error?s.message:"Failed to reset testing data")}finally{le(!1)}}},_e=()=>{F(!1),ee("delete")};return m?e.jsx($e,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-end sm:items-center justify-center sm:p-4",children:[e.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:se,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(H.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-t-2xl sm:rounded-2xl shadow-2xl border border-[#dde3eb] w-full sm:max-w-4xl h-[92vh] sm:max-h-[85vh] overflow-hidden flex flex-col sm:flex-row",children:[e.jsxs("div",{className:"hidden sm:flex w-64 flex-shrink-0 bg-slate-50 border-r border-slate-200 flex-col p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${b===s.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(t,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"sm:hidden flex items-center border-b border-[#dde3eb] bg-slate-50 overflow-x-auto no-scrollbar px-2",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`flex flex-col items-center gap-0.5 px-3 py-2.5 shrink-0 text-xs font-medium border-b-2 transition-colors ${b===s.id?"border-sky-600 text-sky-700":"border-transparent text-slate-500"}`,children:[e.jsx(t,{size:16}),e.jsx("span",{className:"whitespace-nowrap",children:s.label})]},s.id)})}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-base sm:text-lg font-display font-bold text-[#0a1628]",children:Z.find(s=>s.id===b)?.label}),e.jsx("button",{onClick:se,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(Ne,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:[b==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(is,{uid:l.uid,photoURL:l.photo,displayName:l.name,onUploaded:s=>h(t=>({...t,photo:s}))}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(n,{type:"text",value:l.name||"",onChange:s=>h(t=>({...t,name:s.target.value})),maxLength:100,autoComplete:"name",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsxs("div",{className:"flex items-center gap-2 max-w-md",children:[e.jsx(n,{type:"email",value:l.email||"",disabled:!0,className:"flex-1 bg-slate-100"}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>ee("email"),children:"Change"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(n,{type:"tel",value:l.phone||"",onChange:s=>h(t=>({...t,phone:s.target.value})),maxLength:20,inputMode:"tel",autoComplete:"tel",pattern:"^\\+?[0-9 ()\\-.]{7,20}$",placeholder:"+63 912 345 6789",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Gender"}),e.jsxs(ss,{value:l.gender||"",onValueChange:s=>h(t=>({...t,gender:s})),children:[e.jsx(ts,{className:"max-w-md bg-white border-[#dde3eb] rounded-lg",children:e.jsx(as,{placeholder:"Select gender (optional)"})}),e.jsxs(ns,{children:[e.jsx(te,{value:"male",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]})}),e.jsx(te,{value:"female",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ls,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]})}),e.jsx(te,{value:"prefer_not_to_say",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]})})]})]})]}),o==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"LRN"}),e.jsx(n,{value:l.lrn||"",onChange:s=>h(t=>({...t,lrn:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(n,{value:l.grade||"",onChange:s=>h(t=>({...t,grade:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(n,{value:l.section||"",onChange:s=>h(t=>({...t,section:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(n,{value:l.school||"",onChange:s=>h(t=>({...t,school:s.target.value})),className:"max-w-md"})]})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(n,{value:l.department||"",onChange:s=>h(t=>({...t,department:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(n,{value:l.subject||"",onChange:s=>h(t=>({...t,subject:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(n,{value:l.yearsOfExperience||"",onChange:s=>h(t=>({...t,yearsOfExperience:s.target.value})),className:"max-w-md"})]})]}),o==="admin"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(n,{value:l.position||"",onChange:s=>h(t=>({...t,position:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(p,{variant:"outline",className:"rounded-xl",onClick:()=>ee("password"),children:[e.jsx(Be,{size:16,className:"mr-2"}),"Update Password"]})]})]}),b==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(x,{checked:i.notifications.pushNotifications,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,pushNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(x,{checked:i.notifications.soundEnabled,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,soundEnabled:s}}))})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Submissions"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify when students submit work"})]}),e.jsx(x,{checked:w.notifyOnSubmission,onCheckedChange:s=>C(t=>({...t,notifyOnSubmission:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Activity Alerts"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify on at-risk student activity"})]}),e.jsx(x,{checked:w.notifyOnStudentActivity,onCheckedChange:s=>C(t=>({...t,notifyOnStudentActivity:s}))})]})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),e.jsx("div",{className:"space-y-3",children:[{key:"quizReminders",label:"Quiz Reminders"},{key:"newContent",label:"New Content"},{key:"achievements",label:"Achievements"},{key:"streakAlerts",label:"Streak Alerts"},{key:"weeklySummary",label:"Weekly Summary"}].map(s=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i.notifications.notificationTypes[s.key],onChange:t=>c(N=>({...N,notifications:{...N.notifications,notificationTypes:{...N.notifications.notificationTypes,[s.key]:t.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:s.label})]},s.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Push Notification Categories"}),e.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Choose which kinds of pushes you want to receive on this device."}),e.jsxs("div",{className:"flex items-center justify-between py-2 mb-2 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h5",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Enable Push (master)"}),e.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Turn off to silence ALL push categories."})]}),e.jsx(x,{checked:i.pushPreferences.pushEnabled,onCheckedChange:s=>c(t=>({...t,pushPreferences:{...t.pushPreferences,pushEnabled:s}}))})]}),e.jsx("div",{className:"space-y-2",children:[{key:"achievement",label:"Achievements unlocked",icon:Xe},{key:"quiz_battle",label:"Quiz battle invites & results",icon:Ye},{key:"daily_reward",label:"Daily reward reminders",icon:os},{key:"assignment",label:"New assignments / deadlines",icon:ps},{key:"streak_reminder",label:"Streak reminders",icon:Qe},{key:"leaderboard",label:"Leaderboard updates",icon:ds},{key:"system",label:"System announcements",icon:xs}].map(s=>{const t=s.key,N=s.icon;return e.jsxs("label",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"text-sm text-[#0a1628] font-body flex items-center gap-2",children:[e.jsx(N,{className:"h-4 w-4 text-[#6c47ff]"}),s.label]}),e.jsx(x,{checked:!!i.pushPreferences[t],onCheckedChange:pe=>c(O=>({...O,pushPreferences:{...O.pushPreferences,[s.key]:pe}})),disabled:!i.pushPreferences.pushEnabled&&t!=="pushEnabled"})]},s.key)})}),e.jsx("div",{className:"mt-4",children:e.jsxs(p,{type:"button",variant:"outline",size:"sm",onClick:async()=>{try{const{requestPushPermissionAndRegister:s}=await G(async()=>{const{requestPushPermissionAndRegister:S}=await import("./index-Cvals0ud.js").then(A=>A.b8);return{requestPushPermissionAndRegister:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),{auth:t}=await G(async()=>{const{auth:S}=await import("./index-Cvals0ud.js").then(A=>A.b6);return{auth:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),N=t.currentUser?.uid;if(!N){d.error("You must be signed in to test push notifications.");return}if(!await s(N)){d.error("Push setup failed. Check that VITE_FIREBASE_VAPID_KEY is configured and notifications are allowed.");return}const{httpsCallable:O}=await G(async()=>{const{httpsCallable:S}=await import("./vendor-firebase-core-D7GXCeNu.js").then(A=>A.a9);return{httpsCallable:S}},[]),{cloudFunctions:Te}=await G(async()=>{const{cloudFunctions:S}=await import("./index-Cvals0ud.js").then(A=>A.b6);return{cloudFunctions:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),ye=(await O(Te,"sendTestPush")({}))?.data?.sent??0;ye>0?d.success(`Sent test push to ${ye} device(s).`):d.message("No active devices found. Enable browser notifications first.")}catch(s){d.error(s instanceof Error?s.message:"Failed to send test push")}},children:[e.jsx(ge,{size:14,className:"mr-2"}),"Send test push"]})})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ms,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(n,{type:"time",value:i.notifications.quietHours.start,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,start:s.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(n,{type:"time",value:i.notifications.quietHours.end,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,end:s.target.value}}})),className:"w-32"})]})]})]}),b==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Toggle dark theme"})]}),e.jsx(x,{checked:i.appearance.darkMode,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,darkMode:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:i.appearance.fontSize,onChange:s=>c(t=>({...t,appearance:{...t.appearance,fontSize:Number(s.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"}),e.jsxs("span",{className:"text-xs font-mono text-slate-600 w-8",children:[i.appearance.fontSize,"px"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(x,{checked:i.appearance.compactView,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,compactView:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(x,{checked:i.appearance.reduceAnimations,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,reduceAnimations:s}}))})]})]}),b==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:i.privacy.profileVisibility,onChange:s=>c(t=>({...t,privacy:{...t.privacy,profileVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(x,{checked:i.privacy.showActivityStatus,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,showActivityStatus:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(x,{checked:i.privacy.dataSharing,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,dataSharing:s}}))})]})]}),b==="learning"&&o==="student"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(n,{type:"number",value:i.learning.dailyXpGoal,onChange:s=>c(t=>({...t,learning:{...t.learning,dailyXpGoal:Number(s.target.value||0)}})),className:"max-w-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:i.learning.preferredStudyTime,onChange:s=>c(t=>({...t,learning:{...t.learning,preferredStudyTime:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12PM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(x,{checked:i.learning.autoPlayLessons,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,autoPlayLessons:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(x,{checked:i.learning.showHints,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,showHints:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:i.learning.quizDifficultyPreference,onChange:s=>c(t=>({...t,learning:{...t.learning,quizDifficultyPreference:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ks,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(n,{type:"time",value:i.learning.studyReminderTime,onChange:s=>c(t=>({...t,learning:{...t.learning,studyReminderTime:s.target.value}})),className:"w-32"})]})]}),b==="teaching"&&o==="teacher"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Quiz Defaults"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Time Limit (min)"}),e.jsx(n,{type:"number",value:w.quizDefaults.timeLimitMinutes,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,timeLimitMinutes:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Passing Score (%)"}),e.jsx(n,{type:"number",value:w.quizDefaults.passingScore,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,passingScore:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Attempts"}),e.jsx(n,{type:"number",value:w.quizDefaults.maxAttempts,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,maxAttempts:Number(s.target.value)}}))})]})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"Class Preferences"}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Analytics Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let students see their leaderboard rank"})]}),e.jsx(x,{checked:w.studentAnalyticsVisibility,onCheckedChange:s=>C(t=>({...t,studentAnalyticsVisibility:s}))})]})]}),b==="system"&&o==="admin"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Disable platform access for non-admins"})]}),e.jsx(x,{checked:j.maintenanceMode,onCheckedChange:s=>$(t=>({...t,maintenanceMode:s}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Grade Level"}),e.jsx(n,{value:j.defaultGradeLevel,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Curriculum"}),e.jsx(n,{value:j.defaultCurriculum,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Class Size"}),e.jsx(n,{type:"number",value:j.maxClassSize,disabled:!0})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Audit Log Visible"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show audit logs in admin dashboard"})]}),e.jsx(x,{checked:j.auditLogVisible,onCheckedChange:s=>$(t=>({...t,auditLogVisible:s}))})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"AI Configuration"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Model Name"}),e.jsx(n,{value:j.aiConfig.modelName,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Temperature"}),e.jsx(n,{type:"number",value:j.aiConfig.temperature,disabled:!0})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"API Endpoint"}),e.jsx(n,{value:j.aiConfig.endpoint,disabled:!0})]})]})]}),b==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:Pe,disabled:X,children:[e.jsx(ve,{size:16,className:"mr-2"}),X?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:ze,disabled:Y,children:Y?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[o==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",o==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts.",o==="admin"&&"Reset admin testing artifacts like personal audit/content update records."]}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!E||q,onClick:()=>I(!0),children:q?"Resetting...":"Reset Testing Data"})]}),e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:()=>F(!0),disabled:de,children:[e.jsx(hs,{size:16,className:"mr-2"}),de?"Deleting...":"Delete Account"]})]})]})]}),e.jsxs("div",{className:"shrink-0 px-4 sm:px-6 py-3 sm:py-4 border-t border-[#dde3eb] bg-[#edf1f7] flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-0",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body text-center sm:text-left",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(p,{variant:"outline",onClick:se,className:"rounded-lg border-[#dde3eb] flex-1 sm:flex-none",disabled:B,children:"Cancel"}),e.jsx(p,{onClick:Ee,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white flex-1 sm:flex-none",disabled:B,children:B?"Saving...":"Save Changes"})]})]})]})]})]}),Se&&e.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{v||P(!1)},children:e.jsxs(H.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{duration:.2},className:"w-full max-w-md rounded-2xl border border-[#dde3eb] bg-[#f7f9fc] shadow-2xl",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsxs("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:[f==="password"&&"Change Password",f==="email"&&"Change Email",f==="delete"&&"Delete Account"]}),e.jsx("button",{onClick:()=>{v||P(!1)},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close",children:e.jsx(Ne,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter your current password to continue."}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:Q?"text":"password",value:L,onChange:s=>xe(s.target.value),placeholder:"Current password",autoFocus:!0,className:"pr-10",disabled:v,onKeyDown:s=>{s.key==="Enter"&&fe()}}),e.jsx("button",{type:"button",onClick:()=>he(!Q),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:Q?e.jsx(us,{size:16}):e.jsx(bs,{size:16})})]}),f==="password"&&e.jsx("div",{className:"relative",children:e.jsx(n,{type:"password",value:W,onChange:s=>ue(s.target.value),placeholder:"New password (min 8 chars)",disabled:v})}),f==="email"&&e.jsx(n,{type:"email",value:V,onChange:s=>be(s.target.value),placeholder:"New email address",disabled:v}),f==="delete"&&e.jsx("p",{className:"text-sm text-red-600 font-medium",children:"This action is permanent and cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{variant:"outline",onClick:()=>P(!1),disabled:v,children:"Cancel"}),e.jsx(p,{onClick:()=>void fe(),className:f==="delete"?"bg-red-600 hover:bg-red-700 text-white":"bg-sky-600 hover:bg-sky-700 text-white",disabled:v,children:v?"Processing...":f==="delete"?"Delete Forever":"Confirm"})]})]})]})}),e.jsx(je,{isOpen:we,onClose:()=>I(!1),onConfirm:Re,title:"Reset Testing Data?",message:`Reset ${o} testing data? This will clear quizzes, diagnostic assessments, assessment history, XP, and learning progress. This action cannot be undone.`,confirmText:q?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(je,{isOpen:Ce,onClose:()=>F(!1),onConfirm:_e,title:"Delete Account?",message:"You will need to re-authenticate to permanently delete your account. This cannot be undone.",confirmText:"Continue",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{rt as default}; + */const Ns=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ks=U("smartphone",Ns),ws=()=>{const{userProfile:m,userRole:y}=Me(),[r,z]=a.useState(Le),[R,_]=a.useState(De),[k,T]=a.useState(!1),[D,E]=a.useState(null);a.useEffect(()=>{if(!m?.uid)return;(async()=>{T(!0),E(null);try{if(y==="teacher"){const u=await Fe(m.uid);z(u)}if(y==="admin"){const u=await Ve();_(u)}}catch(u){E(u instanceof Error?u.message:"Failed to load settings")}finally{T(!1)}})()},[m?.uid,y]);const o=a.useCallback(async g=>{if(!m?.uid)return;const u=await qe(m.uid,g);z(u)},[m?.uid]),M=a.useCallback(async g=>{const u=await Ie(g);_(u)},[]);return{teacherPrefs:r,adminConfig:R,loading:k,error:D,saveTeacherPrefs:o,saveAdminConfig:M}},ae=()=>JSON.parse(JSON.stringify(We)),rt=({isOpen:m,onClose:y,profileData:r,onSave:z,settingsData:R,onSaveSettings:_,onApplySettingsPreview:k,onExportData:T,onClearCache:D,onResetData:E})=>{const o=r?.role||"student",{teacherPrefs:M,adminConfig:g,saveTeacherPrefs:u,saveAdminConfig:ke}=ws(),[b,ne]=a.useState("account"),[l,h]=a.useState({}),[i,ie]=a.useState(ae()),[w,C]=a.useState(M),[j,$]=a.useState(g),[B,re]=a.useState(!1),[q,le]=a.useState(!1),[X,ce]=a.useState(!1),[Y,oe]=a.useState(!1),[de,Cs]=a.useState(!1),[we,I]=a.useState(!1),[Ce,F]=a.useState(!1),[Se,P]=a.useState(!1),[L,xe]=a.useState(""),[f,Ae]=a.useState(null),[v,me]=a.useState(!1),[Q,he]=a.useState(!1),[W,ue]=a.useState(""),[V,be]=a.useState(""),J=a.useRef(!1),K=a.useRef(ae());a.useEffect(()=>{if(!m){J.current=!1;return}if(J.current)return;J.current=!0;const s=R?JSON.parse(JSON.stringify(R)):ae();K.current=s,h({uid:r?.uid,name:r?.name||"",email:r?.email||"",phone:r?.phone||"",photo:r?.photo||"",avatarLayers:r?.avatarLayers,role:r?.role,gender:r?.gender,lrn:r?.lrn||"",grade:r?.grade||"",section:r?.section||"",school:r?.school||"",department:r?.department||"",subject:r?.subject||"",yearsOfExperience:r?.yearsOfExperience||"",qualification:r?.qualification||"",position:r?.position||""}),ie(s),C(M),$(g)},[m,r,R,M,g]),a.useEffect(()=>{m&&k?.(i)},[m,i,k]),a.useEffect(()=>{if(!m)return;const s=t=>{t.key==="Escape"&&(k?.(K.current),y())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[m,y,k]);const Z=a.useMemo(()=>{const s=[{id:"account",label:"Account",icon:Oe},{id:"notifications",label:"Notifications",icon:ge},{id:"appearance",label:"Appearance",icon:js}];return o==="student"&&(s.push({id:"privacy",label:"Privacy & Security",icon:He}),s.push({id:"learning",label:"Learning",icon:Ge})),o==="teacher"&&s.push({id:"teaching",label:"Teaching",icon:Ue}),o==="admin"&&s.push({id:"system",label:"System",icon:vs}),s.push({id:"data",label:"Data & Storage",icon:ve}),s},[o]),c=s=>{ie(t=>s(t))},ee=s=>{Ae(s),xe(""),he(!1),s==="password"&&ue(""),s==="email"&&be(l.email||""),P(!0)},fe=async()=>{if(!L.trim()){d.error("Current password is required");return}me(!0);try{if(f==="password"){if(W.length<8){d.error("New password must be at least 8 characters");return}await Ke(L,W),d.success("Password updated")}else if(f==="email"){if(!V.includes("@")){d.error("Enter a valid email");return}await Ze(L,V),h(s=>({...s,email:V})),d.success("Email updated")}else if(f==="delete"){await es(L,l.uid||""),d.success("Account deleted"),y();return}P(!1)}catch(s){d.error(s instanceof Error?s.message:"Authentication failed")}finally{me(!1)}},Ee=async()=>{const s=Je({name:l.name,phone:l.phone});if(s){d.error(s);return}re(!0);try{z&&await z(l),_&&await _(i),o==="teacher"&&await u(w),o==="admin"&&await ke(j),y()}catch(t){d.error(t instanceof Error?t.message:"Failed to save settings")}finally{re(!1)}},se=()=>{P(!1),I(!1),F(!1),k?.(K.current),y()},Pe=async()=>{if(!(!T||X)){ce(!0);try{await T()}catch(s){d.error(s instanceof Error?s.message:"Failed to export data")}finally{ce(!1)}}},ze=async()=>{if(!(!D||Y)){oe(!0);try{await D()}catch(s){d.error(s instanceof Error?s.message:"Failed to clear cache")}finally{oe(!1)}}},Re=async()=>{if(!(!E||q)){I(!1),le(!0);try{await E(),d.success("Testing data reset completed")}catch(s){d.error(s instanceof Error?s.message:"Failed to reset testing data")}finally{le(!1)}}},_e=()=>{F(!1),ee("delete")};return m?e.jsx($e,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-end sm:items-center justify-center sm:p-4",children:[e.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:se,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(H.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-t-2xl sm:rounded-2xl shadow-2xl border border-[#dde3eb] w-full sm:max-w-4xl h-[92vh] sm:max-h-[85vh] overflow-hidden flex flex-col sm:flex-row",children:[e.jsxs("div",{className:"hidden sm:flex w-64 flex-shrink-0 bg-slate-50 border-r border-slate-200 flex-col p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${b===s.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(t,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"sm:hidden flex items-center border-b border-[#dde3eb] bg-slate-50 overflow-x-auto no-scrollbar px-2",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`flex flex-col items-center gap-0.5 px-3 py-2.5 shrink-0 text-xs font-medium border-b-2 transition-colors ${b===s.id?"border-sky-600 text-sky-700":"border-transparent text-slate-500"}`,children:[e.jsx(t,{size:16}),e.jsx("span",{className:"whitespace-nowrap",children:s.label})]},s.id)})}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-base sm:text-lg font-display font-bold text-[#0a1628]",children:Z.find(s=>s.id===b)?.label}),e.jsx("button",{onClick:se,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(Ne,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:[b==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(is,{uid:l.uid,photoURL:l.photo,displayName:l.name,onUploaded:s=>h(t=>({...t,photo:s}))}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(n,{type:"text",value:l.name||"",onChange:s=>h(t=>({...t,name:s.target.value})),maxLength:100,autoComplete:"name",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsxs("div",{className:"flex items-center gap-2 max-w-md",children:[e.jsx(n,{type:"email",value:l.email||"",disabled:!0,className:"flex-1 bg-slate-100"}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>ee("email"),children:"Change"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(n,{type:"tel",value:l.phone||"",onChange:s=>h(t=>({...t,phone:s.target.value})),maxLength:20,inputMode:"tel",autoComplete:"tel",pattern:"^\\+?[0-9 ()\\-.]{7,20}$",placeholder:"+63 912 345 6789",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Gender"}),e.jsxs(ss,{value:l.gender||"",onValueChange:s=>h(t=>({...t,gender:s})),children:[e.jsx(ts,{className:"max-w-md bg-white border-[#dde3eb] rounded-lg",children:e.jsx(as,{placeholder:"Select gender (optional)"})}),e.jsxs(ns,{children:[e.jsx(te,{value:"male",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]})}),e.jsx(te,{value:"female",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ls,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]})}),e.jsx(te,{value:"prefer_not_to_say",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]})})]})]})]}),o==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"LRN"}),e.jsx(n,{value:l.lrn||"",onChange:s=>h(t=>({...t,lrn:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(n,{value:l.grade||"",onChange:s=>h(t=>({...t,grade:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(n,{value:l.section||"",onChange:s=>h(t=>({...t,section:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(n,{value:l.school||"",onChange:s=>h(t=>({...t,school:s.target.value})),className:"max-w-md"})]})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(n,{value:l.department||"",onChange:s=>h(t=>({...t,department:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(n,{value:l.subject||"",onChange:s=>h(t=>({...t,subject:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(n,{value:l.yearsOfExperience||"",onChange:s=>h(t=>({...t,yearsOfExperience:s.target.value})),className:"max-w-md"})]})]}),o==="admin"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(n,{value:l.position||"",onChange:s=>h(t=>({...t,position:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(p,{variant:"outline",className:"rounded-xl",onClick:()=>ee("password"),children:[e.jsx(Be,{size:16,className:"mr-2"}),"Update Password"]})]})]}),b==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(x,{checked:i.notifications.pushNotifications,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,pushNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(x,{checked:i.notifications.soundEnabled,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,soundEnabled:s}}))})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Submissions"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify when students submit work"})]}),e.jsx(x,{checked:w.notifyOnSubmission,onCheckedChange:s=>C(t=>({...t,notifyOnSubmission:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Activity Alerts"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify on at-risk student activity"})]}),e.jsx(x,{checked:w.notifyOnStudentActivity,onCheckedChange:s=>C(t=>({...t,notifyOnStudentActivity:s}))})]})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),e.jsx("div",{className:"space-y-3",children:[{key:"quizReminders",label:"Quiz Reminders"},{key:"newContent",label:"New Content"},{key:"achievements",label:"Achievements"},{key:"streakAlerts",label:"Streak Alerts"},{key:"weeklySummary",label:"Weekly Summary"}].map(s=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i.notifications.notificationTypes[s.key],onChange:t=>c(N=>({...N,notifications:{...N.notifications,notificationTypes:{...N.notifications.notificationTypes,[s.key]:t.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:s.label})]},s.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Push Notification Categories"}),e.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Choose which kinds of pushes you want to receive on this device."}),e.jsxs("div",{className:"flex items-center justify-between py-2 mb-2 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h5",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Enable Push (master)"}),e.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Turn off to silence ALL push categories."})]}),e.jsx(x,{checked:i.pushPreferences.pushEnabled,onCheckedChange:s=>c(t=>({...t,pushPreferences:{...t.pushPreferences,pushEnabled:s}}))})]}),e.jsx("div",{className:"space-y-2",children:[{key:"achievement",label:"Achievements unlocked",icon:Xe},{key:"quiz_battle",label:"Quiz battle invites & results",icon:Ye},{key:"daily_reward",label:"Daily reward reminders",icon:os},{key:"assignment",label:"New assignments / deadlines",icon:ps},{key:"streak_reminder",label:"Streak reminders",icon:Qe},{key:"leaderboard",label:"Leaderboard updates",icon:ds},{key:"system",label:"System announcements",icon:xs}].map(s=>{const t=s.key,N=s.icon;return e.jsxs("label",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"text-sm text-[#0a1628] font-body flex items-center gap-2",children:[e.jsx(N,{className:"h-4 w-4 text-[#6c47ff]"}),s.label]}),e.jsx(x,{checked:!!i.pushPreferences[t],onCheckedChange:pe=>c(O=>({...O,pushPreferences:{...O.pushPreferences,[s.key]:pe}})),disabled:!i.pushPreferences.pushEnabled&&t!=="pushEnabled"})]},s.key)})}),e.jsx("div",{className:"mt-4",children:e.jsxs(p,{type:"button",variant:"outline",size:"sm",onClick:async()=>{try{const{requestPushPermissionAndRegister:s}=await G(async()=>{const{requestPushPermissionAndRegister:S}=await import("./index-D9TvEOZX.js").then(A=>A.b8);return{requestPushPermissionAndRegister:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),{auth:t}=await G(async()=>{const{auth:S}=await import("./index-D9TvEOZX.js").then(A=>A.b6);return{auth:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),N=t.currentUser?.uid;if(!N){d.error("You must be signed in to test push notifications.");return}if(!await s(N)){d.error("Push setup failed. Check that VITE_FIREBASE_VAPID_KEY is configured and notifications are allowed.");return}const{httpsCallable:O}=await G(async()=>{const{httpsCallable:S}=await import("./vendor-firebase-core-D7GXCeNu.js").then(A=>A.a9);return{httpsCallable:S}},[]),{cloudFunctions:Te}=await G(async()=>{const{cloudFunctions:S}=await import("./index-D9TvEOZX.js").then(A=>A.b6);return{cloudFunctions:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),ye=(await O(Te,"sendTestPush")({}))?.data?.sent??0;ye>0?d.success(`Sent test push to ${ye} device(s).`):d.message("No active devices found. Enable browser notifications first.")}catch(s){d.error(s instanceof Error?s.message:"Failed to send test push")}},children:[e.jsx(ge,{size:14,className:"mr-2"}),"Send test push"]})})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ms,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(n,{type:"time",value:i.notifications.quietHours.start,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,start:s.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(n,{type:"time",value:i.notifications.quietHours.end,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,end:s.target.value}}})),className:"w-32"})]})]})]}),b==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Toggle dark theme"})]}),e.jsx(x,{checked:i.appearance.darkMode,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,darkMode:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:i.appearance.fontSize,onChange:s=>c(t=>({...t,appearance:{...t.appearance,fontSize:Number(s.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"}),e.jsxs("span",{className:"text-xs font-mono text-slate-600 w-8",children:[i.appearance.fontSize,"px"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(x,{checked:i.appearance.compactView,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,compactView:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(x,{checked:i.appearance.reduceAnimations,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,reduceAnimations:s}}))})]})]}),b==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:i.privacy.profileVisibility,onChange:s=>c(t=>({...t,privacy:{...t.privacy,profileVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(x,{checked:i.privacy.showActivityStatus,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,showActivityStatus:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(x,{checked:i.privacy.dataSharing,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,dataSharing:s}}))})]})]}),b==="learning"&&o==="student"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(n,{type:"number",value:i.learning.dailyXpGoal,onChange:s=>c(t=>({...t,learning:{...t.learning,dailyXpGoal:Number(s.target.value||0)}})),className:"max-w-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:i.learning.preferredStudyTime,onChange:s=>c(t=>({...t,learning:{...t.learning,preferredStudyTime:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12PM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(x,{checked:i.learning.autoPlayLessons,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,autoPlayLessons:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(x,{checked:i.learning.showHints,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,showHints:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:i.learning.quizDifficultyPreference,onChange:s=>c(t=>({...t,learning:{...t.learning,quizDifficultyPreference:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ks,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(n,{type:"time",value:i.learning.studyReminderTime,onChange:s=>c(t=>({...t,learning:{...t.learning,studyReminderTime:s.target.value}})),className:"w-32"})]})]}),b==="teaching"&&o==="teacher"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Quiz Defaults"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Time Limit (min)"}),e.jsx(n,{type:"number",value:w.quizDefaults.timeLimitMinutes,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,timeLimitMinutes:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Passing Score (%)"}),e.jsx(n,{type:"number",value:w.quizDefaults.passingScore,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,passingScore:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Attempts"}),e.jsx(n,{type:"number",value:w.quizDefaults.maxAttempts,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,maxAttempts:Number(s.target.value)}}))})]})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"Class Preferences"}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Analytics Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let students see their leaderboard rank"})]}),e.jsx(x,{checked:w.studentAnalyticsVisibility,onCheckedChange:s=>C(t=>({...t,studentAnalyticsVisibility:s}))})]})]}),b==="system"&&o==="admin"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Disable platform access for non-admins"})]}),e.jsx(x,{checked:j.maintenanceMode,onCheckedChange:s=>$(t=>({...t,maintenanceMode:s}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Grade Level"}),e.jsx(n,{value:j.defaultGradeLevel,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Curriculum"}),e.jsx(n,{value:j.defaultCurriculum,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Class Size"}),e.jsx(n,{type:"number",value:j.maxClassSize,disabled:!0})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Audit Log Visible"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show audit logs in admin dashboard"})]}),e.jsx(x,{checked:j.auditLogVisible,onCheckedChange:s=>$(t=>({...t,auditLogVisible:s}))})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"AI Configuration"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Model Name"}),e.jsx(n,{value:j.aiConfig.modelName,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Temperature"}),e.jsx(n,{type:"number",value:j.aiConfig.temperature,disabled:!0})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"API Endpoint"}),e.jsx(n,{value:j.aiConfig.endpoint,disabled:!0})]})]})]}),b==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:Pe,disabled:X,children:[e.jsx(ve,{size:16,className:"mr-2"}),X?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:ze,disabled:Y,children:Y?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[o==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",o==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts.",o==="admin"&&"Reset admin testing artifacts like personal audit/content update records."]}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!E||q,onClick:()=>I(!0),children:q?"Resetting...":"Reset Testing Data"})]}),e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:()=>F(!0),disabled:de,children:[e.jsx(hs,{size:16,className:"mr-2"}),de?"Deleting...":"Delete Account"]})]})]})]}),e.jsxs("div",{className:"shrink-0 px-4 sm:px-6 py-3 sm:py-4 border-t border-[#dde3eb] bg-[#edf1f7] flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-0",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body text-center sm:text-left",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(p,{variant:"outline",onClick:se,className:"rounded-lg border-[#dde3eb] flex-1 sm:flex-none",disabled:B,children:"Cancel"}),e.jsx(p,{onClick:Ee,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white flex-1 sm:flex-none",disabled:B,children:B?"Saving...":"Save Changes"})]})]})]})]})]}),Se&&e.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{v||P(!1)},children:e.jsxs(H.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{duration:.2},className:"w-full max-w-md rounded-2xl border border-[#dde3eb] bg-[#f7f9fc] shadow-2xl",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsxs("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:[f==="password"&&"Change Password",f==="email"&&"Change Email",f==="delete"&&"Delete Account"]}),e.jsx("button",{onClick:()=>{v||P(!1)},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close",children:e.jsx(Ne,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter your current password to continue."}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:Q?"text":"password",value:L,onChange:s=>xe(s.target.value),placeholder:"Current password",autoFocus:!0,className:"pr-10",disabled:v,onKeyDown:s=>{s.key==="Enter"&&fe()}}),e.jsx("button",{type:"button",onClick:()=>he(!Q),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:Q?e.jsx(us,{size:16}):e.jsx(bs,{size:16})})]}),f==="password"&&e.jsx("div",{className:"relative",children:e.jsx(n,{type:"password",value:W,onChange:s=>ue(s.target.value),placeholder:"New password (min 8 chars)",disabled:v})}),f==="email"&&e.jsx(n,{type:"email",value:V,onChange:s=>be(s.target.value),placeholder:"New email address",disabled:v}),f==="delete"&&e.jsx("p",{className:"text-sm text-red-600 font-medium",children:"This action is permanent and cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{variant:"outline",onClick:()=>P(!1),disabled:v,children:"Cancel"}),e.jsx(p,{onClick:()=>void fe(),className:f==="delete"?"bg-red-600 hover:bg-red-700 text-white":"bg-sky-600 hover:bg-sky-700 text-white",disabled:v,children:v?"Processing...":f==="delete"?"Delete Forever":"Confirm"})]})]})]})}),e.jsx(je,{isOpen:we,onClose:()=>I(!1),onConfirm:Re,title:"Reset Testing Data?",message:`Reset ${o} testing data? This will clear quizzes, diagnostic assessments, assessment history, XP, and learning progress. This action cannot be undone.`,confirmText:q?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(je,{isOpen:Ce,onClose:()=>F(!1),onConfirm:_e,title:"Delete Account?",message:"You will need to re-authenticate to permanently delete your account. This cannot be undone.",confirmText:"Continue",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{rt as default}; diff --git a/assets/Sidebar-Cd6wJUro.js b/assets/Sidebar-BbWXfzk2.js similarity index 94% rename from assets/Sidebar-Cd6wJUro.js rename to assets/Sidebar-BbWXfzk2.js index a1723c90bcd6696a7b5462dc4bba392a3393a631..cd2b7fed8f499aad55c91bc717ff459a38429aef 100644 --- a/assets/Sidebar-Cd6wJUro.js +++ b/assets/Sidebar-BbWXfzk2.js @@ -1,4 +1,4 @@ -import{r as x,j as e}from"./vendor-react-B4AQeu28.js";import{S as $,a as B,L as u,D,M as G}from"./LogoutActionButton-C7uxe-Am.js";import{e as z,m as c,o as P,U as M,G as N,b as m,V as q,a2 as F,F as U}from"./index-Cvals0ud.js";import{T as S,a as L,b as C}from"./tooltip-ERqatgcd.js";import{X as Q}from"./x-cRIR5BcS.js";import{C as V}from"./chevron-right-DMwHUP8W.js";import{C as W}from"./chevron-left-BVt9k3oq.js";import{C as A}from"./chart-column-NTUNS-L9.js";import{S as R}from"./shirt-Dh8-NVGy.js";/** +import{r as x,j as e}from"./vendor-react-B4AQeu28.js";import{S as $,a as B,L as u,D,M as G}from"./LogoutActionButton-1ArQYuvD.js";import{e as z,m as c,o as P,U as M,G as N,b as m,V as q,a2 as F,F as U}from"./index-D9TvEOZX.js";import{T as S,a as L,b as C}from"./tooltip-B9-3_gHy.js";import{X as Q}from"./x-DM8tXF3P.js";import{C as V}from"./chevron-right-Jv12kepm.js";import{C as W}from"./chevron-left-C7NnvvA7.js";import{C as A}from"./chart-column-BwIV9b12.js";import{S as R}from"./shirt-BptpMBI2.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SupplementalBanner-D2jdKCXO.js b/assets/SupplementalBanner-EZxFiTkk.js similarity index 95% rename from assets/SupplementalBanner-D2jdKCXO.js rename to assets/SupplementalBanner-EZxFiTkk.js index c31ec9237cb7e287fc9a776439d2a645c40ea600..5886374f4cac21eb2dfa5c5b1f43057411cbe40e 100644 --- a/assets/SupplementalBanner-D2jdKCXO.js +++ b/assets/SupplementalBanner-EZxFiTkk.js @@ -1 +1 @@ -import{j as e,r as y}from"./vendor-react-B4AQeu28.js";import{h as j,m as p,y as h,b as f,T as m,B as x}from"./index-Cvals0ud.js";import{X as v}from"./x-cRIR5BcS.js";import{S as w}from"./sparkles-Chs7kbc0.js";import{C as g}from"./chevron-right-DMwHUP8W.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const b={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:e.jsx(m,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:e.jsx(f,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:e.jsx(m,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:e.jsx(x,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:e.jsx(m,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:e.jsx(x,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:e.jsx(m,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:e.jsx(x,{size:14})}]};function u(i){const s=i.toLowerCase();return s==="functions"||s.includes("function")||s==="businessmath"||s.includes("business")||s==="logic"||s.includes("reason")||s.includes("general")||s.includes("gen-math")||s.includes("gen math")?"General Mathematics":s.includes("stat")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("basic")||s.includes("calc")?"Basic Calculus":null}function N(i){const s=i.trim().toLowerCase();return s==="functions"?"Functions and Graphs":s==="businessmath"?"Business and Financial Mathematics":s==="logic"?"Logic and Reasoning":i}const k=({atRiskSubjects:i=[],onAction:s,onDismiss:n})=>{const[l,a]=y.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(j,{children:!l&&e.jsx(p.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-10,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"relative bg-gradient-to-r from-sky-600 via-sky-500 to-sky-600 rounded-2xl p-5 text-white shadow-lg shadow-sky-500/20",children:[e.jsx("button",{onClick:r,className:"absolute top-3 right-3 w-7 h-7 bg-white/20 hover:bg-white/30 rounded-full flex items-center justify-center transition-colors",children:e.jsx(v,{size:14})}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(w,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold text-lg mb-1",children:"Supplemental Materials Available"}),e.jsx("p",{className:"text-sky-100 text-sm mb-3",children:"Based on your diagnostic assessment, we've identified topics that could use extra practice. Strengthening these areas will improve your overall performance."}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:i.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full text-xs font-semibold",children:[e.jsx(h,{size:12}),N(t)]},t))}),e.jsxs("button",{onClick:s,className:"inline-flex items-center gap-2 bg-white text-sky-600 font-bold text-sm px-4 py-2 rounded-xl hover:bg-sky-50 transition-colors",children:["Review Topics",e.jsx(g,{size:16})]})]})]})]})})})},z=({quizSubject:i,atRiskSubjects:s=[]})=>{const n=i?u(i):null;if(!s.some(r=>{const t=u(r);return t&&t===n})||!n)return null;const a=b[n]||[];return e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(h,{size:14,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area — ",n]})]}),e.jsx("p",{className:"text-xs text-rose-700 mb-2",children:"This topic was flagged in your diagnostic. Take your time and review the explanations carefully."}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.slice(0,2).map((r,t)=>e.jsxs("span",{className:"inline-flex items-center gap-1 bg-rose-100 text-rose-700 px-2 py-0.5 rounded-md text-xs font-medium",children:[r.icon,r.label]},t))})]})})},C=({quizSubject:i,quizScore:s=0,atRiskSubjects:n=[],onAction:l})=>{const a=i?u(i):null,r=n.some(c=>{const d=u(c);return d&&d===a});if(s>=70&&!r)return null;const t=a?b[a]||[]:[],o=s<70;return e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:e.jsx("div",{className:`rounded-2xl p-4 border-2 ${o?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${o?"bg-orange-500":"bg-sky-500"}`,children:e.jsx(f,{size:20,className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:o?"Review Recommended":"Supplemental Materials"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:o?`You scored ${s}% on this quiz. We recommend reviewing the following resources to strengthen your understanding.`:"This topic was identified as an area for growth. Check out these additional resources."}),t.length>0&&e.jsx("div",{className:"space-y-1.5 mb-3",children:t.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${o?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),e.jsxs("span",{className:"text-slate-500",children:["— ",c.description]})]},d))}),l&&e.jsxs("button",{onClick:l,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${o?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Review Topics",e.jsx(g,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(z,{...i});case"results":return e.jsx(C,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default}; +import{j as e,r as y}from"./vendor-react-B4AQeu28.js";import{h as j,m as p,y as h,b as f,T as m,B as x}from"./index-D9TvEOZX.js";import{X as v}from"./x-DM8tXF3P.js";import{S as w}from"./sparkles-BLpoopVP.js";import{C as g}from"./chevron-right-Jv12kepm.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const b={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:e.jsx(m,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:e.jsx(f,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:e.jsx(m,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:e.jsx(x,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:e.jsx(m,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:e.jsx(x,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:e.jsx(m,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:e.jsx(x,{size:14})}]};function u(i){const s=i.toLowerCase();return s==="functions"||s.includes("function")||s==="businessmath"||s.includes("business")||s==="logic"||s.includes("reason")||s.includes("general")||s.includes("gen-math")||s.includes("gen math")?"General Mathematics":s.includes("stat")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("basic")||s.includes("calc")?"Basic Calculus":null}function N(i){const s=i.trim().toLowerCase();return s==="functions"?"Functions and Graphs":s==="businessmath"?"Business and Financial Mathematics":s==="logic"?"Logic and Reasoning":i}const k=({atRiskSubjects:i=[],onAction:s,onDismiss:n})=>{const[l,a]=y.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(j,{children:!l&&e.jsx(p.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-10,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"relative bg-gradient-to-r from-sky-600 via-sky-500 to-sky-600 rounded-2xl p-5 text-white shadow-lg shadow-sky-500/20",children:[e.jsx("button",{onClick:r,className:"absolute top-3 right-3 w-7 h-7 bg-white/20 hover:bg-white/30 rounded-full flex items-center justify-center transition-colors",children:e.jsx(v,{size:14})}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(w,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold text-lg mb-1",children:"Supplemental Materials Available"}),e.jsx("p",{className:"text-sky-100 text-sm mb-3",children:"Based on your diagnostic assessment, we've identified topics that could use extra practice. Strengthening these areas will improve your overall performance."}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:i.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full text-xs font-semibold",children:[e.jsx(h,{size:12}),N(t)]},t))}),e.jsxs("button",{onClick:s,className:"inline-flex items-center gap-2 bg-white text-sky-600 font-bold text-sm px-4 py-2 rounded-xl hover:bg-sky-50 transition-colors",children:["Review Topics",e.jsx(g,{size:16})]})]})]})]})})})},z=({quizSubject:i,atRiskSubjects:s=[]})=>{const n=i?u(i):null;if(!s.some(r=>{const t=u(r);return t&&t===n})||!n)return null;const a=b[n]||[];return e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(h,{size:14,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area — ",n]})]}),e.jsx("p",{className:"text-xs text-rose-700 mb-2",children:"This topic was flagged in your diagnostic. Take your time and review the explanations carefully."}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.slice(0,2).map((r,t)=>e.jsxs("span",{className:"inline-flex items-center gap-1 bg-rose-100 text-rose-700 px-2 py-0.5 rounded-md text-xs font-medium",children:[r.icon,r.label]},t))})]})})},C=({quizSubject:i,quizScore:s=0,atRiskSubjects:n=[],onAction:l})=>{const a=i?u(i):null,r=n.some(c=>{const d=u(c);return d&&d===a});if(s>=70&&!r)return null;const t=a?b[a]||[]:[],o=s<70;return e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:e.jsx("div",{className:`rounded-2xl p-4 border-2 ${o?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${o?"bg-orange-500":"bg-sky-500"}`,children:e.jsx(f,{size:20,className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:o?"Review Recommended":"Supplemental Materials"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:o?`You scored ${s}% on this quiz. We recommend reviewing the following resources to strengthen your understanding.`:"This topic was identified as an area for growth. Check out these additional resources."}),t.length>0&&e.jsx("div",{className:"space-y-1.5 mb-3",children:t.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${o?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),e.jsxs("span",{className:"text-slate-500",children:["— ",c.description]})]},d))}),l&&e.jsxs("button",{onClick:l,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${o?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Review Topics",e.jsx(g,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(z,{...i});case"results":return e.jsx(C,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default}; diff --git a/assets/SupplementalPillCarousel-Dr0PNxNV.js b/assets/SupplementalPillCarousel-BXn2Q4qs.js similarity index 98% rename from assets/SupplementalPillCarousel-Dr0PNxNV.js rename to assets/SupplementalPillCarousel-BXn2Q4qs.js index 04b867287fe0cf1b1c940efe664651ef0efcfab6..88d429bd08c9196b51a4399f5c5df6936006cc1c 100644 --- a/assets/SupplementalPillCarousel-Dr0PNxNV.js +++ b/assets/SupplementalPillCarousel-BXn2Q4qs.js @@ -1,4 +1,4 @@ -import{d as o,r as U,j as r}from"./vendor-react-B4AQeu28.js";import{o as se,h as Qe,m as Ie,y as Se,a as jt,L as Ze,I as et}from"./index-Cvals0ud.js";import{f as Dt}from"./deepseekRagService-Bke9fSTt.js";import{T as Nt,D as Ot,d as It,b as At,c as _t,P as kt,O as Pt}from"./vendor-radix-BPuEd8FG.js";import{w as $t}from"./moduleWatchService-NMv-sVdb.js";import{C as Lt}from"./circle-alert-lQsWFo4p.js";import{a as Bt,C as Ft}from"./chevron-up-CzNRBnCs.js";import{B as Gt}from"./bell-oitWfCwK.js";import{C as tt}from"./clock-BsCO0o69.js";import{C as Ve}from"./chevron-right-DMwHUP8W.js";import{S as Ht}from"./sparkles-Chs7kbc0.js";import{X as qt}from"./x-cRIR5BcS.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const ke=[{topicId:"gm-q1-business-finance",label:"Business and Finance",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-BF-1","GM11-BF-2","GM11-BF-3"]},{topicId:"gm-q1-patterns-sequences-series",label:"Patterns, Sequences, and Series",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-PSS-1","GM11-PSS-2","GM11-PSS-3"]},{topicId:"gm-q1-financial-application-sequences-series",label:"Financial Application of Sequences and Series",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-FASS-1","GM11-FASS-2"]},{topicId:"gm-q2-measurement-conversion",label:"Measurement and Conversion",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-MC-1","GM11-MC-2"]},{topicId:"gm-q2-functions-graphs",label:"Functions and Their Graphs",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-FG-1","GM11-FG-2","GM11-FG-3","M11GM-Ia-2","M11GM-Ib-5","M11GM-Id-2","M11GM-Ie-f-1","M11GM-Ii-4"]},{topicId:"gm-q2-piecewise-functions",label:"Piecewise Functions",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-PF-1","GM11-PF-2"]},{topicId:"gm-q2-statistical-variables",label:"Statistical Variables",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-SV-1","GM11-SV-2"]},{topicId:"gm-q3-basic-trigonometry",label:"Basic Trigonometry",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-BT-1","GM11-BT-2"]},{topicId:"gm-q3-practical-applications-measurement",label:"Practical Applications of Measurement",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-PAM-1","GM11-PAM-2","M11GM-IIa-b-1","M11GM-IIa-2","M11GM-IIc-d-1","M11GM-IIf-3"]},{topicId:"gm-q3-transformational-geometry-volume-capacity",label:"Transformational Geometry / Volume and Capacity",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-TGVC-1","GM11-TGVC-2"]},{topicId:"gm-q3-random-variables-sampling",label:"Random Variables and Sampling",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-RVS-1","GM11-RVS-2","GM11-RVS-3"]},{topicId:"gm-q4-compound-interest-annuities-loans",label:"Compound Interest, Annuities, and Loans",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-CIAL-1","GM11-CIAL-2","GM11-CIAL-3"]},{topicId:"gm-q4-hypothesis-testing-regression",label:"Hypothesis Testing and Regression",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-HTR-1","GM11-HTR-2"]},{topicId:"gm-q4-propositions-syllogisms-fallacies",label:"Logical Propositions, Syllogisms, and Fallacies",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-PSF-1","GM11-PSF-2","GM11-PSF-3","M11GM-IIg-1","M11GM-IIh-1","M11GM-IIi-1","M11GM-IIi-2","M11GM-IIj-1"]}];for(const e of ke)for(const n of e.competencyCodes)e.topicId;const zt={};for(const e of ke)zt[e.topicId]=e;const nt={};for(const e of ke)nt[e.topicId]=e.label;function Ut(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const rt=o.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),he=()=>{const e=o.useContext(rt);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Ut(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( +import{d as o,r as U,j as r}from"./vendor-react-B4AQeu28.js";import{o as se,h as Qe,m as Ie,y as Se,a as jt,L as Ze,I as et}from"./index-D9TvEOZX.js";import{f as Dt}from"./deepseekRagService-Bke9fSTt.js";import{T as Nt,D as Ot,d as It,b as At,c as _t,P as kt,O as Pt}from"./vendor-radix-C5nwdvGr.js";import{w as $t}from"./moduleWatchService-C7S4gD7U.js";import{C as Lt}from"./circle-alert-B7tHo7_X.js";import{a as Bt,C as Ft}from"./chevron-up-C5341jJ8.js";import{B as Gt}from"./bell-Ci_PX33B.js";import{C as tt}from"./clock-BPtF2Ddk.js";import{C as Ve}from"./chevron-right-Jv12kepm.js";import{S as Ht}from"./sparkles-BLpoopVP.js";import{X as qt}from"./x-DM8tXF3P.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const ke=[{topicId:"gm-q1-business-finance",label:"Business and Finance",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-BF-1","GM11-BF-2","GM11-BF-3"]},{topicId:"gm-q1-patterns-sequences-series",label:"Patterns, Sequences, and Series",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-PSS-1","GM11-PSS-2","GM11-PSS-3"]},{topicId:"gm-q1-financial-application-sequences-series",label:"Financial Application of Sequences and Series",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-FASS-1","GM11-FASS-2"]},{topicId:"gm-q2-measurement-conversion",label:"Measurement and Conversion",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-MC-1","GM11-MC-2"]},{topicId:"gm-q2-functions-graphs",label:"Functions and Their Graphs",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-FG-1","GM11-FG-2","GM11-FG-3","M11GM-Ia-2","M11GM-Ib-5","M11GM-Id-2","M11GM-Ie-f-1","M11GM-Ii-4"]},{topicId:"gm-q2-piecewise-functions",label:"Piecewise Functions",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-PF-1","GM11-PF-2"]},{topicId:"gm-q2-statistical-variables",label:"Statistical Variables",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-SV-1","GM11-SV-2"]},{topicId:"gm-q3-basic-trigonometry",label:"Basic Trigonometry",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-BT-1","GM11-BT-2"]},{topicId:"gm-q3-practical-applications-measurement",label:"Practical Applications of Measurement",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-PAM-1","GM11-PAM-2","M11GM-IIa-b-1","M11GM-IIa-2","M11GM-IIc-d-1","M11GM-IIf-3"]},{topicId:"gm-q3-transformational-geometry-volume-capacity",label:"Transformational Geometry / Volume and Capacity",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-TGVC-1","GM11-TGVC-2"]},{topicId:"gm-q3-random-variables-sampling",label:"Random Variables and Sampling",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-RVS-1","GM11-RVS-2","GM11-RVS-3"]},{topicId:"gm-q4-compound-interest-annuities-loans",label:"Compound Interest, Annuities, and Loans",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-CIAL-1","GM11-CIAL-2","GM11-CIAL-3"]},{topicId:"gm-q4-hypothesis-testing-regression",label:"Hypothesis Testing and Regression",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-HTR-1","GM11-HTR-2"]},{topicId:"gm-q4-propositions-syllogisms-fallacies",label:"Logical Propositions, Syllogisms, and Fallacies",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-PSF-1","GM11-PSF-2","GM11-PSF-3","M11GM-IIg-1","M11GM-IIh-1","M11GM-IIi-1","M11GM-IIi-2","M11GM-IIj-1"]}];for(const e of ke)for(const n of e.competencyCodes)e.topicId;const zt={};for(const e of ke)zt[e.topicId]=e;const nt={};for(const e of ke)nt[e.topicId]=e.label;function Ut(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const rt=o.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),he=()=>{const e=o.useContext(rt);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Ut(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( [data-state=closed] ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Wt(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Vt(){return Pe(/^Mac/)}function Yt(){return Pe(/^iPhone/)}function Ye(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Xt(){return Pe(/^iPad/)||Vt()&&navigator.maxTouchPoints>1}function at(){return Yt()||Xt()}function Pe(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Kt=24,Jt=typeof window<"u"?U.useLayoutEffect:U.useEffect;function Xe(...e){return(...n)=>{for(let t of e)typeof t=="function"&&t(...n)}}const je=typeof document<"u"&&window.visualViewport;function Ke(e){let n=window.getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY)}function ot(e){for(Ke(e)&&(e=e.parentElement);e&&!Ke(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Qt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let be=0,De;function Zt(e={}){let{isDisabled:n}=e;Jt(()=>{if(!n)return be++,be===1&&at()&&(De=en()),()=>{be--,be===0&&De?.()}},[n])}function en(){let e,n=0,t=m=>{e=ot(m.target),!(e===document.documentElement&&e===document.body)&&(n=m.changedTouches[0].pageY)},i=m=>{if(!e||e===document.documentElement||e===document.body){m.preventDefault();return}let c=m.changedTouches[0].pageY,$=e.scrollTop,I=e.scrollHeight-e.clientHeight;I!==0&&(($<=0&&c>n||$>=I&&c{let c=m.target;Ae(c)&&c!==document.activeElement&&(m.preventDefault(),c.style.transform="translateY(-2000px)",c.focus(),requestAnimationFrame(()=>{c.style.transform=""}))},a=m=>{let c=m.target;Ae(c)&&(c.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{c.style.transform="",je&&(je.height{Je(c)}):je.addEventListener("resize",()=>Je(c),{once:!0}))}))},h=()=>{window.scrollTo(0,0)},w=window.pageXOffset,y=window.pageYOffset,S=Xe(tn(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let v=Xe(me(document,"touchstart",t,{passive:!1,capture:!0}),me(document,"touchmove",i,{passive:!1,capture:!0}),me(document,"touchend",s,{passive:!1,capture:!0}),me(document,"focus",a,!0),me(window,"scroll",h));return()=>{S(),v(),window.scrollTo(w,y)}}function tn(e,n,t){let i=e.style[n];return e.style[n]=t,()=>{e.style[n]=i}}function me(e,n,t,i){return e.addEventListener(n,t,i),()=>{e.removeEventListener(n,t,i)}}function Je(e){let n=document.scrollingElement||document.documentElement;for(;e&&e!==n;){let t=ot(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let i=t.getBoundingClientRect().top,s=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom;const h=t.getBoundingClientRect().bottom+Kt;a>h&&(t.scrollTop+=s-i)}e=t.parentElement}}function Ae(e){return e instanceof HTMLInputElement&&!Qt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function nn(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function rn(...e){return n=>e.forEach(t=>nn(t,n))}function it(...e){return U.useCallback(rn(...e),e)}const st=new WeakMap;function L(e,n,t=!1){if(!e||!(e instanceof HTMLElement))return;let i={};Object.entries(n).forEach(([s,a])=>{if(s.startsWith("--")){e.style.setProperty(s,a);return}i[s]=e.style[s],e.style[s]=a}),!t&&st.set(e,i)}function an(e,n){if(!e||!(e instanceof HTMLElement))return;let t=st.get(e);t&&(e.style[n]=t[n])}const P=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function xe(e,n){if(!e)return null;const t=window.getComputedStyle(e),i=t.transform||t.webkitTransform||t.mozTransform;let s=i.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[P(n)?13:12]):(s=i.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[P(n)?5:4]):null)}function on(e){return 8*(Math.log(e+1)-2)}function Ne(e,n){if(!e)return()=>{};const t=e.style.cssText;return Object.assign(e.style,n),()=>{e.style.cssText=t}}function sn(...e){return(...n)=>{for(const t of e)typeof t=="function"&&t(...n)}}const D={DURATION:.5,EASE:[.32,.72,0,1]},lt=.4,ln=.25,cn=100,ct=8,ne=16,_e=26,Oe="vaul-dragging";function ut(e){const n=o.useRef(e);return o.useEffect(()=>{n.current=e}),o.useMemo(()=>(...t)=>n.current==null?void 0:n.current.call(n,...t),[])}function un({defaultProp:e,onChange:n}){const t=o.useState(e),[i]=t,s=o.useRef(i),a=ut(n);return o.useEffect(()=>{s.current!==i&&(a(i),s.current=i)},[i,s,a]),t}function dt({prop:e,defaultProp:n,onChange:t=()=>{}}){const[i,s]=un({defaultProp:n,onChange:t}),a=e!==void 0,h=a?e:i,w=ut(t),y=o.useCallback(S=>{if(a){const m=typeof S=="function"?S(e):S;m!==e&&w(m)}else s(S)},[a,e,s,w]);return[h,y]}function dn({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:t,drawerRef:i,overlayRef:s,fadeFromIndex:a,onSnapPointChange:h,direction:w="bottom",container:y,snapToSequentialPoint:S}){const[v,m]=dt({prop:e,defaultProp:t?.[0],onChange:n}),[c,$]=o.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);o.useEffect(()=>{function p(){$({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);const I=o.useMemo(()=>v===t?.[t.length-1]||null,[t,v]),M=o.useMemo(()=>{var p;return(p=t?.findIndex(R=>R===v))!=null?p:null},[t,v]),F=t&&t.length>0&&(a||a===0)&&!Number.isNaN(a)&&t[a]===v||!t,f=o.useMemo(()=>{const p=y?{width:y.getBoundingClientRect().width,height:y.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var R;return(R=t?.map(x=>{const G=typeof x=="string";let B=0;if(G&&(B=parseInt(x,10)),P(w)){const u=G?B:c?x*p.height:0;return c?w==="bottom"?p.height-u:-p.height+u:u}const H=G?B:c?x*p.width:0;return c?w==="right"?p.width-H:-p.width+H:H}))!=null?R:[]},[t,c,y]),A=o.useMemo(()=>M!==null?f?.[M]:null,[f,M]),N=o.useCallback(p=>{var R;const x=(R=f?.findIndex(G=>G===p))!=null?R:null;h(x),L(i.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(w)?`translate3d(0, ${p}px, 0)`:`translate3d(${p}px, 0, 0)`}),f&&x!==f.length-1&&a!==void 0&&x!==a&&x{if(v||e){var p;const R=(p=t?.findIndex(x=>x===e||x===v))!=null?p:-1;f&&R!==-1&&typeof f[R]=="number"&&N(f[R])}},[v,e,t,f,N]);function l({draggedDistance:p,closeDrawer:R,velocity:x,dismissible:G}){if(a===void 0)return;const B=w==="bottom"||w==="right"?(A??0)-p:(A??0)+p,H=M===a-1,u=M===0,b=p>0;if(H&&L(s.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`}),!S&&x>2&&!b){G?R():N(f[0]);return}if(!S&&x>2&&b&&f&&t){N(f[t.length-1]);return}const j=f?.reduce((_,W)=>typeof _!="number"||typeof W!="number"?_:Math.abs(W-B)lt&&Math.abs(p)0&&I&&t){N(f[t.length-1]);return}if(u&&_<0&&G&&R(),M===null)return;N(f[M+_]);return}N(j)}function V({draggedDistance:p}){if(A===null)return;const R=w==="bottom"||w==="right"?A-p:A+p;(w==="bottom"||w==="right")&&Rf[f.length-1]||L(i.current,{transform:P(w)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`})}function X(p,R){if(!t||typeof M!="number"||!f||a===void 0)return null;const x=M===a-1;if(M>=a&&R)return 0;if(x&&!R)return 1;if(!F&&!x)return null;const B=x?M+1:M-1,H=x?f[B]-f[B-1]:f[B+1]-f[B],u=p/Math.abs(H);return x?1-u:u}return{isLastSnapPoint:I,activeSnapPoint:v,shouldFade:F,getPercentageDragged:X,setActiveSnapPoint:m,activeSnapPointIndex:M,onRelease:l,onDrag:V,snapPointsOffset:f}}const fn=()=>()=>{};function mn(){const{direction:e,isOpen:n,shouldScaleBackground:t,setBackgroundColorOnScale:i,noBodyStyles:s}=he(),a=o.useRef(null),h=U.useMemo(()=>document.body.style.backgroundColor,[]);function w(){return(window.innerWidth-_e)/window.innerWidth}o.useEffect(()=>{if(n&&t){a.current&&clearTimeout(a.current);const y=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!y)return;sn(i&&!s?Ne(document.body,{background:"black"}):fn,Ne(y,{transformOrigin:P(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${D.DURATION}s`,transitionTimingFunction:`cubic-bezier(${D.EASE.join(",")})`}));const S=Ne(y,{borderRadius:`${ct}px`,overflow:"hidden",...P(e)?{transform:`scale(${w()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${w()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{S(),a.current=window.setTimeout(()=>{h?document.body.style.background=h:document.body.style.removeProperty("background")},D.DURATION*1e3)}}},[n,t,h])}let pe=null;function pn({isOpen:e,modal:n,nested:t,hasBeenOpened:i,preventScrollRestoration:s,noBodyStyles:a}){const[h,w]=o.useState(()=>typeof window<"u"?window.location.href:""),y=o.useRef(0),S=o.useCallback(()=>{if(Ye()&&pe===null&&e&&!a){pe={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:m,innerHeight:c}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-y.current}px`,left:`${-m}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const $=c-window.innerHeight;$&&y.current>=c&&(document.body.style.top=`${-(y.current+$)}px`)}),300)}},[e]),v=o.useCallback(()=>{if(Ye()&&pe!==null&&!a){const m=-parseInt(document.body.style.top,10),c=-parseInt(document.body.style.left,10);Object.assign(document.body.style,pe),window.requestAnimationFrame(()=>{if(s&&h!==window.location.href){w(window.location.href);return}window.scrollTo(c,m)}),pe=null}},[h]);return o.useEffect(()=>{function m(){y.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),o.useEffect(()=>{if(n)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||v()}},[n,v]),o.useEffect(()=>{t||!i||(e?(!window.matchMedia("(display-mode: standalone)").matches&&S(),n||window.setTimeout(()=>{v()},500)):v())},[e,i,h,n,t,S,v]),{restorePositionSetting:v}}function hn({open:e,onOpenChange:n,children:t,onDrag:i,onRelease:s,snapPoints:a,shouldScaleBackground:h=!1,setBackgroundColorOnScale:w=!0,closeThreshold:y=ln,scrollLockTimeout:S=cn,dismissible:v=!0,handleOnly:m=!1,fadeFromIndex:c=a&&a.length-1,activeSnapPoint:$,setActiveSnapPoint:I,fixed:M,modal:F=!0,onClose:f,nested:A,noBodyStyles:N=!1,direction:l="bottom",defaultOpen:V=!1,disablePreventScroll:X=!0,snapToSequentialPoint:p=!1,preventScrollRestoration:R=!1,repositionInputs:x=!0,onAnimationEnd:G,container:B,autoFocus:H=!1}){var u,b;const[j=!1,O]=dt({defaultProp:V,prop:e,onChange:d=>{n?.(d),!d&&!A&&xt(),setTimeout(()=>{G?.(d)},D.DURATION*1e3),d&&!F&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),d||(document.body.style.pointerEvents="auto")}}),[_,W]=o.useState(!1),[Q,le]=o.useState(!1),[pt,$e]=o.useState(!1),ae=o.useRef(null),ge=o.useRef(null),Te=o.useRef(null),Re=o.useRef(null),ce=o.useRef(null),ue=o.useRef(!1),Ce=o.useRef(null),Me=o.useRef(0),oe=o.useRef(!1),Le=o.useRef(!V),Be=o.useRef(0),g=o.useRef(null),Fe=o.useRef(((u=g.current)==null?void 0:u.getBoundingClientRect().height)||0),Ge=o.useRef(((b=g.current)==null?void 0:b.getBoundingClientRect().width)||0),Ee=o.useRef(0),ht=o.useCallback(d=>{a&&d===de.length-1&&(ge.current=new Date)},[]),{activeSnapPoint:gt,activeSnapPointIndex:ie,setActiveSnapPoint:He,onRelease:wt,snapPointsOffset:de,onDrag:vt,shouldFade:qe,getPercentageDragged:bt}=dn({snapPoints:a,activeSnapPointProp:$,setActiveSnapPointProp:I,drawerRef:g,fadeFromIndex:c,overlayRef:ae,onSnapPointChange:ht,direction:l,container:B,snapToSequentialPoint:p});Zt({isDisabled:!j||Q||!F||pt||!_||!x||!X});const{restorePositionSetting:xt}=pn({isOpen:j,modal:F,nested:A??!1,hasBeenOpened:_,preventScrollRestoration:R,noBodyStyles:N});function we(){return(window.innerWidth-_e)/window.innerWidth}function yt(d){var C,E;!v&&!a||g.current&&!g.current.contains(d.target)||(Fe.current=((C=g.current)==null?void 0:C.getBoundingClientRect().height)||0,Ge.current=((E=g.current)==null?void 0:E.getBoundingClientRect().width)||0,le(!0),Te.current=new Date,at()&&window.addEventListener("touchend",()=>ue.current=!1,{once:!0}),d.target.setPointerCapture(d.pointerId),Me.current=P(l)?d.pageY:d.pageX)}function ze(d,C){var E;let T=d;const k=(E=window.getSelection())==null?void 0:E.toString(),z=g.current?xe(g.current,l):null,q=new Date;if(T.tagName==="SELECT"||T.hasAttribute("data-vaul-no-drag")||T.closest("[data-vaul-no-drag]"))return!1;if(l==="right"||l==="left")return!0;if(ge.current&&q.getTime()-ge.current.getTime()<500)return!1;if(z!==null&&(l==="bottom"?z>0:z<0))return!0;if(k&&k.length>0)return!1;if(ce.current&&q.getTime()-ce.current.getTime()T.clientHeight){if(T.scrollTop!==0)return ce.current=new Date,!1;if(T.getAttribute("role")==="dialog")return!0}T=T.parentNode}return!0}function St(d){if(g.current&&Q){const C=l==="bottom"||l==="right"?1:-1,E=(Me.current-(P(l)?d.pageY:d.pageX))*C,T=E>0,k=a&&!v&&!T;if(k&&ie===0)return;const z=Math.abs(E),q=document.querySelector("[data-vaul-drawer-wrapper]"),Z=l==="bottom"||l==="top"?Fe.current:Ge.current;let Y=z/Z;const te=bt(z,T);if(te!==null&&(Y=te),k&&Y>=1||!ue.current&&!ze(d.target,T))return;if(g.current.classList.add(Oe),ue.current=!0,L(g.current,{transition:"none"}),L(ae.current,{transition:"none"}),a&&vt({draggedDistance:E}),T&&!a){const K=on(E),ve=Math.min(K*-1,0)*C;L(g.current,{transform:P(l)?`translate3d(0, ${ve}px, 0)`:`translate3d(${ve}px, 0, 0)`});return}const ee=1-Y;if((qe||c&&ie===c-1)&&(i?.(d,Y),L(ae.current,{opacity:`${ee}`,transition:"none"},!0)),q&&ae.current&&h){const K=Math.min(we()+Y*(1-we()),1),ve=8-Y*8,We=Math.max(0,14-Y*14);L(q,{borderRadius:`${ve}px`,transform:P(l)?`scale(${K}) translate3d(0, ${We}px, 0)`:`scale(${K}) translate3d(${We}px, 0, 0)`,transition:"none"},!0)}if(!a){const K=z*C;L(g.current,{transform:P(l)?`translate3d(0, ${K}px, 0)`:`translate3d(${K}px, 0, 0)`})}}}o.useEffect(()=>{window.requestAnimationFrame(()=>{Le.current=!0})},[]),o.useEffect(()=>{var d;function C(){if(!g.current||!x)return;const E=document.activeElement;if(Ae(E)||oe.current){var T;const k=((T=window.visualViewport)==null?void 0:T.height)||0,z=window.innerHeight;let q=z-k;const Z=g.current.getBoundingClientRect().height||0,Y=Z>z*.8;Ee.current||(Ee.current=Z);const te=g.current.getBoundingClientRect().top;if(Math.abs(Be.current-q)>60&&(oe.current=!oe.current),a&&a.length>0&&de&&ie){const ee=de[ie]||0;q+=ee}if(Be.current=q,Z>k||oe.current){const ee=g.current.getBoundingClientRect().height;let K=ee;ee>k&&(K=k-(Y?te:_e)),M?g.current.style.height=`${ee-Math.max(q,0)}px`:g.current.style.height=`${Math.max(K,k-te)}px`}else Wt()||(g.current.style.height=`${Ee.current}px`);a&&a.length>0&&!oe.current?g.current.style.bottom="0px":g.current.style.bottom=`${Math.max(q,0)}px`}}return(d=window.visualViewport)==null||d.addEventListener("resize",C),()=>{var E;return(E=window.visualViewport)==null?void 0:E.removeEventListener("resize",C)}},[ie,a,de]);function fe(d){Tt(),f?.(),d||O(!1),setTimeout(()=>{a&&He(a[0])},D.DURATION*1e3)}function Ue(){if(!g.current)return;const d=document.querySelector("[data-vaul-drawer-wrapper]"),C=xe(g.current,l);L(g.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`}),L(ae.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,opacity:"1"}),h&&C&&C>0&&j&&L(d,{borderRadius:`${ct}px`,overflow:"hidden",...P(l)?{transform:`scale(${we()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${we()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${D.DURATION}s`,transitionTimingFunction:`cubic-bezier(${D.EASE.join(",")})`},!0)}function Tt(){!Q||!g.current||(g.current.classList.remove(Oe),ue.current=!1,le(!1),Re.current=new Date)}function Rt(d){if(!Q||!g.current)return;g.current.classList.remove(Oe),ue.current=!1,le(!1),Re.current=new Date;const C=xe(g.current,l);if(!d||!ze(d.target,!1)||!C||Number.isNaN(C)||Te.current===null)return;const E=Re.current.getTime()-Te.current.getTime(),T=Me.current-(P(l)?d.pageY:d.pageX),k=Math.abs(T)/E;if(k>.05&&($e(!0),setTimeout(()=>{$e(!1)},200)),a){wt({draggedDistance:T*(l==="bottom"||l==="right"?1:-1),closeDrawer:fe,velocity:k,dismissible:v}),s?.(d,!0);return}if(l==="bottom"||l==="right"?T>0:T<0){Ue(),s?.(d,!0);return}if(k>lt){fe(),s?.(d,!1);return}var z;const q=Math.min((z=g.current.getBoundingClientRect().height)!=null?z:0,window.innerHeight);var Z;const Y=Math.min((Z=g.current.getBoundingClientRect().width)!=null?Z:0,window.innerWidth),te=l==="left"||l==="right";if(Math.abs(C)>=(te?Y:q)*y){fe(),s?.(d,!1);return}s?.(d,!0),Ue()}o.useEffect(()=>(j&&(L(document.documentElement,{scrollBehavior:"auto"}),ge.current=new Date),()=>{an(document.documentElement,"scrollBehavior")}),[j]);function Ct(d){const C=d?(window.innerWidth-ne)/window.innerWidth:1,E=d?-ne:0;Ce.current&&window.clearTimeout(Ce.current),L(g.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(l)?`scale(${C}) translate3d(0, ${E}px, 0)`:`scale(${C}) translate3d(${E}px, 0, 0)`}),!d&&g.current&&(Ce.current=setTimeout(()=>{const T=xe(g.current,l);L(g.current,{transition:"none",transform:P(l)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})},500))}function Mt(d,C){if(C<0)return;const E=(window.innerWidth-ne)/window.innerWidth,T=E+C*(1-E),k=-ne+C*ne;L(g.current,{transform:P(l)?`scale(${T}) translate3d(0, ${k}px, 0)`:`scale(${T}) translate3d(${k}px, 0, 0)`,transition:"none"})}function Et(d,C){const E=P(l)?window.innerHeight:window.innerWidth,T=C?(E-ne)/E:1,k=C?-ne:0;C&&L(g.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(l)?`scale(${T}) translate3d(0, ${k}px, 0)`:`scale(${T}) translate3d(${k}px, 0, 0)`})}return o.useEffect(()=>{F||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[F]),o.createElement(At,{defaultOpen:V,onOpenChange:d=>{!v&&!d||(d?W(!0):fe(!0),O(d))},open:j},o.createElement(rt.Provider,{value:{activeSnapPoint:gt,snapPoints:a,setActiveSnapPoint:He,drawerRef:g,overlayRef:ae,onOpenChange:n,onPress:yt,onRelease:Rt,onDrag:St,dismissible:v,shouldAnimate:Le,handleOnly:m,isOpen:j,isDragging:Q,shouldFade:qe,closeDrawer:fe,onNestedDrag:Mt,onNestedOpenChange:Ct,onNestedRelease:Et,keyboardIsOpen:oe,modal:F,snapPointsOffset:de,activeSnapPointIndex:ie,direction:l,shouldScaleBackground:h,setBackgroundColorOnScale:w,noBodyStyles:N,container:B,autoFocus:H}},t))}const ft=o.forwardRef(function({...e},n){const{overlayRef:t,snapPoints:i,onRelease:s,shouldFade:a,isOpen:h,modal:w,shouldAnimate:y}=he(),S=it(n,t),v=i&&i.length>0;if(!w)return null;const m=o.useCallback(c=>s(c),[s]);return o.createElement(Pt,{onMouseUp:m,ref:S,"data-vaul-overlay":"","data-vaul-snap-points":h&&v?"true":"false","data-vaul-snap-points-overlay":h&&a?"true":"false","data-vaul-animate":y?.current?"true":"false",...e})});ft.displayName="Drawer.Overlay";const mt=o.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:t,...i},s){const{drawerRef:a,onPress:h,onRelease:w,onDrag:y,keyboardIsOpen:S,snapPointsOffset:v,activeSnapPointIndex:m,modal:c,isOpen:$,direction:I,snapPoints:M,container:F,handleOnly:f,shouldAnimate:A,autoFocus:N}=he(),[l,V]=o.useState(!1),X=it(s,a),p=o.useRef(null),R=o.useRef(null),x=o.useRef(!1),G=M&&M.length>0;mn();const B=(u,b,j=0)=>{if(x.current)return!0;const O=Math.abs(u.y),_=Math.abs(u.x),W=_>O,Q=["bottom","right"].includes(b)?1:-1;if(b==="left"||b==="right"){if(!(u.x*Q<0)&&_>=0&&_<=j)return W}else if(!(u.y*Q<0)&&O>=0&&O<=j)return!W;return x.current=!0,!0};o.useEffect(()=>{G&&window.requestAnimationFrame(()=>{V(!0)})},[]);function H(u){p.current=null,x.current=!1,w(u)}return o.createElement(_t,{"data-vaul-drawer-direction":I,"data-vaul-drawer":"","data-vaul-delayed-snap-points":l?"true":"false","data-vaul-snap-points":$&&G?"true":"false","data-vaul-custom-container":F?"true":"false","data-vaul-animate":A?.current?"true":"false",...i,ref:X,style:v&&v.length>0?{"--snap-point-height":`${v[m??0]}px`,...n}:n,onPointerDown:u=>{f||(i.onPointerDown==null||i.onPointerDown.call(i,u),p.current={x:u.pageX,y:u.pageY},h(u))},onOpenAutoFocus:u=>{t?.(u),N||u.preventDefault()},onPointerDownOutside:u=>{if(e?.(u),!c||u.defaultPrevented){u.preventDefault();return}S.current&&(S.current=!1)},onFocusOutside:u=>{if(!c){u.preventDefault();return}},onPointerMove:u=>{if(R.current=u,f||(i.onPointerMove==null||i.onPointerMove.call(i,u),!p.current))return;const b=u.pageY-p.current.y,j=u.pageX-p.current.x,O=u.pointerType==="touch"?10:2;B({x:j,y:b},I,O)?y(u):(Math.abs(j)>O||Math.abs(b)>O)&&(p.current=null)},onPointerUp:u=>{i.onPointerUp==null||i.onPointerUp.call(i,u),p.current=null,x.current=!1,w(u)},onPointerOut:u=>{i.onPointerOut==null||i.onPointerOut.call(i,u),H(R.current)},onContextMenu:u=>{i.onContextMenu==null||i.onContextMenu.call(i,u),R.current&&H(R.current)}})});mt.displayName="Drawer.Content";const gn=250,wn=120,vn=o.forwardRef(function({preventCycle:e=!1,children:n,...t},i){const{closeDrawer:s,isDragging:a,snapPoints:h,activeSnapPoint:w,setActiveSnapPoint:y,dismissible:S,handleOnly:v,isOpen:m,onPress:c,onDrag:$}=he(),I=o.useRef(null),M=o.useRef(!1);function F(){if(M.current){N();return}window.setTimeout(()=>{f()},wn)}function f(){if(a||e||M.current){N();return}if(N(),!h||h.length===0){S||s();return}if(w===h[h.length-1]&&S){s();return}const V=h.findIndex(p=>p===w);if(V===-1)return;const X=h[V+1];y(X)}function A(){I.current=window.setTimeout(()=>{M.current=!0},gn)}function N(){I.current&&window.clearTimeout(I.current),M.current=!1}return o.createElement("div",{onClick:F,onPointerCancel:N,onPointerDown:l=>{v&&c(l),A()},onPointerMove:l=>{v&&$(l)},ref:i,"data-vaul-drawer-visible":m?"true":"false","data-vaul-handle":"","aria-hidden":"true",...t},o.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});vn.displayName="Drawer.Handle";function bn(e){const n=he(),{container:t=n.container,...i}=e;return o.createElement(kt,{container:t,...i})}const re={Root:hn,Content:mt,Overlay:ft,Portal:bn,Close:It,Title:Nt,Description:Ot};function xn({...e}){return r.jsx(re.Root,{"data-slot":"drawer",...e})}function yn({...e}){return r.jsx(re.Portal,{"data-slot":"drawer-portal",...e})}function Sn({...e}){return r.jsx(re.Close,{"data-slot":"drawer-close",...e})}function Tn({className:e,...n}){return r.jsx(re.Overlay,{"data-slot":"drawer-overlay",className:se("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function Rn({className:e,children:n,...t}){return r.jsxs(yn,{"data-slot":"drawer-portal",children:[r.jsx(Tn,{}),r.jsxs(re.Content,{"data-slot":"drawer-content",className:se("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...t,children:[r.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),n]})]})}function Cn({className:e,...n}){return r.jsx("div",{"data-slot":"drawer-header",className:se("flex flex-col gap-1.5 p-4",e),...n})}function Mn({className:e,...n}){return r.jsx("div",{"data-slot":"drawer-footer",className:se("mt-auto flex flex-col gap-2 p-4",e),...n})}function En({className:e,...n}){return r.jsx(re.Title,{"data-slot":"drawer-title",className:se("text-foreground font-semibold",e),...n})}function jn({className:e,...n}){return r.jsx(re.Description,{"data-slot":"drawer-description",className:se("text-muted-foreground text-sm",e),...n})}const Dn={coming_soon:{icon:r.jsx(tt,{size:16}),bg:"bg-amber-50 border-amber-200",text:"text-amber-800",message:"The full module for this topic isn't available yet — here's what you can study in the meantime, based on the DepEd curriculum."},progression_locked:{icon:r.jsx(Ze,{size:16}),bg:"bg-purple-50 border-purple-200",text:"text-purple-800",message:"You're flagged as at-risk here, but this module is currently locked behind progression. Study this brief while you work toward unlocking it."},no_module:{icon:r.jsx(Se,{size:16}),bg:"bg-rose-50 border-rose-200",text:"text-rose-800",message:"No module has been created for this topic yet. Here's what the DepEd curriculum says you should know."}},Nn=({open:e,onOpenChange:n,topicName:t,topicId:i,resolutionState:s,fallbackContent:a,moduleId:h,studentId:w,onNavigateToPrerequisite:y,loading:S=!1,error:v=null})=>{const[m,c]=U.useState(!1),[$,I]=U.useState(!1),[M,F]=U.useState(!1),f=Dn[s],A=async()=>{if(!(!w||!h)){I(!0);try{await $t(w,h),F(!0)}catch{}I(!1)}};return r.jsx(xn,{open:e,onOpenChange:n,children:r.jsxs(Rn,{className:"max-h-[85vh]",children:[r.jsxs(Cn,{children:[r.jsx(En,{className:"text-lg",children:t}),r.jsx(jn,{children:"At-Risk Study Brief"})]}),r.jsxs("div",{className:"px-4 pb-4 overflow-y-auto flex-1 space-y-4",children:[r.jsxs("div",{className:`flex items-start gap-2 p-3 rounded-lg border ${f.bg}`,children:[r.jsx("span",{className:`mt-0.5 ${f.text}`,children:f.icon}),r.jsx("p",{className:`text-xs leading-relaxed ${f.text}`,children:f.message})]}),S&&r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx("div",{className:"animate-pulse text-sm text-gray-500",children:"Loading study brief..."})}),v&&r.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-red-50 border border-red-200",children:[r.jsx(Lt,{size:14,className:"text-red-600"}),r.jsx("p",{className:"text-xs text-red-700",children:v})]}),a&&!S&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-semibold text-gray-900 mb-1",children:"Overview"}),r.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:a.summary})]}),a.key_concepts.length>0&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Key Concepts"}),r.jsx("ul",{className:"space-y-1.5",children:a.key_concepts.map((N,l)=>r.jsxs("li",{className:"flex items-start gap-2 text-sm text-gray-700",children:[r.jsx("span",{className:"mt-1.5 w-1.5 h-1.5 rounded-full bg-purple-500 flex-shrink-0"}),N]},l))})]}),a.one_worked_example?.problem&&r.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[r.jsxs("button",{onClick:()=>c(!m),className:"w-full flex items-center justify-between px-3 py-2.5 bg-gray-50 hover:bg-gray-100 transition-colors",children:[r.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Worked Example"}),m?r.jsx(Bt,{size:16}):r.jsx(Ft,{size:16})]}),r.jsx(Qe,{children:m&&r.jsx(Ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:r.jsxs("div",{className:"px-3 py-3 space-y-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase",children:"Problem"}),r.jsx("p",{className:"text-sm text-gray-800 mt-0.5",children:a.one_worked_example.problem})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase",children:"Solution"}),r.jsx("p",{className:"text-sm text-gray-800 mt-0.5 whitespace-pre-line",children:a.one_worked_example.solution})]})]})})})]}),a.what_to_focus_on&&r.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:[r.jsx("h4",{className:"text-xs font-bold text-blue-800 uppercase mb-1",children:"What to Focus On"}),r.jsx("p",{className:"text-sm text-blue-900 leading-relaxed",children:a.what_to_focus_on})]}),a.rag_confidence==="low"&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[r.jsx(Se,{size:12}),r.jsx("span",{children:"Limited curriculum data was available for this topic preview."})]})]})]}),r.jsxs(Mn,{children:[s==="coming_soon"&&h&&r.jsxs("button",{onClick:A,disabled:M||$,className:"flex items-center justify-center gap-2 w-full py-2.5 rounded-lg bg-amber-500 hover:bg-amber-600 text-white text-sm font-semibold disabled:opacity-50 transition-colors",children:[r.jsx(Gt,{size:14}),M?"Subscribed!":$?"Subscribing...":"Notify Me When Available"]}),s==="progression_locked"&&h&&y&&r.jsxs("button",{onClick:()=>{y(h),n(!1)},className:"flex items-center justify-center gap-2 w-full py-2.5 rounded-lg bg-purple-600 hover:bg-purple-700 text-white text-sm font-semibold transition-colors",children:["Go to prerequisite module",r.jsx(jt,{size:14})]}),r.jsx(Sn,{asChild:!0,children:r.jsx("button",{className:"w-full py-2 rounded-lg border border-gray-200 text-sm text-gray-600 hover:bg-gray-50 transition-colors",children:"Close"})})]})]})})},J={pillBg:"#E9D5FF",pillText:"#6B21A8",pillLockedBg:"#EDE9FE",pillLockedText:"#7C3AED",pillComingSoonBg:"#FEF3C7",pillComingSoonText:"#92400E",pillNoModuleBg:"#FFE4E6",pillNoModuleText:"#BE123C",headerText:"#1F2937",arrowBg:"#F3F4F6"},On=new Set(et.map(e=>e.id));function ye(e){return nt[e]||et.find(n=>n.id===e)?.moduleTitle||e.split("-").slice(2).join(" ").replace(/\b\w/g,n=>n.toUpperCase())}function In(e){switch(e){case"coming_soon":return{style:{backgroundColor:J.pillComingSoonBg,color:J.pillComingSoonText,cursor:"pointer"},icon:r.jsx(tt,{size:14})};case"progression_locked":return{style:{backgroundColor:J.pillLockedBg,color:J.pillLockedText,cursor:"pointer"},icon:r.jsx(Ze,{size:14})};case"no_module":return{style:{backgroundColor:J.pillNoModuleBg,color:J.pillNoModuleText,cursor:"pointer"},icon:r.jsx(Se,{size:14})};default:return{style:{backgroundColor:J.pillBg,color:J.pillText,cursor:"pointer"},icon:r.jsx(Se,{size:14})}}}const Qn=({flaggedTopics:e=[],atRiskSubjects:n=[],unlockedModuleIds:t,moduleStatusMap:i={},resolutionStateMap:s={},fallbackContentMap:a={},onTopicClick:h,onNavigateToPrerequisite:w,studentId:y})=>{const S=U.useRef(null),[v,m]=U.useState(!1),[c,$]=U.useState(null),[I,M]=U.useState({}),[F,f]=U.useState(null),[A,N]=U.useState(!1),[l,V]=U.useState(""),X=e.filter(b=>On.has(b));if(X.length===0)return null;const p=()=>{if(S.current){const{scrollLeft:b,scrollWidth:j,clientWidth:O}=S.current;m(b+O{S.current?.scrollBy({left:200,behavior:"smooth"})},x=b=>{if(s[b])return s[b];const j=i[b];return j==="coming_soon"?"coming_soon":j==="unavailable"?"no_module":(j==="available"||j==="teacher_uploaded")&&t&&!t.has(b)?"progression_locked":"accessible"},G=async b=>{if(x(b)==="accessible"){if(c===b){h?.(b);return}if($(b),!I[b]&&y){f(b);try{const O=ye(b),_=await Dt(y,b,O,"General Mathematics",.7);_.generated&&M(W=>({...W,[b]:_.tips}))}catch{}f(null)}}else V(b),N(!0)},B=l?x(l):"no_module",H=l&&a[l]||null,u=l||null;return r.jsxs(r.Fragment,{children:[r.jsxs(Ie.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-4",children:[r.jsx("h3",{className:"text-base font-bold mb-3",style:{color:J.headerText},children:"Recommended for Review"}),r.jsxs("div",{className:"relative flex items-center",children:[r.jsx("div",{ref:S,onScroll:p,className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:X.slice(0,8).map((b,j)=>{const O=x(b),{style:_,icon:W}=In(O);return r.jsxs("button",{onClick:()=>G(b),title:O==="coming_soon"?"Module coming soon — tap for study brief":O==="progression_locked"?"Locked — complete previous module first":O==="no_module"?"No module yet — tap for curriculum brief":void 0,className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-semibold transition-all whitespace-nowrap hover:scale-[1.02] active:scale-[0.98]",style:_,children:[W,ye(b),O==="accessible"&&r.jsx(Ve,{size:14})]},`${b}-${j}`)})}),v&&r.jsx("button",{onClick:R,className:"flex-shrink-0 ml-2 w-8 h-8 rounded-full flex items-center justify-center transition-colors",style:{backgroundColor:J.arrowBg},"aria-label":"Scroll right",children:r.jsx(Ve,{size:16,className:"text-gray-600"})})]}),r.jsx("style",{children:` .scrollbar-hide::-webkit-scrollbar { display: none; } diff --git a/assets/TeacherDashboard-BbvSzo2l.js b/assets/TeacherDashboard-BbvSzo2l.js deleted file mode 100644 index 9da74bcf1c864b481a974c12deadd3f3b135572e..0000000000000000000000000000000000000000 --- a/assets/TeacherDashboard-BbvSzo2l.js +++ /dev/null @@ -1,114 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cvals0ud.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css","assets/jspdf.es.min-CSpYkTDq.js"])))=>i.map(i=>d[i]); -import{e as vt,t as Rl,f as Mn,g as Ve,_ as Gs,u as hs,h as Mt,m as Ae,i as oi,j as oe,k as ii,R as ds,l as Ml,n as mt,o as li,b as Wt,G as ci,B as Hr,Z as Al,p as ar,q as ft,A as di,U as us,r as xs,T as na,v as Ja,C as zl,w as An,x as Ll,y as oa,z as zn,D as Ln,E as mi,F as Dl,H as rr,I as $l,J as Fl,K as Ol,M as Bl,N as Dn,O as Pl,P as Hl}from"./index-Cvals0ud.js";import{d as me,j as e,r as u,c as Ur}from"./vendor-react-B4AQeu28.js";import{B as jt,c as Ul}from"./button-CanHmtQ3.js";import{I as ys}from"./input-D6YjrCkj.js";import Gl from"./ConfirmModal-CzN8U1r6.js";import{collection as Lt,query as Rt,limit as nr,where as _t,getDocs as Dt,doc as ut,getDoc as ws,updateDoc as as,serverTimestamp as ct,setDoc as rs,arrayRemove as Ql,deleteDoc as ui,Timestamp as Vl,orderBy as Wl,onSnapshot as xi}from"./vendor-firebase-firestore-CNv3xXal.js";import{X as Xt}from"./x-cRIR5BcS.js";import{S as Vs}from"./search-C0dGOTBF.js";import{C as Bt}from"./check-BVDfRV4g.js";import{P as ia}from"./plus-DUNZAuOT.js";import{F as Ns,N as ql,A as pi}from"./NotificationDropdown-BA3YDfYB.js";import{M as Yl,L as Kl,D as Xl,S as Jl,a as Zl}from"./LogoutActionButton-C7uxe-Am.js";import{P as or,s as $n,f as hi,L as ir,d as ec,p as tc,a as sc,A as lr,b as ac}from"./quizService-ADP3v46Q.js";import{C as Ts}from"./clock-BsCO0o69.js";import{S as wa}from"./send-DJ3IeuSS.js";import{C as Aa}from"./circle-check-big-6fwaSN-C.js";import{S as rc}from"./vendor-radix-BPuEd8FG.js";import{T as nc,a as oc,b as ic}from"./tooltip-ERqatgcd.js";import{C as lc}from"./circle-help-Bpd0FWyO.js";import{E as cc,a as dc}from"./eye-gVkJiC2f.js";import{T as fi}from"./trash-2-DaNTdmd2.js";import{C as gr}from"./circle-alert-lQsWFo4p.js";import{I as sa}from"./info-Nl0vLXXp.js";import{C as zt,a as ka}from"./chevron-up-CzNRBnCs.js";import{M as Fn}from"./minus-XCv3x7RR.js";import{C as _s}from"./chart-column-NTUNS-L9.js";import{C as Gr,H as On,S as Bn}from"./skeleton-2ST8J4tA.js";import{D as mc}from"./download-BJi3JOJ-.js";import{C as Es}from"./chevron-left-BVt9k3oq.js";import{C as Is}from"./chevron-right-DMwHUP8W.js";import{S as gi}from"./save-FkmW81ji.js";import{C as Na}from"./circle-check-Bi1b5YEO.js";import{S as Rs}from"./sparkles-Chs7kbc0.js";import{U as Qr}from"./upload-CEq77VjR.js";import{L as uc,C as xc}from"./lightbulb-BO_q6pvi.js";import{u as pc}from"./useQuery-CiaHK9El.js";import{S as Pn,g as hc,G as fc,s as Hn}from"./subjects-jEWdBmnZ.js";import{u as gc}from"./useCurriculum-BAkeEYG2.js";import bc from"./ChatMarkdown-Bihf5n-9.js";import{c as vc,a as bi,C as wc,f as Nc}from"./formatDistanceToNow-CnY6T5Ff.js";import{B as cr}from"./bell-oitWfCwK.js";import{D as Un,a as Gn,b as jc,c as yc,d as Sc,S as kc}from"./dialog-BkdNfKs4.js";import{u as Kt,r as Cc}from"./vendor-xlsx-uZelXSz_.js";import{s as Ic}from"./moduleWatchService-NMv-sVdb.js";import{r as Tc,u as _c,a as Ec}from"./vendor-firebase-storage-Bi7H_66d.js";import{C as Vr}from"./clipboard-check-Dml7qHk3.js";import{R as Qn,B as Vn,C as Wn,X as qn,Y as Yn,T as Kn,a as Xn,b as Jn}from"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";import"./log-out-CKjuia0o.js";/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rc=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],Mc=vt("align-left",Rc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ac=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],_r=vt("calendar-days",Ac);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zc=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],Lc=vt("chart-no-axes-column",zc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dc=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],$c=vt("ellipsis-vertical",Dc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fc=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Wr=vt("ellipsis",Fc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oc=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Bc=vt("external-link",Oc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pc=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Hc=vt("file-spreadsheet",Pc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uc=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],dr=vt("library",Uc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gc=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],vi=vt("list-checks",Gc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qc=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],wi=vt("message-circle",Qc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vc=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Wc=vt("panel-right",Vc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qc=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],Yc=vt("pen-line",qc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kc=[["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"}]],Ni=vt("pen",Kc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xc=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Zn=vt("printer",Xc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jc=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],Zc=vt("scan-line",Jc);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ed=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],td=vt("table",ed);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sd=[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]],ji=vt("trending-down",sd);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ad=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ja=vt("video",ad);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rd=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],qr=vt("wand-sparkles",rd);function nd(t,s){const a=Rl(t);return isNaN(s)?vc(t,NaN):(a.setDate(a.getDate()+s),a)}function yi(t,s){const a=Mn(t),r=Mn(s);return+a==+r}function eo(t){return yi(t,bi(t))}function od(t,s){return nd(t,-1)}function to(t){return yi(t,od(bi(t)))}const br=0,As=1,la=2,Si=4;function so(t){return()=>t}function id(t){t()}function ki(t,s){return a=>t(s(a))}function ao(t,s){return()=>t(s)}function ld(t,s){return a=>t(s,a)}function nn(t){return t!==void 0}function cd(...t){return()=>{t.map(id)}}function ca(){}function vr(t,s){return s(t),t}function dd(t,s){return s(t)}function rt(...t){return t}function Ke(t,s){return t(As,s)}function Me(t,s){t(br,s)}function on(t){t(la)}function ot(t){return t(Si)}function pe(t,s){return Ke(t,ld(s,br))}function ns(t,s){const a=t(As,r=>{a(),s(r)});return a}function ro(t){let s,a;return r=>o=>{s=o,a&&clearTimeout(a),a=setTimeout(()=>{r(s)},t)}}function Ci(t,s){return t===s}function at(t=Ci){let s;return a=>r=>{t(s,r)||(s=r,a(r))}}function we(t){return s=>a=>{t(a)&&s(a)}}function ie(t){return s=>ki(s,t)}function cs(t){return s=>()=>{s(t)}}function W(t,...s){const a=md(...s);return((r,o)=>{switch(r){case la:on(t);return;case As:return Ke(t,a(o))}})}function ms(t,s){return a=>r=>{a(s=t(s,r))}}function Qs(t){return s=>a=>{t>0?t--:s(a)}}function js(t){let s=null,a;return r=>o=>{s=o,!a&&(a=setTimeout(()=>{a=void 0,r(s)},t))}}function ze(...t){const s=new Array(t.length);let a=0,r=null;const o=2**t.length-1;return t.forEach((n,i)=>{const l=2**i;Ke(n,c=>{const d=a;a|=l,s[i]=c,d!==o&&a===o&&r&&(r(),r=null)})}),n=>i=>{const l=()=>{n([i].concat(s))};a===o?l():r=l}}function md(...t){return s=>t.reduceRight(dd,s)}function ud(t){let s,a;const r=()=>s?.();return function(o,n){switch(o){case As:return n?a===n?void 0:(r(),a=n,s=Ke(t,n),s):(r(),ca);case la:r(),a=null;return}}}function X(t){let s=t;const a=Pe();return((r,o)=>{switch(r){case br:s=o;break;case As:{o(s);break}case Si:return s}return a(r,o)})}function Et(t,s){return vr(X(s),a=>pe(t,a))}function Pe(){const t=[];return((s,a)=>{switch(s){case br:t.slice().forEach(r=>{r(a)});return;case la:t.splice(0,t.length);return;case As:return t.push(a),()=>{const r=t.indexOf(a);r>-1&&t.splice(r,1)}}})}function Ht(t){return vr(Pe(),s=>pe(t,s))}function qe(t,s=[],{singleton:a}={singleton:!0}){return{constructor:t,dependencies:s,id:xd(),singleton:a}}const xd=()=>Symbol();function pd(t){const s=new Map,a=({constructor:r,dependencies:o,id:n,singleton:i})=>{if(i&&s.has(n))return s.get(n);const l=r(o.map(c=>a(c)));return i&&s.set(n,l),l};return a(t)}function pt(...t){const s=Pe(),a=new Array(t.length);let r=0;const o=2**t.length-1;return t.forEach((n,i)=>{const l=2**i;Ke(n,c=>{a[i]=c,r|=l,r===o&&Me(s,a)})}),function(n,i){switch(n){case la:{on(s);return}case As:return r===o&&i(a),Ke(s,i)}}}function ve(t,s=Ci){return W(t,at(s))}function Yr(...t){return function(s,a){switch(s){case la:return;case As:return cd(...t.map(r=>Ke(r,a)))}}}const bt={DEBUG:0,INFO:1,WARN:2,ERROR:3},hd={[bt.DEBUG]:"debug",[bt.ERROR]:"error",[bt.INFO]:"log",[bt.WARN]:"warn"},fd=()=>typeof globalThis>"u"?window:globalThis,zs=qe(()=>{const t=X(bt.ERROR);return{log:X((s,a,r=bt.INFO)=>{const o=fd().VIRTUOSO_LOG_LEVEL??ot(t);r>=o&&console[hd[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",s,a)}),logLevel:t}},[],{singleton:!0});function Ws(t,s,a){return ln(t,s,a).callbackRef}function ln(t,s,a){const r=me.useRef(null);let o=i=>{};const n=me.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const c=i[0].target;c.offsetParent!==null&&t(c)};a?l():requestAnimationFrame(l)}):null,[t,a]);return o=i=>{i&&s?(n?.observe(i),r.current=i):(r.current&&n?.unobserve(r.current),r.current=null)},{callbackRef:o,ref:r}}function gd(t,s,a,r,o,n,i,l,c){const d=me.useCallback(m=>{const p=bd(m.children,s,l?"offsetWidth":"offsetHeight",o);let h=m.parentElement;for(;h.dataset.virtuosoScroller===void 0;)h=h.parentElement;const b=h.lastElementChild.dataset.viewportType==="window";let N;b&&(N=h.ownerDocument.defaultView);const C=i?l?i.scrollLeft:i.scrollTop:b?l?N.scrollX||N.document.documentElement.scrollLeft:N.scrollY||N.document.documentElement.scrollTop:l?h.scrollLeft:h.scrollTop,y=i?l?i.scrollWidth:i.scrollHeight:b?l?N.document.documentElement.scrollWidth:N.document.documentElement.scrollHeight:l?h.scrollWidth:h.scrollHeight,f=i?l?i.offsetWidth:i.offsetHeight:b?l?N.innerWidth:N.innerHeight:l?h.offsetWidth:h.offsetHeight;r({scrollHeight:y,scrollTop:Math.max(C,0),viewportHeight:f}),n?.(l?no("column-gap",getComputedStyle(m).columnGap,o):no("row-gap",getComputedStyle(m).rowGap,o)),p!==null&&t(p)},[t,s,o,n,i,r,l]);return ln(d,a,c)}function bd(t,s,a,r){const o=t.length;if(o===0)return null;const n=[];for(let i=0;i{if(!c?.offsetParent)return;const d=c.getBoundingClientRect(),m=d.width;let p,h;if(s){const b=s.getBoundingClientRect(),N=d.top-b.top;h=b.height-Math.max(0,N),p=N+s.scrollTop}else{const b=i.current.ownerDocument.defaultView;h=b.innerHeight-Math.max(0,d.top),p=d.top+b.scrollY}r.current={listHeight:d.height,offsetTop:p,visibleHeight:h,visibleWidth:m},t(r.current)},[t,s]),{callbackRef:n,ref:i}=ln(o,!0,a),l=me.useCallback(()=>{o(i.current)},[o,i]);return me.useEffect(()=>{if(s){s.addEventListener("scroll",l);const d=new ResizeObserver(()=>{requestAnimationFrame(l)});return d.observe(s),()=>{s.removeEventListener("scroll",l),d.unobserve(s)}}const c=i.current?.ownerDocument.defaultView;return c?.addEventListener("scroll",l),c?.addEventListener("resize",l),()=>{c?.removeEventListener("scroll",l),c?.removeEventListener("resize",l)}},[l,s,i]),n}const At=qe(()=>{const t=Pe(),s=Pe(),a=X(0),r=Pe(),o=X(0),n=Pe(),i=Pe(),l=X(0),c=X(0),d=X(0),m=X(0),p=Pe(),h=Pe(),b=X(!1),N=X(!1),C=X(!1);return pe(W(t,ie(({scrollTop:y})=>y)),s),pe(W(t,ie(({scrollHeight:y})=>y)),i),pe(s,o),{deviation:a,fixedFooterHeight:d,fixedHeaderHeight:c,footerHeight:m,headerHeight:l,horizontalDirection:N,scrollBy:h,scrollContainerState:t,scrollHeight:i,scrollingInProgress:b,scrollTo:p,scrollTop:s,skipAnimationFrameInResizeObserver:C,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:n}},[],{singleton:!0}),Ca={lvl:0};function Ti(t,s){const a=t.length;if(a===0)return[];let{index:r,value:o}=s(t[0]);const n=[];for(let i=1;is&&(l=l.concat(Xr(o,s,a))),r>=s&&r<=a&&l.push({k:r,v:i}),r<=a&&(l=l.concat(Xr(n,s,a))),l}function Za(t){const{l:s,lvl:a,r}=t;if(r.lvl>=a-1&&s.lvl>=a-1)return t;if(a>r.lvl+1){if(Er(s))return Mi(gt(t,{lvl:a-1}));if(!et(s)&&!et(s.r))return gt(s.r,{l:gt(s,{r:s.r.l}),lvl:a,r:gt(t,{l:s.r.r,lvl:a-1})});throw new Error("Unexpected empty nodes")}if(Er(t))return Jr(gt(t,{lvl:a-1}));if(!et(r)&&!et(r.l)){const o=r.l,n=Er(o)?r.lvl-1:r.lvl;return gt(o,{l:gt(t,{lvl:a-1,r:o.l}),lvl:o.lvl+1,r:Jr(gt(r,{l:o.r,lvl:n}))})}throw new Error("Unexpected empty nodes")}function gt(t,s){return Ri(s.k!==void 0?s.k:t.k,s.v!==void 0?s.v:t.v,s.lvl!==void 0?s.lvl:t.lvl,s.l!==void 0?s.l:t.l,s.r!==void 0?s.r:t.r)}function _i(t){return et(t.r)?t.l:Za(gt(t,{r:_i(t.r)}))}function Er(t){return et(t)||t.lvl>t.r.lvl}function Ei(t){return et(t.r)?[t.k,t.v]:Ei(t.r)}function Ri(t,s,a,r=Ca,o=Ca){return{k:t,l:r,lvl:a,r:o,v:s}}function oo(t){return Jr(Mi(t))}function Mi(t){const{l:s}=t;return!et(s)&&s.lvl===t.lvl?gt(s,{r:gt(t,{l:s.r})}):t}function Jr(t){const{lvl:s,r:a}=t;return!et(a)&&!et(a.r)&&a.lvl===s&&a.r.lvl===s?gt(a,{l:gt(t,{r:a.l}),lvl:s+1}):t}function vd(t){return Ti(t,({k:s,v:a})=>({index:s,value:a}))}function Ai(t,s){return!!(t&&t.startIndex===s.startIndex&&t.endIndex===s.endIndex)}function Ta(t,s){return!!(t&&t[0]===s[0]&&t[1]===s[1])}const cn=qe(()=>({recalcInProgress:X(!1)}),[],{singleton:!0});function zi(t,s,a){return t[mr(t,s,a)]}function mr(t,s,a,r=0){let o=t.length-1;for(;r<=o;){const n=Math.floor((r+o)/2),i=t[n],l=a(i,s);if(l===0)return n;if(l===-1){if(o-r<2)return n-1;o=n-1}else{if(o===r)return n;r=n+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${s}`)}function wd(t,s,a,r){const o=mr(t,s,r),n=mr(t,a,r,o);return t.slice(o,n+1)}function Ms(t,s){return Math.round(t.getBoundingClientRect()[s])}function wr(t){return!et(t.groupOffsetTree)}function dn({index:t},s){return s===t?0:s=p||n===h)&&(t=Kr(t,p)):(d=h!==n,c=!0),m>o&&o>=p&&h!==n&&(t=Pt(t,o+1,h));d&&(t=Pt(t,i,n))}return[t,a]}function yd(t){return typeof t.groupIndex<"u"}function Sd({offset:t},s){return s===t?0:s0?l+a:l}function Li(t,s){if(!wr(s))return t;let a=0;for(;s.groupIndices[a]<=t+a;)a++;return t+a}function Di(t,s,a){if(yd(t))return s.groupIndices[t.groupIndex]+1;const r=t.index==="LAST"?a:t.index;let o=Li(r,s);return o=Math.max(0,o,Math.min(a,o)),o}function kd(t,s,a,r=0){return r>0&&(s=Math.max(s,zi(t,r,dn).offset)),Ti(wd(t,s,a,Sd),Td)}function Cd(t,[s,a,r,o]){s.length>0&&r("received item sizes",s,bt.DEBUG);const n=t.sizeTree;let i=n,l=0;if(a.length>0&&et(n)&&s.length===2){const h=s[0].size,b=s[1].size;i=a.reduce((N,C)=>Pt(Pt(N,C,h),C+1,b),i)}else[i,l]=jd(i,s);if(i===n)return t;const{lastIndex:c,lastOffset:d,lastSize:m,offsetTree:p}=Zr(t.offsetTree,l,i,o);return{groupIndices:a,groupOffsetTree:a.reduce((h,b)=>Pt(h,b,_a(b,p,o)),aa()),lastIndex:c,lastOffset:d,lastSize:m,offsetTree:p,sizeTree:i}}function Id(t){return Us(t).map(({k:s,v:a},r,o)=>{const n=o[r+1];return{endIndex:n!==void 0?n.k-1:1/0,size:a,startIndex:s}})}function io(t,s){let a=0,r=0;for(;ao.start===r&&(o.end===s||o.end===1/0)&&o.value===a}const Ed={offsetHeight:"height",offsetWidth:"width"},fs=qe(([{log:t},{recalcInProgress:s}])=>{const a=Pe(),r=Pe(),o=Et(r,0),n=Pe(),i=Pe(),l=X(0),c=X([]),d=X(void 0),m=X(void 0),p=X(void 0),h=X(void 0),b=X((g,S)=>Ms(g,Ed[S])),N=X(void 0),C=X(0),y=Nd(),f=Et(W(a,ze(c,t,C),ms(Cd,y),at()),y),w=Et(W(c,at(),ms((g,S)=>({current:S,prev:g.current}),{current:[],prev:[]}),ie(({prev:g})=>g)),[]);pe(W(c,we(g=>g.length>0),ze(f,C),ie(([g,S,v])=>{const L=g.reduce((E,j,Q)=>Pt(E,j,_a(j,S.offsetTree,v)||Q),aa());return{...S,groupIndices:g,groupOffsetTree:L}})),f),pe(W(r,ze(f),we(([g,{lastIndex:S}])=>g[{endIndex:S,size:v,startIndex:g}])),a),pe(d,m);const I=Et(W(d,ie(g=>g===void 0)),!0);pe(W(m,we(g=>g!==void 0&&et(ot(f).sizeTree)),ie(g=>{const S=ot(p),v=ot(c).length>0;return S!==void 0&&S!==0?v?[{endIndex:0,size:S,startIndex:0},{endIndex:1,size:g,startIndex:1}]:[]:[{endIndex:0,size:g,startIndex:0}]})),a),pe(W(h,we(g=>g!==void 0&&g.length>0&&et(ot(f).sizeTree)),ie(g=>{const S=[];let v=g[0],L=0;for(let E=1;Eg!==void 0&&S!==void 0),ie(([g,S,v])=>{const L=[];for(let E=0;E({changed:v!==g,sizes:v}),{changed:!1,sizes:y}),ie(g=>g.changed)));Ke(W(l,ms((g,S)=>({diff:g.prev-S,prev:S}),{diff:0,prev:0}),ie(g=>g.diff)),g=>{const{groupIndices:S}=ot(f);if(g>0)Me(s,!0),Me(n,g+io(g,S));else if(g<0){const v=ot(w);v.length>0&&(g-=io(-g,v)),Me(i,g)}}),Ke(W(l,ze(t)),([g,S])=>{g<0&&S("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},bt.ERROR)});const M=Ht(n);pe(W(n,ze(f),ie(([g,S])=>{const v=S.groupIndices.length>0,L=[],E=S.lastSize;if(v){const j=Ia(S.sizeTree,0);let Q=0,K=0;for(;Q{let Ne=ne.ranges;return ne.prevSize!==0&&(Ne=[...ne.ranges,{endIndex:re+g-1,size:ne.prevSize,startIndex:ne.prevIndex}]),{prevIndex:re+g,prevSize:he,ranges:Ne}},{prevIndex:g,prevSize:0,ranges:L}).ranges}return Us(S.sizeTree).reduce((j,{k:Q,v:K})=>({prevIndex:Q+g,prevSize:K,ranges:[...j.ranges,{endIndex:Q+g-1,size:j.prevSize,startIndex:j.prevIndex}]}),{prevIndex:0,prevSize:E,ranges:[]}).ranges})),a);const q=Ht(W(i,ze(f,C),ie(([g,{offsetTree:S},v])=>{const L=-g;return _a(L,S,v)})));return pe(W(i,ze(f,C),ie(([g,S,v])=>{if(S.groupIndices.length>0){if(et(S.sizeTree))return S;let E=aa();const j=ot(w);let Q=0,K=0,ae=0;for(;Q<-g;){ae=j[K];const ne=j[K+1]-ae-1;K++,Q+=ne+1}if(E=Us(S.sizeTree).reduce((ne,{k:re,v:he})=>Pt(ne,Math.max(0,re+g),he),E),Q!==-g){const ne=Ia(S.sizeTree,ae);E=Pt(E,0,ne);const re=os(S.sizeTree,-g+1)[1];E=Pt(E,1,re)}return{...S,sizeTree:E,...Zr(S.offsetTree,0,E,v)}}const L=Us(S.sizeTree).reduce((E,{k:j,v:Q})=>Pt(E,Math.max(0,j+g),Q),aa());return{...S,sizeTree:L,...Zr(S.offsetTree,0,L,v)}})),f),{beforeUnshiftWith:M,data:N,defaultItemSize:m,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:p,gap:C,groupIndices:c,heightEstimates:h,itemSize:b,listRefresh:D,shiftWith:i,shiftWithOffset:q,sizeRanges:a,sizes:f,statefulTotalCount:o,totalCount:r,trackItemSizes:I,unshiftWith:n}},rt(zs,cn),{singleton:!0});function Rd(t){return t.reduce((s,a)=>(s.groupIndices.push(s.totalCount),s.totalCount+=a+1,s),{groupIndices:[],totalCount:0})}const $i=qe(([{groupIndices:t,sizes:s,totalCount:a},{headerHeight:r,scrollTop:o}])=>{const n=Pe(),i=Pe(),l=Ht(W(n,ie(Rd)));return pe(W(l,ie(c=>c.totalCount)),a),pe(W(l,ie(c=>c.groupIndices)),t),pe(W(pt(o,s,r),we(([c,d])=>wr(d)),ie(([c,d,m])=>os(d.groupOffsetTree,Math.max(c-m,0),"v")[0]),at(),ie(c=>[c])),i),{groupCounts:n,topItemsIndexes:i}},rt(fs,At)),Ls=qe(([{log:t}])=>{const s=X(!1),a=Ht(W(s,we(r=>r),at()));return Ke(s,r=>{r&&ot(t)("props updated",{},bt.DEBUG)}),{didMount:a,propsReady:s}},rt(zs),{singleton:!0}),Md=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Fi(t){const s=typeof t=="number"?{index:t}:t;return s.align||(s.align="start"),(!s.behavior||!Md)&&(s.behavior="auto"),s.offset===void 0&&(s.offset=0),s}const za=qe(([{gap:t,listRefresh:s,sizes:a,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:n,footerHeight:i,headerHeight:l,scrollingInProgress:c,scrollTo:d,smoothScrollTargetReached:m,viewportHeight:p},{log:h}])=>{const b=Pe(),N=Pe(),C=X(0);let y=null,f=null,w=null;function I(){y!==null&&(y(),y=null),w!==null&&(w(),w=null),f&&(clearTimeout(f),f=null),Me(c,!1)}return pe(W(b,ze(a,p,r,C,l,i,h),ze(t,n,o),ie(([[D,M,q,g,S,v,L,E],j,Q,K])=>{const ae=Fi(D),{align:ne,behavior:re,offset:he}=ae,Ne=g-1,de=Di(ae,M,Ne);let ue=_a(de,M.offsetTree,j)+v;ne==="end"?(ue+=Q+os(M.sizeTree,de)[1]-q+K,de===Ne&&(ue+=L)):ne==="center"?ue+=(Q+os(M.sizeTree,de)[1]-q+K)/2:ue-=S,he!==void 0&&he!==0&&(ue+=he);const H=Z=>{I(),Z?(E("retrying to scroll to",{location:D},bt.DEBUG),Me(b,D)):(Me(N,!0),E("list did not change, scroll successful",{},bt.DEBUG))};if(I(),re==="smooth"){let Z=!1;w=Ke(s,se=>{Z=Z||se}),y=ns(m,()=>{H(Z)})}else y=ns(W(s,Ad(150)),H);return f=setTimeout(()=>{I()},1200),Me(c,!0),E("scrolling from index to",{behavior:re,index:de,top:ue},bt.DEBUG),{behavior:re,top:ue}})),d),{scrollTargetReached:N,scrollToIndex:b,topListHeight:C}},rt(fs,At,zs),{singleton:!0});function Ad(t){return s=>{const a=setTimeout(()=>{s(!1)},t);return r=>{r&&(s(!0),clearTimeout(a))}}}function mn(t,s){t===0?s():requestAnimationFrame(()=>{mn(t-1,s)})}function un(t,s){const a=s-1;return typeof t=="number"?t:t.index==="LAST"?a:t.index}const La=qe(([{defaultItemSize:t,listRefresh:s,sizes:a},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:n},{didMount:i}])=>{const l=X(!0),c=X(0),d=X(!0);return pe(W(i,ze(c),we(([m,p])=>p!==0),cs(!1)),l),pe(W(i,ze(c),we(([m,p])=>p!==0),cs(!1)),d),Ke(W(pt(s,i),ze(l,a,t,d),we(([[,m],p,{sizeTree:h},b,N])=>m&&(!et(h)||nn(b))&&!p&&!N),ze(c)),([,m])=>{ns(o,()=>{Me(d,!0)}),mn(4,()=>{ns(r,()=>{Me(l,!0)}),Me(n,m)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:c,scrolledToInitialItem:l}},rt(fs,At,za,Ls),{singleton:!0});function Oi(t,s){return Math.abs(t-s)<1.01}const Ea="up",ya="down",zd="none",Ld={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Dd=0,Da=qe(([{footerHeight:t,headerHeight:s,scrollBy:a,scrollContainerState:r,scrollTop:o,viewportHeight:n}])=>{const i=X(!1),l=X(!0),c=Pe(),d=Pe(),m=X(4),p=X(Dd),h=Et(W(Yr(W(ve(o),Qs(1),cs(!0)),W(ve(o),Qs(1),cs(!1),ro(100))),at()),!1),b=Et(W(Yr(W(a,cs(!0)),W(a,cs(!1),ro(200))),at()),!1);pe(W(pt(ve(o),ve(p)),ie(([w,I])=>w<=I),at()),l),pe(W(l,js(50)),d);const N=Ht(W(pt(r,ve(n),ve(s),ve(t),ve(m)),ms((w,[{scrollHeight:I,scrollTop:D},M,q,g,S])=>{const v=D+M-I>-S,L={scrollHeight:I,scrollTop:D,viewportHeight:M};if(v){let j,Q;return D>w.state.scrollTop?(j="SCROLLED_DOWN",Q=w.state.scrollTop-D):(j="SIZE_DECREASED",Q=w.state.scrollTop-D||w.scrollTopDelta),{atBottom:!0,atBottomBecause:j,scrollTopDelta:Q,state:L}}let E;return L.scrollHeight>w.state.scrollHeight?E="SIZE_INCREASED":Mw!==void 0&&w.atBottom===I.atBottom))),C=Et(W(r,ms((w,{scrollHeight:I,scrollTop:D,viewportHeight:M})=>{if(!Oi(w.scrollHeight,I)){const q=I-(D+M)<1;return w.scrollTop!==D&&q?{changed:!0,jump:w.scrollTop-D,scrollHeight:I,scrollTop:D}:{changed:!0,jump:0,scrollHeight:I,scrollTop:D}}return{changed:!1,jump:0,scrollHeight:I,scrollTop:D}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),we(w=>w.changed),ie(w=>w.jump)),0);pe(W(N,ie(w=>w.atBottom)),i),pe(W(i,js(50)),c);const y=X(ya);pe(W(r,ie(({scrollTop:w})=>w),at(),ms((w,I)=>ot(b)?{direction:w.direction,prevScrollTop:I}:{direction:Iw.direction)),y),pe(W(r,js(50),cs(zd)),y);const f=X(0);return pe(W(h,we(w=>!w),cs(0)),f),pe(W(o,js(100),ze(h),we(([w,I])=>I),ms(([w,I],[D])=>[I,D],[0,0]),ie(([w,I])=>I-w)),f),{atBottomState:N,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:d,atTopThreshold:p,isAtBottom:i,isAtTop:l,isScrolling:h,lastJumpDueToItemResize:C,scrollDirection:y,scrollVelocity:f}},rt(At)),Ra="top",Ma="bottom",lo="none";function co(t,s,a){return typeof t=="number"?a===Ea&&s===Ra||a===ya&&s===Ma?t:0:a===Ea?s===Ra?t.main:t.reverse:s===Ma?t.main:t.reverse}function mo(t,s){return typeof t=="number"?t:t[s]??0}const xn=qe(([{deviation:t,fixedHeaderHeight:s,headerHeight:a,scrollTop:r,viewportHeight:o}])=>{const n=Pe(),i=X(0),l=X(0),c=X(0),d=Et(W(pt(ve(r),ve(o),ve(a),ve(n,Ta),ve(c),ve(i),ve(s),ve(t),ve(l)),ie(([m,p,h,[b,N],C,y,f,w,I])=>{const D=m-w,M=y+f,q=Math.max(h-D,0);let g=lo;const S=mo(I,Ra),v=mo(I,Ma);return b-=w,b+=h+f,N+=h+f,N-=w,b>m+M-S&&(g=Ea),Nm!==null),at(Ta)),[0,0]);return{increaseViewportBy:l,listBoundary:n,overscan:c,topListHeight:i,visibleRange:d}},rt(At),{singleton:!0});function $d(t,s,a){if(wr(s)){const r=Li(t,s);return[{index:os(s.groupOffsetTree,r)[0],offset:0,size:0},{data:a?.[0],index:r,offset:0,size:0}]}return[{data:a?.[0],index:t,offset:0,size:0}]}const Rr={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function er(t,s,a,r,o,n){const{lastIndex:i,lastOffset:l,lastSize:c}=o;let d=0,m=0;if(t.length>0){d=t[0].offset;const C=t[t.length-1];m=C.offset+C.size}const p=a-i,h=l+p*c+(p-1)*r,b=d,N=h-m;return{bottom:m,firstItemIndex:n,items:uo(t,o,n),offsetBottom:N,offsetTop:d,top:b,topItems:uo(s,o,n),topListHeight:s.reduce((C,y)=>y.size+C,0),totalCount:a}}function Bi(t,s,a,r,o,n){let i=0;if(a.groupIndices.length>0)for(const m of a.groupIndices){if(m-i>=t)break;i++}const l=t+i,c=un(s,l),d=Array.from({length:l}).map((m,p)=>({data:n[p+c],index:p+c,offset:0,size:0}));return er(d,[],l,o,a,r)}function uo(t,s,a){if(t.length===0)return[];if(!wr(s))return t.map(d=>({...d,index:d.index+a,originalIndex:d.index}));const r=t[0].index,o=t[t.length-1].index,n=[],i=ra(s.groupOffsetTree,r,o);let l,c=0;for(const d of t){(!l||l.end{const C=X([]),y=X(0),f=Pe(),w=X(0);pe(n.topItemsIndexes,C);const I=Et(W(pt(b,N,ve(c,Ta),ve(o),ve(r),ve(d),m,ve(C),ve(s),ve(a),ve(w),t),we(([g,S,,v,,,,,,,,L])=>{const E=L!==void 0&&L.length!==v;return g&&!S&&!E}),ie(([,,[g,S],v,L,E,j,Q,K,ae,ne,re])=>{const he=L,{offsetTree:Ne,sizeTree:de}=he,ue=ot(y);if(v===0)return{...Rr,totalCount:v};if(g===0&&S===0)return ue===0?{...Rr,totalCount:v}:Bi(ue,E,L,K,ae,re||[]);if(et(de))return ue>0?null:er($d(un(E,v),he,re),[],v,ae,he,K);const H=[];if(Q.length>0){const te=Q[0],_=Q[Q.length-1];let V=0;for(const k of ra(de,te,_)){const O=k.value,T=Math.max(k.start,te),B=Math.min(k.end,_);for(let G=T;G<=B;G++)H.push({data:re?.[G],index:G,offset:V,size:O}),V+=O}}if(!j)return er([],H,v,ae,he,K);const Z=Q.length>0?Q[Q.length-1]+1:0,se=kd(Ne,g,S,Z);if(se.length===0)return null;const Re=v-1,$e=vr([],te=>{for(const _ of se){const V=_.value;let k=V.offset,O=_.start;const T=V.size;if(V.offset=S);G++)te.push({data:re?.[G],index:G,offset:k,size:T}),k+=T+ae}}),He=xo(ne,Ra),U=xo(ne,Ma);if($e.length>0&&(He>0||U>0)){const te=$e[0],_=$e[$e.length-1];if(He>0&&te.index>Z){const V=Math.min(He,te.index-Z),k=[];let O=te.offset;for(let T=te.index-1;T>=te.index-V;T--){const B=ra(de,T,T)[0]?.value??te.size;O-=B+ae,k.unshift({data:re?.[T],index:T,offset:O,size:B})}$e.unshift(...k)}if(U>0&&_.indexg!==null),at()),Rr);pe(W(t,we(nn),ie(g=>g?.length)),o),pe(W(I,ie(g=>g.topListHeight)),p),pe(p,l),pe(W(I,ie(g=>[g.top,g.bottom])),i),pe(W(I,ie(g=>g.items)),f);const D=Ht(W(I,we(({items:g})=>g.length>0),ze(o,t),we(([{items:g},S])=>g[g.length-1].originalIndex===S-1),ie(([,g,S])=>[g-1,S]),at(Ta),ie(([g])=>g))),M=Ht(W(I,js(200),we(({items:g,topItems:S})=>g.length>0&&g[0].originalIndex===S.length),ie(({items:g})=>g[0].index),at())),q=Ht(W(I,we(({items:g})=>g.length>0),ie(({items:g})=>{let S=0,v=g.length-1;for(;g[S].type==="group"&&SS;)v--;return{endIndex:g[v].index,startIndex:g[S].index}}),at(Ai)));return{endReached:D,initialItemCount:y,itemsRendered:f,listState:I,minOverscanItemCount:w,rangeChanged:q,startReached:M,topItemsIndexes:C,...h}},rt(fs,$i,xn,La,za,Da,Ls,cn),{singleton:!0}),Pi=qe(([{fixedFooterHeight:t,fixedHeaderHeight:s,footerHeight:a,headerHeight:r},{listState:o}])=>{const n=Pe(),i=Et(W(pt(a,t,r,s,o),ie(([l,c,d,m,p])=>l+c+d+m+p.offsetBottom+p.bottom)),0);return pe(ve(i),n),{totalListHeight:i,totalListHeightChanged:n}},rt(At,qs),{singleton:!0}),Fd=qe(([{viewportHeight:t},{totalListHeight:s}])=>{const a=X(!1),r=Et(W(pt(a,t,s),we(([o])=>o),ie(([,o,n])=>Math.max(0,o-n)),js(0),at()),0);return{alignToBottom:a,paddingTopAddition:r}},rt(At,Pi),{singleton:!0}),Hi=qe(()=>({context:X(null)})),Od=({itemBottom:t,itemTop:s,locationParams:{align:a,behavior:r,...o},viewportBottom:n,viewportTop:i})=>sn?{...o,align:a??"end",...r!==void 0?{behavior:r}:{}}:null,Ui=qe(([{gap:t,sizes:s,totalCount:a},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:n,scrollingInProgress:i,scrollTop:l,viewportHeight:c},{scrollToIndex:d}])=>{const m=Pe();return pe(W(m,ze(s,c,a,n,o,r,l),ze(t),ie(([[p,h,b,N,C,y,f,w],I])=>{const{calculateViewLocation:D=Od,done:M,...q}=p,g=Di(p,h,N-1),S=_a(g,h.offsetTree,I)+C+y,v=S+os(h.sizeTree,g)[1],L=w+y,E=w+b-f,j=D({itemBottom:v,itemTop:S,locationParams:q,viewportBottom:E,viewportTop:L});return j!==null?M&&ns(W(i,we(Q=>!Q),Qs(ot(i)?1:2)),M):M?.(),j}),we(p=>p!==null)),d),{scrollIntoView:m}},rt(fs,At,za,qs,zs),{singleton:!0});function po(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const Bd=(t,s)=>typeof t=="function"?po(t(s)):s&&po(t),Pd=qe(([{listRefresh:t,totalCount:s,fixedItemSize:a,data:r},{atBottomState:o,isAtBottom:n},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:c,propsReady:d},{log:m},{scrollingInProgress:p},{context:h},{scrollIntoView:b}])=>{const N=X(!1),C=Pe();let y=null;function f(M){Me(i,{align:"end",behavior:M,index:"LAST"})}Ke(W(pt(W(ve(s),Qs(1)),c),ze(ve(N),n,l,p),ie(([[M,q],g,S,v,L])=>{let E=q&&v,j="auto";return E&&(j=Bd(g,S||L),E=E&&j!==!1),{followOutputBehavior:j,shouldFollow:E,totalCount:M}}),we(({shouldFollow:M})=>M)),({followOutputBehavior:M,totalCount:q})=>{y!==null&&(y(),y=null),ot(a)!==void 0?requestAnimationFrame(()=>{ot(m)("following output to ",{totalCount:q},bt.DEBUG),f(M)}):y=ns(t,()=>{ot(m)("following output to ",{totalCount:q},bt.DEBUG),f(M),y=null})});function w(M){const q=ns(o,g=>{M&&!g.atBottom&&g.notAtBottomBecause==="SIZE_INCREASED"&&y===null&&(ot(m)("scrolling to bottom due to increased size",{},bt.DEBUG),f("auto"))});setTimeout(q,100)}Ke(W(pt(ve(N),s,d),we(([M,,q])=>M!==!1&&q),ms(({value:M},[,q])=>({refreshed:M===q,value:q}),{refreshed:!1,value:0}),we(({refreshed:M})=>M),ze(N,s)),([,M])=>{ot(l)&&w(M!==!1)}),Ke(C,()=>{w(ot(N)!==!1)}),Ke(pt(ve(N),o),([M,q])=>{M!==!1&&!q.atBottom&&q.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")});const I=X(null),D=Pe();return pe(Yr(W(ve(r),ie(M=>M?.length??0)),W(ve(s))),D),Ke(W(pt(W(D,Qs(1)),c),ze(ve(I),l,p,h),ie(([[M,q],g,S,v,L])=>q&&S&&g?.({context:L,totalCount:M,scrollingInProgress:v})),we(M=>!!M),js(0)),M=>{y!==null&&(y(),y=null),ot(a)!==void 0?requestAnimationFrame(()=>{ot(m)("scrolling into view",{}),Me(b,M)}):y=ns(t,()=>{ot(m)("scrolling into view",{}),Me(b,M),y=null})}),{autoscrollToBottom:C,followOutput:N,scrollIntoViewOnChange:I}},rt(fs,Da,za,La,Ls,zs,At,Hi,Ui)),Hd=qe(([{data:t,firstItemIndex:s,gap:a,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:n,listState:i},{didMount:l}])=>(pe(W(l,ze(n),we(([,c])=>c!==0),ze(o,r,s,a,t),ie(([[,c],d,m,p,h,b=[]])=>Bi(c,d,m,p,h,b))),i),{}),rt(fs,La,qs,Ls),{singleton:!0}),Ud=qe(([{didMount:t},{scrollTo:s},{listState:a}])=>{const r=X(0);return Ke(W(t,ze(r),we(([,o])=>o!==0),ie(([,o])=>({top:o}))),o=>{ns(W(a,Qs(1),we(n=>n.items.length>1)),()=>{requestAnimationFrame(()=>{Me(s,o)})})}),{initialScrollTop:r}},rt(Ls,At,qs),{singleton:!0}),Gi=qe(([{scrollVelocity:t}])=>{const s=X(!1),a=Pe(),r=X(!1);return pe(W(t,ze(r,s,a),we(([o,n])=>n!==!1&&n!==void 0),ie(([o,n,i,l])=>{const{enter:c,exit:d}=n;if(i){if(d(o,l))return!1}else if(c(o,l))return!0;return i}),at()),s),Ke(W(pt(s,t,a),ze(r)),([[o,n,i],l])=>{o&&l!==!1&&l!==void 0&&l.change&&l.change(n,i)}),{isSeeking:s,scrollSeekConfiguration:r,scrollSeekRangeChanged:a,scrollVelocity:t}},rt(Da),{singleton:!0}),pn=qe(([{scrollContainerState:t,scrollTo:s}])=>{const a=Pe(),r=Pe(),o=Pe(),n=X(!1),i=X(void 0);return pe(W(pt(a,r),ie(([{scrollTop:l,viewportHeight:c},{offsetTop:d,listHeight:m}])=>({scrollHeight:m,scrollTop:Math.max(0,l-d),viewportHeight:c}))),t),pe(W(s,ze(r),ie(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),o),{customScrollParent:i,useWindowScroll:n,windowScrollContainerState:a,windowScrollTo:o,windowViewportRect:r}},rt(At)),Gd=qe(([{sizeRanges:t,sizes:s},{headerHeight:a,scrollTop:r},{initialTopMostItemIndex:o},{didMount:n},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:c}])=>{const d=Pe(),m=X(void 0),p=X(null),h=X(null);return pe(l,p),pe(c,h),Ke(W(d,ze(s,r,i,p,h,a)),([b,N,C,y,f,w,I])=>{const D=Id(N.sizeTree);y&&f!==null&&w!==null&&(C=f.scrollTop-w.offsetTop),C-=I,b({ranges:D,scrollTop:C})}),pe(W(m,we(nn),ie(Qd)),o),pe(W(n,ze(m),we(([,b])=>b!==void 0),at(),ie(([,b])=>b.ranges)),t),{getState:d,restoreStateFrom:m}},rt(fs,At,La,Ls,pn));function Qd(t){return{align:"start",index:0,offset:t.scrollTop}}const Vd=qe(([{topItemsIndexes:t}])=>{const s=X(0);return pe(W(s,we(a=>a>=0),ie(a=>Array.from({length:a}).map((r,o)=>o))),t),{topItemCount:s}},rt(qs));function Qi(t){let s=!1,a;return(()=>(s||(s=!0,a=t()),a))}const Wd=Qi(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),qd=qe(([{deviation:t,scrollBy:s,scrollingInProgress:a,scrollTop:r},{isAtBottom:o,isScrolling:n,lastJumpDueToItemResize:i,scrollDirection:l},{listState:c},{beforeUnshiftWith:d,gap:m,shiftWithOffset:p,sizes:h},{log:b},{recalcInProgress:N}])=>{const C=Ht(W(c,ze(i),ms(([,f,w,I],[{bottom:D,items:M,offsetBottom:q,totalCount:g},S])=>{const v=D+q;let L=0;return w===g&&f.length>0&&M.length>0&&(M[0].originalIndex===0&&f[0].originalIndex===0||(L=v-I,L!==0&&(L+=S))),[L,M,g,v]},[0,[],0,0]),we(([f])=>f!==0),ze(r,l,a,o,b,N),we(([,f,w,I,,,D])=>!D&&!I&&f!==0&&w===Ea),ie(([[f],,,,,w])=>(w("Upward scrolling compensation",{amount:f},bt.DEBUG),f))));function y(f){f>0?(Me(s,{behavior:"auto",top:-f}),Me(t,0)):(Me(t,0),Me(s,{behavior:"auto",top:-f}))}return Ke(W(C,ze(t,n)),([f,w,I])=>{I&&Wd()?Me(t,w-f):y(-f)}),Ke(W(pt(Et(n,!1),t,N),we(([f,w,I])=>!f&&!I&&w!==0),ie(([f,w])=>w),js(1)),y),pe(W(p,ie(f=>({top:-f}))),s),Ke(W(d,ze(h,m),ie(([f,{groupIndices:w,lastSize:I,sizeTree:D},M])=>{function q(E){return E*(I+M)}if(w.length===0)return q(f);let g=0;const S=Ia(D,0);let v=0,L=0;for(;vf&&(g-=S,E=f-v+1),v+=E,g+=q(E),L++}return g})),f=>{Me(t,f),requestAnimationFrame(()=>{Me(s,{top:f}),requestAnimationFrame(()=>{Me(t,0),Me(N,!1)})})}),{deviation:t}},rt(At,Da,qs,fs,zs,cn)),Yd=qe(([t,s,a,r,o,n,i,l,c,d,m])=>({...t,...s,...a,...r,...o,...n,...i,...l,...c,...d,...m}),rt(xn,Hd,Ls,Gi,Pi,Ud,Fd,pn,Ui,zs,Hi)),Vi=qe(([{data:t,defaultItemSize:s,firstItemIndex:a,fixedItemSize:r,fixedGroupSize:o,gap:n,groupIndices:i,heightEstimates:l,itemSize:c,sizeRanges:d,sizes:m,statefulTotalCount:p,totalCount:h,trackItemSizes:b},{initialItemFinalLocationReached:N,initialTopMostItemIndex:C,scrolledToInitialItem:y},f,w,I,D,{scrollToIndex:M},q,{topItemCount:g},{groupCounts:S},v])=>{const{listState:L,minOverscanItemCount:E,topItemsIndexes:j,rangeChanged:Q,...K}=D;return pe(Q,v.scrollSeekRangeChanged),pe(W(v.windowViewportRect,ie(ae=>ae.visibleHeight)),f.viewportHeight),{data:t,defaultItemHeight:s,firstItemIndex:a,fixedItemHeight:r,fixedGroupHeight:o,gap:n,groupCounts:S,heightEstimates:l,initialItemFinalLocationReached:N,initialTopMostItemIndex:C,scrolledToInitialItem:y,sizeRanges:d,topItemCount:g,topItemsIndexes:j,totalCount:h,...I,groupIndices:i,itemSize:c,listState:L,minOverscanItemCount:E,scrollToIndex:M,statefulTotalCount:p,trackItemSizes:b,rangeChanged:Q,...K,...v,...f,sizes:m,...w}},rt(fs,La,At,Gd,Pd,qs,za,qd,Vd,$i,Yd));function Kd(t,s){const a={},r={};let o=0;const n=t.length;for(;o(f[w]=I=>{const D=y[s.methods[w]];Me(D,I)},f),{})}function m(y){return i.reduce((f,w)=>(f[w]=ud(y[s.events[w]]),f),{})}const p=me.forwardRef(function(y,f){const{children:w,...I}=y,[D]=me.useState(()=>vr(pd(t),g=>{c(g,I)})),[M]=me.useState(ao(m,D));Qa(()=>{for(const g of i)g in I&&Ke(M[g],I[g]);return()=>{Object.values(M).map(on)}},[I,M,D]),Qa(()=>{c(D,I)}),me.useImperativeHandle(f,so(d(D)));const q=a;return e.jsx(l.Provider,{value:D,children:a!==void 0?e.jsx(q,{...Kd([...r,...o,...i],I),children:w}):w})}),h=y=>{const f=me.useContext(l);return me.useCallback(w=>{Me(f[y],w)},[f,y])},b=y=>{const f=me.useContext(l)[y],w=me.useCallback(I=>Ke(f,I),[f]);return me.useSyncExternalStore(w,()=>ot(f),()=>ot(f))},N=y=>{const f=me.useContext(l)[y],[w,I]=me.useState(ao(ot,f));return Qa(()=>Ke(f,D=>{D!==w&&I(so(D))}),[f,w]),w},C=parseInt(me.version)>=18?b:N;return{Component:p,useEmitter:(y,f)=>{const w=me.useContext(l)[y];Qa(()=>Ke(w,f),[f,w])},useEmitterValue:C,usePublisher:h}}const qi=me.createContext(void 0),Yi=me.createContext(void 0),Mr="-webkit-sticky",ho="sticky",hn=Qi(()=>{if(typeof document>"u")return ho;const t=document.createElement("div");return t.style.position=Mr,t.style.position===Mr?Mr:ho}),Ki=typeof document<"u"?me.useLayoutEffect:me.useEffect;function Ar(t){return"self"in t}function Xd(t){return"body"in t}function Xi(t,s,a,r=ca,o,n){const i=me.useRef(null),l=me.useRef(null),c=me.useRef(null),d=me.useCallback(h=>{let b,N,C;const y=h.target;if(Xd(y)||Ar(y)){const w=Ar(y)?y:y.defaultView;C=n===!0?w.scrollX:w.scrollY,b=n===!0?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight,N=n===!0?w.innerWidth:w.innerHeight}else C=n===!0?y.scrollLeft:y.scrollTop,b=n===!0?y.scrollWidth:y.scrollHeight,N=n===!0?y.offsetWidth:y.offsetHeight;const f=()=>{t({scrollHeight:b,scrollTop:Math.max(C,0),viewportHeight:N})};h.suppressFlushSync===!0?f():Ur.flushSync(f),l.current!==null&&(C===l.current||C<=0||C===b-N)&&(l.current=null,s(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,s,n]);me.useEffect(()=>{const h=o||i.current;return r(o||i.current),d({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",d,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",d)}},[i,d,a,r,o]);function m(h){const b=i.current;if(!b||(n===!0?"offsetWidth"in b&&b.offsetWidth===0:"offsetHeight"in b&&b.offsetHeight===0))return;const N=h.behavior==="smooth";let C,y,f;Ar(b)?(y=Math.max(Ms(b.document.documentElement,n===!0?"width":"height"),n===!0?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight),C=n===!0?b.innerWidth:b.innerHeight,f=n===!0?window.scrollX:window.scrollY):(y=b[n===!0?"scrollWidth":"scrollHeight"],C=Ms(b,n===!0?"width":"height"),f=b[n===!0?"scrollLeft":"scrollTop"]);const w=y-C;if(h.top=Math.ceil(Math.max(Math.min(w,h.top),0)),Oi(C,y)||h.top===f){t({scrollHeight:y,scrollTop:f,viewportHeight:C}),N&&s(!0);return}N?(l.current=h.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,l.current=null,s(!0)},1e3)):l.current=null,n===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},left:h.top}),b.scrollTo(h)}function p(h){n===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},...h.top!==void 0?{left:h.top}:{}}),i.current.scrollBy(h)}return{scrollByCallback:p,scrollerRef:i,scrollToCallback:m}}function fn(t){return t}const Jd=qe(()=>{const t=X(l=>`Item ${l}`),s=X(l=>`Group ${l}`),a=X({}),r=X(fn),o=X("div"),n=X(ca),i=(l,c=null)=>Et(W(a,ie(d=>d[l]),at()),c);return{components:a,computeItemKey:r,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:s,HeaderComponent:i("Header"),HeaderFooterTag:o,ItemComponent:i("Item","div"),itemContent:t,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:n,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),Zd=qe(([t,s])=>({...t,...s}),rt(Vi,Jd)),em=({height:t})=>e.jsx("div",{style:{height:t}}),tm={overflowAnchor:"none",position:hn(),zIndex:1},Ji={overflowAnchor:"none"},sm={...Ji,display:"inline-block",height:"100%"},fo=me.memo(function({showTopList:t=!1}){const s=je("listState"),a=qt("sizeRanges"),r=je("useWindowScroll"),o=je("customScrollParent"),n=qt("windowScrollContainerState"),i=qt("scrollContainerState"),l=o||r?n:i,c=je("itemContent"),d=je("context"),m=je("groupContent"),p=je("trackItemSizes"),h=je("itemSize"),b=je("log"),N=qt("gap"),C=je("horizontalDirection"),{callbackRef:y}=gd(a,h,p,t?ca:l,b,N,o,C,je("skipAnimationFrameInResizeObserver")),[f,w]=me.useState(0);bn("deviation",K=>{f!==K&&w(K)});const I=je("EmptyPlaceholder"),D=je("ScrollSeekPlaceholder")??em,M=je("ListComponent"),q=je("ItemComponent"),g=je("GroupComponent"),S=je("computeItemKey"),v=je("isSeeking"),L=je("groupIndices").length>0,E=je("alignToBottom"),j=je("initialItemFinalLocationReached"),Q=t?{}:{boxSizing:"border-box",...C?{display:"inline-block",height:"100%",marginLeft:f!==0?f:E?"auto":0,paddingLeft:s.offsetTop,paddingRight:s.offsetBottom,whiteSpace:"nowrap"}:{marginTop:f!==0?f:E?"auto":0,paddingBottom:s.offsetBottom,paddingTop:s.offsetTop},...j?{}:{visibility:"hidden"}};return!t&&s.totalCount===0&&I!==null&&I!==void 0?e.jsx(I,{...Tt(I,d)}):e.jsx(M,{...Tt(M,d),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:y,style:Q,children:(t?s.topItems:s.items).map(K=>{const ae=K.originalIndex,ne=S(ae+s.firstItemIndex,K.data,d);return v?u.createElement(D,{...Tt(D,d),height:K.size,index:K.index,key:ne,type:K.type||"item",...K.type==="group"?{}:{groupIndex:K.groupIndex}}):K.type==="group"?u.createElement(g,{...Tt(g,d),"data-index":ae,"data-item-index":K.index,"data-known-size":K.size,key:ne,style:tm},m(K.index,d)):u.createElement(q,{...Tt(q,d),...om(q,K.data),"data-index":ae,"data-item-group-index":K.groupIndex,"data-item-index":K.index,"data-known-size":K.size,key:ne,style:C?sm:Ji},L?c(K.index,K.groupIndex,K.data,d):c(K.index,K.data,d))})})}),am={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},rm={outline:"none",overflowX:"auto",position:"relative"},gn=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),Zi=(t,s,a=0)=>({...gn(t),position:s?"relative":"absolute",top:s?-a:0}),nm={position:hn(),top:0,width:"100%",zIndex:1};function Tt(t,s){if(typeof t!="string")return{context:s}}function om(t,s){return{item:typeof t=="string"?void 0:s}}const im=me.memo(function(){const t=je("HeaderComponent"),s=qt("headerHeight"),a=je("HeaderFooterTag"),r=Ws(me.useMemo(()=>n=>{s(Ms(n,"height"))},[s]),!0,je("skipAnimationFrameInResizeObserver")),o=je("context");return t!=null?e.jsx(a,{ref:r,children:e.jsx(t,{...Tt(t,o)})}):null}),lm=me.memo(function(){const t=je("FooterComponent"),s=qt("footerHeight"),a=je("HeaderFooterTag"),r=Ws(me.useMemo(()=>n=>{s(Ms(n,"height"))},[s]),!0,je("skipAnimationFrameInResizeObserver")),o=je("context");return t!=null?e.jsx(a,{ref:r,children:e.jsx(t,{...Tt(t,o)})}):null});function el({useEmitter:t,useEmitterValue:s,usePublisher:a}){return me.memo(function({children:r,style:o,context:n,...i}){const l=a("scrollContainerState"),c=s("ScrollerComponent"),d=a("smoothScrollTargetReached"),m=s("scrollerRef"),p=s("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:b,scrollToCallback:N}=Xi(l,d,c,m,void 0,p);return t("scrollTo",N),t("scrollBy",h),e.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:b,style:{...p?rm:am,...o},tabIndex:0,...i,...Tt(c,n),children:r})})}function tl({useEmitter:t,useEmitterValue:s,usePublisher:a}){return me.memo(function({children:r,style:o,context:n,...i}){const l=a("windowScrollContainerState"),c=s("ScrollerComponent"),d=a("smoothScrollTargetReached"),m=s("totalListHeight"),p=s("deviation"),h=s("customScrollParent"),b=me.useRef(null),N=s("scrollerRef"),{scrollByCallback:C,scrollerRef:y,scrollToCallback:f}=Xi(l,d,c,N,h);return Ki(()=>(y.current=h||b.current?.ownerDocument.defaultView,()=>{y.current=null}),[y,h]),t("windowScrollTo",f),t("scrollBy",C),e.jsx(c,{ref:b,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...m!==0?{height:m+p}:void 0},...i,...Tt(c,n),children:r})})}const cm=({children:t})=>{const s=me.useContext(qi),a=qt("viewportHeight"),r=qt("fixedItemHeight"),o=je("alignToBottom"),n=je("horizontalDirection"),i=me.useMemo(()=>ki(a,c=>Ms(c,n?"width":"height")),[a,n]),l=Ws(i,!0,je("skipAnimationFrameInResizeObserver"));return me.useEffect(()=>{s&&(a(s.viewportHeight),r(s.itemHeight))},[s,a,r]),e.jsx("div",{"data-viewport-type":"element",ref:l,style:gn(o),children:t})},dm=({children:t})=>{const s=me.useContext(qi),a=qt("windowViewportRect"),r=qt("fixedItemHeight"),o=je("customScrollParent"),n=je("useWindowScroll"),i=je("topListHeight"),l=Ii(a,o,je("skipAnimationFrameInResizeObserver")),c=je("alignToBottom");return me.useEffect(()=>{s&&(r(s.itemHeight),a({listHeight:0,offsetTop:0,visibleHeight:s.viewportHeight,visibleWidth:100}))},[s,a,r]),e.jsx("div",{"data-viewport-type":"window",ref:l,style:Zi(c,n,i),children:t})},mm=({children:t})=>{const s=je("TopItemListComponent")??"div",a=je("headerHeight"),r={...nm,marginTop:`${a}px`},o=je("context");return e.jsx(s,{style:r,...Tt(s,o),children:t})},um=me.memo(function(t){const s=je("useWindowScroll"),a=je("topItemsIndexes").length>0,r=je("customScrollParent"),o=je("context");return e.jsxs(r||s?hm:pm,{...t,context:o,children:[a&&e.jsx(mm,{children:e.jsx(fo,{showTopList:!0})}),e.jsxs(r||s?dm:cm,{children:[e.jsx(im,{}),e.jsx(fo,{}),e.jsx(lm,{})]})]})}),{Component:xm,useEmitter:bn,useEmitterValue:je,usePublisher:qt}=Wi(Zd,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},um),pm=el({useEmitter:bn,useEmitterValue:je,usePublisher:qt}),hm=tl({useEmitter:bn,useEmitterValue:je,usePublisher:qt}),fm=xm,gm=qe(()=>{const t=X(d=>e.jsxs("td",{children:["Item $",d]})),s=X(null),a=X(d=>e.jsxs("td",{colSpan:1e3,children:["Group ",d]})),r=X(null),o=X(null),n=X({}),i=X(fn),l=X(ca),c=(d,m=null)=>Et(W(n,ie(p=>p[d]),at()),m);return{components:n,computeItemKey:i,context:s,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:o,fixedHeaderContent:r,itemContent:t,groupContent:a,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});rt(Vi,gm);hn();const go={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},bm={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:bo,floor:ur,max:Sa,min:zr,round:vo}=Math;function wo(t,s,a){return Array.from({length:s-t+1}).map((r,o)=>({data:a===null?null:a[o+t],index:o+t}))}function vm(t){return{...bm,items:t}}function Va(t,s){return t!==void 0&&t.width===s.width&&t.height===s.height}function wm(t,s){return t!==void 0&&t.column===s.column&&t.row===s.row}const Nm=qe(([{increaseViewportBy:t,listBoundary:s,overscan:a,visibleRange:r},{footerHeight:o,headerHeight:n,scrollBy:i,scrollContainerState:l,scrollTo:c,scrollTop:d,smoothScrollTargetReached:m,viewportHeight:p},h,b,{didMount:N,propsReady:C},{customScrollParent:y,useWindowScroll:f,windowScrollContainerState:w,windowScrollTo:I,windowViewportRect:D},M])=>{const q=X(0),g=X(0),S=X(go),v=X({height:0,width:0}),L=X({height:0,width:0}),E=Pe(),j=Pe(),Q=X(0),K=X(null),ae=X({column:0,row:0}),ne=Pe(),re=Pe(),he=X(!1),Ne=X(0),de=X(!0),ue=X(!1),H=X(!1);Ke(W(N,ze(Ne),we(([U,te])=>te!==0)),()=>{Me(de,!1)}),Ke(W(pt(N,de,L,v,Ne,ue),we(([U,te,_,V,,k])=>U&&!te&&_.height!==0&&V.height!==0&&!k)),([,,,,U])=>{Me(ue,!0),mn(1,()=>{Me(E,U)}),ns(W(d),()=>{Me(s,[0,0]),Me(de,!0)})}),pe(W(re,we(U=>U!=null&&U.scrollTop>0),cs(0)),g),Ke(W(N,ze(re),we(([,U])=>U!=null)),([,U])=>{U&&(Me(v,U.viewport),Me(L,U.item),Me(ae,U.gap),U.scrollTop>0&&(Me(he,!0),ns(W(d,Qs(1)),te=>{Me(he,!1)}),Me(c,{top:U.scrollTop})))}),pe(W(v,ie(({height:U})=>U)),p),pe(W(pt(ve(v,Va),ve(L,Va),ve(ae,(U,te)=>U!==void 0&&U.column===te.column&&U.row===te.row),ve(d)),ie(([U,te,_,V])=>({gap:_,item:te,scrollTop:V,viewport:U}))),ne),pe(W(pt(ve(q),r,ve(ae,wm),ve(L,Va),ve(v,Va),ve(K),ve(g),ve(he),ve(de),ve(Ne)),we(([,,,,,,,U])=>!U),ie(([U,[te,_],V,k,O,T,B,,G,A])=>{const{column:J,row:le}=V,{height:xe,width:ce}=k,{width:Fe}=O;if(B===0&&(U===0||Fe===0))return go;if(ce===0){const $t=un(A,U),Gt=$t+Math.max(B-1,0);return vm(wo($t,Gt,T))}const Te=sl(Fe,ce,J);let tt,Oe;G?te===0&&_===0&&B>0?(tt=0,Oe=B-1):(tt=Te*ur((te+le)/(xe+le)),Oe=Te*bo((_+le)/(xe+le))-1,Oe=zr(U-1,Sa(Oe,Te-1)),tt=zr(Oe,Sa(0,tt))):(tt=0,Oe=-1);const Ye=wo(tt,Oe,T),{bottom:ht,top:wt}=No(O,V,k,Ye),lt=bo(U/Te),Nt=lt*xe+(lt-1)*le-ht;return{bottom:ht,itemHeight:xe,items:Ye,itemWidth:ce,offsetBottom:Nt,offsetTop:wt,top:wt}})),S),pe(W(K,we(U=>U!==null),ie(U=>U.length)),q),pe(W(pt(v,L,S,ae),we(([U,te,{items:_}])=>_.length>0&&te.height!==0&&U.height!==0),ie(([U,te,{items:_},V])=>{const{bottom:k,top:O}=No(U,V,te,_);return[O,k]}),at(Ta)),s);const Z=X(!1);pe(W(d,ze(Z),ie(([U,te])=>te||U!==0)),Z);const se=Ht(W(pt(S,q),we(([{items:U}])=>U.length>0),ze(Z),we(([[U,te],_])=>{const V=U.items[U.items.length-1].index===te-1;return(_||U.bottom>0&&U.itemHeight>0&&U.offsetBottom===0&&U.items.length===te)&&V}),ie(([[,U]])=>U-1),at())),Re=Ht(W(ve(S),we(({items:U})=>U.length>0&&U[0].index===0),cs(0),at())),$e=Ht(W(ve(S),ze(he),we(([{items:U},te])=>U.length>0&&!te),ie(([{items:U}])=>({endIndex:U[U.length-1].index,startIndex:U[0].index})),at(Ai),js(0)));pe($e,b.scrollSeekRangeChanged),pe(W(E,ze(v,L,q,ae),ie(([U,te,_,V,k])=>{const O=Fi(U),{align:T,behavior:B,offset:G}=O;let A=O.index;A==="LAST"&&(A=V-1),A=Sa(0,A,zr(V-1,A));let J=en(te,k,_,A);return T==="end"?J=vo(J-te.height+_.height):T==="center"&&(J=vo(J-te.height/2+_.height/2)),G!==void 0&&G!==0&&(J+=G),{behavior:B,top:J}})),c);const He=Et(W(S,ie(U=>U.offsetBottom+U.bottom)),0);return pe(W(D,ie(U=>({height:U.visibleHeight,width:U.visibleWidth}))),v),{customScrollParent:y,data:K,deviation:Q,footerHeight:o,gap:ae,headerHeight:n,increaseViewportBy:t,initialItemCount:g,itemDimensions:L,overscan:a,restoreStateFrom:re,scrollBy:i,scrollContainerState:l,scrollHeight:j,scrollTo:c,scrollToIndex:E,scrollTop:d,smoothScrollTargetReached:m,totalCount:q,useWindowScroll:f,viewportDimensions:v,windowScrollContainerState:w,windowScrollTo:I,windowViewportRect:D,...b,gridState:S,horizontalDirection:H,initialTopMostItemIndex:Ne,totalListHeight:He,...h,endReached:se,propsReady:C,rangeChanged:$e,startReached:Re,stateChanged:ne,stateRestoreInProgress:he,...M}},rt(xn,At,Da,Gi,Ls,pn,zs));function sl(t,s,a){return Sa(1,ur((t+a)/(ur(s)+a)))}function No(t,s,a,r){const{height:o}=a;if(o===void 0||r.length===0)return{bottom:0,top:0};const n=en(t,s,a,r[0].index);return{bottom:en(t,s,a,r[r.length-1].index)+o,top:n}}function en(t,s,a,r){const o=sl(t.width,a.width,s.column),n=ur(r/o),i=n*a.height+Sa(0,n-1)*s.row;return i>0?i+s.row:i}const jm=qe(()=>{const t=X(p=>`Item ${p}`),s=X({}),a=X(null),r=X("virtuoso-grid-item"),o=X("virtuoso-grid-list"),n=X(fn),i=X("div"),l=X(ca),c=(p,h=null)=>Et(W(s,ie(b=>b[p]),at()),h),d=X(!1),m=X(!1);return pe(ve(m),d),{components:s,computeItemKey:n,context:a,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:r,ItemComponent:c("Item","div"),itemContent:t,listClassName:o,ListComponent:c("List","div"),readyStateChanged:d,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),ym=qe(([t,s])=>({...t,...s}),rt(Nm,jm)),Sm=me.memo(function(){const t=st("gridState"),s=st("listClassName"),a=st("itemClassName"),r=st("itemContent"),o=st("computeItemKey"),n=st("isSeeking"),i=Yt("scrollHeight"),l=st("ItemComponent"),c=st("ListComponent"),d=st("ScrollSeekPlaceholder"),m=st("context"),p=Yt("itemDimensions"),h=Yt("gap"),b=st("log"),N=st("stateRestoreInProgress"),C=Yt("reportReadyState"),y=Ws(me.useMemo(()=>f=>{const w=f.parentElement.parentElement.scrollHeight;i(w);const I=f.firstChild;if(I!==null){const{height:D,width:M}=I.getBoundingClientRect();p({height:D,width:M})}h({column:jo("column-gap",getComputedStyle(f).columnGap,b),row:jo("row-gap",getComputedStyle(f).rowGap,b)})},[i,p,h,b]),!0,!1);return Ki(()=>{t.itemHeight>0&&t.itemWidth>0&&C(!0)},[t]),N?null:e.jsx(c,{className:s,ref:y,...Tt(c,m),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(f=>{const w=o(f.index,f.data,m);return n?e.jsx(d,{...Tt(d,m),height:t.itemHeight,index:f.index,width:t.itemWidth},w):u.createElement(l,{...Tt(l,m),className:a,"data-index":f.index,key:w},r(f.index,f.data,m))})})}),km=me.memo(function(){const t=st("HeaderComponent"),s=Yt("headerHeight"),a=st("headerFooterTag"),r=Ws(me.useMemo(()=>n=>{s(Ms(n,"height"))},[s]),!0,!1),o=st("context");return t!=null?e.jsx(a,{ref:r,children:e.jsx(t,{...Tt(t,o)})}):null}),Cm=me.memo(function(){const t=st("FooterComponent"),s=Yt("footerHeight"),a=st("headerFooterTag"),r=Ws(me.useMemo(()=>n=>{s(Ms(n,"height"))},[s]),!0,!1),o=st("context");return t!=null?e.jsx(a,{ref:r,children:e.jsx(t,{...Tt(t,o)})}):null}),Im=({children:t})=>{const s=me.useContext(Yi),a=Yt("itemDimensions"),r=Yt("viewportDimensions"),o=Ws(me.useMemo(()=>n=>{r(n.getBoundingClientRect())},[r]),!0,!1);return me.useEffect(()=>{s&&(r({height:s.viewportHeight,width:s.viewportWidth}),a({height:s.itemHeight,width:s.itemWidth}))},[s,r,a]),e.jsx("div",{ref:o,style:gn(!1),children:t})},Tm=({children:t})=>{const s=me.useContext(Yi),a=Yt("windowViewportRect"),r=Yt("itemDimensions"),o=st("customScrollParent"),n=st("useWindowScroll"),i=Ii(a,o,!1);return me.useEffect(()=>{s&&(r({height:s.itemHeight,width:s.itemWidth}),a({listHeight:0,offsetTop:0,visibleHeight:s.viewportHeight,visibleWidth:s.viewportWidth}))},[s,a,r]),e.jsx("div",{ref:i,style:Zi(!1,n),children:t})},_m=me.memo(function({...t}){const s=st("useWindowScroll"),a=st("customScrollParent"),r=a||s?Rm:Em,o=a||s?Tm:Im,n=st("context");return e.jsx(r,{...t,...Tt(r,n),children:e.jsxs(o,{children:[e.jsx(km,{}),e.jsx(Sm,{}),e.jsx(Cm,{})]})})}),{useEmitter:al,useEmitterValue:st,usePublisher:Yt}=Wi(ym,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},_m),Em=el({useEmitter:al,useEmitterValue:st,usePublisher:Yt}),Rm=tl({useEmitter:al,useEmitterValue:st,usePublisher:Yt});function jo(t,s,a){return s!=="normal"&&s?.endsWith("px")!==!0&&a(`${t} was not resolved to pixel value correctly`,s,bt.WARN),s==="normal"?0:parseInt(s??"0",10)}function yo(t){if(Array.isArray(t)){if(t.length<5||t.length>6)throw new Error(`Invalid bone format: expected [x,y,w,h,r,c?] but got ${t.length} elements`);const s=t;return{x:s[0],y:s[1],w:s[2],h:s[3],r:s[4],c:s[5]||void 0}}return t}const So=new Set(["p","h1","h2","h3","h4","h5","h6","li","td","th"]);function Mm(t,s="component",a){const r=t.getBoundingClientRect(),o=[],n=a?.leafTags?new Set([...So,...a.leafTags]):So,i=a?.captureRoundedBorders??!0,l=a?.excludeTags?new Set(a.excludeTags):null,c=a?.excludeSelectors??null;function d(m){const p=getComputedStyle(m);if(p.display==="none"||p.visibility==="hidden"||p.opacity==="0")return;const h=m.tagName.toLowerCase();if(l?.has(h)||c?.some(v=>m.matches(v)))return;const b=[...m.children].filter(v=>{const L=getComputedStyle(v);return L.display!=="none"&&L.visibility!=="hidden"&&L.opacity!=="0"}),N=h==="img"||h==="svg"||h==="video"||h==="canvas",C=h==="input"||h==="button"||h==="textarea"||h==="select",y=b.length===0||N||C||n.has(h),f=p.backgroundColor,w=f!=="rgba(0, 0, 0, 0)"&&f!=="transparent",I=p.backgroundImage!=="none",D=parseFloat(p.borderTopWidth)||0,M=i&&D>0&&p.borderTopColor!=="rgba(0, 0, 0, 0)"&&p.borderTopColor!=="transparent",q=(parseFloat(p.borderTopLeftRadius)||0)>0,g=w||I||M&&q,S=h==="tr"||h==="td"||h==="th"||h==="thead"||h==="tbody"||h==="table";if(y){const v=m.getBoundingClientRect();if(v.width<1||v.height<1)return;const L=N&&v.width>0&&v.height>0&&Math.abs(v.width-v.height)<4,E=S?0:L?"50%":ko(p,m)??8,j=r.width;o.push({x:j>0?+((v.left-r.left)/j*100).toFixed(4):0,y:Math.round(v.top-r.top),w:j>0?+(v.width/j*100).toFixed(4):0,h:Math.round(v.height),r:E});return}if(g){const v=m.getBoundingClientRect();if(v.width>=1&&v.height>=1){const L=S?0:ko(p,m)??8,E=r.width;o.push({x:E>0?+((v.left-r.left)/E*100).toFixed(4):0,y:Math.round(v.top-r.top),w:E>0?+(v.width/E*100).toFixed(4):0,h:Math.round(v.height),r:L,c:!0})}}for(const v of b)d(v)}for(const m of t.children)d(m);return{name:s,viewportWidth:Math.round(r.width),width:Math.round(r.width),height:Math.round(r.height),bones:o}}function ko(t,s){const a=parseFloat(t.borderTopLeftRadius)||0,r=parseFloat(t.borderTopRightRadius)||0,o=parseFloat(t.borderBottomRightRadius)||0,n=parseFloat(t.borderBottomLeftRadius)||0;if(a===0&&r===0&&o===0&&n===0)return;const i=s?(()=>{const d=s.getBoundingClientRect();return d.width>0&&d.height>0&&Math.abs(d.width-d.height)<4})():!1;return t.borderRadius==="50%"?"50%":Math.max(a,r,o,n)>9998?i?"50%":9999:a===r&&r===o&&o===n?a!==8?a:void 0:`${a}px ${r}px ${o}px ${n}px`}const Am=new Map;function zm(t){return Am.get(t)}function Lm(){typeof window<"u"&&window.__BONEYARD_BUILD&&(window.__BONEYARD_SNAPSHOT=Mm)}function Dm(){return typeof window<"u"&&window.__BONEYARD_BUILD===!0}function $m(t,s){if(!("breakpoints"in t))return t;const a=Object.keys(t.breakpoints).map(Number).sort((o,n)=>o-n);if(a.length===0)return null;const r=[...a].reverse().find(o=>s>=o)??a[0];return t.breakpoints[r]??null}const Js={angle:110,start:30,end:70,speed:"2s",lightHighlight:"#f7f7f7",darkHighlight:"#2c2c2c"},ha={speed:"1.8s",lightAdjust:.3,darkAdjust:.02},Co={web:{light:"#f0f0f0",dark:"#222222"}},Fm=/rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+))?\s*\)/;function Io(t,s){const a=t.match(Fm);if(a){const[,r,o,n,i="1"]=a,l=Math.min(1,parseFloat(i)+s*.5);return`rgba(${r},${o},${n},${l.toFixed(3)})`}if(t.startsWith("#")&&t.length>=7){const r=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),n=parseInt(t.slice(5,7),16);if(!isNaN(r)&&!isNaN(o)&&!isNaN(n)){const i=Math.round(r+(255-r)*s),l=Math.round(o+(255-o)*s),c=Math.round(n+(255-n)*s);return`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}}return t}Lm();let ls={};function To({loading:t,children:s,name:a,initialBones:r,color:o,darkColor:n,animate:i,stagger:l=!1,transition:c=!1,boneClass:d,className:m,fallback:p,fixture:h,snapshotConfig:b}){const N=u.useRef(null),C=u.useRef(Math.random().toString(36).slice(2,8)).current,[y,f]=u.useState(0),[w,I]=u.useState(0),[D,M]=u.useState(!1);u.useEffect(()=>{if(typeof window>"u")return;const _=()=>{const O=document.documentElement.classList.contains("dark")||!!N.current?.closest(".dark");M(O)};_();const V=new MutationObserver(_);V.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});const k=window.matchMedia("(prefers-color-scheme: dark)");return k.addEventListener("change",_),()=>{V.disconnect(),k.removeEventListener("change",_)}},[]);const q=o??ls.color??Co.web.light,g=n??ls.darkColor??Co.web.dark,S=D?g:q,v=i??ls.animate??"pulse",L=v===!0?"pulse":v===!1?"solid":v;u.useEffect(()=>{const _=N.current;if(!_)return;const V=new ResizeObserver(O=>{const T=O[0]?.contentRect;f(Math.round(T?.width??0)),T&&T.height>0&&I(Math.round(T.height))});V.observe(_);const k=_.getBoundingClientRect();return f(Math.round(k.width)),k.height>0&&I(Math.round(k.height)),()=>V.disconnect()},[]);const E={};if(a&&(E["data-boneyard"]=a,b&&(E["data-boneyard-config"]=JSON.stringify(b))),Dm())return e.jsx("div",{ref:N,className:m,style:{position:"relative"},...E,children:e.jsx("div",{children:h??s})});const[j,Q]=u.useState(!1);u.useLayoutEffect(()=>{Q(!0)},[]);const K=r??(a?zm(a):void 0),ae=j&&typeof window<"u"?window.innerWidth:0,ne=y>0?y:ae,re=K&&ne>0?$m(K,ne):null,he=d??ls.boneClass,Ne=(()=>{const _=l??ls.stagger;return _===!0?80:_===!1||!_?0:_})(),de=(()=>{const _=c??ls.transition;return _===!0?300:_===!1||!_?0:_})(),[ue,H]=u.useState(!1),Z=u.useRef(t),se=u.useRef(null);u.useEffect(()=>(Z.current&&!t&&de>0&&re&&(se.current&&clearTimeout(se.current),H(!0),se.current=setTimeout(()=>{H(!1),se.current=null},de)),Z.current=t,()=>{se.current&&clearTimeout(se.current)}),[t,de,re]);const Re=(t||ue)&&re,$e=t&&!re&&!ue,He=w>0?w:re?.height??0,U=re?.height??0,te=He>0&&U>0?He/U:1;return e.jsxs("div",{ref:N,className:m,style:{position:"relative"},...E,children:[e.jsx("div",{"data-boneyard-content":"true",style:Re&&!ue?{visibility:"hidden"}:void 0,children:$e?p:s}),Re&&e.jsx("div",{"data-boneyard-overlay":"true",style:{position:"absolute",inset:0,overflow:"hidden",opacity:ue?0:1,transition:de>0?`opacity ${de}ms ease-out`:void 0},children:e.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[re.bones.filter(_=>!yo(_).c).map((_,V)=>{const k=yo(_),O=S;Io(S,D?ha.darkAdjust:ha.lightAdjust);const T=k.w/100*(re.width??0),B=k.r==="50%"&&Math.abs(T-k.h)<4,G={position:"absolute",left:`${k.x}%`,top:k.y*te,width:B?k.h*te:`${k.w}%`,height:k.h*te,borderRadius:typeof k.r=="string"?k.r:`${k.r}px`,backgroundColor:O},A=ls.speed;if(L==="pulse")G.animation=`bp-${C} ${A??ha.speed} ease-in-out infinite`;else if(L==="shimmer"){const J=D?ls.darkShimmerColor??Js.darkHighlight:ls.shimmerColor??Js.lightHighlight,le=ls.shimmerAngle??Js.angle;delete G.backgroundColor,G.backgroundImage=`linear-gradient(${le}deg, ${O} ${Js.start}%, ${J} 50%, ${O} ${Js.end}%)`,G.backgroundSize="200% 100%",G.animation=`bs-${C} ${A??Js.speed} linear infinite`}return Ne>0&&(G.opacity=0,G.animation=`${G.animation?G.animation+",":""} by-${C} 0.3s ease-out ${V*Ne}ms forwards`),e.jsx("div",{"data-boneyard-bone":"true",className:he,style:G},V)}),L==="pulse"&&e.jsx("style",{children:`@keyframes bp-${C}{0%,100%{background-color:${S}}50%{background-color:${Io(S,D?ha.darkAdjust:ha.lightAdjust)}}}`}),L==="shimmer"&&e.jsx("style",{children:`@keyframes bs-${C}{0%{background-position:200% 0}100%{background-position:-200% 0}}`}),Ne>0&&e.jsx("style",{children:`@keyframes by-${C}{from{opacity:0}to{opacity:1}}`})]})})]})}async function vn(t){const s=Lt(Ve,"managedStudents");try{const n=Rt(s,_t("teacherId","==",t)),i=await Dt(n);if(!i.empty)return i.docs.map(c=>({id:c.id,...c.data()})).sort((c,d)=>String(c.name||"").localeCompare(String(d.name||"")))}catch{}const r=(await nl(t)).map(n=>n.id);if(r.length===0)return[];const o=new Map;for(let n=0;n{o.set(d.id,{id:d.id,...d.data()})})}return Array.from(o.values()).sort((n,i)=>String(n.name||"").localeCompare(String(i.name||"")))}async function Om(t,s=[]){if(!t)return[];const a=Lt(Ve,"users"),r=new Map,o=(i,l)=>String(l.role||"").toLowerCase()!=="student"?null:{uid:i,name:String(l.name||l.displayName||"").trim()||"Student",email:String(l.email||"").trim(),lrn:l.lrn&&String(l.lrn).trim()||void 0,photo:l.photo?String(l.photo).trim()||void 0:l.photoURL&&String(l.photoURL).trim()||void 0,grade:l.grade&&String(l.grade).trim()||void 0,section:l.section&&String(l.section).trim()||void 0,classSectionId:l.classSectionId&&String(l.classSectionId).trim()||void 0,adviserTeacherId:l.adviserTeacherId&&String(l.adviserTeacherId).trim()||void 0,role:"student",createdAt:l.createdAt||void 0};try{const i=Rt(a,_t("role","==","student"),_t("adviserTeacherId","==",t));(await Dt(i)).docs.forEach(c=>{const d=o(c.id,c.data());d&&r.set(c.id,d)})}catch(i){console.warn("[studentService] adviser-scoped student query failed:",i)}const n=Array.from(new Set((s||[]).map(i=>(i||"").trim()).filter(i=>!!i)));for(let i=0;i{if(r.has(m.id))return;const p=o(m.id,m.data());p&&r.set(m.id,p)})}catch(c){console.warn("[studentService] section-scoped student query failed:",c)}}return Array.from(r.values()).sort((i,l)=>i.name.localeCompare(l.name))}function Bm(t){const s=`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name||"Student")}&background=random`,a=Vl.now();return{id:t.uid,accountUid:t.uid,lrn:t.lrn,name:t.name,email:t.email,avatar:t.photo||s,teacherId:t.adviserTeacherId,grade:t.grade,gradeLevel:gs(t.grade)||void 0,section:t.section,classSectionId:t.classSectionId,riskLevel:"Low",engagementScore:0,avgQuizScore:0,weakestTopic:"N/A",classroomId:t.classSectionId||"",attendance:0,assignmentCompletion:0,lastActive:null,struggles:[],createdAt:t.createdAt||a,updatedAt:a,hasRegisteredAccount:!0,source:"registered"}}function _o(t){return(t||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9\s]+/g," ").trim().replace(/\s+/g," ")}async function Pm(t){const s=(t.studentId||"").trim();if(!s)throw new Error("Cannot reassign section: studentId is required.");const a=(t.newClassSectionId||"").trim()||Ut(t.newGrade,t.newSection);if(!a)throw new Error("Cannot reassign section: a target class section is required.");const r=(t.teacherId||"").trim(),o=(t.teacherName||"").trim(),n=(t.schoolYear||"").trim(),i=(t.previousClassSectionId||"").trim();try{const l=ut(Ve,"managedStudents",s),c=await ws(l);c.exists()&&await as(l,{grade:t.newGrade,section:t.newSection,classSectionId:a,gradeLevel:gs(t.newGrade)||t.newGrade,teacherId:r||c.data()?.teacherId,updatedAt:ct()})}catch(l){console.warn("[studentService] reassignStudentSection: managedStudents update failed:",l)}if(t.isRegisteredAccount)try{await rs(ut(Ve,"users",s),{grade:t.newGrade,section:t.newSection,classSectionId:a,adviserTeacherId:r||void 0,adviserTeacherName:o||void 0,updatedAt:ct()},{merge:!0})}catch(l){console.warn("[studentService] reassignStudentSection: users profile update failed:",l)}try{await Nr({classSectionId:a,grade:t.newGrade,section:t.newSection,schoolYear:n,ownerTeacherId:r,ownerTeacherName:o,studentUids:[s]})}catch(l){console.warn("[studentService] reassignStudentSection: ownership upsert failed:",l)}if(i&&i!==a)try{const l=ut(Ve,"classSectionOwnership",i),c=await ws(l);if(c.exists()){const m=(c.data().studentUids||[]).filter(p=>p!==s);await as(l,{studentUids:m,updatedAt:ct()})}}catch(l){console.warn("[studentService] reassignStudentSection: previous-section cleanup failed:",l)}}async function Hm(t){const{apiService:s}=await Gs(async()=>{const{apiService:d}=await import("./index-Cvals0ud.js").then(m=>m.b7);return{apiService:d}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),a=(t.adviserTeacherId||"").trim();if(!a)throw new Error("createStudentAccountFromRoster requires adviserTeacherId.");const r=(t.email||"").trim().toLowerCase();if(!r)throw new Error("createStudentAccountFromRoster requires an email.");const o=(t.grade||"").trim(),n=(t.section||"").trim(),i=(t.classSectionId||"").trim()||(o&&n?Ut(o,n):""),c=((await s.createStudentAccount({name:(t.name||"").trim()||"Student",email:r,temporaryPassword:t.temporaryPassword,lrn:t.lrn?.trim()||void 0,grade:o||void 0,section:n||void 0,classSectionId:i||void 0,adviserTeacherId:a,adviserTeacherName:t.adviserTeacherName?.trim()||void 0,schoolYear:t.schoolYear?.trim()||void 0})).uid||"").trim();if(!c)throw new Error("Backend did not return a uid for the newly created student.");try{await rs(ut(Ve,"managedStudents",c),xr({accountUid:c,name:(t.name||"").trim()||"Student",email:r,lrn:t.lrn?.trim()||null,teacherId:a,grade:o||null,gradeLevel:gs(o)||null,section:n||null,classSectionId:i||null,classroomId:i||null,riskLevel:"Low",avgQuizScore:0,engagementScore:0,attendance:0,assignmentCompletion:0,weakestTopic:"",struggles:[],avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name||"Student")}&background=random`,hasRegisteredAccount:!0,source:"both",createdAt:ct(),updatedAt:ct()}))}catch(d){console.warn("[studentService] createStudentAccountFromRoster: managed-student merge failed:",d)}if(i&&o&&n)try{await Nr({classSectionId:i,grade:o,section:n,schoolYear:t.schoolYear||"",ownerTeacherId:a,ownerTeacherName:t.adviserTeacherName,studentUids:[c]})}catch(d){console.warn("[studentService] createStudentAccountFromRoster: ownership upsert failed:",d)}return{uid:c,email:r,temporaryPassword:t.temporaryPassword}}async function rl(t,s,a){const r=Ut(s,a),o=ut(Ve,"managedStudents",t);await as(o,{grade:s,section:a,classSectionId:r,updatedAt:ct()})}async function Um(t,s){const a=ut(Ve,"classSectionOwnership",s);await as(a,{studentUids:Ql(t),updatedAt:ct()}).catch(r=>console.warn("[studentService] removeStudentFromClass: ownership update failed:",r)),await ui(ut(Ve,"managedStudents",t)).catch(r=>console.warn("[studentService] removeStudentFromClass: managedStudents delete failed:",r))}function Ut(t,s){return[t,s].filter(Boolean).join("_").replace(/\s+/g,"_").toLowerCase()}function xr(t){const s=Object.entries(t).filter(([,a])=>a!==void 0);return Object.fromEntries(s)}function gs(t){const s=(t||"").trim();if(!s)return null;const a=s.match(/(\d{1,2})/);return a?`Grade ${a[1]}`:/^grade\s+/i.test(s)?s.replace(/\s+/g," ").trim().replace(/^grade/i,"Grade"):s}function da(t){const a=gs(t)?.match(/(\d{1,2})/),r=a?Number.parseInt(a[1],10):Number.NaN;return Number.isFinite(r)?r>=11?"Senior High School":"Junior High School":null}function ma(t,s){const a=`${t||""} ${s||""}`.toUpperCase();if(!a.trim())return null;const r=["STEM","ABM","HUMSS","GAS","TVL","ICT"];for(const o of r)if(new RegExp(`\\b${o}\\b`).test(a))return o;return null}function ps(t){const s=(t||"").trim();if(!s)return{grade:"Grade 11",section:"Section A"};const[a="Grade 11",r="Section A"]=s.split(" - ").map(o=>o.trim());return{grade:a||"Grade 11",section:r||"Section A"}}function St(t){const s=t.metadata||{},a=t.className||s.className,r=ps(a),o=(t.grade||s.grade||r.grade||"").trim()||null,n=(t.section||s.section||r.section||"").trim()||null,i=(t.classSectionId||s.classSectionId||"").trim()||(o&&n?Ut(o,n):"")||null,l=(a||"").trim()||(o&&n?`${o} - ${n}`:"")||null,c=gs(t.gradeLevel||s.gradeLevel||o),d=(t.classification||s.classification||"").trim()||da(c)||null,m=(t.strand||s.strand||"").trim()||ma(l,n)||null;return{classSectionId:i,className:l,grade:o,section:n,gradeLevel:c,classification:d,strand:m,schoolYear:(t.schoolYear||s.schoolYear||"").trim()||null,ownerTeacherId:(t.ownerTeacherId||s.ownerTeacherId||"").trim()||null,ownerTeacherName:(t.ownerTeacherName||s.ownerTeacherName||"").trim()||null,adviserTeacherId:(t.adviserTeacherId||s.adviserTeacherId||"").trim()||null,adviserTeacherName:(t.adviserTeacherName||s.adviserTeacherName||"").trim()||null,managerId:(t.managerId||s.managerId||"").trim()||null,managerName:(t.managerName||s.managerName||"").trim()||null}}function Gm(t){const s=(t.className||"").trim(),[a="",r=""]=s.split(" - "),o=(t.grade||a||"").trim()||null,n=(t.section||r||"").trim()||null,i=(t.classSectionId||"").trim()||(o&&n?Ut(o,n):"")||null,l=s||(o&&n?`${o} - ${n}`:null),c=gs(t.gradeLevel||o),d=(t.classification||"").trim()||da(c),m=(t.strand||"").trim()||ma(l,n);return{classSectionId:i,className:l,grade:o,section:n,gradeLevel:c,classification:d,strand:m,schoolYear:(t.schoolYear||"").trim()||null,ownerTeacherId:(t.ownerTeacherId||"").trim()||null,ownerTeacherName:(t.ownerTeacherName||"").trim()||null,adviserTeacherId:(t.adviserTeacherId||"").trim()||null,adviserTeacherName:(t.adviserTeacherName||"").trim()||null,managerId:(t.managerId||"").trim()||null,managerName:(t.managerName||"").trim()||null}}async function nl(t){const s=Lt(Ve,"classrooms"),a=new Map,r=Rt(s,_t("teacherId","==",t));(await Dt(r)).docs.forEach(l=>{a.set(l.id,{id:l.id,...l.data()})});const n=Rt(s,_t("managerId","==",t));return(await Dt(n)).docs.forEach(l=>{a.set(l.id,{id:l.id,...l.data()})}),Array.from(a.values()).sort((l,c)=>String(l.name||"").localeCompare(String(c.name||"")))}async function Nr(t){const s=t.classSectionId||Ut(t.grade,t.section),a=ut(Ve,"classSectionOwnership",s),r=await ws(a),o=r.exists()?r.data().studentUids||[]:[],n=Array.from(new Set([...t.studentUids||[],...o])),i=xr(t);return r.exists()?await as(a,{...i,classSectionId:s,studentUids:n,updatedAt:ct()}):await rs(a,{...i,classSectionId:s,studentUids:n,createdAt:ct(),updatedAt:ct()}),s}async function ol(t){const s=(t.classSectionId||"").trim()||Ut(t.grade,t.section),a=(t.className||"").trim()||`${t.grade} - ${t.section}`,r=Gm({classSectionId:s,className:a,grade:t.grade,section:t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName,adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName,classification:t.classification,strand:t.strand,gradeLevel:t.gradeLevel});await Nr({classSectionId:s,className:a,grade:r.grade||t.grade,gradeLevel:r.gradeLevel||t.gradeLevel||t.grade,classification:r.classification||t.classification,strand:r.strand||t.strand,section:r.section||t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName,studentUids:[]});const o=Lt(Ve,"classrooms"),n=Rt(o,_t("classSectionId","==",s)),i=await Dt(n);if(i.empty){const l=xr({name:a,teacherId:t.ownerTeacherId,grade:r.grade,gradeLevel:r.gradeLevel,classification:r.classification,strand:r.strand,section:r.section,classSectionId:s,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName||"",adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName||"",managerId:t.managerId,managerName:t.managerName||"",classMetadata:r,schedule:"Mon-Fri",studentCount:0,avgScore:0,atRiskCount:0,createdAt:ct(),updatedAt:ct()});await rs(ut(Ve,"classrooms",s),l,{merge:!0})}else for(const l of i.docs){const c=xr({name:a,grade:r.grade,gradeLevel:r.gradeLevel,classification:r.classification,strand:r.strand,section:r.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName||"",adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName||"",managerId:t.managerId,managerName:t.managerName||"",classMetadata:r,updatedAt:ct()});await as(l.ref,c)}return s}async function jr(t,s,a,r,o,n){const i=Ut(s,a);await Nr({classSectionId:i,grade:s,section:a,schoolYear:o,ownerTeacherId:r,ownerTeacherName:n,studentUids:[t]});const l=await ws(ut(Ve,"users",t)),c=l.exists()?l.data():{};await rs(ut(Ve,"users",t),{grade:s,section:a,classSectionId:i,adviserTeacherId:r,adviserTeacherName:n||"",updatedAt:ct()},{merge:!0}),await rs(ut(Ve,"managedStudents",t),{accountUid:t,name:c.name||c.displayName||"Student",email:c.email||"",lrn:c.lrn||null,teacherId:r,grade:s,gradeLevel:s,section:a,classSectionId:i,classroomId:i,hasRegisteredAccount:!0,source:"registered",updatedAt:ct()},{merge:!0})}async function Qm(t){const s=Lt(Ve,"classSectionOwnership"),a=new Map,r=Rt(s,_t("ownerTeacherId","==",t));(await Dt(r)).docs.forEach(l=>{a.set(l.id,{id:l.id,...l.data()})});const n=Rt(s,_t("managerId","==",t));return(await Dt(n)).docs.forEach(l=>{a.set(l.id,{id:l.id,...l.data()})}),Array.from(a.values()).sort((l,c)=>String(l.classSectionId||"").localeCompare(String(c.classSectionId||"")))}async function Vm(t="",s=25){const a=Lt(Ve,"users"),r=Math.max(1,Math.min(100,s)),o=Rt(a,_t("role","==","teacher"),nr(r*4)),n=await Dt(o),i=t.trim().toLowerCase();return n.docs.map(c=>{const d=c.data(),m=String(d.name||"").trim(),p=String(d.email||"").trim();return{uid:c.id,name:m||"Teacher",email:p,photo:String(d.photo||d.photoURL||"").trim()||void 0}}).filter(c=>i?c.name.toLowerCase().includes(i)||c.email.toLowerCase().includes(i):!0).sort((c,d)=>c.name.localeCompare(d.name)).slice(0,r)}function Wm(t,s,a=20){if(t.length===0)return s([]),()=>{};const r=Lt(Ve,"activities"),o=Rt(r,_t("classroomId","in",t),Wl("timestamp","desc"));return xi(o,n=>{const i=n.docs.slice(0,a).map(l=>({id:l.id,...l.data()}));s(i)},n=>{console.error("[studentService] subscribeToActivities error:",n),s([])})}const qm=({open:t,onClose:s,onCreated:a,teacherName:r})=>{const{currentUser:o}=hs(),[n,i]=u.useState("details"),[l,c]=u.useState(""),d="Grade 11",[m,p]=u.useState(""),[h,b]=u.useState(!1),[N,C]=u.useState(""),[y,f]=u.useState([]),[w,I]=u.useState(new Set),[D,M]=u.useState(""),[q,g]=u.useState(!1);u.useEffect(()=>{t||(i("details"),c(""),p(""),C(""),I(new Set),M(""))},[t]),u.useEffect(()=>{t&&n==="students"&&S()},[t,n]);const S=async()=>{g(!0);try{const j=Lt(Ve,"users"),Q=Rt(j,_t("role","==","student")),K=await Dt(Q),ae=[];K.docs.forEach(ne=>{const re=ne.data();ae.push({uid:ne.id,name:re.name||re.displayName||"Student",email:re.email||"",grade:re.grade,section:re.section})}),f(ae.sort((ne,re)=>ne.name.localeCompare(re.name)))}catch(j){console.error("[CreateClassModal] Failed to load students:",j)}finally{g(!1)}},v=async()=>{if(o){if(!m.trim()){C("Section name is required");return}C(""),b(!0);try{const j=String(new Date().getFullYear());if(await ol({classSectionId:"",grade:d,section:m.trim(),schoolYear:j,ownerTeacherId:o.uid,ownerTeacherName:r||o.displayName||"",managerId:o.uid,managerName:r||o.displayName||"",className:l.trim()||`${d} - ${m.trim()}`}),w.size>0){const Q=Array.from(w).map(K=>jr(K,d,m.trim(),o.uid,j,r||o.displayName||""));await Promise.allSettled(Q)}a(),s()}catch(j){C(j instanceof Error?j.message:"Failed to create class")}finally{b(!1)}}},L=j=>{I(Q=>{const K=new Set(Q);return K.has(j)?K.delete(j):K.add(j),K})},E=y.filter(j=>j.name.toLowerCase().includes(D.toLowerCase())||j.email.toLowerCase().includes(D.toLowerCase()));return t?e.jsx(Mt,{children:e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),e.jsxs(Ae.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"relative bg-white rounded-2xl shadow-xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-[#f1f5f9]",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#1e293b]",children:n==="details"?"Create New Class":"Add Students"}),e.jsx("button",{onClick:s,className:"p-1 rounded-lg hover:bg-[#f1f5f9] transition-colors",children:e.jsx(Xt,{size:20,className:"text-[#64748b]"})})]}),e.jsxs("div",{className:"p-6 overflow-y-auto flex-1",children:[n==="details"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-[#475569] block mb-1.5",children:"Class Name"}),e.jsx(ys,{placeholder:"e.g. Grade 11 - Section A",value:l,onChange:j=>c(j.target.value)}),e.jsx("p",{className:"text-xs text-[#94a3b8] mt-1",children:"Optional. Auto-generated from grade + section if empty."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-[#475569] block mb-1.5",children:"Section"}),e.jsx(ys,{placeholder:"e.g. Section A, STEM-1, Rizal",value:m,onChange:j=>p(j.target.value)})]}),N&&e.jsx("p",{className:"text-sm text-rose-500",children:N})]}),n==="students"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Vs,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#94a3b8]"}),e.jsx(ys,{placeholder:"Search students...",value:D,onChange:j=>M(j.target.value),className:"pl-9"})]}),e.jsxs("p",{className:"text-xs text-[#64748b]",children:[w.size," student(s) selected"]}),q?e.jsx("p",{className:"text-sm text-[#64748b] text-center py-4",children:"Loading students..."}):E.length===0?e.jsx("p",{className:"text-sm text-[#64748b] text-center py-4",children:"No students found."}):e.jsx("div",{className:"space-y-1 max-h-[300px] overflow-y-auto",children:E.map(j=>e.jsxs("button",{onClick:()=>L(j.uid),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors ${w.has(j.uid)?"bg-purple-50 border border-purple-200":"hover:bg-[#f8fafc] border border-transparent"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-md border-2 flex items-center justify-center ${w.has(j.uid)?"bg-[#9956DE] border-[#9956DE]":"border-[#cbd5e1]"}`,children:w.has(j.uid)&&e.jsx(Bt,{size:12,className:"text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-[#1e293b] truncate",children:j.name}),e.jsx("p",{className:"text-xs text-[#64748b] truncate",children:j.email})]}),j.grade&&e.jsx("span",{className:"text-xs text-[#94a3b8]",children:j.grade})]},j.uid))}),N&&e.jsx("p",{className:"text-sm text-rose-500",children:N})]})]}),e.jsx("div",{className:"flex items-center justify-between p-6 border-t border-[#f1f5f9]",children:n==="details"?e.jsxs(e.Fragment,{children:[e.jsx(jt,{variant:"outline",onClick:s,children:"Cancel"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(jt,{variant:"outline",onClick:()=>{if(!m.trim()){C("Section is required");return}C(""),i("students")},children:"Add Students"}),e.jsx(jt,{onClick:v,disabled:h||!m.trim(),className:"bg-[#9956DE] hover:bg-[#7c3aed] text-white",children:h?"Creating...":"Create Class"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{variant:"outline",onClick:()=>i("details"),children:"Back"}),e.jsxs(jt,{onClick:v,disabled:h,className:"bg-[#9956DE] hover:bg-[#7c3aed] text-white",children:[e.jsx(ia,{size:16,className:"mr-1"}),h?"Creating...":`Create with ${w.size} Student${w.size!==1?"s":""}`]})]})})]})]})}):null},Ym=({open:t,onClose:s,onAdded:a,grade:r,section:o,teacherName:n,existingStudentUids:i=[]})=>{const{currentUser:l}=hs(),[c,d]=u.useState([]),[m,p]=u.useState(new Set),[h,b]=u.useState(""),[N,C]=u.useState(!1),[y,f]=u.useState(!1);u.useEffect(()=>{t&&(p(new Set),b(""),w())},[t]);const w=async()=>{C(!0);try{const M=Rt(Lt(Ve,"users"),_t("role","==","student")),g=(await Dt(M)).docs.filter(S=>!i.includes(S.id)).map(S=>{const v=S.data();return{uid:S.id,name:v.name||v.displayName||"Student",email:v.email||""}}).sort((S,v)=>S.name.localeCompare(v.name));d(g)}catch{}C(!1)},I=async()=>{if(!(!l||m.size===0)){f(!0);try{const M=String(new Date().getFullYear()),q=Array.from(m).map(g=>jr(g,r,o,l.uid,M,n||l.displayName||""));await Promise.allSettled(q),oe.success(`Added ${m.size} student(s) to class`),a(),s()}catch{oe.error("Failed to add students")}f(!1)}},D=c.filter(M=>M.name.toLowerCase().includes(h.toLowerCase())||M.email.toLowerCase().includes(h.toLowerCase()));return t?e.jsx(Mt,{children:e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),e.jsxs(Ae.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"relative bg-white rounded-2xl shadow-xl w-full max-w-2xl mx-4 max-h-[80vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#f1f5f9]",children:[e.jsxs("h2",{className:"text-base font-semibold text-[#1e293b]",children:["Add Students to ",r," - ",o]}),e.jsx("button",{onClick:s,className:"p-1 rounded-lg hover:bg-[#f1f5f9]",children:e.jsx(Xt,{size:18,className:"text-[#64748b]"})})]}),e.jsxs("div",{className:"p-4 space-y-3 flex-1 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Vs,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#94a3b8]"}),e.jsx(ys,{placeholder:"Search students...",value:h,onChange:M=>b(M.target.value),className:"pl-8 h-9 text-sm"})]}),e.jsx("button",{onClick:()=>{m.size===D.length?p(new Set):p(new Set(D.map(M=>M.uid)))},className:"text-[11px] font-semibold text-[#9956DE] hover:text-[#7c3aed] bg-[#9956DE]/10 hover:bg-[#9956DE]/20 px-3 py-1.5 rounded-lg transition-colors whitespace-nowrap",children:m.size===D.length&&D.length>0?"Deselect All":"Select All"})]}),e.jsxs("p",{className:"text-xs text-[#64748b]",children:[m.size," of ",D.length," selected"]}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-1 min-h-[300px]",children:N?e.jsx("p",{className:"text-sm text-center text-[#64748b] py-6",children:"Loading..."}):D.length===0?e.jsx("p",{className:"text-sm text-center text-[#64748b] py-6",children:"No students available"}):D.map(M=>e.jsxs("button",{onClick:()=>p(q=>{const g=new Set(q);return g.has(M.uid)?g.delete(M.uid):g.add(M.uid),g}),className:`w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left transition-colors ${m.has(M.uid)?"bg-purple-50 border border-purple-200":"hover:bg-[#f8fafc] border border-transparent"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-md border-2 flex items-center justify-center shrink-0 ${m.has(M.uid)?"bg-[#9956DE] border-[#9956DE]":"border-[#cbd5e1]"}`,children:m.has(M.uid)&&e.jsx(Bt,{size:12,className:"text-white"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-[#1e293b] truncate",children:M.name}),e.jsx("p",{className:"text-[11px] text-[#64748b] truncate",children:M.email})]})]},M.uid))})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-[#f1f5f9]",children:[e.jsx(jt,{variant:"outline",size:"sm",onClick:s,children:"Cancel"}),e.jsxs(jt,{size:"sm",onClick:I,disabled:y||m.size===0,className:"bg-[#9956DE] hover:bg-[#7c3aed] text-white",children:[e.jsx(oi,{size:14,className:"mr-1.5"}),y?"Adding...":`Add ${m.size} Student${m.size!==1?"s":""}`]})]})]})]})}):null},il="https://deign86-mathpulse-api-v3test.hf.space";async function ll(){const t={"Content-Type":"application/json"},s=ii.currentUser;if(s)try{const a=await s.getIdToken(!1);a&&(t.Authorization=`Bearer ${a}`)}catch{}return t}async function Eo(t,s=!1){const a=await ll(),r=`${il}/api/analytics/class/${encodeURIComponent(t)}${s?"?refresh=true":""}`,o=await fetch(r,{headers:a});if(!o.ok)throw new Error(`GET class analytics failed: ${o.status}`);return o.json()}async function Km(t){const s=await ll(),a=await fetch(`${il}/api/analytics/class/${encodeURIComponent(t)}/refresh-insights`,{method:"POST",headers:s});if(!a.ok)throw a.status===429?new Error("Insights can only be refreshed once every 5 minutes."):new Error(`POST refresh insights failed: ${a.status}`);return a.json()}const yr="https://deign86-mathpulse-api-v3test.hf.space";async function Sr(){const t={"Content-Type":"application/json"},s=ii.currentUser;if(s)try{const a=await s.getIdToken(!1);a&&(t.Authorization=`Bearer ${a}`)}catch{}return t}async function tn(t){const s=await Sr(),a=await fetch(`${yr}/api/intervention/${encodeURIComponent(t)}`,{headers:s});if(!a.ok)throw new Error(`GET intervention failed: ${a.status}`);return a.json()}async function cl(t){const s=await Sr(),a=await fetch(`${yr}/api/intervention/generate`,{method:"POST",headers:s,body:JSON.stringify({student_id:t})});if(!a.ok)throw new Error(`POST intervention/generate failed: ${a.status}`);return a.json()}async function dl(t,s,a,r){const o=await Sr(),n=await fetch(`${yr}/api/intervention/${encodeURIComponent(t)}/step/${s}/complete`,{method:"POST",headers:o,body:JSON.stringify({score:a,time_spent_minutes:r})});if(!n.ok)throw new Error(`POST step complete failed: ${n.status}`);return n.json()}async function Xm(t){const s=await Sr(),a=await fetch(`${yr}/api/intervention/${encodeURIComponent(t)}/export-pdf`,{headers:s});if(!a.ok)throw new Error(`GET export-pdf failed: ${a.status}`);return a.json()}const Jm=Object.freeze(Object.defineProperty({__proto__:null,completeStep:dl,generateInterventionPlan:cl,getExportPDFData:Xm,getInterventionPlan:tn},Symbol.toStringTag,{value:"Module"})),Zm={video_lesson:e.jsx(ja,{className:"w-5 h-5"}),practice:e.jsx(or,{className:"w-5 h-5"}),assessment:e.jsx(Aa,{className:"w-5 h-5"}),chat_session:e.jsx(wi,{className:"w-5 h-5"}),review:e.jsx(ds,{className:"w-5 h-5"})},Ro={easy:"bg-emerald-100 text-emerald-700",medium:"bg-amber-100 text-amber-700",hard:"bg-rose-100 text-rose-700"},eu=({step:t,studentId:s,studentName:a,totalSteps:r,onClose:o,onStepCompleted:n})=>{const[i,l]=u.useState(!1),[c,d]=u.useState([{role:"assistant",content:`Hi ${a}! Let's work on "${t.title}". ${t.description||`This covers ${t.topic}.`} Ready to start?`}]),[m,p]=u.useState(""),h=async()=>{l(!0);try{await dl(s,t.step_number,0,t.duration_minutes),n(t.step_number),oe.success(`Step ${t.step_number} completed!`),o()}catch{oe.error("Failed to mark step as complete.")}finally{l(!1)}},b=()=>{if(!m.trim())return;const N=m.trim();d(C=>[...C,{role:"user",content:N}]),p(""),setTimeout(()=>{d(C=>[...C,{role:"assistant",content:`Great question about ${t.topic}! Let me help you understand this step by step. What part are you finding most challenging?`}])},1e3)};return e.jsx(Mt,{children:e.jsxs(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",onClick:o,children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(Ae.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"relative bg-white rounded-[24px] shadow-[0_24px_64px_rgba(0,0,0,0.18)] w-full max-w-[800px] max-h-[85vh] flex flex-col overflow-hidden z-10",onClick:N=>N.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-100 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center text-white",children:Zm[t.type]||e.jsx(or,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-[15px] font-bold text-[#1e293b]",children:t.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsxs("span",{className:"text-[11px] text-[#64748b]",children:["Step ",t.step_number," of ",r]}),t.competency_tag&&e.jsx("span",{className:"px-1.5 py-0.5 bg-indigo-50 text-indigo-600 text-[9px] font-mono rounded",children:t.competency_tag}),e.jsx("span",{className:`px-2 py-0.5 text-[10px] font-semibold rounded-full ${Ro[t.difficulty]||Ro.easy}`,children:t.difficulty})]})]})]}),e.jsx("button",{onClick:o,className:"w-8 h-8 rounded-full bg-slate-100 hover:bg-slate-200 flex items-center justify-center transition-colors",children:e.jsx(Xt,{className:"w-4 h-4 text-slate-500"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-slate-50 rounded-[14px] p-4 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Ts,{className:"w-4 h-4 text-slate-500"}),e.jsxs("span",{className:"text-[12px] font-semibold text-slate-600",children:[t.duration_minutes," minutes"]}),t.num_items&&e.jsxs("span",{className:"text-[12px] text-slate-500",children:["• ",t.num_items," items"]})]}),e.jsx("p",{className:"text-[13px] text-[#475569] leading-relaxed",children:t.description||`Work through ${t.topic} at ${t.difficulty} difficulty.`})]}),t.type==="video_lesson"&&e.jsxs("div",{className:"bg-indigo-50/50 rounded-[14px] p-6 border border-indigo-100 flex flex-col items-center justify-center min-h-[160px]",children:[e.jsx(ja,{className:"w-10 h-10 text-indigo-400 mb-3"}),e.jsx("p",{className:"text-[13px] font-semibold text-indigo-700",children:"Video Lesson"}),e.jsxs("p",{className:"text-[11px] text-indigo-500 mt-1",children:["Content for: ",t.topic]})]}),(t.type==="practice"||t.type==="assessment")&&e.jsxs("div",{className:"bg-purple-50/50 rounded-[14px] p-6 border border-purple-100 flex flex-col items-center justify-center min-h-[160px]",children:[e.jsx(or,{className:"w-10 h-10 text-purple-400 mb-3"}),e.jsxs("p",{className:"text-[13px] font-semibold text-purple-700",children:[t.type==="assessment"?"Assessment":"Practice"," Questions"]}),e.jsxs("p",{className:"text-[11px] text-purple-500 mt-1",children:[t.num_items||10," questions on ",t.topic]})]})]}),e.jsxs("div",{className:"flex flex-col bg-slate-50 rounded-[14px] border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-slate-100 bg-white",children:e.jsxs("p",{className:"text-[12px] font-semibold text-[#1e293b] flex items-center gap-1.5",children:[e.jsx(wi,{className:"w-3.5 h-3.5 text-indigo-500"})," AI Guide",e.jsx("span",{className:"text-[9px] font-medium text-slate-400 ml-1",children:"(Preview)"})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-[200px] max-h-[300px]",children:c.map((N,C)=>e.jsx("div",{className:`flex ${N.role==="user"?"justify-end":"justify-start"}`,children:e.jsx("div",{className:`max-w-[85%] px-3 py-2 rounded-[12px] text-[12px] leading-relaxed ${N.role==="user"?"bg-indigo-500 text-white":"bg-white border border-slate-200 text-[#475569]"}`,children:N.content})},C))}),e.jsxs("div",{className:"p-3 border-t border-slate-100 bg-white flex gap-2",children:[e.jsx("input",{type:"text",value:m,onChange:N=>p(N.target.value),onKeyDown:N=>N.key==="Enter"&&b(),placeholder:"Ask for help...",className:"flex-1 text-[12px] px-3 py-2 rounded-[10px] border border-slate-200 focus:outline-none focus:border-indigo-300"}),e.jsx("button",{onClick:b,className:"w-8 h-8 rounded-full bg-indigo-500 hover:bg-indigo-600 flex items-center justify-center text-white transition-colors",children:e.jsx(wa,{className:"w-3.5 h-3.5"})})]})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-slate-100 flex items-center justify-between shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-full bg-slate-200 h-2 rounded-full overflow-hidden",style:{width:120},children:e.jsx("div",{className:"h-full bg-indigo-500 rounded-full",style:{width:`${t.step_number/r*100}%`}})}),e.jsxs("span",{className:"text-[11px] text-slate-500",children:[t.step_number,"/",r]})]}),e.jsxs("button",{onClick:h,disabled:i||t.is_completed,className:"flex items-center gap-2 px-5 py-2.5 bg-emerald-500 hover:bg-emerald-600 text-white text-[13px] font-semibold rounded-full transition-colors disabled:opacity-50 shadow-sm",children:[e.jsx(Aa,{className:"w-4 h-4"}),t.is_completed?"Completed ✓":i?"Saving...":"Mark as Complete"]})]})]})]})})};async function tu(t,s,a){const r=ut(Lt(Ve,"generatedLessonPlans"));return await rs(r,{...t,teacherId:s,teacherName:a?.teacherName||null,studentId:a?.studentId||null,studentName:a?.studentName||null,status:"draft",createdAt:ct(),updatedAt:ct()}),r.id}async function su(t){const s=ut(Ve,"generatedLessonPlans",t),a=await ws(s);if(!a.exists())throw new Error("Lesson draft not found. Save draft before publishing.");if(!a.data().publishReady)throw new Error("Lesson is not publish-ready. Resolve source legitimacy and validation issues first.");await as(s,{status:"published",publishedAt:ct(),updatedAt:ct()})}async function au(t,s=!0){const a=t.learningCompetency||t.lessonTitle||t.focusTopics&&t.focusTopics[0]||"general mathematics",r=t.subject||"general_math",o=t.quarter??1;let n="",i=[],l,c,d,m=!1;if(s)try{const b=await Ml(a,r,o,{lessonTitle:t.lessonTitle,learningCompetency:t.learningCompetency,moduleUnit:t.moduleUnit,learnerLevel:t.learnerLevel});i=b.sources||[],n=b.explanation||"",l=b.retrievalConfidence,c=b.retrievalBand,d=b.retrievalQuery,m=b.needsReview??!1}catch{n="",i=[]}const p={...t,subject:r,quarter:o,curriculumContext:n?`[CURRICULUM CONTEXT] -${n}`:void 0,curriculumRetrievalConfidence:l,curriculumRetrievalBand:c,curriculumRetrievalQuery:d,needsReview:m};return{...await mt.generateLessonPlan(p),curriculumSources:i,curriculumContext:n}}const ru=Ul("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function nu({className:t,variant:s,asChild:a=!1,...r}){const o=a?rc:"span";return e.jsx(o,{"data-slot":"badge",className:li(ru({variant:s}),t),...r})}function ou(t){return t.length<=42?t:`${t.slice(0,18)}...${t.slice(-20)}`}const Mo=({sources:t=[],className:s})=>t.length?e.jsxs(nc,{children:[e.jsx(oc,{asChild:!0,children:e.jsxs(nu,{className:["bg-[#75D06A]/15 text-[#2E7D32] border-[#75D06A]/40 font-body font-semibold text-[11px] px-2.5 py-1 rounded-full cursor-help",s||""].join(" "),variant:"outline",children:[e.jsx(Wt,{size:12}),"DepEd Aligned"]})}),e.jsxs(ic,{side:"top",sideOffset:6,className:"max-w-sm bg-white border border-[#dde3eb] text-[#0a1628] shadow-lg p-3",children:[e.jsx("p",{className:"text-[11px] font-display font-bold uppercase tracking-wide text-[#5a6578] mb-2",children:"Curriculum Sources"}),e.jsx("div",{className:"space-y-2",children:t.slice(0,5).map((a,r)=>e.jsxs("div",{className:"text-xs leading-relaxed",children:[e.jsxs("p",{className:"font-semibold text-[#0a1628]",children:[a.subject," | Q",a.quarter]}),e.jsxs("p",{className:"text-[#5a6578]",children:[ou(a.sourceFile)," | p.",a.page]}),e.jsxs("p",{className:"text-[#5a6578]",children:["Similarity: ",(a.score*100).toFixed(1),"%"]})]},`${a.sourceFile}-${a.page}-${r}`))})]})]}):null,iu=[{level:"Remember",icon:Hr,bgColor:"bg-sky-500/20",borderColor:"border-sky-500/40",textColor:"text-sky-400",description:"Recall facts, formulas, definitions, and basic procedures.",mathExample:"State the quadratic formula.",mapsTo:"Identification, Enumeration",defaultWeight:"Included by default"},{level:"Understand",icon:Wt,bgColor:"bg-sky-500/20",borderColor:"border-sky-500/40",textColor:"text-sky-400",description:"Explain concepts, interpret graphs, classify mathematical objects.",mathExample:"Explain why the discriminant determines the number of roots.",mapsTo:"Multiple Choice, Identification",defaultWeight:"Included by default"},{level:"Apply",icon:Al,bgColor:"bg-green-500/20",borderColor:"border-green-500/40",textColor:"text-green-400",description:"Use formulas and procedures to solve routine problems.",mathExample:"Solve: 2x² + 5x - 3 = 0 using the quadratic formula.",mapsTo:"Equation-Based, Word Problem",defaultWeight:"Included by default"},{level:"Analyze",icon:Lc,bgColor:"bg-orange-500/20",borderColor:"border-orange-500/40",textColor:"text-orange-400",description:"Break down problems, compare solution methods, identify patterns.",mathExample:"Given f(x) = x³ - 3x, find and classify all critical points.",mapsTo:"Word Problem, Equation-Based",defaultWeight:"Included by default"}],lu=({isOpen:t,onClose:s})=>t?e.jsx(Mt,{children:t&&e.jsx(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[70] flex items-center justify-center p-4",onClick:s,children:e.jsxs(Ae.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-white border border-slate-200 rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col overflow-hidden",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 px-6 py-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(ci,{size:22,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-white",children:"Bloom's Taxonomy in MathPulse AI"}),e.jsx("p",{className:"text-cyan-200 text-xs",children:"Understanding cognitive levels in assessments"})]})]}),e.jsx("button",{onClick:s,className:"w-8 h-8 bg-white/20 hover:bg-white/30 rounded-lg flex items-center justify-center transition-colors",children:e.jsx(Xt,{size:16,className:"text-white"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-2",children:"What is Bloom's Taxonomy?"}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Bloom's Taxonomy is an educational framework developed by Benjamin Bloom in 1956 and revised in 2001. It classifies learning objectives into six cognitive levels, from basic recall of facts up to complex evaluation and creation. MathPulse AI uses the first four levels most relevant to Senior High School mathematics."})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-2",children:"Why MathPulse AI Uses It"}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Using Bloom's Taxonomy ensures that assessments do not only test memorization. A well-balanced math quiz should challenge students at multiple cognitive levels: remembering formulas, understanding concepts, applying procedures, and analyzing relationships. This mirrors the DepEd K-12 competency framework which requires higher-order thinking skills (HOTS) alongside foundational knowledge."})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-3",children:"Level-by-Level Breakdown"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:iu.map(a=>{const r=a.icon;return e.jsxs("div",{className:`${a.bgColor} border ${a.borderColor} rounded-xl p-4 space-y-2`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{size:18,className:a.textColor}),e.jsx("span",{className:`font-bold text-sm ${a.textColor}`,children:a.level})]}),e.jsx("p",{className:"text-xs text-slate-500",children:a.description}),e.jsxs("div",{className:"bg-black/20 rounded-lg p-2",children:[e.jsx("p",{className:"text-[10px] font-semibold text-slate-500 uppercase tracking-wide mb-0.5",children:"Math Example"}),e.jsx("p",{className:"text-xs text-[#dde3eb] italic",children:a.mathExample})]}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsxs("span",{className:"text-slate-500",children:["Maps to: ",e.jsx("span",{className:"text-slate-500 font-medium",children:a.mapsTo})]}),e.jsx("span",{className:"text-green-400 font-medium",children:a.defaultWeight})]})]},a.level)})})]}),e.jsx("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4",children:e.jsxs("p",{className:"text-xs text-slate-500 leading-relaxed",children:[e.jsx("span",{className:"font-semibold text-slate-600",children:"Note:"})," ","All four levels are selected by default to produce a balanced, HOTS-aligned assessment. Deselecting a level will remove questions of that cognitive depth from the generated quiz."]})})]}),e.jsxs("div",{className:"border-t border-slate-200 px-6 py-3 flex items-center justify-between flex-shrink-0 bg-slate-50",children:[e.jsxs("a",{href:"https://cft.vanderbilt.edu/guides-sub-pages/blooms-taxonomy/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-rose-400 hover:text-rose-300 font-medium transition-colors",children:[e.jsx(Bc,{size:12}),"Learn More"]}),e.jsx("button",{onClick:s,className:"px-5 py-2 bg-sky-600 hover:bg-rose-500 text-white text-sm font-bold rounded-xl transition-colors",children:"Got it"})]})]})})}):null,cu={draft:"bg-[#edf1f7] text-[#5a6578]",published:"bg-green-100 text-green-700",assigned:"bg-sky-100 text-sky-700",completed:"bg-rose-100 text-rose-700"},Wa={identification:{label:"Identification",icon:e.jsx(Ns,{size:16}),description:"Define or identify concepts"},enumeration:{label:"Enumeration",icon:e.jsx(ir,{size:16}),description:"List steps or properties"},multiple_choice:{label:"Multiple Choice",icon:e.jsx(Bt,{size:16}),description:"Choose from 4 options"},word_problem:{label:"Word Problem",icon:e.jsx(Wt,{size:16}),description:"Real-world scenarios"},equation_based:{label:"Equation-Based",icon:e.jsx(zl,{size:16}),description:"Solve equations"}},Ao={remember:{label:"Remember",color:"bg-sky-100 text-sky-700 border-sky-300",description:"Recall facts & formulas"},understand:{label:"Understand",color:"bg-emerald-100 text-emerald-700 border-emerald-300",description:"Explain concepts"},apply:{label:"Apply",color:"bg-rose-100 text-rose-700 border-rose-300",description:"Use in new contexts"},analyze:{label:"Analyze",color:"bg-rose-100 text-rose-700 border-rose-300",description:"Examine & compare"}},du=["Grade 11","Grade 12"],Lr=t=>{const s=(t||"").trim().toLowerCase();return s==="grade 12"||s==="12"||s.includes("12")?"Grade 12":"Grade 11"},mu={"Grade 11":{"General Mathematics - Patterns, Relations, and Functions":["Patterns and Real-Life Relationships","Functions as Mathematical Models","Function Notation and Evaluation","Domain and Range of Functions","Operations on Functions","Composite Functions","Inverse Functions","Graphs of Rational Functions","Graphs of Exponential Functions","Graphs of Logarithmic Functions"],"General Mathematics - Financial Mathematics":["Simple and Compound Interest","Simple and General Annuities","Present and Future Value","Loans, Amortization, and Sinking Funds","Stocks, Bonds, and Market Indices","Business Decision-Making with Mathematical Models"],"General Mathematics - Logic and Mathematical Reasoning":["Propositions and Logical Connectives","Truth Values and Truth Tables","Logical Equivalence and Implication","Quantifiers and Negation","Validity of Arguments"]},"Grade 12":{"Pre-Calculus - Analytic Geometry":["Conic Sections - Parabola","Conic Sections - Ellipse","Conic Sections - Hyperbola","Conic Sections - Circle","Systems of Nonlinear Equations"],"Pre-Calculus - Series and Induction":["Sequences and Series","Arithmetic Sequences","Geometric Sequences","Mathematical Induction","Binomial Theorem"],"Pre-Calculus - Trigonometry":["Angles and Unit Circle","Trigonometric Functions","Trigonometric Identities","Sum and Difference Formulas","Inverse Trigonometric Functions","Polar Coordinates"],"Basic Calculus - Limits":["Limits of Functions","Limit Theorems","One-Sided Limits","Infinite Limits and Limits at Infinity","Continuity of Functions"],"Basic Calculus - Derivatives":["Definition of the Derivative","Differentiation Rules","Chain Rule","Implicit Differentiation","Higher-Order Derivatives","Related Rates","Extrema and the First Derivative Test","Concavity and the Second Derivative Test","Optimization Problems"],"Basic Calculus - Integration":["Antiderivatives and Indefinite Integrals","Definite Integrals and the FTC","Integration by Substitution","Area Under a Curve"]}},uu={"Grade 11":["General Mathematics - "],"Grade 12":["Pre-Calculus - ","Basic Calculus - "]},zo=(t,s)=>{const a=uu[s];return Object.fromEntries(Object.entries(t).filter(([r])=>a.some(o=>r.startsWith(o))))},fa=30,ga=12,Dr="mathpulse:quiz-maker:active-task",xu={easy:"text-green-600",medium:"text-rose-600",hard:"text-red-600"},ml=({onBack:t,gradeLevel:s,selectedClassId:a,selectedClassName:r,onOpenNotifications:o,onOpenProfile:n,onOpenInsightModal:i,userPhoto:l,teacherName:c,drawerMode:d=!1,onQuizSaved:m,onQuizGenerating:p})=>{const{currentUser:h,loading:b}=hs(),N=u.useMemo(()=>mt.getImportGroundedRolloutFlags(),[]),[C,y]=u.useState("create"),[f,w]=u.useState("setup"),[I,D]=u.useState(Lr(s)),[M,q]=u.useState(10),[g,S]=u.useState([]),[v,L]=u.useState([]),[E,j]=u.useState(["multiple_choice","word_problem","identification"]),[Q,K]=u.useState(["remember","understand","apply","analyze"]),[ae,ne]=u.useState(!1),[re,he]=u.useState({easy:30,medium:50,hard:20}),[Ne,de]=u.useState({}),[ue,H]=u.useState(!1),[Z,se]=u.useState([]),[Re,$e]=u.useState(!1),[He,U]=u.useState(""),[te,_]=u.useState(!1),[V,k]=u.useState(!1),[O,T]=u.useState(null),[B,G]=u.useState(0),[A,J]=u.useState("queued"),[le,xe]=u.useState("Waiting to start generation..."),[ce,Fe]=u.useState(null),[Te,tt]=u.useState(null),[Oe,Ye]=u.useState(""),[ht,wt]=u.useState(!1),lt=u.useRef(!1),[Nt,$t]=u.useState("topics"),[Gt,Ss]=u.useState(null),[$s,Fs]=u.useState(!1),[is,z]=u.useState("all"),[fe,Xe]=u.useState("all"),[ke,Ce]=u.useState(!1),[Le,yt]=u.useState(null),[nt,R]=u.useState(!1),[ee,Ie]=u.useState(!1),[ge,Je]=u.useState(!1),[ye,Ct]=u.useState([]),[xt,_e]=u.useState(!1),[Jt,Zt]=u.useState(""),[es,Fa]=u.useState(null),[Ys,ks]=u.useState([]),[Oa,Ks]=u.useState(!1),[Os,Ba]=u.useState("all"),[Pa,Ha]=u.useState(null),[Ua,Bs]=u.useState(null),ua=u.useCallback(async()=>{H(!0);const x=Lr(I);try{const $=await mt.getQuizTopics(x);$.topics&&de(zo($.topics,x))}catch{de(zo(mu[x],x))}finally{H(!1)}},[I]),F=u.useCallback(async()=>{if(!N.quizEnabled){se([]),U("Import-grounded quiz generation is disabled by rollout flag; using curriculum defaults."),$e(!1);return}$e(!0),U("");try{const x=await mt.getCourseMaterialTopics({classSectionId:a,limit:20}),$=(x.topics||[]).filter(P=>P.title?.trim());se($),x.warnings&&x.warnings.length>0&&U(x.warnings.join(" "))}catch{se([]),U("Imported topics are currently unavailable; quiz generation will use curriculum defaults.")}finally{$e(!1)}},[a,N.quizEnabled]);u.useEffect(()=>{ua(),S([]),L([])},[ua]),u.useEffect(()=>{F()},[F]);const Y=u.useMemo(()=>{const x=Array.from(new Set(Z.map($=>$.title.trim()).filter(Boolean)));return x.length===0?Ne:{"Imported Course Materials":x,...Ne}},[Ne,Z]);u.useEffect(()=>{z("all"),Xe("all")},[ce]);const Ee=u.useMemo(()=>{if(!ce)return[];const x=ce.questions.map(P=>P.provenance?.sourceFile?.trim()).filter(P=>!!P),$=(ce.metadata.topicProvenance||[]).map(P=>P.sourceFile?.trim()).filter(P=>!!P);return Array.from(new Set([...x,...$])).sort((P,be)=>P.localeCompare(be))},[ce]),Be=u.useMemo(()=>{if(!ce)return[];const x=ce.questions.map(P=>P.provenance?.materialId?.trim()).filter(P=>!!P),$=(ce.metadata.topicProvenance||[]).map(P=>P.materialId?.trim()).filter(P=>!!P);return Array.from(new Set([...x,...$])).sort((P,be)=>P.localeCompare(be))},[ce]),Ft=u.useMemo(()=>ce?ce.questions.filter(x=>{const $=is==="all"||(x.provenance?.sourceFile||"").trim()===is,P=fe==="all"||(x.provenance?.materialId||"").trim()===fe;return $&&P}):[],[ce,is,fe]),De=(x,$)=>{const P={...re},be=Math.max(0,Math.min(100,P[x]+$)),Ge=be-P[x];P[x]=be;const Ze=Object.keys(P).filter(dt=>dt!==x),Qt=Ze.reduce((dt,ts)=>dt+P[ts],0);if(Qt>0)for(const dt of Ze)P[dt]=Math.max(0,Math.round(P[dt]-Ge*P[dt]/Qt));const Xs=Object.values(P).reduce((dt,ts)=>dt+ts,0);if(Xs!==100){const dt=Ze.reduce((ts,Rn)=>P[ts]>=P[Rn]?ts:Rn);P[dt]+=100-Xs}he(P)},Ga=x=>{S($=>$.includes(x)?$.filter(P=>P!==x):[...$,x]),L($=>$.filter(P=>P!==x))},Ot=x=>{j($=>$.includes(x)?$.length>1?$.filter(P=>P!==x):$:[...$,x])},We=x=>{K($=>$.includes(x)?$.length>1?$.filter(P=>P!==x):$:[...$,x])},xa=()=>{let x=g.length>0?g.filter(P=>!v.includes(P)):Object.values(Y).flat().filter(P=>!v.includes(P)).slice(0,3);x.length>ga&&(x=x.slice(0,ga));const $=Math.min(M,fa);return{topics:x,gradeLevel:I,numQuestions:$,questionTypes:E,includeGraphs:ae,difficultyDistribution:re,bloomLevels:Q,excludeTopics:v,classSectionId:a,className:r,preferImportedTopics:N.quizEnabled}},pa=u.useCallback((x,$)=>{const P={taskId:x,request:$,createdAt:new Date().toISOString(),ownerUid:h?.uid};try{sessionStorage.setItem(Dr,JSON.stringify(P))}catch{}},[h]),bs=u.useCallback(()=>{try{sessionStorage.removeItem(Dr)}catch{}},[]),kr=u.useCallback(x=>{const $=Math.max(0,Math.min(100,Math.round(typeof x.progressPercent=="number"?x.progressPercent:x.status==="queued"?10:x.status==="running"?65:x.status==="completed"?100:x.status==="cancelling"?95:100)));G(P=>{let be=Math.max(P,$);if(x.status==="running"&&$<=P){const Ge=String(x.progressStage||"").toLowerCase(),Ze=Ge.includes("assembling")||Ge.includes("final")?97:Ge.includes("generating")?89:95;be=Math.min(Ze,P+1)}return be}),J(x.progressStage||x.status),xe(x.progressMessage||(x.status==="queued"?"Task queued for generation.":x.status==="running"?"Generating quiz in the background...":x.status==="completed"?"Generation complete.":x.status==="cancelling"?"Cancelling generation...":"Generation finished with an error."))},[]);u.useEffect(()=>{if(b||lt.current)return;if(lt.current=!0,!h){bs();return}let x=!1;const $=sessionStorage.getItem(Dr);if(!$)return;let P=null;try{P=JSON.parse($)}catch{bs();return}if(!P?.taskId){bs();return}if(P.ownerUid&&P.ownerUid!==h.uid){bs();return}return _(!0),T(P.taskId),Ye(""),mt.waitForTaskResult(P.taskId,{timeoutMs:24e4,pollIntervalMs:1500,onProgress:kr}).then(async be=>{if(x)return;const Ge=be.result;if(!Ge||typeof Ge!="object")throw new Error("Quiz generation completed without a valid result payload.");const Ze=Ge;Fe(Ze),w("results"),G(100),J("completed"),xe("Generation complete."),T(null),bs();try{await Cn(Ze,P.request),oe.success("Quiz auto-saved to your library as draft.")}catch(Qt){oe.error(Qt instanceof Error?Qt.message:"Quiz generated but failed to save to library")}}).catch(be=>{if(!x){if(be instanceof ar&&(be.status===401||be.status===403)){lt.current=!1,_(!1);return}Ye(be instanceof Error?be.message:"Failed to resume quiz generation"),T(null),bs()}}).finally(()=>{x||_(!1)}),()=>{x=!0}},[kr,b,bs,h]);const yn=()=>{if(te){window.confirm("Quiz generation is in progress. Are you sure you want to leave?")&&(w("setup"),Fe(null),Ye(""),t());return}w("setup"),Fe(null),Ye(""),t()},jl=async()=>{p?.(),Ye(""),_(!0),Bs(null),G(8),J("queued"),xe("Submitting quiz generation task..."),Fe(null);const x=xa();try{const $=await mt.generateQuiz(x,{onTaskCreated:P=>{T(P),pa(P,x),G(be=>Math.max(be,12)),J("queued"),xe("Task queued. Generation is running in the background.")},onProgress:P=>{kr(P),P.taskId&&P.taskId!==O&&T(P.taskId)}});Fe($),w("results"),G(100),J("completed"),xe("Generation complete."),T(null),bs();try{await Cn($,x),oe.success("Quiz auto-saved to your library as draft.")}catch(P){oe.error(P instanceof Error?P.message:"Quiz generated but failed to save to library")}mt.reportImportGroundedFeedback({flow:"quiz",status:"success",classSectionId:x.classSectionId,className:x.className,metadata:{totalQuestions:$.metadata.totalQuestions,usedImportedTopics:!!$.metadata.usedImportedTopics,importedTopicCount:$.metadata.importedTopicCount??0,importGroundingEnabled:N.quizEnabled}})}catch($){Ye($ instanceof Error?$.message:"Quiz generation failed"),G(100),J("failed"),xe("Generation failed."),T(null),bs(),mt.reportImportGroundedFeedback({flow:"quiz",status:"failed",classSectionId:x.classSectionId,className:x.className,metadata:{error:$ instanceof Error?$.message:"Quiz generation failed",importGroundingEnabled:N.quizEnabled}})}finally{_(!1)}},yl=()=>{if(!ce)return;const x=ce.questions.map(($,P)=>{let be=`${P+1}. [${$.difficulty.toUpperCase()}] [${$.bloomLevel}] (${$.points} pts) -`;return be+=` ${$.question} -`,$.options&&(be+=$.options.map(Ge=>` ${Ge}`).join(` -`)+` -`),be+=` Answer: ${$.correctAnswer} -`,be+=` Explanation: ${$.explanation} -`,be}).join(` -`);navigator.clipboard.writeText(x),wt(!0),setTimeout(()=>wt(!1),2e3)},Sl=()=>{if(!ce)return;const x=new Blob([JSON.stringify(ce,null,2)],{type:"application/json"}),$=URL.createObjectURL(x),P=document.createElement("a");P.href=$,P.download=`quiz_${I.replace(/\s/g,"_")}_${Date.now()}.json`,P.click(),URL.revokeObjectURL($)};g.length>0||Object.values(Y).flat().length>0;const Sn=(x,$)=>{const P=$?.gradeLevel||I,be=$?.topics||g,Ge=x.questions.map((Ze,Qt)=>({id:`q_${Date.now()}_${Qt}`,questionType:Ze.questionType||"identification",question:Ze.question,...Ze.options?{options:Ze.options}:{},correctAnswer:Ze.correctAnswer,bloomLevel:Ze.bloomLevel||"understand",difficulty:Ze.difficulty||"medium",topic:Ze.topic,subject:P,points:Ze.points,explanation:Ze.explanation}));return{title:`${P} Quiz – ${be.length>0?be.slice(0,2).join(", "):"Mixed Topics"}`,gradeLevel:P,questions:Ge,totalPoints:x.totalPoints,metadata:{topicsCovered:Object.keys(x.metadata.topicsCovered),difficultyBreakdown:{easy:x.metadata.difficultyBreakdown.easy??0,medium:x.metadata.difficultyBreakdown.medium??0,hard:x.metadata.difficultyBreakdown.hard??0},bloomDistribution:x.metadata.bloomTaxonomyDistribution,questionTypeBreakdown:x.metadata.questionTypeBreakdown,supplementalPurpose:x.metadata.supplementalPurpose,recommendedTeacherActions:x.metadata.recommendedTeacherActions??[],generatedAt:new Date().toISOString(),generatedBy:"teacher_generated"},status:"draft",source:"teacher_generated"}},kn=u.useCallback(x=>{ks($=>[x,...$.filter(P=>P.id!==x.id)])},[]);async function Cn(x,$){if(!h)return null;const P=Sn(x,$),be=await $n(P,h.uid,Le?{documentId:Le}:void 0);return yt(be),kn({id:be,...P,teacherId:h.uid}),be}const kl=async()=>{if(!ce){oe.error("No quiz to save. Generate a quiz first.");return}if(!h){oe.error("You must be signed in to save quizzes.");return}Ce(!0);try{const x=Sn(ce),$=await $n(x,h.uid,Le?{documentId:Le}:void 0);yt($),kn({id:$,...x,teacherId:h.uid}),oe.success("Quiz saved to your library!"),m?.($)}catch(x){oe.error(x instanceof Error?x.message:"Failed to save quiz")}finally{Ce(!1)}},Cl=async()=>{if(Le){R(!0);try{await tc(Le),ks(x=>x.map($=>$.id===Le?{...$,status:"published"}:$)),oe.success("Quiz published to Quiz Bank!")}catch(x){oe.error(x instanceof Error?x.message:"Failed to publish quiz")}finally{R(!1)}}},Cr=async x=>{const $=x??Le;if(!$){oe.error("Save the quiz first before assigning.");return}if(Ha($),Ie(!0),Fa(null),Zt(""),ye.length===0&&h){_e(!0);try{const P=await vn(h.uid);Ct(P)}catch{oe.error("Failed to load students")}finally{_e(!1)}}},Il=async()=>{const x=Pa??Le;if(!(!es||!x||!h)){Je(!0);try{await sc(x,es,h.uid),ks($=>$.map(P=>P.id===x?{...P,status:"assigned",metadata:{...P.metadata,assignedTo:es}}:P)),oe.success("Quiz assigned to student!"),Ie(!1),Ha(null),C==="bank"&&Ir()}catch($){oe.error($ instanceof Error?$.message:"Failed to assign quiz")}finally{Je(!1)}}},Ir=u.useCallback(async()=>{if(h){Ks(!0);try{const x=await hi(h.uid);ks(x)}catch{oe.error("Failed to load quiz bank")}finally{Ks(!1)}}},[h]);u.useEffect(()=>{C==="bank"&&Ir()},[C,Ir]);const Tl=async x=>{try{await ec(x),ks($=>$.filter(P=>P.id!==x)),oe.success("Quiz deleted")}catch{oe.error("Failed to delete quiz")}},In=ye.filter(x=>x.name.toLowerCase().includes(Jt.toLowerCase())||x.email.toLowerCase().includes(Jt.toLowerCase())),Tn=Os==="all"?Ys:Ys.filter(x=>x.status===Os),_l=x=>{const $=(x.metadata.topicsCovered||[]).reduce((P,be)=>(P[be]=(P[be]||0)+1,P),{});return{questions:x.questions.map(P=>({questionType:P.questionType,question:P.question,correctAnswer:P.correctAnswer,options:P.options??null,bloomLevel:P.bloomLevel,difficulty:P.difficulty,topic:P.topic,points:P.points,explanation:P.explanation})),totalPoints:x.totalPoints,metadata:{topicsCovered:$,difficultyBreakdown:x.metadata.difficultyBreakdown,bloomTaxonomyDistribution:x.metadata.bloomDistribution,questionTypeBreakdown:x.metadata.questionTypeBreakdown,gradeLevel:x.gradeLevel,totalQuestions:x.questions.length,includesGraphQuestions:!1,supplementalPurpose:x.metadata.supplementalPurpose,bloomTaxonomyRationale:"Loaded from saved quiz bank entry.",recommendedTeacherActions:x.metadata.recommendedTeacherActions||[]}}},Tr=x=>{yt(x.id),Fe(_l(x)),tt(null),Bs(x.id),z("all"),Xe("all"),Ss(null),w("results"),y("create")},_n={remember:{badge:"border-purple-200 text-purple-700 bg-purple-50",card:"from-[#a855f7] to-[#9333ea]",num:"text-purple-700 bg-purple-100 border-purple-200"},understand:{badge:"border-blue-200 text-blue-700 bg-blue-50",card:"from-[#3b82f6] to-[#2563eb]",num:"text-blue-700 bg-blue-100 border-blue-200"},apply:{badge:"border-amber-200 text-amber-700 bg-amber-50",card:"from-[#f59e0b] to-[#d97706]",num:"text-amber-700 bg-amber-100 border-amber-200"},analyze:{badge:"border-orange-200 text-orange-700 bg-orange-50",card:"from-[#f97316] to-[#ea580c]",num:"text-orange-700 bg-orange-100 border-orange-200"},evaluate:{badge:"border-rose-200 text-rose-700 bg-rose-50",card:"from-[#f43f5e] to-[#e11d48]",num:"text-rose-700 bg-rose-100 border-rose-200"},create:{badge:"border-emerald-200 text-emerald-700 bg-emerald-50",card:"from-[#10b981] to-[#059669]",num:"text-emerald-700 bg-emerald-100 border-emerald-200"}},El=(x,$,P)=>{const be=Gt===$,Ge=_n[x.bloomLevel?.toLowerCase()]||_n.remember,Ze=x.bloomLevel?.toLowerCase()==="remember"?"hover:border-purple-200":x.bloomLevel?.toLowerCase()==="understand"?"hover:border-blue-200":x.bloomLevel?.toLowerCase()==="apply"?"hover:border-amber-200":"hover:border-slate-200";return e.jsxs(Ae.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:$*.05},className:`border border-[#e2e8f0] rounded-[20px] overflow-hidden bg-white shadow-sm hover:shadow-md ${Ze} transition-all duration-300`,children:[e.jsxs("div",{className:"p-6 flex justify-between items-start cursor-pointer hover:bg-slate-50/50 transition-colors",onClick:()=>Ss(be?null:$),children:[e.jsxs("div",{className:"space-y-3 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap mb-1",children:[e.jsxs("span",{className:`w-8 h-8 rounded-lg bg-gradient-to-br ${Ge.card} text-white flex items-center justify-center font-bold text-[13px] shadow-sm`,children:["Q",$+1]}),e.jsx("span",{className:`px-2.5 py-1 rounded-md border text-[10px] font-bold uppercase tracking-wider shadow-sm ${Ge.badge}`,children:x.bloomLevel}),e.jsx("span",{className:`px-2.5 py-1 rounded-md border text-[10px] font-bold uppercase tracking-wider shadow-sm ${x.difficulty==="easy"?"border-emerald-200 text-emerald-700 bg-emerald-50":x.difficulty==="hard"?"border-rose-200 text-rose-700 bg-rose-50":"border-amber-200 text-amber-700 bg-amber-50"}`,children:x.difficulty}),e.jsxs("span",{className:"text-[12px] font-bold text-[#64748b] bg-slate-100 px-2 py-1 rounded-md",children:[x.points," pts"]}),x.topic&&e.jsx("span",{className:"text-[12px] font-semibold text-[#64748b] px-2 py-1 hidden sm:inline-block border-l border-slate-200",children:x.topic})]}),e.jsx("p",{className:"text-[16px] font-bold text-[#1e293b] pr-4 leading-relaxed",children:x.question})]}),e.jsxs("div",{className:"flex flex-col items-end justify-between h-full gap-4 shrink-0 mt-1",children:[e.jsx("span",{className:`px-3 py-1.5 rounded-md text-[10px] font-bold uppercase tracking-widest hidden sm:block border shadow-sm ${Ge.badge}`,children:x.bloomLevel}),e.jsx("div",{className:"w-8 h-8 rounded-full bg-slate-50 flex items-center justify-center border border-slate-200 mt-2",children:be?e.jsx(ka,{size:16,className:"text-[#64748b] transition-transform duration-300"}):e.jsx(zt,{size:16,className:"text-[#64748b]"})})]})]}),e.jsx(Mt,{children:be&&e.jsx(Ae.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:e.jsxs("div",{className:"p-6 pt-0 bg-white",children:[e.jsx("div",{className:"h-px w-full bg-gradient-to-r from-transparent via-[#e2e8f0] to-transparent mb-6"}),x.options&&e.jsxs("div",{className:"mb-6",children:[e.jsx("p",{className:"text-[13px] font-bold text-[#64748b] mb-3 uppercase tracking-wider",children:"Options:"}),e.jsx("div",{className:"space-y-3",children:x.options.map((Qt,Xs)=>{const dt=Qt.includes(x.correctAnswer);return e.jsxs("div",{className:`rounded-[12px] p-4 text-[14px] font-medium transition-all cursor-pointer relative overflow-hidden ${dt?"bg-gradient-to-r from-emerald-50 to-emerald-100/30 border-2 border-emerald-400 text-emerald-800 font-bold shadow-sm":"bg-white border border-[#e2e8f0] text-[#475569] hover:border-[#a855f7] hover:shadow-[0_2px_8px_rgba(168,85,247,0.1)]"}`,children:[dt&&e.jsx("div",{className:"absolute left-0 top-0 w-1 h-full bg-emerald-500"}),e.jsx("span",{className:dt?"pl-2":"",children:Qt}),dt&&e.jsx("div",{className:"w-6 h-6 rounded-full bg-emerald-500 text-white flex items-center justify-center shadow-sm absolute right-4 top-1/2 -translate-y-1/2",children:e.jsx(Bt,{size:13})})]},Xs)})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-5",children:[e.jsxs("div",{className:"bg-emerald-50/80 border border-emerald-200/60 rounded-[16px] p-5 shadow-sm",children:[e.jsxs("p",{className:"text-[11px] font-bold text-emerald-700 uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[e.jsx(Na,{size:14})," Correct Answer"]}),e.jsx("p",{className:"text-[16px] font-bold text-[#1e293b]",children:x.correctAnswer})]}),e.jsxs("div",{className:"bg-purple-50/80 border border-purple-200/60 rounded-[16px] p-5 shadow-sm",children:[e.jsxs("p",{className:"text-[11px] font-bold text-purple-700 uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[e.jsx(Rs,{size:14})," AI Explanation"]}),e.jsx("p",{className:"text-[13px] text-[#475569] leading-relaxed font-medium",children:x.explanation})]})]}),e.jsxs("div",{className:"flex gap-6 text-[12px] font-medium text-[#64748b] mt-5 pt-4 border-t border-slate-100",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Ns,{size:14})," ",e.jsx("strong",{className:"text-[#1e293b]",children:"Type:"})," ",Wa[x.questionType]?.label||x.questionType]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Hr,{size:14})," ",e.jsx("strong",{className:"text-[#1e293b]",children:"Bloom:"})," ",x.bloomLevel]})]})]})})})]},$)},En=e.jsxs("div",{className:"w-full h-full flex flex-col overflow-y-auto bg-gradient-to-br from-[#eef2ff] via-[#f5f3ff] to-[#fff7ed]",children:[e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] pt-[12px] pb-4",children:e.jsxs("div",{className:"flex items-center gap-1 bg-white/50 backdrop-blur-md p-1.5 rounded-full border border-white shadow-[0_2px_8px_rgba(0,0,0,0.04)] w-max",children:[e.jsxs("button",{onClick:()=>y("create"),className:`px-6 py-2 rounded-full text-[13px] font-bold flex items-center gap-2 transition-all duration-300 ease-out ${C==="create"?"bg-white text-[#a855f7] shadow-[0_2px_8px_rgba(168,85,247,0.15)] scale-100":"bg-transparent text-[#64748b] hover:text-[#1e293b] hover:bg-white/60 scale-95 hover:scale-100"}`,children:[e.jsx(qr,{size:16})," Create Quiz"]}),e.jsxs("button",{onClick:()=>y("bank"),className:`px-6 py-2 rounded-full text-[13px] font-bold flex items-center gap-2 transition-all duration-300 ease-out ${C==="bank"?"bg-white text-[#a855f7] shadow-[0_2px_8px_rgba(168,85,247,0.15)] scale-100":"bg-transparent text-[#64748b] hover:text-[#1e293b] hover:bg-white/60 scale-95 hover:scale-100"}`,children:[e.jsx(dr,{size:16})," Quiz Bank"]})]})}),e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] pb-[32px] flex-1",children:[C==="bank"&&e.jsxs("div",{className:"w-full space-y-[24px]",children:[e.jsx("div",{className:"flex items-center gap-3 overflow-x-auto pb-2 border-b border-[#e2e8f0] mb-6",style:{scrollbarWidth:"none"},children:["all","draft","published","assigned","completed"].map(x=>e.jsx("button",{onClick:()=>Ba(x),className:`px-5 py-2 text-[13px] font-bold rounded-full whitespace-nowrap transition-all duration-300 mb-4 capitalize ${Os===x?"bg-purple-50 text-[#9333ea] border border-purple-200 shadow-[0_2px_8px_rgba(168,85,247,0.15)] hover:scale-105":"bg-white/80 text-[#64748b] border border-white hover:border-[#e2e8f0] hover:bg-white shadow-sm hover:shadow-md hover:-translate-y-0.5"}`,children:x==="all"?"All":x.charAt(0).toUpperCase()+x.slice(1)},x))}),Oa?e.jsxs("div",{className:"flex items-center justify-center py-16",children:[e.jsx(ft,{size:24,className:"animate-spin text-sky-500"}),e.jsx("span",{className:"ml-2 text-sm text-[#5a6578]",children:"Loading quiz bank…"})]}):Tn.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-slate-500",children:[e.jsx(dr,{size:40,className:"mb-3"}),e.jsx("p",{className:"font-medium",children:"No quizzes found"}),e.jsx("p",{className:"text-xs mt-1",children:"Generate your first quiz in the Create tab"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Tn.map(x=>e.jsxs(Ae.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},onClick:()=>Tr(x),role:"button",tabIndex:0,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),Tr(x))},className:`relative bg-white/80 backdrop-blur-md rounded-[20px] p-6 shadow-sm border flex flex-col group hover:-translate-y-1 transition-all duration-300 cursor-pointer overflow-hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#a855f7] ${x.status==="assigned"||x.status==="published"?"border-white hover:border-purple-100 hover:shadow-[0_8px_24px_rgba(168,85,247,0.1)]":"border-white hover:border-slate-200 hover:shadow-[0_8px_24px_rgba(0,0,0,0.06)]"}`,children:[e.jsx("div",{className:`absolute top-0 left-0 w-[6px] h-full transition-colors duration-300 ${x.status==="assigned"||x.status==="published"?"bg-purple-300 group-hover:bg-[#a855f7]":"bg-slate-200 group-hover:bg-slate-400"}`}),e.jsxs("div",{className:"flex justify-between items-start mb-4 gap-4 pl-3",children:[e.jsx("h3",{className:`font-bold text-[15px] text-[#1e293b] leading-tight transition-colors ${x.status==="assigned"||x.status==="published"?"group-hover:text-[#9333ea]":"group-hover:text-slate-700"}`,children:x.title}),e.jsx("span",{className:`px-2.5 py-1 rounded-[6px] text-[10px] font-bold uppercase tracking-wider shrink-0 shadow-sm ${cu[x.status]}`,children:x.status})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-5 pl-3",children:x.metadata.topicsCovered.slice(0,3).map($=>e.jsx("span",{className:"px-2.5 py-1 bg-[#f8fafc] text-slate-600 text-[11px] font-medium rounded-md border border-slate-200 group-hover:border-slate-300 transition-colors",children:$},$))}),e.jsxs("div",{className:"flex items-center gap-5 text-[13px] text-[#64748b] font-medium mb-6 pl-3",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(lc,{size:14})," ",x.questions.length," questions"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(di,{size:14})," ",x.totalPoints," pts"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(us,{size:14})," ",x.gradeLevel]})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-auto pt-5 border-t border-[#f1f5f9] pl-3",children:[e.jsxs("button",{onClick:$=>{$.stopPropagation(),Tr(x)},className:"flex items-center gap-1.5 text-[13px] font-semibold text-[#64748b] hover:text-[#1e293b] transition-colors bg-slate-50 hover:bg-slate-100 border border-slate-200 px-4 py-2 rounded-full shadow-sm",children:[e.jsx(cc,{size:14})," View"]}),e.jsxs("button",{onClick:$=>{$.stopPropagation(),Cr(x.id)},className:"flex items-center gap-1.5 text-[13px] font-bold text-[#a855f7] hover:text-[#9333ea] transition-colors",children:[e.jsx(wa,{size:14})," Assign"]}),e.jsxs("button",{onClick:$=>{$.stopPropagation(),Tl(x.id)},className:"flex items-center gap-1.5 text-[13px] font-semibold text-rose-500 hover:text-rose-700 transition-colors ml-auto opacity-60 group-hover:opacity-100",children:[e.jsx(fi,{size:14})," Delete"]})]})]},x.id))})]}),C==="create"&&e.jsxs(e.Fragment,{children:[Oe&&e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] pt-4",children:e.jsxs(Ae.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-red-50 border border-red-200 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(gr,{size:18,className:"text-red-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-red-800 font-medium",children:"Error"}),e.jsx("p",{className:"text-sm text-red-600",children:Oe})]}),e.jsx("button",{onClick:()=>Ye(""),className:"ml-auto",children:e.jsx(Xt,{size:14,className:"text-red-400"})})]})}),te&&e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-[24px] xl:p-[32px]",children:[e.jsxs("div",{className:"bg-white p-8 rounded-[16px] shadow-sm border border-[#e2e8f0] w-full max-w-3xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"text-[16px] font-bold text-[#1e293b] flex items-center gap-3",children:[e.jsx(ft,{size:20,className:"animate-spin text-[#a855f7]"}),"Generating Quiz in Background"]}),e.jsxs("span",{className:"text-[14px] font-extrabold text-[#9333ea]",children:[B,"%"]})]}),e.jsx("div",{className:"w-full bg-slate-100 h-2.5 rounded-full overflow-hidden mb-6",children:e.jsx(Ae.div,{animate:{width:`${B}%`},transition:{duration:.35,ease:"easeOut"},className:"bg-gradient-to-r from-sky-400 via-indigo-500 to-purple-500 h-full rounded-full"})}),e.jsxs("div",{className:"text-[13px] text-[#64748b]",children:[e.jsxs("p",{className:"font-medium text-[#475569] mb-1",children:["Stage: ",e.jsx("span",{className:"font-bold text-[#1e293b] capitalize",children:A.replace(/_/g," ")})]}),e.jsx("p",{children:le}),O&&e.jsxs("p",{className:"text-[11px] mt-3 opacity-60 font-mono",children:["Task ID: ",O]})]})]}),e.jsxs("p",{className:"mt-8 text-[14px] font-medium text-[#64748b] flex items-center gap-2 animate-pulse",children:[e.jsx(ft,{size:16,className:"animate-spin"})," Generating quiz... Please wait."]})]}),!te&&f!=="results"&&e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] mb-8",children:e.jsx("div",{className:"flex items-center justify-between bg-white/80 backdrop-blur-[12px] rounded-2xl border border-white shadow-[0_4px_16px_rgba(0,0,0,0.03)] p-1.5",children:[{id:"setup",label:"Setup"},{id:"topics",label:"Topics"},{id:"style",label:"Question Style"},{id:"preview",label:"Preview"}].map((x,$)=>{const be=["setup","topics","style","preview"].indexOf(f),Ge=be>$,Ze=be===$;return e.jsxs("div",{className:`flex-1 flex items-center justify-center gap-2 py-3 px-4 rounded-xl transition-all duration-500 ${Ze?"bg-purple-50/80 shadow-[0_1px_3px_rgba(168,85,247,0.1)]":Ge?"bg-transparent":"bg-transparent opacity-60"}`,children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[12px] font-bold shrink-0 ${Ze?"bg-gradient-to-br from-[#a855f7] to-[#9333ea] text-white shadow-md":Ge?"bg-emerald-500 text-white shadow-sm":"bg-slate-100 text-[#64748b]"}`,children:Ge?e.jsx(Bt,{size:13,strokeWidth:3}):$+1}),e.jsx("span",{className:`text-[13px] font-bold whitespace-nowrap ${Ze?"text-[#9333ea]":Ge?"text-[#1e293b]":"text-[#64748b]"}`,children:x.label})]},x.id)})})}),f==="setup"&&!te&&e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] flex-1 space-y-[24px] pb-8",children:[e.jsxs("div",{className:"bg-gradient-to-r from-purple-50/80 to-indigo-50/80 backdrop-blur-sm border border-purple-100/50 rounded-[16px] p-5 flex items-start gap-4 shadow-sm hover:shadow-md transition-shadow duration-300",children:[e.jsx("div",{className:"bg-white p-2 rounded-full shadow-sm shrink-0",children:e.jsx(sa,{size:18,className:"text-[#9333ea]"})}),e.jsxs("p",{className:"text-[13px] text-[#475569] leading-relaxed pt-0.5",children:["This quiz maker generates ",e.jsx("span",{className:"font-bold text-[#9333ea]",children:"supplemental assessments"})," to support classroom instruction. Questions follow Bloom's Taxonomy for comprehensive skill evaluation. Generation limit: up to ",fa," questions and ",ga," topics per quiz."]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[20px] border border-white shadow-[0_4px_16px_rgba(0,0,0,0.03)] overflow-hidden hover:shadow-[0_8px_24px_rgba(0,0,0,0.06)] transition-all duration-300",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-white/50",children:e.jsx("h3",{className:"text-[11px] font-bold text-[#64748b] uppercase tracking-wider",children:"Basic Settings"})}),e.jsxs("div",{className:"p-8 flex flex-col md:flex-row gap-8",children:[e.jsxs("div",{className:"flex-1 group",children:[e.jsx("label",{htmlFor:"quiz-grade-level",className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Grade level"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{id:"quiz-grade-level",value:I,onChange:x=>D(Lr(x.target.value)),className:"appearance-none w-full bg-white border border-[#e2e8f0] hover:border-[#cbd5e1] text-[#475569] text-[14px] font-medium rounded-xl px-4 py-3.5 outline-none focus:border-[#a855f7] focus:ring-4 focus:ring-[#a855f7]/10 cursor-pointer transition-all duration-200 shadow-sm",children:du.map(x=>e.jsx("option",{value:x,children:x},x))}),e.jsx(zt,{size:18,className:"text-[#64748b] absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none"})]})]}),e.jsxs("div",{className:"flex-1 group",children:[e.jsx("label",{htmlFor:"quiz-num-questions",className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Number of questions"}),e.jsxs("div",{className:"flex items-center bg-white border border-[#e2e8f0] rounded-xl overflow-hidden focus-within:border-[#a855f7] focus-within:ring-4 focus-within:ring-[#a855f7]/10 transition-all duration-200 h-[50px] shadow-sm hover:border-[#cbd5e1]",children:[e.jsx("button",{onClick:()=>q(Math.max(1,M-1)),className:"w-14 h-full flex items-center justify-center text-[#64748b] bg-slate-50 hover:bg-slate-100 hover:text-[#1e293b] transition-colors border-r border-[#e2e8f0] active:bg-slate-200",children:e.jsx(Fn,{size:16})}),e.jsx("input",{id:"quiz-num-questions",type:"number",min:1,max:fa,value:M,onChange:x=>q(Math.min(fa,Math.max(1,parseInt(x.target.value)||1))),className:"flex-1 text-center font-bold text-[16px] text-[#1e293b] border-none outline-none focus:ring-0 w-full h-full p-0"}),e.jsx("button",{onClick:()=>q(Math.min(fa,M+1)),className:"w-14 h-full flex items-center justify-center text-[#64748b] bg-slate-50 hover:bg-slate-100 hover:text-[#1e293b] transition-colors border-l border-[#e2e8f0] active:bg-slate-200",children:e.jsx(ia,{size:16})})]})]})]})]})]}),f==="topics"&&!te&&e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] flex-1 space-y-[24px] pb-8",children:[e.jsxs("div",{className:"flex items-end justify-between mb-2",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[20px] font-bold text-[#1e293b] mb-1",children:"Select topics"}),e.jsxs("p",{className:"text-[13px] text-[#64748b]",children:["Choose up to ",ga," topics across all strands"]})]}),e.jsxs("div",{className:"bg-purple-50 border border-purple-100 px-3 py-1.5 rounded-full flex items-center gap-2 shadow-sm",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#a855f7] animate-pulse"}),e.jsxs("span",{className:"text-[12px] font-bold text-[#a855f7]",children:[g.filter(x=>!v.includes(x)).length," of ",ga," selected"]})]})]}),ue?e.jsxs("div",{className:"flex items-center justify-center py-10 text-sm text-[#5a6578]",children:[e.jsx(ft,{size:24,className:"animate-spin text-[#9b51e0] mr-2"})," Loading topics..."]}):e.jsx("div",{className:"space-y-3",children:Object.entries(Y).map(([x,$])=>{const P=$.filter(Ge=>g.includes(Ge)&&!v.includes(Ge)).length,be=Nt===x;return e.jsxs("div",{className:"border border-[#dde3eb] rounded-xl bg-white overflow-hidden shadow-sm",children:[e.jsxs("button",{onClick:()=>$t(be?null:x),className:"w-full flex items-center justify-between p-4 hover:bg-[#f7f9fc] transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-1 h-6 bg-[#9b51e0] rounded-full"}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"font-bold text-[#0a1628] text-sm",children:x}),e.jsxs("p",{className:"text-xs text-slate-500",children:[$.length," topics"]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"bg-purple-100 text-[#9b51e0] px-2.5 py-0.5 rounded-full text-xs font-semibold",children:[P," selected"]}),be?e.jsx(ka,{size:18,className:"text-slate-400"}):e.jsx(zt,{size:18,className:"text-slate-400"})]})]}),e.jsx(Mt,{children:be&&e.jsx(Ae.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},className:"overflow-hidden border-t border-[#edf1f7]",children:e.jsx("div",{className:"py-2",children:$.map((Ge,Ze)=>{const Qt=g.includes(Ge),Xs=v.includes(Ge),dt=Qt&&!Xs;let ts="Core";return Ze%3===0&&(ts="Foundation"),Ze%3===2&&(ts="Advanced"),e.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-[#f7f9fc]",children:[e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer flex-1",children:[e.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center transition-colors ${dt?"bg-[#9b51e0] border-[#9b51e0]":"border-2 border-[#dde3eb] bg-white"}`,children:dt&&e.jsx(Bt,{size:14,className:"text-white"})}),e.jsx("input",{type:"checkbox",className:"hidden",checked:dt,onChange:()=>Ga(Ge)}),e.jsx("span",{className:`text-sm font-semibold ${dt?"text-[#0a1628]":"text-[#5a6578]"}`,children:Ge})]}),e.jsx("span",{className:`border px-3 py-1 rounded-full text-[10px] uppercase font-bold tracking-wider ${ts==="Advanced"?"bg-white text-slate-400 border-[#dde3eb]":"bg-purple-50 text-[#9b51e0] border-purple-100"}`,children:ts})]},Ge)})})})})]},x)})})]}),f==="style"&&!te&&e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] flex-1 space-y-[24px] pb-8",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[20px] border border-[#e2e8f0] shadow-sm overflow-hidden hover:shadow-[0_8px_24px_rgba(0,0,0,0.04)] transition-shadow duration-300",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-white/50",children:e.jsx("h3",{className:"text-[11px] font-bold text-[#64748b] uppercase tracking-wider",children:"Question Types"})}),e.jsx("div",{className:"p-4 grid grid-cols-2 sm:grid-cols-5 gap-3",children:Object.entries(Wa).map(([x,$])=>{const P=E.includes(x);return e.jsxs("button",{onClick:()=>Ot(x),className:`border-2 rounded-[16px] p-4 flex flex-col items-center justify-center text-center cursor-pointer transition-all duration-300 relative overflow-hidden group hover:-translate-y-1 ${P?"border-[#a855f7] bg-gradient-to-b from-purple-50/80 to-white/80 shadow-[0_4px_12px_rgba(168,85,247,0.12)]":"border-slate-100 bg-slate-50/50 shadow-sm hover:shadow-md hover:border-purple-200"}`,children:[P&&e.jsx("div",{className:"absolute top-2 right-2 w-5 h-5 bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-full flex items-center justify-center shadow-md",children:e.jsx(Bt,{size:11,className:"text-white"})}),e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center mb-3 group-hover:scale-110 transition-transform duration-300 ${P?"bg-white border border-purple-200 shadow-md":"bg-white border border-slate-200 shadow-sm group-hover:shadow-md"}`,children:e.jsx("span",{className:P?"text-[#a855f7]":"text-slate-500",children:$.icon})}),e.jsx("span",{className:`font-bold text-[12px] leading-tight ${P?"text-[#9333ea]":"text-slate-700"}`,children:$.label})]},x)})})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[20px] border border-[#e2e8f0] shadow-sm overflow-hidden hover:shadow-[0_8px_24px_rgba(0,0,0,0.04)] transition-shadow duration-300",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-white/50",children:e.jsx("h3",{className:"text-[11px] font-bold text-[#64748b] uppercase tracking-wider",children:"Bloom's Taxonomy Levels"})}),e.jsx("div",{className:"p-6 flex flex-wrap gap-4",children:Object.entries(Ao).map(([x,$])=>{const P=Q.includes(x);return e.jsx("button",{onClick:()=>We(x),className:`px-6 py-2.5 rounded-full border-2 font-bold text-[13px] transition-all duration-200 hover:-translate-y-0.5 capitalize ${P?"border-[#a855f7] text-[#9333ea] bg-purple-50/80 shadow-[0_2px_8px_rgba(168,85,247,0.15)]":"border-slate-200 text-[#64748b] bg-white shadow-sm hover:border-slate-300 hover:bg-slate-50"}`,children:x},x)})})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[20px] border border-[#e2e8f0] shadow-sm overflow-hidden hover:shadow-[0_8px_24px_rgba(0,0,0,0.04)] transition-shadow duration-300",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-white/50",children:e.jsx("h3",{className:"text-[11px] font-bold text-[#64748b] uppercase tracking-wider",children:"Difficulty Distribution"})}),e.jsx("div",{className:"p-8 space-y-8",children:Object.entries(re).map(([x,$])=>{const P={easy:"bg-emerald-400",medium:"bg-amber-400",hard:"bg-rose-400"},be={easy:"text-emerald-600",medium:"text-amber-500",hard:"text-rose-500"},Ge={easy:"group-hover:border-emerald-200",medium:"group-hover:border-amber-200",hard:"group-hover:border-rose-200"};return e.jsxs("div",{className:"flex items-center gap-6 group",children:[e.jsx("span",{className:`w-16 text-[13px] font-bold text-[#475569] capitalize group-hover:${be[x]} transition-colors`,children:x}),e.jsx("div",{className:"flex-1 bg-slate-100 h-3 rounded-full overflow-hidden shadow-inner",children:e.jsx(Ae.div,{animate:{width:`${$}%`},className:`h-full rounded-full transition-all duration-500 ease-out ${P[x]}`})}),e.jsxs("div",{className:`flex items-center bg-white border border-[#e2e8f0] rounded-xl shadow-sm overflow-hidden p-0.5 w-28 h-10 transition-colors ${Ge[x]}`,children:[e.jsx("button",{onClick:()=>De(x,-5),className:`w-8 h-full flex items-center justify-center text-[#64748b] hover:bg-slate-50 hover:${be[x]} rounded-lg transition-colors`,children:e.jsx(Fn,{className:"w-3.5 h-3.5"})}),e.jsx("input",{type:"text",value:`${$}%`,readOnly:!0,className:"flex-1 text-center font-bold text-[14px] text-[#1e293b] border-none outline-none focus:ring-0 w-full p-0 pointer-events-none"}),e.jsx("button",{onClick:()=>De(x,5),className:`w-8 h-full flex items-center justify-center text-[#64748b] hover:bg-slate-50 hover:${be[x]} rounded-lg transition-colors`,children:e.jsx(ia,{className:"w-3.5 h-3.5"})})]})]},x)})})]})]}),f==="preview"&&!te&&!ce&&e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] flex-1 space-y-[24px] pb-8",children:e.jsxs("div",{className:"bg-white/80 backdrop-blur-md rounded-[20px] border border-[#e2e8f0] shadow-[0_8px_24px_rgba(0,0,0,0.04)] overflow-hidden p-8",children:[e.jsxs("h3",{className:"text-[12px] font-bold text-[#64748b] uppercase tracking-wider mb-6 flex items-center gap-2",children:[e.jsx(_s,{size:16,className:"text-[#a855f7]"})," Quiz Summary"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-6",children:[{label:"Questions",value:M},{label:"Topics",value:g.filter(x=>!v.includes(x)).length},{label:"Level",value:I.replace("Grade ","Gr. ")}].map(x=>e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-purple-50 to-indigo-50 rounded-[16px] p-6 text-center border border-purple-100/50 shadow-sm flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-16 h-16 bg-purple-200/30 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx("span",{className:"text-[36px] font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-[#a855f7] to-[#9333ea] leading-none mb-1 relative z-10",children:x.value}),e.jsx("span",{className:"text-[13px] font-bold text-[#64748b] relative z-10",children:x.label})]},x.label))}),e.jsxs("div",{className:"bg-slate-50/80 rounded-[14px] p-5 border border-slate-200/60 text-[#475569] text-[14px] leading-relaxed flex gap-4 items-start shadow-inner",children:[e.jsx(sa,{size:18,className:"text-[#94a3b8] shrink-0 mt-0.5"}),e.jsxs("p",{children:[E.map(x=>Wa[x]?.label).join(" and ")," questions across"," ",e.jsxs("span",{className:"font-bold text-[#1e293b]",children:[g.filter(x=>!v.includes(x)).length," topics"]})," ","— aligned to ",e.jsx("span",{className:"font-semibold",children:Q.map(x=>Ao[x]?.label).join(", ")})," levels of Bloom's Taxonomy."," ",e.jsxs("span",{className:"font-semibold text-emerald-600",children:["Easy ",re.easy,"%"]})," • ",e.jsxs("span",{className:"font-semibold text-amber-500",children:["Medium ",re.medium,"%"]})," • ",e.jsxs("span",{className:"font-semibold text-rose-500",children:["Hard ",re.hard,"%"]}),"."]})]})]})}),f==="results"&&ce&&e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] space-y-[24px] pb-8",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-md rounded-[20px] border border-[#e2e8f0] shadow-[0_8px_24px_rgba(0,0,0,0.04)] p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-bold font-display text-[#0a1628]",children:"Quiz Generated"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:yl,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-[#dde3eb] rounded-lg text-xs font-medium text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:[ht?e.jsx(Bt,{size:14,className:"text-green-500"}):e.jsx(Gr,{size:14}),ht?"Copied!":"Copy All"]}),e.jsxs("button",{onClick:Sl,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-[#dde3eb] rounded-lg text-xs font-medium text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:[e.jsx(mc,{size:14}),"Export JSON"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 md:gap-6",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] text-white shadow-[0_8px_16px_rgba(168,85,247,0.25)] rounded-[20px] p-6 text-center flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-20 h-20 bg-white/10 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx(Ns,{size:22,className:"text-white/80 mb-2 relative z-10"}),e.jsx("span",{className:"text-[32px] font-extrabold leading-none mb-1 relative z-10 drop-shadow-sm",children:ce.questions.length}),e.jsx("span",{className:"text-[12px] font-bold text-white/90 uppercase tracking-widest relative z-10",children:"Questions"})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f43f5e] to-[#e11d48] text-white shadow-[0_8px_16px_rgba(244,63,94,0.25)] rounded-[20px] p-6 text-center flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-20 h-20 bg-white/10 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx(xs,{size:22,className:"text-white/80 mb-2 relative z-10"}),e.jsx("span",{className:"text-[32px] font-extrabold leading-none mb-1 relative z-10 drop-shadow-sm",children:ce.totalPoints}),e.jsx("span",{className:"text-[12px] font-bold text-white/90 uppercase tracking-widest relative z-10",children:"Total Points"})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f59e0b] to-[#d97706] text-white shadow-[0_8px_16px_rgba(245,158,11,0.25)] rounded-[20px] p-6 text-center flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-20 h-20 bg-white/10 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx(Wt,{size:22,className:"text-white/80 mb-2 relative z-10"}),e.jsx("span",{className:"text-[32px] font-extrabold leading-none mb-1 relative z-10 drop-shadow-sm",children:Object.keys(ce.metadata.topicsCovered).length}),e.jsx("span",{className:"text-[12px] font-bold text-white/90 uppercase tracking-widest relative z-10",children:"Topics"})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] text-white shadow-[0_8px_16px_rgba(16,185,129,0.25)] rounded-[20px] p-6 text-center flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-20 h-20 bg-white/10 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx(ir,{size:22,className:"text-white/80 mb-2 relative z-10"}),e.jsx("span",{className:"text-[32px] font-extrabold leading-none mb-1 relative z-10 drop-shadow-sm",children:Object.keys(ce.metadata.bloomTaxonomyDistribution).length}),e.jsx("span",{className:"text-[12px] font-bold text-white/90 uppercase tracking-widest relative z-10",children:"Bloom Levels"})]})]}),(ce.metadata.usedImportedTopics||(ce.metadata.topicProvenance||[]).length>0)&&e.jsxs("div",{className:"mt-4 bg-white rounded-lg p-3 border border-[#dde3eb]",children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Imported Topic Provenance"}),e.jsxs("p",{className:"text-xs text-[#5a6578] mb-2",children:["Imported topics used: ",ce.metadata.usedImportedTopics?"Yes":"No"," • ","Materials: ",ce.metadata.importedMaterialsCount??0," • ","Topics: ",ce.metadata.importedTopicCount??0]}),(ce.metadata.topicProvenance||[]).slice(0,5).map((x,$)=>e.jsxs("div",{className:"text-xs text-[#5a6578]",children:[x.title||"Untitled topic",x.sourceFile?` • ${x.sourceFile}`:""]},`${x.topicId||x.title||"topic"}_${$}`)),(Ee.length>0||Be.length>0)&&e.jsxs("div",{className:"mt-3 grid grid-cols-1 md:grid-cols-2 gap-2",children:[e.jsxs("label",{className:"text-xs text-[#5a6578] flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:"Filter by Source File"}),e.jsxs("select",{value:is,onChange:x=>z(x.target.value),className:"bg-white border border-[#dde3eb] rounded-md px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"All sources"}),Ee.map(x=>e.jsx("option",{value:x,children:x},x))]})]}),e.jsxs("label",{className:"text-xs text-[#5a6578] flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:"Filter by Material ID"}),e.jsxs("select",{value:fe,onChange:x=>Xe(x.target.value),className:"bg-white border border-[#dde3eb] rounded-md px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"All materials"}),Be.map(x=>e.jsx("option",{value:x,children:x},x))]})]})]}),e.jsxs("p",{className:"text-[11px] text-[#5a6578] mt-2",children:["Showing ",Ft.length," of ",ce.questions.length," questions after provenance filters."]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mt-8 mb-10",children:[e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-[16px] p-6 shadow-sm border-t-[4px] border-t-[#10b981] hover:shadow-md transition-shadow",children:[e.jsxs("h4",{className:"text-[12px] font-bold text-[#64748b] uppercase tracking-wider mb-5 flex items-center gap-2",children:[e.jsx(_s,{size:14})," Difficulty"]}),e.jsx("div",{className:"space-y-3 text-[14px] font-medium text-[#475569]",children:Object.entries(ce.metadata.difficultyBreakdown).map(([x,$])=>e.jsxs("div",{className:"flex justify-between items-center bg-slate-50 px-3 py-2 rounded-lg",children:[e.jsx("span",{className:`font-bold capitalize ${xu[x]||"text-[#475569]"}`,children:x}),e.jsx("span",{className:"font-bold text-[#1e293b] bg-white px-2 py-0.5 rounded shadow-sm border border-slate-100",children:$})]},x))})]}),e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-[16px] p-6 shadow-sm border-t-[4px] border-t-[#a855f7] hover:shadow-md transition-shadow",children:[e.jsxs("h4",{className:"text-[12px] font-bold text-[#64748b] uppercase tracking-wider mb-5 flex items-center gap-2",children:[e.jsx(Hr,{size:14})," Bloom's Taxonomy"]}),e.jsx("div",{className:"space-y-3 text-[14px] font-medium text-[#475569]",children:Object.entries(ce.metadata.bloomTaxonomyDistribution).map(([x,$])=>e.jsxs("div",{className:"flex justify-between items-center bg-slate-50 px-3 py-2 rounded-lg",children:[e.jsx("span",{className:"text-[#1e293b] font-semibold capitalize",children:x}),e.jsx("span",{className:"font-bold text-[#1e293b] bg-white px-2 py-0.5 rounded shadow-sm border border-slate-100",children:$})]},x))})]}),e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-[16px] p-6 shadow-sm border-t-[4px] border-t-[#0ea5e9] hover:shadow-md transition-shadow",children:[e.jsxs("h4",{className:"text-[12px] font-bold text-[#64748b] uppercase tracking-wider mb-5 flex items-center gap-2",children:[e.jsx(ir,{size:14})," Question Types"]}),e.jsx("div",{className:"space-y-3 text-[14px] font-medium text-[#475569]",children:Object.entries(ce.metadata.questionTypeBreakdown).map(([x,$])=>e.jsxs("div",{className:"flex justify-between items-center bg-slate-50 px-3 py-2 rounded-lg",children:[e.jsx("span",{className:"text-[#1e293b] font-semibold",children:Wa[x]?.label||x}),e.jsx("span",{className:"font-bold text-[#1e293b] bg-white px-2 py-0.5 rounded shadow-sm border border-slate-100",children:$})]},x))})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-purple-50 to-indigo-50/50 border border-purple-100 rounded-[16px] p-6 mb-10 flex items-start gap-4 shadow-sm relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full bg-[#a855f7]"}),e.jsx("div",{className:"bg-white p-2 rounded-full shadow-sm shrink-0",children:e.jsx(sa,{size:18,className:"text-[#9333ea]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold text-[#9333ea] mb-3",children:ce.metadata.supplementalPurpose||"This quiz is designed to supplement classroom instruction, not replace teacher-led learning."}),ce.metadata.recommendedTeacherActions&&ce.metadata.recommendedTeacherActions.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[13px] font-bold text-[#1e293b] mb-2",children:"Recommended Actions:"}),e.jsx("ul",{className:"list-disc pl-5 text-[13px] font-medium text-[#475569] space-y-1.5",children:ce.metadata.recommendedTeacherActions.map((x,$)=>e.jsx("li",{children:x},$))})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("h3",{className:"text-[18px] font-bold text-[#1e293b] flex items-center gap-2",children:[e.jsx(vi,{size:20,className:"text-[#a855f7]"})," Review Questions"]}),e.jsx("div",{className:"space-y-4",children:Ft.length>0?Ft.map((x,$)=>El(x,$)):e.jsx("div",{className:"border border-[#dde3eb] rounded-xl p-4 bg-white text-sm text-[#5a6578]",children:"No questions match the selected provenance filters. Clear one or both filters to view all questions."})})]})]})]})]}),C==="create"&&e.jsx("div",{className:"sticky bottom-0 mt-auto w-full bg-white/90 backdrop-blur-[12px] border-t border-[#e2e8f0] z-30 shadow-[0_-4px_12px_rgba(0,0,0,0.03)]",children:e.jsxs("div",{className:"w-full px-6 xl:px-8 py-4 flex items-center justify-between",children:[e.jsxs("div",{children:[f==="topics"&&!te&&e.jsx("button",{onClick:()=>{S([]),L([])},className:"text-[13px] font-semibold text-[#a855f7] hover:underline",children:"Clear all"}),(f==="style"||f==="preview")&&!te&&e.jsxs("button",{onClick:()=>w(f==="preview"?"style":"topics"),className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-sm transition-transform hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(Es,{size:16})," Back"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[f==="setup"&&!te&&e.jsxs("button",{onClick:()=>w("topics"),className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-semibold rounded-full px-8 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02] flex items-center gap-2",children:["Next: Topics ",e.jsx(Is,{size:16})]}),f==="topics"&&!te&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>w("setup"),className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-sm transition-transform hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(Es,{size:16})," Back"]}),e.jsxs("button",{onClick:()=>w("style"),className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02] flex items-center gap-2",children:["Next: Question Style ",e.jsx(Is,{size:16})]})]}),f==="style"&&!te&&e.jsxs("button",{onClick:()=>w("preview"),className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-semibold rounded-full px-8 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02] flex items-center gap-2",children:["Next: Preview ",e.jsx(Is,{size:16})]}),f==="preview"&&!te&&!ce&&e.jsxs("button",{onClick:jl,className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-bold rounded-full px-8 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-all hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(Bt,{size:16})," Generate Quiz"]}),te&&e.jsxs("div",{className:"flex items-center gap-3 text-slate-500 font-medium text-sm",children:[e.jsx(ft,{size:16,className:"animate-spin"})," Generating quiz... Please wait."]}),f==="results"&&(Ua?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{y("bank"),Bs(null)},className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-sm transition-transform hover:scale-[1.02]",children:"Back to Quiz Bank"}),e.jsxs("button",{onClick:()=>Cr(Ua),className:"bg-white border border-[#a855f7] text-[#9333ea] hover:bg-purple-50 text-[14px] font-bold rounded-full px-8 py-2.5 shadow-sm transition-transform hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(wa,{size:16})," Assign"]}),e.jsx("button",{onClick:yn,className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-bold rounded-full px-10 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02]",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{w("setup"),Fe(null),tt(null),yt(null),Bs(null)},className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-sm transition-transform hover:scale-[1.02]",children:"Create Another"}),Le?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:Cl,disabled:nt,className:"bg-white border border-[#a855f7] text-[#9333ea] hover:bg-purple-50 text-[14px] font-bold rounded-full px-8 py-2.5 shadow-sm transition-transform hover:scale-[1.02] flex items-center gap-2",children:[nt?e.jsx(ft,{size:16,className:"animate-spin"}):e.jsx(na,{size:16})," Publish"]}),e.jsxs("button",{onClick:()=>Cr(),className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-bold rounded-full px-8 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(wa,{size:16})," Assign to Class"]})]}):e.jsxs("button",{onClick:kl,disabled:ke,className:"bg-emerald-600 hover:bg-emerald-700 text-white px-8 py-2.5 rounded-full font-bold shadow-lg shadow-emerald-500/30 hover:-translate-y-1 transition-all flex items-center gap-2 text-[14px]",children:[ke?e.jsx(ft,{size:16,className:"animate-spin"}):e.jsx(gi,{size:16})," Save to Library"]}),e.jsx("button",{onClick:yn,className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-bold rounded-full px-10 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02]",children:"Done"})]}))]})]})}),e.jsx(lu,{isOpen:$s,onClose:()=>Fs(!1)}),e.jsx(Mt,{children:ee&&e.jsx(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/40 z-[60] flex items-center justify-center p-4",onClick:()=>Ie(!1),children:e.jsxs(Ae.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-[#f7f9fc] rounded-2xl shadow-2xl w-full max-w-md max-h-[70vh] flex flex-col overflow-hidden border border-[#dde3eb]",onClick:x=>x.stopPropagation(),children:[e.jsxs("div",{className:"px-5 py-4 border-b border-[#dde3eb] flex items-center justify-between",children:[e.jsxs("h3",{className:"text-base font-bold font-display text-[#0a1628] flex items-center gap-2",children:[e.jsx(us,{size:18,className:"text-sky-600"}),"Assign to Student"]}),e.jsx("button",{onClick:()=>Ie(!1),className:"p-1 hover:bg-[#edf1f7] rounded-lg transition-colors",children:e.jsx(Xt,{size:16,className:"text-slate-500"})})]}),e.jsx("div",{className:"px-5 py-3 border-b border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center gap-2 bg-[#edf1f7] rounded-xl px-3 py-2",children:[e.jsx(Vs,{size:14,className:"text-slate-500"}),e.jsx("input",{type:"text",placeholder:"Search students…",value:Jt,onChange:x=>Zt(x.target.value),className:"flex-1 bg-transparent text-sm outline-none placeholder:text-slate-500"})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1",children:xt?e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx(ft,{size:20,className:"animate-spin text-sky-500"})}):In.length===0?e.jsx("p",{className:"text-center text-sm text-slate-500 py-10",children:"No students found"}):In.map(x=>e.jsxs("button",{onClick:()=>Fa(x.id),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-left transition-colors ${es===x.id?"bg-sky-50 border border-sky-300":"hover:bg-[#edf1f7] border border-transparent"}`,children:[e.jsx("img",{src:x.avatar&&!x.avatar.includes("ui-avatars.com")?x.avatar:Ja(x.gender),alt:x.name,className:"w-8 h-8 rounded-lg object-cover"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-[#0a1628] truncate",children:x.name}),e.jsx("p",{className:"text-xs text-slate-500 truncate",children:x.email})]}),es===x.id&&e.jsx(Bt,{size:16,className:"text-sky-600 flex-shrink-0"})]},x.id))}),e.jsxs("div",{className:"px-5 py-3 border-t border-[#dde3eb] flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>Ie(!1),className:"px-4 py-2 text-sm font-medium text-[#5a6578] hover:bg-[#edf1f7] rounded-xl transition-colors",children:"Cancel"}),e.jsxs("button",{onClick:Il,disabled:!es||ge,className:`flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-bold transition-all ${es&&!ge?"bg-gradient-to-r from-sky-600 to-sky-500 text-white shadow-sm":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[ge?e.jsx(ft,{size:14,className:"animate-spin"}):e.jsx(wa,{size:14}),"Assign"]})]})]})})})]});return d?e.jsx("div",{className:"w-full h-full flex flex-col overflow-hidden bg-white",children:En}):En},pu=({onOpenNotifications:t,onOpenProfile:s,onOpenInsightModal:a,userPhoto:r,teacherName:o})=>{const[n,i]=u.useState([]),[l,c]=u.useState(!1),[d,m]=u.useState(!1),[p,h]=u.useState(""),[b,N]=u.useState(11),[C,y]=u.useState("general_mathematics"),[f,w]=u.useState([]),[I,D]=u.useState(!1),[M,q]=u.useState(null),g=u.useCallback(async()=>{D(!0);try{const j=Rt(Lt(Ve,"question_bank",String(b),C,"questions","questions"),nr(50));let K=(await Dt(j)).docs.map(ae=>{const ne=ae.data();return{id:ae.id,question:ne.question||"",choices:ne.choices||[],correct_answer:ne.correct_answer||"",explanation:ne.explanation||"",topic:ne.topic||"",difficulty:ne.difficulty||"medium",grade_level:ne.grade_level||11}});if(K.length===0){const ae=Rt(Lt(Ve,"quizBattleQuestionBank"),nr(50));K=(await Dt(ae)).docs.map(re=>{const he=re.data();return{id:re.id,question:he.question||"",choices:he.choices||[],correct_answer:he.correct_answer||"",explanation:he.explanation||"",topic:he.topic||"",difficulty:he.difficulty||"medium",grade_level:he.grade_level||11}})}w(K)}catch(j){console.warn("[QuestionBankPanel] Failed to load questions:",j)}finally{D(!1)}},[b,C]);u.useEffect(()=>{g()},[g]);const S=u.useCallback(async()=>{c(!0);try{const j=await An("/api/quiz-battle/bank-status");i(j.pdfs)}catch(j){const Q=j instanceof ar?j.message:"Failed to load bank status";oe.error(Q)}finally{c(!1)}},[]);u.useEffect(()=>{S()},[S]);const v=async()=>{if(!p.trim()){oe.error("Please enter a storage path");return}m(!0);try{await An("/api/quiz-battle/ingest-pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storage_path:p.trim(),grade_level:b,topic:C.trim(),force_reingest:!1})}),oe.success("PDF ingestion completed"),await S(),h("")}catch(j){const Q=j instanceof ar?j.message:"Ingestion failed";oe.error(Q)}finally{m(!1)}},L=n.reduce((j,Q)=>j+Q.question_count,0),E=n.filter(j=>j.processed).length;return e.jsxs("div",{className:"w-full h-full flex flex-col overflow-y-auto bg-gradient-to-br from-[#f8fafc] to-[#f1f5f9]",children:[e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] pt-[12px] pb-2"}),e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] pb-[32px] space-y-[32px]",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#3b82f6] to-[#2563eb] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(59,130,246,0.2)] hover:shadow-[0_8px_24px_rgba(59,130,246,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total PDFs"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(Ns,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:n.length})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] hover:shadow-[0_8px_24px_rgba(168,85,247,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total Questions"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(Wt,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:L})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(16,185,129,0.2)] hover:shadow-[0_8px_24px_rgba(16,185,129,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Processed"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(ds,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:E})]})]}),e.jsx("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] overflow-hidden",children:e.jsxs("div",{className:"p-[24px] sm:p-[32px]",children:[e.jsxs("h2",{className:"text-[20px] font-bold text-[#1e293b] mb-6 flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center shadow-md shadow-purple-500/20",children:e.jsx(Qr,{className:"w-4 h-4 text-white"})}),"Ingest New PDF"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6 items-end",children:[e.jsxs("div",{className:"md:col-span-6 group",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Firebase Storage Path"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:e.jsx(Ns,{className:"h-4 w-4 text-[#94a3b8] group-hover:text-[#a855f7] transition-colors"})}),e.jsx("input",{type:"text",placeholder:"quiz_pdfs/grade_11/gen_math_q1.pdf",value:p,onChange:j=>h(j.target.value),className:"w-full bg-slate-50 border border-slate-200 hover:border-[#cbd5e1] text-[#475569] text-[14px] font-medium rounded-xl pl-11 pr-4 py-3.5 outline-none focus:bg-white focus:border-[#a855f7] focus:ring-4 focus:ring-[#a855f7]/10 transition-all shadow-inner"})]})]}),e.jsxs("div",{className:"md:col-span-2 group",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Grade Level"}),e.jsx("input",{type:"number",placeholder:"11",min:7,max:12,value:b,onChange:j=>N(Number(j.target.value)),className:"w-full bg-slate-50 border border-slate-200 hover:border-[#cbd5e1] text-[#475569] text-[14px] font-medium rounded-xl px-4 py-3.5 outline-none focus:bg-white focus:border-[#a855f7] focus:ring-4 focus:ring-[#a855f7]/10 transition-all shadow-inner"})]}),e.jsxs("div",{className:"md:col-span-4 group",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Topic Slug"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:e.jsx(Wt,{className:"h-4 w-4 text-[#94a3b8] group-hover:text-[#a855f7] transition-colors"})}),e.jsx("input",{type:"text",placeholder:"general_mathematics",value:C,onChange:j=>y(j.target.value),className:"w-full bg-slate-50 border border-slate-200 hover:border-[#cbd5e1] text-[#475569] text-[14px] font-medium rounded-xl pl-11 pr-4 py-3.5 outline-none focus:bg-white focus:border-[#a855f7] focus:ring-4 focus:ring-[#a855f7]/10 transition-all shadow-inner"})]})]})]}),e.jsx("div",{className:"mt-6 flex justify-end pt-6 border-t border-slate-100",children:e.jsxs("button",{onClick:v,disabled:d,className:"bg-gradient-to-r from-[#a855f7] to-[#9333ea] hover:from-[#9333ea] hover:to-[#7e22ce] text-white text-[14px] font-bold rounded-full px-8 py-3 shadow-[0_4px_16px_rgba(168,85,247,0.3)] transition-all hover:scale-[1.02] flex items-center gap-2 hover:shadow-[0_8px_24px_rgba(168,85,247,0.4)] disabled:opacity-50 disabled:hover:scale-100",children:[d?e.jsx(ft,{className:"w-4 h-4 animate-spin"}):e.jsx(Qr,{className:"w-4 h-4"}),"Ingest PDF"]})})]})}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] p-[24px] sm:p-[32px]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h2",{className:"text-[20px] font-bold text-[#1e293b]",children:"Processing Status"}),e.jsx("button",{onClick:S,disabled:l,className:"w-9 h-9 rounded-full bg-white border border-slate-200 flex items-center justify-center text-[#64748b] hover:text-[#9333ea] hover:border-purple-200 shadow-sm transition-all hover:scale-105 active:scale-95 disabled:opacity-50",children:e.jsx(ds,{className:`w-4 h-4 ${l?"animate-spin":""}`})})]}),e.jsx("div",{className:"bg-white rounded-[16px] border border-[#f1f5f9] overflow-hidden shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#9956DE] border-b border-[#8b5cf6] shadow-md relative z-10",children:[e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Filename"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Grade"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Topic"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap text-center",children:"Questions"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Status"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Processed At"})]})}),e.jsxs("tbody",{className:"divide-y divide-[#f1f5f9] bg-white",children:[n.map(j=>e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[e.jsx("td",{className:"py-4 px-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${j.processed?"bg-indigo-50 text-indigo-500":"bg-amber-50 text-amber-500"}`,children:e.jsx(Ns,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-[13px] font-bold text-[#1e293b] group-hover:text-purple-600 transition-colors line-clamp-1",children:j.filename})]})}),e.jsx("td",{className:"py-4 px-6 text-[13px] font-semibold text-[#475569]",children:j.grade_level}),e.jsx("td",{className:"py-4 px-6",children:e.jsx("span",{className:"text-[12px] font-medium bg-slate-100 text-slate-600 px-2.5 py-1 rounded-md line-clamp-1",children:j.topic})}),e.jsx("td",{className:"py-4 px-6 text-[13px] font-bold text-[#1e293b] text-center",children:j.question_count||"-"}),e.jsx("td",{className:"py-4 px-6",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-3 py-1 text-[11px] font-bold rounded-full border shadow-sm ${j.processed?"bg-emerald-50 text-emerald-600 border-emerald-200/50":"bg-amber-50 text-amber-600 border-amber-200/50"}`,children:[j.processed?e.jsx(ds,{className:"w-3 h-3"}):e.jsx(ft,{className:"w-3 h-3 animate-spin"}),j.processed?"Completed":"Processing..."]})}),e.jsx("td",{className:"py-4 px-6 text-[13px] font-medium text-[#64748b]",children:j.timestamp?new Date(j.timestamp).toLocaleDateString():"-"})]},j.filename)),n.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"py-12 px-6 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-[#64748b]",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4 border border-slate-100",children:e.jsx(Ns,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-1",children:"No PDFs processed yet"}),e.jsx("p",{className:"text-[13px]",children:"Upload a PDF using the form above to get started."})]})})})]})]})})})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] p-[24px] sm:p-[32px]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("h2",{className:"text-[20px] font-bold text-[#1e293b] flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] bg-gradient-to-br from-[#3b82f6] to-[#2563eb] flex items-center justify-center shadow-md shadow-blue-500/20",children:e.jsx(Wt,{className:"w-4 h-4 text-white"})}),"Question Bank (",f.length,")"]}),e.jsx("button",{onClick:g,disabled:I,className:"w-9 h-9 rounded-full bg-white border border-slate-200 flex items-center justify-center text-[#64748b] hover:text-[#9333ea] hover:border-purple-200 shadow-sm transition-all hover:scale-105 active:scale-95 disabled:opacity-50",children:e.jsx(ds,{className:`w-4 h-4 ${I?"animate-spin":""}`})})]}),I?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(ft,{className:"w-6 h-6 animate-spin text-[#9956DE]"})}):f.length===0?e.jsxs("div",{className:"text-center py-12 text-[#64748b]",children:[e.jsx(Wt,{className:"w-10 h-10 mx-auto mb-3 text-slate-300"}),e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-1",children:"No questions in the bank yet"}),e.jsx("p",{className:"text-[13px]",children:"Ingest a PDF above to populate the question bank."})]}):e.jsx("div",{className:"space-y-2 max-h-[500px] overflow-y-auto",children:f.map(j=>e.jsxs("div",{className:"border border-[#f1f5f9] rounded-xl p-4 hover:border-purple-200 transition-colors bg-white",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 cursor-pointer",onClick:()=>q(M===j.id?null:j.id),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[13px] font-medium text-[#1e293b] line-clamp-2",children:j.question}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsxs("span",{className:"text-[11px] px-2 py-0.5 rounded-md bg-blue-50 text-blue-600 font-semibold",children:["Grade ",j.grade_level]}),e.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded-md bg-slate-100 text-slate-600 font-medium",children:j.topic}),e.jsx("span",{className:`text-[11px] px-2 py-0.5 rounded-md font-semibold ${j.difficulty==="easy"?"bg-green-50 text-green-600":j.difficulty==="hard"?"bg-rose-50 text-rose-600":"bg-amber-50 text-amber-600"}`,children:j.difficulty})]})]}),M===j.id?e.jsx(ka,{size:16,className:"text-[#94a3b8] shrink-0"}):e.jsx(zt,{size:16,className:"text-[#94a3b8] shrink-0"})]}),M===j.id&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-[#f1f5f9] space-y-2",children:[e.jsx("div",{className:"space-y-1",children:j.choices.map((Q,K)=>e.jsxs("p",{className:`text-[12px] px-3 py-1.5 rounded-lg ${Q===j.correct_answer?"bg-green-50 text-green-700 font-semibold border border-green-200":"bg-slate-50 text-[#475569]"}`,children:[String.fromCharCode(65+K),". ",Q]},K))}),j.explanation&&e.jsxs("p",{className:"text-[12px] text-[#64748b] italic mt-2 flex items-center gap-1",children:[e.jsx(uc,{size:12})," ",j.explanation]})]})]},j.id))})]})]})]})},Lo={totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:0},hu={"gen-math":{label:"GEN MATH",color:"bg-sky-100 text-sky-700"},"stats-prob":{label:"STAT&PROB",color:"bg-sky-100 text-sky-700"},"pre-calc":{label:"PRE-CALC",color:"bg-orange-100 text-orange-700"},"basic-calc":{label:"BASIC CALC",color:"bg-red-100 text-red-700"}},Do={mastered:{label:"Mastered",color:"text-emerald-600 bg-emerald-50 border-emerald-100"},on_track:{label:"On Track",color:"text-amber-600 bg-amber-50 border-amber-100"},needs_attention:{label:"Needs Work",color:"text-rose-600 bg-rose-50 border-rose-100"},no_data:{label:"No Data",color:"text-slate-600 bg-slate-50 border-slate-200"}},$o={needs_attention:0,on_track:1,no_data:2,mastered:3},fu=({classSectionId:t,onOpenNotifications:s,onOpenProfile:a})=>{const{currentUser:r,userProfile:o}=hs(),[n,i]=u.useState([]),[l,c]=u.useState(Lo),[d,m]=u.useState(!0),[p,h]=u.useState("all"),[b,N]=u.useState("all"),[C,y]=u.useState(""),[f,w]=u.useState("classAverage"),[I,D]=u.useState("asc"),M=Pn.map(H=>H.id),q=Pn.reduce((H,Z)=>(H[Z.id]=Z.name,H),{}),{isLoading:g,refetch:S}=gc();u.useEffect(()=>{g||(console.log("[TopicMasteryView] Curriculum ready"),S())},[g,S]);const[v,L]=u.useState(new Set),[E,j]=u.useState([]),Q=pc({queryKey:Ll.topicMastery(r?.uid||"anonymous",t),enabled:!!r,staleTime:120*1e3,gcTime:900*1e3,queryFn:async()=>{try{if(!r)return{excluded:[],topics:[],summary:{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:0}};const H=ut(Ve,"teachers",r.uid,"settings","quizSettings"),Z=await ws(H),se=Z.exists()?Z.data()?.excludedTopics||[]:[],Re="https://deign86-mathpulse-api-v3test.hf.space",$e=new URLSearchParams({teacherId:r.uid});t&&$e.set("classSectionId",t);const He=await r.getIdToken(),U=await fetch(`${Re}/api/analytics/topic-mastery?${$e.toString()}`,{headers:{Authorization:`Bearer ${He}`}});if(!U.ok)return{excluded:se,topics:[],summary:{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:se.length}};const te=await U.json(),_=(te.topics||[]).map(V=>({...V,isExcluded:se.includes(V.topicName)}));return{excluded:se,topics:_,summary:te.summary||{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:se.length}}}catch{return{excluded:[],topics:[],summary:{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:0}}}}});u.useEffect(()=>{if(m(Q.isLoading||Q.isFetching),!Q.data){j([]),i([]),c(Lo),L(new Set);return}j(Q.data.excluded),i(Q.data.topics),c(Q.data.summary)},[Q.data,Q.isFetching,Q.isLoading]);const K=async H=>{if(!r)return;const Z=E.includes(H)?E.filter(se=>se!==H):[...E,H];j(Z),i(se=>se.map(Re=>Re.topicName===H?{...Re,isExcluded:!Re.isExcluded}:Re)),c(se=>({...se,excludedCount:Z.length}));try{const se=ut(Ve,"teachers",r.uid,"settings","quizSettings");(await ws(se)).exists()?await as(se,{excludedTopics:Z}):await rs(se,{excludedTopics:Z})}catch{oe.error("Failed to update excluded topics")}},ae=async()=>{if(!r)return;const H=[...new Set([...E,...v])];j(H),i(Z=>Z.map(se=>v.has(se.topicName)?{...se,isExcluded:!0}:se)),c(Z=>({...Z,excludedCount:H.length})),L(new Set);try{const Z=ut(Ve,"teachers",r.uid,"settings","quizSettings");(await ws(Z)).exists()?await as(Z,{excludedTopics:H}):await rs(Z,{excludedTopics:H}),oe.success(`${v.size} topics excluded from quizzes`)}catch{oe.error("Failed to update")}},ne=async()=>{if(!r)return;const H=E.filter(Z=>!v.has(Z));j(H),i(Z=>Z.map(se=>v.has(se.topicName)?{...se,isExcluded:!1}:se)),c(Z=>({...Z,excludedCount:H.length})),L(new Set);try{const Z=ut(Ve,"teachers",r.uid,"settings","quizSettings");(await ws(Z)).exists()?await as(Z,{excludedTopics:H}):await rs(Z,{excludedTopics:H}),oe.success(`${v.size} topics re-included in quizzes`)}catch{oe.error("Failed to update")}},re=H=>{f===H?D(Z=>Z==="asc"?"desc":"asc"):(w(H),D("asc"))},he=b==="all"?M:hc(b);u.useEffect(()=>{p!=="all"&&(he.includes(p)||h("all"))},[he,p]);const Ne=n.filter(H=>!(p!=="all"&&H.subjectId!==p||!he.includes(H.subjectId)||C&&!H.topicName.toLowerCase().includes(C.toLowerCase()))).sort((H,Z)=>{const se=I==="asc"?1:-1;switch(f){case"topicName":return se*H.topicName.localeCompare(Z.topicName);case"classAverage":return se*(H.classAverage-Z.classAverage);case"studentsAttempted":return se*(H.studentsAttempted-Z.studentsAttempted);case"masteryStatus":return se*(($o[H.masteryStatus]||0)-($o[Z.masteryStatus]||0));default:return 0}}),de=()=>{v.size===Ne.length?L(new Set):L(new Set(Ne.map(H=>H.topicName)))},ue=({field:H})=>f!==H?e.jsx(zt,{size:14,className:"text-white/40"}):I==="asc"?e.jsx(ka,{size:14,className:"text-white font-bold"}):e.jsx(zt,{size:14,className:"text-white font-bold"});return d?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(ft,{size:24,className:"animate-spin text-indigo-500"}),e.jsx("span",{className:"ml-2 text-[#64748b]",children:"Loading topic mastery data..."})]}):e.jsxs(Ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-full p-[24px] xl:p-[32px] space-y-[24px]",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total Topics Tracked"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(_s,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:l.totalTopicsTracked})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(16,185,129,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Mastered by Class"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(Aa,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:l.masteredCount})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f43f5e] to-[#e11d48] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(244,63,94,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Needs Work"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(oa,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:l.needsAttentionCount})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#64748b] to-[#475569] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(100,116,139,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Excluded Topics"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(dc,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:l.excludedCount})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white",children:[e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"flex items-center bg-white px-4 py-2.5 rounded-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-[#e2e8f0] group focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all w-full md:w-64",children:[e.jsx(Vs,{size:16,className:"text-[#64748b] shrink-0 group-focus-within:text-[#4f46e5] transition-colors"}),e.jsx("input",{type:"text",placeholder:"Search topics...",value:C,onChange:H=>y(H.target.value),className:"bg-transparent border-none focus:outline-none ml-2 text-[13px] w-full text-[#475569] placeholder:text-[#94a3b8]"})]}),e.jsxs("div",{className:"relative w-full md:w-48",children:[e.jsxs("select",{value:p,onChange:H=>h(H.target.value),className:"appearance-none w-full bg-white border border-[#e2e8f0] text-[#475569] text-[13px] font-medium rounded-[12px] pl-4 pr-10 py-2.5 outline-none focus:border-[#a855f7] focus:ring-2 focus:ring-[#a855f7]/20 shadow-[0_1px_4px_rgba(0,0,0,0.02)] cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Subjects"}),he.map(H=>e.jsx("option",{value:H,children:q[H]||H},H))]}),e.jsx(zt,{size:16,className:"text-[#64748b] absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative w-full md:w-48",children:[e.jsxs("select",{value:b,onChange:H=>N(H.target.value),className:"appearance-none w-full bg-white border border-[#e2e8f0] text-[#475569] text-[13px] font-medium rounded-[12px] pl-4 pr-10 py-2.5 outline-none focus:border-[#a855f7] focus:ring-2 focus:ring-[#a855f7]/20 shadow-[0_1px_4px_rgba(0,0,0,0.02)] cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Grades"}),fc.map(H=>e.jsx("option",{value:H,children:H},H))]}),e.jsx(zt,{size:16,className:"text-[#64748b] absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]}),e.jsx(Mt,{children:v.size>0&&e.jsxs(Ae.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mb-4 bg-indigo-50 border border-indigo-200 rounded-[12px] p-3 flex items-center gap-3 flex-wrap overflow-hidden",children:[e.jsxs("span",{className:"text-[13px] font-semibold text-indigo-700",children:[v.size," topics selected"]}),e.jsx("button",{onClick:ae,className:"px-4 py-1.5 bg-[#475569] text-white text-[11px] font-bold rounded-full hover:bg-[#334155] transition-colors shadow-sm",children:"Exclude Selected"}),e.jsx("button",{onClick:ne,className:"px-4 py-1.5 bg-emerald-600 text-white text-[11px] font-bold rounded-full hover:bg-emerald-700 transition-colors shadow-sm",children:"Include Selected"}),e.jsx("button",{onClick:()=>L(new Set),className:"px-4 py-1.5 bg-white border border-[#e2e8f0] text-[#64748b] text-[11px] font-bold rounded-full hover:bg-[#f8fafc] transition-colors shadow-sm",children:"Clear Selection"})]})}),e.jsx("div",{className:"bg-white rounded-[16px] border border-[#f1f5f9] overflow-hidden shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("div",{className:"min-w-[800px]",children:[e.jsxs("div",{className:"bg-[#9956DE] grid grid-cols-12 gap-4 p-4 border-b border-[#8b5cf6] items-center text-[11px] font-bold text-white tracking-wider uppercase shadow-md relative z-10 h-12",children:[e.jsx("div",{className:"col-span-1 flex justify-center",children:e.jsx("input",{type:"checkbox",checked:v.size===Ne.length&&Ne.length>0,onChange:de,className:"rounded text-[#4f46e5] focus:ring-[#4f46e5] w-4 h-4 border-white/30 bg-white/10 cursor-pointer"})}),e.jsxs("div",{className:"col-span-3 flex items-center gap-1 cursor-pointer hover:text-white/80 select-none",onClick:()=>re("topicName"),children:["TOPIC NAME ",e.jsx(ue,{field:"topicName"})]}),e.jsx("div",{className:"col-span-2",children:"UNIT"}),e.jsxs("div",{className:"col-span-2 flex items-center gap-1 cursor-pointer hover:text-white/80 select-none",onClick:()=>re("classAverage"),children:["CLASS AVG % ",e.jsx(ue,{field:"classAverage"})]}),e.jsxs("div",{className:"col-span-2 flex items-center gap-1 cursor-pointer hover:text-white/80 select-none",onClick:()=>re("studentsAttempted"),children:["STUDENTS ",e.jsx(ue,{field:"studentsAttempted"})]}),e.jsxs("div",{className:"col-span-1 flex items-center gap-1 cursor-pointer hover:text-white/80 select-none",onClick:()=>re("masteryStatus"),children:["STATUS ",e.jsx(ue,{field:"masteryStatus"})]}),e.jsx("div",{className:"col-span-1 text-center",children:"EXCLUDE"})]}),e.jsx("div",{className:"flex flex-col",children:Ne.length===0?e.jsx("div",{className:"p-16 text-center border-b border-[#f1f5f9]",children:n.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(_s,{size:32,className:"text-[#cbd5e1]"}),e.jsx("p",{className:"text-[13px] font-semibold text-[#64748b]",children:"No topic data available yet"}),e.jsx("p",{className:"text-[11px] text-[#94a3b8]",children:"Import student quiz data to see class topic mastery analytics."})]}):e.jsx("span",{className:"text-[13px] text-[#64748b]",children:"No topics match the current filters."})}):Ne.map(H=>{const Z=v.has(H.topicName),se=Do[H.masteryStatus]||Do.no_data,Re=hu[H.subjectId]||{label:H.subjectId.toUpperCase(),color:"bg-[#f8fafc] text-[#64748b]"},$e=H.classAverage<60?"bg-rose-500":H.classAverage<85?"bg-amber-500":"bg-emerald-500",He=H.isExcluded?"bg-slate-50/60 opacity-70":H.masteryStatus==="needs_attention"?"bg-rose-50/30":H.masteryStatus==="mastered"?"bg-emerald-50/20":"";return e.jsxs("div",{className:`grid grid-cols-12 gap-4 p-4 border-b border-[#f1f5f9] items-center hover:bg-slate-50/80 transition-colors group ${He} ${H.isExcluded?"line-through decoration-slate-400":""}`,children:[e.jsx("div",{className:"col-span-1 flex justify-center",children:e.jsx("input",{type:"checkbox",checked:Z,onChange:()=>{const U=new Set(v);Z?U.delete(H.topicName):U.add(H.topicName),L(U)},className:"rounded text-[#4f46e5] focus:ring-[#4f46e5] w-4 h-4 border-gray-300 cursor-pointer"})}),e.jsxs("div",{className:"col-span-3 flex flex-col sm:flex-row sm:items-center gap-1.5 pr-2 min-w-0",children:[e.jsx("span",{className:"font-semibold text-[#1e293b] text-[13px] truncate",children:H.topicName}),e.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded shrink-0 ${Re.color}`,children:Re.label})]}),e.jsx("div",{className:"col-span-2 text-[#475569] text-[13px] truncate pr-2",children:H.unit}),e.jsx("div",{className:"col-span-2",children:e.jsxs("span",{className:"font-bold text-[#1e293b] text-[14px]",children:[H.classAverage,"%"]})}),e.jsxs("div",{className:"col-span-2 pr-4",children:[e.jsx("div",{className:"flex justify-between items-center text-[11px] mb-1",children:e.jsxs("span",{className:"font-semibold text-[#1e293b]",children:[H.studentsAttempted," / ",H.totalStudents]})}),e.jsx("div",{className:"w-full bg-[#f1f5f9] h-1.5 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${$e}`,style:{width:`${H.classAverage}%`}})})]}),e.jsx("div",{className:"col-span-1",children:e.jsx("span",{className:`text-[10px] font-bold px-2.5 py-1 rounded-full border whitespace-nowrap ${se.color}`,children:se.label})}),e.jsxs("div",{className:"col-span-1 flex justify-center relative",children:[e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer group/toggle",children:[e.jsx("input",{type:"checkbox",checked:H.isExcluded,onChange:()=>K(H.topicName),className:"sr-only peer"}),e.jsx("div",{className:"w-9 h-5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#4f46e5]"})]}),e.jsx("div",{className:"hidden group-hover/toggle:block absolute z-20 bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-slate-800 text-white text-[10px] rounded whitespace-nowrap shadow-lg",children:H.isExcluded?"Include in generation":"Exclude from generation"})]})]},H.topicName)})})]})})})]})]})};function ul(t){return(t||"").trim().toLowerCase()}function Fo(t){const s=(t.lrn||"").trim().toLowerCase();if(s)return`lrn:${s}`;const a=(t.email||"").trim().toLowerCase();if(a)return`email:${a}`;const r=t.name.trim().toLowerCase();if(r)return`name:${r}`;const o=ul(t.classSectionId),n=(t.id||"").trim().toLowerCase();return o&&n?`${o}|id:${n}`:n?`id:${n}`:`${o}|anonymous`}function gu(t,s){const a=[],r=(t.lrn||"").trim().toLowerCase(),o=(t.email||"").trim().toLowerCase(),n=t.name.trim().toLowerCase(),i=(t.id||"").trim().toLowerCase();return r&&a.push(`${s}|lrn:${r}`),o&&a.push(`${s}|email:${o}`),n&&a.push(`${s}|name:${n}`),i&&a.push(`${s}|id:${i}`),a.length===0&&a.push(`${s}|anonymous`),a}function bu(t,s){const a=[t.riskLevel,s.riskLevel].includes("High")?"High":[t.riskLevel,s.riskLevel].includes("Medium")?"Medium":"Low";return{...t,lrn:t.lrn||s.lrn,classSectionId:t.classSectionId??s.classSectionId,avgQuizScore:s.avgQuizScore>0?s.avgQuizScore:t.avgQuizScore,engagementScore:s.engagementScore>0?s.engagementScore:t.engagementScore,weakestTopic:t.weakestTopic&&t.weakestTopic!=="Foundational Skills"?t.weakestTopic:s.weakestTopic,riskLevel:a}}function xl(t,s){const a=new Map,r=new Map,o=s?ul(s):"all";return t.forEach(n=>{const i=gu(n,o),l=i.map(m=>r.get(m)).find(Boolean)||i[0],c=a.get(l),d=c?bu(c,n):n;a.set(l,d),i.forEach(m=>r.set(m,l))}),Array.from(a.values())}function Oo(t,s){return xl([...t,...s])}function Zs(t){return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}function vu(t){if(!t)return null;const s="gen-math",a=Hn.find(i=>i.id===s)?.modules||[];if(a.length===0)return null;const r={mastery:0,concept:0,application:0,engagement:0,consistency:0},o=t.lessons??{};a.forEach(i=>{const l=Hn.find(y=>y.modules.some(f=>f.id===i.id)),c=l?t?.subjects?.[l.id]?.modulesProgress?.[i.id]:null,d=Zs(c?.progress||0),m=i.lessons.length?i.lessons.reduce((y,f)=>{const w=o?.[f.id]?.score;if(typeof w=="number"&&Number.isFinite(w))return y+Zs(w);const I=!!c?.lessonsCompleted?.includes?.(f.id);return y+(I?100:0)},0)/i.lessons.length:0,p=i.quizzes.length?(c?.quizzesCompleted?.length||0)/i.quizzes.length*100:0,h=Zs(m),b=Zs(p),N=Zs(Math.min(100,(h+b*2)/1.5)),C=Zs(Math.min(100,40+d*.6));r.mastery+=d,r.concept+=h,r.application+=b,r.engagement+=N,r.consistency+=C});const n=a.length;return{mastery:Math.round(r.mastery/n),concept:Math.round(r.concept/n),application:Math.round(r.application/n),engagement:Math.round(r.engagement/n),consistency:Math.round(r.consistency/n)}}const Bo={advanced:{bg:"bg-emerald-100",text:"text-emerald-700",bar:"bg-emerald-500"},proficient:{bg:"bg-sky-100",text:"text-sky-700",bar:"bg-sky-500"},developing:{bg:"bg-rose-100",text:"text-rose-700",bar:"bg-rose-500"},beginner:{bg:"bg-red-100",text:"text-red-700",bar:"bg-red-500"}},$r=[{key:"mastery",short:"M",label:"Overall Mastery",header:"Mastery"},{key:"concept",short:"C",label:"Concept Grasp",header:"Concept"},{key:"application",short:"A",label:"Application",header:"Applications"},{key:"consistency",short:"S",label:"Consistency",header:"Consistency"}],wu=({classSectionId:t,className:s,fallbackStudents:a=[],onBack:r,onOpenNotifications:o,onOpenProfile:n,insightDismissed:i,onOpenInsightModal:l})=>{const{currentUser:c,userProfile:d}=hs(),m=u.useRef(0),[p,h]=u.useState([]),[b,N]=u.useState(!0),[C,y]=u.useState(""),[f,w]=u.useState("riskLevel"),[I,D]=u.useState("desc"),[M,q]=u.useState("all"),[g,S]=u.useState([]),[v,L]=u.useState(!1),[E,j]=u.useState(""),[Q,K]=u.useState(""),ae=u.useCallback(_=>({id:_.id,lrn:_.lrn||void 0,name:_.name,email:_.email||"",avatar:Ja(_.gender),classSectionId:_.classSectionId??null,riskLevel:_.riskLevel||"Low",engagementScore:_.engagementScore,avgQuizScore:_.avgQuizScore,weakestTopic:_.weakestTopic||"Foundational Skills"}),[]),ne=u.useCallback(_=>({id:_.id,lrn:_.lrn,name:_.name,email:_.email||"",avatar:_.avatar&&!_.avatar.includes("ui-avatars.com")?_.avatar:Ja(_.gender),classSectionId:_.classSectionId??null,riskLevel:String(_.riskLevel).charAt(0).toUpperCase()+String(_.riskLevel).slice(1).toLowerCase(),engagementScore:_.engagementScore,avgQuizScore:Number(_.avgQuizScore??_.avgScore??0),weakestTopic:_.weakestTopic||"Foundational Skills"}),[]),re=u.useCallback(async(_,V)=>{const k=new Map;_.forEach(T=>k.set(T.id,null));const O=25;for(let T=0;T<_.length;T+=O){if(m.current!==V)return;const B=_.slice(T,T+O);(await Promise.allSettled(B.map(async A=>{try{const J=await zn(A.id);return{studentId:A.id,summary:vu(J)}}catch{return{studentId:A.id,summary:null}}}))).forEach((A,J)=>{const le=B[J]?.id;le&&(A.status==="fulfilled"?k.set(le,A.value.summary):k.set(le,null))})}m.current===V&&h(T=>T.map(B=>k.has(B.student.id)?{...B,competencyMatrix:k.get(B.student.id)??null,competencyMatrixLoading:!1}:B))},[]),he=u.useCallback(async()=>{if(c?.uid){N(!0),K("");try{let V=(await vn(c.uid)).map(B=>({id:B.id,name:B.name,email:B.email||"",avatar:B.avatar&&!B.avatar.includes("ui-avatars.com")?B.avatar:Ja(B.gender),classSectionId:B.classSectionId??null,riskLevel:B.riskLevel,engagementScore:B.engagementScore,avgQuizScore:B.avgQuizScore,weakestTopic:B.weakestTopic||"Foundational Skills"}));a.length>0&&(V=Oo(V,a.map(ne))),t&&(V=V.filter(B=>B.classSectionId===t));const k=await mt.getImportedClassOverview({classSectionId:t,limit:3e3});k.warnings.length>0&&K(k.warnings.join(" ")),V=Oo(V,k.students.map(ae));const O=xl(V,t),T=m.current+=1;h(O.map((B,G)=>({rowKey:`${Fo(B)}|row:${G}`,student:B,competency:null,competencyMatrix:null,competencyMatrixLoading:!0,loading:!1,expanded:!1}))),re(O,T)}catch(_){if(console.error("Failed to load students:",_),a.length>0){const V=a.map(ne).filter(k=>!t||k.classSectionId===t).map((k,O)=>({rowKey:`${Fo(k)}|row:${O}`,student:k,competency:null,competencyMatrix:null,competencyMatrixLoading:!1,loading:!1,expanded:!1}));h(V),K("Showing recently imported students while backend roster sync catches up.")}else h([]),K("Student competency roster is unavailable right now.")}finally{N(!1)}}},[t,c?.uid,a,re,ne,ae]);u.useEffect(()=>{he()},[he]),u.useEffect(()=>{(async()=>{if(!t){S([]),j("");return}L(!0),j("");try{const V=await mt.getCourseMaterialTopics({classSectionId:t,limit:20}),k=(V.topics||[]).filter(O=>O.title?.trim());S(k),V.warnings.length>0&&j(V.warnings.join(" "))}catch{S([]),j("Imported topic context is unavailable right now.")}finally{L(!1)}})()},[t]);const Ne=async _=>{h(V=>V.map(k=>{if(k.rowKey!==_)return k;const O=!k.expanded,T=k.student.id,B={weakestTopic:k.student.weakestTopic,avgQuizScore:k.student.avgQuizScore};return O&&!k.competency&&!k.loading?(de(_,T,B),{...k,expanded:!0,loading:!0}):{...k,expanded:O}}))},de=async(_,V,k)=>{try{const T=((await zn(V))?.quizAttempts??[]).map(G=>({topic:G.quizId,score:G.score,total:100,timeTaken:G.timeSpent})),B=await mt.getStudentCompetency(V,T.length>0?T:void 0);h(G=>G.map(A=>A.rowKey===_?{...A,competency:B,loading:!1}:A))}catch{const T=k.avgQuizScore||50,B={studentId:V,competencies:[{topic:k.weakestTopic||"Unknown",efficiencyScore:Math.max(15,T-20),competencyLevel:T<50?"beginner":"developing",perspective:`Student needs focused practice in ${k.weakestTopic}.`},{topic:"Functions and Relations",efficiencyScore:Math.min(95,T+10),competencyLevel:T>70?"proficient":"developing",perspective:"Shows solid understanding of function concepts."},{topic:"Problem Solving",efficiencyScore:T,competencyLevel:T>80?"advanced":T>60?"proficient":"developing",perspective:"Applies mathematical reasoning consistently."}],recommendedTopics:[k.weakestTopic||"Review fundamentals"],excludeTopics:[]};h(G=>G.map(A=>A.rowKey===_?{...A,competency:B,loading:!1}:A))}},ue=_=>{f===_?D(V=>V==="asc"?"desc":"asc"):(w(_),D("asc"))},H={High:0,Medium:1,Low:2},Z=p.filter(_=>{if(M!=="all"&&_.student.riskLevel!==M)return!1;if(C){const V=C.toLowerCase();return _.student.name.toLowerCase().includes(V)||_.student.email.toLowerCase().includes(V)}return!0}).sort((_,V)=>{let k=0;switch(f){case"name":k=_.student.name.localeCompare(V.student.name);break;case"avgQuizScore":k=_.student.avgQuizScore-V.student.avgQuizScore;break;case"riskLevel":k=H[_.student.riskLevel]-H[V.student.riskLevel];break;case"engagementScore":k=_.student.engagementScore-V.student.engagementScore;break}return I==="asc"?k:-k}),se=p.length,Re=p.filter(_=>_.student.riskLevel==="High").length,$e=se>0?Math.round(p.reduce((_,V)=>_+V.student.avgQuizScore,0)/se):0,He=se>0?Math.round(p.reduce((_,V)=>_+V.student.engagementScore,0)/se):0,U=Array.from(new Set(g.map(_=>_.title).filter(Boolean))).slice(0,10),te=({field:_})=>f!==_?e.jsx(zt,{size:14,className:"text-white/40"}):I==="asc"?e.jsx(ka,{size:14,className:"text-white font-bold"}):e.jsx(zt,{size:14,className:"text-white font-bold"});return b?e.jsxs("div",{className:"flex items-center justify-center py-20 p-6",children:[e.jsx(ft,{size:32,className:"animate-spin text-[var(--primary)]"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading student data..."})]}):e.jsxs(Ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6 space-y-6",children:[r&&e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("button",{onClick:r,className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors bg-white/60 hover:bg-white/80 px-[18px] py-2 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50",children:[e.jsx(Es,{className:"w-4 h-4"}),"Back to Classes"]})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px] mb-6",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-5 shadow-[0_4px_12px_rgba(168,85,247,0.2)] hover:shadow-[0_8px_24px_rgba(168,85,247,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total Students"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(Ln,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[28px] font-bold relative z-10 leading-none mb-4",children:se}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Evaluated in this class"})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f97316] to-[#ea580c] rounded-[16px] p-5 shadow-[0_4px_12px_rgba(249,115,22,0.2)] hover:shadow-[0_8px_24px_rgba(249,115,22,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"At-Risk Students"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(oa,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[28px] font-bold relative z-10 leading-none mb-4",children:Re}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Need immediate intervention"})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#0ea5e9] to-[#0284c7] rounded-[16px] p-5 shadow-[0_4px_12px_rgba(14,165,233,0.2)] hover:shadow-[0_8px_24px_rgba(14,165,233,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Class Average"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(_s,{className:"w-4 h-4 text-white"})})]}),e.jsxs("div",{className:"text-[28px] font-bold relative z-10 leading-none mb-4",children:[$e,"%"]}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Vs. expected benchmark"})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] rounded-[16px] p-5 shadow-[0_4px_12px_rgba(16,185,129,0.2)] hover:shadow-[0_8px_24px_rgba(16,185,129,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Avg. Engagement"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(na,{className:"w-4 h-4 text-white"})})]}),e.jsxs("div",{className:"text-[28px] font-bold relative z-10 leading-none mb-4",children:[He,"%"]}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Activity completion rate"})})]})]}),e.jsx("div",{className:"sticky top-0 z-30 py-4 -my-4 bg-[#f8fafc]/80 backdrop-blur-[16px] border-b border-slate-200/50 shadow-[0_4px_20px_rgba(0,0,0,0.02)] px-2 sm:-mx-6 sm:px-6 mb-6 rounded-b-[18px]",children:e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 w-full md:w-auto items-center",children:[e.jsxs("div",{className:"flex items-center bg-white px-4 py-2.5 rounded-full shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#e2e8f0] group focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all w-full sm:w-64",children:[e.jsx(Vs,{className:"w-4 h-4 text-[#64748b] shrink-0 group-focus-within:text-[#9956DE] transition-colors"}),e.jsx("input",{type:"text",placeholder:"Search students...",value:C,onChange:_=>y(_.target.value),className:"bg-transparent border-none focus:outline-none ml-2 text-[13px] w-full text-[#475569] placeholder:text-[#94a3b8]"})]}),e.jsx("div",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar w-full sm:w-auto p-2 -m-2",children:["all","High","Medium","Low"].map(_=>e.jsx("button",{onClick:()=>q(_),className:`px-4 py-1.5 text-[13px] font-semibold rounded-full whitespace-nowrap transition-colors shadow-md ${M===_?"bg-[#9956DE] text-white":"bg-white text-slate-500 hover:text-slate-700 hover:bg-slate-50"}`,children:_==="all"?"All":`${_} Risk`},_))})]}),e.jsxs("button",{onClick:he,className:"flex items-center gap-2 text-[13px] font-semibold text-slate-500 hover:text-slate-700 transition-colors shrink-0 bg-white px-4 py-2 rounded-full shadow-md hover:bg-slate-50 self-end sm:self-auto",children:[e.jsx(ds,{className:"w-4 h-4"})," Refresh"]})]})}),e.jsxs("div",{className:"bg-[#f5f3ff]/60 border border-[#e0e7ff] rounded-[14px] px-5 py-3 mb-6 flex items-start sm:items-center gap-3",children:[e.jsx("div",{className:"mt-0.5 sm:mt-0 shrink-0",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[#9956DE]",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center flex-1",children:[e.jsxs("span",{className:"text-[#9956DE] font-semibold text-[13px] whitespace-nowrap mr-1",children:["Imported Topic Context",s?` for ${s}`:"",":"]}),v?e.jsx("span",{className:"text-[#8b5cf6] text-[13px]",children:"Loading class-scoped imported topics..."}):U.length>0?e.jsx("div",{className:"flex flex-wrap items-center gap-1.5 mt-1 sm:mt-0",children:U.map((_,V)=>e.jsxs(me.Fragment,{children:[e.jsx("span",{className:"text-[#8b5cf6] text-[13px]",children:_}),Vue("name"),children:["Student ",e.jsx(te,{field:"name"})]}),e.jsxs("div",{className:"w-[120px] shrink-0 px-4 flex justify-center cursor-pointer hover:text-white/80 transition-colors",onClick:()=>ue("riskLevel"),children:["Risk Level ",e.jsx(te,{field:"riskLevel"})]}),e.jsxs("div",{className:"w-[200px] shrink-0 px-4 flex items-center gap-1 cursor-pointer hover:text-white/80 transition-colors",onClick:()=>ue("avgQuizScore"),children:["Avg. Score ",e.jsx(te,{field:"avgQuizScore"})]}),e.jsxs("div",{className:"w-[180px] shrink-0 px-4 flex items-center gap-1 cursor-pointer hover:text-white/80 transition-colors",onClick:()=>ue("engagementScore"),children:["Engagement ",e.jsx(te,{field:"engagementScore"})]}),e.jsx("div",{className:"w-[160px] shrink-0 px-4 flex justify-center cursor-pointer hover:text-white/80 transition-colors",children:"Weakest Topic"}),$r.map((_,V)=>e.jsx("div",{className:`w-[100px] shrink-0 px-2 flex justify-center ${V===$r.length-1?"border-r border-transparent":""}`,children:_.header},_.key))]}),Z.length===0?e.jsxs("div",{className:"py-12 text-center text-slate-500",children:[e.jsx(Ln,{size:32,className:"mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No students match the current filters"})]}):e.jsx("div",{className:"divide-y divide-border",children:Z.map(_=>(_.student.riskLevel==="High"||_.student.riskLevel,e.jsxs("div",{className:"flex flex-col border-b border-slate-100 group",children:[e.jsxs("div",{className:"flex items-center min-h-[64px] hover:bg-slate-50/60 transition-colors cursor-pointer relative",onClick:()=>void Ne(_.rowKey),children:[e.jsxs("div",{className:"w-[260px] shrink-0 sticky left-0 z-10 bg-white group-hover:bg-slate-50/90 transition-colors px-5 h-full min-h-[64px] flex items-center border-r border-slate-100 shadow-[2px_0_4px_rgba(0,0,0,0.01)]",children:[e.jsx("div",{className:`transition-transform duration-200 mr-3 shrink-0 ${_.expanded?"rotate-90":""}`,children:e.jsx(Is,{className:"w-4 h-4 text-slate-400"})}),e.jsx("img",{src:_.student.avatar,alt:_.student.name,className:"w-8 h-8 rounded-full bg-border object-cover shrink-0 mr-3"}),e.jsx("span",{className:"font-semibold text-slate-800 text-[14px] truncate",children:_.student.name})]}),e.jsx("div",{className:"w-[120px] shrink-0 px-4 flex justify-center",children:e.jsx("span",{className:`px-3 py-1 rounded-full border text-[11px] font-bold uppercase tracking-wider ${_.student.riskLevel==="High"?"bg-rose-50 text-rose-600 border-rose-200":_.student.riskLevel==="Medium"?"bg-amber-50 text-amber-600 border-amber-200":"bg-emerald-50 text-emerald-600 border-emerald-200"}`,children:_.student.riskLevel})}),e.jsxs("div",{className:"w-[200px] shrink-0 px-4 flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 bg-slate-100 h-2.5 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${_.student.avgQuizScore>=80?"bg-emerald-500":_.student.avgQuizScore>=60?"bg-amber-400":"bg-rose-500"}`,style:{width:`${_.student.avgQuizScore}%`}})}),e.jsxs("span",{className:"text-[13px] font-bold text-slate-800 w-8",children:[_.student.avgQuizScore,"%"]})]}),e.jsxs("div",{className:"w-[180px] shrink-0 px-4 flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 bg-slate-100 h-2.5 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-[#9956DE]",style:{width:`${_.student.engagementScore}%`}})}),e.jsxs("span",{className:"text-[13px] font-bold text-slate-800 w-8",children:[_.student.engagementScore,"%"]})]}),e.jsx("div",{className:"w-[160px] shrink-0 px-4 flex justify-center",children:e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-600 text-[11px] font-medium rounded-full truncate max-w-full border border-slate-200",children:_.student.weakestTopic})}),$r.map(V=>{const k=_.competencyMatrix?.[V.key]??0;return e.jsx("div",{className:"w-[100px] shrink-0 px-2 flex justify-center",children:_.competencyMatrixLoading?e.jsx(ft,{size:12,className:"animate-spin text-muted-foreground"}):_.competencyMatrix?e.jsxs("span",{className:`text-[12px] font-medium px-2 rounded-full border ${k>=80?"text-emerald-600 bg-emerald-50 border-emerald-100":k>=60?"text-amber-600 bg-amber-50 border-amber-100":"text-rose-500 bg-rose-50 border-rose-100"}`,children:[k,"%"]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},V.key)})]}),e.jsx(Mt,{children:_.expanded&&e.jsx(Ae.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden bg-slate-50/80 border-t border-slate-100 shadow-inner",children:e.jsxs("div",{className:"flex min-w-[1320px]",children:[e.jsx("div",{className:"w-[260px] shrink-0 sticky left-0 z-10 bg-slate-50/90 border-r border-slate-100 flex items-start justify-end pr-4 py-4",children:e.jsx("div",{className:"w-1.5 h-full rounded-full bg-[#9956DE]/30"})}),e.jsx("div",{className:"flex-1 py-4 pl-6 pr-6",children:_.loading?e.jsxs("div",{className:"flex items-center py-4",children:[e.jsx(ft,{size:16,className:"animate-spin text-indigo-500 mr-2"}),e.jsx("span",{className:"text-sm text-slate-500",children:"Analyzing competency data..."})]}):_.competency?e.jsxs("div",{className:"space-y-4 max-w-4xl",children:[_.competency.recommendedTopics.length>0&&e.jsxs("div",{className:"bg-[#f5f3ff] rounded-[12px] p-4 border border-[#e0e7ff] inline-block shadow-sm mb-4",children:[e.jsxs("h4",{className:"text-[#7274ED] font-semibold text-[13px] flex items-center gap-2 mb-1.5",children:[e.jsx(Wt,{className:"w-4 h-4"})," Recommended Focus Areas"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:_.competency.recommendedTopics.map((V,k)=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full border border-indigo-100 bg-white text-indigo-700 text-xs font-medium shadow-sm",children:V},k))})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:_.competency.competencies.map((V,k)=>e.jsx(Nu,{competency:V},k))})]}):e.jsx("div",{className:"text-sm text-slate-500 py-4",children:"Failed to load competency details."})})]})})})]},_.rowKey)))})]})})]})},Nu=({competency:t})=>{const s=Bo[t.competencyLevel]||Bo.developing;return e.jsxs("div",{className:"bg-card rounded-lg border border-border p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h6",{className:"text-xs font-bold text-foreground truncate flex-1",children:t.topic}),e.jsx("span",{className:`ml-2 px-2 py-0.5 rounded text-[10px] font-bold uppercase ${s.bg} ${s.text}`,children:t.competencyLevel})]}),e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[e.jsx("span",{className:"text-slate-500",children:"Efficiency"}),e.jsxs("span",{className:"font-bold text-muted-foreground",children:[t.efficiencyScore,"%"]})]}),e.jsx("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:e.jsx(Ae.div,{initial:{width:0},animate:{width:`${t.efficiencyScore}%`},transition:{duration:.6,delay:.1},className:`h-full rounded-full ${s.bar}`})})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug line-clamp-2",children:t.perspective})]})},ju=()=>{const{notifications:t,unreadCount:s,isLoading:a,markAsRead:r,markAllAsRead:o}=mi(),[n,i]=u.useState("all"),l=["streak_reminder","daily_checkin","streak_milestone","achievement_unlocked","level_up","xp_earned","quiz_result"],c=t.filter(N=>!N.isRead&&!l.includes(N.type)).length,d=N=>{switch(N){case"achievement_unlocked":case"achievement":return Dl;case"message":return Yl;case"grade":case"quiz_result":return ci;case"reminder":case"streak_reminder":case"daily_checkin":return Ts;case"risk_alert":return oa;case"sparkles":case"lesson_plan_ready":return Rs;case"users":case"student_import":return us;default:return cr}},m=(N,C)=>{switch(N){case"risk_alert":return"bg-rose-50/30 text-rose-500 border-rose-100";case"sparkles":case"lesson_plan_ready":return"bg-purple-50/30 text-[#a855f7] border-purple-100";case"daily_checkin":return"bg-amber-50/20 text-amber-500 border-amber-100";case"users":case"student_import":return"bg-blue-50/30 text-blue-500 border-blue-100";default:return"bg-slate-50 text-slate-500 border-slate-100"}},p=N=>{switch(N){case"risk_alert":return"from-rose-400 to-rose-600 shadow-[0_4px_12px_rgba(244,63,94,0.3)]";case"sparkles":case"lesson_plan_ready":return"from-[#a855f7] to-[#9333ea] shadow-[0_4px_12px_rgba(168,85,247,0.3)]";case"daily_checkin":return"from-amber-300 to-amber-500 shadow-[0_4px_12px_rgba(245,158,11,0.3)]";case"users":case"student_import":return"from-blue-400 to-blue-600 shadow-[0_4px_12px_rgba(59,130,246,0.3)]";default:return"from-slate-400 to-slate-600 shadow-[0_4px_12px_rgba(100,116,139,0.3)]"}},h=u.useMemo(()=>{let N=t.filter(C=>!l.includes(C.type));return n==="unread"&&(N=N.filter(C=>!C.isRead)),n==="important"&&(N=N.filter(C=>C.type==="risk_alert")),N},[t,n]),b=u.useMemo(()=>{const N=[],C=h.filter(w=>eo(w.createdAt)),y=h.filter(w=>to(w.createdAt)),f=h.filter(w=>!eo(w.createdAt)&&!to(w.createdAt));return C.length>0&&N.push({title:"Today",icon:Ts,items:C}),y.length>0&&N.push({title:"Yesterday",icon:On,items:y}),f.length>0&&N.push({title:"Earlier",icon:On,items:f}),N},[h]);return e.jsx("div",{className:"w-full h-full flex flex-col bg-[#f8fafc]/50",children:e.jsxs("div",{className:"max-w-[900px] mx-auto w-full p-[24px] xl:p-[32px] space-y-[24px] flex-1 overflow-y-auto no-scrollbar pb-12",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("button",{onClick:()=>i("all"),className:`px-6 py-2.5 text-[13px] rounded-full whitespace-nowrap transition-all duration-300 border ${n==="all"?"bg-purple-50 text-[#9333ea] border-purple-200 shadow-md font-bold":"bg-white/80 text-[#64748b] border-white hover:border-[#e2e8f0] shadow-sm font-medium"}`,children:"All"}),e.jsxs("button",{onClick:()=>i("unread"),className:`px-6 py-2.5 text-[13px] rounded-full whitespace-nowrap transition-all duration-300 border flex items-center gap-2 ${n==="unread"?"bg-purple-50 text-[#9333ea] border-purple-200 shadow-md font-bold":"bg-white/80 text-[#64748b] border-white hover:border-[#e2e8f0] shadow-sm font-medium"}`,children:["Unread",e.jsx("span",{className:"w-5 h-5 rounded-full bg-slate-100 text-[10px] font-bold flex items-center justify-center text-slate-500",children:c})]}),e.jsxs("button",{onClick:()=>i("important"),className:`px-6 py-2.5 text-[13px] rounded-full whitespace-nowrap transition-all duration-300 border flex items-center gap-2 ${n==="important"?"bg-purple-50 text-[#9333ea] border-purple-200 shadow-md font-bold":"bg-white/80 text-[#64748b] border-white hover:border-[#e2e8f0] shadow-sm font-medium"}`,children:["Important",t.some(N=>N.type==="risk_alert"&&!N.isRead)&&e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-rose-500 shadow-[0_0_8px_rgba(244,63,94,0.6)]"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-3 shrink-0",children:[e.jsx("span",{className:"text-[13px] font-bold text-[#64748b]",children:c>0?`${c} unread`:"No unread"}),e.jsxs("button",{onClick:o,disabled:c===0,className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[13px] font-bold rounded-full px-5 py-2 shadow-sm transition-all hover:shadow-md hover:-translate-y-0.5 flex items-center gap-2 group disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-sm",children:[e.jsx(wc,{className:"w-4 h-4 text-[#94a3b8] group-hover:text-emerald-500 transition-colors"}),"Mark all as read"]})]})]}),e.jsx("div",{className:"space-y-8",children:a?e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white p-12 flex flex-col items-center justify-center gap-4",children:[e.jsx(ft,{className:"w-8 h-8 text-[#a855f7] animate-spin"}),e.jsx("p",{className:"text-[14px] font-medium text-[#64748b]",children:"Syncing notifications..."})]}):b.length===0?e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white p-16 flex flex-col items-center justify-center text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-slate-50 rounded-full flex items-center justify-center mb-6 border border-slate-100",children:e.jsx(cr,{className:"w-10 h-10 text-slate-300"})}),e.jsx("h3",{className:"text-[18px] font-bold text-[#1e293b] mb-2",children:"All clear!"}),e.jsx("p",{className:"text-[14px] text-[#64748b] max-w-sm",children:"No notifications found for this filter. New alerts will appear here automatically."})]}):b.map(N=>e.jsxs("div",{children:[e.jsxs("h3",{className:"text-[12px] font-bold text-[#94a3b8] uppercase tracking-wider mb-3 ml-2 flex items-center gap-2",children:[e.jsx(N.icon,{className:"w-4 h-4"})," ",N.title]}),e.jsx("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_4px_24px_rgba(0,0,0,0.03)] overflow-hidden divide-y divide-[#f1f5f9]",children:N.items.map(C=>{const y=d(C.type),f=C.type==="risk_alert";return e.jsxs(Ae.div,{layout:!0,onClick:()=>!C.isRead&&r(C.id),className:`relative p-5 flex gap-5 group cursor-pointer hover:bg-white transition-all duration-300 ${C.isRead?"opacity-80":m(C.type)}`,children:[e.jsx("div",{className:`absolute left-0 top-0 w-1.5 h-full transition-colors ${C.isRead?"bg-transparent":f?"bg-rose-500":"bg-[#a855f7]"}`}),e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center text-white shrink-0 group-hover:scale-110 transition-transform bg-gradient-to-br ${p(C.type)}`,children:e.jsx(y,{className:"w-6 h-6"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex justify-between items-start mb-1",children:[e.jsxs("h4",{className:"text-[15px] font-bold text-[#1e293b] flex items-center gap-2 truncate pr-4",children:[C.title,!C.isRead&&e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${f?"bg-rose-500 shadow-[0_0_6px_rgba(244,63,94,0.8)]":"bg-[#a855f7] shadow-[0_0_6px_rgba(168,85,247,0.8)]"}`})]}),e.jsxs("span",{className:`text-[12px] font-bold whitespace-nowrap ${C.isRead?"text-[#94a3b8]":f?"text-rose-600":"text-[#a855f7]"}`,children:[Nc(C.createdAt)," ago"]})]}),e.jsx("p",{className:"text-[14px] text-[#475569] font-medium leading-relaxed",children:C.message}),!C.isRead&&C.actionUrl&&e.jsx("div",{className:"mt-3 flex gap-2",children:e.jsx("button",{className:`px-5 py-2 bg-white border rounded-full text-[12px] font-bold shadow-sm transition-all hover:-translate-y-0.5 ${f?"border-rose-200 text-rose-600 hover:bg-rose-50":"border-purple-200 text-[#9333ea] hover:bg-purple-50"}`,children:"Review Plan"})})]}),e.jsx("button",{className:"opacity-0 group-hover:opacity-100 p-2 text-slate-400 hover:text-slate-600 transition-all rounded-full hover:bg-slate-100 shrink-0 self-start",children:e.jsx($c,{size:18})})]},C.id)})})]},N.title))})]})})},yu=t=>{const s=t.data(),a=s.startTime,r=s.endTime,o=s.createdAt,n=s.updatedAt,i=l=>{if(l){if(typeof l?.toDate=="function")return l.toDate();if(l instanceof Date)return l}};return{...s,id:t.id,startTime:i(a)||new Date,endTime:i(r),createdAt:i(o)||new Date,updatedAt:i(n)}},Su=async(t,s)=>{const a=ut(Lt(Ve,"calendarEvents")),r={id:a.id,userId:t,title:s.title,description:s.description,startTime:s.startTime,endTime:s.endTime,color:s.color,createdAt:new Date};return await rs(a,{...r,createdAt:ct(),updatedAt:ct()}),r},ku=async(t,s)=>{const a=ut(Ve,"calendarEvents",t);await as(a,{...s,updatedAt:ct()})},Cu=async t=>{await ui(ut(Ve,"calendarEvents",t))},pl=(t,s={},a,r)=>{if(!t)return a([]),()=>{};const{limitCount:o=500}=s,n=Rt(Lt(Ve,"calendarEvents"),_t("userId","==",t),nr(o));return xi(n,i=>{a(i.docs.map(l=>yu(l)))},i=>{console.error("Error subscribing to calendar events:",i),r?.(i)})};function Iu({className:t,...s}){return e.jsx("textarea",{"data-slot":"textarea",className:li("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...s})}const ta=t=>String(t).padStart(2,"0"),Ps=t=>`${t.getFullYear()}-${ta(t.getMonth()+1)}-${ta(t.getDate())}`,sn=t=>new Date(t.getFullYear(),t.getMonth(),1),Po=t=>new Date(t.getFullYear(),t.getMonth()+1,0),Tu=t=>{const s=sn(t),a=s.getDay(),r=new Date(s);return r.setDate(s.getDate()-a),r.setHours(0,0,0,0),r},_u=(t,s)=>{const a=new Date(t);return a.setDate(a.getDate()+s),a},Ho=(t,s)=>t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate(),Eu=(t,s)=>t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth(),Ru=t=>t.toLocaleDateString(void 0,{month:"long",year:"numeric"}),qa=t=>t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),Uo=(t,s)=>{const[a,r,o]=t.split("-").map(l=>parseInt(l,10)),[n,i]=s.split(":").map(l=>parseInt(l,10));return new Date(a,(r||1)-1,o||1,n||0,i||0,0,0)},Mu=["purple","blue","emerald","amber","rose"],Fr=t=>{switch(t){case"blue":return"#3b82f6";case"emerald":return"#10b981";case"amber":return"#f59e0b";case"rose":return"#f43f5e";case"purple":default:return"#a855f7"}},Au=(t,s=!1)=>{if(s)return"bg-blue-50 text-blue-700 border-blue-100 opacity-80";switch(t){case"blue":return"bg-blue-50 text-blue-700 border-blue-100 opacity-90 hover:bg-blue-100";case"emerald":return"bg-emerald-50 text-emerald-700 border-emerald-100 opacity-90 hover:bg-emerald-100";case"amber":return"bg-amber-50 text-amber-700 border-amber-100 opacity-90 hover:bg-amber-100";case"rose":return"bg-rose-50 text-rose-700 border-rose-100 opacity-90 hover:bg-rose-100";case"purple":default:return"bg-purple-50 text-purple-700 border-purple-100 opacity-90 hover:bg-purple-100"}},zu=(t,s=!1)=>{if(s)return{dot:"bg-[#3b82f6]",border:"border-l-blue-400",time:"text-blue-600 border-blue-50"};switch(t){case"blue":return{dot:"bg-blue-500",border:"border-l-blue-400",time:"text-blue-600 border-blue-50"};case"emerald":return{dot:"bg-emerald-500",border:"border-l-emerald-400",time:"text-emerald-600 border-emerald-50"};case"amber":return{dot:"bg-amber-500",border:"border-l-amber-400",time:"text-amber-600 border-amber-50"};case"rose":return{dot:"bg-rose-500",border:"border-l-rose-400",time:"text-rose-600 border-rose-50"};case"purple":default:return{dot:"bg-[#a855f7]",border:"border-l-[#a855f7]",time:"text-[#a855f7] border-purple-50"}}},Or=[{names:["sun","sunday"],day:0},{names:["mon","monday"],day:1},{names:["tue","tues","tuesday"],day:2},{names:["wed","wednesday"],day:3},{names:["thu","thurs","thursday"],day:4},{names:["fri","friday"],day:5},{names:["sat","saturday"],day:6}];function Lu(t){const s=t.toLowerCase(),a=new Set;if(s.includes("daily")||s.includes("everyday"))return[0,1,2,3,4,5,6];if(s.includes("weekends"))return[0,6];if(s.includes("weekdays"))return[1,2,3,4,5];const r=s.match(/(mon|tue|wed|thu|fri|sat|sun)[\s/-]*(mon|tue|wed|thu|fri|sat|sun)/);if(r){const o=Or.find(i=>i.names.includes(r[1]))?.day,n=Or.find(i=>i.names.includes(r[2]))?.day;if(o!==void 0&&n!==void 0){let i=o;for(;a.add(i),i!==n;)i=(i+1)%7;return Array.from(a)}}return Or.forEach(({names:o,day:n})=>{o.some(i=>s.includes(i))&&a.add(n)}),Array.from(a).sort((o,n)=>o-n)}const Du=({classes:t,teacherId:s})=>{const{currentUser:a}=hs(),[r,o]=u.useState([]),[n,i]=u.useState(!0),[l,c]=u.useState(""),[d,m]=u.useState(!0),[p,h]=u.useState(()=>{const A=new Date;return A.setHours(0,0,0,0),A}),[b,N]=u.useState(()=>{const A=new Date;return A.setHours(0,0,0,0),A}),[C,y]=u.useState(new Set),[f,w]=u.useState(!1),[I,D]=u.useState(null),[M,q]=u.useState(!1),[g,S]=u.useState(""),[v,L]=u.useState(""),[E,j]=u.useState(()=>Ps(new Date)),[Q,K]=u.useState("09:00"),[ae,ne]=u.useState(""),[re,he]=u.useState("purple"),[Ne,de]=u.useState(!1),[ue,H]=u.useState(null);u.useEffect(()=>{if(!a?.uid){o([]),i(!1);return}c(""),i(!0);const A=pl(a.uid,{limitCount:500},J=>{o(J),i(!1)},()=>{c("Unable to load calendar events right now."),i(!1)});return()=>A()},[a?.uid]);const Z=u.useMemo(()=>{const A=sn(p);return A.setHours(0,0,0,0),A},[p]),se=u.useMemo(()=>{const A=Po(p);return A.setHours(23,59,59,999),A},[p]),Re=u.useMemo(()=>{if(!t||t.length===0)return[];const A=[],J=sn(p),le=Po(p),xe=new Date(J);for(;xe<=le;){const ce=xe.getDay();t.forEach(Fe=>{if(Lu(Fe.schedule).includes(ce)){const tt=`schedule-${Fe.id}-${Ps(xe)}`;C.has(tt)||A.push({id:tt,userId:s||"",title:Fe.name,startTime:new Date(xe),createdAt:new Date})}}),xe.setDate(xe.getDate()+1)}return A},[t,p,s,C]),$e=u.useMemo(()=>[...r,...Re],[r,Re]),He=u.useMemo(()=>$e.filter(A=>A.startTime>=Z&&A.startTime<=se).sort((A,J)=>A.startTime.getTime()-J.startTime.getTime()),[$e,Z,se]),U=u.useMemo(()=>{const A=new Map;for(const J of He){const le=Ps(J.startTime),xe=A.get(le)||[];xe.push(J),A.set(le,xe)}return A},[He]),te=u.useMemo(()=>Ps(b),[b]),_=u.useMemo(()=>[...U.get(te)||[]].sort((J,le)=>J.startTime.getTime()-le.startTime.getTime()),[U,te]),V=u.useMemo(()=>{const A=Tu(p);return Array.from({length:42}).map((J,le)=>_u(A,le))},[p]),k=A=>{const J=Ps(A);D(null),S(""),L(""),j(J),K("09:00"),ne(""),he("purple"),w(!0)},O=A=>{A.id.startsWith("schedule-")?(y(J=>new Set(J).add(A.id)),D(null)):D(A.id),S(A.title),L(A.description||""),j(Ps(A.startTime)),K(ta(A.startTime.getHours())+":"+ta(A.startTime.getMinutes())),ne(A.endTime?ta(A.endTime.getHours())+":"+ta(A.endTime.getMinutes()):""),he(A.color||"purple"),de(!1),w(!0)},T=(A,J)=>{A.stopPropagation(),H(J),de(!0)},B=async()=>{const A=a?.uid||s||"local-user";if(!g.trim()){c("Event title is required.");return}q(!0),c("");const J=Uo(E,Q),le=ae?Uo(E,ae):void 0,xe={title:g.trim(),description:v.trim()?v.trim():void 0,startTime:J,endTime:le&&le.getTime()>J.getTime()?le:void 0,color:re};try{if(I)o(ce=>ce.map(Fe=>Fe.id===I?{...Fe,...xe}:Fe)),await ku(I,xe);else{const ce=`temp-${Date.now()}`;o(Fe=>[...Fe,{id:ce,userId:A,createdAt:new Date,...xe}]),await Su(A,xe)}w(!1)}catch(ce){console.error(ce),w(!1)}finally{q(!1)}},G=async A=>{if(A.startsWith("schedule-")){y(J=>new Set(J).add(A)),ue?.id===A&&de(!1);return}c(""),o(J=>J.filter(le=>le.id!==A)),ue?.id===A&&de(!1);try{await Cu(A)}catch(J){console.error(J)}};return e.jsxs("div",{className:"w-full h-full flex flex-col px-[24px] xl:px-[32px] py-[24px] xl:py-[32px] overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 flex-1 min-h-0 w-full max-w-[1400px] mx-auto",children:[e.jsx("div",{className:`flex flex-col flex-1 min-w-0 transition-all duration-500 ${d?"lg:w-[65%] xl:w-[70%]":"lg:w-full"}`,children:e.jsxs("div",{className:"bg-white/90 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 border-b border-[#a855f7] bg-[#a855f7] shrink-0 flex justify-between items-center rounded-t-[24px] relative overflow-hidden group",children:[e.jsx("div",{className:"absolute -bottom-24 -right-12 w-64 h-64 bg-white/10 rounded-full"}),e.jsx("div",{className:"absolute -top-20 left-1/4 w-40 h-40 bg-white/5 rounded-full"}),e.jsxs("div",{className:"flex items-center gap-5 relative z-10",children:[e.jsx("button",{onClick:()=>h(new Date(p.getFullYear(),p.getMonth()-1,1)),"aria-label":"Previous month",className:"w-9 h-9 rounded-full flex items-center justify-center text-[#6d28d9] bg-white hover:bg-slate-50 transition-colors shadow-sm hover:shadow-md active:scale-90",children:e.jsx(Es,{className:"w-5 h-5"})}),e.jsx("h2",{className:"text-[22px] font-bold text-white w-44 text-center tracking-tight",children:Ru(p)}),e.jsx("button",{onClick:()=>h(new Date(p.getFullYear(),p.getMonth()+1,1)),"aria-label":"Next month",className:"w-9 h-9 rounded-full flex items-center justify-center text-[#6d28d9] bg-white hover:bg-slate-50 transition-colors shadow-sm hover:shadow-md active:scale-90",children:e.jsx(Is,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"flex items-center gap-3 relative z-10",children:[e.jsxs("span",{className:"text-[13px] font-bold text-[#6d28d9] bg-white px-4 py-1.5 rounded-full shadow-sm",children:[He.length," events"]}),e.jsx("button",{onClick:()=>m(!d),className:`w-9 h-9 rounded-full flex items-center justify-center transition-all shadow-sm hover:shadow-md border ${d?"text-[#6d28d9] bg-white border-white":"text-white bg-white/20 border-white/30 backdrop-blur-md"}`,title:d?"Hide Sidebar":"Show Sidebar","aria-label":d?"Hide Sidebar":"Show Sidebar",children:e.jsx(Wc,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-y-auto custom-scrollbar",children:[e.jsx("div",{className:"grid grid-cols-7 text-center border-b border-slate-200/60 pb-5 shrink-0 sticky top-0 bg-white z-20 shadow-[0_10px_10px_-10px_rgba(0,0,0,0.05)] px-4 pt-6",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(A=>e.jsx("div",{className:"text-[12px] font-bold text-[#475569] uppercase tracking-widest",children:A},A))}),e.jsx("div",{className:"grid grid-cols-7 gap-2 pb-6 px-4",children:V.map(A=>{const J=Ps(A),le=U.get(J)||[],xe=Ho(A,b),ce=Ho(A,new Date),Fe=Eu(A,p);return e.jsxs("div",{onClick:()=>N(new Date(A)),className:`group p-2 rounded-lg transition-all cursor-pointer border-2 flex flex-col relative min-h-[100px] xl:min-h-[120px] ${xe?"bg-purple-50/50 border-[#a855f7] shadow-sm z-10":ce?"bg-purple-50/20 border-purple-300 shadow-[inset_0_0_20px_rgba(168,85,247,0.05)] hover:bg-purple-50/40 hover:border-purple-400":"border-transparent hover:bg-slate-50 hover:border-slate-200"} ${Fe?"":"opacity-30 grayscale"}`,children:[e.jsx("div",{className:"flex justify-between items-start",children:e.jsx("span",{className:`w-7 h-7 rounded-full flex items-center justify-center font-bold text-[14px] transition-all ${ce?"bg-gradient-to-br from-[#a855f7] to-[#9333ea] text-white shadow-md":xe?"text-[#9333ea]":"text-[#1e293b]"}`,children:A.getDate()})}),e.jsxs("div",{className:"mt-1 space-y-1",children:[le.slice(0,3).map(Te=>{const tt=Te.id.startsWith("schedule-");return e.jsx("div",{onClick:Oe=>T(Oe,Te),className:`w-full truncate text-[11px] font-bold px-2 py-1.5 rounded border shadow-sm transition-all hover:-translate-y-[1px] hover:shadow-md cursor-pointer ${Au(Te.color,tt)}`,children:Te.title},Te.id)}),le.length>3&&e.jsxs("div",{className:"text-[10px] font-bold text-[#64748b] pl-1 pt-0.5",children:["+",le.length-3," more"]})]})]},J)})})]})]})}),e.jsx(Mt,{children:d&&e.jsx(Ae.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"lg:w-[35%] xl:w-[30%] h-full shrink-0",children:e.jsxs("div",{className:"bg-white/90 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 border-b border-[#f1f5f9] bg-white shrink-0 flex justify-between items-center relative overflow-hidden group",children:[e.jsx("div",{className:"absolute top-[-30px] right-[-30px] w-24 h-24 bg-purple-50 rounded-full mix-blend-multiply filter blur-2xl opacity-50 transition-transform duration-700 group-hover:scale-150"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("h2",{className:"text-[20px] font-bold text-[#1e293b]",children:b.toLocaleDateString(void 0,{weekday:"long"})}),e.jsx("p",{className:"text-[13px] font-medium text-[#64748b]",children:b.toLocaleDateString(void 0,{day:"numeric",month:"long",year:"numeric"})})]}),e.jsx("button",{onClick:()=>k(b),title:"Add Event",className:"w-10 h-10 flex items-center justify-center rounded-full bg-[#a855f7] text-white hover:bg-[#9333ea] shadow-md shadow-purple-200 transition-all hover:scale-105 active:scale-95 relative z-10",children:e.jsx(ia,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 custom-scrollbar pb-12",children:_.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center opacity-40",children:[e.jsx(_r,{className:"w-12 h-12 text-slate-300 mb-4"}),e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b]",children:"No events today"}),e.jsx("p",{className:"text-[12px] text-[#64748b]",children:"Schedule a meeting or add a class."})]}):_.map(A=>{const J=A.id.startsWith("schedule-"),le=zu(A.color,J);return e.jsxs("div",{className:"relative pl-6 before:absolute before:left-2 before:top-2 before:bottom-[-24px] before:w-[2px] before:bg-slate-100 last:before:hidden",children:[e.jsx("div",{className:`absolute left-0 top-1.5 w-4 h-4 rounded-full border-[3px] border-white shadow-sm z-10 ${le.dot}`}),e.jsxs("div",{onClick:xe=>T(xe,A),className:`group relative bg-white border border-[#e2e8f0] rounded-[20px] p-5 shadow-sm hover:shadow-md hover:-translate-y-0.5 transition-all border-l-[6px] cursor-pointer ${le.border}`,children:[e.jsx("div",{className:"flex justify-between items-start mb-2",children:e.jsx("h4",{className:"text-[15px] font-bold text-[#1e293b] group-hover:text-[#9333ea] transition-colors break-words line-clamp-2 w-full pr-2",children:A.title})}),e.jsxs("div",{className:`flex items-center gap-2 text-[11px] font-bold bg-slate-50 w-max px-2.5 py-1 rounded-lg border mb-3 ${le.time}`,children:[e.jsx(Ts,{className:"w-3.5 h-3.5"})," ",e.jsxs("span",{children:[qa(A.startTime),A.endTime?` - ${qa(A.endTime)}`:""]})]}),A.description&&e.jsx("p",{className:"text-[13px] font-medium text-[#64748b] bg-slate-50/50 px-3 py-2 rounded-xl border border-slate-100/30 break-words whitespace-normal w-full overflow-hidden",children:A.description})]})]},A.id)})})]})})})]}),e.jsx(Un,{open:f,onOpenChange:w,children:e.jsx(Gn,{className:"sm:max-w-[500px] p-0 overflow-hidden rounded-[28px] border-none shadow-2xl [&>button]:hidden",children:e.jsxs("div",{className:"p-8 bg-white",children:[e.jsxs(jc,{className:"mb-6",children:[e.jsx(yc,{className:"text-[24px] font-bold text-[#1e293b] tracking-tight",children:I?"Edit Event":"Add New Event"}),e.jsx(Sc,{className:"text-[14px] text-[#64748b]",children:"Schedule a classroom activity or reminder."})]}),l&&e.jsx("p",{className:"text-rose-500 text-sm font-semibold mb-4",children:l}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Event Title"}),e.jsx(ys,{value:g,onChange:A=>S(A.target.value),placeholder:"e.g., Mathematics Quiz - Grade 11",className:"bg-white border-slate-200 focus:border-[#a855f7] focus:ring-4 focus:ring-purple-50 rounded-xl h-12 px-4 transition-all text-[14px]"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Date"}),e.jsx(ys,{type:"date",value:E,onChange:A=>j(A.target.value),className:"bg-white border-slate-200 focus:border-[#a855f7] rounded-xl h-12 px-4 text-[14px]"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Start Time"}),e.jsx(ys,{type:"time",value:Q,onChange:A=>K(A.target.value),className:"bg-white border-slate-200 focus:border-[#a855f7] rounded-xl h-12 px-4 text-[14px]"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Notes (Optional)"}),e.jsx(Iu,{value:v,onChange:A=>L(A.target.value),placeholder:"Additional details about this event...",className:"bg-white border-slate-200 focus:border-[#a855f7] rounded-xl min-h-[100px] p-4 transition-all text-[14px] break-all"})]}),e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Color Theme"}),e.jsx("div",{className:"flex gap-3 ml-1",children:Mu.map(A=>e.jsx("button",{onClick:()=>he(A),className:`w-8 h-8 rounded-full flex items-center justify-center transition-all ${re===A?"ring-2 ring-offset-2 ring-slate-800 scale-110 shadow-sm":"hover:scale-110 opacity-80 hover:opacity-100"}`,style:{backgroundColor:Fr(A)},title:A,children:re===A&&e.jsx(Bt,{className:"w-4 h-4 text-white"})},A))})]})]}),e.jsxs("div",{className:"flex gap-3 mt-8",children:[e.jsx(jt,{variant:"outline",onClick:()=>w(!1),className:"flex-1 h-12 rounded-xl font-bold border-slate-200 hover:bg-slate-100 transition-all text-[14px]",children:"Cancel"}),e.jsx(jt,{onClick:B,disabled:M,className:"flex-[1.5] h-12 rounded-xl font-bold bg-[#a855f7] hover:bg-[#9333ea] text-white shadow-lg shadow-purple-200 transition-all hover:scale-[1.02] text-[14px]",children:M?e.jsx(ft,{className:"w-5 h-5 animate-spin"}):"Save Event"})]})]})})}),e.jsx(Un,{open:Ne,onOpenChange:de,children:e.jsx(Gn,{className:"sm:max-w-[400px] p-0 overflow-hidden rounded-[24px] border-none shadow-2xl [&>button]:hidden",children:ue&&e.jsxs("div",{className:"p-8 bg-white relative",children:[e.jsx("button",{onClick:()=>de(!1),"aria-label":"Close event details",className:"absolute top-4 right-4 p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors",children:e.jsx(Xt,{size:18})}),e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl flex items-center justify-center shrink-0",style:{backgroundColor:Fr(ue.color||"purple")+"20",color:Fr(ue.color||"purple")},children:ue.id.startsWith("schedule-")?e.jsx(rr,{size:24}):e.jsx(_r,{size:24})}),e.jsxs("div",{className:"pr-6",children:[e.jsx("h3",{className:"text-[18px] font-bold text-[#1e293b] leading-tight mb-2",children:ue.title}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-slate-100 text-slate-600 text-[12px] font-semibold border border-slate-200",children:[e.jsx(_r,{size:12}),ue.startTime.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-slate-100 text-slate-600 text-[12px] font-semibold border border-slate-200",children:[e.jsx(Ts,{size:12}),qa(ue.startTime),ue.endTime?` - ${qa(ue.endTime)}`:""]})]})]})]}),ue.description&&e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Mc,{size:16,className:"text-slate-400"}),e.jsx("h4",{className:"text-[13px] font-bold text-slate-700",children:"Details"})]}),e.jsx("p",{className:"text-[14px] text-slate-600 leading-relaxed bg-slate-50/50 p-4 rounded-xl border border-slate-100/50 break-words",children:ue.description})]}),e.jsxs("div",{className:"flex gap-3 pt-2 border-t border-slate-100",children:[e.jsxs(jt,{variant:"outline",onClick:()=>G(ue.id),className:"flex-1 h-11 rounded-xl font-bold border-rose-200 text-rose-600 hover:bg-rose-50 hover:text-rose-700 transition-all text-[13px]",children:[e.jsx(fi,{className:"w-4 h-4 mr-2"})," Delete"]}),e.jsxs(jt,{onClick:()=>O(ue),className:"flex-1 h-11 rounded-xl font-bold bg-[#1e293b] hover:bg-slate-800 text-white shadow-lg shadow-slate-200 transition-all hover:scale-[1.02] text-[13px]",children:[e.jsx(Ni,{className:"w-4 h-4 mr-2"})," Edit Event"]})]})]})})})]})},pr=[{hex:"#9956DE",bg:"bg-[#9956DE]/10",border:"border-[#9956DE]/20",borderLeft:"border-l-[#9956DE]",text:"text-[#9956DE]",groupHover:"group-hover:text-[#9956DE]"},{hex:"#7274ED",bg:"bg-[#7274ED]/10",border:"border-[#7274ED]/20",borderLeft:"border-l-[#7274ED]",text:"text-[#7274ED]",groupHover:"group-hover:text-[#7274ED]"},{hex:"#1FA7E1",bg:"bg-[#1FA7E1]/10",border:"border-[#1FA7E1]/20",borderLeft:"border-l-[#1FA7E1]",text:"text-[#1FA7E1]",groupHover:"group-hover:text-[#1FA7E1]"},{hex:"#6ED1CF",bg:"bg-[#6ED1CF]/10",border:"border-[#6ED1CF]/20",borderLeft:"border-l-[#6ED1CF]",text:"text-[#6ED1CF]",groupHover:"group-hover:text-[#6ED1CF]"},{hex:"#FFB356",bg:"bg-[#FFB356]/10",border:"border-[#FFB356]/20",borderLeft:"border-l-[#FFB356]",text:"text-[#FFB356]",groupHover:"group-hover:text-[#FFB356]"}],Go=({classes:t,onSelectClass:s,onOpenNotifications:a,onOpenProfile:r,insightDismissed:o,onOpenInsightModal:n,viewType:i="analytics",onCreateClass:l})=>{const{currentUser:c,userProfile:d}=hs(),[m,p]=u.useState(""),h=i==="competency",b=t.reduce((f,w)=>f+(w.studentCount||0),0),N=t.reduce((f,w)=>f+(w.atRiskCount||0),0),C=t.length>0?(t.reduce((f,w)=>f+(w.avgScore||0),0)/t.length).toFixed(1):0,y=t.filter(f=>f.name.toLowerCase().includes(m.toLowerCase())||(f.gradeLevel||"").toLowerCase().includes(m.toLowerCase()));return e.jsx("div",{className:"h-full overflow-y-auto w-full block",children:e.jsxs("div",{className:"max-w-[1400px] mx-auto p-3 sm:p-[24px] xl:p-[32px] space-y-3 sm:space-y-[24px]",children:[e.jsx("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:e.jsx("div",{className:"flex-1 max-w-xl",children:e.jsxs("div",{className:"flex items-center bg-white/80 px-4 py-2.5 rounded-[16px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white backdrop-blur-[12px] group focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all",children:[e.jsx(Vs,{className:"w-4 h-4 text-[#64748b] shrink-0 group-focus-within:text-[#4f46e5] transition-colors"}),e.jsx("input",{type:"text",placeholder:"Global search for a student across all classes...",value:m,onChange:f=>p(f.target.value),className:"bg-transparent border-none focus:outline-none ml-3 text-[13px] w-full text-[#475569] placeholder:text-[#94a3b8]"})]})})}),h?e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-[16px]",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total Students Evaluated"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(us,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none mb-6",children:b}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Active across all classes"})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#0ea5e9] to-[#0284c7] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(14,165,233,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Global Avg Competency"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(xs,{className:"w-4 h-4 text-white"})})]}),e.jsxs("div",{className:"text-[32px] font-bold relative z-10 leading-none mb-6",children:[C,"%"]}),e.jsxs("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:[e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Vs. expected benchmark"}),e.jsx("span",{className:"text-[11px] font-bold bg-white/20 px-2 py-0.5 rounded-[4px] backdrop-blur-sm",children:"+1.4%"})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f97316] to-[#ea580c] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(249,115,22,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Universal Weakness"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(xs,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[20px] font-bold relative z-10 leading-tight mb-2 truncate",children:"Foundational Skills"}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsxs("span",{className:"text-[12px] font-medium text-white/90",children:["Identified in ",t.length," classes"]})})]})]}):e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-2 sm:gap-[16px]",children:[e.jsxs("div",{className:"lg:col-span-8 grid grid-cols-3 sm:grid-cols-3 gap-2 sm:gap-[16px]",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] rounded-[14px] sm:rounded-[16px] p-[14px] sm:p-[20px] shadow-[0_4px_12px_rgba(16,185,129,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2 sm:mb-4",children:[e.jsx("span",{className:"text-[11px] sm:text-[13px] font-medium text-white/90",children:"Attendance rate"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(us,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[24px] sm:text-[32px] font-bold relative z-10 leading-none mb-3 sm:mb-6",children:"94%"}),e.jsxs("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:[e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Active participants"}),e.jsx("span",{className:"text-[11px] font-bold bg-white/20 px-2 py-0.5 rounded-[4px] backdrop-blur-sm",children:b>0?Math.round(b*.94):0})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#0ea5e9] to-[#0284c7] rounded-[14px] sm:rounded-[16px] p-[14px] sm:p-[20px] shadow-[0_4px_12px_rgba(14,165,233,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2 sm:mb-4",children:[e.jsx("span",{className:"text-[11px] sm:text-[13px] font-medium text-white/90",children:"Class average"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(xs,{className:"w-4 h-4 text-white"})})]}),e.jsxs("div",{className:"text-[24px] sm:text-[32px] font-bold relative z-10 leading-none mb-3 sm:mb-6",children:[C,"%"]}),e.jsxs("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:[e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Vs. last month"}),e.jsx("span",{className:"text-[11px] font-bold bg-white/20 px-2 py-0.5 rounded-[4px] backdrop-blur-sm",children:"+2.1%"})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f97316] to-[#ea580c] rounded-[14px] sm:rounded-[16px] p-[14px] sm:p-[20px] shadow-[0_4px_12px_rgba(249,115,22,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2 sm:mb-4",children:[e.jsx("span",{className:"text-[11px] sm:text-[13px] font-medium text-white/90",children:"At risk"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(gr,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[24px] sm:text-[32px] font-bold relative z-10 leading-none mb-3 sm:mb-6",children:N}),e.jsxs("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:[e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Requires attention"}),e.jsxs("span",{className:"text-[11px] font-bold bg-white/20 px-2 py-0.5 rounded-[4px] backdrop-blur-sm",children:[b>0?Math.round(N/b*100):0,"%"]})]})]})]}),e.jsxs("div",{className:"lg:col-span-4 relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] flex flex-col text-white",children:[e.jsx("div",{className:"absolute -right-12 -top-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex justify-between items-center mb-4 relative z-10 border-b border-white/20 pb-3",children:[e.jsxs("h3",{className:"text-[14px] font-semibold text-white flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-white animate-pulse shadow-[0_0_8px_rgba(255,255,255,0.8)]"}),"AI Action Items"]}),e.jsx("span",{className:"text-[10px] font-bold text-[#9333ea] bg-white px-2 py-0.5 rounded-[4px]",children:"2 Pending"})]}),e.jsxs("div",{className:"space-y-[8px] flex-1 overflow-y-auto no-scrollbar relative z-10",children:[e.jsxs("div",{className:"bg-white/10 hover:bg-white/20 rounded-[8px] p-3 text-[12px] border border-white/10 transition-colors backdrop-blur-sm group cursor-pointer flex gap-3 items-start",children:[e.jsx("div",{className:"mt-0.5 shrink-0 text-white/80 group-hover:text-white transition-colors",children:e.jsx(ji,{className:"w-4 h-4"})}),e.jsxs("div",{className:"leading-snug text-white/90",children:[e.jsx("span",{className:"font-bold text-white",children:"Grade 11 - Section B"})," average dropped by 4% after the last quiz."]})]}),e.jsxs("div",{className:"bg-white/10 hover:bg-white/20 rounded-[8px] p-3 text-[12px] border border-white/10 transition-colors backdrop-blur-sm group cursor-pointer flex gap-3 items-start",children:[e.jsx("div",{className:"mt-0.5 shrink-0 text-white/80 group-hover:text-white transition-colors",children:e.jsx(Ns,{className:"w-4 h-4"})}),e.jsxs("div",{className:"leading-snug text-white/90",children:[e.jsx("span",{className:"font-bold text-white",children:"3 Lesson Plans"})," generated and awaiting your review."]})]})]})]})]}),e.jsxs("div",{className:"bg-white/60 backdrop-blur-[12px] rounded-[24px] p-3 sm:p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white mt-3 sm:mt-[24px]",children:[e.jsxs("div",{className:"mb-6 border-b border-[#f1f5f9] pb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[18px] font-semibold text-[#1e293b]",children:h?"Select a Class":"My Classes"}),l&&!h&&e.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 px-3 py-1.5 text-[12px] font-semibold text-[#9956DE] bg-[#9956DE]/10 rounded-lg hover:bg-[#9956DE]/20 transition-colors",children:[e.jsx(ia,{size:14}),"Create Class"]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-[16px]",children:[y.map((f,w)=>{const I=pr[w%pr.length];let D=null;return f.riskLevel==="high"?D=e.jsx("span",{className:"inline-flex px-2 py-1 bg-rose-50 text-rose-600 text-[10px] font-bold rounded-md border border-rose-100/50 uppercase",children:"High Risk"}):f.riskLevel==="medium"?D=e.jsx("span",{className:"inline-flex px-2 py-1 bg-amber-50 text-amber-600 text-[10px] font-bold rounded-md border border-amber-100/50 uppercase",children:"Medium Risk"}):D=e.jsx("span",{className:"inline-flex px-2 py-1 bg-emerald-50 text-emerald-600 text-[10px] font-bold rounded-md border border-emerald-100/50 uppercase",children:"On Track"}),e.jsxs("div",{onClick:()=>s(f),className:`flex flex-col p-[16px] bg-white shadow-[0_1px_4px_rgba(0,0,0,0.04)] hover:shadow-md hover:-translate-y-0.5 rounded-[18px] transition-all cursor-pointer group border border-[#f1f5f9] border-l-[6px] ${I.borderLeft}`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-[12px] ${I.bg} flex items-center justify-center border ${I.border}`,children:e.jsx(Wt,{className:`w-5 h-5 ${I.text}`})}),e.jsxs("div",{children:[e.jsx("h4",{className:`font-bold text-[14px] text-[#1e293b] mb-0.5 transition-colors ${I.groupHover}`,children:f.name}),e.jsx("p",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider",children:f.gradeLevel||"Senior High"})]})]}),D]}),e.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#475569] bg-[#f8fafc] rounded-[12px] p-3 border border-[#f1f5f9]",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Students"}),e.jsx("span",{className:"font-semibold text-[#1e293b]",children:f.studentCount})]}),e.jsx("div",{className:"w-[1px] h-8 bg-[#e2e8f0]"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:h?"Avg Competency":"Average"}),e.jsxs("span",{className:"font-semibold text-[#1e293b]",children:[f.avgScore,"%"]})]}),!h&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-[1px] h-8 bg-[#e2e8f0]"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Schedule"}),e.jsx("span",{className:"font-semibold text-[#1e293b]",children:f.schedule||"Mon-Fri"})]})]})]})]},f.id)}),y.length===0&&e.jsx("div",{className:"col-span-full py-8 text-center text-[#64748b] text-[13px] bg-[#f8fafc] rounded-[18px] border border-[#e2e8f0]",children:"No classes match your search."})]})]})]})})},hl="PH_SHS_OFFICIAL_CLASS_RECORD",$u=.85,an=.85,Fu="2026.04.24",fl=4,tr=["INPUT DATA","SENIOR HIGH SCHOOL CLASS RECORD","LEARNERS NAMES","WRITTEN WORK","PERFORMANCE TASKS","QUARTERLY ASSESSMENT","REMARK","FINAL SEMESTRAL GRADES"],Ou=[...tr,"Pursuant to DepEd Order 8 series of 2015","INITIAL GRADE","QUARTERLY GRADE","ADDITIONAL REMARKS","MALE","FEMALE","SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY","WEIGHT OF COMPONENTS","LOOK UP","HELPER","ATTACHMENTS"],Bu=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],$a=["WITH ATTACHMENTS","OFFICIALLY DROPPED","WITHDRAWN","UNOFFICIALLY DROPPED","TRANSFEREE","SHIFTER"],Pu=["TOTAL","SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY","WEIGHT OF COMPONENTS"],Hu={SECOND:["SECOND QUARTER","2ND QUARTER","Q2"]},ea={inputData:["input data"],firstQuarter:["first quarter","1st quarter","q1"],secondQuarter:["second quarter","2nd quarter","q2"],finalSemestral:["final semestral","final grades","semestral"],helper:["helper","weight","attachments"],lookup:["look up","lookup","reference"]},Vt={region:["REGION"],division:["DIVISION"],schoolName:["SCHOOL NAME"],schoolId:["SCHOOL ID"],schoolYear:["SCHOOL YEAR"],gradeSection:["GRADE / SECTION","GRADE/SECTION"],semester:["SEMESTER"],track:["TRACK"],subjectCode:["SUBJECT CODE"],subjectName:["SUBJECT NAME","SUBJECT"],teacherName:["TEACHER","NAME OF TEACHER"]},Ue={learnerNo:["NO","NO.","#"],learnerName:["LEARNERS NAMES","LEARNER NAME","NAME"],writtenWork:["WRITTEN WORK","WW"],performanceTasks:["PERFORMANCE TASKS","PT"],quarterlyAssessment:["QUARTERLY ASSESSMENT","QA"],total:["TOTAL"],ps:["PS"],ws:["WS"],initialGrade:["INITIAL GRADE"],quarterlyGrade:["QUARTERLY GRADE"],firstQuarter:["FIRST QUARTER","1ST QUARTER"],secondQuarter:["SECOND QUARTER","2ND QUARTER"],firstSemester:["FIRST SEMESTER"],finalGrades:["FINAL GRADES","FINAL GRADE"],remark:["REMARK","REMARKS"],additionalRemarks:["ADDITIONAL REMARKS","ADDITIONAL REMARK"]};function Uu(t){return t==null?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?t:String(t)}function kt(t){return String(t??"").replace(/[\u00a0\t\r\n]+/g," ").replace(/[|]+/g," ").replace(/\s+/g," ").trim().toUpperCase()}function Qo(t){return kt(t).replace(/[^A-Z0-9]+/g,"")}function Se(t,s){const a=kt(t),r=kt(s);if(!a||!r)return!1;if(a.includes(r))return!0;const o=Qo(t),n=Qo(s);return!o||!n?!1:o.includes(n)}function sr(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const s=t.replace(/,/g,"").trim();if(!s)return;const a=Number(s);if(Number.isFinite(a))return a}}function Br(t){return kt(t).toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,80)}function gl(t){const s={};return t.forEach(a=>{const r=Kt.encode_cell(a.s);for(let o=a.s.r;o<=a.e.r;o+=1)for(let n=a.s.c;n<=a.e.c;n+=1){const i=Kt.encode_cell({r:o,c:n});s[i]=r}}),s}function Gu(t,s,a){const o=(a||gl(t.merges))[s]||s;return t.cells[o]||t.cells[s]}const bl="A1:A1",Vo=1200,Wo=200,qo=2e5;function Qu(t){const s=Math.max(0,t.s.r),a=Math.max(0,t.s.c);let r=Math.max(s,t.e.r),o=Math.max(a,t.e.c);r-s+1>Vo&&(r=s+Vo-1),o-a+1>Wo&&(o=a+Wo-1);const n=r-s+1,i=o-a+1;if(n*i>qo){const c=Math.max(1,Math.floor(qo/i));r=s+Math.min(n,c)-1}return{s:{r:s,c:a},e:{r,c:o}}}function Vu(t){try{return Kt.decode_range(t)}catch{return Kt.decode_range(bl)}}function Wu(t){let s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return Object.keys(t.cells).forEach(n=>{try{const i=Kt.decode_cell(n);s=Math.min(s,i.r),a=Math.min(a,i.c),r=Math.max(r,i.r),o=Math.max(o,i.c)}catch{}}),t.merges.forEach(n=>{s=Math.min(s,n.s.r,n.e.r),a=Math.min(a,n.s.c,n.e.c),r=Math.max(r,n.s.r,n.e.r),o=Math.max(o,n.s.c,n.e.c)}),!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(r)||!Number.isFinite(o)?null:{s:{r:Math.max(0,Math.trunc(s)),c:Math.max(0,Math.trunc(a))},e:{r:Math.max(0,Math.trunc(r)),c:Math.max(0,Math.trunc(o))}}}function qu(t){const s=Vu(t.ref||bl),a=Wu(t);return Qu(a||s)}function Yu(t,s){const a=qu(s),r=`${Kt.encode_cell(a.s)}:${Kt.encode_cell(a.e)}`,o=gl(s.merges),n=a.e.r-a.s.r+1,i=a.e.c-a.s.c+1,l=[];for(let c=0;ct.endRow||at.endCol?null:t.cells[s-t.startRow]?.[a-t.startCol]??null}function Ds(t,s){return st.endRow?"":(t.cells[s-t.startRow]||[]).map(r=>r?.normalizedText||"").filter(Boolean).join(" ").trim()}function ba(t){return Kt.encode_col(t)}function Ya(t){const s=String(t||"").trim().toUpperCase();if(!s||!/^[A-Z]+$/.test(s))return-1;try{return Kt.decode_col(s)}catch{return-1}}function Ku(t){return`${Kt.encode_cell(t.s)}:${Kt.encode_cell(t.e)}`}function Xu(t,s){const a=[];for(let r=s.s.r;r<=s.e.r;r+=1){const o=[];for(let n=s.s.c;n<=s.e.c;n+=1){const i=Qe(t,r,n);o.push(i?.displayValue??null)}a.push(o)}return a}function Ju(t,s){const a=kt(t),r=kt(s);return!a||!r?0:a===r?1:a.includes(r)?.9:.75}function wn(t,s){const a=[];for(let r=0;r{Se(l.normalizedText,c)&&a.push({sheetName:t.sheetName,anchor:c,row:l.row,col:l.col,address:l.address,value:String(l.displayValue??""),confidence:Ju(l.displayValue,c)})})}const o=t.startRow+r,n=Ds(t,o);n&&s.forEach(i=>{if(!Se(n,i))return;const l=t.cells[r].find(c=>c?.normalizedText);l&&a.push({sheetName:t.sheetName,anchor:i,row:o,col:l.col,address:l.address,value:n,confidence:.8})})}return a}function Zu(t,s){return Object.values(t).flatMap(a=>wn(a,s))}function It(t,s){return wn(t,[s]).sort((a,r)=>a.row-r.row||a.col-r.col)}function vl(t,s,a,r=6){for(let o=1;o<=r;o+=1){const i=Qe(t,s,a+o)?.displayValue;if(i!=null&&String(i).trim())return String(i).trim()}for(let o=1;o<=r;o+=1){const i=Qe(t,s+o,a)?.displayValue;if(i!=null&&String(i).trim())return String(i).trim()}}function wl(t,s,a=5){let r=s,o=-1;for(let n=Math.max(t.startRow,s-a);n<=Math.min(t.endRow,s+a);n+=1){const i=Ds(t,n),l=["LEARNERS NAMES","WRITTEN WORK","PERFORMANCE TASKS","QUARTERLY ASSESSMENT","REMARK"].reduce((c,d)=>i.includes(d)?c+1:c,0);l>o&&(o=l,r=n)}return r}function ex(t,s){const a=kt(t).toLowerCase(),r=o=>[...s].some(n=>Se(n,o));return ea.inputData.some(o=>a.includes(o))||r("INPUT DATA")?"inputData":ea.finalSemestral.some(o=>a.includes(o))||r("FINAL SEMESTRAL GRADES")||r("FINAL GRADES")?"finalSemestral":ea.firstQuarter.some(o=>a.includes(o))||r("FIRST QUARTER")?"firstQuarter":ea.secondQuarter.some(o=>a.includes(o))||r("SECOND QUARTER")?"secondQuarter":r("SENIOR HIGH SCHOOL CLASS RECORD")||r("WRITTEN WORK")&&r("PERFORMANCE TASKS")?"firstQuarter":ea.helper.some(o=>a.includes(o))||r("WEIGHT OF COMPONENTS")||r("ATTACHMENTS")||r("HELPER")?"helper":ea.lookup.some(o=>a.includes(o))||r("LOOK UP")?"lookup":"other"}function tx(t){const s=t.criticalTotal>0?t.criticalFound/t.criticalTotal:0,a=t.totalSheets>0?t.recognizedSheets/t.totalSheets:0,r=t.hasDepedAnchor?1:0,o=.65*s+.2*a+.15*r;return Number(Math.max(0,Math.min(1,o)).toFixed(4))}function sx(t){const s=Zu(t.matrices,Ou),a=new Set,r=[];tr.forEach(b=>{s.some(C=>Se(C.anchor,b))&&(a.add(b),r.push(`Found critical anchor: ${b}`))});const o=tr.filter(b=>!a.has(b)),n=new Map;s.forEach(b=>{n.has(b.sheetName)||n.set(b.sheetName,new Set),n.get(b.sheetName)?.add(b.anchor)});const i=t.sheetNames.map(b=>{const N=n.get(b)||new Set,C=ex(b,N),y=Math.min(1,.35+Math.min(.55,N.size*.08)),f=[`sheet:${b}`,`signals:${N.size}`,...[...N].slice(0,5)];return{sheetName:b,role:C,confidence:Number(y.toFixed(3)),evidence:f}}),l={firstQuarter:[],secondQuarter:[],finalSemestral:[],helper:[],lookup:[],other:[]};i.forEach(b=>{switch(b.role){case"inputData":l.inputData?l.other.push(b.sheetName):l.inputData=b.sheetName;break;case"firstQuarter":l.firstQuarter.push(b.sheetName);break;case"secondQuarter":l.secondQuarter.push(b.sheetName);break;case"finalSemestral":l.finalSemestral.push(b.sheetName);break;case"helper":l.helper.push(b.sheetName);break;case"lookup":l.lookup.push(b.sheetName);break;case"other":default:l.other.push(b.sheetName);break}});const c=(l.inputData?1:0)+l.firstQuarter.length+l.secondQuarter.length+l.finalSemestral.length+l.helper.length+l.lookup.length,d=tx({criticalFound:a.size,criticalTotal:tr.length,recognizedSheets:c,totalSheets:t.sheetNames.length,hasDepedAnchor:s.some(b=>Se(b.anchor,"Pursuant to DepEd Order 8 series of 2015"))}),m=l.firstQuarter.length>0||l.secondQuarter.length>0,p=!!l.inputData&&m&&l.finalSemestral.length>0,h=d>=.55&&p;return l.inputData||r.push("Input Data sheet not confidently detected."),m||r.push("No quarter class record sheet detected."),l.finalSemestral.length===0&&r.push("No Final Semestral Grades sheet detected."),{format:hl,isOfficialFormatLikely:h,confidence:d,evidence:r,missingCriticalAnchors:o,detectedSheets:l,anchorMatches:s}}function hr(t){if(typeof t=="number"&&Number.isFinite(t))return t;const s=String(t??"").trim();if(!s)return;const a=Number(s.replace(/[^0-9]/g,""));if(!(!Number.isFinite(a)||a<=0))return a}function Nn(t){const s=kt(t);if(s.includes("FEMALE"))return"FEMALE";if(s.includes("MALE"))return"MALE"}function jn(t){const s=kt(t.rowText);return s?s==="MALE"||s==="FEMALE"?"sex-header":Bu.some(a=>s.includes(a))?"signature":Pu.some(a=>s.includes(a))?"helper":s.includes("LEARNERS NAMES")||s.includes("WRITTEN WORK")||s.includes("PERFORMANCE TASKS")||s.includes("QUARTERLY ASSESSMENT")||s.includes("INITIAL GRADE")||s.includes("QUARTERLY GRADE")?"header":t.hasLearnerName||t.hasLearnerNumber?"learner":s.includes("ATTACHMENTS")||s.includes("LOOK UP")?"helper":"unknown":"blank"}function ax(t){const s=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],a=[];return s.forEach(r=>{It(t,r).forEach(o=>{a.push({role:r,name:String(Qe(t,o.row,o.col+1)?.displayValue||"").trim()||void 0,sourceSheet:t.sheetName,sourceRow:o.row+1})})}),a}function rx(t){const s=[],a=It(t,"LEARNERS NAMES")[0],r=a?wl(t,a.row,5):t.startRow,o=(y,f)=>It(t,y).find(I=>Math.abs(I.row-r)<=2)?.col??f,n=o(Ue.learnerNo[0],t.startCol),i=o(Ue.learnerName[0],t.startCol+1),l=o(Ue.firstQuarter[0],i+1),c=o(Ue.secondQuarter[0],l+1),d=o(Ue.firstSemester[0],c+1),m=o(Ue.finalGrades[0],d+1),p=o(Ue.remark[0],m+1),h=o(Ue.additionalRemarks[0],p+1),b=[];let N="UNKNOWN",C=0;for(let y=r+1;y<=t.endRow;y+=1){const f=Ds(t,y),w=jn({rowText:f,hasLearnerNumber:/\b\d{1,2}\b/.test(f),hasLearnerName:/[A-Z]{2,}/.test(f)});if(w==="sex-header"){N=Nn(f)||N;continue}if(w==="signature"||w==="helper")break;if(w==="blank"){if(C+=1,C>=fl)break;continue}if(w!=="learner")continue;C=0;const I=hr(Qe(t,y,n)?.displayValue),D=String(Qe(t,y,i)?.displayValue||"").trim();if(!D&&I===void 0)continue;const M=Qe(t,y,l)?.displayValue??null,q=Qe(t,y,c)?.displayValue??null,g=Qe(t,y,d)?.displayValue??null,S=Qe(t,y,m)?.displayValue??null,v=Qe(t,y,p)?.displayValue??null;let L=Qe(t,y,h)?.displayValue??null;const E=$a.filter(j=>Se(f,j));E.length>0&&(L=[L,E.join("; ")].filter(Boolean).join("; ")||null),!D&&I!==void 0&&s.push(`Row ${y+1} has learner number ${I} but empty learner name.`),b.push({learnerNo:I,fullName:D||`Unnamed Learner ${I||y+1}`,sex:N,firstQuarter:M,secondQuarter:q,firstSemester:g,finalGrades:S,remark:v,additionalRemarks:L,sourceRow:y+1})}return{sheetName:t.sheetName,learnerGrades:b,signatures:ax(t),warnings:s}}function ss(t,s){for(const a of s){const r=It(t,a);for(const o of r){const n=vl(t,o.row,o.col,8);if(n&&n.trim())return n.trim()}}}function nx(t){const s=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],a=[];return s.forEach(r=>{It(t,r).forEach(n=>{const i=vl(t,n.row,n.col,10);a.push({role:r,name:i,sourceSheet:t.sheetName,sourceRow:n.row+1})})}),a}function ox(t){const s=It(t,"LEARNERS NAMES")[0];if(!s)return[];const a=s.row+1,r=s.col,o=Math.max(t.startCol,r-1),n=Math.min(t.endCol,r+1),i=Math.min(t.endCol,r+2),l=[];let c="UNKNOWN",d=0;for(let m=a;m<=t.endRow;m+=1){const p=Ds(t,m),h=jn({rowText:p,hasLearnerNumber:!!hr(Qe(t,m,o)?.displayValue),hasLearnerName:!!String(Qe(t,m,r)?.displayValue||"").trim()});if(h==="sex-header"){c=Nn(p)||c,d=0;continue}if(h==="signature"||h==="helper")break;if(h!=="learner"){if(h==="blank"&&(d+=1),d>=5)break;continue}d=0;const b=hr(Qe(t,m,o)?.displayValue),N=String(Qe(t,m,r)?.displayValue||"").trim(),C=String(Qe(t,m,n)?.displayValue||"").trim()||void 0,y=String(Qe(t,m,i)?.displayValue||"").trim()||void 0,f=$a.filter(w=>Se(p,w));!N&&b===void 0||l.push({learnerNo:b,sex:c,fullName:N||`Unnamed Learner ${b||m}`,sourceSheet:t.sheetName,sourceRow:m+1,remarks:C,additionalRemarks:y,statuses:f.length>0?f:void 0})}return l}function ix(t){const s=[],a=[];for(let r=t.startRow;r<=t.endRow;r+=1){const o=Ds(t,r);if(o){if($a.some(n=>Se(o,n))){s.push(o);continue}(Se(o,"IMPORTANT")||Se(o,"NOTE")||Se(o,"ATTACHMENT")||Se(o,"LOOK UP"))&&a.push(o)}}return{attachmentRules:Array.from(new Set(s)),helperNotes:Array.from(new Set(a))}}function lx(t){const s=[],a={region:ss(t,Vt.region),division:ss(t,Vt.division),schoolName:ss(t,Vt.schoolName),schoolId:ss(t,Vt.schoolId),schoolYear:ss(t,Vt.schoolYear),gradeSection:ss(t,Vt.gradeSection),semester:ss(t,Vt.semester),track:ss(t,Vt.track),subjectCode:ss(t,Vt.subjectCode),subjectName:ss(t,Vt.subjectName),teacherName:ss(t,Vt.teacherName)},r=ox(t),o=nx(t),{attachmentRules:n,helperNotes:i}=ix(t);return a.schoolName||s.push("Input Data metadata is missing School Name."),a.schoolYear||s.push("Input Data metadata is missing School Year."),r.length===0&&s.push("No learners detected in Input Data sheet."),wn(t,Object.values(Vt).flat()).length<4&&s.push("Input Data sheet contains limited metadata anchors; layout may have drifted."),{sheetName:t.sheetName,schoolContext:a,learners:r,signatures:o,attachmentRules:n,helperNotes:i,warnings:s}}function cx(t){const s=kt(t.sheetName);return Hu.SECOND.some(a=>Se(s,a))?"SECOND":"FIRST"}function dx(t,s){const a=[],r=[],o=[];let n,i="NONE";for(let l=t.startCol;l<=t.endCol;l+=1){const c=Qe(t,s,l),d=kt(c?.displayValue||""),m=Qe(t,s+1,l),p=String(m?.displayValue||c?.displayValue||"").trim();if(!d&&!p)continue;if(Se(d,Ue.writtenWork[0])){i="WW";continue}if(Se(d,Ue.performanceTasks[0])){i="PT";continue}if(Se(d,Ue.quarterlyAssessment[0])){n={key:Br(p||"quarterly_assessment"),label:p||"Quarterly Assessment",column:ba(l)},i="DERIVED";continue}if(Se(d,Ue.initialGrade[0])||Se(d,Ue.quarterlyGrade[0])||Se(d,Ue.remark[0])||Se(d,Ue.additionalRemarks[0])||Se(d,Ue.firstQuarter[0])||Se(d,Ue.secondQuarter[0])||Se(d,Ue.firstSemester[0])||Se(d,Ue.finalGrades[0])||Se(d,Ue.ps[0])||Se(d,Ue.ws[0])||Se(d,Ue.total[0])){i="DERIVED",o.push({key:Br(p||d),label:p||d,column:ba(l)});continue}const h={key:Br(p||d||ba(l)),label:p||d||ba(l),maxScore:sr(m?.displayValue),column:ba(l)};i==="WW"?a.push(h):i==="PT"?r.push(h):i==="DERIVED"&&o.push(h)}return{writtenWorks:a,performanceTasks:r,quarterlyAssessment:n,derived:o}}function mx(t){const s=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],a=[];return s.forEach(r=>{It(t,r).forEach(o=>{const n=Qe(t,o.row,o.col+1),i=String(n?.displayValue||"").trim()||void 0;a.push({role:r,name:i,sourceSheet:t.sheetName,sourceRow:o.row+1})})}),a}function Yo(t,s,a){for(let r=t.startCol;r<=t.endCol;r+=1){const o=kt(Qe(t,s,r)?.displayValue||""),n=kt(Qe(t,s+1,r)?.displayValue||"");if(a.some(i=>Se(o,i)||Se(n,i)))return r}}function ux(t,s,a,r){const o={learnerNo:hr(Qe(t,s,r.numberCol)?.displayValue),fullName:String(Qe(t,s,r.nameCol)?.displayValue||"").trim(),sourceRow:s+1},n={};a.writtenWorks.forEach(d=>{const m=d.column?Ya(d.column):-1;if(m<0)return;const p=Qe(t,s,m)?.displayValue;n[d.key]=p??null}),Object.keys(n).length>0&&(o.writtenWorks=n);const i={};if(a.performanceTasks.forEach(d=>{const m=d.column?Ya(d.column):-1;if(m<0)return;const p=Qe(t,s,m)?.displayValue;i[d.key]=p??null}),Object.keys(i).length>0&&(o.performanceTasks=i),a.quarterlyAssessment?.column){const d=Ya(a.quarterlyAssessment.column);o.quarterlyAssessment=Qe(t,s,d)?.displayValue??null}const l=a.derived||[],c={};return l.forEach(d=>{if(!d.column)return;const m=Ya(d.column);if(m<0)return;const p=Qe(t,s,m)?.displayValue??null;c[d.key]=p,Se(d.label,Ue.initialGrade[0])&&(o.initialGrade=p),Se(d.label,Ue.quarterlyGrade[0])&&(o.quarterlyGrade=p),Se(d.label,Ue.firstQuarter[0])&&(o.firstQuarter=p),Se(d.label,Ue.secondQuarter[0])&&(o.secondQuarter=p),Se(d.label,Ue.firstSemester[0])&&(o.firstSemester=p),Se(d.label,Ue.finalGrades[0])&&(o.finalGrades=p),Se(d.label,Ue.remark[0])&&(o.remark=p!==null?String(p):null),Se(d.label,Ue.additionalRemarks[0])&&(o.additionalRemarks=p!==null?String(p):null)}),Object.keys(c).length>0&&(o.totals=c),o}function xx(t){const s=cx(t),a=[],r=It(t,Ue.learnerName[0])[0]||It(t,Ue.learnerName[1])[0],o=r?wl(t,r.row,4):t.startRow,n=dx(t,o),i=Yo(t,o,Ue.learnerNo)??t.startCol,l=Yo(t,o,Ue.learnerName)??Math.min(t.endCol,i+1),c=[];let d="UNKNOWN",m=0;for(let N=o+1;N<=t.endRow;N+=1){const C=Ds(t,N),y=jn({rowText:C,hasLearnerNumber:/\b\d{1,2}\b/.test(C),hasLearnerName:/[A-Z]{2,}/.test(C)});if(y==="sex-header"){d=Nn(C)||d;continue}if(y==="signature"||y==="helper")break;if(y==="blank"){if(m+=1,m>=fl)break;continue}if(y!=="learner")continue;m=0;const f=ux(t,N,n,{numberCol:i,nameCol:l});if(f.sex=d,!f.fullName&&f.learnerNo===void 0)continue;const w=$a.filter(I=>Se(C,I));w.length>0&&!f.additionalRemarks&&(f.additionalRemarks=w.join("; ")),!f.fullName&&f.learnerNo!==void 0&&(a.push(`Row ${N+1} has learner number ${f.learnerNo} but empty name.`),f.fullName=`Unnamed Learner ${f.learnerNo}`),c.push(f)}n.writtenWorks.length===0&&n.performanceTasks.length===0&&a.push(`No detailed assessment columns detected in ${t.sheetName}.`);const p=sr(It(t,"WRITTEN WORK %")[0]?.value||It(t,"WRITTEN WORK")[0]?.value),h=sr(It(t,"PERFORMANCE TASKS %")[0]?.value||It(t,"PERFORMANCE TASKS")[0]?.value),b=sr(It(t,"QUARTERLY ASSESSMENT %")[0]?.value||It(t,"QUARTERLY ASSESSMENT")[0]?.value);return{sheetName:t.sheetName,quarter:s,gradingWeights:{writtenWork:p,performanceTasks:h,quarterlyAssessment:b},assessmentColumns:n,learnerGrades:c,signatures:mx(t),warnings:a}}function px(t){const s=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],a=[];return s.forEach(r=>{It(t,r).forEach(o=>{a.push({role:r,name:String(Qe(t,o.row,o.col+1)?.displayValue||"").trim()||void 0,sourceSheet:t.sheetName,sourceRow:o.row+1})})}),a}function hx(t){const s=[];let a=!1;for(let r=t.startRow;r<=t.endRow;r+=1){const o=Ds(t,r);if(!o){if(a&&s.length>0)break;continue}if(Se(o,"WEIGHT OF COMPONENTS")){a=!0;continue}if(!a)continue;const n={sourceRow:r+1,raw:o};for(let i=t.startCol;i<=t.endCol;i+=1){const l=Qe(t,r,i)?.displayValue;l==null||String(l).trim()===""||(n[`c${i}`]=l)}Object.keys(n).length>2&&s.push(n)}return s}function fx(t){const s=[],a=[],r=[],o=[],n=[];return t.forEach(i=>{px(i).forEach(l=>a.push(l)),hx(i).forEach(l=>r.push({...l,sourceSheet:i.sheetName}));for(let l=i.startRow;l<=i.endRow;l+=1){const c=Ds(i,l);if(c){if($a.some(d=>Se(c,d))){o.push(`${i.sheetName}: ${c}`);continue}(Se(c,"HELPER")||Se(c,"LOOK UP")||Se(c,"IMPORTANT")||Se(c,"REFERENCE")||Se(c,"ATTACHMENT"))&&n.push(`${i.sheetName}: ${c}`)}}}),r.length===0&&s.push("No component weight rows were parsed from reference sheets."),{sheetName:t.map(i=>i.sheetName).join(", "),componentWeights:r,attachmentRules:Array.from(new Set(o)),helperNotes:Array.from(new Set(n)),signatures:a,warnings:s}}function gx(t,s,a){const r=new Map,o=n=>{const i=`${kt(n.fullName)}|${n.learnerNo||""}|${n.sourceSheet}`,l=r.get(i);if(!l){r.set(i,n);return}const c=Array.from(new Set([...l.statuses||[],...n.statuses||[]]));r.set(i,{...l,...n,remarks:n.remarks||l.remarks,additionalRemarks:n.additionalRemarks||l.additionalRemarks,statuses:c.length>0?c:void 0})};return t.forEach(o),s.forEach(n=>{n.learnerGrades.forEach(i=>{o({learnerNo:i.learnerNo,sex:i.sex,fullName:i.fullName,sourceSheet:n.sheetName,sourceRow:i.sourceRow,remarks:i.remark||void 0,additionalRemarks:i.additionalRemarks||void 0})})}),a.forEach(n=>{n.learnerGrades.forEach(i=>{o({learnerNo:i.learnerNo,sex:i.sex,fullName:i.fullName,sourceSheet:n.sheetName,sourceRow:i.sourceRow,remarks:i.remark||void 0,additionalRemarks:i.additionalRemarks||void 0})})}),Array.from(r.values())}function bx(t,s,a,r){const o=[...t.signatures,...s.flatMap(i=>i.signatures),...a.flatMap(i=>i.signatures),...r.signatures],n=new Map;return o.forEach(i=>{const l=`${kt(i.role)}|${kt(i.name||"")}|${i.sourceSheet}`;n.set(l,i)}),Array.from(n.values())}function vx(t){const s=gx(t.inputData.learners,t.quarterSheets,t.finalSheets);return{format:hl,version:Fu,workbookMeta:{fileName:t.workbook.fileName,sheetNames:t.workbook.sheetNames,detectedSheets:{inputData:t.detection.detectedSheets.inputData,firstQuarter:t.detection.detectedSheets.firstQuarter,secondQuarter:t.detection.detectedSheets.secondQuarter,finalSemestral:t.detection.detectedSheets.finalSemestral,helper:t.detection.detectedSheets.helper,lookup:t.detection.detectedSheets.lookup,other:t.detection.detectedSheets.other}},schoolContext:{...t.inputData.schoolContext},learners:s,quarterlyRecords:t.quarterSheets.map(a=>({sheetName:a.sheetName,quarter:a.quarter,gradingWeights:a.gradingWeights,assessmentColumns:a.assessmentColumns,learnerGrades:a.learnerGrades})),finalSemestralRecords:t.finalSheets.map(a=>({sheetName:a.sheetName,learnerGrades:a.learnerGrades})),references:{componentWeights:t.references.componentWeights,attachmentRules:Array.from(new Set([...t.inputData.attachmentRules||[],...t.references.attachmentRules||[]])),helperNotes:Array.from(new Set([...t.inputData.helperNotes||[],...t.references.helperNotes||[]])),signatures:bx(t.inputData,t.quarterSheets,t.finalSheets,t.references),unclassifiedBlocks:t.unclassifiedBlocks},validation:t.validation,raw:t.workbook.raw}}function wx(t){return!t||t.length===0?[]:t.map(s=>({s:{r:s.s.r,c:s.s.c},e:{r:s.e.r,c:s.e.c}}))}function Nx(t){const s={ref:t["!ref"],merges:wx(t["!merges"]),cells:{}};return Object.keys(t).filter(a=>!a.startsWith("!")).forEach(a=>{const r=t[a];!r||!(r.v!==void 0||typeof r.w=="string"&&r.w.trim().length>0||typeof r.f=="string"&&r.f.trim().length>0)||(s.cells[a]={v:r.v,w:r.w,t:r.t,f:r.f})}),s}function jx(t,s){const a=Cc(s,{type:"array",cellFormula:!0,cellNF:!0,cellText:!0,cellDates:!0,raw:!1}),r={},o={};return a.SheetNames.forEach(n=>{const i=a.Sheets[n];if(!i)return;const l=Nx(i);o[n]=l,r[n]=Yu(n,l)}),{fileName:t,sheetNames:a.SheetNames,raw:{sheets:o},matrices:r}}async function yx(t){const s=await t.arrayBuffer();return jx(t.name,s)}class Sx{state={};markRange(s,a,r){const o=s;this.state[o]||(this.state[o]={mappedAddresses:new Set,mappings:[]});for(let n=a.s.r;n<=a.e.r;n+=1)for(let i=a.s.c;i<=a.e.c;i+=1)this.state[o].mappedAddresses.add(`${n}:${i}`);this.state[o].mappings.push({sheetName:s,range:a,reason:r})}getMappings(){return Object.values(this.state).flatMap(s=>s.mappings)}getMappedRegionCount(){return this.getMappings().length}getUnmappedBlocks(s,a="unclassified"){const r=[];return Object.values(s).forEach(o=>{const n=new Set,i=this.state[o.sheetName]?.mappedAddresses??new Set;for(let l=o.startRow;l<=o.endRow;l+=1)for(let c=o.startCol;c<=o.endCol;c+=1){const d=`${l}:${c}`;if(n.has(d)||i.has(d))continue;const m=Qe(o,l,c);if(!(m&&m.displayValue!==null&&m.displayValue!==void 0&&String(m.displayValue).trim())){n.add(d);continue}const h=this.collectComponent(o,l,c,i,n);h&&r.push({sheetName:o.sheetName,range:Ku(h),purposeGuess:a,raw2D:Xu(o,h)})}}),r}collectComponent(s,a,r,o,n){const i=[{row:a,col:r}];let l=a,c=a,d=r,m=r,p=!1;for(;i.length>0;){const h=i.shift();if(!h)break;const b=`${h.row}:${h.col}`;if(n.has(b)||o.has(b))continue;n.add(b);const N=Qe(s,h.row,h.col);N&&N.displayValue!==null&&N.displayValue!==void 0&&String(N.displayValue).trim()&&(p=!0,l=Math.min(l,h.row),c=Math.max(c,h.row),d=Math.min(d,h.col),m=Math.max(m,h.col),[{row:h.row-1,col:h.col},{row:h.row+1,col:h.col},{row:h.row,col:h.col-1},{row:h.row,col:h.col+1}].forEach(y=>{y.rows.endRow||y.cols.endCol||i.push(y)}))}return p?{s:{r:l,c:d},e:{r:c,c:m}}:null}}function kx(t){const s=t.detection.detectedSheets,a=[s.inputData?1:0,s.firstQuarter.length,s.secondQuarter.length,s.finalSemestral.length,s.helper.length,s.lookup.length].reduce((r,o)=>r+o,0);return{totalSheets:t.totalSheets,recognizedSheets:a,unclassifiedSheets:s.other.length,mappedCellRegions:t.mappedCellRegions,unmappedCellRegions:t.unmappedCellRegions}}function Cx(t){const s=new Map;t.forEach(r=>{const o=`${r.learnerNo||""}|${r.fullName.trim().toUpperCase()}`;s.has(o)||s.set(o,[]),s.get(o)?.push(r.sourceRow)});const a=[];return s.forEach((r,o)=>{r.length>1&&a.push(`Duplicate learner entry detected for ${o} at rows ${r.join(", ")}.`)}),a}function Ix(t){const s=[];return t.forEach(a=>{a.learnerGrades.forEach(r=>{r.fullName.trim()||s.push(`${a.sheetName} row ${r.sourceRow}: learner name is blank.`);const o=r.writtenWorks&&Object.values(r.writtenWorks).some(i=>i!==null&&i!==""),n=r.performanceTasks&&Object.values(r.performanceTasks).some(i=>i!==null&&i!=="");!o&&!n&&r.quarterlyAssessment==null&&s.push(`${a.sheetName} row ${r.sourceRow}: all grade blocks are empty.`)})}),s}function Tx(t){const s=[];return t.forEach(a=>{a.learnerGrades.forEach(r=>{r.fullName.trim()||s.push(`${a.sheetName} row ${r.sourceRow}: learner name is blank.`),r.finalGrades==null&&r.firstSemester==null&&r.firstQuarter==null&&r.secondQuarter==null&&s.push(`${a.sheetName} row ${r.sourceRow}: no semestral/final values detected.`)})}),s}function _x(t){const s=[],a=[];t.detection.detectedSheets.inputData||a.push("Missing Input Data sheet."),t.quarterSheets.length===0&&a.push("No quarter class record sheets were extracted."),t.finalSheets.length===0&&a.push("No Final Semestral sheet was extracted."),t.detection.missingCriticalAnchors.length>0&&s.push(`Missing critical anchors: ${t.detection.missingCriticalAnchors.join(", ")}.`),Cx(t.inputData.learners).forEach(n=>s.push(n)),Ix(t.quarterSheets).forEach(n=>s.push(n)),Tx(t.finalSheets).forEach(n=>s.push(n)),s.push(...t.inputData.warnings),t.quarterSheets.forEach(n=>s.push(...n.warnings)),t.finalSheets.forEach(n=>s.push(...n.warnings)),t.unmappedCellRegions>t.mappedCellRegions&&s.push("A significant portion of workbook regions are unclassified; review diagnostics before confirming import.");const r=t.detection.confidence,o=t.detection.isOfficialFormatLikely&&a.length===0;return r({fullName:i.fullName,learnerNo:i.learnerNo,sex:i.sex,remarks:i.remarks,additionalRemarks:i.additionalRemarks,statuses:i.statuses,sourceSheet:i.sourceSheet,sourceRow:i.sourceRow})),r=t.quarterlyRecords.flatMap(i=>i.learnerGrades.map(l=>({fullName:l.fullName,sourceSheet:i.sheetName,sourceRow:l.sourceRow,quarter:i.quarter,firstQuarter:l.firstQuarter,secondQuarter:l.secondQuarter,firstSemester:l.firstSemester,finalGrades:l.finalGrades,quarterlyGrade:l.quarterlyGrade,initialGrade:l.initialGrade,remark:l.remark,additionalRemarks:l.additionalRemarks}))),o=t.finalSemestralRecords.flatMap(i=>i.learnerGrades.map(l=>({fullName:l.fullName,sourceSheet:i.sheetName,sourceRow:l.sourceRow,firstQuarter:l.firstQuarter,secondQuarter:l.secondQuarter,firstSemester:l.firstSemester,finalGrades:l.finalGrades,remark:l.remark,additionalRemarks:l.additionalRemarks}))),n=[...t.learners,...t.quarterlyRecords.flatMap(i=>i.learnerGrades.map(l=>({learnerNo:l.learnerNo,sex:l.sex,fullName:l.fullName,sourceSheet:i.sheetName,sourceRow:l.sourceRow,remarks:l.remark||void 0,additionalRemarks:l.additionalRemarks||void 0})))].map(i=>({fullName:i.fullName,remark:i.remarks||null,additionalRemarks:i.additionalRemarks||null,statuses:"statuses"in i?i.statuses:void 0,sourceSheet:i.sourceSheet,sourceRow:i.sourceRow}));return{classEntity:s,studentEntities:a,gradeEntities:[...r,...o],remarksEntities:n}}const Ko=1500;function Xo(t){return t?Object.values(t.matrices).reduce((s,a)=>s+a.rowCount*a.colCount,0):0}function Jo(t){const s=`[shs-import] parse ${t.stage} file=${t.fileName} duration=${t.durationMs}ms sheets=${t.sheetCount} matrixCells=${t.matrixCellCount}`;if(t.stage==="failed"){console.error(`${s}${t.errorMessage?` error=${t.errorMessage}`:""}`);return}if(t.durationMs>=Ko){console.warn(`${s} slow=true threshold=${Ko}ms`);return}}function Hs(t,s){t?.onProgress?.(s)}function Rx(t,s){return Array.from(new Set(t.filter(a=>Number.isFinite(a)).map(a=>Math.max(s.startRow,Math.min(s.endRow,Math.trunc(a))))))}function va(t,s,a,r){Rx(a,s).forEach(o=>{t.markRange(s.sheetName,{s:{r:o,c:s.startCol},e:{r:o,c:s.endCol}},r)})}async function Mx(t,s){const a=s?.confidenceThreshold??$u,r=Date.now();let o=null;try{if(Hs(s,{stage:"reading",message:"Reading workbook structure and raw sheets..."}),o=await yx(t),!o)throw new Error("Workbook read returned null");Hs(s,{stage:"detecting-format",message:"Detecting DepEd SHS workbook format..."});const n=sx(o);Hs(s,{stage:"extracting",message:"Extracting metadata, learners, grades, and references..."});const i=n.detectedSheets.inputData||o.sheetNames[0],l=o.matrices[i],c=l?lx(l):{sheetName:i,schoolContext:{},learners:[],signatures:[],attachmentRules:[],helperNotes:[],warnings:["Input data sheet was not available in matrix map."]},m=[...n.detectedSheets.firstQuarter||[],...n.detectedSheets.secondQuarter||[]].map(I=>o.matrices[I]).filter(I=>!!I).map(I=>xx(I)),p=(n.detectedSheets.finalSemestral||[]).map(I=>o.matrices[I]).filter(I=>!!I).map(I=>rx(I)),h=[...n.detectedSheets.helper||[],...n.detectedSheets.lookup||[]].map(I=>o.matrices[I]).filter(I=>!!I),b=fx(h),N=new Sx;n.anchorMatches.forEach(I=>{const D=o.matrices[I.sheetName];D&&va(N,D,[I.row],`Anchor match: ${I.anchor}`)}),[c.sheetName].forEach(I=>{const D=o.matrices[I];if(!D)return;const M=Array.from({length:Math.min(14,D.rowCount)},(S,v)=>D.startRow+v),q=c.learners.map(S=>S.sourceRow-1),g=c.signatures.map(S=>S.sourceRow).filter(S=>typeof S=="number").map(S=>S-1);va(N,D,[...M,...q,...g],"Input Data parsed rows")}),m.forEach(I=>{const D=o.matrices[I.sheetName];if(!D)return;const M=I.learnerGrades.map(S=>S.sourceRow-1),q=I.signatures.map(S=>S.sourceRow).filter(S=>typeof S=="number").map(S=>S-1),g=M.length>0?Math.max(D.startRow,Math.min(...M)-2):D.startRow;va(N,D,[g,g+1,...M,...q],"Quarter sheet parsed rows")}),p.forEach(I=>{const D=o.matrices[I.sheetName];if(!D)return;const M=I.learnerGrades.map(S=>S.sourceRow-1),q=I.signatures.map(S=>S.sourceRow).filter(S=>typeof S=="number").map(S=>S-1),g=M.length>0?Math.max(D.startRow,Math.min(...M)-2):D.startRow;va(N,D,[g,g+1,...M,...q],"Final semestral parsed rows")}),h.forEach(I=>{const D=b.componentWeights.filter(g=>g.sourceSheet===I.sheetName).map(g=>g.sourceRow).filter(g=>typeof g=="number").map(g=>g-1),M=b.signatures?.filter(g=>g.sourceSheet===I.sheetName).map(g=>g.sourceRow).filter(g=>typeof g=="number").map(g=>g-1)||[],q=D.length===0&&M.length===0?[I.startRow,I.startRow+1,I.startRow+2]:[];va(N,I,[...D,...M,...q],"Reference/helper parsed rows")});const C=N.getUnmappedBlocks(o.matrices);Hs(s,{stage:"validating",message:"Validating completeness and structural integrity..."});const y=_x({detection:n,inputData:c,quarterSheets:m,finalSheets:p,mappedCellRegions:N.getMappedRegionCount(),unmappedCellRegions:C.length,totalSheets:o.sheetNames.length});Hs(s,{stage:"normalizing",message:"Normalizing parsed workbook and creating entity mapping..."});const f=vx({workbook:o,detection:n,inputData:c,quarterSheets:m,finalSheets:p,references:b,validation:y,unclassifiedBlocks:C});f.validation.confidenceT.trim().toLowerCase().replace(/\s+/g," "),he=T=>{if(typeof T=="number"&&Number.isFinite(T))return T;const B=Number(String(T??"").replace(/[^0-9.-]+/g,""));return Number.isFinite(B)?B:null},Ne=(T,B)=>{const G=Number.isFinite(T)?T:B;return Math.max(0,Math.min(100,G))},de=T=>{const B=String(T??"");return/[",\n]/.test(B)?`"${B.replace(/"/g,'""')}"`:B},ue=(T,B)=>{const G=new Map,A=["quarterlyGrade","finalGrades","firstSemester","firstQuarter","secondQuarter","initialGrade"];T.mapping.gradeEntities.forEach(Oe=>{const Ye=re(Oe.fullName||"");if(!Ye)return;const ht=A.map(lt=>he(Oe[lt])).filter(lt=>lt!==null);if(ht.length===0)return;const wt=G.get(Ye)||[];G.set(Ye,wt.concat(ht))});const J=T.mapping.studentEntities||[];if(J.length===0)return null;const le=(T.imported.schoolContext.semester||T.imported.schoolContext.schoolYear||"First Semester").trim(),xe=(T.imported.schoolContext.subjectName||"Class Record Import").trim(),ce=(t||s||"import").replace(/[^a-zA-Z0-9]+/g,"").toUpperCase().slice(0,12)||"IMPORT",Te=[["name","lrn","email","engagementScore","avgQuizScore","attendance","assignmentCompletion","term","assessmentName"].join(",")];if(J.forEach((Oe,Ye)=>{const ht=re(Oe.fullName||""),wt=G.get(ht)||[],lt=wt.length>0?wt.reduce((z,fe)=>z+fe,0)/wt.length:75,Nt=Ne(lt,75),$t=Ne(Nt+5,85),Gt=Ne(Nt*.7+$t*.3,80),Ss=Ne($t*.6+Nt*.4,82),$s=Oe.learnerNo||Ye+1,Fs=`IMP-${ce}-${String($s).padStart(4,"0")}`,is=Oe.fullName||`Learner ${Ye+1}`;Te.push([de(is),de(Fs),de(""),de(Number(Gt.toFixed(1))),de(Number(Nt.toFixed(1))),de(Number($t.toFixed(1))),de(Number(Ss.toFixed(1))),de(le),de(xe)].join(","))}),Te.length<=1)return null;const tt=B.replace(/\.(xlsx|xls)$/i,"");return new File([Te.join(` -`)],`${tt}-normalized.csv`,{type:"text/csv"})},H=async T=>{S(!0),j(""),K(null);let B=T;if(/\.(xlsx|xls)$/i.test(T.name))try{const G=await Mx(T,{confidenceThreshold:an});w(G);const A=ue(G,T.name);A&&(B=A)}catch{w(null)}else w(null);try{const G=await mt.uploadClassRecords(B,{classSectionId:t,className:s,datasetIntent:"synthetic_student_records"}),A=G.students.length,le=((xe,ce,Fe,Te)=>({classSectionId:xe.classSectionId||ce||"imported_class",className:xe.className||Fe||"Imported Class",classMetadata:xe.classMetadata||Te}))(G,t,s,a);A>0&&l?.({students:G.students,classSectionId:le.classSectionId,className:le.className,classMetadata:le.classMetadata}),G.success?(oe.success(`Successfully imported ${A} student records.`),K({datasetIntent:G.datasetIntent,summary:G.interpretationSummary,columns:G.columnInterpretations?.map(xe=>({columnName:xe.columnName,mappedField:xe.mappedField,usagePolicy:xe.usagePolicy,confidenceBand:xe.confidenceBand,domainSignals:xe.domainSignals}))||[]}),c?.()):oe.error("Import completed but no usable student rows were detected. Check required columns and retry.")}catch(G){oe.error(G instanceof Error?G.message:"Upload failed")}finally{S(!1)}},Z=async T=>{L(!0);try{const B=await mt.uploadCourseMaterials(T,{classSectionId:t,className:s});if(B.success){const G=B.topics?.length??0;oe.success(`Course material imported (${G} topics extracted).`),c?.()}}catch(B){oe.error(B instanceof Error?B.message:"Course material upload failed")}finally{L(!1)}},[se,Re]=u.useState(r),[$e,He]=u.useState(!1),[U,te]=u.useState(null),_=u.useMemo(()=>{let T=se;if(o.length>0){const B=new Set(o.map(G=>vs(G.classSectionId||G.id)));T=T.filter(G=>B.has(vs(G.classSectionId))||B.has(vs(G.classroomId)))}else return[];return t&&(T=T.filter(B=>vs(B.classSectionId)===vs(t)||vs(B.classroomId)===vs(t))),T},[se,t,o]);u.useEffect(()=>{Re(r),k(Object.fromEntries(r.map(T=>[Ka(T),{grade:T.grade||"",section:T.section||""}])))},[r]);const[V,k]=u.useState({}),O=async()=>{He(!0);let T=0,B=0;try{for(const A of _){const J=V[Ka(A)],le=J?.grade||A.grade,xe=J?.section||A.section;try{n&&(le!==A.grade||xe!==A.section)&&(await jr(A.id,le,xe,n,new Date().getFullYear().toString(),i),await rl(A.id,le,xe),T++)}catch(ce){console.warn(`[EditRecords] Failed to save ${A.name}:`,ce),B++}}const G=se.map(A=>{const J=V[Ka(A)];if(!J)return A;const le=St({metadata:A.classMetadata,classSectionId:A.classSectionId,className:[J.grade,J.section].filter(Boolean).join(" - "),grade:J.grade,section:J.section});return{...A,grade:J.grade,section:J.section,className:le.className||[J.grade,J.section].filter(Boolean).join(" - "),classSectionId:le.classSectionId||A.classSectionId,classMetadata:le}});Re(G),m?.(G),B>0?oe.warning(`Saved ${T} records, ${B} failed`):oe.success("Records saved successfully")}catch{oe.error("Failed to save changes")}finally{He(!1)}};return e.jsx("div",{className:"h-full overflow-y-auto w-full block",children:e.jsxs("div",{className:"w-full p-[24px] xl:p-[32px] space-y-[24px]",children:[C==="main"&&e.jsxs("div",{className:"block space-y-[24px]",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[16px] p-4 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-slate-200 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-indigo-50 flex items-center justify-center border border-indigo-100/50",children:e.jsx(ir,{className:"w-5 h-5 text-indigo-500"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-[14px] font-bold text-[#1e293b]",children:"Upload Context"}),e.jsx("p",{className:"text-[12px] text-[#64748b]",children:"Select where the imported data should be applied"})]})]}),e.jsxs("div",{className:"relative w-full md:w-[300px]",children:[e.jsxs("select",{className:"appearance-none bg-[#f8fafc] border border-[#e2e8f0] text-[#1e293b] font-bold text-[13px] rounded-lg pl-4 pr-10 py-2.5 outline-none focus:border-[#4f46e5] focus:ring-2 focus:ring-[#4f46e5]/20 shadow-[0_1px_4px_rgba(0,0,0,0.02)] cursor-pointer w-full transition-colors",value:s||t||"All Classes",onChange:()=>{},children:[e.jsx("option",{value:"All Classes",children:"All Classes"}),o.map(T=>e.jsx("option",{value:T.classSectionId||T.id,children:T.name},T.id))]}),e.jsx(zt,{className:"w-4 h-4 text-[#64748b] absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-[24px]",children:[e.jsxs("div",{onDragOver:T=>{T.preventDefault(),D(!0)},onDragLeave:()=>D(!1),onDrop:T=>{T.preventDefault(),D(!1);const B=T.dataTransfer.files[0];B&&H(B)},onClick:()=>ae.current?.click(),className:`border-2 border-dashed transition-all rounded-[24px] p-8 flex flex-col items-center justify-center text-center cursor-pointer group shadow-[0_4px_20px_rgba(0,0,0,0.02)] relative overflow-hidden h-[280px] ${I?"border-[#1FA7E1] bg-[#1FA7E1]/10":"border-[#1FA7E1]/30 hover:border-[#1FA7E1] bg-white hover:bg-[#1FA7E1]/5"}`,children:[e.jsx("input",{ref:ae,type:"file",accept:".csv,.xlsx,.xls",onChange:T=>{const B=T.target.files?.[0];B&&H(B)},className:"hidden"}),e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#1FA7E1]/10 flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300 shadow-sm border border-[#1FA7E1]/20",children:g?e.jsx("span",{className:"animate-spin text-[#1FA7E1]",children:"..."}):e.jsx(td,{className:"w-8 h-8 text-[#1FA7E1]"})}),e.jsx("h3",{className:"text-[18px] font-bold text-[#1e293b] mb-2",children:g?"Uploading...":"Class Records"}),e.jsx("p",{className:"text-[13px] text-[#64748b] max-w-sm mb-6",children:"Upload student grades, attendance logs, and quiz scores to power predictive analytics."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".csv"}),e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".xlsx"})]})]}),e.jsxs("div",{onDragOver:T=>{T.preventDefault(),q(!0)},onDragLeave:()=>q(!1),onDrop:T=>{T.preventDefault(),q(!1);const B=T.dataTransfer.files[0];B&&Z(B)},onClick:()=>ne.current?.click(),className:`border-2 border-dashed transition-all rounded-[24px] p-8 flex flex-col items-center justify-center text-center cursor-pointer group shadow-[0_4px_20px_rgba(0,0,0,0.02)] relative overflow-hidden h-[280px] ${M?"border-[#9956DE] bg-[#9956DE]/10":"border-[#9956DE]/30 hover:border-[#9956DE] bg-white hover:bg-[#9956DE]/5"}`,children:[e.jsx("input",{ref:ne,type:"file",accept:".pdf,.docx,.txt",onChange:T=>{const B=T.target.files?.[0];B&&Z(B)},className:"hidden"}),e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#9956DE]/10 flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300 shadow-sm border border-[#9956DE]/20",children:v?e.jsx("span",{className:"animate-spin text-[#9956DE]",children:"..."}):e.jsx(Ns,{className:"w-8 h-8 text-[#9956DE]"})}),e.jsx("h3",{className:"text-[18px] font-bold text-[#1e293b] mb-2",children:v?"Uploading...":"Course Materials"}),e.jsx("p",{className:"text-[13px] text-[#64748b] max-w-sm mb-6",children:"Upload syllabus, lesson plans, and curriculum docs to ground AI lesson generation."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".pdf"}),e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".docx"}),e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".txt"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-[16px]",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#0ea5e9] to-[#0284c7] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(14,165,233,0.2)] flex flex-col text-white group transition-all duration-300 hover:-translate-y-1 hover:shadow-lg hover:shadow-sky-500/30",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full"}),e.jsx("div",{className:"w-10 h-10 rounded-full bg-white/10 border border-white/20 flex items-center justify-center shrink-0 mb-3 relative z-10 transition-transform group-hover:scale-110",children:e.jsx(Zc,{className:"w-5 h-5 text-white"})}),e.jsx("h4",{className:"font-bold text-[14px] mb-1.5 relative z-10",children:"Smart Parsing"}),e.jsx("p",{className:"text-[12px] text-white/90 leading-relaxed relative z-10",children:"AI automatically understands varied spreadsheet formats and maps column names securely."})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f97316] to-[#ea580c] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(249,115,22,0.2)] flex flex-col text-white group transition-all duration-300 hover:-translate-y-1 hover:shadow-lg hover:shadow-orange-500/30",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full"}),e.jsx("div",{className:"w-10 h-10 rounded-full bg-white/10 border border-white/20 flex items-center justify-center shrink-0 mb-3 relative z-10 transition-transform group-hover:scale-110",children:e.jsx(ji,{className:"w-5 h-5 text-white"})}),e.jsx("h4",{className:"font-bold text-[14px] mb-1.5 relative z-10",children:"Risk Prediction"}),e.jsx("p",{className:"text-[12px] text-white/90 leading-relaxed relative z-10",children:"Analyzes historical performance patterns across your data to predict at-risk students."})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] flex flex-col text-white group transition-all duration-300 hover:-translate-y-1 hover:shadow-lg hover:shadow-purple-500/30",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full"}),e.jsx("div",{className:"w-10 h-10 rounded-full bg-white/10 border border-white/20 flex items-center justify-center shrink-0 mb-3 relative z-10 transition-transform group-hover:scale-110",children:e.jsx(Rs,{className:"w-5 h-5 text-white"})}),e.jsx("h4",{className:"font-bold text-[14px] mb-1.5 relative z-10",children:"Contextual AI"}),e.jsx("p",{className:"text-[12px] text-white/90 leading-relaxed relative z-10",children:"Maps curriculum topics to generate highly personalized remedial lesson paths."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-[24px]",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white flex flex-col justify-between h-full",children:[e.jsx("h2",{className:"text-[16px] font-semibold text-[#1e293b] mb-4",children:"Data Health"}),e.jsxs("div",{className:"flex-1 bg-emerald-50/50 border border-emerald-100 rounded-[16px] p-6 flex flex-col items-center justify-center text-center transition-all duration-300 hover:bg-emerald-50 hover:shadow-md hover:border-emerald-200",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-emerald-100 flex items-center justify-center mb-3 text-emerald-600 transition-transform duration-300 hover:scale-110 hover:-translate-y-1",children:e.jsx(Na,{className:"w-6 h-6"})}),e.jsx("h3",{className:"text-emerald-700 font-bold text-[15px] mb-1",children:"All Records Synced"}),e.jsx("p",{className:"text-emerald-600/80 text-[12px] max-w-[200px]",children:"AI parsing completed successfully with no anomalies detected."})]}),e.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[e.jsxs("button",{onClick:()=>y("edit-records"),className:"w-full flex items-center justify-center gap-2 bg-[#1e293b] hover:bg-black text-white text-[13px] font-semibold rounded-full px-4 py-3 shadow-[0_1px_4px_rgba(0,0,0,0.04)] transition-transform hover:scale-[1.02]",children:[e.jsx(Yc,{className:"w-4 h-4"})," Edit Class Records"]}),e.jsx("button",{onClick:()=>y("mapping-logs"),className:"w-full flex items-center justify-center gap-2 bg-white text-[#475569] border border-slate-300 hover:bg-slate-50 text-[13px] font-semibold rounded-full px-4 py-3 shadow-[0_1px_4px_rgba(0,0,0,0.04)] transition-colors",children:"View Mapping Logs"})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white flex flex-col h-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h2",{className:"text-[16px] font-semibold text-[#1e293b]",children:"Recent Uploads"}),e.jsx("button",{onClick:()=>y("mapping-logs"),className:"text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors",children:"View All"})]}),e.jsxs("div",{className:"flex-1 space-y-[12px] overflow-y-auto no-scrollbar flex flex-col justify-center items-center h-[120px]",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-slate-50 flex items-center justify-center mb-2 border border-slate-100",children:e.jsx(Hc,{className:"w-5 h-5 text-slate-300"})}),e.jsx("p",{className:"text-[13px] font-medium text-slate-500",children:"There are no recent uploads yet."})]})]})]})]}),C==="mapping-logs"&&e.jsxs("div",{className:"space-y-[16px]",children:[e.jsx("div",{className:"shrink-0 mb-2",children:e.jsxs("button",{onClick:()=>y("main"),className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors w-max bg-white px-[18px] py-2 rounded-full shadow-sm border border-slate-200",children:[e.jsx(lr,{className:"w-4 h-4"})," Back to Uploads"]})}),e.jsxs("div",{className:"bg-white rounded-[18px] border border-[#f1f5f9] overflow-hidden shadow-sm",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-slate-50 flex justify-between items-center",children:e.jsx("h2",{className:"text-[15px] font-semibold text-[#1e293b]",children:"Latest Import Mapping"})}),e.jsx("div",{className:"p-5",children:Q?e.jsx("div",{className:"space-y-3",children:Q.columns.map((T,B)=>e.jsxs("div",{className:"flex justify-between p-3 border rounded bg-slate-50",children:[e.jsx("span",{className:"font-semibold text-sm",children:T.columnName}),e.jsx("span",{className:"text-sm text-indigo-600",children:T.mappedField||"Unmapped"})]},B))}):e.jsx("p",{className:"text-slate-500 text-sm",children:"No recent mapping logs to display."})})]})]}),C==="edit-records"&&e.jsxs("div",{className:"space-y-[16px] h-full flex flex-col",children:[e.jsx("div",{className:"shrink-0 mb-2",children:e.jsxs("button",{onClick:()=>y("main"),className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors w-max bg-white px-[18px] py-2 rounded-full shadow-sm border border-slate-200",children:[e.jsx(lr,{className:"w-4 h-4"})," Back to Uploads"]})}),e.jsxs("div",{className:"bg-white rounded-[18px] border border-slate-200 shadow-sm overflow-hidden flex flex-col flex-1",children:[e.jsxs("div",{className:"p-5 border-b border-slate-200 flex justify-between items-center bg-white",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[18px] font-bold text-[#1e293b]",children:"Edit Class Records"}),e.jsx("p",{className:"text-[13px] text-[#64748b]",children:"Review and modify student data manually"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>y("main"),className:"px-5 py-2 rounded-full border border-slate-300 text-slate-700 font-semibold text-[13px] hover:bg-slate-50",children:"Cancel"}),e.jsx("button",{onClick:O,disabled:$e,className:"px-5 py-2 rounded-full bg-emerald-500 text-white font-semibold text-[13px] hover:bg-emerald-600 flex items-center gap-2 disabled:opacity-50",children:$e?"Saving...":e.jsxs(e.Fragment,{children:[e.jsx(gi,{className:"w-4 h-4"})," Save Changes"]})})]})]}),e.jsxs("div",{className:"px-5 py-3 border-b border-slate-200 flex justify-between items-center bg-slate-50/50 shrink-0 text-slate-500 text-[13px]",children:[e.jsxs("span",{className:"flex items-center gap-2 font-medium",children:[e.jsx(sa,{className:"w-4 h-4"})," Click on any field to edit"]}),e.jsxs("span",{children:["Showing ",_.length," records"]})]}),e.jsx("div",{className:"overflow-auto flex-1 table-scrollbar bg-white relative",children:e.jsxs("div",{className:"min-w-[1100px] w-full flex flex-col min-h-full",children:[e.jsxs("div",{className:"flex items-center w-full bg-slate-100/90 border-b border-slate-200 text-[12px] font-semibold text-slate-500 tracking-wide sticky top-0 z-20 shadow-[0_1px_2px_rgba(0,0,0,0.02)] h-12",children:[e.jsx("div",{className:"flex-[1.5] min-w-[240px] px-6 sticky left-0 z-30 bg-slate-100/90 backdrop-blur-sm border-r border-slate-200 h-full flex items-center shadow-[2px_0_4px_rgba(0,0,0,0.02)]",children:"Student Name"}),e.jsx("div",{className:"w-[100px] shrink-0 px-4 h-full flex items-center justify-center",children:"LRN"}),e.jsx("div",{className:"w-[140px] shrink-0 px-4 h-full flex items-center justify-center",children:"Grade"}),e.jsx("div",{className:"w-[140px] shrink-0 px-4 h-full flex items-center justify-center",children:"Section"}),e.jsx("div",{className:"w-[100px] shrink-0 px-4 h-full flex items-center justify-center",children:"Avg Score"}),e.jsx("div",{className:"w-[120px] shrink-0 px-4 h-full flex items-center justify-center",children:"Risk Level"}),e.jsx("div",{className:"flex-1 min-w-[180px] px-4 h-full flex items-center justify-center",children:"Weakest Topic"}),e.jsx("div",{className:"w-[80px] shrink-0 px-4 h-full flex items-center justify-center border-r border-transparent",children:"Action"})]}),e.jsx("div",{className:"flex flex-col w-full pb-4",children:_.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-6 text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-slate-100 flex items-center justify-center mb-4",children:e.jsx(sa,{className:"w-7 h-7 text-slate-400"})}),e.jsx("h3",{className:"text-[16px] font-bold text-slate-700 mb-2",children:"No managed classes found"}),e.jsx("p",{className:"text-[13px] text-slate-500 max-w-sm",children:"You don't currently manage any classes. Ask your administrator to assign you as a section manager, or create a new class from the Dashboard."})]}):_.map((T,B)=>{const G=Ka(T),A=T.name.split(" "),J=A.length>1?`${A[0][0]}${A[A.length-1][0]}`.toUpperCase():T.name.substring(0,2).toUpperCase(),le=["bg-[#be185d]","bg-[#3b82f6]","bg-[#f43f5e]","bg-[#2563eb]","bg-[#059669]","bg-[#d946ef]"],xe=le[B%le.length],ce=(T.avgScore??0)>=75?"text-emerald-500":(T.avgScore??0)>=60?"text-orange-500":"text-rose-500";let Fe="bg-slate-50 text-slate-600 border-slate-200";const Te=(T.riskLevel||"").toLowerCase();return Te==="low"?Fe="bg-emerald-50 text-emerald-600 border-emerald-200":Te==="high"?Fe="bg-rose-50 text-rose-600 border-rose-200":Te==="medium"&&(Fe="bg-orange-50 text-orange-600 border-orange-200"),e.jsxs("div",{className:"flex items-center w-full border-b border-slate-100 hover:bg-slate-50 transition-colors group min-h-[64px]",children:[e.jsxs("div",{className:"flex-[1.5] min-w-[240px] px-6 sticky left-0 z-10 bg-white group-hover:bg-slate-50 border-r border-slate-100 h-full flex items-center gap-4 shadow-[2px_0_4px_rgba(0,0,0,0.01)]",children:[e.jsx("div",{className:`w-8 h-8 rounded-full ${xe} text-white flex items-center justify-center font-bold text-[12px] shrink-0`,children:J}),e.jsx("span",{className:"font-semibold text-slate-800 text-[14px] truncate",children:T.name})]}),e.jsx("div",{className:"w-[100px] shrink-0 px-4 flex justify-center text-[13px] text-slate-500",children:T.lrn||"—"}),e.jsx("div",{className:"w-[140px] shrink-0 px-4 flex justify-center",children:e.jsx("input",{type:"text",value:V[G]?.grade||T.grade||"",onChange:tt=>k(Oe=>({...Oe,[G]:{...Oe[G],grade:tt.target.value}})),readOnly:U!==G,className:`outline-none px-4 py-1.5 rounded-full text-[13px] font-medium text-slate-600 w-full transition-all text-center ${U===G?"bg-white border border-purple-500 ring-2 ring-purple-500/20":"bg-slate-100 border border-transparent cursor-default"}`})}),e.jsx("div",{className:"w-[140px] shrink-0 px-4 flex justify-center",children:e.jsx("input",{type:"text",value:V[G]?.section||T.section||"",onChange:tt=>k(Oe=>({...Oe,[G]:{...Oe[G],section:tt.target.value}})),readOnly:U!==G,className:`outline-none px-4 py-1.5 rounded-full text-[13px] font-medium text-slate-600 w-full transition-all text-center ${U===G?"bg-white border border-purple-500 ring-2 ring-purple-500/20":"bg-slate-100 border border-transparent cursor-default"}`})}),e.jsx("div",{className:"w-[100px] shrink-0 px-4 flex justify-center",children:e.jsxs("span",{className:`${ce} font-bold text-[14px]`,children:[T.avgScore,"%"]})}),e.jsx("div",{className:"w-[120px] shrink-0 px-4 flex justify-center",children:e.jsx("span",{className:`px-3 py-1 text-[10px] font-bold rounded uppercase border ${Fe}`,children:T.riskLevel||"Unknown"})}),e.jsx("div",{className:"flex-1 min-w-[180px] px-4 flex justify-center text-[13px] text-slate-600 truncate",children:T.weakestTopic||"Foundational Skills"}),e.jsx("div",{className:"w-[80px] shrink-0 px-4 flex justify-center border-r border-transparent",children:e.jsx("button",{onClick:()=>te(U===G?null:G),className:`w-8 h-8 rounded-full flex items-center justify-center transition-colors ${U===G?"bg-purple-100 text-purple-600":"hover:bg-slate-200 text-slate-400"}`,children:e.jsx(Ni,{className:"w-4 h-4"})})})]},G)})})]})})]})]})]})})}const zx=[{value:"available",label:"Available",icon:e.jsx(Aa,{size:14}),color:"text-emerald-600"},{value:"teacher_uploaded",label:"Teacher Material",icon:e.jsx(Qr,{size:14}),color:"text-blue-600"},{value:"coming_soon",label:"Coming Soon",icon:e.jsx(Ts,{size:14}),color:"text-amber-600"},{value:"unavailable",label:"Unavailable",icon:e.jsx(xc,{size:14}),color:"text-slate-400"}],Lx=({teacherId:t})=>{const[s,a]=u.useState(""),[r,o]=u.useState("teacher_uploaded"),[n,i]=u.useState(!1),[l,c]=u.useState(null),d=async()=>{if(!s){oe.error("Select a module first.");return}i(!0);try{let m;if(l&&r==="teacher_uploaded"){const p=Tc(Fl,`teacher_modules/${t}/${s}/${l.name}`);await _c(p,l),m=await Ec(p)}await Ic(s,r,t,m),oe.success(`Module status updated to "${r}".`),c(null)}catch(m){oe.error(m.message||"Failed to update module status.")}finally{i(!1)}};return e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-slate-800",children:"Module Availability Control"}),e.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Set module status or upload alternative PDF when DepEd content is unavailable."})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-slate-600 mb-1 block",children:"Module"}),e.jsxs("select",{value:s,onChange:m=>a(m.target.value),className:"w-full rounded-lg border border-slate-200 px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"Select module..."}),$l.map(m=>e.jsxs("option",{value:m.id,children:[m.moduleTitle," (",m.quarter,")"]},m.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-slate-600 mb-1 block",children:"Status"}),e.jsx("select",{value:r,onChange:m=>o(m.target.value),className:"w-full rounded-lg border border-slate-200 px-3 py-2 text-sm",children:zx.map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))})]})]}),r==="teacher_uploaded"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-slate-600 mb-1 block",children:"Upload Alternative PDF (optional)"}),e.jsx("input",{type:"file",accept:".pdf",onChange:m=>c(m.target.files?.[0]||null),className:"text-sm text-slate-600"})]}),e.jsx("button",{type:"button",onClick:d,disabled:!s||n,className:"px-4 py-2 rounded-lg bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-bold disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:n?"Updating...":"Update Status"})]})},Xa="ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789",Zo="school.mathpulse.local";function ei(t=10){const s=typeof globalThis<"u"&&typeof globalThis.crypto<"u"?globalThis.crypto:void 0;if(s&&typeof s.getRandomValues=="function"){const r=new Uint32Array(t);s.getRandomValues(r);let o="";for(let n=0;n{const[l,c]=u.useState(""),[d,m]=u.useState(""),[p,h]=u.useState(!1),[b,N]=u.useState(null),[C,y]=u.useState(null),[f,w]=u.useState(!1);u.useEffect(()=>{t&&(N(null),w(!1),h(!1),y(null),c((a?.email||Dx(a)).trim()),m(ei()))},[t,a]);const I=u.useMemo(()=>a?[a.grade,a.section].filter(Boolean).join(" · ")||"Unassigned section":null,[a]),D=()=>{m(ei()),w(!1)},M=async()=>{try{const S=C?.temporaryPassword||d;if(!S)return;typeof navigator<"u"&&navigator.clipboard&&await navigator.clipboard.writeText(S),w(!0),oe.success("Temporary password copied. Share it with the student now — it will not be shown again."),window.setTimeout(()=>w(!1),2500)}catch(S){console.warn("Clipboard write failed:",S),oe.error("Unable to copy password. Please copy it manually.")}},q=async()=>{if(!a)return;const S=l.trim();if(!$x(S)){N("Enter a valid email address before creating the account.");return}if(!d||d.length<8){N("Temporary password must be at least 8 characters.");return}if(!r){N("Missing teacher context. Please refresh and try again.");return}h(!0),N(null);try{const v=await Hm({name:a.name,lrn:a.lrn,email:S,grade:a.grade,section:a.section,classSectionId:a.classSectionId,adviserTeacherId:r,adviserTeacherName:o,schoolYear:n,temporaryPassword:d});y(v),i?.({...v,rosterId:a.rosterId}),oe.success(`Account created for ${a.name}.`)}catch(v){const L=v instanceof Error?v.message:"Failed to create account.";N(L)}finally{h(!1)}},g=C?.temporaryPassword||d;return e.jsx(Mt,{children:t&&a&&e.jsx(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:()=>{p||s()},children:e.jsxs(Ae.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{type:"spring",damping:28,stiffness:320},onClick:S=>S.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl w-full max-w-lg overflow-hidden border border-[#dde3eb]",role:"dialog","aria-modal":"true","aria-labelledby":"create-student-account-modal-title",children:[e.jsxs("div",{className:"flex items-start justify-between px-6 pt-6",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-indigo-100 text-indigo-600 flex items-center justify-center shrink-0",children:e.jsx(oi,{size:22})}),e.jsxs("div",{children:[e.jsx("h2",{id:"create-student-account-modal-title",className:"text-[16px] font-bold text-[#0a1628]",children:C?"Account Created":"Create Student Account"}),e.jsx("p",{className:"text-[12px] text-[#5a6578] mt-0.5",children:C?"Share these credentials with the student. The password will not be shown again.":`Provision a system account for ${a.name}.`})]})]}),e.jsx("button",{type:"button",onClick:()=>{p||s()},className:"p-1.5 rounded-lg hover:bg-[#dde3eb] transition-colors","aria-label":"Close",children:e.jsx(Xt,{className:"w-4 h-4 text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-2xl p-4",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-[#64748b]",children:"Roster Row"}),e.jsx("p",{className:"text-[14px] font-semibold text-[#0a1628] mt-1",children:a.name}),e.jsxs("p",{className:"text-[12px] text-[#475569] mt-0.5",children:[a.lrn?`LRN ${a.lrn} · `:"",I]})]}),!C&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-[12px] font-semibold text-[#0a1628]",children:"Email address"}),e.jsx("input",{type:"email",value:l,onChange:S=>c(S.target.value),disabled:p,className:"mt-1 w-full rounded-xl border border-[#dde3eb] bg-white px-3 py-2 text-[13px] text-[#0a1628] focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-200",placeholder:"student@school.example",autoComplete:"off",spellCheck:!1}),e.jsx("span",{className:"text-[11px] text-[#64748b] mt-1 block",children:"Auto-generated from LRN if available. The student will sign in with this address."})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[12px] font-semibold text-[#0a1628] block",children:"Temporary password"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("input",{type:"text",value:d,readOnly:!0,className:"flex-1 rounded-xl border border-[#dde3eb] bg-white px-3 py-2 text-[13px] font-mono tracking-wide text-[#0a1628] focus:outline-none"}),e.jsx("button",{type:"button",onClick:D,disabled:p,className:"p-2 rounded-xl border border-[#dde3eb] bg-white hover:bg-[#f1f5f9] transition-colors disabled:opacity-60","aria-label":"Regenerate temporary password",children:e.jsx(ds,{className:"w-4 h-4 text-[#475569]"})}),e.jsx("button",{type:"button",onClick:M,className:"p-2 rounded-xl border border-[#dde3eb] bg-white hover:bg-[#f1f5f9] transition-colors","aria-label":"Copy temporary password",children:f?e.jsx(Bt,{className:"w-4 h-4 text-emerald-600"}):e.jsx(Gr,{className:"w-4 h-4 text-[#475569]"})})]}),e.jsx("span",{className:"text-[11px] text-[#64748b] mt-1 block",children:"The student should change this on first sign-in. Share it once — it will not be persisted."})]}),b&&e.jsxs("div",{className:"flex items-start gap-2 rounded-xl bg-rose-50 border border-rose-200 px-3 py-2 text-[12px] text-rose-700",children:[e.jsx(kc,{className:"w-4 h-4 mt-0.5 shrink-0"}),e.jsx("span",{children:b})]})]}),C&&e.jsxs("div",{className:"rounded-2xl border border-emerald-200 bg-emerald-50 p-4 space-y-2",children:[e.jsx("p",{className:"text-[12px] font-semibold text-emerald-800",children:"Credentials"}),e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-white border border-emerald-100 px-3 py-2",children:[e.jsx("span",{className:"text-[12px] text-[#475569]",children:"Email"}),e.jsx("span",{className:"text-[13px] font-semibold text-[#0a1628]",children:C.email})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-white border border-emerald-100 px-3 py-2",children:[e.jsx("span",{className:"text-[12px] text-[#475569]",children:"Temporary password"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold font-mono text-[#0a1628]",children:g}),e.jsx("button",{type:"button",onClick:M,className:"p-1.5 rounded-lg border border-emerald-200 bg-white hover:bg-emerald-100 transition-colors","aria-label":"Copy temporary password",children:f?e.jsx(Bt,{className:"w-4 h-4 text-emerald-600"}):e.jsx(Gr,{className:"w-4 h-4 text-emerald-700"})})]})]}),e.jsx("p",{className:"text-[11px] text-emerald-800",children:"This password is not stored anywhere. If you close this dialog without copying, you will need to reset it from the admin tools."})]})]}),e.jsx("div",{className:"flex items-center justify-end gap-2 px-6 pb-6",children:C?e.jsx(jt,{type:"button",onClick:s,className:"bg-indigo-600 hover:bg-indigo-700 text-white text-[13px] font-semibold rounded-xl px-5 py-2",children:"Done"}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{type:"button",variant:"ghost",onClick:s,disabled:p,className:"text-[13px] font-semibold text-[#475569] rounded-xl px-4 py-2 hover:bg-[#dde3eb]",children:"Cancel"}),e.jsx(jt,{type:"button",onClick:q,disabled:p,className:"bg-indigo-600 hover:bg-indigo-700 text-white text-[13px] font-semibold rounded-xl px-5 py-2 disabled:opacity-60",children:p?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ft,{className:"w-4 h-4 animate-spin"}),"Creating…"]}):"Create account"})]})})]})})})};function Ox(t){const s=t.atRiskCount>=5?"high":t.atRiskCount>=2?"medium":"low",a=St({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.name,grade:t.grade,gradeLevel:t.gradeLevel,classification:t.classification,strand:t.strand,section:t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId||t.teacherId,ownerTeacherName:t.ownerTeacherName,adviserTeacherId:t.adviserTeacherId||t.teacherId,adviserTeacherName:t.adviserTeacherName||t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName});return{id:t.id,name:a.className||t.name,classSectionId:a.classSectionId||t.classSectionId,classMetadata:a,gradeLevel:a.gradeLevel||void 0,classification:a.classification||void 0,strand:a.strand||void 0,managerId:a.managerId||void 0,managerName:a.managerName||void 0,schedule:t.schedule,studentCount:t.studentCount,avgScore:t.avgScore,atRiskCount:t.atRiskCount,riskLevel:s}}function Pr(t,s){const a=t.riskStatus?["intervene","critical","at_risk"].includes(t.riskStatus)?"high":t.riskStatus==="watch"?"medium":"low":(t.riskLevel||"Low").toLowerCase(),r=t.lastActive?Nl(t.lastActive.toDate()):"Unknown",o=t.className||s||"Imported Class",n=ps(o),i=t.grade||n.grade,l=t.section||n.section,c=St({metadata:t.classMetadata,classSectionId:t.classSectionId||t.classroomId,className:[i,l].filter(Boolean).join(" - ")||o,grade:i,gradeLevel:t.gradeLevel,classification:t.classification,strand:t.strand,section:l,adviserTeacherId:t.teacherId,ownerTeacherId:t.teacherId,managerId:t.classMetadata?.managerId||t.managerId,managerName:t.classMetadata?.managerName||t.managerName});return{id:t.id,lrn:t.lrn,name:t.name,avatar:t.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:t.avgQuizScore,riskLevel:a,weakestTopic:t.weakestTopic||"N/A",classroomId:t.classroomId||c.classSectionId||o,className:c.className||[i,l].filter(Boolean).join(" - ")||o,grade:i,gradeLevel:c.gradeLevel||gs(i)||void 0,classification:c.classification||da(c.gradeLevel||i)||void 0,strand:c.strand||ma(c.className,l)||void 0,section:l,classSectionId:c.classSectionId||t.classSectionId,classMetadata:c,managerId:c.managerId||void 0,managerName:c.managerName||void 0,lastActive:r,struggles:t.struggles||[],engagementScore:t.engagementScore,attendance:t.attendance,assignmentCompletion:t.assignmentCompletion,hasRegisteredAccount:t.hasRegisteredAccount,source:t.source,accountUid:t.accountUid,email:t.email}}function Bx(t){const s=t.atRiskCount>=5?"high":t.atRiskCount>=2?"medium":"low",a=St({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.name,grade:t.grade,gradeLevel:t.gradeLevel||t.classMetadata?.gradeLevel,classification:t.classification||t.classMetadata?.classification,strand:t.strand||t.classMetadata?.strand,section:t.section,managerId:t.managerId||t.classMetadata?.managerId,managerName:t.managerName||t.classMetadata?.managerName});return{id:t.id,name:a.className||t.name,classSectionId:a.classSectionId||t.classSectionId||void 0,classMetadata:a,gradeLevel:a.gradeLevel||void 0,classification:a.classification||void 0,strand:a.strand||void 0,managerId:a.managerId||void 0,managerName:a.managerName||void 0,schedule:t.schedule||"Mon-Fri",studentCount:t.studentCount,avgScore:t.avgScore,atRiskCount:t.atRiskCount,riskLevel:s}}function Px(t){const s=(t.riskLevel||"Low").toLowerCase(),a=St({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.className||[t.grade,t.section].filter(Boolean).join(" - ")||"Imported Class",grade:t.grade,gradeLevel:t.gradeLevel||t.classMetadata?.gradeLevel,classification:t.classification||t.classMetadata?.classification,strand:t.strand||t.classMetadata?.strand,section:t.section,managerId:t.managerId||t.classMetadata?.managerId,managerName:t.managerName||t.classMetadata?.managerName}),r=a.className||"Imported Class";return{id:t.id,lrn:t.lrn||void 0,name:t.name,avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:t.avgQuizScore,riskLevel:s,weakestTopic:t.weakestTopic||"Foundational Skills",classroomId:a.classSectionId||t.classSectionId||r,className:r,grade:a.grade||ps(r).grade,gradeLevel:a.gradeLevel||gs(a.grade||ps(r).grade)||void 0,classification:a.classification||da(a.gradeLevel||a.grade)||void 0,strand:a.strand||ma(r,a.section||t.section)||void 0,section:a.section||ps(r).section,classSectionId:a.classSectionId||t.classSectionId||void 0,classMetadata:a,managerId:a.managerId||void 0,managerName:a.managerName||void 0,lastActive:"Recently imported",struggles:[t.weakestTopic||"Foundational Skills"],engagementScore:t.engagementScore,attendance:t.attendance,assignmentCompletion:t.assignmentCompletion}}function Hx(t,s,a){return t<60||s<75||a<55?"high":t<75||s<85||a<70?"medium":"low"}function Ux(t,s,a,r){const o=St({metadata:r,classSectionId:s,className:a}),n=o.className||"Imported Class",i=o.classSectionId||"imported_class",l=Number(t.avgQuizScore||0),c=Number(t.attendance||0),d=Number(t.engagementScore||0),m=Number(t.assignmentCompletion||0),p=t.unknownFields?.weakestTopic||t.unknownFields?.topic||"Foundational Skills",h=Hx(l,c,d),b=t.studentId||t.lrn||t.email||t.name||Math.random().toString(36).slice(2);return{id:`upload-${i}-${b}`,lrn:t.lrn,name:t.name,avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:l,riskLevel:h,weakestTopic:p,classroomId:i,className:n,grade:o.grade||ps(n).grade,gradeLevel:o.gradeLevel||gs(o.grade||ps(n).grade)||void 0,classification:o.classification||da(o.gradeLevel||o.grade)||void 0,strand:o.strand||ma(n,o.section)||void 0,section:o.section||ps(n).section,classSectionId:i,classMetadata:o,managerId:o.managerId||void 0,managerName:o.managerName||void 0,lastActive:"Recently imported",struggles:[p],engagementScore:d,attendance:c,assignmentCompletion:m}}function Nl(t){const s=Date.now()-t.getTime(),a=Math.floor(s/6e4);if(a<1)return"Just now";if(a<60)return`${a} min${a>1?"s":""} ago`;const r=Math.floor(a/60);if(r<24)return`${r} hour${r>1?"s":""} ago`;const o=Math.floor(r/24);return`${o} day${o>1?"s":""} ago`}function it(t){return(t||"").trim().toLowerCase()}function ti(t){const s=it(t.classSectionId);if(s)return`section:${s}`;const a=(t.id||"").trim().toLowerCase();return a?`id:${a}`:`name:${(t.name||"").trim().toLowerCase()}`}function si(t,s){const a=new Map;return t.forEach(r=>{a.set(ti(r),r)}),s.forEach(r=>{const o=ti(r),n=a.get(o);if(!n){a.set(o,r);return}const i=Math.max(n.atRiskCount||0,r.atRiskCount||0),l=Math.max(n.studentCount||0,r.studentCount||0),c=r.avgScore>0?r.avgScore:n.avgScore,d=i>=5?"high":i>=2?"medium":"low",m=St({metadata:n.classMetadata,classSectionId:n.classSectionId||r.classSectionId,className:n.name||r.name,grade:n.classMetadata?.grade||r.classMetadata?.grade,gradeLevel:n.classMetadata?.gradeLevel||r.classMetadata?.gradeLevel,classification:n.classMetadata?.classification||r.classMetadata?.classification,strand:n.classMetadata?.strand||r.classMetadata?.strand,section:n.classMetadata?.section||r.classMetadata?.section,schoolYear:n.classMetadata?.schoolYear||r.classMetadata?.schoolYear,ownerTeacherId:n.classMetadata?.ownerTeacherId||r.classMetadata?.ownerTeacherId,ownerTeacherName:n.classMetadata?.ownerTeacherName||r.classMetadata?.ownerTeacherName,adviserTeacherId:n.classMetadata?.adviserTeacherId||r.classMetadata?.adviserTeacherId,adviserTeacherName:n.classMetadata?.adviserTeacherName||r.classMetadata?.adviserTeacherName,managerId:n.classMetadata?.managerId||r.classMetadata?.managerId,managerName:n.classMetadata?.managerName||r.classMetadata?.managerName});a.set(o,{...n,classSectionId:m.classSectionId||n.classSectionId||r.classSectionId,name:m.className||n.name||r.name,classMetadata:m,gradeLevel:m.gradeLevel||void 0,classification:m.classification||void 0,strand:m.strand||void 0,managerId:m.managerId||void 0,managerName:m.managerName||void 0,schedule:n.schedule||r.schedule,studentCount:l,atRiskCount:i,avgScore:c,riskLevel:d})}),Array.from(a.values())}function fr(t){const s=(t.lrn||"").trim().toLowerCase();if(s)return`lrn:${s}`;const a=t.name.trim().toLowerCase();if(a)return`name:${a}`;const r=it(t.classSectionId)||it(t.classroomId),o=(t.id||"").trim().toLowerCase();return r&&o?`${r}|id:${o}`:`${r}|anonymous`}function rn(t){const s=it(t.classSectionId)||it(t.classroomId),a=(t.lrn||"").trim().toLowerCase(),r=(t.id||"").trim().toLowerCase(),o=t.name.trim().toLowerCase().replace(/\s+/g,"_");return s&&a?`${s}|lrn:${a}`:s&&r?`${s}|id:${r}`:a?`lrn:${a}`:r&&o?`id:${r}|name:${o}`:r?`id:${r}`:s&&o?`${s}|name:${o}`:`name:${o||"unknown"}`}function ai(t,s){const a=new Map;return t.forEach(r=>{a.set(fr(r),r)}),s.forEach(r=>{const o=fr(r),n=a.get(o);if(!n){a.set(o,r);return}const i=[n.riskLevel,r.riskLevel].includes("high")?"high":[n.riskLevel,r.riskLevel].includes("medium")?"medium":"low",l=St({metadata:n.classMetadata,classSectionId:n.classSectionId||r.classSectionId,className:n.className||r.className,grade:n.grade||r.grade,gradeLevel:n.gradeLevel||r.gradeLevel,classification:n.classification||r.classification,strand:n.strand||r.strand,section:n.section||r.section,managerId:n.managerId||r.managerId,managerName:n.managerName||r.managerName});a.set(o,{...n,lrn:n.lrn||r.lrn,classSectionId:l.classSectionId||n.classSectionId||r.classSectionId,classroomId:n.classroomId||r.classroomId,className:l.className||n.className||r.className,grade:l.grade||n.grade||r.grade,gradeLevel:l.gradeLevel||n.gradeLevel||r.gradeLevel,classification:l.classification||n.classification||r.classification,strand:l.strand||n.strand||r.strand,section:l.section||n.section||r.section,managerId:l.managerId||n.managerId||r.managerId,managerName:l.managerName||n.managerName||r.managerName,classMetadata:l,avgScore:r.avgScore>0?r.avgScore:n.avgScore,attendance:r.attendance>0?r.attendance:n.attendance,engagementScore:r.engagementScore>0?r.engagementScore:n.engagementScore,assignmentCompletion:r.assignmentCompletion>0?r.assignmentCompletion:n.assignmentCompletion,weakestTopic:n.weakestTopic&&n.weakestTopic!=="N/A"?n.weakestTopic:r.weakestTopic,riskLevel:i,struggles:n.struggles.length>0?n.struggles:r.struggles,hasRegisteredAccount:n.hasRegisteredAccount===!0||r.hasRegisteredAccount===!0?!0:n.hasRegisteredAccount??r.hasRegisteredAccount,source:n.source==="registered"&&r.source==="import"||n.source==="import"&&r.source==="registered"||n.source==="both"||r.source==="both"?"both":n.source||r.source,accountUid:n.accountUid||r.accountUid,email:n.email||r.email})}),Array.from(a.values())}const qp=({onLogout:t,onOpenProfile:s,onOpenSettings:a})=>{const{currentUser:r,userProfile:o}=hs(),[n,i]=u.useState("dashboard"),[l,c]=u.useState(!1),[d,m]=u.useState(!1),[p,h]=u.useState(!1),[b,N]=u.useState(!1),[C,y]=u.useState(!1),[f,w]=u.useState(!1),[I,D]=u.useState(!1),M=["streak_reminder","daily_checkin","streak_milestone","achievement_unlocked","level_up","xp_earned","quiz_result"],{notifications:q}=mi(),g=q.filter(R=>!R.isRead&&!M.includes(R.type)).length,[S,v]=u.useState(null),[L,E]=u.useState(null),[j,Q]=u.useState(!1),[K,ae]=u.useState(!1),[ne,re]=u.useState(!1),[he,Ne]=u.useState(!1),[de,ue]=u.useState([]),[H,Z]=u.useState([]),se=u.useMemo(()=>r?.uid?de.filter(R=>R.managerId===r.uid||R.classMetadata?.managerId===r.uid):de,[de,r?.uid]),[Re,$e]=u.useState([]),[He,U]=u.useState(""),[te,_]=u.useState(!0),[V,k]=u.useState(!1),[O,T]=u.useState(0),[B,G]=u.useState([]),[A,J]=u.useState(!1),[le,xe]=u.useState(null),[ce,Fe]=u.useState(null),Te=o?.name||"Teacher",tt=u.useRef(new Map);u.useEffect(()=>{const R=()=>N(window.innerWidth<1024);return R(),window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]),u.useEffect(()=>{if(!r)return;const R=r.uid;let ee=!0,Ie;return(async()=>{_(!0);try{const Je=await nl(R);let ye=Je.map(Ox);const Ct=await Qm(R).catch(()=>[]),xt=new Map;Ct.forEach(F=>{const Y=it(F.classSectionId);Y&&xt.set(Y,F)}),ye=ye.map(F=>{const Y=xt.get(it(F.classSectionId));if(!Y)return F;const Ee=St({metadata:F.classMetadata,classSectionId:Y.classSectionId||F.classSectionId,className:Y.className||F.name,grade:Y.grade||F.classMetadata?.grade,gradeLevel:Y.gradeLevel||F.classMetadata?.gradeLevel,classification:Y.classification||F.classMetadata?.classification,strand:Y.strand||F.classMetadata?.strand,section:Y.section||F.classMetadata?.section,schoolYear:Y.schoolYear||F.classMetadata?.schoolYear,ownerTeacherId:Y.ownerTeacherId||F.classMetadata?.ownerTeacherId,ownerTeacherName:Y.ownerTeacherName||F.classMetadata?.ownerTeacherName,managerId:Y.managerId||F.classMetadata?.managerId,managerName:Y.managerName||F.classMetadata?.managerName});return{...F,name:Ee.className||F.name,classSectionId:Ee.classSectionId||F.classSectionId,classMetadata:Ee,gradeLevel:Ee.gradeLevel||F.gradeLevel,classification:Ee.classification||F.classification,strand:Ee.strand||F.strand,managerId:Ee.managerId||F.managerId,managerName:Ee.managerName||F.managerName}});const _e=new Map,Jt=new Map;Je.forEach(F=>{const Y=St({metadata:F.classMetadata,classSectionId:F.classSectionId,className:F.name,grade:F.grade,gradeLevel:F.gradeLevel,classification:F.classification,strand:F.strand,section:F.section,schoolYear:F.schoolYear,ownerTeacherId:F.ownerTeacherId||F.teacherId,ownerTeacherName:F.ownerTeacherName,adviserTeacherId:F.adviserTeacherId||F.teacherId,adviserTeacherName:F.adviserTeacherName,managerId:F.managerId,managerName:F.managerName});_e.set(F.id,Y.className||F.name),Jt.set(F.id,Y);const Ee=it(F.classSectionId);if(Ee){const Be=xt.get(Ee),Ft=St({metadata:Y,classSectionId:Be?.classSectionId||Ee,className:Be?.className||Y.className,grade:Be?.grade||Y.grade,gradeLevel:Be?.gradeLevel||Y.gradeLevel,classification:Be?.classification||Y.classification,strand:Be?.strand||Y.strand,section:Be?.section||Y.section,schoolYear:Be?.schoolYear||Y.schoolYear,ownerTeacherId:Be?.ownerTeacherId||Y.ownerTeacherId,ownerTeacherName:Be?.ownerTeacherName||Y.ownerTeacherName,managerId:Be?.managerId||Y.managerId,managerName:Be?.managerName||Y.managerName});_e.set(Ee,Ft.className||F.name),Jt.set(Ee,Ft)}});const Zt=F=>{const Y=it(F.classSectionId||F.classroomId);if(!Y)return F;const Ee=Jt.get(Y);if(!Ee)return F;const Be=St({metadata:Ee,classSectionId:F.classSectionId||Ee.classSectionId,className:F.className||Ee.className,grade:F.grade||Ee.grade,gradeLevel:F.gradeLevel||Ee.gradeLevel,classification:F.classification||Ee.classification,strand:F.strand||Ee.strand,section:F.section||Ee.section,managerId:F.managerId||Ee.managerId,managerName:F.managerName||Ee.managerName});return{...F,className:Be.className||F.className,grade:Be.grade||F.grade,gradeLevel:Be.gradeLevel||F.gradeLevel,classification:Be.classification||F.classification,strand:Be.strand||F.strand,section:Be.section||F.section,classSectionId:Be.classSectionId||F.classSectionId,classMetadata:Be,managerId:Be.managerId||F.managerId,managerName:Be.managerName||F.managerName}},es=(F,Y,Ee)=>_e.get(F)||(Y?_e.get(Y):void 0)||Ee||"Unknown",Fa=Array.from(new Set([...Ct.map(F=>F.classSectionId),...Je.map(F=>F.classSectionId).filter(Boolean),...ye.map(F=>F.classSectionId).filter(Boolean)].map(F=>(F||"").trim()).filter(F=>!!F))),[Ys,ks]=await Promise.all([vn(R).catch(F=>(console.warn("[TeacherDashboard] managed-student fetch failed:",F),[])),Om(R,Fa).catch(F=>(console.warn("[TeacherDashboard] registered-student fetch failed:",F),[]))]);let Oa=ks;if(ks.length===0&&Ys.length===0)try{const{collection:F,query:Y,where:Ee,getDocs:Be}=await Gs(async()=>{const{collection:Ot,query:We,where:xa,getDocs:pa}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{collection:Ot,query:We,where:xa,getDocs:pa}},__vite__mapDeps([2,3])),{db:Ft}=await Gs(async()=>{const{db:Ot}=await import("./index-Cvals0ud.js").then(We=>We.b6);return{db:Ot}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),De=Y(F(Ft,"users"),Ee("role","==","student"));Oa=(await Be(De)).docs.map(Ot=>{const We=Ot.data();return{uid:Ot.id,name:String(We.name||We.displayName||"").trim()||"Student",email:String(We.email||"").trim(),lrn:We.lrn?String(We.lrn).trim():void 0,photo:We.photo?String(We.photo).trim():We.photoURL?String(We.photoURL).trim():void 0,grade:We.grade?String(We.grade).trim():void 0,section:We.section?String(We.section).trim():void 0,classSectionId:We.classSectionId?String(We.classSectionId).trim():void 0,adviserTeacherId:We.adviserTeacherId?String(We.adviserTeacherId).trim():void 0,role:"student",createdAt:We.createdAt||void 0}}).filter(Ot=>Ot.name!=="Student"||Ot.email)}catch(F){console.warn("[TeacherDashboard] fallback all-students fetch failed:",F)}const Ks=new Map,Os=new Map,Ba=new Map;Ys.forEach(F=>{Ks.set(F.id,F),F.lrn&&Os.set(F.lrn.trim().toLowerCase(),F);const Y=_o(F.name),Ee=it(F.classSectionId||F.classroomId);Y&&Ba.set(`${Y}|${Ee}`,F)});const Pa=new Set,Ha=Oa.map(F=>{const Y=Bm(F),Ee=(F.lrn||"").trim().toLowerCase(),Be=_o(F.name),Ft=it(F.classSectionId);let De;if(Ks.has(F.uid))De=Ks.get(F.uid);else if(Ee&&Os.has(Ee))De=Os.get(Ee);else if(Be){const We=`${Be}|${Ft}`;De=Ba.get(We)}if(De){Pa.add(De.id);const We={...Y,id:F.uid,accountUid:F.uid,email:Y.email||De.email,lrn:Y.lrn||De.lrn,name:Y.name||De.name,avatar:Y.avatar||De.avatar,riskLevel:De.riskLevel||Y.riskLevel,avgQuizScore:De.avgQuizScore||Y.avgQuizScore,engagementScore:De.engagementScore||Y.engagementScore,attendance:De.attendance||Y.attendance,assignmentCompletion:De.assignmentCompletion||Y.assignmentCompletion,weakestTopic:De.weakestTopic||Y.weakestTopic,struggles:De.struggles||Y.struggles,lastActive:De.lastActive||Y.lastActive,wri:De.wri??null,riskStatus:De.riskStatus??null,riskUpdatedAt:De.riskUpdatedAt??null,diagnosticScore:De.diagnosticScore??null,externalGradesAvg:De.externalGradesAvg??null,systemPerformanceAvg:De.systemPerformanceAvg??null,riskHistory:De.riskHistory,grade:Y.grade||De.grade,gradeLevel:Y.gradeLevel||De.gradeLevel,section:Y.section||De.section,classSectionId:Y.classSectionId||De.classSectionId,classroomId:Y.classroomId||De.classroomId,classMetadata:De.classMetadata||Y.classMetadata,hasRegisteredAccount:!0,source:"both"},xa=it(We.classSectionId||We.classroomId),pa=es(We.classroomId||"",xa,We.className);return Zt(Pr(We,pa))}const Ga=it(Y.classSectionId||Y.classroomId),Ot=es(Y.classroomId||"",Ga,Y.className);return Zt(Pr(Y,Ot))}),Ua=Ys.filter(F=>!Pa.has(F.id)).map(F=>{const Y={...F,hasRegisteredAccount:!1,source:"import"},Ee=it(Y.classSectionId||Y.classroomId),Be=es(Y.classroomId,Ee,Y.className);return Zt(Pr(Y,Be))}),Bs=[...Ha,...Ua];if(!ee)return;ue(F=>ye.length===0&&F.length>0?F:ye),Z(F=>Bs.length===0&&F.length>0?F:Bs),mt.getImportedClassOverview({limit:3e3,forceRefresh:O>0}).then(F=>{ee&&(F.warnings.length>0&&console.warn("Imported class overview warnings:",F.warnings.join(" ")),ue(Y=>si(Y,F.classrooms.map(Bx))),Z(Y=>{if(Y.length===0)return Y;const Ee=F.students.map(Px),Be=new Set;Y.forEach(De=>Be.add(fr(De)));const Ft=Ee.filter(De=>Be.has(fr(De)));return Ft.length===0?Y:ai(Y,Ft)}))}).catch(F=>{console.warn("Imported class overview merge unavailable:",F)});const ua=Je.map(F=>F.id);ua.length>0&&(Ie=Wm(ua,F=>{ee&&$e(F.map(Y=>({id:Y.id,student:Y.studentName,action:Y.action,topic:Y.topic,time:Nl(Y.timestamp.toDate()),type:Y.type})))}))}catch(Je){console.error("Failed to load teacher data:",Je),oe.error("Failed to load dashboard data")}finally{_(!1)}})(),()=>{ee=!1,Ie&&Ie()}},[r,O]),u.useEffect(()=>{if(!r)return;let R=!0;return Vm("",80).then(ee=>{R&&G(ee)}).catch(ee=>{console.warn("Failed to load teacher directory options:",ee)}),()=>{R=!1}},[r]),u.useEffect(()=>{if(H.length===0)return;(async()=>{if(H.length===0){U("");return}k(!0);try{const ee=H.map(ge=>({name:ge.name,engagementScore:ge.engagementScore,avgQuizScore:ge.avgScore,attendance:ge.attendance,riskLevel:ge.riskLevel})),Ie=await mt.getDailyInsight({students:ee});U(Ie.insight)}catch{U(`${H.filter(ee=>ee.riskLevel==="high").length} students are at high risk of falling behind. Review their progress in the analytics view.`)}finally{k(!1)}})()},[H]);const Oe=de.reduce((R,ee)=>R+ee.studentCount,0),Ye=H.filter(R=>R.riskLevel==="high").length,ht=(()=>{const R=H.map(ee=>ee.avgScore).filter(ee=>ee>0);return R.length>0?Math.round(R.reduce((ee,Ie)=>ee+Ie,0)/R.length):0})(),wt=[{name:"High Risk",value:H.filter(R=>R.riskLevel==="high").length,color:"#FF8B8B"},{name:"Medium Risk",value:H.filter(R=>R.riskLevel==="medium").length,color:"#F08386"},{name:"Low Risk",value:H.filter(R=>R.riskLevel==="low").length,color:"#75D06A"}],lt={};H.forEach(R=>{R.weakestTopic&&R.weakestTopic!=="N/A"&&(lt[R.weakestTopic]||(lt[R.weakestTopic]={total:0,sum:0}),lt[R.weakestTopic].total+=1,lt[R.weakestTopic].sum+=R.avgScore)});const Nt=Object.entries(lt).map(([R,ee])=>({topic:R,score:Math.round(ee.sum/ee.total)})).sort((R,ee)=>R.score-ee.score).slice(0,6),$t=R=>{v(R),i("analytics")},Gt=R=>{E(R),i("intervention")},Ss=()=>{E(null),i("analytics")},$s=()=>{v(null),E(null),i("dashboard")},Fs=async(R,ee)=>{if(!r){oe.error("Unable to assign manager: teacher context is missing.");return}const Ie=ps(R.classMetadata?.className||R.name),ge=St({metadata:R.classMetadata,classSectionId:R.classSectionId,className:R.name,grade:R.classMetadata?.grade||Ie.grade,gradeLevel:R.classMetadata?.gradeLevel,classification:R.classMetadata?.classification,strand:R.classMetadata?.strand,section:R.classMetadata?.section||Ie.section,schoolYear:R.classMetadata?.schoolYear||String(new Date().getFullYear()),ownerTeacherId:R.classMetadata?.ownerTeacherId||r.uid,ownerTeacherName:R.classMetadata?.ownerTeacherName||Te,adviserTeacherId:R.classMetadata?.adviserTeacherId||r.uid,adviserTeacherName:R.classMetadata?.adviserTeacherName||Te,managerId:ee.uid,managerName:ee.name}),Je=ge.classSectionId||Ut(ge.grade||Ie.grade,ge.section||Ie.section);if(!Je){oe.error("Unable to assign manager: missing class section ID.");return}J(!0);try{await ol({classSectionId:Je,className:ge.className||R.name,grade:ge.grade||Ie.grade,gradeLevel:ge.gradeLevel||gs(ge.grade||Ie.grade)||ge.grade||Ie.grade,classification:ge.classification||da(ge.gradeLevel||ge.grade)||void 0,strand:ge.strand||ma(ge.className,ge.section)||void 0,section:ge.section||Ie.section,schoolYear:ge.schoolYear||String(new Date().getFullYear()),ownerTeacherId:ge.ownerTeacherId||r.uid,ownerTeacherName:ge.ownerTeacherName||Te,managerId:ee.uid,managerName:ee.name});const ye=St({metadata:ge,classSectionId:Je,managerId:ee.uid,managerName:ee.name}),Ct=it(Je);ue(xt=>xt.map(_e=>it(_e.classSectionId)!==Ct?_e:{..._e,name:ye.className||_e.name,classSectionId:ye.classSectionId||_e.classSectionId,classMetadata:ye,gradeLevel:ye.gradeLevel||_e.gradeLevel,classification:ye.classification||_e.classification,strand:ye.strand||_e.strand,managerId:ee.uid,managerName:ee.name})),Z(xt=>xt.map(_e=>{if(it(_e.classSectionId||_e.classroomId)!==Ct)return _e;const Zt=St({metadata:_e.classMetadata,classSectionId:ye.classSectionId||_e.classSectionId,className:_e.className||ye.className,grade:_e.grade||ye.grade,gradeLevel:_e.gradeLevel||ye.gradeLevel,classification:_e.classification||ye.classification,strand:_e.strand||ye.strand,section:_e.section||ye.section,managerId:ee.uid,managerName:ee.name});return{..._e,classMetadata:Zt,gradeLevel:Zt.gradeLevel||_e.gradeLevel,classification:Zt.classification||_e.classification,strand:Zt.strand||_e.strand,managerId:ee.uid,managerName:ee.name}})),v(xt=>!xt||it(xt.classSectionId)!==Ct?xt:{...xt,classMetadata:ye,managerId:ee.uid,managerName:ee.name,gradeLevel:ye.gradeLevel||xt.gradeLevel,classification:ye.classification||xt.classification,strand:ye.strand||xt.strand}),oe.success(`Assigned ${ee.name} as section manager.`)}catch(ye){console.error("Failed to assign class manager:",ye),oe.error(ye instanceof Error?ye.message:"Failed to assign class manager")}finally{J(!1)}},is=u.useCallback(R=>{xe({rosterId:R.id,name:R.name,lrn:R.lrn,email:R.email,grade:R.grade,section:R.section,classSectionId:R.classSectionId})},[]),z=u.useCallback(R=>{Z(ee=>ee.map(Ie=>Ie.id===R.rosterId?{...Ie,hasRegisteredAccount:!0,source:"both",accountUid:R.uid,email:R.email||Ie.email}:Ie)),T(ee=>ee+1)},[]),fe=u.useCallback(async(R,ee)=>{if(!r){oe.error("Cannot reassign section without an authenticated teacher.");return}const Ie=r.uid,ge=(ee.classSectionId||"").trim();if(!ge){oe.error("Pick a target section first.");return}Fe(R.id);try{await Pm({studentId:R.accountUid||R.id,isRegisteredAccount:!!R.hasRegisteredAccount,newClassSectionId:ge,newGrade:ee.grade,newSection:ee.section,previousClassSectionId:R.classSectionId,teacherId:Ie,teacherName:Te,schoolYear:R.classMetadata?.schoolYear||String(new Date().getFullYear())}),Z(Je=>Je.map(ye=>{if(ye.id!==R.id)return ye;const Ct=St({metadata:ye.classMetadata,classSectionId:ge,className:ye.className,grade:ee.grade,section:ee.section});return{...ye,grade:ee.grade,section:ee.section,classSectionId:ge,classroomId:ge,classMetadata:Ct}})),oe.success(`Moved ${R.name} to ${ee.grade} - ${ee.section}.`)}catch(Je){console.error("Section reassignment failed:",Je),oe.error(Je instanceof Error?Je.message:"Failed to reassign section.")}finally{Fe(null)}},[r,Te]),Xe=u.useCallback(async R=>{if(!r||!window.confirm(`Remove ${R.name} from this class? This cannot be undone.`))return;const ee=R.classSectionId||R.classroomId||"";if(!ee){oe.error("Cannot determine class section for this student.");return}try{await Um(R.accountUid||R.id,ee),Z(Ie=>Ie.filter(ge=>ge.id!==R.id)),oe.success(`Removed ${R.name} from class.`)}catch(Ie){console.error("Remove student failed:",Ie),oe.error("Failed to remove student.")}},[r]);u.useEffect(()=>{const R=()=>{const ee=window.innerWidth<1024;N(ee),ee?c(!1):h(!1)};return R(),window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]),u.useEffect(()=>{b&&h(!1)},[n,b]);const ke=R=>{i(R),v(null),E(null)},Ce=u.useMemo(()=>{if(!S)return;if(S.classMetadata?.classSectionId)return S.classMetadata.classSectionId||void 0;if(S.classSectionId)return S.classSectionId;const R=ps(S.classMetadata?.className||S.name);return Ut(R.grade,R.section)||void 0},[S]),Le=u.useMemo(()=>S||null,[S]),yt=u.useMemo(()=>{if(!Le)return;const R=de.findIndex(ee=>ee.id===Le.id);return pr[Math.max(0,R)%pr.length]},[Le,de]),nt=u.useMemo(()=>{if(!Le)return H;const R=(Le.id||"").trim().toLowerCase(),ee=it(Le.classSectionId),Ie=(Le.name||"").trim().toLowerCase();return H.filter(ge=>{const Je=it(ge.classroomId),ye=it(ge.classSectionId),Ct=(ge.className||"").trim().toLowerCase();return ee&&(ye===ee||Je===ee)||R&&(Je===R||ye===R)||Ie&&Ct===Ie})},[Le,H]);return te?e.jsx(Ol,{message:"Loading dashboard..."}):e.jsxs("div",{className:"relative flex h-screen w-full bg-background overflow-hidden",children:[b&&p&&e.jsx("button",{"aria-label":"Close navigation",className:"fixed inset-0 z-30 bg-slate-900/40 backdrop-blur-[1px]",onClick:()=>h(!1)}),e.jsxs(Ae.aside,{initial:!1,animate:{width:b?280:l&&!d?80:280,x:b?p?0:-300:0},transition:{type:"spring",stiffness:360,damping:34},onMouseEnter:()=>!b&&l&&m(!0),onMouseLeave:()=>m(!1),className:"fixed inset-y-0 left-0 z-40 bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] flex flex-col shadow-sm lg:static lg:z-auto p-5",children:[e.jsxs("div",{className:`mb-8 flex items-center ${l&&!d?"justify-center":"justify-between"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-[#7274ED] to-[#9956DE] rounded-2xl flex items-center justify-center shadow-md flex-shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"MathPulse AI",className:"w-10 h-10 object-contain drop-shadow-md"})}),(!l||d)&&e.jsx("div",{children:e.jsx("h1",{className:"text-base font-semibold font-display text-[#0a1628] whitespace-nowrap",children:"MathPulse AI"})})]}),!b&&(!l||d)&&e.jsx(Ae.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>c(!l),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":l?"Expand sidebar":"Collapse sidebar",children:l?e.jsx(Is,{size:20}):e.jsx(Es,{size:20})}),b&&e.jsx("button",{onClick:()=>h(!1),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":"Close navigation",children:e.jsx(Xt,{size:20})})]}),e.jsxs("nav",{className:"flex-1 space-y-5",children:[e.jsxs("div",{children:[l&&!d?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-semibold text-[#5a6578] uppercase tracking-widest",children:"Overview"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Cs,{icon:Kl,label:"Dashboard",active:n==="dashboard",collapsed:l&&!d,onClick:$s,forceExpanded:b}),e.jsx(Cs,{icon:_s,label:"Class Analytics",active:n==="analytics"||n==="intervention",collapsed:l&&!d,onClick:()=>ke("analytics"),forceExpanded:b})]})]}),e.jsxs("div",{children:[l&&!d?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-semibold text-[#5a6578] uppercase tracking-widest",children:"Students"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Cs,{icon:xs,label:"Topic Mastery",active:n==="topic_mastery",collapsed:l&&!d,onClick:()=>ke("topic_mastery"),forceExpanded:b}),e.jsx(Cs,{icon:us,label:"Competency",active:n==="competency",collapsed:l&&!d,onClick:()=>ke("competency"),forceExpanded:b})]})]}),e.jsxs("div",{children:[l&&!d?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-semibold text-[#5a6578] uppercase tracking-widest",children:"Tools"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Cs,{icon:Xl,label:"Data Import",active:n==="import",collapsed:l&&!d,onClick:()=>i("import"),forceExpanded:b}),e.jsx(Cs,{icon:Vr,label:"AI Quiz Maker",active:n==="quiz_maker",collapsed:l&&!d,onClick:()=>i("quiz_maker"),forceExpanded:b}),e.jsx(Cs,{icon:Wt,label:"Question Bank",active:n==="question_bank",collapsed:l&&!d,onClick:()=>i("question_bank"),forceExpanded:b}),e.jsx(Cs,{icon:rr,label:"Calendar",active:n==="calendar",collapsed:l&&!d,onClick:()=>i("calendar"),forceExpanded:b})]})]})]}),e.jsxs("div",{className:"space-y-2 border-t border-[#dde3eb] pt-4",children:[e.jsxs(Ae.button,{whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-[#5a6578] font-semibold border border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628] transition-all duration-200 whitespace-nowrap ${l&&!d?"justify-center":""}`,onClick:a,title:l&&!d?"Settings":"",children:[e.jsx(Jl,{size:18,strokeWidth:2,className:"flex-shrink-0"}),(!l||d)&&e.jsx("span",{className:"font-body text-xs",children:"Settings"})]}),e.jsx("div",{className:"text-[#5a6578]",children:e.jsx(Zl,{onClick:()=>y(!0),collapsed:l&&!d})})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden bg-gradient-to-br from-[#eef2ff] via-[#f5f3ff] to-[#fff7ed]",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[["dashboard","analytics","intervention","competency","topic_mastery","calendar","notifications","question_bank","import","quiz_maker"].includes(n)&&e.jsx("header",{className:"bg-transparent border-b border-[#e2e8f0]/40 px-[24px] xl:px-[32px] pt-[24px] pb-[16px] flex-shrink-0 z-30",children:e.jsxs("div",{className:"flex flex-row items-center justify-between gap-2 mb-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[b&&e.jsx("button",{onClick:()=>h(!0),className:"mt-1 p-2 rounded-lg border border-border text-muted-foreground hover:text-[#9956DE] hover:border-[#9956DE]/30 hover:bg-[#9956DE]/12 transition-colors","aria-label":"Open navigation",children:e.jsx(Bl,{size:18})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-lg sm:text-[26px] font-bold text-[#1e293b] tracking-tight leading-tight truncate",children:[n==="dashboard"&&"Teacher Dashboard",n==="analytics"&&"Class Analytics",n==="intervention"&&"Intervention Center",n==="competency"&&"Student Competency",n==="topic_mastery"&&"Topic Mastery",n==="calendar"&&"Academic Calendar",n==="notifications"&&"Notifications",n==="question_bank"&&"Question Bank",n==="import"&&"Data Import",n==="quiz_maker"&&"AI Quiz Maker"]}),e.jsxs("p",{className:"text-[13px] text-[#64748b] mt-1",children:[n==="dashboard"&&`Welcome back, ${Te}`,n==="analytics"&&"Analyze performance and risk across your classes.",n==="intervention"&&"Identify and support students who need immediate help.",n==="competency"&&"Track individual student progress against learning goals.",n==="topic_mastery"&&"Overview of student mastery levels across different math topics.",n==="calendar"&&"Manage your schedules and academic events.",n==="notifications"&&"Stay updated with student activity and system alerts.",n==="question_bank"&&"Manage and create math questions for your quizzes.",n==="import"&&"Upload class records and materials to power AI analytics.",n==="quiz_maker"&&"Create AI-powered quizzes based on your curriculum."]})]}),n==="dashboard"&&e.jsxs("div",{className:"hidden xl:flex items-center gap-2 ml-4 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#9956DE]/12 border border-[#9956DE]/30 rounded-lg",children:[e.jsx(us,{size:13,className:"text-[#9956DE]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#9956DE]",children:[Oe," students"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#F08386]/12 border border-[#F08386]/30 rounded-lg",children:[e.jsx(oa,{size:13,className:"text-[#F08386]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#C65E63]",children:[Ye," at risk"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#75D06A]/14 border border-[#75D06A]/35 rounded-lg",children:[e.jsx(na,{size:13,className:"text-[#75D06A]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#4D9F46]",children:[ht,"% avg"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("div",{className:"relative group",children:[e.jsxs("button",{onClick:()=>{ae(!0),Q(!0)},className:"relative w-10 h-10 flex items-center justify-center bg-[#eef2ff]/80 hover:bg-[#e0e7ff] rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#a5b4fc]/60 text-[#4f46e5] hover:border-[#818cf8] transition-colors cursor-pointer hover:scale-[1.02]","aria-label":"View AI Insight",children:[e.jsx(Rs,{size:18}),!j&&He&&e.jsx("div",{className:"absolute top-2.5 right-2.5 w-2 h-2 bg-rose-500 rounded-full border border-white animate-pulse"})]}),e.jsx("span",{className:"absolute -bottom-8 left-1/2 -translate-x-1/2 text-[10px] bg-[#1e293b] text-white px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-50 pointer-events-none",children:"AI Insight"})]}),b&&n==="dashboard"&&e.jsx("button",{onClick:()=>Ne(R=>!R),className:`relative w-10 h-10 flex items-center justify-center rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border transition-colors cursor-pointer hover:scale-[1.02] ${he?"bg-[#818cf8] border-[#6366f1] text-white":"bg-white/60 hover:bg-white/80 border-white/50 text-[#64748b] hover:text-[#1e293b]"}`,"aria-label":he?"Close calendar panel":"Open calendar panel",title:he?"Close calendar":"View calendar",children:e.jsx(rr,{size:18})}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>re(!ne),className:"relative w-10 h-10 flex items-center justify-center bg-white/60 hover:bg-white/80 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50 text-[#64748b] hover:text-[#1e293b] transition-colors cursor-pointer hover:scale-[1.02]","aria-label":"View notifications",title:"Notifications",children:[e.jsx(cr,{size:18}),g>0&&e.jsx("span",{className:"absolute top-2.5 right-2.5 w-2 h-2 bg-rose-500 rounded-full border border-white"})]}),e.jsx(ql,{isOpen:ne,onClose:()=>re(!1),onViewAll:()=>i("notifications")})]}),n!=="dashboard"&&e.jsxs("div",{onClick:s,className:"flex items-center gap-2 bg-white/60 px-4 py-2 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50 cursor-pointer hover:bg-white/80 transition-colors h-10 hover:scale-[1.02]",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-indigo-100 overflow-hidden shrink-0",children:e.jsx("img",{src:o?.photo||`https://ui-avatars.com/api/?name=${encodeURIComponent(Te)}&background=e0e7ff&color=4f46e5`,alt:"Profile",className:"w-full h-full object-cover"})}),e.jsx("span",{className:"text-[13px] font-semibold text-[#1e293b]",children:Te})]})]})]})}),e.jsx("main",{className:`flex-1 flex flex-col ${n==="intervention"||n==="analytics"?"overflow-hidden":"overflow-y-auto"}`,children:e.jsxs(Mt,{mode:"wait",children:[n==="dashboard"&&e.jsx(Qx,{classes:se,liveActivity:Re,onViewClass:$t,onViewAllClasses:()=>i("analytics"),onViewActivityStudent:R=>{const ee=H.find(Ie=>Ie.name===R);ee&&Gt(ee)},dailyInsight:He,insightLoading:V,isInsightDismissed:j,onDismissInsight:()=>Q(!0),onOpenInsightModal:()=>{ae(!0),Q(!0)},totalStudents:Oe,totalAtRisk:Ye,avgPerformance:ht,onCreateClass:()=>w(!0)}),n==="analytics"&&Le&&e.jsx(qx,{selectedClass:Le,students:nt,allClasses:de,riskDistribution:wt,topicPerformance:Nt,onViewStudent:Gt,onCreateAccount:is,onReassignSection:fe,reassignBusyId:ce,onBack:()=>v(null),teacherOptions:B,managerUpdating:A,onAssignManager:R=>Fs(Le,R),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,classColor:yt,insightDismissed:j,onOpenInsightModal:()=>ae(!0),onAddStudents:()=>D(!0),onRemoveStudent:Xe}),n==="analytics"&&!Le&&se.length>0&&e.jsx(Go,{classes:se,onSelectClass:$t,onOpenNotifications:()=>i("notifications"),onOpenProfile:s,insightDismissed:j,onOpenInsightModal:()=>ae(!0),onCreateClass:()=>w(!0)}),n==="analytics"&&!Le&&se.length===0&&e.jsx(Ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-sm max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#9956DE]/20 text-[#9956DE] flex items-center justify-center mb-4",children:e.jsx(_s,{size:24})}),e.jsx("h2",{className:"text-2xl font-display font-semibold text-foreground mb-2",children:"Class Analytics"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body leading-relaxed mb-4",children:"No classes available yet. Create a class or import class records to unlock analytics views."}),e.jsxs(jt,{onClick:()=>w(!0),className:"bg-[#9956DE] hover:bg-[#7c3aed] text-white",children:[e.jsx(ia,{size:16,className:"mr-1.5"}),"Create Class"]})]})}),n==="intervention"&&L&&e.jsx(Yx,{student:L,teacherId:r?.uid||"",teacherName:Te,initialCache:tt.current.get(L.id),onCacheUpdate:(R,ee)=>tt.current.set(R,ee),onStudentUpdated:R=>{const ee=L?rn(L):null;E(R),Z(Ie=>Ie.map(ge=>{const Je=rn(ge),ye=ee?Je===ee:!1,Ct=ge.id===R.id&&it(ge.classSectionId)===it(R.classSectionId);return ye||Ct?R:ge}))},onBack:Ss,onNavigateToQuizMaker:R=>{i("quiz_maker"),R&&sessionStorage.setItem("quizMakerInitialTab",R)}}),n==="topic_mastery"&&e.jsx(fu,{classSectionId:Ce,onOpenNotifications:()=>i("notifications"),onOpenProfile:s}),n==="competency"&&Le&&e.jsx(wu,{classSectionId:Ce,className:S?.name,fallbackStudents:H,onBack:()=>v(null),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,insightDismissed:j,onOpenInsightModal:()=>ae(!0)}),n==="competency"&&!Le&&de.length>0&&e.jsx(Go,{classes:se,onSelectClass:R=>v(R),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,insightDismissed:j,onOpenInsightModal:()=>ae(!0),viewType:"competency"}),n==="competency"&&!Le&&de.length===0&&e.jsx(Gx,{icon:us,title:"Student Competency",description:"No classes available yet. Import class records to view competency breakdowns."}),n==="import"&&e.jsxs(e.Fragment,{children:[e.jsx(Ax,{classSectionId:Ce,className:S?.name,classMetadata:S?.classMetadata,students:H,classes:se.map(R=>({id:R.id,name:R.name,classSectionId:R.classSectionId})),teacherId:r?.uid||"",teacherName:Te,onStudentsUpdated:R=>Z(R),onBackToClasses:()=>i("dashboard"),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,onOpenInsightModal:()=>{ae(!0),Q(!0)},userPhoto:o?.photo,onImportedClassRecords:R=>{const ee=R.students.map(_e=>Ux(_e,R.classSectionId,R.className,R.classMetadata)),Ie=St({metadata:R.classMetadata,classSectionId:R.classSectionId,className:R.className}),ge=Ie.classSectionId||"imported_class",Je=Ie.className||"Imported Class",ye=ee.filter(_e=>_e.riskLevel==="high").length,Ct=ee.length>0?Math.round(ee.reduce((_e,Jt)=>_e+Jt.avgScore,0)/ee.length):0,xt={id:ge,name:Je,classSectionId:ge,classMetadata:{...Ie,classSectionId:ge,className:Je},schedule:"Mon-Fri",studentCount:ee.length,avgScore:Ct,atRiskCount:ye,riskLevel:ye>=5?"high":ye>=2?"medium":"low"};Z(_e=>ai(_e,ee)),ue(_e=>si(_e,[xt]))},onDataChanged:()=>T(R=>R+1)}),e.jsx("div",{className:"mt-6",children:e.jsx(Lx,{teacherId:r?.uid||""})})]}),n==="notifications"&&e.jsx(ju,{liveActivity:Re,atRiskStudents:H.filter(R=>R.riskLevel==="high").map(R=>({name:R.name,riskLevel:R.riskLevel,weakestTopic:R.weakestTopic})),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,onOpenInsightModal:()=>{ae(!0),Q(!0)},userPhoto:o?.photo,teacherName:Te}),n==="calendar"&&e.jsx(Du,{classes:de,teacherId:r?.uid}),n==="quiz_maker"&&e.jsx(ml,{onBack:()=>{const R=sessionStorage.getItem("quizMakerReturnTo");sessionStorage.removeItem("quizMakerReturnTo"),sessionStorage.removeItem("quizMakerInitialTab"),i(R==="intervention"?"intervention":"dashboard")},onOpenNotifications:()=>i("notifications"),onOpenProfile:s,onOpenInsightModal:()=>{ae(!0),Q(!0)},userPhoto:o?.photo,teacherName:Te}),n==="question_bank"&&e.jsx(pu,{onOpenNotifications:()=>i("notifications"),onOpenProfile:s,onOpenInsightModal:()=>{ae(!0),Q(!0)},userPhoto:o?.photo,teacherName:Te})]})})]}),n==="dashboard"&&!b&&e.jsx(ni,{onViewCalendar:()=>i("calendar"),onOpenProfile:s,userProfile:o,teacherName:Te,liveActivity:Re})]}),e.jsx(Mt,{children:b&&n==="dashboard"&&he&&e.jsxs(e.Fragment,{children:[e.jsx(Ae.button,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-40 bg-slate-900/40 backdrop-blur-[2px]","aria-label":"Close calendar panel",onClick:()=>Ne(!1)},"cal-backdrop"),e.jsx(Ae.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",stiffness:320,damping:32},className:"fixed top-0 right-0 bottom-0 z-50 w-[300px] max-w-[85vw] shadow-2xl",children:e.jsx(ni,{onViewCalendar:()=>{i("calendar"),Ne(!1)},onOpenProfile:()=>{s?.(),Ne(!1)},userProfile:o,teacherName:Te,liveActivity:Re})},"cal-drawer")]})}),e.jsx(Mt,{children:K&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs(Ae.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-2xl shadow-xl w-full max-w-lg overflow-hidden border border-slate-200",children:[e.jsxs("div",{className:"p-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/50",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600",children:e.jsx(Rs,{size:16})}),e.jsx("h3",{className:"font-semibold text-slate-800",children:"Detailed AI Insight"})]}),e.jsx("button",{onClick:()=>{ae(!1)},className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors",children:e.jsx(Xt,{size:18})})]}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"text-sm text-slate-600 leading-relaxed",children:e.jsx(bc,{children:He?.replace(/[*_]*\s*\(?Word\s*count\s*:\s*[*_]*\s*\d+\)?\s*[*_]*/gi,"").trim()||`**${Ye} students (${Oe>0?Math.round(Ye/Oe*100):0}%)** are currently at high risk of falling behind in recent topics. Review their progress in the analytics view to plan interventions.`})})}),e.jsx("div",{className:"p-4 border-t border-slate-100 bg-slate-50 flex justify-end gap-2",children:e.jsx("button",{onClick:()=>{ae(!1)},className:"px-4 py-2 text-sm font-medium text-slate-600 hover:text-slate-800 hover:bg-slate-200 rounded-lg transition-colors",children:"Minimize to Menu"})})]})})}),e.jsx(Gl,{isOpen:C,onClose:()=>y(!1),onConfirm:t,title:"Logout",message:"Are you sure you want to logout?",confirmText:"Logout",cancelText:"Cancel"}),e.jsx(qm,{open:f,onClose:()=>w(!1),onCreated:()=>T(R=>R+1),teacherName:Te}),e.jsx(Ym,{open:I,onClose:()=>D(!1),onAdded:()=>T(R=>R+1),grade:Le?.gradeLevel||Le?.classMetadata?.grade||"Grade 11",section:Le?.classMetadata?.section||Le?.name?.split(" - ")[1]||"",teacherName:Te,existingStudentUids:nt.map(R=>R.id)}),e.jsx(Fx,{isOpen:!!le,onClose:()=>xe(null),seed:le,adviserTeacherId:r?.uid||"",adviserTeacherName:Te,schoolYear:le?H.find(R=>R.id===le.rosterId)?.classMetadata?.schoolYear||String(new Date().getFullYear()):void 0,onCreated:z})]})},Cs=({icon:t,label:s,active:a,collapsed:r,forceExpanded:o=!1,onClick:n})=>e.jsxs(Ae.button,{onClick:n,whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl cursor-pointer transition-all duration-200 border whitespace-nowrap ${r&&!o?"justify-center":""} ${a?"bg-[#9956DE]/12 border-[#9956DE]/30 shadow-sm text-[#9956DE]":"bg-transparent border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]"}`,children:[e.jsx(t,{size:18,strokeWidth:a?2.5:2,className:"flex-shrink-0"}),(!r||o)&&e.jsx("span",{className:"font-body font-semibold text-xs",children:s}),a&&!r&&e.jsx(Ae.div,{layoutId:"sidebar-active-indicator",className:"ml-auto w-2 h-2 rounded-full bg-[#9956DE]",transition:{type:"spring",duration:.4}})]}),Gx=({icon:t,title:s,description:a})=>e.jsx(Ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-sm max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#9956DE]/20 text-[#9956DE] flex items-center justify-center mb-4",children:e.jsx(t,{size:24})}),e.jsx("h2",{className:"text-2xl font-display font-semibold text-foreground mb-2",children:s}),e.jsx("p",{className:"text-sm text-muted-foreground font-body leading-relaxed",children:a})]})}),Qx=({classes:t,liveActivity:s,onViewClass:a,onViewAllClasses:r,onViewActivityStudent:o,dailyInsight:n,insightLoading:i,isInsightDismissed:l,onDismissInsight:c,onOpenInsightModal:d,totalStudents:m,totalAtRisk:p,avgPerformance:h,onCreateClass:b})=>{const N=m>0?Math.round(p/m*100):0,C=m>0?Math.round((m-p)/m*100):0;return e.jsxs(Ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-3 sm:p-6 space-y-4",children:[!l&&n&&e.jsxs("div",{onClick:d,className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] border border-white p-[14px_16px] sm:p-[18px_20px] flex flex-col sm:flex-row items-start sm:items-center gap-3 sm:gap-4 shadow-[0_1px_4px_rgba(0,0,0,0.04)] cursor-pointer hover:shadow-md transition-shadow group",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsx("div",{className:"absolute -inset-[5px] rounded-full border-2 border-[#a5b4fc] opacity-50 animate-pulse"}),e.jsx("div",{className:"w-[46px] h-[46px] rounded-full bg-[#eef2ff] border-2 border-[#c7d2fe] flex items-center justify-center text-[#4f46e5] text-xl relative overflow-hidden group-hover:scale-[1.05] transition-transform",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Mascot",className:"w-[85%] h-[85%] object-contain"})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"text-[13.5px] font-semibold text-[#1e1b4b] flex flex-wrap items-center gap-2 mb-1",children:[e.jsx(Rs,{size:14,className:"text-[#818cf8]"}),"MathPulse AI insight",e.jsx("span",{className:"bg-[#fee2e2] text-[#b91c1c] text-[10px] font-semibold px-2 py-0.5 rounded-full border border-[#fca5a5]",children:"Attention needed"})]}),e.jsx("div",{className:"text-[12.5px] text-[#475569] leading-[1.55]",children:"Some students may be at risk of falling behind. Click to view detailed analysis."})]}),e.jsxs("div",{className:"flex gap-2 flex-shrink-0 self-end sm:self-auto",children:[e.jsx("button",{onClick:y=>{y.stopPropagation(),c()},className:"px-[15px] py-[7px] rounded-[10px] text-xs font-medium cursor-pointer border border-[#e2e8f0] bg-white text-[#475569] hover:bg-[#f8fafc] transition-colors",children:"Dismiss"}),e.jsx("button",{onClick:y=>{y.stopPropagation(),r()},className:"px-[15px] py-[7px] rounded-[10px] text-xs font-medium cursor-pointer border border-[#4f46e5] bg-[#4f46e5] text-white shadow-[0_2px_8px_rgba(79,70,229,0.13)] hover:bg-[#4338ca] transition-colors",children:"Review students"})]})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-1.5 sm:gap-3",children:[e.jsxs("div",{className:"group relative overflow-hidden bg-[#10b981] shadow-[0_4px_16px_rgba(16,185,129,0.13)] rounded-sm sm:rounded-lg p-[10px] sm:p-[15px] text-white flex flex-col gap-[6px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[9px] sm:text-[11px] opacity-90 leading-tight",children:"Total students"}),e.jsx("div",{className:"hidden sm:flex bg-white/20 p-1.5 rounded-lg",children:e.jsx(us,{size:15})})]}),e.jsx("div",{className:"relative z-10 text-[18px] sm:text-[26px] font-semibold tracking-tight",children:m}),e.jsxs("div",{className:"relative z-10 border-t border-white/30 pt-1.5 sm:pt-2 flex justify-between items-center text-[9px] sm:text-[10px] opacity-90",children:[e.jsx("span",{className:"hidden sm:block",children:"Added this year"}),e.jsx("span",{className:"bg-black/15 px-[5px] sm:px-[7px] py-[2px] rounded font-semibold",children:m>0?"+1":"0"})]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#0ea5e9] shadow-[0_4px_16px_rgba(14,165,233,0.13)] rounded-sm sm:rounded-lg p-[10px] sm:p-[15px] text-white flex flex-col gap-[6px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[9px] sm:text-[11px] opacity-90 leading-tight",children:"Class average"}),e.jsx("div",{className:"hidden sm:flex bg-white/20 p-1.5 rounded-lg",children:e.jsx(xs,{size:15})})]}),e.jsxs("div",{className:"relative z-10 text-[18px] sm:text-[26px] font-semibold tracking-tight",children:[h,"%"]}),e.jsxs("div",{className:"relative z-10 border-t border-white/30 pt-1.5 sm:pt-2 flex justify-between items-center text-[9px] sm:text-[10px] opacity-90",children:[e.jsx("span",{className:"hidden sm:block",children:"Vs. last month"}),e.jsx("span",{className:"bg-black/15 px-[5px] sm:px-[7px] py-[2px] rounded font-semibold",children:"+2.5%"})]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#a855f7] shadow-[0_4px_16px_rgba(168,85,247,0.13)] rounded-sm sm:rounded-lg p-[10px] sm:p-[15px] text-white flex flex-col gap-[6px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[9px] sm:text-[11px] opacity-90 leading-tight",children:"Engage­ment"}),e.jsx("div",{className:"hidden sm:flex bg-white/20 p-1.5 rounded-lg",children:e.jsx(pi,{size:15})})]}),e.jsxs("div",{className:"relative z-10 text-[18px] sm:text-[26px] font-semibold tracking-tight",children:[C,"%"]}),e.jsxs("div",{className:"relative z-10 border-t border-white/30 pt-1.5 sm:pt-2 flex justify-between items-center text-[9px] sm:text-[10px] opacity-90",children:[e.jsx("span",{className:"hidden sm:block",children:"Active participants"}),e.jsx("span",{className:"bg-black/15 px-[5px] sm:px-[7px] py-[2px] rounded font-semibold",children:Math.round(C/100*m)})]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#f97316] shadow-[0_4px_16px_rgba(249,115,22,0.13)] rounded-sm sm:rounded-lg p-[10px] sm:p-[15px] text-white flex flex-col gap-[6px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[9px] sm:text-[11px] opacity-90 leading-tight",children:"At risk"}),e.jsx("div",{className:"hidden sm:flex bg-white/20 p-1.5 rounded-lg",children:e.jsx(gr,{size:15})})]}),e.jsx("div",{className:"relative z-10 text-[18px] sm:text-[26px] font-semibold tracking-tight",children:p}),e.jsxs("div",{className:"relative z-10 border-t border-white/30 pt-1.5 sm:pt-2 flex justify-between items-center text-[9px] sm:text-[10px] opacity-90",children:[e.jsx("span",{className:"hidden sm:block",children:"Requires attention"}),e.jsxs("span",{className:"bg-black/15 px-[5px] sm:px-[7px] py-[2px] rounded font-semibold",children:[N,"%"]})]})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] border border-white p-[18px_20px] shadow-[0_1px_4px_rgba(0,0,0,0.04)]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-[14px]",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-[#1e293b]",children:"My classes"}),e.jsx("span",{onClick:r,className:"text-[12px] text-[#10b981] font-semibold cursor-pointer hover:underline",children:"View all"})]}),e.jsxs("div",{className:"space-y-[9px]",children:[t.length===0&&e.jsxs("div",{className:"text-center py-4",children:[e.jsx("p",{className:"text-sm text-slate-500 mb-3",children:"No classes imported yet."}),b&&e.jsx("button",{onClick:b,className:"text-sm text-[#9956DE] font-semibold hover:underline",children:"+ Create a class"})]}),t.map((y,f)=>{const w=[{bg:"bg-[#f3e8ff]",text:"text-[#a855f7]",borderHover:"hover:border-[#d8b4fe]",stripe:"bg-[#a855f7]"},{bg:"bg-[#eff6ff]",text:"text-[#3b82f6]",borderHover:"hover:border-[#bfdbfe]",stripe:"bg-[#3b82f6]"},{bg:"bg-[#f0fdf4]",text:"text-[#22c55e]",borderHover:"hover:border-[#bbf7d0]",stripe:"bg-[#22c55e]"},{bg:"bg-[#fff7ed]",text:"text-[#f97316]",borderHover:"hover:border-[#fed7aa]",stripe:"bg-[#f97316]"},{bg:"bg-[#fff1f2]",text:"text-[#f43f5e]",borderHover:"hover:border-[#fecdd3]",stripe:"bg-[#f43f5e]"}],I=w[f%w.length];return e.jsxs("div",{onClick:()=>a(y),className:`relative overflow-hidden flex items-center gap-3 p-[12px_13px] pl-[16px] border border-[#f1f5f9] rounded-[14px] cursor-pointer ${I.borderHover} hover:shadow-[0_2px_10px_rgba(0,0,0,0.04)] hover:bg-[#fafbff] transition-all group`,children:[e.jsx("div",{className:`absolute left-0 top-0 bottom-0 w-[5px] ${I.stripe}`}),e.jsx("div",{className:`w-[38px] h-[38px] rounded-[10px] flex items-center justify-center flex-shrink-0 text-[17px] ${I.bg} ${I.text} group-hover:scale-110 transition-transform duration-300`,children:e.jsx(Wt,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[12.5px] font-medium text-[#1e293b]",children:y.name}),e.jsx("div",{className:"text-[11px] text-[#94a3b8] mt-[1px]",children:y.classification||"High School"})]}),e.jsx("div",{className:"hidden sm:block text-[12px] text-[#64748b] min-w-[65px]",children:y.schedule||"Mon-Fri"}),e.jsxs("div",{className:"hidden sm:block text-[12px] text-[#64748b] min-w-[85px]",children:[y.studentCount," students"]}),e.jsx("span",{className:`text-[10px] font-semibold px-[9px] py-[3px] rounded-[6px] ${y.riskLevel==="high"?"bg-[#fee2e2] text-[#b91c1c] border border-[#fca5a5]":y.riskLevel==="medium"?"bg-[#fffbeb] text-[#b45309] border border-[#fcd34d]":"bg-[#ecfdf5] text-[#065f46] border border-[#6ee7b7]"}`,children:y.riskLevel==="high"?"High risk":y.riskLevel==="medium"?"Medium risk":"On track"}),e.jsx(Wr,{size:16,className:"text-[#cbd5e1] ml-auto hover:text-[#64748b]"})]},y.id)})]})]})]})},Vx=me.memo(({student:t,onViewStudent:s,onCreateAccount:a,onRemoveStudent:r})=>{const n=t.riskLevel==="high"?{borderLeft:"border-l-rose-500",bgAvatar:"bg-rose-50 text-rose-600 border-rose-100/50",badge:"text-rose-600 bg-rose-50",progress:"bg-rose-500"}:t.riskLevel==="medium"?{borderLeft:"border-l-amber-500",bgAvatar:"bg-amber-50 text-amber-600 border-amber-100/50",badge:"text-amber-600 bg-amber-50",progress:"bg-amber-500"}:{borderLeft:"border-l-emerald-500",bgAvatar:"bg-emerald-50 text-emerald-600 border-emerald-100/50",badge:"text-emerald-600 bg-emerald-50",progress:"bg-emerald-500"},i=t.hasRegisteredAccount===!1&&t.source==="import",l=t.hasRegisteredAccount===!0;return e.jsxs("div",{onClick:()=>s(t),className:`p-[12px] bg-white rounded-[14px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#f1f5f9] border-l-[4px] ${n.borderLeft} hover:scale-[1.02] transition-transform cursor-pointer group flex flex-col justify-between`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-[10px]",children:[e.jsxs("div",{className:"flex gap-[8px] items-center min-w-0 pr-2",children:[t.avatar?e.jsx("img",{src:t.avatar,alt:t.name,className:`w-8 h-8 rounded-full border ${n.bgAvatar.split(" ")[2]} object-cover shrink-0`}):e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center font-semibold text-[11px] shrink-0 border ${n.bgAvatar}`,children:t.name.substring(0,2).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("p",{className:"text-[13px] font-semibold text-[#1e293b] leading-tight truncate",children:t.name}),l&&e.jsx("span",{title:"Registered student account",className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0"})]}),e.jsxs("p",{className:"text-[10px] text-[#64748b] flex items-center gap-[4px] mt-0.5 truncate",children:[e.jsx(Ts,{className:"w-[10px] h-[10px] shrink-0"})," ",t.lastActive||"recently"]})]})]}),e.jsxs("span",{className:`font-semibold text-[11px] px-[6px] py-[2px] rounded-[14px] shrink-0 ${n.badge}`,children:[t.avgScore,"%"]}),r&&e.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),r(t)},className:"opacity-0 group-hover:opacity-100 transition-opacity text-slate-400 hover:text-red-500 p-1 rounded shrink-0","aria-label":`Remove ${t.name} from class`,title:"Remove from class",children:e.jsx(Xt,{size:14})})]}),i&&e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 px-2 py-1 rounded-[10px] bg-amber-50 border border-amber-100/80",children:[e.jsx("span",{className:"text-[10px] font-semibold text-amber-700 uppercase tracking-wider",children:"No Account"}),a&&e.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),a(t)},className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-white text-amber-700 border border-amber-200 hover:bg-amber-100 text-[10px] font-semibold transition-colors","aria-label":`Create system account for ${t.name}`,children:[e.jsx("span",{"aria-hidden":!0,children:"+"}),"Create"]})]}),e.jsx("div",{className:"w-full bg-[#f1f5f9] h-1.5 rounded-full overflow-hidden mt-auto",children:e.jsx("div",{className:`h-full rounded-full ${n.progress}`,style:{width:`${t.avgScore}%`}})})]})}),Wx=({students:t,allClasses:s,currentClass:a,onReassignSection:r,reassignBusyId:o})=>{const[n,i]=u.useState(!1),l=u.useMemo(()=>{const d=new Map;return s.forEach(m=>{const p=(m.classSectionId||m.id||"").trim();if(!p)return;const h=(m.classMetadata?.grade||"").trim(),b=(m.classMetadata?.section||"").trim();if(!h||!b)return;const N=m.name||`${h} - ${b}`;d.set(p,{classSectionId:p,grade:h,section:b,label:N})}),Array.from(d.values()).sort((m,p)=>m.label.localeCompare(p.label))},[s]),c=u.useMemo(()=>{const d=new Map,m=[];return t.forEach(p=>{const h=(p.classSectionId||"").trim();if(!h){m.push(p);return}const b=p.section||p.className||h,N=d.get(h)||{label:b,students:[]};N.students=[...N.students,p],d.set(h,N)}),{assigned:Array.from(d.entries()).map(([p,h])=>({sectionId:p,...h})).sort((p,h)=>p.label.localeCompare(h.label)),unassigned:m}},[t]);return e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] border border-white shadow-[0_1px_4px_rgba(0,0,0,0.04)] overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>i(d=>!d),className:"w-full flex items-center justify-between px-6 py-4 text-left","aria-expanded":n,children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[15px] font-semibold text-[#1e293b]",children:"Section Management"}),e.jsxs("p",{className:"text-[12px] text-[#64748b] mt-0.5",children:["Move students between sections. Showing ",t.length," students across ",c.assigned.length," section",c.assigned.length===1?"":"s",c.unassigned.length>0?` · ${c.unassigned.length} unassigned`:"","."]})]}),e.jsx(zt,{className:`w-4 h-4 text-[#64748b] transition-transform ${n?"rotate-180":""}`})]}),n&&e.jsxs("div",{className:"border-t border-[#f1f5f9] divide-y divide-[#f1f5f9]",children:[c.assigned.length===0&&c.unassigned.length===0&&e.jsx("p",{className:"text-[12px] text-[#64748b] px-6 py-5",children:"No students yet. Add students to this teacher to manage section assignments."}),c.assigned.map(d=>e.jsxs("div",{className:"px-6 py-4",children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-[#64748b] mb-2",children:[d.label," ",e.jsxs("span",{className:"text-[10px] font-normal text-[#94a3b8]",children:["(",d.students.length,")"]})]}),e.jsx("div",{className:"space-y-1.5",children:d.students.map(m=>e.jsx(ri,{student:m,sectionTargets:l,currentSectionId:a.classSectionId,onReassign:r,isBusy:o===m.id},`section-row-${m.id}`))})]},d.sectionId)),c.unassigned.length>0&&e.jsxs("div",{className:"px-6 py-4 bg-amber-50/40",children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-amber-700 mb-2",children:["Unassigned ",e.jsxs("span",{className:"text-[10px] font-normal text-amber-600/80",children:["(",c.unassigned.length,")"]})]}),e.jsx("div",{className:"space-y-1.5",children:c.unassigned.map(d=>e.jsx(ri,{student:d,sectionTargets:l,currentSectionId:a.classSectionId,onReassign:r,isBusy:o===d.id},`section-row-${d.id}`))})]})]})]})},ri=({student:t,sectionTargets:s,currentSectionId:a,onReassign:r,isBusy:o})=>{const[n,i]=u.useState(t.classSectionId||"");u.useEffect(()=>{i(t.classSectionId||"")},[t.classSectionId]);const l=()=>{const d=s.find(m=>m.classSectionId===n);d&&d.classSectionId!==t.classSectionId&&r(t,d)},c=n===(t.classSectionId||"");return e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-2 md:gap-3 px-3 py-2 rounded-[12px] bg-white border border-[#f1f5f9]",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[13px] font-semibold text-[#1e293b] truncate",children:t.name}),e.jsxs("p",{className:"text-[11px] text-[#64748b] truncate",children:[t.lrn?`LRN ${t.lrn} · `:"",t.classMetadata?.className||t.className||"Unassigned section",a&&t.classSectionId===a?" · current":""]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:n,onChange:d=>i(d.target.value),disabled:o||s.length===0,className:"text-[12px] rounded-xl border border-[#dde3eb] bg-white px-3 py-1.5 text-[#0a1628] focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:opacity-60",children:[e.jsx("option",{value:"",children:"Select section…"}),s.map(d=>e.jsx("option",{value:d.classSectionId,children:d.label},d.classSectionId))]}),e.jsx("button",{type:"button",onClick:l,disabled:o||c||!n,className:"text-[12px] font-semibold rounded-xl px-3 py-1.5 bg-indigo-600 text-white hover:bg-indigo-700 transition-colors disabled:opacity-50 disabled:hover:bg-indigo-600",children:o?"Saving…":"Move"})]})]})},qx=({selectedClass:t,students:s,allClasses:a,riskDistribution:r,topicPerformance:o,onViewStudent:n,onCreateAccount:i,onReassignSection:l,reassignBusyId:c,onBack:d,teacherOptions:m,managerUpdating:p,onAssignManager:h,onOpenNotifications:b,onOpenProfile:N,classColor:C,insightDismissed:y,onOpenInsightModal:f,onAddStudents:w,onRemoveStudent:I})=>{const{currentUser:D,userProfile:M}=hs(),[q,g]=u.useState(""),[S,v]=u.useState(""),[L,E]=u.useState("All"),[j,Q]=u.useState(null),[K,ae]=u.useState(!0),[ne,re]=u.useState(!1),[he,Ne]=u.useState(!0);u.useEffect(()=>{let k=!1;return ae(!0),Eo(t.id).then(O=>{k||Q(O)}).catch(O=>console.warn("[AnalyticsView] Backend fetch failed, using local data:",O)).finally(()=>{k||ae(!1)}),()=>{k=!0}},[t.id]),u.useEffect(()=>{let k,O;return(async()=>{try{const{collection:T,onSnapshot:B}=await Gs(async()=>{const{collection:le,onSnapshot:xe}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{collection:le,onSnapshot:xe}},__vite__mapDeps([2,3])),{db:G}=await Gs(async()=>{const{db:le}=await import("./index-Cvals0ud.js").then(xe=>xe.b6);return{db:le}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),A=T(G,"classes",t.id,"student_summaries");let J=!0;k=B(A,()=>{if(J){J=!1;return}O&&clearTimeout(O),O=setTimeout(()=>{Eo(t.id).then(Q).catch(()=>{})},2e3)})}catch{}})(),()=>{k?.(),O&&clearTimeout(O)}},[t.id]);const de=j?.class_average??(()=>{if(t.avgScore>0)return t.avgScore;if(s.length===0)return 0;const k=s.map(O=>O.avgScore).filter(O=>O>0);return k.length>0?Math.round(k.reduce((O,T)=>O+T,0)/k.length):0})(),ue=j?.completion_rate??(()=>{if(s.length===0)return 0;const k=s.reduce((O,T)=>O+(T.assignmentCompletion||0),0);return Math.round(k/s.length)})(),H=j?.participation_rate??(()=>{if(s.length===0)return 0;const k=s.reduce((T,B)=>T+(B.attendance||0),0)/s.length,O=s.reduce((T,B)=>T+(B.engagementScore||0),0)/s.length;return Math.round(k*.6+O*.4)})(),Z=j?.insights?.risk_distribution?[{name:"Critical",value:j.insights.risk_distribution.Critical||0,color:"#dc2626"},{name:"High Risk",value:j.insights.risk_distribution["High Risk"]||0,color:"#f43f5e"},{name:"Medium Risk",value:j.insights.risk_distribution["Medium Risk"]||0,color:"#f59e0b"},{name:"Low Risk",value:j.insights.risk_distribution["Low Risk"]||0,color:"#10b981"},{name:"Unassessed",value:j.insights.risk_distribution.Unassessed||0,color:"#94a3b8"}].filter(k=>k.value>0):[{name:"High Risk",value:s.filter(k=>k.riskLevel==="high").length,color:"#FF8B8B"},{name:"Medium Risk",value:s.filter(k=>k.riskLevel==="medium").length,color:"#F08386"},{name:"Low Risk",value:s.filter(k=>k.riskLevel==="low").length,color:"#75D06A"}];u.useEffect(()=>{v(t.classMetadata?.managerId||t.managerId||"")},[t]);const se=u.useMemo(()=>{const k=q.trim().toLowerCase();let O=s;if(k&&(O=O.filter(T=>T.name.toLowerCase().includes(k)||(T.lrn||"").toLowerCase().includes(k)||(T.weakestTopic||"").toLowerCase().includes(k))),L==="Good")if(j){const T=new Set(j.students.filter(B=>B.quiz_attempt_count>0&&B.avg_score>=75).map(B=>B.student_id));O=O.filter(B=>T.has(B.id))}else O=O.filter(T=>T.avgScore>=85&&T.riskLevel!=="high");else if(L==="Risk")if(j){const T=new Set(j.students.filter(B=>["High Risk","Critical","Unassessed"].includes(B.risk_level)).map(B=>B.student_id));O=O.filter(B=>T.has(B.id))}else O=O.filter(T=>T.riskLevel==="high"||T.avgScore<75);return O},[q,s,L,j]),Re=u.useMemo(()=>j?j.students.filter(k=>k.quiz_attempt_count>0).sort((k,O)=>O.avg_score-k.avg_score).slice(0,5).map(k=>{const O=s.find(T=>T.id===k.student_id);return O?{...O,avgScore:k.avg_score}:null}).filter(Boolean):[...s].sort((k,O)=>O.avgScore-k.avgScore).slice(0,5),[s,j]),$e=u.useMemo(()=>j?j.students.filter(k=>["High Risk","Critical"].includes(k.risk_level)).sort((k,O)=>k.avg_score-O.avg_score).map(k=>{const O=s.find(T=>T.id===k.student_id);return O?{...O,avgScore:k.avg_score,_backendRisk:k.risk_level}:null}).filter(Boolean):[...s].filter(k=>k.riskLevel==="high"||k.avgScore<70||k.assignmentCompletion<65),[s,j]),He=u.useMemo(()=>j?.insights?.topic_performance?.length?j.insights.topic_performance.map(k=>({topic:k.topic,score:k.class_accuracy})):o,[j,o]),U=k=>{if(!j)return null;const O=j.students.find(T=>T.student_id===k);return O?O.avg_score:null},te=k=>{if(!j)return null;const O=j.students.find(T=>T.student_id===k);return O?O.risk_level:null},_=async()=>{re(!0);try{const k=await Km(t.id);Q(O=>O&&{...O,insights:k})}catch(k){console.warn("[AnalyticsView] Refresh insights failed:",k?.message)}finally{re(!1)}};u.useMemo(()=>m.find(k=>k.uid===S),[m,S]);const V=[t.classMetadata?.gradeLevel||t.gradeLevel,t.classMetadata?.classification||t.classification,t.classMetadata?.strand||t.strand].filter(Boolean);return e.jsxs(Ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-3 sm:p-[24px] xl:p-[32px] space-y-3 sm:space-y-[24px] h-full overflow-y-auto",children:[e.jsx("div",{className:"flex items-center justify-between mb-3 sm:mb-6",children:e.jsxs("button",{onClick:d,className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors bg-white/60 hover:bg-white/80 px-[18px] py-2 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50",children:[e.jsx(Es,{className:"w-4 h-4"}),"Back to Classes"]})}),e.jsxs("header",{style:{backgroundColor:C?.hex||"#6366f1"},className:"rounded-[24px] p-4 sm:p-[24px] lg:p-[32px] shadow-[0_8px_32px_rgba(0,0,0,0.08)] flex flex-col lg:flex-row lg:items-center justify-between gap-4 sm:gap-6 relative overflow-hidden group text-white",children:[e.jsx("div",{className:"absolute -right-10 -bottom-10 w-48 h-48 rounded-full bg-white/10 group-hover:scale-[1.3] transition-transform duration-700 ease-out pointer-events-none"}),e.jsx("div",{className:"absolute -left-10 -top-10 w-32 h-32 rounded-full bg-white/10 group-hover:scale-[1.2] transition-transform duration-700 delay-75 ease-out pointer-events-none"}),e.jsxs("div",{className:"shrink-0 relative z-10",children:[e.jsx("h1",{className:"text-xl sm:text-[28px] font-bold mb-2 sm:mb-3 tracking-tight",children:t.name}),e.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:V.map((k,O)=>e.jsx("span",{className:"px-3 py-1 bg-white/20 backdrop-blur-md text-white text-[12px] font-semibold rounded-full shadow-sm border border-white/20",children:k},k))}),e.jsxs("p",{className:"text-[13px] text-white/80 font-medium",children:["Manager: ",t.classMetadata?.managerName||t.managerName||"Not assigned"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-[18px] w-full",children:[e.jsxs("div",{className:"group relative overflow-hidden bg-[#0ea5e9] shadow-[0_4px_16px_rgba(14,165,233,0.13)] rounded-lg sm:rounded-2xl p-[12px] sm:p-[15px] text-white flex flex-col gap-[8px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] opacity-90 uppercase tracking-wider font-semibold",children:"Class Average"}),e.jsx("div",{className:"bg-white/20 p-1.5 rounded-lg flex",children:e.jsx(xs,{size:14})})]}),e.jsxs("div",{className:"relative z-10 text-[22px] sm:text-[26px] font-semibold tracking-tight",children:[Math.round(de),"%"]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#10b981] shadow-[0_4px_16px_rgba(16,185,129,0.13)] rounded-lg sm:rounded-2xl p-[12px] sm:p-[15px] text-white flex flex-col gap-[8px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] opacity-90 uppercase tracking-wider font-semibold",children:"Completion"}),e.jsx("div",{className:"bg-white/20 p-1.5 rounded-lg flex",children:e.jsx(Aa,{size:14})})]}),e.jsxs("div",{className:"relative z-10 text-[22px] sm:text-[26px] font-semibold tracking-tight",children:[Math.round(ue),"%"]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#a855f7] shadow-[0_4px_16px_rgba(168,85,247,0.13)] rounded-lg sm:rounded-2xl p-[12px] sm:p-[15px] text-white flex flex-col gap-[8px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] opacity-90 uppercase tracking-wider font-semibold",children:"Participation"}),e.jsx("div",{className:"bg-white/20 p-1.5 rounded-lg flex",children:e.jsx(us,{size:14})})]}),e.jsxs("div",{className:"relative z-10 text-[22px] sm:text-[26px] font-semibold tracking-tight",children:[Math.round(H),"%"]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#f97316] shadow-[0_4px_16px_rgba(249,115,22,0.13)] rounded-lg sm:rounded-2xl p-[12px] sm:p-[15px] text-white flex flex-col gap-[8px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] opacity-90 uppercase tracking-wider font-semibold",children:"Attention"}),e.jsx("div",{className:"bg-white/20 p-1.5 rounded-lg flex",children:e.jsx(oa,{size:14})})]}),e.jsxs("div",{className:"relative z-10 text-[22px] sm:text-[26px] font-semibold tracking-tight",children:[$e.length," ",e.jsx("span",{className:"text-[12px] opacity-90 font-medium",children:"students"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-3 sm:gap-[24px] h-auto xl:h-[600px]",children:[e.jsxs("div",{className:"xl:col-span-1 bg-white/80 backdrop-blur-[12px] rounded-[18px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white flex flex-col overflow-hidden h-[500px] xl:h-full",children:[e.jsxs("div",{className:"p-5 border-b border-[#f1f5f9] shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-[15px] font-semibold text-[#1e293b]",children:["Students ",e.jsxs("span",{className:"text-[#64748b] text-[13px]",children:["(",se.length,")"]})]}),e.jsx("button",{onClick:()=>w?.(),className:"text-[11px] font-semibold text-[#9956DE] hover:text-[#7c3aed] bg-[#9956DE]/10 hover:bg-[#9956DE]/20 px-3 py-1.5 rounded-lg transition-colors",children:"+ Add"})]}),e.jsxs("div",{className:"flex items-center bg-white px-4 py-2 rounded-[14px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#f1f5f9] group",children:[e.jsx(Vs,{className:"w-4 h-4 text-[#64748b] shrink-0 group-focus-within:text-[#4f46e5] transition-colors"}),e.jsx("input",{type:"text",placeholder:"Search students...",value:q,onChange:k=>g(k.target.value),className:"bg-transparent border-none focus:outline-none ml-2 text-[13px] w-full text-[#475569] placeholder:text-[#64748b]"})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-4 overflow-x-auto no-scrollbar pb-1",children:[e.jsx("button",{onClick:()=>E("All"),className:`px-3 py-1.5 text-[11px] font-semibold rounded-[14px] whitespace-nowrap transition-all hover:scale-[1.02] ${L==="All"?"bg-[#4f46e5] text-white shadow-[0_1px_4px_rgba(0,0,0,0.04)]":"bg-[#f8fafc] text-[#64748b] hover:bg-[#f1f5f9]"}`,children:"All Students"}),e.jsx("button",{onClick:()=>E("Good"),className:`px-3 py-1.5 text-[11px] font-semibold rounded-[14px] whitespace-nowrap transition-all hover:scale-[1.02] ${L==="Good"?"bg-emerald-50 text-emerald-600 border border-emerald-100/50 shadow-[0_1px_4px_rgba(0,0,0,0.04)]":"bg-emerald-50/40 text-emerald-600 border border-emerald-50 hover:bg-emerald-50"}`,children:"Top Performers"}),e.jsx("button",{onClick:()=>E("Risk"),className:`px-3 py-1.5 text-[11px] font-semibold rounded-[14px] whitespace-nowrap transition-all hover:scale-[1.02] ${L==="Risk"?"bg-rose-50 text-rose-600 border border-rose-100/50 shadow-[0_1px_4px_rgba(0,0,0,0.04)]":"bg-rose-50/40 text-rose-600 border border-rose-50 hover:bg-rose-50"}`,children:"Needs Attention"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-4 flex flex-col no-scrollbar",children:e.jsx(fm,{style:{height:"100%"},data:se,className:"no-scrollbar",itemContent:(k,O)=>{const T=U(O.id),B=T!==null?{...O,avgScore:T}:O;return e.jsx("div",{className:"py-[6px] px-[8px]",children:e.jsx(Vx,{student:B,onViewStudent:n,onCreateAccount:i,onRemoveStudent:I})})},computeItemKey:(k,O)=>rn(O)})})]}),e.jsxs("div",{className:"xl:col-span-2 flex flex-col gap-[24px] h-full overflow-y-auto no-scrollbar pb-10 xl:pb-0",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-[24px]",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white flex flex-col group h-[280px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"font-semibold text-[15px] text-[#1e293b]",children:"Risk Distribution"}),e.jsx(Wr,{className:"w-4 h-4 text-[#64748b] cursor-pointer group-hover:scale-110 transition-transform"})]}),e.jsx("div",{className:"relative w-full flex-1 min-h-[180px]",children:e.jsx(Qn,{width:"100%",height:"100%",children:e.jsxs(Vn,{data:Z,children:[e.jsx(Wn,{strokeDasharray:"4 4",stroke:"#f1f5f9",vertical:!1}),e.jsx(qn,{dataKey:"name",axisLine:{stroke:"#cbd5e1",strokeWidth:2},tickLine:!1,tick:{fill:"#475569",fontSize:11,fontWeight:600},dy:10}),e.jsx(Yn,{axisLine:!1,tickLine:!1,tick:{fill:"#64748b",fontSize:10,fontWeight:600}}),e.jsx(Kn,{cursor:{fill:"#f8fafc"},contentStyle:{borderRadius:"12px",border:"none",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}}),e.jsx(Xn,{dataKey:"value",radius:[6,6,0,0],barSize:80,children:Z.map((k,O)=>{const T={Critical:"#dc2626","High Risk":"#f43f5e","Medium Risk":"#f59e0b","Low Risk":"#10b981",Unassessed:"#94a3b8"};return e.jsx(Jn,{fill:T[k.name]||k.color},`cell-${O}`)})})]})})})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white flex flex-col group h-[280px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"font-semibold text-[15px] text-[#1e293b]",children:"Topic Performance"}),e.jsx(Wr,{className:"w-4 h-4 text-[#64748b] cursor-pointer group-hover:scale-110 transition-transform"})]}),e.jsx("div",{className:"relative w-full flex-1 min-h-[180px] -ml-8",children:e.jsx(Qn,{width:"100%",height:"100%",children:e.jsxs(Vn,{data:He,layout:"vertical",margin:{top:0,right:10,left:40,bottom:0},children:[e.jsx(Wn,{strokeDasharray:"4 4",stroke:"#f1f5f9",horizontal:!1}),e.jsx(qn,{type:"number",domain:[0,100],axisLine:!1,tickLine:!1,tick:{fill:"#64748b",fontSize:10,fontWeight:600},tickFormatter:k=>`${k}%`}),e.jsx(Yn,{dataKey:"topic",type:"category",axisLine:{stroke:"#cbd5e1",strokeWidth:2},tickLine:!1,tick:{fill:"#1e293b",fontSize:11,fontWeight:600},dx:-10}),e.jsx(Kn,{cursor:{fill:"#f8fafc"},contentStyle:{borderRadius:"12px",border:"none",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}}),e.jsx(Xn,{dataKey:"score",radius:[0,6,6,0],barSize:28,children:He.map((k,O)=>{const T=k.score>=75?"#10b981":k.score>=60?"#f59e0b":"#f43f5e";return e.jsx(Jn,{fill:T},`cell-${O}`)})})]})})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-[24px]",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("h3",{className:"font-semibold text-[15px] text-[#1e293b] flex items-center gap-2",children:[e.jsx(na,{className:"w-4 h-4 text-emerald-500"}),"Top Performers"]})}),e.jsxs("div",{className:"space-y-[8px]",children:[Re.map(k=>e.jsxs("div",{onClick:()=>n(k),className:"flex justify-between items-center p-3 bg-emerald-50/40 rounded-[14px] border border-emerald-50 group hover:scale-[1.02] transition-transform cursor-pointer",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[#1e293b]",children:k.name}),e.jsxs("span",{className:"text-[13px] font-semibold text-emerald-600",children:[U(k.id)??k.avgScore,"%"]})]},`top-${k.id}`)),Re.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No students available yet."})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("h3",{className:"font-semibold text-[15px] text-[#1e293b] flex items-center gap-2",children:[e.jsx(oa,{className:"w-4 h-4 text-rose-500"}),"Needs Attention"]})}),e.jsxs("div",{className:"space-y-[8px]",children:[$e.slice(0,4).map(k=>{const O=te(k.id),T=O||(k.riskLevel==="high"?"HIGH RISK":"MEDIUM RISK"),B=O==="Critical"||k.avgScore===0&&k.riskLevel==="high",G=O==="High Risk"||k.riskLevel==="high",A=B?"bg-red-50/60 border-red-100":G?"bg-rose-50/40 border-rose-50":"bg-amber-50/40 border-amber-50",J=B?"text-red-700":G?"text-rose-600":"text-amber-600";return e.jsxs("div",{onClick:()=>n(k),className:`flex justify-between items-center p-3 rounded-[14px] border group hover:scale-[1.02] transition-transform cursor-pointer ${A}`,children:[e.jsx("span",{className:"text-[13px] font-semibold text-[#1e293b]",children:k.name}),e.jsx("span",{className:`text-[11px] font-semibold bg-white px-2 py-0.5 rounded-[14px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#f1f5f9] ${J}`,children:T.toUpperCase()})]},`attn-${k.id}`)}),$e.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No urgent students."})]})]})]})]})]}),j?.insights&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50/80 to-purple-50/60 backdrop-blur-[12px] rounded-[18px] p-5 sm:p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-indigo-100/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("button",{onClick:()=>Ne(!he),className:"flex items-center gap-2 text-[15px] font-semibold text-[#1e293b]",children:[e.jsx(Rs,{className:"w-4 h-4 text-indigo-500"}),"AI Class Insights",e.jsx(zt,{className:`w-4 h-4 text-[#64748b] transition-transform ${he?"":"-rotate-90"}`})]}),e.jsxs("button",{onClick:_,disabled:ne,className:"flex items-center gap-1.5 text-[11px] font-semibold text-indigo-600 hover:text-indigo-700 bg-white/70 hover:bg-white px-3 py-1.5 rounded-lg transition-colors disabled:opacity-50",children:[e.jsx(ds,{className:`w-3 h-3 ${ne?"animate-spin":""}`}),ne?"Refreshing...":"Refresh AI Analysis"]})]}),he&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-white/70 rounded-[14px] p-4 border border-white",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(_s,{size:18,className:"text-indigo-600"}),e.jsx("h4",{className:"text-[13px] font-semibold text-[#1e293b]",children:"Class Overview"})]}),e.jsx("p",{className:"text-[12px] text-[#475569] leading-relaxed",children:j.insights.class_summary})]}),e.jsxs("div",{className:"bg-white/70 rounded-[14px] p-4 border border-white",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(na,{size:18,className:"text-emerald-600"}),e.jsx("h4",{className:"text-[13px] font-semibold text-[#1e293b]",children:"What's Working"})]}),e.jsx("p",{className:"text-[12px] text-[#475569] leading-relaxed",children:j.insights.class_strengths})]}),e.jsxs("div",{className:"bg-white/70 rounded-[14px] p-4 border border-white",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(xs,{size:18,className:"text-amber-600"}),e.jsx("h4",{className:"text-[13px] font-semibold text-[#1e293b]",children:"Recommended Actions"})]}),e.jsx("ul",{className:"space-y-1.5",children:j.insights.recommended_actions.map((k,O)=>e.jsxs("li",{className:"text-[12px] text-[#475569] leading-relaxed flex items-start gap-1.5",children:[e.jsx("span",{className:"text-indigo-500 mt-0.5 shrink-0",children:"•"}),k]},O))})]})]})]}),e.jsx(Wx,{students:s,allClasses:a,currentClass:t,onReassignSection:l,reassignBusyId:c})]})},Yx=({student:t,teacherId:s,teacherName:a,onStudentUpdated:r,onBack:o,onNavigateToQuizMaker:n,initialCache:i,onCacheUpdate:l})=>{const c=(t.riskLevel||"low").toLowerCase(),d=c==="high"||c==="medium",m=u.useMemo(()=>mt.getImportGroundedRolloutFlags(),[]),[p,h]=u.useState(null),[b,N]=u.useState(!0),[C,y]=u.useState(null),[f,w]=u.useState(i?.learningPath||""),[I,D]=u.useState(!0),[M,q]=u.useState(i?.gradeDraft||t.grade||"Grade 11"),[g,S]=u.useState(i?.sectionDraft||t.section||"Section A"),[v,L]=u.useState(!1),[E,j]=u.useState(i?.lessonPlan??null),[Q,K]=u.useState([]),[ae,ne]=u.useState(""),[re,he]=u.useState(!1),[Ne,de]=u.useState(""),[ue,H]=u.useState("all"),[Z,se]=u.useState("all"),[Re,$e]=u.useState(!1),[He,U]=u.useState(!1),[te,_]=u.useState(null),[V,k]=u.useState(!1),[O,T]=u.useState(!1),[B,G]=u.useState(0),[A,J]=u.useState(!1),[le,xe]=u.useState("choose"),[ce,Fe]=u.useState([]),[Te,tt]=u.useState(!1),[Oe,Ye]=u.useState(!1),[ht,wt]=u.useState(!1),[lt,Nt]=u.useState(!1);u.useEffect(()=>{q(t.grade||"Grade 11"),S(t.section||"Section A")},[t.grade,t.section]),u.useEffect(()=>{let z=!1;return N(!0),tn(t.id).then(fe=>{z||h(fe)}).catch(fe=>console.warn("[InterventionView] Backend fetch failed:",fe)).finally(()=>{z||N(!1)}),()=>{z=!0}},[t.id]),u.useEffect(()=>{const z=fe=>{if(fe.key==="Escape"){if(lt){Nt(!1);return}if(Oe){ht?Nt(!0):Ye(!1);return}A&&J(!1)}};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[Oe,A,ht,lt]),u.useEffect(()=>{if(Oe){const z=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=z}}},[Oe]),u.useEffect(()=>{l?.(t.id,{lessonPlan:E,learningPath:f,gradeDraft:M,sectionDraft:g})},[E,f,M,g,t.id,l]),u.useEffect(()=>{(async()=>{D(!0);try{let fe="";try{fe=await Hl(t.struggles.length>0?t.struggles:[t.weakestTopic],"general_math"),ne(fe)}catch{ne("")}const Xe=await mt.getLearningPath({weaknesses:t.struggles.length>0?t.struggles:[t.weakestTopic],gradeLevel:"High School",subject:"general_math"}),ke=fe?`${Xe.learningPath} - -${fe}`:Xe.learningPath;w(ke)}catch{w("Unable to generate learning path. Please try again later."),ne("")}finally{D(!1)}})()},[t]);const $t=u.useCallback(async()=>{he(!0),de("");try{const z=t.classSectionId||Ut(M||"Grade 11",g||"Section A"),fe=t.struggles.length>0?t.struggles[0]:t.weakestTopic,Xe=await au({gradeLevel:M||t.grade||"Grade 11",subject:"general_math",quarter:1,moduleUnit:[M,g].filter(Boolean).join(" - ")||t.className,lessonTitle:`Grounded Lesson: ${fe}`,learningCompetency:fe,learnerLevel:t.avgScore<60?"support":t.avgScore<80?"developing":"advanced",classSectionId:z,className:[M,g].filter(Boolean).join(" - ")||t.className,focusTopics:t.struggles.length>0?t.struggles:[t.weakestTopic],topicCount:5,preferImportedTopics:m.lessonEnabled,allowReviewSources:Re,allowUnverifiedLesson:He},!0);j(Xe),K(Xe.curriculumSources||[]),_(null),mt.reportImportGroundedFeedback({flow:"lesson",status:"success",classSectionId:z,className:[M,g].filter(Boolean).join(" - ")||t.className,metadata:{usedImportedTopics:Xe.usedImportedTopics,importedTopicCount:Xe.importedTopicCount,blockCount:Xe.blocks.length,publishReady:Xe.publishReady,sourceLegitimacyStatus:Xe.sourceLegitimacy.status,selfValidationPassed:Xe.selfValidation.passed,importGroundingEnabled:m.lessonEnabled}})}catch(z){let fe=z instanceof Error?z.message:"Unable to generate lesson plan at this time.";if(z instanceof ar&&z.status===422)try{const ke=JSON.parse(z.responseBody)?.detail;ke?.message&&(fe=ke.message);const Ce=ke?.sourceLegitimacy?.issues||[],Le=ke?.selfValidation?.issues||[],yt=[...Ce,...Le].filter(Boolean).slice(0,3);yt.length>0&&(fe=`${fe} ${yt.join(" ")}`)}catch{}de(fe),j(null),K([]),mt.reportImportGroundedFeedback({flow:"lesson",status:"failed",classSectionId:t.classSectionId||Ut(M||"Grade 11",g||"Section A"),className:[M,g].filter(Boolean).join(" - ")||t.className,metadata:{error:fe,allowReviewSources:Re,allowUnverifiedLesson:He,importGroundingEnabled:m.lessonEnabled}})}finally{he(!1)}},[t,M,g,m.lessonEnabled,Re,He]),Gt=u.useCallback(async()=>{if(!E)return oe.error("Generate a lesson plan first."),null;k(!0);try{const z=await tu(E,s,{teacherName:a,studentId:t.id,studentName:t.name});return _(z),oe.success("Lesson plan saved as draft."),z}catch(z){return console.error("Failed to save lesson draft:",z),oe.error(z instanceof Error?z.message:"Failed to save lesson draft."),null}finally{k(!1)}},[E,s,a,t.id,t.name]),Ss=u.useCallback(async()=>{if(!E){oe.error("Generate a lesson plan first.");return}if(!E.publishReady){const z=[...E.sourceLegitimacy.issues,...E.selfValidation.issues].filter(Boolean).slice(0,2).join(" ");oe.error(z||"Lesson is not publish-ready. Resolve legitimacy and validation checks first.");return}T(!0);try{let z=te;if(z||(z=await Gt()),!z)return;await su(z),oe.success("Lesson plan published to class content."),mt.reportImportGroundedFeedback({flow:"lesson",status:"success",classSectionId:E.classSectionId||t.classSectionId,className:E.className||t.className,metadata:{action:"publish_lesson_plan",lessonPlanId:z,publishReady:E.publishReady,sourceLegitimacyStatus:E.sourceLegitimacy.status,selfValidationPassed:E.selfValidation.passed}})}catch(z){console.error("Failed to publish lesson plan:",z),oe.error(z instanceof Error?z.message:"Failed to publish lesson plan."),mt.reportImportGroundedFeedback({flow:"lesson",status:"failed",classSectionId:E.classSectionId||t.classSectionId,className:E.className||t.className,metadata:{action:"publish_lesson_plan",error:z instanceof Error?z.message:"Failed to publish lesson plan."}})}finally{T(!1)}},[E,te,Gt,t.className,t.classSectionId]);u.useEffect(()=>{$t()},[B]),u.useEffect(()=>{G(z=>z+1)},[t.id]),u.useEffect(()=>{H("all"),se("all")},[E]),u.useMemo(()=>E?Array.from(new Set(E.blocks.map(z=>z.provenance?.sourceFile?.trim()).filter(z=>!!z))).sort((z,fe)=>z.localeCompare(fe)):[],[E]),u.useMemo(()=>E?Array.from(new Set(E.blocks.map(z=>z.provenance?.materialId?.trim()).filter(z=>!!z))).sort((z,fe)=>z.localeCompare(fe)):[],[E]);const $s=u.useMemo(()=>E?E.blocks.filter(z=>{const fe=ue==="all"||(z.provenance?.sourceFile||"").trim()===ue,Xe=Z==="all"||(z.provenance?.materialId||"").trim()===Z;return fe&&Xe}):[],[E,ue,Z]),Fs=u.useMemo(()=>p?.learning_path?.steps?.length?p.learning_path.steps.map(z=>({id:z.step_number,type:z.type==="video_lesson"?"video":z.type==="assessment"?"assessment":"quiz",title:z.title,duration:`${z.duration_minutes} mins`,questions:z.num_items||void 0,icon:z.type==="video_lesson"?ja:z.type==="assessment"?Na:z.type==="review"?ds:Vr,competency:z.competency_tag,difficulty:z.difficulty,is_completed:z.is_completed})):[{id:1,type:"video",title:`${t.weakestTopic} Fundamentals`,duration:"8 mins",questions:void 0,icon:ja,competency:"",difficulty:"easy",is_completed:!1},{id:2,type:"quiz",title:`${t.weakestTopic} Practice`,duration:"12 mins",questions:10,icon:Vr,competency:"",difficulty:"easy",is_completed:!1},{id:3,type:"assessment",title:"Final Check",duration:"10 mins",questions:5,icon:Na,competency:"",difficulty:"medium",is_completed:!1}],[p,t.weakestTopic]),is=async()=>{if(!s){oe.error("Unable to update section: teacher context missing");return}L(!0);try{await jr(t.id,M,g,s,new Date().getFullYear().toString(),a),await rl(t.id,M,g);const z={...t,grade:M,section:g,className:[M,g].filter(Boolean).join(" - "),classSectionId:Ut(M,g)};r(z),oe.success("Student section assignment updated")}catch(z){console.error("Failed to update student section assignment:",z),oe.error("Failed to update section assignment")}finally{L(!1)}};return e.jsxs(Ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full h-full flex overflow-hidden relative",children:[e.jsx("div",{className:"flex-1 overflow-y-auto p-[24px] xl:p-[32px] no-scrollbar",children:e.jsxs("div",{className:"max-w-[1000px] mx-auto space-y-[24px]",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-[8px]",children:e.jsx("div",{children:e.jsxs("button",{onClick:o,className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors bg-white/60 hover:bg-white/80 px-[18px] py-2 rounded-full backdrop-blur-[12px] mb-[16px] w-max shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50",children:[e.jsx(lr,{className:"w-4 h-4"}),"Back to Analytics"]})})}),e.jsxs("div",{className:"bg-gradient-to-br from-[#ecfdf5] via-[#f0fdf4] to-[#f7fdf9] backdrop-blur-[12px] rounded-[20px] p-[24px] border border-emerald-100 shadow-[0_4px_16px_rgba(16,185,129,0.08)] relative overflow-hidden",children:[e.jsx("div",{className:"absolute right-[-20px] bottom-[-20px] opacity-[0.06] pointer-events-none",children:e.jsx(Dn,{className:"w-48 h-48 text-emerald-600"})}),e.jsxs("div",{className:"flex items-center gap-3 mb-5 relative z-10",children:[e.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-[#059669] to-[#10b981] flex items-center justify-center shrink-0 shadow-[0_4px_10px_rgba(5,150,105,0.3)]",children:e.jsx(Dn,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#1e293b]",children:"AI Analysis"}),e.jsxs("span",{className:"flex items-center gap-1 px-2.5 py-0.5 bg-emerald-500 text-white text-[10px] font-bold rounded-full uppercase tracking-wider shadow-sm",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"}),"Insights Active"]})]})]}),ae&&e.jsx(Mo,{sources:Q,className:"mb-4 relative z-10"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 w-full relative z-10",children:[e.jsxs("div",{className:"bg-white/70 backdrop-blur-sm rounded-[14px] p-4 border border-emerald-100/60 shadow-[0_1px_4px_rgba(0,0,0,0.04)] relative overflow-hidden",children:[e.jsx("div",{className:"absolute left-0 top-0 w-1 h-full bg-emerald-400 rounded-l-[14px]"}),e.jsxs("h4",{className:"text-[11px] font-bold text-emerald-600 uppercase tracking-wider mb-2.5 flex items-center gap-1.5 pl-2",children:[e.jsx(na,{className:"w-3.5 h-3.5"})," Learning Strengths"]}),e.jsx("p",{className:"text-[13px] text-[#475569] leading-relaxed pl-2",children:p?.learning_strengths||(d?e.jsx(e.Fragment,{children:"Demonstrates engagement but faces challenges. Needs support with foundational topics."}):e.jsxs(e.Fragment,{children:["Excels in ",e.jsx("span",{className:"font-semibold text-[#1e293b]",children:t.weakestTopic}),". Demonstrates high engagement during interactive tests."]}))})]}),e.jsxs("div",{className:"bg-white/70 backdrop-blur-sm rounded-[14px] p-4 border border-rose-100/60 shadow-[0_1px_4px_rgba(0,0,0,0.04)] relative overflow-hidden",children:[e.jsx("div",{className:"absolute left-0 top-0 w-1 h-full bg-rose-400 rounded-l-[14px]"}),e.jsxs("h4",{className:"text-[11px] font-bold text-rose-500 uppercase tracking-wider mb-2.5 flex items-center gap-1.5 pl-2",children:[e.jsx(xs,{className:"w-3.5 h-3.5"})," Next Steps"]}),e.jsx("ul",{className:"text-[13px] text-[#475569] leading-relaxed list-none p-0 m-0 space-y-1 pl-2",children:p?.next_steps_summary?e.jsx("li",{children:p.next_steps_summary}):t.struggles.length>0?t.struggles.map((z,fe)=>e.jsxs("li",{children:["Must continue strengthening ",e.jsx("span",{className:"font-semibold text-[#1e293b]",children:z}),"."]},fe)):e.jsxs("li",{children:["Focus on repetitive practice modules for ",e.jsx("span",{className:"font-semibold text-[#1e293b]",children:t.weakestTopic}),"."]})})]})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6 border-b border-[#f1f5f9] pb-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-[#1e293b]",children:"Generated Learning Path"}),e.jsxs("button",{disabled:I||b,onClick:async()=>{N(!0);try{const z=await cl(t.id);h(z)}catch(z){console.warn("[InterventionView] Regenerate failed:",z)}finally{N(!1)}G(z=>z+1)},className:"bg-[#f8fafc] hover:bg-white text-[#4f46e5] border border-[#e0e7ff] text-[11px] font-semibold rounded-full px-4 py-1.5 transition-colors shadow-[0_1px_4px_rgba(0,0,0,0.02)] flex items-center gap-1.5 disabled:opacity-50",children:[e.jsx(ds,{className:`w-3 h-3 ${b?"animate-spin":""}`})," ",b?"Analyzing...":"Regenerate"]})]}),e.jsxs(To,{name:"teacher-intervention-learning-path",loading:!1,fixture:null,fallback:null,children:[e.jsxs("div",{className:"mb-8 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mr-2",children:"Methodology:"}),(p?.learning_path?.methodology_tags||["Interactive","Video","Practice","Quiz"]).map(z=>e.jsx("span",{className:"px-3 py-1 bg-[#f8fafc] text-[#475569] text-[11px] font-semibold rounded-full border border-[#e2e8f0]",children:z},z))]}),e.jsx("div",{className:"relative border-l-2 border-[#e2e8f0] ml-[20px] space-y-[28px] pb-4",children:Fs.map((z,fe)=>{let Xe=e.jsx(ja,{className:"w-4 h-4"}),ke="bg-[#8b5cf6] shadow-[0_4px_10px_rgba(139,92,246,0.3)]",Ce="text-purple-600",Le="group-hover:border-purple-200",yt="hover:bg-[#4f46e5]",nt=e.jsx(ac,{className:"w-4 h-4 ml-0.5"});return z.type==="quiz"?(Xe=e.jsx(or,{className:"w-4 h-4"}),ke="bg-sky-500 shadow-[0_4px_10px_rgba(14,165,233,0.3)]",Ce="text-sky-600",Le="group-hover:border-sky-200",yt="hover:bg-sky-500",nt=e.jsx(Is,{className:"w-4 h-4"})):z.type==="assessment"&&(Xe=e.jsx(Na,{className:"w-4 h-4"}),ke="bg-emerald-500 shadow-[0_4px_10px_rgba(16,185,129,0.3)]",Ce="text-emerald-600",Le="group-hover:bg-emerald-50"),e.jsxs(Ae.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:fe*.1},className:"relative pl-[32px] group",children:[e.jsx("div",{className:`absolute -left-[17px] top-1 w-8 h-8 rounded-full ${ke} text-white flex items-center justify-center ring-4 ring-white group-hover:scale-110 transition-transform`,children:Xe}),e.jsxs("div",{onClick:()=>{p?.learning_path?.steps?.[fe]&&y(p.learning_path.steps[fe])},className:`${z.type==="assessment"?"bg-emerald-50/50 border-emerald-100":"bg-white border-[#f1f5f9]"} rounded-[14px] p-[18px] border shadow-[0_1px_4px_rgba(0,0,0,0.04)] flex justify-between items-center transition-colors cursor-pointer ${Le}`,children:[e.jsxs("div",{children:[e.jsxs("span",{className:`text-[10px] font-semibold uppercase tracking-wider mb-1 block ${Ce}`,children:["Step ",fe+1," • ",z.type==="video"?"Video Lesson":z.type==="quiz"?"Practice":"Assessment"]}),e.jsx("p",{className:"font-semibold text-[#1e293b] text-[13px] mb-0.5",children:z.title}),e.jsxs("p",{className:"text-[#64748b] text-[11px] flex items-center gap-1.5",children:[z.type==="video"&&e.jsxs(e.Fragment,{children:[e.jsx(Ts,{className:"w-3 h-3"})," ",z.duration]}),z.type==="quiz"&&e.jsxs(e.Fragment,{children:[e.jsx(vi,{className:"w-3 h-3"})," ",z.questions?`${z.questions} questions`:z.duration]}),z.type==="assessment"&&e.jsxs(e.Fragment,{children:[e.jsx(xs,{className:"w-3 h-3"})," ",z.questions?`${z.questions} assessment questions`:z.duration]}),z.competency&&e.jsx("span",{className:"ml-2 px-1.5 py-0.5 bg-indigo-50 text-indigo-600 text-[9px] font-mono rounded",children:z.competency})]})]}),z.type==="assessment"?e.jsx(di,{className:"w-6 h-6 text-emerald-400"}):e.jsx("button",{className:`w-8 h-8 rounded-full bg-[#f8fafc] flex items-center justify-center text-[#64748b] ${yt} hover:text-white transition-colors border border-[#e2e8f0]`,children:nt})]})]},z.id)})})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-[#1e293b]",children:"Targeted Lesson Generation"}),e.jsx(jt,{onClick:()=>G(z=>z+1),disabled:re,className:"bg-[#4f46e5] hover:bg-[#3730a3] text-white h-8 text-[11px] rounded-full px-4",children:re?"Loading...":"Regenerate"})]}),e.jsx("p",{className:"text-[13px] text-[#64748b] mb-6",children:"Configure inputs and requirements for AI lesson generation."}),e.jsxs("div",{className:"bg-[#f8fafc]/80 rounded-[14px] p-[20px] border border-[#f1f5f9] mb-6",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[e.jsx(sa,{className:"w-4 h-4 text-[#4f46e5] shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-[13px] text-[#475569] leading-relaxed",children:["Class records alone are not enough for import-grounded lesson plans. Ensure course materials are uploaded via ",e.jsx("span",{className:"text-[#4f46e5] font-semibold",children:"Data Import"}),"."]})]}),e.jsxs("div",{className:"space-y-4 border-t border-[#e2e8f0] pt-5 mt-5",children:[e.jsxs("label",{className:"flex items-center justify-between cursor-pointer group",children:[e.jsx("span",{className:"text-[13px] font-medium text-[#1e293b] group-hover:text-[#4f46e5] transition-colors",children:"Allow sources requiring manual review"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:Re,onChange:z=>$e(z.target.checked)}),e.jsx("div",{className:"w-10 h-5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#4f46e5]"})]})]}),e.jsxs("label",{className:"flex items-center justify-between cursor-pointer group",children:[e.jsx("span",{className:"text-[13px] font-medium text-[#1e293b] group-hover:text-[#4f46e5] transition-colors",children:"Allow unverified lesson draft"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:He,onChange:z=>U(z.target.checked)}),e.jsx("div",{className:"w-10 h-5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#4f46e5]"})]})]})]})]}),e.jsxs(To,{name:"teacher-intervention-lesson-plan",loading:!1,fixture:null,fallback:null,children:[Ne&&e.jsx("div",{className:"bg-[#FF8B8B]/14 border border-[#FF8B8B]/35 rounded-xl p-3 text-sm text-[#D66A6A] mb-4",children:Ne}),E&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-[#f8fafc] border border-[#f1f5f9] rounded-[14px] p-5 shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:[e.jsx("div",{className:"mb-3",children:e.jsx(Mo,{sources:Q})}),e.jsx("p",{className:"text-[14px] font-semibold text-[#1e293b]",children:E.lessonTitle}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-2 mt-2",children:[e.jsxs("p",{className:"text-[11px] text-[#64748b]",children:[e.jsx("span",{className:"font-semibold text-[#475569]",children:"Imported topics:"})," ",E.usedImportedTopics?"Yes":"No"," (",E.importedTopicCount,")"]}),e.jsxs("p",{className:"text-[11px] text-[#64748b]",children:[e.jsx("span",{className:"font-semibold text-[#475569]",children:"Subject:"})," ",E.subject||"General Math"," (Q",E.quarter||1,")"]})]}),E.curriculumCompetency&&e.jsxs("p",{className:"text-[11px] text-[#4f46e5] font-semibold mt-2 bg-indigo-50/50 px-2 py-1 rounded inline-block",children:["Competency: ",E.curriculumCompetency]}),e.jsx("div",{className:"mt-3 flex items-center justify-between",children:e.jsxs("p",{className:"text-[11px] text-[#64748b]",children:["Publish readiness: ",e.jsx("span",{className:`font-semibold ${E.publishReady?"text-emerald-600":"text-rose-500"}`,children:E.publishReady?"Ready":"Blocked"})]})}),E.warnings.length>0&&e.jsx("p",{className:"text-[11px] text-amber-600 mt-2 bg-amber-50 px-2 py-1.5 rounded",children:E.warnings.join(" ")})]}),E.lessonObjective&&e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-[14px] p-4 shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:[e.jsx("p",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1.5",children:"Lesson objective"}),e.jsx("p",{className:"text-[13px] text-[#1e293b]",children:E.lessonObjective})]}),E.realWorldHook&&e.jsxs("div",{className:"bg-indigo-50/50 border border-indigo-100 rounded-[14px] p-4 shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:[e.jsx("p",{className:"text-[10px] font-semibold text-[#4f46e5] uppercase tracking-wider mb-1.5",children:"Real-life application"}),e.jsx("p",{className:"text-[13px] text-[#1e293b]",children:E.realWorldHook})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-4",children:$s.map(z=>e.jsxs("div",{className:"border border-[#e2e8f0] rounded-[14px] p-4 bg-white shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-[#1e293b]",children:z.title}),e.jsxs("p",{className:"text-[11px] text-[#64748b] mt-1",children:[z.estimatedMinutes," mins "," • "," ",z.strategy]}),e.jsx("p",{className:"text-[12px] text-[#475569] mt-2 bg-[#f8fafc] p-2 rounded-lg",children:z.objective}),e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1.5",children:"Activities"}),z.activities.slice(0,2).map((fe,Xe)=>e.jsxs("p",{className:"text-[11px] text-[#475569] mb-1 flex items-start gap-1",children:[e.jsx("span",{className:"text-[#94a3b8] mt-0.5",children:"•"})," ",e.jsx("span",{children:fe})]},Xe))]})]},z.blockId))}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-4",children:[e.jsx(jt,{variant:"outline",onClick:()=>void Gt(),disabled:V||!E,className:"border-[#cbd5e1] text-[#475569] hover:bg-[#f8fafc] text-[12px] h-9 rounded-full px-5",children:V?e.jsx(Bn,{className:"h-4 w-16"}):"Save Draft"}),e.jsx(jt,{onClick:()=>void Ss(),disabled:O||!E||!E.publishReady,className:"bg-[#10b981] hover:bg-[#059669] text-white text-[12px] h-9 rounded-full px-5",children:O?e.jsx(Bn,{className:"h-4 w-24 bg-white/35"}):"Publish Lesson Plan"})]})]})]})]})]})}),e.jsx("aside",{className:"w-[320px] 2xl:w-[340px] bg-white/70 backdrop-blur-[24px] border-l border-white shadow-[-4px_0_24px_rgba(0,0,0,0.02)] flex flex-col h-full shrink-0 overflow-y-auto z-10 no-scrollbar relative",children:e.jsxs("div",{className:"p-[24px] space-y-[24px] flex flex-col items-center",children:[e.jsxs("div",{className:"flex flex-col items-center text-center w-full",children:[e.jsx("img",{src:t.avatar,alt:t.name,className:"w-[96px] h-[96px] rounded-full object-cover shadow-[0_8px_16px_rgba(0,0,0,0.1)] mb-4 border-4 border-white z-10 relative"}),e.jsx("h2",{className:"text-[20px] font-semibold text-[#1e293b] mb-1",children:t.name}),e.jsxs("p",{className:"text-[11px] font-semibold text-[#64748b] mb-3 uppercase tracking-wider",children:["ID: ",t.id.substring(0,8)]}),e.jsx("span",{className:`text-[11px] font-semibold px-3 py-1 rounded-[14px] border ${(p?.risk_level||"").includes("Critical")?"text-red-700 bg-red-50 border-red-200 animate-pulse":t.riskLevel==="high"||(p?.risk_level||"").includes("High")?"text-rose-600 bg-rose-50 border-rose-100":t.riskLevel==="medium"||(p?.risk_level||"").includes("Medium")?"text-amber-600 bg-amber-50 border-amber-100":"text-emerald-600 bg-emerald-50 border-emerald-100"}`,children:p?.risk_level||(t.riskLevel==="high"?"High Risk":t.riskLevel==="medium"?"Medium Risk":"Low Risk")})]}),e.jsxs("div",{className:"w-full grid grid-cols-2 gap-[12px]",children:[e.jsxs("div",{className:"bg-white/80 rounded-[14px] p-4 border border-white shadow-[0_1px_4px_rgba(0,0,0,0.02)] text-left flex flex-col justify-center",children:[e.jsx("p",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Avg Score"}),e.jsxs("p",{className:"text-[20px] font-bold text-[#4f46e5]",children:[p?.avg_score??t.avgScore,"%"]})]}),e.jsxs("div",{className:"bg-white/80 rounded-[14px] p-4 border border-white shadow-[0_1px_4px_rgba(0,0,0,0.02)] text-left flex flex-col justify-center",children:[e.jsx("p",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Engagement"}),e.jsx("p",{className:"text-[20px] font-bold text-[#1e293b]",children:p?.engagement_level||(t.avgScore>80?"High":t.avgScore>50?"Medium":"Low")})]}),e.jsxs("div",{className:"bg-white/80 rounded-[14px] p-4 border border-white shadow-[0_1px_4px_rgba(0,0,0,0.02)] text-left flex flex-col justify-center",children:[e.jsx("p",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Last Active"}),e.jsx("p",{className:"text-[13px] font-semibold text-[#1e293b] mt-1",children:p?.last_active?new Date(p.last_active).toLocaleDateString():t.lastActive})]}),e.jsxs("div",{className:"bg-rose-50/60 rounded-[14px] p-4 border border-rose-100 text-left flex flex-col justify-center",children:[e.jsx("p",{className:"text-[11px] font-semibold text-rose-600 uppercase tracking-wider mb-1",children:"Weakest Topic"}),e.jsx("p",{className:"text-[12px] font-semibold text-[#1e293b] mt-1 leading-snug break-words",title:p?.weakest_topic||t.weakestTopic,children:p?.weakest_topic||t.weakestTopic})]})]}),e.jsx("div",{className:"w-full flex flex-col gap-[10px]",children:e.jsxs("button",{onClick:async()=>{xe("choose"),J(!0)},className:"w-full flex items-center justify-center gap-2 bg-white hover:bg-[#f8fafc] text-[#475569] border border-[#cbd5e1] hover:border-[#94a3b8] text-[13px] font-semibold rounded-full px-4 py-3 shadow-[0_1px_4px_rgba(0,0,0,0.04)] transition-transform hover:scale-[1.02]",children:[e.jsx(Zn,{className:"w-4 h-4"})," Export Materials"]})}),A&&Ur.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",onClick:()=>J(!1),children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs("div",{className:"relative bg-white rounded-[24px] shadow-[0_24px_64px_rgba(0,0,0,0.18)] w-full max-w-[460px] z-10 overflow-hidden",onClick:z=>z.stopPropagation(),children:[e.jsx("div",{className:"bg-gradient-to-r from-[#a855f7] to-[#9333ea] px-6 pt-5 pb-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[le==="bank"&&e.jsx("button",{onClick:()=>xe("choose"),className:"w-7 h-7 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center text-white transition-colors mr-1",children:e.jsx(Es,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-8 h-8 rounded-[8px] bg-white/20 flex items-center justify-center",children:e.jsx(qr,{className:"w-4 h-4 text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-[15px] font-bold text-white leading-tight",children:le==="choose"?"Export Materials":"Choose a Quiz"}),e.jsx("p",{className:"text-[11px] text-white/70 font-medium",children:le==="choose"?`For ${t.name}`:"Select a quiz from your bank"})]})]}),e.jsx("button",{onClick:()=>J(!1),className:"w-7 h-7 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center text-white transition-colors",children:e.jsx(Xt,{className:"w-4 h-4"})})]})}),e.jsx("div",{className:"p-6",children:le==="choose"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[13px] text-[#64748b] mb-5 font-medium",children:"How would you like to proceed?"}),e.jsxs("button",{onClick:async()=>{J(!1),oe.info("Generating PDF report...");try{const{getExportPDFData:z}=await Gs(async()=>{const{getExportPDFData:nt}=await Promise.resolve().then(()=>Jm);return{getExportPDFData:nt}},void 0),fe=await z(t.id),{default:Xe}=await Gs(async()=>{const{default:nt}=await import("./jspdf.es.min-CSpYkTDq.js").then(R=>R.j);return{default:nt}},__vite__mapDeps([12,0,1,2,3,4,5,6,7,8,9,10,11])),ke=new Xe;let Ce=20;ke.setFontSize(18),ke.text("MathPulse AI - Intervention Report",20,Ce),Ce+=12,ke.setFontSize(11),ke.text(`Student: ${fe.student_name}`,20,Ce),Ce+=7,ke.text(`Grade: ${fe.grade_level} | Section: ${fe.section}`,20,Ce),Ce+=7,ke.text(`Risk Level: ${fe.risk_level} | Avg Score: ${fe.avg_score}%`,20,Ce),Ce+=7,ke.text(`Engagement: ${fe.engagement_level} | Generated: ${new Date().toLocaleDateString()}`,20,Ce),Ce+=12,ke.setFontSize(13),ke.text("AI Analysis",20,Ce),Ce+=8,ke.setFontSize(10);const Le=170,yt=nt=>{const R=ke.splitTextToSize(nt,Le);for(const ee of R)Ce>270&&(ke.addPage(),Ce=20),ke.text(ee,20,Ce),Ce+=5;Ce+=2};if(yt(`Strengths: ${fe.learning_strengths}`),yt(`Next Steps: ${fe.next_steps_summary}`),Ce+=4,fe.learning_path?.steps?.length){ke.setFontSize(13),ke.text("Learning Path",20,Ce),Ce+=8,ke.setFontSize(10);for(const nt of fe.learning_path.steps)Ce>270&&(ke.addPage(),Ce=20),yt(`${nt.step_number}. [${nt.type}] ${nt.title} (${nt.duration_minutes} min, ${nt.difficulty})`),nt.competency_tag&&(ke.text(` Competency: ${nt.competency_tag}`,20,Ce),Ce+=6);Ce+=6}if(fe.teacher_recommendations?.length){Ce>250&&(ke.addPage(),Ce=20),ke.setFontSize(13),ke.text("Teacher Recommendations",20,Ce),Ce+=8,ke.setFontSize(10);for(const nt of fe.teacher_recommendations)Ce>270&&(ke.addPage(),Ce=20),yt(`• ${nt}`)}ke.setFontSize(8),ke.text("Generated by MathPulse AI | Confidential - For Teacher Use Only",20,285),ke.save(`intervention-report-${fe.student_name.replace(/\s+/g,"-")}-${new Date().toISOString().slice(0,10)}.pdf`),oe.success("PDF report downloaded!")}catch(z){console.error("PDF export failed:",z),oe.error("Failed to generate PDF report.")}},className:"w-full flex items-start gap-4 p-4 rounded-[16px] border border-slate-200 hover:border-[#a855f7] hover:shadow-[0_4px_12px_rgba(168,85,247,0.08)] hover:bg-purple-50/30 transition-all group mb-3 text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[10px] bg-purple-50 border border-purple-100 flex items-center justify-center shrink-0 group-hover:bg-purple-100 transition-colors",children:e.jsx(Zn,{className:"w-5 h-5 text-[#a855f7]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-0.5",children:"Download PDF Report"}),e.jsx("p",{className:"text-[12px] text-[#64748b] font-medium",children:"Full intervention report with AI insights and learning path."})]})]}),e.jsxs("button",{onClick:async()=>{tt(!0),xe("bank");try{const z=await hi(s);Fe(z)}catch{Fe([])}finally{tt(!1)}},className:"w-full flex items-start gap-4 p-4 rounded-[16px] border border-slate-200 hover:border-[#a855f7] hover:shadow-[0_4px_12px_rgba(168,85,247,0.08)] hover:bg-purple-50/30 transition-all group mb-3 text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[10px] bg-purple-50 border border-purple-100 flex items-center justify-center shrink-0 group-hover:bg-purple-100 transition-colors",children:e.jsx(dr,{className:"w-5 h-5 text-[#a855f7]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-0.5",children:"Choose from existing quizzes"}),e.jsx("p",{className:"text-[12px] text-[#64748b] font-medium",children:"Pick a quiz already in your Quiz Bank."})]})]}),e.jsxs("button",{onClick:()=>{J(!1),wt(!1),Ye(!0)},className:"w-full flex items-start gap-4 p-4 rounded-[16px] border border-slate-200 hover:border-[#a855f7] hover:shadow-[0_4px_12px_rgba(168,85,247,0.08)] hover:bg-purple-50/30 transition-all group text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[10px] bg-purple-50 border border-purple-100 flex items-center justify-center shrink-0 group-hover:bg-purple-100 transition-colors",children:e.jsx(Rs,{className:"w-5 h-5 text-[#a855f7]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-0.5",children:"Create a new quiz"}),e.jsx("p",{className:"text-[12px] text-[#64748b] font-medium",children:"Use AI Quiz Maker. You can return here when done."})]})]})]}):e.jsx("div",{children:Te?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3",children:[e.jsx("div",{className:"w-8 h-8 border-2 border-[#a855f7] border-t-transparent rounded-full animate-spin"}),e.jsx("p",{className:"text-[13px] text-[#64748b] font-medium",children:"Loading quizzes..."})]}):ce.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-purple-50 flex items-center justify-center",children:e.jsx(dr,{className:"w-6 h-6 text-[#a855f7]"})}),e.jsx("p",{className:"text-[14px] font-semibold text-[#1e293b]",children:"No quizzes yet"}),e.jsx("p",{className:"text-[12px] text-[#64748b]",children:"Create your first quiz using the AI Quiz Maker."})]}):e.jsx("div",{className:"space-y-3 max-h-[320px] overflow-y-auto pr-1",children:ce.map(z=>e.jsxs("div",{className:"flex items-center justify-between gap-3 p-4 rounded-[14px] border border-slate-200 hover:border-[#a855f7] hover:shadow-[0_2px_8px_rgba(168,85,247,0.08)] transition-all group",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[13px] font-bold text-[#1e293b] truncate",children:z.title}),e.jsxs("p",{className:"text-[11px] text-[#64748b] font-medium mt-0.5",children:[z.questions?.length??0," questions",z.gradeLevel?` · ${z.gradeLevel}`:"",z.metadata?.topicsCovered?.[0]?` · ${z.metadata.topicsCovered[0]}`:""]})]}),e.jsx("button",{onClick:()=>{J(!1),oe.success(`"${z.title}" selected for ${t.name}`)},className:"shrink-0 px-3 py-1.5 rounded-full bg-[#a855f7] text-white text-[11px] font-bold hover:bg-[#9333ea] transition-colors shadow-sm",children:"Assign"})]},z.id))})})})]})]}),document.body),Oe&&Ur.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/40 backdrop-blur-sm",onClick:()=>{ht?Nt(!0):Ye(!1)}}),e.jsxs("div",{className:"fixed top-0 right-0 z-[9999] h-full w-full max-w-[88vw] xl:max-w-[1080px] bg-white shadow-[-8px_0_40px_rgba(0,0,0,0.15)] flex flex-col",style:{animation:"slideInFromRight 0.3s cubic-bezier(0.16,1,0.3,1)"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-slate-100 bg-white shrink-0",children:[e.jsxs("button",{onClick:()=>{ht?Nt(!0):Ye(!1)},className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors bg-indigo-50 hover:bg-indigo-100 px-4 py-2 rounded-full",children:[e.jsx(lr,{className:"w-4 h-4"}),"Back to ",t.name]}),e.jsx("div",{className:"h-5 w-px bg-slate-200"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-[8px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center",children:e.jsx(qr,{className:"w-3.5 h-3.5 text-white"})}),e.jsx("span",{className:"text-[14px] font-bold text-[#1e293b]",children:"AI Quiz Maker"})]}),ht&&e.jsx("span",{className:"ml-auto text-[11px] font-semibold text-amber-600 bg-amber-50 border border-amber-200 px-2.5 py-0.5 rounded-full",children:"Quiz in progress"})]}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(ml,{onBack:()=>Ye(!1),drawerMode:!0,gradeLevel:t.grade,onQuizGenerating:()=>wt(!0),onQuizSaved:z=>{wt(!1),oe.success("Quiz saved! Close this panel or create another.",{action:{label:"Close Panel",onClick:()=>Ye(!1)}})}})})]}),lt&&e.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:()=>Nt(!1)}),e.jsxs("div",{className:"relative bg-white rounded-[20px] shadow-[0_24px_60px_rgba(0,0,0,0.2)] w-full max-w-[380px] p-7 z-10",children:[e.jsx("div",{className:"w-11 h-11 rounded-full bg-amber-50 border border-amber-200 flex items-center justify-center mb-4",children:e.jsx(gr,{className:"w-5 h-5 text-amber-500"})}),e.jsx("h3",{className:"text-[16px] font-bold text-[#1e293b] mb-2",children:"Discard quiz progress?"}),e.jsx("p",{className:"text-[13px] text-[#64748b] font-medium mb-6",children:"Your current quiz session will be lost if you close this panel. This cannot be undone."}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>Nt(!1),className:"flex-1 py-2.5 rounded-full border border-slate-200 text-[13px] font-semibold text-[#475569] hover:bg-slate-50 transition-colors",children:"Keep editing"}),e.jsx("button",{onClick:()=>{Nt(!1),Ye(!1),wt(!1)},className:"flex-1 py-2.5 rounded-full bg-rose-500 hover:bg-rose-600 text-white text-[13px] font-semibold transition-colors",children:"Discard & close"})]})]})]}),e.jsx("style",{children:` - @keyframes slideInFromRight { - from { transform: translateX(100%); opacity: 0.6; } - to { transform: translateX(0); opacity: 1; } - } - `})]}),document.body),e.jsxs("div",{className:"w-full bg-white/80 rounded-[18px] p-[20px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white mt-auto",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-[#1e293b] mb-4",children:"Section Assignment"}),e.jsxs("div",{className:"space-y-[12px]",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1.5 block ml-1",children:"Grade Level"}),e.jsx("div",{className:"relative",children:e.jsx(ys,{value:M,onChange:z=>q(z.target.value),placeholder:"Grade",className:"appearance-none w-full bg-[#f8fafc] border border-[#e2e8f0] text-[#475569] text-[13px] font-medium rounded-[14px] px-4 py-2.5 outline-none focus:border-[#a855f7] focus:ring-1 focus:ring-[#a855f7] h-auto"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1.5 block ml-1",children:"Section"}),e.jsx("div",{className:"relative",children:e.jsx(ys,{value:g,onChange:z=>S(z.target.value),placeholder:"Section",className:"appearance-none w-full bg-[#f8fafc] border border-[#e2e8f0] text-[#475569] text-[13px] font-medium rounded-[14px] px-4 py-2.5 outline-none focus:border-[#a855f7] focus:ring-1 focus:ring-[#a855f7] h-auto"})})]}),e.jsx("button",{onClick:is,disabled:v||!M.trim()||!g.trim(),className:"w-full bg-white hover:bg-[#f8fafc] disabled:opacity-50 text-[#4f46e5] border border-[#e0e7ff] text-[13px] font-semibold rounded-[14px] px-4 py-2.5 transition-colors shadow-[0_1px_4px_rgba(0,0,0,0.02)] mt-2",children:v?"Updating...":"Update Assignment"})]})]})]})}),C&&e.jsx(eu,{step:C,studentId:t.id,studentName:t.name,totalSteps:p?.learning_path?.steps?.length||3,onClose:()=>y(null),onStepCompleted:()=>{y(null),tn(t.id).then(h).catch(()=>{})}})]})},ni=({onViewCalendar:t,onOpenProfile:s,userProfile:a,teacherName:r,liveActivity:o=[]})=>{const{currentUser:n}=hs(),[i,l]=u.useState(new Date),[c,d]=u.useState("pulse"),[m,p]=u.useState([]),[h,b]=u.useState(!1);u.useEffect(()=>{if(!n?.uid)return;const v=pl(n.uid,{limitCount:100},L=>p(L),()=>{});return()=>v()},[n?.uid]);const N=v=>new Date(v.getFullYear(),v.getMonth()+1,0).getDate(),C=v=>new Date(v.getFullYear(),v.getMonth(),1).getDay(),y=()=>i.toLocaleDateString(void 0,{month:"long",year:"numeric"}),f=()=>l(new Date(i.getFullYear(),i.getMonth()-1)),w=()=>l(new Date(i.getFullYear(),i.getMonth()+1)),I=()=>{const v=N(i),L=C(i),E=[];for(let j=L-1;j>=0;j--)E.unshift(null);for(let j=1;j<=v;j++)E.push(j);return E},D=v=>{if(!v)return!1;const L=new Date;return v===L.getDate()&&i.getMonth()===L.getMonth()&&i.getFullYear()===L.getFullYear()},M=I(),q=["Mo","Tu","We","Th","Fr","Sa","Su"],g=v=>{if(!v)return!1;const L=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(v).padStart(2,"0")}`;return m.some(E=>{const j=new Date(E.startTime);return`${j.getFullYear()}-${String(j.getMonth()+1).padStart(2,"0")}-${String(j.getDate()).padStart(2,"0")}`===L})},S=v=>{if(!v)return;const L=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(v).padStart(2,"0")}`,E=m.filter(j=>{const Q=new Date(j.startTime);return`${Q.getFullYear()}-${String(Q.getMonth()+1).padStart(2,"0")}-${String(Q.getDate()).padStart(2,"0")}`===L});if(E.length!==0)return E.map(j=>`• ${j.title}`).join(` -`)};return e.jsxs("aside",{className:"w-[280px] bg-white border-l border-[#e2e8f0] flex flex-col flex-shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"p-[22px_16px_10px] border-b border-[#f1f5f9] flex flex-col items-center gap-[5px]",children:[e.jsx("div",{className:"w-[48px] h-[48px] rounded-full bg-[#e0e7ff] flex items-center justify-center text-[22px] text-[#4f46e5] shadow-[0_0_0_3px_#c7d2fe] flex-shrink-0",children:e.jsx(Pl,{src:a?.photo,name:r,className:"w-full h-full rounded-full"})}),e.jsx("div",{className:"text-[13.5px] font-semibold text-[#1e293b] mt-1",children:r}),e.jsx("div",{className:"text-[11px] text-[#94a3b8]",children:"Teacher"}),e.jsx("button",{onClick:s,className:"mt-[4px] py-[6px] px-[22px] bg-[#818cf8] hover:bg-[#6366f1] text-white rounded-full text-[11.5px] font-medium transition-colors",children:"Profile"})]}),e.jsxs("div",{className:"border-b border-[#f1f5f9]",children:[e.jsxs("div",{className:"p-[10px_16px_8px] flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:v=>{v.stopPropagation(),f()},className:"w-6 h-6 flex items-center justify-center bg-white border border-[#e2e8f0] rounded-[7px] text-[#64748b] hover:bg-[#f8fafc] cursor-pointer text-[14px] z-10",children:e.jsx(Es,{size:14})}),e.jsx("span",{className:"text-[12px] font-semibold text-[#1e293b] hover:text-[#4f46e5] transition-colors cursor-pointer",onClick:t,children:y()}),e.jsx("button",{onClick:v=>{v.stopPropagation(),w()},className:"w-6 h-6 flex items-center justify-center bg-white border border-[#e2e8f0] rounded-[7px] text-[#64748b] hover:bg-[#f8fafc] cursor-pointer text-[14px] z-10",children:e.jsx(Is,{size:14})})]}),e.jsx("button",{onClick:()=>b(v=>!v),className:"w-6 h-6 flex items-center justify-center rounded-[7px] text-[#94a3b8] hover:bg-[#f1f5f9] hover:text-[#64748b] transition-colors",title:h?"Show calendar":"Hide calendar","aria-label":h?"Expand calendar":"Collapse calendar",children:e.jsx(zt,{size:14,className:`transition-transform duration-200 ${h?"":"rotate-180"}`})})]}),e.jsx(Mt,{initial:!1,children:!h&&e.jsx(Ae.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22,ease:"easeInOut"},className:"overflow-hidden",children:e.jsx("div",{className:"px-[16px] pb-[10px] cursor-pointer hover:bg-slate-50 transition-colors group/cal",onClick:t,children:e.jsxs("div",{className:"grid grid-cols-7 gap-[2px] text-center mb-1",children:[q.map(v=>e.jsx("div",{className:"text-[10px] font-semibold text-[#94a3b8] p-[2px_0_4px]",children:v},v)),M.map((v,L)=>e.jsxs("div",{className:"relative flex flex-col items-center justify-center h-[28px]",title:S(v),children:[e.jsx("div",{className:`text-[11px] leading-[22px] w-[22px] h-[22px] flex items-center justify-center rounded-full transition-all ${v===null?"text-[#cbd5e1]":D(v)?"bg-[#818cf8] text-white font-semibold":"text-[#475569] group-hover/cal:bg-slate-100"}`,children:v}),v!==null&&g(v)&&e.jsx("div",{className:`absolute bottom-0 w-1 h-1 rounded-full ${D(v)?"bg-white":"bg-[#a855f7]"}`})]},`${i.getMonth()}-${L}`))]})})},"cal-grid")})]}),e.jsxs("div",{className:"flex gap-[18px] p-[12px_16px_0] border-b border-[#f1f5f9] flex-shrink-0",children:[e.jsx("button",{onClick:()=>d("pulse"),className:`text-[11.5px] font-semibold pb-[9px] border-b-[2.5px] transition-colors ${c==="pulse"?"text-[#10b981] border-[#10b981]":"text-[#94a3b8] border-transparent"}`,children:"Live pulse"}),e.jsx("button",{onClick:()=>d("reminders"),className:`text-[11.5px] font-semibold pb-[9px] border-b-[2.5px] transition-colors ${c==="reminders"?"text-[#10b981] border-[#10b981]":"text-[#94a3b8] border-transparent"}`,children:"Reminders"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-[14px_16px]",children:[c==="pulse"&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("div",{className:"text-[10px] font-bold text-[#64748b] uppercase tracking-wider",children:"Live Activity Stream"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),e.jsx("span",{className:"text-[9px] font-bold text-emerald-600",children:"LIVE"})]})]}),o.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center opacity-40",children:[e.jsx(pi,{size:32,className:"text-slate-300 mb-2"}),e.jsx("p",{className:"text-[11px] font-bold text-[#1e293b]",children:"No recent activity"})]}):e.jsx("div",{className:"space-y-4",children:o.slice(0,5).map(v=>e.jsxs("div",{className:"relative pl-5 before:absolute before:left-1.5 before:top-2 before:bottom-[-16px] before:w-[1px] before:bg-slate-100 last:before:hidden",children:[e.jsx("div",{className:"absolute left-0 top-1.5 w-3 h-3 rounded-full border-2 border-white bg-indigo-500 shadow-sm z-10"}),e.jsxs("div",{className:"bg-white border border-[#f1f5f9] rounded-xl p-3 shadow-sm hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex justify-between items-start mb-1",children:[e.jsx("span",{className:"text-[12px] font-bold text-[#1e293b] truncate",children:v.student}),e.jsx("span",{className:"text-[9px] font-medium text-[#94a3b8] shrink-0",children:v.time})]}),e.jsxs("p",{className:"text-[11px] text-[#64748b] leading-snug",children:[v.action," ",e.jsx("span",{className:"font-bold text-[#4f46e5]",children:v.topic})]})]})]},v.id))})]}),c==="reminders"&&e.jsxs("div",{className:"space-y-3",children:[m.filter(v=>{const L=new Date;return L.setHours(0,0,0,0),new Date(v.startTime).getTime()>=L.getTime()}).sort((v,L)=>new Date(v.startTime).getTime()-new Date(L.startTime).getTime()).slice(0,5).map(v=>{const L=new Date(v.startTime).toDateString()===new Date().toDateString();return e.jsxs("div",{onClick:t,className:"flex items-start gap-3 p-3 border border-[#f1f5f9] rounded-[14px] cursor-pointer hover:bg-slate-50 transition-colors group",children:[e.jsx("div",{className:`p-2 rounded-xl border border-[#f1f5f9] bg-white text-[14px] flex-shrink-0 shadow-sm transition-transform group-hover:scale-105 ${L?"text-rose-500":"text-[#4f46e5]"}`,children:e.jsx(rr,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[12px] font-bold text-[#1e293b] mb-0.5 truncate",children:v.title}),e.jsxs("div",{className:`text-[10px] font-medium ${L?"text-rose-500 font-bold":"text-[#94a3b8]"}`,children:[L?"Today, ":"",new Date(v.startTime).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]})]},v.id)}),m.filter(v=>new Date(v.startTime).getTime()>=new Date().setHours(0,0,0,0)).length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center opacity-40",children:[e.jsx(cr,{size:32,className:"text-slate-300 mb-2"}),e.jsx("p",{className:"text-[11px] font-bold text-[#1e293b]",children:"No upcoming tasks"})]})]})]})]})};export{qp as default}; diff --git a/assets/TeacherDashboard-DXtFjzFe.js b/assets/TeacherDashboard-DXtFjzFe.js new file mode 100644 index 0000000000000000000000000000000000000000..2866e2600f9234edca02a2db3d2f989345006df5 --- /dev/null +++ b/assets/TeacherDashboard-DXtFjzFe.js @@ -0,0 +1,114 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css","assets/jspdf.es.min-CzGv_66N.js"])))=>i.map(i=>d[i]); +import{e as wt,t as Al,f as zn,g as Ue,_ as ys,u as hs,h as zt,m as ze,i as li,j as ie,k as ci,R as cs,l as zl,n as xt,o as di,b as Gt,G as ui,B as Hr,Z as Ll,p as ar,q as gt,A as mi,U as us,r as ms,T as ia,v as Xa,C as Dl,w as Ln,x as $l,y as la,z as Ur,D as Dn,E as xi,F as Fl,H as rr,I as Ol,J as Pl,K as Bl,M as Hl,N as $n,O as Ul,P as Gl}from"./index-D9TvEOZX.js";import{d as he,j as e,r as u,c as Gr}from"./vendor-react-B4AQeu28.js";import{B as St,c as Ql}from"./button-DC8Fz5kC.js";import{I as Cs}from"./input-7k8DpmeH.js";import Vl from"./ConfirmModal-bHzo3ssd.js";import{collection as Lt,query as Mt,limit as nr,where as Et,getDocs as Ot,doc as pt,getDoc as Ss,updateDoc as es,serverTimestamp as ct,setDoc as ts,arrayRemove as Wl,deleteDoc as pi,Timestamp as ql,orderBy as Yl,onSnapshot as hi,addDoc as Kl}from"./vendor-firebase-firestore-CNv3xXal.js";import{X as Xt}from"./x-DM8tXF3P.js";import{S as Ws}from"./search-DhblJahq.js";import{C as Ht}from"./check-Ceq9J6wq.js";import{P as ca}from"./plus-BO4Ob0HD.js";import{F as Es,N as Xl,A as fi}from"./NotificationDropdown-BGvkzRtG.js";import{M as Jl,L as Zl,D as ec,S as tc,a as sc}from"./LogoutActionButton-1ArQYuvD.js";import{f as ac,V as rc,P as or,s as Fn,a as gi,L as ir,d as nc,p as oc,b as ic,A as lr,c as lc}from"./quizService-BthGydmr.js";import{C as Ms}from"./clock-BPtF2Ddk.js";import{S as sa}from"./send-Duo9AQbk.js";import{C as Aa}from"./circle-check-big-yn5lhjQR.js";import{S as cc}from"./vendor-radix-C5nwdvGr.js";import{T as dc,a as uc,b as mc}from"./tooltip-B9-3_gHy.js";import{C as xc}from"./circle-help-BNf4DSN0.js";import{E as pc,a as hc}from"./eye-C42pNDm-.js";import{T as bi}from"./trash-2-BYUCk-BO.js";import{C as gr}from"./circle-alert-B7tHo7_X.js";import{I as ra}from"./info-Dc8OHnyB.js";import{C as $t,a as ka}from"./chevron-up-C5341jJ8.js";import{M as On}from"./minus-VA5XFKbP.js";import{C as As}from"./chart-column-BwIV9b12.js";import{C as Qr,H as Pn,S as Bn}from"./skeleton-DpSy2iSj.js";import{D as fc}from"./download-BC34EYX_.js";import{C as zs}from"./chevron-left-C7NnvvA7.js";import{C as Rs}from"./chevron-right-Jv12kepm.js";import{S as vi}from"./save-BUPludiE.js";import{C as ja}from"./circle-check-C6IXGFgm.js";import{S as ps}from"./sparkles-BLpoopVP.js";import{U as Vr}from"./upload-OtZe8H1o.js";import{L as gc,C as bc}from"./lightbulb-CVSZ487_.js";import{u as vc}from"./useQuery-CpdRUEDx.js";import{S as Hn,g as wc,G as Nc,s as Un}from"./subjects-BJQJlUBm.js";import{u as jc}from"./useCurriculum-CNtxEkAg.js";import yc from"./ChatMarkdown-D5DdKmyx.js";import{c as Sc,a as wi,C as kc,f as Cc}from"./formatDistanceToNow-2ba72dLM.js";import{B as cr}from"./bell-Ci_PX33B.js";import{D as Gn,a as Qn,b as Ic,c as Tc,d as _c,S as Ec}from"./dialog-BXd6FyxO.js";import{u as Kt,r as Rc}from"./vendor-xlsx-uZelXSz_.js";import{s as Mc}from"./moduleWatchService-C7S4gD7U.js";import{r as Ac,u as zc,a as Lc}from"./vendor-firebase-storage-Bi7H_66d.js";import{C as Wr}from"./clipboard-check-DEpL_ccN.js";import{R as Vn,B as Wn,C as qn,X as Yn,Y as Kn,T as Xn,a as Jn,b as Zn}from"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";import"./log-out-Bh-BcVV5.js";/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dc=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],$c=wt("align-left",Dc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fc=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],_r=wt("calendar-days",Fc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oc=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],Pc=wt("chart-no-axes-column",Oc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bc=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Hc=wt("ellipsis-vertical",Bc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uc=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],qr=wt("ellipsis",Uc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gc=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Qc=wt("external-link",Gc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vc=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Wc=wt("file-spreadsheet",Vc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qc=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],dr=wt("library",qc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yc=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],Ni=wt("list-checks",Yc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kc=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],ji=wt("message-circle",Kc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xc=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Jc=wt("panel-right",Xc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zc=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],ed=wt("pen-line",Zc);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const td=[["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"}]],yi=wt("pen",td);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sd=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],eo=wt("printer",sd);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ad=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],rd=wt("scan-line",ad);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nd=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],od=wt("table",nd);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const id=[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]],Yr=wt("trending-down",id);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ld=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],Ja=wt("video",ld);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cd=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Kr=wt("wand-sparkles",cd);function dd(t,s){const a=Al(t);return isNaN(s)?Sc(t,NaN):(a.setDate(a.getDate()+s),a)}function Si(t,s){const a=zn(t),r=zn(s);return+a==+r}function to(t){return Si(t,wi(t))}function ud(t,s){return dd(t,-1)}function so(t){return Si(t,ud(wi(t)))}const br=0,Ds=1,da=2,ki=4;function ao(t){return()=>t}function md(t){t()}function Ci(t,s){return a=>t(s(a))}function ro(t,s){return()=>t(s)}function xd(t,s){return a=>t(s,a)}function ln(t){return t!==void 0}function pd(...t){return()=>{t.map(md)}}function ua(){}function vr(t,s){return s(t),t}function hd(t,s){return s(t)}function at(...t){return t}function Xe(t,s){return t(Ds,s)}function Ae(t,s){t(br,s)}function cn(t){t(da)}function ot(t){return t(ki)}function ge(t,s){return Xe(t,xd(s,br))}function ss(t,s){const a=t(Ds,r=>{a(),s(r)});return a}function no(t){let s,a;return r=>o=>{s=o,a&&clearTimeout(a),a=setTimeout(()=>{r(s)},t)}}function Ii(t,s){return t===s}function st(t=Ii){let s;return a=>r=>{t(s,r)||(s=r,a(r))}}function ke(t){return s=>a=>{t(a)&&s(a)}}function xe(t){return s=>Ci(s,t)}function ls(t){return s=>()=>{s(t)}}function K(t,...s){const a=fd(...s);return((r,o)=>{switch(r){case da:cn(t);return;case Ds:return Xe(t,a(o))}})}function ds(t,s){return a=>r=>{a(s=t(s,r))}}function Vs(t){return s=>a=>{t>0?t--:s(a)}}function ks(t){let s=null,a;return r=>o=>{s=o,!a&&(a=setTimeout(()=>{a=void 0,r(s)},t))}}function Le(...t){const s=new Array(t.length);let a=0,r=null;const o=2**t.length-1;return t.forEach((n,i)=>{const l=2**i;Xe(n,c=>{const d=a;a|=l,s[i]=c,d!==o&&a===o&&r&&(r(),r=null)})}),n=>i=>{const l=()=>{n([i].concat(s))};a===o?l():r=l}}function fd(...t){return s=>t.reduceRight(hd,s)}function gd(t){let s,a;const r=()=>s?.();return function(o,n){switch(o){case Ds:return n?a===n?void 0:(r(),a=n,s=Xe(t,n),s):(r(),ua);case da:r(),a=null;return}}}function Z(t){let s=t;const a=Be();return((r,o)=>{switch(r){case br:s=o;break;case Ds:{o(s);break}case ki:return s}return a(r,o)})}function Rt(t,s){return vr(Z(s),a=>ge(t,a))}function Be(){const t=[];return((s,a)=>{switch(s){case br:t.slice().forEach(r=>{r(a)});return;case da:t.splice(0,t.length);return;case Ds:return t.push(a),()=>{const r=t.indexOf(a);r>-1&&t.splice(r,1)}}})}function Qt(t){return vr(Be(),s=>ge(t,s))}function Ke(t,s=[],{singleton:a}={singleton:!0}){return{constructor:t,dependencies:s,id:bd(),singleton:a}}const bd=()=>Symbol();function vd(t){const s=new Map,a=({constructor:r,dependencies:o,id:n,singleton:i})=>{if(i&&s.has(n))return s.get(n);const l=r(o.map(c=>a(c)));return i&&s.set(n,l),l};return a(t)}function ht(...t){const s=Be(),a=new Array(t.length);let r=0;const o=2**t.length-1;return t.forEach((n,i)=>{const l=2**i;Xe(n,c=>{a[i]=c,r|=l,r===o&&Ae(s,a)})}),function(n,i){switch(n){case da:{cn(s);return}case Ds:return r===o&&i(a),Xe(s,i)}}}function Se(t,s=Ii){return K(t,st(s))}function Xr(...t){return function(s,a){switch(s){case da:return;case Ds:return pd(...t.map(r=>Xe(r,a)))}}}const vt={DEBUG:0,INFO:1,WARN:2,ERROR:3},wd={[vt.DEBUG]:"debug",[vt.ERROR]:"error",[vt.INFO]:"log",[vt.WARN]:"warn"},Nd=()=>typeof globalThis>"u"?window:globalThis,$s=Ke(()=>{const t=Z(vt.ERROR);return{log:Z((s,a,r=vt.INFO)=>{const o=Nd().VIRTUOSO_LOG_LEVEL??ot(t);r>=o&&console[wd[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",s,a)}),logLevel:t}},[],{singleton:!0});function qs(t,s,a){return dn(t,s,a).callbackRef}function dn(t,s,a){const r=he.useRef(null);let o=i=>{};const n=he.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const c=i[0].target;c.offsetParent!==null&&t(c)};a?l():requestAnimationFrame(l)}):null,[t,a]);return o=i=>{i&&s?(n?.observe(i),r.current=i):(r.current&&n?.unobserve(r.current),r.current=null)},{callbackRef:o,ref:r}}function jd(t,s,a,r,o,n,i,l,c){const d=he.useCallback(m=>{const p=yd(m.children,s,l?"offsetWidth":"offsetHeight",o);let h=m.parentElement;for(;h.dataset.virtuosoScroller===void 0;)h=h.parentElement;const b=h.lastElementChild.dataset.viewportType==="window";let N;b&&(N=h.ownerDocument.defaultView);const C=i?l?i.scrollLeft:i.scrollTop:b?l?N.scrollX||N.document.documentElement.scrollLeft:N.scrollY||N.document.documentElement.scrollTop:l?h.scrollLeft:h.scrollTop,S=i?l?i.scrollWidth:i.scrollHeight:b?l?N.document.documentElement.scrollWidth:N.document.documentElement.scrollHeight:l?h.scrollWidth:h.scrollHeight,v=i?l?i.offsetWidth:i.offsetHeight:b?l?N.innerWidth:N.innerHeight:l?h.offsetWidth:h.offsetHeight;r({scrollHeight:S,scrollTop:Math.max(C,0),viewportHeight:v}),n?.(l?oo("column-gap",getComputedStyle(m).columnGap,o):oo("row-gap",getComputedStyle(m).rowGap,o)),p!==null&&t(p)},[t,s,o,n,i,r,l]);return dn(d,a,c)}function yd(t,s,a,r){const o=t.length;if(o===0)return null;const n=[];for(let i=0;i{if(!c?.offsetParent)return;const d=c.getBoundingClientRect(),m=d.width;let p,h;if(s){const b=s.getBoundingClientRect(),N=d.top-b.top;h=b.height-Math.max(0,N),p=N+s.scrollTop}else{const b=i.current.ownerDocument.defaultView;h=b.innerHeight-Math.max(0,d.top),p=d.top+b.scrollY}r.current={listHeight:d.height,offsetTop:p,visibleHeight:h,visibleWidth:m},t(r.current)},[t,s]),{callbackRef:n,ref:i}=dn(o,!0,a),l=he.useCallback(()=>{o(i.current)},[o,i]);return he.useEffect(()=>{if(s){s.addEventListener("scroll",l);const d=new ResizeObserver(()=>{requestAnimationFrame(l)});return d.observe(s),()=>{s.removeEventListener("scroll",l),d.unobserve(s)}}const c=i.current?.ownerDocument.defaultView;return c?.addEventListener("scroll",l),c?.addEventListener("resize",l),()=>{c?.removeEventListener("scroll",l),c?.removeEventListener("resize",l)}},[l,s,i]),n}const Dt=Ke(()=>{const t=Be(),s=Be(),a=Z(0),r=Be(),o=Z(0),n=Be(),i=Be(),l=Z(0),c=Z(0),d=Z(0),m=Z(0),p=Be(),h=Be(),b=Z(!1),N=Z(!1),C=Z(!1);return ge(K(t,xe(({scrollTop:S})=>S)),s),ge(K(t,xe(({scrollHeight:S})=>S)),i),ge(s,o),{deviation:a,fixedFooterHeight:d,fixedHeaderHeight:c,footerHeight:m,headerHeight:l,horizontalDirection:N,scrollBy:h,scrollContainerState:t,scrollHeight:i,scrollingInProgress:b,scrollTo:p,scrollTop:s,skipAnimationFrameInResizeObserver:C,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:n}},[],{singleton:!0}),Ca={lvl:0};function _i(t,s){const a=t.length;if(a===0)return[];let{index:r,value:o}=s(t[0]);const n=[];for(let i=1;is&&(l=l.concat(Zr(o,s,a))),r>=s&&r<=a&&l.push({k:r,v:i}),r<=a&&(l=l.concat(Zr(n,s,a))),l}function Za(t){const{l:s,lvl:a,r}=t;if(r.lvl>=a-1&&s.lvl>=a-1)return t;if(a>r.lvl+1){if(Er(s))return Ai(bt(t,{lvl:a-1}));if(!et(s)&&!et(s.r))return bt(s.r,{l:bt(s,{r:s.r.l}),lvl:a,r:bt(t,{l:s.r.r,lvl:a-1})});throw new Error("Unexpected empty nodes")}if(Er(t))return en(bt(t,{lvl:a-1}));if(!et(r)&&!et(r.l)){const o=r.l,n=Er(o)?r.lvl-1:r.lvl;return bt(o,{l:bt(t,{lvl:a-1,r:o.l}),lvl:o.lvl+1,r:en(bt(r,{l:o.r,lvl:n}))})}throw new Error("Unexpected empty nodes")}function bt(t,s){return Mi(s.k!==void 0?s.k:t.k,s.v!==void 0?s.v:t.v,s.lvl!==void 0?s.lvl:t.lvl,s.l!==void 0?s.l:t.l,s.r!==void 0?s.r:t.r)}function Ei(t){return et(t.r)?t.l:Za(bt(t,{r:Ei(t.r)}))}function Er(t){return et(t)||t.lvl>t.r.lvl}function Ri(t){return et(t.r)?[t.k,t.v]:Ri(t.r)}function Mi(t,s,a,r=Ca,o=Ca){return{k:t,l:r,lvl:a,r:o,v:s}}function io(t){return en(Ai(t))}function Ai(t){const{l:s}=t;return!et(s)&&s.lvl===t.lvl?bt(s,{r:bt(t,{l:s.r})}):t}function en(t){const{lvl:s,r:a}=t;return!et(a)&&!et(a.r)&&a.lvl===s&&a.r.lvl===s?bt(a,{l:bt(t,{r:a.l}),lvl:s+1}):t}function Sd(t){return _i(t,({k:s,v:a})=>({index:s,value:a}))}function zi(t,s){return!!(t&&t.startIndex===s.startIndex&&t.endIndex===s.endIndex)}function Ta(t,s){return!!(t&&t[0]===s[0]&&t[1]===s[1])}const un=Ke(()=>({recalcInProgress:Z(!1)}),[],{singleton:!0});function Li(t,s,a){return t[ur(t,s,a)]}function ur(t,s,a,r=0){let o=t.length-1;for(;r<=o;){const n=Math.floor((r+o)/2),i=t[n],l=a(i,s);if(l===0)return n;if(l===-1){if(o-r<2)return n-1;o=n-1}else{if(o===r)return n;r=n+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${s}`)}function kd(t,s,a,r){const o=ur(t,s,r),n=ur(t,a,r,o);return t.slice(o,n+1)}function Ls(t,s){return Math.round(t.getBoundingClientRect()[s])}function wr(t){return!et(t.groupOffsetTree)}function mn({index:t},s){return s===t?0:s=p||n===h)&&(t=Jr(t,p)):(d=h!==n,c=!0),m>o&&o>=p&&h!==n&&(t=Ut(t,o+1,h));d&&(t=Ut(t,i,n))}return[t,a]}function Td(t){return typeof t.groupIndex<"u"}function _d({offset:t},s){return s===t?0:s0?l+a:l}function Di(t,s){if(!wr(s))return t;let a=0;for(;s.groupIndices[a]<=t+a;)a++;return t+a}function $i(t,s,a){if(Td(t))return s.groupIndices[t.groupIndex]+1;const r=t.index==="LAST"?a:t.index;let o=Di(r,s);return o=Math.max(0,o,Math.min(a,o)),o}function Ed(t,s,a,r=0){return r>0&&(s=Math.max(s,Li(t,r,mn).offset)),_i(kd(t,s,a,_d),Ad)}function Rd(t,[s,a,r,o]){s.length>0&&r("received item sizes",s,vt.DEBUG);const n=t.sizeTree;let i=n,l=0;if(a.length>0&&et(n)&&s.length===2){const h=s[0].size,b=s[1].size;i=a.reduce((N,C)=>Ut(Ut(N,C,h),C+1,b),i)}else[i,l]=Id(i,s);if(i===n)return t;const{lastIndex:c,lastOffset:d,lastSize:m,offsetTree:p}=tn(t.offsetTree,l,i,o);return{groupIndices:a,groupOffsetTree:a.reduce((h,b)=>Ut(h,b,_a(b,p,o)),na()),lastIndex:c,lastOffset:d,lastSize:m,offsetTree:p,sizeTree:i}}function Md(t){return Qs(t).map(({k:s,v:a},r,o)=>{const n=o[r+1];return{endIndex:n!==void 0?n.k-1:1/0,size:a,startIndex:s}})}function lo(t,s){let a=0,r=0;for(;ao.start===r&&(o.end===s||o.end===1/0)&&o.value===a}const Ld={offsetHeight:"height",offsetWidth:"width"},fs=Ke(([{log:t},{recalcInProgress:s}])=>{const a=Be(),r=Be(),o=Rt(r,0),n=Be(),i=Be(),l=Z(0),c=Z([]),d=Z(void 0),m=Z(void 0),p=Z(void 0),h=Z(void 0),b=Z((f,k)=>Ls(f,Ld[k])),N=Z(void 0),C=Z(0),S=Cd(),v=Rt(K(a,Le(c,t,C),ds(Rd,S),st()),S),g=Rt(K(c,st(),ds((f,k)=>({current:k,prev:f.current}),{current:[],prev:[]}),xe(({prev:f})=>f)),[]);ge(K(c,ke(f=>f.length>0),Le(v,C),xe(([f,k,w])=>{const $=f.reduce((A,y,q)=>Ut(A,y,_a(y,k.offsetTree,w)||q),na());return{...k,groupIndices:f,groupOffsetTree:$}})),v),ge(K(r,Le(v),ke(([f,{lastIndex:k}])=>f[{endIndex:k,size:w,startIndex:f}])),a),ge(d,m);const I=Rt(K(d,xe(f=>f===void 0)),!0);ge(K(m,ke(f=>f!==void 0&&et(ot(v).sizeTree)),xe(f=>{const k=ot(p),w=ot(c).length>0;return k!==void 0&&k!==0?w?[{endIndex:0,size:k,startIndex:0},{endIndex:1,size:f,startIndex:1}]:[]:[{endIndex:0,size:f,startIndex:0}]})),a),ge(K(h,ke(f=>f!==void 0&&f.length>0&&et(ot(v).sizeTree)),xe(f=>{const k=[];let w=f[0],$=0;for(let A=1;Af!==void 0&&k!==void 0),xe(([f,k,w])=>{const $=[];for(let A=0;A({changed:w!==f,sizes:w}),{changed:!1,sizes:S}),xe(f=>f.changed)));Xe(K(l,ds((f,k)=>({diff:f.prev-k,prev:k}),{diff:0,prev:0}),xe(f=>f.diff)),f=>{const{groupIndices:k}=ot(v);if(f>0)Ae(s,!0),Ae(n,f+lo(f,k));else if(f<0){const w=ot(g);w.length>0&&(f-=lo(-f,w)),Ae(i,f)}}),Xe(K(l,Le(t)),([f,k])=>{f<0&&k("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},vt.ERROR)});const R=Qt(n);ge(K(n,Le(v),xe(([f,k])=>{const w=k.groupIndices.length>0,$=[],A=k.lastSize;if(w){const y=Ia(k.sizeTree,0);let q=0,J=0;for(;q{let Ie=le.ranges;return le.prevSize!==0&&(Ie=[...le.ranges,{endIndex:ne+f-1,size:le.prevSize,startIndex:le.prevIndex}]),{prevIndex:ne+f,prevSize:be,ranges:Ie}},{prevIndex:f,prevSize:0,ranges:$}).ranges}return Qs(k.sizeTree).reduce((y,{k:q,v:J})=>({prevIndex:q+f,prevSize:J,ranges:[...y.ranges,{endIndex:q+f-1,size:y.prevSize,startIndex:y.prevIndex}]}),{prevIndex:0,prevSize:A,ranges:[]}).ranges})),a);const W=Qt(K(i,Le(v,C),xe(([f,{offsetTree:k},w])=>{const $=-f;return _a($,k,w)})));return ge(K(i,Le(v,C),xe(([f,k,w])=>{if(k.groupIndices.length>0){if(et(k.sizeTree))return k;let A=na();const y=ot(g);let q=0,J=0,re=0;for(;q<-f;){re=y[J];const le=y[J+1]-re-1;J++,q+=le+1}if(A=Qs(k.sizeTree).reduce((le,{k:ne,v:be})=>Ut(le,Math.max(0,ne+f),be),A),q!==-f){const le=Ia(k.sizeTree,re);A=Ut(A,0,le);const ne=as(k.sizeTree,-f+1)[1];A=Ut(A,1,ne)}return{...k,sizeTree:A,...tn(k.offsetTree,0,A,w)}}const $=Qs(k.sizeTree).reduce((A,{k:y,v:q})=>Ut(A,Math.max(0,y+f),q),na());return{...k,sizeTree:$,...tn(k.offsetTree,0,$,w)}})),v),{beforeUnshiftWith:R,data:N,defaultItemSize:m,firstItemIndex:l,fixedItemSize:d,fixedGroupSize:p,gap:C,groupIndices:c,heightEstimates:h,itemSize:b,listRefresh:L,shiftWith:i,shiftWithOffset:W,sizeRanges:a,sizes:v,statefulTotalCount:o,totalCount:r,trackItemSizes:I,unshiftWith:n}},at($s,un),{singleton:!0});function Dd(t){return t.reduce((s,a)=>(s.groupIndices.push(s.totalCount),s.totalCount+=a+1,s),{groupIndices:[],totalCount:0})}const Fi=Ke(([{groupIndices:t,sizes:s,totalCount:a},{headerHeight:r,scrollTop:o}])=>{const n=Be(),i=Be(),l=Qt(K(n,xe(Dd)));return ge(K(l,xe(c=>c.totalCount)),a),ge(K(l,xe(c=>c.groupIndices)),t),ge(K(ht(o,s,r),ke(([c,d])=>wr(d)),xe(([c,d,m])=>as(d.groupOffsetTree,Math.max(c-m,0),"v")[0]),st(),xe(c=>[c])),i),{groupCounts:n,topItemsIndexes:i}},at(fs,Dt)),Fs=Ke(([{log:t}])=>{const s=Z(!1),a=Qt(K(s,ke(r=>r),st()));return Xe(s,r=>{r&&ot(t)("props updated",{},vt.DEBUG)}),{didMount:a,propsReady:s}},at($s),{singleton:!0}),$d=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Oi(t){const s=typeof t=="number"?{index:t}:t;return s.align||(s.align="start"),(!s.behavior||!$d)&&(s.behavior="auto"),s.offset===void 0&&(s.offset=0),s}const za=Ke(([{gap:t,listRefresh:s,sizes:a,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:n,footerHeight:i,headerHeight:l,scrollingInProgress:c,scrollTo:d,smoothScrollTargetReached:m,viewportHeight:p},{log:h}])=>{const b=Be(),N=Be(),C=Z(0);let S=null,v=null,g=null;function I(){S!==null&&(S(),S=null),g!==null&&(g(),g=null),v&&(clearTimeout(v),v=null),Ae(c,!1)}return ge(K(b,Le(a,p,r,C,l,i,h),Le(t,n,o),xe(([[L,R,W,f,k,w,$,A],y,q,J])=>{const re=Oi(L),{align:le,behavior:ne,offset:be}=re,Ie=f-1,de=$i(re,R,Ie);let fe=_a(de,R.offsetTree,y)+w;le==="end"?(fe+=q+as(R.sizeTree,de)[1]-W+J,de===Ie&&(fe+=$)):le==="center"?fe+=(q+as(R.sizeTree,de)[1]-W+J)/2:fe-=k,be!==void 0&&be!==0&&(fe+=be);const H=ee=>{I(),ee?(A("retrying to scroll to",{location:L},vt.DEBUG),Ae(b,L)):(Ae(N,!0),A("list did not change, scroll successful",{},vt.DEBUG))};if(I(),ne==="smooth"){let ee=!1;g=Xe(s,oe=>{ee=ee||oe}),S=ss(m,()=>{H(ee)})}else S=ss(K(s,Fd(150)),H);return v=setTimeout(()=>{I()},1200),Ae(c,!0),A("scrolling from index to",{behavior:ne,index:de,top:fe},vt.DEBUG),{behavior:ne,top:fe}})),d),{scrollTargetReached:N,scrollToIndex:b,topListHeight:C}},at(fs,Dt,$s),{singleton:!0});function Fd(t){return s=>{const a=setTimeout(()=>{s(!1)},t);return r=>{r&&(s(!0),clearTimeout(a))}}}function xn(t,s){t===0?s():requestAnimationFrame(()=>{xn(t-1,s)})}function pn(t,s){const a=s-1;return typeof t=="number"?t:t.index==="LAST"?a:t.index}const La=Ke(([{defaultItemSize:t,listRefresh:s,sizes:a},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:n},{didMount:i}])=>{const l=Z(!0),c=Z(0),d=Z(!0);return ge(K(i,Le(c),ke(([m,p])=>p!==0),ls(!1)),l),ge(K(i,Le(c),ke(([m,p])=>p!==0),ls(!1)),d),Xe(K(ht(s,i),Le(l,a,t,d),ke(([[,m],p,{sizeTree:h},b,N])=>m&&(!et(h)||ln(b))&&!p&&!N),Le(c)),([,m])=>{ss(o,()=>{Ae(d,!0)}),xn(4,()=>{ss(r,()=>{Ae(l,!0)}),Ae(n,m)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:c,scrolledToInitialItem:l}},at(fs,Dt,za,Fs),{singleton:!0});function Pi(t,s){return Math.abs(t-s)<1.01}const Ea="up",ya="down",Od="none",Pd={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Bd=0,Da=Ke(([{footerHeight:t,headerHeight:s,scrollBy:a,scrollContainerState:r,scrollTop:o,viewportHeight:n}])=>{const i=Z(!1),l=Z(!0),c=Be(),d=Be(),m=Z(4),p=Z(Bd),h=Rt(K(Xr(K(Se(o),Vs(1),ls(!0)),K(Se(o),Vs(1),ls(!1),no(100))),st()),!1),b=Rt(K(Xr(K(a,ls(!0)),K(a,ls(!1),no(200))),st()),!1);ge(K(ht(Se(o),Se(p)),xe(([g,I])=>g<=I),st()),l),ge(K(l,ks(50)),d);const N=Qt(K(ht(r,Se(n),Se(s),Se(t),Se(m)),ds((g,[{scrollHeight:I,scrollTop:L},R,W,f,k])=>{const w=L+R-I>-k,$={scrollHeight:I,scrollTop:L,viewportHeight:R};if(w){let y,q;return L>g.state.scrollTop?(y="SCROLLED_DOWN",q=g.state.scrollTop-L):(y="SIZE_DECREASED",q=g.state.scrollTop-L||g.scrollTopDelta),{atBottom:!0,atBottomBecause:y,scrollTopDelta:q,state:$}}let A;return $.scrollHeight>g.state.scrollHeight?A="SIZE_INCREASED":Rg!==void 0&&g.atBottom===I.atBottom))),C=Rt(K(r,ds((g,{scrollHeight:I,scrollTop:L,viewportHeight:R})=>{if(!Pi(g.scrollHeight,I)){const W=I-(L+R)<1;return g.scrollTop!==L&&W?{changed:!0,jump:g.scrollTop-L,scrollHeight:I,scrollTop:L}:{changed:!0,jump:0,scrollHeight:I,scrollTop:L}}return{changed:!1,jump:0,scrollHeight:I,scrollTop:L}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ke(g=>g.changed),xe(g=>g.jump)),0);ge(K(N,xe(g=>g.atBottom)),i),ge(K(i,ks(50)),c);const S=Z(ya);ge(K(r,xe(({scrollTop:g})=>g),st(),ds((g,I)=>ot(b)?{direction:g.direction,prevScrollTop:I}:{direction:Ig.direction)),S),ge(K(r,ks(50),ls(Od)),S);const v=Z(0);return ge(K(h,ke(g=>!g),ls(0)),v),ge(K(o,ks(100),Le(h),ke(([g,I])=>I),ds(([g,I],[L])=>[I,L],[0,0]),xe(([g,I])=>I-g)),v),{atBottomState:N,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:d,atTopThreshold:p,isAtBottom:i,isAtTop:l,isScrolling:h,lastJumpDueToItemResize:C,scrollDirection:S,scrollVelocity:v}},at(Dt)),Ra="top",Ma="bottom",co="none";function uo(t,s,a){return typeof t=="number"?a===Ea&&s===Ra||a===ya&&s===Ma?t:0:a===Ea?s===Ra?t.main:t.reverse:s===Ma?t.main:t.reverse}function mo(t,s){return typeof t=="number"?t:t[s]??0}const hn=Ke(([{deviation:t,fixedHeaderHeight:s,headerHeight:a,scrollTop:r,viewportHeight:o}])=>{const n=Be(),i=Z(0),l=Z(0),c=Z(0),d=Rt(K(ht(Se(r),Se(o),Se(a),Se(n,Ta),Se(c),Se(i),Se(s),Se(t),Se(l)),xe(([m,p,h,[b,N],C,S,v,g,I])=>{const L=m-g,R=S+v,W=Math.max(h-L,0);let f=co;const k=mo(I,Ra),w=mo(I,Ma);return b-=g,b+=h+v,N+=h+v,N-=g,b>m+R-k&&(f=Ea),Nm!==null),st(Ta)),[0,0]);return{increaseViewportBy:l,listBoundary:n,overscan:c,topListHeight:i,visibleRange:d}},at(Dt),{singleton:!0});function Hd(t,s,a){if(wr(s)){const r=Di(t,s);return[{index:as(s.groupOffsetTree,r)[0],offset:0,size:0},{data:a?.[0],index:r,offset:0,size:0}]}return[{data:a?.[0],index:t,offset:0,size:0}]}const Rr={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function er(t,s,a,r,o,n){const{lastIndex:i,lastOffset:l,lastSize:c}=o;let d=0,m=0;if(t.length>0){d=t[0].offset;const C=t[t.length-1];m=C.offset+C.size}const p=a-i,h=l+p*c+(p-1)*r,b=d,N=h-m;return{bottom:m,firstItemIndex:n,items:xo(t,o,n),offsetBottom:N,offsetTop:d,top:b,topItems:xo(s,o,n),topListHeight:s.reduce((C,S)=>S.size+C,0),totalCount:a}}function Bi(t,s,a,r,o,n){let i=0;if(a.groupIndices.length>0)for(const m of a.groupIndices){if(m-i>=t)break;i++}const l=t+i,c=pn(s,l),d=Array.from({length:l}).map((m,p)=>({data:n[p+c],index:p+c,offset:0,size:0}));return er(d,[],l,o,a,r)}function xo(t,s,a){if(t.length===0)return[];if(!wr(s))return t.map(d=>({...d,index:d.index+a,originalIndex:d.index}));const r=t[0].index,o=t[t.length-1].index,n=[],i=oa(s.groupOffsetTree,r,o);let l,c=0;for(const d of t){(!l||l.end{const C=Z([]),S=Z(0),v=Be(),g=Z(0);ge(n.topItemsIndexes,C);const I=Rt(K(ht(b,N,Se(c,Ta),Se(o),Se(r),Se(d),m,Se(C),Se(s),Se(a),Se(g),t),ke(([f,k,,w,,,,,,,,$])=>{const A=$!==void 0&&$.length!==w;return f&&!k&&!A}),xe(([,,[f,k],w,$,A,y,q,J,re,le,ne])=>{const be=$,{offsetTree:Ie,sizeTree:de}=be,fe=ot(S);if(w===0)return{...Rr,totalCount:w};if(f===0&&k===0)return fe===0?{...Rr,totalCount:w}:Bi(fe,A,$,J,re,ne||[]);if(et(de))return fe>0?null:er(Hd(pn(A,w),be,ne),[],w,re,be,J);const H=[];if(q.length>0){const te=q[0],E=q[q.length-1];let Y=0;for(const V of oa(de,te,E)){const pe=V.value,D=Math.max(V.start,te),j=Math.min(V.end,E);for(let _=D;_<=j;_++)H.push({data:ne?.[_],index:_,offset:Y,size:pe}),Y+=pe}}if(!y)return er([],H,w,re,be,J);const ee=q.length>0?q[q.length-1]+1:0,oe=Ed(Ie,f,k,ee);if(oe.length===0)return null;const Re=w-1,Fe=vr([],te=>{for(const E of oe){const Y=E.value;let V=Y.offset,pe=E.start;const D=Y.size;if(Y.offset=k);_++)te.push({data:ne?.[_],index:_,offset:V,size:D}),V+=D+re}}),Pe=po(le,Ra),G=po(le,Ma);if(Fe.length>0&&(Pe>0||G>0)){const te=Fe[0],E=Fe[Fe.length-1];if(Pe>0&&te.index>ee){const Y=Math.min(Pe,te.index-ee),V=[];let pe=te.offset;for(let D=te.index-1;D>=te.index-Y;D--){const j=oa(de,D,D)[0]?.value??te.size;pe-=j+re,V.unshift({data:ne?.[D],index:D,offset:pe,size:j})}Fe.unshift(...V)}if(G>0&&E.indexf!==null),st()),Rr);ge(K(t,ke(ln),xe(f=>f?.length)),o),ge(K(I,xe(f=>f.topListHeight)),p),ge(p,l),ge(K(I,xe(f=>[f.top,f.bottom])),i),ge(K(I,xe(f=>f.items)),v);const L=Qt(K(I,ke(({items:f})=>f.length>0),Le(o,t),ke(([{items:f},k])=>f[f.length-1].originalIndex===k-1),xe(([,f,k])=>[f-1,k]),st(Ta),xe(([f])=>f))),R=Qt(K(I,ks(200),ke(({items:f,topItems:k})=>f.length>0&&f[0].originalIndex===k.length),xe(({items:f})=>f[0].index),st())),W=Qt(K(I,ke(({items:f})=>f.length>0),xe(({items:f})=>{let k=0,w=f.length-1;for(;f[k].type==="group"&&kk;)w--;return{endIndex:f[w].index,startIndex:f[k].index}}),st(zi)));return{endReached:L,initialItemCount:S,itemsRendered:v,listState:I,minOverscanItemCount:g,rangeChanged:W,startReached:R,topItemsIndexes:C,...h}},at(fs,Fi,hn,La,za,Da,Fs,un),{singleton:!0}),Hi=Ke(([{fixedFooterHeight:t,fixedHeaderHeight:s,footerHeight:a,headerHeight:r},{listState:o}])=>{const n=Be(),i=Rt(K(ht(a,t,r,s,o),xe(([l,c,d,m,p])=>l+c+d+m+p.offsetBottom+p.bottom)),0);return ge(Se(i),n),{totalListHeight:i,totalListHeightChanged:n}},at(Dt,Ys),{singleton:!0}),Ud=Ke(([{viewportHeight:t},{totalListHeight:s}])=>{const a=Z(!1),r=Rt(K(ht(a,t,s),ke(([o])=>o),xe(([,o,n])=>Math.max(0,o-n)),ks(0),st()),0);return{alignToBottom:a,paddingTopAddition:r}},at(Dt,Hi),{singleton:!0}),Ui=Ke(()=>({context:Z(null)})),Gd=({itemBottom:t,itemTop:s,locationParams:{align:a,behavior:r,...o},viewportBottom:n,viewportTop:i})=>sn?{...o,align:a??"end",...r!==void 0?{behavior:r}:{}}:null,Gi=Ke(([{gap:t,sizes:s,totalCount:a},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:n,scrollingInProgress:i,scrollTop:l,viewportHeight:c},{scrollToIndex:d}])=>{const m=Be();return ge(K(m,Le(s,c,a,n,o,r,l),Le(t),xe(([[p,h,b,N,C,S,v,g],I])=>{const{calculateViewLocation:L=Gd,done:R,...W}=p,f=$i(p,h,N-1),k=_a(f,h.offsetTree,I)+C+S,w=k+as(h.sizeTree,f)[1],$=g+S,A=g+b-v,y=L({itemBottom:w,itemTop:k,locationParams:W,viewportBottom:A,viewportTop:$});return y!==null?R&&ss(K(i,ke(q=>!q),Vs(ot(i)?1:2)),R):R?.(),y}),ke(p=>p!==null)),d),{scrollIntoView:m}},at(fs,Dt,za,Ys,$s),{singleton:!0});function ho(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const Qd=(t,s)=>typeof t=="function"?ho(t(s)):s&&ho(t),Vd=Ke(([{listRefresh:t,totalCount:s,fixedItemSize:a,data:r},{atBottomState:o,isAtBottom:n},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:c,propsReady:d},{log:m},{scrollingInProgress:p},{context:h},{scrollIntoView:b}])=>{const N=Z(!1),C=Be();let S=null;function v(R){Ae(i,{align:"end",behavior:R,index:"LAST"})}Xe(K(ht(K(Se(s),Vs(1)),c),Le(Se(N),n,l,p),xe(([[R,W],f,k,w,$])=>{let A=W&&w,y="auto";return A&&(y=Qd(f,k||$),A=A&&y!==!1),{followOutputBehavior:y,shouldFollow:A,totalCount:R}}),ke(({shouldFollow:R})=>R)),({followOutputBehavior:R,totalCount:W})=>{S!==null&&(S(),S=null),ot(a)!==void 0?requestAnimationFrame(()=>{ot(m)("following output to ",{totalCount:W},vt.DEBUG),v(R)}):S=ss(t,()=>{ot(m)("following output to ",{totalCount:W},vt.DEBUG),v(R),S=null})});function g(R){const W=ss(o,f=>{R&&!f.atBottom&&f.notAtBottomBecause==="SIZE_INCREASED"&&S===null&&(ot(m)("scrolling to bottom due to increased size",{},vt.DEBUG),v("auto"))});setTimeout(W,100)}Xe(K(ht(Se(N),s,d),ke(([R,,W])=>R!==!1&&W),ds(({value:R},[,W])=>({refreshed:R===W,value:W}),{refreshed:!1,value:0}),ke(({refreshed:R})=>R),Le(N,s)),([,R])=>{ot(l)&&g(R!==!1)}),Xe(C,()=>{g(ot(N)!==!1)}),Xe(ht(Se(N),o),([R,W])=>{R!==!1&&!W.atBottom&&W.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&v("auto")});const I=Z(null),L=Be();return ge(Xr(K(Se(r),xe(R=>R?.length??0)),K(Se(s))),L),Xe(K(ht(K(L,Vs(1)),c),Le(Se(I),l,p,h),xe(([[R,W],f,k,w,$])=>W&&k&&f?.({context:$,totalCount:R,scrollingInProgress:w})),ke(R=>!!R),ks(0)),R=>{S!==null&&(S(),S=null),ot(a)!==void 0?requestAnimationFrame(()=>{ot(m)("scrolling into view",{}),Ae(b,R)}):S=ss(t,()=>{ot(m)("scrolling into view",{}),Ae(b,R),S=null})}),{autoscrollToBottom:C,followOutput:N,scrollIntoViewOnChange:I}},at(fs,Da,za,La,Fs,$s,Dt,Ui,Gi)),Wd=Ke(([{data:t,firstItemIndex:s,gap:a,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:n,listState:i},{didMount:l}])=>(ge(K(l,Le(n),ke(([,c])=>c!==0),Le(o,r,s,a,t),xe(([[,c],d,m,p,h,b=[]])=>Bi(c,d,m,p,h,b))),i),{}),at(fs,La,Ys,Fs),{singleton:!0}),qd=Ke(([{didMount:t},{scrollTo:s},{listState:a}])=>{const r=Z(0);return Xe(K(t,Le(r),ke(([,o])=>o!==0),xe(([,o])=>({top:o}))),o=>{ss(K(a,Vs(1),ke(n=>n.items.length>1)),()=>{requestAnimationFrame(()=>{Ae(s,o)})})}),{initialScrollTop:r}},at(Fs,Dt,Ys),{singleton:!0}),Qi=Ke(([{scrollVelocity:t}])=>{const s=Z(!1),a=Be(),r=Z(!1);return ge(K(t,Le(r,s,a),ke(([o,n])=>n!==!1&&n!==void 0),xe(([o,n,i,l])=>{const{enter:c,exit:d}=n;if(i){if(d(o,l))return!1}else if(c(o,l))return!0;return i}),st()),s),Xe(K(ht(s,t,a),Le(r)),([[o,n,i],l])=>{o&&l!==!1&&l!==void 0&&l.change&&l.change(n,i)}),{isSeeking:s,scrollSeekConfiguration:r,scrollSeekRangeChanged:a,scrollVelocity:t}},at(Da),{singleton:!0}),fn=Ke(([{scrollContainerState:t,scrollTo:s}])=>{const a=Be(),r=Be(),o=Be(),n=Z(!1),i=Z(void 0);return ge(K(ht(a,r),xe(([{scrollTop:l,viewportHeight:c},{offsetTop:d,listHeight:m}])=>({scrollHeight:m,scrollTop:Math.max(0,l-d),viewportHeight:c}))),t),ge(K(s,Le(r),xe(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),o),{customScrollParent:i,useWindowScroll:n,windowScrollContainerState:a,windowScrollTo:o,windowViewportRect:r}},at(Dt)),Yd=Ke(([{sizeRanges:t,sizes:s},{headerHeight:a,scrollTop:r},{initialTopMostItemIndex:o},{didMount:n},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:c}])=>{const d=Be(),m=Z(void 0),p=Z(null),h=Z(null);return ge(l,p),ge(c,h),Xe(K(d,Le(s,r,i,p,h,a)),([b,N,C,S,v,g,I])=>{const L=Md(N.sizeTree);S&&v!==null&&g!==null&&(C=v.scrollTop-g.offsetTop),C-=I,b({ranges:L,scrollTop:C})}),ge(K(m,ke(ln),xe(Kd)),o),ge(K(n,Le(m),ke(([,b])=>b!==void 0),st(),xe(([,b])=>b.ranges)),t),{getState:d,restoreStateFrom:m}},at(fs,Dt,La,Fs,fn));function Kd(t){return{align:"start",index:0,offset:t.scrollTop}}const Xd=Ke(([{topItemsIndexes:t}])=>{const s=Z(0);return ge(K(s,ke(a=>a>=0),xe(a=>Array.from({length:a}).map((r,o)=>o))),t),{topItemCount:s}},at(Ys));function Vi(t){let s=!1,a;return(()=>(s||(s=!0,a=t()),a))}const Jd=Vi(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Zd=Ke(([{deviation:t,scrollBy:s,scrollingInProgress:a,scrollTop:r},{isAtBottom:o,isScrolling:n,lastJumpDueToItemResize:i,scrollDirection:l},{listState:c},{beforeUnshiftWith:d,gap:m,shiftWithOffset:p,sizes:h},{log:b},{recalcInProgress:N}])=>{const C=Qt(K(c,Le(i),ds(([,v,g,I],[{bottom:L,items:R,offsetBottom:W,totalCount:f},k])=>{const w=L+W;let $=0;return g===f&&v.length>0&&R.length>0&&(R[0].originalIndex===0&&v[0].originalIndex===0||($=w-I,$!==0&&($+=k))),[$,R,f,w]},[0,[],0,0]),ke(([v])=>v!==0),Le(r,l,a,o,b,N),ke(([,v,g,I,,,L])=>!L&&!I&&v!==0&&g===Ea),xe(([[v],,,,,g])=>(g("Upward scrolling compensation",{amount:v},vt.DEBUG),v))));function S(v){v>0?(Ae(s,{behavior:"auto",top:-v}),Ae(t,0)):(Ae(t,0),Ae(s,{behavior:"auto",top:-v}))}return Xe(K(C,Le(t,n)),([v,g,I])=>{I&&Jd()?Ae(t,g-v):S(-v)}),Xe(K(ht(Rt(n,!1),t,N),ke(([v,g,I])=>!v&&!I&&g!==0),xe(([v,g])=>g),ks(1)),S),ge(K(p,xe(v=>({top:-v}))),s),Xe(K(d,Le(h,m),xe(([v,{groupIndices:g,lastSize:I,sizeTree:L},R])=>{function W(A){return A*(I+R)}if(g.length===0)return W(v);let f=0;const k=Ia(L,0);let w=0,$=0;for(;wv&&(f-=k,A=v-w+1),w+=A,f+=W(A),$++}return f})),v=>{Ae(t,v),requestAnimationFrame(()=>{Ae(s,{top:v}),requestAnimationFrame(()=>{Ae(t,0),Ae(N,!1)})})}),{deviation:t}},at(Dt,Da,Ys,fs,$s,un)),eu=Ke(([t,s,a,r,o,n,i,l,c,d,m])=>({...t,...s,...a,...r,...o,...n,...i,...l,...c,...d,...m}),at(hn,Wd,Fs,Qi,Hi,qd,Ud,fn,Gi,$s,Ui)),Wi=Ke(([{data:t,defaultItemSize:s,firstItemIndex:a,fixedItemSize:r,fixedGroupSize:o,gap:n,groupIndices:i,heightEstimates:l,itemSize:c,sizeRanges:d,sizes:m,statefulTotalCount:p,totalCount:h,trackItemSizes:b},{initialItemFinalLocationReached:N,initialTopMostItemIndex:C,scrolledToInitialItem:S},v,g,I,L,{scrollToIndex:R},W,{topItemCount:f},{groupCounts:k},w])=>{const{listState:$,minOverscanItemCount:A,topItemsIndexes:y,rangeChanged:q,...J}=L;return ge(q,w.scrollSeekRangeChanged),ge(K(w.windowViewportRect,xe(re=>re.visibleHeight)),v.viewportHeight),{data:t,defaultItemHeight:s,firstItemIndex:a,fixedItemHeight:r,fixedGroupHeight:o,gap:n,groupCounts:k,heightEstimates:l,initialItemFinalLocationReached:N,initialTopMostItemIndex:C,scrolledToInitialItem:S,sizeRanges:d,topItemCount:f,topItemsIndexes:y,totalCount:h,...I,groupIndices:i,itemSize:c,listState:$,minOverscanItemCount:A,scrollToIndex:R,statefulTotalCount:p,trackItemSizes:b,rangeChanged:q,...J,...w,...v,sizes:m,...g}},at(fs,La,Dt,Yd,Vd,Ys,za,Zd,Xd,Fi,eu));function tu(t,s){const a={},r={};let o=0;const n=t.length;for(;o(v[g]=I=>{const L=S[s.methods[g]];Ae(L,I)},v),{})}function m(S){return i.reduce((v,g)=>(v[g]=gd(S[s.events[g]]),v),{})}const p=he.forwardRef(function(S,v){const{children:g,...I}=S,[L]=he.useState(()=>vr(vd(t),f=>{c(f,I)})),[R]=he.useState(ro(m,L));Ga(()=>{for(const f of i)f in I&&Xe(R[f],I[f]);return()=>{Object.values(R).map(cn)}},[I,R,L]),Ga(()=>{c(L,I)}),he.useImperativeHandle(v,ao(d(L)));const W=a;return e.jsx(l.Provider,{value:L,children:a!==void 0?e.jsx(W,{...tu([...r,...o,...i],I),children:g}):g})}),h=S=>{const v=he.useContext(l);return he.useCallback(g=>{Ae(v[S],g)},[v,S])},b=S=>{const v=he.useContext(l)[S],g=he.useCallback(I=>Xe(v,I),[v]);return he.useSyncExternalStore(g,()=>ot(v),()=>ot(v))},N=S=>{const v=he.useContext(l)[S],[g,I]=he.useState(ro(ot,v));return Ga(()=>Xe(v,L=>{L!==g&&I(ao(L))}),[v,g]),g},C=parseInt(he.version)>=18?b:N;return{Component:p,useEmitter:(S,v)=>{const g=he.useContext(l)[S];Ga(()=>Xe(g,v),[v,g])},useEmitterValue:C,usePublisher:h}}const Yi=he.createContext(void 0),Ki=he.createContext(void 0),Mr="-webkit-sticky",fo="sticky",gn=Vi(()=>{if(typeof document>"u")return fo;const t=document.createElement("div");return t.style.position=Mr,t.style.position===Mr?Mr:fo}),Xi=typeof document<"u"?he.useLayoutEffect:he.useEffect;function Ar(t){return"self"in t}function su(t){return"body"in t}function Ji(t,s,a,r=ua,o,n){const i=he.useRef(null),l=he.useRef(null),c=he.useRef(null),d=he.useCallback(h=>{let b,N,C;const S=h.target;if(su(S)||Ar(S)){const g=Ar(S)?S:S.defaultView;C=n===!0?g.scrollX:g.scrollY,b=n===!0?g.document.documentElement.scrollWidth:g.document.documentElement.scrollHeight,N=n===!0?g.innerWidth:g.innerHeight}else C=n===!0?S.scrollLeft:S.scrollTop,b=n===!0?S.scrollWidth:S.scrollHeight,N=n===!0?S.offsetWidth:S.offsetHeight;const v=()=>{t({scrollHeight:b,scrollTop:Math.max(C,0),viewportHeight:N})};h.suppressFlushSync===!0?v():Gr.flushSync(v),l.current!==null&&(C===l.current||C<=0||C===b-N)&&(l.current=null,s(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,s,n]);he.useEffect(()=>{const h=o||i.current;return r(o||i.current),d({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",d,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",d)}},[i,d,a,r,o]);function m(h){const b=i.current;if(!b||(n===!0?"offsetWidth"in b&&b.offsetWidth===0:"offsetHeight"in b&&b.offsetHeight===0))return;const N=h.behavior==="smooth";let C,S,v;Ar(b)?(S=Math.max(Ls(b.document.documentElement,n===!0?"width":"height"),n===!0?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight),C=n===!0?b.innerWidth:b.innerHeight,v=n===!0?window.scrollX:window.scrollY):(S=b[n===!0?"scrollWidth":"scrollHeight"],C=Ls(b,n===!0?"width":"height"),v=b[n===!0?"scrollLeft":"scrollTop"]);const g=S-C;if(h.top=Math.ceil(Math.max(Math.min(g,h.top),0)),Pi(C,S)||h.top===v){t({scrollHeight:S,scrollTop:v,viewportHeight:C}),N&&s(!0);return}N?(l.current=h.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,l.current=null,s(!0)},1e3)):l.current=null,n===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},left:h.top}),b.scrollTo(h)}function p(h){n===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},...h.top!==void 0?{left:h.top}:{}}),i.current.scrollBy(h)}return{scrollByCallback:p,scrollerRef:i,scrollToCallback:m}}function bn(t){return t}const au=Ke(()=>{const t=Z(l=>`Item ${l}`),s=Z(l=>`Group ${l}`),a=Z({}),r=Z(bn),o=Z("div"),n=Z(ua),i=(l,c=null)=>Rt(K(a,xe(d=>d[l]),st()),c);return{components:a,computeItemKey:r,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:s,HeaderComponent:i("Header"),HeaderFooterTag:o,ItemComponent:i("Item","div"),itemContent:t,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:n,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),ru=Ke(([t,s])=>({...t,...s}),at(Wi,au)),nu=({height:t})=>e.jsx("div",{style:{height:t}}),ou={overflowAnchor:"none",position:gn(),zIndex:1},Zi={overflowAnchor:"none"},iu={...Zi,display:"inline-block",height:"100%"},go=he.memo(function({showTopList:t=!1}){const s=Te("listState"),a=qt("sizeRanges"),r=Te("useWindowScroll"),o=Te("customScrollParent"),n=qt("windowScrollContainerState"),i=qt("scrollContainerState"),l=o||r?n:i,c=Te("itemContent"),d=Te("context"),m=Te("groupContent"),p=Te("trackItemSizes"),h=Te("itemSize"),b=Te("log"),N=qt("gap"),C=Te("horizontalDirection"),{callbackRef:S}=jd(a,h,p,t?ua:l,b,N,o,C,Te("skipAnimationFrameInResizeObserver")),[v,g]=he.useState(0);wn("deviation",J=>{v!==J&&g(J)});const I=Te("EmptyPlaceholder"),L=Te("ScrollSeekPlaceholder")??nu,R=Te("ListComponent"),W=Te("ItemComponent"),f=Te("GroupComponent"),k=Te("computeItemKey"),w=Te("isSeeking"),$=Te("groupIndices").length>0,A=Te("alignToBottom"),y=Te("initialItemFinalLocationReached"),q=t?{}:{boxSizing:"border-box",...C?{display:"inline-block",height:"100%",marginLeft:v!==0?v:A?"auto":0,paddingLeft:s.offsetTop,paddingRight:s.offsetBottom,whiteSpace:"nowrap"}:{marginTop:v!==0?v:A?"auto":0,paddingBottom:s.offsetBottom,paddingTop:s.offsetTop},...y?{}:{visibility:"hidden"}};return!t&&s.totalCount===0&&I!==null&&I!==void 0?e.jsx(I,{..._t(I,d)}):e.jsx(R,{..._t(R,d),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:S,style:q,children:(t?s.topItems:s.items).map(J=>{const re=J.originalIndex,le=k(re+s.firstItemIndex,J.data,d);return w?u.createElement(L,{..._t(L,d),height:J.size,index:J.index,key:le,type:J.type||"item",...J.type==="group"?{}:{groupIndex:J.groupIndex}}):J.type==="group"?u.createElement(f,{..._t(f,d),"data-index":re,"data-item-index":J.index,"data-known-size":J.size,key:le,style:ou},m(J.index,d)):u.createElement(W,{..._t(W,d),...uu(W,J.data),"data-index":re,"data-item-group-index":J.groupIndex,"data-item-index":J.index,"data-known-size":J.size,key:le,style:C?iu:Zi},$?c(J.index,J.groupIndex,J.data,d):c(J.index,J.data,d))})})}),lu={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},cu={outline:"none",overflowX:"auto",position:"relative"},vn=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),el=(t,s,a=0)=>({...vn(t),position:s?"relative":"absolute",top:s?-a:0}),du={position:gn(),top:0,width:"100%",zIndex:1};function _t(t,s){if(typeof t!="string")return{context:s}}function uu(t,s){return{item:typeof t=="string"?void 0:s}}const mu=he.memo(function(){const t=Te("HeaderComponent"),s=qt("headerHeight"),a=Te("HeaderFooterTag"),r=qs(he.useMemo(()=>n=>{s(Ls(n,"height"))},[s]),!0,Te("skipAnimationFrameInResizeObserver")),o=Te("context");return t!=null?e.jsx(a,{ref:r,children:e.jsx(t,{..._t(t,o)})}):null}),xu=he.memo(function(){const t=Te("FooterComponent"),s=qt("footerHeight"),a=Te("HeaderFooterTag"),r=qs(he.useMemo(()=>n=>{s(Ls(n,"height"))},[s]),!0,Te("skipAnimationFrameInResizeObserver")),o=Te("context");return t!=null?e.jsx(a,{ref:r,children:e.jsx(t,{..._t(t,o)})}):null});function tl({useEmitter:t,useEmitterValue:s,usePublisher:a}){return he.memo(function({children:r,style:o,context:n,...i}){const l=a("scrollContainerState"),c=s("ScrollerComponent"),d=a("smoothScrollTargetReached"),m=s("scrollerRef"),p=s("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:b,scrollToCallback:N}=Ji(l,d,c,m,void 0,p);return t("scrollTo",N),t("scrollBy",h),e.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:b,style:{...p?cu:lu,...o},tabIndex:0,...i,..._t(c,n),children:r})})}function sl({useEmitter:t,useEmitterValue:s,usePublisher:a}){return he.memo(function({children:r,style:o,context:n,...i}){const l=a("windowScrollContainerState"),c=s("ScrollerComponent"),d=a("smoothScrollTargetReached"),m=s("totalListHeight"),p=s("deviation"),h=s("customScrollParent"),b=he.useRef(null),N=s("scrollerRef"),{scrollByCallback:C,scrollerRef:S,scrollToCallback:v}=Ji(l,d,c,N,h);return Xi(()=>(S.current=h||b.current?.ownerDocument.defaultView,()=>{S.current=null}),[S,h]),t("windowScrollTo",v),t("scrollBy",C),e.jsx(c,{ref:b,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...m!==0?{height:m+p}:void 0},...i,..._t(c,n),children:r})})}const pu=({children:t})=>{const s=he.useContext(Yi),a=qt("viewportHeight"),r=qt("fixedItemHeight"),o=Te("alignToBottom"),n=Te("horizontalDirection"),i=he.useMemo(()=>Ci(a,c=>Ls(c,n?"width":"height")),[a,n]),l=qs(i,!0,Te("skipAnimationFrameInResizeObserver"));return he.useEffect(()=>{s&&(a(s.viewportHeight),r(s.itemHeight))},[s,a,r]),e.jsx("div",{"data-viewport-type":"element",ref:l,style:vn(o),children:t})},hu=({children:t})=>{const s=he.useContext(Yi),a=qt("windowViewportRect"),r=qt("fixedItemHeight"),o=Te("customScrollParent"),n=Te("useWindowScroll"),i=Te("topListHeight"),l=Ti(a,o,Te("skipAnimationFrameInResizeObserver")),c=Te("alignToBottom");return he.useEffect(()=>{s&&(r(s.itemHeight),a({listHeight:0,offsetTop:0,visibleHeight:s.viewportHeight,visibleWidth:100}))},[s,a,r]),e.jsx("div",{"data-viewport-type":"window",ref:l,style:el(c,n,i),children:t})},fu=({children:t})=>{const s=Te("TopItemListComponent")??"div",a=Te("headerHeight"),r={...du,marginTop:`${a}px`},o=Te("context");return e.jsx(s,{style:r,..._t(s,o),children:t})},gu=he.memo(function(t){const s=Te("useWindowScroll"),a=Te("topItemsIndexes").length>0,r=Te("customScrollParent"),o=Te("context");return e.jsxs(r||s?wu:vu,{...t,context:o,children:[a&&e.jsx(fu,{children:e.jsx(go,{showTopList:!0})}),e.jsxs(r||s?hu:pu,{children:[e.jsx(mu,{}),e.jsx(go,{}),e.jsx(xu,{})]})]})}),{Component:bu,useEmitter:wn,useEmitterValue:Te,usePublisher:qt}=qi(ru,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},gu),vu=tl({useEmitter:wn,useEmitterValue:Te,usePublisher:qt}),wu=sl({useEmitter:wn,useEmitterValue:Te,usePublisher:qt}),Nu=bu,ju=Ke(()=>{const t=Z(d=>e.jsxs("td",{children:["Item $",d]})),s=Z(null),a=Z(d=>e.jsxs("td",{colSpan:1e3,children:["Group ",d]})),r=Z(null),o=Z(null),n=Z({}),i=Z(bn),l=Z(ua),c=(d,m=null)=>Rt(K(n,xe(p=>p[d]),st()),m);return{components:n,computeItemKey:i,context:s,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:o,fixedHeaderContent:r,itemContent:t,groupContent:a,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});at(Wi,ju);gn();const bo={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},yu={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:vo,floor:mr,max:Sa,min:zr,round:wo}=Math;function No(t,s,a){return Array.from({length:s-t+1}).map((r,o)=>({data:a===null?null:a[o+t],index:o+t}))}function Su(t){return{...yu,items:t}}function Qa(t,s){return t!==void 0&&t.width===s.width&&t.height===s.height}function ku(t,s){return t!==void 0&&t.column===s.column&&t.row===s.row}const Cu=Ke(([{increaseViewportBy:t,listBoundary:s,overscan:a,visibleRange:r},{footerHeight:o,headerHeight:n,scrollBy:i,scrollContainerState:l,scrollTo:c,scrollTop:d,smoothScrollTargetReached:m,viewportHeight:p},h,b,{didMount:N,propsReady:C},{customScrollParent:S,useWindowScroll:v,windowScrollContainerState:g,windowScrollTo:I,windowViewportRect:L},R])=>{const W=Z(0),f=Z(0),k=Z(bo),w=Z({height:0,width:0}),$=Z({height:0,width:0}),A=Be(),y=Be(),q=Z(0),J=Z(null),re=Z({column:0,row:0}),le=Be(),ne=Be(),be=Z(!1),Ie=Z(0),de=Z(!0),fe=Z(!1),H=Z(!1);Xe(K(N,Le(Ie),ke(([G,te])=>te!==0)),()=>{Ae(de,!1)}),Xe(K(ht(N,de,$,w,Ie,fe),ke(([G,te,E,Y,,V])=>G&&!te&&E.height!==0&&Y.height!==0&&!V)),([,,,,G])=>{Ae(fe,!0),xn(1,()=>{Ae(A,G)}),ss(K(d),()=>{Ae(s,[0,0]),Ae(de,!0)})}),ge(K(ne,ke(G=>G!=null&&G.scrollTop>0),ls(0)),f),Xe(K(N,Le(ne),ke(([,G])=>G!=null)),([,G])=>{G&&(Ae(w,G.viewport),Ae($,G.item),Ae(re,G.gap),G.scrollTop>0&&(Ae(be,!0),ss(K(d,Vs(1)),te=>{Ae(be,!1)}),Ae(c,{top:G.scrollTop})))}),ge(K(w,xe(({height:G})=>G)),p),ge(K(ht(Se(w,Qa),Se($,Qa),Se(re,(G,te)=>G!==void 0&&G.column===te.column&&G.row===te.row),Se(d)),xe(([G,te,E,Y])=>({gap:E,item:te,scrollTop:Y,viewport:G}))),le),ge(K(ht(Se(W),r,Se(re,ku),Se($,Qa),Se(w,Qa),Se(J),Se(f),Se(be),Se(de),Se(Ie)),ke(([,,,,,,,G])=>!G),xe(([G,[te,E],Y,V,pe,D,j,,_,T])=>{const{column:Q,row:ue}=Y,{height:ce,width:ae}=V,{width:Ce}=pe;if(j===0&&(G===0||Ce===0))return bo;if(ae===0){const At=pn(T,G),rs=At+Math.max(j-1,0);return Su(No(At,rs,D))}const Ne=al(Ce,ae,Q);let Je,$e;_?te===0&&E===0&&j>0?(Je=0,$e=j-1):(Je=Ne*mr((te+ue)/(ce+ue)),$e=Ne*vo((E+ue)/(ce+ue))-1,$e=zr(G-1,Sa($e,Ne-1)),Je=zr($e,Sa(0,Je))):(Je=0,$e=-1);const Ge=No(Je,$e,D),{bottom:ft,top:Nt}=jo(pe,Y,V,Ge),dt=vo(G/Ne),jt=dt*ce+(dt-1)*ue-ft;return{bottom:ft,itemHeight:ce,items:Ge,itemWidth:ae,offsetBottom:jt,offsetTop:Nt,top:Nt}})),k),ge(K(J,ke(G=>G!==null),xe(G=>G.length)),W),ge(K(ht(w,$,k,re),ke(([G,te,{items:E}])=>E.length>0&&te.height!==0&&G.height!==0),xe(([G,te,{items:E},Y])=>{const{bottom:V,top:pe}=jo(G,Y,te,E);return[pe,V]}),st(Ta)),s);const ee=Z(!1);ge(K(d,Le(ee),xe(([G,te])=>te||G!==0)),ee);const oe=Qt(K(ht(k,W),ke(([{items:G}])=>G.length>0),Le(ee),ke(([[G,te],E])=>{const Y=G.items[G.items.length-1].index===te-1;return(E||G.bottom>0&&G.itemHeight>0&&G.offsetBottom===0&&G.items.length===te)&&Y}),xe(([[,G]])=>G-1),st())),Re=Qt(K(Se(k),ke(({items:G})=>G.length>0&&G[0].index===0),ls(0),st())),Fe=Qt(K(Se(k),Le(be),ke(([{items:G},te])=>G.length>0&&!te),xe(([{items:G}])=>({endIndex:G[G.length-1].index,startIndex:G[0].index})),st(zi),ks(0)));ge(Fe,b.scrollSeekRangeChanged),ge(K(A,Le(w,$,W,re),xe(([G,te,E,Y,V])=>{const pe=Oi(G),{align:D,behavior:j,offset:_}=pe;let T=pe.index;T==="LAST"&&(T=Y-1),T=Sa(0,T,zr(Y-1,T));let Q=sn(te,V,E,T);return D==="end"?Q=wo(Q-te.height+E.height):D==="center"&&(Q=wo(Q-te.height/2+E.height/2)),_!==void 0&&_!==0&&(Q+=_),{behavior:j,top:Q}})),c);const Pe=Rt(K(k,xe(G=>G.offsetBottom+G.bottom)),0);return ge(K(L,xe(G=>({height:G.visibleHeight,width:G.visibleWidth}))),w),{customScrollParent:S,data:J,deviation:q,footerHeight:o,gap:re,headerHeight:n,increaseViewportBy:t,initialItemCount:f,itemDimensions:$,overscan:a,restoreStateFrom:ne,scrollBy:i,scrollContainerState:l,scrollHeight:y,scrollTo:c,scrollToIndex:A,scrollTop:d,smoothScrollTargetReached:m,totalCount:W,useWindowScroll:v,viewportDimensions:w,windowScrollContainerState:g,windowScrollTo:I,windowViewportRect:L,...b,gridState:k,horizontalDirection:H,initialTopMostItemIndex:Ie,totalListHeight:Pe,...h,endReached:oe,propsReady:C,rangeChanged:Fe,startReached:Re,stateChanged:le,stateRestoreInProgress:be,...R}},at(hn,Dt,Da,Qi,Fs,fn,$s));function al(t,s,a){return Sa(1,mr((t+a)/(mr(s)+a)))}function jo(t,s,a,r){const{height:o}=a;if(o===void 0||r.length===0)return{bottom:0,top:0};const n=sn(t,s,a,r[0].index);return{bottom:sn(t,s,a,r[r.length-1].index)+o,top:n}}function sn(t,s,a,r){const o=al(t.width,a.width,s.column),n=mr(r/o),i=n*a.height+Sa(0,n-1)*s.row;return i>0?i+s.row:i}const Iu=Ke(()=>{const t=Z(p=>`Item ${p}`),s=Z({}),a=Z(null),r=Z("virtuoso-grid-item"),o=Z("virtuoso-grid-list"),n=Z(bn),i=Z("div"),l=Z(ua),c=(p,h=null)=>Rt(K(s,xe(b=>b[p]),st()),h),d=Z(!1),m=Z(!1);return ge(Se(m),d),{components:s,computeItemKey:n,context:a,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:r,ItemComponent:c("Item","div"),itemContent:t,listClassName:o,ListComponent:c("List","div"),readyStateChanged:d,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Tu=Ke(([t,s])=>({...t,...s}),at(Cu,Iu)),_u=he.memo(function(){const t=tt("gridState"),s=tt("listClassName"),a=tt("itemClassName"),r=tt("itemContent"),o=tt("computeItemKey"),n=tt("isSeeking"),i=Yt("scrollHeight"),l=tt("ItemComponent"),c=tt("ListComponent"),d=tt("ScrollSeekPlaceholder"),m=tt("context"),p=Yt("itemDimensions"),h=Yt("gap"),b=tt("log"),N=tt("stateRestoreInProgress"),C=Yt("reportReadyState"),S=qs(he.useMemo(()=>v=>{const g=v.parentElement.parentElement.scrollHeight;i(g);const I=v.firstChild;if(I!==null){const{height:L,width:R}=I.getBoundingClientRect();p({height:L,width:R})}h({column:yo("column-gap",getComputedStyle(v).columnGap,b),row:yo("row-gap",getComputedStyle(v).rowGap,b)})},[i,p,h,b]),!0,!1);return Xi(()=>{t.itemHeight>0&&t.itemWidth>0&&C(!0)},[t]),N?null:e.jsx(c,{className:s,ref:S,..._t(c,m),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(v=>{const g=o(v.index,v.data,m);return n?e.jsx(d,{..._t(d,m),height:t.itemHeight,index:v.index,width:t.itemWidth},g):u.createElement(l,{..._t(l,m),className:a,"data-index":v.index,key:g},r(v.index,v.data,m))})})}),Eu=he.memo(function(){const t=tt("HeaderComponent"),s=Yt("headerHeight"),a=tt("headerFooterTag"),r=qs(he.useMemo(()=>n=>{s(Ls(n,"height"))},[s]),!0,!1),o=tt("context");return t!=null?e.jsx(a,{ref:r,children:e.jsx(t,{..._t(t,o)})}):null}),Ru=he.memo(function(){const t=tt("FooterComponent"),s=Yt("footerHeight"),a=tt("headerFooterTag"),r=qs(he.useMemo(()=>n=>{s(Ls(n,"height"))},[s]),!0,!1),o=tt("context");return t!=null?e.jsx(a,{ref:r,children:e.jsx(t,{..._t(t,o)})}):null}),Mu=({children:t})=>{const s=he.useContext(Ki),a=Yt("itemDimensions"),r=Yt("viewportDimensions"),o=qs(he.useMemo(()=>n=>{r(n.getBoundingClientRect())},[r]),!0,!1);return he.useEffect(()=>{s&&(r({height:s.viewportHeight,width:s.viewportWidth}),a({height:s.itemHeight,width:s.itemWidth}))},[s,r,a]),e.jsx("div",{ref:o,style:vn(!1),children:t})},Au=({children:t})=>{const s=he.useContext(Ki),a=Yt("windowViewportRect"),r=Yt("itemDimensions"),o=tt("customScrollParent"),n=tt("useWindowScroll"),i=Ti(a,o,!1);return he.useEffect(()=>{s&&(r({height:s.itemHeight,width:s.itemWidth}),a({listHeight:0,offsetTop:0,visibleHeight:s.viewportHeight,visibleWidth:s.viewportWidth}))},[s,a,r]),e.jsx("div",{ref:i,style:el(!1,n),children:t})},zu=he.memo(function({...t}){const s=tt("useWindowScroll"),a=tt("customScrollParent"),r=a||s?Du:Lu,o=a||s?Au:Mu,n=tt("context");return e.jsx(r,{...t,..._t(r,n),children:e.jsxs(o,{children:[e.jsx(Eu,{}),e.jsx(_u,{}),e.jsx(Ru,{})]})})}),{useEmitter:rl,useEmitterValue:tt,usePublisher:Yt}=qi(Tu,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},zu),Lu=tl({useEmitter:rl,useEmitterValue:tt,usePublisher:Yt}),Du=sl({useEmitter:rl,useEmitterValue:tt,usePublisher:Yt});function yo(t,s,a){return s!=="normal"&&s?.endsWith("px")!==!0&&a(`${t} was not resolved to pixel value correctly`,s,vt.WARN),s==="normal"?0:parseInt(s??"0",10)}function So(t){if(Array.isArray(t)){if(t.length<5||t.length>6)throw new Error(`Invalid bone format: expected [x,y,w,h,r,c?] but got ${t.length} elements`);const s=t;return{x:s[0],y:s[1],w:s[2],h:s[3],r:s[4],c:s[5]||void 0}}return t}const ko=new Set(["p","h1","h2","h3","h4","h5","h6","li","td","th"]);function $u(t,s="component",a){const r=t.getBoundingClientRect(),o=[],n=a?.leafTags?new Set([...ko,...a.leafTags]):ko,i=a?.captureRoundedBorders??!0,l=a?.excludeTags?new Set(a.excludeTags):null,c=a?.excludeSelectors??null;function d(m){const p=getComputedStyle(m);if(p.display==="none"||p.visibility==="hidden"||p.opacity==="0")return;const h=m.tagName.toLowerCase();if(l?.has(h)||c?.some(w=>m.matches(w)))return;const b=[...m.children].filter(w=>{const $=getComputedStyle(w);return $.display!=="none"&&$.visibility!=="hidden"&&$.opacity!=="0"}),N=h==="img"||h==="svg"||h==="video"||h==="canvas",C=h==="input"||h==="button"||h==="textarea"||h==="select",S=b.length===0||N||C||n.has(h),v=p.backgroundColor,g=v!=="rgba(0, 0, 0, 0)"&&v!=="transparent",I=p.backgroundImage!=="none",L=parseFloat(p.borderTopWidth)||0,R=i&&L>0&&p.borderTopColor!=="rgba(0, 0, 0, 0)"&&p.borderTopColor!=="transparent",W=(parseFloat(p.borderTopLeftRadius)||0)>0,f=g||I||R&&W,k=h==="tr"||h==="td"||h==="th"||h==="thead"||h==="tbody"||h==="table";if(S){const w=m.getBoundingClientRect();if(w.width<1||w.height<1)return;const $=N&&w.width>0&&w.height>0&&Math.abs(w.width-w.height)<4,A=k?0:$?"50%":Co(p,m)??8,y=r.width;o.push({x:y>0?+((w.left-r.left)/y*100).toFixed(4):0,y:Math.round(w.top-r.top),w:y>0?+(w.width/y*100).toFixed(4):0,h:Math.round(w.height),r:A});return}if(f){const w=m.getBoundingClientRect();if(w.width>=1&&w.height>=1){const $=k?0:Co(p,m)??8,A=r.width;o.push({x:A>0?+((w.left-r.left)/A*100).toFixed(4):0,y:Math.round(w.top-r.top),w:A>0?+(w.width/A*100).toFixed(4):0,h:Math.round(w.height),r:$,c:!0})}}for(const w of b)d(w)}for(const m of t.children)d(m);return{name:s,viewportWidth:Math.round(r.width),width:Math.round(r.width),height:Math.round(r.height),bones:o}}function Co(t,s){const a=parseFloat(t.borderTopLeftRadius)||0,r=parseFloat(t.borderTopRightRadius)||0,o=parseFloat(t.borderBottomRightRadius)||0,n=parseFloat(t.borderBottomLeftRadius)||0;if(a===0&&r===0&&o===0&&n===0)return;const i=s?(()=>{const d=s.getBoundingClientRect();return d.width>0&&d.height>0&&Math.abs(d.width-d.height)<4})():!1;return t.borderRadius==="50%"?"50%":Math.max(a,r,o,n)>9998?i?"50%":9999:a===r&&r===o&&o===n?a!==8?a:void 0:`${a}px ${r}px ${o}px ${n}px`}const Fu=new Map;function Ou(t){return Fu.get(t)}function Pu(){typeof window<"u"&&window.__BONEYARD_BUILD&&(window.__BONEYARD_SNAPSHOT=$u)}function Bu(){return typeof window<"u"&&window.__BONEYARD_BUILD===!0}function Hu(t,s){if(!("breakpoints"in t))return t;const a=Object.keys(t.breakpoints).map(Number).sort((o,n)=>o-n);if(a.length===0)return null;const r=[...a].reverse().find(o=>s>=o)??a[0];return t.breakpoints[r]??null}const Zs={angle:110,start:30,end:70,speed:"2s",lightHighlight:"#f7f7f7",darkHighlight:"#2c2c2c"},ga={speed:"1.8s",lightAdjust:.3,darkAdjust:.02},Io={web:{light:"#f0f0f0",dark:"#222222"}},Uu=/rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+))?\s*\)/;function To(t,s){const a=t.match(Uu);if(a){const[,r,o,n,i="1"]=a,l=Math.min(1,parseFloat(i)+s*.5);return`rgba(${r},${o},${n},${l.toFixed(3)})`}if(t.startsWith("#")&&t.length>=7){const r=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),n=parseInt(t.slice(5,7),16);if(!isNaN(r)&&!isNaN(o)&&!isNaN(n)){const i=Math.round(r+(255-r)*s),l=Math.round(o+(255-o)*s),c=Math.round(n+(255-n)*s);return`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}}return t}Pu();let is={};function _o({loading:t,children:s,name:a,initialBones:r,color:o,darkColor:n,animate:i,stagger:l=!1,transition:c=!1,boneClass:d,className:m,fallback:p,fixture:h,snapshotConfig:b}){const N=u.useRef(null),C=u.useRef(Math.random().toString(36).slice(2,8)).current,[S,v]=u.useState(0),[g,I]=u.useState(0),[L,R]=u.useState(!1);u.useEffect(()=>{if(typeof window>"u")return;const E=()=>{const pe=document.documentElement.classList.contains("dark")||!!N.current?.closest(".dark");R(pe)};E();const Y=new MutationObserver(E);Y.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});const V=window.matchMedia("(prefers-color-scheme: dark)");return V.addEventListener("change",E),()=>{Y.disconnect(),V.removeEventListener("change",E)}},[]);const W=o??is.color??Io.web.light,f=n??is.darkColor??Io.web.dark,k=L?f:W,w=i??is.animate??"pulse",$=w===!0?"pulse":w===!1?"solid":w;u.useEffect(()=>{const E=N.current;if(!E)return;const Y=new ResizeObserver(pe=>{const D=pe[0]?.contentRect;v(Math.round(D?.width??0)),D&&D.height>0&&I(Math.round(D.height))});Y.observe(E);const V=E.getBoundingClientRect();return v(Math.round(V.width)),V.height>0&&I(Math.round(V.height)),()=>Y.disconnect()},[]);const A={};if(a&&(A["data-boneyard"]=a,b&&(A["data-boneyard-config"]=JSON.stringify(b))),Bu())return e.jsx("div",{ref:N,className:m,style:{position:"relative"},...A,children:e.jsx("div",{children:h??s})});const[y,q]=u.useState(!1);u.useLayoutEffect(()=>{q(!0)},[]);const J=r??(a?Ou(a):void 0),re=y&&typeof window<"u"?window.innerWidth:0,le=S>0?S:re,ne=J&&le>0?Hu(J,le):null,be=d??is.boneClass,Ie=(()=>{const E=l??is.stagger;return E===!0?80:E===!1||!E?0:E})(),de=(()=>{const E=c??is.transition;return E===!0?300:E===!1||!E?0:E})(),[fe,H]=u.useState(!1),ee=u.useRef(t),oe=u.useRef(null);u.useEffect(()=>(ee.current&&!t&&de>0&&ne&&(oe.current&&clearTimeout(oe.current),H(!0),oe.current=setTimeout(()=>{H(!1),oe.current=null},de)),ee.current=t,()=>{oe.current&&clearTimeout(oe.current)}),[t,de,ne]);const Re=(t||fe)&&ne,Fe=t&&!ne&&!fe,Pe=g>0?g:ne?.height??0,G=ne?.height??0,te=Pe>0&&G>0?Pe/G:1;return e.jsxs("div",{ref:N,className:m,style:{position:"relative"},...A,children:[e.jsx("div",{"data-boneyard-content":"true",style:Re&&!fe?{visibility:"hidden"}:void 0,children:Fe?p:s}),Re&&e.jsx("div",{"data-boneyard-overlay":"true",style:{position:"absolute",inset:0,overflow:"hidden",opacity:fe?0:1,transition:de>0?`opacity ${de}ms ease-out`:void 0},children:e.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[ne.bones.filter(E=>!So(E).c).map((E,Y)=>{const V=So(E),pe=k;To(k,L?ga.darkAdjust:ga.lightAdjust);const D=V.w/100*(ne.width??0),j=V.r==="50%"&&Math.abs(D-V.h)<4,_={position:"absolute",left:`${V.x}%`,top:V.y*te,width:j?V.h*te:`${V.w}%`,height:V.h*te,borderRadius:typeof V.r=="string"?V.r:`${V.r}px`,backgroundColor:pe},T=is.speed;if($==="pulse")_.animation=`bp-${C} ${T??ga.speed} ease-in-out infinite`;else if($==="shimmer"){const Q=L?is.darkShimmerColor??Zs.darkHighlight:is.shimmerColor??Zs.lightHighlight,ue=is.shimmerAngle??Zs.angle;delete _.backgroundColor,_.backgroundImage=`linear-gradient(${ue}deg, ${pe} ${Zs.start}%, ${Q} 50%, ${pe} ${Zs.end}%)`,_.backgroundSize="200% 100%",_.animation=`bs-${C} ${T??Zs.speed} linear infinite`}return Ie>0&&(_.opacity=0,_.animation=`${_.animation?_.animation+",":""} by-${C} 0.3s ease-out ${Y*Ie}ms forwards`),e.jsx("div",{"data-boneyard-bone":"true",className:be,style:_},Y)}),$==="pulse"&&e.jsx("style",{children:`@keyframes bp-${C}{0%,100%{background-color:${k}}50%{background-color:${To(k,L?ga.darkAdjust:ga.lightAdjust)}}}`}),$==="shimmer"&&e.jsx("style",{children:`@keyframes bs-${C}{0%{background-position:200% 0}100%{background-position:-200% 0}}`}),Ie>0&&e.jsx("style",{children:`@keyframes by-${C}{from{opacity:0}to{opacity:1}}`})]})})]})}async function Nn(t){const s=Lt(Ue,"managedStudents");try{const n=Mt(s,Et("teacherId","==",t)),i=await Ot(n);if(!i.empty)return i.docs.map(c=>({id:c.id,...c.data()})).sort((c,d)=>String(c.name||"").localeCompare(String(d.name||"")))}catch{}const r=(await ol(t)).map(n=>n.id);if(r.length===0)return[];const o=new Map;for(let n=0;n{o.set(d.id,{id:d.id,...d.data()})})}return Array.from(o.values()).sort((n,i)=>String(n.name||"").localeCompare(String(i.name||"")))}async function Gu(t,s=[]){if(!t)return[];const a=Lt(Ue,"users"),r=new Map,o=(i,l)=>String(l.role||"").toLowerCase()!=="student"?null:{uid:i,name:String(l.name||l.displayName||"").trim()||"Student",email:String(l.email||"").trim(),lrn:l.lrn&&String(l.lrn).trim()||void 0,photo:l.photo?String(l.photo).trim()||void 0:l.photoURL&&String(l.photoURL).trim()||void 0,grade:l.grade&&String(l.grade).trim()||void 0,section:l.section&&String(l.section).trim()||void 0,classSectionId:l.classSectionId&&String(l.classSectionId).trim()||void 0,adviserTeacherId:l.adviserTeacherId&&String(l.adviserTeacherId).trim()||void 0,role:"student",createdAt:l.createdAt||void 0};try{const i=Mt(a,Et("role","==","student"),Et("adviserTeacherId","==",t));(await Ot(i)).docs.forEach(c=>{const d=o(c.id,c.data());d&&r.set(c.id,d)})}catch(i){console.warn("[studentService] adviser-scoped student query failed:",i)}const n=Array.from(new Set((s||[]).map(i=>(i||"").trim()).filter(i=>!!i)));for(let i=0;i{if(r.has(m.id))return;const p=o(m.id,m.data());p&&r.set(m.id,p)})}catch(c){console.warn("[studentService] section-scoped student query failed:",c)}}return Array.from(r.values()).sort((i,l)=>i.name.localeCompare(l.name))}function Qu(t){const s=`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name||"Student")}&background=random`,a=ql.now();return{id:t.uid,accountUid:t.uid,lrn:t.lrn,name:t.name,email:t.email,avatar:t.photo||s,teacherId:t.adviserTeacherId,grade:t.grade,gradeLevel:gs(t.grade)||void 0,section:t.section,classSectionId:t.classSectionId,riskLevel:"Low",engagementScore:0,avgQuizScore:0,weakestTopic:"N/A",classroomId:t.classSectionId||"",attendance:0,assignmentCompletion:0,lastActive:null,struggles:[],createdAt:t.createdAt||a,updatedAt:a,hasRegisteredAccount:!0,source:"registered"}}function Eo(t){return(t||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9\s]+/g," ").trim().replace(/\s+/g," ")}async function Vu(t){const s=(t.studentId||"").trim();if(!s)throw new Error("Cannot reassign section: studentId is required.");const a=(t.newClassSectionId||"").trim()||Ft(t.newGrade,t.newSection);if(!a)throw new Error("Cannot reassign section: a target class section is required.");const r=(t.teacherId||"").trim(),o=(t.teacherName||"").trim(),n=(t.schoolYear||"").trim(),i=(t.previousClassSectionId||"").trim();try{const l=pt(Ue,"managedStudents",s),c=await Ss(l);c.exists()&&await es(l,{grade:t.newGrade,section:t.newSection,classSectionId:a,gradeLevel:gs(t.newGrade)||t.newGrade,teacherId:r||c.data()?.teacherId,updatedAt:ct()})}catch(l){console.warn("[studentService] reassignStudentSection: managedStudents update failed:",l)}if(t.isRegisteredAccount)try{await ts(pt(Ue,"users",s),{grade:t.newGrade,section:t.newSection,classSectionId:a,adviserTeacherId:r||void 0,adviserTeacherName:o||void 0,updatedAt:ct()},{merge:!0})}catch(l){console.warn("[studentService] reassignStudentSection: users profile update failed:",l)}try{await Nr({classSectionId:a,grade:t.newGrade,section:t.newSection,schoolYear:n,ownerTeacherId:r,ownerTeacherName:o,studentUids:[s]})}catch(l){console.warn("[studentService] reassignStudentSection: ownership upsert failed:",l)}if(i&&i!==a)try{const l=pt(Ue,"classSectionOwnership",i),c=await Ss(l);if(c.exists()){const m=(c.data().studentUids||[]).filter(p=>p!==s);await es(l,{studentUids:m,updatedAt:ct()})}}catch(l){console.warn("[studentService] reassignStudentSection: previous-section cleanup failed:",l)}}async function Wu(t){const{apiService:s}=await ys(async()=>{const{apiService:d}=await import("./index-D9TvEOZX.js").then(m=>m.b7);return{apiService:d}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),a=(t.adviserTeacherId||"").trim();if(!a)throw new Error("createStudentAccountFromRoster requires adviserTeacherId.");const r=(t.email||"").trim().toLowerCase();if(!r)throw new Error("createStudentAccountFromRoster requires an email.");const o=(t.grade||"").trim(),n=(t.section||"").trim(),i=(t.classSectionId||"").trim()||(o&&n?Ft(o,n):""),c=((await s.createStudentAccount({name:(t.name||"").trim()||"Student",email:r,temporaryPassword:t.temporaryPassword,lrn:t.lrn?.trim()||void 0,grade:o||void 0,section:n||void 0,classSectionId:i||void 0,adviserTeacherId:a,adviserTeacherName:t.adviserTeacherName?.trim()||void 0,schoolYear:t.schoolYear?.trim()||void 0})).uid||"").trim();if(!c)throw new Error("Backend did not return a uid for the newly created student.");try{await ts(pt(Ue,"managedStudents",c),xr({accountUid:c,name:(t.name||"").trim()||"Student",email:r,lrn:t.lrn?.trim()||null,teacherId:a,grade:o||null,gradeLevel:gs(o)||null,section:n||null,classSectionId:i||null,classroomId:i||null,riskLevel:"Low",avgQuizScore:0,engagementScore:0,attendance:0,assignmentCompletion:0,weakestTopic:"",struggles:[],avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name||"Student")}&background=random`,hasRegisteredAccount:!0,source:"both",createdAt:ct(),updatedAt:ct()}))}catch(d){console.warn("[studentService] createStudentAccountFromRoster: managed-student merge failed:",d)}if(i&&o&&n)try{await Nr({classSectionId:i,grade:o,section:n,schoolYear:t.schoolYear||"",ownerTeacherId:a,ownerTeacherName:t.adviserTeacherName,studentUids:[c]})}catch(d){console.warn("[studentService] createStudentAccountFromRoster: ownership upsert failed:",d)}return{uid:c,email:r,temporaryPassword:t.temporaryPassword}}async function nl(t,s,a){const r=Ft(s,a),o=pt(Ue,"managedStudents",t);await es(o,{grade:s,section:a,classSectionId:r,updatedAt:ct()})}async function qu(t,s){const a=pt(Ue,"classSectionOwnership",s);await es(a,{studentUids:Wl(t),updatedAt:ct()}).catch(r=>console.warn("[studentService] removeStudentFromClass: ownership update failed:",r)),await pi(pt(Ue,"managedStudents",t)).catch(r=>console.warn("[studentService] removeStudentFromClass: managedStudents delete failed:",r))}function Ft(t,s){return[t,s].filter(Boolean).join("_").replace(/\s+/g,"_").toLowerCase()}function xr(t){const s=Object.entries(t).filter(([,a])=>a!==void 0);return Object.fromEntries(s)}function gs(t){const s=(t||"").trim();if(!s)return null;const a=s.match(/(\d{1,2})/);return a?`Grade ${a[1]}`:/^grade\s+/i.test(s)?s.replace(/\s+/g," ").trim().replace(/^grade/i,"Grade"):s}function ma(t){const a=gs(t)?.match(/(\d{1,2})/),r=a?Number.parseInt(a[1],10):Number.NaN;return Number.isFinite(r)?r>=11?"Senior High School":"Junior High School":null}function xa(t,s){const a=`${t||""} ${s||""}`.toUpperCase();if(!a.trim())return null;const r=["STEM","ABM","HUMSS","GAS","TVL","ICT"];for(const o of r)if(new RegExp(`\\b${o}\\b`).test(a))return o;return null}function xs(t){const s=(t||"").trim();if(!s)return{grade:"Grade 11",section:"Section A"};const[a="Grade 11",r="Section A"]=s.split(" - ").map(o=>o.trim());return{grade:a||"Grade 11",section:r||"Section A"}}function Ct(t){const s=t.metadata||{},a=t.className||s.className,r=xs(a),o=(t.grade||s.grade||r.grade||"").trim()||null,n=(t.section||s.section||r.section||"").trim()||null,i=(t.classSectionId||s.classSectionId||"").trim()||(o&&n?Ft(o,n):"")||null,l=(a||"").trim()||(o&&n?`${o} - ${n}`:"")||null,c=gs(t.gradeLevel||s.gradeLevel||o),d=(t.classification||s.classification||"").trim()||ma(c)||null,m=(t.strand||s.strand||"").trim()||xa(l,n)||null;return{classSectionId:i,className:l,grade:o,section:n,gradeLevel:c,classification:d,strand:m,schoolYear:(t.schoolYear||s.schoolYear||"").trim()||null,ownerTeacherId:(t.ownerTeacherId||s.ownerTeacherId||"").trim()||null,ownerTeacherName:(t.ownerTeacherName||s.ownerTeacherName||"").trim()||null,adviserTeacherId:(t.adviserTeacherId||s.adviserTeacherId||"").trim()||null,adviserTeacherName:(t.adviserTeacherName||s.adviserTeacherName||"").trim()||null,managerId:(t.managerId||s.managerId||"").trim()||null,managerName:(t.managerName||s.managerName||"").trim()||null}}function Yu(t){const s=(t.className||"").trim(),[a="",r=""]=s.split(" - "),o=(t.grade||a||"").trim()||null,n=(t.section||r||"").trim()||null,i=(t.classSectionId||"").trim()||(o&&n?Ft(o,n):"")||null,l=s||(o&&n?`${o} - ${n}`:null),c=gs(t.gradeLevel||o),d=(t.classification||"").trim()||ma(c),m=(t.strand||"").trim()||xa(l,n);return{classSectionId:i,className:l,grade:o,section:n,gradeLevel:c,classification:d,strand:m,schoolYear:(t.schoolYear||"").trim()||null,ownerTeacherId:(t.ownerTeacherId||"").trim()||null,ownerTeacherName:(t.ownerTeacherName||"").trim()||null,adviserTeacherId:(t.adviserTeacherId||"").trim()||null,adviserTeacherName:(t.adviserTeacherName||"").trim()||null,managerId:(t.managerId||"").trim()||null,managerName:(t.managerName||"").trim()||null}}async function ol(t){const s=Lt(Ue,"classrooms"),a=new Map,r=Mt(s,Et("teacherId","==",t));(await Ot(r)).docs.forEach(l=>{a.set(l.id,{id:l.id,...l.data()})});const n=Mt(s,Et("managerId","==",t));return(await Ot(n)).docs.forEach(l=>{a.set(l.id,{id:l.id,...l.data()})}),Array.from(a.values()).sort((l,c)=>String(l.name||"").localeCompare(String(c.name||"")))}async function Nr(t){const s=t.classSectionId||Ft(t.grade,t.section),a=pt(Ue,"classSectionOwnership",s),r=await Ss(a),o=r.exists()?r.data().studentUids||[]:[],n=Array.from(new Set([...t.studentUids||[],...o])),i=xr(t);return r.exists()?await es(a,{...i,classSectionId:s,studentUids:n,updatedAt:ct()}):await ts(a,{...i,classSectionId:s,studentUids:n,createdAt:ct(),updatedAt:ct()}),s}async function il(t){const s=(t.classSectionId||"").trim()||Ft(t.grade,t.section),a=(t.className||"").trim()||`${t.grade} - ${t.section}`,r=Yu({classSectionId:s,className:a,grade:t.grade,section:t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName,adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName,classification:t.classification,strand:t.strand,gradeLevel:t.gradeLevel});await Nr({classSectionId:s,className:a,grade:r.grade||t.grade,gradeLevel:r.gradeLevel||t.gradeLevel||t.grade,classification:r.classification||t.classification,strand:r.strand||t.strand,section:r.section||t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName,studentUids:[]});const o=Lt(Ue,"classrooms"),n=Mt(o,Et("classSectionId","==",s)),i=await Ot(n);if(i.empty){const l=xr({name:a,teacherId:t.ownerTeacherId,grade:r.grade,gradeLevel:r.gradeLevel,classification:r.classification,strand:r.strand,section:r.section,classSectionId:s,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName||"",adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName||"",managerId:t.managerId,managerName:t.managerName||"",classMetadata:r,schedule:"Mon-Fri",studentCount:0,avgScore:0,atRiskCount:0,createdAt:ct(),updatedAt:ct()});await ts(pt(Ue,"classrooms",s),l,{merge:!0})}else for(const l of i.docs){const c=xr({name:a,grade:r.grade,gradeLevel:r.gradeLevel,classification:r.classification,strand:r.strand,section:r.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId,ownerTeacherName:t.ownerTeacherName||"",adviserTeacherId:t.ownerTeacherId,adviserTeacherName:t.ownerTeacherName||"",managerId:t.managerId,managerName:t.managerName||"",classMetadata:r,updatedAt:ct()});await es(l.ref,c)}return s}async function jr(t,s,a,r,o,n){const i=Ft(s,a);await Nr({classSectionId:i,grade:s,section:a,schoolYear:o,ownerTeacherId:r,ownerTeacherName:n,studentUids:[t]});const l=await Ss(pt(Ue,"users",t)),c=l.exists()?l.data():{};await ts(pt(Ue,"users",t),{grade:s,section:a,classSectionId:i,adviserTeacherId:r,adviserTeacherName:n||"",updatedAt:ct()},{merge:!0}),await ts(pt(Ue,"managedStudents",t),{accountUid:t,name:c.name||c.displayName||"Student",email:c.email||"",lrn:c.lrn||null,teacherId:r,grade:s,gradeLevel:s,section:a,classSectionId:i,classroomId:i,hasRegisteredAccount:!0,source:"registered",updatedAt:ct()},{merge:!0})}async function Ku(t){const s=Lt(Ue,"classSectionOwnership"),a=new Map,r=Mt(s,Et("ownerTeacherId","==",t));(await Ot(r)).docs.forEach(l=>{a.set(l.id,{id:l.id,...l.data()})});const n=Mt(s,Et("managerId","==",t));return(await Ot(n)).docs.forEach(l=>{a.set(l.id,{id:l.id,...l.data()})}),Array.from(a.values()).sort((l,c)=>String(l.classSectionId||"").localeCompare(String(c.classSectionId||"")))}async function Xu(t="",s=25){const a=Lt(Ue,"users"),r=Math.max(1,Math.min(100,s)),o=Mt(a,Et("role","==","teacher"),nr(r*4)),n=await Ot(o),i=t.trim().toLowerCase();return n.docs.map(c=>{const d=c.data(),m=String(d.name||"").trim(),p=String(d.email||"").trim();return{uid:c.id,name:m||"Teacher",email:p,photo:String(d.photo||d.photoURL||"").trim()||void 0}}).filter(c=>i?c.name.toLowerCase().includes(i)||c.email.toLowerCase().includes(i):!0).sort((c,d)=>c.name.localeCompare(d.name)).slice(0,r)}function Ju(t,s,a=20){if(t.length===0)return s([]),()=>{};const r=Lt(Ue,"activities"),o=Mt(r,Et("classroomId","in",t),Yl("timestamp","desc"));return hi(o,n=>{const i=n.docs.slice(0,a).map(l=>({id:l.id,...l.data()}));s(i)},n=>{console.error("[studentService] subscribeToActivities error:",n),s([])})}const Zu=({open:t,onClose:s,onCreated:a,teacherName:r})=>{const{currentUser:o}=hs(),[n,i]=u.useState("details"),[l,c]=u.useState(""),d="Grade 11",[m,p]=u.useState(""),[h,b]=u.useState(!1),[N,C]=u.useState(""),[S,v]=u.useState([]),[g,I]=u.useState(new Set),[L,R]=u.useState(""),[W,f]=u.useState(!1);u.useEffect(()=>{t||(i("details"),c(""),p(""),C(""),I(new Set),R(""))},[t]),u.useEffect(()=>{t&&n==="students"&&k()},[t,n]);const k=async()=>{f(!0);try{const y=Lt(Ue,"users"),q=Mt(y,Et("role","==","student")),J=await Ot(q),re=[];J.docs.forEach(le=>{const ne=le.data();re.push({uid:le.id,name:ne.name||ne.displayName||"Student",email:ne.email||"",grade:ne.grade,section:ne.section})}),v(re.sort((le,ne)=>le.name.localeCompare(ne.name)))}catch(y){console.error("[CreateClassModal] Failed to load students:",y)}finally{f(!1)}},w=async()=>{if(o){if(!m.trim()){C("Section name is required");return}C(""),b(!0);try{const y=String(new Date().getFullYear());if(await il({classSectionId:"",grade:d,section:m.trim(),schoolYear:y,ownerTeacherId:o.uid,ownerTeacherName:r||o.displayName||"",managerId:o.uid,managerName:r||o.displayName||"",className:l.trim()||`${d} - ${m.trim()}`}),g.size>0){const q=Array.from(g).map(J=>jr(J,d,m.trim(),o.uid,y,r||o.displayName||""));await Promise.allSettled(q)}a(),s()}catch(y){C(y instanceof Error?y.message:"Failed to create class")}finally{b(!1)}}},$=y=>{I(q=>{const J=new Set(q);return J.has(y)?J.delete(y):J.add(y),J})},A=S.filter(y=>y.name.toLowerCase().includes(L.toLowerCase())||y.email.toLowerCase().includes(L.toLowerCase()));return t?e.jsx(zt,{children:e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(ze.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),e.jsxs(ze.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"relative bg-white rounded-2xl shadow-xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-[#f1f5f9]",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#1e293b]",children:n==="details"?"Create New Class":"Add Students"}),e.jsx("button",{onClick:s,className:"p-1 rounded-lg hover:bg-[#f1f5f9] transition-colors",children:e.jsx(Xt,{size:20,className:"text-[#64748b]"})})]}),e.jsxs("div",{className:"p-6 overflow-y-auto flex-1",children:[n==="details"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-[#475569] block mb-1.5",children:"Class Name"}),e.jsx(Cs,{placeholder:"e.g. Grade 11 - Section A",value:l,onChange:y=>c(y.target.value)}),e.jsx("p",{className:"text-xs text-[#94a3b8] mt-1",children:"Optional. Auto-generated from grade + section if empty."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-[#475569] block mb-1.5",children:"Section"}),e.jsx(Cs,{placeholder:"e.g. Section A, STEM-1, Rizal",value:m,onChange:y=>p(y.target.value)})]}),N&&e.jsx("p",{className:"text-sm text-rose-500",children:N})]}),n==="students"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ws,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#94a3b8]"}),e.jsx(Cs,{placeholder:"Search students...",value:L,onChange:y=>R(y.target.value),className:"pl-9"})]}),e.jsxs("p",{className:"text-xs text-[#64748b]",children:[g.size," student(s) selected"]}),W?e.jsx("p",{className:"text-sm text-[#64748b] text-center py-4",children:"Loading students..."}):A.length===0?e.jsx("p",{className:"text-sm text-[#64748b] text-center py-4",children:"No students found."}):e.jsx("div",{className:"space-y-1 max-h-[300px] overflow-y-auto",children:A.map(y=>e.jsxs("button",{onClick:()=>$(y.uid),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors ${g.has(y.uid)?"bg-purple-50 border border-purple-200":"hover:bg-[#f8fafc] border border-transparent"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-md border-2 flex items-center justify-center ${g.has(y.uid)?"bg-[#9956DE] border-[#9956DE]":"border-[#cbd5e1]"}`,children:g.has(y.uid)&&e.jsx(Ht,{size:12,className:"text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-[#1e293b] truncate",children:y.name}),e.jsx("p",{className:"text-xs text-[#64748b] truncate",children:y.email})]}),y.grade&&e.jsx("span",{className:"text-xs text-[#94a3b8]",children:y.grade})]},y.uid))}),N&&e.jsx("p",{className:"text-sm text-rose-500",children:N})]})]}),e.jsx("div",{className:"flex items-center justify-between p-6 border-t border-[#f1f5f9]",children:n==="details"?e.jsxs(e.Fragment,{children:[e.jsx(St,{variant:"outline",onClick:s,children:"Cancel"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(St,{variant:"outline",onClick:()=>{if(!m.trim()){C("Section is required");return}C(""),i("students")},children:"Add Students"}),e.jsx(St,{onClick:w,disabled:h||!m.trim(),className:"bg-[#9956DE] hover:bg-[#7c3aed] text-white",children:h?"Creating...":"Create Class"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(St,{variant:"outline",onClick:()=>i("details"),children:"Back"}),e.jsxs(St,{onClick:w,disabled:h,className:"bg-[#9956DE] hover:bg-[#7c3aed] text-white",children:[e.jsx(ca,{size:16,className:"mr-1"}),h?"Creating...":`Create with ${g.size} Student${g.size!==1?"s":""}`]})]})})]})]})}):null},em=({open:t,onClose:s,onAdded:a,grade:r,section:o,teacherName:n,existingStudentUids:i=[]})=>{const{currentUser:l}=hs(),[c,d]=u.useState([]),[m,p]=u.useState(new Set),[h,b]=u.useState(""),[N,C]=u.useState(!1),[S,v]=u.useState(!1);u.useEffect(()=>{t&&(p(new Set),b(""),g())},[t]);const g=async()=>{C(!0);try{const R=Mt(Lt(Ue,"users"),Et("role","==","student")),f=(await Ot(R)).docs.filter(k=>!i.includes(k.id)).map(k=>{const w=k.data();return{uid:k.id,name:w.name||w.displayName||"Student",email:w.email||""}}).sort((k,w)=>k.name.localeCompare(w.name));d(f)}catch{}C(!1)},I=async()=>{if(!(!l||m.size===0)){v(!0);try{const R=String(new Date().getFullYear()),W=Array.from(m).map(f=>jr(f,r,o,l.uid,R,n||l.displayName||""));await Promise.allSettled(W),ie.success(`Added ${m.size} student(s) to class`),a(),s()}catch{ie.error("Failed to add students")}v(!1)}},L=c.filter(R=>R.name.toLowerCase().includes(h.toLowerCase())||R.email.toLowerCase().includes(h.toLowerCase()));return t?e.jsx(zt,{children:e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(ze.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:s}),e.jsxs(ze.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"relative bg-white rounded-2xl shadow-xl w-full max-w-2xl mx-4 max-h-[80vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#f1f5f9]",children:[e.jsxs("h2",{className:"text-base font-semibold text-[#1e293b]",children:["Add Students to ",r," - ",o]}),e.jsx("button",{onClick:s,className:"p-1 rounded-lg hover:bg-[#f1f5f9]",children:e.jsx(Xt,{size:18,className:"text-[#64748b]"})})]}),e.jsxs("div",{className:"p-4 space-y-3 flex-1 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Ws,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#94a3b8]"}),e.jsx(Cs,{placeholder:"Search students...",value:h,onChange:R=>b(R.target.value),className:"pl-8 h-9 text-sm"})]}),e.jsx("button",{onClick:()=>{m.size===L.length?p(new Set):p(new Set(L.map(R=>R.uid)))},className:"text-[11px] font-semibold text-[#9956DE] hover:text-[#7c3aed] bg-[#9956DE]/10 hover:bg-[#9956DE]/20 px-3 py-1.5 rounded-lg transition-colors whitespace-nowrap",children:m.size===L.length&&L.length>0?"Deselect All":"Select All"})]}),e.jsxs("p",{className:"text-xs text-[#64748b]",children:[m.size," of ",L.length," selected"]}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-1 min-h-[300px]",children:N?e.jsx("p",{className:"text-sm text-center text-[#64748b] py-6",children:"Loading..."}):L.length===0?e.jsx("p",{className:"text-sm text-center text-[#64748b] py-6",children:"No students available"}):L.map(R=>e.jsxs("button",{onClick:()=>p(W=>{const f=new Set(W);return f.has(R.uid)?f.delete(R.uid):f.add(R.uid),f}),className:`w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left transition-colors ${m.has(R.uid)?"bg-purple-50 border border-purple-200":"hover:bg-[#f8fafc] border border-transparent"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-md border-2 flex items-center justify-center shrink-0 ${m.has(R.uid)?"bg-[#9956DE] border-[#9956DE]":"border-[#cbd5e1]"}`,children:m.has(R.uid)&&e.jsx(Ht,{size:12,className:"text-white"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-[#1e293b] truncate",children:R.name}),e.jsx("p",{className:"text-[11px] text-[#64748b] truncate",children:R.email})]})]},R.uid))})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-[#f1f5f9]",children:[e.jsx(St,{variant:"outline",size:"sm",onClick:s,children:"Cancel"}),e.jsxs(St,{size:"sm",onClick:I,disabled:S||m.size===0,className:"bg-[#9956DE] hover:bg-[#7c3aed] text-white",children:[e.jsx(li,{size:14,className:"mr-1.5"}),S?"Adding...":`Add ${m.size} Student${m.size!==1?"s":""}`]})]})]})]})}):null},ll="https://deign86-mathpulse-api-v3test.hf.space";async function cl(){const t={"Content-Type":"application/json"},s=ci.currentUser;if(s)try{const a=await s.getIdToken(!1);a&&(t.Authorization=`Bearer ${a}`)}catch{}return t}async function Ro(t,s=!1){const a=await cl(),r=`${ll}/api/analytics/class/${encodeURIComponent(t)}${s?"?refresh=true":""}`,o=await fetch(r,{headers:a});if(!o.ok)throw new Error(`GET class analytics failed: ${o.status}`);return o.json()}async function tm(t){const s=await cl(),a=await fetch(`${ll}/api/analytics/class/${encodeURIComponent(t)}/refresh-insights`,{method:"POST",headers:s});if(!a.ok)throw a.status===429?new Error("Insights can only be refreshed once every 5 minutes."):new Error(`POST refresh insights failed: ${a.status}`);return a.json()}const yr="https://deign86-mathpulse-api-v3test.hf.space";async function Sr(){const t={"Content-Type":"application/json"},s=ci.currentUser;if(s)try{const a=await s.getIdToken(!1);a&&(t.Authorization=`Bearer ${a}`)}catch{}return t}async function an(t){const s=await Sr(),a=await fetch(`${yr}/api/intervention/${encodeURIComponent(t)}`,{headers:s});if(!a.ok)throw new Error(`GET intervention failed: ${a.status}`);return a.json()}async function dl(t){const s=await Sr(),a=await fetch(`${yr}/api/intervention/generate`,{method:"POST",headers:s,body:JSON.stringify({student_id:t})});if(!a.ok)throw new Error(`POST intervention/generate failed: ${a.status}`);return a.json()}async function ul(t,s,a,r){const o=await Sr(),n=await fetch(`${yr}/api/intervention/${encodeURIComponent(t)}/step/${s}/complete`,{method:"POST",headers:o,body:JSON.stringify({score:a,time_spent_minutes:r})});if(!n.ok)throw new Error(`POST step complete failed: ${n.status}`);return n.json()}async function sm(t){const s=await Sr(),a=await fetch(`${yr}/api/intervention/${encodeURIComponent(t)}/export-pdf`,{headers:s});if(!a.ok)throw new Error(`GET export-pdf failed: ${a.status}`);return a.json()}async function ml(t,s){const r=(t.learning_path?.steps||[]).map(n=>({title:`Step ${n.step_number}: ${n.title}`,content:`${n.description||n.topic} (${n.type.replace("_"," ")} · ${n.duration_minutes} mins${n.num_items?` · ${n.num_items} items`:""})`}));return(await Kl(Lt(Ue,"modules"),{title:`Intervention: ${t.weakest_topic} — ${t.student_name}`,gradeLevel:t.grade_level||"Grade 11",subject:"General Mathematics",quarter:"Q1",strandOrTrack:null,competencyTags:t.weak_topics.slice(0,3),moduleType:"teacher_uploaded",sourceLabel:"Teacher Upload",summary:t.next_steps_summary||`Personalized intervention for ${t.weakest_topic}`,learningObjectives:[t.learning_strengths,t.next_steps_summary].filter(Boolean),sections:r,practice:[],teacherId:s,assignedTo:t.student_id,createdAt:ct()})).id}const am=Object.freeze(Object.defineProperty({__proto__:null,assignLearningPathAsModule:ml,completeStep:ul,generateInterventionPlan:dl,getExportPDFData:sm,getInterventionPlan:an},Symbol.toStringTag,{value:"Module"}));function rm(t,s=!0){const[a,r]=u.useState([]),[o,n]=u.useState(!1),[i,l]=u.useState(null);return u.useEffect(()=>{if(!t||!s){r([]);return}let c=!1;return n(!0),l(null),ac(t).then(d=>{c||r(d)}).catch(d=>{c||l(d.message)}).finally(()=>{c||n(!1)}),()=>{c=!0}},[t,s]),{videos:a,isLoading:o,error:i}}const nm=({step:t,isActive:s})=>{const{videos:a,isLoading:r,error:o}=rm(t.youtube_query||`${t.topic} math tutorial Philippines`,s);return s?e.jsxs("div",{className:"mt-4",children:[o&&e.jsxs("p",{className:"text-xs text-red-400 mb-2",children:["Could not load videos: ",o]}),e.jsx(rc,{videos:r?[]:a,topic:t.title})]}):null},om={video_lesson:e.jsx(Ja,{className:"w-5 h-5"}),practice:e.jsx(or,{className:"w-5 h-5"}),assessment:e.jsx(Aa,{className:"w-5 h-5"}),chat_session:e.jsx(ji,{className:"w-5 h-5"}),review:e.jsx(cs,{className:"w-5 h-5"})},Mo={easy:"bg-emerald-100 text-emerald-700",medium:"bg-amber-100 text-amber-700",hard:"bg-rose-100 text-rose-700"},im=({step:t,studentId:s,studentName:a,totalSteps:r,onClose:o,onStepCompleted:n})=>{const[i,l]=u.useState(!1),[c,d]=u.useState([{role:"assistant",content:`Hi ${a}! Let's work on "${t.title}". ${t.description||`This covers ${t.topic}.`} Ready to start?`}]),[m,p]=u.useState(""),h=async()=>{l(!0);try{await ul(s,t.step_number,0,t.duration_minutes),n(t.step_number),ie.success(`Step ${t.step_number} completed!`),o()}catch{ie.error("Failed to mark step as complete.")}finally{l(!1)}},b=()=>{if(!m.trim())return;const N=m.trim();d(C=>[...C,{role:"user",content:N}]),p(""),setTimeout(()=>{d(C=>[...C,{role:"assistant",content:`Great question about ${t.topic}! Let me help you understand this step by step. What part are you finding most challenging?`}])},1e3)};return e.jsx(zt,{children:e.jsxs(ze.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",onClick:o,children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(ze.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"relative bg-white rounded-[24px] shadow-[0_24px_64px_rgba(0,0,0,0.18)] w-full max-w-[800px] max-h-[85vh] flex flex-col overflow-hidden z-10",onClick:N=>N.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-100 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center text-white",children:om[t.type]||e.jsx(or,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-[15px] font-bold text-[#1e293b]",children:t.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsxs("span",{className:"text-[11px] text-[#64748b]",children:["Step ",t.step_number," of ",r]}),t.competency_tag&&e.jsx("span",{className:"px-1.5 py-0.5 bg-indigo-50 text-indigo-600 text-[9px] font-mono rounded",children:t.competency_tag}),e.jsx("span",{className:`px-2 py-0.5 text-[10px] font-semibold rounded-full ${Mo[t.difficulty]||Mo.easy}`,children:t.difficulty})]})]})]}),e.jsx("button",{onClick:o,className:"w-8 h-8 rounded-full bg-slate-100 hover:bg-slate-200 flex items-center justify-center transition-colors",children:e.jsx(Xt,{className:"w-4 h-4 text-slate-500"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-slate-50 rounded-[14px] p-4 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Ms,{className:"w-4 h-4 text-slate-500"}),e.jsxs("span",{className:"text-[12px] font-semibold text-slate-600",children:[t.duration_minutes," minutes"]}),t.num_items&&e.jsxs("span",{className:"text-[12px] text-slate-500",children:["• ",t.num_items," items"]})]}),e.jsx("p",{className:"text-[13px] text-[#475569] leading-relaxed",children:t.description||`Work through ${t.topic} at ${t.difficulty} difficulty.`})]}),t.type==="video_lesson"&&e.jsx(nm,{step:t,isActive:!0}),(t.type==="practice"||t.type==="assessment")&&e.jsxs("div",{className:"bg-purple-50/50 rounded-[14px] p-6 border border-purple-100 flex flex-col items-center justify-center min-h-[160px]",children:[e.jsx(or,{className:"w-10 h-10 text-purple-400 mb-3"}),e.jsxs("p",{className:"text-[13px] font-semibold text-purple-700",children:[t.type==="assessment"?"Assessment":"Practice"," Questions"]}),e.jsxs("p",{className:"text-[11px] text-purple-500 mt-1",children:[t.num_items||10," questions on ",t.topic]})]})]}),e.jsxs("div",{className:"flex flex-col bg-slate-50 rounded-[14px] border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-slate-100 bg-white",children:e.jsxs("p",{className:"text-[12px] font-semibold text-[#1e293b] flex items-center gap-1.5",children:[e.jsx(ji,{className:"w-3.5 h-3.5 text-indigo-500"})," AI Guide",e.jsx("span",{className:"text-[9px] font-medium text-slate-400 ml-1",children:"(Preview)"})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-[200px] max-h-[300px]",children:c.map((N,C)=>e.jsx("div",{className:`flex ${N.role==="user"?"justify-end":"justify-start"}`,children:e.jsx("div",{className:`max-w-[85%] px-3 py-2 rounded-[12px] text-[12px] leading-relaxed ${N.role==="user"?"bg-indigo-500 text-white":"bg-white border border-slate-200 text-[#475569]"}`,children:N.content})},C))}),e.jsxs("div",{className:"p-3 border-t border-slate-100 bg-white flex gap-2",children:[e.jsx("input",{type:"text",value:m,onChange:N=>p(N.target.value),onKeyDown:N=>N.key==="Enter"&&b(),placeholder:"Ask for help...",className:"flex-1 text-[12px] px-3 py-2 rounded-[10px] border border-slate-200 focus:outline-none focus:border-indigo-300"}),e.jsx("button",{onClick:b,className:"w-8 h-8 rounded-full bg-indigo-500 hover:bg-indigo-600 flex items-center justify-center text-white transition-colors",children:e.jsx(sa,{className:"w-3.5 h-3.5"})})]})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-slate-100 flex items-center justify-between shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-full bg-slate-200 h-2 rounded-full overflow-hidden",style:{width:120},children:e.jsx("div",{className:"h-full bg-indigo-500 rounded-full",style:{width:`${t.step_number/r*100}%`}})}),e.jsxs("span",{className:"text-[11px] text-slate-500",children:[t.step_number,"/",r]})]}),e.jsxs("button",{onClick:h,disabled:i||t.is_completed,className:"flex items-center gap-2 px-5 py-2.5 bg-emerald-500 hover:bg-emerald-600 text-white text-[13px] font-semibold rounded-full transition-colors disabled:opacity-50 shadow-sm",children:[e.jsx(Aa,{className:"w-4 h-4"}),t.is_completed?"Completed ✓":i?"Saving...":"Mark as Complete"]})]})]})]})})};async function lm(t,s,a){const r=pt(Lt(Ue,"generatedLessonPlans"));return await ts(r,{...t,teacherId:s,teacherName:a?.teacherName||null,studentId:a?.studentId||null,studentName:a?.studentName||null,status:"draft",createdAt:ct(),updatedAt:ct()}),r.id}async function cm(t){const s=pt(Ue,"generatedLessonPlans",t),a=await Ss(s);if(!a.exists())throw new Error("Lesson draft not found. Save draft before publishing.");if(!a.data().publishReady)throw new Error("Lesson is not publish-ready. Resolve source legitimacy and validation issues first.");await es(s,{status:"published",publishedAt:ct(),updatedAt:ct()})}async function Ao(t,s=!0){const a=t.learningCompetency||t.lessonTitle||t.focusTopics&&t.focusTopics[0]||"general mathematics",r=t.subject||"general_math",o=t.quarter??1;let n="",i=[],l,c,d,m=!1;if(s)try{const b=await zl(a,r,o,{lessonTitle:t.lessonTitle,learningCompetency:t.learningCompetency,moduleUnit:t.moduleUnit,learnerLevel:t.learnerLevel});i=b.sources||[],n=b.explanation||"",l=b.retrievalConfidence,c=b.retrievalBand,d=b.retrievalQuery,m=b.needsReview??!1}catch{n="",i=[]}const p={...t,subject:r,quarter:o,curriculumContext:n?`[CURRICULUM CONTEXT] +${n}`:void 0,curriculumRetrievalConfidence:l,curriculumRetrievalBand:c,curriculumRetrievalQuery:d,needsReview:m};return{...await xt.generateLessonPlan(p),curriculumSources:i,curriculumContext:n}}const dm=Ql("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function um({className:t,variant:s,asChild:a=!1,...r}){const o=a?cc:"span";return e.jsx(o,{"data-slot":"badge",className:di(dm({variant:s}),t),...r})}function mm(t){return t.length<=42?t:`${t.slice(0,18)}...${t.slice(-20)}`}const zo=({sources:t=[],className:s})=>t.length?e.jsxs(dc,{children:[e.jsx(uc,{asChild:!0,children:e.jsxs(um,{className:["bg-[#75D06A]/15 text-[#2E7D32] border-[#75D06A]/40 font-body font-semibold text-[11px] px-2.5 py-1 rounded-full cursor-help",s||""].join(" "),variant:"outline",children:[e.jsx(Gt,{size:12}),"DepEd Aligned"]})}),e.jsxs(mc,{side:"top",sideOffset:6,className:"max-w-sm bg-white border border-[#dde3eb] text-[#0a1628] shadow-lg p-3",children:[e.jsx("p",{className:"text-[11px] font-display font-bold uppercase tracking-wide text-[#5a6578] mb-2",children:"Curriculum Sources"}),e.jsx("div",{className:"space-y-2",children:t.slice(0,5).map((a,r)=>e.jsxs("div",{className:"text-xs leading-relaxed",children:[e.jsxs("p",{className:"font-semibold text-[#0a1628]",children:[a.subject," | Q",a.quarter]}),e.jsxs("p",{className:"text-[#5a6578]",children:[mm(a.sourceFile)," | p.",a.page]}),e.jsxs("p",{className:"text-[#5a6578]",children:["Similarity: ",(a.score*100).toFixed(1),"%"]})]},`${a.sourceFile}-${a.page}-${r}`))})]})]}):null,xm=[{level:"Remember",icon:Hr,bgColor:"bg-sky-500/20",borderColor:"border-sky-500/40",textColor:"text-sky-400",description:"Recall facts, formulas, definitions, and basic procedures.",mathExample:"State the quadratic formula.",mapsTo:"Identification, Enumeration",defaultWeight:"Included by default"},{level:"Understand",icon:Gt,bgColor:"bg-sky-500/20",borderColor:"border-sky-500/40",textColor:"text-sky-400",description:"Explain concepts, interpret graphs, classify mathematical objects.",mathExample:"Explain why the discriminant determines the number of roots.",mapsTo:"Multiple Choice, Identification",defaultWeight:"Included by default"},{level:"Apply",icon:Ll,bgColor:"bg-green-500/20",borderColor:"border-green-500/40",textColor:"text-green-400",description:"Use formulas and procedures to solve routine problems.",mathExample:"Solve: 2x² + 5x - 3 = 0 using the quadratic formula.",mapsTo:"Equation-Based, Word Problem",defaultWeight:"Included by default"},{level:"Analyze",icon:Pc,bgColor:"bg-orange-500/20",borderColor:"border-orange-500/40",textColor:"text-orange-400",description:"Break down problems, compare solution methods, identify patterns.",mathExample:"Given f(x) = x³ - 3x, find and classify all critical points.",mapsTo:"Word Problem, Equation-Based",defaultWeight:"Included by default"}],pm=({isOpen:t,onClose:s})=>t?e.jsx(zt,{children:t&&e.jsx(ze.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[70] flex items-center justify-center p-4",onClick:s,children:e.jsxs(ze.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-white border border-slate-200 rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col overflow-hidden",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 px-6 py-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(ui,{size:22,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-white",children:"Bloom's Taxonomy in MathPulse AI"}),e.jsx("p",{className:"text-cyan-200 text-xs",children:"Understanding cognitive levels in assessments"})]})]}),e.jsx("button",{onClick:s,className:"w-8 h-8 bg-white/20 hover:bg-white/30 rounded-lg flex items-center justify-center transition-colors",children:e.jsx(Xt,{size:16,className:"text-white"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-2",children:"What is Bloom's Taxonomy?"}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Bloom's Taxonomy is an educational framework developed by Benjamin Bloom in 1956 and revised in 2001. It classifies learning objectives into six cognitive levels, from basic recall of facts up to complex evaluation and creation. MathPulse AI uses the first four levels most relevant to Senior High School mathematics."})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-2",children:"Why MathPulse AI Uses It"}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:"Using Bloom's Taxonomy ensures that assessments do not only test memorization. A well-balanced math quiz should challenge students at multiple cognitive levels: remembering formulas, understanding concepts, applying procedures, and analyzing relationships. This mirrors the DepEd K-12 competency framework which requires higher-order thinking skills (HOTS) alongside foundational knowledge."})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-rose-400 uppercase tracking-wide mb-3",children:"Level-by-Level Breakdown"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:xm.map(a=>{const r=a.icon;return e.jsxs("div",{className:`${a.bgColor} border ${a.borderColor} rounded-xl p-4 space-y-2`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{size:18,className:a.textColor}),e.jsx("span",{className:`font-bold text-sm ${a.textColor}`,children:a.level})]}),e.jsx("p",{className:"text-xs text-slate-500",children:a.description}),e.jsxs("div",{className:"bg-black/20 rounded-lg p-2",children:[e.jsx("p",{className:"text-[10px] font-semibold text-slate-500 uppercase tracking-wide mb-0.5",children:"Math Example"}),e.jsx("p",{className:"text-xs text-[#dde3eb] italic",children:a.mathExample})]}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsxs("span",{className:"text-slate-500",children:["Maps to: ",e.jsx("span",{className:"text-slate-500 font-medium",children:a.mapsTo})]}),e.jsx("span",{className:"text-green-400 font-medium",children:a.defaultWeight})]})]},a.level)})})]}),e.jsx("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4",children:e.jsxs("p",{className:"text-xs text-slate-500 leading-relaxed",children:[e.jsx("span",{className:"font-semibold text-slate-600",children:"Note:"})," ","All four levels are selected by default to produce a balanced, HOTS-aligned assessment. Deselecting a level will remove questions of that cognitive depth from the generated quiz."]})})]}),e.jsxs("div",{className:"border-t border-slate-200 px-6 py-3 flex items-center justify-between flex-shrink-0 bg-slate-50",children:[e.jsxs("a",{href:"https://cft.vanderbilt.edu/guides-sub-pages/blooms-taxonomy/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-rose-400 hover:text-rose-300 font-medium transition-colors",children:[e.jsx(Qc,{size:12}),"Learn More"]}),e.jsx("button",{onClick:s,className:"px-5 py-2 bg-sky-600 hover:bg-rose-500 text-white text-sm font-bold rounded-xl transition-colors",children:"Got it"})]})]})})}):null,hm={draft:"bg-[#edf1f7] text-[#5a6578]",published:"bg-green-100 text-green-700",assigned:"bg-sky-100 text-sky-700",completed:"bg-rose-100 text-rose-700"},Va={identification:{label:"Identification",icon:e.jsx(Es,{size:16}),description:"Define or identify concepts"},enumeration:{label:"Enumeration",icon:e.jsx(ir,{size:16}),description:"List steps or properties"},multiple_choice:{label:"Multiple Choice",icon:e.jsx(Ht,{size:16}),description:"Choose from 4 options"},word_problem:{label:"Word Problem",icon:e.jsx(Gt,{size:16}),description:"Real-world scenarios"},equation_based:{label:"Equation-Based",icon:e.jsx(Dl,{size:16}),description:"Solve equations"}},Lo={remember:{label:"Remember",color:"bg-sky-100 text-sky-700 border-sky-300",description:"Recall facts & formulas"},understand:{label:"Understand",color:"bg-emerald-100 text-emerald-700 border-emerald-300",description:"Explain concepts"},apply:{label:"Apply",color:"bg-rose-100 text-rose-700 border-rose-300",description:"Use in new contexts"},analyze:{label:"Analyze",color:"bg-rose-100 text-rose-700 border-rose-300",description:"Examine & compare"}},fm=["Grade 11","Grade 12"],Lr=t=>{const s=(t||"").trim().toLowerCase();return s==="grade 12"||s==="12"||s.includes("12")?"Grade 12":"Grade 11"},gm={"Grade 11":{"General Mathematics - Patterns, Relations, and Functions":["Patterns and Real-Life Relationships","Functions as Mathematical Models","Function Notation and Evaluation","Domain and Range of Functions","Operations on Functions","Composite Functions","Inverse Functions","Graphs of Rational Functions","Graphs of Exponential Functions","Graphs of Logarithmic Functions"],"General Mathematics - Financial Mathematics":["Simple and Compound Interest","Simple and General Annuities","Present and Future Value","Loans, Amortization, and Sinking Funds","Stocks, Bonds, and Market Indices","Business Decision-Making with Mathematical Models"],"General Mathematics - Logic and Mathematical Reasoning":["Propositions and Logical Connectives","Truth Values and Truth Tables","Logical Equivalence and Implication","Quantifiers and Negation","Validity of Arguments"]},"Grade 12":{"Pre-Calculus - Analytic Geometry":["Conic Sections - Parabola","Conic Sections - Ellipse","Conic Sections - Hyperbola","Conic Sections - Circle","Systems of Nonlinear Equations"],"Pre-Calculus - Series and Induction":["Sequences and Series","Arithmetic Sequences","Geometric Sequences","Mathematical Induction","Binomial Theorem"],"Pre-Calculus - Trigonometry":["Angles and Unit Circle","Trigonometric Functions","Trigonometric Identities","Sum and Difference Formulas","Inverse Trigonometric Functions","Polar Coordinates"],"Basic Calculus - Limits":["Limits of Functions","Limit Theorems","One-Sided Limits","Infinite Limits and Limits at Infinity","Continuity of Functions"],"Basic Calculus - Derivatives":["Definition of the Derivative","Differentiation Rules","Chain Rule","Implicit Differentiation","Higher-Order Derivatives","Related Rates","Extrema and the First Derivative Test","Concavity and the Second Derivative Test","Optimization Problems"],"Basic Calculus - Integration":["Antiderivatives and Indefinite Integrals","Definite Integrals and the FTC","Integration by Substitution","Area Under a Curve"]}},bm={"Grade 11":["General Mathematics - "],"Grade 12":["Pre-Calculus - ","Basic Calculus - "]},Do=(t,s)=>{const a=bm[s];return Object.fromEntries(Object.entries(t).filter(([r])=>a.some(o=>r.startsWith(o))))},ba=30,va=12,Dr="mathpulse:quiz-maker:active-task",vm={easy:"text-green-600",medium:"text-rose-600",hard:"text-red-600"},xl=({onBack:t,gradeLevel:s,selectedClassId:a,selectedClassName:r,onOpenNotifications:o,onOpenProfile:n,onOpenInsightModal:i,userPhoto:l,teacherName:c,drawerMode:d=!1,onQuizSaved:m,onQuizGenerating:p})=>{const{currentUser:h,loading:b}=hs(),N=u.useMemo(()=>xt.getImportGroundedRolloutFlags(),[]),[C,S]=u.useState("create"),[v,g]=u.useState("setup"),[I,L]=u.useState(Lr(s)),[R,W]=u.useState(10),[f,k]=u.useState([]),[w,$]=u.useState([]),[A,y]=u.useState(["multiple_choice","word_problem","identification"]),[q,J]=u.useState(["remember","understand","apply","analyze"]),[re,le]=u.useState(!1),[ne,be]=u.useState({easy:30,medium:50,hard:20}),[Ie,de]=u.useState({}),[fe,H]=u.useState(!1),[ee,oe]=u.useState([]),[Re,Fe]=u.useState(!1),[Pe,G]=u.useState(""),[te,E]=u.useState(!1),[Y,V]=u.useState(!1),[pe,D]=u.useState(null),[j,_]=u.useState(0),[T,Q]=u.useState("queued"),[ue,ce]=u.useState("Waiting to start generation..."),[ae,Ce]=u.useState(null),[Ne,Je]=u.useState(null),[$e,Ge]=u.useState(""),[ft,Nt]=u.useState(!1),dt=u.useRef(!1),[jt,At]=u.useState("topics"),[rs,Is]=u.useState(null),[bs,Ps]=u.useState(!1),[ns,vs]=u.useState("all"),[os,z]=u.useState("all"),[me,We]=u.useState(!1),[B,kt]=u.useState(null),[Me,M]=u.useState(!1),[O,ve]=u.useState(!1),[we,qe]=u.useState(!1),[je,yt]=u.useState([]),[it,se]=u.useState(!1),[rt,nt]=u.useState(""),[ut,ws]=u.useState(null),[Ks,Ts]=u.useState([]),[Fa,Xs]=u.useState(!1),[Bs,Oa]=u.useState("all"),[Pa,Ba]=u.useState(null),[Ha,Hs]=u.useState(null),pa=u.useCallback(async()=>{H(!0);const x=Lr(I);try{const F=await xt.getQuizTopics(x);F.topics&&de(Do(F.topics,x))}catch{de(Do(gm[x],x))}finally{H(!1)}},[I]),P=u.useCallback(async()=>{if(!N.quizEnabled){oe([]),G("Import-grounded quiz generation is disabled by rollout flag; using curriculum defaults."),Fe(!1);return}Fe(!0),G("");try{const x=await xt.getCourseMaterialTopics({classSectionId:a,limit:20}),F=(x.topics||[]).filter(U=>U.title?.trim());oe(F),x.warnings&&x.warnings.length>0&&G(x.warnings.join(" "))}catch{oe([]),G("Imported topics are currently unavailable; quiz generation will use curriculum defaults.")}finally{Fe(!1)}},[a,N.quizEnabled]);u.useEffect(()=>{pa(),k([]),$([])},[pa]),u.useEffect(()=>{P()},[P]);const X=u.useMemo(()=>{const x=Array.from(new Set(ee.map(F=>F.title.trim()).filter(Boolean)));return x.length===0?Ie:{"Imported Course Materials":x,...Ie}},[Ie,ee]);u.useEffect(()=>{vs("all"),z("all")},[ae]);const Ee=u.useMemo(()=>{if(!ae)return[];const x=ae.questions.map(U=>U.provenance?.sourceFile?.trim()).filter(U=>!!U),F=(ae.metadata.topicProvenance||[]).map(U=>U.sourceFile?.trim()).filter(U=>!!U);return Array.from(new Set([...x,...F])).sort((U,ye)=>U.localeCompare(ye))},[ae]),Oe=u.useMemo(()=>{if(!ae)return[];const x=ae.questions.map(U=>U.provenance?.materialId?.trim()).filter(U=>!!U),F=(ae.metadata.topicProvenance||[]).map(U=>U.materialId?.trim()).filter(U=>!!U);return Array.from(new Set([...x,...F])).sort((U,ye)=>U.localeCompare(ye))},[ae]),Pt=u.useMemo(()=>ae?ae.questions.filter(x=>{const F=ns==="all"||(x.provenance?.sourceFile||"").trim()===ns,U=os==="all"||(x.provenance?.materialId||"").trim()===os;return F&&U}):[],[ae,ns,os]),De=(x,F)=>{const U={...ne},ye=Math.max(0,Math.min(100,U[x]+F)),Qe=ye-U[x];U[x]=ye;const Ze=Object.keys(U).filter(mt=>mt!==x),Vt=Ze.reduce((mt,Jt)=>mt+U[Jt],0);if(Vt>0)for(const mt of Ze)U[mt]=Math.max(0,Math.round(U[mt]-Qe*U[mt]/Vt));const Js=Object.values(U).reduce((mt,Jt)=>mt+Jt,0);if(Js!==100){const mt=Ze.reduce((Jt,An)=>U[Jt]>=U[An]?Jt:An);U[mt]+=100-Js}be(U)},Ua=x=>{k(F=>F.includes(x)?F.filter(U=>U!==x):[...F,x]),$(F=>F.filter(U=>U!==x))},Bt=x=>{y(F=>F.includes(x)?F.length>1?F.filter(U=>U!==x):F:[...F,x])},Ye=x=>{J(F=>F.includes(x)?F.length>1?F.filter(U=>U!==x):F:[...F,x])},ha=()=>{let x=f.length>0?f.filter(U=>!w.includes(U)):Object.values(X).flat().filter(U=>!w.includes(U)).slice(0,3);x.length>va&&(x=x.slice(0,va));const F=Math.min(R,ba);return{topics:x,gradeLevel:I,numQuestions:F,questionTypes:A,includeGraphs:re,difficultyDistribution:ne,bloomLevels:q,excludeTopics:w,classSectionId:a,className:r,preferImportedTopics:N.quizEnabled}},fa=u.useCallback((x,F)=>{const U={taskId:x,request:F,createdAt:new Date().toISOString(),ownerUid:h?.uid};try{sessionStorage.setItem(Dr,JSON.stringify(U))}catch{}},[h]),Ns=u.useCallback(()=>{try{sessionStorage.removeItem(Dr)}catch{}},[]),kr=u.useCallback(x=>{const F=Math.max(0,Math.min(100,Math.round(typeof x.progressPercent=="number"?x.progressPercent:x.status==="queued"?10:x.status==="running"?65:x.status==="completed"?100:x.status==="cancelling"?95:100)));_(U=>{let ye=Math.max(U,F);if(x.status==="running"&&F<=U){const Qe=String(x.progressStage||"").toLowerCase(),Ze=Qe.includes("assembling")||Qe.includes("final")?97:Qe.includes("generating")?89:95;ye=Math.min(Ze,U+1)}return ye}),Q(x.progressStage||x.status),ce(x.progressMessage||(x.status==="queued"?"Task queued for generation.":x.status==="running"?"Generating quiz in the background...":x.status==="completed"?"Generation complete.":x.status==="cancelling"?"Cancelling generation...":"Generation finished with an error."))},[]);u.useEffect(()=>{if(b||dt.current)return;if(dt.current=!0,!h){Ns();return}let x=!1;const F=sessionStorage.getItem(Dr);if(!F)return;let U=null;try{U=JSON.parse(F)}catch{Ns();return}if(!U?.taskId){Ns();return}if(U.ownerUid&&U.ownerUid!==h.uid){Ns();return}return E(!0),D(U.taskId),Ge(""),xt.waitForTaskResult(U.taskId,{timeoutMs:24e4,pollIntervalMs:1500,onProgress:kr}).then(async ye=>{if(x)return;const Qe=ye.result;if(!Qe||typeof Qe!="object")throw new Error("Quiz generation completed without a valid result payload.");const Ze=Qe;Ce(Ze),g("results"),_(100),Q("completed"),ce("Generation complete."),D(null),Ns();try{await Tn(Ze,U.request),ie.success("Quiz auto-saved to your library as draft.")}catch(Vt){ie.error(Vt instanceof Error?Vt.message:"Quiz generated but failed to save to library")}}).catch(ye=>{if(!x){if(ye instanceof ar&&(ye.status===401||ye.status===403)){dt.current=!1,E(!1);return}Ge(ye instanceof Error?ye.message:"Failed to resume quiz generation"),D(null),Ns()}}).finally(()=>{x||E(!1)}),()=>{x=!0}},[kr,b,Ns,h]);const kn=()=>{if(te){window.confirm("Quiz generation is in progress. Are you sure you want to leave?")&&(g("setup"),Ce(null),Ge(""),t());return}g("setup"),Ce(null),Ge(""),t()},Sl=async()=>{p?.(),Ge(""),E(!0),Hs(null),_(8),Q("queued"),ce("Submitting quiz generation task..."),Ce(null);const x=ha();try{const F=await xt.generateQuiz(x,{onTaskCreated:U=>{D(U),fa(U,x),_(ye=>Math.max(ye,12)),Q("queued"),ce("Task queued. Generation is running in the background.")},onProgress:U=>{kr(U),U.taskId&&U.taskId!==pe&&D(U.taskId)}});Ce(F),g("results"),_(100),Q("completed"),ce("Generation complete."),D(null),Ns();try{await Tn(F,x),ie.success("Quiz auto-saved to your library as draft.")}catch(U){ie.error(U instanceof Error?U.message:"Quiz generated but failed to save to library")}xt.reportImportGroundedFeedback({flow:"quiz",status:"success",classSectionId:x.classSectionId,className:x.className,metadata:{totalQuestions:F.metadata.totalQuestions,usedImportedTopics:!!F.metadata.usedImportedTopics,importedTopicCount:F.metadata.importedTopicCount??0,importGroundingEnabled:N.quizEnabled}})}catch(F){Ge(F instanceof Error?F.message:"Quiz generation failed"),_(100),Q("failed"),ce("Generation failed."),D(null),Ns(),xt.reportImportGroundedFeedback({flow:"quiz",status:"failed",classSectionId:x.classSectionId,className:x.className,metadata:{error:F instanceof Error?F.message:"Quiz generation failed",importGroundingEnabled:N.quizEnabled}})}finally{E(!1)}},kl=()=>{if(!ae)return;const x=ae.questions.map((F,U)=>{let ye=`${U+1}. [${F.difficulty.toUpperCase()}] [${F.bloomLevel}] (${F.points} pts) +`;return ye+=` ${F.question} +`,F.options&&(ye+=F.options.map(Qe=>` ${Qe}`).join(` +`)+` +`),ye+=` Answer: ${F.correctAnswer} +`,ye+=` Explanation: ${F.explanation} +`,ye}).join(` +`);navigator.clipboard.writeText(x),Nt(!0),setTimeout(()=>Nt(!1),2e3)},Cl=()=>{if(!ae)return;const x=new Blob([JSON.stringify(ae,null,2)],{type:"application/json"}),F=URL.createObjectURL(x),U=document.createElement("a");U.href=F,U.download=`quiz_${I.replace(/\s/g,"_")}_${Date.now()}.json`,U.click(),URL.revokeObjectURL(F)};f.length>0||Object.values(X).flat().length>0;const Cn=(x,F)=>{const U=F?.gradeLevel||I,ye=F?.topics||f,Qe=x.questions.map((Ze,Vt)=>({id:`q_${Date.now()}_${Vt}`,questionType:Ze.questionType||"identification",question:Ze.question,...Ze.options?{options:Ze.options}:{},correctAnswer:Ze.correctAnswer,bloomLevel:Ze.bloomLevel||"understand",difficulty:Ze.difficulty||"medium",topic:Ze.topic,subject:U,points:Ze.points,explanation:Ze.explanation}));return{title:`${U} Quiz – ${ye.length>0?ye.slice(0,2).join(", "):"Mixed Topics"}`,gradeLevel:U,questions:Qe,totalPoints:x.totalPoints,metadata:{topicsCovered:Object.keys(x.metadata.topicsCovered),difficultyBreakdown:{easy:x.metadata.difficultyBreakdown.easy??0,medium:x.metadata.difficultyBreakdown.medium??0,hard:x.metadata.difficultyBreakdown.hard??0},bloomDistribution:x.metadata.bloomTaxonomyDistribution,questionTypeBreakdown:x.metadata.questionTypeBreakdown,supplementalPurpose:x.metadata.supplementalPurpose,recommendedTeacherActions:x.metadata.recommendedTeacherActions??[],generatedAt:new Date().toISOString(),generatedBy:"teacher_generated"},status:"draft",source:"teacher_generated"}},In=u.useCallback(x=>{Ts(F=>[x,...F.filter(U=>U.id!==x.id)])},[]);async function Tn(x,F){if(!h)return null;const U=Cn(x,F),ye=await Fn(U,h.uid,B?{documentId:B}:void 0);return kt(ye),In({id:ye,...U,teacherId:h.uid}),ye}const Il=async()=>{if(!ae){ie.error("No quiz to save. Generate a quiz first.");return}if(!h){ie.error("You must be signed in to save quizzes.");return}We(!0);try{const x=Cn(ae),F=await Fn(x,h.uid,B?{documentId:B}:void 0);kt(F),In({id:F,...x,teacherId:h.uid}),ie.success("Quiz saved to your library!"),m?.(F)}catch(x){ie.error(x instanceof Error?x.message:"Failed to save quiz")}finally{We(!1)}},Tl=async()=>{if(B){M(!0);try{await oc(B),Ts(x=>x.map(F=>F.id===B?{...F,status:"published"}:F)),ie.success("Quiz published to Quiz Bank!")}catch(x){ie.error(x instanceof Error?x.message:"Failed to publish quiz")}finally{M(!1)}}},Cr=async x=>{const F=x??B;if(!F){ie.error("Save the quiz first before assigning.");return}if(Ba(F),ve(!0),ws(null),nt(""),je.length===0&&h){se(!0);try{const U=await Nn(h.uid);yt(U)}catch{ie.error("Failed to load students")}finally{se(!1)}}},_l=async()=>{const x=Pa??B;if(!(!ut||!x||!h)){qe(!0);try{await ic(x,ut,h.uid),Ts(F=>F.map(U=>U.id===x?{...U,status:"assigned",metadata:{...U.metadata,assignedTo:ut}}:U)),ie.success("Quiz assigned to student!"),ve(!1),Ba(null),C==="bank"&&Ir()}catch(F){ie.error(F instanceof Error?F.message:"Failed to assign quiz")}finally{qe(!1)}}},Ir=u.useCallback(async()=>{if(h){Xs(!0);try{const x=await gi(h.uid);Ts(x)}catch{ie.error("Failed to load quiz bank")}finally{Xs(!1)}}},[h]);u.useEffect(()=>{C==="bank"&&Ir()},[C,Ir]);const El=async x=>{try{await nc(x),Ts(F=>F.filter(U=>U.id!==x)),ie.success("Quiz deleted")}catch{ie.error("Failed to delete quiz")}},_n=je.filter(x=>x.name.toLowerCase().includes(rt.toLowerCase())||x.email.toLowerCase().includes(rt.toLowerCase())),En=Bs==="all"?Ks:Ks.filter(x=>x.status===Bs),Rl=x=>{const F=(x.metadata.topicsCovered||[]).reduce((U,ye)=>(U[ye]=(U[ye]||0)+1,U),{});return{questions:x.questions.map(U=>({questionType:U.questionType,question:U.question,correctAnswer:U.correctAnswer,options:U.options??null,bloomLevel:U.bloomLevel,difficulty:U.difficulty,topic:U.topic,points:U.points,explanation:U.explanation})),totalPoints:x.totalPoints,metadata:{topicsCovered:F,difficultyBreakdown:x.metadata.difficultyBreakdown,bloomTaxonomyDistribution:x.metadata.bloomDistribution,questionTypeBreakdown:x.metadata.questionTypeBreakdown,gradeLevel:x.gradeLevel,totalQuestions:x.questions.length,includesGraphQuestions:!1,supplementalPurpose:x.metadata.supplementalPurpose,bloomTaxonomyRationale:"Loaded from saved quiz bank entry.",recommendedTeacherActions:x.metadata.recommendedTeacherActions||[]}}},Tr=x=>{kt(x.id),Ce(Rl(x)),Je(null),Hs(x.id),vs("all"),z("all"),Is(null),g("results"),S("create")},Rn={remember:{badge:"border-purple-200 text-purple-700 bg-purple-50",card:"from-[#a855f7] to-[#9333ea]",num:"text-purple-700 bg-purple-100 border-purple-200"},understand:{badge:"border-blue-200 text-blue-700 bg-blue-50",card:"from-[#3b82f6] to-[#2563eb]",num:"text-blue-700 bg-blue-100 border-blue-200"},apply:{badge:"border-amber-200 text-amber-700 bg-amber-50",card:"from-[#f59e0b] to-[#d97706]",num:"text-amber-700 bg-amber-100 border-amber-200"},analyze:{badge:"border-orange-200 text-orange-700 bg-orange-50",card:"from-[#f97316] to-[#ea580c]",num:"text-orange-700 bg-orange-100 border-orange-200"},evaluate:{badge:"border-rose-200 text-rose-700 bg-rose-50",card:"from-[#f43f5e] to-[#e11d48]",num:"text-rose-700 bg-rose-100 border-rose-200"},create:{badge:"border-emerald-200 text-emerald-700 bg-emerald-50",card:"from-[#10b981] to-[#059669]",num:"text-emerald-700 bg-emerald-100 border-emerald-200"}},Ml=(x,F,U)=>{const ye=rs===F,Qe=Rn[x.bloomLevel?.toLowerCase()]||Rn.remember,Ze=x.bloomLevel?.toLowerCase()==="remember"?"hover:border-purple-200":x.bloomLevel?.toLowerCase()==="understand"?"hover:border-blue-200":x.bloomLevel?.toLowerCase()==="apply"?"hover:border-amber-200":"hover:border-slate-200";return e.jsxs(ze.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:F*.05},className:`border border-[#e2e8f0] rounded-[20px] overflow-hidden bg-white shadow-sm hover:shadow-md ${Ze} transition-all duration-300`,children:[e.jsxs("div",{className:"p-6 flex justify-between items-start cursor-pointer hover:bg-slate-50/50 transition-colors",onClick:()=>Is(ye?null:F),children:[e.jsxs("div",{className:"space-y-3 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap mb-1",children:[e.jsxs("span",{className:`w-8 h-8 rounded-lg bg-gradient-to-br ${Qe.card} text-white flex items-center justify-center font-bold text-[13px] shadow-sm`,children:["Q",F+1]}),e.jsx("span",{className:`px-2.5 py-1 rounded-md border text-[10px] font-bold uppercase tracking-wider shadow-sm ${Qe.badge}`,children:x.bloomLevel}),e.jsx("span",{className:`px-2.5 py-1 rounded-md border text-[10px] font-bold uppercase tracking-wider shadow-sm ${x.difficulty==="easy"?"border-emerald-200 text-emerald-700 bg-emerald-50":x.difficulty==="hard"?"border-rose-200 text-rose-700 bg-rose-50":"border-amber-200 text-amber-700 bg-amber-50"}`,children:x.difficulty}),e.jsxs("span",{className:"text-[12px] font-bold text-[#64748b] bg-slate-100 px-2 py-1 rounded-md",children:[x.points," pts"]}),x.topic&&e.jsx("span",{className:"text-[12px] font-semibold text-[#64748b] px-2 py-1 hidden sm:inline-block border-l border-slate-200",children:x.topic})]}),e.jsx("p",{className:"text-[16px] font-bold text-[#1e293b] pr-4 leading-relaxed",children:x.question})]}),e.jsxs("div",{className:"flex flex-col items-end justify-between h-full gap-4 shrink-0 mt-1",children:[e.jsx("span",{className:`px-3 py-1.5 rounded-md text-[10px] font-bold uppercase tracking-widest hidden sm:block border shadow-sm ${Qe.badge}`,children:x.bloomLevel}),e.jsx("div",{className:"w-8 h-8 rounded-full bg-slate-50 flex items-center justify-center border border-slate-200 mt-2",children:ye?e.jsx(ka,{size:16,className:"text-[#64748b] transition-transform duration-300"}):e.jsx($t,{size:16,className:"text-[#64748b]"})})]})]}),e.jsx(zt,{children:ye&&e.jsx(ze.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:e.jsxs("div",{className:"p-6 pt-0 bg-white",children:[e.jsx("div",{className:"h-px w-full bg-gradient-to-r from-transparent via-[#e2e8f0] to-transparent mb-6"}),x.options&&e.jsxs("div",{className:"mb-6",children:[e.jsx("p",{className:"text-[13px] font-bold text-[#64748b] mb-3 uppercase tracking-wider",children:"Options:"}),e.jsx("div",{className:"space-y-3",children:x.options.map((Vt,Js)=>{const mt=Vt.includes(x.correctAnswer);return e.jsxs("div",{className:`rounded-[12px] p-4 text-[14px] font-medium transition-all cursor-pointer relative overflow-hidden ${mt?"bg-gradient-to-r from-emerald-50 to-emerald-100/30 border-2 border-emerald-400 text-emerald-800 font-bold shadow-sm":"bg-white border border-[#e2e8f0] text-[#475569] hover:border-[#a855f7] hover:shadow-[0_2px_8px_rgba(168,85,247,0.1)]"}`,children:[mt&&e.jsx("div",{className:"absolute left-0 top-0 w-1 h-full bg-emerald-500"}),e.jsx("span",{className:mt?"pl-2":"",children:Vt}),mt&&e.jsx("div",{className:"w-6 h-6 rounded-full bg-emerald-500 text-white flex items-center justify-center shadow-sm absolute right-4 top-1/2 -translate-y-1/2",children:e.jsx(Ht,{size:13})})]},Js)})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-5",children:[e.jsxs("div",{className:"bg-emerald-50/80 border border-emerald-200/60 rounded-[16px] p-5 shadow-sm",children:[e.jsxs("p",{className:"text-[11px] font-bold text-emerald-700 uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[e.jsx(ja,{size:14})," Correct Answer"]}),e.jsx("p",{className:"text-[16px] font-bold text-[#1e293b]",children:x.correctAnswer})]}),e.jsxs("div",{className:"bg-purple-50/80 border border-purple-200/60 rounded-[16px] p-5 shadow-sm",children:[e.jsxs("p",{className:"text-[11px] font-bold text-purple-700 uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[e.jsx(ps,{size:14})," AI Explanation"]}),e.jsx("p",{className:"text-[13px] text-[#475569] leading-relaxed font-medium",children:x.explanation})]})]}),e.jsxs("div",{className:"flex gap-6 text-[12px] font-medium text-[#64748b] mt-5 pt-4 border-t border-slate-100",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Es,{size:14})," ",e.jsx("strong",{className:"text-[#1e293b]",children:"Type:"})," ",Va[x.questionType]?.label||x.questionType]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Hr,{size:14})," ",e.jsx("strong",{className:"text-[#1e293b]",children:"Bloom:"})," ",x.bloomLevel]})]})]})})})]},F)},Mn=e.jsxs("div",{className:"w-full h-full flex flex-col overflow-y-auto bg-gradient-to-br from-[#eef2ff] via-[#f5f3ff] to-[#fff7ed]",children:[e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] pt-[12px] pb-4",children:e.jsxs("div",{className:"flex items-center gap-1 bg-white/50 backdrop-blur-md p-1.5 rounded-full border border-white shadow-[0_2px_8px_rgba(0,0,0,0.04)] w-max",children:[e.jsxs("button",{onClick:()=>S("create"),className:`px-6 py-2 rounded-full text-[13px] font-bold flex items-center gap-2 transition-all duration-300 ease-out ${C==="create"?"bg-white text-[#a855f7] shadow-[0_2px_8px_rgba(168,85,247,0.15)] scale-100":"bg-transparent text-[#64748b] hover:text-[#1e293b] hover:bg-white/60 scale-95 hover:scale-100"}`,children:[e.jsx(Kr,{size:16})," Create Quiz"]}),e.jsxs("button",{onClick:()=>S("bank"),className:`px-6 py-2 rounded-full text-[13px] font-bold flex items-center gap-2 transition-all duration-300 ease-out ${C==="bank"?"bg-white text-[#a855f7] shadow-[0_2px_8px_rgba(168,85,247,0.15)] scale-100":"bg-transparent text-[#64748b] hover:text-[#1e293b] hover:bg-white/60 scale-95 hover:scale-100"}`,children:[e.jsx(dr,{size:16})," Quiz Bank"]})]})}),e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] pb-[32px] flex-1",children:[C==="bank"&&e.jsxs("div",{className:"w-full space-y-[24px]",children:[e.jsx("div",{className:"flex items-center gap-3 overflow-x-auto pb-2 border-b border-[#e2e8f0] mb-6",style:{scrollbarWidth:"none"},children:["all","draft","published","assigned","completed"].map(x=>e.jsx("button",{onClick:()=>Oa(x),className:`px-5 py-2 text-[13px] font-bold rounded-full whitespace-nowrap transition-all duration-300 mb-4 capitalize ${Bs===x?"bg-purple-50 text-[#9333ea] border border-purple-200 shadow-[0_2px_8px_rgba(168,85,247,0.15)] hover:scale-105":"bg-white/80 text-[#64748b] border border-white hover:border-[#e2e8f0] hover:bg-white shadow-sm hover:shadow-md hover:-translate-y-0.5"}`,children:x==="all"?"All":x.charAt(0).toUpperCase()+x.slice(1)},x))}),Fa?e.jsxs("div",{className:"flex items-center justify-center py-16",children:[e.jsx(gt,{size:24,className:"animate-spin text-sky-500"}),e.jsx("span",{className:"ml-2 text-sm text-[#5a6578]",children:"Loading quiz bank…"})]}):En.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-slate-500",children:[e.jsx(dr,{size:40,className:"mb-3"}),e.jsx("p",{className:"font-medium",children:"No quizzes found"}),e.jsx("p",{className:"text-xs mt-1",children:"Generate your first quiz in the Create tab"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:En.map(x=>e.jsxs(ze.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},onClick:()=>Tr(x),role:"button",tabIndex:0,onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),Tr(x))},className:`relative bg-white/80 backdrop-blur-md rounded-[20px] p-6 shadow-sm border flex flex-col group hover:-translate-y-1 transition-all duration-300 cursor-pointer overflow-hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#a855f7] ${x.status==="assigned"||x.status==="published"?"border-white hover:border-purple-100 hover:shadow-[0_8px_24px_rgba(168,85,247,0.1)]":"border-white hover:border-slate-200 hover:shadow-[0_8px_24px_rgba(0,0,0,0.06)]"}`,children:[e.jsx("div",{className:`absolute top-0 left-0 w-[6px] h-full transition-colors duration-300 ${x.status==="assigned"||x.status==="published"?"bg-purple-300 group-hover:bg-[#a855f7]":"bg-slate-200 group-hover:bg-slate-400"}`}),e.jsxs("div",{className:"flex justify-between items-start mb-4 gap-4 pl-3",children:[e.jsx("h3",{className:`font-bold text-[15px] text-[#1e293b] leading-tight transition-colors ${x.status==="assigned"||x.status==="published"?"group-hover:text-[#9333ea]":"group-hover:text-slate-700"}`,children:x.title}),e.jsx("span",{className:`px-2.5 py-1 rounded-[6px] text-[10px] font-bold uppercase tracking-wider shrink-0 shadow-sm ${hm[x.status]}`,children:x.status})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-5 pl-3",children:x.metadata.topicsCovered.slice(0,3).map(F=>e.jsx("span",{className:"px-2.5 py-1 bg-[#f8fafc] text-slate-600 text-[11px] font-medium rounded-md border border-slate-200 group-hover:border-slate-300 transition-colors",children:F},F))}),e.jsxs("div",{className:"flex items-center gap-5 text-[13px] text-[#64748b] font-medium mb-6 pl-3",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(xc,{size:14})," ",x.questions.length," questions"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(mi,{size:14})," ",x.totalPoints," pts"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(us,{size:14})," ",x.gradeLevel]})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-auto pt-5 border-t border-[#f1f5f9] pl-3",children:[e.jsxs("button",{onClick:F=>{F.stopPropagation(),Tr(x)},className:"flex items-center gap-1.5 text-[13px] font-semibold text-[#64748b] hover:text-[#1e293b] transition-colors bg-slate-50 hover:bg-slate-100 border border-slate-200 px-4 py-2 rounded-full shadow-sm",children:[e.jsx(pc,{size:14})," View"]}),e.jsxs("button",{onClick:F=>{F.stopPropagation(),Cr(x.id)},className:"flex items-center gap-1.5 text-[13px] font-bold text-[#a855f7] hover:text-[#9333ea] transition-colors",children:[e.jsx(sa,{size:14})," Assign"]}),e.jsxs("button",{onClick:F=>{F.stopPropagation(),El(x.id)},className:"flex items-center gap-1.5 text-[13px] font-semibold text-rose-500 hover:text-rose-700 transition-colors ml-auto opacity-60 group-hover:opacity-100",children:[e.jsx(bi,{size:14})," Delete"]})]})]},x.id))})]}),C==="create"&&e.jsxs(e.Fragment,{children:[$e&&e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] pt-4",children:e.jsxs(ze.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-red-50 border border-red-200 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(gr,{size:18,className:"text-red-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-red-800 font-medium",children:"Error"}),e.jsx("p",{className:"text-sm text-red-600",children:$e})]}),e.jsx("button",{onClick:()=>Ge(""),className:"ml-auto",children:e.jsx(Xt,{size:14,className:"text-red-400"})})]})}),te&&e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-[24px] xl:p-[32px]",children:[e.jsxs("div",{className:"bg-white p-8 rounded-[16px] shadow-sm border border-[#e2e8f0] w-full max-w-3xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"text-[16px] font-bold text-[#1e293b] flex items-center gap-3",children:[e.jsx(gt,{size:20,className:"animate-spin text-[#a855f7]"}),"Generating Quiz in Background"]}),e.jsxs("span",{className:"text-[14px] font-extrabold text-[#9333ea]",children:[j,"%"]})]}),e.jsx("div",{className:"w-full bg-slate-100 h-2.5 rounded-full overflow-hidden mb-6",children:e.jsx(ze.div,{animate:{width:`${j}%`},transition:{duration:.35,ease:"easeOut"},className:"bg-gradient-to-r from-sky-400 via-indigo-500 to-purple-500 h-full rounded-full"})}),e.jsxs("div",{className:"text-[13px] text-[#64748b]",children:[e.jsxs("p",{className:"font-medium text-[#475569] mb-1",children:["Stage: ",e.jsx("span",{className:"font-bold text-[#1e293b] capitalize",children:T.replace(/_/g," ")})]}),e.jsx("p",{children:ue}),pe&&e.jsxs("p",{className:"text-[11px] mt-3 opacity-60 font-mono",children:["Task ID: ",pe]})]})]}),e.jsxs("p",{className:"mt-8 text-[14px] font-medium text-[#64748b] flex items-center gap-2 animate-pulse",children:[e.jsx(gt,{size:16,className:"animate-spin"})," Generating quiz... Please wait."]})]}),!te&&v!=="results"&&e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] mb-8",children:e.jsx("div",{className:"flex items-center justify-between bg-white/80 backdrop-blur-[12px] rounded-2xl border border-white shadow-[0_4px_16px_rgba(0,0,0,0.03)] p-1.5",children:[{id:"setup",label:"Setup"},{id:"topics",label:"Topics"},{id:"style",label:"Question Style"},{id:"preview",label:"Preview"}].map((x,F)=>{const ye=["setup","topics","style","preview"].indexOf(v),Qe=ye>F,Ze=ye===F;return e.jsxs("div",{className:`flex-1 flex items-center justify-center gap-2 py-3 px-4 rounded-xl transition-all duration-500 ${Ze?"bg-purple-50/80 shadow-[0_1px_3px_rgba(168,85,247,0.1)]":Qe?"bg-transparent":"bg-transparent opacity-60"}`,children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[12px] font-bold shrink-0 ${Ze?"bg-gradient-to-br from-[#a855f7] to-[#9333ea] text-white shadow-md":Qe?"bg-emerald-500 text-white shadow-sm":"bg-slate-100 text-[#64748b]"}`,children:Qe?e.jsx(Ht,{size:13,strokeWidth:3}):F+1}),e.jsx("span",{className:`text-[13px] font-bold whitespace-nowrap ${Ze?"text-[#9333ea]":Qe?"text-[#1e293b]":"text-[#64748b]"}`,children:x.label})]},x.id)})})}),v==="setup"&&!te&&e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] flex-1 space-y-[24px] pb-8",children:[e.jsxs("div",{className:"bg-gradient-to-r from-purple-50/80 to-indigo-50/80 backdrop-blur-sm border border-purple-100/50 rounded-[16px] p-5 flex items-start gap-4 shadow-sm hover:shadow-md transition-shadow duration-300",children:[e.jsx("div",{className:"bg-white p-2 rounded-full shadow-sm shrink-0",children:e.jsx(ra,{size:18,className:"text-[#9333ea]"})}),e.jsxs("p",{className:"text-[13px] text-[#475569] leading-relaxed pt-0.5",children:["This quiz maker generates ",e.jsx("span",{className:"font-bold text-[#9333ea]",children:"supplemental assessments"})," to support classroom instruction. Questions follow Bloom's Taxonomy for comprehensive skill evaluation. Generation limit: up to ",ba," questions and ",va," topics per quiz."]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[20px] border border-white shadow-[0_4px_16px_rgba(0,0,0,0.03)] overflow-hidden hover:shadow-[0_8px_24px_rgba(0,0,0,0.06)] transition-all duration-300",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-white/50",children:e.jsx("h3",{className:"text-[11px] font-bold text-[#64748b] uppercase tracking-wider",children:"Basic Settings"})}),e.jsxs("div",{className:"p-8 flex flex-col md:flex-row gap-8",children:[e.jsxs("div",{className:"flex-1 group",children:[e.jsx("label",{htmlFor:"quiz-grade-level",className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Grade level"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{id:"quiz-grade-level",value:I,onChange:x=>L(Lr(x.target.value)),className:"appearance-none w-full bg-white border border-[#e2e8f0] hover:border-[#cbd5e1] text-[#475569] text-[14px] font-medium rounded-xl px-4 py-3.5 outline-none focus:border-[#a855f7] focus:ring-4 focus:ring-[#a855f7]/10 cursor-pointer transition-all duration-200 shadow-sm",children:fm.map(x=>e.jsx("option",{value:x,children:x},x))}),e.jsx($t,{size:18,className:"text-[#64748b] absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none"})]})]}),e.jsxs("div",{className:"flex-1 group",children:[e.jsx("label",{htmlFor:"quiz-num-questions",className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Number of questions"}),e.jsxs("div",{className:"flex items-center bg-white border border-[#e2e8f0] rounded-xl overflow-hidden focus-within:border-[#a855f7] focus-within:ring-4 focus-within:ring-[#a855f7]/10 transition-all duration-200 h-[50px] shadow-sm hover:border-[#cbd5e1]",children:[e.jsx("button",{onClick:()=>W(Math.max(1,R-1)),className:"w-14 h-full flex items-center justify-center text-[#64748b] bg-slate-50 hover:bg-slate-100 hover:text-[#1e293b] transition-colors border-r border-[#e2e8f0] active:bg-slate-200",children:e.jsx(On,{size:16})}),e.jsx("input",{id:"quiz-num-questions",type:"number",min:1,max:ba,value:R,onChange:x=>W(Math.min(ba,Math.max(1,parseInt(x.target.value)||1))),className:"flex-1 text-center font-bold text-[16px] text-[#1e293b] border-none outline-none focus:ring-0 w-full h-full p-0"}),e.jsx("button",{onClick:()=>W(Math.min(ba,R+1)),className:"w-14 h-full flex items-center justify-center text-[#64748b] bg-slate-50 hover:bg-slate-100 hover:text-[#1e293b] transition-colors border-l border-[#e2e8f0] active:bg-slate-200",children:e.jsx(ca,{size:16})})]})]})]})]})]}),v==="topics"&&!te&&e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] flex-1 space-y-[24px] pb-8",children:[e.jsxs("div",{className:"flex items-end justify-between mb-2",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[20px] font-bold text-[#1e293b] mb-1",children:"Select topics"}),e.jsxs("p",{className:"text-[13px] text-[#64748b]",children:["Choose up to ",va," topics across all strands"]})]}),e.jsxs("div",{className:"bg-purple-50 border border-purple-100 px-3 py-1.5 rounded-full flex items-center gap-2 shadow-sm",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#a855f7] animate-pulse"}),e.jsxs("span",{className:"text-[12px] font-bold text-[#a855f7]",children:[f.filter(x=>!w.includes(x)).length," of ",va," selected"]})]})]}),fe?e.jsxs("div",{className:"flex items-center justify-center py-10 text-sm text-[#5a6578]",children:[e.jsx(gt,{size:24,className:"animate-spin text-[#9b51e0] mr-2"})," Loading topics..."]}):e.jsx("div",{className:"space-y-3",children:Object.entries(X).map(([x,F])=>{const U=F.filter(Qe=>f.includes(Qe)&&!w.includes(Qe)).length,ye=jt===x;return e.jsxs("div",{className:"border border-[#dde3eb] rounded-xl bg-white overflow-hidden shadow-sm",children:[e.jsxs("button",{onClick:()=>At(ye?null:x),className:"w-full flex items-center justify-between p-4 hover:bg-[#f7f9fc] transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-1 h-6 bg-[#9b51e0] rounded-full"}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"font-bold text-[#0a1628] text-sm",children:x}),e.jsxs("p",{className:"text-xs text-slate-500",children:[F.length," topics"]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"bg-purple-100 text-[#9b51e0] px-2.5 py-0.5 rounded-full text-xs font-semibold",children:[U," selected"]}),ye?e.jsx(ka,{size:18,className:"text-slate-400"}):e.jsx($t,{size:18,className:"text-slate-400"})]})]}),e.jsx(zt,{children:ye&&e.jsx(ze.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},className:"overflow-hidden border-t border-[#edf1f7]",children:e.jsx("div",{className:"py-2",children:F.map((Qe,Ze)=>{const Vt=f.includes(Qe),Js=w.includes(Qe),mt=Vt&&!Js;let Jt="Core";return Ze%3===0&&(Jt="Foundation"),Ze%3===2&&(Jt="Advanced"),e.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-[#f7f9fc]",children:[e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer flex-1",children:[e.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center transition-colors ${mt?"bg-[#9b51e0] border-[#9b51e0]":"border-2 border-[#dde3eb] bg-white"}`,children:mt&&e.jsx(Ht,{size:14,className:"text-white"})}),e.jsx("input",{type:"checkbox",className:"hidden",checked:mt,onChange:()=>Ua(Qe)}),e.jsx("span",{className:`text-sm font-semibold ${mt?"text-[#0a1628]":"text-[#5a6578]"}`,children:Qe})]}),e.jsx("span",{className:`border px-3 py-1 rounded-full text-[10px] uppercase font-bold tracking-wider ${Jt==="Advanced"?"bg-white text-slate-400 border-[#dde3eb]":"bg-purple-50 text-[#9b51e0] border-purple-100"}`,children:Jt})]},Qe)})})})})]},x)})})]}),v==="style"&&!te&&e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] flex-1 space-y-[24px] pb-8",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[20px] border border-[#e2e8f0] shadow-sm overflow-hidden hover:shadow-[0_8px_24px_rgba(0,0,0,0.04)] transition-shadow duration-300",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-white/50",children:e.jsx("h3",{className:"text-[11px] font-bold text-[#64748b] uppercase tracking-wider",children:"Question Types"})}),e.jsx("div",{className:"p-4 grid grid-cols-2 sm:grid-cols-5 gap-3",children:Object.entries(Va).map(([x,F])=>{const U=A.includes(x);return e.jsxs("button",{onClick:()=>Bt(x),className:`border-2 rounded-[16px] p-4 flex flex-col items-center justify-center text-center cursor-pointer transition-all duration-300 relative overflow-hidden group hover:-translate-y-1 ${U?"border-[#a855f7] bg-gradient-to-b from-purple-50/80 to-white/80 shadow-[0_4px_12px_rgba(168,85,247,0.12)]":"border-slate-100 bg-slate-50/50 shadow-sm hover:shadow-md hover:border-purple-200"}`,children:[U&&e.jsx("div",{className:"absolute top-2 right-2 w-5 h-5 bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-full flex items-center justify-center shadow-md",children:e.jsx(Ht,{size:11,className:"text-white"})}),e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center mb-3 group-hover:scale-110 transition-transform duration-300 ${U?"bg-white border border-purple-200 shadow-md":"bg-white border border-slate-200 shadow-sm group-hover:shadow-md"}`,children:e.jsx("span",{className:U?"text-[#a855f7]":"text-slate-500",children:F.icon})}),e.jsx("span",{className:`font-bold text-[12px] leading-tight ${U?"text-[#9333ea]":"text-slate-700"}`,children:F.label})]},x)})})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[20px] border border-[#e2e8f0] shadow-sm overflow-hidden hover:shadow-[0_8px_24px_rgba(0,0,0,0.04)] transition-shadow duration-300",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-white/50",children:e.jsx("h3",{className:"text-[11px] font-bold text-[#64748b] uppercase tracking-wider",children:"Bloom's Taxonomy Levels"})}),e.jsx("div",{className:"p-6 flex flex-wrap gap-4",children:Object.entries(Lo).map(([x,F])=>{const U=q.includes(x);return e.jsx("button",{onClick:()=>Ye(x),className:`px-6 py-2.5 rounded-full border-2 font-bold text-[13px] transition-all duration-200 hover:-translate-y-0.5 capitalize ${U?"border-[#a855f7] text-[#9333ea] bg-purple-50/80 shadow-[0_2px_8px_rgba(168,85,247,0.15)]":"border-slate-200 text-[#64748b] bg-white shadow-sm hover:border-slate-300 hover:bg-slate-50"}`,children:x},x)})})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[20px] border border-[#e2e8f0] shadow-sm overflow-hidden hover:shadow-[0_8px_24px_rgba(0,0,0,0.04)] transition-shadow duration-300",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-white/50",children:e.jsx("h3",{className:"text-[11px] font-bold text-[#64748b] uppercase tracking-wider",children:"Difficulty Distribution"})}),e.jsx("div",{className:"p-8 space-y-8",children:Object.entries(ne).map(([x,F])=>{const U={easy:"bg-emerald-400",medium:"bg-amber-400",hard:"bg-rose-400"},ye={easy:"text-emerald-600",medium:"text-amber-500",hard:"text-rose-500"},Qe={easy:"group-hover:border-emerald-200",medium:"group-hover:border-amber-200",hard:"group-hover:border-rose-200"};return e.jsxs("div",{className:"flex items-center gap-6 group",children:[e.jsx("span",{className:`w-16 text-[13px] font-bold text-[#475569] capitalize group-hover:${ye[x]} transition-colors`,children:x}),e.jsx("div",{className:"flex-1 bg-slate-100 h-3 rounded-full overflow-hidden shadow-inner",children:e.jsx(ze.div,{animate:{width:`${F}%`},className:`h-full rounded-full transition-all duration-500 ease-out ${U[x]}`})}),e.jsxs("div",{className:`flex items-center bg-white border border-[#e2e8f0] rounded-xl shadow-sm overflow-hidden p-0.5 w-28 h-10 transition-colors ${Qe[x]}`,children:[e.jsx("button",{onClick:()=>De(x,-5),className:`w-8 h-full flex items-center justify-center text-[#64748b] hover:bg-slate-50 hover:${ye[x]} rounded-lg transition-colors`,children:e.jsx(On,{className:"w-3.5 h-3.5"})}),e.jsx("input",{type:"text",value:`${F}%`,readOnly:!0,className:"flex-1 text-center font-bold text-[14px] text-[#1e293b] border-none outline-none focus:ring-0 w-full p-0 pointer-events-none"}),e.jsx("button",{onClick:()=>De(x,5),className:`w-8 h-full flex items-center justify-center text-[#64748b] hover:bg-slate-50 hover:${ye[x]} rounded-lg transition-colors`,children:e.jsx(ca,{className:"w-3.5 h-3.5"})})]})]},x)})})]})]}),v==="preview"&&!te&&!ae&&e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] flex-1 space-y-[24px] pb-8",children:e.jsxs("div",{className:"bg-white/80 backdrop-blur-md rounded-[20px] border border-[#e2e8f0] shadow-[0_8px_24px_rgba(0,0,0,0.04)] overflow-hidden p-8",children:[e.jsxs("h3",{className:"text-[12px] font-bold text-[#64748b] uppercase tracking-wider mb-6 flex items-center gap-2",children:[e.jsx(As,{size:16,className:"text-[#a855f7]"})," Quiz Summary"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-6",children:[{label:"Questions",value:R},{label:"Topics",value:f.filter(x=>!w.includes(x)).length},{label:"Level",value:I.replace("Grade ","Gr. ")}].map(x=>e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-purple-50 to-indigo-50 rounded-[16px] p-6 text-center border border-purple-100/50 shadow-sm flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-16 h-16 bg-purple-200/30 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx("span",{className:"text-[36px] font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-[#a855f7] to-[#9333ea] leading-none mb-1 relative z-10",children:x.value}),e.jsx("span",{className:"text-[13px] font-bold text-[#64748b] relative z-10",children:x.label})]},x.label))}),e.jsxs("div",{className:"bg-slate-50/80 rounded-[14px] p-5 border border-slate-200/60 text-[#475569] text-[14px] leading-relaxed flex gap-4 items-start shadow-inner",children:[e.jsx(ra,{size:18,className:"text-[#94a3b8] shrink-0 mt-0.5"}),e.jsxs("p",{children:[A.map(x=>Va[x]?.label).join(" and ")," questions across"," ",e.jsxs("span",{className:"font-bold text-[#1e293b]",children:[f.filter(x=>!w.includes(x)).length," topics"]})," ","— aligned to ",e.jsx("span",{className:"font-semibold",children:q.map(x=>Lo[x]?.label).join(", ")})," levels of Bloom's Taxonomy."," ",e.jsxs("span",{className:"font-semibold text-emerald-600",children:["Easy ",ne.easy,"%"]})," • ",e.jsxs("span",{className:"font-semibold text-amber-500",children:["Medium ",ne.medium,"%"]})," • ",e.jsxs("span",{className:"font-semibold text-rose-500",children:["Hard ",ne.hard,"%"]}),"."]})]})]})}),v==="results"&&ae&&e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] space-y-[24px] pb-8",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-md rounded-[20px] border border-[#e2e8f0] shadow-[0_8px_24px_rgba(0,0,0,0.04)] p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-bold font-display text-[#0a1628]",children:"Quiz Generated"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:kl,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-[#dde3eb] rounded-lg text-xs font-medium text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:[ft?e.jsx(Ht,{size:14,className:"text-green-500"}):e.jsx(Qr,{size:14}),ft?"Copied!":"Copy All"]}),e.jsxs("button",{onClick:Cl,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-[#dde3eb] rounded-lg text-xs font-medium text-[#5a6578] hover:bg-[#edf1f7] transition-colors",children:[e.jsx(fc,{size:14}),"Export JSON"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 md:gap-6",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] text-white shadow-[0_8px_16px_rgba(168,85,247,0.25)] rounded-[20px] p-6 text-center flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-20 h-20 bg-white/10 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx(Es,{size:22,className:"text-white/80 mb-2 relative z-10"}),e.jsx("span",{className:"text-[32px] font-extrabold leading-none mb-1 relative z-10 drop-shadow-sm",children:ae.questions.length}),e.jsx("span",{className:"text-[12px] font-bold text-white/90 uppercase tracking-widest relative z-10",children:"Questions"})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f43f5e] to-[#e11d48] text-white shadow-[0_8px_16px_rgba(244,63,94,0.25)] rounded-[20px] p-6 text-center flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-20 h-20 bg-white/10 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx(ms,{size:22,className:"text-white/80 mb-2 relative z-10"}),e.jsx("span",{className:"text-[32px] font-extrabold leading-none mb-1 relative z-10 drop-shadow-sm",children:ae.totalPoints}),e.jsx("span",{className:"text-[12px] font-bold text-white/90 uppercase tracking-widest relative z-10",children:"Total Points"})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f59e0b] to-[#d97706] text-white shadow-[0_8px_16px_rgba(245,158,11,0.25)] rounded-[20px] p-6 text-center flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-20 h-20 bg-white/10 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx(Gt,{size:22,className:"text-white/80 mb-2 relative z-10"}),e.jsx("span",{className:"text-[32px] font-extrabold leading-none mb-1 relative z-10 drop-shadow-sm",children:Object.keys(ae.metadata.topicsCovered).length}),e.jsx("span",{className:"text-[12px] font-bold text-white/90 uppercase tracking-widest relative z-10",children:"Topics"})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] text-white shadow-[0_8px_16px_rgba(16,185,129,0.25)] rounded-[20px] p-6 text-center flex flex-col items-center justify-center group hover:-translate-y-1 transition-transform",children:[e.jsx("div",{className:"absolute -right-4 -top-4 w-20 h-20 bg-white/10 rounded-full group-hover:scale-150 transition-transform duration-500"}),e.jsx(ir,{size:22,className:"text-white/80 mb-2 relative z-10"}),e.jsx("span",{className:"text-[32px] font-extrabold leading-none mb-1 relative z-10 drop-shadow-sm",children:Object.keys(ae.metadata.bloomTaxonomyDistribution).length}),e.jsx("span",{className:"text-[12px] font-bold text-white/90 uppercase tracking-widest relative z-10",children:"Bloom Levels"})]})]}),(ae.metadata.usedImportedTopics||(ae.metadata.topicProvenance||[]).length>0)&&e.jsxs("div",{className:"mt-4 bg-white rounded-lg p-3 border border-[#dde3eb]",children:[e.jsx("p",{className:"text-xs font-semibold text-[#5a6578] mb-2",children:"Imported Topic Provenance"}),e.jsxs("p",{className:"text-xs text-[#5a6578] mb-2",children:["Imported topics used: ",ae.metadata.usedImportedTopics?"Yes":"No"," • ","Materials: ",ae.metadata.importedMaterialsCount??0," • ","Topics: ",ae.metadata.importedTopicCount??0]}),(ae.metadata.topicProvenance||[]).slice(0,5).map((x,F)=>e.jsxs("div",{className:"text-xs text-[#5a6578]",children:[x.title||"Untitled topic",x.sourceFile?` • ${x.sourceFile}`:""]},`${x.topicId||x.title||"topic"}_${F}`)),(Ee.length>0||Oe.length>0)&&e.jsxs("div",{className:"mt-3 grid grid-cols-1 md:grid-cols-2 gap-2",children:[e.jsxs("label",{className:"text-xs text-[#5a6578] flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:"Filter by Source File"}),e.jsxs("select",{value:ns,onChange:x=>vs(x.target.value),className:"bg-white border border-[#dde3eb] rounded-md px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"All sources"}),Ee.map(x=>e.jsx("option",{value:x,children:x},x))]})]}),e.jsxs("label",{className:"text-xs text-[#5a6578] flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:"Filter by Material ID"}),e.jsxs("select",{value:os,onChange:x=>z(x.target.value),className:"bg-white border border-[#dde3eb] rounded-md px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"All materials"}),Oe.map(x=>e.jsx("option",{value:x,children:x},x))]})]})]}),e.jsxs("p",{className:"text-[11px] text-[#5a6578] mt-2",children:["Showing ",Pt.length," of ",ae.questions.length," questions after provenance filters."]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mt-8 mb-10",children:[e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-[16px] p-6 shadow-sm border-t-[4px] border-t-[#10b981] hover:shadow-md transition-shadow",children:[e.jsxs("h4",{className:"text-[12px] font-bold text-[#64748b] uppercase tracking-wider mb-5 flex items-center gap-2",children:[e.jsx(As,{size:14})," Difficulty"]}),e.jsx("div",{className:"space-y-3 text-[14px] font-medium text-[#475569]",children:Object.entries(ae.metadata.difficultyBreakdown).map(([x,F])=>e.jsxs("div",{className:"flex justify-between items-center bg-slate-50 px-3 py-2 rounded-lg",children:[e.jsx("span",{className:`font-bold capitalize ${vm[x]||"text-[#475569]"}`,children:x}),e.jsx("span",{className:"font-bold text-[#1e293b] bg-white px-2 py-0.5 rounded shadow-sm border border-slate-100",children:F})]},x))})]}),e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-[16px] p-6 shadow-sm border-t-[4px] border-t-[#a855f7] hover:shadow-md transition-shadow",children:[e.jsxs("h4",{className:"text-[12px] font-bold text-[#64748b] uppercase tracking-wider mb-5 flex items-center gap-2",children:[e.jsx(Hr,{size:14})," Bloom's Taxonomy"]}),e.jsx("div",{className:"space-y-3 text-[14px] font-medium text-[#475569]",children:Object.entries(ae.metadata.bloomTaxonomyDistribution).map(([x,F])=>e.jsxs("div",{className:"flex justify-between items-center bg-slate-50 px-3 py-2 rounded-lg",children:[e.jsx("span",{className:"text-[#1e293b] font-semibold capitalize",children:x}),e.jsx("span",{className:"font-bold text-[#1e293b] bg-white px-2 py-0.5 rounded shadow-sm border border-slate-100",children:F})]},x))})]}),e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-[16px] p-6 shadow-sm border-t-[4px] border-t-[#0ea5e9] hover:shadow-md transition-shadow",children:[e.jsxs("h4",{className:"text-[12px] font-bold text-[#64748b] uppercase tracking-wider mb-5 flex items-center gap-2",children:[e.jsx(ir,{size:14})," Question Types"]}),e.jsx("div",{className:"space-y-3 text-[14px] font-medium text-[#475569]",children:Object.entries(ae.metadata.questionTypeBreakdown).map(([x,F])=>e.jsxs("div",{className:"flex justify-between items-center bg-slate-50 px-3 py-2 rounded-lg",children:[e.jsx("span",{className:"text-[#1e293b] font-semibold",children:Va[x]?.label||x}),e.jsx("span",{className:"font-bold text-[#1e293b] bg-white px-2 py-0.5 rounded shadow-sm border border-slate-100",children:F})]},x))})]})]}),e.jsxs("div",{className:"bg-gradient-to-r from-purple-50 to-indigo-50/50 border border-purple-100 rounded-[16px] p-6 mb-10 flex items-start gap-4 shadow-sm relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full bg-[#a855f7]"}),e.jsx("div",{className:"bg-white p-2 rounded-full shadow-sm shrink-0",children:e.jsx(ra,{size:18,className:"text-[#9333ea]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold text-[#9333ea] mb-3",children:ae.metadata.supplementalPurpose||"This quiz is designed to supplement classroom instruction, not replace teacher-led learning."}),ae.metadata.recommendedTeacherActions&&ae.metadata.recommendedTeacherActions.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[13px] font-bold text-[#1e293b] mb-2",children:"Recommended Actions:"}),e.jsx("ul",{className:"list-disc pl-5 text-[13px] font-medium text-[#475569] space-y-1.5",children:ae.metadata.recommendedTeacherActions.map((x,F)=>e.jsx("li",{children:x},F))})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("h3",{className:"text-[18px] font-bold text-[#1e293b] flex items-center gap-2",children:[e.jsx(Ni,{size:20,className:"text-[#a855f7]"})," Review Questions"]}),e.jsx("div",{className:"space-y-4",children:Pt.length>0?Pt.map((x,F)=>Ml(x,F)):e.jsx("div",{className:"border border-[#dde3eb] rounded-xl p-4 bg-white text-sm text-[#5a6578]",children:"No questions match the selected provenance filters. Clear one or both filters to view all questions."})})]})]})]})]}),C==="create"&&e.jsx("div",{className:"sticky bottom-0 mt-auto w-full bg-white/90 backdrop-blur-[12px] border-t border-[#e2e8f0] z-30 shadow-[0_-4px_12px_rgba(0,0,0,0.03)]",children:e.jsxs("div",{className:"w-full px-6 xl:px-8 py-4 flex items-center justify-between",children:[e.jsxs("div",{children:[v==="topics"&&!te&&e.jsx("button",{onClick:()=>{k([]),$([])},className:"text-[13px] font-semibold text-[#a855f7] hover:underline",children:"Clear all"}),(v==="style"||v==="preview")&&!te&&e.jsxs("button",{onClick:()=>g(v==="preview"?"style":"topics"),className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-sm transition-transform hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(zs,{size:16})," Back"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[v==="setup"&&!te&&e.jsxs("button",{onClick:()=>g("topics"),className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-semibold rounded-full px-8 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02] flex items-center gap-2",children:["Next: Topics ",e.jsx(Rs,{size:16})]}),v==="topics"&&!te&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>g("setup"),className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-sm transition-transform hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(zs,{size:16})," Back"]}),e.jsxs("button",{onClick:()=>g("style"),className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02] flex items-center gap-2",children:["Next: Question Style ",e.jsx(Rs,{size:16})]})]}),v==="style"&&!te&&e.jsxs("button",{onClick:()=>g("preview"),className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-semibold rounded-full px-8 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02] flex items-center gap-2",children:["Next: Preview ",e.jsx(Rs,{size:16})]}),v==="preview"&&!te&&!ae&&e.jsxs("button",{onClick:Sl,className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-bold rounded-full px-8 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-all hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(Ht,{size:16})," Generate Quiz"]}),te&&e.jsxs("div",{className:"flex items-center gap-3 text-slate-500 font-medium text-sm",children:[e.jsx(gt,{size:16,className:"animate-spin"})," Generating quiz... Please wait."]}),v==="results"&&(Ha?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{S("bank"),Hs(null)},className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-sm transition-transform hover:scale-[1.02]",children:"Back to Quiz Bank"}),e.jsxs("button",{onClick:()=>Cr(Ha),className:"bg-white border border-[#a855f7] text-[#9333ea] hover:bg-purple-50 text-[14px] font-bold rounded-full px-8 py-2.5 shadow-sm transition-transform hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(sa,{size:16})," Assign"]}),e.jsx("button",{onClick:kn,className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-bold rounded-full px-10 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02]",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{g("setup"),Ce(null),Je(null),kt(null),Hs(null)},className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[14px] font-semibold rounded-full px-6 py-2.5 shadow-sm transition-transform hover:scale-[1.02]",children:"Create Another"}),B?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:Tl,disabled:Me,className:"bg-white border border-[#a855f7] text-[#9333ea] hover:bg-purple-50 text-[14px] font-bold rounded-full px-8 py-2.5 shadow-sm transition-transform hover:scale-[1.02] flex items-center gap-2",children:[Me?e.jsx(gt,{size:16,className:"animate-spin"}):e.jsx(ia,{size:16})," Publish"]}),e.jsxs("button",{onClick:()=>Cr(),className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-bold rounded-full px-8 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02] flex items-center gap-2",children:[e.jsx(sa,{size:16})," Assign to Class"]})]}):e.jsxs("button",{onClick:Il,disabled:me,className:"bg-emerald-600 hover:bg-emerald-700 text-white px-8 py-2.5 rounded-full font-bold shadow-lg shadow-emerald-500/30 hover:-translate-y-1 transition-all flex items-center gap-2 text-[14px]",children:[me?e.jsx(gt,{size:16,className:"animate-spin"}):e.jsx(vi,{size:16})," Save to Library"]}),e.jsx("button",{onClick:kn,className:"bg-[#a855f7] hover:bg-[#9333ea] text-white text-[14px] font-bold rounded-full px-10 py-2.5 shadow-[0_4px_12px_rgba(168,85,247,0.3)] transition-transform hover:scale-[1.02]",children:"Done"})]}))]})]})}),e.jsx(pm,{isOpen:bs,onClose:()=>Ps(!1)}),e.jsx(zt,{children:O&&e.jsx(ze.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/40 z-[60] flex items-center justify-center p-4",onClick:()=>ve(!1),children:e.jsxs(ze.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-[#f7f9fc] rounded-2xl shadow-2xl w-full max-w-md max-h-[70vh] flex flex-col overflow-hidden border border-[#dde3eb]",onClick:x=>x.stopPropagation(),children:[e.jsxs("div",{className:"px-5 py-4 border-b border-[#dde3eb] flex items-center justify-between",children:[e.jsxs("h3",{className:"text-base font-bold font-display text-[#0a1628] flex items-center gap-2",children:[e.jsx(us,{size:18,className:"text-sky-600"}),"Assign to Student"]}),e.jsx("button",{onClick:()=>ve(!1),className:"p-1 hover:bg-[#edf1f7] rounded-lg transition-colors",children:e.jsx(Xt,{size:16,className:"text-slate-500"})})]}),e.jsx("div",{className:"px-5 py-3 border-b border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center gap-2 bg-[#edf1f7] rounded-xl px-3 py-2",children:[e.jsx(Ws,{size:14,className:"text-slate-500"}),e.jsx("input",{type:"text",placeholder:"Search students…",value:rt,onChange:x=>nt(x.target.value),className:"flex-1 bg-transparent text-sm outline-none placeholder:text-slate-500"})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1",children:it?e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx(gt,{size:20,className:"animate-spin text-sky-500"})}):_n.length===0?e.jsx("p",{className:"text-center text-sm text-slate-500 py-10",children:"No students found"}):_n.map(x=>e.jsxs("button",{onClick:()=>ws(x.id),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-left transition-colors ${ut===x.id?"bg-sky-50 border border-sky-300":"hover:bg-[#edf1f7] border border-transparent"}`,children:[e.jsx("img",{src:x.avatar&&!x.avatar.includes("ui-avatars.com")?x.avatar:Xa(x.gender),alt:x.name,className:"w-8 h-8 rounded-lg object-cover"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-[#0a1628] truncate",children:x.name}),e.jsx("p",{className:"text-xs text-slate-500 truncate",children:x.email})]}),ut===x.id&&e.jsx(Ht,{size:16,className:"text-sky-600 flex-shrink-0"})]},x.id))}),e.jsxs("div",{className:"px-5 py-3 border-t border-[#dde3eb] flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>ve(!1),className:"px-4 py-2 text-sm font-medium text-[#5a6578] hover:bg-[#edf1f7] rounded-xl transition-colors",children:"Cancel"}),e.jsxs("button",{onClick:_l,disabled:!ut||we,className:`flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-bold transition-all ${ut&&!we?"bg-gradient-to-r from-sky-600 to-sky-500 text-white shadow-sm":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[we?e.jsx(gt,{size:14,className:"animate-spin"}):e.jsx(sa,{size:14}),"Assign"]})]})]})})})]});return d?e.jsx("div",{className:"w-full h-full flex flex-col overflow-hidden bg-white",children:Mn}):Mn},wm=({onOpenNotifications:t,onOpenProfile:s,onOpenInsightModal:a,userPhoto:r,teacherName:o})=>{const[n,i]=u.useState([]),[l,c]=u.useState(!1),[d,m]=u.useState(!1),[p,h]=u.useState(""),[b,N]=u.useState(11),[C,S]=u.useState("general_mathematics"),[v,g]=u.useState([]),[I,L]=u.useState(!1),[R,W]=u.useState(null),f=u.useCallback(async()=>{L(!0);try{const y=Mt(Lt(Ue,"question_bank",String(b),C,"questions","questions"),nr(50));let J=(await Ot(y)).docs.map(re=>{const le=re.data();return{id:re.id,question:le.question||"",choices:le.choices||[],correct_answer:le.correct_answer||"",explanation:le.explanation||"",topic:le.topic||"",difficulty:le.difficulty||"medium",grade_level:le.grade_level||11}});if(J.length===0){const re=Mt(Lt(Ue,"quizBattleQuestionBank"),nr(50));J=(await Ot(re)).docs.map(ne=>{const be=ne.data();return{id:ne.id,question:be.question||"",choices:be.choices||[],correct_answer:be.correct_answer||"",explanation:be.explanation||"",topic:be.topic||"",difficulty:be.difficulty||"medium",grade_level:be.grade_level||11}})}g(J)}catch(y){console.warn("[QuestionBankPanel] Failed to load questions:",y)}finally{L(!1)}},[b,C]);u.useEffect(()=>{f()},[f]);const k=u.useCallback(async()=>{c(!0);try{const y=await Ln("/api/quiz-battle/bank-status");i(y.pdfs)}catch(y){const q=y instanceof ar?y.message:"Failed to load bank status";ie.error(q)}finally{c(!1)}},[]);u.useEffect(()=>{k()},[k]);const w=async()=>{if(!p.trim()){ie.error("Please enter a storage path");return}m(!0);try{await Ln("/api/quiz-battle/ingest-pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storage_path:p.trim(),grade_level:b,topic:C.trim(),force_reingest:!1})}),ie.success("PDF ingestion completed"),await k(),h("")}catch(y){const q=y instanceof ar?y.message:"Ingestion failed";ie.error(q)}finally{m(!1)}},$=n.reduce((y,q)=>y+q.question_count,0),A=n.filter(y=>y.processed).length;return e.jsxs("div",{className:"w-full h-full flex flex-col overflow-y-auto bg-gradient-to-br from-[#f8fafc] to-[#f1f5f9]",children:[e.jsx("div",{className:"w-full px-[24px] xl:px-[32px] pt-[12px] pb-2"}),e.jsxs("div",{className:"w-full px-[24px] xl:px-[32px] pb-[32px] space-y-[32px]",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#3b82f6] to-[#2563eb] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(59,130,246,0.2)] hover:shadow-[0_8px_24px_rgba(59,130,246,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total PDFs"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(Es,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:n.length})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] hover:shadow-[0_8px_24px_rgba(168,85,247,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total Questions"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(Gt,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:$})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(16,185,129,0.2)] hover:shadow-[0_8px_24px_rgba(16,185,129,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Processed"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(cs,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:A})]})]}),e.jsx("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] overflow-hidden",children:e.jsxs("div",{className:"p-[24px] sm:p-[32px]",children:[e.jsxs("h2",{className:"text-[20px] font-bold text-[#1e293b] mb-6 flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center shadow-md shadow-purple-500/20",children:e.jsx(Vr,{className:"w-4 h-4 text-white"})}),"Ingest New PDF"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6 items-end",children:[e.jsxs("div",{className:"md:col-span-6 group",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Firebase Storage Path"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:e.jsx(Es,{className:"h-4 w-4 text-[#94a3b8] group-hover:text-[#a855f7] transition-colors"})}),e.jsx("input",{type:"text",placeholder:"quiz_pdfs/grade_11/gen_math_q1.pdf",value:p,onChange:y=>h(y.target.value),className:"w-full bg-slate-50 border border-slate-200 hover:border-[#cbd5e1] text-[#475569] text-[14px] font-medium rounded-xl pl-11 pr-4 py-3.5 outline-none focus:bg-white focus:border-[#a855f7] focus:ring-4 focus:ring-[#a855f7]/10 transition-all shadow-inner"})]})]}),e.jsxs("div",{className:"md:col-span-2 group",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Grade Level"}),e.jsx("input",{type:"number",placeholder:"11",min:7,max:12,value:b,onChange:y=>N(Number(y.target.value)),className:"w-full bg-slate-50 border border-slate-200 hover:border-[#cbd5e1] text-[#475569] text-[14px] font-medium rounded-xl px-4 py-3.5 outline-none focus:bg-white focus:border-[#a855f7] focus:ring-4 focus:ring-[#a855f7]/10 transition-all shadow-inner"})]}),e.jsxs("div",{className:"md:col-span-4 group",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] mb-2 block group-hover:text-[#a855f7] transition-colors",children:"Topic Slug"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:e.jsx(Gt,{className:"h-4 w-4 text-[#94a3b8] group-hover:text-[#a855f7] transition-colors"})}),e.jsx("input",{type:"text",placeholder:"general_mathematics",value:C,onChange:y=>S(y.target.value),className:"w-full bg-slate-50 border border-slate-200 hover:border-[#cbd5e1] text-[#475569] text-[14px] font-medium rounded-xl pl-11 pr-4 py-3.5 outline-none focus:bg-white focus:border-[#a855f7] focus:ring-4 focus:ring-[#a855f7]/10 transition-all shadow-inner"})]})]})]}),e.jsx("div",{className:"mt-6 flex justify-end pt-6 border-t border-slate-100",children:e.jsxs("button",{onClick:w,disabled:d,className:"bg-gradient-to-r from-[#a855f7] to-[#9333ea] hover:from-[#9333ea] hover:to-[#7e22ce] text-white text-[14px] font-bold rounded-full px-8 py-3 shadow-[0_4px_16px_rgba(168,85,247,0.3)] transition-all hover:scale-[1.02] flex items-center gap-2 hover:shadow-[0_8px_24px_rgba(168,85,247,0.4)] disabled:opacity-50 disabled:hover:scale-100",children:[d?e.jsx(gt,{className:"w-4 h-4 animate-spin"}):e.jsx(Vr,{className:"w-4 h-4"}),"Ingest PDF"]})})]})}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] p-[24px] sm:p-[32px]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h2",{className:"text-[20px] font-bold text-[#1e293b]",children:"Processing Status"}),e.jsx("button",{onClick:k,disabled:l,className:"w-9 h-9 rounded-full bg-white border border-slate-200 flex items-center justify-center text-[#64748b] hover:text-[#9333ea] hover:border-purple-200 shadow-sm transition-all hover:scale-105 active:scale-95 disabled:opacity-50",children:e.jsx(cs,{className:`w-4 h-4 ${l?"animate-spin":""}`})})]}),e.jsx("div",{className:"bg-white rounded-[16px] border border-[#f1f5f9] overflow-hidden shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#9956DE] border-b border-[#8b5cf6] shadow-md relative z-10",children:[e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Filename"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Grade"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Topic"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap text-center",children:"Questions"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Status"}),e.jsx("th",{className:"h-12 px-6 text-[11px] font-bold text-white uppercase tracking-wider whitespace-nowrap",children:"Processed At"})]})}),e.jsxs("tbody",{className:"divide-y divide-[#f1f5f9] bg-white",children:[n.map(y=>e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[e.jsx("td",{className:"py-4 px-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${y.processed?"bg-indigo-50 text-indigo-500":"bg-amber-50 text-amber-500"}`,children:e.jsx(Es,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-[13px] font-bold text-[#1e293b] group-hover:text-purple-600 transition-colors line-clamp-1",children:y.filename})]})}),e.jsx("td",{className:"py-4 px-6 text-[13px] font-semibold text-[#475569]",children:y.grade_level}),e.jsx("td",{className:"py-4 px-6",children:e.jsx("span",{className:"text-[12px] font-medium bg-slate-100 text-slate-600 px-2.5 py-1 rounded-md line-clamp-1",children:y.topic})}),e.jsx("td",{className:"py-4 px-6 text-[13px] font-bold text-[#1e293b] text-center",children:y.question_count||"-"}),e.jsx("td",{className:"py-4 px-6",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-3 py-1 text-[11px] font-bold rounded-full border shadow-sm ${y.processed?"bg-emerald-50 text-emerald-600 border-emerald-200/50":"bg-amber-50 text-amber-600 border-amber-200/50"}`,children:[y.processed?e.jsx(cs,{className:"w-3 h-3"}):e.jsx(gt,{className:"w-3 h-3 animate-spin"}),y.processed?"Completed":"Processing..."]})}),e.jsx("td",{className:"py-4 px-6 text-[13px] font-medium text-[#64748b]",children:y.timestamp?new Date(y.timestamp).toLocaleDateString():"-"})]},y.filename)),n.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"py-12 px-6 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-[#64748b]",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4 border border-slate-100",children:e.jsx(Es,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-1",children:"No PDFs processed yet"}),e.jsx("p",{className:"text-[13px]",children:"Upload a PDF using the form above to get started."})]})})})]})]})})})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] p-[24px] sm:p-[32px]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("h2",{className:"text-[20px] font-bold text-[#1e293b] flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] bg-gradient-to-br from-[#3b82f6] to-[#2563eb] flex items-center justify-center shadow-md shadow-blue-500/20",children:e.jsx(Gt,{className:"w-4 h-4 text-white"})}),"Question Bank (",v.length,")"]}),e.jsx("button",{onClick:f,disabled:I,className:"w-9 h-9 rounded-full bg-white border border-slate-200 flex items-center justify-center text-[#64748b] hover:text-[#9333ea] hover:border-purple-200 shadow-sm transition-all hover:scale-105 active:scale-95 disabled:opacity-50",children:e.jsx(cs,{className:`w-4 h-4 ${I?"animate-spin":""}`})})]}),I?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(gt,{className:"w-6 h-6 animate-spin text-[#9956DE]"})}):v.length===0?e.jsxs("div",{className:"text-center py-12 text-[#64748b]",children:[e.jsx(Gt,{className:"w-10 h-10 mx-auto mb-3 text-slate-300"}),e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-1",children:"No questions in the bank yet"}),e.jsx("p",{className:"text-[13px]",children:"Ingest a PDF above to populate the question bank."})]}):e.jsx("div",{className:"space-y-2 max-h-[500px] overflow-y-auto",children:v.map(y=>e.jsxs("div",{className:"border border-[#f1f5f9] rounded-xl p-4 hover:border-purple-200 transition-colors bg-white",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 cursor-pointer",onClick:()=>W(R===y.id?null:y.id),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[13px] font-medium text-[#1e293b] line-clamp-2",children:y.question}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsxs("span",{className:"text-[11px] px-2 py-0.5 rounded-md bg-blue-50 text-blue-600 font-semibold",children:["Grade ",y.grade_level]}),e.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded-md bg-slate-100 text-slate-600 font-medium",children:y.topic}),e.jsx("span",{className:`text-[11px] px-2 py-0.5 rounded-md font-semibold ${y.difficulty==="easy"?"bg-green-50 text-green-600":y.difficulty==="hard"?"bg-rose-50 text-rose-600":"bg-amber-50 text-amber-600"}`,children:y.difficulty})]})]}),R===y.id?e.jsx(ka,{size:16,className:"text-[#94a3b8] shrink-0"}):e.jsx($t,{size:16,className:"text-[#94a3b8] shrink-0"})]}),R===y.id&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-[#f1f5f9] space-y-2",children:[e.jsx("div",{className:"space-y-1",children:y.choices.map((q,J)=>e.jsxs("p",{className:`text-[12px] px-3 py-1.5 rounded-lg ${q===y.correct_answer?"bg-green-50 text-green-700 font-semibold border border-green-200":"bg-slate-50 text-[#475569]"}`,children:[String.fromCharCode(65+J),". ",q]},J))}),y.explanation&&e.jsxs("p",{className:"text-[12px] text-[#64748b] italic mt-2 flex items-center gap-1",children:[e.jsx(gc,{size:12})," ",y.explanation]})]})]},y.id))})]})]})]})},$o={totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:0},Nm={"gen-math":{label:"GEN MATH",color:"bg-sky-100 text-sky-700"},"stats-prob":{label:"STAT&PROB",color:"bg-sky-100 text-sky-700"},"pre-calc":{label:"PRE-CALC",color:"bg-orange-100 text-orange-700"},"basic-calc":{label:"BASIC CALC",color:"bg-red-100 text-red-700"}},Fo={mastered:{label:"Mastered",color:"text-emerald-600 bg-emerald-50 border-emerald-100"},on_track:{label:"On Track",color:"text-amber-600 bg-amber-50 border-amber-100"},needs_attention:{label:"Needs Work",color:"text-rose-600 bg-rose-50 border-rose-100"},no_data:{label:"No Data",color:"text-slate-600 bg-slate-50 border-slate-200"}},Oo={needs_attention:0,on_track:1,no_data:2,mastered:3},jm=({classSectionId:t,onOpenNotifications:s,onOpenProfile:a})=>{const{currentUser:r,userProfile:o}=hs(),[n,i]=u.useState([]),[l,c]=u.useState($o),[d,m]=u.useState(!0),[p,h]=u.useState("all"),[b,N]=u.useState("all"),[C,S]=u.useState(""),[v,g]=u.useState("classAverage"),[I,L]=u.useState("asc"),R=Hn.map(H=>H.id),W=Hn.reduce((H,ee)=>(H[ee.id]=ee.name,H),{}),{isLoading:f,refetch:k}=jc();u.useEffect(()=>{f||(console.log("[TopicMasteryView] Curriculum ready"),k())},[f,k]);const[w,$]=u.useState(new Set),[A,y]=u.useState([]),q=vc({queryKey:$l.topicMastery(r?.uid||"anonymous",t),enabled:!!r,staleTime:120*1e3,gcTime:900*1e3,queryFn:async()=>{try{if(!r)return{excluded:[],topics:[],summary:{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:0}};const H=pt(Ue,"teachers",r.uid,"settings","quizSettings"),ee=await Ss(H),oe=ee.exists()?ee.data()?.excludedTopics||[]:[],Re="https://deign86-mathpulse-api-v3test.hf.space",Fe=new URLSearchParams({teacherId:r.uid});t&&Fe.set("classSectionId",t);const Pe=await r.getIdToken(),G=await fetch(`${Re}/api/analytics/topic-mastery?${Fe.toString()}`,{headers:{Authorization:`Bearer ${Pe}`}});if(!G.ok)return{excluded:oe,topics:[],summary:{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:oe.length}};const te=await G.json(),E=(te.topics||[]).map(Y=>({...Y,isExcluded:oe.includes(Y.topicName)}));return{excluded:oe,topics:E,summary:te.summary||{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:oe.length}}}catch{return{excluded:[],topics:[],summary:{totalTopicsTracked:0,masteredCount:0,needsAttentionCount:0,excludedCount:0}}}}});u.useEffect(()=>{if(m(q.isLoading||q.isFetching),!q.data){y([]),i([]),c($o),$(new Set);return}y(q.data.excluded),i(q.data.topics),c(q.data.summary)},[q.data,q.isFetching,q.isLoading]);const J=async H=>{if(!r)return;const ee=A.includes(H)?A.filter(oe=>oe!==H):[...A,H];y(ee),i(oe=>oe.map(Re=>Re.topicName===H?{...Re,isExcluded:!Re.isExcluded}:Re)),c(oe=>({...oe,excludedCount:ee.length}));try{const oe=pt(Ue,"teachers",r.uid,"settings","quizSettings");(await Ss(oe)).exists()?await es(oe,{excludedTopics:ee}):await ts(oe,{excludedTopics:ee})}catch{ie.error("Failed to update excluded topics")}},re=async()=>{if(!r)return;const H=[...new Set([...A,...w])];y(H),i(ee=>ee.map(oe=>w.has(oe.topicName)?{...oe,isExcluded:!0}:oe)),c(ee=>({...ee,excludedCount:H.length})),$(new Set);try{const ee=pt(Ue,"teachers",r.uid,"settings","quizSettings");(await Ss(ee)).exists()?await es(ee,{excludedTopics:H}):await ts(ee,{excludedTopics:H}),ie.success(`${w.size} topics excluded from quizzes`)}catch{ie.error("Failed to update")}},le=async()=>{if(!r)return;const H=A.filter(ee=>!w.has(ee));y(H),i(ee=>ee.map(oe=>w.has(oe.topicName)?{...oe,isExcluded:!1}:oe)),c(ee=>({...ee,excludedCount:H.length})),$(new Set);try{const ee=pt(Ue,"teachers",r.uid,"settings","quizSettings");(await Ss(ee)).exists()?await es(ee,{excludedTopics:H}):await ts(ee,{excludedTopics:H}),ie.success(`${w.size} topics re-included in quizzes`)}catch{ie.error("Failed to update")}},ne=H=>{v===H?L(ee=>ee==="asc"?"desc":"asc"):(g(H),L("asc"))},be=b==="all"?R:wc(b);u.useEffect(()=>{p!=="all"&&(be.includes(p)||h("all"))},[be,p]);const Ie=n.filter(H=>!(p!=="all"&&H.subjectId!==p||!be.includes(H.subjectId)||C&&!H.topicName.toLowerCase().includes(C.toLowerCase()))).sort((H,ee)=>{const oe=I==="asc"?1:-1;switch(v){case"topicName":return oe*H.topicName.localeCompare(ee.topicName);case"classAverage":return oe*(H.classAverage-ee.classAverage);case"studentsAttempted":return oe*(H.studentsAttempted-ee.studentsAttempted);case"masteryStatus":return oe*((Oo[H.masteryStatus]||0)-(Oo[ee.masteryStatus]||0));default:return 0}}),de=()=>{w.size===Ie.length?$(new Set):$(new Set(Ie.map(H=>H.topicName)))},fe=({field:H})=>v!==H?e.jsx($t,{size:14,className:"text-white/40"}):I==="asc"?e.jsx(ka,{size:14,className:"text-white font-bold"}):e.jsx($t,{size:14,className:"text-white font-bold"});return d?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(gt,{size:24,className:"animate-spin text-indigo-500"}),e.jsx("span",{className:"ml-2 text-[#64748b]",children:"Loading topic mastery data..."})]}):e.jsxs(ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-full p-[24px] xl:p-[32px] space-y-[24px]",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total Topics Tracked"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(As,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:l.totalTopicsTracked})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(16,185,129,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Mastered by Class"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(Aa,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:l.masteredCount})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f43f5e] to-[#e11d48] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(244,63,94,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Needs Work"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(la,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:l.needsAttentionCount})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#64748b] to-[#475569] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(100,116,139,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Excluded Topics"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(hc,{size:16,className:"text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none",children:l.excludedCount})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white",children:[e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"flex items-center bg-white px-4 py-2.5 rounded-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-[#e2e8f0] group focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all w-full md:w-64",children:[e.jsx(Ws,{size:16,className:"text-[#64748b] shrink-0 group-focus-within:text-[#4f46e5] transition-colors"}),e.jsx("input",{type:"text",placeholder:"Search topics...",value:C,onChange:H=>S(H.target.value),className:"bg-transparent border-none focus:outline-none ml-2 text-[13px] w-full text-[#475569] placeholder:text-[#94a3b8]"})]}),e.jsxs("div",{className:"relative w-full md:w-48",children:[e.jsxs("select",{value:p,onChange:H=>h(H.target.value),className:"appearance-none w-full bg-white border border-[#e2e8f0] text-[#475569] text-[13px] font-medium rounded-[12px] pl-4 pr-10 py-2.5 outline-none focus:border-[#a855f7] focus:ring-2 focus:ring-[#a855f7]/20 shadow-[0_1px_4px_rgba(0,0,0,0.02)] cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Subjects"}),be.map(H=>e.jsx("option",{value:H,children:W[H]||H},H))]}),e.jsx($t,{size:16,className:"text-[#64748b] absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative w-full md:w-48",children:[e.jsxs("select",{value:b,onChange:H=>N(H.target.value),className:"appearance-none w-full bg-white border border-[#e2e8f0] text-[#475569] text-[13px] font-medium rounded-[12px] pl-4 pr-10 py-2.5 outline-none focus:border-[#a855f7] focus:ring-2 focus:ring-[#a855f7]/20 shadow-[0_1px_4px_rgba(0,0,0,0.02)] cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Grades"}),Nc.map(H=>e.jsx("option",{value:H,children:H},H))]}),e.jsx($t,{size:16,className:"text-[#64748b] absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]}),e.jsx(zt,{children:w.size>0&&e.jsxs(ze.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mb-4 bg-indigo-50 border border-indigo-200 rounded-[12px] p-3 flex items-center gap-3 flex-wrap overflow-hidden",children:[e.jsxs("span",{className:"text-[13px] font-semibold text-indigo-700",children:[w.size," topics selected"]}),e.jsx("button",{onClick:re,className:"px-4 py-1.5 bg-[#475569] text-white text-[11px] font-bold rounded-full hover:bg-[#334155] transition-colors shadow-sm",children:"Exclude Selected"}),e.jsx("button",{onClick:le,className:"px-4 py-1.5 bg-emerald-600 text-white text-[11px] font-bold rounded-full hover:bg-emerald-700 transition-colors shadow-sm",children:"Include Selected"}),e.jsx("button",{onClick:()=>$(new Set),className:"px-4 py-1.5 bg-white border border-[#e2e8f0] text-[#64748b] text-[11px] font-bold rounded-full hover:bg-[#f8fafc] transition-colors shadow-sm",children:"Clear Selection"})]})}),e.jsx("div",{className:"bg-white rounded-[16px] border border-[#f1f5f9] overflow-hidden shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("div",{className:"min-w-[800px]",children:[e.jsxs("div",{className:"bg-[#9956DE] grid grid-cols-12 gap-4 p-4 border-b border-[#8b5cf6] items-center text-[11px] font-bold text-white tracking-wider uppercase shadow-md relative z-10 h-12",children:[e.jsx("div",{className:"col-span-1 flex justify-center",children:e.jsx("input",{type:"checkbox",checked:w.size===Ie.length&&Ie.length>0,onChange:de,className:"rounded text-[#4f46e5] focus:ring-[#4f46e5] w-4 h-4 border-white/30 bg-white/10 cursor-pointer"})}),e.jsxs("div",{className:"col-span-3 flex items-center gap-1 cursor-pointer hover:text-white/80 select-none",onClick:()=>ne("topicName"),children:["TOPIC NAME ",e.jsx(fe,{field:"topicName"})]}),e.jsx("div",{className:"col-span-2",children:"UNIT"}),e.jsxs("div",{className:"col-span-2 flex items-center gap-1 cursor-pointer hover:text-white/80 select-none",onClick:()=>ne("classAverage"),children:["CLASS AVG % ",e.jsx(fe,{field:"classAverage"})]}),e.jsxs("div",{className:"col-span-2 flex items-center gap-1 cursor-pointer hover:text-white/80 select-none",onClick:()=>ne("studentsAttempted"),children:["STUDENTS ",e.jsx(fe,{field:"studentsAttempted"})]}),e.jsxs("div",{className:"col-span-1 flex items-center gap-1 cursor-pointer hover:text-white/80 select-none",onClick:()=>ne("masteryStatus"),children:["STATUS ",e.jsx(fe,{field:"masteryStatus"})]}),e.jsx("div",{className:"col-span-1 text-center",children:"EXCLUDE"})]}),e.jsx("div",{className:"flex flex-col",children:Ie.length===0?e.jsx("div",{className:"p-16 text-center border-b border-[#f1f5f9]",children:n.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(As,{size:32,className:"text-[#cbd5e1]"}),e.jsx("p",{className:"text-[13px] font-semibold text-[#64748b]",children:"No topic data available yet"}),e.jsx("p",{className:"text-[11px] text-[#94a3b8]",children:"Import student quiz data to see class topic mastery analytics."})]}):e.jsx("span",{className:"text-[13px] text-[#64748b]",children:"No topics match the current filters."})}):Ie.map(H=>{const ee=w.has(H.topicName),oe=Fo[H.masteryStatus]||Fo.no_data,Re=Nm[H.subjectId]||{label:H.subjectId.toUpperCase(),color:"bg-[#f8fafc] text-[#64748b]"},Fe=H.classAverage<60?"bg-rose-500":H.classAverage<85?"bg-amber-500":"bg-emerald-500",Pe=H.isExcluded?"bg-slate-50/60 opacity-70":H.masteryStatus==="needs_attention"?"bg-rose-50/30":H.masteryStatus==="mastered"?"bg-emerald-50/20":"";return e.jsxs("div",{className:`grid grid-cols-12 gap-4 p-4 border-b border-[#f1f5f9] items-center hover:bg-slate-50/80 transition-colors group ${Pe} ${H.isExcluded?"line-through decoration-slate-400":""}`,children:[e.jsx("div",{className:"col-span-1 flex justify-center",children:e.jsx("input",{type:"checkbox",checked:ee,onChange:()=>{const G=new Set(w);ee?G.delete(H.topicName):G.add(H.topicName),$(G)},className:"rounded text-[#4f46e5] focus:ring-[#4f46e5] w-4 h-4 border-gray-300 cursor-pointer"})}),e.jsxs("div",{className:"col-span-3 flex flex-col sm:flex-row sm:items-center gap-1.5 pr-2 min-w-0",children:[e.jsx("span",{className:"font-semibold text-[#1e293b] text-[13px] truncate",children:H.topicName}),e.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded shrink-0 ${Re.color}`,children:Re.label})]}),e.jsx("div",{className:"col-span-2 text-[#475569] text-[13px] truncate pr-2",children:H.unit}),e.jsx("div",{className:"col-span-2",children:e.jsxs("span",{className:"font-bold text-[#1e293b] text-[14px]",children:[H.classAverage,"%"]})}),e.jsxs("div",{className:"col-span-2 pr-4",children:[e.jsx("div",{className:"flex justify-between items-center text-[11px] mb-1",children:e.jsxs("span",{className:"font-semibold text-[#1e293b]",children:[H.studentsAttempted," / ",H.totalStudents]})}),e.jsx("div",{className:"w-full bg-[#f1f5f9] h-1.5 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${Fe}`,style:{width:`${H.classAverage}%`}})})]}),e.jsx("div",{className:"col-span-1",children:e.jsx("span",{className:`text-[10px] font-bold px-2.5 py-1 rounded-full border whitespace-nowrap ${oe.color}`,children:oe.label})}),e.jsxs("div",{className:"col-span-1 flex justify-center relative",children:[e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer group/toggle",children:[e.jsx("input",{type:"checkbox",checked:H.isExcluded,onChange:()=>J(H.topicName),className:"sr-only peer"}),e.jsx("div",{className:"w-9 h-5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#4f46e5]"})]}),e.jsx("div",{className:"hidden group-hover/toggle:block absolute z-20 bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-slate-800 text-white text-[10px] rounded whitespace-nowrap shadow-lg",children:H.isExcluded?"Include in generation":"Exclude from generation"})]})]},H.topicName)})})]})})})]})]})};function pl(t){return(t||"").trim().toLowerCase()}function Po(t){const s=(t.lrn||"").trim().toLowerCase();if(s)return`lrn:${s}`;const a=(t.email||"").trim().toLowerCase();if(a)return`email:${a}`;const r=t.name.trim().toLowerCase();if(r)return`name:${r}`;const o=pl(t.classSectionId),n=(t.id||"").trim().toLowerCase();return o&&n?`${o}|id:${n}`:n?`id:${n}`:`${o}|anonymous`}function ym(t,s){const a=[],r=(t.lrn||"").trim().toLowerCase(),o=(t.email||"").trim().toLowerCase(),n=t.name.trim().toLowerCase(),i=(t.id||"").trim().toLowerCase();return r&&a.push(`${s}|lrn:${r}`),o&&a.push(`${s}|email:${o}`),n&&a.push(`${s}|name:${n}`),i&&a.push(`${s}|id:${i}`),a.length===0&&a.push(`${s}|anonymous`),a}function Sm(t,s){const a=[t.riskLevel,s.riskLevel].includes("High")?"High":[t.riskLevel,s.riskLevel].includes("Medium")?"Medium":"Low";return{...t,lrn:t.lrn||s.lrn,classSectionId:t.classSectionId??s.classSectionId,avgQuizScore:s.avgQuizScore>0?s.avgQuizScore:t.avgQuizScore,engagementScore:s.engagementScore>0?s.engagementScore:t.engagementScore,weakestTopic:t.weakestTopic&&t.weakestTopic!=="Foundational Skills"?t.weakestTopic:s.weakestTopic,riskLevel:a}}function hl(t,s){const a=new Map,r=new Map,o=s?pl(s):"all";return t.forEach(n=>{const i=ym(n,o),l=i.map(m=>r.get(m)).find(Boolean)||i[0],c=a.get(l),d=c?Sm(c,n):n;a.set(l,d),i.forEach(m=>r.set(m,l))}),Array.from(a.values())}function Bo(t,s){return hl([...t,...s])}function ea(t){return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}function km(t){if(!t)return null;const s="gen-math",a=Un.find(i=>i.id===s)?.modules||[];if(a.length===0)return null;const r={mastery:0,concept:0,application:0,engagement:0,consistency:0},o=t.lessons??{};a.forEach(i=>{const l=Un.find(S=>S.modules.some(v=>v.id===i.id)),c=l?t?.subjects?.[l.id]?.modulesProgress?.[i.id]:null,d=ea(c?.progress||0),m=i.lessons.length?i.lessons.reduce((S,v)=>{const g=o?.[v.id]?.score;if(typeof g=="number"&&Number.isFinite(g))return S+ea(g);const I=!!c?.lessonsCompleted?.includes?.(v.id);return S+(I?100:0)},0)/i.lessons.length:0,p=i.quizzes.length?(c?.quizzesCompleted?.length||0)/i.quizzes.length*100:0,h=ea(m),b=ea(p),N=ea(Math.min(100,(h+b*2)/1.5)),C=ea(Math.min(100,40+d*.6));r.mastery+=d,r.concept+=h,r.application+=b,r.engagement+=N,r.consistency+=C});const n=a.length;return{mastery:Math.round(r.mastery/n),concept:Math.round(r.concept/n),application:Math.round(r.application/n),engagement:Math.round(r.engagement/n),consistency:Math.round(r.consistency/n)}}const Ho={advanced:{bg:"bg-emerald-100",text:"text-emerald-700",bar:"bg-emerald-500"},proficient:{bg:"bg-sky-100",text:"text-sky-700",bar:"bg-sky-500"},developing:{bg:"bg-rose-100",text:"text-rose-700",bar:"bg-rose-500"},beginner:{bg:"bg-red-100",text:"text-red-700",bar:"bg-red-500"}},$r=[{key:"mastery",short:"M",label:"Overall Mastery",header:"Mastery"},{key:"concept",short:"C",label:"Concept Grasp",header:"Concept"},{key:"application",short:"A",label:"Application",header:"Applications"},{key:"consistency",short:"S",label:"Consistency",header:"Consistency"}],Cm=({classSectionId:t,className:s,fallbackStudents:a=[],onBack:r,onOpenNotifications:o,onOpenProfile:n,insightDismissed:i,onOpenInsightModal:l})=>{const{currentUser:c,userProfile:d}=hs(),m=u.useRef(0),[p,h]=u.useState([]),[b,N]=u.useState(!0),[C,S]=u.useState(""),[v,g]=u.useState("riskLevel"),[I,L]=u.useState("desc"),[R,W]=u.useState("all"),[f,k]=u.useState([]),[w,$]=u.useState(!1),[A,y]=u.useState(""),[q,J]=u.useState(""),re=u.useCallback(E=>({id:E.id,lrn:E.lrn||void 0,name:E.name,email:E.email||"",avatar:Xa(E.gender),classSectionId:E.classSectionId??null,riskLevel:E.riskLevel||"Low",engagementScore:E.engagementScore,avgQuizScore:E.avgQuizScore,weakestTopic:E.weakestTopic||"Foundational Skills"}),[]),le=u.useCallback(E=>({id:E.id,lrn:E.lrn,name:E.name,email:E.email||"",avatar:E.avatar&&!E.avatar.includes("ui-avatars.com")?E.avatar:Xa(E.gender),classSectionId:E.classSectionId??null,riskLevel:String(E.riskLevel).charAt(0).toUpperCase()+String(E.riskLevel).slice(1).toLowerCase(),engagementScore:Number(E.engagementScore)||0,avgQuizScore:Number(E.avgQuizScore??E.avgScore??0)||0,weakestTopic:E.weakestTopic||"Foundational Skills",accountUid:E.accountUid}),[]),ne=u.useCallback(async(E,Y)=>{const V=new Map,pe=new Map;E.forEach(j=>V.set(j.id,null));const D=25;for(let j=0;j{const ue=Q.accountUid||Q.id;try{const ce=await Ur(ue),ae=ce?.averageScore||0;return{studentId:Q.id,summary:km(ce),avgScore:ae}}catch{return{studentId:Q.id,summary:null,avgScore:0}}}))).forEach((Q,ue)=>{const ce=_[ue]?.id;ce&&(Q.status==="fulfilled"?(V.set(ce,Q.value.summary),Q.value.avgScore>0&&pe.set(ce,Q.value.avgScore)):V.set(ce,null))})}m.current===Y&&h(j=>j.map(_=>{if(!V.has(_.student.id))return _;const T=pe.get(_.student.id);return{..._,student:T!=null&&T>_.student.avgQuizScore?{..._.student,avgQuizScore:Math.round(T)}:_.student,competencyMatrix:V.get(_.student.id)??null,competencyMatrixLoading:!1}}))},[]),be=u.useCallback(async()=>{if(c?.uid){N(!0),J("");try{let Y=(await Nn(c.uid)).map(j=>({id:j.id,name:j.name,email:j.email||"",avatar:j.avatar&&!j.avatar.includes("ui-avatars.com")?j.avatar:Xa(j.gender),classSectionId:j.classSectionId??null,riskLevel:j.riskLevel,engagementScore:Number(j.engagementScore)||0,avgQuizScore:Number(j.avgQuizScore)||0,weakestTopic:j.weakestTopic||"Foundational Skills",accountUid:j.accountUid}));a.length>0&&(Y=Bo(Y,a.map(le))),t&&(Y=Y.filter(j=>j.classSectionId===t));const V=await xt.getImportedClassOverview({classSectionId:t,limit:3e3});V.warnings.length>0&&J(V.warnings.join(" ")),Y=Bo(Y,V.students.map(re));const pe=hl(Y,t),D=m.current+=1;h(pe.map((j,_)=>({rowKey:`${Po(j)}|row:${_}`,student:j,competency:null,competencyMatrix:null,competencyMatrixLoading:!0,loading:!1,expanded:!1}))),ne(pe,D)}catch(E){if(console.error("Failed to load students:",E),a.length>0){const Y=a.map(le).filter(V=>!t||V.classSectionId===t).map((V,pe)=>({rowKey:`${Po(V)}|row:${pe}`,student:V,competency:null,competencyMatrix:null,competencyMatrixLoading:!1,loading:!1,expanded:!1}));h(Y),J("Showing recently imported students while backend roster sync catches up.")}else h([]),J("Student competency roster is unavailable right now.")}finally{N(!1)}}},[t,c?.uid,a,ne,le,re]);u.useEffect(()=>{be()},[be]),u.useEffect(()=>{(async()=>{if(!t){k([]),y("");return}$(!0),y("");try{const Y=await xt.getCourseMaterialTopics({classSectionId:t,limit:20}),V=(Y.topics||[]).filter(pe=>pe.title?.trim());k(V),Y.warnings.length>0&&y(Y.warnings.join(" "))}catch{k([]),y("Imported topic context is unavailable right now.")}finally{$(!1)}})()},[t]);const Ie=async E=>{h(Y=>Y.map(V=>{if(V.rowKey!==E)return V;const pe=!V.expanded,D=V.student.id,j={weakestTopic:V.student.weakestTopic,avgQuizScore:V.student.avgQuizScore};return pe&&!V.competency&&!V.loading?(de(E,D,j),{...V,expanded:!0,loading:!0}):{...V,expanded:pe}}))},de=async(E,Y,V)=>{try{const D=((await Ur(Y))?.quizAttempts??[]).map(_=>({topic:_.quizId,score:_.score,total:100,timeTaken:_.timeSpent})),j=await xt.getStudentCompetency(Y,D.length>0?D:void 0);h(_=>_.map(T=>T.rowKey===E?{...T,competency:j,loading:!1}:T))}catch{const D=V.avgQuizScore||50,j={studentId:Y,competencies:[{topic:V.weakestTopic||"Unknown",efficiencyScore:Math.max(15,D-20),competencyLevel:D<50?"beginner":"developing",perspective:`Student needs focused practice in ${V.weakestTopic}.`},{topic:"Functions and Relations",efficiencyScore:Math.min(95,D+10),competencyLevel:D>70?"proficient":"developing",perspective:"Shows solid understanding of function concepts."},{topic:"Problem Solving",efficiencyScore:D,competencyLevel:D>80?"advanced":D>60?"proficient":"developing",perspective:"Applies mathematical reasoning consistently."}],recommendedTopics:[V.weakestTopic||"Review fundamentals"],excludeTopics:[]};h(_=>_.map(T=>T.rowKey===E?{...T,competency:j,loading:!1}:T))}},fe=E=>{v===E?L(Y=>Y==="asc"?"desc":"asc"):(g(E),L("asc"))},H={High:0,Medium:1,Low:2},ee=p.filter(E=>{if(R!=="all"&&E.student.riskLevel!==R)return!1;if(C){const Y=C.toLowerCase();return E.student.name.toLowerCase().includes(Y)||E.student.email.toLowerCase().includes(Y)}return!0}).sort((E,Y)=>{let V=0;switch(v){case"name":V=E.student.name.localeCompare(Y.student.name);break;case"avgQuizScore":V=E.student.avgQuizScore-Y.student.avgQuizScore;break;case"riskLevel":V=H[E.student.riskLevel]-H[Y.student.riskLevel];break;case"engagementScore":V=E.student.engagementScore-Y.student.engagementScore;break}return I==="asc"?V:-V}),oe=p.length,Re=p.filter(E=>E.student.riskLevel==="High").length,Fe=oe>0?Math.round(p.reduce((E,Y)=>E+(Number(Y.student.avgQuizScore)||0),0)/oe):0,Pe=oe>0?Math.round(p.reduce((E,Y)=>E+(Number(Y.student.engagementScore)||0),0)/oe):0,G=Array.from(new Set(f.map(E=>E.title).filter(Boolean))).slice(0,10),te=({field:E})=>v!==E?e.jsx($t,{size:14,className:"text-white/40"}):I==="asc"?e.jsx(ka,{size:14,className:"text-white font-bold"}):e.jsx($t,{size:14,className:"text-white font-bold"});return b?e.jsxs("div",{className:"flex items-center justify-center py-20 p-6",children:[e.jsx(gt,{size:32,className:"animate-spin text-[var(--primary)]"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading student data..."})]}):e.jsxs(ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6 space-y-6",children:[r&&e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("button",{onClick:r,className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors bg-white/60 hover:bg-white/80 px-[18px] py-2 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50",children:[e.jsx(zs,{className:"w-4 h-4"}),"Back to Classes"]})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px] mb-6",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-5 shadow-[0_4px_12px_rgba(168,85,247,0.2)] hover:shadow-[0_8px_24px_rgba(168,85,247,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total Students"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(Dn,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[28px] font-bold relative z-10 leading-none mb-4",children:oe}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Evaluated in this class"})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f97316] to-[#ea580c] rounded-[16px] p-5 shadow-[0_4px_12px_rgba(249,115,22,0.2)] hover:shadow-[0_8px_24px_rgba(249,115,22,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"At-Risk Students"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(la,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[28px] font-bold relative z-10 leading-none mb-4",children:Re}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Need immediate intervention"})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#0ea5e9] to-[#0284c7] rounded-[16px] p-5 shadow-[0_4px_12px_rgba(14,165,233,0.2)] hover:shadow-[0_8px_24px_rgba(14,165,233,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Class Average"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(As,{className:"w-4 h-4 text-white"})})]}),e.jsxs("div",{className:"text-[28px] font-bold relative z-10 leading-none mb-4",children:[Fe,"%"]}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Vs. expected benchmark"})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] rounded-[16px] p-5 shadow-[0_4px_12px_rgba(16,185,129,0.2)] hover:shadow-[0_8px_24px_rgba(16,185,129,0.3)] hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between group text-white",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Avg. Engagement"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(ia,{className:"w-4 h-4 text-white"})})]}),e.jsxs("div",{className:"text-[28px] font-bold relative z-10 leading-none mb-4",children:[Pe,"%"]}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Activity completion rate"})})]})]}),e.jsx("div",{className:"sticky top-0 z-30 py-4 -my-4 bg-[#f8fafc]/80 backdrop-blur-[16px] border-b border-slate-200/50 shadow-[0_4px_20px_rgba(0,0,0,0.02)] px-2 sm:-mx-6 sm:px-6 mb-6 rounded-b-[18px]",children:e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 w-full md:w-auto items-center",children:[e.jsxs("div",{className:"flex items-center bg-white px-4 py-2.5 rounded-full shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#e2e8f0] group focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all w-full sm:w-64",children:[e.jsx(Ws,{className:"w-4 h-4 text-[#64748b] shrink-0 group-focus-within:text-[#9956DE] transition-colors"}),e.jsx("input",{type:"text",placeholder:"Search students...",value:C,onChange:E=>S(E.target.value),className:"bg-transparent border-none focus:outline-none ml-2 text-[13px] w-full text-[#475569] placeholder:text-[#94a3b8]"})]}),e.jsx("div",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar w-full sm:w-auto p-2 -m-2",children:["all","High","Medium","Low"].map(E=>e.jsx("button",{onClick:()=>W(E),className:`px-4 py-1.5 text-[13px] font-semibold rounded-full whitespace-nowrap transition-colors shadow-md ${R===E?"bg-[#9956DE] text-white":"bg-white text-slate-500 hover:text-slate-700 hover:bg-slate-50"}`,children:E==="all"?"All":`${E} Risk`},E))})]}),e.jsxs("button",{onClick:be,className:"flex items-center gap-2 text-[13px] font-semibold text-slate-500 hover:text-slate-700 transition-colors shrink-0 bg-white px-4 py-2 rounded-full shadow-md hover:bg-slate-50 self-end sm:self-auto",children:[e.jsx(cs,{className:"w-4 h-4"})," Refresh"]})]})}),e.jsxs("div",{className:"bg-[#f5f3ff]/60 border border-[#e0e7ff] rounded-[14px] px-5 py-3 mb-6 flex items-start sm:items-center gap-3",children:[e.jsx("div",{className:"mt-0.5 sm:mt-0 shrink-0",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[#9956DE]",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center flex-1",children:[e.jsxs("span",{className:"text-[#9956DE] font-semibold text-[13px] whitespace-nowrap mr-1",children:["Imported Topic Context",s?` for ${s}`:"",":"]}),w?e.jsx("span",{className:"text-[#8b5cf6] text-[13px]",children:"Loading class-scoped imported topics..."}):G.length>0?e.jsx("div",{className:"flex flex-wrap items-center gap-1.5 mt-1 sm:mt-0",children:G.map((E,Y)=>e.jsxs(he.Fragment,{children:[e.jsx("span",{className:"text-[#8b5cf6] text-[13px]",children:E}),Yfe("name"),children:["Student ",e.jsx(te,{field:"name"})]}),e.jsxs("div",{className:"w-[120px] shrink-0 px-4 flex justify-center cursor-pointer hover:text-white/80 transition-colors",onClick:()=>fe("riskLevel"),children:["Risk Level ",e.jsx(te,{field:"riskLevel"})]}),e.jsxs("div",{className:"w-[200px] shrink-0 px-4 flex items-center gap-1 cursor-pointer hover:text-white/80 transition-colors",onClick:()=>fe("avgQuizScore"),children:["Avg. Score ",e.jsx(te,{field:"avgQuizScore"})]}),e.jsxs("div",{className:"w-[180px] shrink-0 px-4 flex items-center gap-1 cursor-pointer hover:text-white/80 transition-colors",onClick:()=>fe("engagementScore"),children:["Engagement ",e.jsx(te,{field:"engagementScore"})]}),e.jsx("div",{className:"w-[160px] shrink-0 px-4 flex justify-center cursor-pointer hover:text-white/80 transition-colors",children:"Weakest Topic"}),$r.map((E,Y)=>e.jsx("div",{className:`w-[100px] shrink-0 px-2 flex justify-center ${Y===$r.length-1?"border-r border-transparent":""}`,children:E.header},E.key))]}),ee.length===0?e.jsxs("div",{className:"py-12 text-center text-slate-500",children:[e.jsx(Dn,{size:32,className:"mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No students match the current filters"})]}):e.jsx("div",{className:"divide-y divide-border",children:ee.map(E=>(E.student.riskLevel==="High"||E.student.riskLevel,e.jsxs("div",{className:"flex flex-col border-b border-slate-100 group",children:[e.jsxs("div",{className:"flex items-center min-h-[64px] hover:bg-slate-50/60 transition-colors cursor-pointer relative",onClick:()=>void Ie(E.rowKey),children:[e.jsxs("div",{className:"w-[260px] shrink-0 sticky left-0 z-10 bg-white group-hover:bg-slate-50/90 transition-colors px-5 h-full min-h-[64px] flex items-center border-r border-slate-100 shadow-[2px_0_4px_rgba(0,0,0,0.01)]",children:[e.jsx("div",{className:`transition-transform duration-200 mr-3 shrink-0 ${E.expanded?"rotate-90":""}`,children:e.jsx(Rs,{className:"w-4 h-4 text-slate-400"})}),e.jsx("img",{src:E.student.avatar,alt:E.student.name,className:"w-8 h-8 rounded-full bg-border object-cover shrink-0 mr-3"}),e.jsx("span",{className:"font-semibold text-slate-800 text-[14px] truncate",children:E.student.name})]}),e.jsx("div",{className:"w-[120px] shrink-0 px-4 flex justify-center",children:e.jsx("span",{className:`px-3 py-1 rounded-full border text-[11px] font-bold uppercase tracking-wider ${E.student.riskLevel==="High"?"bg-rose-50 text-rose-600 border-rose-200":E.student.riskLevel==="Medium"?"bg-amber-50 text-amber-600 border-amber-200":"bg-emerald-50 text-emerald-600 border-emerald-200"}`,children:E.student.riskLevel})}),e.jsxs("div",{className:"w-[200px] shrink-0 px-4 flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 bg-slate-100 h-2.5 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${E.student.avgQuizScore>=80?"bg-emerald-500":E.student.avgQuizScore>=60?"bg-amber-400":"bg-rose-500"}`,style:{width:`${E.student.avgQuizScore}%`}})}),e.jsxs("span",{className:"text-[13px] font-bold text-slate-800 w-8",children:[E.student.avgQuizScore,"%"]})]}),e.jsxs("div",{className:"w-[180px] shrink-0 px-4 flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 bg-slate-100 h-2.5 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-[#9956DE]",style:{width:`${E.student.engagementScore}%`}})}),e.jsxs("span",{className:"text-[13px] font-bold text-slate-800 w-8",children:[E.student.engagementScore,"%"]})]}),e.jsx("div",{className:"w-[160px] shrink-0 px-4 flex justify-center",children:e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-600 text-[11px] font-medium rounded-full truncate max-w-full border border-slate-200",children:E.student.weakestTopic})}),$r.map(Y=>{const V=E.competencyMatrix?.[Y.key]??0;return e.jsx("div",{className:"w-[100px] shrink-0 px-2 flex justify-center",children:E.competencyMatrixLoading?e.jsx(gt,{size:12,className:"animate-spin text-muted-foreground"}):E.competencyMatrix?e.jsxs("span",{className:`text-[12px] font-medium px-2 rounded-full border ${V>=80?"text-emerald-600 bg-emerald-50 border-emerald-100":V>=60?"text-amber-600 bg-amber-50 border-amber-100":"text-rose-500 bg-rose-50 border-rose-100"}`,children:[V,"%"]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},Y.key)})]}),e.jsx(zt,{children:E.expanded&&e.jsx(ze.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden bg-slate-50/80 border-t border-slate-100 shadow-inner",children:e.jsxs("div",{className:"flex min-w-[1320px]",children:[e.jsx("div",{className:"w-[260px] shrink-0 sticky left-0 z-10 bg-slate-50/90 border-r border-slate-100 flex items-start justify-end pr-4 py-4",children:e.jsx("div",{className:"w-1.5 h-full rounded-full bg-[#9956DE]/30"})}),e.jsx("div",{className:"flex-1 py-4 pl-6 pr-6",children:E.loading?e.jsxs("div",{className:"flex items-center py-4",children:[e.jsx(gt,{size:16,className:"animate-spin text-indigo-500 mr-2"}),e.jsx("span",{className:"text-sm text-slate-500",children:"Analyzing competency data..."})]}):E.competency?e.jsxs("div",{className:"space-y-4 max-w-4xl",children:[E.competency.recommendedTopics.length>0&&e.jsxs("div",{className:"bg-[#f5f3ff] rounded-[12px] p-4 border border-[#e0e7ff] inline-block shadow-sm mb-4",children:[e.jsxs("h4",{className:"text-[#7274ED] font-semibold text-[13px] flex items-center gap-2 mb-1.5",children:[e.jsx(Gt,{className:"w-4 h-4"})," Recommended Focus Areas"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:E.competency.recommendedTopics.map((Y,V)=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full border border-indigo-100 bg-white text-indigo-700 text-xs font-medium shadow-sm",children:Y},V))})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:E.competency.competencies.map((Y,V)=>e.jsx(Im,{competency:Y},V))})]}):e.jsx("div",{className:"text-sm text-slate-500 py-4",children:"Failed to load competency details."})})]})})})]},E.rowKey)))})]})})]})},Im=({competency:t})=>{const s=Ho[t.competencyLevel]||Ho.developing;return e.jsxs("div",{className:"bg-card rounded-lg border border-border p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h6",{className:"text-xs font-bold text-foreground truncate flex-1",children:t.topic}),e.jsx("span",{className:`ml-2 px-2 py-0.5 rounded text-[10px] font-bold uppercase ${s.bg} ${s.text}`,children:t.competencyLevel})]}),e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[e.jsx("span",{className:"text-slate-500",children:"Efficiency"}),e.jsxs("span",{className:"font-bold text-muted-foreground",children:[t.efficiencyScore,"%"]})]}),e.jsx("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:e.jsx(ze.div,{initial:{width:0},animate:{width:`${t.efficiencyScore}%`},transition:{duration:.6,delay:.1},className:`h-full rounded-full ${s.bar}`})})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug line-clamp-2",children:t.perspective})]})},Tm=()=>{const{notifications:t,unreadCount:s,isLoading:a,markAsRead:r,markAllAsRead:o}=xi(),[n,i]=u.useState("all"),l=["streak_reminder","daily_checkin","streak_milestone","achievement_unlocked","level_up","xp_earned","quiz_result"],c=t.filter(N=>!N.isRead&&!l.includes(N.type)).length,d=N=>{switch(N){case"achievement_unlocked":case"achievement":return Fl;case"message":return Jl;case"grade":case"quiz_result":return ui;case"reminder":case"streak_reminder":case"daily_checkin":return Ms;case"risk_alert":return la;case"sparkles":case"lesson_plan_ready":return ps;case"users":case"student_import":return us;default:return cr}},m=(N,C)=>{switch(N){case"risk_alert":return"bg-rose-50/30 text-rose-500 border-rose-100";case"sparkles":case"lesson_plan_ready":return"bg-purple-50/30 text-[#a855f7] border-purple-100";case"daily_checkin":return"bg-amber-50/20 text-amber-500 border-amber-100";case"users":case"student_import":return"bg-blue-50/30 text-blue-500 border-blue-100";default:return"bg-slate-50 text-slate-500 border-slate-100"}},p=N=>{switch(N){case"risk_alert":return"from-rose-400 to-rose-600 shadow-[0_4px_12px_rgba(244,63,94,0.3)]";case"sparkles":case"lesson_plan_ready":return"from-[#a855f7] to-[#9333ea] shadow-[0_4px_12px_rgba(168,85,247,0.3)]";case"daily_checkin":return"from-amber-300 to-amber-500 shadow-[0_4px_12px_rgba(245,158,11,0.3)]";case"users":case"student_import":return"from-blue-400 to-blue-600 shadow-[0_4px_12px_rgba(59,130,246,0.3)]";default:return"from-slate-400 to-slate-600 shadow-[0_4px_12px_rgba(100,116,139,0.3)]"}},h=u.useMemo(()=>{let N=t.filter(C=>!l.includes(C.type));return n==="unread"&&(N=N.filter(C=>!C.isRead)),n==="important"&&(N=N.filter(C=>C.type==="risk_alert")),N},[t,n]),b=u.useMemo(()=>{const N=[],C=h.filter(g=>to(g.createdAt)),S=h.filter(g=>so(g.createdAt)),v=h.filter(g=>!to(g.createdAt)&&!so(g.createdAt));return C.length>0&&N.push({title:"Today",icon:Ms,items:C}),S.length>0&&N.push({title:"Yesterday",icon:Pn,items:S}),v.length>0&&N.push({title:"Earlier",icon:Pn,items:v}),N},[h]);return e.jsx("div",{className:"w-full h-full flex flex-col bg-[#f8fafc]/50",children:e.jsxs("div",{className:"max-w-[900px] mx-auto w-full p-[24px] xl:p-[32px] space-y-[24px] flex-1 overflow-y-auto no-scrollbar pb-12",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("button",{onClick:()=>i("all"),className:`px-6 py-2.5 text-[13px] rounded-full whitespace-nowrap transition-all duration-300 border ${n==="all"?"bg-purple-50 text-[#9333ea] border-purple-200 shadow-md font-bold":"bg-white/80 text-[#64748b] border-white hover:border-[#e2e8f0] shadow-sm font-medium"}`,children:"All"}),e.jsxs("button",{onClick:()=>i("unread"),className:`px-6 py-2.5 text-[13px] rounded-full whitespace-nowrap transition-all duration-300 border flex items-center gap-2 ${n==="unread"?"bg-purple-50 text-[#9333ea] border-purple-200 shadow-md font-bold":"bg-white/80 text-[#64748b] border-white hover:border-[#e2e8f0] shadow-sm font-medium"}`,children:["Unread",e.jsx("span",{className:"w-5 h-5 rounded-full bg-slate-100 text-[10px] font-bold flex items-center justify-center text-slate-500",children:c})]}),e.jsxs("button",{onClick:()=>i("important"),className:`px-6 py-2.5 text-[13px] rounded-full whitespace-nowrap transition-all duration-300 border flex items-center gap-2 ${n==="important"?"bg-purple-50 text-[#9333ea] border-purple-200 shadow-md font-bold":"bg-white/80 text-[#64748b] border-white hover:border-[#e2e8f0] shadow-sm font-medium"}`,children:["Important",t.some(N=>N.type==="risk_alert"&&!N.isRead)&&e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-rose-500 shadow-[0_0_8px_rgba(244,63,94,0.6)]"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-3 shrink-0",children:[e.jsx("span",{className:"text-[13px] font-bold text-[#64748b]",children:c>0?`${c} unread`:"No unread"}),e.jsxs("button",{onClick:o,disabled:c===0,className:"bg-white hover:bg-slate-50 border border-slate-200 text-[#475569] text-[13px] font-bold rounded-full px-5 py-2 shadow-sm transition-all hover:shadow-md hover:-translate-y-0.5 flex items-center gap-2 group disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-sm",children:[e.jsx(kc,{className:"w-4 h-4 text-[#94a3b8] group-hover:text-emerald-500 transition-colors"}),"Mark all as read"]})]})]}),e.jsx("div",{className:"space-y-8",children:a?e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white p-12 flex flex-col items-center justify-center gap-4",children:[e.jsx(gt,{className:"w-8 h-8 text-[#a855f7] animate-spin"}),e.jsx("p",{className:"text-[14px] font-medium text-[#64748b]",children:"Syncing notifications..."})]}):b.length===0?e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white p-16 flex flex-col items-center justify-center text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-slate-50 rounded-full flex items-center justify-center mb-6 border border-slate-100",children:e.jsx(cr,{className:"w-10 h-10 text-slate-300"})}),e.jsx("h3",{className:"text-[18px] font-bold text-[#1e293b] mb-2",children:"All clear!"}),e.jsx("p",{className:"text-[14px] text-[#64748b] max-w-sm",children:"No notifications found for this filter. New alerts will appear here automatically."})]}):b.map(N=>e.jsxs("div",{children:[e.jsxs("h3",{className:"text-[12px] font-bold text-[#94a3b8] uppercase tracking-wider mb-3 ml-2 flex items-center gap-2",children:[e.jsx(N.icon,{className:"w-4 h-4"})," ",N.title]}),e.jsx("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_4px_24px_rgba(0,0,0,0.03)] overflow-hidden divide-y divide-[#f1f5f9]",children:N.items.map(C=>{const S=d(C.type),v=C.type==="risk_alert";return e.jsxs(ze.div,{layout:!0,onClick:()=>!C.isRead&&r(C.id),className:`relative p-5 flex gap-5 group cursor-pointer hover:bg-white transition-all duration-300 ${C.isRead?"opacity-80":m(C.type)}`,children:[e.jsx("div",{className:`absolute left-0 top-0 w-1.5 h-full transition-colors ${C.isRead?"bg-transparent":v?"bg-rose-500":"bg-[#a855f7]"}`}),e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center text-white shrink-0 group-hover:scale-110 transition-transform bg-gradient-to-br ${p(C.type)}`,children:e.jsx(S,{className:"w-6 h-6"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex justify-between items-start mb-1",children:[e.jsxs("h4",{className:"text-[15px] font-bold text-[#1e293b] flex items-center gap-2 truncate pr-4",children:[C.title,!C.isRead&&e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${v?"bg-rose-500 shadow-[0_0_6px_rgba(244,63,94,0.8)]":"bg-[#a855f7] shadow-[0_0_6px_rgba(168,85,247,0.8)]"}`})]}),e.jsxs("span",{className:`text-[12px] font-bold whitespace-nowrap ${C.isRead?"text-[#94a3b8]":v?"text-rose-600":"text-[#a855f7]"}`,children:[Cc(C.createdAt)," ago"]})]}),e.jsx("p",{className:"text-[14px] text-[#475569] font-medium leading-relaxed",children:C.message}),!C.isRead&&C.actionUrl&&e.jsx("div",{className:"mt-3 flex gap-2",children:e.jsx("button",{className:`px-5 py-2 bg-white border rounded-full text-[12px] font-bold shadow-sm transition-all hover:-translate-y-0.5 ${v?"border-rose-200 text-rose-600 hover:bg-rose-50":"border-purple-200 text-[#9333ea] hover:bg-purple-50"}`,children:"Review Plan"})})]}),e.jsx("button",{className:"opacity-0 group-hover:opacity-100 p-2 text-slate-400 hover:text-slate-600 transition-all rounded-full hover:bg-slate-100 shrink-0 self-start",children:e.jsx(Hc,{size:18})})]},C.id)})})]},N.title))})]})})},_m=t=>{const s=t.data(),a=s.startTime,r=s.endTime,o=s.createdAt,n=s.updatedAt,i=l=>{if(l){if(typeof l?.toDate=="function")return l.toDate();if(l instanceof Date)return l}};return{...s,id:t.id,startTime:i(a)||new Date,endTime:i(r),createdAt:i(o)||new Date,updatedAt:i(n)}},Em=async(t,s)=>{const a=pt(Lt(Ue,"calendarEvents")),r={id:a.id,userId:t,title:s.title,description:s.description,startTime:s.startTime,endTime:s.endTime,color:s.color,createdAt:new Date};return await ts(a,{...r,createdAt:ct(),updatedAt:ct()}),r},Rm=async(t,s)=>{const a=pt(Ue,"calendarEvents",t);await es(a,{...s,updatedAt:ct()})},Mm=async t=>{await pi(pt(Ue,"calendarEvents",t))},fl=(t,s={},a,r)=>{if(!t)return a([]),()=>{};const{limitCount:o=500}=s,n=Mt(Lt(Ue,"calendarEvents"),Et("userId","==",t),nr(o));return hi(n,i=>{a(i.docs.map(l=>_m(l)))},i=>{console.error("Error subscribing to calendar events:",i),r?.(i)})};function Am({className:t,...s}){return e.jsx("textarea",{"data-slot":"textarea",className:di("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...s})}const aa=t=>String(t).padStart(2,"0"),Us=t=>`${t.getFullYear()}-${aa(t.getMonth()+1)}-${aa(t.getDate())}`,rn=t=>new Date(t.getFullYear(),t.getMonth(),1),Uo=t=>new Date(t.getFullYear(),t.getMonth()+1,0),zm=t=>{const s=rn(t),a=s.getDay(),r=new Date(s);return r.setDate(s.getDate()-a),r.setHours(0,0,0,0),r},Lm=(t,s)=>{const a=new Date(t);return a.setDate(a.getDate()+s),a},Go=(t,s)=>t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate(),Dm=(t,s)=>t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth(),$m=t=>t.toLocaleDateString(void 0,{month:"long",year:"numeric"}),Wa=t=>t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),Qo=(t,s)=>{const[a,r,o]=t.split("-").map(l=>parseInt(l,10)),[n,i]=s.split(":").map(l=>parseInt(l,10));return new Date(a,(r||1)-1,o||1,n||0,i||0,0,0)},Fm=["purple","blue","emerald","amber","rose"],Fr=t=>{switch(t){case"blue":return"#3b82f6";case"emerald":return"#10b981";case"amber":return"#f59e0b";case"rose":return"#f43f5e";case"purple":default:return"#a855f7"}},Om=(t,s=!1)=>{if(s)return"bg-blue-50 text-blue-700 border-blue-100 opacity-80";switch(t){case"blue":return"bg-blue-50 text-blue-700 border-blue-100 opacity-90 hover:bg-blue-100";case"emerald":return"bg-emerald-50 text-emerald-700 border-emerald-100 opacity-90 hover:bg-emerald-100";case"amber":return"bg-amber-50 text-amber-700 border-amber-100 opacity-90 hover:bg-amber-100";case"rose":return"bg-rose-50 text-rose-700 border-rose-100 opacity-90 hover:bg-rose-100";case"purple":default:return"bg-purple-50 text-purple-700 border-purple-100 opacity-90 hover:bg-purple-100"}},Pm=(t,s=!1)=>{if(s)return{dot:"bg-[#3b82f6]",border:"border-l-blue-400",time:"text-blue-600 border-blue-50"};switch(t){case"blue":return{dot:"bg-blue-500",border:"border-l-blue-400",time:"text-blue-600 border-blue-50"};case"emerald":return{dot:"bg-emerald-500",border:"border-l-emerald-400",time:"text-emerald-600 border-emerald-50"};case"amber":return{dot:"bg-amber-500",border:"border-l-amber-400",time:"text-amber-600 border-amber-50"};case"rose":return{dot:"bg-rose-500",border:"border-l-rose-400",time:"text-rose-600 border-rose-50"};case"purple":default:return{dot:"bg-[#a855f7]",border:"border-l-[#a855f7]",time:"text-[#a855f7] border-purple-50"}}},Or=[{names:["sun","sunday"],day:0},{names:["mon","monday"],day:1},{names:["tue","tues","tuesday"],day:2},{names:["wed","wednesday"],day:3},{names:["thu","thurs","thursday"],day:4},{names:["fri","friday"],day:5},{names:["sat","saturday"],day:6}];function Bm(t){const s=t.toLowerCase(),a=new Set;if(s.includes("daily")||s.includes("everyday"))return[0,1,2,3,4,5,6];if(s.includes("weekends"))return[0,6];if(s.includes("weekdays"))return[1,2,3,4,5];const r=s.match(/(mon|tue|wed|thu|fri|sat|sun)[\s/-]*(mon|tue|wed|thu|fri|sat|sun)/);if(r){const o=Or.find(i=>i.names.includes(r[1]))?.day,n=Or.find(i=>i.names.includes(r[2]))?.day;if(o!==void 0&&n!==void 0){let i=o;for(;a.add(i),i!==n;)i=(i+1)%7;return Array.from(a)}}return Or.forEach(({names:o,day:n})=>{o.some(i=>s.includes(i))&&a.add(n)}),Array.from(a).sort((o,n)=>o-n)}const Hm=({classes:t,teacherId:s})=>{const{currentUser:a}=hs(),[r,o]=u.useState([]),[n,i]=u.useState(!0),[l,c]=u.useState(""),[d,m]=u.useState(!0),[p,h]=u.useState(()=>{const T=new Date;return T.setHours(0,0,0,0),T}),[b,N]=u.useState(()=>{const T=new Date;return T.setHours(0,0,0,0),T}),[C,S]=u.useState(new Set),[v,g]=u.useState(!1),[I,L]=u.useState(null),[R,W]=u.useState(!1),[f,k]=u.useState(""),[w,$]=u.useState(""),[A,y]=u.useState(()=>Us(new Date)),[q,J]=u.useState("09:00"),[re,le]=u.useState(""),[ne,be]=u.useState("purple"),[Ie,de]=u.useState(!1),[fe,H]=u.useState(null);u.useEffect(()=>{if(!a?.uid){o([]),i(!1);return}c(""),i(!0);const T=fl(a.uid,{limitCount:500},Q=>{o(Q),i(!1)},()=>{c("Unable to load calendar events right now."),i(!1)});return()=>T()},[a?.uid]);const ee=u.useMemo(()=>{const T=rn(p);return T.setHours(0,0,0,0),T},[p]),oe=u.useMemo(()=>{const T=Uo(p);return T.setHours(23,59,59,999),T},[p]),Re=u.useMemo(()=>{if(!t||t.length===0)return[];const T=[],Q=rn(p),ue=Uo(p),ce=new Date(Q);for(;ce<=ue;){const ae=ce.getDay();t.forEach(Ce=>{if(Bm(Ce.schedule).includes(ae)){const Je=`schedule-${Ce.id}-${Us(ce)}`;C.has(Je)||T.push({id:Je,userId:s||"",title:Ce.name,startTime:new Date(ce),createdAt:new Date})}}),ce.setDate(ce.getDate()+1)}return T},[t,p,s,C]),Fe=u.useMemo(()=>[...r,...Re],[r,Re]),Pe=u.useMemo(()=>Fe.filter(T=>T.startTime>=ee&&T.startTime<=oe).sort((T,Q)=>T.startTime.getTime()-Q.startTime.getTime()),[Fe,ee,oe]),G=u.useMemo(()=>{const T=new Map;for(const Q of Pe){const ue=Us(Q.startTime),ce=T.get(ue)||[];ce.push(Q),T.set(ue,ce)}return T},[Pe]),te=u.useMemo(()=>Us(b),[b]),E=u.useMemo(()=>[...G.get(te)||[]].sort((Q,ue)=>Q.startTime.getTime()-ue.startTime.getTime()),[G,te]),Y=u.useMemo(()=>{const T=zm(p);return Array.from({length:42}).map((Q,ue)=>Lm(T,ue))},[p]),V=T=>{const Q=Us(T);L(null),k(""),$(""),y(Q),J("09:00"),le(""),be("purple"),g(!0)},pe=T=>{T.id.startsWith("schedule-")?(S(Q=>new Set(Q).add(T.id)),L(null)):L(T.id),k(T.title),$(T.description||""),y(Us(T.startTime)),J(aa(T.startTime.getHours())+":"+aa(T.startTime.getMinutes())),le(T.endTime?aa(T.endTime.getHours())+":"+aa(T.endTime.getMinutes()):""),be(T.color||"purple"),de(!1),g(!0)},D=(T,Q)=>{T.stopPropagation(),H(Q),de(!0)},j=async()=>{const T=a?.uid||s||"local-user";if(!f.trim()){c("Event title is required.");return}W(!0),c("");const Q=Qo(A,q),ue=re?Qo(A,re):void 0,ce={title:f.trim(),description:w.trim()?w.trim():void 0,startTime:Q,endTime:ue&&ue.getTime()>Q.getTime()?ue:void 0,color:ne};try{if(I)o(ae=>ae.map(Ce=>Ce.id===I?{...Ce,...ce}:Ce)),await Rm(I,ce);else{const ae=`temp-${Date.now()}`;o(Ce=>[...Ce,{id:ae,userId:T,createdAt:new Date,...ce}]),await Em(T,ce)}g(!1)}catch(ae){console.error(ae),g(!1)}finally{W(!1)}},_=async T=>{if(T.startsWith("schedule-")){S(Q=>new Set(Q).add(T)),fe?.id===T&&de(!1);return}c(""),o(Q=>Q.filter(ue=>ue.id!==T)),fe?.id===T&&de(!1);try{await Mm(T)}catch(Q){console.error(Q)}};return e.jsxs("div",{className:"w-full h-full flex flex-col px-[24px] xl:px-[32px] py-[24px] xl:py-[32px] overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 flex-1 min-h-0 w-full max-w-[1400px] mx-auto",children:[e.jsx("div",{className:`flex flex-col flex-1 min-w-0 transition-all duration-500 ${d?"lg:w-[65%] xl:w-[70%]":"lg:w-full"}`,children:e.jsxs("div",{className:"bg-white/90 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 border-b border-[#a855f7] bg-[#a855f7] shrink-0 flex justify-between items-center rounded-t-[24px] relative overflow-hidden group",children:[e.jsx("div",{className:"absolute -bottom-24 -right-12 w-64 h-64 bg-white/10 rounded-full"}),e.jsx("div",{className:"absolute -top-20 left-1/4 w-40 h-40 bg-white/5 rounded-full"}),e.jsxs("div",{className:"flex items-center gap-5 relative z-10",children:[e.jsx("button",{onClick:()=>h(new Date(p.getFullYear(),p.getMonth()-1,1)),"aria-label":"Previous month",className:"w-9 h-9 rounded-full flex items-center justify-center text-[#6d28d9] bg-white hover:bg-slate-50 transition-colors shadow-sm hover:shadow-md active:scale-90",children:e.jsx(zs,{className:"w-5 h-5"})}),e.jsx("h2",{className:"text-[22px] font-bold text-white w-44 text-center tracking-tight",children:$m(p)}),e.jsx("button",{onClick:()=>h(new Date(p.getFullYear(),p.getMonth()+1,1)),"aria-label":"Next month",className:"w-9 h-9 rounded-full flex items-center justify-center text-[#6d28d9] bg-white hover:bg-slate-50 transition-colors shadow-sm hover:shadow-md active:scale-90",children:e.jsx(Rs,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"flex items-center gap-3 relative z-10",children:[e.jsxs("span",{className:"text-[13px] font-bold text-[#6d28d9] bg-white px-4 py-1.5 rounded-full shadow-sm",children:[Pe.length," events"]}),e.jsx("button",{onClick:()=>m(!d),className:`w-9 h-9 rounded-full flex items-center justify-center transition-all shadow-sm hover:shadow-md border ${d?"text-[#6d28d9] bg-white border-white":"text-white bg-white/20 border-white/30 backdrop-blur-md"}`,title:d?"Hide Sidebar":"Show Sidebar","aria-label":d?"Hide Sidebar":"Show Sidebar",children:e.jsx(Jc,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-y-auto custom-scrollbar",children:[e.jsx("div",{className:"grid grid-cols-7 text-center border-b border-slate-200/60 pb-5 shrink-0 sticky top-0 bg-white z-20 shadow-[0_10px_10px_-10px_rgba(0,0,0,0.05)] px-4 pt-6",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(T=>e.jsx("div",{className:"text-[12px] font-bold text-[#475569] uppercase tracking-widest",children:T},T))}),e.jsx("div",{className:"grid grid-cols-7 gap-2 pb-6 px-4",children:Y.map(T=>{const Q=Us(T),ue=G.get(Q)||[],ce=Go(T,b),ae=Go(T,new Date),Ce=Dm(T,p);return e.jsxs("div",{onClick:()=>N(new Date(T)),className:`group p-2 rounded-lg transition-all cursor-pointer border-2 flex flex-col relative min-h-[100px] xl:min-h-[120px] ${ce?"bg-purple-50/50 border-[#a855f7] shadow-sm z-10":ae?"bg-purple-50/20 border-purple-300 shadow-[inset_0_0_20px_rgba(168,85,247,0.05)] hover:bg-purple-50/40 hover:border-purple-400":"border-transparent hover:bg-slate-50 hover:border-slate-200"} ${Ce?"":"opacity-30 grayscale"}`,children:[e.jsx("div",{className:"flex justify-between items-start",children:e.jsx("span",{className:`w-7 h-7 rounded-full flex items-center justify-center font-bold text-[14px] transition-all ${ae?"bg-gradient-to-br from-[#a855f7] to-[#9333ea] text-white shadow-md":ce?"text-[#9333ea]":"text-[#1e293b]"}`,children:T.getDate()})}),e.jsxs("div",{className:"mt-1 space-y-1",children:[ue.slice(0,3).map(Ne=>{const Je=Ne.id.startsWith("schedule-");return e.jsx("div",{onClick:$e=>D($e,Ne),className:`w-full truncate text-[11px] font-bold px-2 py-1.5 rounded border shadow-sm transition-all hover:-translate-y-[1px] hover:shadow-md cursor-pointer ${Om(Ne.color,Je)}`,children:Ne.title},Ne.id)}),ue.length>3&&e.jsxs("div",{className:"text-[10px] font-bold text-[#64748b] pl-1 pt-0.5",children:["+",ue.length-3," more"]})]})]},Q)})})]})]})}),e.jsx(zt,{children:d&&e.jsx(ze.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"lg:w-[35%] xl:w-[30%] h-full shrink-0",children:e.jsxs("div",{className:"bg-white/90 backdrop-blur-[12px] rounded-[24px] border border-white shadow-[0_8px_32px_rgba(0,0,0,0.04)] overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 border-b border-[#f1f5f9] bg-white shrink-0 flex justify-between items-center relative overflow-hidden group",children:[e.jsx("div",{className:"absolute top-[-30px] right-[-30px] w-24 h-24 bg-purple-50 rounded-full mix-blend-multiply filter blur-2xl opacity-50 transition-transform duration-700 group-hover:scale-150"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("h2",{className:"text-[20px] font-bold text-[#1e293b]",children:b.toLocaleDateString(void 0,{weekday:"long"})}),e.jsx("p",{className:"text-[13px] font-medium text-[#64748b]",children:b.toLocaleDateString(void 0,{day:"numeric",month:"long",year:"numeric"})})]}),e.jsx("button",{onClick:()=>V(b),title:"Add Event",className:"w-10 h-10 flex items-center justify-center rounded-full bg-[#a855f7] text-white hover:bg-[#9333ea] shadow-md shadow-purple-200 transition-all hover:scale-105 active:scale-95 relative z-10",children:e.jsx(ca,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 custom-scrollbar pb-12",children:E.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center opacity-40",children:[e.jsx(_r,{className:"w-12 h-12 text-slate-300 mb-4"}),e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b]",children:"No events today"}),e.jsx("p",{className:"text-[12px] text-[#64748b]",children:"Schedule a meeting or add a class."})]}):E.map(T=>{const Q=T.id.startsWith("schedule-"),ue=Pm(T.color,Q);return e.jsxs("div",{className:"relative pl-6 before:absolute before:left-2 before:top-2 before:bottom-[-24px] before:w-[2px] before:bg-slate-100 last:before:hidden",children:[e.jsx("div",{className:`absolute left-0 top-1.5 w-4 h-4 rounded-full border-[3px] border-white shadow-sm z-10 ${ue.dot}`}),e.jsxs("div",{onClick:ce=>D(ce,T),className:`group relative bg-white border border-[#e2e8f0] rounded-[20px] p-5 shadow-sm hover:shadow-md hover:-translate-y-0.5 transition-all border-l-[6px] cursor-pointer ${ue.border}`,children:[e.jsx("div",{className:"flex justify-between items-start mb-2",children:e.jsx("h4",{className:"text-[15px] font-bold text-[#1e293b] group-hover:text-[#9333ea] transition-colors break-words line-clamp-2 w-full pr-2",children:T.title})}),e.jsxs("div",{className:`flex items-center gap-2 text-[11px] font-bold bg-slate-50 w-max px-2.5 py-1 rounded-lg border mb-3 ${ue.time}`,children:[e.jsx(Ms,{className:"w-3.5 h-3.5"})," ",e.jsxs("span",{children:[Wa(T.startTime),T.endTime?` - ${Wa(T.endTime)}`:""]})]}),T.description&&e.jsx("p",{className:"text-[13px] font-medium text-[#64748b] bg-slate-50/50 px-3 py-2 rounded-xl border border-slate-100/30 break-words whitespace-normal w-full overflow-hidden",children:T.description})]})]},T.id)})})]})})})]}),e.jsx(Gn,{open:v,onOpenChange:g,children:e.jsx(Qn,{className:"sm:max-w-[500px] p-0 overflow-hidden rounded-[28px] border-none shadow-2xl [&>button]:hidden",children:e.jsxs("div",{className:"p-8 bg-white",children:[e.jsxs(Ic,{className:"mb-6",children:[e.jsx(Tc,{className:"text-[24px] font-bold text-[#1e293b] tracking-tight",children:I?"Edit Event":"Add New Event"}),e.jsx(_c,{className:"text-[14px] text-[#64748b]",children:"Schedule a classroom activity or reminder."})]}),l&&e.jsx("p",{className:"text-rose-500 text-sm font-semibold mb-4",children:l}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Event Title"}),e.jsx(Cs,{value:f,onChange:T=>k(T.target.value),placeholder:"e.g., Mathematics Quiz - Grade 11",className:"bg-white border-slate-200 focus:border-[#a855f7] focus:ring-4 focus:ring-purple-50 rounded-xl h-12 px-4 transition-all text-[14px]"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Date"}),e.jsx(Cs,{type:"date",value:A,onChange:T=>y(T.target.value),className:"bg-white border-slate-200 focus:border-[#a855f7] rounded-xl h-12 px-4 text-[14px]"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Start Time"}),e.jsx(Cs,{type:"time",value:q,onChange:T=>J(T.target.value),className:"bg-white border-slate-200 focus:border-[#a855f7] rounded-xl h-12 px-4 text-[14px]"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Notes (Optional)"}),e.jsx(Am,{value:w,onChange:T=>$(T.target.value),placeholder:"Additional details about this event...",className:"bg-white border-slate-200 focus:border-[#a855f7] rounded-xl min-h-[100px] p-4 transition-all text-[14px] break-all"})]}),e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsx("label",{className:"text-[13px] font-bold text-[#1e293b] ml-1",children:"Color Theme"}),e.jsx("div",{className:"flex gap-3 ml-1",children:Fm.map(T=>e.jsx("button",{onClick:()=>be(T),className:`w-8 h-8 rounded-full flex items-center justify-center transition-all ${ne===T?"ring-2 ring-offset-2 ring-slate-800 scale-110 shadow-sm":"hover:scale-110 opacity-80 hover:opacity-100"}`,style:{backgroundColor:Fr(T)},title:T,children:ne===T&&e.jsx(Ht,{className:"w-4 h-4 text-white"})},T))})]})]}),e.jsxs("div",{className:"flex gap-3 mt-8",children:[e.jsx(St,{variant:"outline",onClick:()=>g(!1),className:"flex-1 h-12 rounded-xl font-bold border-slate-200 hover:bg-slate-100 transition-all text-[14px]",children:"Cancel"}),e.jsx(St,{onClick:j,disabled:R,className:"flex-[1.5] h-12 rounded-xl font-bold bg-[#a855f7] hover:bg-[#9333ea] text-white shadow-lg shadow-purple-200 transition-all hover:scale-[1.02] text-[14px]",children:R?e.jsx(gt,{className:"w-5 h-5 animate-spin"}):"Save Event"})]})]})})}),e.jsx(Gn,{open:Ie,onOpenChange:de,children:e.jsx(Qn,{className:"sm:max-w-[400px] p-0 overflow-hidden rounded-[24px] border-none shadow-2xl [&>button]:hidden",children:fe&&e.jsxs("div",{className:"p-8 bg-white relative",children:[e.jsx("button",{onClick:()=>de(!1),"aria-label":"Close event details",className:"absolute top-4 right-4 p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors",children:e.jsx(Xt,{size:18})}),e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl flex items-center justify-center shrink-0",style:{backgroundColor:Fr(fe.color||"purple")+"20",color:Fr(fe.color||"purple")},children:fe.id.startsWith("schedule-")?e.jsx(rr,{size:24}):e.jsx(_r,{size:24})}),e.jsxs("div",{className:"pr-6",children:[e.jsx("h3",{className:"text-[18px] font-bold text-[#1e293b] leading-tight mb-2",children:fe.title}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-slate-100 text-slate-600 text-[12px] font-semibold border border-slate-200",children:[e.jsx(_r,{size:12}),fe.startTime.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-slate-100 text-slate-600 text-[12px] font-semibold border border-slate-200",children:[e.jsx(Ms,{size:12}),Wa(fe.startTime),fe.endTime?` - ${Wa(fe.endTime)}`:""]})]})]})]}),fe.description&&e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx($c,{size:16,className:"text-slate-400"}),e.jsx("h4",{className:"text-[13px] font-bold text-slate-700",children:"Details"})]}),e.jsx("p",{className:"text-[14px] text-slate-600 leading-relaxed bg-slate-50/50 p-4 rounded-xl border border-slate-100/50 break-words",children:fe.description})]}),e.jsxs("div",{className:"flex gap-3 pt-2 border-t border-slate-100",children:[e.jsxs(St,{variant:"outline",onClick:()=>_(fe.id),className:"flex-1 h-11 rounded-xl font-bold border-rose-200 text-rose-600 hover:bg-rose-50 hover:text-rose-700 transition-all text-[13px]",children:[e.jsx(bi,{className:"w-4 h-4 mr-2"})," Delete"]}),e.jsxs(St,{onClick:()=>pe(fe),className:"flex-1 h-11 rounded-xl font-bold bg-[#1e293b] hover:bg-slate-800 text-white shadow-lg shadow-slate-200 transition-all hover:scale-[1.02] text-[13px]",children:[e.jsx(yi,{className:"w-4 h-4 mr-2"})," Edit Event"]})]})]})})})]})},pr=[{hex:"#9956DE",bg:"bg-[#9956DE]/10",border:"border-[#9956DE]/20",borderLeft:"border-l-[#9956DE]",text:"text-[#9956DE]",groupHover:"group-hover:text-[#9956DE]"},{hex:"#7274ED",bg:"bg-[#7274ED]/10",border:"border-[#7274ED]/20",borderLeft:"border-l-[#7274ED]",text:"text-[#7274ED]",groupHover:"group-hover:text-[#7274ED]"},{hex:"#1FA7E1",bg:"bg-[#1FA7E1]/10",border:"border-[#1FA7E1]/20",borderLeft:"border-l-[#1FA7E1]",text:"text-[#1FA7E1]",groupHover:"group-hover:text-[#1FA7E1]"},{hex:"#6ED1CF",bg:"bg-[#6ED1CF]/10",border:"border-[#6ED1CF]/20",borderLeft:"border-l-[#6ED1CF]",text:"text-[#6ED1CF]",groupHover:"group-hover:text-[#6ED1CF]"},{hex:"#FFB356",bg:"bg-[#FFB356]/10",border:"border-[#FFB356]/20",borderLeft:"border-l-[#FFB356]",text:"text-[#FFB356]",groupHover:"group-hover:text-[#FFB356]"}],Vo=({classes:t,onSelectClass:s,onOpenNotifications:a,onOpenProfile:r,insightDismissed:o,onOpenInsightModal:n,viewType:i="analytics",onCreateClass:l})=>{const{currentUser:c,userProfile:d}=hs(),[m,p]=u.useState(""),h=i==="competency",b=t.reduce((g,I)=>g+(I.studentCount||0),0),N=t.reduce((g,I)=>g+(I.atRiskCount||0),0),C=t.length>0?(t.reduce((g,I)=>g+(I.avgScore||0),0)/t.length).toFixed(1):0,S=u.useMemo(()=>{const g=[],I=t.filter(R=>R.atRiskCount>0);if(I.length>0){const R=[...I].sort((W,f)=>f.atRiskCount-W.atRiskCount)[0];g.push({icon:Yr,text:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-bold text-white",children:R.name})," has ",R.atRiskCount," at-risk student",R.atRiskCount>1?"s":""," needing intervention."]})})}const L=t.filter(R=>R.avgScore>0&&R.avgScore<60);return L.length>0&&g.push({icon:Yr,text:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"font-bold text-white",children:[L.length," class",L.length>1?"es":""]})," below 60% average — consider review sessions."]})}),N===0&&b>0&&g.push({icon:ps,text:e.jsxs(e.Fragment,{children:["All ",e.jsxs("span",{className:"font-bold text-white",children:[b," students"]})," are on track. Great work!"]})}),t.length>0&&Number(C)===0&&g.push({icon:Gt,text:e.jsxs(e.Fragment,{children:["No quiz data yet. ",e.jsx("span",{className:"font-bold text-white",children:"Assign assessments"})," to start tracking progress."]})}),g.length===0&&g.push({icon:ps,text:e.jsx(e.Fragment,{children:"No action items right now. Check back after students complete activities."})}),g},[t,N,b,C]),v=t.filter(g=>g.name.toLowerCase().includes(m.toLowerCase())||(g.gradeLevel||"").toLowerCase().includes(m.toLowerCase()));return e.jsx("div",{className:"h-full overflow-y-auto w-full block",children:e.jsxs("div",{className:"max-w-[1400px] mx-auto p-3 sm:p-[24px] xl:p-[32px] space-y-3 sm:space-y-[24px]",children:[e.jsx("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:e.jsx("div",{className:"flex-1 max-w-xl",children:e.jsxs("div",{className:"flex items-center bg-white/80 px-4 py-2.5 rounded-[16px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white backdrop-blur-[12px] group focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all",children:[e.jsx(Ws,{className:"w-4 h-4 text-[#64748b] shrink-0 group-focus-within:text-[#4f46e5] transition-colors"}),e.jsx("input",{type:"text",placeholder:"Global search for a student across all classes...",value:m,onChange:g=>p(g.target.value),className:"bg-transparent border-none focus:outline-none ml-3 text-[13px] w-full text-[#475569] placeholder:text-[#94a3b8]"})]})})}),h?e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-[16px]",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Total Students Evaluated"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(us,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[32px] font-bold relative z-10 leading-none mb-6",children:b}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Active across all classes"})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#0ea5e9] to-[#0284c7] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(14,165,233,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Global Avg Competency"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(ms,{className:"w-4 h-4 text-white"})})]}),e.jsxs("div",{className:"text-[32px] font-bold relative z-10 leading-none mb-6",children:[C,"%"]}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:e.jsxs("span",{className:"text-[12px] font-medium text-white/90",children:["Across ",t.length," ",t.length===1?"class":"classes"]})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f97316] to-[#ea580c] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(249,115,22,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-4",children:[e.jsx("span",{className:"text-[13px] font-medium text-white/90",children:"Universal Weakness"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(ms,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[20px] font-bold relative z-10 leading-tight mb-2 truncate",children:"Foundational Skills"}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3 mt-auto",children:e.jsxs("span",{className:"text-[12px] font-medium text-white/90",children:["Identified in ",t.length," classes"]})})]})]}):e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-2 sm:gap-[16px]",children:[e.jsxs("div",{className:"lg:col-span-8 grid grid-cols-3 sm:grid-cols-3 gap-2 sm:gap-[16px]",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#10b981] to-[#059669] rounded-[14px] sm:rounded-[16px] p-[14px] sm:p-[20px] shadow-[0_4px_12px_rgba(16,185,129,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2 sm:mb-4",children:[e.jsx("span",{className:"text-[11px] sm:text-[13px] font-medium text-white/90",children:"Total Students"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(us,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[24px] sm:text-[32px] font-bold relative z-10 leading-none mb-3 sm:mb-6",children:b}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:e.jsxs("span",{className:"text-[12px] font-medium text-white/90",children:["Across ",t.length," ",t.length===1?"class":"classes"]})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#0ea5e9] to-[#0284c7] rounded-[14px] sm:rounded-[16px] p-[14px] sm:p-[20px] shadow-[0_4px_12px_rgba(14,165,233,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2 sm:mb-4",children:[e.jsx("span",{className:"text-[11px] sm:text-[13px] font-medium text-white/90",children:"Class average"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(ms,{className:"w-4 h-4 text-white"})})]}),e.jsxs("div",{className:"text-[24px] sm:text-[32px] font-bold relative z-10 leading-none mb-3 sm:mb-6",children:[C,"%"]}),e.jsx("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:e.jsxs("span",{className:"text-[12px] font-medium text-white/90",children:["Across ",t.length," ",t.length===1?"class":"classes"]})})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f97316] to-[#ea580c] rounded-[14px] sm:rounded-[16px] p-[14px] sm:p-[20px] shadow-[0_4px_12px_rgba(249,115,22,0.2)] flex flex-col justify-between h-full group text-white",children:[e.jsx("div",{className:"absolute -right-12 -bottom-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex items-start justify-between relative z-10 mb-2 sm:mb-4",children:[e.jsx("span",{className:"text-[11px] sm:text-[13px] font-medium text-white/90",children:"At risk"}),e.jsx("div",{className:"w-8 h-8 rounded-full border border-white/30 flex items-center justify-center bg-white/10",children:e.jsx(gr,{className:"w-4 h-4 text-white"})})]}),e.jsx("div",{className:"text-[24px] sm:text-[32px] font-bold relative z-10 leading-none mb-3 sm:mb-6",children:N}),e.jsxs("div",{className:"flex items-center justify-between relative z-10 border-t border-white/20 pt-3",children:[e.jsx("span",{className:"text-[12px] font-medium text-white/90",children:"Requires attention"}),e.jsxs("span",{className:"text-[11px] font-bold bg-white/20 px-2 py-0.5 rounded-[4px] backdrop-blur-sm",children:[b>0?Math.round(N/b*100):0,"%"]})]})]})]}),e.jsxs("div",{className:"lg:col-span-4 relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] flex flex-col text-white",children:[e.jsx("div",{className:"absolute -right-12 -top-12 w-40 h-40 bg-white/10 rounded-full"}),e.jsxs("div",{className:"flex justify-between items-center mb-4 relative z-10 border-b border-white/20 pb-3",children:[e.jsxs("h3",{className:"text-[14px] font-semibold text-white flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-white animate-pulse shadow-[0_0_8px_rgba(255,255,255,0.8)]"}),"AI Action Items"]}),e.jsxs("span",{className:"text-[10px] font-bold text-[#9333ea] bg-white px-2 py-0.5 rounded-[4px]",children:[S.length," Pending"]})]}),e.jsx("div",{className:"space-y-[8px] flex-1 overflow-y-auto no-scrollbar relative z-10",children:S.map((g,I)=>e.jsxs("div",{className:"bg-white/10 hover:bg-white/20 rounded-[8px] p-3 text-[12px] border border-white/10 transition-colors backdrop-blur-sm group cursor-pointer flex gap-3 items-start",children:[e.jsx("div",{className:"mt-0.5 shrink-0 text-white/80 group-hover:text-white transition-colors",children:e.jsx(g.icon,{className:"w-4 h-4"})}),e.jsx("div",{className:"leading-snug text-white/90",children:g.text})]},I))})]})]}),e.jsxs("div",{className:"bg-white/60 backdrop-blur-[12px] rounded-[24px] p-3 sm:p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white mt-3 sm:mt-[24px]",children:[e.jsxs("div",{className:"mb-6 border-b border-[#f1f5f9] pb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[18px] font-semibold text-[#1e293b]",children:h?"Select a Class":"My Classes"}),l&&!h&&e.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 px-3 py-1.5 text-[12px] font-semibold text-[#9956DE] bg-[#9956DE]/10 rounded-lg hover:bg-[#9956DE]/20 transition-colors",children:[e.jsx(ca,{size:14}),"Create Class"]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-[16px]",children:[v.map((g,I)=>{const L=pr[I%pr.length];let R=null;return g.riskLevel==="high"?R=e.jsx("span",{className:"inline-flex px-2 py-1 bg-rose-50 text-rose-600 text-[10px] font-bold rounded-md border border-rose-100/50 uppercase",children:"High Risk"}):g.riskLevel==="medium"?R=e.jsx("span",{className:"inline-flex px-2 py-1 bg-amber-50 text-amber-600 text-[10px] font-bold rounded-md border border-amber-100/50 uppercase",children:"Medium Risk"}):R=e.jsx("span",{className:"inline-flex px-2 py-1 bg-emerald-50 text-emerald-600 text-[10px] font-bold rounded-md border border-emerald-100/50 uppercase",children:"On Track"}),e.jsxs("div",{onClick:()=>s(g),className:`flex flex-col p-[16px] bg-white shadow-[0_1px_4px_rgba(0,0,0,0.04)] hover:shadow-md hover:-translate-y-0.5 rounded-[18px] transition-all cursor-pointer group border border-[#f1f5f9] border-l-[6px] ${L.borderLeft}`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-[12px] ${L.bg} flex items-center justify-center border ${L.border}`,children:e.jsx(Gt,{className:`w-5 h-5 ${L.text}`})}),e.jsxs("div",{children:[e.jsx("h4",{className:`font-bold text-[14px] text-[#1e293b] mb-0.5 transition-colors ${L.groupHover}`,children:g.name}),e.jsx("p",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider",children:g.gradeLevel||"Senior High"})]})]}),R]}),e.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#475569] bg-[#f8fafc] rounded-[12px] p-3 border border-[#f1f5f9]",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Students"}),e.jsx("span",{className:"font-semibold text-[#1e293b]",children:g.studentCount})]}),e.jsx("div",{className:"w-[1px] h-8 bg-[#e2e8f0]"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:h?"Avg Competency":"Average"}),e.jsxs("span",{className:"font-semibold text-[#1e293b]",children:[g.avgScore,"%"]})]}),!h&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-[1px] h-8 bg-[#e2e8f0]"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Schedule"}),e.jsx("span",{className:"font-semibold text-[#1e293b]",children:g.schedule||"Mon-Fri"})]})]})]})]},g.id)}),v.length===0&&e.jsx("div",{className:"col-span-full py-8 text-center text-[#64748b] text-[13px] bg-[#f8fafc] rounded-[18px] border border-[#e2e8f0]",children:"No classes match your search."})]})]})]})})},gl="PH_SHS_OFFICIAL_CLASS_RECORD",Um=.85,nn=.85,Gm="2026.04.24",bl=4,tr=["INPUT DATA","SENIOR HIGH SCHOOL CLASS RECORD","LEARNERS NAMES","WRITTEN WORK","PERFORMANCE TASKS","QUARTERLY ASSESSMENT","REMARK","FINAL SEMESTRAL GRADES"],Qm=[...tr,"Pursuant to DepEd Order 8 series of 2015","INITIAL GRADE","QUARTERLY GRADE","ADDITIONAL REMARKS","MALE","FEMALE","SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY","WEIGHT OF COMPONENTS","LOOK UP","HELPER","ATTACHMENTS"],Vm=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],$a=["WITH ATTACHMENTS","OFFICIALLY DROPPED","WITHDRAWN","UNOFFICIALLY DROPPED","TRANSFEREE","SHIFTER"],Wm=["TOTAL","SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY","WEIGHT OF COMPONENTS"],qm={SECOND:["SECOND QUARTER","2ND QUARTER","Q2"]},ta={inputData:["input data"],firstQuarter:["first quarter","1st quarter","q1"],secondQuarter:["second quarter","2nd quarter","q2"],finalSemestral:["final semestral","final grades","semestral"],helper:["helper","weight","attachments"],lookup:["look up","lookup","reference"]},Wt={region:["REGION"],division:["DIVISION"],schoolName:["SCHOOL NAME"],schoolId:["SCHOOL ID"],schoolYear:["SCHOOL YEAR"],gradeSection:["GRADE / SECTION","GRADE/SECTION"],semester:["SEMESTER"],track:["TRACK"],subjectCode:["SUBJECT CODE"],subjectName:["SUBJECT NAME","SUBJECT"],teacherName:["TEACHER","NAME OF TEACHER"]},He={learnerNo:["NO","NO.","#"],learnerName:["LEARNERS NAMES","LEARNER NAME","NAME"],writtenWork:["WRITTEN WORK","WW"],performanceTasks:["PERFORMANCE TASKS","PT"],quarterlyAssessment:["QUARTERLY ASSESSMENT","QA"],total:["TOTAL"],ps:["PS"],ws:["WS"],initialGrade:["INITIAL GRADE"],quarterlyGrade:["QUARTERLY GRADE"],firstQuarter:["FIRST QUARTER","1ST QUARTER"],secondQuarter:["SECOND QUARTER","2ND QUARTER"],firstSemester:["FIRST SEMESTER"],finalGrades:["FINAL GRADES","FINAL GRADE"],remark:["REMARK","REMARKS"],additionalRemarks:["ADDITIONAL REMARKS","ADDITIONAL REMARK"]};function Ym(t){return t==null?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?t:String(t)}function It(t){return String(t??"").replace(/[\u00a0\t\r\n]+/g," ").replace(/[|]+/g," ").replace(/\s+/g," ").trim().toUpperCase()}function Wo(t){return It(t).replace(/[^A-Z0-9]+/g,"")}function _e(t,s){const a=It(t),r=It(s);if(!a||!r)return!1;if(a.includes(r))return!0;const o=Wo(t),n=Wo(s);return!o||!n?!1:o.includes(n)}function sr(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const s=t.replace(/,/g,"").trim();if(!s)return;const a=Number(s);if(Number.isFinite(a))return a}}function Pr(t){return It(t).toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,80)}function vl(t){const s={};return t.forEach(a=>{const r=Kt.encode_cell(a.s);for(let o=a.s.r;o<=a.e.r;o+=1)for(let n=a.s.c;n<=a.e.c;n+=1){const i=Kt.encode_cell({r:o,c:n});s[i]=r}}),s}function Km(t,s,a){const o=(a||vl(t.merges))[s]||s;return t.cells[o]||t.cells[s]}const wl="A1:A1",qo=1200,Yo=200,Ko=2e5;function Xm(t){const s=Math.max(0,t.s.r),a=Math.max(0,t.s.c);let r=Math.max(s,t.e.r),o=Math.max(a,t.e.c);r-s+1>qo&&(r=s+qo-1),o-a+1>Yo&&(o=a+Yo-1);const n=r-s+1,i=o-a+1;if(n*i>Ko){const c=Math.max(1,Math.floor(Ko/i));r=s+Math.min(n,c)-1}return{s:{r:s,c:a},e:{r,c:o}}}function Jm(t){try{return Kt.decode_range(t)}catch{return Kt.decode_range(wl)}}function Zm(t){let s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return Object.keys(t.cells).forEach(n=>{try{const i=Kt.decode_cell(n);s=Math.min(s,i.r),a=Math.min(a,i.c),r=Math.max(r,i.r),o=Math.max(o,i.c)}catch{}}),t.merges.forEach(n=>{s=Math.min(s,n.s.r,n.e.r),a=Math.min(a,n.s.c,n.e.c),r=Math.max(r,n.s.r,n.e.r),o=Math.max(o,n.s.c,n.e.c)}),!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(r)||!Number.isFinite(o)?null:{s:{r:Math.max(0,Math.trunc(s)),c:Math.max(0,Math.trunc(a))},e:{r:Math.max(0,Math.trunc(r)),c:Math.max(0,Math.trunc(o))}}}function ex(t){const s=Jm(t.ref||wl),a=Zm(t);return Xm(a||s)}function tx(t,s){const a=ex(s),r=`${Kt.encode_cell(a.s)}:${Kt.encode_cell(a.e)}`,o=vl(s.merges),n=a.e.r-a.s.r+1,i=a.e.c-a.s.c+1,l=[];for(let c=0;ct.endRow||at.endCol?null:t.cells[s-t.startRow]?.[a-t.startCol]??null}function Os(t,s){return st.endRow?"":(t.cells[s-t.startRow]||[]).map(r=>r?.normalizedText||"").filter(Boolean).join(" ").trim()}function wa(t){return Kt.encode_col(t)}function qa(t){const s=String(t||"").trim().toUpperCase();if(!s||!/^[A-Z]+$/.test(s))return-1;try{return Kt.decode_col(s)}catch{return-1}}function sx(t){return`${Kt.encode_cell(t.s)}:${Kt.encode_cell(t.e)}`}function ax(t,s){const a=[];for(let r=s.s.r;r<=s.e.r;r+=1){const o=[];for(let n=s.s.c;n<=s.e.c;n+=1){const i=Ve(t,r,n);o.push(i?.displayValue??null)}a.push(o)}return a}function rx(t,s){const a=It(t),r=It(s);return!a||!r?0:a===r?1:a.includes(r)?.9:.75}function jn(t,s){const a=[];for(let r=0;r{_e(l.normalizedText,c)&&a.push({sheetName:t.sheetName,anchor:c,row:l.row,col:l.col,address:l.address,value:String(l.displayValue??""),confidence:rx(l.displayValue,c)})})}const o=t.startRow+r,n=Os(t,o);n&&s.forEach(i=>{if(!_e(n,i))return;const l=t.cells[r].find(c=>c?.normalizedText);l&&a.push({sheetName:t.sheetName,anchor:i,row:o,col:l.col,address:l.address,value:n,confidence:.8})})}return a}function nx(t,s){return Object.values(t).flatMap(a=>jn(a,s))}function Tt(t,s){return jn(t,[s]).sort((a,r)=>a.row-r.row||a.col-r.col)}function Nl(t,s,a,r=6){for(let o=1;o<=r;o+=1){const i=Ve(t,s,a+o)?.displayValue;if(i!=null&&String(i).trim())return String(i).trim()}for(let o=1;o<=r;o+=1){const i=Ve(t,s+o,a)?.displayValue;if(i!=null&&String(i).trim())return String(i).trim()}}function jl(t,s,a=5){let r=s,o=-1;for(let n=Math.max(t.startRow,s-a);n<=Math.min(t.endRow,s+a);n+=1){const i=Os(t,n),l=["LEARNERS NAMES","WRITTEN WORK","PERFORMANCE TASKS","QUARTERLY ASSESSMENT","REMARK"].reduce((c,d)=>i.includes(d)?c+1:c,0);l>o&&(o=l,r=n)}return r}function ox(t,s){const a=It(t).toLowerCase(),r=o=>[...s].some(n=>_e(n,o));return ta.inputData.some(o=>a.includes(o))||r("INPUT DATA")?"inputData":ta.finalSemestral.some(o=>a.includes(o))||r("FINAL SEMESTRAL GRADES")||r("FINAL GRADES")?"finalSemestral":ta.firstQuarter.some(o=>a.includes(o))||r("FIRST QUARTER")?"firstQuarter":ta.secondQuarter.some(o=>a.includes(o))||r("SECOND QUARTER")?"secondQuarter":r("SENIOR HIGH SCHOOL CLASS RECORD")||r("WRITTEN WORK")&&r("PERFORMANCE TASKS")?"firstQuarter":ta.helper.some(o=>a.includes(o))||r("WEIGHT OF COMPONENTS")||r("ATTACHMENTS")||r("HELPER")?"helper":ta.lookup.some(o=>a.includes(o))||r("LOOK UP")?"lookup":"other"}function ix(t){const s=t.criticalTotal>0?t.criticalFound/t.criticalTotal:0,a=t.totalSheets>0?t.recognizedSheets/t.totalSheets:0,r=t.hasDepedAnchor?1:0,o=.65*s+.2*a+.15*r;return Number(Math.max(0,Math.min(1,o)).toFixed(4))}function lx(t){const s=nx(t.matrices,Qm),a=new Set,r=[];tr.forEach(b=>{s.some(C=>_e(C.anchor,b))&&(a.add(b),r.push(`Found critical anchor: ${b}`))});const o=tr.filter(b=>!a.has(b)),n=new Map;s.forEach(b=>{n.has(b.sheetName)||n.set(b.sheetName,new Set),n.get(b.sheetName)?.add(b.anchor)});const i=t.sheetNames.map(b=>{const N=n.get(b)||new Set,C=ox(b,N),S=Math.min(1,.35+Math.min(.55,N.size*.08)),v=[`sheet:${b}`,`signals:${N.size}`,...[...N].slice(0,5)];return{sheetName:b,role:C,confidence:Number(S.toFixed(3)),evidence:v}}),l={firstQuarter:[],secondQuarter:[],finalSemestral:[],helper:[],lookup:[],other:[]};i.forEach(b=>{switch(b.role){case"inputData":l.inputData?l.other.push(b.sheetName):l.inputData=b.sheetName;break;case"firstQuarter":l.firstQuarter.push(b.sheetName);break;case"secondQuarter":l.secondQuarter.push(b.sheetName);break;case"finalSemestral":l.finalSemestral.push(b.sheetName);break;case"helper":l.helper.push(b.sheetName);break;case"lookup":l.lookup.push(b.sheetName);break;case"other":default:l.other.push(b.sheetName);break}});const c=(l.inputData?1:0)+l.firstQuarter.length+l.secondQuarter.length+l.finalSemestral.length+l.helper.length+l.lookup.length,d=ix({criticalFound:a.size,criticalTotal:tr.length,recognizedSheets:c,totalSheets:t.sheetNames.length,hasDepedAnchor:s.some(b=>_e(b.anchor,"Pursuant to DepEd Order 8 series of 2015"))}),m=l.firstQuarter.length>0||l.secondQuarter.length>0,p=!!l.inputData&&m&&l.finalSemestral.length>0,h=d>=.55&&p;return l.inputData||r.push("Input Data sheet not confidently detected."),m||r.push("No quarter class record sheet detected."),l.finalSemestral.length===0&&r.push("No Final Semestral Grades sheet detected."),{format:gl,isOfficialFormatLikely:h,confidence:d,evidence:r,missingCriticalAnchors:o,detectedSheets:l,anchorMatches:s}}function hr(t){if(typeof t=="number"&&Number.isFinite(t))return t;const s=String(t??"").trim();if(!s)return;const a=Number(s.replace(/[^0-9]/g,""));if(!(!Number.isFinite(a)||a<=0))return a}function yn(t){const s=It(t);if(s.includes("FEMALE"))return"FEMALE";if(s.includes("MALE"))return"MALE"}function Sn(t){const s=It(t.rowText);return s?s==="MALE"||s==="FEMALE"?"sex-header":Vm.some(a=>s.includes(a))?"signature":Wm.some(a=>s.includes(a))?"helper":s.includes("LEARNERS NAMES")||s.includes("WRITTEN WORK")||s.includes("PERFORMANCE TASKS")||s.includes("QUARTERLY ASSESSMENT")||s.includes("INITIAL GRADE")||s.includes("QUARTERLY GRADE")?"header":t.hasLearnerName||t.hasLearnerNumber?"learner":s.includes("ATTACHMENTS")||s.includes("LOOK UP")?"helper":"unknown":"blank"}function cx(t){const s=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],a=[];return s.forEach(r=>{Tt(t,r).forEach(o=>{a.push({role:r,name:String(Ve(t,o.row,o.col+1)?.displayValue||"").trim()||void 0,sourceSheet:t.sheetName,sourceRow:o.row+1})})}),a}function dx(t){const s=[],a=Tt(t,"LEARNERS NAMES")[0],r=a?jl(t,a.row,5):t.startRow,o=(S,v)=>Tt(t,S).find(I=>Math.abs(I.row-r)<=2)?.col??v,n=o(He.learnerNo[0],t.startCol),i=o(He.learnerName[0],t.startCol+1),l=o(He.firstQuarter[0],i+1),c=o(He.secondQuarter[0],l+1),d=o(He.firstSemester[0],c+1),m=o(He.finalGrades[0],d+1),p=o(He.remark[0],m+1),h=o(He.additionalRemarks[0],p+1),b=[];let N="UNKNOWN",C=0;for(let S=r+1;S<=t.endRow;S+=1){const v=Os(t,S),g=Sn({rowText:v,hasLearnerNumber:/\b\d{1,2}\b/.test(v),hasLearnerName:/[A-Z]{2,}/.test(v)});if(g==="sex-header"){N=yn(v)||N;continue}if(g==="signature"||g==="helper")break;if(g==="blank"){if(C+=1,C>=bl)break;continue}if(g!=="learner")continue;C=0;const I=hr(Ve(t,S,n)?.displayValue),L=String(Ve(t,S,i)?.displayValue||"").trim();if(!L&&I===void 0)continue;const R=Ve(t,S,l)?.displayValue??null,W=Ve(t,S,c)?.displayValue??null,f=Ve(t,S,d)?.displayValue??null,k=Ve(t,S,m)?.displayValue??null,w=Ve(t,S,p)?.displayValue??null;let $=Ve(t,S,h)?.displayValue??null;const A=$a.filter(y=>_e(v,y));A.length>0&&($=[$,A.join("; ")].filter(Boolean).join("; ")||null),!L&&I!==void 0&&s.push(`Row ${S+1} has learner number ${I} but empty learner name.`),b.push({learnerNo:I,fullName:L||`Unnamed Learner ${I||S+1}`,sex:N,firstQuarter:R,secondQuarter:W,firstSemester:f,finalGrades:k,remark:w,additionalRemarks:$,sourceRow:S+1})}return{sheetName:t.sheetName,learnerGrades:b,signatures:cx(t),warnings:s}}function Zt(t,s){for(const a of s){const r=Tt(t,a);for(const o of r){const n=Nl(t,o.row,o.col,8);if(n&&n.trim())return n.trim()}}}function ux(t){const s=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],a=[];return s.forEach(r=>{Tt(t,r).forEach(n=>{const i=Nl(t,n.row,n.col,10);a.push({role:r,name:i,sourceSheet:t.sheetName,sourceRow:n.row+1})})}),a}function mx(t){const s=Tt(t,"LEARNERS NAMES")[0];if(!s)return[];const a=s.row+1,r=s.col,o=Math.max(t.startCol,r-1),n=Math.min(t.endCol,r+1),i=Math.min(t.endCol,r+2),l=[];let c="UNKNOWN",d=0;for(let m=a;m<=t.endRow;m+=1){const p=Os(t,m),h=Sn({rowText:p,hasLearnerNumber:!!hr(Ve(t,m,o)?.displayValue),hasLearnerName:!!String(Ve(t,m,r)?.displayValue||"").trim()});if(h==="sex-header"){c=yn(p)||c,d=0;continue}if(h==="signature"||h==="helper")break;if(h!=="learner"){if(h==="blank"&&(d+=1),d>=5)break;continue}d=0;const b=hr(Ve(t,m,o)?.displayValue),N=String(Ve(t,m,r)?.displayValue||"").trim(),C=String(Ve(t,m,n)?.displayValue||"").trim()||void 0,S=String(Ve(t,m,i)?.displayValue||"").trim()||void 0,v=$a.filter(g=>_e(p,g));!N&&b===void 0||l.push({learnerNo:b,sex:c,fullName:N||`Unnamed Learner ${b||m}`,sourceSheet:t.sheetName,sourceRow:m+1,remarks:C,additionalRemarks:S,statuses:v.length>0?v:void 0})}return l}function xx(t){const s=[],a=[];for(let r=t.startRow;r<=t.endRow;r+=1){const o=Os(t,r);if(o){if($a.some(n=>_e(o,n))){s.push(o);continue}(_e(o,"IMPORTANT")||_e(o,"NOTE")||_e(o,"ATTACHMENT")||_e(o,"LOOK UP"))&&a.push(o)}}return{attachmentRules:Array.from(new Set(s)),helperNotes:Array.from(new Set(a))}}function px(t){const s=[],a={region:Zt(t,Wt.region),division:Zt(t,Wt.division),schoolName:Zt(t,Wt.schoolName),schoolId:Zt(t,Wt.schoolId),schoolYear:Zt(t,Wt.schoolYear),gradeSection:Zt(t,Wt.gradeSection),semester:Zt(t,Wt.semester),track:Zt(t,Wt.track),subjectCode:Zt(t,Wt.subjectCode),subjectName:Zt(t,Wt.subjectName),teacherName:Zt(t,Wt.teacherName)},r=mx(t),o=ux(t),{attachmentRules:n,helperNotes:i}=xx(t);return a.schoolName||s.push("Input Data metadata is missing School Name."),a.schoolYear||s.push("Input Data metadata is missing School Year."),r.length===0&&s.push("No learners detected in Input Data sheet."),jn(t,Object.values(Wt).flat()).length<4&&s.push("Input Data sheet contains limited metadata anchors; layout may have drifted."),{sheetName:t.sheetName,schoolContext:a,learners:r,signatures:o,attachmentRules:n,helperNotes:i,warnings:s}}function hx(t){const s=It(t.sheetName);return qm.SECOND.some(a=>_e(s,a))?"SECOND":"FIRST"}function fx(t,s){const a=[],r=[],o=[];let n,i="NONE";for(let l=t.startCol;l<=t.endCol;l+=1){const c=Ve(t,s,l),d=It(c?.displayValue||""),m=Ve(t,s+1,l),p=String(m?.displayValue||c?.displayValue||"").trim();if(!d&&!p)continue;if(_e(d,He.writtenWork[0])){i="WW";continue}if(_e(d,He.performanceTasks[0])){i="PT";continue}if(_e(d,He.quarterlyAssessment[0])){n={key:Pr(p||"quarterly_assessment"),label:p||"Quarterly Assessment",column:wa(l)},i="DERIVED";continue}if(_e(d,He.initialGrade[0])||_e(d,He.quarterlyGrade[0])||_e(d,He.remark[0])||_e(d,He.additionalRemarks[0])||_e(d,He.firstQuarter[0])||_e(d,He.secondQuarter[0])||_e(d,He.firstSemester[0])||_e(d,He.finalGrades[0])||_e(d,He.ps[0])||_e(d,He.ws[0])||_e(d,He.total[0])){i="DERIVED",o.push({key:Pr(p||d),label:p||d,column:wa(l)});continue}const h={key:Pr(p||d||wa(l)),label:p||d||wa(l),maxScore:sr(m?.displayValue),column:wa(l)};i==="WW"?a.push(h):i==="PT"?r.push(h):i==="DERIVED"&&o.push(h)}return{writtenWorks:a,performanceTasks:r,quarterlyAssessment:n,derived:o}}function gx(t){const s=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],a=[];return s.forEach(r=>{Tt(t,r).forEach(o=>{const n=Ve(t,o.row,o.col+1),i=String(n?.displayValue||"").trim()||void 0;a.push({role:r,name:i,sourceSheet:t.sheetName,sourceRow:o.row+1})})}),a}function Xo(t,s,a){for(let r=t.startCol;r<=t.endCol;r+=1){const o=It(Ve(t,s,r)?.displayValue||""),n=It(Ve(t,s+1,r)?.displayValue||"");if(a.some(i=>_e(o,i)||_e(n,i)))return r}}function bx(t,s,a,r){const o={learnerNo:hr(Ve(t,s,r.numberCol)?.displayValue),fullName:String(Ve(t,s,r.nameCol)?.displayValue||"").trim(),sourceRow:s+1},n={};a.writtenWorks.forEach(d=>{const m=d.column?qa(d.column):-1;if(m<0)return;const p=Ve(t,s,m)?.displayValue;n[d.key]=p??null}),Object.keys(n).length>0&&(o.writtenWorks=n);const i={};if(a.performanceTasks.forEach(d=>{const m=d.column?qa(d.column):-1;if(m<0)return;const p=Ve(t,s,m)?.displayValue;i[d.key]=p??null}),Object.keys(i).length>0&&(o.performanceTasks=i),a.quarterlyAssessment?.column){const d=qa(a.quarterlyAssessment.column);o.quarterlyAssessment=Ve(t,s,d)?.displayValue??null}const l=a.derived||[],c={};return l.forEach(d=>{if(!d.column)return;const m=qa(d.column);if(m<0)return;const p=Ve(t,s,m)?.displayValue??null;c[d.key]=p,_e(d.label,He.initialGrade[0])&&(o.initialGrade=p),_e(d.label,He.quarterlyGrade[0])&&(o.quarterlyGrade=p),_e(d.label,He.firstQuarter[0])&&(o.firstQuarter=p),_e(d.label,He.secondQuarter[0])&&(o.secondQuarter=p),_e(d.label,He.firstSemester[0])&&(o.firstSemester=p),_e(d.label,He.finalGrades[0])&&(o.finalGrades=p),_e(d.label,He.remark[0])&&(o.remark=p!==null?String(p):null),_e(d.label,He.additionalRemarks[0])&&(o.additionalRemarks=p!==null?String(p):null)}),Object.keys(c).length>0&&(o.totals=c),o}function vx(t){const s=hx(t),a=[],r=Tt(t,He.learnerName[0])[0]||Tt(t,He.learnerName[1])[0],o=r?jl(t,r.row,4):t.startRow,n=fx(t,o),i=Xo(t,o,He.learnerNo)??t.startCol,l=Xo(t,o,He.learnerName)??Math.min(t.endCol,i+1),c=[];let d="UNKNOWN",m=0;for(let N=o+1;N<=t.endRow;N+=1){const C=Os(t,N),S=Sn({rowText:C,hasLearnerNumber:/\b\d{1,2}\b/.test(C),hasLearnerName:/[A-Z]{2,}/.test(C)});if(S==="sex-header"){d=yn(C)||d;continue}if(S==="signature"||S==="helper")break;if(S==="blank"){if(m+=1,m>=bl)break;continue}if(S!=="learner")continue;m=0;const v=bx(t,N,n,{numberCol:i,nameCol:l});if(v.sex=d,!v.fullName&&v.learnerNo===void 0)continue;const g=$a.filter(I=>_e(C,I));g.length>0&&!v.additionalRemarks&&(v.additionalRemarks=g.join("; ")),!v.fullName&&v.learnerNo!==void 0&&(a.push(`Row ${N+1} has learner number ${v.learnerNo} but empty name.`),v.fullName=`Unnamed Learner ${v.learnerNo}`),c.push(v)}n.writtenWorks.length===0&&n.performanceTasks.length===0&&a.push(`No detailed assessment columns detected in ${t.sheetName}.`);const p=sr(Tt(t,"WRITTEN WORK %")[0]?.value||Tt(t,"WRITTEN WORK")[0]?.value),h=sr(Tt(t,"PERFORMANCE TASKS %")[0]?.value||Tt(t,"PERFORMANCE TASKS")[0]?.value),b=sr(Tt(t,"QUARTERLY ASSESSMENT %")[0]?.value||Tt(t,"QUARTERLY ASSESSMENT")[0]?.value);return{sheetName:t.sheetName,quarter:s,gradingWeights:{writtenWork:p,performanceTasks:h,quarterlyAssessment:b},assessmentColumns:n,learnerGrades:c,signatures:gx(t),warnings:a}}function wx(t){const s=["SUBMITTED BY","CHECKED BY","VERIFIED BY","RECOMMENDED BY","APPROVED BY"],a=[];return s.forEach(r=>{Tt(t,r).forEach(o=>{a.push({role:r,name:String(Ve(t,o.row,o.col+1)?.displayValue||"").trim()||void 0,sourceSheet:t.sheetName,sourceRow:o.row+1})})}),a}function Nx(t){const s=[];let a=!1;for(let r=t.startRow;r<=t.endRow;r+=1){const o=Os(t,r);if(!o){if(a&&s.length>0)break;continue}if(_e(o,"WEIGHT OF COMPONENTS")){a=!0;continue}if(!a)continue;const n={sourceRow:r+1,raw:o};for(let i=t.startCol;i<=t.endCol;i+=1){const l=Ve(t,r,i)?.displayValue;l==null||String(l).trim()===""||(n[`c${i}`]=l)}Object.keys(n).length>2&&s.push(n)}return s}function jx(t){const s=[],a=[],r=[],o=[],n=[];return t.forEach(i=>{wx(i).forEach(l=>a.push(l)),Nx(i).forEach(l=>r.push({...l,sourceSheet:i.sheetName}));for(let l=i.startRow;l<=i.endRow;l+=1){const c=Os(i,l);if(c){if($a.some(d=>_e(c,d))){o.push(`${i.sheetName}: ${c}`);continue}(_e(c,"HELPER")||_e(c,"LOOK UP")||_e(c,"IMPORTANT")||_e(c,"REFERENCE")||_e(c,"ATTACHMENT"))&&n.push(`${i.sheetName}: ${c}`)}}}),r.length===0&&s.push("No component weight rows were parsed from reference sheets."),{sheetName:t.map(i=>i.sheetName).join(", "),componentWeights:r,attachmentRules:Array.from(new Set(o)),helperNotes:Array.from(new Set(n)),signatures:a,warnings:s}}function yx(t,s,a){const r=new Map,o=n=>{const i=`${It(n.fullName)}|${n.learnerNo||""}|${n.sourceSheet}`,l=r.get(i);if(!l){r.set(i,n);return}const c=Array.from(new Set([...l.statuses||[],...n.statuses||[]]));r.set(i,{...l,...n,remarks:n.remarks||l.remarks,additionalRemarks:n.additionalRemarks||l.additionalRemarks,statuses:c.length>0?c:void 0})};return t.forEach(o),s.forEach(n=>{n.learnerGrades.forEach(i=>{o({learnerNo:i.learnerNo,sex:i.sex,fullName:i.fullName,sourceSheet:n.sheetName,sourceRow:i.sourceRow,remarks:i.remark||void 0,additionalRemarks:i.additionalRemarks||void 0})})}),a.forEach(n=>{n.learnerGrades.forEach(i=>{o({learnerNo:i.learnerNo,sex:i.sex,fullName:i.fullName,sourceSheet:n.sheetName,sourceRow:i.sourceRow,remarks:i.remark||void 0,additionalRemarks:i.additionalRemarks||void 0})})}),Array.from(r.values())}function Sx(t,s,a,r){const o=[...t.signatures,...s.flatMap(i=>i.signatures),...a.flatMap(i=>i.signatures),...r.signatures],n=new Map;return o.forEach(i=>{const l=`${It(i.role)}|${It(i.name||"")}|${i.sourceSheet}`;n.set(l,i)}),Array.from(n.values())}function kx(t){const s=yx(t.inputData.learners,t.quarterSheets,t.finalSheets);return{format:gl,version:Gm,workbookMeta:{fileName:t.workbook.fileName,sheetNames:t.workbook.sheetNames,detectedSheets:{inputData:t.detection.detectedSheets.inputData,firstQuarter:t.detection.detectedSheets.firstQuarter,secondQuarter:t.detection.detectedSheets.secondQuarter,finalSemestral:t.detection.detectedSheets.finalSemestral,helper:t.detection.detectedSheets.helper,lookup:t.detection.detectedSheets.lookup,other:t.detection.detectedSheets.other}},schoolContext:{...t.inputData.schoolContext},learners:s,quarterlyRecords:t.quarterSheets.map(a=>({sheetName:a.sheetName,quarter:a.quarter,gradingWeights:a.gradingWeights,assessmentColumns:a.assessmentColumns,learnerGrades:a.learnerGrades})),finalSemestralRecords:t.finalSheets.map(a=>({sheetName:a.sheetName,learnerGrades:a.learnerGrades})),references:{componentWeights:t.references.componentWeights,attachmentRules:Array.from(new Set([...t.inputData.attachmentRules||[],...t.references.attachmentRules||[]])),helperNotes:Array.from(new Set([...t.inputData.helperNotes||[],...t.references.helperNotes||[]])),signatures:Sx(t.inputData,t.quarterSheets,t.finalSheets,t.references),unclassifiedBlocks:t.unclassifiedBlocks},validation:t.validation,raw:t.workbook.raw}}function Cx(t){return!t||t.length===0?[]:t.map(s=>({s:{r:s.s.r,c:s.s.c},e:{r:s.e.r,c:s.e.c}}))}function Ix(t){const s={ref:t["!ref"],merges:Cx(t["!merges"]),cells:{}};return Object.keys(t).filter(a=>!a.startsWith("!")).forEach(a=>{const r=t[a];!r||!(r.v!==void 0||typeof r.w=="string"&&r.w.trim().length>0||typeof r.f=="string"&&r.f.trim().length>0)||(s.cells[a]={v:r.v,w:r.w,t:r.t,f:r.f})}),s}function Tx(t,s){const a=Rc(s,{type:"array",cellFormula:!0,cellNF:!0,cellText:!0,cellDates:!0,raw:!1}),r={},o={};return a.SheetNames.forEach(n=>{const i=a.Sheets[n];if(!i)return;const l=Ix(i);o[n]=l,r[n]=tx(n,l)}),{fileName:t,sheetNames:a.SheetNames,raw:{sheets:o},matrices:r}}async function _x(t){const s=await t.arrayBuffer();return Tx(t.name,s)}class Ex{state={};markRange(s,a,r){const o=s;this.state[o]||(this.state[o]={mappedAddresses:new Set,mappings:[]});for(let n=a.s.r;n<=a.e.r;n+=1)for(let i=a.s.c;i<=a.e.c;i+=1)this.state[o].mappedAddresses.add(`${n}:${i}`);this.state[o].mappings.push({sheetName:s,range:a,reason:r})}getMappings(){return Object.values(this.state).flatMap(s=>s.mappings)}getMappedRegionCount(){return this.getMappings().length}getUnmappedBlocks(s,a="unclassified"){const r=[];return Object.values(s).forEach(o=>{const n=new Set,i=this.state[o.sheetName]?.mappedAddresses??new Set;for(let l=o.startRow;l<=o.endRow;l+=1)for(let c=o.startCol;c<=o.endCol;c+=1){const d=`${l}:${c}`;if(n.has(d)||i.has(d))continue;const m=Ve(o,l,c);if(!(m&&m.displayValue!==null&&m.displayValue!==void 0&&String(m.displayValue).trim())){n.add(d);continue}const h=this.collectComponent(o,l,c,i,n);h&&r.push({sheetName:o.sheetName,range:sx(h),purposeGuess:a,raw2D:ax(o,h)})}}),r}collectComponent(s,a,r,o,n){const i=[{row:a,col:r}];let l=a,c=a,d=r,m=r,p=!1;for(;i.length>0;){const h=i.shift();if(!h)break;const b=`${h.row}:${h.col}`;if(n.has(b)||o.has(b))continue;n.add(b);const N=Ve(s,h.row,h.col);N&&N.displayValue!==null&&N.displayValue!==void 0&&String(N.displayValue).trim()&&(p=!0,l=Math.min(l,h.row),c=Math.max(c,h.row),d=Math.min(d,h.col),m=Math.max(m,h.col),[{row:h.row-1,col:h.col},{row:h.row+1,col:h.col},{row:h.row,col:h.col-1},{row:h.row,col:h.col+1}].forEach(S=>{S.rows.endRow||S.cols.endCol||i.push(S)}))}return p?{s:{r:l,c:d},e:{r:c,c:m}}:null}}function Rx(t){const s=t.detection.detectedSheets,a=[s.inputData?1:0,s.firstQuarter.length,s.secondQuarter.length,s.finalSemestral.length,s.helper.length,s.lookup.length].reduce((r,o)=>r+o,0);return{totalSheets:t.totalSheets,recognizedSheets:a,unclassifiedSheets:s.other.length,mappedCellRegions:t.mappedCellRegions,unmappedCellRegions:t.unmappedCellRegions}}function Mx(t){const s=new Map;t.forEach(r=>{const o=`${r.learnerNo||""}|${r.fullName.trim().toUpperCase()}`;s.has(o)||s.set(o,[]),s.get(o)?.push(r.sourceRow)});const a=[];return s.forEach((r,o)=>{r.length>1&&a.push(`Duplicate learner entry detected for ${o} at rows ${r.join(", ")}.`)}),a}function Ax(t){const s=[];return t.forEach(a=>{a.learnerGrades.forEach(r=>{r.fullName.trim()||s.push(`${a.sheetName} row ${r.sourceRow}: learner name is blank.`);const o=r.writtenWorks&&Object.values(r.writtenWorks).some(i=>i!==null&&i!==""),n=r.performanceTasks&&Object.values(r.performanceTasks).some(i=>i!==null&&i!=="");!o&&!n&&r.quarterlyAssessment==null&&s.push(`${a.sheetName} row ${r.sourceRow}: all grade blocks are empty.`)})}),s}function zx(t){const s=[];return t.forEach(a=>{a.learnerGrades.forEach(r=>{r.fullName.trim()||s.push(`${a.sheetName} row ${r.sourceRow}: learner name is blank.`),r.finalGrades==null&&r.firstSemester==null&&r.firstQuarter==null&&r.secondQuarter==null&&s.push(`${a.sheetName} row ${r.sourceRow}: no semestral/final values detected.`)})}),s}function Lx(t){const s=[],a=[];t.detection.detectedSheets.inputData||a.push("Missing Input Data sheet."),t.quarterSheets.length===0&&a.push("No quarter class record sheets were extracted."),t.finalSheets.length===0&&a.push("No Final Semestral sheet was extracted."),t.detection.missingCriticalAnchors.length>0&&s.push(`Missing critical anchors: ${t.detection.missingCriticalAnchors.join(", ")}.`),Mx(t.inputData.learners).forEach(n=>s.push(n)),Ax(t.quarterSheets).forEach(n=>s.push(n)),zx(t.finalSheets).forEach(n=>s.push(n)),s.push(...t.inputData.warnings),t.quarterSheets.forEach(n=>s.push(...n.warnings)),t.finalSheets.forEach(n=>s.push(...n.warnings)),t.unmappedCellRegions>t.mappedCellRegions&&s.push("A significant portion of workbook regions are unclassified; review diagnostics before confirming import.");const r=t.detection.confidence,o=t.detection.isOfficialFormatLikely&&a.length===0;return r({fullName:i.fullName,learnerNo:i.learnerNo,sex:i.sex,remarks:i.remarks,additionalRemarks:i.additionalRemarks,statuses:i.statuses,sourceSheet:i.sourceSheet,sourceRow:i.sourceRow})),r=t.quarterlyRecords.flatMap(i=>i.learnerGrades.map(l=>({fullName:l.fullName,sourceSheet:i.sheetName,sourceRow:l.sourceRow,quarter:i.quarter,firstQuarter:l.firstQuarter,secondQuarter:l.secondQuarter,firstSemester:l.firstSemester,finalGrades:l.finalGrades,quarterlyGrade:l.quarterlyGrade,initialGrade:l.initialGrade,remark:l.remark,additionalRemarks:l.additionalRemarks}))),o=t.finalSemestralRecords.flatMap(i=>i.learnerGrades.map(l=>({fullName:l.fullName,sourceSheet:i.sheetName,sourceRow:l.sourceRow,firstQuarter:l.firstQuarter,secondQuarter:l.secondQuarter,firstSemester:l.firstSemester,finalGrades:l.finalGrades,remark:l.remark,additionalRemarks:l.additionalRemarks}))),n=[...t.learners,...t.quarterlyRecords.flatMap(i=>i.learnerGrades.map(l=>({learnerNo:l.learnerNo,sex:l.sex,fullName:l.fullName,sourceSheet:i.sheetName,sourceRow:l.sourceRow,remarks:l.remark||void 0,additionalRemarks:l.additionalRemarks||void 0})))].map(i=>({fullName:i.fullName,remark:i.remarks||null,additionalRemarks:i.additionalRemarks||null,statuses:"statuses"in i?i.statuses:void 0,sourceSheet:i.sourceSheet,sourceRow:i.sourceRow}));return{classEntity:s,studentEntities:a,gradeEntities:[...r,...o],remarksEntities:n}}const Jo=1500;function Zo(t){return t?Object.values(t.matrices).reduce((s,a)=>s+a.rowCount*a.colCount,0):0}function ei(t){const s=`[shs-import] parse ${t.stage} file=${t.fileName} duration=${t.durationMs}ms sheets=${t.sheetCount} matrixCells=${t.matrixCellCount}`;if(t.stage==="failed"){console.error(`${s}${t.errorMessage?` error=${t.errorMessage}`:""}`);return}if(t.durationMs>=Jo){console.warn(`${s} slow=true threshold=${Jo}ms`);return}}function Gs(t,s){t?.onProgress?.(s)}function $x(t,s){return Array.from(new Set(t.filter(a=>Number.isFinite(a)).map(a=>Math.max(s.startRow,Math.min(s.endRow,Math.trunc(a))))))}function Na(t,s,a,r){$x(a,s).forEach(o=>{t.markRange(s.sheetName,{s:{r:o,c:s.startCol},e:{r:o,c:s.endCol}},r)})}async function Fx(t,s){const a=s?.confidenceThreshold??Um,r=Date.now();let o=null;try{if(Gs(s,{stage:"reading",message:"Reading workbook structure and raw sheets..."}),o=await _x(t),!o)throw new Error("Workbook read returned null");Gs(s,{stage:"detecting-format",message:"Detecting DepEd SHS workbook format..."});const n=lx(o);Gs(s,{stage:"extracting",message:"Extracting metadata, learners, grades, and references..."});const i=n.detectedSheets.inputData||o.sheetNames[0],l=o.matrices[i],c=l?px(l):{sheetName:i,schoolContext:{},learners:[],signatures:[],attachmentRules:[],helperNotes:[],warnings:["Input data sheet was not available in matrix map."]},m=[...n.detectedSheets.firstQuarter||[],...n.detectedSheets.secondQuarter||[]].map(I=>o.matrices[I]).filter(I=>!!I).map(I=>vx(I)),p=(n.detectedSheets.finalSemestral||[]).map(I=>o.matrices[I]).filter(I=>!!I).map(I=>dx(I)),h=[...n.detectedSheets.helper||[],...n.detectedSheets.lookup||[]].map(I=>o.matrices[I]).filter(I=>!!I),b=jx(h),N=new Ex;n.anchorMatches.forEach(I=>{const L=o.matrices[I.sheetName];L&&Na(N,L,[I.row],`Anchor match: ${I.anchor}`)}),[c.sheetName].forEach(I=>{const L=o.matrices[I];if(!L)return;const R=Array.from({length:Math.min(14,L.rowCount)},(k,w)=>L.startRow+w),W=c.learners.map(k=>k.sourceRow-1),f=c.signatures.map(k=>k.sourceRow).filter(k=>typeof k=="number").map(k=>k-1);Na(N,L,[...R,...W,...f],"Input Data parsed rows")}),m.forEach(I=>{const L=o.matrices[I.sheetName];if(!L)return;const R=I.learnerGrades.map(k=>k.sourceRow-1),W=I.signatures.map(k=>k.sourceRow).filter(k=>typeof k=="number").map(k=>k-1),f=R.length>0?Math.max(L.startRow,Math.min(...R)-2):L.startRow;Na(N,L,[f,f+1,...R,...W],"Quarter sheet parsed rows")}),p.forEach(I=>{const L=o.matrices[I.sheetName];if(!L)return;const R=I.learnerGrades.map(k=>k.sourceRow-1),W=I.signatures.map(k=>k.sourceRow).filter(k=>typeof k=="number").map(k=>k-1),f=R.length>0?Math.max(L.startRow,Math.min(...R)-2):L.startRow;Na(N,L,[f,f+1,...R,...W],"Final semestral parsed rows")}),h.forEach(I=>{const L=b.componentWeights.filter(f=>f.sourceSheet===I.sheetName).map(f=>f.sourceRow).filter(f=>typeof f=="number").map(f=>f-1),R=b.signatures?.filter(f=>f.sourceSheet===I.sheetName).map(f=>f.sourceRow).filter(f=>typeof f=="number").map(f=>f-1)||[],W=L.length===0&&R.length===0?[I.startRow,I.startRow+1,I.startRow+2]:[];Na(N,I,[...L,...R,...W],"Reference/helper parsed rows")});const C=N.getUnmappedBlocks(o.matrices);Gs(s,{stage:"validating",message:"Validating completeness and structural integrity..."});const S=Lx({detection:n,inputData:c,quarterSheets:m,finalSheets:p,mappedCellRegions:N.getMappedRegionCount(),unmappedCellRegions:C.length,totalSheets:o.sheetNames.length});Gs(s,{stage:"normalizing",message:"Normalizing parsed workbook and creating entity mapping..."});const v=kx({workbook:o,detection:n,inputData:c,quarterSheets:m,finalSheets:p,references:b,validation:S,unclassifiedBlocks:C});v.validation.confidenceD.trim().toLowerCase().replace(/\s+/g," "),be=D=>{if(typeof D=="number"&&Number.isFinite(D))return D;const j=Number(String(D??"").replace(/[^0-9.-]+/g,""));return Number.isFinite(j)?j:null},Ie=(D,j)=>{const _=Number.isFinite(D)?D:j;return Math.max(0,Math.min(100,_))},de=D=>{const j=String(D??"");return/[",\n]/.test(j)?`"${j.replace(/"/g,'""')}"`:j},fe=(D,j)=>{const _=new Map,T=["quarterlyGrade","finalGrades","firstSemester","firstQuarter","secondQuarter","initialGrade"];D.mapping.gradeEntities.forEach($e=>{const Ge=ne($e.fullName||"");if(!Ge)return;const ft=T.map(dt=>be($e[dt])).filter(dt=>dt!==null);if(ft.length===0)return;const Nt=_.get(Ge)||[];_.set(Ge,Nt.concat(ft))});const Q=D.mapping.studentEntities||[];if(Q.length===0)return null;const ue=(D.imported.schoolContext.semester||D.imported.schoolContext.schoolYear||"First Semester").trim(),ce=(D.imported.schoolContext.subjectName||"Class Record Import").trim(),ae=(t||s||"import").replace(/[^a-zA-Z0-9]+/g,"").toUpperCase().slice(0,12)||"IMPORT",Ne=[["name","lrn","email","engagementScore","avgQuizScore","attendance","assignmentCompletion","term","assessmentName"].join(",")];if(Q.forEach(($e,Ge)=>{const ft=ne($e.fullName||""),Nt=_.get(ft)||[],dt=Nt.length>0?Nt.reduce((vs,os)=>vs+os,0)/Nt.length:75,jt=Ie(dt,75),At=Ie(jt+5,85),rs=Ie(jt*.7+At*.3,80),Is=Ie(At*.6+jt*.4,82),bs=$e.learnerNo||Ge+1,Ps=`IMP-${ae}-${String(bs).padStart(4,"0")}`,ns=$e.fullName||`Learner ${Ge+1}`;Ne.push([de(ns),de(Ps),de(""),de(Number(rs.toFixed(1))),de(Number(jt.toFixed(1))),de(Number(At.toFixed(1))),de(Number(Is.toFixed(1))),de(ue),de(ce)].join(","))}),Ne.length<=1)return null;const Je=j.replace(/\.(xlsx|xls)$/i,"");return new File([Ne.join(` +`)],`${Je}-normalized.csv`,{type:"text/csv"})},H=async D=>{k(!0),y(""),J(null);let j=D;if(/\.(xlsx|xls)$/i.test(D.name))try{const _=await Fx(D,{confidenceThreshold:nn});g(_);const T=fe(_,D.name);T&&(j=T)}catch{g(null)}else g(null);try{const _=await xt.uploadClassRecords(j,{classSectionId:t,className:s,datasetIntent:"synthetic_student_records"}),T=_.students.length,ue=((ce,ae,Ce,Ne)=>({classSectionId:ce.classSectionId||ae||"imported_class",className:ce.className||Ce||"Imported Class",classMetadata:ce.classMetadata||Ne}))(_,t,s,a);T>0&&l?.({students:_.students,classSectionId:ue.classSectionId,className:ue.className,classMetadata:ue.classMetadata}),_.success?(ie.success(`Successfully imported ${T} student records.`),J({datasetIntent:_.datasetIntent,summary:_.interpretationSummary,columns:_.columnInterpretations?.map(ce=>({columnName:ce.columnName,mappedField:ce.mappedField,usagePolicy:ce.usagePolicy,confidenceBand:ce.confidenceBand,domainSignals:ce.domainSignals}))||[]}),c?.()):ie.error("Import completed but no usable student rows were detected. Check required columns and retry.")}catch(_){ie.error(_ instanceof Error?_.message:"Upload failed")}finally{k(!1)}},ee=async D=>{$(!0);try{const j=await xt.uploadCourseMaterials(D,{classSectionId:t,className:s});if(j.success){const _=j.topics?.length??0;ie.success(`Course material imported (${_} topics extracted).`),c?.()}}catch(j){ie.error(j instanceof Error?j.message:"Course material upload failed")}finally{$(!1)}},[oe,Re]=u.useState(r),[Fe,Pe]=u.useState(!1),[G,te]=u.useState(null),E=u.useMemo(()=>{let D=oe;if(o.length>0){const j=new Set(o.map(_=>js(_.classSectionId||_.id)));D=D.filter(_=>j.has(js(_.classSectionId))||j.has(js(_.classroomId)))}else return[];return t&&(D=D.filter(j=>js(j.classSectionId)===js(t)||js(j.classroomId)===js(t))),D},[oe,t,o]);u.useEffect(()=>{Re(r),V(Object.fromEntries(r.map(D=>[Ya(D),{grade:D.grade||"",section:D.section||""}])))},[r]);const[Y,V]=u.useState({}),pe=async()=>{Pe(!0);let D=0,j=0;try{for(const T of E){const Q=Y[Ya(T)],ue=Q?.grade||T.grade,ce=Q?.section||T.section;try{n&&(ue!==T.grade||ce!==T.section)&&(await jr(T.id,ue,ce,n,new Date().getFullYear().toString(),i),await nl(T.id,ue,ce),D++)}catch(ae){console.warn(`[EditRecords] Failed to save ${T.name}:`,ae),j++}}const _=oe.map(T=>{const Q=Y[Ya(T)];if(!Q)return T;const ue=Ct({metadata:T.classMetadata,classSectionId:T.classSectionId,className:[Q.grade,Q.section].filter(Boolean).join(" - "),grade:Q.grade,section:Q.section});return{...T,grade:Q.grade,section:Q.section,className:ue.className||[Q.grade,Q.section].filter(Boolean).join(" - "),classSectionId:ue.classSectionId||T.classSectionId,classMetadata:ue}});Re(_),m?.(_),j>0?ie.warning(`Saved ${D} records, ${j} failed`):ie.success("Records saved successfully")}catch{ie.error("Failed to save changes")}finally{Pe(!1)}};return e.jsx("div",{className:"h-full overflow-y-auto w-full block",children:e.jsxs("div",{className:"w-full p-[24px] xl:p-[32px] space-y-[24px]",children:[C==="main"&&e.jsxs("div",{className:"block space-y-[24px]",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[16px] p-4 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-slate-200 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-indigo-50 flex items-center justify-center border border-indigo-100/50",children:e.jsx(ir,{className:"w-5 h-5 text-indigo-500"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-[14px] font-bold text-[#1e293b]",children:"Upload Context"}),e.jsx("p",{className:"text-[12px] text-[#64748b]",children:"Select where the imported data should be applied"})]})]}),e.jsxs("div",{className:"relative w-full md:w-[300px]",children:[e.jsxs("select",{className:"appearance-none bg-[#f8fafc] border border-[#e2e8f0] text-[#1e293b] font-bold text-[13px] rounded-lg pl-4 pr-10 py-2.5 outline-none focus:border-[#4f46e5] focus:ring-2 focus:ring-[#4f46e5]/20 shadow-[0_1px_4px_rgba(0,0,0,0.02)] cursor-pointer w-full transition-colors",value:s||t||"All Classes",onChange:()=>{},children:[e.jsx("option",{value:"All Classes",children:"All Classes"}),o.map(D=>e.jsx("option",{value:D.classSectionId||D.id,children:D.name},D.id))]}),e.jsx($t,{className:"w-4 h-4 text-[#64748b] absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-[24px]",children:[e.jsxs("div",{onDragOver:D=>{D.preventDefault(),L(!0)},onDragLeave:()=>L(!1),onDrop:D=>{D.preventDefault(),L(!1);const j=D.dataTransfer.files[0];j&&H(j)},onClick:()=>re.current?.click(),className:`border-2 border-dashed transition-all rounded-[24px] p-8 flex flex-col items-center justify-center text-center cursor-pointer group shadow-[0_4px_20px_rgba(0,0,0,0.02)] relative overflow-hidden h-[280px] ${I?"border-[#1FA7E1] bg-[#1FA7E1]/10":"border-[#1FA7E1]/30 hover:border-[#1FA7E1] bg-white hover:bg-[#1FA7E1]/5"}`,children:[e.jsx("input",{ref:re,type:"file",accept:".csv,.xlsx,.xls",onChange:D=>{const j=D.target.files?.[0];j&&H(j)},className:"hidden"}),e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#1FA7E1]/10 flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300 shadow-sm border border-[#1FA7E1]/20",children:f?e.jsx("span",{className:"animate-spin text-[#1FA7E1]",children:"..."}):e.jsx(od,{className:"w-8 h-8 text-[#1FA7E1]"})}),e.jsx("h3",{className:"text-[18px] font-bold text-[#1e293b] mb-2",children:f?"Uploading...":"Class Records"}),e.jsx("p",{className:"text-[13px] text-[#64748b] max-w-sm mb-6",children:"Upload student grades, attendance logs, and quiz scores to power predictive analytics."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".csv"}),e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".xlsx"})]})]}),e.jsxs("div",{onDragOver:D=>{D.preventDefault(),W(!0)},onDragLeave:()=>W(!1),onDrop:D=>{D.preventDefault(),W(!1);const j=D.dataTransfer.files[0];j&&ee(j)},onClick:()=>le.current?.click(),className:`border-2 border-dashed transition-all rounded-[24px] p-8 flex flex-col items-center justify-center text-center cursor-pointer group shadow-[0_4px_20px_rgba(0,0,0,0.02)] relative overflow-hidden h-[280px] ${R?"border-[#9956DE] bg-[#9956DE]/10":"border-[#9956DE]/30 hover:border-[#9956DE] bg-white hover:bg-[#9956DE]/5"}`,children:[e.jsx("input",{ref:le,type:"file",accept:".pdf,.docx,.txt",onChange:D=>{const j=D.target.files?.[0];j&&ee(j)},className:"hidden"}),e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#9956DE]/10 flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300 shadow-sm border border-[#9956DE]/20",children:w?e.jsx("span",{className:"animate-spin text-[#9956DE]",children:"..."}):e.jsx(Es,{className:"w-8 h-8 text-[#9956DE]"})}),e.jsx("h3",{className:"text-[18px] font-bold text-[#1e293b] mb-2",children:w?"Uploading...":"Course Materials"}),e.jsx("p",{className:"text-[13px] text-[#64748b] max-w-sm mb-6",children:"Upload syllabus, lesson plans, and curriculum docs to ground AI lesson generation."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".pdf"}),e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".docx"}),e.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 text-[11px] font-semibold rounded-full border border-slate-200",children:".txt"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-[16px]",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#0ea5e9] to-[#0284c7] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(14,165,233,0.2)] flex flex-col text-white group transition-all duration-300 hover:-translate-y-1 hover:shadow-lg hover:shadow-sky-500/30",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full"}),e.jsx("div",{className:"w-10 h-10 rounded-full bg-white/10 border border-white/20 flex items-center justify-center shrink-0 mb-3 relative z-10 transition-transform group-hover:scale-110",children:e.jsx(rd,{className:"w-5 h-5 text-white"})}),e.jsx("h4",{className:"font-bold text-[14px] mb-1.5 relative z-10",children:"Smart Parsing"}),e.jsx("p",{className:"text-[12px] text-white/90 leading-relaxed relative z-10",children:"AI automatically understands varied spreadsheet formats and maps column names securely."})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#f97316] to-[#ea580c] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(249,115,22,0.2)] flex flex-col text-white group transition-all duration-300 hover:-translate-y-1 hover:shadow-lg hover:shadow-orange-500/30",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full"}),e.jsx("div",{className:"w-10 h-10 rounded-full bg-white/10 border border-white/20 flex items-center justify-center shrink-0 mb-3 relative z-10 transition-transform group-hover:scale-110",children:e.jsx(Yr,{className:"w-5 h-5 text-white"})}),e.jsx("h4",{className:"font-bold text-[14px] mb-1.5 relative z-10",children:"Risk Prediction"}),e.jsx("p",{className:"text-[12px] text-white/90 leading-relaxed relative z-10",children:"Analyzes historical performance patterns across your data to predict at-risk students."})]}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-[#a855f7] to-[#9333ea] rounded-[16px] p-[20px] shadow-[0_4px_12px_rgba(168,85,247,0.2)] flex flex-col text-white group transition-all duration-300 hover:-translate-y-1 hover:shadow-lg hover:shadow-purple-500/30",children:[e.jsx("div",{className:"absolute -right-8 -bottom-8 w-24 h-24 bg-white/10 rounded-full"}),e.jsx("div",{className:"w-10 h-10 rounded-full bg-white/10 border border-white/20 flex items-center justify-center shrink-0 mb-3 relative z-10 transition-transform group-hover:scale-110",children:e.jsx(ps,{className:"w-5 h-5 text-white"})}),e.jsx("h4",{className:"font-bold text-[14px] mb-1.5 relative z-10",children:"Contextual AI"}),e.jsx("p",{className:"text-[12px] text-white/90 leading-relaxed relative z-10",children:"Maps curriculum topics to generate highly personalized remedial lesson paths."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-[24px]",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white flex flex-col justify-between h-full",children:[e.jsx("h2",{className:"text-[16px] font-semibold text-[#1e293b] mb-4",children:"Data Health"}),e.jsxs("div",{className:"flex-1 bg-emerald-50/50 border border-emerald-100 rounded-[16px] p-6 flex flex-col items-center justify-center text-center transition-all duration-300 hover:bg-emerald-50 hover:shadow-md hover:border-emerald-200",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-emerald-100 flex items-center justify-center mb-3 text-emerald-600 transition-transform duration-300 hover:scale-110 hover:-translate-y-1",children:e.jsx(ja,{className:"w-6 h-6"})}),e.jsx("h3",{className:"text-emerald-700 font-bold text-[15px] mb-1",children:"All Records Synced"}),e.jsx("p",{className:"text-emerald-600/80 text-[12px] max-w-[200px]",children:"AI parsing completed successfully with no anomalies detected."})]}),e.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[e.jsxs("button",{onClick:()=>S("edit-records"),className:"w-full flex items-center justify-center gap-2 bg-[#1e293b] hover:bg-black text-white text-[13px] font-semibold rounded-full px-4 py-3 shadow-[0_1px_4px_rgba(0,0,0,0.04)] transition-transform hover:scale-[1.02]",children:[e.jsx(ed,{className:"w-4 h-4"})," Edit Class Records"]}),e.jsx("button",{onClick:()=>S("mapping-logs"),className:"w-full flex items-center justify-center gap-2 bg-white text-[#475569] border border-slate-300 hover:bg-slate-50 text-[13px] font-semibold rounded-full px-4 py-3 shadow-[0_1px_4px_rgba(0,0,0,0.04)] transition-colors",children:"View Mapping Logs"})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[24px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white flex flex-col h-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h2",{className:"text-[16px] font-semibold text-[#1e293b]",children:"Recent Uploads"}),e.jsx("button",{onClick:()=>S("mapping-logs"),className:"text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors",children:"View All"})]}),e.jsxs("div",{className:"flex-1 space-y-[12px] overflow-y-auto no-scrollbar flex flex-col justify-center items-center h-[120px]",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-slate-50 flex items-center justify-center mb-2 border border-slate-100",children:e.jsx(Wc,{className:"w-5 h-5 text-slate-300"})}),e.jsx("p",{className:"text-[13px] font-medium text-slate-500",children:"There are no recent uploads yet."})]})]})]})]}),C==="mapping-logs"&&e.jsxs("div",{className:"space-y-[16px]",children:[e.jsx("div",{className:"shrink-0 mb-2",children:e.jsxs("button",{onClick:()=>S("main"),className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors w-max bg-white px-[18px] py-2 rounded-full shadow-sm border border-slate-200",children:[e.jsx(lr,{className:"w-4 h-4"})," Back to Uploads"]})}),e.jsxs("div",{className:"bg-white rounded-[18px] border border-[#f1f5f9] overflow-hidden shadow-sm",children:[e.jsx("div",{className:"p-5 border-b border-[#f1f5f9] bg-slate-50 flex justify-between items-center",children:e.jsx("h2",{className:"text-[15px] font-semibold text-[#1e293b]",children:"Latest Import Mapping"})}),e.jsx("div",{className:"p-5",children:q?e.jsx("div",{className:"space-y-3",children:q.columns.map((D,j)=>e.jsxs("div",{className:"flex justify-between p-3 border rounded bg-slate-50",children:[e.jsx("span",{className:"font-semibold text-sm",children:D.columnName}),e.jsx("span",{className:"text-sm text-indigo-600",children:D.mappedField||"Unmapped"})]},j))}):e.jsx("p",{className:"text-slate-500 text-sm",children:"No recent mapping logs to display."})})]})]}),C==="edit-records"&&e.jsxs("div",{className:"space-y-[16px] h-full flex flex-col",children:[e.jsx("div",{className:"shrink-0 mb-2",children:e.jsxs("button",{onClick:()=>S("main"),className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors w-max bg-white px-[18px] py-2 rounded-full shadow-sm border border-slate-200",children:[e.jsx(lr,{className:"w-4 h-4"})," Back to Uploads"]})}),e.jsxs("div",{className:"bg-white rounded-[18px] border border-slate-200 shadow-sm overflow-hidden flex flex-col flex-1",children:[e.jsxs("div",{className:"p-5 border-b border-slate-200 flex justify-between items-center bg-white",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[18px] font-bold text-[#1e293b]",children:"Edit Class Records"}),e.jsx("p",{className:"text-[13px] text-[#64748b]",children:"Review and modify student data manually"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>S("main"),className:"px-5 py-2 rounded-full border border-slate-300 text-slate-700 font-semibold text-[13px] hover:bg-slate-50",children:"Cancel"}),e.jsx("button",{onClick:pe,disabled:Fe,className:"px-5 py-2 rounded-full bg-emerald-500 text-white font-semibold text-[13px] hover:bg-emerald-600 flex items-center gap-2 disabled:opacity-50",children:Fe?"Saving...":e.jsxs(e.Fragment,{children:[e.jsx(vi,{className:"w-4 h-4"})," Save Changes"]})})]})]}),e.jsxs("div",{className:"px-5 py-3 border-b border-slate-200 flex justify-between items-center bg-slate-50/50 shrink-0 text-slate-500 text-[13px]",children:[e.jsxs("span",{className:"flex items-center gap-2 font-medium",children:[e.jsx(ra,{className:"w-4 h-4"})," Click on any field to edit"]}),e.jsxs("span",{children:["Showing ",E.length," records"]})]}),e.jsx("div",{className:"overflow-auto flex-1 table-scrollbar bg-white relative",children:e.jsxs("div",{className:"min-w-[1100px] w-full flex flex-col min-h-full",children:[e.jsxs("div",{className:"flex items-center w-full bg-slate-100/90 border-b border-slate-200 text-[12px] font-semibold text-slate-500 tracking-wide sticky top-0 z-20 shadow-[0_1px_2px_rgba(0,0,0,0.02)] h-12",children:[e.jsx("div",{className:"flex-[1.5] min-w-[240px] px-6 sticky left-0 z-30 bg-slate-100/90 backdrop-blur-sm border-r border-slate-200 h-full flex items-center shadow-[2px_0_4px_rgba(0,0,0,0.02)]",children:"Student Name"}),e.jsx("div",{className:"w-[100px] shrink-0 px-4 h-full flex items-center justify-center",children:"LRN"}),e.jsx("div",{className:"w-[140px] shrink-0 px-4 h-full flex items-center justify-center",children:"Grade"}),e.jsx("div",{className:"w-[140px] shrink-0 px-4 h-full flex items-center justify-center",children:"Section"}),e.jsx("div",{className:"w-[100px] shrink-0 px-4 h-full flex items-center justify-center",children:"Avg Score"}),e.jsx("div",{className:"w-[120px] shrink-0 px-4 h-full flex items-center justify-center",children:"Risk Level"}),e.jsx("div",{className:"flex-1 min-w-[180px] px-4 h-full flex items-center justify-center",children:"Weakest Topic"}),e.jsx("div",{className:"w-[80px] shrink-0 px-4 h-full flex items-center justify-center border-r border-transparent",children:"Action"})]}),e.jsx("div",{className:"flex flex-col w-full pb-4",children:E.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-6 text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-slate-100 flex items-center justify-center mb-4",children:e.jsx(ra,{className:"w-7 h-7 text-slate-400"})}),e.jsx("h3",{className:"text-[16px] font-bold text-slate-700 mb-2",children:"No managed classes found"}),e.jsx("p",{className:"text-[13px] text-slate-500 max-w-sm",children:"You don't currently manage any classes. Ask your administrator to assign you as a section manager, or create a new class from the Dashboard."})]}):E.map((D,j)=>{const _=Ya(D),T=D.name.split(" "),Q=T.length>1?`${T[0][0]}${T[T.length-1][0]}`.toUpperCase():D.name.substring(0,2).toUpperCase(),ue=["bg-[#be185d]","bg-[#3b82f6]","bg-[#f43f5e]","bg-[#2563eb]","bg-[#059669]","bg-[#d946ef]"],ce=ue[j%ue.length],ae=(D.avgScore??0)>=75?"text-emerald-500":(D.avgScore??0)>=60?"text-orange-500":"text-rose-500";let Ce="bg-slate-50 text-slate-600 border-slate-200";const Ne=(D.riskLevel||"").toLowerCase();return Ne==="low"?Ce="bg-emerald-50 text-emerald-600 border-emerald-200":Ne==="high"?Ce="bg-rose-50 text-rose-600 border-rose-200":Ne==="medium"&&(Ce="bg-orange-50 text-orange-600 border-orange-200"),e.jsxs("div",{className:"flex items-center w-full border-b border-slate-100 hover:bg-slate-50 transition-colors group min-h-[64px]",children:[e.jsxs("div",{className:"flex-[1.5] min-w-[240px] px-6 sticky left-0 z-10 bg-white group-hover:bg-slate-50 border-r border-slate-100 h-full flex items-center gap-4 shadow-[2px_0_4px_rgba(0,0,0,0.01)]",children:[e.jsx("div",{className:`w-8 h-8 rounded-full ${ce} text-white flex items-center justify-center font-bold text-[12px] shrink-0`,children:Q}),e.jsx("span",{className:"font-semibold text-slate-800 text-[14px] truncate",children:D.name})]}),e.jsx("div",{className:"w-[100px] shrink-0 px-4 flex justify-center text-[13px] text-slate-500",children:D.lrn||"—"}),e.jsx("div",{className:"w-[140px] shrink-0 px-4 flex justify-center",children:e.jsx("input",{type:"text",value:Y[_]?.grade||D.grade||"",onChange:Je=>V($e=>({...$e,[_]:{...$e[_],grade:Je.target.value}})),readOnly:G!==_,className:`outline-none px-4 py-1.5 rounded-full text-[13px] font-medium text-slate-600 w-full transition-all text-center ${G===_?"bg-white border border-purple-500 ring-2 ring-purple-500/20":"bg-slate-100 border border-transparent cursor-default"}`})}),e.jsx("div",{className:"w-[140px] shrink-0 px-4 flex justify-center",children:e.jsx("input",{type:"text",value:Y[_]?.section||D.section||"",onChange:Je=>V($e=>({...$e,[_]:{...$e[_],section:Je.target.value}})),readOnly:G!==_,className:`outline-none px-4 py-1.5 rounded-full text-[13px] font-medium text-slate-600 w-full transition-all text-center ${G===_?"bg-white border border-purple-500 ring-2 ring-purple-500/20":"bg-slate-100 border border-transparent cursor-default"}`})}),e.jsx("div",{className:"w-[100px] shrink-0 px-4 flex justify-center",children:e.jsxs("span",{className:`${ae} font-bold text-[14px]`,children:[D.avgScore,"%"]})}),e.jsx("div",{className:"w-[120px] shrink-0 px-4 flex justify-center",children:e.jsx("span",{className:`px-3 py-1 text-[10px] font-bold rounded uppercase border ${Ce}`,children:D.riskLevel||"Unknown"})}),e.jsx("div",{className:"flex-1 min-w-[180px] px-4 flex justify-center text-[13px] text-slate-600 truncate",children:D.weakestTopic||"Foundational Skills"}),e.jsx("div",{className:"w-[80px] shrink-0 px-4 flex justify-center border-r border-transparent",children:e.jsx("button",{onClick:()=>te(G===_?null:_),className:`w-8 h-8 rounded-full flex items-center justify-center transition-colors ${G===_?"bg-purple-100 text-purple-600":"hover:bg-slate-200 text-slate-400"}`,children:e.jsx(yi,{className:"w-4 h-4"})})})]},_)})})]})})]})]})]})})}const Px=[{value:"available",label:"Available",icon:e.jsx(Aa,{size:14}),color:"text-emerald-600"},{value:"teacher_uploaded",label:"Teacher Material",icon:e.jsx(Vr,{size:14}),color:"text-blue-600"},{value:"coming_soon",label:"Coming Soon",icon:e.jsx(Ms,{size:14}),color:"text-amber-600"},{value:"unavailable",label:"Unavailable",icon:e.jsx(bc,{size:14}),color:"text-slate-400"}],Bx=({teacherId:t})=>{const[s,a]=u.useState(""),[r,o]=u.useState("teacher_uploaded"),[n,i]=u.useState(!1),[l,c]=u.useState(null),d=async()=>{if(!s){ie.error("Select a module first.");return}i(!0);try{let m;if(l&&r==="teacher_uploaded"){const p=Ac(Pl,`teacher_modules/${t}/${s}/${l.name}`);await zc(p,l),m=await Lc(p)}await Mc(s,r,t,m),ie.success(`Module status updated to "${r}".`),c(null)}catch(m){ie.error(m.message||"Failed to update module status.")}finally{i(!1)}};return e.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-slate-800",children:"Module Availability Control"}),e.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Set module status or upload alternative PDF when DepEd content is unavailable."})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-slate-600 mb-1 block",children:"Module"}),e.jsxs("select",{value:s,onChange:m=>a(m.target.value),className:"w-full rounded-lg border border-slate-200 px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"Select module..."}),Ol.map(m=>e.jsxs("option",{value:m.id,children:[m.moduleTitle," (",m.quarter,")"]},m.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-slate-600 mb-1 block",children:"Status"}),e.jsx("select",{value:r,onChange:m=>o(m.target.value),className:"w-full rounded-lg border border-slate-200 px-3 py-2 text-sm",children:Px.map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))})]})]}),r==="teacher_uploaded"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-slate-600 mb-1 block",children:"Upload Alternative PDF (optional)"}),e.jsx("input",{type:"file",accept:".pdf",onChange:m=>c(m.target.files?.[0]||null),className:"text-sm text-slate-600"})]}),e.jsx("button",{type:"button",onClick:d,disabled:!s||n,className:"px-4 py-2 rounded-lg bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-bold disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:n?"Updating...":"Update Status"})]})},Ka="ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789",ti="school.mathpulse.local";function si(t=10){const s=typeof globalThis<"u"&&typeof globalThis.crypto<"u"?globalThis.crypto:void 0;if(s&&typeof s.getRandomValues=="function"){const r=new Uint32Array(t);s.getRandomValues(r);let o="";for(let n=0;n{const[l,c]=u.useState(""),[d,m]=u.useState(""),[p,h]=u.useState(!1),[b,N]=u.useState(null),[C,S]=u.useState(null),[v,g]=u.useState(!1);u.useEffect(()=>{t&&(N(null),g(!1),h(!1),S(null),c((a?.email||Hx(a)).trim()),m(si()))},[t,a]);const I=u.useMemo(()=>a?[a.grade,a.section].filter(Boolean).join(" · ")||"Unassigned section":null,[a]),L=()=>{m(si()),g(!1)},R=async()=>{try{const k=C?.temporaryPassword||d;if(!k)return;typeof navigator<"u"&&navigator.clipboard&&await navigator.clipboard.writeText(k),g(!0),ie.success("Temporary password copied. Share it with the student now — it will not be shown again."),window.setTimeout(()=>g(!1),2500)}catch(k){console.warn("Clipboard write failed:",k),ie.error("Unable to copy password. Please copy it manually.")}},W=async()=>{if(!a)return;const k=l.trim();if(!Ux(k)){N("Enter a valid email address before creating the account.");return}if(!d||d.length<8){N("Temporary password must be at least 8 characters.");return}if(!r){N("Missing teacher context. Please refresh and try again.");return}h(!0),N(null);try{const w=await Wu({name:a.name,lrn:a.lrn,email:k,grade:a.grade,section:a.section,classSectionId:a.classSectionId,adviserTeacherId:r,adviserTeacherName:o,schoolYear:n,temporaryPassword:d});S(w),i?.({...w,rosterId:a.rosterId}),ie.success(`Account created for ${a.name}.`)}catch(w){const $=w instanceof Error?w.message:"Failed to create account.";N($)}finally{h(!1)}},f=C?.temporaryPassword||d;return e.jsx(zt,{children:t&&a&&e.jsx(ze.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:()=>{p||s()},children:e.jsxs(ze.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{type:"spring",damping:28,stiffness:320},onClick:k=>k.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl w-full max-w-lg overflow-hidden border border-[#dde3eb]",role:"dialog","aria-modal":"true","aria-labelledby":"create-student-account-modal-title",children:[e.jsxs("div",{className:"flex items-start justify-between px-6 pt-6",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-indigo-100 text-indigo-600 flex items-center justify-center shrink-0",children:e.jsx(li,{size:22})}),e.jsxs("div",{children:[e.jsx("h2",{id:"create-student-account-modal-title",className:"text-[16px] font-bold text-[#0a1628]",children:C?"Account Created":"Create Student Account"}),e.jsx("p",{className:"text-[12px] text-[#5a6578] mt-0.5",children:C?"Share these credentials with the student. The password will not be shown again.":`Provision a system account for ${a.name}.`})]})]}),e.jsx("button",{type:"button",onClick:()=>{p||s()},className:"p-1.5 rounded-lg hover:bg-[#dde3eb] transition-colors","aria-label":"Close",children:e.jsx(Xt,{className:"w-4 h-4 text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-2xl p-4",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-[#64748b]",children:"Roster Row"}),e.jsx("p",{className:"text-[14px] font-semibold text-[#0a1628] mt-1",children:a.name}),e.jsxs("p",{className:"text-[12px] text-[#475569] mt-0.5",children:[a.lrn?`LRN ${a.lrn} · `:"",I]})]}),!C&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-[12px] font-semibold text-[#0a1628]",children:"Email address"}),e.jsx("input",{type:"email",value:l,onChange:k=>c(k.target.value),disabled:p,className:"mt-1 w-full rounded-xl border border-[#dde3eb] bg-white px-3 py-2 text-[13px] text-[#0a1628] focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-200",placeholder:"student@school.example",autoComplete:"off",spellCheck:!1}),e.jsx("span",{className:"text-[11px] text-[#64748b] mt-1 block",children:"Auto-generated from LRN if available. The student will sign in with this address."})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[12px] font-semibold text-[#0a1628] block",children:"Temporary password"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("input",{type:"text",value:d,readOnly:!0,className:"flex-1 rounded-xl border border-[#dde3eb] bg-white px-3 py-2 text-[13px] font-mono tracking-wide text-[#0a1628] focus:outline-none"}),e.jsx("button",{type:"button",onClick:L,disabled:p,className:"p-2 rounded-xl border border-[#dde3eb] bg-white hover:bg-[#f1f5f9] transition-colors disabled:opacity-60","aria-label":"Regenerate temporary password",children:e.jsx(cs,{className:"w-4 h-4 text-[#475569]"})}),e.jsx("button",{type:"button",onClick:R,className:"p-2 rounded-xl border border-[#dde3eb] bg-white hover:bg-[#f1f5f9] transition-colors","aria-label":"Copy temporary password",children:v?e.jsx(Ht,{className:"w-4 h-4 text-emerald-600"}):e.jsx(Qr,{className:"w-4 h-4 text-[#475569]"})})]}),e.jsx("span",{className:"text-[11px] text-[#64748b] mt-1 block",children:"The student should change this on first sign-in. Share it once — it will not be persisted."})]}),b&&e.jsxs("div",{className:"flex items-start gap-2 rounded-xl bg-rose-50 border border-rose-200 px-3 py-2 text-[12px] text-rose-700",children:[e.jsx(Ec,{className:"w-4 h-4 mt-0.5 shrink-0"}),e.jsx("span",{children:b})]})]}),C&&e.jsxs("div",{className:"rounded-2xl border border-emerald-200 bg-emerald-50 p-4 space-y-2",children:[e.jsx("p",{className:"text-[12px] font-semibold text-emerald-800",children:"Credentials"}),e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-white border border-emerald-100 px-3 py-2",children:[e.jsx("span",{className:"text-[12px] text-[#475569]",children:"Email"}),e.jsx("span",{className:"text-[13px] font-semibold text-[#0a1628]",children:C.email})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-white border border-emerald-100 px-3 py-2",children:[e.jsx("span",{className:"text-[12px] text-[#475569]",children:"Temporary password"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold font-mono text-[#0a1628]",children:f}),e.jsx("button",{type:"button",onClick:R,className:"p-1.5 rounded-lg border border-emerald-200 bg-white hover:bg-emerald-100 transition-colors","aria-label":"Copy temporary password",children:v?e.jsx(Ht,{className:"w-4 h-4 text-emerald-600"}):e.jsx(Qr,{className:"w-4 h-4 text-emerald-700"})})]})]}),e.jsx("p",{className:"text-[11px] text-emerald-800",children:"This password is not stored anywhere. If you close this dialog without copying, you will need to reset it from the admin tools."})]})]}),e.jsx("div",{className:"flex items-center justify-end gap-2 px-6 pb-6",children:C?e.jsx(St,{type:"button",onClick:s,className:"bg-indigo-600 hover:bg-indigo-700 text-white text-[13px] font-semibold rounded-xl px-5 py-2",children:"Done"}):e.jsxs(e.Fragment,{children:[e.jsx(St,{type:"button",variant:"ghost",onClick:s,disabled:p,className:"text-[13px] font-semibold text-[#475569] rounded-xl px-4 py-2 hover:bg-[#dde3eb]",children:"Cancel"}),e.jsx(St,{type:"button",onClick:W,disabled:p,className:"bg-indigo-600 hover:bg-indigo-700 text-white text-[13px] font-semibold rounded-xl px-5 py-2 disabled:opacity-60",children:p?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(gt,{className:"w-4 h-4 animate-spin"}),"Creating…"]}):"Create account"})]})})]})})})};function Qx(t){const s=t.atRiskCount>=5?"high":t.atRiskCount>=2?"medium":"low",a=Ct({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.name,grade:t.grade,gradeLevel:t.gradeLevel,classification:t.classification,strand:t.strand,section:t.section,schoolYear:t.schoolYear,ownerTeacherId:t.ownerTeacherId||t.teacherId,ownerTeacherName:t.ownerTeacherName,adviserTeacherId:t.adviserTeacherId||t.teacherId,adviserTeacherName:t.adviserTeacherName||t.ownerTeacherName,managerId:t.managerId,managerName:t.managerName});return{id:t.id,name:a.className||t.name,classSectionId:a.classSectionId||t.classSectionId,classMetadata:a,gradeLevel:a.gradeLevel||void 0,classification:a.classification||void 0,strand:a.strand||void 0,managerId:a.managerId||void 0,managerName:a.managerName||void 0,schedule:t.schedule,studentCount:t.studentCount,avgScore:t.avgScore,atRiskCount:t.atRiskCount,riskLevel:s}}function Br(t,s){const a=t.riskStatus?["intervene","critical","at_risk"].includes(t.riskStatus)?"high":t.riskStatus==="watch"?"medium":"low":(t.riskLevel||"Low").toLowerCase(),r=t.lastActive?yl(t.lastActive.toDate()):"Unknown",o=t.className||s||"Imported Class",n=xs(o),i=t.grade||n.grade,l=t.section||n.section,c=Ct({metadata:t.classMetadata,classSectionId:t.classSectionId||t.classroomId,className:[i,l].filter(Boolean).join(" - ")||o,grade:i,gradeLevel:t.gradeLevel,classification:t.classification,strand:t.strand,section:l,adviserTeacherId:t.teacherId,ownerTeacherId:t.teacherId,managerId:t.classMetadata?.managerId||t.managerId,managerName:t.classMetadata?.managerName||t.managerName});return{id:t.id,lrn:t.lrn,name:t.name,avatar:t.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:t.avgQuizScore,riskLevel:a,weakestTopic:t.weakestTopic||"N/A",classroomId:t.classroomId||c.classSectionId||o,className:c.className||[i,l].filter(Boolean).join(" - ")||o,grade:i,gradeLevel:c.gradeLevel||gs(i)||void 0,classification:c.classification||ma(c.gradeLevel||i)||void 0,strand:c.strand||xa(c.className,l)||void 0,section:l,classSectionId:c.classSectionId||t.classSectionId,classMetadata:c,managerId:c.managerId||void 0,managerName:c.managerName||void 0,lastActive:r,struggles:t.struggles||[],engagementScore:t.engagementScore,attendance:t.attendance,assignmentCompletion:t.assignmentCompletion,hasRegisteredAccount:t.hasRegisteredAccount,source:t.source,accountUid:t.accountUid,email:t.email}}function Vx(t){const s=t.atRiskCount>=5?"high":t.atRiskCount>=2?"medium":"low",a=Ct({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.name,grade:t.grade,gradeLevel:t.gradeLevel||t.classMetadata?.gradeLevel,classification:t.classification||t.classMetadata?.classification,strand:t.strand||t.classMetadata?.strand,section:t.section,managerId:t.managerId||t.classMetadata?.managerId,managerName:t.managerName||t.classMetadata?.managerName});return{id:t.id,name:a.className||t.name,classSectionId:a.classSectionId||t.classSectionId||void 0,classMetadata:a,gradeLevel:a.gradeLevel||void 0,classification:a.classification||void 0,strand:a.strand||void 0,managerId:a.managerId||void 0,managerName:a.managerName||void 0,schedule:t.schedule||"Mon-Fri",studentCount:t.studentCount,avgScore:t.avgScore,atRiskCount:t.atRiskCount,riskLevel:s}}function Wx(t){const s=(t.riskLevel||"Low").toLowerCase(),a=Ct({metadata:t.classMetadata,classSectionId:t.classSectionId,className:t.className||[t.grade,t.section].filter(Boolean).join(" - ")||"Imported Class",grade:t.grade,gradeLevel:t.gradeLevel||t.classMetadata?.gradeLevel,classification:t.classification||t.classMetadata?.classification,strand:t.strand||t.classMetadata?.strand,section:t.section,managerId:t.managerId||t.classMetadata?.managerId,managerName:t.managerName||t.classMetadata?.managerName}),r=a.className||"Imported Class";return{id:t.id,lrn:t.lrn||void 0,name:t.name,avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:t.avgQuizScore,riskLevel:s,weakestTopic:t.weakestTopic||"Foundational Skills",classroomId:a.classSectionId||t.classSectionId||r,className:r,grade:a.grade||xs(r).grade,gradeLevel:a.gradeLevel||gs(a.grade||xs(r).grade)||void 0,classification:a.classification||ma(a.gradeLevel||a.grade)||void 0,strand:a.strand||xa(r,a.section||t.section)||void 0,section:a.section||xs(r).section,classSectionId:a.classSectionId||t.classSectionId||void 0,classMetadata:a,managerId:a.managerId||void 0,managerName:a.managerName||void 0,lastActive:"Recently imported",struggles:[t.weakestTopic||"Foundational Skills"],engagementScore:t.engagementScore,attendance:t.attendance,assignmentCompletion:t.assignmentCompletion}}function qx(t,s,a){return t<60||s<75||a<55?"high":t<75||s<85||a<70?"medium":"low"}function Yx(t,s,a,r){const o=Ct({metadata:r,classSectionId:s,className:a}),n=o.className||"Imported Class",i=o.classSectionId||"imported_class",l=Number(t.avgQuizScore||0),c=Number(t.attendance||0),d=Number(t.engagementScore||0),m=Number(t.assignmentCompletion||0),p=t.unknownFields?.weakestTopic||t.unknownFields?.topic||"Foundational Skills",h=qx(l,c,d),b=t.studentId||t.lrn||t.email||t.name||Math.random().toString(36).slice(2);return{id:`upload-${i}-${b}`,lrn:t.lrn,name:t.name,avatar:`https://ui-avatars.com/api/?name=${encodeURIComponent(t.name)}&background=random`,avgScore:l,riskLevel:h,weakestTopic:p,classroomId:i,className:n,grade:o.grade||xs(n).grade,gradeLevel:o.gradeLevel||gs(o.grade||xs(n).grade)||void 0,classification:o.classification||ma(o.gradeLevel||o.grade)||void 0,strand:o.strand||xa(n,o.section)||void 0,section:o.section||xs(n).section,classSectionId:i,classMetadata:o,managerId:o.managerId||void 0,managerName:o.managerName||void 0,lastActive:"Recently imported",struggles:[p],engagementScore:d,attendance:c,assignmentCompletion:m}}function yl(t){const s=Date.now()-t.getTime(),a=Math.floor(s/6e4);if(a<1)return"Just now";if(a<60)return`${a} min${a>1?"s":""} ago`;const r=Math.floor(a/60);if(r<24)return`${r} hour${r>1?"s":""} ago`;const o=Math.floor(r/24);return`${o} day${o>1?"s":""} ago`}function lt(t){return(t||"").trim().toLowerCase()}function ai(t){const s=lt(t.classSectionId);if(s)return`section:${s}`;const a=(t.id||"").trim().toLowerCase();return a?`id:${a}`:`name:${(t.name||"").trim().toLowerCase()}`}function ri(t,s){const a=new Map;return t.forEach(r=>{a.set(ai(r),r)}),s.forEach(r=>{const o=ai(r),n=a.get(o);if(!n){a.set(o,r);return}const i=Math.max(n.atRiskCount||0,r.atRiskCount||0),l=Math.max(n.studentCount||0,r.studentCount||0),c=r.avgScore>0?r.avgScore:n.avgScore,d=i>=5?"high":i>=2?"medium":"low",m=Ct({metadata:n.classMetadata,classSectionId:n.classSectionId||r.classSectionId,className:n.name||r.name,grade:n.classMetadata?.grade||r.classMetadata?.grade,gradeLevel:n.classMetadata?.gradeLevel||r.classMetadata?.gradeLevel,classification:n.classMetadata?.classification||r.classMetadata?.classification,strand:n.classMetadata?.strand||r.classMetadata?.strand,section:n.classMetadata?.section||r.classMetadata?.section,schoolYear:n.classMetadata?.schoolYear||r.classMetadata?.schoolYear,ownerTeacherId:n.classMetadata?.ownerTeacherId||r.classMetadata?.ownerTeacherId,ownerTeacherName:n.classMetadata?.ownerTeacherName||r.classMetadata?.ownerTeacherName,adviserTeacherId:n.classMetadata?.adviserTeacherId||r.classMetadata?.adviserTeacherId,adviserTeacherName:n.classMetadata?.adviserTeacherName||r.classMetadata?.adviserTeacherName,managerId:n.classMetadata?.managerId||r.classMetadata?.managerId,managerName:n.classMetadata?.managerName||r.classMetadata?.managerName});a.set(o,{...n,classSectionId:m.classSectionId||n.classSectionId||r.classSectionId,name:m.className||n.name||r.name,classMetadata:m,gradeLevel:m.gradeLevel||void 0,classification:m.classification||void 0,strand:m.strand||void 0,managerId:m.managerId||void 0,managerName:m.managerName||void 0,schedule:n.schedule||r.schedule,studentCount:l,atRiskCount:i,avgScore:c,riskLevel:d})}),Array.from(a.values())}function fr(t){const s=(t.lrn||"").trim().toLowerCase();if(s)return`lrn:${s}`;const a=t.name.trim().toLowerCase();if(a)return`name:${a}`;const r=lt(t.classSectionId)||lt(t.classroomId),o=(t.id||"").trim().toLowerCase();return r&&o?`${r}|id:${o}`:`${r}|anonymous`}function on(t){const s=lt(t.classSectionId)||lt(t.classroomId),a=(t.lrn||"").trim().toLowerCase(),r=(t.id||"").trim().toLowerCase(),o=t.name.trim().toLowerCase().replace(/\s+/g,"_");return s&&a?`${s}|lrn:${a}`:s&&r?`${s}|id:${r}`:a?`lrn:${a}`:r&&o?`id:${r}|name:${o}`:r?`id:${r}`:s&&o?`${s}|name:${o}`:`name:${o||"unknown"}`}function ni(t,s){const a=new Map;return t.forEach(r=>{a.set(fr(r),r)}),s.forEach(r=>{const o=fr(r),n=a.get(o);if(!n){a.set(o,r);return}const i=[n.riskLevel,r.riskLevel].includes("high")?"high":[n.riskLevel,r.riskLevel].includes("medium")?"medium":"low",l=Ct({metadata:n.classMetadata,classSectionId:n.classSectionId||r.classSectionId,className:n.className||r.className,grade:n.grade||r.grade,gradeLevel:n.gradeLevel||r.gradeLevel,classification:n.classification||r.classification,strand:n.strand||r.strand,section:n.section||r.section,managerId:n.managerId||r.managerId,managerName:n.managerName||r.managerName});a.set(o,{...n,lrn:n.lrn||r.lrn,classSectionId:l.classSectionId||n.classSectionId||r.classSectionId,classroomId:n.classroomId||r.classroomId,className:l.className||n.className||r.className,grade:l.grade||n.grade||r.grade,gradeLevel:l.gradeLevel||n.gradeLevel||r.gradeLevel,classification:l.classification||n.classification||r.classification,strand:l.strand||n.strand||r.strand,section:l.section||n.section||r.section,managerId:l.managerId||n.managerId||r.managerId,managerName:l.managerName||n.managerName||r.managerName,classMetadata:l,avgScore:r.avgScore>0?r.avgScore:n.avgScore,attendance:r.attendance>0?r.attendance:n.attendance,engagementScore:r.engagementScore>0?r.engagementScore:n.engagementScore,assignmentCompletion:r.assignmentCompletion>0?r.assignmentCompletion:n.assignmentCompletion,weakestTopic:n.weakestTopic&&n.weakestTopic!=="N/A"?n.weakestTopic:r.weakestTopic,riskLevel:i,struggles:n.struggles.length>0?n.struggles:r.struggles,hasRegisteredAccount:n.hasRegisteredAccount===!0||r.hasRegisteredAccount===!0?!0:n.hasRegisteredAccount??r.hasRegisteredAccount,source:n.source==="registered"&&r.source==="import"||n.source==="import"&&r.source==="registered"||n.source==="both"||r.source==="both"?"both":n.source||r.source,accountUid:n.accountUid||r.accountUid,email:n.email||r.email})}),Array.from(a.values())}const eh=({onLogout:t,onOpenProfile:s,onOpenSettings:a})=>{const{currentUser:r,userProfile:o}=hs(),[n,i]=u.useState("dashboard"),[l,c]=u.useState(!1),[d,m]=u.useState(!1),[p,h]=u.useState(!1),[b,N]=u.useState(!1),[C,S]=u.useState(!1),[v,g]=u.useState(!1),[I,L]=u.useState(!1),R=["streak_reminder","daily_checkin","streak_milestone","achievement_unlocked","level_up","xp_earned","quiz_result"],{notifications:W}=xi(),f=W.filter(M=>!M.isRead&&!R.includes(M.type)).length,[k,w]=u.useState(null),[$,A]=u.useState(null),[y,q]=u.useState(!1),[J,re]=u.useState(!1),[le,ne]=u.useState(!1),[be,Ie]=u.useState(!1),[de,fe]=u.useState([]),[H,ee]=u.useState([]),oe=u.useMemo(()=>r?.uid?de.filter(M=>M.managerId===r.uid||M.classMetadata?.managerId===r.uid):de,[de,r?.uid]),[Re,Fe]=u.useState([]),[Pe,G]=u.useState(""),[te,E]=u.useState(!0),[Y,V]=u.useState(!1),[pe,D]=u.useState(0),[j,_]=u.useState([]),[T,Q]=u.useState(!1),[ue,ce]=u.useState(null),[ae,Ce]=u.useState(null),Ne=o?.name||"Teacher",Je=u.useRef(new Map);u.useEffect(()=>{const M=()=>N(window.innerWidth<1024);return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]),u.useEffect(()=>{if(!r)return;const M=r.uid;let O=!0,ve;return(async()=>{E(!0);try{const qe=await ol(M);let je=qe.map(Qx);const yt=await Ku(M).catch(()=>[]),it=new Map;yt.forEach(P=>{const X=lt(P.classSectionId);X&&it.set(X,P)}),je=je.map(P=>{const X=it.get(lt(P.classSectionId));if(!X)return P;const Ee=Ct({metadata:P.classMetadata,classSectionId:X.classSectionId||P.classSectionId,className:X.className||P.name,grade:X.grade||P.classMetadata?.grade,gradeLevel:X.gradeLevel||P.classMetadata?.gradeLevel,classification:X.classification||P.classMetadata?.classification,strand:X.strand||P.classMetadata?.strand,section:X.section||P.classMetadata?.section,schoolYear:X.schoolYear||P.classMetadata?.schoolYear,ownerTeacherId:X.ownerTeacherId||P.classMetadata?.ownerTeacherId,ownerTeacherName:X.ownerTeacherName||P.classMetadata?.ownerTeacherName,managerId:X.managerId||P.classMetadata?.managerId,managerName:X.managerName||P.classMetadata?.managerName});return{...P,name:Ee.className||P.name,classSectionId:Ee.classSectionId||P.classSectionId,classMetadata:Ee,gradeLevel:Ee.gradeLevel||P.gradeLevel,classification:Ee.classification||P.classification,strand:Ee.strand||P.strand,managerId:Ee.managerId||P.managerId,managerName:Ee.managerName||P.managerName}});const se=new Map,rt=new Map;qe.forEach(P=>{const X=Ct({metadata:P.classMetadata,classSectionId:P.classSectionId,className:P.name,grade:P.grade,gradeLevel:P.gradeLevel,classification:P.classification,strand:P.strand,section:P.section,schoolYear:P.schoolYear,ownerTeacherId:P.ownerTeacherId||P.teacherId,ownerTeacherName:P.ownerTeacherName,adviserTeacherId:P.adviserTeacherId||P.teacherId,adviserTeacherName:P.adviserTeacherName,managerId:P.managerId,managerName:P.managerName});se.set(P.id,X.className||P.name),rt.set(P.id,X);const Ee=lt(P.classSectionId);if(Ee){const Oe=it.get(Ee),Pt=Ct({metadata:X,classSectionId:Oe?.classSectionId||Ee,className:Oe?.className||X.className,grade:Oe?.grade||X.grade,gradeLevel:Oe?.gradeLevel||X.gradeLevel,classification:Oe?.classification||X.classification,strand:Oe?.strand||X.strand,section:Oe?.section||X.section,schoolYear:Oe?.schoolYear||X.schoolYear,ownerTeacherId:Oe?.ownerTeacherId||X.ownerTeacherId,ownerTeacherName:Oe?.ownerTeacherName||X.ownerTeacherName,managerId:Oe?.managerId||X.managerId,managerName:Oe?.managerName||X.managerName});se.set(Ee,Pt.className||P.name),rt.set(Ee,Pt)}});const nt=P=>{const X=lt(P.classSectionId||P.classroomId);if(!X)return P;const Ee=rt.get(X);if(!Ee)return P;const Oe=Ct({metadata:Ee,classSectionId:P.classSectionId||Ee.classSectionId,className:P.className||Ee.className,grade:P.grade||Ee.grade,gradeLevel:P.gradeLevel||Ee.gradeLevel,classification:P.classification||Ee.classification,strand:P.strand||Ee.strand,section:P.section||Ee.section,managerId:P.managerId||Ee.managerId,managerName:P.managerName||Ee.managerName});return{...P,className:Oe.className||P.className,grade:Oe.grade||P.grade,gradeLevel:Oe.gradeLevel||P.gradeLevel,classification:Oe.classification||P.classification,strand:Oe.strand||P.strand,section:Oe.section||P.section,classSectionId:Oe.classSectionId||P.classSectionId,classMetadata:Oe,managerId:Oe.managerId||P.managerId,managerName:Oe.managerName||P.managerName}},ut=(P,X,Ee)=>se.get(P)||(X?se.get(X):void 0)||Ee||"Unknown",ws=Array.from(new Set([...yt.map(P=>P.classSectionId),...qe.map(P=>P.classSectionId).filter(Boolean),...je.map(P=>P.classSectionId).filter(Boolean)].map(P=>(P||"").trim()).filter(P=>!!P))),[Ks,Ts]=await Promise.all([Nn(M).catch(P=>(console.warn("[TeacherDashboard] managed-student fetch failed:",P),[])),Gu(M,ws).catch(P=>(console.warn("[TeacherDashboard] registered-student fetch failed:",P),[]))]);let Fa=Ts;if(Ts.length===0&&Ks.length===0)try{const{collection:P,query:X,where:Ee,getDocs:Oe}=await ys(async()=>{const{collection:Bt,query:Ye,where:ha,getDocs:fa}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{collection:Bt,query:Ye,where:ha,getDocs:fa}},__vite__mapDeps([2,3])),{db:Pt}=await ys(async()=>{const{db:Bt}=await import("./index-D9TvEOZX.js").then(Ye=>Ye.b6);return{db:Bt}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),De=X(P(Pt,"users"),Ee("role","==","student"));Fa=(await Oe(De)).docs.map(Bt=>{const Ye=Bt.data();return{uid:Bt.id,name:String(Ye.name||Ye.displayName||"").trim()||"Student",email:String(Ye.email||"").trim(),lrn:Ye.lrn?String(Ye.lrn).trim():void 0,photo:Ye.photo?String(Ye.photo).trim():Ye.photoURL?String(Ye.photoURL).trim():void 0,grade:Ye.grade?String(Ye.grade).trim():void 0,section:Ye.section?String(Ye.section).trim():void 0,classSectionId:Ye.classSectionId?String(Ye.classSectionId).trim():void 0,adviserTeacherId:Ye.adviserTeacherId?String(Ye.adviserTeacherId).trim():void 0,role:"student",createdAt:Ye.createdAt||void 0}}).filter(Bt=>Bt.name!=="Student"||Bt.email)}catch(P){console.warn("[TeacherDashboard] fallback all-students fetch failed:",P)}const Xs=new Map,Bs=new Map,Oa=new Map;Ks.forEach(P=>{Xs.set(P.id,P),P.lrn&&Bs.set(P.lrn.trim().toLowerCase(),P);const X=Eo(P.name),Ee=lt(P.classSectionId||P.classroomId);X&&Oa.set(`${X}|${Ee}`,P)});const Pa=new Set,Ba=Fa.map(P=>{const X=Qu(P),Ee=(P.lrn||"").trim().toLowerCase(),Oe=Eo(P.name),Pt=lt(P.classSectionId);let De;if(Xs.has(P.uid))De=Xs.get(P.uid);else if(Ee&&Bs.has(Ee))De=Bs.get(Ee);else if(Oe){const Ye=`${Oe}|${Pt}`;De=Oa.get(Ye)}if(De){Pa.add(De.id);const Ye={...X,id:P.uid,accountUid:P.uid,email:X.email||De.email,lrn:X.lrn||De.lrn,name:X.name||De.name,avatar:X.avatar||De.avatar,riskLevel:De.riskLevel||X.riskLevel,avgQuizScore:De.avgQuizScore||X.avgQuizScore,engagementScore:De.engagementScore||X.engagementScore,attendance:De.attendance||X.attendance,assignmentCompletion:De.assignmentCompletion||X.assignmentCompletion,weakestTopic:De.weakestTopic||X.weakestTopic,struggles:De.struggles||X.struggles,lastActive:De.lastActive||X.lastActive,wri:De.wri??null,riskStatus:De.riskStatus??null,riskUpdatedAt:De.riskUpdatedAt??null,diagnosticScore:De.diagnosticScore??null,externalGradesAvg:De.externalGradesAvg??null,systemPerformanceAvg:De.systemPerformanceAvg??null,riskHistory:De.riskHistory,grade:X.grade||De.grade,gradeLevel:X.gradeLevel||De.gradeLevel,section:X.section||De.section,classSectionId:X.classSectionId||De.classSectionId,classroomId:X.classroomId||De.classroomId,classMetadata:De.classMetadata||X.classMetadata,hasRegisteredAccount:!0,source:"both"},ha=lt(Ye.classSectionId||Ye.classroomId),fa=ut(Ye.classroomId||"",ha,Ye.className);return nt(Br(Ye,fa))}const Ua=lt(X.classSectionId||X.classroomId),Bt=ut(X.classroomId||"",Ua,X.className);return nt(Br(X,Bt))}),Ha=Ks.filter(P=>!Pa.has(P.id)).map(P=>{const X={...P,hasRegisteredAccount:!1,source:"import"},Ee=lt(X.classSectionId||X.classroomId),Oe=ut(X.classroomId,Ee,X.className);return nt(Br(X,Oe))}),Hs=[...Ba,...Ha];if(!O)return;fe(P=>je.length===0&&P.length>0?P:je),ee(P=>Hs.length===0&&P.length>0?P:Hs),xt.getImportedClassOverview({limit:3e3,forceRefresh:pe>0}).then(P=>{O&&(P.warnings.length>0&&console.warn("Imported class overview warnings:",P.warnings.join(" ")),fe(X=>ri(X,P.classrooms.map(Vx))),ee(X=>{if(X.length===0)return X;const Ee=P.students.map(Wx),Oe=new Set;X.forEach(De=>Oe.add(fr(De)));const Pt=Ee.filter(De=>Oe.has(fr(De)));return Pt.length===0?X:ni(X,Pt)}))}).catch(P=>{console.warn("Imported class overview merge unavailable:",P)});const pa=qe.map(P=>P.id);pa.length>0&&(ve=Ju(pa,P=>{O&&Fe(P.map(X=>({id:X.id,student:X.studentName,action:X.action,topic:X.topic,time:yl(X.timestamp.toDate()),type:X.type})))}))}catch(qe){console.error("Failed to load teacher data:",qe),ie.error("Failed to load dashboard data")}finally{E(!1)}})(),()=>{O=!1,ve&&ve()}},[r,pe]),u.useEffect(()=>{if(!r)return;let M=!0;return Xu("",80).then(O=>{M&&_(O)}).catch(O=>{console.warn("Failed to load teacher directory options:",O)}),()=>{M=!1}},[r]),u.useEffect(()=>{if(H.length===0)return;(async()=>{if(H.length===0){G("");return}V(!0);try{const O=H.map(we=>({name:we.name,engagementScore:we.engagementScore,avgQuizScore:we.avgScore,attendance:we.attendance,riskLevel:we.riskLevel})),ve=await xt.getDailyInsight({students:O});G(ve.insight)}catch{G(`${H.filter(O=>O.riskLevel==="high").length} students are at high risk of falling behind. Review their progress in the analytics view.`)}finally{V(!1)}})()},[H]);const $e=de.reduce((M,O)=>M+O.studentCount,0),Ge=H.filter(M=>M.riskLevel==="high").length,ft=(()=>{const M=H.map(O=>O.avgScore).filter(O=>O>0);return M.length>0?Math.round(M.reduce((O,ve)=>O+ve,0)/M.length):0})(),Nt=[{name:"High Risk",value:H.filter(M=>M.riskLevel==="high").length,color:"#FF8B8B"},{name:"Medium Risk",value:H.filter(M=>M.riskLevel==="medium").length,color:"#F08386"},{name:"Low Risk",value:H.filter(M=>M.riskLevel==="low").length,color:"#75D06A"}],dt={};H.forEach(M=>{M.weakestTopic&&M.weakestTopic!=="N/A"&&(dt[M.weakestTopic]||(dt[M.weakestTopic]={total:0,sum:0}),dt[M.weakestTopic].total+=1,dt[M.weakestTopic].sum+=M.avgScore)});const jt=Object.entries(dt).map(([M,O])=>({topic:M,score:Math.round(O.sum/O.total)})).sort((M,O)=>M.score-O.score).slice(0,6),At=M=>{w(M),i("analytics")},rs=M=>{A(M),i("intervention")},Is=()=>{A(null),i("analytics")},bs=()=>{w(null),A(null),i("dashboard")},Ps=async(M,O)=>{if(!r){ie.error("Unable to assign manager: teacher context is missing.");return}const ve=xs(M.classMetadata?.className||M.name),we=Ct({metadata:M.classMetadata,classSectionId:M.classSectionId,className:M.name,grade:M.classMetadata?.grade||ve.grade,gradeLevel:M.classMetadata?.gradeLevel,classification:M.classMetadata?.classification,strand:M.classMetadata?.strand,section:M.classMetadata?.section||ve.section,schoolYear:M.classMetadata?.schoolYear||String(new Date().getFullYear()),ownerTeacherId:M.classMetadata?.ownerTeacherId||r.uid,ownerTeacherName:M.classMetadata?.ownerTeacherName||Ne,adviserTeacherId:M.classMetadata?.adviserTeacherId||r.uid,adviserTeacherName:M.classMetadata?.adviserTeacherName||Ne,managerId:O.uid,managerName:O.name}),qe=we.classSectionId||Ft(we.grade||ve.grade,we.section||ve.section);if(!qe){ie.error("Unable to assign manager: missing class section ID.");return}Q(!0);try{await il({classSectionId:qe,className:we.className||M.name,grade:we.grade||ve.grade,gradeLevel:we.gradeLevel||gs(we.grade||ve.grade)||we.grade||ve.grade,classification:we.classification||ma(we.gradeLevel||we.grade)||void 0,strand:we.strand||xa(we.className,we.section)||void 0,section:we.section||ve.section,schoolYear:we.schoolYear||String(new Date().getFullYear()),ownerTeacherId:we.ownerTeacherId||r.uid,ownerTeacherName:we.ownerTeacherName||Ne,managerId:O.uid,managerName:O.name});const je=Ct({metadata:we,classSectionId:qe,managerId:O.uid,managerName:O.name}),yt=lt(qe);fe(it=>it.map(se=>lt(se.classSectionId)!==yt?se:{...se,name:je.className||se.name,classSectionId:je.classSectionId||se.classSectionId,classMetadata:je,gradeLevel:je.gradeLevel||se.gradeLevel,classification:je.classification||se.classification,strand:je.strand||se.strand,managerId:O.uid,managerName:O.name})),ee(it=>it.map(se=>{if(lt(se.classSectionId||se.classroomId)!==yt)return se;const nt=Ct({metadata:se.classMetadata,classSectionId:je.classSectionId||se.classSectionId,className:se.className||je.className,grade:se.grade||je.grade,gradeLevel:se.gradeLevel||je.gradeLevel,classification:se.classification||je.classification,strand:se.strand||je.strand,section:se.section||je.section,managerId:O.uid,managerName:O.name});return{...se,classMetadata:nt,gradeLevel:nt.gradeLevel||se.gradeLevel,classification:nt.classification||se.classification,strand:nt.strand||se.strand,managerId:O.uid,managerName:O.name}})),w(it=>!it||lt(it.classSectionId)!==yt?it:{...it,classMetadata:je,managerId:O.uid,managerName:O.name,gradeLevel:je.gradeLevel||it.gradeLevel,classification:je.classification||it.classification,strand:je.strand||it.strand}),ie.success(`Assigned ${O.name} as section manager.`)}catch(je){console.error("Failed to assign class manager:",je),ie.error(je instanceof Error?je.message:"Failed to assign class manager")}finally{Q(!1)}},ns=u.useCallback(M=>{ce({rosterId:M.id,name:M.name,lrn:M.lrn,email:M.email,grade:M.grade,section:M.section,classSectionId:M.classSectionId})},[]),vs=u.useCallback(M=>{ee(O=>O.map(ve=>ve.id===M.rosterId?{...ve,hasRegisteredAccount:!0,source:"both",accountUid:M.uid,email:M.email||ve.email}:ve)),D(O=>O+1)},[]),os=u.useCallback(async(M,O)=>{if(!r){ie.error("Cannot reassign section without an authenticated teacher.");return}const ve=r.uid,we=(O.classSectionId||"").trim();if(!we){ie.error("Pick a target section first.");return}Ce(M.id);try{await Vu({studentId:M.accountUid||M.id,isRegisteredAccount:!!M.hasRegisteredAccount,newClassSectionId:we,newGrade:O.grade,newSection:O.section,previousClassSectionId:M.classSectionId,teacherId:ve,teacherName:Ne,schoolYear:M.classMetadata?.schoolYear||String(new Date().getFullYear())}),ee(qe=>qe.map(je=>{if(je.id!==M.id)return je;const yt=Ct({metadata:je.classMetadata,classSectionId:we,className:je.className,grade:O.grade,section:O.section});return{...je,grade:O.grade,section:O.section,classSectionId:we,classroomId:we,classMetadata:yt}})),ie.success(`Moved ${M.name} to ${O.grade} - ${O.section}.`)}catch(qe){console.error("Section reassignment failed:",qe),ie.error(qe instanceof Error?qe.message:"Failed to reassign section.")}finally{Ce(null)}},[r,Ne]),z=u.useCallback(async M=>{if(!r||!window.confirm(`Remove ${M.name} from this class? This cannot be undone.`))return;const O=M.classSectionId||M.classroomId||"";if(!O){ie.error("Cannot determine class section for this student.");return}try{await qu(M.accountUid||M.id,O),ee(ve=>ve.filter(we=>we.id!==M.id)),ie.success(`Removed ${M.name} from class.`)}catch(ve){console.error("Remove student failed:",ve),ie.error("Failed to remove student.")}},[r]);u.useEffect(()=>{const M=()=>{const O=window.innerWidth<1024;N(O),O?c(!1):h(!1)};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]),u.useEffect(()=>{b&&h(!1)},[n,b]);const me=M=>{i(M),w(null),A(null)},We=u.useMemo(()=>{if(!k)return;if(k.classMetadata?.classSectionId)return k.classMetadata.classSectionId||void 0;if(k.classSectionId)return k.classSectionId;const M=xs(k.classMetadata?.className||k.name);return Ft(M.grade,M.section)||void 0},[k]),B=u.useMemo(()=>k||null,[k]),kt=u.useMemo(()=>{if(!B)return;const M=de.findIndex(O=>O.id===B.id);return pr[Math.max(0,M)%pr.length]},[B,de]),Me=u.useMemo(()=>{if(!B)return H;const M=(B.id||"").trim().toLowerCase(),O=lt(B.classSectionId),ve=(B.name||"").trim().toLowerCase();return H.filter(we=>{const qe=lt(we.classroomId),je=lt(we.classSectionId),yt=(we.className||"").trim().toLowerCase();return O&&(je===O||qe===O)||M&&(qe===M||je===M)||ve&&yt===ve})},[B,H]);return te?e.jsx(Bl,{message:"Loading dashboard..."}):e.jsxs("div",{className:"relative flex h-screen w-full bg-background overflow-hidden",children:[b&&p&&e.jsx("button",{"aria-label":"Close navigation",className:"fixed inset-0 z-30 bg-slate-900/40 backdrop-blur-[1px]",onClick:()=>h(!1)}),e.jsxs(ze.aside,{initial:!1,animate:{width:b?280:l&&!d?80:280,x:b?p?0:-300:0},transition:{type:"spring",stiffness:360,damping:34},onMouseEnter:()=>!b&&l&&m(!0),onMouseLeave:()=>m(!1),className:"fixed inset-y-0 left-0 z-40 bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] flex flex-col shadow-sm lg:static lg:z-auto p-5",children:[e.jsxs("div",{className:`mb-8 flex items-center ${l&&!d?"justify-center":"justify-between"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-[#7274ED] to-[#9956DE] rounded-2xl flex items-center justify-center shadow-md flex-shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"MathPulse AI",className:"w-10 h-10 object-contain drop-shadow-md"})}),(!l||d)&&e.jsx("div",{children:e.jsx("h1",{className:"text-base font-semibold font-display text-[#0a1628] whitespace-nowrap",children:"MathPulse AI"})})]}),!b&&(!l||d)&&e.jsx(ze.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>c(!l),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":l?"Expand sidebar":"Collapse sidebar",children:l?e.jsx(Rs,{size:20}):e.jsx(zs,{size:20})}),b&&e.jsx("button",{onClick:()=>h(!1),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":"Close navigation",children:e.jsx(Xt,{size:20})})]}),e.jsxs("nav",{className:"flex-1 space-y-5",children:[e.jsxs("div",{children:[l&&!d?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-semibold text-[#5a6578] uppercase tracking-widest",children:"Overview"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(_s,{icon:Zl,label:"Dashboard",active:n==="dashboard",collapsed:l&&!d,onClick:bs,forceExpanded:b}),e.jsx(_s,{icon:As,label:"Class Analytics",active:n==="analytics"||n==="intervention",collapsed:l&&!d,onClick:()=>me("analytics"),forceExpanded:b})]})]}),e.jsxs("div",{children:[l&&!d?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-semibold text-[#5a6578] uppercase tracking-widest",children:"Students"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(_s,{icon:ms,label:"Topic Mastery",active:n==="topic_mastery",collapsed:l&&!d,onClick:()=>me("topic_mastery"),forceExpanded:b}),e.jsx(_s,{icon:us,label:"Competency",active:n==="competency",collapsed:l&&!d,onClick:()=>me("competency"),forceExpanded:b})]})]}),e.jsxs("div",{children:[l&&!d?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):e.jsx("p",{className:"px-4 mb-2 text-[10px] font-semibold text-[#5a6578] uppercase tracking-widest",children:"Tools"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(_s,{icon:ec,label:"Data Import",active:n==="import",collapsed:l&&!d,onClick:()=>i("import"),forceExpanded:b}),e.jsx(_s,{icon:Wr,label:"AI Quiz Maker",active:n==="quiz_maker",collapsed:l&&!d,onClick:()=>i("quiz_maker"),forceExpanded:b}),e.jsx(_s,{icon:Gt,label:"Question Bank",active:n==="question_bank",collapsed:l&&!d,onClick:()=>i("question_bank"),forceExpanded:b}),e.jsx(_s,{icon:rr,label:"Calendar",active:n==="calendar",collapsed:l&&!d,onClick:()=>i("calendar"),forceExpanded:b})]})]})]}),e.jsxs("div",{className:"space-y-2 border-t border-[#dde3eb] pt-4",children:[e.jsxs(ze.button,{whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-[#5a6578] font-semibold border border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628] transition-all duration-200 whitespace-nowrap ${l&&!d?"justify-center":""}`,onClick:a,title:l&&!d?"Settings":"",children:[e.jsx(tc,{size:18,strokeWidth:2,className:"flex-shrink-0"}),(!l||d)&&e.jsx("span",{className:"font-body text-xs",children:"Settings"})]}),e.jsx("div",{className:"text-[#5a6578]",children:e.jsx(sc,{onClick:()=>S(!0),collapsed:l&&!d})})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden bg-gradient-to-br from-[#eef2ff] via-[#f5f3ff] to-[#fff7ed]",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[["dashboard","analytics","intervention","competency","topic_mastery","calendar","notifications","question_bank","import","quiz_maker"].includes(n)&&e.jsx("header",{className:"bg-transparent border-b border-[#e2e8f0]/40 px-[24px] xl:px-[32px] pt-[24px] pb-[16px] flex-shrink-0 z-30",children:e.jsxs("div",{className:"flex flex-row items-center justify-between gap-2 mb-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[b&&e.jsx("button",{onClick:()=>h(!0),className:"mt-1 p-2 rounded-lg border border-border text-muted-foreground hover:text-[#9956DE] hover:border-[#9956DE]/30 hover:bg-[#9956DE]/12 transition-colors","aria-label":"Open navigation",children:e.jsx(Hl,{size:18})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-lg sm:text-[26px] font-bold text-[#1e293b] tracking-tight leading-tight truncate",children:[n==="dashboard"&&"Teacher Dashboard",n==="analytics"&&"Class Analytics",n==="intervention"&&"Intervention Center",n==="competency"&&"Student Competency",n==="topic_mastery"&&"Topic Mastery",n==="calendar"&&"Academic Calendar",n==="notifications"&&"Notifications",n==="question_bank"&&"Question Bank",n==="import"&&"Data Import",n==="quiz_maker"&&"AI Quiz Maker"]}),e.jsxs("p",{className:"text-[13px] text-[#64748b] mt-1",children:[n==="dashboard"&&`Welcome back, ${Ne}`,n==="analytics"&&"Analyze performance and risk across your classes.",n==="intervention"&&"Identify and support students who need immediate help.",n==="competency"&&"Track individual student progress against learning goals.",n==="topic_mastery"&&"Overview of student mastery levels across different math topics.",n==="calendar"&&"Manage your schedules and academic events.",n==="notifications"&&"Stay updated with student activity and system alerts.",n==="question_bank"&&"Manage and create math questions for your quizzes.",n==="import"&&"Upload class records and materials to power AI analytics.",n==="quiz_maker"&&"Create AI-powered quizzes based on your curriculum."]})]}),n==="dashboard"&&e.jsxs("div",{className:"hidden xl:flex items-center gap-2 ml-4 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#9956DE]/12 border border-[#9956DE]/30 rounded-lg",children:[e.jsx(us,{size:13,className:"text-[#9956DE]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#9956DE]",children:[$e," students"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#F08386]/12 border border-[#F08386]/30 rounded-lg",children:[e.jsx(la,{size:13,className:"text-[#F08386]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#C65E63]",children:[Ge," at risk"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#75D06A]/14 border border-[#75D06A]/35 rounded-lg",children:[e.jsx(ia,{size:13,className:"text-[#75D06A]"}),e.jsxs("span",{className:"text-xs font-display font-semibold text-[#4D9F46]",children:[ft,"% avg"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("div",{className:"relative group",children:[e.jsxs("button",{onClick:()=>{re(!0),q(!0)},className:"relative w-10 h-10 flex items-center justify-center bg-[#eef2ff]/80 hover:bg-[#e0e7ff] rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#a5b4fc]/60 text-[#4f46e5] hover:border-[#818cf8] transition-colors cursor-pointer hover:scale-[1.02]","aria-label":"View AI Insight",children:[e.jsx(ps,{size:18}),!y&&Pe&&e.jsx("div",{className:"absolute top-2.5 right-2.5 w-2 h-2 bg-rose-500 rounded-full border border-white animate-pulse"})]}),e.jsx("span",{className:"absolute -bottom-8 left-1/2 -translate-x-1/2 text-[10px] bg-[#1e293b] text-white px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-50 pointer-events-none",children:"AI Insight"})]}),b&&n==="dashboard"&&e.jsx("button",{onClick:()=>Ie(M=>!M),className:`relative w-10 h-10 flex items-center justify-center rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border transition-colors cursor-pointer hover:scale-[1.02] ${be?"bg-[#818cf8] border-[#6366f1] text-white":"bg-white/60 hover:bg-white/80 border-white/50 text-[#64748b] hover:text-[#1e293b]"}`,"aria-label":be?"Close calendar panel":"Open calendar panel",title:be?"Close calendar":"View calendar",children:e.jsx(rr,{size:18})}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>ne(!le),className:"relative w-10 h-10 flex items-center justify-center bg-white/60 hover:bg-white/80 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50 text-[#64748b] hover:text-[#1e293b] transition-colors cursor-pointer hover:scale-[1.02]","aria-label":"View notifications",title:"Notifications",children:[e.jsx(cr,{size:18}),f>0&&e.jsx("span",{className:"absolute top-2.5 right-2.5 w-2 h-2 bg-rose-500 rounded-full border border-white"})]}),e.jsx(Xl,{isOpen:le,onClose:()=>ne(!1),onViewAll:()=>i("notifications")})]}),n!=="dashboard"&&e.jsxs("div",{onClick:s,className:"flex items-center gap-2 bg-white/60 px-4 py-2 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50 cursor-pointer hover:bg-white/80 transition-colors h-10 hover:scale-[1.02]",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-indigo-100 overflow-hidden shrink-0",children:e.jsx("img",{src:o?.photo||`https://ui-avatars.com/api/?name=${encodeURIComponent(Ne)}&background=e0e7ff&color=4f46e5`,alt:"Profile",className:"w-full h-full object-cover"})}),e.jsx("span",{className:"text-[13px] font-semibold text-[#1e293b]",children:Ne})]})]})]})}),e.jsx("main",{className:`flex-1 flex flex-col ${n==="intervention"||n==="analytics"?"overflow-hidden":"overflow-y-auto"}`,children:e.jsxs(zt,{mode:"wait",children:[n==="dashboard"&&e.jsx(Xx,{classes:oe,liveActivity:Re,onViewClass:At,onViewAllClasses:()=>i("analytics"),onViewActivityStudent:M=>{const O=H.find(ve=>ve.name===M);O&&rs(O)},dailyInsight:Pe,insightLoading:Y,isInsightDismissed:y,onDismissInsight:()=>q(!0),onOpenInsightModal:()=>{re(!0),q(!0)},totalStudents:$e,totalAtRisk:Ge,avgPerformance:ft,onCreateClass:()=>g(!0)}),n==="analytics"&&B&&e.jsx(ep,{selectedClass:B,students:Me,allClasses:de,riskDistribution:Nt,topicPerformance:jt,onViewStudent:rs,onCreateAccount:ns,onReassignSection:os,reassignBusyId:ae,onBack:()=>w(null),teacherOptions:j,managerUpdating:T,onAssignManager:M=>Ps(B,M),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,classColor:kt,insightDismissed:y,onOpenInsightModal:()=>re(!0),onAddStudents:()=>L(!0),onRemoveStudent:z}),n==="analytics"&&!B&&oe.length>0&&e.jsx(Vo,{classes:oe,onSelectClass:At,onOpenNotifications:()=>i("notifications"),onOpenProfile:s,insightDismissed:y,onOpenInsightModal:()=>re(!0),onCreateClass:()=>g(!0)}),n==="analytics"&&!B&&oe.length===0&&e.jsx(ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-sm max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#9956DE]/20 text-[#9956DE] flex items-center justify-center mb-4",children:e.jsx(As,{size:24})}),e.jsx("h2",{className:"text-2xl font-display font-semibold text-foreground mb-2",children:"Class Analytics"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body leading-relaxed mb-4",children:"No classes available yet. Create a class or import class records to unlock analytics views."}),e.jsxs(St,{onClick:()=>g(!0),className:"bg-[#9956DE] hover:bg-[#7c3aed] text-white",children:[e.jsx(ca,{size:16,className:"mr-1.5"}),"Create Class"]})]})}),n==="intervention"&&$&&e.jsx(tp,{student:$,teacherId:r?.uid||"",teacherName:Ne,initialCache:Je.current.get($.id),onCacheUpdate:(M,O)=>Je.current.set(M,O),onStudentUpdated:M=>{const O=$?on($):null;A(M),ee(ve=>ve.map(we=>{const qe=on(we),je=O?qe===O:!1,yt=we.id===M.id&<(we.classSectionId)===lt(M.classSectionId);return je||yt?M:we}))},onBack:Is,onNavigateToQuizMaker:M=>{i("quiz_maker"),M&&sessionStorage.setItem("quizMakerInitialTab",M)}}),n==="topic_mastery"&&e.jsx(jm,{classSectionId:We,onOpenNotifications:()=>i("notifications"),onOpenProfile:s}),n==="competency"&&B&&e.jsx(Cm,{classSectionId:We,className:k?.name,fallbackStudents:H,onBack:()=>w(null),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,insightDismissed:y,onOpenInsightModal:()=>re(!0)}),n==="competency"&&!B&&de.length>0&&e.jsx(Vo,{classes:oe,onSelectClass:M=>w(M),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,insightDismissed:y,onOpenInsightModal:()=>re(!0),viewType:"competency"}),n==="competency"&&!B&&de.length===0&&e.jsx(Kx,{icon:us,title:"Student Competency",description:"No classes available yet. Import class records to view competency breakdowns."}),n==="import"&&e.jsxs(e.Fragment,{children:[e.jsx(Ox,{classSectionId:We,className:k?.name,classMetadata:k?.classMetadata,students:H,classes:oe.map(M=>({id:M.id,name:M.name,classSectionId:M.classSectionId})),teacherId:r?.uid||"",teacherName:Ne,onStudentsUpdated:M=>ee(M),onBackToClasses:()=>i("dashboard"),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,onOpenInsightModal:()=>{re(!0),q(!0)},userPhoto:o?.photo,onImportedClassRecords:M=>{const O=M.students.map(se=>Yx(se,M.classSectionId,M.className,M.classMetadata)),ve=Ct({metadata:M.classMetadata,classSectionId:M.classSectionId,className:M.className}),we=ve.classSectionId||"imported_class",qe=ve.className||"Imported Class",je=O.filter(se=>se.riskLevel==="high").length,yt=O.length>0?Math.round(O.reduce((se,rt)=>se+rt.avgScore,0)/O.length):0,it={id:we,name:qe,classSectionId:we,classMetadata:{...ve,classSectionId:we,className:qe},schedule:"Mon-Fri",studentCount:O.length,avgScore:yt,atRiskCount:je,riskLevel:je>=5?"high":je>=2?"medium":"low"};ee(se=>ni(se,O)),fe(se=>ri(se,[it]))},onDataChanged:()=>D(M=>M+1)}),e.jsx("div",{className:"mt-6",children:e.jsx(Bx,{teacherId:r?.uid||""})})]}),n==="notifications"&&e.jsx(Tm,{liveActivity:Re,atRiskStudents:H.filter(M=>M.riskLevel==="high").map(M=>({name:M.name,riskLevel:M.riskLevel,weakestTopic:M.weakestTopic})),onOpenNotifications:()=>i("notifications"),onOpenProfile:s,onOpenInsightModal:()=>{re(!0),q(!0)},userPhoto:o?.photo,teacherName:Ne}),n==="calendar"&&e.jsx(Hm,{classes:de,teacherId:r?.uid}),n==="quiz_maker"&&e.jsx(xl,{onBack:()=>{const M=sessionStorage.getItem("quizMakerReturnTo");sessionStorage.removeItem("quizMakerReturnTo"),sessionStorage.removeItem("quizMakerInitialTab"),i(M==="intervention"?"intervention":"dashboard")},onOpenNotifications:()=>i("notifications"),onOpenProfile:s,onOpenInsightModal:()=>{re(!0),q(!0)},userPhoto:o?.photo,teacherName:Ne}),n==="question_bank"&&e.jsx(wm,{onOpenNotifications:()=>i("notifications"),onOpenProfile:s,onOpenInsightModal:()=>{re(!0),q(!0)},userPhoto:o?.photo,teacherName:Ne})]})})]}),n==="dashboard"&&!b&&e.jsx(ii,{onViewCalendar:()=>i("calendar"),onOpenProfile:s,userProfile:o,teacherName:Ne,liveActivity:Re})]}),e.jsx(zt,{children:b&&n==="dashboard"&&be&&e.jsxs(e.Fragment,{children:[e.jsx(ze.button,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-40 bg-slate-900/40 backdrop-blur-[2px]","aria-label":"Close calendar panel",onClick:()=>Ie(!1)},"cal-backdrop"),e.jsx(ze.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",stiffness:320,damping:32},className:"fixed top-0 right-0 bottom-0 z-50 w-[300px] max-w-[85vw] shadow-2xl",children:e.jsx(ii,{onViewCalendar:()=>{i("calendar"),Ie(!1)},onOpenProfile:()=>{s?.(),Ie(!1)},userProfile:o,teacherName:Ne,liveActivity:Re})},"cal-drawer")]})}),e.jsx(zt,{children:J&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs(ze.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-2xl shadow-xl w-full max-w-lg overflow-hidden border border-slate-200",children:[e.jsxs("div",{className:"p-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/50",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600",children:e.jsx(ps,{size:16})}),e.jsx("h3",{className:"font-semibold text-slate-800",children:"Detailed AI Insight"})]}),e.jsx("button",{onClick:()=>{re(!1)},className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors",children:e.jsx(Xt,{size:18})})]}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"text-sm text-slate-600 leading-relaxed",children:e.jsx(yc,{children:Pe?.replace(/[*_]*\s*\(?Word\s*count\s*:\s*[*_]*\s*\d+\)?\s*[*_]*/gi,"").trim()||`**${Ge} students (${$e>0?Math.round(Ge/$e*100):0}%)** are currently at high risk of falling behind in recent topics. Review their progress in the analytics view to plan interventions.`})})}),e.jsx("div",{className:"p-4 border-t border-slate-100 bg-slate-50 flex justify-end gap-2",children:e.jsx("button",{onClick:()=>{re(!1)},className:"px-4 py-2 text-sm font-medium text-slate-600 hover:text-slate-800 hover:bg-slate-200 rounded-lg transition-colors",children:"Minimize to Menu"})})]})})}),e.jsx(Vl,{isOpen:C,onClose:()=>S(!1),onConfirm:t,title:"Logout",message:"Are you sure you want to logout?",confirmText:"Logout",cancelText:"Cancel"}),e.jsx(Zu,{open:v,onClose:()=>g(!1),onCreated:()=>D(M=>M+1),teacherName:Ne}),e.jsx(em,{open:I,onClose:()=>L(!1),onAdded:()=>D(M=>M+1),grade:B?.gradeLevel||B?.classMetadata?.grade||"Grade 11",section:B?.classMetadata?.section||B?.name?.split(" - ")[1]||"",teacherName:Ne,existingStudentUids:Me.map(M=>M.id)}),e.jsx(Gx,{isOpen:!!ue,onClose:()=>ce(null),seed:ue,adviserTeacherId:r?.uid||"",adviserTeacherName:Ne,schoolYear:ue?H.find(M=>M.id===ue.rosterId)?.classMetadata?.schoolYear||String(new Date().getFullYear()):void 0,onCreated:vs})]})},_s=({icon:t,label:s,active:a,collapsed:r,forceExpanded:o=!1,onClick:n})=>e.jsxs(ze.button,{onClick:n,whileHover:{x:2},whileTap:{scale:.98},className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl cursor-pointer transition-all duration-200 border whitespace-nowrap ${r&&!o?"justify-center":""} ${a?"bg-[#9956DE]/12 border-[#9956DE]/30 shadow-sm text-[#9956DE]":"bg-transparent border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]"}`,children:[e.jsx(t,{size:18,strokeWidth:a?2.5:2,className:"flex-shrink-0"}),(!r||o)&&e.jsx("span",{className:"font-body font-semibold text-xs",children:s}),a&&!r&&e.jsx(ze.div,{layoutId:"sidebar-active-indicator",className:"ml-auto w-2 h-2 rounded-full bg-[#9956DE]",transition:{type:"spring",duration:.4}})]}),Kx=({icon:t,title:s,description:a})=>e.jsx(ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-6",children:e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-sm max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#9956DE]/20 text-[#9956DE] flex items-center justify-center mb-4",children:e.jsx(t,{size:24})}),e.jsx("h2",{className:"text-2xl font-display font-semibold text-foreground mb-2",children:s}),e.jsx("p",{className:"text-sm text-muted-foreground font-body leading-relaxed",children:a})]})}),Xx=({classes:t,liveActivity:s,onViewClass:a,onViewAllClasses:r,onViewActivityStudent:o,dailyInsight:n,insightLoading:i,isInsightDismissed:l,onDismissInsight:c,onOpenInsightModal:d,totalStudents:m,totalAtRisk:p,avgPerformance:h,onCreateClass:b})=>{const N=m>0?Math.round(p/m*100):0,C=m>0?Math.round((m-p)/m*100):0;return e.jsxs(ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-3 sm:p-6 space-y-4",children:[!l&&n&&e.jsxs("div",{onClick:d,className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] border border-white p-[14px_16px] sm:p-[18px_20px] flex flex-col sm:flex-row items-start sm:items-center gap-3 sm:gap-4 shadow-[0_1px_4px_rgba(0,0,0,0.04)] cursor-pointer hover:shadow-md transition-shadow group",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsx("div",{className:"absolute -inset-[5px] rounded-full border-2 border-[#a5b4fc] opacity-50 animate-pulse"}),e.jsx("div",{className:"w-[46px] h-[46px] rounded-full bg-[#eef2ff] border-2 border-[#c7d2fe] flex items-center justify-center text-[#4f46e5] text-xl relative overflow-hidden group-hover:scale-[1.05] transition-transform",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Mascot",className:"w-[85%] h-[85%] object-contain"})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"text-[13.5px] font-semibold text-[#1e1b4b] flex flex-wrap items-center gap-2 mb-1",children:[e.jsx(ps,{size:14,className:"text-[#818cf8]"}),"MathPulse AI insight",e.jsx("span",{className:"bg-[#fee2e2] text-[#b91c1c] text-[10px] font-semibold px-2 py-0.5 rounded-full border border-[#fca5a5]",children:"Attention needed"})]}),e.jsx("div",{className:"text-[12.5px] text-[#475569] leading-[1.55]",children:"Some students may be at risk of falling behind. Click to view detailed analysis."})]}),e.jsxs("div",{className:"flex gap-2 flex-shrink-0 self-end sm:self-auto",children:[e.jsx("button",{onClick:S=>{S.stopPropagation(),c()},className:"px-[15px] py-[7px] rounded-[10px] text-xs font-medium cursor-pointer border border-[#e2e8f0] bg-white text-[#475569] hover:bg-[#f8fafc] transition-colors",children:"Dismiss"}),e.jsx("button",{onClick:S=>{S.stopPropagation(),r()},className:"px-[15px] py-[7px] rounded-[10px] text-xs font-medium cursor-pointer border border-[#4f46e5] bg-[#4f46e5] text-white shadow-[0_2px_8px_rgba(79,70,229,0.13)] hover:bg-[#4338ca] transition-colors",children:"Review students"})]})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-1.5 sm:gap-3",children:[e.jsxs("div",{className:"group relative overflow-hidden bg-[#10b981] shadow-[0_4px_16px_rgba(16,185,129,0.13)] rounded-sm sm:rounded-lg p-[10px] sm:p-[15px] text-white flex flex-col gap-[6px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[9px] sm:text-[11px] opacity-90 leading-tight",children:"Total students"}),e.jsx("div",{className:"hidden sm:flex bg-white/20 p-1.5 rounded-lg",children:e.jsx(us,{size:15})})]}),e.jsx("div",{className:"relative z-10 text-[18px] sm:text-[26px] font-semibold tracking-tight",children:m}),e.jsxs("div",{className:"relative z-10 border-t border-white/30 pt-1.5 sm:pt-2 flex justify-between items-center text-[9px] sm:text-[10px] opacity-90",children:[e.jsx("span",{className:"hidden sm:block",children:"Added this year"}),e.jsx("span",{className:"bg-black/15 px-[5px] sm:px-[7px] py-[2px] rounded font-semibold",children:m>0?"+1":"0"})]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#0ea5e9] shadow-[0_4px_16px_rgba(14,165,233,0.13)] rounded-sm sm:rounded-lg p-[10px] sm:p-[15px] text-white flex flex-col gap-[6px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[9px] sm:text-[11px] opacity-90 leading-tight",children:"Class average"}),e.jsx("div",{className:"hidden sm:flex bg-white/20 p-1.5 rounded-lg",children:e.jsx(ms,{size:15})})]}),e.jsxs("div",{className:"relative z-10 text-[18px] sm:text-[26px] font-semibold tracking-tight",children:[h,"%"]}),e.jsxs("div",{className:"relative z-10 border-t border-white/30 pt-1.5 sm:pt-2 flex justify-between items-center text-[9px] sm:text-[10px] opacity-90",children:[e.jsx("span",{className:"hidden sm:block",children:"Vs. last month"}),e.jsx("span",{className:"bg-black/15 px-[5px] sm:px-[7px] py-[2px] rounded font-semibold",children:"+2.5%"})]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#a855f7] shadow-[0_4px_16px_rgba(168,85,247,0.13)] rounded-sm sm:rounded-lg p-[10px] sm:p-[15px] text-white flex flex-col gap-[6px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[9px] sm:text-[11px] opacity-90 leading-tight",children:"Engage­ment"}),e.jsx("div",{className:"hidden sm:flex bg-white/20 p-1.5 rounded-lg",children:e.jsx(fi,{size:15})})]}),e.jsxs("div",{className:"relative z-10 text-[18px] sm:text-[26px] font-semibold tracking-tight",children:[C,"%"]}),e.jsxs("div",{className:"relative z-10 border-t border-white/30 pt-1.5 sm:pt-2 flex justify-between items-center text-[9px] sm:text-[10px] opacity-90",children:[e.jsx("span",{className:"hidden sm:block",children:"Active participants"}),e.jsx("span",{className:"bg-black/15 px-[5px] sm:px-[7px] py-[2px] rounded font-semibold",children:Math.round(C/100*m)})]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#f97316] shadow-[0_4px_16px_rgba(249,115,22,0.13)] rounded-sm sm:rounded-lg p-[10px] sm:p-[15px] text-white flex flex-col gap-[6px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[9px] sm:text-[11px] opacity-90 leading-tight",children:"At risk"}),e.jsx("div",{className:"hidden sm:flex bg-white/20 p-1.5 rounded-lg",children:e.jsx(gr,{size:15})})]}),e.jsx("div",{className:"relative z-10 text-[18px] sm:text-[26px] font-semibold tracking-tight",children:p}),e.jsxs("div",{className:"relative z-10 border-t border-white/30 pt-1.5 sm:pt-2 flex justify-between items-center text-[9px] sm:text-[10px] opacity-90",children:[e.jsx("span",{className:"hidden sm:block",children:"Requires attention"}),e.jsxs("span",{className:"bg-black/15 px-[5px] sm:px-[7px] py-[2px] rounded font-semibold",children:[N,"%"]})]})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] border border-white p-[18px_20px] shadow-[0_1px_4px_rgba(0,0,0,0.04)]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-[14px]",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-[#1e293b]",children:"My classes"}),e.jsx("span",{onClick:r,className:"text-[12px] text-[#10b981] font-semibold cursor-pointer hover:underline",children:"View all"})]}),e.jsxs("div",{className:"space-y-[9px]",children:[t.length===0&&e.jsxs("div",{className:"text-center py-4",children:[e.jsx("p",{className:"text-sm text-slate-500 mb-3",children:"No classes imported yet."}),b&&e.jsx("button",{onClick:b,className:"text-sm text-[#9956DE] font-semibold hover:underline",children:"+ Create a class"})]}),t.map((S,v)=>{const g=[{bg:"bg-[#f3e8ff]",text:"text-[#a855f7]",borderHover:"hover:border-[#d8b4fe]",stripe:"bg-[#a855f7]"},{bg:"bg-[#eff6ff]",text:"text-[#3b82f6]",borderHover:"hover:border-[#bfdbfe]",stripe:"bg-[#3b82f6]"},{bg:"bg-[#f0fdf4]",text:"text-[#22c55e]",borderHover:"hover:border-[#bbf7d0]",stripe:"bg-[#22c55e]"},{bg:"bg-[#fff7ed]",text:"text-[#f97316]",borderHover:"hover:border-[#fed7aa]",stripe:"bg-[#f97316]"},{bg:"bg-[#fff1f2]",text:"text-[#f43f5e]",borderHover:"hover:border-[#fecdd3]",stripe:"bg-[#f43f5e]"}],I=g[v%g.length];return e.jsxs("div",{onClick:()=>a(S),className:`relative overflow-hidden flex items-center gap-3 p-[12px_13px] pl-[16px] border border-[#f1f5f9] rounded-[14px] cursor-pointer ${I.borderHover} hover:shadow-[0_2px_10px_rgba(0,0,0,0.04)] hover:bg-[#fafbff] transition-all group`,children:[e.jsx("div",{className:`absolute left-0 top-0 bottom-0 w-[5px] ${I.stripe}`}),e.jsx("div",{className:`w-[38px] h-[38px] rounded-[10px] flex items-center justify-center flex-shrink-0 text-[17px] ${I.bg} ${I.text} group-hover:scale-110 transition-transform duration-300`,children:e.jsx(Gt,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[12.5px] font-medium text-[#1e293b]",children:S.name}),e.jsx("div",{className:"text-[11px] text-[#94a3b8] mt-[1px]",children:S.classification||"High School"})]}),e.jsx("div",{className:"hidden sm:block text-[12px] text-[#64748b] min-w-[65px]",children:S.schedule||"Mon-Fri"}),e.jsxs("div",{className:"hidden sm:block text-[12px] text-[#64748b] min-w-[85px]",children:[S.studentCount," students"]}),e.jsx("span",{className:`text-[10px] font-semibold px-[9px] py-[3px] rounded-[6px] ${S.riskLevel==="high"?"bg-[#fee2e2] text-[#b91c1c] border border-[#fca5a5]":S.riskLevel==="medium"?"bg-[#fffbeb] text-[#b45309] border border-[#fcd34d]":"bg-[#ecfdf5] text-[#065f46] border border-[#6ee7b7]"}`,children:S.riskLevel==="high"?"High risk":S.riskLevel==="medium"?"Medium risk":"On track"}),e.jsx(qr,{size:16,className:"text-[#cbd5e1] ml-auto hover:text-[#64748b]"})]},S.id)})]})]})]})},Jx=he.memo(({student:t,onViewStudent:s,onCreateAccount:a,onRemoveStudent:r})=>{const n=t.riskLevel==="high"?{borderLeft:"border-l-rose-500",bgAvatar:"bg-rose-50 text-rose-600 border-rose-100/50",badge:"text-rose-600 bg-rose-50",progress:"bg-rose-500"}:t.riskLevel==="medium"?{borderLeft:"border-l-amber-500",bgAvatar:"bg-amber-50 text-amber-600 border-amber-100/50",badge:"text-amber-600 bg-amber-50",progress:"bg-amber-500"}:{borderLeft:"border-l-emerald-500",bgAvatar:"bg-emerald-50 text-emerald-600 border-emerald-100/50",badge:"text-emerald-600 bg-emerald-50",progress:"bg-emerald-500"},i=t.hasRegisteredAccount===!1&&t.source==="import",l=t.hasRegisteredAccount===!0;return e.jsxs("div",{onClick:()=>s(t),className:`p-[12px] bg-white rounded-[14px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#f1f5f9] border-l-[4px] ${n.borderLeft} hover:scale-[1.02] transition-transform cursor-pointer group flex flex-col justify-between`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-[10px]",children:[e.jsxs("div",{className:"flex gap-[8px] items-center min-w-0 pr-2",children:[t.avatar?e.jsx("img",{src:t.avatar,alt:t.name,className:`w-8 h-8 rounded-full border ${n.bgAvatar.split(" ")[2]} object-cover shrink-0`}):e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center font-semibold text-[11px] shrink-0 border ${n.bgAvatar}`,children:t.name.substring(0,2).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("p",{className:"text-[13px] font-semibold text-[#1e293b] leading-tight truncate",children:t.name}),l&&e.jsx("span",{title:"Registered student account",className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0"})]}),e.jsxs("p",{className:"text-[10px] text-[#64748b] flex items-center gap-[4px] mt-0.5 truncate",children:[e.jsx(Ms,{className:"w-[10px] h-[10px] shrink-0"})," ",t.lastActive||"recently"]})]})]}),e.jsxs("span",{className:`font-semibold text-[11px] px-[6px] py-[2px] rounded-[14px] shrink-0 ${n.badge}`,children:[t.avgScore,"%"]}),r&&e.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),r(t)},className:"opacity-0 group-hover:opacity-100 transition-opacity text-slate-400 hover:text-red-500 p-1 rounded shrink-0","aria-label":`Remove ${t.name} from class`,title:"Remove from class",children:e.jsx(Xt,{size:14})})]}),i&&e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 px-2 py-1 rounded-[10px] bg-amber-50 border border-amber-100/80",children:[e.jsx("span",{className:"text-[10px] font-semibold text-amber-700 uppercase tracking-wider",children:"No Account"}),a&&e.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),a(t)},className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-white text-amber-700 border border-amber-200 hover:bg-amber-100 text-[10px] font-semibold transition-colors","aria-label":`Create system account for ${t.name}`,children:[e.jsx("span",{"aria-hidden":!0,children:"+"}),"Create"]})]}),e.jsx("div",{className:"w-full bg-[#f1f5f9] h-1.5 rounded-full overflow-hidden mt-auto",children:e.jsx("div",{className:`h-full rounded-full ${n.progress}`,style:{width:`${t.avgScore}%`}})})]})}),Zx=({students:t,allClasses:s,currentClass:a,onReassignSection:r,reassignBusyId:o})=>{const[n,i]=u.useState(!1),l=u.useMemo(()=>{const d=new Map;return s.forEach(m=>{const p=(m.classSectionId||m.id||"").trim();if(!p)return;const h=(m.classMetadata?.grade||"").trim(),b=(m.classMetadata?.section||"").trim();if(!h||!b)return;const N=m.name||`${h} - ${b}`;d.set(p,{classSectionId:p,grade:h,section:b,label:N})}),Array.from(d.values()).sort((m,p)=>m.label.localeCompare(p.label))},[s]),c=u.useMemo(()=>{const d=new Map,m=[];return t.forEach(p=>{const h=(p.classSectionId||"").trim();if(!h){m.push(p);return}const b=p.section||p.className||h,N=d.get(h)||{label:b,students:[]};N.students=[...N.students,p],d.set(h,N)}),{assigned:Array.from(d.entries()).map(([p,h])=>({sectionId:p,...h})).sort((p,h)=>p.label.localeCompare(h.label)),unassigned:m}},[t]);return e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] border border-white shadow-[0_1px_4px_rgba(0,0,0,0.04)] overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>i(d=>!d),className:"w-full flex items-center justify-between px-6 py-4 text-left","aria-expanded":n,children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[15px] font-semibold text-[#1e293b]",children:"Section Management"}),e.jsxs("p",{className:"text-[12px] text-[#64748b] mt-0.5",children:["Move students between sections. Showing ",t.length," students across ",c.assigned.length," section",c.assigned.length===1?"":"s",c.unassigned.length>0?` · ${c.unassigned.length} unassigned`:"","."]})]}),e.jsx($t,{className:`w-4 h-4 text-[#64748b] transition-transform ${n?"rotate-180":""}`})]}),n&&e.jsxs("div",{className:"border-t border-[#f1f5f9] divide-y divide-[#f1f5f9]",children:[c.assigned.length===0&&c.unassigned.length===0&&e.jsx("p",{className:"text-[12px] text-[#64748b] px-6 py-5",children:"No students yet. Add students to this teacher to manage section assignments."}),c.assigned.map(d=>e.jsxs("div",{className:"px-6 py-4",children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-[#64748b] mb-2",children:[d.label," ",e.jsxs("span",{className:"text-[10px] font-normal text-[#94a3b8]",children:["(",d.students.length,")"]})]}),e.jsx("div",{className:"space-y-1.5",children:d.students.map(m=>e.jsx(oi,{student:m,sectionTargets:l,currentSectionId:a.classSectionId,onReassign:r,isBusy:o===m.id},`section-row-${m.id}`))})]},d.sectionId)),c.unassigned.length>0&&e.jsxs("div",{className:"px-6 py-4 bg-amber-50/40",children:[e.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-amber-700 mb-2",children:["Unassigned ",e.jsxs("span",{className:"text-[10px] font-normal text-amber-600/80",children:["(",c.unassigned.length,")"]})]}),e.jsx("div",{className:"space-y-1.5",children:c.unassigned.map(d=>e.jsx(oi,{student:d,sectionTargets:l,currentSectionId:a.classSectionId,onReassign:r,isBusy:o===d.id},`section-row-${d.id}`))})]})]})]})},oi=({student:t,sectionTargets:s,currentSectionId:a,onReassign:r,isBusy:o})=>{const[n,i]=u.useState(t.classSectionId||"");u.useEffect(()=>{i(t.classSectionId||"")},[t.classSectionId]);const l=()=>{const d=s.find(m=>m.classSectionId===n);d&&d.classSectionId!==t.classSectionId&&r(t,d)},c=n===(t.classSectionId||"");return e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-2 md:gap-3 px-3 py-2 rounded-[12px] bg-white border border-[#f1f5f9]",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[13px] font-semibold text-[#1e293b] truncate",children:t.name}),e.jsxs("p",{className:"text-[11px] text-[#64748b] truncate",children:[t.lrn?`LRN ${t.lrn} · `:"",t.classMetadata?.className||t.className||"Unassigned section",a&&t.classSectionId===a?" · current":""]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:n,onChange:d=>i(d.target.value),disabled:o||s.length===0,className:"text-[12px] rounded-xl border border-[#dde3eb] bg-white px-3 py-1.5 text-[#0a1628] focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:opacity-60",children:[e.jsx("option",{value:"",children:"Select section…"}),s.map(d=>e.jsx("option",{value:d.classSectionId,children:d.label},d.classSectionId))]}),e.jsx("button",{type:"button",onClick:l,disabled:o||c||!n,className:"text-[12px] font-semibold rounded-xl px-3 py-1.5 bg-indigo-600 text-white hover:bg-indigo-700 transition-colors disabled:opacity-50 disabled:hover:bg-indigo-600",children:o?"Saving…":"Move"})]})]})},ep=({selectedClass:t,students:s,allClasses:a,riskDistribution:r,topicPerformance:o,onViewStudent:n,onCreateAccount:i,onReassignSection:l,reassignBusyId:c,onBack:d,teacherOptions:m,managerUpdating:p,onAssignManager:h,onOpenNotifications:b,onOpenProfile:N,classColor:C,insightDismissed:S,onOpenInsightModal:v,onAddStudents:g,onRemoveStudent:I})=>{const{currentUser:L,userProfile:R}=hs(),[W,f]=u.useState(""),[k,w]=u.useState(""),[$,A]=u.useState("All"),[y,q]=u.useState(null),[J,re]=u.useState(!0),[le,ne]=u.useState(!1),[be,Ie]=u.useState(!0);u.useEffect(()=>{let j=!1;return re(!0),Ro(t.id).then(_=>{j||q(_)}).catch(_=>console.warn("[AnalyticsView] Backend fetch failed, using local data:",_)).finally(()=>{j||re(!1)}),()=>{j=!0}},[t.id]),u.useEffect(()=>{let j,_;return(async()=>{try{const{collection:T,onSnapshot:Q}=await ys(async()=>{const{collection:Ce,onSnapshot:Ne}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{collection:Ce,onSnapshot:Ne}},__vite__mapDeps([2,3])),{db:ue}=await ys(async()=>{const{db:Ce}=await import("./index-D9TvEOZX.js").then(Ne=>Ne.b6);return{db:Ce}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),ce=T(ue,"classes",t.id,"student_summaries");let ae=!0;j=Q(ce,()=>{if(ae){ae=!1;return}_&&clearTimeout(_),_=setTimeout(()=>{Ro(t.id).then(q).catch(()=>{})},2e3)})}catch{}})(),()=>{j?.(),_&&clearTimeout(_)}},[t.id]);const[de,fe]=u.useState(new Map);u.useEffect(()=>{let j=!1;const _=s.filter(T=>T.accountUid||T.hasRegisteredAccount);if(_.length!==0)return(async()=>{try{const{doc:T,getDoc:Q}=await ys(async()=>{const{doc:Ce,getDoc:Ne}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{doc:Ce,getDoc:Ne}},__vite__mapDeps([2,3])),{db:ue}=await ys(async()=>{const{db:Ce}=await import("./index-D9TvEOZX.js").then(Ne=>Ne.b6);return{db:Ce}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),ce=new Map,ae=_.slice(0,50);await Promise.all(ae.map(async Ce=>{const Ne=Ce.accountUid||Ce.id;try{const Je=await Q(T(ue,"progress",Ne));if(Je.exists()){const Ge=Je.data().averageScore||0;Ge>0&&ce.set(Ce.id,Ge)}}catch{}})),j||fe(ce)}catch{}})(),()=>{j=!0}},[s]);const H=y!=null&&y.students.some(j=>j.quiz_attempt_count>0),ee=(()=>{if(H)return y.class_average;if(t.avgScore>0)return t.avgScore;if(s.length===0)return 0;const j=s.map(_=>de.get(_.id)||_.avgScore).filter(_=>_>0);return j.length>0?Math.round(j.reduce((_,T)=>_+T,0)/j.length):0})(),oe=(()=>{if(H)return y.completion_rate;if(s.length===0)return 0;const j=s.filter(_=>de.has(_.id)||_.assignmentCompletion>0).length;return Math.round(j/s.length*100)})(),Re=(()=>{if(H)return y.participation_rate;if(s.length===0)return 0;const j=s.filter(_=>de.has(_.id)||_.engagementScore>0||_.avgScore>0).length;return s.length>0?Math.round(j/s.length*100):0})(),Fe=y?.insights?.risk_distribution?[{name:"Critical",value:y.insights.risk_distribution.Critical||0,color:"#dc2626"},{name:"High Risk",value:y.insights.risk_distribution["High Risk"]||0,color:"#f43f5e"},{name:"Medium Risk",value:y.insights.risk_distribution["Medium Risk"]||0,color:"#f59e0b"},{name:"Low Risk",value:y.insights.risk_distribution["Low Risk"]||0,color:"#10b981"},{name:"Unassessed",value:y.insights.risk_distribution.Unassessed||0,color:"#94a3b8"}].filter(j=>j.value>0):[{name:"High Risk",value:s.filter(j=>j.riskLevel==="high").length,color:"#FF8B8B"},{name:"Medium Risk",value:s.filter(j=>j.riskLevel==="medium").length,color:"#F08386"},{name:"Low Risk",value:s.filter(j=>j.riskLevel==="low").length,color:"#75D06A"}];u.useEffect(()=>{w(t.classMetadata?.managerId||t.managerId||"")},[t]);const Pe=u.useMemo(()=>{const j=W.trim().toLowerCase();let _=s;if(j&&(_=_.filter(T=>T.name.toLowerCase().includes(j)||(T.lrn||"").toLowerCase().includes(j)||(T.weakestTopic||"").toLowerCase().includes(j))),$==="Good")if(y){const T=new Set(y.students.filter(Q=>Q.quiz_attempt_count>0&&Q.avg_score>=75).map(Q=>Q.student_id));_=_.filter(Q=>T.has(Q.id))}else _=_.filter(T=>T.avgScore>=85&&T.riskLevel!=="high");else if($==="Risk")if(y){const T=new Set(y.students.filter(Q=>["High Risk","Critical","Unassessed"].includes(Q.risk_level)).map(Q=>Q.student_id));_=_.filter(Q=>T.has(Q.id))}else _=_.filter(T=>T.riskLevel==="high"||T.avgScore<75);return _},[W,s,$,y]),G=u.useMemo(()=>H?y.students.filter(j=>j.quiz_attempt_count>0).sort((j,_)=>_.avg_score-j.avg_score).slice(0,5).map(j=>{const _=s.find(T=>T.id===j.student_id);return _?{..._,avgScore:j.avg_score}:null}).filter(Boolean):[...s].map(j=>({...j,avgScore:de.get(j.id)||j.avgScore})).sort((j,_)=>_.avgScore-j.avgScore).slice(0,5),[s,y,H,de]),te=u.useMemo(()=>H?y.students.filter(j=>["High Risk","Critical"].includes(j.risk_level)).sort((j,_)=>j.avg_score-_.avg_score).map(j=>{const _=s.find(T=>T.id===j.student_id);return _?{..._,avgScore:j.avg_score,_backendRisk:j.risk_level}:null}).filter(Boolean):[...s].filter(j=>j.riskLevel==="high"||(de.get(j.id)||j.avgScore)<70||j.assignmentCompletion<65),[s,y,H,de]),E=u.useMemo(()=>y?.insights?.topic_performance?.length?y.insights.topic_performance.map(j=>({topic:j.topic,score:j.class_accuracy})):o,[y,o]),Y=j=>{if(H){const _=y.students.find(T=>T.student_id===j);if(_&&_.avg_score>0)return _.avg_score}return de.has(j)?de.get(j):null},V=j=>{if(!y)return null;const _=y.students.find(T=>T.student_id===j);return _?_.risk_level:null},pe=async()=>{ne(!0);try{const j=await tm(t.id);q(_=>_&&{..._,insights:j})}catch(j){console.warn("[AnalyticsView] Refresh insights failed:",j?.message)}finally{ne(!1)}};u.useMemo(()=>m.find(j=>j.uid===k),[m,k]);const D=[t.classMetadata?.gradeLevel||t.gradeLevel,t.classMetadata?.classification||t.classification,t.classMetadata?.strand||t.strand].filter(Boolean);return e.jsxs(ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"p-3 sm:p-[24px] xl:p-[32px] space-y-3 sm:space-y-[24px] h-full overflow-y-auto",children:[e.jsx("div",{className:"flex items-center justify-between mb-3 sm:mb-6",children:e.jsxs("button",{onClick:d,className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors bg-white/60 hover:bg-white/80 px-[18px] py-2 rounded-full backdrop-blur-[12px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50",children:[e.jsx(zs,{className:"w-4 h-4"}),"Back to Classes"]})}),e.jsxs("header",{style:{backgroundColor:C?.hex||"#6366f1"},className:"rounded-[24px] p-4 sm:p-[24px] lg:p-[32px] shadow-[0_8px_32px_rgba(0,0,0,0.08)] flex flex-col lg:flex-row lg:items-center justify-between gap-4 sm:gap-6 relative overflow-hidden group text-white",children:[e.jsx("div",{className:"absolute -right-10 -bottom-10 w-48 h-48 rounded-full bg-white/10 group-hover:scale-[1.3] transition-transform duration-700 ease-out pointer-events-none"}),e.jsx("div",{className:"absolute -left-10 -top-10 w-32 h-32 rounded-full bg-white/10 group-hover:scale-[1.2] transition-transform duration-700 delay-75 ease-out pointer-events-none"}),e.jsxs("div",{className:"shrink-0 relative z-10",children:[e.jsx("h1",{className:"text-xl sm:text-[28px] font-bold mb-2 sm:mb-3 tracking-tight",children:t.name}),e.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:D.map((j,_)=>e.jsx("span",{className:"px-3 py-1 bg-white/20 backdrop-blur-md text-white text-[12px] font-semibold rounded-full shadow-sm border border-white/20",children:j},j))}),e.jsxs("p",{className:"text-[13px] text-white/80 font-medium",children:["Manager: ",t.classMetadata?.managerName||t.managerName||"Not assigned"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-[18px] w-full",children:[e.jsxs("div",{className:"group relative overflow-hidden bg-[#0ea5e9] shadow-[0_4px_16px_rgba(14,165,233,0.13)] rounded-lg sm:rounded-2xl p-[12px] sm:p-[15px] text-white flex flex-col gap-[8px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] opacity-90 uppercase tracking-wider font-semibold",children:"Class Average"}),e.jsx("div",{className:"bg-white/20 p-1.5 rounded-lg flex",children:e.jsx(ms,{size:14})})]}),e.jsxs("div",{className:"relative z-10 text-[22px] sm:text-[26px] font-semibold tracking-tight",children:[Math.round(ee),"%"]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#10b981] shadow-[0_4px_16px_rgba(16,185,129,0.13)] rounded-lg sm:rounded-2xl p-[12px] sm:p-[15px] text-white flex flex-col gap-[8px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] opacity-90 uppercase tracking-wider font-semibold",children:"Completion"}),e.jsx("div",{className:"bg-white/20 p-1.5 rounded-lg flex",children:e.jsx(Aa,{size:14})})]}),e.jsxs("div",{className:"relative z-10 text-[22px] sm:text-[26px] font-semibold tracking-tight",children:[Math.round(oe),"%"]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#a855f7] shadow-[0_4px_16px_rgba(168,85,247,0.13)] rounded-lg sm:rounded-2xl p-[12px] sm:p-[15px] text-white flex flex-col gap-[8px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] opacity-90 uppercase tracking-wider font-semibold",children:"Participation"}),e.jsx("div",{className:"bg-white/20 p-1.5 rounded-lg flex",children:e.jsx(us,{size:14})})]}),e.jsxs("div",{className:"relative z-10 text-[22px] sm:text-[26px] font-semibold tracking-tight",children:[Math.round(Re),"%"]})]}),e.jsxs("div",{className:"group relative overflow-hidden bg-[#f97316] shadow-[0_4px_16px_rgba(249,115,22,0.13)] rounded-lg sm:rounded-2xl p-[12px] sm:p-[15px] text-white flex flex-col gap-[8px] sm:gap-[10px]",children:[e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-white/10 group-hover:scale-[1.6] transition-transform duration-500 ease-out"}),e.jsx("div",{className:"absolute -left-4 -top-4 w-12 h-12 rounded-full bg-white/10 group-hover:scale-[1.4] transition-transform duration-500 delay-75 ease-out"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] opacity-90 uppercase tracking-wider font-semibold",children:"Attention"}),e.jsx("div",{className:"bg-white/20 p-1.5 rounded-lg flex",children:e.jsx(la,{size:14})})]}),e.jsxs("div",{className:"relative z-10 text-[22px] sm:text-[26px] font-semibold tracking-tight",children:[te.length," ",e.jsx("span",{className:"text-[12px] opacity-90 font-medium",children:"students"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-3 sm:gap-[24px] h-auto xl:h-[600px]",children:[e.jsxs("div",{className:"xl:col-span-1 bg-white/80 backdrop-blur-[12px] rounded-[18px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white flex flex-col overflow-hidden h-[500px] xl:h-full",children:[e.jsxs("div",{className:"p-5 border-b border-[#f1f5f9] shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-[15px] font-semibold text-[#1e293b]",children:["Students ",e.jsxs("span",{className:"text-[#64748b] text-[13px]",children:["(",Pe.length,")"]})]}),e.jsx("button",{onClick:()=>g?.(),className:"text-[11px] font-semibold text-[#9956DE] hover:text-[#7c3aed] bg-[#9956DE]/10 hover:bg-[#9956DE]/20 px-3 py-1.5 rounded-lg transition-colors",children:"+ Add"})]}),e.jsxs("div",{className:"flex items-center bg-white px-4 py-2 rounded-[14px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#f1f5f9] group",children:[e.jsx(Ws,{className:"w-4 h-4 text-[#64748b] shrink-0 group-focus-within:text-[#4f46e5] transition-colors"}),e.jsx("input",{type:"text",placeholder:"Search students...",value:W,onChange:j=>f(j.target.value),className:"bg-transparent border-none focus:outline-none ml-2 text-[13px] w-full text-[#475569] placeholder:text-[#64748b]"})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-4 overflow-x-auto no-scrollbar pb-1",children:[e.jsx("button",{onClick:()=>A("All"),className:`px-3 py-1.5 text-[11px] font-semibold rounded-[14px] whitespace-nowrap transition-all hover:scale-[1.02] ${$==="All"?"bg-[#4f46e5] text-white shadow-[0_1px_4px_rgba(0,0,0,0.04)]":"bg-[#f8fafc] text-[#64748b] hover:bg-[#f1f5f9]"}`,children:"All Students"}),e.jsx("button",{onClick:()=>A("Good"),className:`px-3 py-1.5 text-[11px] font-semibold rounded-[14px] whitespace-nowrap transition-all hover:scale-[1.02] ${$==="Good"?"bg-emerald-50 text-emerald-600 border border-emerald-100/50 shadow-[0_1px_4px_rgba(0,0,0,0.04)]":"bg-emerald-50/40 text-emerald-600 border border-emerald-50 hover:bg-emerald-50"}`,children:"Top Performers"}),e.jsx("button",{onClick:()=>A("Risk"),className:`px-3 py-1.5 text-[11px] font-semibold rounded-[14px] whitespace-nowrap transition-all hover:scale-[1.02] ${$==="Risk"?"bg-rose-50 text-rose-600 border border-rose-100/50 shadow-[0_1px_4px_rgba(0,0,0,0.04)]":"bg-rose-50/40 text-rose-600 border border-rose-50 hover:bg-rose-50"}`,children:"Needs Attention"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-4 flex flex-col no-scrollbar",children:e.jsx(Nu,{style:{height:"100%"},data:Pe,className:"no-scrollbar",itemContent:(j,_)=>{const T=Y(_.id),Q=T!==null?{..._,avgScore:T}:_;return e.jsx("div",{className:"py-[6px] px-[8px]",children:e.jsx(Jx,{student:Q,onViewStudent:n,onCreateAccount:i,onRemoveStudent:I})})},computeItemKey:(j,_)=>on(_)})})]}),e.jsxs("div",{className:"xl:col-span-2 flex flex-col gap-[24px] h-full overflow-y-auto no-scrollbar pb-10 xl:pb-0",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-[24px]",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white flex flex-col group h-[280px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"font-semibold text-[15px] text-[#1e293b]",children:"Risk Distribution"}),e.jsx(qr,{className:"w-4 h-4 text-[#64748b] cursor-pointer group-hover:scale-110 transition-transform"})]}),e.jsx("div",{className:"relative w-full flex-1 min-h-[180px]",children:e.jsx(Vn,{width:"100%",height:"100%",children:e.jsxs(Wn,{data:Fe,children:[e.jsx(qn,{strokeDasharray:"4 4",stroke:"#f1f5f9",vertical:!1}),e.jsx(Yn,{dataKey:"name",axisLine:{stroke:"#cbd5e1",strokeWidth:2},tickLine:!1,tick:{fill:"#475569",fontSize:11,fontWeight:600},dy:10}),e.jsx(Kn,{axisLine:!1,tickLine:!1,tick:{fill:"#64748b",fontSize:10,fontWeight:600}}),e.jsx(Xn,{cursor:{fill:"#f8fafc"},contentStyle:{borderRadius:"12px",border:"none",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}}),e.jsx(Jn,{dataKey:"value",radius:[6,6,0,0],barSize:80,children:Fe.map((j,_)=>{const T={Critical:"#dc2626","High Risk":"#f43f5e","Medium Risk":"#f59e0b","Low Risk":"#10b981",Unassessed:"#94a3b8"};return e.jsx(Zn,{fill:T[j.name]||j.color},`cell-${_}`)})})]})})})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white flex flex-col group h-[280px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"font-semibold text-[15px] text-[#1e293b]",children:"Topic Performance"}),e.jsx(qr,{className:"w-4 h-4 text-[#64748b] cursor-pointer group-hover:scale-110 transition-transform"})]}),e.jsx("div",{className:"relative w-full flex-1 min-h-[180px] -ml-8",children:e.jsx(Vn,{width:"100%",height:"100%",children:e.jsxs(Wn,{data:E,layout:"vertical",margin:{top:0,right:10,left:40,bottom:0},children:[e.jsx(qn,{strokeDasharray:"4 4",stroke:"#f1f5f9",horizontal:!1}),e.jsx(Yn,{type:"number",domain:[0,100],axisLine:!1,tickLine:!1,tick:{fill:"#64748b",fontSize:10,fontWeight:600},tickFormatter:j=>`${j}%`}),e.jsx(Kn,{dataKey:"topic",type:"category",axisLine:{stroke:"#cbd5e1",strokeWidth:2},tickLine:!1,tick:{fill:"#1e293b",fontSize:11,fontWeight:600},dx:-10}),e.jsx(Xn,{cursor:{fill:"#f8fafc"},contentStyle:{borderRadius:"12px",border:"none",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}}),e.jsx(Jn,{dataKey:"score",radius:[0,6,6,0],barSize:28,children:E.map((j,_)=>{const T=j.score>=75?"#10b981":j.score>=60?"#f59e0b":"#f43f5e";return e.jsx(Zn,{fill:T},`cell-${_}`)})})]})})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-[24px]",children:[e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("h3",{className:"font-semibold text-[15px] text-[#1e293b] flex items-center gap-2",children:[e.jsx(ia,{className:"w-4 h-4 text-emerald-500"}),"Top Performers"]})}),e.jsxs("div",{className:"space-y-[8px]",children:[G.map(j=>e.jsxs("div",{onClick:()=>n(j),className:"flex justify-between items-center p-3 bg-emerald-50/40 rounded-[14px] border border-emerald-50 group hover:scale-[1.02] transition-transform cursor-pointer",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[#1e293b]",children:j.name}),e.jsxs("span",{className:"text-[13px] font-semibold text-emerald-600",children:[Y(j.id)??j.avgScore,"%"]})]},`top-${j.id}`)),G.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No students available yet."})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("h3",{className:"font-semibold text-[15px] text-[#1e293b] flex items-center gap-2",children:[e.jsx(la,{className:"w-4 h-4 text-rose-500"}),"Needs Attention"]})}),e.jsxs("div",{className:"space-y-[8px]",children:[te.slice(0,4).map(j=>{const _=V(j.id),T=_||(j.riskLevel==="high"?"HIGH RISK":"MEDIUM RISK"),Q=_==="Critical"||j.avgScore===0&&j.riskLevel==="high",ue=_==="High Risk"||j.riskLevel==="high",ce=Q?"bg-red-50/60 border-red-100":ue?"bg-rose-50/40 border-rose-50":"bg-amber-50/40 border-amber-50",ae=Q?"text-red-700":ue?"text-rose-600":"text-amber-600";return e.jsxs("div",{onClick:()=>n(j),className:`flex justify-between items-center p-3 rounded-[14px] border group hover:scale-[1.02] transition-transform cursor-pointer ${ce}`,children:[e.jsx("span",{className:"text-[13px] font-semibold text-[#1e293b]",children:j.name}),e.jsx("span",{className:`text-[11px] font-semibold bg-white px-2 py-0.5 rounded-[14px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-[#f1f5f9] ${ae}`,children:T.toUpperCase()})]},`attn-${j.id}`)}),te.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No urgent students."})]})]})]})]})]}),y?.insights&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50/80 to-purple-50/60 backdrop-blur-[12px] rounded-[18px] p-5 sm:p-6 shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-indigo-100/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("button",{onClick:()=>Ie(!be),className:"flex items-center gap-2 text-[15px] font-semibold text-[#1e293b]",children:[e.jsx(ps,{className:"w-4 h-4 text-indigo-500"}),"AI Class Insights",e.jsx($t,{className:`w-4 h-4 text-[#64748b] transition-transform ${be?"":"-rotate-90"}`})]}),e.jsxs("button",{onClick:pe,disabled:le,className:"flex items-center gap-1.5 text-[11px] font-semibold text-indigo-600 hover:text-indigo-700 bg-white/70 hover:bg-white px-3 py-1.5 rounded-lg transition-colors disabled:opacity-50",children:[e.jsx(cs,{className:`w-3 h-3 ${le?"animate-spin":""}`}),le?"Refreshing...":"Refresh AI Analysis"]})]}),be&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-white/70 rounded-[14px] p-4 border border-white",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(As,{size:18,className:"text-indigo-600"}),e.jsx("h4",{className:"text-[13px] font-semibold text-[#1e293b]",children:"Class Overview"})]}),e.jsx("p",{className:"text-[12px] text-[#475569] leading-relaxed",children:y.insights.class_summary})]}),e.jsxs("div",{className:"bg-white/70 rounded-[14px] p-4 border border-white",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ia,{size:18,className:"text-emerald-600"}),e.jsx("h4",{className:"text-[13px] font-semibold text-[#1e293b]",children:"What's Working"})]}),e.jsx("p",{className:"text-[12px] text-[#475569] leading-relaxed",children:y.insights.class_strengths})]}),e.jsxs("div",{className:"bg-white/70 rounded-[14px] p-4 border border-white",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ms,{size:18,className:"text-amber-600"}),e.jsx("h4",{className:"text-[13px] font-semibold text-[#1e293b]",children:"Recommended Actions"})]}),e.jsx("ul",{className:"space-y-1.5",children:y.insights.recommended_actions.map((j,_)=>e.jsxs("li",{className:"text-[12px] text-[#475569] leading-relaxed flex items-start gap-1.5",children:[e.jsx("span",{className:"text-indigo-500 mt-0.5 shrink-0",children:"•"}),j]},_))})]})]})]}),e.jsx(Zx,{students:s,allClasses:a,currentClass:t,onReassignSection:l,reassignBusyId:c})]})},tp=({student:t,teacherId:s,teacherName:a,onStudentUpdated:r,onBack:o,onNavigateToQuizMaker:n,initialCache:i,onCacheUpdate:l})=>{const c=(t.riskLevel||"low").toLowerCase(),d=c==="high"||c==="medium",m=u.useMemo(()=>xt.getImportGroundedRolloutFlags(),[]),[p,h]=u.useState(null),[b,N]=u.useState(!0),[C,S]=u.useState(null),[v,g]=u.useState(i?.learningPath||""),[I,L]=u.useState(!0),[R,W]=u.useState(i?.gradeDraft||t.grade||"Grade 11"),[f,k]=u.useState(i?.sectionDraft||t.section||"Section A"),[w,$]=u.useState(!1),[A,y]=u.useState(i?.lessonPlan??null),[q,J]=u.useState([]),[re,le]=u.useState(""),[ne,be]=u.useState(!1),[Ie,de]=u.useState(""),[fe,H]=u.useState("all"),[ee,oe]=u.useState("all"),[Re,Fe]=u.useState(!1),[Pe,G]=u.useState(!1),[te,E]=u.useState(null),[Y,V]=u.useState(!1),[pe,D]=u.useState(!1),[j,_]=u.useState(0),[T,Q]=u.useState(!1),[ue,ce]=u.useState("choose"),[ae,Ce]=u.useState([]),[Ne,Je]=u.useState(!1),[$e,Ge]=u.useState(!1),[ft,Nt]=u.useState(!1),[dt,jt]=u.useState(!1);u.useEffect(()=>{W(t.grade||"Grade 11"),k(t.section||"Section A")},[t.grade,t.section]),u.useEffect(()=>{let z=!1;return N(!0),an(t.id).then(me=>{z||h(me)}).catch(me=>console.warn("[InterventionView] Backend fetch failed:",me)).finally(()=>{z||N(!1)}),()=>{z=!0}},[t.id]);const[At,rs]=u.useState(null);u.useEffect(()=>{let z=!1;const me=t.accountUid||t.id;return Ur(me).then(We=>{!z&&We?.averageScore&&rs(Math.round(We.averageScore))}).catch(()=>{}),()=>{z=!0}},[t.id,t.accountUid]),u.useEffect(()=>{const z=me=>{if(me.key==="Escape"){if(dt){jt(!1);return}if($e){ft?jt(!0):Ge(!1);return}T&&Q(!1)}};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[$e,T,ft,dt]),u.useEffect(()=>{if($e){const z=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=z}}},[$e]),u.useEffect(()=>{l?.(t.id,{lessonPlan:A,learningPath:v,gradeDraft:R,sectionDraft:f})},[A,v,R,f,t.id,l]),u.useEffect(()=>{(async()=>{L(!0);try{let me="";try{me=await Gl(t.struggles.length>0?t.struggles:[t.weakestTopic],"general_math"),le(me)}catch{le("")}const We=await xt.getLearningPath({weaknesses:t.struggles.length>0?t.struggles:[t.weakestTopic],gradeLevel:"High School",subject:"general_math"}),B=me?`${We.learningPath} + +${me}`:We.learningPath;g(B)}catch{g("Unable to generate learning path. Please try again later."),le("")}finally{L(!1)}})()},[t]);const Is=u.useCallback(async()=>{be(!0),de("");try{const z=t.classSectionId||Ft(R||"Grade 11",f||"Section A"),me=t.struggles.length>0?t.struggles[0]:t.weakestTopic,We=await Ao({gradeLevel:R||t.grade||"Grade 11",subject:"general_math",quarter:1,moduleUnit:[R,f].filter(Boolean).join(" - ")||t.className,lessonTitle:`Grounded Lesson: ${me}`,learningCompetency:me,learnerLevel:t.avgScore<60?"support":t.avgScore<80?"developing":"advanced",classSectionId:z,className:[R,f].filter(Boolean).join(" - ")||t.className,focusTopics:t.struggles.length>0?t.struggles:[t.weakestTopic],topicCount:5,preferImportedTopics:m.lessonEnabled,allowReviewSources:Re,allowUnverifiedLesson:Pe},!0);y(We),J(We.curriculumSources||[]),E(null),xt.reportImportGroundedFeedback({flow:"lesson",status:"success",classSectionId:z,className:[R,f].filter(Boolean).join(" - ")||t.className,metadata:{usedImportedTopics:We.usedImportedTopics,importedTopicCount:We.importedTopicCount,blockCount:We.blocks.length,publishReady:We.publishReady,sourceLegitimacyStatus:We.sourceLegitimacy.status,selfValidationPassed:We.selfValidation.passed,importGroundingEnabled:m.lessonEnabled}})}catch(z){let me=z instanceof Error?z.message:"Unable to generate lesson plan at this time.";if(z instanceof ar&&z.status===422)try{const B=JSON.parse(z.responseBody)?.detail;if(B?.selfValidation&&!Pe)try{const O=t.classSectionId||Ft(R||"Grade 11",f||"Section A"),ve=t.struggles.length>0?t.struggles[0]:t.weakestTopic,we=await Ao({gradeLevel:R||t.grade||"Grade 11",subject:"general_math",quarter:1,moduleUnit:[R,f].filter(Boolean).join(" - ")||t.className,lessonTitle:`Grounded Lesson: ${ve}`,learningCompetency:ve,learnerLevel:t.avgScore<60?"support":t.avgScore<80?"developing":"advanced",classSectionId:O,className:[R,f].filter(Boolean).join(" - ")||t.className,focusTopics:t.struggles.length>0?t.struggles:[t.weakestTopic],topicCount:5,preferImportedTopics:m.lessonEnabled,allowReviewSources:Re,allowUnverifiedLesson:!0},!0);y(we),J(we.curriculumSources||[]),E(null),de("");return}catch{}B?.message&&(me=B.message);const kt=B?.sourceLegitimacy?.issues||[],Me=B?.selfValidation?.issues||[],M=[...kt,...Me].filter(Boolean).slice(0,3);M.length>0&&(me=`${me} ${M.join(" ")}`)}catch{}de(me),y(null),J([]),xt.reportImportGroundedFeedback({flow:"lesson",status:"failed",classSectionId:t.classSectionId||Ft(R||"Grade 11",f||"Section A"),className:[R,f].filter(Boolean).join(" - ")||t.className,metadata:{error:me,allowReviewSources:Re,allowUnverifiedLesson:Pe,importGroundingEnabled:m.lessonEnabled}})}finally{be(!1)}},[t,R,f,m.lessonEnabled,Re,Pe]),bs=u.useCallback(async()=>{if(!A)return ie.error("Generate a lesson plan first."),null;V(!0);try{const z=await lm(A,s,{teacherName:a,studentId:t.id,studentName:t.name});return E(z),ie.success("Lesson plan saved as draft."),z}catch(z){return console.error("Failed to save lesson draft:",z),ie.error(z instanceof Error?z.message:"Failed to save lesson draft."),null}finally{V(!1)}},[A,s,a,t.id,t.name]),Ps=u.useCallback(async()=>{if(!A){ie.error("Generate a lesson plan first.");return}if(!A.publishReady){const z=[...A.sourceLegitimacy.issues,...A.selfValidation.issues].filter(Boolean).slice(0,2).join(" ");ie.error(z||"Lesson is not publish-ready. Resolve legitimacy and validation checks first.");return}D(!0);try{let z=te;if(z||(z=await bs()),!z)return;await cm(z),ie.success("Lesson plan published to class content."),xt.reportImportGroundedFeedback({flow:"lesson",status:"success",classSectionId:A.classSectionId||t.classSectionId,className:A.className||t.className,metadata:{action:"publish_lesson_plan",lessonPlanId:z,publishReady:A.publishReady,sourceLegitimacyStatus:A.sourceLegitimacy.status,selfValidationPassed:A.selfValidation.passed}})}catch(z){console.error("Failed to publish lesson plan:",z),ie.error(z instanceof Error?z.message:"Failed to publish lesson plan."),xt.reportImportGroundedFeedback({flow:"lesson",status:"failed",classSectionId:A.classSectionId||t.classSectionId,className:A.className||t.className,metadata:{action:"publish_lesson_plan",error:z instanceof Error?z.message:"Failed to publish lesson plan."}})}finally{D(!1)}},[A,te,bs,t.className,t.classSectionId]);u.useEffect(()=>{Is()},[j]),u.useEffect(()=>{_(z=>z+1)},[t.id]),u.useEffect(()=>{H("all"),oe("all")},[A]),u.useMemo(()=>A?Array.from(new Set(A.blocks.map(z=>z.provenance?.sourceFile?.trim()).filter(z=>!!z))).sort((z,me)=>z.localeCompare(me)):[],[A]),u.useMemo(()=>A?Array.from(new Set(A.blocks.map(z=>z.provenance?.materialId?.trim()).filter(z=>!!z))).sort((z,me)=>z.localeCompare(me)):[],[A]);const ns=u.useMemo(()=>A?A.blocks.filter(z=>{const me=fe==="all"||(z.provenance?.sourceFile||"").trim()===fe,We=ee==="all"||(z.provenance?.materialId||"").trim()===ee;return me&&We}):[],[A,fe,ee]),vs=u.useMemo(()=>p?.learning_path?.steps?.length?p.learning_path.steps.map(z=>({id:z.step_number,type:z.type==="video_lesson"?"video":z.type==="assessment"?"assessment":"quiz",title:z.title,duration:`${z.duration_minutes} mins`,questions:z.num_items||void 0,icon:z.type==="video_lesson"?Ja:z.type==="assessment"?ja:z.type==="review"?cs:Wr,competency:z.competency_tag,difficulty:z.difficulty,is_completed:z.is_completed})):[{id:1,type:"video",title:`${t.weakestTopic} Fundamentals`,duration:"8 mins",questions:void 0,icon:Ja,competency:"",difficulty:"easy",is_completed:!1},{id:2,type:"quiz",title:`${t.weakestTopic} Practice`,duration:"12 mins",questions:10,icon:Wr,competency:"",difficulty:"easy",is_completed:!1},{id:3,type:"assessment",title:"Final Check",duration:"10 mins",questions:5,icon:ja,competency:"",difficulty:"medium",is_completed:!1}],[p,t.weakestTopic]),os=async()=>{if(!s){ie.error("Unable to update section: teacher context missing");return}$(!0);try{await jr(t.id,R,f,s,new Date().getFullYear().toString(),a),await nl(t.id,R,f);const z={...t,grade:R,section:f,className:[R,f].filter(Boolean).join(" - "),classSectionId:Ft(R,f)};r(z),ie.success("Student section assignment updated")}catch(z){console.error("Failed to update student section assignment:",z),ie.error("Failed to update section assignment")}finally{$(!1)}};return e.jsxs(ze.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full h-full flex overflow-hidden relative",children:[e.jsx("div",{className:"flex-1 overflow-y-auto p-[24px] xl:p-[32px] no-scrollbar",children:e.jsxs("div",{className:"max-w-[1000px] mx-auto space-y-[24px]",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-[8px]",children:e.jsx("div",{children:e.jsxs("button",{onClick:o,className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors bg-white/60 hover:bg-white/80 px-[18px] py-2 rounded-full backdrop-blur-[12px] mb-[16px] w-max shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white/50",children:[e.jsx(lr,{className:"w-4 h-4"}),"Back to Analytics"]})})}),e.jsxs("div",{className:"bg-gradient-to-br from-[#ecfdf5] via-[#f0fdf4] to-[#f7fdf9] backdrop-blur-[12px] rounded-[20px] p-[24px] border border-emerald-100 shadow-[0_4px_16px_rgba(16,185,129,0.08)] relative overflow-hidden",children:[e.jsx("div",{className:"absolute right-[-20px] bottom-[-20px] opacity-[0.06] pointer-events-none",children:e.jsx($n,{className:"w-48 h-48 text-emerald-600"})}),e.jsxs("div",{className:"flex items-center gap-3 mb-5 relative z-10",children:[e.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-[#059669] to-[#10b981] flex items-center justify-center shrink-0 shadow-[0_4px_10px_rgba(5,150,105,0.3)]",children:e.jsx($n,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#1e293b]",children:"AI Analysis"}),e.jsxs("span",{className:"flex items-center gap-1 px-2.5 py-0.5 bg-emerald-500 text-white text-[10px] font-bold rounded-full uppercase tracking-wider shadow-sm",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"}),"Insights Active"]})]})]}),re&&e.jsx(zo,{sources:q,className:"mb-4 relative z-10"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 w-full relative z-10",children:[e.jsxs("div",{className:"bg-white/70 backdrop-blur-sm rounded-[14px] p-4 border border-emerald-100/60 shadow-[0_1px_4px_rgba(0,0,0,0.04)] relative overflow-hidden",children:[e.jsx("div",{className:"absolute left-0 top-0 w-1 h-full bg-emerald-400 rounded-l-[14px]"}),e.jsxs("h4",{className:"text-[11px] font-bold text-emerald-600 uppercase tracking-wider mb-2.5 flex items-center gap-1.5 pl-2",children:[e.jsx(ia,{className:"w-3.5 h-3.5"})," Learning Strengths"]}),e.jsx("p",{className:"text-[13px] text-[#475569] leading-relaxed pl-2",children:p?.learning_strengths||(d?e.jsx(e.Fragment,{children:"Demonstrates engagement but faces challenges. Needs support with foundational topics."}):e.jsxs(e.Fragment,{children:["Excels in ",e.jsx("span",{className:"font-semibold text-[#1e293b]",children:t.weakestTopic}),". Demonstrates high engagement during interactive tests."]}))})]}),e.jsxs("div",{className:"bg-white/70 backdrop-blur-sm rounded-[14px] p-4 border border-rose-100/60 shadow-[0_1px_4px_rgba(0,0,0,0.04)] relative overflow-hidden",children:[e.jsx("div",{className:"absolute left-0 top-0 w-1 h-full bg-rose-400 rounded-l-[14px]"}),e.jsxs("h4",{className:"text-[11px] font-bold text-rose-500 uppercase tracking-wider mb-2.5 flex items-center gap-1.5 pl-2",children:[e.jsx(ms,{className:"w-3.5 h-3.5"})," Next Steps"]}),e.jsx("ul",{className:"text-[13px] text-[#475569] leading-relaxed list-none p-0 m-0 space-y-1 pl-2",children:p?.next_steps_summary?e.jsx("li",{children:p.next_steps_summary}):t.struggles.length>0?t.struggles.map((z,me)=>e.jsxs("li",{children:["Must continue strengthening ",e.jsx("span",{className:"font-semibold text-[#1e293b]",children:z}),"."]},me)):e.jsxs("li",{children:["Focus on repetitive practice modules for ",e.jsx("span",{className:"font-semibold text-[#1e293b]",children:t.weakestTopic}),"."]})})]})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6 border-b border-[#f1f5f9] pb-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-[#1e293b]",children:"Generated Learning Path"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{disabled:!p?.learning_path,onClick:async()=>{if(p)try{await ml(p,s),ie.success(`Learning path assigned to ${t.name}'s modules.`)}catch(z){console.error("[InterventionView] Assign failed:",z),ie.error("Failed to assign learning path.")}},className:"bg-emerald-50 hover:bg-emerald-100 text-emerald-700 border border-emerald-200 text-[11px] font-semibold rounded-full px-4 py-1.5 transition-colors shadow-[0_1px_4px_rgba(0,0,0,0.02)] flex items-center gap-1.5 disabled:opacity-50",children:[e.jsx(sa,{className:"w-3 h-3"})," Assign to Student"]}),e.jsxs("button",{disabled:I||b,onClick:async()=>{N(!0);try{const z=await dl(t.id);h(z)}catch(z){console.warn("[InterventionView] Regenerate failed:",z)}finally{N(!1)}_(z=>z+1)},className:"bg-[#f8fafc] hover:bg-white text-[#4f46e5] border border-[#e0e7ff] text-[11px] font-semibold rounded-full px-4 py-1.5 transition-colors shadow-[0_1px_4px_rgba(0,0,0,0.02)] flex items-center gap-1.5 disabled:opacity-50",children:[e.jsx(cs,{className:`w-3 h-3 ${b?"animate-spin":""}`})," ",b?"Analyzing...":"Regenerate"]})]})]}),e.jsxs(_o,{name:"teacher-intervention-learning-path",loading:!1,fixture:null,fallback:null,children:[e.jsxs("div",{className:"mb-8 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mr-2",children:"Methodology:"}),(p?.learning_path?.methodology_tags||["Interactive","Video","Practice","Quiz"]).map(z=>e.jsx("span",{className:"px-3 py-1 bg-[#f8fafc] text-[#475569] text-[11px] font-semibold rounded-full border border-[#e2e8f0]",children:z},z))]}),e.jsx("div",{className:"relative border-l-2 border-[#e2e8f0] ml-[20px] space-y-[28px] pb-4",children:vs.map((z,me)=>{let We=e.jsx(Ja,{className:"w-4 h-4"}),B="bg-[#8b5cf6] shadow-[0_4px_10px_rgba(139,92,246,0.3)]",kt="text-purple-600",Me="group-hover:border-purple-200",M="hover:bg-[#4f46e5]",O=e.jsx(lc,{className:"w-4 h-4 ml-0.5"});return z.type==="quiz"?(We=e.jsx(or,{className:"w-4 h-4"}),B="bg-sky-500 shadow-[0_4px_10px_rgba(14,165,233,0.3)]",kt="text-sky-600",Me="group-hover:border-sky-200",M="hover:bg-sky-500",O=e.jsx(Rs,{className:"w-4 h-4"})):z.type==="assessment"&&(We=e.jsx(ja,{className:"w-4 h-4"}),B="bg-emerald-500 shadow-[0_4px_10px_rgba(16,185,129,0.3)]",kt="text-emerald-600",Me="group-hover:bg-emerald-50"),e.jsxs(ze.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:me*.1},className:"relative pl-[32px] group",children:[e.jsx("div",{className:`absolute -left-[17px] top-1 w-8 h-8 rounded-full ${B} text-white flex items-center justify-center ring-4 ring-white group-hover:scale-110 transition-transform`,children:We}),e.jsxs("div",{onClick:()=>{p?.learning_path?.steps?.[me]&&S(p.learning_path.steps[me])},className:`${z.type==="assessment"?"bg-emerald-50/50 border-emerald-100":"bg-white border-[#f1f5f9]"} rounded-[14px] p-[18px] border shadow-[0_1px_4px_rgba(0,0,0,0.04)] flex justify-between items-center transition-colors cursor-pointer ${Me}`,children:[e.jsxs("div",{children:[e.jsxs("span",{className:`text-[10px] font-semibold uppercase tracking-wider mb-1 block ${kt}`,children:["Step ",me+1," • ",z.type==="video"?"Video Lesson":z.type==="quiz"?"Practice":"Assessment"]}),e.jsx("p",{className:"font-semibold text-[#1e293b] text-[13px] mb-0.5",children:z.title}),e.jsxs("p",{className:"text-[#64748b] text-[11px] flex items-center gap-1.5",children:[z.type==="video"&&e.jsxs(e.Fragment,{children:[e.jsx(Ms,{className:"w-3 h-3"})," ",z.duration]}),z.type==="quiz"&&e.jsxs(e.Fragment,{children:[e.jsx(Ni,{className:"w-3 h-3"})," ",z.questions?`${z.questions} questions`:z.duration]}),z.type==="assessment"&&e.jsxs(e.Fragment,{children:[e.jsx(ms,{className:"w-3 h-3"})," ",z.questions?`${z.questions} assessment questions`:z.duration]}),z.competency&&e.jsx("span",{className:"ml-2 px-1.5 py-0.5 bg-indigo-50 text-indigo-600 text-[9px] font-mono rounded",children:z.competency})]})]}),z.type==="assessment"?e.jsx(mi,{className:"w-6 h-6 text-emerald-400"}):e.jsx("button",{className:`w-8 h-8 rounded-full bg-[#f8fafc] flex items-center justify-center text-[#64748b] ${M} hover:text-white transition-colors border border-[#e2e8f0]`,children:O})]})]},z.id)})})]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-[12px] rounded-[18px] p-[24px] shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-white",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-[#1e293b]",children:"Targeted Lesson Generation"}),e.jsx(St,{onClick:()=>_(z=>z+1),disabled:ne,className:"bg-[#4f46e5] hover:bg-[#3730a3] text-white h-8 text-[11px] rounded-full px-4",children:ne?"Loading...":"Regenerate"})]}),e.jsx("p",{className:"text-[13px] text-[#64748b] mb-6",children:"Configure inputs and requirements for AI lesson generation."}),e.jsxs("div",{className:"bg-[#f8fafc]/80 rounded-[14px] p-[20px] border border-[#f1f5f9] mb-6",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[e.jsx(ra,{className:"w-4 h-4 text-[#4f46e5] shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-[13px] text-[#475569] leading-relaxed",children:["Class records alone are not enough for import-grounded lesson plans. Ensure course materials are uploaded via ",e.jsx("span",{className:"text-[#4f46e5] font-semibold",children:"Data Import"}),"."]})]}),e.jsxs("div",{className:"space-y-4 border-t border-[#e2e8f0] pt-5 mt-5",children:[e.jsxs("label",{className:"flex items-center justify-between cursor-pointer group",children:[e.jsx("span",{className:"text-[13px] font-medium text-[#1e293b] group-hover:text-[#4f46e5] transition-colors",children:"Allow sources requiring manual review"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:Re,onChange:z=>Fe(z.target.checked)}),e.jsx("div",{className:"w-10 h-5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#4f46e5]"})]})]}),e.jsxs("label",{className:"flex items-center justify-between cursor-pointer group",children:[e.jsx("span",{className:"text-[13px] font-medium text-[#1e293b] group-hover:text-[#4f46e5] transition-colors",children:"Allow unverified lesson draft"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:Pe,onChange:z=>G(z.target.checked)}),e.jsx("div",{className:"w-10 h-5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#4f46e5]"})]})]})]})]}),e.jsxs(_o,{name:"teacher-intervention-lesson-plan",loading:!1,fixture:null,fallback:null,children:[Ie&&e.jsx("div",{className:"bg-[#FF8B8B]/14 border border-[#FF8B8B]/35 rounded-xl p-3 text-sm text-[#D66A6A] mb-4",children:Ie}),A&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-[#f8fafc] border border-[#f1f5f9] rounded-[14px] p-5 shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:[e.jsx("div",{className:"mb-3",children:e.jsx(zo,{sources:q})}),e.jsx("p",{className:"text-[14px] font-semibold text-[#1e293b]",children:A.lessonTitle}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-2 mt-2",children:[e.jsxs("p",{className:"text-[11px] text-[#64748b]",children:[e.jsx("span",{className:"font-semibold text-[#475569]",children:"Imported topics:"})," ",A.usedImportedTopics?"Yes":"No"," (",A.importedTopicCount,")"]}),e.jsxs("p",{className:"text-[11px] text-[#64748b]",children:[e.jsx("span",{className:"font-semibold text-[#475569]",children:"Subject:"})," ",A.subject||"General Math"," (Q",A.quarter||1,")"]})]}),A.curriculumCompetency&&e.jsxs("p",{className:"text-[11px] text-[#4f46e5] font-semibold mt-2 bg-indigo-50/50 px-2 py-1 rounded inline-block",children:["Competency: ",A.curriculumCompetency]}),e.jsx("div",{className:"mt-3 flex items-center justify-between",children:e.jsxs("p",{className:"text-[11px] text-[#64748b]",children:["Publish readiness: ",e.jsx("span",{className:`font-semibold ${A.publishReady?"text-emerald-600":"text-rose-500"}`,children:A.publishReady?"Ready":"Blocked"})]})}),A.warnings.length>0&&e.jsx("p",{className:"text-[11px] text-amber-600 mt-2 bg-amber-50 px-2 py-1.5 rounded",children:A.warnings.join(" ")})]}),A.lessonObjective&&e.jsxs("div",{className:"bg-white border border-[#e2e8f0] rounded-[14px] p-4 shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:[e.jsx("p",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1.5",children:"Lesson objective"}),e.jsx("p",{className:"text-[13px] text-[#1e293b]",children:A.lessonObjective})]}),A.realWorldHook&&e.jsxs("div",{className:"bg-indigo-50/50 border border-indigo-100 rounded-[14px] p-4 shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:[e.jsx("p",{className:"text-[10px] font-semibold text-[#4f46e5] uppercase tracking-wider mb-1.5",children:"Real-life application"}),e.jsx("p",{className:"text-[13px] text-[#1e293b]",children:A.realWorldHook})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-4",children:ns.map(z=>e.jsxs("div",{className:"border border-[#e2e8f0] rounded-[14px] p-4 bg-white shadow-[0_1px_4px_rgba(0,0,0,0.02)]",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-[#1e293b]",children:z.title}),e.jsxs("p",{className:"text-[11px] text-[#64748b] mt-1",children:[z.estimatedMinutes," mins "," • "," ",z.strategy]}),e.jsx("p",{className:"text-[12px] text-[#475569] mt-2 bg-[#f8fafc] p-2 rounded-lg",children:z.objective}),e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-[10px] font-semibold text-[#64748b] uppercase tracking-wider mb-1.5",children:"Activities"}),z.activities.slice(0,2).map((me,We)=>e.jsxs("p",{className:"text-[11px] text-[#475569] mb-1 flex items-start gap-1",children:[e.jsx("span",{className:"text-[#94a3b8] mt-0.5",children:"•"})," ",e.jsx("span",{children:me})]},We))]})]},z.blockId))}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-4",children:[e.jsx(St,{variant:"outline",onClick:()=>void bs(),disabled:Y||!A,className:"border-[#cbd5e1] text-[#475569] hover:bg-[#f8fafc] text-[12px] h-9 rounded-full px-5",children:Y?e.jsx(Bn,{className:"h-4 w-16"}):"Save Draft"}),e.jsx(St,{onClick:()=>void Ps(),disabled:pe||!A||!A.publishReady,className:"bg-[#10b981] hover:bg-[#059669] text-white text-[12px] h-9 rounded-full px-5",children:pe?e.jsx(Bn,{className:"h-4 w-24 bg-white/35"}):"Publish Lesson Plan"})]})]})]})]})]})}),e.jsx("aside",{className:"w-[320px] 2xl:w-[340px] bg-white/70 backdrop-blur-[24px] border-l border-white shadow-[-4px_0_24px_rgba(0,0,0,0.02)] flex flex-col h-full shrink-0 overflow-y-auto z-10 no-scrollbar relative",children:e.jsxs("div",{className:"p-[24px] space-y-[24px] flex flex-col items-center",children:[e.jsxs("div",{className:"flex flex-col items-center text-center w-full",children:[e.jsx("img",{src:t.avatar,alt:t.name,className:"w-[96px] h-[96px] rounded-full object-cover shadow-[0_8px_16px_rgba(0,0,0,0.1)] mb-4 border-4 border-white z-10 relative"}),e.jsx("h2",{className:"text-[20px] font-semibold text-[#1e293b] mb-1",children:t.name}),e.jsxs("p",{className:"text-[11px] font-semibold text-[#64748b] mb-3 uppercase tracking-wider",children:["ID: ",t.id.substring(0,8)]}),e.jsx("span",{className:`text-[11px] font-semibold px-3 py-1 rounded-[14px] border ${(p?.risk_level||"").includes("Critical")?"text-red-700 bg-red-50 border-red-200 animate-pulse":t.riskLevel==="high"||(p?.risk_level||"").includes("High")?"text-rose-600 bg-rose-50 border-rose-100":t.riskLevel==="medium"||(p?.risk_level||"").includes("Medium")?"text-amber-600 bg-amber-50 border-amber-100":"text-emerald-600 bg-emerald-50 border-emerald-100"}`,children:p?.risk_level||(t.riskLevel==="high"?"High Risk":t.riskLevel==="medium"?"Medium Risk":"Low Risk")})]}),e.jsxs("div",{className:"w-full grid grid-cols-2 gap-[12px]",children:[e.jsxs("div",{className:"bg-white/80 rounded-[14px] p-4 border border-white shadow-[0_1px_4px_rgba(0,0,0,0.02)] text-left flex flex-col justify-center",children:[e.jsx("p",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Avg Score"}),e.jsxs("p",{className:"text-[20px] font-bold text-[#4f46e5]",children:[p?.avg_score||At||t.avgScore,"%"]})]}),e.jsxs("div",{className:"bg-white/80 rounded-[14px] p-4 border border-white shadow-[0_1px_4px_rgba(0,0,0,0.02)] text-left flex flex-col justify-center",children:[e.jsx("p",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Engagement"}),e.jsx("p",{className:"text-[20px] font-bold text-[#1e293b]",children:p?.engagement_level||((At||t.avgScore)>80?"High":(At||t.avgScore)>50?"Medium":"Low")})]}),e.jsxs("div",{className:"bg-white/80 rounded-[14px] p-4 border border-white shadow-[0_1px_4px_rgba(0,0,0,0.02)] text-left flex flex-col justify-center",children:[e.jsx("p",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1",children:"Last Active"}),e.jsx("p",{className:"text-[13px] font-semibold text-[#1e293b] mt-1",children:p?.last_active?new Date(p.last_active).toLocaleDateString():t.lastActive})]}),e.jsxs("div",{className:"bg-rose-50/60 rounded-[14px] p-4 border border-rose-100 text-left flex flex-col justify-center",children:[e.jsx("p",{className:"text-[11px] font-semibold text-rose-600 uppercase tracking-wider mb-1",children:"Weakest Topic"}),e.jsx("p",{className:"text-[12px] font-semibold text-[#1e293b] mt-1 leading-snug break-words",title:p?.weakest_topic||t.weakestTopic,children:p?.weakest_topic||t.weakestTopic})]})]}),e.jsx("div",{className:"w-full flex flex-col gap-[10px]",children:e.jsxs("button",{onClick:async()=>{ce("choose"),Q(!0)},className:"w-full flex items-center justify-center gap-2 bg-white hover:bg-[#f8fafc] text-[#475569] border border-[#cbd5e1] hover:border-[#94a3b8] text-[13px] font-semibold rounded-full px-4 py-3 shadow-[0_1px_4px_rgba(0,0,0,0.04)] transition-transform hover:scale-[1.02]",children:[e.jsx(eo,{className:"w-4 h-4"})," Export Materials"]})}),T&&Gr.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",onClick:()=>Q(!1),children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs("div",{className:"relative bg-white rounded-[24px] shadow-[0_24px_64px_rgba(0,0,0,0.18)] w-full max-w-[460px] z-10 overflow-hidden",onClick:z=>z.stopPropagation(),children:[e.jsx("div",{className:"bg-gradient-to-r from-[#a855f7] to-[#9333ea] px-6 pt-5 pb-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[ue==="bank"&&e.jsx("button",{onClick:()=>ce("choose"),className:"w-7 h-7 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center text-white transition-colors mr-1",children:e.jsx(zs,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-8 h-8 rounded-[8px] bg-white/20 flex items-center justify-center",children:e.jsx(Kr,{className:"w-4 h-4 text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-[15px] font-bold text-white leading-tight",children:ue==="choose"?"Export Materials":"Choose a Quiz"}),e.jsx("p",{className:"text-[11px] text-white/70 font-medium",children:ue==="choose"?`For ${t.name}`:"Select a quiz from your bank"})]})]}),e.jsx("button",{onClick:()=>Q(!1),className:"w-7 h-7 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center text-white transition-colors",children:e.jsx(Xt,{className:"w-4 h-4"})})]})}),e.jsx("div",{className:"p-6",children:ue==="choose"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[13px] text-[#64748b] mb-5 font-medium",children:"How would you like to proceed?"}),e.jsxs("button",{onClick:async()=>{Q(!1),ie.info("Generating PDF report...");try{const{getExportPDFData:z}=await ys(async()=>{const{getExportPDFData:se}=await Promise.resolve().then(()=>am);return{getExportPDFData:se}},void 0),me=await z(t.id),{default:We}=await ys(async()=>{const{default:se}=await import("./jspdf.es.min-CzGv_66N.js").then(rt=>rt.j);return{default:se}},__vite__mapDeps([12,0,1,2,3,4,5,6,7,8,9,10,11])),B=new We,kt=B.internal.pageSize.getWidth(),Me=20,M=kt-Me*2;let O=20;const ve=se=>{O+se>275&&(B.addPage(),O=20)},we=()=>{B.setDrawColor(200,200,200),B.line(Me,O,kt-Me,O),O+=6},qe=(se,rt=0)=>{const nt=B.splitTextToSize(se,M-rt);for(const ut of nt)ve(5),B.text(ut,Me+rt,O),O+=5},je=se=>{ve(16),O+=4,B.setFillColor(99,102,241),B.roundedRect(Me,O-4,M,10,2,2,"F"),B.setTextColor(255,255,255),B.setFontSize(11),B.setFont("helvetica","bold"),B.text(se,Me+4,O+3),B.setTextColor(0,0,0),O+=12};B.setFillColor(79,70,229),B.rect(0,0,kt,38,"F"),B.setTextColor(255,255,255),B.setFontSize(20),B.setFont("helvetica","bold"),B.text("MathPulse AI",Me,16),B.setFontSize(11),B.setFont("helvetica","normal"),B.text("Student Intervention Report",Me,24),B.setFontSize(9),B.text(`Generated: ${new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}`,Me,32),B.setTextColor(0,0,0),O=48,je("Student Profile"),B.setFontSize(10),B.setFont("helvetica","normal");const yt=[["Name",me.student_name],["Grade Level",me.grade_level||"N/A"],["Section",me.section||"N/A"],["Risk Level",me.risk_level],["Average Score",`${me.avg_score}%`],["Engagement",me.engagement_level],["Weakest Topic",me.weakest_topic||"N/A"],["Last Active",me.last_active?new Date(me.last_active).toLocaleDateString():"Unknown"]];for(const[se,rt]of yt)ve(6),B.setFont("helvetica","bold"),B.text(`${se}:`,Me+2,O),B.setFont("helvetica","normal"),B.text(String(rt),Me+45,O),O+=6;if(O+=4,me.weak_topics?.length||Object.keys(me.accuracy_by_topic||{}).length){if(je("Risk Assessment & Topic Analysis"),B.setFontSize(10),me.weak_topics?.length){B.setFont("helvetica","bold"),B.text("Weak Topics:",Me+2,O),O+=6,B.setFont("helvetica","normal");for(const rt of me.weak_topics)ve(6),B.text(` • ${rt}`,Me+4,O),O+=5;O+=3}const se=Object.entries(me.accuracy_by_topic||{});if(se.length>0){B.setFont("helvetica","bold"),B.text("Topic Accuracy Breakdown:",Me+2,O),O+=7,B.setFontSize(9),B.setFont("helvetica","normal");for(const[rt,nt]of se.sort(([,ut],[,ws])=>ut-ws)){ve(7);const ut=60,ws=nt/100*ut;B.text(rt,Me+4,O),B.setFillColor(226,232,240),B.roundedRect(Me+70,O-3,ut,4,1,1,"F"),B.setFillColor(nt>=70?34:nt>=50?245:239,nt>=70?197:nt>=50?158:68,nt>=70?94:nt>=50?11:68),ws>0&&B.roundedRect(Me+70,O-3,ws,4,1,1,"F"),B.text(`${Math.round(nt)}%`,Me+70+ut+3,O),O+=7}O+=3}}if(je("AI Analysis & Insights"),B.setFontSize(10),me.learning_strengths&&(B.setFont("helvetica","bold"),B.text("Learning Strengths:",Me+2,O),O+=6,B.setFont("helvetica","normal"),qe(me.learning_strengths,4),O+=4),me.next_steps_summary&&(B.setFont("helvetica","bold"),ve(8),B.text("Recommended Next Steps:",Me+2,O),O+=6,B.setFont("helvetica","normal"),qe(me.next_steps_summary,4),O+=4),me.learning_path?.steps?.length){je("Personalized Learning Path"),B.setFontSize(9),B.setFont("helvetica","italic"),B.text(`Estimated Duration: ${me.learning_path.estimated_duration_days} days | Primary Focus: ${me.learning_path.primary_weak_topic}`,Me+2,O),O+=8,B.setFont("helvetica","normal"),B.setFontSize(10);for(const se of me.learning_path.steps){ve(18),B.setFillColor(99,102,241),B.circle(Me+6,O,3,"F"),B.setTextColor(255,255,255),B.setFontSize(8),B.text(String(se.step_number),Me+4.5,O+1.5),B.setTextColor(0,0,0),B.setFontSize(10),B.setFont("helvetica","bold"),B.text(se.title,Me+14,O+1),B.setFont("helvetica","normal"),B.setFontSize(9);const rt=`${se.type.replace("_"," ")} • ${se.duration_minutes} min • ${se.difficulty}${se.competency_tag?` • ${se.competency_tag}`:""}`;if(B.setTextColor(100,116,139),B.text(rt,Me+14,O+6),B.setTextColor(0,0,0),se.description){B.setFontSize(9);const nt=B.splitTextToSize(se.description,M-16);for(const ut of nt.slice(0,2))O+=5,ve(5),B.text(ut,Me+14,O+2)}O+=12}}if(me.teacher_recommendations?.length){je("Teacher Recommendations"),B.setFontSize(10),B.setFont("helvetica","normal");for(let se=0;se{Je(!0),ce("bank");try{const z=await gi(s);Ce(z)}catch{Ce([])}finally{Je(!1)}},className:"w-full flex items-start gap-4 p-4 rounded-[16px] border border-slate-200 hover:border-[#a855f7] hover:shadow-[0_4px_12px_rgba(168,85,247,0.08)] hover:bg-purple-50/30 transition-all group mb-3 text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[10px] bg-purple-50 border border-purple-100 flex items-center justify-center shrink-0 group-hover:bg-purple-100 transition-colors",children:e.jsx(dr,{className:"w-5 h-5 text-[#a855f7]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-0.5",children:"Choose from existing quizzes"}),e.jsx("p",{className:"text-[12px] text-[#64748b] font-medium",children:"Pick a quiz already in your Quiz Bank."})]})]}),e.jsxs("button",{onClick:()=>{Q(!1),Nt(!1),Ge(!0)},className:"w-full flex items-start gap-4 p-4 rounded-[16px] border border-slate-200 hover:border-[#a855f7] hover:shadow-[0_4px_12px_rgba(168,85,247,0.08)] hover:bg-purple-50/30 transition-all group text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[10px] bg-purple-50 border border-purple-100 flex items-center justify-center shrink-0 group-hover:bg-purple-100 transition-colors",children:e.jsx(ps,{className:"w-5 h-5 text-[#a855f7]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold text-[#1e293b] mb-0.5",children:"Create a new quiz"}),e.jsx("p",{className:"text-[12px] text-[#64748b] font-medium",children:"Use AI Quiz Maker. You can return here when done."})]})]})]}):e.jsx("div",{children:Ne?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3",children:[e.jsx("div",{className:"w-8 h-8 border-2 border-[#a855f7] border-t-transparent rounded-full animate-spin"}),e.jsx("p",{className:"text-[13px] text-[#64748b] font-medium",children:"Loading quizzes..."})]}):ae.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-purple-50 flex items-center justify-center",children:e.jsx(dr,{className:"w-6 h-6 text-[#a855f7]"})}),e.jsx("p",{className:"text-[14px] font-semibold text-[#1e293b]",children:"No quizzes yet"}),e.jsx("p",{className:"text-[12px] text-[#64748b]",children:"Create your first quiz using the AI Quiz Maker."})]}):e.jsx("div",{className:"space-y-3 max-h-[320px] overflow-y-auto pr-1",children:ae.map(z=>e.jsxs("div",{className:"flex items-center justify-between gap-3 p-4 rounded-[14px] border border-slate-200 hover:border-[#a855f7] hover:shadow-[0_2px_8px_rgba(168,85,247,0.08)] transition-all group",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[13px] font-bold text-[#1e293b] truncate",children:z.title}),e.jsxs("p",{className:"text-[11px] text-[#64748b] font-medium mt-0.5",children:[z.questions?.length??0," questions",z.gradeLevel?` · ${z.gradeLevel}`:"",z.metadata?.topicsCovered?.[0]?` · ${z.metadata.topicsCovered[0]}`:""]})]}),e.jsx("button",{onClick:()=>{Q(!1),ie.success(`"${z.title}" selected for ${t.name}`)},className:"shrink-0 px-3 py-1.5 rounded-full bg-[#a855f7] text-white text-[11px] font-bold hover:bg-[#9333ea] transition-colors shadow-sm",children:"Assign"})]},z.id))})})})]})]}),document.body),$e&&Gr.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/40 backdrop-blur-sm",onClick:()=>{ft?jt(!0):Ge(!1)}}),e.jsxs("div",{className:"fixed top-0 right-0 z-[9999] h-full w-full max-w-[88vw] xl:max-w-[1080px] bg-white shadow-[-8px_0_40px_rgba(0,0,0,0.15)] flex flex-col",style:{animation:"slideInFromRight 0.3s cubic-bezier(0.16,1,0.3,1)"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-slate-100 bg-white shrink-0",children:[e.jsxs("button",{onClick:()=>{ft?jt(!0):Ge(!1)},className:"flex items-center gap-2 text-[13px] font-semibold text-[#4f46e5] hover:text-[#3730a3] transition-colors bg-indigo-50 hover:bg-indigo-100 px-4 py-2 rounded-full",children:[e.jsx(lr,{className:"w-4 h-4"}),"Back to ",t.name]}),e.jsx("div",{className:"h-5 w-px bg-slate-200"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-[8px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center",children:e.jsx(Kr,{className:"w-3.5 h-3.5 text-white"})}),e.jsx("span",{className:"text-[14px] font-bold text-[#1e293b]",children:"AI Quiz Maker"})]}),ft&&e.jsx("span",{className:"ml-auto text-[11px] font-semibold text-amber-600 bg-amber-50 border border-amber-200 px-2.5 py-0.5 rounded-full",children:"Quiz in progress"})]}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(xl,{onBack:()=>Ge(!1),drawerMode:!0,gradeLevel:t.grade,onQuizGenerating:()=>Nt(!0),onQuizSaved:z=>{Nt(!1),ie.success("Quiz saved! Close this panel or create another.",{action:{label:"Close Panel",onClick:()=>Ge(!1)}})}})})]}),dt&&e.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:()=>jt(!1)}),e.jsxs("div",{className:"relative bg-white rounded-[20px] shadow-[0_24px_60px_rgba(0,0,0,0.2)] w-full max-w-[380px] p-7 z-10",children:[e.jsx("div",{className:"w-11 h-11 rounded-full bg-amber-50 border border-amber-200 flex items-center justify-center mb-4",children:e.jsx(gr,{className:"w-5 h-5 text-amber-500"})}),e.jsx("h3",{className:"text-[16px] font-bold text-[#1e293b] mb-2",children:"Discard quiz progress?"}),e.jsx("p",{className:"text-[13px] text-[#64748b] font-medium mb-6",children:"Your current quiz session will be lost if you close this panel. This cannot be undone."}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>jt(!1),className:"flex-1 py-2.5 rounded-full border border-slate-200 text-[13px] font-semibold text-[#475569] hover:bg-slate-50 transition-colors",children:"Keep editing"}),e.jsx("button",{onClick:()=>{jt(!1),Ge(!1),Nt(!1)},className:"flex-1 py-2.5 rounded-full bg-rose-500 hover:bg-rose-600 text-white text-[13px] font-semibold transition-colors",children:"Discard & close"})]})]})]}),e.jsx("style",{children:` + @keyframes slideInFromRight { + from { transform: translateX(100%); opacity: 0.6; } + to { transform: translateX(0); opacity: 1; } + } + `})]}),document.body),e.jsxs("div",{className:"w-full bg-white/80 rounded-[18px] p-[20px] shadow-[0_1px_4px_rgba(0,0,0,0.02)] border border-white mt-auto",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-[#1e293b] mb-4",children:"Section Assignment"}),e.jsxs("div",{className:"space-y-[12px]",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1.5 block ml-1",children:"Grade Level"}),e.jsx("div",{className:"relative",children:e.jsx(Cs,{value:R,onChange:z=>W(z.target.value),placeholder:"Grade",className:"appearance-none w-full bg-[#f8fafc] border border-[#e2e8f0] text-[#475569] text-[13px] font-medium rounded-[14px] px-4 py-2.5 outline-none focus:border-[#a855f7] focus:ring-1 focus:ring-[#a855f7] h-auto"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-semibold text-[#64748b] uppercase tracking-wider mb-1.5 block ml-1",children:"Section"}),e.jsx("div",{className:"relative",children:e.jsx(Cs,{value:f,onChange:z=>k(z.target.value),placeholder:"Section",className:"appearance-none w-full bg-[#f8fafc] border border-[#e2e8f0] text-[#475569] text-[13px] font-medium rounded-[14px] px-4 py-2.5 outline-none focus:border-[#a855f7] focus:ring-1 focus:ring-[#a855f7] h-auto"})})]}),e.jsx("button",{onClick:os,disabled:w||!R.trim()||!f.trim(),className:"w-full bg-white hover:bg-[#f8fafc] disabled:opacity-50 text-[#4f46e5] border border-[#e0e7ff] text-[13px] font-semibold rounded-[14px] px-4 py-2.5 transition-colors shadow-[0_1px_4px_rgba(0,0,0,0.02)] mt-2",children:w?"Updating...":"Update Assignment"})]})]})]})}),C&&e.jsx(im,{step:C,studentId:t.id,studentName:t.name,totalSteps:p?.learning_path?.steps?.length||3,onClose:()=>S(null),onStepCompleted:()=>{S(null),an(t.id).then(h).catch(()=>{})}})]})},ii=({onViewCalendar:t,onOpenProfile:s,userProfile:a,teacherName:r,liveActivity:o=[]})=>{const{currentUser:n}=hs(),[i,l]=u.useState(new Date),[c,d]=u.useState("pulse"),[m,p]=u.useState([]),[h,b]=u.useState(!1);u.useEffect(()=>{if(!n?.uid)return;const w=fl(n.uid,{limitCount:100},$=>p($),()=>{});return()=>w()},[n?.uid]);const N=w=>new Date(w.getFullYear(),w.getMonth()+1,0).getDate(),C=w=>new Date(w.getFullYear(),w.getMonth(),1).getDay(),S=()=>i.toLocaleDateString(void 0,{month:"long",year:"numeric"}),v=()=>l(new Date(i.getFullYear(),i.getMonth()-1)),g=()=>l(new Date(i.getFullYear(),i.getMonth()+1)),I=()=>{const w=N(i),$=C(i),A=[];for(let y=$-1;y>=0;y--)A.unshift(null);for(let y=1;y<=w;y++)A.push(y);return A},L=w=>{if(!w)return!1;const $=new Date;return w===$.getDate()&&i.getMonth()===$.getMonth()&&i.getFullYear()===$.getFullYear()},R=I(),W=["Mo","Tu","We","Th","Fr","Sa","Su"],f=w=>{if(!w)return!1;const $=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(w).padStart(2,"0")}`;return m.some(A=>{const y=new Date(A.startTime);return`${y.getFullYear()}-${String(y.getMonth()+1).padStart(2,"0")}-${String(y.getDate()).padStart(2,"0")}`===$})},k=w=>{if(!w)return;const $=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(w).padStart(2,"0")}`,A=m.filter(y=>{const q=new Date(y.startTime);return`${q.getFullYear()}-${String(q.getMonth()+1).padStart(2,"0")}-${String(q.getDate()).padStart(2,"0")}`===$});if(A.length!==0)return A.map(y=>`• ${y.title}`).join(` +`)};return e.jsxs("aside",{className:"w-[280px] bg-white border-l border-[#e2e8f0] flex flex-col flex-shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"p-[22px_16px_10px] border-b border-[#f1f5f9] flex flex-col items-center gap-[5px]",children:[e.jsx("div",{className:"w-[48px] h-[48px] rounded-full bg-[#e0e7ff] flex items-center justify-center text-[22px] text-[#4f46e5] shadow-[0_0_0_3px_#c7d2fe] flex-shrink-0",children:e.jsx(Ul,{src:a?.photo,name:r,className:"w-full h-full rounded-full"})}),e.jsx("div",{className:"text-[13.5px] font-semibold text-[#1e293b] mt-1",children:r}),e.jsx("div",{className:"text-[11px] text-[#94a3b8]",children:"Teacher"}),e.jsx("button",{onClick:s,className:"mt-[4px] py-[6px] px-[22px] bg-[#818cf8] hover:bg-[#6366f1] text-white rounded-full text-[11.5px] font-medium transition-colors",children:"Profile"})]}),e.jsxs("div",{className:"border-b border-[#f1f5f9]",children:[e.jsxs("div",{className:"p-[10px_16px_8px] flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:w=>{w.stopPropagation(),v()},className:"w-6 h-6 flex items-center justify-center bg-white border border-[#e2e8f0] rounded-[7px] text-[#64748b] hover:bg-[#f8fafc] cursor-pointer text-[14px] z-10",children:e.jsx(zs,{size:14})}),e.jsx("span",{className:"text-[12px] font-semibold text-[#1e293b] hover:text-[#4f46e5] transition-colors cursor-pointer",onClick:t,children:S()}),e.jsx("button",{onClick:w=>{w.stopPropagation(),g()},className:"w-6 h-6 flex items-center justify-center bg-white border border-[#e2e8f0] rounded-[7px] text-[#64748b] hover:bg-[#f8fafc] cursor-pointer text-[14px] z-10",children:e.jsx(Rs,{size:14})})]}),e.jsx("button",{onClick:()=>b(w=>!w),className:"w-6 h-6 flex items-center justify-center rounded-[7px] text-[#94a3b8] hover:bg-[#f1f5f9] hover:text-[#64748b] transition-colors",title:h?"Show calendar":"Hide calendar","aria-label":h?"Expand calendar":"Collapse calendar",children:e.jsx($t,{size:14,className:`transition-transform duration-200 ${h?"":"rotate-180"}`})})]}),e.jsx(zt,{initial:!1,children:!h&&e.jsx(ze.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22,ease:"easeInOut"},className:"overflow-hidden",children:e.jsx("div",{className:"px-[16px] pb-[10px] cursor-pointer hover:bg-slate-50 transition-colors group/cal",onClick:t,children:e.jsxs("div",{className:"grid grid-cols-7 gap-[2px] text-center mb-1",children:[W.map(w=>e.jsx("div",{className:"text-[10px] font-semibold text-[#94a3b8] p-[2px_0_4px]",children:w},w)),R.map((w,$)=>e.jsxs("div",{className:"relative flex flex-col items-center justify-center h-[28px]",title:k(w),children:[e.jsx("div",{className:`text-[11px] leading-[22px] w-[22px] h-[22px] flex items-center justify-center rounded-full transition-all ${w===null?"text-[#cbd5e1]":L(w)?"bg-[#818cf8] text-white font-semibold":"text-[#475569] group-hover/cal:bg-slate-100"}`,children:w}),w!==null&&f(w)&&e.jsx("div",{className:`absolute bottom-0 w-1 h-1 rounded-full ${L(w)?"bg-white":"bg-[#a855f7]"}`})]},`${i.getMonth()}-${$}`))]})})},"cal-grid")})]}),e.jsxs("div",{className:"flex gap-[18px] p-[12px_16px_0] border-b border-[#f1f5f9] flex-shrink-0",children:[e.jsx("button",{onClick:()=>d("pulse"),className:`text-[11.5px] font-semibold pb-[9px] border-b-[2.5px] transition-colors ${c==="pulse"?"text-[#10b981] border-[#10b981]":"text-[#94a3b8] border-transparent"}`,children:"Live pulse"}),e.jsx("button",{onClick:()=>d("reminders"),className:`text-[11.5px] font-semibold pb-[9px] border-b-[2.5px] transition-colors ${c==="reminders"?"text-[#10b981] border-[#10b981]":"text-[#94a3b8] border-transparent"}`,children:"Reminders"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-[14px_16px]",children:[c==="pulse"&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("div",{className:"text-[10px] font-bold text-[#64748b] uppercase tracking-wider",children:"Live Activity Stream"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),e.jsx("span",{className:"text-[9px] font-bold text-emerald-600",children:"LIVE"})]})]}),o.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center opacity-40",children:[e.jsx(fi,{size:32,className:"text-slate-300 mb-2"}),e.jsx("p",{className:"text-[11px] font-bold text-[#1e293b]",children:"No recent activity"})]}):e.jsx("div",{className:"space-y-4",children:o.slice(0,5).map(w=>e.jsxs("div",{className:"relative pl-5 before:absolute before:left-1.5 before:top-2 before:bottom-[-16px] before:w-[1px] before:bg-slate-100 last:before:hidden",children:[e.jsx("div",{className:"absolute left-0 top-1.5 w-3 h-3 rounded-full border-2 border-white bg-indigo-500 shadow-sm z-10"}),e.jsxs("div",{className:"bg-white border border-[#f1f5f9] rounded-xl p-3 shadow-sm hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex justify-between items-start mb-1",children:[e.jsx("span",{className:"text-[12px] font-bold text-[#1e293b] truncate",children:w.student}),e.jsx("span",{className:"text-[9px] font-medium text-[#94a3b8] shrink-0",children:w.time})]}),e.jsxs("p",{className:"text-[11px] text-[#64748b] leading-snug",children:[w.action," ",e.jsx("span",{className:"font-bold text-[#4f46e5]",children:w.topic})]})]})]},w.id))})]}),c==="reminders"&&e.jsxs("div",{className:"space-y-3",children:[m.filter(w=>{const $=new Date;return $.setHours(0,0,0,0),new Date(w.startTime).getTime()>=$.getTime()}).sort((w,$)=>new Date(w.startTime).getTime()-new Date($.startTime).getTime()).slice(0,5).map(w=>{const $=new Date(w.startTime).toDateString()===new Date().toDateString();return e.jsxs("div",{onClick:t,className:"flex items-start gap-3 p-3 border border-[#f1f5f9] rounded-[14px] cursor-pointer hover:bg-slate-50 transition-colors group",children:[e.jsx("div",{className:`p-2 rounded-xl border border-[#f1f5f9] bg-white text-[14px] flex-shrink-0 shadow-sm transition-transform group-hover:scale-105 ${$?"text-rose-500":"text-[#4f46e5]"}`,children:e.jsx(rr,{size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[12px] font-bold text-[#1e293b] mb-0.5 truncate",children:w.title}),e.jsxs("div",{className:`text-[10px] font-medium ${$?"text-rose-500 font-bold":"text-[#94a3b8]"}`,children:[$?"Today, ":"",new Date(w.startTime).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]})]},w.id)}),m.filter(w=>new Date(w.startTime).getTime()>=new Date().setHours(0,0,0,0)).length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center opacity-40",children:[e.jsx(cr,{size:32,className:"text-slate-300 mb-2"}),e.jsx("p",{className:"text-[11px] font-bold text-[#1e293b]",children:"No upcoming tasks"})]})]})]})]})};export{eh as default}; diff --git a/assets/XPNotification-LB3BKZhf.js b/assets/XPNotification-D9mC9Rv1.js similarity index 89% rename from assets/XPNotification-LB3BKZhf.js rename to assets/XPNotification-D9mC9Rv1.js index 17c76109c87c8fde498ed303da8268c082beff62..70b6385b2ab56ff2d9b2ae9890d044828e0fca7a 100644 --- a/assets/XPNotification-LB3BKZhf.js +++ b/assets/XPNotification-D9mC9Rv1.js @@ -1 +1 @@ -import{r as l,b as n,j as e}from"./vendor-react-B4AQeu28.js";import{h as c,m as r,a7 as m}from"./index-Cvals0ud.js";import{S as x}from"./sparkles-Chs7kbc0.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const w=({xp:i,message:a,show:t,onComplete:s})=>(l.useEffect(()=>{if(t){const o=setTimeout(()=>{s()},3e3);return()=>clearTimeout(o)}},[t,s]),n.createPortal(e.jsx(c,{children:t&&e.jsx(r.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-8 left-1/2 -translate-x-1/2 z-[300]",style:{willChange:"transform, opacity"},children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-400 via-orange-500 to-rose-500 text-white px-6 py-4 rounded-2xl shadow-2xl border-2 border-rose-300 flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(m,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(r.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:e.jsx(x,{size:16,className:"text-rose-200"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:a}),e.jsxs("p",{className:"text-2xl font-black",children:["+",i," XP"]})]})]})})}),document.body));export{w as default}; +import{r as l,b as n,j as e}from"./vendor-react-B4AQeu28.js";import{h as c,m as r,a7 as m}from"./index-D9TvEOZX.js";import{S as x}from"./sparkles-BLpoopVP.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const w=({xp:i,message:a,show:t,onComplete:s})=>(l.useEffect(()=>{if(t){const o=setTimeout(()=>{s()},3e3);return()=>clearTimeout(o)}},[t,s]),n.createPortal(e.jsx(c,{children:t&&e.jsx(r.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-8 left-1/2 -translate-x-1/2 z-[300]",style:{willChange:"transform, opacity"},children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-400 via-orange-500 to-rose-500 text-white px-6 py-4 rounded-2xl shadow-2xl border-2 border-rose-300 flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(m,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(r.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:e.jsx(x,{size:16,className:"text-rose-200"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:a}),e.jsxs("p",{className:"text-2xl font-black",children:["+",i," XP"]})]})]})})}),document.body));export{w as default}; diff --git a/assets/automationService-bOdf9kmP.js b/assets/automationService-BZunccIA.js similarity index 96% rename from assets/automationService-bOdf9kmP.js rename to assets/automationService-BZunccIA.js index d34c0483a6d10cf5323b792ba1efa823bd441453..36b1a8bd27f2f706e21271b3bb2347d5d8b29b47 100644 --- a/assets/automationService-bOdf9kmP.js +++ b/assets/automationService-BZunccIA.js @@ -1 +1 @@ -import{doc as g,collection as a,serverTimestamp as c,setDoc as l,addDoc as D,query as b,where as z,getDocs as A,updateDoc as Q,writeBatch as $}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as r,b4 as _}from"./index-Cvals0ud.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const m=async(e,n,o,u,i)=>{try{const t=g(a(r,"notifications")),s={id:t.id,userId:e,type:n,title:o,message:u,read:!1,...i?{actionUrl:i}:{},createdAt:new Date},d={id:s.id,userId:s.userId,type:s.type,title:s.title,message:s.message,read:s.read,createdAt:c(),link:i||null};return await l(t,{...d}),s}catch(t){throw console.error("Error creating notification:",t),t}};async function M(e){if(!e)return 0;const n=a(r,"deepDiagnosticAssignments"),o=b(n,z("lrn","==",e));return(await A(o)).docs.filter(i=>{const t=i.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function x(e,n,o="Grade 11",u,i="iar_only",t="initial_assessment",s){if(t==="followup_diagnostic"){const d=a(r,"deepDiagnosticAssignments"),C=b(d,z("lrn","==",e)),f=await A(C);if(!f.empty){const p=$(r);let w=!1;for(const h of f.docs){const I=h.data().status;(I==="pending"||I==="queued")&&(p.update(h.ref,{status:"in_progress",startedAt:c()}),w=!0)}w&&await p.commit()}}return await l(g(r,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:o,workflowMode:i,assessmentType:t,questionBreakdown:u||null,topicBreakdown:s||null,completedAt:c(),processed:!1,processing:!1}),{success:!0,event:"diagnostic_completed",lrn:e,message:`Diagnostic submitted for ${e}. Processing will begin automatically.`,remedialQuizzesCreated:0,notifications:["Your diagnostic results are being processed. Check back shortly!"]}}async function N(e){return await D(a(r,"quizResults"),{lrn:e.lrn,studentId:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:c()}),{success:!0,event:"quiz_submitted",lrn:e.lrn,message:`Quiz submitted for ${e.lrn}. Risk recalculation will run automatically.`,remedialQuizzesCreated:0,notifications:[`Quiz result recorded for ${e.subject}.`]}}async function W(e){return await _(e.lrn),await m(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await m(e.teacherId,"message","New Student Enrolled",`${e.name} has joined. Diagnostic assessment is pending.`),{success:!0,event:"student_enrolled",lrn:e.lrn,message:`Student ${e.name} enrolled and initialised`,remedialQuizzesCreated:0,notifications:[`Welcome ${e.name}! Please complete the diagnostic assessment.`]}}async function G(e){return await D(a(r,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:c(),processed:!1}),await m(e.teacherId,"message","Data Import Processed",`Data import complete — ${e.students.length} student records processed.`),{success:!0,event:"data_imported",message:`Data import processed for ${e.students.length} students`,remedialQuizzesCreated:0,notifications:[`Data import complete — ${e.students.length} student records processed.`]}}async function Y(e){const n=g(r,"curriculumContent",e.contentId);return e.action==="delete"?await Q(n,{deleted:!0,deletedBy:e.adminId,deletedAt:c(),contentType:e.contentType,subjectId:e.subjectId||null}):await l(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:c()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{M as getPendingDeepDiagnosticCount,Y as triggerContentUpdated,G as triggerDataImported,x as triggerDiagnosticCompleted,N as triggerQuizSubmitted,W as triggerStudentEnrolled}; +import{doc as g,collection as a,serverTimestamp as c,setDoc as l,addDoc as D,query as b,where as z,getDocs as A,updateDoc as Q,writeBatch as $}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as r,b4 as _}from"./index-D9TvEOZX.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const m=async(e,n,o,u,i)=>{try{const t=g(a(r,"notifications")),s={id:t.id,userId:e,type:n,title:o,message:u,read:!1,...i?{actionUrl:i}:{},createdAt:new Date},d={id:s.id,userId:s.userId,type:s.type,title:s.title,message:s.message,read:s.read,createdAt:c(),link:i||null};return await l(t,{...d}),s}catch(t){throw console.error("Error creating notification:",t),t}};async function M(e){if(!e)return 0;const n=a(r,"deepDiagnosticAssignments"),o=b(n,z("lrn","==",e));return(await A(o)).docs.filter(i=>{const t=i.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function x(e,n,o="Grade 11",u,i="iar_only",t="initial_assessment",s){if(t==="followup_diagnostic"){const d=a(r,"deepDiagnosticAssignments"),C=b(d,z("lrn","==",e)),f=await A(C);if(!f.empty){const p=$(r);let w=!1;for(const h of f.docs){const I=h.data().status;(I==="pending"||I==="queued")&&(p.update(h.ref,{status:"in_progress",startedAt:c()}),w=!0)}w&&await p.commit()}}return await l(g(r,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:o,workflowMode:i,assessmentType:t,questionBreakdown:u||null,topicBreakdown:s||null,completedAt:c(),processed:!1,processing:!1}),{success:!0,event:"diagnostic_completed",lrn:e,message:`Diagnostic submitted for ${e}. Processing will begin automatically.`,remedialQuizzesCreated:0,notifications:["Your diagnostic results are being processed. Check back shortly!"]}}async function N(e){return await D(a(r,"quizResults"),{lrn:e.lrn,studentId:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:c()}),{success:!0,event:"quiz_submitted",lrn:e.lrn,message:`Quiz submitted for ${e.lrn}. Risk recalculation will run automatically.`,remedialQuizzesCreated:0,notifications:[`Quiz result recorded for ${e.subject}.`]}}async function W(e){return await _(e.lrn),await m(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await m(e.teacherId,"message","New Student Enrolled",`${e.name} has joined. Diagnostic assessment is pending.`),{success:!0,event:"student_enrolled",lrn:e.lrn,message:`Student ${e.name} enrolled and initialised`,remedialQuizzesCreated:0,notifications:[`Welcome ${e.name}! Please complete the diagnostic assessment.`]}}async function G(e){return await D(a(r,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:c(),processed:!1}),await m(e.teacherId,"message","Data Import Processed",`Data import complete — ${e.students.length} student records processed.`),{success:!0,event:"data_imported",message:`Data import processed for ${e.students.length} students`,remedialQuizzesCreated:0,notifications:[`Data import complete — ${e.students.length} student records processed.`]}}async function Y(e){const n=g(r,"curriculumContent",e.contentId);return e.action==="delete"?await Q(n,{deleted:!0,deletedBy:e.adminId,deletedAt:c(),contentType:e.contentType,subjectId:e.subjectId||null}):await l(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:c()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{M as getPendingDeepDiagnosticCount,Y as triggerContentUpdated,G as triggerDataImported,x as triggerDiagnosticCompleted,N as triggerQuizSubmitted,W as triggerStudentEnrolled}; diff --git a/assets/bell-oitWfCwK.js b/assets/bell-Ci_PX33B.js similarity index 91% rename from assets/bell-oitWfCwK.js rename to assets/bell-Ci_PX33B.js index ee5af89c443978e910eb09381aebc323e2370428..e5fa3f3df6efe94df3a8bc116261db91f22e2687 100644 --- a/assets/bell-oitWfCwK.js +++ b/assets/bell-Ci_PX33B.js @@ -1,4 +1,4 @@ -import{e}from"./index-Cvals0ud.js";/** +import{e}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/button-CanHmtQ3.js b/assets/button-DC8Fz5kC.js similarity index 94% rename from assets/button-CanHmtQ3.js rename to assets/button-DC8Fz5kC.js index 155d991d5f98c9b8c87c5bd3cf99104c02a2e1b9..c692127e36dfee237f5ce1e551a1c385528bc7e1 100644 --- a/assets/button-CanHmtQ3.js +++ b/assets/button-DC8Fz5kC.js @@ -1 +1 @@ -import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-BPuEd8FG.js";import{c as V}from"./vendor-charts-CAmziV1y.js";import{o as p}from"./index-Cvals0ud.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,j=(n,r)=>e=>{var o;if(r?.variants==null)return m(n,e?.class,e?.className);const{variants:u,defaultVariants:i}=r,b=Object.keys(u).map(t=>{const a=e?.[t],d=i?.[t];if(a===null)return null;const s=g(a)||g(d);return u[t][s]}),v=e&&Object.entries(e).reduce((t,a)=>{let[d,s]=a;return s===void 0||(t[d]=s),t},{}),f=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((t,a)=>{let{class:d,className:s,...h}=a;return Object.entries(h).every(x=>{let[c,l]=x;return Array.isArray(l)?l.includes({...i,...v}[c]):{...i,...v}[c]===l})?[...t,d,s]:t},[]);return m(n,b,f,e?.class,e?.className)},N=j("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function w({className:n,variant:r,size:e,asChild:o=!1,...u}){const i=o?k:"button";return y.jsx(i,{"data-slot":"button",className:p(N({variant:r,size:e,className:n})),...u})}export{w as B,j as c}; +import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-C5nwdvGr.js";import{c as V}from"./vendor-charts-CAmziV1y.js";import{o as p}from"./index-D9TvEOZX.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,j=(n,r)=>e=>{var o;if(r?.variants==null)return m(n,e?.class,e?.className);const{variants:u,defaultVariants:i}=r,b=Object.keys(u).map(t=>{const a=e?.[t],d=i?.[t];if(a===null)return null;const s=g(a)||g(d);return u[t][s]}),v=e&&Object.entries(e).reduce((t,a)=>{let[d,s]=a;return s===void 0||(t[d]=s),t},{}),f=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((t,a)=>{let{class:d,className:s,...h}=a;return Object.entries(h).every(x=>{let[c,l]=x;return Array.isArray(l)?l.includes({...i,...v}[c]):{...i,...v}[c]===l})?[...t,d,s]:t},[]);return m(n,b,f,e?.class,e?.className)},N=j("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function w({className:n,variant:r,size:e,asChild:o=!1,...u}){const i=o?k:"button";return y.jsx(i,{"data-slot":"button",className:p(N({variant:r,size:e,className:n})),...u})}export{w as B,j as c}; diff --git a/assets/chart-column-NTUNS-L9.js b/assets/chart-column-BwIV9b12.js similarity index 89% rename from assets/chart-column-NTUNS-L9.js rename to assets/chart-column-BwIV9b12.js index a3056fb6f4b0c0ae1540a13dca5ae2a49aff81ba..cdc2a9dc93bd4b17e81cbb166b999fc0f828c0cb 100644 --- a/assets/chart-column-NTUNS-L9.js +++ b/assets/chart-column-BwIV9b12.js @@ -1,4 +1,4 @@ -import{e as t}from"./index-Cvals0ud.js";/** +import{e as t}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chatService-DQPU-_oL.js b/assets/chatService-CmuZxVTC.js similarity index 95% rename from assets/chatService-DQPU-_oL.js rename to assets/chatService-CmuZxVTC.js index 462d712a5109fab72a975e2d50e51f6f132b45be..9edc9a9887d296d343ffc8827c125cd9ba0c4b5e 100644 --- a/assets/chatService-DQPU-_oL.js +++ b/assets/chatService-CmuZxVTC.js @@ -1 +1 @@ -import{doc as c,collection as u,getDoc as g,serverTimestamp as i,setDoc as w,updateDoc as p,query as l,where as d,orderBy as y,getDocs as A}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as a}from"./index-Cvals0ud.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const Q=async(s,t="New Conversation")=>{try{const e=c(u(a,"chatSessions")),n={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...n,createdAt:i(),updatedAt:i()}),n}catch(e){throw console.error("Error creating chat session:",e),e}},R=async s=>{try{const t=l(u(a,"chatSessions"),d("userId","==",s),d("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(n=>{const r=n.data();return{...r,createdAt:r.createdAt?.toDate()||new Date,updatedAt:r.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},b=async s=>{try{const t=await g(c(a,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},q=async(s,t,e,n)=>{try{const r=c(u(a,"chatMessages")),o={id:r.id,userId:"",role:t,content:e,timestamp:new Date,...n?{context:n}:{}},m=await g(c(a,"chatSessions",s));m.exists()&&(o.userId=m.data().userId);const h={id:o.id,userId:o.userId,role:o.role,content:o.content,sessionId:s,timestamp:i()};return o.context&&(h.context=o.context),await w(r,h),await p(c(a,"chatSessions",s),{updatedAt:i()}),o}catch(r){throw console.error("Error adding message:",r),r}},B=async(s,t)=>{try{const e=l(u(a,"chatMessages"),d("sessionId","==",s),d("userId","==",t),y("timestamp","asc"));return(await A(e)).docs.map(r=>{const o=r.data();return{...o,timestamp:o.timestamp?.toDate()||new Date}})}catch(e){return console.error("Error getting session messages:",e),[]}},N=async(s,t)=>{try{await p(c(a,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},U=async s=>{try{await p(c(a,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{q as addMessageToSession,Q as createChatSession,U as deleteSession,b as getChatSession,B as getSessionMessages,R as getUserChatSessions,N as updateSessionTitle}; +import{doc as c,collection as u,getDoc as g,serverTimestamp as i,setDoc as w,updateDoc as p,query as l,where as d,orderBy as y,getDocs as A}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as a}from"./index-D9TvEOZX.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const Q=async(s,t="New Conversation")=>{try{const e=c(u(a,"chatSessions")),n={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...n,createdAt:i(),updatedAt:i()}),n}catch(e){throw console.error("Error creating chat session:",e),e}},R=async s=>{try{const t=l(u(a,"chatSessions"),d("userId","==",s),d("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(n=>{const r=n.data();return{...r,createdAt:r.createdAt?.toDate()||new Date,updatedAt:r.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},b=async s=>{try{const t=await g(c(a,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},q=async(s,t,e,n)=>{try{const r=c(u(a,"chatMessages")),o={id:r.id,userId:"",role:t,content:e,timestamp:new Date,...n?{context:n}:{}},m=await g(c(a,"chatSessions",s));m.exists()&&(o.userId=m.data().userId);const h={id:o.id,userId:o.userId,role:o.role,content:o.content,sessionId:s,timestamp:i()};return o.context&&(h.context=o.context),await w(r,h),await p(c(a,"chatSessions",s),{updatedAt:i()}),o}catch(r){throw console.error("Error adding message:",r),r}},B=async(s,t)=>{try{const e=l(u(a,"chatMessages"),d("sessionId","==",s),d("userId","==",t),y("timestamp","asc"));return(await A(e)).docs.map(r=>{const o=r.data();return{...o,timestamp:o.timestamp?.toDate()||new Date}})}catch(e){return console.error("Error getting session messages:",e),[]}},N=async(s,t)=>{try{await p(c(a,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},U=async s=>{try{await p(c(a,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{q as addMessageToSession,Q as createChatSession,U as deleteSession,b as getChatSession,B as getSessionMessages,R as getUserChatSessions,N as updateSessionTitle}; diff --git a/assets/check-BVDfRV4g.js b/assets/check-Ceq9J6wq.js similarity index 85% rename from assets/check-BVDfRV4g.js rename to assets/check-Ceq9J6wq.js index 6f6903ba5889f995611532b3a01012ca85e79f85..5b206ed88cfa68ca2a7aa91ab89d288a310b2230 100644 --- a/assets/check-BVDfRV4g.js +++ b/assets/check-Ceq9J6wq.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Cvals0ud.js";/** +import{e as c}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chevron-left-BVt9k3oq.js b/assets/chevron-left-C7NnvvA7.js similarity index 86% rename from assets/chevron-left-BVt9k3oq.js rename to assets/chevron-left-C7NnvvA7.js index aef528de2013723e7ed4d7244786756d1c4613f5..5c76be9af06bbdb3304215c551b7163af0b18a10 100644 --- a/assets/chevron-left-BVt9k3oq.js +++ b/assets/chevron-left-C7NnvvA7.js @@ -1,4 +1,4 @@ -import{e}from"./index-Cvals0ud.js";/** +import{e}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chevron-right-DMwHUP8W.js b/assets/chevron-right-Jv12kepm.js similarity index 85% rename from assets/chevron-right-DMwHUP8W.js rename to assets/chevron-right-Jv12kepm.js index f01fb630c0becc5499f1e869551dbb8ad1a5b25e..39def0f93d1ba0f62432ba8fdb2eb6be36dce9e1 100644 --- a/assets/chevron-right-DMwHUP8W.js +++ b/assets/chevron-right-Jv12kepm.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-Cvals0ud.js";/** +import{e as o}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chevron-up-CzNRBnCs.js b/assets/chevron-up-C5341jJ8.js similarity index 92% rename from assets/chevron-up-CzNRBnCs.js rename to assets/chevron-up-C5341jJ8.js index 35cbd1a72b1c74d3bced44d57292dd58f0f85702..92b474a6a63a53e57b848bbacdded5acb8d86796 100644 --- a/assets/chevron-up-CzNRBnCs.js +++ b/assets/chevron-up-C5341jJ8.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-Cvals0ud.js";/** +import{e as o}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-alert-lQsWFo4p.js b/assets/circle-alert-B7tHo7_X.js similarity index 90% rename from assets/circle-alert-lQsWFo4p.js rename to assets/circle-alert-B7tHo7_X.js index 94800718d3aa838183aa1444c2a20d74ac8e3e34..6f9b035fc8cc51f4eeefc706d600f80ad1f36e4b 100644 --- a/assets/circle-alert-lQsWFo4p.js +++ b/assets/circle-alert-B7tHo7_X.js @@ -1,4 +1,4 @@ -import{e}from"./index-Cvals0ud.js";/** +import{e}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-Bi1b5YEO.js b/assets/circle-check-C6IXGFgm.js similarity index 87% rename from assets/circle-check-Bi1b5YEO.js rename to assets/circle-check-C6IXGFgm.js index 5b4cf51acdd34392b5ea2f0fa886e176c61d09ad..28420c22de852ece330523d07abf3bb2947bcc5a 100644 --- a/assets/circle-check-Bi1b5YEO.js +++ b/assets/circle-check-C6IXGFgm.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Cvals0ud.js";/** +import{e as c}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-big-6fwaSN-C.js b/assets/circle-check-big-yn5lhjQR.js similarity index 88% rename from assets/circle-check-big-6fwaSN-C.js rename to assets/circle-check-big-yn5lhjQR.js index a93362828973ebdf0814babe7aa829a76de2c304..4db978ffd65f042ab831a8c53c704267917e6965 100644 --- a/assets/circle-check-big-6fwaSN-C.js +++ b/assets/circle-check-big-yn5lhjQR.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Cvals0ud.js";/** +import{e as c}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-help-Bpd0FWyO.js b/assets/circle-help-BNf4DSN0.js similarity index 89% rename from assets/circle-help-Bpd0FWyO.js rename to assets/circle-help-BNf4DSN0.js index ec7145a3b3532a16673660b9b48485ada26a86ef..831b04de92a7ac87d4a6d6ceafcc05b14cc076bc 100644 --- a/assets/circle-help-Bpd0FWyO.js +++ b/assets/circle-help-BNf4DSN0.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Cvals0ud.js";/** +import{e as c}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/clipboard-check-Dml7qHk3.js b/assets/clipboard-check-DEpL_ccN.js similarity index 91% rename from assets/clipboard-check-Dml7qHk3.js rename to assets/clipboard-check-DEpL_ccN.js index 791e5ba10215c9294cfe99b3405b5a47b5c20a76..de8787ae9abc9ec5622b3bbf6d0ddb6e3869cde3 100644 --- a/assets/clipboard-check-Dml7qHk3.js +++ b/assets/clipboard-check-DEpL_ccN.js @@ -1,4 +1,4 @@ -import{e}from"./index-Cvals0ud.js";/** +import{e}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/clock-BsCO0o69.js b/assets/clock-BPtF2Ddk.js similarity index 87% rename from assets/clock-BsCO0o69.js rename to assets/clock-BPtF2Ddk.js index b3152523f20665852d156fb51f498f7278c49faa..3e86b6ee67c56acc7b558e259bdfd9d601fb5b21 100644 --- a/assets/clock-BsCO0o69.js +++ b/assets/clock-BPtF2Ddk.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Cvals0ud.js";/** +import{e as c}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/diagnosticService-ByxEbtPN.js b/assets/diagnosticService-Bx7r3sIn.js similarity index 89% rename from assets/diagnosticService-ByxEbtPN.js rename to assets/diagnosticService-Bx7r3sIn.js index 19801ed79afac1efe4b98f73a11e336267f48472..7f94145c48478cff2383efbffe865ac60dd05cc6 100644 --- a/assets/diagnosticService-ByxEbtPN.js +++ b/assets/diagnosticService-Bx7r3sIn.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cvals0ud.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-B-vquVVw.css"])))=>i.map(i=>d[i]); -import{_ as w}from"./index-Cvals0ud.js";const y="https://deign86-mathpulse-api-v3test.hf.space";async function P(g,h){const f=`${y}/api/diagnostic/generate`,{auth:i}=await w(async()=>{const{auth:e}=await import("./index-Cvals0ud.js").then(a=>a.b6);return{auth:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),c=i.currentUser,l=async()=>{const e=new Headers({"Content-Type":"application/json"});if(c){const a=await c.getIdToken(!1);a&&e.set("Authorization",`Bearer ${a}`)}return e},u=async e=>fetch(f,{method:"POST",headers:await l(),body:JSON.stringify({strand:g,grade_level:h}),signal:e}),d=(e,a)=>{let t="Something went wrong. Please try again.";try{const s=JSON.parse(a);if(s.detail){const o=String(s.detail);o.includes("Database unavailable")||o.includes("unavailable")?t="Our servers are temporarily busy. Please try again in a moment.":o.includes("timeout")||o.includes("timed out")?t="The request timed out. Please check your connection and try again.":t=o}}catch{!e.ok&&a&&(t="Failed to start assessment. Please try again.")}return t},n=2,r=3e4;for(let e=1;e<=n;e++){const a=new AbortController,t=setTimeout(()=>a.abort(),r);try{const s=await u(a.signal);if(s.ok)return clearTimeout(t),s.json();if(s.status>=400&&s.status<500){clearTimeout(t);const m=await s.text().catch(()=>"");throw new Error(d(s,m))}const o=await s.text().catch(()=>""),p=d(s,o);if(clearTimeout(t),esetTimeout(T,m));continue}throw new Error(p)}catch(s){if(clearTimeout(t),s instanceof DOMException&&s.name==="AbortError"){if(e{const{auth:n}=await import("./index-Cvals0ud.js").then(r=>r.b6);return{auth:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),l=c.currentUser;if(l){const n=await l.getIdToken(!1);n&&i.set("Authorization",`Bearer ${n}`)}const u=new AbortController,d=setTimeout(()=>u.abort(),6e4);try{const n=await fetch(f,{method:"POST",headers:i,body:JSON.stringify({test_id:g,responses:h}),signal:u.signal});if(!n.ok){const r=await n.text().catch(()=>"");let e="Something went wrong. Please try again.";try{const a=JSON.parse(r);if(a.detail){const t=String(a.detail);t.includes("session")||t.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":t.includes("Database unavailable")||t.includes("unavailable")?e="Our servers are temporarily busy. Please try again in a moment.":t.includes("timeout")||t.includes("timed out")?e="The request timed out. Please check your connection and try again.":e=t}}catch{r.includes("404")||r.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":r&&(e="Something went wrong. Please try again.")}throw new Error(e)}return n.json()}finally{clearTimeout(d)}}export{P as g,_ as s}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D9TvEOZX.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-CIg5rXpX.css"])))=>i.map(i=>d[i]); +import{_ as w}from"./index-D9TvEOZX.js";const y="https://deign86-mathpulse-api-v3test.hf.space";async function P(g,h){const f=`${y}/api/diagnostic/generate`,{auth:i}=await w(async()=>{const{auth:e}=await import("./index-D9TvEOZX.js").then(a=>a.b6);return{auth:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),c=i.currentUser,l=async()=>{const e=new Headers({"Content-Type":"application/json"});if(c){const a=await c.getIdToken(!1);a&&e.set("Authorization",`Bearer ${a}`)}return e},u=async e=>fetch(f,{method:"POST",headers:await l(),body:JSON.stringify({strand:g,grade_level:h}),signal:e}),d=(e,a)=>{let t="Something went wrong. Please try again.";try{const s=JSON.parse(a);if(s.detail){const o=String(s.detail);o.includes("Database unavailable")||o.includes("unavailable")?t="Our servers are temporarily busy. Please try again in a moment.":o.includes("timeout")||o.includes("timed out")?t="The request timed out. Please check your connection and try again.":t=o}}catch{!e.ok&&a&&(t="Failed to start assessment. Please try again.")}return t},n=2,r=3e4;for(let e=1;e<=n;e++){const a=new AbortController,t=setTimeout(()=>a.abort(),r);try{const s=await u(a.signal);if(s.ok)return clearTimeout(t),s.json();if(s.status>=400&&s.status<500){clearTimeout(t);const m=await s.text().catch(()=>"");throw new Error(d(s,m))}const o=await s.text().catch(()=>""),p=d(s,o);if(clearTimeout(t),esetTimeout(T,m));continue}throw new Error(p)}catch(s){if(clearTimeout(t),s instanceof DOMException&&s.name==="AbortError"){if(e{const{auth:n}=await import("./index-D9TvEOZX.js").then(r=>r.b6);return{auth:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),l=c.currentUser;if(l){const n=await l.getIdToken(!1);n&&i.set("Authorization",`Bearer ${n}`)}const u=new AbortController,d=setTimeout(()=>u.abort(),6e4);try{const n=await fetch(f,{method:"POST",headers:i,body:JSON.stringify({test_id:g,responses:h}),signal:u.signal});if(!n.ok){const r=await n.text().catch(()=>"");let e="Something went wrong. Please try again.";try{const a=JSON.parse(r);if(a.detail){const t=String(a.detail);t.includes("session")||t.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":t.includes("Database unavailable")||t.includes("unavailable")?e="Our servers are temporarily busy. Please try again in a moment.":t.includes("timeout")||t.includes("timed out")?e="The request timed out. Please check your connection and try again.":e=t}}catch{r.includes("404")||r.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":r&&(e="Something went wrong. Please try again.")}throw new Error(e)}return n.json()}finally{clearTimeout(d)}}export{P as g,_ as s}; diff --git a/assets/dialog-BkdNfKs4.js b/assets/dialog-BXd6FyxO.js similarity index 94% rename from assets/dialog-BkdNfKs4.js rename to assets/dialog-BXd6FyxO.js index 672bacc9243ad8e8a621e5bf7f5574e0fc7d3a03..d77a37dcc87f935f2f6d85a836bdb0089148a0bf 100644 --- a/assets/dialog-BkdNfKs4.js +++ b/assets/dialog-BXd6FyxO.js @@ -1,4 +1,4 @@ -import{e as g,o as s}from"./index-Cvals0ud.js";import{j as t,r as d}from"./vendor-react-B4AQeu28.js";import{b as m,c as l,d as p,T as n,D as i,P as u,O as r}from"./vendor-radix-BPuEd8FG.js";import{X as x}from"./x-cRIR5BcS.js";/** +import{e as g,o as s}from"./index-D9TvEOZX.js";import{j as t,r as d}from"./vendor-react-B4AQeu28.js";import{b as m,c as l,d as p,T as n,D as i,P as u,O as r}from"./vendor-radix-C5nwdvGr.js";import{X as x}from"./x-DM8tXF3P.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/dollar-sign-B2IOYAA6.js b/assets/dollar-sign-Bysazpsk.js similarity index 89% rename from assets/dollar-sign-B2IOYAA6.js rename to assets/dollar-sign-Bysazpsk.js index c76b2bce755c26d69f6e5993e7f5f2a0b45b0dbc..8af7f7593013f07285cc8a0afb807a95a4fb5f33 100644 --- a/assets/dollar-sign-B2IOYAA6.js +++ b/assets/dollar-sign-Bysazpsk.js @@ -1,4 +1,4 @@ -import{e}from"./index-Cvals0ud.js";/** +import{e}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/download-BJi3JOJ-.js b/assets/download-BC34EYX_.js similarity index 89% rename from assets/download-BJi3JOJ-.js rename to assets/download-BC34EYX_.js index 9abdfe419763ee48ecbef5a6656a2aad153893e4..26a729512d0fa73b6b1dbba05d1d28a8299a5507 100644 --- a/assets/download-BJi3JOJ-.js +++ b/assets/download-BC34EYX_.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-Cvals0ud.js";/** +import{e as o}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/eye-gVkJiC2f.js b/assets/eye-C42pNDm-.js similarity index 96% rename from assets/eye-gVkJiC2f.js rename to assets/eye-C42pNDm-.js index 5f15b759e2a4fee0489986a52a1c91f844482ff5..c0ba756cfe0a2b85644018a333adcada5e9214a3 100644 --- a/assets/eye-gVkJiC2f.js +++ b/assets/eye-C42pNDm-.js @@ -1,4 +1,4 @@ -import{e}from"./index-Cvals0ud.js";/** +import{e}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/formatDistanceToNow-CnY6T5Ff.js b/assets/formatDistanceToNow-2ba72dLM.js similarity index 99% rename from assets/formatDistanceToNow-CnY6T5Ff.js rename to assets/formatDistanceToNow-2ba72dLM.js index 4b1f9fbdab3a51bef622a2c190e998de9b4ce496..d087ccf2eb4f071f49171aefc997075845777c43 100644 --- a/assets/formatDistanceToNow-CnY6T5Ff.js +++ b/assets/formatDistanceToNow-2ba72dLM.js @@ -1,4 +1,4 @@ -import{e as W,t as u,aa as S}from"./index-Cvals0ud.js";/** +import{e as W,t as u,aa as S}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/funnel-aw0mPVdH.js b/assets/funnel-eKLw0u3T.js similarity index 90% rename from assets/funnel-aw0mPVdH.js rename to assets/funnel-eKLw0u3T.js index b0583b2c2b251ffba7b11e68a93038db81cc6807..9391e221848bd5d206e598ae428934aa011e3f2a 100644 --- a/assets/funnel-aw0mPVdH.js +++ b/assets/funnel-eKLw0u3T.js @@ -1,4 +1,4 @@ -import{e}from"./index-Cvals0ud.js";/** +import{e}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/gift-NZiFoj7A.js b/assets/gift-Cuw3Q8xP.js similarity index 91% rename from assets/gift-NZiFoj7A.js rename to assets/gift-Cuw3Q8xP.js index ea8599a1cb5e602036eacc8b57bdeac4c45e2f02..05b9c544f7d5842207d670de4ba91447a96e0b12 100644 --- a/assets/gift-NZiFoj7A.js +++ b/assets/gift-Cuw3Q8xP.js @@ -1,4 +1,4 @@ -import{e as t}from"./index-Cvals0ud.js";/** +import{e as t}from"./index-D9TvEOZX.js";/** * @license lucide-react v0.487.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/index-CE66MpTE.js b/assets/index-Ba8UWZjC.js similarity index 90% rename from assets/index-CE66MpTE.js rename to assets/index-Ba8UWZjC.js index ef1c4fa626a3da21a9f73eecde7681f4e08aa05e..6c537e12034cc64c48711889cb9623ba500455ae 100644 --- a/assets/index-CE66MpTE.js +++ b/assets/index-Ba8UWZjC.js @@ -1 +1 @@ -import{E as m,Z as u,b as p,$ as h,T as f,F as b}from"./index-Cvals0ud.js";import{a8 as V,a9 as W}from"./index-Cvals0ud.js";import{j as e,r as c,b as g}from"./vendor-react-B4AQeu28.js";import{C as v}from"./circle-alert-lQsWFo4p.js";import{M as y}from"./megaphone-BGcgznHr.js";import{B as d}from"./bell-oitWfCwK.js";import{C as j}from"./circle-check-big-6fwaSN-C.js";import{C as k}from"./clipboard-check-Dml7qHk3.js";import{f as N,C as w}from"./formatDistanceToNow-CnY6T5Ff.js";import{T as C}from"./trash-2-DaNTdmd2.js";import{X as _}from"./x-cRIR5BcS.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-BPuEd8FG.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const E={achievement_unlocked:b,level_up:f,quiz_result:k,daily_checkin:j,streak_milestone:h,streak_reminder:d,teacher_announcement:y,new_assignment:p,xp_earned:u,system_alert:v},R=t=>{switch(t){case"achievement_unlocked":case"achievement":return"bg-rose-500/10 text-rose-600";case"xp_earned":return"bg-amber-500/10 text-amber-600";case"daily_checkin":case"checkin":return"bg-emerald-500/10 text-emerald-600";case"streak_milestone":case"streak_reminder":return"bg-orange-500/10 text-orange-600";case"teacher_announcement":return"bg-violet-500/10 text-violet-600";case"new_assignment":case"quiz_result":return"bg-sky-500/10 text-sky-600";case"level_up":return"bg-indigo-500/10 text-indigo-600";case"system_alert":return"bg-red-500/10 text-red-600";default:return"bg-[#edf1f7] text-[#5a6578]"}},z=({notification:t})=>{const{markAsRead:r,deleteNotification:a}=m(),o=E[t.type]||d,i=R(t.type),n=()=>{if(t.isRead||r(t.id),t.type==="streak_reminder"||t.type==="daily_checkin"){window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Modules"}}));return}t.actionUrl&&(window.location.href=t.actionUrl)},l=N(t.createdAt,{addSuffix:!0});return e.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n())},className:`group text-left p-4 border-b border-[#dde3eb] cursor-pointer transition-colors hover:bg-[#edf1f7]/50 ${t.isRead?"":"bg-sky-50/40"}`,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${i}`,children:e.jsx(o,{size:18})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] line-clamp-1 font-body",children:t.title}),!t.isRead&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-sky-600 flex-shrink-0 mt-1.5"})]}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2 line-clamp-2 font-body",children:t.message}),e.jsx("p",{className:"text-xs text-slate-500",children:l})]}),e.jsx("button",{onClick:s=>{s.stopPropagation(),a(t.id)},className:"opacity-0 group-hover:opacity-100 transition-opacity text-slate-400 hover:text-red-500","aria-label":"Delete notification",children:e.jsx(C,{size:14})})]})})},T=({onClose:t})=>{const{notifications:r,unreadCount:a,isLoading:o,markAllAsRead:i}=m(),n=c.useRef(null);c.useEffect(()=>{const s=x=>{n.current&&!n.current.contains(x.target)&&t()};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[t]);const l=e.jsxs("div",{ref:n,className:"fixed right-4 top-20 w-80 bg-[#f7f9fc] rounded-xl shadow-2xl border border-[#dde3eb] max-h-96 overflow-y-auto z-[9999] overflow-hidden",style:{right:"1rem",top:"5rem"},children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-gradient-to-r from-sky-600 to-sky-500",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-white text-sm",children:"Notifications"}),e.jsx("p",{className:"text-xs text-sky-100 mt-0.5",children:a>0?`${a} unread`:"No new alerts"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a>0&&e.jsxs("button",{onClick:i,className:"text-xs text-sky-200 hover:text-white font-bold transition-colors flex items-center gap-1",children:[e.jsx(w,{size:14}),"Mark all read"]}),e.jsx("button",{onClick:t,className:"text-sky-200 hover:text-white transition-colors",title:"Close",children:e.jsx(_,{size:16})})]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto",children:o?e.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(s=>e.jsx("div",{className:"animate-pulse bg-[#dde3eb] rounded h-12"},s))}):r.length===0?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(d,{size:48,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] text-sm font-body",children:"You're all caught up!"})]}):r.map(s=>e.jsx(z,{notification:s},s.id))})]});return g.createPortal(l,document.body)},H=()=>{const{unreadCount:t}=m(),[r,a]=c.useState(!1),o=c.useRef(null);c.useEffect(()=>{const n=l=>{o.current&&!o.current.contains(l.target)&&a(!1)};return r&&document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[r]);const i=t>99?"99+":t.toString();return e.jsxs("div",{ref:o,className:"relative",children:[e.jsxs("button",{onClick:()=>a(!r),className:"relative p-3 bg-[#edf1f7] rounded-xl text-[#5a6578] hover:bg-[#dde3eb] transition-colors","aria-label":"Notifications","aria-expanded":r,"aria-haspopup":"true",children:[e.jsx(d,{size:20}),t>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs font-bold rounded-full min-w-[18px] h-[18px] flex items-center justify-center px-1",children:i})]}),r&&e.jsx(T,{onClose:()=>a(!1)})]})};export{H as NotificationBell,V as NotificationProvider,W as notify,m as useNotifications}; +import{E as m,Z as u,b as p,$ as h,T as f,F as b}from"./index-D9TvEOZX.js";import{a8 as V,a9 as W}from"./index-D9TvEOZX.js";import{j as e,r as c,b as g}from"./vendor-react-B4AQeu28.js";import{C as v}from"./circle-alert-B7tHo7_X.js";import{M as y}from"./megaphone-Bl3_WN0I.js";import{B as d}from"./bell-Ci_PX33B.js";import{C as j}from"./circle-check-big-yn5lhjQR.js";import{C as k}from"./clipboard-check-DEpL_ccN.js";import{f as N,C as w}from"./formatDistanceToNow-2ba72dLM.js";import{T as C}from"./trash-2-BYUCk-BO.js";import{X as _}from"./x-DM8tXF3P.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const E={achievement_unlocked:b,level_up:f,quiz_result:k,daily_checkin:j,streak_milestone:h,streak_reminder:d,teacher_announcement:y,new_assignment:p,xp_earned:u,system_alert:v},R=t=>{switch(t){case"achievement_unlocked":case"achievement":return"bg-rose-500/10 text-rose-600";case"xp_earned":return"bg-amber-500/10 text-amber-600";case"daily_checkin":case"checkin":return"bg-emerald-500/10 text-emerald-600";case"streak_milestone":case"streak_reminder":return"bg-orange-500/10 text-orange-600";case"teacher_announcement":return"bg-violet-500/10 text-violet-600";case"new_assignment":case"quiz_result":return"bg-sky-500/10 text-sky-600";case"level_up":return"bg-indigo-500/10 text-indigo-600";case"system_alert":return"bg-red-500/10 text-red-600";default:return"bg-[#edf1f7] text-[#5a6578]"}},z=({notification:t})=>{const{markAsRead:r,deleteNotification:a}=m(),o=E[t.type]||d,i=R(t.type),n=()=>{if(t.isRead||r(t.id),t.type==="streak_reminder"||t.type==="daily_checkin"){window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Modules"}}));return}t.actionUrl&&(window.location.href=t.actionUrl)},l=N(t.createdAt,{addSuffix:!0});return e.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n())},className:`group text-left p-4 border-b border-[#dde3eb] cursor-pointer transition-colors hover:bg-[#edf1f7]/50 ${t.isRead?"":"bg-sky-50/40"}`,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${i}`,children:e.jsx(o,{size:18})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] line-clamp-1 font-body",children:t.title}),!t.isRead&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-sky-600 flex-shrink-0 mt-1.5"})]}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2 line-clamp-2 font-body",children:t.message}),e.jsx("p",{className:"text-xs text-slate-500",children:l})]}),e.jsx("button",{onClick:s=>{s.stopPropagation(),a(t.id)},className:"opacity-0 group-hover:opacity-100 transition-opacity text-slate-400 hover:text-red-500","aria-label":"Delete notification",children:e.jsx(C,{size:14})})]})})},T=({onClose:t})=>{const{notifications:r,unreadCount:a,isLoading:o,markAllAsRead:i}=m(),n=c.useRef(null);c.useEffect(()=>{const s=x=>{n.current&&!n.current.contains(x.target)&&t()};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[t]);const l=e.jsxs("div",{ref:n,className:"fixed right-4 top-20 w-80 bg-[#f7f9fc] rounded-xl shadow-2xl border border-[#dde3eb] max-h-96 overflow-y-auto z-[9999] overflow-hidden",style:{right:"1rem",top:"5rem"},children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-gradient-to-r from-sky-600 to-sky-500",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-white text-sm",children:"Notifications"}),e.jsx("p",{className:"text-xs text-sky-100 mt-0.5",children:a>0?`${a} unread`:"No new alerts"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a>0&&e.jsxs("button",{onClick:i,className:"text-xs text-sky-200 hover:text-white font-bold transition-colors flex items-center gap-1",children:[e.jsx(w,{size:14}),"Mark all read"]}),e.jsx("button",{onClick:t,className:"text-sky-200 hover:text-white transition-colors",title:"Close",children:e.jsx(_,{size:16})})]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto",children:o?e.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(s=>e.jsx("div",{className:"animate-pulse bg-[#dde3eb] rounded h-12"},s))}):r.length===0?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(d,{size:48,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] text-sm font-body",children:"You're all caught up!"})]}):r.map(s=>e.jsx(z,{notification:s},s.id))})]});return g.createPortal(l,document.body)},H=()=>{const{unreadCount:t}=m(),[r,a]=c.useState(!1),o=c.useRef(null);c.useEffect(()=>{const n=l=>{o.current&&!o.current.contains(l.target)&&a(!1)};return r&&document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[r]);const i=t>99?"99+":t.toString();return e.jsxs("div",{ref:o,className:"relative",children:[e.jsxs("button",{onClick:()=>a(!r),className:"relative p-3 bg-[#edf1f7] rounded-xl text-[#5a6578] hover:bg-[#dde3eb] transition-colors","aria-label":"Notifications","aria-expanded":r,"aria-haspopup":"true",children:[e.jsx(d,{size:20}),t>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs font-bold rounded-full min-w-[18px] h-[18px] flex items-center justify-center px-1",children:i})]}),r&&e.jsx(T,{onClose:()=>a(!1)})]})};export{H as NotificationBell,V as NotificationProvider,W as notify,m as useNotifications}; diff --git a/assets/index-B-vquVVw.css b/assets/index-CIg5rXpX.css similarity index 82% rename from assets/index-B-vquVVw.css rename to assets/index-CIg5rXpX.css index f677cf5f976de92daf1d1e4bf41a48e559e9c591..b9ad920ae2b2ff335c4d4f938956e1f4ba82c770 100644 --- a/assets/index-B-vquVVw.css +++ b/assets/index-CIg5rXpX.css @@ -1 +1 @@ -/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-scroll-snap-strictness:proximity;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-800:oklch(47.6% .114 61.907);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-emerald-950:oklch(26.2% .051 172.552);--color-teal-50:oklch(98.4% .014 180.72);--color-teal-100:oklch(95.3% .051 180.801);--color-teal-300:oklch(85.5% .138 181.071);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-teal-600:oklch(60% .118 184.704);--color-teal-700:oklch(51.1% .096 186.391);--color-teal-900:oklch(38.6% .063 188.416);--color-cyan-100:oklch(95.6% .045 203.388);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-200:var(--color-violet-200);--color-sky-700:var(--color-violet-700);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-violet-50:oklch(96.9% .016 293.756);--color-violet-100:oklch(94.3% .029 294.588);--color-violet-200:oklch(89.4% .057 293.283);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-600:oklch(54.1% .281 293.009);--color-violet-700:oklch(49.1% .27 292.581);--color-violet-800:oklch(43.2% .232 292.759);--color-violet-900:oklch(38% .189 293.745);--color-violet-950:oklch(28.3% .141 291.089);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-purple-800:oklch(43.8% .218 303.724);--color-purple-900:oklch(38.1% .176 304.987);--color-fuchsia-50:oklch(97.7% .017 320.058);--color-fuchsia-200:oklch(90.3% .076 319.62);--color-fuchsia-300:oklch(83.3% .145 321.434);--color-fuchsia-400:oklch(74% .238 322.16);--color-fuchsia-500:oklch(66.7% .295 322.15);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-pink-600:oklch(59.2% .249 .584);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-100:oklch(94.1% .03 12.58);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-rose-700:oklch(51.4% .222 16.935);--color-rose-800:oklch(45.5% .188 13.697);--color-rose-900:oklch(41% .159 10.272);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-700:oklch(37% .013 285.805);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--animate-bounce:bounce 1s infinite;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-border:var(--border)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground);font-family:var(--font-body);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h1{font-family:var(--font-display);font-size:var(--text-2xl);letter-spacing:-.02em;font-weight:700;line-height:1.3}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h2{font-family:var(--font-display);font-size:var(--text-xl);letter-spacing:-.01em;font-weight:700;line-height:1.35}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h3{font-family:var(--font-display);font-size:var(--text-lg);font-weight:600;line-height:1.4}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h4{font-family:var(--font-display);font-size:var(--text-base);font-weight:600;line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) label{font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) button{font-family:var(--font-body);font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) input{font-family:var(--font-body);font-size:var(--text-base);font-weight:var(--font-weight-normal);line-height:1.5}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.\[container-type\:inline-size\]{container-type:inline-size}.\[container-type\:size\]{container-type:size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.-inset-\[5px\]{inset:-5px}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.inset-x-\[-20px\]{inset-inline:-20px}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.end-1{inset-inline-end:calc(var(--spacing) * 1)}.-top-1{top:calc(var(--spacing) * -1)}.-top-2{top:calc(var(--spacing) * -2)}.-top-3{top:calc(var(--spacing) * -3)}.-top-3\.5{top:calc(var(--spacing) * -3.5)}.-top-4{top:calc(var(--spacing) * -4)}.-top-5{top:calc(var(--spacing) * -5)}.-top-6{top:calc(var(--spacing) * -6)}.-top-8{top:calc(var(--spacing) * -8)}.-top-10{top:calc(var(--spacing) * -10)}.-top-12{top:calc(var(--spacing) * -12)}.-top-20{top:calc(var(--spacing) * -20)}.-top-24{top:calc(var(--spacing) * -24)}.-top-40{top:calc(var(--spacing) * -40)}.top-0{top:calc(var(--spacing) * 0)}.top-0\.5{top:calc(var(--spacing) * .5)}.top-1{top:calc(var(--spacing) * 1)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-3{top:calc(var(--spacing) * 3)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-4{top:calc(var(--spacing) * 4)}.top-5{top:calc(var(--spacing) * 5)}.top-6{top:calc(var(--spacing) * 6)}.top-7{top:calc(var(--spacing) * 7)}.top-8{top:calc(var(--spacing) * 8)}.top-12{top:calc(var(--spacing) * 12)}.top-20{top:calc(var(--spacing) * 20)}.top-24{top:calc(var(--spacing) * 24)}.top-\[-5\%\]{top:-5%}.top-\[-10\%\]{top:-10%}.top-\[-30px\]{top:-30px}.top-\[0\%\]{top:0%}.top-\[1px\]{top:1px}.top-\[10\%\]{top:10%}.top-\[10px\]{top:10px}.top-\[15\%\]{top:15%}.top-\[20\%\]{top:20%}.top-\[25px\]{top:25px}.top-\[40\%\]{top:40%}.top-\[45\%\]{top:45%}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-\[80px\]{top:80px}.top-full{top:100%}.-right-1{right:calc(var(--spacing) * -1)}.-right-2{right:calc(var(--spacing) * -2)}.-right-2\.5{right:calc(var(--spacing) * -2.5)}.-right-3{right:calc(var(--spacing) * -3)}.-right-4{right:calc(var(--spacing) * -4)}.-right-5{right:calc(var(--spacing) * -5)}.-right-6{right:calc(var(--spacing) * -6)}.-right-8{right:calc(var(--spacing) * -8)}.-right-10{right:calc(var(--spacing) * -10)}.-right-12{right:calc(var(--spacing) * -12)}.-right-24{right:calc(var(--spacing) * -24)}.-right-40{right:calc(var(--spacing) * -40)}.right-0{right:calc(var(--spacing) * 0)}.right-0\.5{right:calc(var(--spacing) * .5)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-2\.5{right:calc(var(--spacing) * 2.5)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.right-6{right:calc(var(--spacing) * 6)}.right-8{right:calc(var(--spacing) * 8)}.right-12{right:calc(var(--spacing) * 12)}.right-16{right:calc(var(--spacing) * 16)}.right-\[-5\%\]{right:-5%}.right-\[-5px\]{right:-5px}.right-\[-10\%\]{right:-10%}.right-\[-10px\]{right:-10px}.right-\[-20\%\]{right:-20%}.right-\[-20px\]{right:-20px}.right-\[-30px\]{right:-30px}.right-\[10\%\]{right:10%}.right-\[24px\]{right:24px}.right-\[150px\]{right:150px}.right-full{right:100%}.-bottom-1{bottom:calc(var(--spacing) * -1)}.-bottom-2{bottom:calc(var(--spacing) * -2)}.-bottom-2\.5{bottom:calc(var(--spacing) * -2.5)}.-bottom-3{bottom:calc(var(--spacing) * -3)}.-bottom-4{bottom:calc(var(--spacing) * -4)}.-bottom-5{bottom:calc(var(--spacing) * -5)}.-bottom-6{bottom:calc(var(--spacing) * -6)}.-bottom-8{bottom:calc(var(--spacing) * -8)}.-bottom-10{bottom:calc(var(--spacing) * -10)}.-bottom-12{bottom:calc(var(--spacing) * -12)}.-bottom-24{bottom:calc(var(--spacing) * -24)}.-bottom-40{bottom:calc(var(--spacing) * -40)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-5{bottom:calc(var(--spacing) * 5)}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-12{bottom:calc(var(--spacing) * 12)}.bottom-16{bottom:calc(var(--spacing) * 16)}.bottom-28{bottom:calc(var(--spacing) * 28)}.bottom-\[-10\%\]{bottom:-10%}.bottom-\[-20px\]{bottom:-20px}.bottom-\[-500px\]{bottom:-500px}.bottom-\[0\%\]{bottom:0%}.bottom-\[2px\]{bottom:2px}.bottom-\[35px\]{bottom:35px}.bottom-\[50px\]{bottom:50px}.bottom-full{bottom:100%}.-left-2{left:calc(var(--spacing) * -2)}.-left-2\.5{left:calc(var(--spacing) * -2.5)}.-left-3{left:calc(var(--spacing) * -3)}.-left-4{left:calc(var(--spacing) * -4)}.-left-8{left:calc(var(--spacing) * -8)}.-left-10{left:calc(var(--spacing) * -10)}.-left-12{left:calc(var(--spacing) * -12)}.-left-40{left:calc(var(--spacing) * -40)}.-left-\[17px\]{left:-17px}.-left-\[150\%\]{left:-150%}.left-0{left:calc(var(--spacing) * 0)}.left-1{left:calc(var(--spacing) * 1)}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-3\.5{left:calc(var(--spacing) * 3.5)}.left-4{left:calc(var(--spacing) * 4)}.left-8{left:calc(var(--spacing) * 8)}.left-12{left:calc(var(--spacing) * 12)}.left-\[-5\%\]{left:-5%}.left-\[-10\%\]{left:-10%}.left-\[-20px\]{left:-20px}.left-\[10\%\]{left:10%}.left-\[15\%\]{left:15%}.left-\[20\%\]{left:20%}.left-\[40\%\]{left:40%}.left-\[50\%\]{left:50%}.left-\[54px\]{left:54px}.left-\[var\(--x\)\]{left:var(--x)}.left-full{left:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[-2\]{z-index:-2}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.z-\[3\]{z-index:3}.z-\[4\]{z-index:4}.z-\[11\]{z-index:11}.z-\[12\]{z-index:12}.z-\[13\]{z-index:13}.z-\[50\]{z-index:50}.z-\[51\]{z-index:51}.z-\[60\]{z-index:60}.z-\[70\]{z-index:70}.z-\[75\]{z-index:75}.z-\[80\]{z-index:80}.z-\[90\]{z-index:90}.z-\[100\]{z-index:100}.z-\[110\]{z-index:110}.z-\[120\]{z-index:120}.z-\[130\]{z-index:130}.z-\[200\]{z-index:200}.z-\[250\]{z-index:250}.z-\[300\]{z-index:300}.z-\[9998\]{z-index:9998}.z-\[9999\]{z-index:9999}.z-\[10000\]{z-index:10000}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-12{grid-column:span 12/span 12}.col-span-full{grid-column:1/-1}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-m-2{margin:calc(var(--spacing) * -2)}.m-0{margin:calc(var(--spacing) * 0)}.m-1{margin:calc(var(--spacing) * 1)}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-mx-3{margin-inline:calc(var(--spacing) * -3)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.-mx-\[24px\]{margin-inline:-24px}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3\.5{margin-inline:calc(var(--spacing) * 3.5)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-\[-20px\]{margin-inline:-20px}.mx-\[1px\]{margin-inline:1px}.mx-auto{margin-inline:auto}.-my-4{margin-block:calc(var(--spacing) * -4)}.my-0\.5{margin-block:calc(var(--spacing) * .5)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-4{margin-block:calc(var(--spacing) * 4)}.-mt-0\.5{margin-top:calc(var(--spacing) * -.5)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-3{margin-top:calc(var(--spacing) * -3)}.-mt-4{margin-top:calc(var(--spacing) * -4)}.-mt-10{margin-top:calc(var(--spacing) * -10)}.-mt-24{margin-top:calc(var(--spacing) * -24)}.mt-0{margin-top:calc(var(--spacing) * 0)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-\[-10px\]{margin-top:-10px}.mt-\[-20px\]{margin-top:-20px}.mt-\[0\.5rem\]{margin-top:.5rem}.mt-\[1px\]{margin-top:1px}.mt-\[4px\]{margin-top:4px}.mt-\[24px\]{margin-top:24px}.mt-auto{margin-top:auto}.-mr-10{margin-right:calc(var(--spacing) * -10)}.-mr-24{margin-right:calc(var(--spacing) * -24)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-4{margin-right:calc(var(--spacing) * 4)}.-mb-8{margin-bottom:calc(var(--spacing) * -8)}.-mb-10{margin-bottom:calc(var(--spacing) * -10)}.-mb-18{margin-bottom:calc(var(--spacing) * -18)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.mb-\[-10px\]{margin-bottom:-10px}.mb-\[2px\]{margin-bottom:2px}.mb-\[8px\]{margin-bottom:8px}.mb-\[10px\]{margin-bottom:10px}.mb-\[14px\]{margin-bottom:14px}.mb-\[16px\]{margin-bottom:16px}.-ml-1{margin-left:calc(var(--spacing) * -1)}.-ml-4{margin-left:calc(var(--spacing) * -4)}.-ml-8{margin-left:calc(var(--spacing) * -8)}.-ml-10{margin-left:calc(var(--spacing) * -10)}.-ml-18{margin-left:calc(var(--spacing) * -18)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-10{margin-left:calc(var(--spacing) * 10)}.ml-14{margin-left:calc(var(--spacing) * 14)}.ml-\[20px\]{margin-left:20px}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.\[aspect-ratio\:1\/var\(--aspect-ratio\)\]{aspect-ratio:1/var(--aspect-ratio)}.aspect-\[4\/5\]{aspect-ratio:4/5}.aspect-square{aspect-ratio:1}.aspect-video{aspect-ratio:var(--aspect-video)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-full{width:100%;height:100%}.\[height\:100cqmax\]{height:100cqmax}.h-0{height:calc(var(--spacing) * 0)}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-3\/4{height:75%}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-32{height:calc(var(--spacing) * 32)}.h-36{height:calc(var(--spacing) * 36)}.h-40{height:calc(var(--spacing) * 40)}.h-48{height:calc(var(--spacing) * 48)}.h-64{height:calc(var(--spacing) * 64)}.h-80{height:calc(var(--spacing) * 80)}.h-96{height:calc(var(--spacing) * 96)}.h-\[1\.5rem\]{height:1.5rem}.h-\[1\.15rem\]{height:1.15rem}.h-\[1px\]{height:1px}.h-\[2px\]{height:2px}.h-\[3px\]{height:3px}.h-\[6px\]{height:6px}.h-\[10px\]{height:10px}.h-\[14px\]{height:14px}.h-\[16px\]{height:16px}.h-\[18px\]{height:18px}.h-\[22px\]{height:22px}.h-\[25px\]{height:25px}.h-\[28px\]{height:28px}.h-\[32px\]{height:32px}.h-\[35px\]{height:35px}.h-\[38px\]{height:38px}.h-\[40\%\]{height:40%}.h-\[40px\]{height:40px}.h-\[45px\]{height:45px}.h-\[46px\]{height:46px}.h-\[48px\]{height:48px}.h-\[50px\]{height:50px}.h-\[52px\]{height:52px}.h-\[54px\]{height:54px}.h-\[60\%\]{height:60%}.h-\[65px\]{height:65px}.h-\[70\%\]{height:70%}.h-\[72px\]{height:72px}.h-\[75px\]{height:75px}.h-\[76px\]{height:76px}.h-\[80\%\]{height:80%}.h-\[80px\]{height:80px}.h-\[85\%\]{height:85%}.h-\[85px\]{height:85px}.h-\[92vh\]{height:92vh}.h-\[95vh\]{height:95vh}.h-\[96px\]{height:96px}.h-\[100px\]{height:100px}.h-\[100vh\]{height:100vh}.h-\[105\%\]{height:105%}.h-\[110\%\]{height:110%}.h-\[120\%\]{height:120%}.h-\[120px\]{height:120px}.h-\[130px\]{height:130px}.h-\[140px\]{height:140px}.h-\[150vh\]{height:150vh}.h-\[160px\]{height:160px}.h-\[170px\]{height:170px}.h-\[185px\]{height:185px}.h-\[190px\]{height:190px}.h-\[220px\]{height:220px}.h-\[250px\]{height:250px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[500px\]{height:500px}.h-\[600vw\]{height:600vw}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[calc\(100\%-16px\)\]{height:calc(100% - 16px)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--radix-context-menu-content-available-height\){max-height:var(--radix-context-menu-content-available-height)}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-24{max-height:calc(var(--spacing) * 24)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[300px\]{max-height:300px}.max-h-\[320px\]{max-height:320px}.max-h-\[360px\]{max-height:360px}.max-h-\[500px\]{max-height:500px}.max-h-\[calc\(90vh-200px\)\]{max-height:calc(90vh - 200px)}.max-h-\[calc\(90vh-320px\)\]{max-height:calc(90vh - 320px)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-\[2\.5rem\]{min-height:2.5rem}.min-h-\[3rem\]{min-height:3rem}.min-h-\[24px\]{min-height:24px}.min-h-\[40px\]{min-height:40px}.min-h-\[44px\]{min-height:44px}.min-h-\[48px\]{min-height:48px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[64px\]{min-height:64px}.min-h-\[75px\]{min-height:75px}.min-h-\[100px\]{min-height:100px}.min-h-\[110px\]{min-height:110px}.min-h-\[140px\]{min-height:140px}.min-h-\[160px\]{min-height:160px}.min-h-\[170px\]{min-height:170px}.min-h-\[180px\]{min-height:180px}.min-h-\[185px\]{min-height:185px}.min-h-\[190px\]{min-height:190px}.min-h-\[200px\]{min-height:200px}.min-h-\[240px\]{min-height:240px}.min-h-\[250px\]{min-height:250px}.min-h-\[290px\]{min-height:290px}.min-h-\[300px\]{min-height:300px}.min-h-\[320px\]{min-height:320px}.min-h-\[330px\]{min-height:330px}.min-h-\[400px\]{min-height:400px}.min-h-\[500px\]{min-height:500px}.min-h-\[800px\]{min-height:800px}.min-h-\[calc\(100vh-3\.5rem\)\]{min-height:calc(100vh - 3.5rem)}.min-h-dvh{min-height:100dvh}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.\!w-auto{width:auto!important}.\[width\:100cqh\]{width:100cqh}.\[width\:100cqi\]{width:100cqi}.\[width\:var\(--width\)\]{width:var(--width)}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-0{width:calc(var(--spacing) * 0)}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1{width:calc(var(--spacing) * 1)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-1\/2{width:50%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-5\/6{width:83.3333%}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-96{width:calc(var(--spacing) * 96)}.w-\[1px\]{width:1px}.w-\[2px\]{width:2px}.w-\[5px\]{width:5px}.w-\[6px\]{width:6px}.w-\[10px\]{width:10px}.w-\[16px\]{width:16px}.w-\[22px\]{width:22px}.w-\[30\%\]{width:30%}.w-\[32px\]{width:32px}.w-\[38\%\]{width:38%}.w-\[38px\]{width:38px}.w-\[40\%\]{width:40%}.w-\[46px\]{width:46px}.w-\[48px\]{width:48px}.w-\[52px\]{width:52px}.w-\[55\%\]{width:55%}.w-\[58\%\]{width:58%}.w-\[60\%\]{width:60%}.w-\[60px\]{width:60px}.w-\[65\%\]{width:65%}.w-\[65px\]{width:65px}.w-\[67\%\]{width:67%}.w-\[70\%\]{width:70%}.w-\[70px\]{width:70px}.w-\[72vw\]{width:72vw}.w-\[75px\]{width:75px}.w-\[76\%\]{width:76%}.w-\[78px\]{width:78px}.w-\[79\%\]{width:79%}.w-\[80\%\]{width:80%}.w-\[80px\]{width:80px}.w-\[81\%\]{width:81%}.w-\[84\%\]{width:84%}.w-\[85\%\]{width:85%}.w-\[86\%\]{width:86%}.w-\[88\%\]{width:88%}.w-\[89\%\]{width:89%}.w-\[90\%\]{width:90%}.w-\[90px\]{width:90px}.w-\[92\%\]{width:92%}.w-\[94\%\]{width:94%}.w-\[95\%\]{width:95%}.w-\[96px\]{width:96px}.w-\[100\%\]{width:100%}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150vw\]{width:150vw}.w-\[160px\]{width:160px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-\[220px\]{width:220px}.w-\[250vw\]{width:250vw}.w-\[260px\]{width:260px}.w-\[280px\]{width:280px}.w-\[300px\]{width:300px}.w-\[320px\]{width:320px}.w-\[350px\]{width:350px}.w-\[380px\]{width:380px}.w-\[400px\]{width:400px}.w-\[600vw\]{width:600vw}.w-\[calc\(100\%\+48px\)\]{width:calc(100% + 48px)}.w-\[calc\(100\%-4rem\)\]{width:calc(100% - 4rem)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[19rem\]{max-width:19rem}.max-w-\[22rem\]{max-width:22rem}.max-w-\[24rem\]{max-width:24rem}.max-w-\[28rem\]{max-width:28rem}.max-w-\[36rem\]{max-width:36rem}.max-w-\[44rem\]{max-width:44rem}.max-w-\[48\%\]{max-width:48%}.max-w-\[50rem\]{max-width:50rem}.max-w-\[54rem\]{max-width:54rem}.max-w-\[70\%\]{max-width:70%}.max-w-\[75\%\]{max-width:75%}.max-w-\[80px\]{max-width:80px}.max-w-\[85\%\]{max-width:85%}.max-w-\[85vw\]{max-width:85vw}.max-w-\[88vw\]{max-width:88vw}.max-w-\[90\%\]{max-width:90%}.max-w-\[90px\]{max-width:90px}.max-w-\[90rem\]{max-width:90rem}.max-w-\[120px\]{max-width:120px}.max-w-\[130px\]{max-width:130px}.max-w-\[140px\]{max-width:140px}.max-w-\[160px\]{max-width:160px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[250px\]{max-width:250px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[320px\]{max-width:320px}.max-w-\[330px\]{max-width:330px}.max-w-\[340px\]{max-width:340px}.max-w-\[380px\]{max-width:380px}.max-w-\[400px\]{max-width:400px}.max-w-\[420px\]{max-width:420px}.max-w-\[450px\]{max-width:450px}.max-w-\[460px\]{max-width:460px}.max-w-\[800px\]{max-width:800px}.max-w-\[900px\]{max-width:900px}.max-w-\[1000px\]{max-width:1000px}.max-w-\[1100px\]{max-width:1100px}.max-w-\[1200px\]{max-width:1200px}.max-w-\[1400px\]{max-width:1400px}.max-w-\[1600px\]{max-width:1600px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-\[calc\(100vw-24px\)\]{max-width:calc(100vw - 24px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-max{max-width:max-content}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-\[1\.5rem\]{min-width:1.5rem}.min-w-\[1\.75rem\]{min-width:1.75rem}.min-w-\[2\.5rem\]{min-width:2.5rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[18px\]{min-width:18px}.min-w-\[60px\]{min-width:60px}.min-w-\[65px\]{min-width:65px}.min-w-\[85px\]{min-width:85px}.min-w-\[90px\]{min-width:90px}.min-w-\[120px\]{min-width:120px}.min-w-\[130px\]{min-width:130px}.min-w-\[140px\]{min-width:140px}.min-w-\[160px\]{min-width:160px}.min-w-\[180px\]{min-width:180px}.min-w-\[240px\]{min-width:240px}.min-w-\[280px\]{min-width:280px}.min-w-\[800px\]{min-width:800px}.min-w-\[1000px\]{min-width:1000px}.min-w-\[1100px\]{min-width:1100px}.min-w-\[1140px\]{min-width:1140px}.min-w-\[1240px\]{min-width:1240px}.min-w-\[1320px\]{min-width:1320px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-\[1\.5\]{flex:1.5}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.border-separate{border-collapse:separate}.border-spacing-y-2{--tw-border-spacing-y:calc(var(--spacing) * 2);border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.\[transform-origin\:0\%_0\%\]{transform-origin:0 0}.\[transform-origin\:50\%_0\%\]{transform-origin:50% 0}.\[transform-origin\:100\%_0\%\]{transform-origin:100% 0}.origin-\(--radix-context-menu-content-transform-origin\){transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-hover-card-content-transform-origin\){transform-origin:var(--radix-hover-card-content-transform-origin)}.origin-\(--radix-menubar-content-transform-origin\){transform-origin:var(--radix-menubar-content-transform-origin)}.origin-\(--radix-popover-content-transform-origin\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-bottom{transform-origin:bottom}.origin-bottom-right{transform-origin:100% 100%}.origin-right{transform-origin:100%}.origin-top-right{transform-origin:100% 0}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\/4{--tw-translate-x: -25% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-4{--tw-translate-x:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-\[30px\]{--tw-translate-x: -30px ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1{--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1\/3{--tw-translate-x:calc(1 / 3 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1\/4{--tw-translate-x: 25% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-100\%\]{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[30px\]{--tw-translate-x:30px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-4{--tw-translate-y:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0\.5{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1{--tw-translate-y:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1\/2{--tw-translate-y: 50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1\/3{--tw-translate-y:calc(1 / 3 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-10{--tw-translate-y:calc(var(--spacing) * 10);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[10\%\]{--tw-translate-y:10%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-full{--tw-translate-y:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-50{--tw-scale-x:50%;--tw-scale-y:50%;--tw-scale-z:50%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-x-\[-1\]{--tw-scale-x:-1;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-y-75{--tw-scale-y:75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-y-150{--tw-scale-y:150%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-\[0\.80\]{scale:.8}.scale-\[0\.99\]{scale:.99}.scale-\[1\.01\]{scale:1.01}.scale-\[1\.1\]{scale:1.1}.scale-\[1\.02\]{scale:1.02}.scale-\[1\.05\]{scale:1.05}.scale-\[1\.15\]{scale:1.15}.scale-\[1\.35\]{scale:1.35}.-rotate-12{rotate:-12deg}.-rotate-90{rotate:-90deg}.-rotate-\[15deg\]{rotate:-15deg}.rotate-6{rotate:6deg}.rotate-12{rotate:12deg}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.rotate-\[-3deg\]{rotate:-3deg}.rotate-\[-5deg\]{rotate:-5deg}.rotate-\[15deg\]{rotate:15deg}.-skew-x-12{--tw-skew-x:skewX( -12deg );transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.\[transform\:rotate\(-90deg\)_rotateX\(-90deg\)\]{transform:rotate(-90deg)rotateX(-90deg)}.\[transform\:rotate\(90deg\)_rotateX\(-90deg\)\]{transform:rotate(90deg)rotateX(-90deg)}.\[transform\:rotateX\(-90deg\)\]{transform:rotateX(-90deg)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[fadeIn_0\.3s_ease-in-out\]{animation:.3s ease-in-out fadeIn}.animate-bounce{animation:var(--animate-bounce)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.touch-manipulation{touch-action:manipulation}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.snap-center{scroll-snap-align:center}.scroll-my-1{scroll-margin-block:calc(var(--spacing) * 1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing) * 1)}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-rows-5{grid-template-rows:repeat(5,minmax(0,1fr))}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-items-start{justify-items:start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-10{gap:calc(var(--spacing) * 10)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-\[2px\]{gap:2px}.gap-\[3px\]{gap:3px}.gap-\[4px\]{gap:4px}.gap-\[5px\]{gap:5px}.gap-\[6px\]{gap:6px}.gap-\[8px\]{gap:8px}.gap-\[10px\]{gap:10px}.gap-\[12px\]{gap:12px}.gap-\[16px\]{gap:16px}.gap-\[18px\]{gap:18px}.gap-\[24px\]{gap:24px}:where(.-space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * -.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * -.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 10) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 10) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[8px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(8px * var(--tw-space-y-reverse));margin-block-end:calc(8px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[9px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(9px * var(--tw-space-y-reverse));margin-block-end:calc(9px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[12px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(12px * var(--tw-space-y-reverse));margin-block-end:calc(12px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[16px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(16px * var(--tw-space-y-reverse));margin-block-end:calc(16px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[24px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(24px * var(--tw-space-y-reverse));margin-block-end:calc(24px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[28px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(28px * var(--tw-space-y-reverse));margin-block-end:calc(28px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[32px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(32px * var(--tw-space-y-reverse));margin-block-end:calc(32px * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-10{column-gap:calc(var(--spacing) * 10)}:where(.-space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * -2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * -2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 1) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[\#edf1f7\]>:not(:last-child)){border-color:#edf1f7}:where(.divide-\[\#f1f5f9\]>:not(:last-child)){border-color:#f1f5f9}:where(.divide-border>:not(:last-child)){border-color:var(--border)}:where(.divide-slate-50>:not(:last-child)){border-color:var(--color-slate-50)}:where(.divide-slate-50\/60>:not(:last-child)){border-color:#f8fafc99}@supports (color:color-mix(in lab,red,red)){:where(.divide-slate-50\/60>:not(:last-child)){border-color:color-mix(in oklab,var(--color-slate-50) 60%,transparent)}}:where(.divide-slate-100>:not(:last-child)){border-color:var(--color-slate-100)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.overscroll-contain{overscroll-behavior:contain}.scroll-smooth{scroll-behavior:smooth}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\[-20px\]{border-radius:-20px}.rounded-\[1\.2rem\]{border-radius:1.2rem}.rounded-\[1\.4rem\]{border-radius:1.4rem}.rounded-\[1\.5rem\]{border-radius:1.5rem}.rounded-\[1rem\]{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[2rem\]{border-radius:2rem}.rounded-\[3px\]{border-radius:3px}.rounded-\[4px\]{border-radius:4px}.rounded-\[6px\]{border-radius:6px}.rounded-\[7px\]{border-radius:7px}.rounded-\[8px\]{border-radius:8px}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-\[14px\]{border-radius:14px}.rounded-\[16px\]{border-radius:16px}.rounded-\[17px\]{border-radius:17px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[28px\]{border-radius:28px}.rounded-\[32px\]{border-radius:32px}.rounded-\[40px\]{border-radius:40px}.rounded-\[50\%\]{border-radius:50%}.rounded-\[50\%_50\%_0_0\/100\%_100\%_0_0\]{border-radius:50% 50% 0 0/100% 100% 0 0}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.rounded-t-\[2\.5rem\]{border-top-left-radius:2.5rem;border-top-right-radius:2.5rem}.rounded-t-\[2px\]{border-top-left-radius:2px;border-top-right-radius:2px}.rounded-t-\[3px\]{border-top-left-radius:3px;border-top-right-radius:3px}.rounded-t-\[24px\]{border-top-left-radius:24px;border-top-right-radius:24px}.rounded-t-\[32px\]{border-top-left-radius:32px;border-top-right-radius:32px}.rounded-t-\[40px\]{border-top-left-radius:40px;border-top-right-radius:40px}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.rounded-t-xl{border-top-left-radius:calc(var(--radius) + 4px);border-top-right-radius:calc(var(--radius) + 4px)}.rounded-l-2xl{border-top-left-radius:var(--radius-2xl);border-bottom-left-radius:var(--radius-2xl)}.rounded-l-\[1\.5rem\]{border-top-left-radius:1.5rem;border-bottom-left-radius:1.5rem}.rounded-l-\[14px\]{border-top-left-radius:14px;border-bottom-left-radius:14px}.rounded-l-\[18px\]{border-top-left-radius:18px;border-bottom-left-radius:18px}.rounded-l-full{border-top-left-radius:3.40282e38px;border-bottom-left-radius:3.40282e38px}.rounded-tl-\[20px\]{border-top-left-radius:20px}.rounded-tl-\[24px\]{border-top-left-radius:24px}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-r-2xl{border-top-right-radius:var(--radius-2xl);border-bottom-right-radius:var(--radius-2xl)}.rounded-r-full{border-top-right-radius:3.40282e38px;border-bottom-right-radius:3.40282e38px}.rounded-tr-\[20px\]{border-top-right-radius:20px}.rounded-b-2xl{border-bottom-right-radius:var(--radius-2xl);border-bottom-left-radius:var(--radius-2xl)}.rounded-b-\[18px\]{border-bottom-right-radius:18px;border-bottom-left-radius:18px}.rounded-b-\[24px\]{border-bottom-right-radius:24px;border-bottom-left-radius:24px}.rounded-b-\[32px\]{border-bottom-right-radius:32px;border-bottom-left-radius:32px}.rounded-b-md{border-bottom-right-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-br-sm{border-bottom-right-radius:calc(var(--radius) - 4px)}.rounded-bl-\[24px\]{border-bottom-left-radius:24px}.rounded-bl-none{border-bottom-left-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[2px\]{border-style:var(--tw-border-style);border-width:2px}.border-\[3px\]{border-style:var(--tw-border-style);border-width:3px}.border-\[4px\]{border-style:var(--tw-border-style);border-width:4px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-x-\[1\.5px\]{border-inline-style:var(--tw-border-style);border-inline-width:1.5px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-t-4,.border-t-\[4px\]{border-top-style:var(--tw-border-style);border-top-width:4px}.border-t-\[6px\]{border-top-style:var(--tw-border-style);border-top-width:6px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}.border-r-4{border-right-style:var(--tw-border-style);border-right-width:4px}.border-r-\[6px\]{border-right-style:var(--tw-border-style);border-right-width:6px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-b-4{border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.border-b-\[2\.5px\]{border-bottom-style:var(--tw-border-style);border-bottom-width:2.5px}.border-b-\[4px\]{border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4,.border-l-\[4px\]{border-left-style:var(--tw-border-style);border-left-width:4px}.border-l-\[6px\]{border-left-style:var(--tw-border-style);border-left-width:6px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.\!border-emerald-400{border-color:var(--color-emerald-400)!important}.border-\(--color-border\){border-color:var(--color-border)}.border-\[\#0B0F19\]{border-color:#0b0f19}.border-\[\#0ea5e9\]\/20{border-color:#0ea5e933}.border-\[\#1FA7E1\]{border-color:#1fa7e1}.border-\[\#1FA7E1\]\/20{border-color:#1fa7e133}.border-\[\#1FA7E1\]\/30{border-color:#1fa7e14d}.border-\[\#1FA7E1\]\/40{border-color:#1fa7e166}.border-\[\#1a85a4\]\/20{border-color:#1a85a433}.border-\[\#1a85a4\]\/30{border-color:#1a85a44d}.border-\[\#2a3648\]{border-color:#2a3648}.border-\[\#2f384e\]{border-color:#2f384e}.border-\[\#4f46e5\]{border-color:#4f46e5}.border-\[\#4f46e5\]\/20{border-color:#4f46e533}.border-\[\#6ED1CF\]\/20{border-color:#6ed1cf33}.border-\[\#6ee7b7\]{border-color:#6ee7b7}.border-\[\#7C3AED\]{border-color:#7c3aed}.border-\[\#8A3FD3\]\/20{border-color:#8a3fd333}.border-\[\#8A3FD3\]\/30{border-color:#8a3fd34d}.border-\[\#8B5CF6\]\/40{border-color:#8b5cf666}.border-\[\#8b5cf6\]{border-color:#8b5cf6}.border-\[\#9b51e0\]{border-color:#9b51e0}.border-\[\#10b981\]{border-color:#10b981}.border-\[\#75D06A\]{border-color:#75d06a}.border-\[\#75D06A\]\/30{border-color:#75d06a4d}.border-\[\#75D06A\]\/35{border-color:#75d06a59}.border-\[\#75D06A\]\/40{border-color:#75d06a66}.border-\[\#6366f1\]{border-color:#6366f1}.border-\[\#7274ED\]\/20{border-color:#7274ed33}.border-\[\#7274ED\]\/30{border-color:#7274ed4d}.border-\[\#9956DE\]{border-color:#9956de}.border-\[\#9956DE\]\/20{border-color:#9956de33}.border-\[\#9956DE\]\/25{border-color:#9956de40}.border-\[\#9956DE\]\/30{border-color:#9956de4d}.border-\[\#9956DE\]\/40{border-color:#9956de66}.border-\[\#F1F5F9\]{border-color:#f1f5f9}.border-\[\#F08386\]{border-color:#f08386}.border-\[\#F08386\]\/30{border-color:#f083864d}.border-\[\#FF8B8B\]{border-color:#ff8b8b}.border-\[\#FF8B8B\]\/35{border-color:#ff8b8b59}.border-\[\#FFB356\]{border-color:#ffb356}.border-\[\#FFB356\]\/20{border-color:#ffb35633}.border-\[\#FFB356\]\/38{border-color:#ffb35661}.border-\[\#a5b4fc\]{border-color:#a5b4fc}.border-\[\#a5b4fc\]\/60{border-color:#a5b4fc99}.border-\[\#a855f7\]{border-color:#a855f7}.border-\[\#c7d2fe\]{border-color:#c7d2fe}.border-\[\#cbd5e1\]{border-color:#cbd5e1}.border-\[\#d1cec6\]{border-color:#d1cec6}.border-\[\#dadce0\]{border-color:#dadce0}.border-\[\#dde3eb\]{border-color:#dde3eb}.border-\[\#e0e7ff\]{border-color:#e0e7ff}.border-\[\#e2e8f0\]{border-color:#e2e8f0}.border-\[\#e2e8f0\]\/40{border-color:#e2e8f066}.border-\[\#e67e00\]{border-color:#e67e00}.border-\[\#edf1f7\]{border-color:#edf1f7}.border-\[\#f1f5f9\]{border-color:#f1f5f9}.border-\[\#fbbf24\]{border-color:#fbbf24}.border-\[\#fca5a5\]{border-color:#fca5a5}.border-\[\#fcd34d\]{border-color:#fcd34d}.border-\[\#fde68a\]{border-color:#fde68a}.border-amber-50{border-color:var(--color-amber-50)}.border-amber-100{border-color:var(--color-amber-100)}.border-amber-100\/50{border-color:#fef3c680}@supports (color:color-mix(in lab,red,red)){.border-amber-100\/50{border-color:color-mix(in oklab,var(--color-amber-100) 50%,transparent)}}.border-amber-100\/80{border-color:#fef3c6cc}@supports (color:color-mix(in lab,red,red)){.border-amber-100\/80{border-color:color-mix(in oklab,var(--color-amber-100) 80%,transparent)}}.border-amber-200{border-color:var(--color-amber-200)}.border-amber-200\/50{border-color:#fee68580}@supports (color:color-mix(in lab,red,red)){.border-amber-200\/50{border-color:color-mix(in oklab,var(--color-amber-200) 50%,transparent)}}.border-amber-200\/60{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.border-amber-200\/60{border-color:color-mix(in oklab,var(--color-amber-200) 60%,transparent)}}.border-amber-300{border-color:var(--color-amber-300)}.border-amber-300\/40{border-color:#ffd23666}@supports (color:color-mix(in lab,red,red)){.border-amber-300\/40{border-color:color-mix(in oklab,var(--color-amber-300) 40%,transparent)}}.border-amber-300\/50{border-color:#ffd23680}@supports (color:color-mix(in lab,red,red)){.border-amber-300\/50{border-color:color-mix(in oklab,var(--color-amber-300) 50%,transparent)}}.border-amber-400{border-color:var(--color-amber-400)}.border-amber-500{border-color:var(--color-amber-500)}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-blue-50{border-color:var(--color-blue-50)}.border-blue-100{border-color:var(--color-blue-100)}.border-blue-100\/50{border-color:#dbeafe80}@supports (color:color-mix(in lab,red,red)){.border-blue-100\/50{border-color:color-mix(in oklab,var(--color-blue-100) 50%,transparent)}}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-300{border-color:var(--color-blue-300)}.border-blue-400\/30{border-color:#54a2ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-400\/30{border-color:color-mix(in oklab,var(--color-blue-400) 30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-border\/80{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/80{border-color:color-mix(in oklab,var(--border) 80%,transparent)}}.border-emerald-50{border-color:var(--color-emerald-50)}.border-emerald-100{border-color:var(--color-emerald-100)}.border-emerald-100\/50{border-color:#d0fae580}@supports (color:color-mix(in lab,red,red)){.border-emerald-100\/50{border-color:color-mix(in oklab,var(--color-emerald-100) 50%,transparent)}}.border-emerald-100\/60{border-color:#d0fae599}@supports (color:color-mix(in lab,red,red)){.border-emerald-100\/60{border-color:color-mix(in oklab,var(--color-emerald-100) 60%,transparent)}}.border-emerald-200{border-color:var(--color-emerald-200)}.border-emerald-200\/50{border-color:#a4f4cf80}@supports (color:color-mix(in lab,red,red)){.border-emerald-200\/50{border-color:color-mix(in oklab,var(--color-emerald-200) 50%,transparent)}}.border-emerald-200\/60{border-color:#a4f4cf99}@supports (color:color-mix(in lab,red,red)){.border-emerald-200\/60{border-color:color-mix(in oklab,var(--color-emerald-200) 60%,transparent)}}.border-emerald-300{border-color:var(--color-emerald-300)}.border-emerald-300\/40{border-color:#5ee9b566}@supports (color:color-mix(in lab,red,red)){.border-emerald-300\/40{border-color:color-mix(in oklab,var(--color-emerald-300) 40%,transparent)}}.border-emerald-300\/70{border-color:#5ee9b5b3}@supports (color:color-mix(in lab,red,red)){.border-emerald-300\/70{border-color:color-mix(in oklab,var(--color-emerald-300) 70%,transparent)}}.border-emerald-400{border-color:var(--color-emerald-400)}.border-emerald-400\/30{border-color:#00d2944d}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/30{border-color:color-mix(in oklab,var(--color-emerald-400) 30%,transparent)}}.border-emerald-400\/50{border-color:#00d29480}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/50{border-color:color-mix(in oklab,var(--color-emerald-400) 50%,transparent)}}.border-emerald-500{border-color:var(--color-emerald-500)}.border-emerald-500\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/20{border-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-emerald-600\/50{border-color:#00976780}@supports (color:color-mix(in lab,red,red)){.border-emerald-600\/50{border-color:color-mix(in oklab,var(--color-emerald-600) 50%,transparent)}}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-200{border-color:var(--color-green-200)}.border-green-500\/40{border-color:#00c75866}@supports (color:color-mix(in lab,red,red)){.border-green-500\/40{border-color:color-mix(in oklab,var(--color-green-500) 40%,transparent)}}.border-indigo-50{border-color:var(--color-indigo-50)}.border-indigo-100{border-color:var(--color-indigo-100)}.border-indigo-100\/50{border-color:#e0e7ff80}@supports (color:color-mix(in lab,red,red)){.border-indigo-100\/50{border-color:color-mix(in oklab,var(--color-indigo-100) 50%,transparent)}}.border-indigo-200{border-color:var(--color-indigo-200)}.border-indigo-200\/50{border-color:#c7d2ff80}@supports (color:color-mix(in lab,red,red)){.border-indigo-200\/50{border-color:color-mix(in oklab,var(--color-indigo-200) 50%,transparent)}}.border-indigo-300{border-color:var(--color-indigo-300)}.border-indigo-400{border-color:var(--color-indigo-400)}.border-indigo-500{border-color:var(--color-indigo-500)}.border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500) 30%,transparent)}}.border-indigo-600\/50{border-color:#4f39f680}@supports (color:color-mix(in lab,red,red)){.border-indigo-600\/50{border-color:color-mix(in oklab,var(--color-indigo-600) 50%,transparent)}}.border-input{border-color:var(--input)}.border-muted-foreground\/15{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.border-muted-foreground\/15{border-color:color-mix(in oklab,var(--muted-foreground) 15%,transparent)}}.border-orange-100{border-color:var(--color-orange-100)}.border-orange-100\/50{border-color:#ffedd580}@supports (color:color-mix(in lab,red,red)){.border-orange-100\/50{border-color:color-mix(in oklab,var(--color-orange-100) 50%,transparent)}}.border-orange-200{border-color:var(--color-orange-200)}.border-orange-200\/60{border-color:#ffd7a899}@supports (color:color-mix(in lab,red,red)){.border-orange-200\/60{border-color:color-mix(in oklab,var(--color-orange-200) 60%,transparent)}}.border-orange-300\/50{border-color:#ffb96d80}@supports (color:color-mix(in lab,red,red)){.border-orange-300\/50{border-color:color-mix(in oklab,var(--color-orange-300) 50%,transparent)}}.border-orange-400{border-color:var(--color-orange-400)}.border-orange-500{border-color:var(--color-orange-500)}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500) 30%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500) 40%,transparent)}}.border-primary{border-color:var(--primary)}.border-purple-50{border-color:var(--color-purple-50)}.border-purple-100{border-color:var(--color-purple-100)}.border-purple-100\/50{border-color:#f3e8ff80}@supports (color:color-mix(in lab,red,red)){.border-purple-100\/50{border-color:color-mix(in oklab,var(--color-purple-100) 50%,transparent)}}.border-purple-200{border-color:var(--color-purple-200)}.border-purple-200\/60{border-color:#e9d5ff99}@supports (color:color-mix(in lab,red,red)){.border-purple-200\/60{border-color:color-mix(in oklab,var(--color-purple-200) 60%,transparent)}}.border-purple-300{border-color:var(--color-purple-300)}.border-purple-400{border-color:var(--color-purple-400)}.border-purple-500{border-color:var(--color-purple-500)}.border-purple-500\/20{border-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/20{border-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.border-red-100{border-color:var(--color-red-100)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-red-400{border-color:var(--color-red-400)}.border-red-500{border-color:var(--color-red-500)}.border-rose-50{border-color:var(--color-rose-50)}.border-rose-100{border-color:var(--color-rose-100)}.border-rose-100\/50{border-color:#ffe4e680}@supports (color:color-mix(in lab,red,red)){.border-rose-100\/50{border-color:color-mix(in oklab,var(--color-rose-100) 50%,transparent)}}.border-rose-100\/60{border-color:#ffe4e699}@supports (color:color-mix(in lab,red,red)){.border-rose-100\/60{border-color:color-mix(in oklab,var(--color-rose-100) 60%,transparent)}}.border-rose-200{border-color:var(--color-rose-200)}.border-rose-200\/50{border-color:#ffccd380}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/50{border-color:color-mix(in oklab,var(--color-rose-200) 50%,transparent)}}.border-rose-200\/60{border-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/60{border-color:color-mix(in oklab,var(--color-rose-200) 60%,transparent)}}.border-rose-300{border-color:var(--color-rose-300)}.border-rose-300\/70{border-color:#ffa2aeb3}@supports (color:color-mix(in lab,red,red)){.border-rose-300\/70{border-color:color-mix(in oklab,var(--color-rose-300) 70%,transparent)}}.border-rose-400{border-color:var(--color-rose-400)}.border-rose-400\/50{border-color:#ff667f80}@supports (color:color-mix(in lab,red,red)){.border-rose-400\/50{border-color:color-mix(in oklab,var(--color-rose-400) 50%,transparent)}}.border-rose-500{border-color:var(--color-rose-500)}.border-rose-500\/20{border-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/20{border-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.border-rose-500\/30{border-color:#ff23574d}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/30{border-color:color-mix(in oklab,var(--color-rose-500) 30%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500) 50%,transparent)}}.border-sidebar-border{border-color:var(--sidebar-border)}.border-sky-100{border-color:var(--color-violet-100)}.border-sky-100\/80{border-color:#ede9fecc}@supports (color:color-mix(in lab,red,red)){.border-sky-100\/80{border-color:color-mix(in oklab,var(--color-violet-100) 80%,transparent)}}.border-sky-200{border-color:var(--color-violet-200)}.border-sky-200\/50{border-color:#ddd6ff80}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/50{border-color:color-mix(in oklab,var(--color-violet-200) 50%,transparent)}}.border-sky-200\/60{border-color:#ddd6ff99}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/60{border-color:color-mix(in oklab,var(--color-violet-200) 60%,transparent)}}.border-sky-300{border-color:var(--color-violet-300)}.border-sky-400{border-color:var(--color-violet-400)}.border-sky-500{border-color:var(--color-violet-500)}.border-sky-500\/20{border-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/20{border-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.border-sky-500\/30{border-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/30{border-color:color-mix(in oklab,var(--color-violet-500) 30%,transparent)}}.border-sky-500\/40{border-color:#8d54ff66}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/40{border-color:color-mix(in oklab,var(--color-violet-500) 40%,transparent)}}.border-sky-600{border-color:var(--color-violet-600)}.border-slate-50{border-color:var(--color-slate-50)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-100\/30{border-color:#f1f5f94d}@supports (color:color-mix(in lab,red,red)){.border-slate-100\/30{border-color:color-mix(in oklab,var(--color-slate-100) 30%,transparent)}}.border-slate-100\/50{border-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.border-slate-100\/50{border-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\/50{border-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/50{border-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.border-slate-200\/60{border-color:#e2e8f099}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/60{border-color:color-mix(in oklab,var(--color-slate-200) 60%,transparent)}}.border-slate-200\/70{border-color:#e2e8f0b3}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/70{border-color:color-mix(in oklab,var(--color-slate-200) 70%,transparent)}}.border-slate-200\/80{border-color:#e2e8f0cc}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/80{border-color:color-mix(in oklab,var(--color-slate-200) 80%,transparent)}}.border-slate-300{border-color:var(--color-slate-300)}.border-slate-300\/30{border-color:#cad5e24d}@supports (color:color-mix(in lab,red,red)){.border-slate-300\/30{border-color:color-mix(in oklab,var(--color-slate-300) 30%,transparent)}}.border-slate-300\/50{border-color:#cad5e280}@supports (color:color-mix(in lab,red,red)){.border-slate-300\/50{border-color:color-mix(in oklab,var(--color-slate-300) 50%,transparent)}}.border-slate-700{border-color:var(--color-slate-700)}.border-slate-700\/50{border-color:#31415880}@supports (color:color-mix(in lab,red,red)){.border-slate-700\/50{border-color:color-mix(in oklab,var(--color-slate-700) 50%,transparent)}}.border-slate-800{border-color:var(--color-slate-800)}.border-slate-800\/10{border-color:#1d293d1a}@supports (color:color-mix(in lab,red,red)){.border-slate-800\/10{border-color:color-mix(in oklab,var(--color-slate-800) 10%,transparent)}}.border-teal-300{border-color:var(--color-teal-300)}.border-teal-300\/60{border-color:#46ecd599}@supports (color:color-mix(in lab,red,red)){.border-teal-300\/60{border-color:color-mix(in oklab,var(--color-teal-300) 60%,transparent)}}.border-transparent{border-color:#0000}.border-violet-100{border-color:var(--color-violet-100)}.border-violet-200\/60{border-color:#ddd6ff99}@supports (color:color-mix(in lab,red,red)){.border-violet-200\/60{border-color:color-mix(in oklab,var(--color-violet-200) 60%,transparent)}}.border-violet-300{border-color:var(--color-violet-300)}.border-violet-800{border-color:var(--color-violet-800)}.border-white{border-color:var(--color-white)}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.border-white\/15{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.border-white\/15{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.border-white\/25{border-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.border-white\/25{border-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.border-white\/30{border-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.border-white\/35{border-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.border-white\/35{border-color:color-mix(in oklab,var(--color-white) 35%,transparent)}}.border-white\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\/40{border-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.border-white\/50{border-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.border-white\/50{border-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.border-white\/80{border-color:#fffc}@supports (color:color-mix(in lab,red,red)){.border-white\/80{border-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.border-white\/90{border-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.border-white\/90{border-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.border-zinc-200{border-color:var(--color-zinc-200)}.border-t-\[\#0ea5e9\]{border-top-color:#0ea5e9}.border-t-\[\#10b981\]{border-top-color:#10b981}.border-t-\[\#9956DE\]{border-top-color:#9956de}.border-t-\[\#a855f7\]{border-top-color:#a855f7}.border-t-slate-800{border-top-color:var(--color-slate-800)}.border-t-transparent{border-top-color:#0000}.border-t-white{border-top-color:var(--color-white)}.border-r-amber-300{border-right-color:var(--color-amber-300)}.border-r-teal-300{border-right-color:var(--color-teal-300)}.border-r-transparent{border-right-color:#0000}.border-b-amber-300{border-bottom-color:var(--color-amber-300)}.border-b-teal-300{border-bottom-color:var(--color-teal-300)}.border-l-\[\#1FA7E1\]{border-left-color:#1fa7e1}.border-l-\[\#6ED1CF\]{border-left-color:#6ed1cf}.border-l-\[\#10b981\]{border-left-color:#10b981}.border-l-\[\#7274ED\]{border-left-color:#7274ed}.border-l-\[\#9956DE\]{border-left-color:#9956de}.border-l-\[\#FFB356\]{border-left-color:#ffb356}.border-l-\[\#a855f7\]{border-left-color:#a855f7}.border-l-\[\#f43f5e\]{border-left-color:#f43f5e}.border-l-amber-400{border-left-color:var(--color-amber-400)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-blue-400{border-left-color:var(--color-blue-400)}.border-l-emerald-400{border-left-color:var(--color-emerald-400)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-rose-400{border-left-color:var(--color-rose-400)}.border-l-rose-500{border-left-color:var(--color-rose-500)}.border-l-transparent{border-left-color:#0000}.\!bg-\[\#6ED1CF\]\/35{background-color:#6ed1cf59!important}.\!bg-\[\#7274ED\]{background-color:#7274ed!important}.bg-\(--color-bg\){background-color:var(--color-bg)}.bg-\[\#0B0F19\]{background-color:#0b0f19}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0ea5e9\]{background-color:#0ea5e9}.bg-\[\#0ea5e9\]\/10{background-color:#0ea5e91a}.bg-\[\#0f1422\]{background-color:#0f1422}.bg-\[\#00a86b\]{background-color:#00a86b}.bg-\[\#1FA7E1\]{background-color:#1fa7e1}.bg-\[\#1FA7E1\]\/10{background-color:#1fa7e11a}.bg-\[\#1FA7E1\]\/80{background-color:#1fa7e1cc}.bg-\[\#1a85a4\]{background-color:#1a85a4}.bg-\[\#1a2030\]{background-color:#1a2030}.bg-\[\#1e293b\]{background-color:#1e293b}.bg-\[\#1e2433\]{background-color:#1e2433}.bg-\[\#1e2433\]\/95{background-color:#1e2433f2}.bg-\[\#1e2536\]{background-color:#1e2536}.bg-\[\#2d1b69\]{background-color:#2d1b69}.bg-\[\#2f3547\]{background-color:#2f3547}.bg-\[\#3b3a82\]{background-color:#3b3a82}.bg-\[\#3b82f6\]{background-color:#3b82f6}.bg-\[\#4f46e5\]{background-color:#4f46e5}.bg-\[\#4f46e5\]\/10{background-color:#4f46e51a}.bg-\[\#6D28D9\]{background-color:#6d28d9}.bg-\[\#6ED1CF\]\/10{background-color:#6ed1cf1a}.bg-\[\#6ED1CF\]\/30{background-color:#6ed1cf4d}.bg-\[\#6F2BAF\]{background-color:#6f2baf}.bg-\[\#7C51A8\]{background-color:#7c51a8}.bg-\[\#7ec16d\]{background-color:#7ec16d}.bg-\[\#8A3FD3\]{background-color:#8a3fd3}.bg-\[\#8A3FD3\]\/5{background-color:#8a3fd30d}.bg-\[\#8A3FD3\]\/10{background-color:#8a3fd31a}.bg-\[\#8B5CF6\]{background-color:#8b5cf6}.bg-\[\#8E1010\]{background-color:#8e1010}.bg-\[\#8b5cf6\]{background-color:#8b5cf6}.bg-\[\#9a67d0\]{background-color:#9a67d0}.bg-\[\#9b51e0\]{background-color:#9b51e0}.bg-\[\#10B981\],.bg-\[\#10b981\]{background-color:#10b981}.bg-\[\#22c55e\]{background-color:#22c55e}.bg-\[\#34d399\]{background-color:#34d399}.bg-\[\#48bca6\]{background-color:#48bca6}.bg-\[\#58B34D\]{background-color:#58b34d}.bg-\[\#62b658\]{background-color:#62b658}.bg-\[\#75D06A\]{background-color:#75d06a}.bg-\[\#75D06A\]\/10{background-color:#75d06a1a}.bg-\[\#75D06A\]\/14{background-color:#75d06a24}.bg-\[\#75D06A\]\/15{background-color:#75d06a26}.bg-\[\#75D06A\]\/22{background-color:#75d06a38}.bg-\[\#75D06A\]\/100{background-color:#75d06a}.bg-\[\#127DA6\]{background-color:#127da6}.bg-\[\#158abf\]{background-color:#158abf}.bg-\[\#161a25\]\/90{background-color:#161a25e6}.bg-\[\#181d27\]{background-color:#181d27}.bg-\[\#533ab6\]{background-color:#533ab6}.bg-\[\#662AA8\]{background-color:#662aa8}.bg-\[\#818cf8\]{background-color:#818cf8}.bg-\[\#2563eb\]{background-color:#2563eb}.bg-\[\#5154E7\]{background-color:#5154e7}.bg-\[\#6366f1\]{background-color:#6366f1}.bg-\[\#7274ED\]{background-color:#7274ed}.bg-\[\#7274ED\]\/10{background-color:#7274ed1a}.bg-\[\#7274ED\]\/80{background-color:#7274edcc}.bg-\[\#7274ED\]\/100{background-color:#7274ed}.bg-\[\#8544c7\]{background-color:#8544c7}.bg-\[\#9956DE\]{background-color:#9956de}.bg-\[\#9956DE\]\/5{background-color:#9956de0d}.bg-\[\#9956DE\]\/10{background-color:#9956de1a}.bg-\[\#9956DE\]\/12{background-color:#9956de1f}.bg-\[\#9956DE\]\/16{background-color:#9956de29}.bg-\[\#9956DE\]\/20{background-color:#9956de33}.bg-\[\#9956DE\]\/30{background-color:#9956de4d}.bg-\[\#9956DE\]\/32{background-color:#9956de52}.bg-\[\#9956DE\]\/80{background-color:#9956decc}.bg-\[\#9956de\]{background-color:#9956de}.bg-\[\#10709b\]{background-color:#10709b}.bg-\[\#42389d\]{background-color:#42389d}.bg-\[\#059669\]{background-color:#059669}.bg-\[\#111827\]{background-color:#111827}.bg-\[\#475569\]{background-color:#475569}.bg-\[\#633299\]{background-color:#633299}.bg-\[\#C62828\]{background-color:#c62828}.bg-\[\#D96C6A\]{background-color:#d96c6a}.bg-\[\#D44747\]{background-color:#d44747}.bg-\[\#DE7949\]{background-color:#de7949}.bg-\[\#E06A6A\]{background-color:#e06a6a}.bg-\[\#F43F5E\]{background-color:#f43f5e}.bg-\[\#F08386\]\/10{background-color:#f083861a}.bg-\[\#F08386\]\/12{background-color:#f083861f}.bg-\[\#F08386\]\/15{background-color:#f0838626}.bg-\[\#F08386\]\/20{background-color:#f0838633}.bg-\[\#F39029\]{background-color:#f39029}.bg-\[\#FB96BB\]{background-color:#fb96bb}.bg-\[\#FE6464\]{background-color:#fe6464}.bg-\[\#FF8B8B\]{background-color:#ff8b8b}.bg-\[\#FF8B8B\]\/10{background-color:#ff8b8b1a}.bg-\[\#FF8B8B\]\/14{background-color:#ff8b8b24}.bg-\[\#FF8B8B\]\/22{background-color:#ff8b8b38}.bg-\[\#FFA23A\]{background-color:#ffa23a}.bg-\[\#FFB356\]{background-color:#ffb356}.bg-\[\#FFB356\]\/10{background-color:#ffb3561a}.bg-\[\#FFB356\]\/16{background-color:#ffb35629}.bg-\[\#FFB356\]\/90{background-color:#ffb356e6}.bg-\[\#a855f7\]{background-color:#a855f7}.bg-\[\#be185d\]{background-color:#be185d}.bg-\[\#d946ef\]{background-color:#d946ef}.bg-\[\#dde3eb\]{background-color:#dde3eb}.bg-\[\#df7b9e\]{background-color:#df7b9e}.bg-\[\#e0e7ff\]{background-color:#e0e7ff}.bg-\[\#e0f4fa\]{background-color:#e0f4fa}.bg-\[\#e2e8f0\]{background-color:#e2e8f0}.bg-\[\#e66a5e\]{background-color:#e66a5e}.bg-\[\#e67070\]{background-color:#e67070}.bg-\[\#e69940\]{background-color:#e69940}.bg-\[\#eb74a6\]{background-color:#eb74a6}.bg-\[\#ecfdf5\]{background-color:#ecfdf5}.bg-\[\#edf1f7\]{background-color:#edf1f7}.bg-\[\#eef2ff\]{background-color:#eef2ff}.bg-\[\#eef2ff\]\/80{background-color:#eef2ffcc}.bg-\[\#ef4444\]{background-color:#ef4444}.bg-\[\#eff6ff\]{background-color:#eff6ff}.bg-\[\#f0fdf4\]{background-color:#f0fdf4}.bg-\[\#f1f5f9\]{background-color:#f1f5f9}.bg-\[\#f3e8ff\]{background-color:#f3e8ff}.bg-\[\#f5f3ff\]{background-color:#f5f3ff}.bg-\[\#f5f3ff\]\/40{background-color:#f5f3ff66}.bg-\[\#f5f3ff\]\/60{background-color:#f5f3ff99}.bg-\[\#f7f9fc\]{background-color:#f7f9fc}.bg-\[\#f8fafc\]{background-color:#f8fafc}.bg-\[\#f8fafc\]\/50{background-color:#f8fafc80}.bg-\[\#f8fafc\]\/80{background-color:#f8fafccc}.bg-\[\#f8faff\]{background-color:#f8faff}.bg-\[\#f8fbff\]{background-color:#f8fbff}.bg-\[\#f43f5e\]{background-color:#f43f5e}.bg-\[\#f59e0b\]{background-color:#f59e0b}.bg-\[\#f97316\]{background-color:#f97316}.bg-\[\#fb7185\]{background-color:#fb7185}.bg-\[\#fbab41\]{background-color:#fbab41}.bg-\[\#fbbf24\]{background-color:#fbbf24}.bg-\[\#fdfdfd\]{background-color:#fdfdfd}.bg-\[\#fee2e2\]{background-color:#fee2e2}.bg-\[\#fff1f2\]{background-color:#fff1f2}.bg-\[\#fff3cd\]{background-color:#fff3cd}.bg-\[\#fff7ed\]{background-color:#fff7ed}.bg-\[\#fffbeb\]{background-color:#fffbeb}.bg-\[color-mix\(in_srgb\,var\(--chart-2\)_14\%\,transparent\)\]{background-color:var(--chart-2)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-2\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-2) 14%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-3\)_14\%\,transparent\)\]{background-color:var(--chart-3)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-3\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-3) 14%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-4\)_14\%\,transparent\)\]{background-color:var(--chart-4)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-4\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-4) 14%,transparent)}}.bg-accent{background-color:var(--accent)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-50\/20{background-color:#fffbeb33}@supports (color:color-mix(in lab,red,red)){.bg-amber-50\/20{background-color:color-mix(in oklab,var(--color-amber-50) 20%,transparent)}}.bg-amber-50\/30{background-color:#fffbeb4d}@supports (color:color-mix(in lab,red,red)){.bg-amber-50\/30{background-color:color-mix(in oklab,var(--color-amber-50) 30%,transparent)}}.bg-amber-50\/40{background-color:#fffbeb66}@supports (color:color-mix(in lab,red,red)){.bg-amber-50\/40{background-color:color-mix(in oklab,var(--color-amber-50) 40%,transparent)}}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-300\/20{background-color:#ffd23633}@supports (color:color-mix(in lab,red,red)){.bg-amber-300\/20{background-color:color-mix(in oklab,var(--color-amber-300) 20%,transparent)}}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-400\/90{background-color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.bg-amber-400\/90{background-color:color-mix(in oklab,var(--color-amber-400) 90%,transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-amber-600{background-color:var(--color-amber-600)}.bg-background{background-color:var(--background)}.bg-black\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\/0{background-color:color-mix(in oklab,var(--color-black) 0%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.bg-black\/15{background-color:#00000026}@supports (color:color-mix(in lab,red,red)){.bg-black\/15{background-color:color-mix(in oklab,var(--color-black) 15%,transparent)}}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-50\/30{background-color:#eff6ff4d}@supports (color:color-mix(in lab,red,red)){.bg-blue-50\/30{background-color:color-mix(in oklab,var(--color-blue-50) 30%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-100\/40{background-color:#dbeafe66}@supports (color:color-mix(in lab,red,red)){.bg-blue-100\/40{background-color:color-mix(in oklab,var(--color-blue-100) 40%,transparent)}}.bg-blue-300\/40{background-color:#90c5ff66}@supports (color:color-mix(in lab,red,red)){.bg-blue-300\/40{background-color:color-mix(in oklab,var(--color-blue-300) 40%,transparent)}}.bg-blue-400{background-color:var(--color-blue-400)}.bg-blue-400\/30{background-color:#54a2ff4d}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/30{background-color:color-mix(in oklab,var(--color-blue-400) 30%,transparent)}}.bg-blue-400\/40{background-color:#54a2ff66}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/40{background-color:color-mix(in oklab,var(--color-blue-400) 40%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500) 10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500) 20%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--border)}.bg-card,.bg-card\/20{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/20{background-color:color-mix(in oklab,var(--card) 20%,transparent)}}.bg-cyan-400\/30{background-color:#00d2ef4d}@supports (color:color-mix(in lab,red,red)){.bg-cyan-400\/30{background-color:color-mix(in oklab,var(--color-cyan-400) 30%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/10{background-color:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/10{background-color:color-mix(in oklab,var(--color-cyan-500) 10%,transparent)}}.bg-destructive{background-color:var(--destructive)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-50\/20{background-color:#ecfdf533}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/20{background-color:color-mix(in oklab,var(--color-emerald-50) 20%,transparent)}}.bg-emerald-50\/30{background-color:#ecfdf54d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/30{background-color:color-mix(in oklab,var(--color-emerald-50) 30%,transparent)}}.bg-emerald-50\/40{background-color:#ecfdf566}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/40{background-color:color-mix(in oklab,var(--color-emerald-50) 40%,transparent)}}.bg-emerald-50\/50{background-color:#ecfdf580}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/50{background-color:color-mix(in oklab,var(--color-emerald-50) 50%,transparent)}}.bg-emerald-50\/80{background-color:#ecfdf5cc}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/80{background-color:color-mix(in oklab,var(--color-emerald-50) 80%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-100\/50{background-color:#d0fae580}@supports (color:color-mix(in lab,red,red)){.bg-emerald-100\/50{background-color:color-mix(in oklab,var(--color-emerald-100) 50%,transparent)}}.bg-emerald-200{background-color:var(--color-emerald-200)}.bg-emerald-200\/50{background-color:#a4f4cf80}@supports (color:color-mix(in lab,red,red)){.bg-emerald-200\/50{background-color:color-mix(in oklab,var(--color-emerald-200) 50%,transparent)}}.bg-emerald-300{background-color:var(--color-emerald-300)}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-500\/30{background-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/30{background-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-foreground{background-color:var(--foreground)}.bg-fuchsia-300\/20{background-color:#f2a9ff33}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-300\/20{background-color:color-mix(in oklab,var(--color-fuchsia-300) 20%,transparent)}}.bg-fuchsia-400\/30{background-color:#ec6cff4d}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-400\/30{background-color:color-mix(in oklab,var(--color-fuchsia-400) 30%,transparent)}}.bg-fuchsia-500{background-color:var(--color-fuchsia-500)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500) 20%,transparent)}}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-50\/50{background-color:#eef2ff80}@supports (color:color-mix(in lab,red,red)){.bg-indigo-50\/50{background-color:color-mix(in oklab,var(--color-indigo-50) 50%,transparent)}}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-100\/50{background-color:#e0e7ff80}@supports (color:color-mix(in lab,red,red)){.bg-indigo-100\/50{background-color:color-mix(in oklab,var(--color-indigo-100) 50%,transparent)}}.bg-indigo-200{background-color:var(--color-indigo-200)}.bg-indigo-300{background-color:var(--color-indigo-300)}.bg-indigo-300\/10{background-color:#a4b3ff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-300\/10{background-color:color-mix(in oklab,var(--color-indigo-300) 10%,transparent)}}.bg-indigo-400{background-color:var(--color-indigo-400)}.bg-indigo-400\/30{background-color:#7d87ff4d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-400\/30{background-color:color-mix(in oklab,var(--color-indigo-400) 30%,transparent)}}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/10{background-color:color-mix(in oklab,var(--color-indigo-500) 10%,transparent)}}.bg-indigo-500\/20{background-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/20{background-color:color-mix(in oklab,var(--color-indigo-500) 20%,transparent)}}.bg-indigo-500\/30{background-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/30{background-color:color-mix(in oklab,var(--color-indigo-500) 30%,transparent)}}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-input-background{background-color:var(--input-background)}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\/30{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/30{background-color:color-mix(in oklab,var(--muted-foreground) 30%,transparent)}}.bg-muted\/20{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/20{background-color:color-mix(in oklab,var(--muted) 20%,transparent)}}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted) 30%,transparent)}}.bg-muted\/40{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,var(--muted) 40%,transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-orange-50{background-color:var(--color-orange-50)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-orange-400{background-color:var(--color-orange-400)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500) 10%,transparent)}}.bg-orange-500\/15{background-color:#fe6e0026}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/15{background-color:color-mix(in oklab,var(--color-orange-500) 15%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-pink-500\/20{background-color:#f6339a33}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/20{background-color:color-mix(in oklab,var(--color-pink-500) 20%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary,.bg-primary\/10{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary) 10%,transparent)}}.bg-primary\/20{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.bg-purple-50{background-color:var(--color-purple-50)}.bg-purple-50\/20{background-color:#faf5ff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/20{background-color:color-mix(in oklab,var(--color-purple-50) 20%,transparent)}}.bg-purple-50\/30{background-color:#faf5ff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/30{background-color:color-mix(in oklab,var(--color-purple-50) 30%,transparent)}}.bg-purple-50\/40{background-color:#faf5ff66}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/40{background-color:color-mix(in oklab,var(--color-purple-50) 40%,transparent)}}.bg-purple-50\/50{background-color:#faf5ff80}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/50{background-color:color-mix(in oklab,var(--color-purple-50) 50%,transparent)}}.bg-purple-50\/80{background-color:#faf5ffcc}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/80{background-color:color-mix(in oklab,var(--color-purple-50) 80%,transparent)}}.bg-purple-100{background-color:var(--color-purple-100)}.bg-purple-100\/30{background-color:#f3e8ff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-100\/30{background-color:color-mix(in oklab,var(--color-purple-100) 30%,transparent)}}.bg-purple-200\/30{background-color:#e9d5ff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-200\/30{background-color:color-mix(in oklab,var(--color-purple-200) 30%,transparent)}}.bg-purple-300{background-color:var(--color-purple-300)}.bg-purple-300\/10{background-color:#d9b3ff1a}@supports (color:color-mix(in lab,red,red)){.bg-purple-300\/10{background-color:color-mix(in oklab,var(--color-purple-300) 10%,transparent)}}.bg-purple-400{background-color:var(--color-purple-400)}.bg-purple-400\/20{background-color:#c07eff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-400\/20{background-color:color-mix(in oklab,var(--color-purple-400) 20%,transparent)}}.bg-purple-400\/30{background-color:#c07eff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-400\/30{background-color:color-mix(in oklab,var(--color-purple-400) 30%,transparent)}}.bg-purple-500{background-color:var(--color-purple-500)}.bg-purple-500\/10{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/10{background-color:color-mix(in oklab,var(--color-purple-500) 10%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.bg-purple-500\/30{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/30{background-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.bg-purple-600{background-color:var(--color-purple-600)}.bg-purple-900\/20{background-color:#59168b33}@supports (color:color-mix(in lab,red,red)){.bg-purple-900\/20{background-color:color-mix(in oklab,var(--color-purple-900) 20%,transparent)}}.bg-purple-900\/40{background-color:#59168b66}@supports (color:color-mix(in lab,red,red)){.bg-purple-900\/40{background-color:color-mix(in oklab,var(--color-purple-900) 40%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-50\/30{background-color:#fef2f24d}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/30{background-color:color-mix(in oklab,var(--color-red-50) 30%,transparent)}}.bg-red-50\/50{background-color:#fef2f280}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/50{background-color:color-mix(in oklab,var(--color-red-50) 50%,transparent)}}.bg-red-50\/60{background-color:#fef2f299}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/60{background-color:color-mix(in oklab,var(--color-red-50) 60%,transparent)}}.bg-red-100{background-color:var(--color-red-100)}.bg-red-400{background-color:var(--color-red-400)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/80{background-color:#fb2c36cc}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/80{background-color:color-mix(in oklab,var(--color-red-500) 80%,transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-rose-50{background-color:var(--color-rose-50)}.bg-rose-50\/20{background-color:#fff1f233}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/20{background-color:color-mix(in oklab,var(--color-rose-50) 20%,transparent)}}.bg-rose-50\/30{background-color:#fff1f24d}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/30{background-color:color-mix(in oklab,var(--color-rose-50) 30%,transparent)}}.bg-rose-50\/40{background-color:#fff1f266}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/40{background-color:color-mix(in oklab,var(--color-rose-50) 40%,transparent)}}.bg-rose-50\/60{background-color:#fff1f299}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/60{background-color:color-mix(in oklab,var(--color-rose-50) 60%,transparent)}}.bg-rose-100{background-color:var(--color-rose-100)}.bg-rose-100\/30{background-color:#ffe4e64d}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/30{background-color:color-mix(in oklab,var(--color-rose-100) 30%,transparent)}}.bg-rose-100\/40{background-color:#ffe4e666}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/40{background-color:color-mix(in oklab,var(--color-rose-100) 40%,transparent)}}.bg-rose-200{background-color:var(--color-rose-200)}.bg-rose-200\/50{background-color:#ffccd380}@supports (color:color-mix(in lab,red,red)){.bg-rose-200\/50{background-color:color-mix(in oklab,var(--color-rose-200) 50%,transparent)}}.bg-rose-200\/60{background-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.bg-rose-200\/60{background-color:color-mix(in oklab,var(--color-rose-200) 60%,transparent)}}.bg-rose-300{background-color:var(--color-rose-300)}.bg-rose-300\/60{background-color:#ffa2ae99}@supports (color:color-mix(in lab,red,red)){.bg-rose-300\/60{background-color:color-mix(in oklab,var(--color-rose-300) 60%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-rose-500\/5{background-color:#ff23570d}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/5{background-color:color-mix(in oklab,var(--color-rose-500) 5%,transparent)}}.bg-rose-500\/10{background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/10{background-color:color-mix(in oklab,var(--color-rose-500) 10%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.bg-rose-600{background-color:var(--color-rose-600)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-sky-50{background-color:var(--color-violet-50)}.bg-sky-50\/40{background-color:#f5f3ff66}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/40{background-color:color-mix(in oklab,var(--color-violet-50) 40%,transparent)}}.bg-sky-50\/50{background-color:#f5f3ff80}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/50{background-color:color-mix(in oklab,var(--color-violet-50) 50%,transparent)}}.bg-sky-50\/70{background-color:#f5f3ffb3}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/70{background-color:color-mix(in oklab,var(--color-violet-50) 70%,transparent)}}.bg-sky-100{background-color:var(--color-violet-100)}.bg-sky-100\/40{background-color:#ede9fe66}@supports (color:color-mix(in lab,red,red)){.bg-sky-100\/40{background-color:color-mix(in oklab,var(--color-violet-100) 40%,transparent)}}.bg-sky-200{background-color:var(--color-violet-200)}.bg-sky-300\/10{background-color:#c4b4ff1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-300\/10{background-color:color-mix(in oklab,var(--color-violet-300) 10%,transparent)}}.bg-sky-400{background-color:var(--color-violet-400)}.bg-sky-400\/20{background-color:#a685ff33}@supports (color:color-mix(in lab,red,red)){.bg-sky-400\/20{background-color:color-mix(in oklab,var(--color-violet-400) 20%,transparent)}}.bg-sky-500{background-color:var(--color-violet-500)}.bg-sky-500\/5{background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/5{background-color:color-mix(in oklab,var(--color-violet-500) 5%,transparent)}}.bg-sky-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/10{background-color:color-mix(in oklab,var(--color-violet-500) 10%,transparent)}}.bg-sky-500\/20{background-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/20{background-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.bg-sky-600{background-color:var(--color-violet-600)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\/20{background-color:#f8fafc33}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/20{background-color:color-mix(in oklab,var(--color-slate-50) 20%,transparent)}}.bg-slate-50\/30{background-color:#f8fafc4d}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/30{background-color:color-mix(in oklab,var(--color-slate-50) 30%,transparent)}}.bg-slate-50\/50{background-color:#f8fafc80}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/50{background-color:color-mix(in oklab,var(--color-slate-50) 50%,transparent)}}.bg-slate-50\/60{background-color:#f8fafc99}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/60{background-color:color-mix(in oklab,var(--color-slate-50) 60%,transparent)}}.bg-slate-50\/80{background-color:#f8fafccc}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/80{background-color:color-mix(in oklab,var(--color-slate-50) 80%,transparent)}}.bg-slate-50\/90{background-color:#f8fafce6}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/90{background-color:color-mix(in oklab,var(--color-slate-50) 90%,transparent)}}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-100\/70{background-color:#f1f5f9b3}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/70{background-color:color-mix(in oklab,var(--color-slate-100) 70%,transparent)}}.bg-slate-100\/80{background-color:#f1f5f9cc}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/80{background-color:color-mix(in oklab,var(--color-slate-100) 80%,transparent)}}.bg-slate-100\/90{background-color:#f1f5f9e6}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/90{background-color:color-mix(in oklab,var(--color-slate-100) 90%,transparent)}}.bg-slate-100\/95{background-color:#f1f5f9f2}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/95{background-color:color-mix(in oklab,var(--color-slate-100) 95%,transparent)}}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-200\/50{background-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.bg-slate-200\/50{background-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.bg-slate-200\/80{background-color:#e2e8f0cc}@supports (color:color-mix(in lab,red,red)){.bg-slate-200\/80{background-color:color-mix(in oklab,var(--color-slate-200) 80%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-300\/60{background-color:#cad5e299}@supports (color:color-mix(in lab,red,red)){.bg-slate-300\/60{background-color:color-mix(in oklab,var(--color-slate-300) 60%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500{background-color:var(--color-slate-500)}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-slate-700{background-color:var(--color-slate-700)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-800\/5{background-color:#1d293d0d}@supports (color:color-mix(in lab,red,red)){.bg-slate-800\/5{background-color:color-mix(in oklab,var(--color-slate-800) 5%,transparent)}}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\/5{background-color:#0f172b0d}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/5{background-color:color-mix(in oklab,var(--color-slate-900) 5%,transparent)}}.bg-slate-900\/10{background-color:#0f172b1a}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/10{background-color:color-mix(in oklab,var(--color-slate-900) 10%,transparent)}}.bg-slate-900\/40{background-color:#0f172b66}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/40{background-color:color-mix(in oklab,var(--color-slate-900) 40%,transparent)}}.bg-slate-900\/50{background-color:#0f172b80}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/50{background-color:color-mix(in oklab,var(--color-slate-900) 50%,transparent)}}.bg-slate-900\/60{background-color:#0f172b99}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/60{background-color:color-mix(in oklab,var(--color-slate-900) 60%,transparent)}}.bg-slate-900\/85{background-color:#0f172bd9}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/85{background-color:color-mix(in oklab,var(--color-slate-900) 85%,transparent)}}.bg-teal-50{background-color:var(--color-teal-50)}.bg-teal-100{background-color:var(--color-teal-100)}.bg-teal-400\/50{background-color:#00d3bd80}@supports (color:color-mix(in lab,red,red)){.bg-teal-400\/50{background-color:color-mix(in oklab,var(--color-teal-400) 50%,transparent)}}.bg-teal-500{background-color:var(--color-teal-500)}.bg-teal-500\/20{background-color:#00baa733}@supports (color:color-mix(in lab,red,red)){.bg-teal-500\/20{background-color:color-mix(in oklab,var(--color-teal-500) 20%,transparent)}}.bg-teal-600{background-color:var(--color-teal-600)}.bg-transparent{background-color:#0000}.bg-violet-50{background-color:var(--color-violet-50)}.bg-violet-100{background-color:var(--color-violet-100)}.bg-violet-500{background-color:var(--color-violet-500)}.bg-violet-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/10{background-color:color-mix(in oklab,var(--color-violet-500) 10%,transparent)}}.bg-violet-600{background-color:var(--color-violet-600)}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.bg-white\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-white\/30{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.bg-white\/30{background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.bg-white\/35{background-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.bg-white\/35{background-color:color-mix(in oklab,var(--color-white) 35%,transparent)}}.bg-white\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\/40{background-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.bg-white\/50{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.bg-white\/50{background-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.bg-white\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.bg-white\/60{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.bg-white\/70{background-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.bg-white\/70{background-color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-white\/85{background-color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.bg-white\/85{background-color:color-mix(in oklab,var(--color-white) 85%,transparent)}}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-white\/95{background-color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.bg-white\/95{background-color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-zinc-100{background-color:var(--color-zinc-100)}.\!bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab!important;background-image:linear-gradient(var(--tw-gradient-stops))!important}.\!bg-gradient-to-r{--tw-gradient-position:to right in oklab!important;background-image:linear-gradient(var(--tw-gradient-stops))!important}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-l{--tw-gradient-position:to left in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-tr{--tw-gradient-position:to top right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[radial-gradient\(circle_at_14\%_12\%\,rgba\(251\,150\,187\,0\.35\)\,transparent_42\%\)\,radial-gradient\(circle_at_80\%_80\%\,rgba\(117\,208\,106\,0\.25\)\,transparent_38\%\)\]{background-image:radial-gradient(circle at 14% 12%,#fb96bb59,#0000 42%),radial-gradient(circle at 80% 80%,#75d06a40,#0000 38%)}.bg-\[radial-gradient\(circle_at_18\%_8\%\,rgba\(251\,150\,187\,0\.32\)\,transparent_42\%\)\,radial-gradient\(circle_at_85\%_84\%\,rgba\(117\,208\,106\,0\.24\)\,transparent_40\%\)\]{background-image:radial-gradient(circle at 18% 8%,#fb96bb52,#0000 42%),radial-gradient(circle at 85% 84%,#75d06a3d,#0000 40%)}.bg-\[radial-gradient\(circle_at_50\%_100\%\,\#9333ea_0\%\,\#c084fc_40\%\,transparent_80\%\)\]{background-image:radial-gradient(circle at 50% 100%,#9333ea,#c084fc,#0000 80%)}.bg-\[radial-gradient\(circle_at_top_right\,rgba\(153\,86\,222\,0\.08\)\,transparent_45\%\)\,radial-gradient\(circle_at_bottom_left\,rgba\(31\,167\,225\,0\.08\)\,transparent_45\%\)\]{background-image:radial-gradient(circle at 100% 0,#9956de14,#0000 45%),radial-gradient(circle at 0 100%,#1fa7e114,#0000 45%)}.bg-\[radial-gradient\(ellipse_at_50\%_100\%\,\#7e22ce_10\%\,transparent_60\%\)\]{background-image:radial-gradient(at 50% 100%,#7e22ce 10%,#0000 60%)}.bg-\[url\(\'data\:image\/svg\+xml\;base64\,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAiLz4KPHBhdGggZD0iTTAgMEgxdjFIMHoiIGZpbGw9IiM2MzY2ZjEiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPgo8L3N2Zz4\=\'\)\]{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAiLz4KPHBhdGggZD0iTTAgMEgxdjFIMHoiIGZpbGw9IiM2MzY2ZjEiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPgo8L3N2Zz4=)}.bg-\[url\(\'data\:image\/svg\+xml\;base64\,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI\+PC9yZWN0Pgo8L3N2Zz4\=\'\)\]{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=)}.\!from-\[\#6ED1CF\]{--tw-gradient-from:#6ed1cf!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.\!from-emerald-50{--tw-gradient-from:var(--color-emerald-50)!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.from-\[\#0ea5e9\]{--tw-gradient-from:#0ea5e9;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#1FA7E1\]\/10{--tw-gradient-from:oklab(68.7044% -.0807821 -.10979/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#1a85a4\]{--tw-gradient-from:#1a85a4;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#3b3a82\]{--tw-gradient-from:#3b3a82;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#3b82f6\]{--tw-gradient-from:#3b82f6;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#4DB9E9\]{--tw-gradient-from:#4db9e9;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#4f46e5\]{--tw-gradient-from:#4f46e5;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#6ED1CF\]{--tw-gradient-from:#6ed1cf;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#6b7280\]{--tw-gradient-from:#6b7280;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#7ec16d\]{--tw-gradient-from:#7ec16d;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#9a67d0\]{--tw-gradient-from:#9a67d0;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#10b981\]{--tw-gradient-from:#10b981;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#48DA94\]{--tw-gradient-from:#48da94;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#48bca6\]{--tw-gradient-from:#48bca6;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#75D06A\]{--tw-gradient-from:#75d06a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#7274ED\]{--tw-gradient-from:#7274ed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#9956DE\]{--tw-gradient-from:#9956de;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#059669\]{--tw-gradient-from:#059669;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#64748b\]{--tw-gradient-from:#64748b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#B467FF\]{--tw-gradient-from:#b467ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#FF7B88\]{--tw-gradient-from:#ff7b88;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#FFB356\]{--tw-gradient-from:#ffb356;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#a855f7\]{--tw-gradient-from:#a855f7;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#e8f7fc\]{--tw-gradient-from:#e8f7fc;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#e66a5e\]{--tw-gradient-from:#e66a5e;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#eb74a6\]{--tw-gradient-from:#eb74a6;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#ecfdf5\]{--tw-gradient-from:#ecfdf5;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#eef2ff\]{--tw-gradient-from:#eef2ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#ef4444\]{--tw-gradient-from:#ef4444;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#f8fafc\]{--tw-gradient-from:#f8fafc;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#f43f5e\]{--tw-gradient-from:#f43f5e;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#f59e0b\]{--tw-gradient-from:#f59e0b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#f97316\]{--tw-gradient-from:#f97316;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#fbab41\]{--tw-gradient-from:#fbab41;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-50{--tw-gradient-from:var(--color-amber-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-100{--tw-gradient-from:var(--color-amber-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-300{--tw-gradient-from:var(--color-amber-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-400{--tw-gradient-from:var(--color-amber-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-500{--tw-gradient-from:var(--color-amber-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-500\/10{--tw-gradient-from:#f99c001a}@supports (color:color-mix(in lab,red,red)){.from-amber-500\/10{--tw-gradient-from:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.from-amber-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-500\/20{--tw-gradient-from:#f99c0033}@supports (color:color-mix(in lab,red,red)){.from-amber-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-amber-500) 20%, transparent)}}.from-amber-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-500\/50{--tw-gradient-from:#f99c0080}@supports (color:color-mix(in lab,red,red)){.from-amber-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-amber-500) 50%, transparent)}}.from-amber-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-400{--tw-gradient-from:var(--color-blue-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-50{--tw-gradient-from:var(--color-emerald-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-50\/80{--tw-gradient-from:#ecfdf5cc}@supports (color:color-mix(in lab,red,red)){.from-emerald-50\/80{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-50) 80%, transparent)}}.from-emerald-50\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-100\/90{--tw-gradient-from:#d0fae5e6}@supports (color:color-mix(in lab,red,red)){.from-emerald-100\/90{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-100) 90%, transparent)}}.from-emerald-100\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-400{--tw-gradient-from:var(--color-emerald-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-500{--tw-gradient-from:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-500\/10{--tw-gradient-from:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.from-emerald-500\/10{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.from-emerald-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-500\/50{--tw-gradient-from:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.from-emerald-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-500) 50%, transparent)}}.from-emerald-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-600{--tw-gradient-from:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-green-500{--tw-gradient-from:var(--color-green-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-50{--tw-gradient-from:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-50\/80{--tw-gradient-from:#eef2ffcc}@supports (color:color-mix(in lab,red,red)){.from-indigo-50\/80{--tw-gradient-from:color-mix(in oklab, var(--color-indigo-50) 80%, transparent)}}.from-indigo-50\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-100\/90{--tw-gradient-from:#e0e7ffe6}@supports (color:color-mix(in lab,red,red)){.from-indigo-100\/90{--tw-gradient-from:color-mix(in oklab, var(--color-indigo-100) 90%, transparent)}}.from-indigo-100\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-200{--tw-gradient-from:var(--color-indigo-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500{--tw-gradient-from:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500\/10{--tw-gradient-from:#625fff1a}@supports (color:color-mix(in lab,red,red)){.from-indigo-500\/10{--tw-gradient-from:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.from-indigo-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500\/20{--tw-gradient-from:#625fff33}@supports (color:color-mix(in lab,red,red)){.from-indigo-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-indigo-500) 20%, transparent)}}.from-indigo-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-600{--tw-gradient-from:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-orange-50{--tw-gradient-from:var(--color-orange-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-orange-500{--tw-gradient-from:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-50{--tw-gradient-from:var(--color-purple-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-50\/80{--tw-gradient-from:#faf5ffcc}@supports (color:color-mix(in lab,red,red)){.from-purple-50\/80{--tw-gradient-from:color-mix(in oklab, var(--color-purple-50) 80%, transparent)}}.from-purple-50\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-100\/90{--tw-gradient-from:#f3e8ffe6}@supports (color:color-mix(in lab,red,red)){.from-purple-100\/90{--tw-gradient-from:color-mix(in oklab, var(--color-purple-100) 90%, transparent)}}.from-purple-100\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-400\/20{--tw-gradient-from:#c07eff33}@supports (color:color-mix(in lab,red,red)){.from-purple-400\/20{--tw-gradient-from:color-mix(in oklab, var(--color-purple-400) 20%, transparent)}}.from-purple-400\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-600{--tw-gradient-from:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-50{--tw-gradient-from:var(--color-rose-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-100\/90{--tw-gradient-from:#ffe4e6e6}@supports (color:color-mix(in lab,red,red)){.from-rose-100\/90{--tw-gradient-from:color-mix(in oklab, var(--color-rose-100) 90%, transparent)}}.from-rose-100\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-400{--tw-gradient-from:var(--color-rose-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-500{--tw-gradient-from:var(--color-rose-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-500\/50{--tw-gradient-from:#ff235780}@supports (color:color-mix(in lab,red,red)){.from-rose-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-rose-500) 50%, transparent)}}.from-rose-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-50{--tw-gradient-from:var(--color-violet-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-100{--tw-gradient-from:var(--color-violet-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-400{--tw-gradient-from:var(--color-violet-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-500{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-500\/20{--tw-gradient-from:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.from-sky-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-violet-500) 20%, transparent)}}.from-sky-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-600{--tw-gradient-from:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-700{--tw-gradient-from:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-50{--tw-gradient-from:var(--color-slate-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-50\/30{--tw-gradient-from:#f8fafc4d}@supports (color:color-mix(in lab,red,red)){.from-slate-50\/30{--tw-gradient-from:color-mix(in oklab, var(--color-slate-50) 30%, transparent)}}.from-slate-50\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-100{--tw-gradient-from:var(--color-slate-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-200{--tw-gradient-from:var(--color-slate-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-400{--tw-gradient-from:var(--color-slate-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-800{--tw-gradient-from:var(--color-slate-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500{--tw-gradient-from:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-violet-500{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-violet-600{--tw-gradient-from:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white{--tw-gradient-from:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white\/0{--tw-gradient-from:#0000}@supports (color:color-mix(in lab,red,red)){.from-white\/0{--tw-gradient-from:color-mix(in oklab, var(--color-white) 0%, transparent)}}.from-white\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white\/20{--tw-gradient-from:#fff3}@supports (color:color-mix(in lab,red,red)){.from-white\/20{--tw-gradient-from:color-mix(in oklab, var(--color-white) 20%, transparent)}}.from-white\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white\/60{--tw-gradient-from:#fff9}@supports (color:color-mix(in lab,red,red)){.from-white\/60{--tw-gradient-from:color-mix(in oklab, var(--color-white) 60%, transparent)}}.from-white\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-\[\#6ED1CF\]{--tw-gradient-via:#6ed1cf;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#75D06A\]{--tw-gradient-via:#75d06a;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#7274ED\]{--tw-gradient-via:#7274ed;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#9956DE\]{--tw-gradient-via:#9956de;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#e2e8f0\]{--tw-gradient-via:#e2e8f0;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#f0fdf4\]{--tw-gradient-via:#f0fdf4;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#f5f3ff\]{--tw-gradient-via:#f5f3ff;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-amber-400\/40{--tw-gradient-via:#fcbb0066}@supports (color:color-mix(in lab,red,red)){.via-amber-400\/40{--tw-gradient-via:color-mix(in oklab, var(--color-amber-400) 40%, transparent)}}.via-amber-400\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-amber-500\/10{--tw-gradient-via:#f99c001a}@supports (color:color-mix(in lab,red,red)){.via-amber-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.via-amber-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-cyan-500{--tw-gradient-via:var(--color-cyan-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-cyan-500\/10{--tw-gradient-via:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.via-cyan-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-cyan-500) 10%, transparent)}}.via-cyan-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-emerald-500\/10{--tw-gradient-via:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.via-emerald-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.via-emerald-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-emerald-500\/40{--tw-gradient-via:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.via-emerald-500\/40{--tw-gradient-via:color-mix(in oklab, var(--color-emerald-500) 40%, transparent)}}.via-emerald-500\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-fuchsia-50{--tw-gradient-via:var(--color-fuchsia-50);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-fuchsia-500\/10{--tw-gradient-via:#e12afb1a}@supports (color:color-mix(in lab,red,red)){.via-fuchsia-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-fuchsia-500) 10%, transparent)}}.via-fuchsia-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-50\/80{--tw-gradient-via:#eef2ffcc}@supports (color:color-mix(in lab,red,red)){.via-indigo-50\/80{--tw-gradient-via:color-mix(in oklab, var(--color-indigo-50) 80%, transparent)}}.via-indigo-50\/80{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-500{--tw-gradient-via:var(--color-indigo-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-50{--tw-gradient-via:var(--color-orange-50);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-500{--tw-gradient-via:var(--color-orange-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-500\/5{--tw-gradient-via:#fe6e000d}@supports (color:color-mix(in lab,red,red)){.via-orange-500\/5{--tw-gradient-via:color-mix(in oklab, var(--color-orange-500) 5%, transparent)}}.via-orange-500\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-pink-500{--tw-gradient-via:var(--color-pink-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-pink-600{--tw-gradient-via:var(--color-pink-600);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-purple-500\/5{--tw-gradient-via:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.via-purple-500\/5{--tw-gradient-via:color-mix(in oklab, var(--color-purple-500) 5%, transparent)}}.via-purple-500\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-rose-500\/10{--tw-gradient-via:#ff23571a}@supports (color:color-mix(in lab,red,red)){.via-rose-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-rose-500) 10%, transparent)}}.via-rose-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-rose-500\/40{--tw-gradient-via:#ff235766}@supports (color:color-mix(in lab,red,red)){.via-rose-500\/40{--tw-gradient-via:color-mix(in oklab, var(--color-rose-500) 40%, transparent)}}.via-rose-500\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-50\/30{--tw-gradient-via:#f5f3ff4d}@supports (color:color-mix(in lab,red,red)){.via-sky-50\/30{--tw-gradient-via:color-mix(in oklab, var(--color-violet-50) 30%, transparent)}}.via-sky-50\/30{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-50\/50{--tw-gradient-via:#f5f3ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-50\/50{--tw-gradient-via:color-mix(in oklab, var(--color-violet-50) 50%, transparent)}}.via-sky-50\/50{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/30{--tw-gradient-via:#a685ff4d}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/30{--tw-gradient-via:color-mix(in oklab, var(--color-violet-400) 30%, transparent)}}.via-sky-400\/30{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/50{--tw-gradient-via:#a685ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/50{--tw-gradient-via:color-mix(in oklab, var(--color-violet-400) 50%, transparent)}}.via-sky-400\/50{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-500{--tw-gradient-via:var(--color-violet-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-teal-500\/5{--tw-gradient-via:#00baa70d}@supports (color:color-mix(in lab,red,red)){.via-teal-500\/5{--tw-gradient-via:color-mix(in oklab, var(--color-teal-500) 5%, transparent)}}.via-teal-500\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white{--tw-gradient-via:var(--color-white);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/15{--tw-gradient-via:#ffffff26}@supports (color:color-mix(in lab,red,red)){.via-white\/15{--tw-gradient-via:color-mix(in oklab, var(--color-white) 15%, transparent)}}.via-white\/15{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/30{--tw-gradient-via:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.via-white\/30{--tw-gradient-via:color-mix(in oklab, var(--color-white) 30%, transparent)}}.via-white\/30{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/40{--tw-gradient-via:#fff6}@supports (color:color-mix(in lab,red,red)){.via-white\/40{--tw-gradient-via:color-mix(in oklab, var(--color-white) 40%, transparent)}}.via-white\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.\!to-\[\#1FA7E1\]{--tw-gradient-to:#1fa7e1!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.\!to-teal-50{--tw-gradient-to:var(--color-teal-50)!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.to-\[\#1FA7E1\]{--tw-gradient-to:#1fa7e1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#2BBF7B\]{--tw-gradient-to:#2bbf7b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#2DA1D8\]{--tw-gradient-to:#2da1d8;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#4b5563\]{--tw-gradient-to:#4b5563;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#6ED1CF\]{--tw-gradient-to:#6ed1cf;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#6ED1CF\]\/10{--tw-gradient-to:oklab(80.0346% -.0906707 -.0221346/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#7c3aed\]{--tw-gradient-to:#7c3aed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#8a5cc0\]{--tw-gradient-to:#8a5cc0;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#9D44FF\]{--tw-gradient-to:#9d44ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#10b981\]{--tw-gradient-to:#10b981;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#40a794\]{--tw-gradient-to:#40a794;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#71ad62\]{--tw-gradient-to:#71ad62;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#75D06A\]{--tw-gradient-to:#75d06a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#126b84\]{--tw-gradient-to:#126b84;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#0284c7\]{--tw-gradient-to:#0284c7;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#2563eb\]{--tw-gradient-to:#2563eb;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#7274ED\]{--tw-gradient-to:#7274ed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#9333ea\]{--tw-gradient-to:#9333ea;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#9956DE\]{--tw-gradient-to:#9956de;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#059669\]{--tw-gradient-to:#059669;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#475569\]{--tw-gradient-to:#475569;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#FF5C70\]{--tw-gradient-to:#ff5c70;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#FF8B8B\]{--tw-gradient-to:#ff8b8b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#FF8C00\]{--tw-gradient-to:#ff8c00;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#FFB356\]{--tw-gradient-to:#ffb356;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#ce5e53\]{--tw-gradient-to:#ce5e53;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#d46895\]{--tw-gradient-to:#d46895;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#d97706\]{--tw-gradient-to:#d97706;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#dc2626\]{--tw-gradient-to:#dc2626;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#e11d48\]{--tw-gradient-to:#e11d48;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#e0983a\]{--tw-gradient-to:#e0983a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#ea580c\]{--tw-gradient-to:#ea580c;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#eef2ff\]{--tw-gradient-to:#eef2ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#f0fbff\]{--tw-gradient-to:#f0fbff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#f1f5f9\]{--tw-gradient-to:#f1f5f9;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#f7fdf9\]{--tw-gradient-to:#f7fdf9;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#faf5ff\]{--tw-gradient-to:#faf5ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#fff7ed\]{--tw-gradient-to:#fff7ed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-amber-50{--tw-gradient-to:var(--color-amber-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-amber-500{--tw-gradient-to:var(--color-amber-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-blue-600{--tw-gradient-to:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-100{--tw-gradient-to:var(--color-cyan-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-500{--tw-gradient-to:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-100\/30{--tw-gradient-to:#d0fae54d}@supports (color:color-mix(in lab,red,red)){.to-emerald-100\/30{--tw-gradient-to:color-mix(in oklab, var(--color-emerald-100) 30%, transparent)}}.to-emerald-100\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-200{--tw-gradient-to:var(--color-emerald-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-600{--tw-gradient-to:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-800{--tw-gradient-to:var(--color-emerald-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-fuchsia-500{--tw-gradient-to:var(--color-fuchsia-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50{--tw-gradient-to:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50\/30{--tw-gradient-to:#eef2ff4d}@supports (color:color-mix(in lab,red,red)){.to-indigo-50\/30{--tw-gradient-to:color-mix(in oklab, var(--color-indigo-50) 30%, transparent)}}.to-indigo-50\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50\/50{--tw-gradient-to:#eef2ff80}@supports (color:color-mix(in lab,red,red)){.to-indigo-50\/50{--tw-gradient-to:color-mix(in oklab, var(--color-indigo-50) 50%, transparent)}}.to-indigo-50\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50\/80{--tw-gradient-to:#eef2ffcc}@supports (color:color-mix(in lab,red,red)){.to-indigo-50\/80{--tw-gradient-to:color-mix(in oklab, var(--color-indigo-50) 80%, transparent)}}.to-indigo-50\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-200{--tw-gradient-to:var(--color-indigo-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-400{--tw-gradient-to:var(--color-indigo-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-500{--tw-gradient-to:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-600{--tw-gradient-to:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-700{--tw-gradient-to:var(--color-indigo-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-800{--tw-gradient-to:var(--color-indigo-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-50{--tw-gradient-to:var(--color-orange-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-100{--tw-gradient-to:var(--color-orange-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-400{--tw-gradient-to:var(--color-orange-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-500{--tw-gradient-to:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-600{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-400\/20{--tw-gradient-to:#fb64b633}@supports (color:color-mix(in lab,red,red)){.to-pink-400\/20{--tw-gradient-to:color-mix(in oklab, var(--color-pink-400) 20%, transparent)}}.to-pink-400\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-50{--tw-gradient-to:var(--color-purple-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-50\/20{--tw-gradient-to:#faf5ff33}@supports (color:color-mix(in lab,red,red)){.to-purple-50\/20{--tw-gradient-to:color-mix(in oklab, var(--color-purple-50) 20%, transparent)}}.to-purple-50\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-50\/60{--tw-gradient-to:#faf5ff99}@supports (color:color-mix(in lab,red,red)){.to-purple-50\/60{--tw-gradient-to:color-mix(in oklab, var(--color-purple-50) 60%, transparent)}}.to-purple-50\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500{--tw-gradient-to:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500\/20{--tw-gradient-to:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/20{--tw-gradient-to:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.to-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600\/5{--tw-gradient-to:#9810fa0d}@supports (color:color-mix(in lab,red,red)){.to-purple-600\/5{--tw-gradient-to:color-mix(in oklab, var(--color-purple-600) 5%, transparent)}}.to-purple-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-red-500{--tw-gradient-to:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-rose-500{--tw-gradient-to:var(--color-rose-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-rose-600{--tw-gradient-to:var(--color-rose-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-400{--tw-gradient-to:var(--color-violet-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-500{--tw-gradient-to:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-600{--tw-gradient-to:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-600\/5{--tw-gradient-to:#7f22fe0d}@supports (color:color-mix(in lab,red,red)){.to-sky-600\/5{--tw-gradient-to:color-mix(in oklab, var(--color-violet-600) 5%, transparent)}}.to-sky-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-800{--tw-gradient-to:var(--color-violet-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-50{--tw-gradient-to:var(--color-slate-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-100{--tw-gradient-to:var(--color-slate-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-300{--tw-gradient-to:var(--color-slate-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-600{--tw-gradient-to:var(--color-slate-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-900{--tw-gradient-to:var(--color-slate-900);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-50{--tw-gradient-to:var(--color-teal-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-300{--tw-gradient-to:var(--color-teal-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-500{--tw-gradient-to:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-600{--tw-gradient-to:var(--color-teal-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-violet-700{--tw-gradient-to:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-violet-800{--tw-gradient-to:var(--color-violet-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/0{--tw-gradient-to:#0000}@supports (color:color-mix(in lab,red,red)){.to-white\/0{--tw-gradient-to:color-mix(in oklab, var(--color-white) 0%, transparent)}}.to-white\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/20{--tw-gradient-to:#fff3}@supports (color:color-mix(in lab,red,red)){.to-white\/20{--tw-gradient-to:color-mix(in oklab, var(--color-white) 20%, transparent)}}.to-white\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/80{--tw-gradient-to:#fffc}@supports (color:color-mix(in lab,red,red)){.to-white\/80{--tw-gradient-to:color-mix(in oklab, var(--color-white) 80%, transparent)}}.to-white\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/90{--tw-gradient-to:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.to-white\/90{--tw-gradient-to:color-mix(in oklab, var(--color-white) 90%, transparent)}}.to-white\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.\[background-size\:var\(--beam-size\)_var\(--beam-size\)\]{background-size:var(--beam-size) var(--beam-size)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.fill-\[\#1e293b\]{fill:#1e293b}.fill-\[\#4f46e5\]{fill:#4f46e5}.fill-\[\#64748b\]{fill:#64748b}.fill-\[\#475569\]{fill:#475569}.fill-amber-300{fill:var(--color-amber-300)}.fill-blue-500{fill:var(--color-blue-500)}.fill-current{fill:currentColor}.fill-emerald-600{fill:var(--color-emerald-600)}.fill-primary{fill:var(--primary)}.fill-purple-600{fill:var(--color-purple-600)}.fill-white{fill:var(--color-white)}.fill-yellow-300{fill:var(--color-yellow-300)}.fill-yellow-400{fill:var(--color-yellow-400)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.object-bottom{object-position:bottom}.p-0{padding:calc(var(--spacing) * 0)}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.p-8{padding:calc(var(--spacing) * 8)}.p-12{padding:calc(var(--spacing) * 12)}.p-16{padding:calc(var(--spacing) * 16)}.p-\[1px\]{padding:1px}.p-\[2px_0_4px\]{padding:2px 0 4px}.p-\[3px\]{padding:3px}.p-\[10px\]{padding:10px}.p-\[10px_16px_8px\]{padding:10px 16px 8px}.p-\[12px\]{padding:12px}.p-\[12px_13px\]{padding:12px 13px}.p-\[12px_16px_0\]{padding:12px 16px 0}.p-\[14px\]{padding:14px}.p-\[14px_16px\]{padding:14px 16px}.p-\[16px\]{padding:16px}.p-\[18px\]{padding:18px}.p-\[18px_20px\]{padding:18px 20px}.p-\[20px\]{padding:20px}.p-\[22px_16px_10px\]{padding:22px 16px 10px}.p-\[24px\]{padding:24px}.p-px{padding:1px}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-10{padding-inline:calc(var(--spacing) * 10)}.px-12{padding-inline:calc(var(--spacing) * 12)}.px-\[5px\]{padding-inline:5px}.px-\[6px\]{padding-inline:6px}.px-\[8px\]{padding-inline:8px}.px-\[9px\]{padding-inline:9px}.px-\[10px\]{padding-inline:10px}.px-\[15px\]{padding-inline:15px}.px-\[16px\]{padding-inline:16px}.px-\[18px\]{padding-inline:18px}.px-\[22px\]{padding-inline:22px}.px-\[24px\]{padding-inline:24px}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.py-32{padding-block:calc(var(--spacing) * 32)}.py-\[2px\]{padding-block:2px}.py-\[3px\]{padding-block:3px}.py-\[6px\]{padding-block:6px}.py-\[7px\]{padding-block:7px}.py-\[24px\]{padding-block:24px}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pt-\[12px\]{padding-top:12px}.pt-\[24px\]{padding-top:24px}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-11{padding-right:calc(var(--spacing) * 11)}.pr-20{padding-right:calc(var(--spacing) * 20)}.pr-\[60px\]{padding-right:60px}.pr-\[150px\]{padding-right:150px}.pr-\[155px\]{padding-right:155px}.pb-0{padding-bottom:calc(var(--spacing) * 0)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.pb-28{padding-bottom:calc(var(--spacing) * 28)}.pb-32{padding-bottom:calc(var(--spacing) * 32)}.pb-\[9px\]{padding-bottom:9px}.pb-\[10px\]{padding-bottom:10px}.pb-\[16px\]{padding-bottom:16px}.pb-\[32px\]{padding-bottom:32px}.pl-1{padding-left:calc(var(--spacing) * 1)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.pl-10{padding-left:calc(var(--spacing) * 10)}.pl-11{padding-left:calc(var(--spacing) * 11)}.pl-\[16px\]{padding-left:16px}.pl-\[18px\]{padding-left:18px}.pl-\[32px\]{padding-left:32px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.7rem\]{font-size:.7rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[0\.65rem\]{font-size:.65rem}.text-\[0\.75rem\]{font-size:.75rem}.text-\[0\.85em\]{font-size:.85em}.text-\[0\.95rem\]{font-size:.95rem}.text-\[1\.05rem\]{font-size:1.05rem}.text-\[1rem\]{font-size:1rem}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13\.5px\]{font-size:13.5px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[26px\]{font-size:26px}.text-\[28px\]{font-size:28px}.text-\[32px\]{font-size:32px}.text-\[36px\]{font-size:36px}.text-\[38px\]{font-size:38px}.text-\[40px\]{font-size:40px}.text-\[50px\]{font-size:50px}.text-\[60px\]{font-size:60px}.text-\[80px\]{font-size:80px}.text-\[140px\]{font-size:140px}.leading-\[1\.1\]{--tw-leading:1.1;line-height:1.1}.leading-\[1\.4\]{--tw-leading:1.4;line-height:1.4}.leading-\[1\.8\]{--tw-leading:1.8;line-height:1.8}.leading-\[1\.15\]{--tw-leading:1.15;line-height:1.15}.leading-\[1\.55\]{--tw-leading:1.55;line-height:1.55}.leading-\[1\.75\]{--tw-leading:1.75;line-height:1.75}.leading-\[1\.85\]{--tw-leading:1.85;line-height:1.85}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[0\.1em\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.3px\]{--tw-tracking:.3px;letter-spacing:.3px}.tracking-\[0\.12em\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.15em\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-\[0\.25em\]{--tw-tracking:.25em;letter-spacing:.25em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking:var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-\[\#1FA7E1\]{color:#1fa7e1!important}.\!text-white{color:var(--color-white)!important}.text-\[\#0a1628\]{color:#0a1628}.text-\[\#0ea5e9\]{color:#0ea5e9}.text-\[\#1E293B\]{color:#1e293b}.text-\[\#1FA7E1\]{color:#1fa7e1}.text-\[\#1a85a4\]{color:#1a85a4}.text-\[\#1e1b4b\]{color:#1e1b4b}.text-\[\#1e293b\]{color:#1e293b}.text-\[\#2E7D32\]{color:#2e7d32}.text-\[\#2e2b5e\]{color:#2e2b5e}.text-\[\#3E8538\]{color:#3e8538}.text-\[\#3b82f6\]{color:#3b82f6}.text-\[\#3c4043\]{color:#3c4043}.text-\[\#4D9F46\]{color:#4d9f46}.text-\[\#4f46e5\]{color:#4f46e5}.text-\[\#5E3388\]\/80{color:#5e3388cc}.text-\[\#5a6578\]{color:#5a6578}.text-\[\#5f6368\]{color:#5f6368}.text-\[\#6ED1CF\]{color:#6ed1cf}.text-\[\#6c47ff\]{color:#6c47ff}.text-\[\#6d28d9\]{color:#6d28d9}.text-\[\#7A44B3\]{color:#7a44b3}.text-\[\#7C3AED\]{color:#7c3aed}.text-\[\#7ec16d\]{color:#7ec16d}.text-\[\#8A1A1A\]{color:#8a1a1a}.text-\[\#8A3FD3\]{color:#8a3fd3}.text-\[\#8a7fbc\]{color:#8a7fbc}.text-\[\#8b5cf6\]{color:#8b5cf6}.text-\[\#9b51e0\]{color:#9b51e0}.text-\[\#10b981\]{color:#10b981}.text-\[\#22c55e\]{color:#22c55e}.text-\[\#065f46\]{color:#065f46}.text-\[\#75D06A\]{color:#75d06a}.text-\[\#94a3b8\]{color:#94a3b8}.text-\[\#818cf8\]{color:#818cf8}.text-\[\#2563eb\]{color:#2563eb}.text-\[\#6366f1\]{color:#6366f1}.text-\[\#6620a2\]{color:#6620a2}.text-\[\#7274ED\]{color:#7274ed}.text-\[\#9333ea\]{color:#9333ea}.text-\[\#9956DE\]{color:#9956de}.text-\[\#36326e\]{color:#36326e}.text-\[\#64748b\]{color:#64748b}.text-\[\#92400e\]{color:#92400e}.text-\[\#202124\]{color:#202124}.text-\[\#334155\]{color:#334155}.text-\[\#475569\]{color:#475569}.text-\[\#A56D29\]{color:#a56d29}.text-\[\#A74B50\]{color:#a74b50}.text-\[\#C65E63\]{color:#c65e63}.text-\[\#CC8A37\]{color:#cc8a37}.text-\[\#D66A6A\]{color:#d66a6a}.text-\[\#EAFBFF\]{color:#eafbff}.text-\[\#F08386\]{color:#f08386}.text-\[\#FF8B8B\]{color:#ff8b8b}.text-\[\#FFB356\]{color:#ffb356}.text-\[\#a0aec0\]{color:#a0aec0}.text-\[\#a3b1ee\]{color:#a3b1ee}.text-\[\#a8a5b3\]{color:#a8a5b3}.text-\[\#a855f7\]{color:#a855f7}.text-\[\#b91c1c\]{color:#b91c1c}.text-\[\#b45309\]{color:#b45309}.text-\[\#c4b5fd\]{color:#c4b5fd}.text-\[\#cbd5e1\]{color:#cbd5e1}.text-\[\#d1abff\]{color:#d1abff}.text-\[\#d1cec6\]{color:#d1cec6}.text-\[\#dde3eb\]{color:#dde3eb}.text-\[\#e66a5e\]{color:#e66a5e}.text-\[\#f8fafc\]{color:#f8fafc}.text-\[\#f43f5e\]{color:#f43f5e}.text-\[\#f97316\]{color:#f97316}.text-\[\#fcd34d\]{color:#fcd34d}.text-\[var\(--chart-2\)\]{color:var(--chart-2)}.text-\[var\(--chart-3\)\]{color:var(--chart-3)}.text-\[var\(--chart-4\)\]{color:var(--chart-4)}.text-\[var\(--primary\)\]{color:var(--primary)}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-100\/90{color:#fef3c6e6}@supports (color:color-mix(in lab,red,red)){.text-amber-100\/90{color:color-mix(in oklab,var(--color-amber-100) 90%,transparent)}}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-600\/80{color:#dd7400cc}@supports (color:color-mix(in lab,red,red)){.text-amber-600\/80{color:color-mix(in oklab,var(--color-amber-600) 80%,transparent)}}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-amber-900\/80{color:#7b3306cc}@supports (color:color-mix(in lab,red,red)){.text-amber-900\/80{color:color-mix(in oklab,var(--color-amber-900) 80%,transparent)}}.text-amber-900\/85{color:#7b3306d9}@supports (color:color-mix(in lab,red,red)){.text-amber-900\/85{color:color-mix(in oklab,var(--color-amber-900) 85%,transparent)}}.text-black{color:var(--color-black)}.text-black\/25{color:#00000040}@supports (color:color-mix(in lab,red,red)){.text-black\/25{color:color-mix(in oklab,var(--color-black) 25%,transparent)}}.text-blue-200{color:var(--color-blue-200)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-cyan-100{color:var(--color-cyan-100)}.text-cyan-200{color:var(--color-cyan-200)}.text-cyan-500{color:var(--color-cyan-500)}.text-destructive{color:var(--destructive)}.text-emerald-100{color:var(--color-emerald-100)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-500\/70{color:#00bb7fb3}@supports (color:color-mix(in lab,red,red)){.text-emerald-500\/70{color:color-mix(in oklab,var(--color-emerald-500) 70%,transparent)}}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-600\/80{color:#009767cc}@supports (color:color-mix(in lab,red,red)){.text-emerald-600\/80{color:color-mix(in oklab,var(--color-emerald-600) 80%,transparent)}}.text-emerald-700{color:var(--color-emerald-700)}.text-emerald-800{color:var(--color-emerald-800)}.text-emerald-900{color:var(--color-emerald-900)}.text-emerald-950{color:var(--color-emerald-950)}.text-foreground{color:var(--foreground)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-200{color:var(--color-indigo-200)}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-400{color:var(--color-indigo-400)}.text-indigo-500{color:var(--color-indigo-500)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-indigo-800{color:var(--color-indigo-800)}.text-indigo-900{color:var(--color-indigo-900)}.text-muted-foreground,.text-muted-foreground\/40{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/40{color:color-mix(in oklab,var(--muted-foreground) 40%,transparent)}}.text-muted-foreground\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,var(--muted-foreground) 60%,transparent)}}.text-orange-300{color:var(--color-orange-300)}.text-orange-400{color:var(--color-orange-400)}.text-orange-500{color:var(--color-orange-500)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-pink-500{color:var(--color-pink-500)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-purple-200{color:var(--color-purple-200)}.text-purple-300{color:var(--color-purple-300)}.text-purple-400{color:var(--color-purple-400)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-600\/80{color:#9810facc}@supports (color:color-mix(in lab,red,red)){.text-purple-600\/80{color:color-mix(in oklab,var(--color-purple-600) 80%,transparent)}}.text-purple-700{color:var(--color-purple-700)}.text-purple-800{color:var(--color-purple-800)}.text-purple-900{color:var(--color-purple-900)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-rose-100{color:var(--color-rose-100)}.text-rose-200{color:var(--color-rose-200)}.text-rose-300{color:var(--color-rose-300)}.text-rose-400{color:var(--color-rose-400)}.text-rose-500{color:var(--color-rose-500)}.text-rose-600{color:var(--color-rose-600)}.text-rose-700{color:var(--color-rose-700)}.text-rose-800{color:var(--color-rose-800)}.text-rose-900{color:var(--color-rose-900)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground) 70%,transparent)}}.text-sky-100{color:var(--color-violet-100)}.text-sky-200{color:var(--color-violet-200)}.text-sky-300{color:var(--color-violet-300)}.text-sky-400{color:var(--color-violet-400)}.text-sky-500{color:var(--color-violet-500)}.text-sky-600{color:var(--color-violet-600)}.text-sky-600\/80{color:#7f22fecc}@supports (color:color-mix(in lab,red,red)){.text-sky-600\/80{color:color-mix(in oklab,var(--color-violet-600) 80%,transparent)}}.text-sky-700{color:var(--color-violet-700)}.text-sky-800{color:var(--color-violet-800)}.text-sky-900{color:var(--color-violet-900)}.text-slate-100{color:var(--color-slate-100)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-500\/60{color:#62748e99}@supports (color:color-mix(in lab,red,red)){.text-slate-500\/60{color:color-mix(in oklab,var(--color-slate-500) 60%,transparent)}}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-teal-400{color:var(--color-teal-400)}.text-teal-500{color:var(--color-teal-500)}.text-teal-600{color:var(--color-teal-600)}.text-teal-700{color:var(--color-teal-700)}.text-teal-900{color:var(--color-teal-900)}.text-transparent{color:#0000}.text-violet-300{color:var(--color-violet-300)}.text-violet-400{color:var(--color-violet-400)}.text-violet-500{color:var(--color-violet-500)}.text-violet-600{color:var(--color-violet-600)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.text-white\/5{color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.text-white\/5{color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.text-white\/10{color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.text-white\/10{color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.text-white\/20{color:#fff3}@supports (color:color-mix(in lab,red,red)){.text-white\/20{color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.text-white\/25{color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.text-white\/25{color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.text-white\/30{color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.text-white\/65{color:#ffffffa6}@supports (color:color-mix(in lab,red,red)){.text-white\/65{color:color-mix(in oklab,var(--color-white) 65%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.text-white\/85{color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.text-white\/85{color:color-mix(in oklab,var(--color-white) 85%,transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\/90{color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.text-yellow-300{color:var(--color-yellow-300)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-800{color:var(--color-yellow-800)}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-slate-400{-webkit-text-decoration-color:var(--color-slate-400);text-decoration-color:var(--color-slate-400)}.underline-offset-4{text-underline-offset:4px}.accent-violet-500{accent-color:var(--color-violet-500)}.opacity-0{opacity:0}.opacity-5{opacity:.05}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-100{opacity:1}.opacity-\[0\.2\]{opacity:.2}.opacity-\[0\.03\]{opacity:.03}.opacity-\[0\.06\]{opacity:.06}.opacity-\[0\.15\]{opacity:.15}.mix-blend-multiply{mix-blend-mode:multiply}.mix-blend-overlay{mix-blend-mode:overlay}.mix-blend-screen{mix-blend-mode:screen}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[-4px_0_24px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:-4px 0 24px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[-8px_0_40px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:-8px 0 40px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-4px_12px_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow:0 -4px 12px var(--tw-shadow-color,#00000008);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-8px_30px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow:0 -8px 30px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-10px_40px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 -10px 40px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-12px_0_0_\#f8fafc\]{--tw-shadow:0 -12px 0 0 var(--tw-shadow-color,#f8fafc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-15px_40px_rgba\(0\,0\,0\,0\.1\)\,inset_0_2px_15px_rgba\(255\,255\,255\,0\.7\)\,inset_0_1px_1px_rgba\(255\,255\,255\,1\)\]{--tw-shadow:0 -15px 40px var(--tw-shadow-color,#0000001a), inset 0 2px 15px var(--tw-shadow-color,#ffffffb3), inset 0 1px 1px var(--tw-shadow-color,#fff);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_2px_rgba\(251\,113\,133\,0\.45\)\,0_6px_0_rgba\(127\,29\,29\,1\)\]{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#fb718573), 0 6px 0 var(--tw-shadow-color,#7f1d1d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_3px_\#c7d2fe\]{--tw-shadow:0 0 0 3px var(--tw-shadow-color,#c7d2fe);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_4px_rgba\(168\,85\,247\,0\.6\)\]{--tw-shadow:0 0 4px var(--tw-shadow-color,#a855f799);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_4px_rgba\(244\,63\,94\,0\.6\)\]{--tw-shadow:0 0 4px var(--tw-shadow-color,#f43f5e99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(168\,85\,247\,0\.8\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#a855f7cc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(244\,63\,94\,0\.8\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#f43f5ecc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(245\,158\,11\,0\.8\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#f59e0bcc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(255\,255\,255\,0\.7\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#ffffffb3);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(129\,140\,248\,0\.8\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#818cf8cc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(165\,180\,252\,0\.8\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#a5b4fccc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(244\,63\,94\,0\.6\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f43f5e99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(255\,255\,255\,0\.8\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#fffc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_white\]{--tw-shadow:0 0 8px var(--tw-shadow-color,white);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(16\,185\,129\,0\.15\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#10b98126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(250\,204\,21\,0\.6\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#facc1599);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(251\,146\,60\,0\.5\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#fb923c80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(251\,191\,36\,0\.5\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#fbbf2480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(251\,191\,36\,0\.6\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#fbbf2499);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(251\,191\,36\,0\.8\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#fbbf24cc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(153\,86\,222\,0\.6\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#9956de99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(192\,132\,252\,0\.9\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#c084fce6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_14px_rgba\(16\,185\,129\,0\.25\)\]{--tw-shadow:0 0 14px var(--tw-shadow-color,#10b98140);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_14px_rgba\(148\,163\,184\,0\.2\)\]{--tw-shadow:0 0 14px var(--tw-shadow-color,#94a3b833);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(16\,185\,129\,0\.2\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#10b98133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(16\,185\,129\,0\.15\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#10b98126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(52\,211\,153\,0\.8\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#34d399cc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(99\,102\,241\,0\.15\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#6366f126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(244\,63\,94\,0\.15\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#f43f5e26);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(245\,158\,11\,0\.15\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#f59e0b26);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(251\,191\,36\,0\.25\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#fbbf2440);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_rgba\(249\,115\,22\,0\.3\)\]{--tw-shadow:0 0 16px var(--tw-shadow-color,#f973164d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(251\,191\,36\,0\.35\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#fbbf2459);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(255\,139\,139\,0\.6\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#ff8b8b99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(255\,179\,86\,0\.6\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#ffb35699);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_20px_rgba\(245\,158\,11\,0\.15\)\]{--tw-shadow:0 0 20px var(--tw-shadow-color,#f59e0b26);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_20px_rgba\(251\,191\,36\,0\.3\)\]{--tw-shadow:0 0 20px var(--tw-shadow-color,#fbbf244d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_24px_rgba\(250\,204\,21\,0\.6\)\]{--tw-shadow:0 0 24px var(--tw-shadow-color,#facc1599);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(31\,167\,225\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#1fa7e133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(138\,63\,211\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#8a3fd333);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_50px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 0 50px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_2px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(168\,85\,247\,0\.1\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,#a855f71a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:0 1px 4px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 1px 4px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(79\,70\,229\,0\.13\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#4f46e521);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(168\,85\,247\,0\.15\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#a855f726);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_15px_-3px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:0 2px 15px -3px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_8px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 4px 8px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(5\,150\,105\,0\.3\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#0596694d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(14\,165\,233\,0\.3\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#0ea5e94d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(16\,185\,129\,0\.3\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#10b9814d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(139\,92\,246\,0\.3\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#8b5cf64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(14\,165\,233\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#0ea5e933);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(16\,185\,129\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#10b98133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(59\,130\,246\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#3b82f633);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(79\,70\,229\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#4f46e54d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(100\,116\,139\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#64748b33);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(100\,116\,139\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#64748b4d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(168\,85\,247\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#a855f733);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(168\,85\,247\,0\.12\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#a855f71f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(244\,63\,94\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#f43f5e33);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(244\,63\,94\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#f43f5e4d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(245\,158\,11\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#f59e0b4d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(249\,115\,22\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#f9731633);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_15px_rgba\(43\,191\,123\,0\.4\)\,inset_0_1px_1px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:0 4px 15px var(--tw-shadow-color,#2bbf7b66), inset 0 1px 1px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_15px_rgba\(45\,161\,216\,0\.4\)\,inset_0_1px_1px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:0 4px 15px var(--tw-shadow-color,#2da1d866), inset 0 1px 1px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_15px_rgba\(157\,68\,255\,0\.4\)\,inset_0_1px_1px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:0 4px 15px var(--tw-shadow-color,#9d44ff66), inset 0 1px 1px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_15px_rgba\(255\,92\,112\,0\.4\)\,inset_0_1px_1px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:0 4px 15px var(--tw-shadow-color,#ff5c7066), inset 0 1px 1px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#00000008);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(14\,165\,233\,0\.13\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#0ea5e921);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(16\,185\,129\,0\.08\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#10b98114);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(16\,185\,129\,0\.13\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#10b98121);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(168\,85\,247\,0\.13\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#a855f721);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(168\,85\,247\,0\.15\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#a855f726);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(249\,115\,22\,0\.13\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#f9731621);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_20px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:0 4px 20px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_24px_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow:0 4px 24px var(--tw-shadow-color,#00000008);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_5px_12px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 5px 12px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_0_rgba\(5\,150\,105\,1\)\]{--tw-shadow:0 6px 0 var(--tw-shadow-color,#059669);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_0_rgba\(15\,20\,30\,0\.5\)\]{--tw-shadow:0 6px 0 var(--tw-shadow-color,#0f141e80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_0_rgba\(79\,70\,229\,1\)\]{--tw-shadow:0 6px 0 var(--tw-shadow-color,#4f46e5);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_0_rgba\(225\,29\,72\,1\)\]{--tw-shadow:0 6px 0 var(--tw-shadow-color,#e11d48);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(16\,185\,129\,0\.2\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#10b98133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(16\,185\,129\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#10b98140);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(59\,130\,246\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#3b82f640);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(168\,85\,247\,0\.12\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#a855f71f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(168\,85\,247\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#a855f740);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(244\,63\,94\,0\.2\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#f43f5e33);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(244\,63\,94\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#f43f5e40);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(245\,158\,11\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#f59e0b40);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_20px_-8px_rgba\(79\,70\,229\,0\.5\)\]{--tw-shadow:0 8px 20px -8px var(--tw-shadow-color,#4f46e580);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_24px_-10px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:0 8px 24px -10px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.12\)\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_-12px_rgba\(0\,0\,0\,0\.06\)\]{--tw-shadow:0 8px 30px -12px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgb\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(31\,167\,225\,0\.2\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#1fa7e133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(59\,58\,130\,0\.3\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#3b3a824d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(138\,63\,211\,0\.2\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#8a3fd333);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_32px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 8px 32px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_32px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow:0 8px 32px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_32px_rgba\(0\,0\,0\,0\.12\)\]{--tw-shadow:0 8px 32px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_10px_-10px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:0 10px 10px -10px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_40px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 10px 40px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_40px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 10px 40px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_25px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow:0 12px 25px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_30px_-10px_rgba\(79\,70\,229\,0\.5\)\]{--tw-shadow:0 12px 30px -10px var(--tw-shadow-color,#4f46e580);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_15px_25px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 15px 25px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_18px_30px_-20px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow:0 18px 30px -20px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_30px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 20px 30px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_40px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 40px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_45px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 45px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_50px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 20px 50px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_50px_rgba\(15\,20\,34\,0\.2\)\]{--tw-shadow:0 20px 50px var(--tw-shadow-color,#0f142233);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_-15px_rgba\(168\,85\,247\,0\.15\)\]{--tw-shadow:0 20px 60px -15px var(--tw-shadow-color,#a855f726);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 20px 60px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_24px_60px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 24px 60px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_24px_64px_rgba\(0\,0\,0\,0\.18\)\]{--tw-shadow:0 24px 64px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_25px_60px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 25px 60px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_80px_rgba\(0\,0\,0\,0\.6\)\]{--tw-shadow:0 30px 80px var(--tw-shadow-color,#0009);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_80px_rgba\(0\,0\,0\,0\.8\)\]{--tw-shadow:0 30px 80px var(--tw-shadow-color,#000c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_80px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 30px 80px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[2px_0_4px_rgba\(0\,0\,0\,0\.01\)\]{--tw-shadow:2px 0 4px var(--tw-shadow-color,#00000003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[2px_0_4px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:2px 0 4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[2px_0_4px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:2px 0 4px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_-4px_6px_rgba\(0\,0\,0\,0\.05\)\,0_4px_6px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 -4px 6px var(--tw-shadow-color,#0000000d), 0 4px 6px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_0_20px_rgba\(168\,85\,247\,0\.05\)\]{--tw-shadow:inset 0 0 20px var(--tw-shadow-color,#a855f70d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_2px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:inset 0 1px 2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_3px_rgba\(255\,255\,255\,0\.5\)\]{--tw-shadow:inset 0 1px 3px var(--tw-shadow-color,#ffffff80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_2px_4px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 2px 4px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_6px_15px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:inset 0 6px 15px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-4,.ring-\[4px\]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#1FA7E1\]\/20{--tw-shadow-color:#1fa7e133}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/20{--tw-shadow-color:color-mix(in oklab, oklab(68.7044% -.0807821 -.10979/.2) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#1FA7E1\]\/30{--tw-shadow-color:#1fa7e14d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(68.7044% -.0807821 -.10979/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#1FA7E1\]\/40{--tw-shadow-color:#1fa7e166}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/40{--tw-shadow-color:color-mix(in oklab, oklab(68.7044% -.0807821 -.10979/.4) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#8A3FD3\]\/30{--tw-shadow-color:#8a3fd34d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8A3FD3\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(54.1025% .117281 -.181162/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#8A3FD3\]\/40{--tw-shadow-color:#8a3fd366}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8A3FD3\]\/40{--tw-shadow-color:color-mix(in oklab, oklab(54.1025% .117281 -.181162/.4) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#8B5CF6\]\/20{--tw-shadow-color:#8b5cf633}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8B5CF6\]\/20{--tw-shadow-color:color-mix(in oklab, oklab(60.5631% .0845415 -.201932/.2) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#75D06A\]\/30{--tw-shadow-color:#75d06a4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#75D06A\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(77.7281% -.128439 .101669/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#9956DE\]\/20{--tw-shadow-color:#9956de33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#9956DE\]\/20{--tw-shadow-color:color-mix(in oklab, oklab(59.4745% .111053 -.167638/.2) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#9956DE\]\/30{--tw-shadow-color:#9956de4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#9956DE\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(59.4745% .111053 -.167638/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#FB96BB\]\/30{--tw-shadow-color:#fb96bb4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FB96BB\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(78.801% .12777 -.00670064/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#FF8B8B\]\/30{--tw-shadow-color:#ff8b8b4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FF8B8B\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(76.3223% .131566 .050208/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#FFB356\]\/30{--tw-shadow-color:#ffb3564d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FFB356\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(82.2219% .0499055 .130321/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[rgba\(124\,58\,237\,0\.05\)_0px_0px_30px_inset\]{--tw-shadow-color:#7c3aed0d}@supports (color:color-mix(in lab,red,red)){.shadow-\[rgba\(124\,58\,237\,0\.05\)_0px_0px_30px_inset\]{--tw-shadow-color:color-mix(in oklab, #7c3aed0d 0px 0px 30px inset var(--tw-shadow-alpha), transparent)}}.shadow-blue-200\/50{--tw-shadow-color:#bedbff80}@supports (color:color-mix(in lab,red,red)){.shadow-blue-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-blue-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500\/20{--tw-shadow-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-blue-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-200\/50{--tw-shadow-color:#a4f4cf80}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/20{--tw-shadow-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/25{--tw-shadow-color:#00bb7f40}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/30{--tw-shadow-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/30{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-100{--tw-shadow-color:oklch(93% .034 272.788)}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-100{--tw-shadow-color:color-mix(in oklab, var(--color-indigo-100) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-100\/20{--tw-shadow-color:#e0e7ff33}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-100\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-100) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-200{--tw-shadow-color:oklch(87% .065 274.039)}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-200{--tw-shadow-color:color-mix(in oklab, var(--color-indigo-200) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-200\/50{--tw-shadow-color:#c7d2ff80}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-500\/10{--tw-shadow-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-500\/20{--tw-shadow-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-500\/25{--tw-shadow-color:#625fff40}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-500\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-500) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-100{--tw-shadow-color:oklch(94.6% .033 307.174)}@supports (color:color-mix(in lab,red,red)){.shadow-purple-100{--tw-shadow-color:color-mix(in oklab, var(--color-purple-100) var(--tw-shadow-alpha), transparent)}}.shadow-purple-200{--tw-shadow-color:oklch(90.2% .063 306.703)}@supports (color:color-mix(in lab,red,red)){.shadow-purple-200{--tw-shadow-color:color-mix(in oklab, var(--color-purple-200) var(--tw-shadow-alpha), transparent)}}.shadow-purple-200\/50{--tw-shadow-color:#e9d5ff80}@supports (color:color-mix(in lab,red,red)){.shadow-purple-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-200\/60{--tw-shadow-color:#e9d5ff99}@supports (color:color-mix(in lab,red,red)){.shadow-purple-200\/60{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-200) 60%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-500\/20{--tw-shadow-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.shadow-purple-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-600\/25{--tw-shadow-color:#9810fa40}@supports (color:color-mix(in lab,red,red)){.shadow-purple-600\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-600) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-900\/50{--tw-shadow-color:#59168b80}@supports (color:color-mix(in lab,red,red)){.shadow-purple-900\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-900) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-red-900\/10{--tw-shadow-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.shadow-red-900\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-red-900) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-rose-200\/50{--tw-shadow-color:#ffccd380}@supports (color:color-mix(in lab,red,red)){.shadow-rose-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-rose-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-rose-500\/20{--tw-shadow-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.shadow-rose-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-rose-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-sky-200{--tw-shadow-color:oklch(89.4% .057 293.283)}@supports (color:color-mix(in lab,red,red)){.shadow-sky-200{--tw-shadow-color:color-mix(in oklab, var(--color-violet-200) var(--tw-shadow-alpha), transparent)}}.shadow-sky-500\/20{--tw-shadow-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.shadow-sky-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-violet-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-slate-100{--tw-shadow-color:oklch(96.8% .007 247.896)}@supports (color:color-mix(in lab,red,red)){.shadow-slate-100{--tw-shadow-color:color-mix(in oklab, var(--color-slate-100) var(--tw-shadow-alpha), transparent)}}.shadow-slate-200{--tw-shadow-color:oklch(92.9% .013 255.508)}@supports (color:color-mix(in lab,red,red)){.shadow-slate-200{--tw-shadow-color:color-mix(in oklab, var(--color-slate-200) var(--tw-shadow-alpha), transparent)}}.shadow-slate-200\/40{--tw-shadow-color:#e2e8f066}@supports (color:color-mix(in lab,red,red)){.shadow-slate-200\/40{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-200) 40%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-slate-200\/50{--tw-shadow-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.shadow-slate-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-slate-900\/10{--tw-shadow-color:#0f172b1a}@supports (color:color-mix(in lab,red,red)){.shadow-slate-900\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-900) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-slate-900\/\[0\.04\]{--tw-shadow-color:#0f172b0a}@supports (color:color-mix(in lab,red,red)){.shadow-slate-900\/\[0\.04\]{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-900) 4%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-\[\#1FA7E1\]\/35{--tw-ring-color:oklab(68.7044% -.0807821 -.10979/.35)}.ring-\[\#8B5CF6\]\/10{--tw-ring-color:oklab(60.5631% .0845415 -.201932/.1)}.ring-\[\#9956DE\]\/50{--tw-ring-color:oklab(59.4745% .111053 -.167638/.5)}.ring-\[color-mix\(in_srgb\,var\(--chart-2\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-2)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-2\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-2) 40%,transparent)}}.ring-\[color-mix\(in_srgb\,var\(--chart-3\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-3)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-3\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-3) 40%,transparent)}}.ring-\[color-mix\(in_srgb\,var\(--chart-4\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-4)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-4\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-4) 40%,transparent)}}.ring-green-300{--tw-ring-color:var(--color-green-300)}.ring-primary{--tw-ring-color:var(--primary)}.ring-purple-500\/20{--tw-ring-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.ring-purple-500\/20{--tw-ring-color:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.ring-red-300{--tw-ring-color:var(--color-red-300)}.ring-red-500{--tw-ring-color:var(--color-red-500)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.ring-rose-300{--tw-ring-color:var(--color-rose-300)}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-sky-50{--tw-ring-color:var(--color-violet-50)}.ring-slate-100{--tw-ring-color:var(--color-slate-100)}.ring-slate-200{--tw-ring-color:var(--color-slate-200)}.ring-slate-800{--tw-ring-color:var(--color-slate-800)}.ring-white{--tw-ring-color:var(--color-white)}.ring-white\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.ring-white\/10{--tw-ring-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.ring-white\/20{--tw-ring-color:#fff3}@supports (color:color-mix(in lab,red,red)){.ring-white\/20{--tw-ring-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-\[4px\]{--tw-ring-offset-width:4px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-\[\#0B0F19\]{--tw-ring-offset-color:#0b0f19}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-2xl{--tw-blur:blur(var(--blur-2xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[1px\]{--tw-blur:blur(1px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[2px\]{--tw-blur:blur(2px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[32px\]{--tw-blur:blur(32px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[60px\]{--tw-blur:blur(60px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[100px\]{--tw-blur:blur(100px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[120px\]{--tw-blur:blur(120px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[140px\]{--tw-blur:blur(140px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[160px\]{--tw-blur:blur(160px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-md{--tw-blur:blur(var(--blur-md));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.brightness-105{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.contrast-50{--tw-contrast:contrast(50%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-2xl{--tw-drop-shadow-size:drop-shadow(0 25px 25px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-2xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[-2px_3px_0px_rgba\(0\,0\,0\,0\.8\)\]{--tw-drop-shadow-size:drop-shadow(-2px 3px 0px var(--tw-drop-shadow-color,#000c));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(31\,167\,225\,0\.5\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#1fa7e180));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(138\,63\,211\,0\.5\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#8a3fd380));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(251\,191\,36\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#fbbf24e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(245\,158\,11\,0\.6\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#f59e0b99));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(245\,158\,11\,0\.8\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#f59e0bcc));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(250\,204\,21\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#facc15e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(255\,255\,255\,0\.4\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#fff6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_15px_rgba\(252\,211\,77\,0\.8\)\]{--tw-drop-shadow-size:drop-shadow(0 0 15px var(--tw-drop-shadow-color,#fcd34dcc));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_25px_rgba\(252\,211\,77\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 25px var(--tw-drop-shadow-color,#fcd34de6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_10px_20px_rgba\(0\,0\,0\,0\.15\)\]{--tw-drop-shadow-size:drop-shadow(0 10px 20px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_12px_15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-drop-shadow-size:drop-shadow(0 12px 15px var(--tw-drop-shadow-color,#0000004d));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_15px_15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-drop-shadow-size:drop-shadow(0 15px 15px var(--tw-drop-shadow-color,#0000004d));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-lg));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-md{--tw-drop-shadow-size:drop-shadow(0 3px 3px var(--tw-drop-shadow-color,#0000001f));--tw-drop-shadow:drop-shadow(var(--drop-shadow-md));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-sm{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-sm));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-xl{--tw-drop-shadow-size:drop-shadow(0 9px 7px var(--tw-drop-shadow-color,#0000001a));--tw-drop-shadow:drop-shadow(var(--drop-shadow-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.saturate-50{--tw-saturate:saturate(50%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-2xl{--tw-backdrop-blur:blur(var(--blur-2xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-3xl{--tw-backdrop-blur:blur(var(--blur-3xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[1px\]{--tw-backdrop-blur:blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[2px\]{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[12px\]{--tw-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[16px\]{--tw-backdrop-blur:blur(16px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[24px\]{--tw-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.delay-75{transition-delay:75ms}.duration-0{--tw-duration:0s;transition-duration:0s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-transform{will-change:transform}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}.\[background\:linear-gradient\(var\(--grid-color\)_0_1px\,_transparent_1px_var\(--beam-size\)\)_50\%_-0\.5px_\/var\(--beam-size\)_var\(--beam-size\)\,linear-gradient\(90deg\,_var\(--grid-color\)_0_1px\,_transparent_1px_var\(--beam-size\)\)_50\%_50\%_\/var\(--beam-size\)_var\(--beam-size\)\]{background:linear-gradient(var(--grid-color) 0 1px,transparent 1px var(--beam-size)) 50% -.5px /var(--beam-size) var(--beam-size),linear-gradient(90deg,var(--grid-color) 0 1px,transparent 1px var(--beam-size)) 50% 50% /var(--beam-size) var(--beam-size)}.\[background\:var\(--background\)\]{background:var(--background)}.\[clip-path\:inset\(0\)\]{clip-path:inset(0)}.\[perspective\:var\(--perspective\)\]{perspective:var(--perspective)}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[transform-style\:preserve-3d\]{transform-style:preserve-3d}.ring-inset{--tw-ring-inset:inset}.group-focus-within\:text-\[\#4f46e5\]:is(:where(.group):focus-within *){color:#4f46e5}.group-focus-within\:text-\[\#9956DE\]:is(:where(.group):focus-within *){color:#9956de}.group-focus-within\:text-indigo-500:is(:where(.group):focus-within *){color:var(--color-indigo-500)}.group-focus-within\:text-indigo-600:is(:where(.group):focus-within *){color:var(--color-indigo-600)}.group-focus-within\/input\:text-indigo-500:is(:where(.group\/input):focus-within *){color:var(--color-indigo-500)}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:1}@media(hover:hover){.group-hover\:left-\[150\%\]:is(:where(.group):hover *){left:150%}.group-hover\:-translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-x-4:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-x-1:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-x-4:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-y-1:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-y-2:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -2);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-y-4:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-y-\[-3px\]:is(:where(.group):hover *){--tw-translate-y:-3px;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:scale-105:is(:where(.group):hover *){--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:scale-125:is(:where(.group):hover *){--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:scale-150:is(:where(.group):hover *){--tw-scale-x:150%;--tw-scale-y:150%;--tw-scale-z:150%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:scale-\[1\.2\]:is(:where(.group):hover *){scale:1.2}.group-hover\:scale-\[1\.3\]:is(:where(.group):hover *){scale:1.3}.group-hover\:scale-\[1\.4\]:is(:where(.group):hover *){scale:1.4}.group-hover\:scale-\[1\.05\]:is(:where(.group):hover *){scale:1.05}.group-hover\:scale-\[1\.6\]:is(:where(.group):hover *){scale:1.6}.group-hover\:scale-\[1\.8\]:is(:where(.group):hover *){scale:1.8}.group-hover\:-rotate-6:is(:where(.group):hover *){rotate:-6deg}.group-hover\:-rotate-12:is(:where(.group):hover *){rotate:-12deg}.group-hover\:rotate-3:is(:where(.group):hover *){rotate:3deg}.group-hover\:rotate-6:is(:where(.group):hover *){rotate:6deg}.group-hover\:rotate-12:is(:where(.group):hover *){rotate:12deg}.group-hover\:rotate-90:is(:where(.group):hover *){rotate:90deg}.group-hover\:rotate-180:is(:where(.group):hover *){rotate:180deg}.group-hover\:rotate-\[25deg\]:is(:where(.group):hover *){rotate:25deg}.group-hover\:animate-\[shimmer_1\.5s_ease-out\]:is(:where(.group):hover *){animation:1.5s ease-out shimmer}.group-hover\:border-amber-200:is(:where(.group):hover *){border-color:var(--color-amber-200)}.group-hover\:border-amber-400:is(:where(.group):hover *){border-color:var(--color-amber-400)}.group-hover\:border-emerald-200:is(:where(.group):hover *){border-color:var(--color-emerald-200)}.group-hover\:border-indigo-400:is(:where(.group):hover *){border-color:var(--color-indigo-400)}.group-hover\:border-purple-100:is(:where(.group):hover *){border-color:var(--color-purple-100)}.group-hover\:border-purple-200:is(:where(.group):hover *){border-color:var(--color-purple-200)}.group-hover\:border-rose-200:is(:where(.group):hover *){border-color:var(--color-rose-200)}.group-hover\:border-sky-200:is(:where(.group):hover *){border-color:var(--color-violet-200)}.group-hover\:border-sky-300:is(:where(.group):hover *){border-color:var(--color-violet-300)}.group-hover\:border-slate-300:is(:where(.group):hover *){border-color:var(--color-slate-300)}.group-hover\:border-teal-400:is(:where(.group):hover *){border-color:var(--color-teal-400)}.group-hover\:border-r-amber-400:is(:where(.group):hover *){border-right-color:var(--color-amber-400)}.group-hover\:border-r-teal-400:is(:where(.group):hover *){border-right-color:var(--color-teal-400)}.group-hover\:border-b-amber-400:is(:where(.group):hover *){border-bottom-color:var(--color-amber-400)}.group-hover\:border-b-teal-400:is(:where(.group):hover *){border-bottom-color:var(--color-teal-400)}.group-hover\:bg-\[\#9333ea\]:is(:where(.group):hover *){background-color:#9333ea}.group-hover\:bg-\[\#a855f7\]:is(:where(.group):hover *){background-color:#a855f7}.group-hover\:bg-amber-50:is(:where(.group):hover *){background-color:var(--color-amber-50)}.group-hover\:bg-amber-100\/50:is(:where(.group):hover *){background-color:#fef3c680}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-amber-100\/50:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-amber-100) 50%,transparent)}}.group-hover\:bg-black\/20:is(:where(.group):hover *){background-color:#0003}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-black\/20:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.group-hover\:bg-blue-100:is(:where(.group):hover *){background-color:var(--color-blue-100)}.group-hover\:bg-emerald-50:is(:where(.group):hover *){background-color:var(--color-emerald-50)}.group-hover\:bg-emerald-100:is(:where(.group):hover *){background-color:var(--color-emerald-100)}.group-hover\:bg-indigo-600:is(:where(.group):hover *){background-color:var(--color-indigo-600)}.group-hover\:bg-purple-100:is(:where(.group):hover *){background-color:var(--color-purple-100)}.group-hover\:bg-slate-50:is(:where(.group):hover *){background-color:var(--color-slate-50)}.group-hover\:bg-slate-50\/90:is(:where(.group):hover *){background-color:#f8fafce6}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-slate-50\/90:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-slate-50) 90%,transparent)}}.group-hover\:bg-slate-400:is(:where(.group):hover *){background-color:var(--color-slate-400)}.group-hover\:bg-slate-700:is(:where(.group):hover *){background-color:var(--color-slate-700)}.group-hover\:bg-teal-50:is(:where(.group):hover *){background-color:var(--color-teal-50)}.group-hover\:bg-white\/20:is(:where(.group):hover *){background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-white\/20:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.group-hover\:bg-white\/30:is(:where(.group):hover *){background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-white\/30:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.group-hover\:p-2\.5:is(:where(.group):hover *){padding:calc(var(--spacing) * 2.5)}.group-hover\:text-\[\#1FA7E1\]:is(:where(.group):hover *){color:#1fa7e1}.group-hover\:text-\[\#1e293b\]:is(:where(.group):hover *){color:#1e293b}.group-hover\:text-\[\#4f46e5\]:is(:where(.group):hover *){color:#4f46e5}.group-hover\:text-\[\#6ED1CF\]:is(:where(.group):hover *){color:#6ed1cf}.group-hover\:text-\[\#7274ED\]:is(:where(.group):hover *){color:#7274ed}.group-hover\:text-\[\#9333ea\]:is(:where(.group):hover *){color:#9333ea}.group-hover\:text-\[\#9956DE\]:is(:where(.group):hover *){color:#9956de}.group-hover\:text-\[\#FFB356\]:is(:where(.group):hover *){color:#ffb356}.group-hover\:text-\[\#a855f7\]:is(:where(.group):hover *){color:#a855f7}.group-hover\:text-amber-500:is(:where(.group):hover *){color:var(--color-amber-500)}.group-hover\:text-blue-700:is(:where(.group):hover *){color:var(--color-blue-700)}.group-hover\:text-emerald-500:is(:where(.group):hover *){color:var(--color-emerald-500)}.group-hover\:text-emerald-600:is(:where(.group):hover *){color:var(--color-emerald-600)}.group-hover\:text-emerald-700:is(:where(.group):hover *){color:var(--color-emerald-700)}.group-hover\:text-indigo-600:is(:where(.group):hover *){color:var(--color-indigo-600)}.group-hover\:text-primary:is(:where(.group):hover *){color:var(--primary)}.group-hover\:text-purple-600:is(:where(.group):hover *){color:var(--color-purple-600)}.group-hover\:text-rose-500:is(:where(.group):hover *){color:var(--color-rose-500)}.group-hover\:text-rose-600:is(:where(.group):hover *){color:var(--color-rose-600)}.group-hover\:text-sky-500:is(:where(.group):hover *){color:var(--color-violet-500)}.group-hover\:text-sky-600:is(:where(.group):hover *){color:var(--color-violet-600)}.group-hover\:text-slate-700:is(:where(.group):hover *){color:var(--color-slate-700)}.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-90:is(:where(.group):hover *){opacity:.9}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\:shadow-\[0_-20px_50px_rgba\(0\,0\,0\,0\.15\)\,inset_0_2px_15px_rgba\(255\,255\,255\,0\.8\)\,inset_0_1px_1px_rgba\(255\,255\,255\,1\)\]:is(:where(.group):hover *){--tw-shadow:0 -20px 50px var(--tw-shadow-color,#00000026), inset 0 2px 15px var(--tw-shadow-color,#fffc), inset 0 1px 1px var(--tw-shadow-color,#fff);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:shadow-\[0_24px_40px_-15px_rgba\(0\,0\,0\,0\.5\)\]:is(:where(.group):hover *){--tw-shadow:0 24px 40px -15px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:shadow-md:is(:where(.group):hover *){--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:duration-\[800ms\]:is(:where(.group):hover *){--tw-duration:.8s;transition-duration:.8s}.group-hover\/avatar\:scale-110:is(:where(.group\/avatar):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\/btn\:translate-x-0\.5:is(:where(.group\/btn):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\/btn\:-translate-y-0\.5:is(:where(.group\/btn):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\/cal\:bg-slate-100:is(:where(.group\/cal):hover *){background-color:var(--color-slate-100)}.group-hover\/drop\:bg-purple-50:is(:where(.group\/drop):hover *){background-color:var(--color-purple-50)}.group-hover\/drop\:text-purple-500:is(:where(.group\/drop):hover *){color:var(--color-purple-500)}.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:1}.group-hover\/toggle\:block:is(:where(.group\/toggle):hover *){display:block}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) *){padding-right:calc(var(--spacing) * 8)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing) * -8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing) * 8)!important;height:calc(var(--spacing) * 8)!important}.group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing) * 4)))}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing) * 4)) + 2px)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width) * -1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width) * -1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing) * 0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing) * -4)}.group-data-\[side\=left\]\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing) * 0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:block:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}.group-data-\[viewport\=false\]\/navigation-menu\:top-full:is(:where(.group\/navigation-menu)[data-viewport=false] *){top:100%}.group-data-\[viewport\=false\]\/navigation-menu\:mt-1\.5:is(:where(.group\/navigation-menu)[data-viewport=false] *){margin-top:calc(var(--spacing) * 1.5)}.group-data-\[viewport\=false\]\/navigation-menu\:overflow-hidden:is(:where(.group\/navigation-menu)[data-viewport=false] *){overflow:hidden}.group-data-\[viewport\=false\]\/navigation-menu\:rounded-md:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-radius:calc(var(--radius) - 2px)}.group-data-\[viewport\=false\]\/navigation-menu\:border:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[viewport\=false\]\/navigation-menu\:bg-popover:is(:where(.group\/navigation-menu)[data-viewport=false] *){background-color:var(--popover)}.group-data-\[viewport\=false\]\/navigation-menu\:text-popover-foreground:is(:where(.group\/navigation-menu)[data-viewport=false] *){color:var(--popover-foreground)}.group-data-\[viewport\=false\]\/navigation-menu\:shadow:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[viewport\=false\]\/navigation-menu\:duration-200:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-duration:.2s;transition-duration:.2s}.peer-checked\:bg-\[\#4f46e5\]:is(:where(.peer):checked~*){background-color:#4f46e5}.peer-checked\:font-bold:is(:where(.peer):checked~*){--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.peer-checked\:text-\[\#1e293b\]:is(:where(.peer):checked~*){color:#1e293b}@media(hover:hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-focus\:outline-none:is(:where(.peer):focus~*){--tw-outline-style:none;outline-style:none}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing) * 1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing) * 2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing) * 1)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-\[\#94a3b8\]::placeholder{color:#94a3b8}.placeholder\:text-\[\#64748b\]::placeholder{color:#64748b}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.placeholder\:text-slate-400::placeholder{color:var(--color-slate-400)}.placeholder\:text-slate-500::placeholder{color:var(--color-slate-500)}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:top-2:before{content:var(--tw-content);top:calc(var(--spacing) * 2)}.before\:bottom-\[-16px\]:before{content:var(--tw-content);bottom:-16px}.before\:bottom-\[-24px\]:before{content:var(--tw-content);bottom:-24px}.before\:left-1\.5:before{content:var(--tw-content);left:calc(var(--spacing) * 1.5)}.before\:left-2:before{content:var(--tw-content);left:calc(var(--spacing) * 2)}.before\:w-\[1px\]:before{content:var(--tw-content);width:1px}.before\:w-\[2px\]:before{content:var(--tw-content);width:2px}.before\:bg-slate-100:before{content:var(--tw-content);background-color:var(--color-slate-100)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing) * 0)}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:h-4:after{content:var(--tw-content);height:calc(var(--spacing) * 4)}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing) * 1)}.after\:w-4:after{content:var(--tw-content);width:calc(var(--spacing) * 4)}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.after\:rounded-full:after{content:var(--tw-content);border-radius:3.40282e38px}.after\:border:after{content:var(--tw-content);border-style:var(--tw-border-style);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);border-color:var(--color-gray-300)}.after\:bg-white:after{content:var(--tw-content);background-color:var(--color-white)}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}.peer-checked\:after\:translate-x-full:is(:where(.peer):checked~*):after{content:var(--tw-content);--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.peer-checked\:after\:border-white:is(:where(.peer):checked~*):after{content:var(--tw-content);border-color:var(--color-white)}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing) * 0)}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.last\:before\:hidden:last-child:before{content:var(--tw-content);display:none}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:border-\[\#a855f7\]:focus-within{border-color:#a855f7}.focus-within\:ring-2:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-within\:ring-4:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-within\:ring-\[\#a855f7\]\/10:focus-within{--tw-ring-color:oklab(62.6846% .129701 -.193012/.1)}.focus-within\:ring-indigo-500\/20:focus-within{--tw-ring-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.focus-within\:ring-indigo-500\/20:focus-within{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 20%, transparent)}}@media(hover:hover){.hover\:z-10:hover{z-index:10}.hover\:h-20:hover{height:calc(var(--spacing) * 20)}.hover\:w-24:hover{width:calc(var(--spacing) * 24)}.hover\:-translate-x-1:hover{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-x-4:hover{--tw-translate-x:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-1:hover{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-2:hover{--tw-translate-y:calc(var(--spacing) * -2);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-\[1px\]:hover{--tw-translate-y: -1px ;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:scale-100:hover{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-\[1\.01\]:hover{scale:1.01}.hover\:scale-\[1\.02\]:hover{scale:1.02}.hover\:rotate-0:hover{rotate:0deg}.hover\:rotate-3:hover{rotate:3deg}.hover\:gap-2:hover{gap:calc(var(--spacing) * 2)}.hover\:border-\[\#1FA7E1\]:hover{border-color:#1fa7e1}.hover\:border-\[\#1FA7E1\]\/50:hover{border-color:#1fa7e180}.hover\:border-\[\#1a85a4\]\/40:hover{border-color:#1a85a466}.hover\:border-\[\#8A3FD3\]\/50:hover{border-color:#8a3fd380}.hover\:border-\[\#94a3b8\]:hover{border-color:#94a3b8}.hover\:border-\[\#818cf8\]:hover{border-color:#818cf8}.hover\:border-\[\#9956DE\]:hover{border-color:#9956de}.hover\:border-\[\#9956DE\]\/30:hover{border-color:#9956de4d}.hover\:border-\[\#9956DE\]\/50:hover{border-color:#9956de80}.hover\:border-\[\#9956DE\]\/60:hover{border-color:#9956de99}.hover\:border-\[\#F08386\]:hover{border-color:#f08386}.hover\:border-\[\#F08386\]\/60:hover{border-color:#f0838699}.hover\:border-\[\#a855f7\]:hover{border-color:#a855f7}.hover\:border-\[\#bbf7d0\]:hover{border-color:#bbf7d0}.hover\:border-\[\#bfdbfe\]:hover{border-color:#bfdbfe}.hover\:border-\[\#cbd5e1\]:hover{border-color:#cbd5e1}.hover\:border-\[\#d1cec6\]:hover{border-color:#d1cec6}.hover\:border-\[\#d8b4fe\]:hover{border-color:#d8b4fe}.hover\:border-\[\#dde3eb\]:hover{border-color:#dde3eb}.hover\:border-\[\#e2e8f0\]:hover{border-color:#e2e8f0}.hover\:border-\[\#fecdd3\]:hover{border-color:#fecdd3}.hover\:border-\[\#fed7aa\]:hover{border-color:#fed7aa}.hover\:border-amber-200:hover{border-color:var(--color-amber-200)}.hover\:border-amber-200\/60:hover{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-200\/60:hover{border-color:color-mix(in oklab,var(--color-amber-200) 60%,transparent)}}.hover\:border-blue-200:hover{border-color:var(--color-blue-200)}.hover\:border-emerald-100:hover{border-color:var(--color-emerald-100)}.hover\:border-emerald-200:hover{border-color:var(--color-emerald-200)}.hover\:border-emerald-300:hover{border-color:var(--color-emerald-300)}.hover\:border-indigo-100:hover{border-color:var(--color-indigo-100)}.hover\:border-indigo-200:hover{border-color:var(--color-indigo-200)}.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:border-indigo-600:hover{border-color:var(--color-indigo-600)}.hover\:border-purple-100:hover{border-color:var(--color-purple-100)}.hover\:border-purple-200:hover{border-color:var(--color-purple-200)}.hover\:border-purple-400:hover{border-color:var(--color-purple-400)}.hover\:border-rose-100:hover{border-color:var(--color-rose-100)}.hover\:border-rose-200:hover{border-color:var(--color-rose-200)}.hover\:border-rose-300:hover{border-color:var(--color-rose-300)}.hover\:border-sky-200:hover{border-color:var(--color-violet-200)}.hover\:border-sky-300:hover{border-color:var(--color-violet-300)}.hover\:border-slate-200:hover{border-color:var(--color-slate-200)}.hover\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\:border-violet-100:hover{border-color:var(--color-violet-100)}.hover\:bg-\[\#1C96CB\]:hover{background-color:#1c96cb}.hover\:bg-\[\#1FA7E1\]\/5:hover{background-color:#1fa7e10d}.hover\:bg-\[\#1a95c9\]:hover{background-color:#1a95c9}.hover\:bg-\[\#4f46e5\]:hover{background-color:#4f46e5}.hover\:bg-\[\#5AB84E\]:hover{background-color:#5ab84e}.hover\:bg-\[\#6ab359\]:hover{background-color:#6ab359}.hover\:bg-\[\#6b4494\]:hover{background-color:#6b4494}.hover\:bg-\[\#7b35c0\]:hover{background-color:#7b35c0}.hover\:bg-\[\#7c3aed\]:hover{background-color:#7c3aed}.hover\:bg-\[\#008f5d\]:hover{background-color:#008f5d}.hover\:bg-\[\#8A3FD3\]\/5:hover{background-color:#8a3fd30d}.hover\:bg-\[\#8A4DCA\]:hover{background-color:#8a4dca}.hover\:bg-\[\#8b5cf6\]:hover{background-color:#8b5cf6}.hover\:bg-\[\#8b45d1\]:hover{background-color:#8b45d1}.hover\:bg-\[\#126b84\]:hover{background-color:#126b84}.hover\:bg-\[\#3730a3\]:hover{background-color:#3730a3}.hover\:bg-\[\#4338ca\]:hover{background-color:#4338ca}.hover\:bg-\[\#6366f1\]:hover{background-color:#6366f1}.hover\:bg-\[\#8544c7\]:hover{background-color:#8544c7}.hover\:bg-\[\#8850CE\]:hover{background-color:#8850ce}.hover\:bg-\[\#9333ea\]:hover{background-color:#9333ea}.hover\:bg-\[\#9956DE\]:hover{background-color:#9956de}.hover\:bg-\[\#9956DE\]\/5:hover{background-color:#9956de0d}.hover\:bg-\[\#9956DE\]\/6:hover{background-color:#9956de0f}.hover\:bg-\[\#9956DE\]\/8:hover{background-color:#9956de14}.hover\:bg-\[\#9956DE\]\/12:hover{background-color:#9956de1f}.hover\:bg-\[\#9956DE\]\/20:hover{background-color:#9956de33}.hover\:bg-\[\#059669\]:hover{background-color:#059669}.hover\:bg-\[\#283042\]:hover{background-color:#283042}.hover\:bg-\[\#334155\]:hover{background-color:#334155}.hover\:bg-\[\#F08386\]\/12:hover{background-color:#f083861f}.hover\:bg-\[\#FA7DA9\]:hover{background-color:#fa7da9}.hover\:bg-\[\#FF7373\]:hover{background-color:#ff7373}.hover\:bg-\[\#dde3eb\]:hover{background-color:#dde3eb}.hover\:bg-\[\#e0e7ff\]:hover{background-color:#e0e7ff}.hover\:bg-\[\#edf1f7\]:hover{background-color:#edf1f7}.hover\:bg-\[\#edf1f7\]\/50:hover{background-color:#edf1f780}.hover\:bg-\[\#f0fbff\]:hover{background-color:#f0fbff}.hover\:bg-\[\#f1f5f9\]:hover{background-color:#f1f5f9}.hover\:bg-\[\#f5f3ff\]:hover{background-color:#f5f3ff}.hover\:bg-\[\#f7f9fc\]:hover{background-color:#f7f9fc}.hover\:bg-\[\#f8fafc\]:hover{background-color:#f8fafc}.hover\:bg-\[\#fafbff\]:hover{background-color:#fafbff}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-amber-50:hover{background-color:var(--color-amber-50)}.hover\:bg-amber-100:hover{background-color:var(--color-amber-100)}.hover\:bg-amber-200\/50:hover{background-color:#fee68580}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-200\/50:hover{background-color:color-mix(in oklab,var(--color-amber-200) 50%,transparent)}}.hover\:bg-amber-400:hover{background-color:var(--color-amber-400)}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-black:hover{background-color:var(--color-black)}.hover\:bg-black\/40:hover{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/40:hover{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.hover\:bg-blue-100:hover{background-color:var(--color-blue-100)}.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}.hover\:bg-emerald-50:hover{background-color:var(--color-emerald-50)}.hover\:bg-emerald-100:hover{background-color:var(--color-emerald-100)}.hover\:bg-emerald-400:hover{background-color:var(--color-emerald-400)}.hover\:bg-emerald-600:hover{background-color:var(--color-emerald-600)}.hover\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-indigo-50:hover{background-color:var(--color-indigo-50)}.hover\:bg-indigo-100:hover{background-color:var(--color-indigo-100)}.hover\:bg-indigo-600:hover{background-color:var(--color-indigo-600)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}.hover\:bg-muted:hover,.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-primary:hover,.hover\:bg-primary\/20:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}.hover\:bg-purple-50:hover{background-color:var(--color-purple-50)}.hover\:bg-purple-50\/10:hover{background-color:#faf5ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-50\/10:hover{background-color:color-mix(in oklab,var(--color-purple-50) 10%,transparent)}}.hover\:bg-purple-50\/20:hover{background-color:#faf5ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-50\/20:hover{background-color:color-mix(in oklab,var(--color-purple-50) 20%,transparent)}}.hover\:bg-purple-50\/30:hover{background-color:#faf5ff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-50\/30:hover{background-color:color-mix(in oklab,var(--color-purple-50) 30%,transparent)}}.hover\:bg-purple-50\/40:hover{background-color:#faf5ff66}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-50\/40:hover{background-color:color-mix(in oklab,var(--color-purple-50) 40%,transparent)}}.hover\:bg-purple-100:hover{background-color:var(--color-purple-100)}.hover\:bg-purple-500:hover{background-color:var(--color-purple-500)}.hover\:bg-purple-700:hover{background-color:var(--color-purple-700)}.hover\:bg-purple-900\/40:hover{background-color:#59168b66}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-900\/40:hover{background-color:color-mix(in oklab,var(--color-purple-900) 40%,transparent)}}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-rose-50:hover{background-color:var(--color-rose-50)}.hover\:bg-rose-100:hover{background-color:var(--color-rose-100)}.hover\:bg-rose-500:hover{background-color:var(--color-rose-500)}.hover\:bg-rose-500\/10:hover{background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-rose-500\/10:hover{background-color:color-mix(in oklab,var(--color-rose-500) 10%,transparent)}}.hover\:bg-rose-600:hover{background-color:var(--color-rose-600)}.hover\:bg-rose-700:hover{background-color:var(--color-rose-700)}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:bg-sky-50:hover{background-color:var(--color-violet-50)}.hover\:bg-sky-50\/80:hover{background-color:#f5f3ffcc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-sky-50\/80:hover{background-color:color-mix(in oklab,var(--color-violet-50) 80%,transparent)}}.hover\:bg-sky-300:hover{background-color:var(--color-violet-300)}.hover\:bg-sky-500:hover{background-color:var(--color-violet-500)}.hover\:bg-sky-600:hover{background-color:var(--color-violet-600)}.hover\:bg-sky-700:hover{background-color:var(--color-violet-700)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-slate-50\/50:hover{background-color:#f8fafc80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-50\/50:hover{background-color:color-mix(in oklab,var(--color-slate-50) 50%,transparent)}}.hover\:bg-slate-50\/60:hover{background-color:#f8fafc99}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-50\/60:hover{background-color:color-mix(in oklab,var(--color-slate-50) 60%,transparent)}}.hover\:bg-slate-50\/70:hover{background-color:#f8fafcb3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-50\/70:hover{background-color:color-mix(in oklab,var(--color-slate-50) 70%,transparent)}}.hover\:bg-slate-50\/80:hover{background-color:#f8fafccc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-50\/80:hover{background-color:color-mix(in oklab,var(--color-slate-50) 80%,transparent)}}.hover\:bg-slate-100:hover{background-color:var(--color-slate-100)}.hover\:bg-slate-100\/50:hover{background-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-100\/50:hover{background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.hover\:bg-slate-200:hover{background-color:var(--color-slate-200)}.hover\:bg-slate-200\/50:hover{background-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-200\/50:hover{background-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.hover\:bg-slate-200\/70:hover{background-color:#e2e8f0b3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-200\/70:hover{background-color:color-mix(in oklab,var(--color-slate-200) 70%,transparent)}}.hover\:bg-slate-800:hover{background-color:var(--color-slate-800)}.hover\:bg-violet-100:hover{background-color:var(--color-violet-100)}.hover\:bg-violet-500:hover{background-color:var(--color-violet-500)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.hover\:bg-white\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/30:hover{background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.hover\:bg-white\/50:hover{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/50:hover{background-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.hover\:bg-white\/60:hover{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/60:hover{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.hover\:bg-white\/80:hover{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/80:hover{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.hover\:\!from-\[\#8FE4DA\]:hover{--tw-gradient-from:#8fe4da!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.hover\:from-\[\#9333ea\]:hover{--tw-gradient-from:#9333ea;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-\[\#FFA500\]:hover{--tw-gradient-from:orange;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-amber-600:hover{--tw-gradient-from:var(--color-amber-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-purple-500:hover{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-purple-700:hover{--tw-gradient-from:var(--color-purple-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-sky-700:hover{--tw-gradient-from:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:\!to-\[\#49BDEB\]:hover{--tw-gradient-to:#49bdeb!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.hover\:to-\[\#7e22ce\]:hover{--tw-gradient-to:#7e22ce;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-\[\#FF7F00\]:hover{--tw-gradient-to:#ff7f00;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-orange-600:hover{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-pink-400:hover{--tw-gradient-to:var(--color-pink-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-purple-600:hover{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-sky-600:hover{--tw-gradient-to:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:text-\[\#0a1628\]:hover{color:#0a1628}.hover\:text-\[\#1e293b\]:hover{color:#1e293b}.hover\:text-\[\#4f46e5\]:hover{color:#4f46e5}.hover\:text-\[\#5a6578\]:hover{color:#5a6578}.hover\:text-\[\#7c3aed\]:hover{color:#7c3aed}.hover\:text-\[\#3730a3\]:hover{color:#3730a3}.hover\:text-\[\#9333ea\]:hover{color:#9333ea}.hover\:text-\[\#9956DE\]:hover{color:#9956de}.hover\:text-\[\#64748b\]:hover{color:#64748b}.hover\:text-\[\#F08386\]:hover{color:#f08386}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-amber-500:hover{color:var(--color-amber-500)}.hover\:text-amber-600:hover{color:var(--color-amber-600)}.hover\:text-emerald-500:hover{color:var(--color-emerald-500)}.hover\:text-emerald-600:hover{color:var(--color-emerald-600)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-indigo-300:hover{color:var(--color-indigo-300)}.hover\:text-indigo-500:hover{color:var(--color-indigo-500)}.hover\:text-indigo-600:hover{color:var(--color-indigo-600)}.hover\:text-indigo-700:hover{color:var(--color-indigo-700)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:text-primary:hover{color:var(--primary)}.hover\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\:text-purple-600:hover{color:var(--color-purple-600)}.hover\:text-purple-700:hover{color:var(--color-purple-700)}.hover\:text-purple-900:hover{color:var(--color-purple-900)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:text-rose-300:hover{color:var(--color-rose-300)}.hover\:text-rose-500:hover{color:var(--color-rose-500)}.hover\:text-rose-600:hover{color:var(--color-rose-600)}.hover\:text-rose-700:hover{color:var(--color-rose-700)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:text-sky-300:hover{color:var(--color-violet-300)}.hover\:text-sky-500:hover{color:var(--color-violet-500)}.hover\:text-sky-600:hover{color:var(--color-violet-600)}.hover\:text-sky-700:hover{color:var(--color-violet-700)}.hover\:text-slate-600:hover{color:var(--color-slate-600)}.hover\:text-slate-700:hover{color:var(--color-slate-700)}.hover\:text-slate-800:hover{color:var(--color-slate-800)}.hover\:text-slate-900:hover{color:var(--color-slate-900)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-white\/80:hover{color:#fffc}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/80:hover{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_2px_8px_rgba\(168\,85\,247\,0\.1\)\]:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#a855f71a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_2px_8px_rgba\(168\,85\,247\,0\.08\)\]:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#a855f714);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_2px_10px_rgba\(0\,0\,0\,0\.04\)\]:hover{--tw-shadow:0 2px 10px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_4px_12px_rgba\(168\,85\,247\,0\.08\)\]:hover{--tw-shadow:0 4px 12px var(--tw-shadow-color,#a855f714);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.2\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.04\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.06\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(14\,165\,233\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0ea5e94d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(16\,185\,129\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#10b9814d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(59\,130\,246\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(168\,85\,247\,0\.1\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#a855f71a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(168\,85\,247\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(168\,85\,247\,0\.4\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#a855f766);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(249\,115\,22\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#f973164d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_24px_rgba\(16\,185\,129\,0\.35\)\]:hover{--tw-shadow:0 12px 24px var(--tw-shadow-color,#10b98159);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_24px_rgba\(59\,130\,246\,0\.35\)\]:hover{--tw-shadow:0 12px 24px var(--tw-shadow-color,#3b82f659);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_24px_rgba\(168\,85\,247\,0\.35\)\]:hover{--tw-shadow:0 12px 24px var(--tw-shadow-color,#a855f759);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_45px_rgba\(31\,167\,225\,0\.4\)\]:hover{--tw-shadow:0 12px 45px var(--tw-shadow-color,#1fa7e166);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_45px_rgba\(138\,63\,211\,0\.4\)\]:hover{--tw-shadow:0 12px 45px var(--tw-shadow-color,#8a3fd366);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_30px_rgba\(0\,0\,0\,0\.12\)\]:hover{--tw-shadow:0 16px 30px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_40px_-15px_rgba\(0\,0\,0\,0\.12\)\]:hover{--tw-shadow:0 16px 40px -15px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_40px_rgba\(114\,116\,237\,0\.28\)\]:hover{--tw-shadow:0 16px 40px var(--tw-shadow-color,#7274ed47);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-orange-500\/30:hover{--tw-shadow-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-orange-500\/30:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-orange-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-pink-500\/35:hover{--tw-shadow-color:#f6339a59}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-pink-500\/35:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-pink-500) 35%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-purple-500\/30:hover{--tw-shadow-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-purple-500\/30:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-sky-300\/50:hover{--tw-shadow-color:#c4b4ff80}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-sky-300\/50:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-violet-300) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-sky-500\/30:hover{--tw-shadow-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-sky-500\/30:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-violet-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:z-10:focus{z-index:10}.focus\:border-\[\#4f46e5\]:focus{border-color:#4f46e5}.focus\:border-\[\#7C3AED\]:focus{border-color:#7c3aed}.focus\:border-\[\#75D06A\]:focus{border-color:#75d06a}.focus\:border-\[\#a855f7\]:focus{border-color:#a855f7}.focus\:border-indigo-300:focus{border-color:var(--color-indigo-300)}.focus\:border-indigo-400:focus{border-color:var(--color-indigo-400)}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:border-indigo-600:focus{border-color:var(--color-indigo-600)}.focus\:border-primary:focus{border-color:var(--primary)}.focus\:border-purple-400:focus{border-color:var(--color-purple-400)}.focus\:border-sky-400:focus{border-color:var(--color-violet-400)}.focus\:border-sky-500:focus{border-color:var(--color-violet-500)}.focus\:border-sky-600:focus{border-color:var(--color-violet-600)}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:bg-primary:focus{background-color:var(--primary)}.focus\:bg-white:focus{background-color:var(--color-white)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:text-primary-foreground:focus{color:var(--primary-foreground)}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-4:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#4f46e5\]:focus{--tw-ring-color:#4f46e5}.focus\:ring-\[\#4f46e5\]\/20:focus{--tw-ring-color:oklab(51.0573% .0278994 -.228355/.2)}.focus\:ring-\[\#9956DE\]\/10:focus{--tw-ring-color:oklab(59.4745% .111053 -.167638/.1)}.focus\:ring-\[\#a855f7\]:focus{--tw-ring-color:#a855f7}.focus\:ring-\[\#a855f7\]\/10:focus{--tw-ring-color:oklab(62.6846% .129701 -.193012/.1)}.focus\:ring-\[\#a855f7\]\/20:focus{--tw-ring-color:oklab(62.6846% .129701 -.193012/.2)}.focus\:ring-\[\#a855f7\]\/30:focus{--tw-ring-color:oklab(62.6846% .129701 -.193012/.3)}.focus\:ring-indigo-100:focus{--tw-ring-color:var(--color-indigo-100)}.focus\:ring-indigo-200:focus{--tw-ring-color:var(--color-indigo-200)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:ring-indigo-500\/30:focus{--tw-ring-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/30:focus{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 30%, transparent)}}.focus\:ring-primary\/20:focus{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/20:focus{--tw-ring-color:color-mix(in oklab, var(--primary) 20%, transparent)}}.focus\:ring-purple-50:focus{--tw-ring-color:var(--color-purple-50)}.focus\:ring-purple-500\/20:focus{--tw-ring-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-purple-500\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-sky-100:focus{--tw-ring-color:var(--color-violet-100)}.focus\:ring-sky-200:focus{--tw-ring-color:var(--color-violet-200)}.focus\:ring-sky-400:focus{--tw-ring-color:var(--color-violet-400)}.focus\:ring-sky-400\/20:focus{--tw-ring-color:#a685ff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-400\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-violet-400) 20%, transparent)}}.focus\:ring-sky-500:focus{--tw-ring-color:var(--color-violet-500)}.focus\:ring-sky-500\/20:focus{--tw-ring-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-500\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-violet-500) 20%, transparent)}}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-\[\#9956DE\]:focus-visible{border-color:#9956de}.focus-visible\:border-indigo-500:focus-visible{border-color:var(--color-indigo-500)}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#8A3FD3\]\/50:focus-visible{--tw-ring-color:oklab(54.1025% .117281 -.181162/.5)}.focus-visible\:ring-\[\#9956DE\]\/20:focus-visible{--tw-ring-color:oklab(59.4745% .111053 -.167638/.2)}.focus-visible\:ring-\[\#a855f7\]:focus-visible{--tw-ring-color:#a855f7}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-indigo-500\/20:focus-visible{--tw-ring-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-indigo-500\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 20%, transparent)}}.focus-visible\:ring-purple-500\/20:focus-visible{--tw-ring-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-purple-500\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:translate-y-0:active{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.active\:translate-y-\[2px\]:active{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.active\:scale-90:active{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\:scale-\[0\.98\]:active{scale:.98}.active\:scale-\[0\.99\]:active{scale:.99}.active\:border-b-0:active{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:bg-slate-200:active{background-color:var(--color-slate-200)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.disabled\:opacity-70:disabled{opacity:.7}@media(hover:hover){.disabled\:hover\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:hover\:scale-100:disabled:hover{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\:hover\:bg-indigo-600:disabled:hover{background-color:var(--color-indigo-600)}.disabled\:hover\:text-\[\#a855f7\]:disabled:hover{color:#a855f7}.disabled\:hover\:shadow-sm:disabled:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-disabled\:opacity-50:has(:disabled){opacity:.5}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.aria-selected\:bg-accent[aria-selected=true]{background-color:var(--accent)}.aria-selected\:bg-primary[aria-selected=true]{background-color:var(--primary)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:var(--accent-foreground)}.aria-selected\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.aria-selected\:text-primary-foreground[aria-selected=true]{color:var(--primary-foreground)}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[active\=true\]\:z-10[data-active=true]{z-index:10}.data-\[active\=true\]\:border-ring[data-active=true]{border-color:var(--ring)}.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-accent-foreground[data-active=true]{color:var(--accent-foreground)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[active\=true\]\:ring-\[3px\][data-active=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}@media(hover:hover){.data-\[active\=true\]\:hover\:bg-accent[data-active=true]:hover{background-color:var(--accent)}}.data-\[active\=true\]\:focus\:bg-accent[data-active=true]:focus{background-color:var(--accent)}.data-\[active\=true\]\:aria-invalid\:border-destructive[data-active=true][aria-invalid=true]{border-color:var(--destructive)}.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-4[data-orientation=horizontal]{height:calc(var(--spacing) * 4)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing) * 44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing) * 1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing) * 0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing) * 1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:ring-0 *)[data-slot=navigation-menu-link]:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:outline-none *)[data-slot=navigation-menu-link]:focus{--tw-outline-style:none;outline-style:none}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:min-w-0>*)[data-slot=select-value]{min-width:calc(var(--spacing) * 0)}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}:is(.\*\:data-\[slot\=select-value\]\:truncate>*)[data-slot=select-value]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.data-\[state\=active\]\:bg-card[data-state=active]{background-color:var(--card)}.data-\[state\=active\]\:bg-gradient-to-r[data-state=active]{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.data-\[state\=active\]\:from-blue-600[data-state=active]{--tw-gradient-from:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.data-\[state\=active\]\:to-sky-500[data-state=active]{--tw-gradient-to:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.data-\[state\=active\]\:text-white[data-state=active]{color:var(--color-white)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-emerald-500[data-state=checked]{background-color:var(--color-emerald-500)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:bg-red-600[data-state=checked]{background-color:var(--color-red-600)}.data-\[state\=checked\]\:bg-sky-600[data-state=checked]{background-color:var(--color-violet-600)}.data-\[state\=checked\]\:bg-white[data-state=checked]{background-color:var(--color-white)}.data-\[state\=checked\]\:text-\[\#9956DE\][data-state=checked]{color:#9956de}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=on\]\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\[state\=on\]\:text-accent-foreground[data-state=on]{color:var(--accent-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open],.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}@media(hover:hover){.data-\[state\=open\]\:hover\:bg-accent[data-state=open]:hover{background-color:var(--accent)}.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=open\]\:focus\:bg-accent[data-state=open]:focus{background-color:var(--accent)}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-\[\#dde3eb\][data-state=unchecked]{background-color:#dde3eb}.data-\[state\=unchecked\]\:bg-slate-200[data-state=unchecked]{background-color:var(--color-slate-200)}.data-\[state\=unchecked\]\:bg-switch-background[data-state=unchecked]{background-color:var(--switch-background)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}.data-\[variant\=outline\]\:border-l-0[data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.data-\[variant\=outline\]\:shadow-xs[data-variant=outline]{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[variant\=outline\]\:first\:border-l[data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=bottom\]\:inset-x-0[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=bottom\]\:bottom-0[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=bottom\]\:mt-24[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing) * 24)}.data-\[vaul-drawer-direction\=bottom\]\:max-h-\[80vh\][data-vaul-drawer-direction=bottom]{max-height:80vh}.data-\[vaul-drawer-direction\=bottom\]\:rounded-t-lg[data-vaul-drawer-direction=bottom]{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.data-\[vaul-drawer-direction\=bottom\]\:border-t[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\[vaul-drawer-direction\=left\]\:inset-y-0[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=left\]\:left-0[data-vaul-drawer-direction=left]{left:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=left\]\:w-3\/4[data-vaul-drawer-direction=left]{width:75%}.data-\[vaul-drawer-direction\=left\]\:border-r[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\[vaul-drawer-direction\=right\]\:inset-y-0[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=right\]\:right-0[data-vaul-drawer-direction=right]{right:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=right\]\:w-3\/4[data-vaul-drawer-direction=right]{width:75%}.data-\[vaul-drawer-direction\=right\]\:border-l[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=top\]\:inset-x-0[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=top\]\:top-0[data-vaul-drawer-direction=top]{top:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=top\]\:mb-24[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing) * 24)}.data-\[vaul-drawer-direction\=top\]\:max-h-\[80vh\][data-vaul-drawer-direction=top]{max-height:80vh}.data-\[vaul-drawer-direction\=top\]\:rounded-b-lg[data-vaul-drawer-direction=top]{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[vaul-drawer-direction\=top\]\:border-b[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@media(min-width:40rem){.sm\:-top-8{top:calc(var(--spacing) * -8)}.sm\:-right-8{right:calc(var(--spacing) * -8)}.sm\:right-8{right:calc(var(--spacing) * 8)}.sm\:right-\[-15px\]{right:-15px}.sm\:bottom-8{bottom:calc(var(--spacing) * 8)}.sm\:left-12{left:calc(var(--spacing) * 12)}.sm\:-mx-6{margin-inline:calc(var(--spacing) * -6)}.sm\:mx-0{margin-inline:calc(var(--spacing) * 0)}.sm\:mx-2{margin-inline:calc(var(--spacing) * 2)}.sm\:mt-0{margin-top:calc(var(--spacing) * 0)}.sm\:mt-1{margin-top:calc(var(--spacing) * 1)}.sm\:mt-2{margin-top:calc(var(--spacing) * 2)}.sm\:mt-3{margin-top:calc(var(--spacing) * 3)}.sm\:mt-6{margin-top:calc(var(--spacing) * 6)}.sm\:mt-\[24px\]{margin-top:24px}.sm\:mb-0{margin-bottom:calc(var(--spacing) * 0)}.sm\:mb-3{margin-bottom:calc(var(--spacing) * 3)}.sm\:mb-4{margin-bottom:calc(var(--spacing) * 4)}.sm\:mb-5{margin-bottom:calc(var(--spacing) * 5)}.sm\:mb-6{margin-bottom:calc(var(--spacing) * 6)}.sm\:ml-auto{margin-left:auto}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:inline-block{display:inline-block}.sm\:size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20)}.sm\:h-2{height:calc(var(--spacing) * 2)}.sm\:h-4{height:calc(var(--spacing) * 4)}.sm\:h-5{height:calc(var(--spacing) * 5)}.sm\:h-6{height:calc(var(--spacing) * 6)}.sm\:h-7{height:calc(var(--spacing) * 7)}.sm\:h-8{height:calc(var(--spacing) * 8)}.sm\:h-10{height:calc(var(--spacing) * 10)}.sm\:h-11{height:calc(var(--spacing) * 11)}.sm\:h-12{height:calc(var(--spacing) * 12)}.sm\:h-14{height:calc(var(--spacing) * 14)}.sm\:h-16{height:calc(var(--spacing) * 16)}.sm\:h-20{height:calc(var(--spacing) * 20)}.sm\:h-28{height:calc(var(--spacing) * 28)}.sm\:h-32{height:calc(var(--spacing) * 32)}.sm\:h-\[90vh\]{height:90vh}.sm\:h-\[95px\]{height:95px}.sm\:h-\[115\%\]{height:115%}.sm\:h-\[125\%\]{height:125%}.sm\:h-\[140px\]{height:140px}.sm\:h-\[145px\]{height:145px}.sm\:h-\[245px\]{height:245px}.sm\:h-\[360px\]{height:360px}.sm\:h-\[450px\]{height:450px}.sm\:h-auto{height:auto}.sm\:max-h-\[85vh\]{max-height:85vh}.sm\:min-h-\[4rem\]{min-height:4rem}.sm\:min-h-\[130px\]{min-height:130px}.sm\:w-4{width:calc(var(--spacing) * 4)}.sm\:w-5{width:calc(var(--spacing) * 5)}.sm\:w-6{width:calc(var(--spacing) * 6)}.sm\:w-7{width:calc(var(--spacing) * 7)}.sm\:w-8{width:calc(var(--spacing) * 8)}.sm\:w-10{width:calc(var(--spacing) * 10)}.sm\:w-11{width:calc(var(--spacing) * 11)}.sm\:w-12{width:calc(var(--spacing) * 12)}.sm\:w-14{width:calc(var(--spacing) * 14)}.sm\:w-16{width:calc(var(--spacing) * 16)}.sm\:w-20{width:calc(var(--spacing) * 20)}.sm\:w-24{width:calc(var(--spacing) * 24)}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:w-32{width:calc(var(--spacing) * 32)}.sm\:w-64{width:calc(var(--spacing) * 64)}.sm\:w-\[32\%\]{width:32%}.sm\:w-\[40\%\]{width:40%}.sm\:w-\[100px\]{width:100px}.sm\:w-\[300px\]{width:300px}.sm\:w-\[450px\]{width:450px}.sm\:w-auto{width:auto}.sm\:max-w-4xl{max-width:var(--container-4xl)}.sm\:max-w-\[180px\]{max-width:180px}.sm\:max-w-\[220px\]{max-width:220px}.sm\:max-w-\[300px\]{max-width:300px}.sm\:max-w-\[400px\]{max-width:400px}.sm\:max-w-\[500px\]{max-width:500px}.sm\:max-w-\[600px\]{max-width:600px}.sm\:max-w-\[850px\]{max-width:850px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-md{max-width:var(--container-md)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:min-w-\[120px\]{min-width:120px}.sm\:min-w-\[140px\]{min-width:140px}.sm\:flex-none{flex:none}.sm\:-translate-x-\[60px\]{--tw-translate-x: -60px ;translate:var(--tw-translate-x) var(--tw-translate-y)}.sm\:translate-x-\[60px\]{--tw-translate-x:60px;translate:var(--tw-translate-x) var(--tw-translate-y)}.sm\:scale-\[0\.85\]{scale:.85}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:gap-0{gap:calc(var(--spacing) * 0)}.sm\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}.sm\:gap-2{gap:calc(var(--spacing) * 2)}.sm\:gap-2\.5{gap:calc(var(--spacing) * 2.5)}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:gap-5{gap:calc(var(--spacing) * 5)}.sm\:gap-6{gap:calc(var(--spacing) * 6)}.sm\:gap-8{gap:calc(var(--spacing) * 8)}.sm\:gap-\[10px\]{gap:10px}.sm\:gap-\[16px\]{gap:16px}.sm\:gap-\[18px\]{gap:18px}.sm\:gap-\[24px\]{gap:24px}:where(.sm\:space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.sm\:space-y-\[24px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(24px * var(--tw-space-y-reverse));margin-block-end:calc(24px * calc(1 - var(--tw-space-y-reverse)))}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.sm\:self-auto{align-self:auto}.sm\:rounded-2xl{border-radius:var(--radius-2xl)}.sm\:rounded-\[1\.5rem\]{border-radius:1.5rem}.sm\:rounded-\[2rem\]{border-radius:2rem}.sm\:rounded-\[16px\]{border-radius:16px}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.sm\:rounded-t-\[40px\]{border-top-left-radius:40px;border-top-right-radius:40px}.sm\:rounded-b-\[40px\]{border-bottom-right-radius:40px;border-bottom-left-radius:40px}.sm\:p-2{padding:calc(var(--spacing) * 2)}.sm\:p-3{padding:calc(var(--spacing) * 3)}.sm\:p-4{padding:calc(var(--spacing) * 4)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:p-7{padding:calc(var(--spacing) * 7)}.sm\:p-8{padding:calc(var(--spacing) * 8)}.sm\:p-\[15px\]{padding:15px}.sm\:p-\[18px_20px\]{padding:18px 20px}.sm\:p-\[20px\]{padding:20px}.sm\:p-\[24px\]{padding:24px}.sm\:p-\[32px\]{padding:32px}.sm\:px-0{padding-inline:calc(var(--spacing) * 0)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:px-7{padding-inline:calc(var(--spacing) * 7)}.sm\:px-8{padding-inline:calc(var(--spacing) * 8)}.sm\:px-10{padding-inline:calc(var(--spacing) * 10)}.sm\:px-\[7px\]{padding-inline:7px}.sm\:py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.sm\:py-2{padding-block:calc(var(--spacing) * 2)}.sm\:py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.sm\:py-3{padding-block:calc(var(--spacing) * 3)}.sm\:py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.sm\:py-4{padding-block:calc(var(--spacing) * 4)}.sm\:py-6{padding-block:calc(var(--spacing) * 6)}.sm\:py-8{padding-block:calc(var(--spacing) * 8)}.sm\:pt-2{padding-top:calc(var(--spacing) * 2)}.sm\:pt-3{padding-top:calc(var(--spacing) * 3)}.sm\:pt-6{padding-top:calc(var(--spacing) * 6)}.sm\:pt-10{padding-top:calc(var(--spacing) * 10)}.sm\:pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.sm\:pb-0{padding-bottom:calc(var(--spacing) * 0)}.sm\:pb-3{padding-bottom:calc(var(--spacing) * 3)}.sm\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\:pb-28{padding-bottom:calc(var(--spacing) * 28)}.sm\:pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.sm\:pl-4{padding-left:calc(var(--spacing) * 4)}.sm\:pl-6{padding-left:calc(var(--spacing) * 6)}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.sm\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.sm\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.sm\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.sm\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.sm\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.sm\:text-\[9px\]{font-size:9px}.sm\:text-\[10px\]{font-size:10px}.sm\:text-\[11px\]{font-size:11px}.sm\:text-\[12px\]{font-size:12px}.sm\:text-\[13px\]{font-size:13px}.sm\:text-\[16px\]{font-size:16px}.sm\:text-\[26px\]{font-size:26px}.sm\:text-\[28px\]{font-size:28px}.sm\:text-\[32px\]{font-size:32px}.sm\:text-\[40px\]{font-size:40px}.sm\:tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.data-\[vaul-drawer-direction\=left\]\:sm\:max-w-sm[data-vaul-drawer-direction=left],.data-\[vaul-drawer-direction\=right\]\:sm\:max-w-sm[data-vaul-drawer-direction=right]{max-width:var(--container-sm)}}@media(min-width:48rem){.md\:absolute{position:absolute}.md\:-top-7{top:calc(var(--spacing) * -7)}.md\:-top-8{top:calc(var(--spacing) * -8)}.md\:right-4{right:calc(var(--spacing) * 4)}.md\:right-10{right:calc(var(--spacing) * 10)}.md\:-bottom-7{bottom:calc(var(--spacing) * -7)}.md\:-bottom-8{bottom:calc(var(--spacing) * -8)}.md\:left-4{left:calc(var(--spacing) * 4)}.md\:left-16{left:calc(var(--spacing) * 16)}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-3{grid-column:span 3/span 3}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-6{grid-column:span 6/span 6}.md\:col-span-9{grid-column:span 9/span 9}.md\:mx-0{margin-inline:calc(var(--spacing) * 0)}.md\:mt-1{margin-top:calc(var(--spacing) * 1)}.md\:mt-2{margin-top:calc(var(--spacing) * 2)}.md\:mt-6{margin-top:calc(var(--spacing) * 6)}.md\:mt-8{margin-top:calc(var(--spacing) * 8)}.md\:mt-12{margin-top:calc(var(--spacing) * 12)}.md\:mt-\[-40px\]{margin-top:-40px}.md\:mr-2{margin-right:calc(var(--spacing) * 2)}.md\:mr-4{margin-right:calc(var(--spacing) * 4)}.md\:mb-1{margin-bottom:calc(var(--spacing) * 1)}.md\:mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.md\:mb-2{margin-bottom:calc(var(--spacing) * 2)}.md\:mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.md\:mb-3{margin-bottom:calc(var(--spacing) * 3)}.md\:mb-4{margin-bottom:calc(var(--spacing) * 4)}.md\:mb-5{margin-bottom:calc(var(--spacing) * 5)}.md\:mb-6{margin-bottom:calc(var(--spacing) * 6)}.md\:ml-2{margin-left:calc(var(--spacing) * 2)}.md\:ml-16{margin-left:calc(var(--spacing) * 16)}.md\:line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.md\:block{display:block}.md\:flex{display:flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:table-cell{display:table-cell}.md\:h-2{height:calc(var(--spacing) * 2)}.md\:h-3{height:calc(var(--spacing) * 3)}.md\:h-4{height:calc(var(--spacing) * 4)}.md\:h-5{height:calc(var(--spacing) * 5)}.md\:h-6{height:calc(var(--spacing) * 6)}.md\:h-7{height:calc(var(--spacing) * 7)}.md\:h-9{height:calc(var(--spacing) * 9)}.md\:h-10{height:calc(var(--spacing) * 10)}.md\:h-11{height:calc(var(--spacing) * 11)}.md\:h-12{height:calc(var(--spacing) * 12)}.md\:h-14{height:calc(var(--spacing) * 14)}.md\:h-16{height:calc(var(--spacing) * 16)}.md\:h-20{height:calc(var(--spacing) * 20)}.md\:h-32{height:calc(var(--spacing) * 32)}.md\:h-40{height:calc(var(--spacing) * 40)}.md\:h-48{height:calc(var(--spacing) * 48)}.md\:h-\[10px\]{height:10px}.md\:h-\[72px\]{height:72px}.md\:h-\[85vh\]{height:85vh}.md\:h-\[86px\]{height:86px}.md\:h-\[100px\]{height:100px}.md\:h-\[130px\]{height:130px}.md\:h-\[180px\]{height:180px}.md\:h-\[310px\]{height:310px}.md\:h-\[400vw\]{height:400vw}.md\:h-\[calc\(100\%-24px\)\]{height:calc(100% - 24px)}.md\:h-auto{height:auto}.md\:min-h-\[5rem\]{min-height:5rem}.md\:min-h-\[290px\]{min-height:290px}.md\:w-2{width:calc(var(--spacing) * 2)}.md\:w-3{width:calc(var(--spacing) * 3)}.md\:w-4{width:calc(var(--spacing) * 4)}.md\:w-5{width:calc(var(--spacing) * 5)}.md\:w-6{width:calc(var(--spacing) * 6)}.md\:w-9{width:calc(var(--spacing) * 9)}.md\:w-10{width:calc(var(--spacing) * 10)}.md\:w-11{width:calc(var(--spacing) * 11)}.md\:w-12{width:calc(var(--spacing) * 12)}.md\:w-14{width:calc(var(--spacing) * 14)}.md\:w-20{width:calc(var(--spacing) * 20)}.md\:w-32{width:calc(var(--spacing) * 32)}.md\:w-40{width:calc(var(--spacing) * 40)}.md\:w-48{width:calc(var(--spacing) * 48)}.md\:w-64{width:calc(var(--spacing) * 64)}.md\:w-80{width:calc(var(--spacing) * 80)}.md\:w-\[10px\]{width:10px}.md\:w-\[72px\]{width:72px}.md\:w-\[86px\]{width:86px}.md\:w-\[150px\]{width:150px}.md\:w-\[200vw\]{width:200vw}.md\:w-\[300px\]{width:300px}.md\:w-\[320px\]{width:320px}.md\:w-\[400vw\]{width:400vw}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[200px\]{max-width:200px}.md\:max-w-\[220px\]{max-width:220px}.md\:max-w-\[280px\]{max-width:280px}.md\:max-w-\[300px\]{max-width:300px}.md\:max-w-\[320px\]{max-width:320px}.md\:max-w-none{max-width:none}.md\:min-w-0{min-width:calc(var(--spacing) * 0)}.md\:min-w-\[320px\]{min-width:320px}.md\:shrink{flex-shrink:1}.md\:translate-y-\[21\%\]{--tw-translate-y:21%;translate:var(--tw-translate-x) var(--tw-translate-y)}.md\:scale-\[1\.25\]{scale:1.25}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.md\:flex-col{flex-direction:column}.md\:flex-row{flex-direction:row}.md\:flex-nowrap{flex-wrap:nowrap}.md\:items-center{align-items:center}.md\:items-start{align-items:flex-start}.md\:justify-start{justify-content:flex-start}.md\:gap-1{gap:calc(var(--spacing) * 1)}.md\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}.md\:gap-2{gap:calc(var(--spacing) * 2)}.md\:gap-3{gap:calc(var(--spacing) * 3)}.md\:gap-4{gap:calc(var(--spacing) * 4)}.md\:gap-5{gap:calc(var(--spacing) * 5)}.md\:gap-6{gap:calc(var(--spacing) * 6)}:where(.md\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.md\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}.md\:self-auto{align-self:auto}.md\:overflow-visible{overflow:visible}.md\:rounded-2xl{border-radius:var(--radius-2xl)}.md\:rounded-3xl{border-radius:var(--radius-3xl)}.md\:rounded-\[1\.4rem\]{border-radius:1.4rem}.md\:rounded-\[2rem\]{border-radius:2rem}.md\:rounded-\[14px\]{border-radius:14px}.md\:rounded-lg{border-radius:var(--radius)}.md\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\:rounded-t-xl{border-top-left-radius:calc(var(--radius) + 4px);border-top-right-radius:calc(var(--radius) + 4px)}.md\:border{border-style:var(--tw-border-style);border-width:1px}.md\:bg-transparent{background-color:#0000}.md\:p-3{padding:calc(var(--spacing) * 3)}.md\:p-4{padding:calc(var(--spacing) * 4)}.md\:p-5{padding:calc(var(--spacing) * 5)}.md\:p-6{padding:calc(var(--spacing) * 6)}.md\:p-8{padding:calc(var(--spacing) * 8)}.md\:px-0{padding-inline:calc(var(--spacing) * 0)}.md\:px-1{padding-inline:calc(var(--spacing) * 1)}.md\:px-2{padding-inline:calc(var(--spacing) * 2)}.md\:px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.md\:px-3{padding-inline:calc(var(--spacing) * 3)}.md\:px-4{padding-inline:calc(var(--spacing) * 4)}.md\:px-5{padding-inline:calc(var(--spacing) * 5)}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:px-8{padding-inline:calc(var(--spacing) * 8)}.md\:px-10{padding-inline:calc(var(--spacing) * 10)}.md\:py-1{padding-block:calc(var(--spacing) * 1)}.md\:py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.md\:py-2{padding-block:calc(var(--spacing) * 2)}.md\:py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.md\:py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.md\:py-4{padding-block:calc(var(--spacing) * 4)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}.md\:pt-0{padding-top:calc(var(--spacing) * 0)}.md\:pt-4{padding-top:calc(var(--spacing) * 4)}.md\:pt-6{padding-top:calc(var(--spacing) * 6)}.md\:pr-0{padding-right:calc(var(--spacing) * 0)}.md\:pr-4{padding-right:calc(var(--spacing) * 4)}.md\:pr-10{padding-right:calc(var(--spacing) * 10)}.md\:pr-40{padding-right:calc(var(--spacing) * 40)}.md\:pr-\[240px\]{padding-right:240px}.md\:pb-0{padding-bottom:calc(var(--spacing) * 0)}.md\:pb-5{padding-bottom:calc(var(--spacing) * 5)}.md\:pl-6{padding-left:calc(var(--spacing) * 6)}.md\:pl-16{padding-left:calc(var(--spacing) * 16)}.md\:pl-20{padding-left:calc(var(--spacing) * 20)}.md\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.md\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.md\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.md\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.md\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.md\:text-\[8px\]{font-size:8px}.md\:text-\[10px\]{font-size:10px}.md\:text-\[11px\]{font-size:11px}.md\:text-\[12px\]{font-size:12px}.md\:text-\[13px\]{font-size:13px}.md\:text-\[15px\]{font-size:15px}.md\:text-\[16px\]{font-size:16px}.md\:text-\[17px\]{font-size:17px}.md\:text-\[18px\]{font-size:18px}.md\:text-\[22px\]{font-size:22px}.md\:text-\[24px\]{font-size:24px}.md\:text-\[26px\]{font-size:26px}.md\:text-\[32px\]{font-size:32px}.md\:text-\[44px\]{font-size:44px}.md\:text-\[70px\]{font-size:70px}.md\:text-\[80px\]{font-size:80px}.md\:text-\[110px\]{font-size:110px}.md\:text-\[140px\]{font-size:140px}.md\:leading-\[1\.1\]{--tw-leading:1.1;line-height:1.1}.md\:leading-\[1\.7\]{--tw-leading:1.7;line-height:1.7}.md\:leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.md\:whitespace-normal{white-space:normal}.md\:opacity-0{opacity:0}.md\:shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing) * 2)}.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing) * 0)}.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing) * 2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media(min-width:64rem){.lg\:static{position:static}.lg\:top-\[5px\]{top:5px}.lg\:right-10{right:calc(var(--spacing) * 10)}.lg\:right-\[-15px\]{right:-15px}.lg\:right-\[250px\]{right:250px}.lg\:bottom-20{bottom:calc(var(--spacing) * 20)}.lg\:z-auto{z-index:auto}.lg\:col-span-1{grid-column:span 1/span 1}.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:-mx-4{margin-inline:calc(var(--spacing) * -4)}.lg\:mx-0{margin-inline:calc(var(--spacing) * 0)}.lg\:-mt-4{margin-top:calc(var(--spacing) * -4)}.lg\:mb-3{margin-bottom:calc(var(--spacing) * 3)}.lg\:mb-6{margin-bottom:calc(var(--spacing) * 6)}.lg\:mb-8{margin-bottom:calc(var(--spacing) * 8)}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:table-cell{display:table-cell}.lg\:h-8{height:calc(var(--spacing) * 8)}.lg\:h-9{height:calc(var(--spacing) * 9)}.lg\:h-12{height:calc(var(--spacing) * 12)}.lg\:h-16{height:calc(var(--spacing) * 16)}.lg\:h-\[265px\]{height:265px}.lg\:min-h-0{min-height:calc(var(--spacing) * 0)}.lg\:min-h-\[160px\]{min-height:160px}.lg\:w-8{width:calc(var(--spacing) * 8)}.lg\:w-9{width:calc(var(--spacing) * 9)}.lg\:w-12{width:calc(var(--spacing) * 12)}.lg\:w-16{width:calc(var(--spacing) * 16)}.lg\:w-\[35\%\]{width:35%}.lg\:w-\[65\%\]{width:65%}.lg\:w-\[260px\]{width:260px}.lg\:w-\[270px\]{width:270px}.lg\:w-auto{width:auto}.lg\:w-full{width:100%}.lg\:w-max{width:max-content}.lg\:translate-y-\[19\%\]{--tw-translate-y:19%;translate:var(--tw-translate-x) var(--tw-translate-y)}.lg\:scale-\[1\.3\]{scale:1.3}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-\[1fr_300px\]{grid-template-columns:1fr 300px}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:items-start{align-items:flex-start}.lg\:justify-end{justify-content:flex-end}.lg\:justify-start{justify-content:flex-start}.lg\:gap-3{gap:calc(var(--spacing) * 3)}.lg\:gap-5{gap:calc(var(--spacing) * 5)}.lg\:gap-6{gap:calc(var(--spacing) * 6)}.lg\:gap-10{gap:calc(var(--spacing) * 10)}.lg\:gap-12{gap:calc(var(--spacing) * 12)}.lg\:gap-14{gap:calc(var(--spacing) * 14)}:where(.lg\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.lg\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.lg\:space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.lg\:p-4{padding:calc(var(--spacing) * 4)}.lg\:p-8{padding:calc(var(--spacing) * 8)}.lg\:p-\[32px\]{padding:32px}.lg\:px-8{padding-inline:calc(var(--spacing) * 8)}.lg\:px-10{padding-inline:calc(var(--spacing) * 10)}.lg\:py-8{padding-block:calc(var(--spacing) * 8)}.lg\:pt-6{padding-top:calc(var(--spacing) * 6)}.lg\:pr-\[280px\]{padding-right:280px}.lg\:text-left{text-align:left}.lg\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.lg\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.lg\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.lg\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.lg\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.lg\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.lg\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.lg\:text-\[11px\]{font-size:11px}.lg\:text-\[18px\]{font-size:18px}.lg\:text-\[46px\]{font-size:46px}}@media(min-width:80rem){.xl\:right-\[32px\]{right:32px}.xl\:col-span-1{grid-column:span 1/span 1}.xl\:col-span-2{grid-column:span 2/span 2}.xl\:col-span-3{grid-column:span 3/span 3}.xl\:col-span-4{grid-column:span 4/span 4}.xl\:col-span-5{grid-column:span 5/span 5}.xl\:col-span-7{grid-column:span 7/span 7}.xl\:col-span-8{grid-column:span 8/span 8}.xl\:col-span-9{grid-column:span 9/span 9}.xl\:-mx-10{margin-inline:calc(var(--spacing) * -10)}.xl\:-mx-\[32px\]{margin-inline:-32px}.xl\:mx-0{margin-inline:calc(var(--spacing) * 0)}.xl\:mb-8{margin-bottom:calc(var(--spacing) * 8)}.xl\:flex{display:flex}.xl\:h-\[80vh\]{height:80vh}.xl\:h-\[600px\]{height:600px}.xl\:h-full{height:100%}.xl\:max-h-\[700px\]{max-height:700px}.xl\:min-h-\[120px\]{min-height:120px}.xl\:w-1\/3{width:33.3333%}.xl\:w-2\/3{width:66.6667%}.xl\:w-\[30\%\]{width:30%}.xl\:w-\[50\%\]{width:50%}.xl\:w-\[70\%\]{width:70%}.xl\:w-\[200px\]{width:200px}.xl\:w-\[350px\]{width:350px}.xl\:w-\[calc\(100\%\+64px\)\]{width:calc(100% + 64px)}.xl\:w-auto{width:auto}.xl\:max-w-\[1080px\]{max-width:1080px}.xl\:max-w-\[1400px\]{max-width:1400px}.xl\:max-w-none{max-width:none}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.xl\:grid-cols-\[1fr_320px\]{grid-template-columns:1fr 320px}.xl\:flex-row{flex-direction:row}.xl\:items-center{align-items:center}.xl\:justify-start{justify-content:flex-start}.xl\:gap-12{gap:calc(var(--spacing) * 12)}.xl\:self-center{align-self:center}.xl\:overflow-hidden{overflow:hidden}.xl\:p-\[32px\]{padding:32px}.xl\:px-8{padding-inline:calc(var(--spacing) * 8)}.xl\:px-10{padding-inline:calc(var(--spacing) * 10)}.xl\:px-\[32px\]{padding-inline:32px}.xl\:py-\[32px\]{padding-block:32px}.xl\:pt-4{padding-top:calc(var(--spacing) * 4)}.xl\:pt-8{padding-top:calc(var(--spacing) * 8)}.xl\:pb-0{padding-bottom:calc(var(--spacing) * 0)}.xl\:text-\[3\.4rem\]{font-size:3.4rem}}@media(min-width:96rem){.\32xl\:block{display:block}.\32xl\:w-\[340px\]{width:340px}}.dark\:border-\[\#1FA7E1\]\/20:is(.dark *){border-color:#1fa7e133}.dark\:border-\[\#2b3140\]:is(.dark *){border-color:#2b3140}.dark\:border-\[\#2f3547\]:is(.dark *){border-color:#2f3547}.dark\:border-\[\#8A3FD3\]\/20:is(.dark *){border-color:#8a3fd333}.dark\:border-\[\#8A3FD3\]\/30:is(.dark *){border-color:#8a3fd34d}.dark\:border-amber-400\/40:is(.dark *){border-color:#fcbb0066}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-400) 40%,transparent)}}.dark\:border-emerald-400\/40:is(.dark *){border-color:#00d29466}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-400) 40%,transparent)}}.dark\:border-emerald-500\/40:is(.dark *){border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-500\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.dark\:border-gray-600:is(.dark *){border-color:var(--color-gray-600)}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:border-purple-700\/50:is(.dark *){border-color:#8200da80}@supports (color:color-mix(in lab,red,red)){.dark\:border-purple-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-purple-700) 50%,transparent)}}.dark\:border-rose-400\/40:is(.dark *){border-color:#ff667f66}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-400) 40%,transparent)}}.dark\:border-rose-500\/20:is(.dark *){border-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-500\/20:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.dark\:border-rose-900:is(.dark *){border-color:var(--color-rose-900)}.dark\:border-sky-700\/50:is(.dark *){border-color:#7008e780}@supports (color:color-mix(in lab,red,red)){.dark\:border-sky-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-violet-700) 50%,transparent)}}.dark\:border-slate-700:is(.dark *){border-color:var(--color-slate-700)}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:border-white\/10:is(.dark *){border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.dark\:bg-\[\#1a1f2e\]\/90:is(.dark *){background-color:#1a1f2ee6}.dark\:bg-\[\#2a3143\]:is(.dark *){background-color:#2a3143}.dark\:bg-\[\#2b2b5f\]:is(.dark *){background-color:#2b2b5f}.dark\:bg-\[\#8A3FD3\]\/10:is(.dark *){background-color:#8a3fd31a}.dark\:bg-\[\#181d27\]:is(.dark *){background-color:#181d27}.dark\:bg-\[\#11151d\]:is(.dark *){background-color:#11151d}.dark\:bg-\[\#15803d\]:is(.dark *){background-color:#15803d}.dark\:bg-\[\#b45309\]:is(.dark *){background-color:#b45309}.dark\:bg-\[\#be123c\]:is(.dark *){background-color:#be123c}.dark\:bg-amber-100\/20:is(.dark *){background-color:#fef3c633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-100\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-100) 20%,transparent)}}.dark\:bg-amber-400\/10:is(.dark *){background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-400\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-400) 10%,transparent)}}.dark\:bg-amber-900\/20:is(.dark *){background-color:#7b330633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-900) 20%,transparent)}}.dark\:bg-black\/30:is(.dark *){background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/30:is(.dark *){background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.dark\:bg-black\/40:is(.dark *){background-color:#0006}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/40:is(.dark *){background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.dark\:bg-black\/50:is(.dark *){background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.dark\:bg-black\/80:is(.dark *){background-color:#000c}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/80:is(.dark *){background-color:color-mix(in oklab,var(--color-black) 80%,transparent)}}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 60%,transparent)}}.dark\:bg-emerald-500\/10:is(.dark *){background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.dark\:bg-emerald-500\/30:is(.dark *){background-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/30:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.dark\:bg-emerald-900\/20:is(.dark *){background-color:#004e3b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-900) 20%,transparent)}}.dark\:bg-gray-800:is(.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-900:is(.dark *){background-color:var(--color-gray-900)}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:bg-purple-900\/50:is(.dark *){background-color:#59168b80}@supports (color:color-mix(in lab,red,red)){.dark\:bg-purple-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-purple-900) 50%,transparent)}}.dark\:bg-rose-500\/10:is(.dark *){background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-500\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-rose-500) 10%,transparent)}}.dark\:bg-rose-900\/20:is(.dark *){background-color:#8b083633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-rose-900) 20%,transparent)}}.dark\:bg-sky-900\/50:is(.dark *){background-color:#4d179a80}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-violet-900) 50%,transparent)}}.dark\:from-\[\#2b2b5f\]:is(.dark *){--tw-gradient-from:#2b2b5f;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-purple-300:is(.dark *){--tw-gradient-from:var(--color-purple-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-sky-300:is(.dark *){--tw-gradient-from:var(--color-violet-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-from:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab, var(--color-violet-500) 20%, transparent)}}.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab, var(--color-cyan-500) 10%, transparent)}}.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via:#e12afb1a}@supports (color:color-mix(in lab,red,red)){.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab, var(--color-fuchsia-500) 10%, transparent)}}.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:to-cyan-200:is(.dark *){--tw-gradient-to:var(--color-cyan-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-fuchsia-200:is(.dark *){--tw-gradient-to:var(--color-fuchsia-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-to:#59168b1a}@supports (color:color-mix(in lab,red,red)){.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab, var(--color-purple-900) 10%, transparent)}}.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-to:#4d179a1a}@supports (color:color-mix(in lab,red,red)){.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab, var(--color-violet-900) 10%, transparent)}}.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:text-\[\#4bc1f2\]:is(.dark *){color:#4bc1f2}.dark\:text-\[\#7ad8ff\]:is(.dark *){color:#7ad8ff}.dark\:text-\[\#7f88a3\]:is(.dark *){color:#7f88a3}.dark\:text-\[\#8b95ad\]:is(.dark *){color:#8b95ad}.dark\:text-\[\#9aa4be\]:is(.dark *){color:#9aa4be}.dark\:text-\[\#9e8fff\]:is(.dark *){color:#9e8fff}.dark\:text-\[\#95a0bb\]:is(.dark *){color:#95a0bb}.dark\:text-\[\#a8b2c9\]:is(.dark *){color:#a8b2c9}.dark\:text-\[\#a35ceb\]:is(.dark *){color:#a35ceb}.dark\:text-\[\#aab3c7\]:is(.dark *){color:#aab3c7}.dark\:text-\[\#b2bad0\]:is(.dark *){color:#b2bad0}.dark\:text-\[\#c48bfc\]:is(.dark *){color:#c48bfc}.dark\:text-\[\#d3a8ff\]:is(.dark *){color:#d3a8ff}.dark\:text-\[\#e4e7f1\]:is(.dark *){color:#e4e7f1}.dark\:text-\[\#ecf0fb\]:is(.dark *){color:#ecf0fb}.dark\:text-\[\#f5f7fb\]:is(.dark *){color:#f5f7fb}.dark\:text-amber-100:is(.dark *){color:var(--color-amber-100)}.dark\:text-amber-100\/90:is(.dark *){color:#fef3c6e6}@supports (color:color-mix(in lab,red,red)){.dark\:text-amber-100\/90:is(.dark *){color:color-mix(in oklab,var(--color-amber-100) 90%,transparent)}}.dark\:text-amber-200:is(.dark *){color:var(--color-amber-200)}.dark\:text-amber-300:is(.dark *){color:var(--color-amber-300)}.dark\:text-amber-400:is(.dark *){color:var(--color-amber-400)}.dark\:text-emerald-300:is(.dark *){color:var(--color-emerald-300)}.dark\:text-emerald-400:is(.dark *){color:var(--color-emerald-400)}.dark\:text-gray-400:is(.dark *){color:var(--color-gray-400)}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}.dark\:text-purple-300:is(.dark *){color:var(--color-purple-300)}.dark\:text-purple-400:is(.dark *){color:var(--color-purple-400)}.dark\:text-purple-400\/80:is(.dark *){color:#c07effcc}@supports (color:color-mix(in lab,red,red)){.dark\:text-purple-400\/80:is(.dark *){color:color-mix(in oklab,var(--color-purple-400) 80%,transparent)}}.dark\:text-rose-300:is(.dark *){color:var(--color-rose-300)}.dark\:text-rose-400:is(.dark *){color:var(--color-rose-400)}.dark\:text-sky-300:is(.dark *){color:var(--color-violet-300)}.dark\:text-sky-400:is(.dark *){color:var(--color-violet-400)}.dark\:text-sky-400\/80:is(.dark *){color:#a685ffcc}@supports (color:color-mix(in lab,red,red)){.dark\:text-sky-400\/80:is(.dark *){color:color-mix(in oklab,var(--color-violet-400) 80%,transparent)}}.dark\:text-slate-200:is(.dark *){color:var(--color-slate-200)}.dark\:text-slate-400:is(.dark *){color:var(--color-slate-400)}.dark\:text-white:is(.dark *){color:var(--color-white)}.dark\:opacity-10:is(.dark *){opacity:.1}.dark\:opacity-\[0\.25\]:is(.dark *){opacity:.25}.dark\:mix-blend-screen:is(.dark *){mix-blend-mode:screen}.dark\:shadow-\[0_12px_24px_rgba\(0\,0\,0\,0\.22\)\]:is(.dark *){--tw-shadow:0 12px 24px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:ring-offset-\[\#0B0F19\]:is(.dark *){--tw-ring-offset-color:#0b0f19}@media(hover:hover){.dark\:hover\:bg-\[\#1FA7E1\]\/10:is(.dark *):hover{background-color:#1fa7e11a}.dark\:hover\:bg-\[\#8A3FD3\]\/10:is(.dark *):hover{background-color:#8a3fd31a}.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.dark\:hover\:bg-black\/50:is(.dark *):hover{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-black\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.dark\:hover\:bg-black\/60:is(.dark *):hover{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-black\/60:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.dark\:hover\:bg-emerald-500\/20:is(.dark *):hover{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-emerald-500\/20:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.dark\:hover\:bg-rose-900\/30:is(.dark *):hover{background-color:#8b08364d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-rose-900\/30:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-rose-900) 30%,transparent)}}.dark\:hover\:bg-slate-800:is(.dark *):hover{background-color:var(--color-slate-800)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-card-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--card-foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:var(--muted-foreground)}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:color-mix(in oklab,var(--border) 50%,transparent)}}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:var(--border)}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:#0000}.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:var(--muted)}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:#0000}.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{outline-offset:2px;outline:2px solid #0000}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing) * 0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:var(--accent)}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:first-child:has([aria-selected]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:last-child:has([aria-selected]),.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\:last-child\]\:pb-6:last-child{padding-bottom:calc(var(--spacing) * 6)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>button\]\:hidden>button,.\[\&\>button\:last-child\]\:hidden>button:last-child{display:none}.\[\&\>span\]\:flex>span{display:flex}.\[\&\>span\]\:items-center>span{align-items:center}.\[\&\>span\]\:gap-2>span{gap:calc(var(--spacing) * 2)}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:size-3\.5>svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:h-2\.5>svg{height:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:h-3>svg{height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:w-2\.5>svg{width:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:w-3>svg{width:calc(var(--spacing) * 3)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentColor}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{rotate:180deg}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing) * -2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing) * -2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}@media(hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary) 90%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}:root{--font-size:16px;--font-display:"Nunito", ui-sans-serif, system-ui, sans-serif;--font-body:"Nunito", ui-sans-serif, system-ui, sans-serif;--background:#f7f9fc;--foreground:#0a1628;--card:#fff;--card-foreground:#0a1628;--popover:#fff;--popover-foreground:#0a1628;--amethyst:#9956de;--slate-blue:#7274ed;--summer-sky:#1fa7e1;--downy:#6ed1cf;--pastel-green:#75d06a;--texas-rose:#ffb356;--mona-lisa:#ff8b8b;--illusion:#fb96bb;--primary:#9956de;--primary-foreground:#fff;--secondary:#7274ed;--secondary-foreground:#fff;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#1fa7e1;--accent-foreground:#fff;--destructive:#ff8b8b;--destructive-foreground:#fff;--border:#e4e4e7;--input:transparent;--input-background:#f4f4f5;--switch-background:#d4d4d8;--font-weight-medium:500;--font-weight-normal:400;--ring:#9956de;--chart-1:#9956de;--chart-2:#ff8b8b;--chart-3:#75d06a;--chart-4:#ffb356;--chart-5:#1fa7e1;--radius:1.25rem;--sidebar:#fff;--sidebar-foreground:#09090b;--sidebar-primary:#7c3aed;--sidebar-primary-foreground:#fff;--sidebar-accent:#f3f0ff;--sidebar-accent-foreground:#5b21b6;--sidebar-border:#e4e4e7;--sidebar-ring:#7c3aed}.dark{--background:#050d18;--foreground:#f0f7ff;--card:#0a1628;--card-foreground:#f0f7ff;--popover:#0a1628;--popover-foreground:#f0f7ff;--primary:#a78bfa;--primary-foreground:#fff;--secondary:#2e1065;--secondary-foreground:#c4b5fd;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#f43f5e;--destructive:#ef4444;--destructive-foreground:#09090b;--border:#27272a;--input:#27272a;--input-background:#27272a;--switch-background:#3f3f46;--ring:#a78bfa;--font-weight-medium:500;--font-weight-normal:400;--chart-1:#a78bfa;--chart-2:#fb7185;--chart-3:#34d399;--chart-4:#fb923c;--chart-5:#38bdf8;--sidebar:#09090b;--sidebar-foreground:#fafafa;--sidebar-primary:#a78bfa;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#fafafa;--sidebar-border:#27272a;--sidebar-ring:#a78bfa}html{font-size:var(--font-size)}html,body,#root{height:100%}html[data-density=compact]{--radius:.9rem}html.reduced-motion *,html.reduced-motion :before,html.reduced-motion :after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}html.smart-dark{filter:invert()hue-rotate(180deg);background:#101217}html.smart-dark img,html.smart-dark picture,html.smart-dark video,html.smart-dark canvas,html.smart-dark svg,html.smart-dark iframe,html.smart-dark [data-preserve-color=true]{filter:invert()hue-rotate(180deg)}.font-display{font-family:var(--font-display)}.font-body{font-family:var(--font-body)}.glow-blue{box-shadow:0 0 24px #0284c71f,0 0 64px #0284c70a}.glow-violet{box-shadow:0 0 24px #7c3aed1f,0 0 64px #7c3aed0a}.glow-rose{box-shadow:0 0 24px #f43f5e1f,0 0 64px #f43f5e0a}.glow-emerald{box-shadow:0 0 24px #0596691f,0 0 64px #0596690a}.bg-dot-pattern{background-image:radial-gradient(circle,#7c3aed14 1px,#0000 1px);background-size:24px 24px}.dark .bg-dot-pattern{background-image:radial-gradient(circle,#a78bfa1f 1px,#0000 1px)}.bg-math-pattern{background-color:var(--background);background-image:url("data:image/svg+xml,%3Csvg width='150' height='150' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgba(124, 58, 237, 0.05)' font-family='sans-serif' font-weight='bold' font-size='28'%3E%3Ctext x='20' y='40'%3E%2B%3C/text%3E%3Ctext x='90' y='60'%3E%3D%3C/text%3E%3Ctext x='40' y='110'%3E%25%3C/text%3E%3Ctext x='110' y='130'%3E%C3%97%3C/text%3E%3Ctext x='130' y='30'%3E%C3%B7%3C/text%3E%3C/g%3E%3C/svg%3E");background-size:150px 150px}.lesson-welcome-card{font-family:var(--font-body);position:relative;overflow:hidden}.lesson-welcome-card:before{content:"";pointer-events:none;z-index:0;border-radius:inherit;background-image:url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgba(26,133,164,0.06)' font-family='sans-serif' font-weight='900' font-size='36'%3E%3Ctext x='10' y='50'%3E%2B%3C/text%3E%3Ctext x='120' y='80'%3E%3D%3C/text%3E%3Ctext x='50' y='140'%3E%CF%80%3C/text%3E%3Ctext x='150' y='170'%3E%C3%97%3C/text%3E%3Ctext x='170' y='40'%3E%E2%88%91%3C/text%3E%3Ctext x='80' y='190'%3E%C3%B7%3C/text%3E%3C/g%3E%3C/svg%3E");background-size:200px 200px;position:absolute;inset:0}.lesson-welcome-card>*{z-index:1;position:relative}.lesson-section-heading{font-family:var(--font-display);letter-spacing:-.02em;font-weight:800;line-height:1.2}.lesson-body-text{font-family:var(--font-body);color:#334155;font-size:1rem;line-height:1.75}.lesson-callout-headsup{background:linear-gradient(135deg,#fffbeb,#fef3c7);border:2px solid #f59e0b;border-left-width:5px;border-radius:1rem;padding:1rem 1.25rem;position:relative;overflow:hidden}.lesson-callout-headsup:after{content:"⚠";opacity:.06;pointer-events:none;font-size:3rem;position:absolute;top:50%;right:1rem;transform:translateY(-50%)}.lesson-formula-box{text-align:center;color:#92400e;letter-spacing:.03em;background:linear-gradient(135deg,#fffbeb,#fef9ee);border:1.5px solid #fbbf24;border-radius:.875rem;padding:.875rem 1.25rem;font-family:Courier New,Courier,monospace;font-size:1.05rem;font-weight:700;box-shadow:0 2px 8px #fbbf2426}.lesson-key-term{color:#92400e;background:linear-gradient(135deg,#fef3c7,#fde68a);border-radius:.3em;padding:.1em .4em;font-size:.95em;font-weight:700}.lesson-header-teal{color:#1a85a4;font-family:var(--font-display);font-weight:800}.lesson-header-orange{color:#fbab41;font-family:var(--font-display);font-weight:800}.bg-noise{position:relative}.bg-noise:before{content:"";opacity:.03;pointer-events:none;z-index:1;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");position:absolute;inset:0}.card-elevated{box-shadow:0 16px 40px -8px #7c3aed26,0 0 24px -5px #7c3aed14}.card-elevated-lg{box-shadow:0 24px 60px -12px #7c3aed33,0 0 32px -10px #7c3aed1a}.shadow-3d-button{box-shadow:0 12px 24px -6px var(--tw-shadow-color,#f9731666),0 6px 12px -4px var(--tw-shadow-color,#f973164d)}.dark .card-elevated{box-shadow:0 1px 2px #0003,0 4px 16px #00000026}.dark .card-elevated-lg{box-shadow:0 2px 4px #0003,0 8px 32px #0003}*{scrollbar-width:thin;scrollbar-color:transparent transparent}:hover{scrollbar-color:#0284c733 transparent}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:#0000;border-radius:10px;transition:background-color .3s}:hover::-webkit-scrollbar-thumb{background-color:#0284c733}::-webkit-scrollbar-thumb:hover{background-color:#0284c766}.scrollbar-hide{scrollbar-width:none;-ms-overflow-style:none}.scrollbar-hide::-webkit-scrollbar{display:none}.accent-line{position:relative}.accent-line:after{content:"";background:linear-gradient(90deg,#0284c7,#f43f5e);border-radius:2px;width:48px;height:3px;position:absolute;bottom:0;left:0}.surface-raised{background:linear-gradient(135deg,#fff,#f8fafc);border:1px solid #e2e8f0cc}.surface-inset{background:linear-gradient(135deg,#f1f5f9,#e8eef6);border:1px solid #cbd5e180}.bg-white-20{background-color:#fff3}.bg-white-15{background-color:#ffffff26}.bg-black-15{background-color:#00000026}.e-w{width:var(--w)}.e-bg{background-color:var(--bg)}.e-color{color:var(--c);fill:var(--c);stroke:var(--c)}.e-grid-cols{grid-template-columns:var(--grid-cols)}.e-perspective{perspective:var(--perspective)}.e-transform{transform:var(--tr)}.e-left-top{left:var(--left);top:var(--top)}.e-z{z-index:var(--z)}.e-filter{filter:var(--filter)}.e-opacity{opacity:var(--o)}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{display:none}.module-detail-grid-pattern{opacity:.1;pointer-events:none;background-image:repeating-linear-gradient(0deg,#0000,#0000 39px,#fff 39px 40px),repeating-linear-gradient(90deg,#0000,#0000 39px,#fff 39px 40px)}.leaderboard-mask{-webkit-mask-image:linear-gradient(#0000,#000 15%);mask-image:linear-gradient(#0000,#000 15%)}.app-loader-screen{z-index:50;background:#f7f9fc;justify-content:center;align-items:center;padding:1rem;display:flex;position:fixed;inset:0}.app-loader-card{background:#fff;border:1px solid #dde3eb;border-radius:2rem;flex-direction:column;align-items:center;gap:1.5rem;width:min(100%,24rem);padding:2rem;display:flex;box-shadow:0 24px 40px #38bdf81f}.app-loader-avatar-shell{background:linear-gradient(135deg,#e0f2fe,#e0e7ff);border:2px solid #fff;border-radius:1.5rem;justify-content:center;align-items:center;width:8rem;height:8rem;display:flex;box-shadow:0 12px 24px #0f172a1f}.app-loader-avatar{object-fit:contain;filter:drop-shadow(0 8px 12px #0f172a33);width:5.5rem;height:5.5rem}.app-loader-bot-icon{width:4rem;height:4rem}.app-loader-title{color:#0a1628;margin:0;font-size:1.25rem;font-weight:700}.app-loader-message-row{justify-content:center;align-items:center;gap:.5rem;margin-top:.5rem;display:flex}.app-loader-spinner{border:2px solid #0284c7;border-top-color:#0000;border-radius:999px;width:1rem;height:1rem}.app-loader-message{color:#64748b;margin:0;font-size:.875rem;font-weight:600}.avatar-gloss{clip-path:polygon(15% 0,85% 0,65% 100%,35% 100%);pointer-events:none;background:linear-gradient(#fff6,#ffffff0d 60%,#0000)}.login-bg{background:linear-gradient(135deg,#f0f9ff,#f8fafc,#fff1f2 60%,#f0f9ff)}.login-frost-overlay{pointer-events:none;background:radial-gradient(at 30%,#f0f9ff33,#f8fafc80 50%,#fff1f266 80%,#f8fafcd9)}.login-orb-purple{background:radial-gradient(circle,#a855f74d,#0000 70%)}.login-orb-pink{background:radial-gradient(circle,#ec489940,#0000 70%)}.login-orb-blue{background:radial-gradient(circle,#38bdf833,#0000 70%)}.dynamic-header{background-color:var(--bg);-webkit-backdrop-filter:blur(var(--blur));backdrop-filter:blur(var(--blur));box-shadow:var(--shadow)}.e-max-h{max-height:var(--max-h);transition:max-height .22s;overflow:hidden}.hero-clip-inset{clip-path:inset(-100% -50% 0)}.card-3d{transform-origin:0;backface-visibility:hidden;transition:transform 2s ease-in-out}.card-accent-sky{border-left:3px solid #0284c7}.card-accent-rose{border-left:3px solid #f43f5e}.card-accent-emerald{border-left:3px solid #059669}.app-loader-copy{text-align:center}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes sunburst-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-sunburst-spin{animation:30s linear infinite sunburst-spin}.chat-markdown{font-family:var(--font-body);overflow-wrap:anywhere;word-break:break-word;font-size:.875rem;line-height:1.625}.chat-markdown h1{font-family:var(--font-display);color:var(--foreground);margin-top:.75rem;margin-bottom:.5rem;font-size:1.25rem;font-weight:700}.chat-markdown h2{font-family:var(--font-display);color:var(--foreground);margin-top:.75rem;margin-bottom:.375rem;font-size:1.1rem;font-weight:700}.chat-markdown h3{font-family:var(--font-display);color:var(--muted-foreground);margin-top:.5rem;margin-bottom:.25rem;font-size:1rem;font-weight:600}.chat-markdown p{margin-top:.375rem;margin-bottom:.375rem}.chat-markdown ul,.chat-markdown ol{margin-top:.375rem;margin-bottom:.375rem;padding-left:1.25rem}.chat-markdown ul{list-style-type:disc}.chat-markdown ol{list-style-type:decimal}.chat-markdown li{margin-top:.125rem;margin-bottom:.125rem}.chat-markdown strong{color:var(--foreground);font-weight:700}.chat-markdown em{font-style:italic}.chat-markdown code{background:var(--secondary);color:var(--primary);border-radius:.25rem;padding:.125rem .375rem;font-size:.8125rem}.chat-markdown pre{background:var(--muted);border:1px solid var(--border);border-radius:.5rem;margin-top:.5rem;margin-bottom:.5rem;padding:.75rem;overflow-x:auto}.chat-markdown pre code{color:inherit;background:0 0;padding:0}.chat-markdown hr{border-color:#94a3b873;margin:.75rem 0}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5rem 0;font-size:.8125rem}.chat-markdown th{background:var(--muted);text-align:left;border:1px solid var(--border);padding:.375rem .5rem;font-weight:600}.chat-markdown td{border:1px solid var(--border);padding:.375rem .5rem}.chat-markdown blockquote{border-left:3px solid var(--primary);color:var(--muted-foreground);margin:.5rem 0;padding-left:.75rem;font-style:italic}.chat-markdown a{color:var(--primary);text-decoration:underline}.chat-markdown>:first-child{margin-top:0}.chat-markdown>:last-child{margin-bottom:0}.chat-markdown .katex-display{padding-bottom:.15rem;overflow:auto hidden}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}} +/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-scroll-snap-strictness:proximity;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-800:oklch(47.6% .114 61.907);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-emerald-950:oklch(26.2% .051 172.552);--color-teal-50:oklch(98.4% .014 180.72);--color-teal-100:oklch(95.3% .051 180.801);--color-teal-300:oklch(85.5% .138 181.071);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-teal-600:oklch(60% .118 184.704);--color-teal-700:oklch(51.1% .096 186.391);--color-teal-900:oklch(38.6% .063 188.416);--color-cyan-100:oklch(95.6% .045 203.388);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-200:var(--color-violet-200);--color-sky-700:var(--color-violet-700);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-violet-50:oklch(96.9% .016 293.756);--color-violet-100:oklch(94.3% .029 294.588);--color-violet-200:oklch(89.4% .057 293.283);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-600:oklch(54.1% .281 293.009);--color-violet-700:oklch(49.1% .27 292.581);--color-violet-800:oklch(43.2% .232 292.759);--color-violet-900:oklch(38% .189 293.745);--color-violet-950:oklch(28.3% .141 291.089);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-purple-800:oklch(43.8% .218 303.724);--color-purple-900:oklch(38.1% .176 304.987);--color-fuchsia-50:oklch(97.7% .017 320.058);--color-fuchsia-200:oklch(90.3% .076 319.62);--color-fuchsia-300:oklch(83.3% .145 321.434);--color-fuchsia-400:oklch(74% .238 322.16);--color-fuchsia-500:oklch(66.7% .295 322.15);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-pink-600:oklch(59.2% .249 .584);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-100:oklch(94.1% .03 12.58);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-rose-700:oklch(51.4% .222 16.935);--color-rose-800:oklch(45.5% .188 13.697);--color-rose-900:oklch(41% .159 10.272);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-700:oklch(37% .013 285.805);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--animate-bounce:bounce 1s infinite;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-border:var(--border)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground);font-family:var(--font-body);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h1{font-family:var(--font-display);font-size:var(--text-2xl);letter-spacing:-.02em;font-weight:700;line-height:1.3}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h2{font-family:var(--font-display);font-size:var(--text-xl);letter-spacing:-.01em;font-weight:700;line-height:1.35}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h3{font-family:var(--font-display);font-size:var(--text-lg);font-weight:600;line-height:1.4}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h4{font-family:var(--font-display);font-size:var(--text-base);font-weight:600;line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) label{font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) button{font-family:var(--font-body);font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) input{font-family:var(--font-body);font-size:var(--text-base);font-weight:var(--font-weight-normal);line-height:1.5}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.\[container-type\:inline-size\]{container-type:inline-size}.\[container-type\:size\]{container-type:size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.-inset-\[5px\]{inset:-5px}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.inset-x-\[-20px\]{inset-inline:-20px}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.end-1{inset-inline-end:calc(var(--spacing) * 1)}.-top-1{top:calc(var(--spacing) * -1)}.-top-2{top:calc(var(--spacing) * -2)}.-top-3{top:calc(var(--spacing) * -3)}.-top-3\.5{top:calc(var(--spacing) * -3.5)}.-top-4{top:calc(var(--spacing) * -4)}.-top-5{top:calc(var(--spacing) * -5)}.-top-6{top:calc(var(--spacing) * -6)}.-top-8{top:calc(var(--spacing) * -8)}.-top-10{top:calc(var(--spacing) * -10)}.-top-12{top:calc(var(--spacing) * -12)}.-top-20{top:calc(var(--spacing) * -20)}.-top-24{top:calc(var(--spacing) * -24)}.-top-40{top:calc(var(--spacing) * -40)}.top-0{top:calc(var(--spacing) * 0)}.top-0\.5{top:calc(var(--spacing) * .5)}.top-1{top:calc(var(--spacing) * 1)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-3{top:calc(var(--spacing) * 3)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-4{top:calc(var(--spacing) * 4)}.top-5{top:calc(var(--spacing) * 5)}.top-6{top:calc(var(--spacing) * 6)}.top-7{top:calc(var(--spacing) * 7)}.top-8{top:calc(var(--spacing) * 8)}.top-12{top:calc(var(--spacing) * 12)}.top-20{top:calc(var(--spacing) * 20)}.top-24{top:calc(var(--spacing) * 24)}.top-\[-5\%\]{top:-5%}.top-\[-10\%\]{top:-10%}.top-\[-30px\]{top:-30px}.top-\[0\%\]{top:0%}.top-\[1px\]{top:1px}.top-\[10\%\]{top:10%}.top-\[10px\]{top:10px}.top-\[15\%\]{top:15%}.top-\[20\%\]{top:20%}.top-\[25px\]{top:25px}.top-\[40\%\]{top:40%}.top-\[45\%\]{top:45%}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-\[80px\]{top:80px}.top-full{top:100%}.-right-1{right:calc(var(--spacing) * -1)}.-right-2{right:calc(var(--spacing) * -2)}.-right-2\.5{right:calc(var(--spacing) * -2.5)}.-right-3{right:calc(var(--spacing) * -3)}.-right-4{right:calc(var(--spacing) * -4)}.-right-5{right:calc(var(--spacing) * -5)}.-right-6{right:calc(var(--spacing) * -6)}.-right-8{right:calc(var(--spacing) * -8)}.-right-10{right:calc(var(--spacing) * -10)}.-right-12{right:calc(var(--spacing) * -12)}.-right-24{right:calc(var(--spacing) * -24)}.-right-40{right:calc(var(--spacing) * -40)}.right-0{right:calc(var(--spacing) * 0)}.right-0\.5{right:calc(var(--spacing) * .5)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-2\.5{right:calc(var(--spacing) * 2.5)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.right-6{right:calc(var(--spacing) * 6)}.right-8{right:calc(var(--spacing) * 8)}.right-12{right:calc(var(--spacing) * 12)}.right-16{right:calc(var(--spacing) * 16)}.right-\[-5\%\]{right:-5%}.right-\[-5px\]{right:-5px}.right-\[-10\%\]{right:-10%}.right-\[-10px\]{right:-10px}.right-\[-20\%\]{right:-20%}.right-\[-20px\]{right:-20px}.right-\[-30px\]{right:-30px}.right-\[10\%\]{right:10%}.right-\[24px\]{right:24px}.right-\[150px\]{right:150px}.right-full{right:100%}.-bottom-1{bottom:calc(var(--spacing) * -1)}.-bottom-2{bottom:calc(var(--spacing) * -2)}.-bottom-2\.5{bottom:calc(var(--spacing) * -2.5)}.-bottom-3{bottom:calc(var(--spacing) * -3)}.-bottom-4{bottom:calc(var(--spacing) * -4)}.-bottom-5{bottom:calc(var(--spacing) * -5)}.-bottom-6{bottom:calc(var(--spacing) * -6)}.-bottom-8{bottom:calc(var(--spacing) * -8)}.-bottom-10{bottom:calc(var(--spacing) * -10)}.-bottom-12{bottom:calc(var(--spacing) * -12)}.-bottom-24{bottom:calc(var(--spacing) * -24)}.-bottom-40{bottom:calc(var(--spacing) * -40)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-5{bottom:calc(var(--spacing) * 5)}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-12{bottom:calc(var(--spacing) * 12)}.bottom-16{bottom:calc(var(--spacing) * 16)}.bottom-28{bottom:calc(var(--spacing) * 28)}.bottom-\[-10\%\]{bottom:-10%}.bottom-\[-20px\]{bottom:-20px}.bottom-\[-500px\]{bottom:-500px}.bottom-\[0\%\]{bottom:0%}.bottom-\[2px\]{bottom:2px}.bottom-\[35px\]{bottom:35px}.bottom-\[50px\]{bottom:50px}.bottom-full{bottom:100%}.-left-2{left:calc(var(--spacing) * -2)}.-left-2\.5{left:calc(var(--spacing) * -2.5)}.-left-3{left:calc(var(--spacing) * -3)}.-left-4{left:calc(var(--spacing) * -4)}.-left-8{left:calc(var(--spacing) * -8)}.-left-10{left:calc(var(--spacing) * -10)}.-left-12{left:calc(var(--spacing) * -12)}.-left-40{left:calc(var(--spacing) * -40)}.-left-\[17px\]{left:-17px}.-left-\[150\%\]{left:-150%}.left-0{left:calc(var(--spacing) * 0)}.left-1{left:calc(var(--spacing) * 1)}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-3\.5{left:calc(var(--spacing) * 3.5)}.left-4{left:calc(var(--spacing) * 4)}.left-8{left:calc(var(--spacing) * 8)}.left-12{left:calc(var(--spacing) * 12)}.left-\[-5\%\]{left:-5%}.left-\[-10\%\]{left:-10%}.left-\[-20px\]{left:-20px}.left-\[10\%\]{left:10%}.left-\[15\%\]{left:15%}.left-\[20\%\]{left:20%}.left-\[40\%\]{left:40%}.left-\[50\%\]{left:50%}.left-\[54px\]{left:54px}.left-\[var\(--x\)\]{left:var(--x)}.left-full{left:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[-2\]{z-index:-2}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.z-\[3\]{z-index:3}.z-\[4\]{z-index:4}.z-\[11\]{z-index:11}.z-\[12\]{z-index:12}.z-\[13\]{z-index:13}.z-\[50\]{z-index:50}.z-\[51\]{z-index:51}.z-\[60\]{z-index:60}.z-\[70\]{z-index:70}.z-\[75\]{z-index:75}.z-\[80\]{z-index:80}.z-\[90\]{z-index:90}.z-\[100\]{z-index:100}.z-\[110\]{z-index:110}.z-\[120\]{z-index:120}.z-\[130\]{z-index:130}.z-\[200\]{z-index:200}.z-\[250\]{z-index:250}.z-\[300\]{z-index:300}.z-\[9998\]{z-index:9998}.z-\[9999\]{z-index:9999}.z-\[10000\]{z-index:10000}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-12{grid-column:span 12/span 12}.col-span-full{grid-column:1/-1}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-m-2{margin:calc(var(--spacing) * -2)}.m-0{margin:calc(var(--spacing) * 0)}.m-1{margin:calc(var(--spacing) * 1)}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-mx-3{margin-inline:calc(var(--spacing) * -3)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.-mx-\[24px\]{margin-inline:-24px}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3\.5{margin-inline:calc(var(--spacing) * 3.5)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-\[-20px\]{margin-inline:-20px}.mx-\[1px\]{margin-inline:1px}.mx-auto{margin-inline:auto}.-my-4{margin-block:calc(var(--spacing) * -4)}.my-0\.5{margin-block:calc(var(--spacing) * .5)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-4{margin-block:calc(var(--spacing) * 4)}.-mt-0\.5{margin-top:calc(var(--spacing) * -.5)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-3{margin-top:calc(var(--spacing) * -3)}.-mt-4{margin-top:calc(var(--spacing) * -4)}.-mt-10{margin-top:calc(var(--spacing) * -10)}.-mt-24{margin-top:calc(var(--spacing) * -24)}.mt-0{margin-top:calc(var(--spacing) * 0)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-\[-10px\]{margin-top:-10px}.mt-\[-20px\]{margin-top:-20px}.mt-\[0\.5rem\]{margin-top:.5rem}.mt-\[1px\]{margin-top:1px}.mt-\[4px\]{margin-top:4px}.mt-\[24px\]{margin-top:24px}.mt-auto{margin-top:auto}.-mr-10{margin-right:calc(var(--spacing) * -10)}.-mr-24{margin-right:calc(var(--spacing) * -24)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-4{margin-right:calc(var(--spacing) * 4)}.-mb-8{margin-bottom:calc(var(--spacing) * -8)}.-mb-10{margin-bottom:calc(var(--spacing) * -10)}.-mb-18{margin-bottom:calc(var(--spacing) * -18)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.mb-\[-10px\]{margin-bottom:-10px}.mb-\[2px\]{margin-bottom:2px}.mb-\[8px\]{margin-bottom:8px}.mb-\[10px\]{margin-bottom:10px}.mb-\[14px\]{margin-bottom:14px}.mb-\[16px\]{margin-bottom:16px}.-ml-1{margin-left:calc(var(--spacing) * -1)}.-ml-4{margin-left:calc(var(--spacing) * -4)}.-ml-8{margin-left:calc(var(--spacing) * -8)}.-ml-10{margin-left:calc(var(--spacing) * -10)}.-ml-18{margin-left:calc(var(--spacing) * -18)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-10{margin-left:calc(var(--spacing) * 10)}.ml-14{margin-left:calc(var(--spacing) * 14)}.ml-\[20px\]{margin-left:20px}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.\[aspect-ratio\:1\/var\(--aspect-ratio\)\]{aspect-ratio:1/var(--aspect-ratio)}.aspect-\[4\/5\]{aspect-ratio:4/5}.aspect-square{aspect-ratio:1}.aspect-video{aspect-ratio:var(--aspect-video)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-full{width:100%;height:100%}.\[height\:100cqmax\]{height:100cqmax}.h-0{height:calc(var(--spacing) * 0)}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-3\/4{height:75%}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-32{height:calc(var(--spacing) * 32)}.h-36{height:calc(var(--spacing) * 36)}.h-40{height:calc(var(--spacing) * 40)}.h-48{height:calc(var(--spacing) * 48)}.h-64{height:calc(var(--spacing) * 64)}.h-80{height:calc(var(--spacing) * 80)}.h-96{height:calc(var(--spacing) * 96)}.h-\[1\.5rem\]{height:1.5rem}.h-\[1\.15rem\]{height:1.15rem}.h-\[1px\]{height:1px}.h-\[2px\]{height:2px}.h-\[3px\]{height:3px}.h-\[6px\]{height:6px}.h-\[10px\]{height:10px}.h-\[14px\]{height:14px}.h-\[16px\]{height:16px}.h-\[18px\]{height:18px}.h-\[22px\]{height:22px}.h-\[25px\]{height:25px}.h-\[28px\]{height:28px}.h-\[32px\]{height:32px}.h-\[35px\]{height:35px}.h-\[38px\]{height:38px}.h-\[40\%\]{height:40%}.h-\[40px\]{height:40px}.h-\[45px\]{height:45px}.h-\[46px\]{height:46px}.h-\[48px\]{height:48px}.h-\[50px\]{height:50px}.h-\[52px\]{height:52px}.h-\[54px\]{height:54px}.h-\[60\%\]{height:60%}.h-\[65px\]{height:65px}.h-\[70\%\]{height:70%}.h-\[72px\]{height:72px}.h-\[75px\]{height:75px}.h-\[76px\]{height:76px}.h-\[80\%\]{height:80%}.h-\[80px\]{height:80px}.h-\[85\%\]{height:85%}.h-\[85px\]{height:85px}.h-\[92vh\]{height:92vh}.h-\[95vh\]{height:95vh}.h-\[96px\]{height:96px}.h-\[100px\]{height:100px}.h-\[100vh\]{height:100vh}.h-\[105\%\]{height:105%}.h-\[110\%\]{height:110%}.h-\[120\%\]{height:120%}.h-\[120px\]{height:120px}.h-\[130px\]{height:130px}.h-\[140px\]{height:140px}.h-\[150vh\]{height:150vh}.h-\[160px\]{height:160px}.h-\[170px\]{height:170px}.h-\[185px\]{height:185px}.h-\[190px\]{height:190px}.h-\[220px\]{height:220px}.h-\[250px\]{height:250px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[500px\]{height:500px}.h-\[600vw\]{height:600vw}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[calc\(100\%-16px\)\]{height:calc(100% - 16px)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--radix-context-menu-content-available-height\){max-height:var(--radix-context-menu-content-available-height)}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-24{max-height:calc(var(--spacing) * 24)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[300px\]{max-height:300px}.max-h-\[320px\]{max-height:320px}.max-h-\[360px\]{max-height:360px}.max-h-\[500px\]{max-height:500px}.max-h-\[calc\(90vh-200px\)\]{max-height:calc(90vh - 200px)}.max-h-\[calc\(90vh-320px\)\]{max-height:calc(90vh - 320px)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-\[2\.5rem\]{min-height:2.5rem}.min-h-\[3rem\]{min-height:3rem}.min-h-\[24px\]{min-height:24px}.min-h-\[40px\]{min-height:40px}.min-h-\[44px\]{min-height:44px}.min-h-\[48px\]{min-height:48px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[64px\]{min-height:64px}.min-h-\[75px\]{min-height:75px}.min-h-\[100px\]{min-height:100px}.min-h-\[110px\]{min-height:110px}.min-h-\[140px\]{min-height:140px}.min-h-\[160px\]{min-height:160px}.min-h-\[170px\]{min-height:170px}.min-h-\[180px\]{min-height:180px}.min-h-\[185px\]{min-height:185px}.min-h-\[190px\]{min-height:190px}.min-h-\[200px\]{min-height:200px}.min-h-\[240px\]{min-height:240px}.min-h-\[250px\]{min-height:250px}.min-h-\[290px\]{min-height:290px}.min-h-\[300px\]{min-height:300px}.min-h-\[320px\]{min-height:320px}.min-h-\[330px\]{min-height:330px}.min-h-\[400px\]{min-height:400px}.min-h-\[500px\]{min-height:500px}.min-h-\[800px\]{min-height:800px}.min-h-\[calc\(100vh-3\.5rem\)\]{min-height:calc(100vh - 3.5rem)}.min-h-dvh{min-height:100dvh}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.\!w-auto{width:auto!important}.\[width\:100cqh\]{width:100cqh}.\[width\:100cqi\]{width:100cqi}.\[width\:var\(--width\)\]{width:var(--width)}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-0{width:calc(var(--spacing) * 0)}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1{width:calc(var(--spacing) * 1)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-1\/2{width:50%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-5\/6{width:83.3333%}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-96{width:calc(var(--spacing) * 96)}.w-\[1px\]{width:1px}.w-\[2px\]{width:2px}.w-\[5px\]{width:5px}.w-\[6px\]{width:6px}.w-\[10px\]{width:10px}.w-\[16px\]{width:16px}.w-\[22px\]{width:22px}.w-\[30\%\]{width:30%}.w-\[32px\]{width:32px}.w-\[38\%\]{width:38%}.w-\[38px\]{width:38px}.w-\[40\%\]{width:40%}.w-\[46px\]{width:46px}.w-\[48px\]{width:48px}.w-\[52px\]{width:52px}.w-\[55\%\]{width:55%}.w-\[58\%\]{width:58%}.w-\[60\%\]{width:60%}.w-\[60px\]{width:60px}.w-\[65\%\]{width:65%}.w-\[65px\]{width:65px}.w-\[67\%\]{width:67%}.w-\[70\%\]{width:70%}.w-\[70px\]{width:70px}.w-\[72vw\]{width:72vw}.w-\[75px\]{width:75px}.w-\[76\%\]{width:76%}.w-\[78px\]{width:78px}.w-\[79\%\]{width:79%}.w-\[80\%\]{width:80%}.w-\[80px\]{width:80px}.w-\[81\%\]{width:81%}.w-\[84\%\]{width:84%}.w-\[85\%\]{width:85%}.w-\[86\%\]{width:86%}.w-\[88\%\]{width:88%}.w-\[89\%\]{width:89%}.w-\[90\%\]{width:90%}.w-\[90px\]{width:90px}.w-\[92\%\]{width:92%}.w-\[94\%\]{width:94%}.w-\[95\%\]{width:95%}.w-\[96px\]{width:96px}.w-\[100\%\]{width:100%}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150vw\]{width:150vw}.w-\[160px\]{width:160px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-\[220px\]{width:220px}.w-\[250vw\]{width:250vw}.w-\[260px\]{width:260px}.w-\[280px\]{width:280px}.w-\[300px\]{width:300px}.w-\[320px\]{width:320px}.w-\[350px\]{width:350px}.w-\[380px\]{width:380px}.w-\[400px\]{width:400px}.w-\[600vw\]{width:600vw}.w-\[calc\(100\%\+48px\)\]{width:calc(100% + 48px)}.w-\[calc\(100\%-4rem\)\]{width:calc(100% - 4rem)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[19rem\]{max-width:19rem}.max-w-\[22rem\]{max-width:22rem}.max-w-\[24rem\]{max-width:24rem}.max-w-\[28rem\]{max-width:28rem}.max-w-\[36rem\]{max-width:36rem}.max-w-\[44rem\]{max-width:44rem}.max-w-\[48\%\]{max-width:48%}.max-w-\[50rem\]{max-width:50rem}.max-w-\[54rem\]{max-width:54rem}.max-w-\[70\%\]{max-width:70%}.max-w-\[75\%\]{max-width:75%}.max-w-\[80px\]{max-width:80px}.max-w-\[85\%\]{max-width:85%}.max-w-\[85vw\]{max-width:85vw}.max-w-\[88vw\]{max-width:88vw}.max-w-\[90\%\]{max-width:90%}.max-w-\[90px\]{max-width:90px}.max-w-\[90rem\]{max-width:90rem}.max-w-\[120px\]{max-width:120px}.max-w-\[130px\]{max-width:130px}.max-w-\[140px\]{max-width:140px}.max-w-\[160px\]{max-width:160px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[250px\]{max-width:250px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[320px\]{max-width:320px}.max-w-\[330px\]{max-width:330px}.max-w-\[340px\]{max-width:340px}.max-w-\[380px\]{max-width:380px}.max-w-\[400px\]{max-width:400px}.max-w-\[420px\]{max-width:420px}.max-w-\[450px\]{max-width:450px}.max-w-\[460px\]{max-width:460px}.max-w-\[800px\]{max-width:800px}.max-w-\[900px\]{max-width:900px}.max-w-\[1000px\]{max-width:1000px}.max-w-\[1100px\]{max-width:1100px}.max-w-\[1200px\]{max-width:1200px}.max-w-\[1400px\]{max-width:1400px}.max-w-\[1600px\]{max-width:1600px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-\[calc\(100vw-24px\)\]{max-width:calc(100vw - 24px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-max{max-width:max-content}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-\[1\.5rem\]{min-width:1.5rem}.min-w-\[1\.75rem\]{min-width:1.75rem}.min-w-\[2\.5rem\]{min-width:2.5rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[18px\]{min-width:18px}.min-w-\[60px\]{min-width:60px}.min-w-\[65px\]{min-width:65px}.min-w-\[85px\]{min-width:85px}.min-w-\[90px\]{min-width:90px}.min-w-\[120px\]{min-width:120px}.min-w-\[130px\]{min-width:130px}.min-w-\[140px\]{min-width:140px}.min-w-\[160px\]{min-width:160px}.min-w-\[180px\]{min-width:180px}.min-w-\[240px\]{min-width:240px}.min-w-\[280px\]{min-width:280px}.min-w-\[800px\]{min-width:800px}.min-w-\[1000px\]{min-width:1000px}.min-w-\[1100px\]{min-width:1100px}.min-w-\[1140px\]{min-width:1140px}.min-w-\[1240px\]{min-width:1240px}.min-w-\[1320px\]{min-width:1320px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-\[1\.5\]{flex:1.5}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.border-separate{border-collapse:separate}.border-spacing-y-2{--tw-border-spacing-y:calc(var(--spacing) * 2);border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.\[transform-origin\:0\%_0\%\]{transform-origin:0 0}.\[transform-origin\:50\%_0\%\]{transform-origin:50% 0}.\[transform-origin\:100\%_0\%\]{transform-origin:100% 0}.origin-\(--radix-context-menu-content-transform-origin\){transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-hover-card-content-transform-origin\){transform-origin:var(--radix-hover-card-content-transform-origin)}.origin-\(--radix-menubar-content-transform-origin\){transform-origin:var(--radix-menubar-content-transform-origin)}.origin-\(--radix-popover-content-transform-origin\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-bottom{transform-origin:bottom}.origin-bottom-right{transform-origin:100% 100%}.origin-right{transform-origin:100%}.origin-top-right{transform-origin:100% 0}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\/4{--tw-translate-x: -25% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-4{--tw-translate-x:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-\[30px\]{--tw-translate-x: -30px ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1{--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1\/3{--tw-translate-x:calc(1 / 3 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1\/4{--tw-translate-x: 25% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-100\%\]{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[30px\]{--tw-translate-x:30px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-4{--tw-translate-y:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0\.5{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1{--tw-translate-y:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1\/2{--tw-translate-y: 50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1\/3{--tw-translate-y:calc(1 / 3 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-10{--tw-translate-y:calc(var(--spacing) * 10);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[10\%\]{--tw-translate-y:10%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-full{--tw-translate-y:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-50{--tw-scale-x:50%;--tw-scale-y:50%;--tw-scale-z:50%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-x-\[-1\]{--tw-scale-x:-1;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-y-75{--tw-scale-y:75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-y-150{--tw-scale-y:150%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-\[0\.80\]{scale:.8}.scale-\[0\.99\]{scale:.99}.scale-\[1\.01\]{scale:1.01}.scale-\[1\.1\]{scale:1.1}.scale-\[1\.02\]{scale:1.02}.scale-\[1\.05\]{scale:1.05}.scale-\[1\.15\]{scale:1.15}.scale-\[1\.35\]{scale:1.35}.-rotate-12{rotate:-12deg}.-rotate-90{rotate:-90deg}.-rotate-\[15deg\]{rotate:-15deg}.rotate-6{rotate:6deg}.rotate-12{rotate:12deg}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.rotate-\[-3deg\]{rotate:-3deg}.rotate-\[-5deg\]{rotate:-5deg}.rotate-\[15deg\]{rotate:15deg}.-skew-x-12{--tw-skew-x:skewX( -12deg );transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.\[transform\:rotate\(-90deg\)_rotateX\(-90deg\)\]{transform:rotate(-90deg)rotateX(-90deg)}.\[transform\:rotate\(90deg\)_rotateX\(-90deg\)\]{transform:rotate(90deg)rotateX(-90deg)}.\[transform\:rotateX\(-90deg\)\]{transform:rotateX(-90deg)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[fadeIn_0\.3s_ease-in-out\]{animation:.3s ease-in-out fadeIn}.animate-bounce{animation:var(--animate-bounce)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.touch-manipulation{touch-action:manipulation}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.snap-center{scroll-snap-align:center}.scroll-my-1{scroll-margin-block:calc(var(--spacing) * 1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing) * 1)}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-rows-5{grid-template-rows:repeat(5,minmax(0,1fr))}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-items-start{justify-items:start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-10{gap:calc(var(--spacing) * 10)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-\[2px\]{gap:2px}.gap-\[3px\]{gap:3px}.gap-\[4px\]{gap:4px}.gap-\[5px\]{gap:5px}.gap-\[6px\]{gap:6px}.gap-\[8px\]{gap:8px}.gap-\[10px\]{gap:10px}.gap-\[12px\]{gap:12px}.gap-\[16px\]{gap:16px}.gap-\[18px\]{gap:18px}.gap-\[24px\]{gap:24px}:where(.-space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * -.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * -.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 10) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 10) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[8px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(8px * var(--tw-space-y-reverse));margin-block-end:calc(8px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[9px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(9px * var(--tw-space-y-reverse));margin-block-end:calc(9px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[12px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(12px * var(--tw-space-y-reverse));margin-block-end:calc(12px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[16px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(16px * var(--tw-space-y-reverse));margin-block-end:calc(16px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[24px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(24px * var(--tw-space-y-reverse));margin-block-end:calc(24px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[28px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(28px * var(--tw-space-y-reverse));margin-block-end:calc(28px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\[32px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(32px * var(--tw-space-y-reverse));margin-block-end:calc(32px * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-10{column-gap:calc(var(--spacing) * 10)}:where(.-space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * -2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * -2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 1) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[\#edf1f7\]>:not(:last-child)){border-color:#edf1f7}:where(.divide-\[\#f1f5f9\]>:not(:last-child)){border-color:#f1f5f9}:where(.divide-border>:not(:last-child)){border-color:var(--border)}:where(.divide-slate-50>:not(:last-child)){border-color:var(--color-slate-50)}:where(.divide-slate-50\/60>:not(:last-child)){border-color:#f8fafc99}@supports (color:color-mix(in lab,red,red)){:where(.divide-slate-50\/60>:not(:last-child)){border-color:color-mix(in oklab,var(--color-slate-50) 60%,transparent)}}:where(.divide-slate-100>:not(:last-child)){border-color:var(--color-slate-100)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.overscroll-contain{overscroll-behavior:contain}.scroll-smooth{scroll-behavior:smooth}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\[-20px\]{border-radius:-20px}.rounded-\[1\.2rem\]{border-radius:1.2rem}.rounded-\[1\.4rem\]{border-radius:1.4rem}.rounded-\[1\.5rem\]{border-radius:1.5rem}.rounded-\[1rem\]{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[2rem\]{border-radius:2rem}.rounded-\[3px\]{border-radius:3px}.rounded-\[4px\]{border-radius:4px}.rounded-\[6px\]{border-radius:6px}.rounded-\[7px\]{border-radius:7px}.rounded-\[8px\]{border-radius:8px}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-\[14px\]{border-radius:14px}.rounded-\[16px\]{border-radius:16px}.rounded-\[17px\]{border-radius:17px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[28px\]{border-radius:28px}.rounded-\[32px\]{border-radius:32px}.rounded-\[40px\]{border-radius:40px}.rounded-\[50\%\]{border-radius:50%}.rounded-\[50\%_50\%_0_0\/100\%_100\%_0_0\]{border-radius:50% 50% 0 0/100% 100% 0 0}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.rounded-t-\[2\.5rem\]{border-top-left-radius:2.5rem;border-top-right-radius:2.5rem}.rounded-t-\[2px\]{border-top-left-radius:2px;border-top-right-radius:2px}.rounded-t-\[3px\]{border-top-left-radius:3px;border-top-right-radius:3px}.rounded-t-\[24px\]{border-top-left-radius:24px;border-top-right-radius:24px}.rounded-t-\[32px\]{border-top-left-radius:32px;border-top-right-radius:32px}.rounded-t-\[40px\]{border-top-left-radius:40px;border-top-right-radius:40px}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.rounded-t-xl{border-top-left-radius:calc(var(--radius) + 4px);border-top-right-radius:calc(var(--radius) + 4px)}.rounded-l-2xl{border-top-left-radius:var(--radius-2xl);border-bottom-left-radius:var(--radius-2xl)}.rounded-l-\[1\.5rem\]{border-top-left-radius:1.5rem;border-bottom-left-radius:1.5rem}.rounded-l-\[14px\]{border-top-left-radius:14px;border-bottom-left-radius:14px}.rounded-l-\[18px\]{border-top-left-radius:18px;border-bottom-left-radius:18px}.rounded-l-full{border-top-left-radius:3.40282e38px;border-bottom-left-radius:3.40282e38px}.rounded-tl-\[20px\]{border-top-left-radius:20px}.rounded-tl-\[24px\]{border-top-left-radius:24px}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-r-2xl{border-top-right-radius:var(--radius-2xl);border-bottom-right-radius:var(--radius-2xl)}.rounded-r-full{border-top-right-radius:3.40282e38px;border-bottom-right-radius:3.40282e38px}.rounded-tr-\[20px\]{border-top-right-radius:20px}.rounded-b-2xl{border-bottom-right-radius:var(--radius-2xl);border-bottom-left-radius:var(--radius-2xl)}.rounded-b-\[18px\]{border-bottom-right-radius:18px;border-bottom-left-radius:18px}.rounded-b-\[24px\]{border-bottom-right-radius:24px;border-bottom-left-radius:24px}.rounded-b-\[32px\]{border-bottom-right-radius:32px;border-bottom-left-radius:32px}.rounded-b-md{border-bottom-right-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-br-sm{border-bottom-right-radius:calc(var(--radius) - 4px)}.rounded-bl-\[24px\]{border-bottom-left-radius:24px}.rounded-bl-none{border-bottom-left-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[2px\]{border-style:var(--tw-border-style);border-width:2px}.border-\[3px\]{border-style:var(--tw-border-style);border-width:3px}.border-\[4px\]{border-style:var(--tw-border-style);border-width:4px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-x-\[1\.5px\]{border-inline-style:var(--tw-border-style);border-inline-width:1.5px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-t-4,.border-t-\[4px\]{border-top-style:var(--tw-border-style);border-top-width:4px}.border-t-\[6px\]{border-top-style:var(--tw-border-style);border-top-width:6px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}.border-r-4{border-right-style:var(--tw-border-style);border-right-width:4px}.border-r-\[6px\]{border-right-style:var(--tw-border-style);border-right-width:6px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-b-4{border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.border-b-\[2\.5px\]{border-bottom-style:var(--tw-border-style);border-bottom-width:2.5px}.border-b-\[4px\]{border-bottom-style:var(--tw-border-style);border-bottom-width:4px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4,.border-l-\[4px\]{border-left-style:var(--tw-border-style);border-left-width:4px}.border-l-\[6px\]{border-left-style:var(--tw-border-style);border-left-width:6px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.\!border-emerald-400{border-color:var(--color-emerald-400)!important}.border-\(--color-border\){border-color:var(--color-border)}.border-\[\#0B0F19\]{border-color:#0b0f19}.border-\[\#0ea5e9\]\/20{border-color:#0ea5e933}.border-\[\#1FA7E1\]{border-color:#1fa7e1}.border-\[\#1FA7E1\]\/20{border-color:#1fa7e133}.border-\[\#1FA7E1\]\/30{border-color:#1fa7e14d}.border-\[\#1FA7E1\]\/40{border-color:#1fa7e166}.border-\[\#1a85a4\]\/20{border-color:#1a85a433}.border-\[\#1a85a4\]\/30{border-color:#1a85a44d}.border-\[\#2a3648\]{border-color:#2a3648}.border-\[\#2f384e\]{border-color:#2f384e}.border-\[\#4f46e5\]{border-color:#4f46e5}.border-\[\#4f46e5\]\/20{border-color:#4f46e533}.border-\[\#6ED1CF\]\/20{border-color:#6ed1cf33}.border-\[\#6ee7b7\]{border-color:#6ee7b7}.border-\[\#7C3AED\]{border-color:#7c3aed}.border-\[\#8A3FD3\]\/20{border-color:#8a3fd333}.border-\[\#8A3FD3\]\/30{border-color:#8a3fd34d}.border-\[\#8B5CF6\]\/40{border-color:#8b5cf666}.border-\[\#8b5cf6\]{border-color:#8b5cf6}.border-\[\#9b51e0\]{border-color:#9b51e0}.border-\[\#10b981\]{border-color:#10b981}.border-\[\#75D06A\]{border-color:#75d06a}.border-\[\#75D06A\]\/30{border-color:#75d06a4d}.border-\[\#75D06A\]\/35{border-color:#75d06a59}.border-\[\#75D06A\]\/40{border-color:#75d06a66}.border-\[\#6366f1\]{border-color:#6366f1}.border-\[\#7274ED\]\/20{border-color:#7274ed33}.border-\[\#7274ED\]\/30{border-color:#7274ed4d}.border-\[\#9956DE\]{border-color:#9956de}.border-\[\#9956DE\]\/20{border-color:#9956de33}.border-\[\#9956DE\]\/25{border-color:#9956de40}.border-\[\#9956DE\]\/30{border-color:#9956de4d}.border-\[\#9956DE\]\/40{border-color:#9956de66}.border-\[\#F1F5F9\]{border-color:#f1f5f9}.border-\[\#F08386\]{border-color:#f08386}.border-\[\#F08386\]\/30{border-color:#f083864d}.border-\[\#FF8B8B\]{border-color:#ff8b8b}.border-\[\#FF8B8B\]\/35{border-color:#ff8b8b59}.border-\[\#FFB356\]{border-color:#ffb356}.border-\[\#FFB356\]\/20{border-color:#ffb35633}.border-\[\#FFB356\]\/38{border-color:#ffb35661}.border-\[\#a5b4fc\]{border-color:#a5b4fc}.border-\[\#a5b4fc\]\/60{border-color:#a5b4fc99}.border-\[\#a855f7\]{border-color:#a855f7}.border-\[\#c7d2fe\]{border-color:#c7d2fe}.border-\[\#cbd5e1\]{border-color:#cbd5e1}.border-\[\#d1cec6\]{border-color:#d1cec6}.border-\[\#dadce0\]{border-color:#dadce0}.border-\[\#dde3eb\]{border-color:#dde3eb}.border-\[\#e0e7ff\]{border-color:#e0e7ff}.border-\[\#e2e8f0\]{border-color:#e2e8f0}.border-\[\#e2e8f0\]\/40{border-color:#e2e8f066}.border-\[\#e67e00\]{border-color:#e67e00}.border-\[\#edf1f7\]{border-color:#edf1f7}.border-\[\#f1f5f9\]{border-color:#f1f5f9}.border-\[\#fbbf24\]{border-color:#fbbf24}.border-\[\#fca5a5\]{border-color:#fca5a5}.border-\[\#fcd34d\]{border-color:#fcd34d}.border-\[\#fde68a\]{border-color:#fde68a}.border-amber-50{border-color:var(--color-amber-50)}.border-amber-100{border-color:var(--color-amber-100)}.border-amber-100\/50{border-color:#fef3c680}@supports (color:color-mix(in lab,red,red)){.border-amber-100\/50{border-color:color-mix(in oklab,var(--color-amber-100) 50%,transparent)}}.border-amber-100\/80{border-color:#fef3c6cc}@supports (color:color-mix(in lab,red,red)){.border-amber-100\/80{border-color:color-mix(in oklab,var(--color-amber-100) 80%,transparent)}}.border-amber-200{border-color:var(--color-amber-200)}.border-amber-200\/50{border-color:#fee68580}@supports (color:color-mix(in lab,red,red)){.border-amber-200\/50{border-color:color-mix(in oklab,var(--color-amber-200) 50%,transparent)}}.border-amber-200\/60{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.border-amber-200\/60{border-color:color-mix(in oklab,var(--color-amber-200) 60%,transparent)}}.border-amber-300{border-color:var(--color-amber-300)}.border-amber-300\/40{border-color:#ffd23666}@supports (color:color-mix(in lab,red,red)){.border-amber-300\/40{border-color:color-mix(in oklab,var(--color-amber-300) 40%,transparent)}}.border-amber-300\/50{border-color:#ffd23680}@supports (color:color-mix(in lab,red,red)){.border-amber-300\/50{border-color:color-mix(in oklab,var(--color-amber-300) 50%,transparent)}}.border-amber-400{border-color:var(--color-amber-400)}.border-amber-500{border-color:var(--color-amber-500)}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-blue-50{border-color:var(--color-blue-50)}.border-blue-100{border-color:var(--color-blue-100)}.border-blue-100\/50{border-color:#dbeafe80}@supports (color:color-mix(in lab,red,red)){.border-blue-100\/50{border-color:color-mix(in oklab,var(--color-blue-100) 50%,transparent)}}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-300{border-color:var(--color-blue-300)}.border-blue-400\/30{border-color:#54a2ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-400\/30{border-color:color-mix(in oklab,var(--color-blue-400) 30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-border\/80{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/80{border-color:color-mix(in oklab,var(--border) 80%,transparent)}}.border-emerald-50{border-color:var(--color-emerald-50)}.border-emerald-100{border-color:var(--color-emerald-100)}.border-emerald-100\/50{border-color:#d0fae580}@supports (color:color-mix(in lab,red,red)){.border-emerald-100\/50{border-color:color-mix(in oklab,var(--color-emerald-100) 50%,transparent)}}.border-emerald-100\/60{border-color:#d0fae599}@supports (color:color-mix(in lab,red,red)){.border-emerald-100\/60{border-color:color-mix(in oklab,var(--color-emerald-100) 60%,transparent)}}.border-emerald-200{border-color:var(--color-emerald-200)}.border-emerald-200\/50{border-color:#a4f4cf80}@supports (color:color-mix(in lab,red,red)){.border-emerald-200\/50{border-color:color-mix(in oklab,var(--color-emerald-200) 50%,transparent)}}.border-emerald-200\/60{border-color:#a4f4cf99}@supports (color:color-mix(in lab,red,red)){.border-emerald-200\/60{border-color:color-mix(in oklab,var(--color-emerald-200) 60%,transparent)}}.border-emerald-300{border-color:var(--color-emerald-300)}.border-emerald-300\/40{border-color:#5ee9b566}@supports (color:color-mix(in lab,red,red)){.border-emerald-300\/40{border-color:color-mix(in oklab,var(--color-emerald-300) 40%,transparent)}}.border-emerald-300\/70{border-color:#5ee9b5b3}@supports (color:color-mix(in lab,red,red)){.border-emerald-300\/70{border-color:color-mix(in oklab,var(--color-emerald-300) 70%,transparent)}}.border-emerald-400{border-color:var(--color-emerald-400)}.border-emerald-400\/30{border-color:#00d2944d}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/30{border-color:color-mix(in oklab,var(--color-emerald-400) 30%,transparent)}}.border-emerald-400\/50{border-color:#00d29480}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/50{border-color:color-mix(in oklab,var(--color-emerald-400) 50%,transparent)}}.border-emerald-500{border-color:var(--color-emerald-500)}.border-emerald-500\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/20{border-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-emerald-600\/50{border-color:#00976780}@supports (color:color-mix(in lab,red,red)){.border-emerald-600\/50{border-color:color-mix(in oklab,var(--color-emerald-600) 50%,transparent)}}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-200{border-color:var(--color-green-200)}.border-green-500\/40{border-color:#00c75866}@supports (color:color-mix(in lab,red,red)){.border-green-500\/40{border-color:color-mix(in oklab,var(--color-green-500) 40%,transparent)}}.border-indigo-50{border-color:var(--color-indigo-50)}.border-indigo-100{border-color:var(--color-indigo-100)}.border-indigo-100\/50{border-color:#e0e7ff80}@supports (color:color-mix(in lab,red,red)){.border-indigo-100\/50{border-color:color-mix(in oklab,var(--color-indigo-100) 50%,transparent)}}.border-indigo-200{border-color:var(--color-indigo-200)}.border-indigo-200\/50{border-color:#c7d2ff80}@supports (color:color-mix(in lab,red,red)){.border-indigo-200\/50{border-color:color-mix(in oklab,var(--color-indigo-200) 50%,transparent)}}.border-indigo-300{border-color:var(--color-indigo-300)}.border-indigo-400{border-color:var(--color-indigo-400)}.border-indigo-500{border-color:var(--color-indigo-500)}.border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500) 30%,transparent)}}.border-indigo-600\/50{border-color:#4f39f680}@supports (color:color-mix(in lab,red,red)){.border-indigo-600\/50{border-color:color-mix(in oklab,var(--color-indigo-600) 50%,transparent)}}.border-input{border-color:var(--input)}.border-muted-foreground\/15{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.border-muted-foreground\/15{border-color:color-mix(in oklab,var(--muted-foreground) 15%,transparent)}}.border-orange-100{border-color:var(--color-orange-100)}.border-orange-100\/50{border-color:#ffedd580}@supports (color:color-mix(in lab,red,red)){.border-orange-100\/50{border-color:color-mix(in oklab,var(--color-orange-100) 50%,transparent)}}.border-orange-200{border-color:var(--color-orange-200)}.border-orange-200\/60{border-color:#ffd7a899}@supports (color:color-mix(in lab,red,red)){.border-orange-200\/60{border-color:color-mix(in oklab,var(--color-orange-200) 60%,transparent)}}.border-orange-300\/50{border-color:#ffb96d80}@supports (color:color-mix(in lab,red,red)){.border-orange-300\/50{border-color:color-mix(in oklab,var(--color-orange-300) 50%,transparent)}}.border-orange-400{border-color:var(--color-orange-400)}.border-orange-500{border-color:var(--color-orange-500)}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500) 30%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500) 40%,transparent)}}.border-primary{border-color:var(--primary)}.border-purple-50{border-color:var(--color-purple-50)}.border-purple-100{border-color:var(--color-purple-100)}.border-purple-100\/50{border-color:#f3e8ff80}@supports (color:color-mix(in lab,red,red)){.border-purple-100\/50{border-color:color-mix(in oklab,var(--color-purple-100) 50%,transparent)}}.border-purple-200{border-color:var(--color-purple-200)}.border-purple-200\/60{border-color:#e9d5ff99}@supports (color:color-mix(in lab,red,red)){.border-purple-200\/60{border-color:color-mix(in oklab,var(--color-purple-200) 60%,transparent)}}.border-purple-300{border-color:var(--color-purple-300)}.border-purple-400{border-color:var(--color-purple-400)}.border-purple-500{border-color:var(--color-purple-500)}.border-purple-500\/20{border-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/20{border-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.border-red-100{border-color:var(--color-red-100)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-red-400{border-color:var(--color-red-400)}.border-red-500{border-color:var(--color-red-500)}.border-rose-50{border-color:var(--color-rose-50)}.border-rose-100{border-color:var(--color-rose-100)}.border-rose-100\/50{border-color:#ffe4e680}@supports (color:color-mix(in lab,red,red)){.border-rose-100\/50{border-color:color-mix(in oklab,var(--color-rose-100) 50%,transparent)}}.border-rose-100\/60{border-color:#ffe4e699}@supports (color:color-mix(in lab,red,red)){.border-rose-100\/60{border-color:color-mix(in oklab,var(--color-rose-100) 60%,transparent)}}.border-rose-200{border-color:var(--color-rose-200)}.border-rose-200\/50{border-color:#ffccd380}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/50{border-color:color-mix(in oklab,var(--color-rose-200) 50%,transparent)}}.border-rose-200\/60{border-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.border-rose-200\/60{border-color:color-mix(in oklab,var(--color-rose-200) 60%,transparent)}}.border-rose-300{border-color:var(--color-rose-300)}.border-rose-300\/70{border-color:#ffa2aeb3}@supports (color:color-mix(in lab,red,red)){.border-rose-300\/70{border-color:color-mix(in oklab,var(--color-rose-300) 70%,transparent)}}.border-rose-400{border-color:var(--color-rose-400)}.border-rose-400\/50{border-color:#ff667f80}@supports (color:color-mix(in lab,red,red)){.border-rose-400\/50{border-color:color-mix(in oklab,var(--color-rose-400) 50%,transparent)}}.border-rose-500{border-color:var(--color-rose-500)}.border-rose-500\/20{border-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/20{border-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.border-rose-500\/30{border-color:#ff23574d}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/30{border-color:color-mix(in oklab,var(--color-rose-500) 30%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500) 50%,transparent)}}.border-sidebar-border{border-color:var(--sidebar-border)}.border-sky-100{border-color:var(--color-violet-100)}.border-sky-100\/80{border-color:#ede9fecc}@supports (color:color-mix(in lab,red,red)){.border-sky-100\/80{border-color:color-mix(in oklab,var(--color-violet-100) 80%,transparent)}}.border-sky-200{border-color:var(--color-violet-200)}.border-sky-200\/50{border-color:#ddd6ff80}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/50{border-color:color-mix(in oklab,var(--color-violet-200) 50%,transparent)}}.border-sky-200\/60{border-color:#ddd6ff99}@supports (color:color-mix(in lab,red,red)){.border-sky-200\/60{border-color:color-mix(in oklab,var(--color-violet-200) 60%,transparent)}}.border-sky-300{border-color:var(--color-violet-300)}.border-sky-400{border-color:var(--color-violet-400)}.border-sky-500{border-color:var(--color-violet-500)}.border-sky-500\/20{border-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/20{border-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.border-sky-500\/30{border-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/30{border-color:color-mix(in oklab,var(--color-violet-500) 30%,transparent)}}.border-sky-500\/40{border-color:#8d54ff66}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/40{border-color:color-mix(in oklab,var(--color-violet-500) 40%,transparent)}}.border-sky-600{border-color:var(--color-violet-600)}.border-slate-50{border-color:var(--color-slate-50)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-100\/30{border-color:#f1f5f94d}@supports (color:color-mix(in lab,red,red)){.border-slate-100\/30{border-color:color-mix(in oklab,var(--color-slate-100) 30%,transparent)}}.border-slate-100\/50{border-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.border-slate-100\/50{border-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\/50{border-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/50{border-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.border-slate-200\/60{border-color:#e2e8f099}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/60{border-color:color-mix(in oklab,var(--color-slate-200) 60%,transparent)}}.border-slate-200\/70{border-color:#e2e8f0b3}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/70{border-color:color-mix(in oklab,var(--color-slate-200) 70%,transparent)}}.border-slate-200\/80{border-color:#e2e8f0cc}@supports (color:color-mix(in lab,red,red)){.border-slate-200\/80{border-color:color-mix(in oklab,var(--color-slate-200) 80%,transparent)}}.border-slate-300{border-color:var(--color-slate-300)}.border-slate-300\/30{border-color:#cad5e24d}@supports (color:color-mix(in lab,red,red)){.border-slate-300\/30{border-color:color-mix(in oklab,var(--color-slate-300) 30%,transparent)}}.border-slate-300\/50{border-color:#cad5e280}@supports (color:color-mix(in lab,red,red)){.border-slate-300\/50{border-color:color-mix(in oklab,var(--color-slate-300) 50%,transparent)}}.border-slate-700{border-color:var(--color-slate-700)}.border-slate-700\/50{border-color:#31415880}@supports (color:color-mix(in lab,red,red)){.border-slate-700\/50{border-color:color-mix(in oklab,var(--color-slate-700) 50%,transparent)}}.border-slate-800{border-color:var(--color-slate-800)}.border-slate-800\/10{border-color:#1d293d1a}@supports (color:color-mix(in lab,red,red)){.border-slate-800\/10{border-color:color-mix(in oklab,var(--color-slate-800) 10%,transparent)}}.border-teal-300{border-color:var(--color-teal-300)}.border-teal-300\/60{border-color:#46ecd599}@supports (color:color-mix(in lab,red,red)){.border-teal-300\/60{border-color:color-mix(in oklab,var(--color-teal-300) 60%,transparent)}}.border-transparent{border-color:#0000}.border-violet-100{border-color:var(--color-violet-100)}.border-violet-200\/60{border-color:#ddd6ff99}@supports (color:color-mix(in lab,red,red)){.border-violet-200\/60{border-color:color-mix(in oklab,var(--color-violet-200) 60%,transparent)}}.border-violet-300{border-color:var(--color-violet-300)}.border-violet-800{border-color:var(--color-violet-800)}.border-white{border-color:var(--color-white)}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.border-white\/15{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.border-white\/15{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.border-white\/25{border-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.border-white\/25{border-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.border-white\/30{border-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.border-white\/35{border-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.border-white\/35{border-color:color-mix(in oklab,var(--color-white) 35%,transparent)}}.border-white\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\/40{border-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.border-white\/50{border-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.border-white\/50{border-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.border-white\/80{border-color:#fffc}@supports (color:color-mix(in lab,red,red)){.border-white\/80{border-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.border-white\/90{border-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.border-white\/90{border-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.border-zinc-200{border-color:var(--color-zinc-200)}.border-t-\[\#0ea5e9\]{border-top-color:#0ea5e9}.border-t-\[\#10b981\]{border-top-color:#10b981}.border-t-\[\#9956DE\]{border-top-color:#9956de}.border-t-\[\#a855f7\]{border-top-color:#a855f7}.border-t-slate-800{border-top-color:var(--color-slate-800)}.border-t-transparent{border-top-color:#0000}.border-t-white{border-top-color:var(--color-white)}.border-r-amber-300{border-right-color:var(--color-amber-300)}.border-r-teal-300{border-right-color:var(--color-teal-300)}.border-r-transparent{border-right-color:#0000}.border-b-amber-300{border-bottom-color:var(--color-amber-300)}.border-b-teal-300{border-bottom-color:var(--color-teal-300)}.border-l-\[\#1FA7E1\]{border-left-color:#1fa7e1}.border-l-\[\#6ED1CF\]{border-left-color:#6ed1cf}.border-l-\[\#10b981\]{border-left-color:#10b981}.border-l-\[\#7274ED\]{border-left-color:#7274ed}.border-l-\[\#9956DE\]{border-left-color:#9956de}.border-l-\[\#FFB356\]{border-left-color:#ffb356}.border-l-\[\#a855f7\]{border-left-color:#a855f7}.border-l-\[\#f43f5e\]{border-left-color:#f43f5e}.border-l-amber-400{border-left-color:var(--color-amber-400)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-blue-400{border-left-color:var(--color-blue-400)}.border-l-emerald-400{border-left-color:var(--color-emerald-400)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-rose-400{border-left-color:var(--color-rose-400)}.border-l-rose-500{border-left-color:var(--color-rose-500)}.border-l-transparent{border-left-color:#0000}.\!bg-\[\#6ED1CF\]\/35{background-color:#6ed1cf59!important}.\!bg-\[\#7274ED\]{background-color:#7274ed!important}.bg-\(--color-bg\){background-color:var(--color-bg)}.bg-\[\#0B0F19\]{background-color:#0b0f19}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0ea5e9\]{background-color:#0ea5e9}.bg-\[\#0ea5e9\]\/10{background-color:#0ea5e91a}.bg-\[\#0f1422\]{background-color:#0f1422}.bg-\[\#00a86b\]{background-color:#00a86b}.bg-\[\#1FA7E1\]{background-color:#1fa7e1}.bg-\[\#1FA7E1\]\/10{background-color:#1fa7e11a}.bg-\[\#1FA7E1\]\/80{background-color:#1fa7e1cc}.bg-\[\#1a85a4\]{background-color:#1a85a4}.bg-\[\#1a2030\]{background-color:#1a2030}.bg-\[\#1e293b\]{background-color:#1e293b}.bg-\[\#1e2433\]{background-color:#1e2433}.bg-\[\#1e2433\]\/95{background-color:#1e2433f2}.bg-\[\#1e2536\]{background-color:#1e2536}.bg-\[\#2d1b69\]{background-color:#2d1b69}.bg-\[\#2f3547\]{background-color:#2f3547}.bg-\[\#3b3a82\]{background-color:#3b3a82}.bg-\[\#3b82f6\]{background-color:#3b82f6}.bg-\[\#4f46e5\]{background-color:#4f46e5}.bg-\[\#4f46e5\]\/10{background-color:#4f46e51a}.bg-\[\#6D28D9\]{background-color:#6d28d9}.bg-\[\#6ED1CF\]\/10{background-color:#6ed1cf1a}.bg-\[\#6ED1CF\]\/30{background-color:#6ed1cf4d}.bg-\[\#6F2BAF\]{background-color:#6f2baf}.bg-\[\#7C51A8\]{background-color:#7c51a8}.bg-\[\#7ec16d\]{background-color:#7ec16d}.bg-\[\#8A3FD3\]{background-color:#8a3fd3}.bg-\[\#8A3FD3\]\/5{background-color:#8a3fd30d}.bg-\[\#8A3FD3\]\/10{background-color:#8a3fd31a}.bg-\[\#8B5CF6\]{background-color:#8b5cf6}.bg-\[\#8E1010\]{background-color:#8e1010}.bg-\[\#8b5cf6\]{background-color:#8b5cf6}.bg-\[\#9a67d0\]{background-color:#9a67d0}.bg-\[\#9b51e0\]{background-color:#9b51e0}.bg-\[\#10B981\],.bg-\[\#10b981\]{background-color:#10b981}.bg-\[\#22c55e\]{background-color:#22c55e}.bg-\[\#34d399\]{background-color:#34d399}.bg-\[\#48bca6\]{background-color:#48bca6}.bg-\[\#58B34D\]{background-color:#58b34d}.bg-\[\#62b658\]{background-color:#62b658}.bg-\[\#75D06A\]{background-color:#75d06a}.bg-\[\#75D06A\]\/10{background-color:#75d06a1a}.bg-\[\#75D06A\]\/14{background-color:#75d06a24}.bg-\[\#75D06A\]\/15{background-color:#75d06a26}.bg-\[\#75D06A\]\/22{background-color:#75d06a38}.bg-\[\#75D06A\]\/100{background-color:#75d06a}.bg-\[\#127DA6\]{background-color:#127da6}.bg-\[\#158abf\]{background-color:#158abf}.bg-\[\#161a25\]\/90{background-color:#161a25e6}.bg-\[\#181d27\]{background-color:#181d27}.bg-\[\#533ab6\]{background-color:#533ab6}.bg-\[\#662AA8\]{background-color:#662aa8}.bg-\[\#818cf8\]{background-color:#818cf8}.bg-\[\#2563eb\]{background-color:#2563eb}.bg-\[\#5154E7\]{background-color:#5154e7}.bg-\[\#6366f1\]{background-color:#6366f1}.bg-\[\#7274ED\]{background-color:#7274ed}.bg-\[\#7274ED\]\/10{background-color:#7274ed1a}.bg-\[\#7274ED\]\/80{background-color:#7274edcc}.bg-\[\#7274ED\]\/100{background-color:#7274ed}.bg-\[\#8544c7\]{background-color:#8544c7}.bg-\[\#9956DE\]{background-color:#9956de}.bg-\[\#9956DE\]\/5{background-color:#9956de0d}.bg-\[\#9956DE\]\/10{background-color:#9956de1a}.bg-\[\#9956DE\]\/12{background-color:#9956de1f}.bg-\[\#9956DE\]\/16{background-color:#9956de29}.bg-\[\#9956DE\]\/20{background-color:#9956de33}.bg-\[\#9956DE\]\/30{background-color:#9956de4d}.bg-\[\#9956DE\]\/32{background-color:#9956de52}.bg-\[\#9956DE\]\/80{background-color:#9956decc}.bg-\[\#9956de\]{background-color:#9956de}.bg-\[\#10709b\]{background-color:#10709b}.bg-\[\#42389d\]{background-color:#42389d}.bg-\[\#059669\]{background-color:#059669}.bg-\[\#111827\]{background-color:#111827}.bg-\[\#475569\]{background-color:#475569}.bg-\[\#633299\]{background-color:#633299}.bg-\[\#C62828\]{background-color:#c62828}.bg-\[\#D96C6A\]{background-color:#d96c6a}.bg-\[\#D44747\]{background-color:#d44747}.bg-\[\#DE7949\]{background-color:#de7949}.bg-\[\#E06A6A\]{background-color:#e06a6a}.bg-\[\#F43F5E\]{background-color:#f43f5e}.bg-\[\#F08386\]\/10{background-color:#f083861a}.bg-\[\#F08386\]\/12{background-color:#f083861f}.bg-\[\#F08386\]\/15{background-color:#f0838626}.bg-\[\#F08386\]\/20{background-color:#f0838633}.bg-\[\#F39029\]{background-color:#f39029}.bg-\[\#FB96BB\]{background-color:#fb96bb}.bg-\[\#FE6464\]{background-color:#fe6464}.bg-\[\#FF8B8B\]{background-color:#ff8b8b}.bg-\[\#FF8B8B\]\/10{background-color:#ff8b8b1a}.bg-\[\#FF8B8B\]\/14{background-color:#ff8b8b24}.bg-\[\#FF8B8B\]\/22{background-color:#ff8b8b38}.bg-\[\#FFA23A\]{background-color:#ffa23a}.bg-\[\#FFB356\]{background-color:#ffb356}.bg-\[\#FFB356\]\/10{background-color:#ffb3561a}.bg-\[\#FFB356\]\/16{background-color:#ffb35629}.bg-\[\#FFB356\]\/90{background-color:#ffb356e6}.bg-\[\#a855f7\]{background-color:#a855f7}.bg-\[\#be185d\]{background-color:#be185d}.bg-\[\#d946ef\]{background-color:#d946ef}.bg-\[\#dde3eb\]{background-color:#dde3eb}.bg-\[\#df7b9e\]{background-color:#df7b9e}.bg-\[\#e0e7ff\]{background-color:#e0e7ff}.bg-\[\#e0f4fa\]{background-color:#e0f4fa}.bg-\[\#e2e8f0\]{background-color:#e2e8f0}.bg-\[\#e66a5e\]{background-color:#e66a5e}.bg-\[\#e67070\]{background-color:#e67070}.bg-\[\#e69940\]{background-color:#e69940}.bg-\[\#eb74a6\]{background-color:#eb74a6}.bg-\[\#ecfdf5\]{background-color:#ecfdf5}.bg-\[\#edf1f7\]{background-color:#edf1f7}.bg-\[\#eef2ff\]{background-color:#eef2ff}.bg-\[\#eef2ff\]\/80{background-color:#eef2ffcc}.bg-\[\#ef4444\]{background-color:#ef4444}.bg-\[\#eff6ff\]{background-color:#eff6ff}.bg-\[\#f0fdf4\]{background-color:#f0fdf4}.bg-\[\#f1f5f9\]{background-color:#f1f5f9}.bg-\[\#f3e8ff\]{background-color:#f3e8ff}.bg-\[\#f5f3ff\]{background-color:#f5f3ff}.bg-\[\#f5f3ff\]\/40{background-color:#f5f3ff66}.bg-\[\#f5f3ff\]\/60{background-color:#f5f3ff99}.bg-\[\#f7f9fc\]{background-color:#f7f9fc}.bg-\[\#f8fafc\]{background-color:#f8fafc}.bg-\[\#f8fafc\]\/50{background-color:#f8fafc80}.bg-\[\#f8fafc\]\/80{background-color:#f8fafccc}.bg-\[\#f8faff\]{background-color:#f8faff}.bg-\[\#f8fbff\]{background-color:#f8fbff}.bg-\[\#f43f5e\]{background-color:#f43f5e}.bg-\[\#f59e0b\]{background-color:#f59e0b}.bg-\[\#f97316\]{background-color:#f97316}.bg-\[\#fb7185\]{background-color:#fb7185}.bg-\[\#fbab41\]{background-color:#fbab41}.bg-\[\#fbbf24\]{background-color:#fbbf24}.bg-\[\#fdfdfd\]{background-color:#fdfdfd}.bg-\[\#fee2e2\]{background-color:#fee2e2}.bg-\[\#fff1f2\]{background-color:#fff1f2}.bg-\[\#fff3cd\]{background-color:#fff3cd}.bg-\[\#fff7ed\]{background-color:#fff7ed}.bg-\[\#fffbeb\]{background-color:#fffbeb}.bg-\[color-mix\(in_srgb\,var\(--chart-2\)_14\%\,transparent\)\]{background-color:var(--chart-2)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-2\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-2) 14%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-3\)_14\%\,transparent\)\]{background-color:var(--chart-3)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-3\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-3) 14%,transparent)}}.bg-\[color-mix\(in_srgb\,var\(--chart-4\)_14\%\,transparent\)\]{background-color:var(--chart-4)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_srgb\,var\(--chart-4\)_14\%\,transparent\)\]{background-color:color-mix(in srgb,var(--chart-4) 14%,transparent)}}.bg-accent{background-color:var(--accent)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-50\/20{background-color:#fffbeb33}@supports (color:color-mix(in lab,red,red)){.bg-amber-50\/20{background-color:color-mix(in oklab,var(--color-amber-50) 20%,transparent)}}.bg-amber-50\/30{background-color:#fffbeb4d}@supports (color:color-mix(in lab,red,red)){.bg-amber-50\/30{background-color:color-mix(in oklab,var(--color-amber-50) 30%,transparent)}}.bg-amber-50\/40{background-color:#fffbeb66}@supports (color:color-mix(in lab,red,red)){.bg-amber-50\/40{background-color:color-mix(in oklab,var(--color-amber-50) 40%,transparent)}}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-300\/20{background-color:#ffd23633}@supports (color:color-mix(in lab,red,red)){.bg-amber-300\/20{background-color:color-mix(in oklab,var(--color-amber-300) 20%,transparent)}}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-400\/90{background-color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.bg-amber-400\/90{background-color:color-mix(in oklab,var(--color-amber-400) 90%,transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-amber-600{background-color:var(--color-amber-600)}.bg-background{background-color:var(--background)}.bg-black\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\/0{background-color:color-mix(in oklab,var(--color-black) 0%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.bg-black\/15{background-color:#00000026}@supports (color:color-mix(in lab,red,red)){.bg-black\/15{background-color:color-mix(in oklab,var(--color-black) 15%,transparent)}}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-50\/30{background-color:#eff6ff4d}@supports (color:color-mix(in lab,red,red)){.bg-blue-50\/30{background-color:color-mix(in oklab,var(--color-blue-50) 30%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-100\/40{background-color:#dbeafe66}@supports (color:color-mix(in lab,red,red)){.bg-blue-100\/40{background-color:color-mix(in oklab,var(--color-blue-100) 40%,transparent)}}.bg-blue-300\/40{background-color:#90c5ff66}@supports (color:color-mix(in lab,red,red)){.bg-blue-300\/40{background-color:color-mix(in oklab,var(--color-blue-300) 40%,transparent)}}.bg-blue-400{background-color:var(--color-blue-400)}.bg-blue-400\/30{background-color:#54a2ff4d}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/30{background-color:color-mix(in oklab,var(--color-blue-400) 30%,transparent)}}.bg-blue-400\/40{background-color:#54a2ff66}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/40{background-color:color-mix(in oklab,var(--color-blue-400) 40%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500) 10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500) 20%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--border)}.bg-card,.bg-card\/20{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/20{background-color:color-mix(in oklab,var(--card) 20%,transparent)}}.bg-cyan-400\/30{background-color:#00d2ef4d}@supports (color:color-mix(in lab,red,red)){.bg-cyan-400\/30{background-color:color-mix(in oklab,var(--color-cyan-400) 30%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/10{background-color:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/10{background-color:color-mix(in oklab,var(--color-cyan-500) 10%,transparent)}}.bg-destructive{background-color:var(--destructive)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-50\/20{background-color:#ecfdf533}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/20{background-color:color-mix(in oklab,var(--color-emerald-50) 20%,transparent)}}.bg-emerald-50\/30{background-color:#ecfdf54d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/30{background-color:color-mix(in oklab,var(--color-emerald-50) 30%,transparent)}}.bg-emerald-50\/40{background-color:#ecfdf566}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/40{background-color:color-mix(in oklab,var(--color-emerald-50) 40%,transparent)}}.bg-emerald-50\/50{background-color:#ecfdf580}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/50{background-color:color-mix(in oklab,var(--color-emerald-50) 50%,transparent)}}.bg-emerald-50\/80{background-color:#ecfdf5cc}@supports (color:color-mix(in lab,red,red)){.bg-emerald-50\/80{background-color:color-mix(in oklab,var(--color-emerald-50) 80%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-100\/50{background-color:#d0fae580}@supports (color:color-mix(in lab,red,red)){.bg-emerald-100\/50{background-color:color-mix(in oklab,var(--color-emerald-100) 50%,transparent)}}.bg-emerald-200{background-color:var(--color-emerald-200)}.bg-emerald-200\/50{background-color:#a4f4cf80}@supports (color:color-mix(in lab,red,red)){.bg-emerald-200\/50{background-color:color-mix(in oklab,var(--color-emerald-200) 50%,transparent)}}.bg-emerald-300{background-color:var(--color-emerald-300)}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-500\/30{background-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/30{background-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-foreground{background-color:var(--foreground)}.bg-fuchsia-300\/20{background-color:#f2a9ff33}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-300\/20{background-color:color-mix(in oklab,var(--color-fuchsia-300) 20%,transparent)}}.bg-fuchsia-400\/30{background-color:#ec6cff4d}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-400\/30{background-color:color-mix(in oklab,var(--color-fuchsia-400) 30%,transparent)}}.bg-fuchsia-500{background-color:var(--color-fuchsia-500)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500) 20%,transparent)}}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-50\/50{background-color:#eef2ff80}@supports (color:color-mix(in lab,red,red)){.bg-indigo-50\/50{background-color:color-mix(in oklab,var(--color-indigo-50) 50%,transparent)}}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-100\/50{background-color:#e0e7ff80}@supports (color:color-mix(in lab,red,red)){.bg-indigo-100\/50{background-color:color-mix(in oklab,var(--color-indigo-100) 50%,transparent)}}.bg-indigo-200{background-color:var(--color-indigo-200)}.bg-indigo-300{background-color:var(--color-indigo-300)}.bg-indigo-300\/10{background-color:#a4b3ff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-300\/10{background-color:color-mix(in oklab,var(--color-indigo-300) 10%,transparent)}}.bg-indigo-400{background-color:var(--color-indigo-400)}.bg-indigo-400\/30{background-color:#7d87ff4d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-400\/30{background-color:color-mix(in oklab,var(--color-indigo-400) 30%,transparent)}}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/10{background-color:color-mix(in oklab,var(--color-indigo-500) 10%,transparent)}}.bg-indigo-500\/20{background-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/20{background-color:color-mix(in oklab,var(--color-indigo-500) 20%,transparent)}}.bg-indigo-500\/30{background-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/30{background-color:color-mix(in oklab,var(--color-indigo-500) 30%,transparent)}}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-input-background{background-color:var(--input-background)}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\/30{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/30{background-color:color-mix(in oklab,var(--muted-foreground) 30%,transparent)}}.bg-muted\/20{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/20{background-color:color-mix(in oklab,var(--muted) 20%,transparent)}}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted) 30%,transparent)}}.bg-muted\/40{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,var(--muted) 40%,transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-orange-50{background-color:var(--color-orange-50)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-orange-400{background-color:var(--color-orange-400)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500) 10%,transparent)}}.bg-orange-500\/15{background-color:#fe6e0026}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/15{background-color:color-mix(in oklab,var(--color-orange-500) 15%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-pink-500\/20{background-color:#f6339a33}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/20{background-color:color-mix(in oklab,var(--color-pink-500) 20%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary,.bg-primary\/10{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary) 10%,transparent)}}.bg-primary\/20{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.bg-purple-50{background-color:var(--color-purple-50)}.bg-purple-50\/20{background-color:#faf5ff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/20{background-color:color-mix(in oklab,var(--color-purple-50) 20%,transparent)}}.bg-purple-50\/30{background-color:#faf5ff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/30{background-color:color-mix(in oklab,var(--color-purple-50) 30%,transparent)}}.bg-purple-50\/40{background-color:#faf5ff66}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/40{background-color:color-mix(in oklab,var(--color-purple-50) 40%,transparent)}}.bg-purple-50\/50{background-color:#faf5ff80}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/50{background-color:color-mix(in oklab,var(--color-purple-50) 50%,transparent)}}.bg-purple-50\/80{background-color:#faf5ffcc}@supports (color:color-mix(in lab,red,red)){.bg-purple-50\/80{background-color:color-mix(in oklab,var(--color-purple-50) 80%,transparent)}}.bg-purple-100{background-color:var(--color-purple-100)}.bg-purple-100\/30{background-color:#f3e8ff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-100\/30{background-color:color-mix(in oklab,var(--color-purple-100) 30%,transparent)}}.bg-purple-200\/30{background-color:#e9d5ff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-200\/30{background-color:color-mix(in oklab,var(--color-purple-200) 30%,transparent)}}.bg-purple-300{background-color:var(--color-purple-300)}.bg-purple-300\/10{background-color:#d9b3ff1a}@supports (color:color-mix(in lab,red,red)){.bg-purple-300\/10{background-color:color-mix(in oklab,var(--color-purple-300) 10%,transparent)}}.bg-purple-400{background-color:var(--color-purple-400)}.bg-purple-400\/20{background-color:#c07eff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-400\/20{background-color:color-mix(in oklab,var(--color-purple-400) 20%,transparent)}}.bg-purple-400\/30{background-color:#c07eff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-400\/30{background-color:color-mix(in oklab,var(--color-purple-400) 30%,transparent)}}.bg-purple-500{background-color:var(--color-purple-500)}.bg-purple-500\/10{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/10{background-color:color-mix(in oklab,var(--color-purple-500) 10%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.bg-purple-500\/30{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/30{background-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.bg-purple-600{background-color:var(--color-purple-600)}.bg-purple-900\/20{background-color:#59168b33}@supports (color:color-mix(in lab,red,red)){.bg-purple-900\/20{background-color:color-mix(in oklab,var(--color-purple-900) 20%,transparent)}}.bg-purple-900\/40{background-color:#59168b66}@supports (color:color-mix(in lab,red,red)){.bg-purple-900\/40{background-color:color-mix(in oklab,var(--color-purple-900) 40%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-50\/30{background-color:#fef2f24d}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/30{background-color:color-mix(in oklab,var(--color-red-50) 30%,transparent)}}.bg-red-50\/50{background-color:#fef2f280}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/50{background-color:color-mix(in oklab,var(--color-red-50) 50%,transparent)}}.bg-red-50\/60{background-color:#fef2f299}@supports (color:color-mix(in lab,red,red)){.bg-red-50\/60{background-color:color-mix(in oklab,var(--color-red-50) 60%,transparent)}}.bg-red-100{background-color:var(--color-red-100)}.bg-red-400{background-color:var(--color-red-400)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/80{background-color:#fb2c36cc}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/80{background-color:color-mix(in oklab,var(--color-red-500) 80%,transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-rose-50{background-color:var(--color-rose-50)}.bg-rose-50\/20{background-color:#fff1f233}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/20{background-color:color-mix(in oklab,var(--color-rose-50) 20%,transparent)}}.bg-rose-50\/30{background-color:#fff1f24d}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/30{background-color:color-mix(in oklab,var(--color-rose-50) 30%,transparent)}}.bg-rose-50\/40{background-color:#fff1f266}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/40{background-color:color-mix(in oklab,var(--color-rose-50) 40%,transparent)}}.bg-rose-50\/60{background-color:#fff1f299}@supports (color:color-mix(in lab,red,red)){.bg-rose-50\/60{background-color:color-mix(in oklab,var(--color-rose-50) 60%,transparent)}}.bg-rose-100{background-color:var(--color-rose-100)}.bg-rose-100\/30{background-color:#ffe4e64d}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/30{background-color:color-mix(in oklab,var(--color-rose-100) 30%,transparent)}}.bg-rose-100\/40{background-color:#ffe4e666}@supports (color:color-mix(in lab,red,red)){.bg-rose-100\/40{background-color:color-mix(in oklab,var(--color-rose-100) 40%,transparent)}}.bg-rose-200{background-color:var(--color-rose-200)}.bg-rose-200\/50{background-color:#ffccd380}@supports (color:color-mix(in lab,red,red)){.bg-rose-200\/50{background-color:color-mix(in oklab,var(--color-rose-200) 50%,transparent)}}.bg-rose-200\/60{background-color:#ffccd399}@supports (color:color-mix(in lab,red,red)){.bg-rose-200\/60{background-color:color-mix(in oklab,var(--color-rose-200) 60%,transparent)}}.bg-rose-300{background-color:var(--color-rose-300)}.bg-rose-300\/60{background-color:#ffa2ae99}@supports (color:color-mix(in lab,red,red)){.bg-rose-300\/60{background-color:color-mix(in oklab,var(--color-rose-300) 60%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-rose-500\/5{background-color:#ff23570d}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/5{background-color:color-mix(in oklab,var(--color-rose-500) 5%,transparent)}}.bg-rose-500\/10{background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/10{background-color:color-mix(in oklab,var(--color-rose-500) 10%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.bg-rose-600{background-color:var(--color-rose-600)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-sky-50{background-color:var(--color-violet-50)}.bg-sky-50\/40{background-color:#f5f3ff66}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/40{background-color:color-mix(in oklab,var(--color-violet-50) 40%,transparent)}}.bg-sky-50\/50{background-color:#f5f3ff80}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/50{background-color:color-mix(in oklab,var(--color-violet-50) 50%,transparent)}}.bg-sky-50\/70{background-color:#f5f3ffb3}@supports (color:color-mix(in lab,red,red)){.bg-sky-50\/70{background-color:color-mix(in oklab,var(--color-violet-50) 70%,transparent)}}.bg-sky-100{background-color:var(--color-violet-100)}.bg-sky-100\/40{background-color:#ede9fe66}@supports (color:color-mix(in lab,red,red)){.bg-sky-100\/40{background-color:color-mix(in oklab,var(--color-violet-100) 40%,transparent)}}.bg-sky-200{background-color:var(--color-violet-200)}.bg-sky-300\/10{background-color:#c4b4ff1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-300\/10{background-color:color-mix(in oklab,var(--color-violet-300) 10%,transparent)}}.bg-sky-400{background-color:var(--color-violet-400)}.bg-sky-400\/20{background-color:#a685ff33}@supports (color:color-mix(in lab,red,red)){.bg-sky-400\/20{background-color:color-mix(in oklab,var(--color-violet-400) 20%,transparent)}}.bg-sky-500{background-color:var(--color-violet-500)}.bg-sky-500\/5{background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/5{background-color:color-mix(in oklab,var(--color-violet-500) 5%,transparent)}}.bg-sky-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/10{background-color:color-mix(in oklab,var(--color-violet-500) 10%,transparent)}}.bg-sky-500\/20{background-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/20{background-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.bg-sky-600{background-color:var(--color-violet-600)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\/20{background-color:#f8fafc33}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/20{background-color:color-mix(in oklab,var(--color-slate-50) 20%,transparent)}}.bg-slate-50\/30{background-color:#f8fafc4d}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/30{background-color:color-mix(in oklab,var(--color-slate-50) 30%,transparent)}}.bg-slate-50\/50{background-color:#f8fafc80}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/50{background-color:color-mix(in oklab,var(--color-slate-50) 50%,transparent)}}.bg-slate-50\/60{background-color:#f8fafc99}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/60{background-color:color-mix(in oklab,var(--color-slate-50) 60%,transparent)}}.bg-slate-50\/80{background-color:#f8fafccc}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/80{background-color:color-mix(in oklab,var(--color-slate-50) 80%,transparent)}}.bg-slate-50\/90{background-color:#f8fafce6}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/90{background-color:color-mix(in oklab,var(--color-slate-50) 90%,transparent)}}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-100\/70{background-color:#f1f5f9b3}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/70{background-color:color-mix(in oklab,var(--color-slate-100) 70%,transparent)}}.bg-slate-100\/80{background-color:#f1f5f9cc}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/80{background-color:color-mix(in oklab,var(--color-slate-100) 80%,transparent)}}.bg-slate-100\/90{background-color:#f1f5f9e6}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/90{background-color:color-mix(in oklab,var(--color-slate-100) 90%,transparent)}}.bg-slate-100\/95{background-color:#f1f5f9f2}@supports (color:color-mix(in lab,red,red)){.bg-slate-100\/95{background-color:color-mix(in oklab,var(--color-slate-100) 95%,transparent)}}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-200\/50{background-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.bg-slate-200\/50{background-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.bg-slate-200\/80{background-color:#e2e8f0cc}@supports (color:color-mix(in lab,red,red)){.bg-slate-200\/80{background-color:color-mix(in oklab,var(--color-slate-200) 80%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-300\/60{background-color:#cad5e299}@supports (color:color-mix(in lab,red,red)){.bg-slate-300\/60{background-color:color-mix(in oklab,var(--color-slate-300) 60%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500{background-color:var(--color-slate-500)}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-slate-700{background-color:var(--color-slate-700)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-800\/5{background-color:#1d293d0d}@supports (color:color-mix(in lab,red,red)){.bg-slate-800\/5{background-color:color-mix(in oklab,var(--color-slate-800) 5%,transparent)}}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\/5{background-color:#0f172b0d}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/5{background-color:color-mix(in oklab,var(--color-slate-900) 5%,transparent)}}.bg-slate-900\/10{background-color:#0f172b1a}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/10{background-color:color-mix(in oklab,var(--color-slate-900) 10%,transparent)}}.bg-slate-900\/40{background-color:#0f172b66}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/40{background-color:color-mix(in oklab,var(--color-slate-900) 40%,transparent)}}.bg-slate-900\/50{background-color:#0f172b80}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/50{background-color:color-mix(in oklab,var(--color-slate-900) 50%,transparent)}}.bg-slate-900\/60{background-color:#0f172b99}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/60{background-color:color-mix(in oklab,var(--color-slate-900) 60%,transparent)}}.bg-slate-900\/85{background-color:#0f172bd9}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/85{background-color:color-mix(in oklab,var(--color-slate-900) 85%,transparent)}}.bg-teal-50{background-color:var(--color-teal-50)}.bg-teal-100{background-color:var(--color-teal-100)}.bg-teal-400\/50{background-color:#00d3bd80}@supports (color:color-mix(in lab,red,red)){.bg-teal-400\/50{background-color:color-mix(in oklab,var(--color-teal-400) 50%,transparent)}}.bg-teal-500{background-color:var(--color-teal-500)}.bg-teal-500\/20{background-color:#00baa733}@supports (color:color-mix(in lab,red,red)){.bg-teal-500\/20{background-color:color-mix(in oklab,var(--color-teal-500) 20%,transparent)}}.bg-teal-600{background-color:var(--color-teal-600)}.bg-transparent{background-color:#0000}.bg-violet-50{background-color:var(--color-violet-50)}.bg-violet-100{background-color:var(--color-violet-100)}.bg-violet-500{background-color:var(--color-violet-500)}.bg-violet-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/10{background-color:color-mix(in oklab,var(--color-violet-500) 10%,transparent)}}.bg-violet-600{background-color:var(--color-violet-600)}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.bg-white\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-white\/30{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.bg-white\/30{background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.bg-white\/35{background-color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.bg-white\/35{background-color:color-mix(in oklab,var(--color-white) 35%,transparent)}}.bg-white\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\/40{background-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.bg-white\/50{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.bg-white\/50{background-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.bg-white\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.bg-white\/60{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.bg-white\/70{background-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.bg-white\/70{background-color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-white\/85{background-color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.bg-white\/85{background-color:color-mix(in oklab,var(--color-white) 85%,transparent)}}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-white\/95{background-color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.bg-white\/95{background-color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-zinc-100{background-color:var(--color-zinc-100)}.\!bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab!important;background-image:linear-gradient(var(--tw-gradient-stops))!important}.\!bg-gradient-to-r{--tw-gradient-position:to right in oklab!important;background-image:linear-gradient(var(--tw-gradient-stops))!important}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-l{--tw-gradient-position:to left in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-tr{--tw-gradient-position:to top right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[radial-gradient\(circle_at_14\%_12\%\,rgba\(251\,150\,187\,0\.35\)\,transparent_42\%\)\,radial-gradient\(circle_at_80\%_80\%\,rgba\(117\,208\,106\,0\.25\)\,transparent_38\%\)\]{background-image:radial-gradient(circle at 14% 12%,#fb96bb59,#0000 42%),radial-gradient(circle at 80% 80%,#75d06a40,#0000 38%)}.bg-\[radial-gradient\(circle_at_18\%_8\%\,rgba\(251\,150\,187\,0\.32\)\,transparent_42\%\)\,radial-gradient\(circle_at_85\%_84\%\,rgba\(117\,208\,106\,0\.24\)\,transparent_40\%\)\]{background-image:radial-gradient(circle at 18% 8%,#fb96bb52,#0000 42%),radial-gradient(circle at 85% 84%,#75d06a3d,#0000 40%)}.bg-\[radial-gradient\(circle_at_50\%_100\%\,\#9333ea_0\%\,\#c084fc_40\%\,transparent_80\%\)\]{background-image:radial-gradient(circle at 50% 100%,#9333ea,#c084fc,#0000 80%)}.bg-\[radial-gradient\(circle_at_top_right\,rgba\(153\,86\,222\,0\.08\)\,transparent_45\%\)\,radial-gradient\(circle_at_bottom_left\,rgba\(31\,167\,225\,0\.08\)\,transparent_45\%\)\]{background-image:radial-gradient(circle at 100% 0,#9956de14,#0000 45%),radial-gradient(circle at 0 100%,#1fa7e114,#0000 45%)}.bg-\[radial-gradient\(ellipse_at_50\%_100\%\,\#7e22ce_10\%\,transparent_60\%\)\]{background-image:radial-gradient(at 50% 100%,#7e22ce 10%,#0000 60%)}.bg-\[url\(\'data\:image\/svg\+xml\;base64\,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAiLz4KPHBhdGggZD0iTTAgMEgxdjFIMHoiIGZpbGw9IiM2MzY2ZjEiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPgo8L3N2Zz4\=\'\)\]{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAiLz4KPHBhdGggZD0iTTAgMEgxdjFIMHoiIGZpbGw9IiM2MzY2ZjEiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPgo8L3N2Zz4=)}.bg-\[url\(\'data\:image\/svg\+xml\;base64\,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI\+PC9yZWN0Pgo8L3N2Zz4\=\'\)\]{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSI+PC9yZWN0Pgo8L3N2Zz4=)}.\!from-\[\#6ED1CF\]{--tw-gradient-from:#6ed1cf!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.\!from-emerald-50{--tw-gradient-from:var(--color-emerald-50)!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.from-\[\#0ea5e9\]{--tw-gradient-from:#0ea5e9;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#1FA7E1\]\/10{--tw-gradient-from:oklab(68.7044% -.0807821 -.10979/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#1a85a4\]{--tw-gradient-from:#1a85a4;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#3b3a82\]{--tw-gradient-from:#3b3a82;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#3b82f6\]{--tw-gradient-from:#3b82f6;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#4DB9E9\]{--tw-gradient-from:#4db9e9;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#4f46e5\]{--tw-gradient-from:#4f46e5;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#6ED1CF\]{--tw-gradient-from:#6ed1cf;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#6b7280\]{--tw-gradient-from:#6b7280;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#7ec16d\]{--tw-gradient-from:#7ec16d;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#9a67d0\]{--tw-gradient-from:#9a67d0;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#10b981\]{--tw-gradient-from:#10b981;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#48DA94\]{--tw-gradient-from:#48da94;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#48bca6\]{--tw-gradient-from:#48bca6;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#75D06A\]{--tw-gradient-from:#75d06a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#7274ED\]{--tw-gradient-from:#7274ed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#9956DE\]{--tw-gradient-from:#9956de;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#059669\]{--tw-gradient-from:#059669;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#64748b\]{--tw-gradient-from:#64748b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#B467FF\]{--tw-gradient-from:#b467ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#FF7B88\]{--tw-gradient-from:#ff7b88;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#FFB356\]{--tw-gradient-from:#ffb356;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#a855f7\]{--tw-gradient-from:#a855f7;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#e8f7fc\]{--tw-gradient-from:#e8f7fc;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#e66a5e\]{--tw-gradient-from:#e66a5e;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#eb74a6\]{--tw-gradient-from:#eb74a6;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#ecfdf5\]{--tw-gradient-from:#ecfdf5;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#eef2ff\]{--tw-gradient-from:#eef2ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#ef4444\]{--tw-gradient-from:#ef4444;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#f8fafc\]{--tw-gradient-from:#f8fafc;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#f43f5e\]{--tw-gradient-from:#f43f5e;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#f59e0b\]{--tw-gradient-from:#f59e0b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#f97316\]{--tw-gradient-from:#f97316;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-\[\#fbab41\]{--tw-gradient-from:#fbab41;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-50{--tw-gradient-from:var(--color-amber-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-100{--tw-gradient-from:var(--color-amber-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-300{--tw-gradient-from:var(--color-amber-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-400{--tw-gradient-from:var(--color-amber-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-500{--tw-gradient-from:var(--color-amber-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-500\/10{--tw-gradient-from:#f99c001a}@supports (color:color-mix(in lab,red,red)){.from-amber-500\/10{--tw-gradient-from:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.from-amber-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-500\/20{--tw-gradient-from:#f99c0033}@supports (color:color-mix(in lab,red,red)){.from-amber-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-amber-500) 20%, transparent)}}.from-amber-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-amber-500\/50{--tw-gradient-from:#f99c0080}@supports (color:color-mix(in lab,red,red)){.from-amber-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-amber-500) 50%, transparent)}}.from-amber-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-400{--tw-gradient-from:var(--color-blue-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-50{--tw-gradient-from:var(--color-emerald-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-50\/80{--tw-gradient-from:#ecfdf5cc}@supports (color:color-mix(in lab,red,red)){.from-emerald-50\/80{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-50) 80%, transparent)}}.from-emerald-50\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-100\/90{--tw-gradient-from:#d0fae5e6}@supports (color:color-mix(in lab,red,red)){.from-emerald-100\/90{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-100) 90%, transparent)}}.from-emerald-100\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-400{--tw-gradient-from:var(--color-emerald-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-500{--tw-gradient-from:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-500\/10{--tw-gradient-from:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.from-emerald-500\/10{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.from-emerald-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-500\/50{--tw-gradient-from:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.from-emerald-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-500) 50%, transparent)}}.from-emerald-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-600{--tw-gradient-from:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-green-500{--tw-gradient-from:var(--color-green-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-50{--tw-gradient-from:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-50\/80{--tw-gradient-from:#eef2ffcc}@supports (color:color-mix(in lab,red,red)){.from-indigo-50\/80{--tw-gradient-from:color-mix(in oklab, var(--color-indigo-50) 80%, transparent)}}.from-indigo-50\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-100\/90{--tw-gradient-from:#e0e7ffe6}@supports (color:color-mix(in lab,red,red)){.from-indigo-100\/90{--tw-gradient-from:color-mix(in oklab, var(--color-indigo-100) 90%, transparent)}}.from-indigo-100\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-200{--tw-gradient-from:var(--color-indigo-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500{--tw-gradient-from:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500\/10{--tw-gradient-from:#625fff1a}@supports (color:color-mix(in lab,red,red)){.from-indigo-500\/10{--tw-gradient-from:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.from-indigo-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500\/20{--tw-gradient-from:#625fff33}@supports (color:color-mix(in lab,red,red)){.from-indigo-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-indigo-500) 20%, transparent)}}.from-indigo-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-600{--tw-gradient-from:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-orange-50{--tw-gradient-from:var(--color-orange-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-orange-500{--tw-gradient-from:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-50{--tw-gradient-from:var(--color-purple-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-50\/80{--tw-gradient-from:#faf5ffcc}@supports (color:color-mix(in lab,red,red)){.from-purple-50\/80{--tw-gradient-from:color-mix(in oklab, var(--color-purple-50) 80%, transparent)}}.from-purple-50\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-100\/90{--tw-gradient-from:#f3e8ffe6}@supports (color:color-mix(in lab,red,red)){.from-purple-100\/90{--tw-gradient-from:color-mix(in oklab, var(--color-purple-100) 90%, transparent)}}.from-purple-100\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-400\/20{--tw-gradient-from:#c07eff33}@supports (color:color-mix(in lab,red,red)){.from-purple-400\/20{--tw-gradient-from:color-mix(in oklab, var(--color-purple-400) 20%, transparent)}}.from-purple-400\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-600{--tw-gradient-from:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-50{--tw-gradient-from:var(--color-rose-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-100\/90{--tw-gradient-from:#ffe4e6e6}@supports (color:color-mix(in lab,red,red)){.from-rose-100\/90{--tw-gradient-from:color-mix(in oklab, var(--color-rose-100) 90%, transparent)}}.from-rose-100\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-400{--tw-gradient-from:var(--color-rose-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-500{--tw-gradient-from:var(--color-rose-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-rose-500\/50{--tw-gradient-from:#ff235780}@supports (color:color-mix(in lab,red,red)){.from-rose-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-rose-500) 50%, transparent)}}.from-rose-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-50{--tw-gradient-from:var(--color-violet-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-100{--tw-gradient-from:var(--color-violet-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-400{--tw-gradient-from:var(--color-violet-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-500{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-500\/20{--tw-gradient-from:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.from-sky-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-violet-500) 20%, transparent)}}.from-sky-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-600{--tw-gradient-from:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-sky-700{--tw-gradient-from:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-50{--tw-gradient-from:var(--color-slate-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-50\/30{--tw-gradient-from:#f8fafc4d}@supports (color:color-mix(in lab,red,red)){.from-slate-50\/30{--tw-gradient-from:color-mix(in oklab, var(--color-slate-50) 30%, transparent)}}.from-slate-50\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-100{--tw-gradient-from:var(--color-slate-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-200{--tw-gradient-from:var(--color-slate-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-400{--tw-gradient-from:var(--color-slate-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-800{--tw-gradient-from:var(--color-slate-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500{--tw-gradient-from:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-violet-500{--tw-gradient-from:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-violet-600{--tw-gradient-from:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white{--tw-gradient-from:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white\/0{--tw-gradient-from:#0000}@supports (color:color-mix(in lab,red,red)){.from-white\/0{--tw-gradient-from:color-mix(in oklab, var(--color-white) 0%, transparent)}}.from-white\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white\/20{--tw-gradient-from:#fff3}@supports (color:color-mix(in lab,red,red)){.from-white\/20{--tw-gradient-from:color-mix(in oklab, var(--color-white) 20%, transparent)}}.from-white\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white\/60{--tw-gradient-from:#fff9}@supports (color:color-mix(in lab,red,red)){.from-white\/60{--tw-gradient-from:color-mix(in oklab, var(--color-white) 60%, transparent)}}.from-white\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-\[\#6ED1CF\]{--tw-gradient-via:#6ed1cf;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#75D06A\]{--tw-gradient-via:#75d06a;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#7274ED\]{--tw-gradient-via:#7274ed;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#9956DE\]{--tw-gradient-via:#9956de;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#e2e8f0\]{--tw-gradient-via:#e2e8f0;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#f0fdf4\]{--tw-gradient-via:#f0fdf4;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[\#f5f3ff\]{--tw-gradient-via:#f5f3ff;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-amber-400\/40{--tw-gradient-via:#fcbb0066}@supports (color:color-mix(in lab,red,red)){.via-amber-400\/40{--tw-gradient-via:color-mix(in oklab, var(--color-amber-400) 40%, transparent)}}.via-amber-400\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-amber-500\/10{--tw-gradient-via:#f99c001a}@supports (color:color-mix(in lab,red,red)){.via-amber-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.via-amber-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-cyan-500{--tw-gradient-via:var(--color-cyan-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-cyan-500\/10{--tw-gradient-via:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.via-cyan-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-cyan-500) 10%, transparent)}}.via-cyan-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-emerald-500\/10{--tw-gradient-via:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.via-emerald-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.via-emerald-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-emerald-500\/40{--tw-gradient-via:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.via-emerald-500\/40{--tw-gradient-via:color-mix(in oklab, var(--color-emerald-500) 40%, transparent)}}.via-emerald-500\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-fuchsia-50{--tw-gradient-via:var(--color-fuchsia-50);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-fuchsia-500\/10{--tw-gradient-via:#e12afb1a}@supports (color:color-mix(in lab,red,red)){.via-fuchsia-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-fuchsia-500) 10%, transparent)}}.via-fuchsia-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-50\/80{--tw-gradient-via:#eef2ffcc}@supports (color:color-mix(in lab,red,red)){.via-indigo-50\/80{--tw-gradient-via:color-mix(in oklab, var(--color-indigo-50) 80%, transparent)}}.via-indigo-50\/80{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-500{--tw-gradient-via:var(--color-indigo-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-50{--tw-gradient-via:var(--color-orange-50);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-500{--tw-gradient-via:var(--color-orange-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-500\/5{--tw-gradient-via:#fe6e000d}@supports (color:color-mix(in lab,red,red)){.via-orange-500\/5{--tw-gradient-via:color-mix(in oklab, var(--color-orange-500) 5%, transparent)}}.via-orange-500\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-pink-500{--tw-gradient-via:var(--color-pink-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-pink-600{--tw-gradient-via:var(--color-pink-600);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-purple-500\/5{--tw-gradient-via:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.via-purple-500\/5{--tw-gradient-via:color-mix(in oklab, var(--color-purple-500) 5%, transparent)}}.via-purple-500\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-rose-500\/10{--tw-gradient-via:#ff23571a}@supports (color:color-mix(in lab,red,red)){.via-rose-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-rose-500) 10%, transparent)}}.via-rose-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-rose-500\/40{--tw-gradient-via:#ff235766}@supports (color:color-mix(in lab,red,red)){.via-rose-500\/40{--tw-gradient-via:color-mix(in oklab, var(--color-rose-500) 40%, transparent)}}.via-rose-500\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-50\/30{--tw-gradient-via:#f5f3ff4d}@supports (color:color-mix(in lab,red,red)){.via-sky-50\/30{--tw-gradient-via:color-mix(in oklab, var(--color-violet-50) 30%, transparent)}}.via-sky-50\/30{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-50\/50{--tw-gradient-via:#f5f3ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-50\/50{--tw-gradient-via:color-mix(in oklab, var(--color-violet-50) 50%, transparent)}}.via-sky-50\/50{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/30{--tw-gradient-via:#a685ff4d}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/30{--tw-gradient-via:color-mix(in oklab, var(--color-violet-400) 30%, transparent)}}.via-sky-400\/30{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-400\/50{--tw-gradient-via:#a685ff80}@supports (color:color-mix(in lab,red,red)){.via-sky-400\/50{--tw-gradient-via:color-mix(in oklab, var(--color-violet-400) 50%, transparent)}}.via-sky-400\/50{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-sky-500{--tw-gradient-via:var(--color-violet-500);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-teal-500\/5{--tw-gradient-via:#00baa70d}@supports (color:color-mix(in lab,red,red)){.via-teal-500\/5{--tw-gradient-via:color-mix(in oklab, var(--color-teal-500) 5%, transparent)}}.via-teal-500\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white{--tw-gradient-via:var(--color-white);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/15{--tw-gradient-via:#ffffff26}@supports (color:color-mix(in lab,red,red)){.via-white\/15{--tw-gradient-via:color-mix(in oklab, var(--color-white) 15%, transparent)}}.via-white\/15{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/30{--tw-gradient-via:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.via-white\/30{--tw-gradient-via:color-mix(in oklab, var(--color-white) 30%, transparent)}}.via-white\/30{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/40{--tw-gradient-via:#fff6}@supports (color:color-mix(in lab,red,red)){.via-white\/40{--tw-gradient-via:color-mix(in oklab, var(--color-white) 40%, transparent)}}.via-white\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.\!to-\[\#1FA7E1\]{--tw-gradient-to:#1fa7e1!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.\!to-teal-50{--tw-gradient-to:var(--color-teal-50)!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.to-\[\#1FA7E1\]{--tw-gradient-to:#1fa7e1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#2BBF7B\]{--tw-gradient-to:#2bbf7b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#2DA1D8\]{--tw-gradient-to:#2da1d8;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#4b5563\]{--tw-gradient-to:#4b5563;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#6ED1CF\]{--tw-gradient-to:#6ed1cf;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#6ED1CF\]\/10{--tw-gradient-to:oklab(80.0346% -.0906707 -.0221346/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#7c3aed\]{--tw-gradient-to:#7c3aed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#8a5cc0\]{--tw-gradient-to:#8a5cc0;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#9D44FF\]{--tw-gradient-to:#9d44ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#10b981\]{--tw-gradient-to:#10b981;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#40a794\]{--tw-gradient-to:#40a794;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#71ad62\]{--tw-gradient-to:#71ad62;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#75D06A\]{--tw-gradient-to:#75d06a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#126b84\]{--tw-gradient-to:#126b84;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#0284c7\]{--tw-gradient-to:#0284c7;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#2563eb\]{--tw-gradient-to:#2563eb;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#7274ED\]{--tw-gradient-to:#7274ed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#9333ea\]{--tw-gradient-to:#9333ea;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#9956DE\]{--tw-gradient-to:#9956de;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#059669\]{--tw-gradient-to:#059669;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#475569\]{--tw-gradient-to:#475569;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#FF5C70\]{--tw-gradient-to:#ff5c70;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#FF8B8B\]{--tw-gradient-to:#ff8b8b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#FF8C00\]{--tw-gradient-to:#ff8c00;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#FFB356\]{--tw-gradient-to:#ffb356;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#ce5e53\]{--tw-gradient-to:#ce5e53;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#d46895\]{--tw-gradient-to:#d46895;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#d97706\]{--tw-gradient-to:#d97706;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#dc2626\]{--tw-gradient-to:#dc2626;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#e11d48\]{--tw-gradient-to:#e11d48;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#e0983a\]{--tw-gradient-to:#e0983a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#ea580c\]{--tw-gradient-to:#ea580c;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#eef2ff\]{--tw-gradient-to:#eef2ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#f0fbff\]{--tw-gradient-to:#f0fbff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#f1f5f9\]{--tw-gradient-to:#f1f5f9;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#f7fdf9\]{--tw-gradient-to:#f7fdf9;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#faf5ff\]{--tw-gradient-to:#faf5ff;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-\[\#fff7ed\]{--tw-gradient-to:#fff7ed;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-amber-50{--tw-gradient-to:var(--color-amber-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-amber-500{--tw-gradient-to:var(--color-amber-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-blue-600{--tw-gradient-to:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-100{--tw-gradient-to:var(--color-cyan-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-500{--tw-gradient-to:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-100\/30{--tw-gradient-to:#d0fae54d}@supports (color:color-mix(in lab,red,red)){.to-emerald-100\/30{--tw-gradient-to:color-mix(in oklab, var(--color-emerald-100) 30%, transparent)}}.to-emerald-100\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-200{--tw-gradient-to:var(--color-emerald-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-600{--tw-gradient-to:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-800{--tw-gradient-to:var(--color-emerald-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-fuchsia-500{--tw-gradient-to:var(--color-fuchsia-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50{--tw-gradient-to:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50\/30{--tw-gradient-to:#eef2ff4d}@supports (color:color-mix(in lab,red,red)){.to-indigo-50\/30{--tw-gradient-to:color-mix(in oklab, var(--color-indigo-50) 30%, transparent)}}.to-indigo-50\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50\/50{--tw-gradient-to:#eef2ff80}@supports (color:color-mix(in lab,red,red)){.to-indigo-50\/50{--tw-gradient-to:color-mix(in oklab, var(--color-indigo-50) 50%, transparent)}}.to-indigo-50\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50\/80{--tw-gradient-to:#eef2ffcc}@supports (color:color-mix(in lab,red,red)){.to-indigo-50\/80{--tw-gradient-to:color-mix(in oklab, var(--color-indigo-50) 80%, transparent)}}.to-indigo-50\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-200{--tw-gradient-to:var(--color-indigo-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-400{--tw-gradient-to:var(--color-indigo-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-500{--tw-gradient-to:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-600{--tw-gradient-to:var(--color-indigo-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-700{--tw-gradient-to:var(--color-indigo-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-800{--tw-gradient-to:var(--color-indigo-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-50{--tw-gradient-to:var(--color-orange-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-100{--tw-gradient-to:var(--color-orange-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-400{--tw-gradient-to:var(--color-orange-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-500{--tw-gradient-to:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-600{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-400\/20{--tw-gradient-to:#fb64b633}@supports (color:color-mix(in lab,red,red)){.to-pink-400\/20{--tw-gradient-to:color-mix(in oklab, var(--color-pink-400) 20%, transparent)}}.to-pink-400\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-50{--tw-gradient-to:var(--color-purple-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-50\/20{--tw-gradient-to:#faf5ff33}@supports (color:color-mix(in lab,red,red)){.to-purple-50\/20{--tw-gradient-to:color-mix(in oklab, var(--color-purple-50) 20%, transparent)}}.to-purple-50\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-50\/60{--tw-gradient-to:#faf5ff99}@supports (color:color-mix(in lab,red,red)){.to-purple-50\/60{--tw-gradient-to:color-mix(in oklab, var(--color-purple-50) 60%, transparent)}}.to-purple-50\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500{--tw-gradient-to:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500\/20{--tw-gradient-to:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/20{--tw-gradient-to:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.to-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600\/5{--tw-gradient-to:#9810fa0d}@supports (color:color-mix(in lab,red,red)){.to-purple-600\/5{--tw-gradient-to:color-mix(in oklab, var(--color-purple-600) 5%, transparent)}}.to-purple-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-red-500{--tw-gradient-to:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-rose-500{--tw-gradient-to:var(--color-rose-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-rose-600{--tw-gradient-to:var(--color-rose-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-400{--tw-gradient-to:var(--color-violet-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-500{--tw-gradient-to:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-600{--tw-gradient-to:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-600\/5{--tw-gradient-to:#7f22fe0d}@supports (color:color-mix(in lab,red,red)){.to-sky-600\/5{--tw-gradient-to:color-mix(in oklab, var(--color-violet-600) 5%, transparent)}}.to-sky-600\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-800{--tw-gradient-to:var(--color-violet-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-50{--tw-gradient-to:var(--color-slate-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-100{--tw-gradient-to:var(--color-slate-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-300{--tw-gradient-to:var(--color-slate-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-600{--tw-gradient-to:var(--color-slate-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-900{--tw-gradient-to:var(--color-slate-900);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-50{--tw-gradient-to:var(--color-teal-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-300{--tw-gradient-to:var(--color-teal-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-500{--tw-gradient-to:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-600{--tw-gradient-to:var(--color-teal-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-violet-700{--tw-gradient-to:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-violet-800{--tw-gradient-to:var(--color-violet-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/0{--tw-gradient-to:#0000}@supports (color:color-mix(in lab,red,red)){.to-white\/0{--tw-gradient-to:color-mix(in oklab, var(--color-white) 0%, transparent)}}.to-white\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/20{--tw-gradient-to:#fff3}@supports (color:color-mix(in lab,red,red)){.to-white\/20{--tw-gradient-to:color-mix(in oklab, var(--color-white) 20%, transparent)}}.to-white\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/80{--tw-gradient-to:#fffc}@supports (color:color-mix(in lab,red,red)){.to-white\/80{--tw-gradient-to:color-mix(in oklab, var(--color-white) 80%, transparent)}}.to-white\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/90{--tw-gradient-to:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.to-white\/90{--tw-gradient-to:color-mix(in oklab, var(--color-white) 90%, transparent)}}.to-white\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.\[background-size\:var\(--beam-size\)_var\(--beam-size\)\]{background-size:var(--beam-size) var(--beam-size)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.fill-\[\#1e293b\]{fill:#1e293b}.fill-\[\#4f46e5\]{fill:#4f46e5}.fill-\[\#64748b\]{fill:#64748b}.fill-\[\#475569\]{fill:#475569}.fill-amber-300{fill:var(--color-amber-300)}.fill-blue-500{fill:var(--color-blue-500)}.fill-current{fill:currentColor}.fill-emerald-600{fill:var(--color-emerald-600)}.fill-primary{fill:var(--primary)}.fill-purple-600{fill:var(--color-purple-600)}.fill-white{fill:var(--color-white)}.fill-yellow-300{fill:var(--color-yellow-300)}.fill-yellow-400{fill:var(--color-yellow-400)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.object-bottom{object-position:bottom}.p-0{padding:calc(var(--spacing) * 0)}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.p-8{padding:calc(var(--spacing) * 8)}.p-12{padding:calc(var(--spacing) * 12)}.p-16{padding:calc(var(--spacing) * 16)}.p-\[1px\]{padding:1px}.p-\[2px_0_4px\]{padding:2px 0 4px}.p-\[3px\]{padding:3px}.p-\[10px\]{padding:10px}.p-\[10px_16px_8px\]{padding:10px 16px 8px}.p-\[12px\]{padding:12px}.p-\[12px_13px\]{padding:12px 13px}.p-\[12px_16px_0\]{padding:12px 16px 0}.p-\[14px\]{padding:14px}.p-\[14px_16px\]{padding:14px 16px}.p-\[16px\]{padding:16px}.p-\[18px\]{padding:18px}.p-\[18px_20px\]{padding:18px 20px}.p-\[20px\]{padding:20px}.p-\[22px_16px_10px\]{padding:22px 16px 10px}.p-\[24px\]{padding:24px}.p-px{padding:1px}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-10{padding-inline:calc(var(--spacing) * 10)}.px-12{padding-inline:calc(var(--spacing) * 12)}.px-\[5px\]{padding-inline:5px}.px-\[6px\]{padding-inline:6px}.px-\[8px\]{padding-inline:8px}.px-\[9px\]{padding-inline:9px}.px-\[10px\]{padding-inline:10px}.px-\[15px\]{padding-inline:15px}.px-\[16px\]{padding-inline:16px}.px-\[18px\]{padding-inline:18px}.px-\[22px\]{padding-inline:22px}.px-\[24px\]{padding-inline:24px}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.py-32{padding-block:calc(var(--spacing) * 32)}.py-\[2px\]{padding-block:2px}.py-\[3px\]{padding-block:3px}.py-\[6px\]{padding-block:6px}.py-\[7px\]{padding-block:7px}.py-\[24px\]{padding-block:24px}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pt-\[12px\]{padding-top:12px}.pt-\[24px\]{padding-top:24px}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-11{padding-right:calc(var(--spacing) * 11)}.pr-20{padding-right:calc(var(--spacing) * 20)}.pr-\[60px\]{padding-right:60px}.pr-\[150px\]{padding-right:150px}.pr-\[155px\]{padding-right:155px}.pb-0{padding-bottom:calc(var(--spacing) * 0)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.pb-28{padding-bottom:calc(var(--spacing) * 28)}.pb-32{padding-bottom:calc(var(--spacing) * 32)}.pb-\[9px\]{padding-bottom:9px}.pb-\[10px\]{padding-bottom:10px}.pb-\[16px\]{padding-bottom:16px}.pb-\[32px\]{padding-bottom:32px}.pl-1{padding-left:calc(var(--spacing) * 1)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.pl-10{padding-left:calc(var(--spacing) * 10)}.pl-11{padding-left:calc(var(--spacing) * 11)}.pl-\[16px\]{padding-left:16px}.pl-\[18px\]{padding-left:18px}.pl-\[32px\]{padding-left:32px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.7rem\]{font-size:.7rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[0\.65rem\]{font-size:.65rem}.text-\[0\.75rem\]{font-size:.75rem}.text-\[0\.85em\]{font-size:.85em}.text-\[0\.95rem\]{font-size:.95rem}.text-\[1\.05rem\]{font-size:1.05rem}.text-\[1rem\]{font-size:1rem}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13\.5px\]{font-size:13.5px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[26px\]{font-size:26px}.text-\[28px\]{font-size:28px}.text-\[32px\]{font-size:32px}.text-\[36px\]{font-size:36px}.text-\[38px\]{font-size:38px}.text-\[40px\]{font-size:40px}.text-\[50px\]{font-size:50px}.text-\[60px\]{font-size:60px}.text-\[80px\]{font-size:80px}.text-\[140px\]{font-size:140px}.leading-\[1\.1\]{--tw-leading:1.1;line-height:1.1}.leading-\[1\.4\]{--tw-leading:1.4;line-height:1.4}.leading-\[1\.8\]{--tw-leading:1.8;line-height:1.8}.leading-\[1\.15\]{--tw-leading:1.15;line-height:1.15}.leading-\[1\.55\]{--tw-leading:1.55;line-height:1.55}.leading-\[1\.75\]{--tw-leading:1.75;line-height:1.75}.leading-\[1\.85\]{--tw-leading:1.85;line-height:1.85}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[0\.1em\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.3px\]{--tw-tracking:.3px;letter-spacing:.3px}.tracking-\[0\.12em\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.15em\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-\[0\.25em\]{--tw-tracking:.25em;letter-spacing:.25em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking:var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-\[\#1FA7E1\]{color:#1fa7e1!important}.\!text-white{color:var(--color-white)!important}.text-\[\#0a1628\]{color:#0a1628}.text-\[\#0ea5e9\]{color:#0ea5e9}.text-\[\#1E293B\]{color:#1e293b}.text-\[\#1FA7E1\]{color:#1fa7e1}.text-\[\#1a85a4\]{color:#1a85a4}.text-\[\#1e1b4b\]{color:#1e1b4b}.text-\[\#1e293b\]{color:#1e293b}.text-\[\#2E7D32\]{color:#2e7d32}.text-\[\#2e2b5e\]{color:#2e2b5e}.text-\[\#3E8538\]{color:#3e8538}.text-\[\#3b82f6\]{color:#3b82f6}.text-\[\#3c4043\]{color:#3c4043}.text-\[\#4D9F46\]{color:#4d9f46}.text-\[\#4f46e5\]{color:#4f46e5}.text-\[\#5E3388\]\/80{color:#5e3388cc}.text-\[\#5a6578\]{color:#5a6578}.text-\[\#5f6368\]{color:#5f6368}.text-\[\#6ED1CF\]{color:#6ed1cf}.text-\[\#6c47ff\]{color:#6c47ff}.text-\[\#6d28d9\]{color:#6d28d9}.text-\[\#7A44B3\]{color:#7a44b3}.text-\[\#7C3AED\]{color:#7c3aed}.text-\[\#7ec16d\]{color:#7ec16d}.text-\[\#8A1A1A\]{color:#8a1a1a}.text-\[\#8A3FD3\]{color:#8a3fd3}.text-\[\#8a7fbc\]{color:#8a7fbc}.text-\[\#8b5cf6\]{color:#8b5cf6}.text-\[\#9b51e0\]{color:#9b51e0}.text-\[\#10b981\]{color:#10b981}.text-\[\#22c55e\]{color:#22c55e}.text-\[\#065f46\]{color:#065f46}.text-\[\#75D06A\]{color:#75d06a}.text-\[\#94a3b8\]{color:#94a3b8}.text-\[\#818cf8\]{color:#818cf8}.text-\[\#2563eb\]{color:#2563eb}.text-\[\#6366f1\]{color:#6366f1}.text-\[\#6620a2\]{color:#6620a2}.text-\[\#7274ED\]{color:#7274ed}.text-\[\#9333ea\]{color:#9333ea}.text-\[\#9956DE\]{color:#9956de}.text-\[\#36326e\]{color:#36326e}.text-\[\#64748b\]{color:#64748b}.text-\[\#92400e\]{color:#92400e}.text-\[\#202124\]{color:#202124}.text-\[\#334155\]{color:#334155}.text-\[\#475569\]{color:#475569}.text-\[\#A56D29\]{color:#a56d29}.text-\[\#A74B50\]{color:#a74b50}.text-\[\#C65E63\]{color:#c65e63}.text-\[\#CC8A37\]{color:#cc8a37}.text-\[\#D66A6A\]{color:#d66a6a}.text-\[\#EAFBFF\]{color:#eafbff}.text-\[\#F08386\]{color:#f08386}.text-\[\#FF8B8B\]{color:#ff8b8b}.text-\[\#FFB356\]{color:#ffb356}.text-\[\#a0aec0\]{color:#a0aec0}.text-\[\#a3b1ee\]{color:#a3b1ee}.text-\[\#a8a5b3\]{color:#a8a5b3}.text-\[\#a855f7\]{color:#a855f7}.text-\[\#b91c1c\]{color:#b91c1c}.text-\[\#b45309\]{color:#b45309}.text-\[\#c4b5fd\]{color:#c4b5fd}.text-\[\#cbd5e1\]{color:#cbd5e1}.text-\[\#d1abff\]{color:#d1abff}.text-\[\#d1cec6\]{color:#d1cec6}.text-\[\#dde3eb\]{color:#dde3eb}.text-\[\#e66a5e\]{color:#e66a5e}.text-\[\#f8fafc\]{color:#f8fafc}.text-\[\#f43f5e\]{color:#f43f5e}.text-\[\#f97316\]{color:#f97316}.text-\[\#fcd34d\]{color:#fcd34d}.text-\[var\(--chart-2\)\]{color:var(--chart-2)}.text-\[var\(--chart-3\)\]{color:var(--chart-3)}.text-\[var\(--chart-4\)\]{color:var(--chart-4)}.text-\[var\(--primary\)\]{color:var(--primary)}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-100\/90{color:#fef3c6e6}@supports (color:color-mix(in lab,red,red)){.text-amber-100\/90{color:color-mix(in oklab,var(--color-amber-100) 90%,transparent)}}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-600\/80{color:#dd7400cc}@supports (color:color-mix(in lab,red,red)){.text-amber-600\/80{color:color-mix(in oklab,var(--color-amber-600) 80%,transparent)}}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-amber-900\/80{color:#7b3306cc}@supports (color:color-mix(in lab,red,red)){.text-amber-900\/80{color:color-mix(in oklab,var(--color-amber-900) 80%,transparent)}}.text-amber-900\/85{color:#7b3306d9}@supports (color:color-mix(in lab,red,red)){.text-amber-900\/85{color:color-mix(in oklab,var(--color-amber-900) 85%,transparent)}}.text-black{color:var(--color-black)}.text-black\/25{color:#00000040}@supports (color:color-mix(in lab,red,red)){.text-black\/25{color:color-mix(in oklab,var(--color-black) 25%,transparent)}}.text-blue-200{color:var(--color-blue-200)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-cyan-100{color:var(--color-cyan-100)}.text-cyan-200{color:var(--color-cyan-200)}.text-cyan-500{color:var(--color-cyan-500)}.text-destructive{color:var(--destructive)}.text-emerald-100{color:var(--color-emerald-100)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-500\/70{color:#00bb7fb3}@supports (color:color-mix(in lab,red,red)){.text-emerald-500\/70{color:color-mix(in oklab,var(--color-emerald-500) 70%,transparent)}}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-600\/80{color:#009767cc}@supports (color:color-mix(in lab,red,red)){.text-emerald-600\/80{color:color-mix(in oklab,var(--color-emerald-600) 80%,transparent)}}.text-emerald-700{color:var(--color-emerald-700)}.text-emerald-800{color:var(--color-emerald-800)}.text-emerald-900{color:var(--color-emerald-900)}.text-emerald-950{color:var(--color-emerald-950)}.text-foreground{color:var(--foreground)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-200{color:var(--color-indigo-200)}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-400{color:var(--color-indigo-400)}.text-indigo-500{color:var(--color-indigo-500)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-indigo-800{color:var(--color-indigo-800)}.text-indigo-900{color:var(--color-indigo-900)}.text-muted-foreground,.text-muted-foreground\/40{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/40{color:color-mix(in oklab,var(--muted-foreground) 40%,transparent)}}.text-muted-foreground\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,var(--muted-foreground) 60%,transparent)}}.text-orange-300{color:var(--color-orange-300)}.text-orange-400{color:var(--color-orange-400)}.text-orange-500{color:var(--color-orange-500)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-pink-500{color:var(--color-pink-500)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-purple-200{color:var(--color-purple-200)}.text-purple-300{color:var(--color-purple-300)}.text-purple-400{color:var(--color-purple-400)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-600\/80{color:#9810facc}@supports (color:color-mix(in lab,red,red)){.text-purple-600\/80{color:color-mix(in oklab,var(--color-purple-600) 80%,transparent)}}.text-purple-700{color:var(--color-purple-700)}.text-purple-800{color:var(--color-purple-800)}.text-purple-900{color:var(--color-purple-900)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-rose-100{color:var(--color-rose-100)}.text-rose-200{color:var(--color-rose-200)}.text-rose-300{color:var(--color-rose-300)}.text-rose-400{color:var(--color-rose-400)}.text-rose-500{color:var(--color-rose-500)}.text-rose-600{color:var(--color-rose-600)}.text-rose-700{color:var(--color-rose-700)}.text-rose-800{color:var(--color-rose-800)}.text-rose-900{color:var(--color-rose-900)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground) 70%,transparent)}}.text-sky-100{color:var(--color-violet-100)}.text-sky-200{color:var(--color-violet-200)}.text-sky-300{color:var(--color-violet-300)}.text-sky-400{color:var(--color-violet-400)}.text-sky-500{color:var(--color-violet-500)}.text-sky-600{color:var(--color-violet-600)}.text-sky-600\/80{color:#7f22fecc}@supports (color:color-mix(in lab,red,red)){.text-sky-600\/80{color:color-mix(in oklab,var(--color-violet-600) 80%,transparent)}}.text-sky-700{color:var(--color-violet-700)}.text-sky-800{color:var(--color-violet-800)}.text-sky-900{color:var(--color-violet-900)}.text-slate-100{color:var(--color-slate-100)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-500\/60{color:#62748e99}@supports (color:color-mix(in lab,red,red)){.text-slate-500\/60{color:color-mix(in oklab,var(--color-slate-500) 60%,transparent)}}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-teal-400{color:var(--color-teal-400)}.text-teal-500{color:var(--color-teal-500)}.text-teal-600{color:var(--color-teal-600)}.text-teal-700{color:var(--color-teal-700)}.text-teal-900{color:var(--color-teal-900)}.text-transparent{color:#0000}.text-violet-300{color:var(--color-violet-300)}.text-violet-400{color:var(--color-violet-400)}.text-violet-500{color:var(--color-violet-500)}.text-violet-600{color:var(--color-violet-600)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.text-white\/5{color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.text-white\/5{color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.text-white\/10{color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.text-white\/10{color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.text-white\/20{color:#fff3}@supports (color:color-mix(in lab,red,red)){.text-white\/20{color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.text-white\/25{color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.text-white\/25{color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.text-white\/30{color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.text-white\/65{color:#ffffffa6}@supports (color:color-mix(in lab,red,red)){.text-white\/65{color:color-mix(in oklab,var(--color-white) 65%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.text-white\/85{color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.text-white\/85{color:color-mix(in oklab,var(--color-white) 85%,transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\/90{color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.text-yellow-300{color:var(--color-yellow-300)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-800{color:var(--color-yellow-800)}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-slate-400{-webkit-text-decoration-color:var(--color-slate-400);text-decoration-color:var(--color-slate-400)}.underline-offset-4{text-underline-offset:4px}.accent-violet-500{accent-color:var(--color-violet-500)}.opacity-0{opacity:0}.opacity-5{opacity:.05}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-100{opacity:1}.opacity-\[0\.2\]{opacity:.2}.opacity-\[0\.03\]{opacity:.03}.opacity-\[0\.06\]{opacity:.06}.opacity-\[0\.15\]{opacity:.15}.mix-blend-multiply{mix-blend-mode:multiply}.mix-blend-overlay{mix-blend-mode:overlay}.mix-blend-screen{mix-blend-mode:screen}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[-4px_0_24px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:-4px 0 24px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[-8px_0_40px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:-8px 0 40px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-4px_12px_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow:0 -4px 12px var(--tw-shadow-color,#00000008);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-8px_30px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow:0 -8px 30px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-10px_40px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 -10px 40px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-12px_0_0_\#f8fafc\]{--tw-shadow:0 -12px 0 0 var(--tw-shadow-color,#f8fafc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_-15px_40px_rgba\(0\,0\,0\,0\.1\)\,inset_0_2px_15px_rgba\(255\,255\,255\,0\.7\)\,inset_0_1px_1px_rgba\(255\,255\,255\,1\)\]{--tw-shadow:0 -15px 40px var(--tw-shadow-color,#0000001a), inset 0 2px 15px var(--tw-shadow-color,#ffffffb3), inset 0 1px 1px var(--tw-shadow-color,#fff);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_2px_rgba\(251\,113\,133\,0\.45\)\,0_6px_0_rgba\(127\,29\,29\,1\)\]{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#fb718573), 0 6px 0 var(--tw-shadow-color,#7f1d1d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_3px_\#c7d2fe\]{--tw-shadow:0 0 0 3px var(--tw-shadow-color,#c7d2fe);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_4px_rgba\(168\,85\,247\,0\.6\)\]{--tw-shadow:0 0 4px var(--tw-shadow-color,#a855f799);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_4px_rgba\(244\,63\,94\,0\.6\)\]{--tw-shadow:0 0 4px var(--tw-shadow-color,#f43f5e99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(168\,85\,247\,0\.8\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#a855f7cc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(244\,63\,94\,0\.8\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#f43f5ecc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(245\,158\,11\,0\.8\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#f59e0bcc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(255\,255\,255\,0\.7\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#ffffffb3);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(129\,140\,248\,0\.8\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#818cf8cc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(165\,180\,252\,0\.8\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#a5b4fccc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(244\,63\,94\,0\.6\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f43f5e99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(255\,255\,255\,0\.8\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#fffc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_white\]{--tw-shadow:0 0 8px var(--tw-shadow-color,white);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(16\,185\,129\,0\.15\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#10b98126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(250\,204\,21\,0\.6\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#facc1599);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(251\,146\,60\,0\.5\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#fb923c80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(251\,191\,36\,0\.5\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#fbbf2480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(251\,191\,36\,0\.6\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#fbbf2499);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(251\,191\,36\,0\.8\)\]{--tw-shadow:0 0 10px var(--tw-shadow-color,#fbbf24cc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(153\,86\,222\,0\.6\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#9956de99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(192\,132\,252\,0\.9\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#c084fce6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_14px_rgba\(16\,185\,129\,0\.25\)\]{--tw-shadow:0 0 14px var(--tw-shadow-color,#10b98140);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_14px_rgba\(148\,163\,184\,0\.2\)\]{--tw-shadow:0 0 14px var(--tw-shadow-color,#94a3b833);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(16\,185\,129\,0\.2\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#10b98133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(16\,185\,129\,0\.15\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#10b98126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(52\,211\,153\,0\.8\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#34d399cc);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(99\,102\,241\,0\.15\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#6366f126);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(244\,63\,94\,0\.15\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#f43f5e26);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(245\,158\,11\,0\.15\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#f59e0b26);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_15px_rgba\(251\,191\,36\,0\.25\)\]{--tw-shadow:0 0 15px var(--tw-shadow-color,#fbbf2440);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_rgba\(249\,115\,22\,0\.3\)\]{--tw-shadow:0 0 16px var(--tw-shadow-color,#f973164d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(251\,191\,36\,0\.35\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#fbbf2459);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(255\,139\,139\,0\.6\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#ff8b8b99);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_18px_rgba\(255\,179\,86\,0\.6\)\]{--tw-shadow:0 0 18px var(--tw-shadow-color,#ffb35699);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_20px_rgba\(245\,158\,11\,0\.15\)\]{--tw-shadow:0 0 20px var(--tw-shadow-color,#f59e0b26);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_20px_rgba\(251\,191\,36\,0\.3\)\]{--tw-shadow:0 0 20px var(--tw-shadow-color,#fbbf244d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_24px_rgba\(250\,204\,21\,0\.6\)\]{--tw-shadow:0 0 24px var(--tw-shadow-color,#facc1599);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(31\,167\,225\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#1fa7e133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_40px_-10px_rgba\(138\,63\,211\,0\.2\)\]{--tw-shadow:0 0 40px -10px var(--tw-shadow-color,#8a3fd333);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_50px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 0 50px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_2px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(168\,85\,247\,0\.1\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,#a855f71a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:0 1px 4px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 1px 4px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(79\,70\,229\,0\.13\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#4f46e521);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_8px_rgba\(168\,85\,247\,0\.15\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#a855f726);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_15px_-3px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:0 2px 15px -3px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_8px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 4px 8px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(5\,150\,105\,0\.3\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#0596694d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(14\,165\,233\,0\.3\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#0ea5e94d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(16\,185\,129\,0\.3\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#10b9814d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_10px_rgba\(139\,92\,246\,0\.3\)\]{--tw-shadow:0 4px 10px var(--tw-shadow-color,#8b5cf64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(14\,165\,233\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#0ea5e933);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(16\,185\,129\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#10b98133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(59\,130\,246\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#3b82f633);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(79\,70\,229\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#4f46e54d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(100\,116\,139\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#64748b33);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(100\,116\,139\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#64748b4d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(168\,85\,247\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#a855f733);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(168\,85\,247\,0\.12\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#a855f71f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(244\,63\,94\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#f43f5e33);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(244\,63\,94\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#f43f5e4d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(245\,158\,11\,0\.3\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#f59e0b4d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_12px_rgba\(249\,115\,22\,0\.2\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#f9731633);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_15px_rgba\(43\,191\,123\,0\.4\)\,inset_0_1px_1px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:0 4px 15px var(--tw-shadow-color,#2bbf7b66), inset 0 1px 1px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_15px_rgba\(45\,161\,216\,0\.4\)\,inset_0_1px_1px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:0 4px 15px var(--tw-shadow-color,#2da1d866), inset 0 1px 1px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_15px_rgba\(157\,68\,255\,0\.4\)\,inset_0_1px_1px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:0 4px 15px var(--tw-shadow-color,#9d44ff66), inset 0 1px 1px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_15px_rgba\(255\,92\,112\,0\.4\)\,inset_0_1px_1px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:0 4px 15px var(--tw-shadow-color,#ff5c7066), inset 0 1px 1px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#00000008);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(14\,165\,233\,0\.13\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#0ea5e921);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(16\,185\,129\,0\.08\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#10b98114);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(16\,185\,129\,0\.13\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#10b98121);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(168\,85\,247\,0\.13\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#a855f721);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(168\,85\,247\,0\.15\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#a855f726);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(249\,115\,22\,0\.13\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#f9731621);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_20px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:0 4px 20px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_4px_24px_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow:0 4px 24px var(--tw-shadow-color,#00000008);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_5px_12px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 5px 12px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_0_rgba\(5\,150\,105\,1\)\]{--tw-shadow:0 6px 0 var(--tw-shadow-color,#059669);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_0_rgba\(15\,20\,30\,0\.5\)\]{--tw-shadow:0 6px 0 var(--tw-shadow-color,#0f141e80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_0_rgba\(79\,70\,229\,1\)\]{--tw-shadow:0 6px 0 var(--tw-shadow-color,#4f46e5);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_6px_0_rgba\(225\,29\,72\,1\)\]{--tw-shadow:0 6px 0 var(--tw-shadow-color,#e11d48);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(16\,185\,129\,0\.2\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#10b98133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(16\,185\,129\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#10b98140);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(59\,130\,246\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#3b82f640);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(168\,85\,247\,0\.12\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#a855f71f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(168\,85\,247\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#a855f740);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(244\,63\,94\,0\.2\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#f43f5e33);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(244\,63\,94\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#f43f5e40);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_16px_rgba\(245\,158\,11\,0\.25\)\]{--tw-shadow:0 8px 16px var(--tw-shadow-color,#f59e0b40);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_20px_-8px_rgba\(79\,70\,229\,0\.5\)\]{--tw-shadow:0 8px 20px -8px var(--tw-shadow-color,#4f46e580);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_24px_-10px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:0 8px 24px -10px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.12\)\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_-12px_rgba\(0\,0\,0\,0\.06\)\]{--tw-shadow:0 8px 30px -12px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgb\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(31\,167\,225\,0\.2\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#1fa7e133);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(59\,58\,130\,0\.3\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#3b3a824d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_30px_rgba\(138\,63\,211\,0\.2\)\]{--tw-shadow:0 8px 30px var(--tw-shadow-color,#8a3fd333);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_32px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 8px 32px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_32px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow:0 8px 32px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_8px_32px_rgba\(0\,0\,0\,0\.12\)\]{--tw-shadow:0 8px 32px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_10px_-10px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:0 10px 10px -10px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_40px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 10px 40px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_10px_40px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 10px 40px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_25px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow:0 12px 25px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_12px_30px_-10px_rgba\(79\,70\,229\,0\.5\)\]{--tw-shadow:0 12px 30px -10px var(--tw-shadow-color,#4f46e580);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_15px_25px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 15px 25px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_18px_30px_-20px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow:0 18px 30px -20px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_30px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 20px 30px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_40px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 40px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_45px_-15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:0 20px 45px -15px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_50px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow:0 20px 50px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_50px_rgba\(15\,20\,34\,0\.2\)\]{--tw-shadow:0 20px 50px var(--tw-shadow-color,#0f142233);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_-15px_rgba\(168\,85\,247\,0\.15\)\]{--tw-shadow:0 20px 60px -15px var(--tw-shadow-color,#a855f726);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_20px_60px_rgba\(0\,0\,0\,0\.4\)\]{--tw-shadow:0 20px 60px var(--tw-shadow-color,#0006);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_24px_60px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 24px 60px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_24px_64px_rgba\(0\,0\,0\,0\.18\)\]{--tw-shadow:0 24px 64px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_25px_60px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 25px 60px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_80px_rgba\(0\,0\,0\,0\.6\)\]{--tw-shadow:0 30px 80px var(--tw-shadow-color,#0009);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_80px_rgba\(0\,0\,0\,0\.8\)\]{--tw-shadow:0 30px 80px var(--tw-shadow-color,#000c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_80px_rgba\(0\,0\,0\,0\.15\)\]{--tw-shadow:0 30px 80px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[2px_0_4px_rgba\(0\,0\,0\,0\.01\)\]{--tw-shadow:2px 0 4px var(--tw-shadow-color,#00000003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[2px_0_4px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:2px 0 4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[2px_0_4px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow:2px 0 4px var(--tw-shadow-color,#00000005);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_-4px_6px_rgba\(0\,0\,0\,0\.05\)\,0_4px_6px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 -4px 6px var(--tw-shadow-color,#0000000d), 0 4px 6px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_0_20px_rgba\(168\,85\,247\,0\.05\)\]{--tw-shadow:inset 0 0 20px var(--tw-shadow-color,#a855f70d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_2px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:inset 0 1px 2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_3px_rgba\(255\,255\,255\,0\.5\)\]{--tw-shadow:inset 0 1px 3px var(--tw-shadow-color,#ffffff80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_2px_4px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow:inset 0 2px 4px var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_6px_15px_rgba\(255\,255\,255\,0\.4\)\]{--tw-shadow:inset 0 6px 15px var(--tw-shadow-color,#fff6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-4,.ring-\[4px\]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#1FA7E1\]\/20{--tw-shadow-color:#1fa7e133}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/20{--tw-shadow-color:color-mix(in oklab, oklab(68.7044% -.0807821 -.10979/.2) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#1FA7E1\]\/30{--tw-shadow-color:#1fa7e14d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(68.7044% -.0807821 -.10979/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#1FA7E1\]\/40{--tw-shadow-color:#1fa7e166}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#1FA7E1\]\/40{--tw-shadow-color:color-mix(in oklab, oklab(68.7044% -.0807821 -.10979/.4) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#8A3FD3\]\/30{--tw-shadow-color:#8a3fd34d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8A3FD3\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(54.1025% .117281 -.181162/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#8A3FD3\]\/40{--tw-shadow-color:#8a3fd366}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8A3FD3\]\/40{--tw-shadow-color:color-mix(in oklab, oklab(54.1025% .117281 -.181162/.4) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#8B5CF6\]\/20{--tw-shadow-color:#8b5cf633}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#8B5CF6\]\/20{--tw-shadow-color:color-mix(in oklab, oklab(60.5631% .0845415 -.201932/.2) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#75D06A\]\/30{--tw-shadow-color:#75d06a4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#75D06A\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(77.7281% -.128439 .101669/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#9956DE\]\/20{--tw-shadow-color:#9956de33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#9956DE\]\/20{--tw-shadow-color:color-mix(in oklab, oklab(59.4745% .111053 -.167638/.2) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#9956DE\]\/30{--tw-shadow-color:#9956de4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#9956DE\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(59.4745% .111053 -.167638/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#FB96BB\]\/30{--tw-shadow-color:#fb96bb4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FB96BB\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(78.801% .12777 -.00670064/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#FF8B8B\]\/30{--tw-shadow-color:#ff8b8b4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FF8B8B\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(76.3223% .131566 .050208/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[\#FFB356\]\/30{--tw-shadow-color:#ffb3564d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#FFB356\]\/30{--tw-shadow-color:color-mix(in oklab, oklab(82.2219% .0499055 .130321/.3) var(--tw-shadow-alpha), transparent)}}.shadow-\[rgba\(124\,58\,237\,0\.05\)_0px_0px_30px_inset\]{--tw-shadow-color:#7c3aed0d}@supports (color:color-mix(in lab,red,red)){.shadow-\[rgba\(124\,58\,237\,0\.05\)_0px_0px_30px_inset\]{--tw-shadow-color:color-mix(in oklab, #7c3aed0d 0px 0px 30px inset var(--tw-shadow-alpha), transparent)}}.shadow-blue-200\/50{--tw-shadow-color:#bedbff80}@supports (color:color-mix(in lab,red,red)){.shadow-blue-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-blue-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500\/20{--tw-shadow-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-blue-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-200\/50{--tw-shadow-color:#a4f4cf80}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/20{--tw-shadow-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/25{--tw-shadow-color:#00bb7f40}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/30{--tw-shadow-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/30{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-100{--tw-shadow-color:oklch(93% .034 272.788)}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-100{--tw-shadow-color:color-mix(in oklab, var(--color-indigo-100) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-100\/20{--tw-shadow-color:#e0e7ff33}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-100\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-100) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-200{--tw-shadow-color:oklch(87% .065 274.039)}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-200{--tw-shadow-color:color-mix(in oklab, var(--color-indigo-200) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-200\/50{--tw-shadow-color:#c7d2ff80}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-500\/10{--tw-shadow-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-500\/20{--tw-shadow-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-indigo-500\/25{--tw-shadow-color:#625fff40}@supports (color:color-mix(in lab,red,red)){.shadow-indigo-500\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-indigo-500) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-100{--tw-shadow-color:oklch(94.6% .033 307.174)}@supports (color:color-mix(in lab,red,red)){.shadow-purple-100{--tw-shadow-color:color-mix(in oklab, var(--color-purple-100) var(--tw-shadow-alpha), transparent)}}.shadow-purple-200{--tw-shadow-color:oklch(90.2% .063 306.703)}@supports (color:color-mix(in lab,red,red)){.shadow-purple-200{--tw-shadow-color:color-mix(in oklab, var(--color-purple-200) var(--tw-shadow-alpha), transparent)}}.shadow-purple-200\/50{--tw-shadow-color:#e9d5ff80}@supports (color:color-mix(in lab,red,red)){.shadow-purple-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-200\/60{--tw-shadow-color:#e9d5ff99}@supports (color:color-mix(in lab,red,red)){.shadow-purple-200\/60{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-200) 60%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-500\/20{--tw-shadow-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.shadow-purple-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-600\/25{--tw-shadow-color:#9810fa40}@supports (color:color-mix(in lab,red,red)){.shadow-purple-600\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-600) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-purple-900\/50{--tw-shadow-color:#59168b80}@supports (color:color-mix(in lab,red,red)){.shadow-purple-900\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-900) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-red-900\/10{--tw-shadow-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.shadow-red-900\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-red-900) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-rose-200\/50{--tw-shadow-color:#ffccd380}@supports (color:color-mix(in lab,red,red)){.shadow-rose-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-rose-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-rose-500\/20{--tw-shadow-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.shadow-rose-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-rose-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-sky-200{--tw-shadow-color:oklch(89.4% .057 293.283)}@supports (color:color-mix(in lab,red,red)){.shadow-sky-200{--tw-shadow-color:color-mix(in oklab, var(--color-violet-200) var(--tw-shadow-alpha), transparent)}}.shadow-sky-500\/20{--tw-shadow-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.shadow-sky-500\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-violet-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-slate-100{--tw-shadow-color:oklch(96.8% .007 247.896)}@supports (color:color-mix(in lab,red,red)){.shadow-slate-100{--tw-shadow-color:color-mix(in oklab, var(--color-slate-100) var(--tw-shadow-alpha), transparent)}}.shadow-slate-200{--tw-shadow-color:oklch(92.9% .013 255.508)}@supports (color:color-mix(in lab,red,red)){.shadow-slate-200{--tw-shadow-color:color-mix(in oklab, var(--color-slate-200) var(--tw-shadow-alpha), transparent)}}.shadow-slate-200\/40{--tw-shadow-color:#e2e8f066}@supports (color:color-mix(in lab,red,red)){.shadow-slate-200\/40{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-200) 40%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-slate-200\/50{--tw-shadow-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.shadow-slate-200\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-200) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-slate-900\/10{--tw-shadow-color:#0f172b1a}@supports (color:color-mix(in lab,red,red)){.shadow-slate-900\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-900) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-slate-900\/\[0\.04\]{--tw-shadow-color:#0f172b0a}@supports (color:color-mix(in lab,red,red)){.shadow-slate-900\/\[0\.04\]{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-900) 4%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-\[\#1FA7E1\]\/35{--tw-ring-color:oklab(68.7044% -.0807821 -.10979/.35)}.ring-\[\#8B5CF6\]\/10{--tw-ring-color:oklab(60.5631% .0845415 -.201932/.1)}.ring-\[\#9956DE\]\/50{--tw-ring-color:oklab(59.4745% .111053 -.167638/.5)}.ring-\[color-mix\(in_srgb\,var\(--chart-2\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-2)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-2\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-2) 40%,transparent)}}.ring-\[color-mix\(in_srgb\,var\(--chart-3\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-3)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-3\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-3) 40%,transparent)}}.ring-\[color-mix\(in_srgb\,var\(--chart-4\)_40\%\,transparent\)\]{--tw-ring-color:var(--chart-4)}@supports (color:color-mix(in lab,red,red)){.ring-\[color-mix\(in_srgb\,var\(--chart-4\)_40\%\,transparent\)\]{--tw-ring-color:color-mix(in srgb,var(--chart-4) 40%,transparent)}}.ring-green-300{--tw-ring-color:var(--color-green-300)}.ring-primary{--tw-ring-color:var(--primary)}.ring-purple-500\/20{--tw-ring-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.ring-purple-500\/20{--tw-ring-color:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.ring-red-300{--tw-ring-color:var(--color-red-300)}.ring-red-500{--tw-ring-color:var(--color-red-500)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.ring-rose-300{--tw-ring-color:var(--color-rose-300)}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-sky-50{--tw-ring-color:var(--color-violet-50)}.ring-slate-100{--tw-ring-color:var(--color-slate-100)}.ring-slate-200{--tw-ring-color:var(--color-slate-200)}.ring-slate-800{--tw-ring-color:var(--color-slate-800)}.ring-white{--tw-ring-color:var(--color-white)}.ring-white\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.ring-white\/10{--tw-ring-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.ring-white\/20{--tw-ring-color:#fff3}@supports (color:color-mix(in lab,red,red)){.ring-white\/20{--tw-ring-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-\[4px\]{--tw-ring-offset-width:4px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-\[\#0B0F19\]{--tw-ring-offset-color:#0b0f19}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-2xl{--tw-blur:blur(var(--blur-2xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[1px\]{--tw-blur:blur(1px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[2px\]{--tw-blur:blur(2px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[32px\]{--tw-blur:blur(32px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[60px\]{--tw-blur:blur(60px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[100px\]{--tw-blur:blur(100px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[120px\]{--tw-blur:blur(120px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[140px\]{--tw-blur:blur(140px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[160px\]{--tw-blur:blur(160px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-md{--tw-blur:blur(var(--blur-md));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.brightness-105{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.contrast-50{--tw-contrast:contrast(50%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-2xl{--tw-drop-shadow-size:drop-shadow(0 25px 25px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-2xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[-2px_3px_0px_rgba\(0\,0\,0\,0\.8\)\]{--tw-drop-shadow-size:drop-shadow(-2px 3px 0px var(--tw-drop-shadow-color,#000c));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(31\,167\,225\,0\.5\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#1fa7e180));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(138\,63\,211\,0\.5\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#8a3fd380));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_8px_rgba\(251\,191\,36\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 8px var(--tw-drop-shadow-color,#fbbf24e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(245\,158\,11\,0\.6\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#f59e0b99));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(245\,158\,11\,0\.8\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#f59e0bcc));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(250\,204\,21\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#facc15e6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_12px_rgba\(255\,255\,255\,0\.4\)\]{--tw-drop-shadow-size:drop-shadow(0 0 12px var(--tw-drop-shadow-color,#fff6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_15px_rgba\(252\,211\,77\,0\.8\)\]{--tw-drop-shadow-size:drop-shadow(0 0 15px var(--tw-drop-shadow-color,#fcd34dcc));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_25px_rgba\(252\,211\,77\,0\.9\)\]{--tw-drop-shadow-size:drop-shadow(0 0 25px var(--tw-drop-shadow-color,#fcd34de6));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_10px_20px_rgba\(0\,0\,0\,0\.15\)\]{--tw-drop-shadow-size:drop-shadow(0 10px 20px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_12px_15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-drop-shadow-size:drop-shadow(0 12px 15px var(--tw-drop-shadow-color,#0000004d));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_15px_15px_rgba\(0\,0\,0\,0\.3\)\]{--tw-drop-shadow-size:drop-shadow(0 15px 15px var(--tw-drop-shadow-color,#0000004d));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-lg));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-md{--tw-drop-shadow-size:drop-shadow(0 3px 3px var(--tw-drop-shadow-color,#0000001f));--tw-drop-shadow:drop-shadow(var(--drop-shadow-md));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-sm{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-sm));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-xl{--tw-drop-shadow-size:drop-shadow(0 9px 7px var(--tw-drop-shadow-color,#0000001a));--tw-drop-shadow:drop-shadow(var(--drop-shadow-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.saturate-50{--tw-saturate:saturate(50%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-2xl{--tw-backdrop-blur:blur(var(--blur-2xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-3xl{--tw-backdrop-blur:blur(var(--blur-3xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[1px\]{--tw-backdrop-blur:blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[2px\]{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[12px\]{--tw-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[16px\]{--tw-backdrop-blur:blur(16px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[24px\]{--tw-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.delay-75{transition-delay:75ms}.duration-0{--tw-duration:0s;transition-duration:0s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-transform{will-change:transform}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}.\[background\:linear-gradient\(var\(--grid-color\)_0_1px\,_transparent_1px_var\(--beam-size\)\)_50\%_-0\.5px_\/var\(--beam-size\)_var\(--beam-size\)\,linear-gradient\(90deg\,_var\(--grid-color\)_0_1px\,_transparent_1px_var\(--beam-size\)\)_50\%_50\%_\/var\(--beam-size\)_var\(--beam-size\)\]{background:linear-gradient(var(--grid-color) 0 1px,transparent 1px var(--beam-size)) 50% -.5px /var(--beam-size) var(--beam-size),linear-gradient(90deg,var(--grid-color) 0 1px,transparent 1px var(--beam-size)) 50% 50% /var(--beam-size) var(--beam-size)}.\[background\:var\(--background\)\]{background:var(--background)}.\[clip-path\:inset\(0\)\]{clip-path:inset(0)}.\[perspective\:var\(--perspective\)\]{perspective:var(--perspective)}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[transform-style\:preserve-3d\]{transform-style:preserve-3d}.ring-inset{--tw-ring-inset:inset}.group-focus-within\:text-\[\#4f46e5\]:is(:where(.group):focus-within *){color:#4f46e5}.group-focus-within\:text-\[\#9956DE\]:is(:where(.group):focus-within *){color:#9956de}.group-focus-within\:text-indigo-500:is(:where(.group):focus-within *){color:var(--color-indigo-500)}.group-focus-within\:text-indigo-600:is(:where(.group):focus-within *){color:var(--color-indigo-600)}.group-focus-within\/input\:text-indigo-500:is(:where(.group\/input):focus-within *){color:var(--color-indigo-500)}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:1}@media(hover:hover){.group-hover\:left-\[150\%\]:is(:where(.group):hover *){left:150%}.group-hover\:-translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-x-4:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-x-1:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-x-4:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-y-1:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-y-2:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -2);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-y-4:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-y-\[-3px\]:is(:where(.group):hover *){--tw-translate-y:-3px;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:scale-105:is(:where(.group):hover *){--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:scale-125:is(:where(.group):hover *){--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:scale-150:is(:where(.group):hover *){--tw-scale-x:150%;--tw-scale-y:150%;--tw-scale-z:150%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:scale-\[1\.2\]:is(:where(.group):hover *){scale:1.2}.group-hover\:scale-\[1\.3\]:is(:where(.group):hover *){scale:1.3}.group-hover\:scale-\[1\.4\]:is(:where(.group):hover *){scale:1.4}.group-hover\:scale-\[1\.05\]:is(:where(.group):hover *){scale:1.05}.group-hover\:scale-\[1\.6\]:is(:where(.group):hover *){scale:1.6}.group-hover\:scale-\[1\.8\]:is(:where(.group):hover *){scale:1.8}.group-hover\:-rotate-6:is(:where(.group):hover *){rotate:-6deg}.group-hover\:-rotate-12:is(:where(.group):hover *){rotate:-12deg}.group-hover\:rotate-3:is(:where(.group):hover *){rotate:3deg}.group-hover\:rotate-6:is(:where(.group):hover *){rotate:6deg}.group-hover\:rotate-12:is(:where(.group):hover *){rotate:12deg}.group-hover\:rotate-90:is(:where(.group):hover *){rotate:90deg}.group-hover\:rotate-180:is(:where(.group):hover *){rotate:180deg}.group-hover\:rotate-\[25deg\]:is(:where(.group):hover *){rotate:25deg}.group-hover\:animate-\[shimmer_1\.5s_ease-out\]:is(:where(.group):hover *){animation:1.5s ease-out shimmer}.group-hover\:border-amber-200:is(:where(.group):hover *){border-color:var(--color-amber-200)}.group-hover\:border-amber-400:is(:where(.group):hover *){border-color:var(--color-amber-400)}.group-hover\:border-emerald-200:is(:where(.group):hover *){border-color:var(--color-emerald-200)}.group-hover\:border-indigo-400:is(:where(.group):hover *){border-color:var(--color-indigo-400)}.group-hover\:border-purple-100:is(:where(.group):hover *){border-color:var(--color-purple-100)}.group-hover\:border-purple-200:is(:where(.group):hover *){border-color:var(--color-purple-200)}.group-hover\:border-rose-200:is(:where(.group):hover *){border-color:var(--color-rose-200)}.group-hover\:border-sky-200:is(:where(.group):hover *){border-color:var(--color-violet-200)}.group-hover\:border-sky-300:is(:where(.group):hover *){border-color:var(--color-violet-300)}.group-hover\:border-slate-300:is(:where(.group):hover *){border-color:var(--color-slate-300)}.group-hover\:border-teal-400:is(:where(.group):hover *){border-color:var(--color-teal-400)}.group-hover\:border-r-amber-400:is(:where(.group):hover *){border-right-color:var(--color-amber-400)}.group-hover\:border-r-teal-400:is(:where(.group):hover *){border-right-color:var(--color-teal-400)}.group-hover\:border-b-amber-400:is(:where(.group):hover *){border-bottom-color:var(--color-amber-400)}.group-hover\:border-b-teal-400:is(:where(.group):hover *){border-bottom-color:var(--color-teal-400)}.group-hover\:bg-\[\#9333ea\]:is(:where(.group):hover *){background-color:#9333ea}.group-hover\:bg-\[\#a855f7\]:is(:where(.group):hover *){background-color:#a855f7}.group-hover\:bg-amber-50:is(:where(.group):hover *){background-color:var(--color-amber-50)}.group-hover\:bg-amber-100\/50:is(:where(.group):hover *){background-color:#fef3c680}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-amber-100\/50:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-amber-100) 50%,transparent)}}.group-hover\:bg-black\/20:is(:where(.group):hover *){background-color:#0003}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-black\/20:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.group-hover\:bg-blue-100:is(:where(.group):hover *){background-color:var(--color-blue-100)}.group-hover\:bg-emerald-50:is(:where(.group):hover *){background-color:var(--color-emerald-50)}.group-hover\:bg-emerald-100:is(:where(.group):hover *){background-color:var(--color-emerald-100)}.group-hover\:bg-indigo-600:is(:where(.group):hover *){background-color:var(--color-indigo-600)}.group-hover\:bg-purple-100:is(:where(.group):hover *){background-color:var(--color-purple-100)}.group-hover\:bg-slate-50:is(:where(.group):hover *){background-color:var(--color-slate-50)}.group-hover\:bg-slate-50\/90:is(:where(.group):hover *){background-color:#f8fafce6}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-slate-50\/90:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-slate-50) 90%,transparent)}}.group-hover\:bg-slate-400:is(:where(.group):hover *){background-color:var(--color-slate-400)}.group-hover\:bg-slate-700:is(:where(.group):hover *){background-color:var(--color-slate-700)}.group-hover\:bg-teal-50:is(:where(.group):hover *){background-color:var(--color-teal-50)}.group-hover\:bg-white\/20:is(:where(.group):hover *){background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-white\/20:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.group-hover\:bg-white\/30:is(:where(.group):hover *){background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.group-hover\:bg-white\/30:is(:where(.group):hover *){background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.group-hover\:p-2\.5:is(:where(.group):hover *){padding:calc(var(--spacing) * 2.5)}.group-hover\:text-\[\#1FA7E1\]:is(:where(.group):hover *){color:#1fa7e1}.group-hover\:text-\[\#1e293b\]:is(:where(.group):hover *){color:#1e293b}.group-hover\:text-\[\#4f46e5\]:is(:where(.group):hover *){color:#4f46e5}.group-hover\:text-\[\#6ED1CF\]:is(:where(.group):hover *){color:#6ed1cf}.group-hover\:text-\[\#7274ED\]:is(:where(.group):hover *){color:#7274ed}.group-hover\:text-\[\#9333ea\]:is(:where(.group):hover *){color:#9333ea}.group-hover\:text-\[\#9956DE\]:is(:where(.group):hover *){color:#9956de}.group-hover\:text-\[\#FFB356\]:is(:where(.group):hover *){color:#ffb356}.group-hover\:text-\[\#a855f7\]:is(:where(.group):hover *){color:#a855f7}.group-hover\:text-amber-500:is(:where(.group):hover *){color:var(--color-amber-500)}.group-hover\:text-blue-700:is(:where(.group):hover *){color:var(--color-blue-700)}.group-hover\:text-emerald-500:is(:where(.group):hover *){color:var(--color-emerald-500)}.group-hover\:text-emerald-600:is(:where(.group):hover *){color:var(--color-emerald-600)}.group-hover\:text-emerald-700:is(:where(.group):hover *){color:var(--color-emerald-700)}.group-hover\:text-indigo-600:is(:where(.group):hover *){color:var(--color-indigo-600)}.group-hover\:text-primary:is(:where(.group):hover *){color:var(--primary)}.group-hover\:text-purple-600:is(:where(.group):hover *){color:var(--color-purple-600)}.group-hover\:text-rose-500:is(:where(.group):hover *){color:var(--color-rose-500)}.group-hover\:text-rose-600:is(:where(.group):hover *){color:var(--color-rose-600)}.group-hover\:text-sky-500:is(:where(.group):hover *){color:var(--color-violet-500)}.group-hover\:text-sky-600:is(:where(.group):hover *){color:var(--color-violet-600)}.group-hover\:text-slate-700:is(:where(.group):hover *){color:var(--color-slate-700)}.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-90:is(:where(.group):hover *){opacity:.9}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\:shadow-\[0_-20px_50px_rgba\(0\,0\,0\,0\.15\)\,inset_0_2px_15px_rgba\(255\,255\,255\,0\.8\)\,inset_0_1px_1px_rgba\(255\,255\,255\,1\)\]:is(:where(.group):hover *){--tw-shadow:0 -20px 50px var(--tw-shadow-color,#00000026), inset 0 2px 15px var(--tw-shadow-color,#fffc), inset 0 1px 1px var(--tw-shadow-color,#fff);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:shadow-\[0_24px_40px_-15px_rgba\(0\,0\,0\,0\.5\)\]:is(:where(.group):hover *){--tw-shadow:0 24px 40px -15px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:shadow-md:is(:where(.group):hover *){--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\:duration-\[800ms\]:is(:where(.group):hover *){--tw-duration:.8s;transition-duration:.8s}.group-hover\/avatar\:scale-110:is(:where(.group\/avatar):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\/btn\:translate-x-0\.5:is(:where(.group\/btn):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\/btn\:-translate-y-0\.5:is(:where(.group\/btn):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\/cal\:bg-slate-100:is(:where(.group\/cal):hover *){background-color:var(--color-slate-100)}.group-hover\/drop\:bg-purple-50:is(:where(.group\/drop):hover *){background-color:var(--color-purple-50)}.group-hover\/drop\:text-purple-500:is(:where(.group\/drop):hover *){color:var(--color-purple-500)}.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:1}.group-hover\/toggle\:block:is(:where(.group\/toggle):hover *){display:block}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) *){padding-right:calc(var(--spacing) * 8)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing) * -8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing) * 8)!important;height:calc(var(--spacing) * 8)!important}.group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing) * 4)))}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing) * 4)) + 2px)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width) * -1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width) * -1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing) * 0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing) * -4)}.group-data-\[side\=left\]\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing) * 0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:block:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}.group-data-\[viewport\=false\]\/navigation-menu\:top-full:is(:where(.group\/navigation-menu)[data-viewport=false] *){top:100%}.group-data-\[viewport\=false\]\/navigation-menu\:mt-1\.5:is(:where(.group\/navigation-menu)[data-viewport=false] *){margin-top:calc(var(--spacing) * 1.5)}.group-data-\[viewport\=false\]\/navigation-menu\:overflow-hidden:is(:where(.group\/navigation-menu)[data-viewport=false] *){overflow:hidden}.group-data-\[viewport\=false\]\/navigation-menu\:rounded-md:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-radius:calc(var(--radius) - 2px)}.group-data-\[viewport\=false\]\/navigation-menu\:border:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[viewport\=false\]\/navigation-menu\:bg-popover:is(:where(.group\/navigation-menu)[data-viewport=false] *){background-color:var(--popover)}.group-data-\[viewport\=false\]\/navigation-menu\:text-popover-foreground:is(:where(.group\/navigation-menu)[data-viewport=false] *){color:var(--popover-foreground)}.group-data-\[viewport\=false\]\/navigation-menu\:shadow:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[viewport\=false\]\/navigation-menu\:duration-200:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-duration:.2s;transition-duration:.2s}.peer-checked\:bg-\[\#4f46e5\]:is(:where(.peer):checked~*){background-color:#4f46e5}.peer-checked\:font-bold:is(:where(.peer):checked~*){--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.peer-checked\:text-\[\#1e293b\]:is(:where(.peer):checked~*){color:#1e293b}@media(hover:hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-focus\:outline-none:is(:where(.peer):focus~*){--tw-outline-style:none;outline-style:none}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing) * 1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing) * 2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing) * 1)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-\[\#94a3b8\]::placeholder{color:#94a3b8}.placeholder\:text-\[\#64748b\]::placeholder{color:#64748b}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.placeholder\:text-slate-400::placeholder{color:var(--color-slate-400)}.placeholder\:text-slate-500::placeholder{color:var(--color-slate-500)}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:top-2:before{content:var(--tw-content);top:calc(var(--spacing) * 2)}.before\:bottom-\[-16px\]:before{content:var(--tw-content);bottom:-16px}.before\:bottom-\[-24px\]:before{content:var(--tw-content);bottom:-24px}.before\:left-1\.5:before{content:var(--tw-content);left:calc(var(--spacing) * 1.5)}.before\:left-2:before{content:var(--tw-content);left:calc(var(--spacing) * 2)}.before\:w-\[1px\]:before{content:var(--tw-content);width:1px}.before\:w-\[2px\]:before{content:var(--tw-content);width:2px}.before\:bg-slate-100:before{content:var(--tw-content);background-color:var(--color-slate-100)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing) * 0)}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:h-4:after{content:var(--tw-content);height:calc(var(--spacing) * 4)}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing) * 1)}.after\:w-4:after{content:var(--tw-content);width:calc(var(--spacing) * 4)}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.after\:rounded-full:after{content:var(--tw-content);border-radius:3.40282e38px}.after\:border:after{content:var(--tw-content);border-style:var(--tw-border-style);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);border-color:var(--color-gray-300)}.after\:bg-white:after{content:var(--tw-content);background-color:var(--color-white)}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}.peer-checked\:after\:translate-x-full:is(:where(.peer):checked~*):after{content:var(--tw-content);--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.peer-checked\:after\:border-white:is(:where(.peer):checked~*):after{content:var(--tw-content);border-color:var(--color-white)}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing) * 0)}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.last\:before\:hidden:last-child:before{content:var(--tw-content);display:none}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:border-\[\#a855f7\]:focus-within{border-color:#a855f7}.focus-within\:ring-2:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-within\:ring-4:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-within\:ring-\[\#a855f7\]\/10:focus-within{--tw-ring-color:oklab(62.6846% .129701 -.193012/.1)}.focus-within\:ring-indigo-500\/20:focus-within{--tw-ring-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.focus-within\:ring-indigo-500\/20:focus-within{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 20%, transparent)}}@media(hover:hover){.hover\:z-10:hover{z-index:10}.hover\:h-20:hover{height:calc(var(--spacing) * 20)}.hover\:w-24:hover{width:calc(var(--spacing) * 24)}.hover\:-translate-x-1:hover{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-x-4:hover{--tw-translate-x:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-1:hover{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-2:hover{--tw-translate-y:calc(var(--spacing) * -2);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-\[1px\]:hover{--tw-translate-y: -1px ;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:scale-100:hover{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-\[1\.01\]:hover{scale:1.01}.hover\:scale-\[1\.02\]:hover{scale:1.02}.hover\:rotate-0:hover{rotate:0deg}.hover\:rotate-3:hover{rotate:3deg}.hover\:gap-2:hover{gap:calc(var(--spacing) * 2)}.hover\:border-\[\#1FA7E1\]:hover{border-color:#1fa7e1}.hover\:border-\[\#1FA7E1\]\/50:hover{border-color:#1fa7e180}.hover\:border-\[\#1a85a4\]\/40:hover{border-color:#1a85a466}.hover\:border-\[\#8A3FD3\]\/50:hover{border-color:#8a3fd380}.hover\:border-\[\#94a3b8\]:hover{border-color:#94a3b8}.hover\:border-\[\#818cf8\]:hover{border-color:#818cf8}.hover\:border-\[\#9956DE\]:hover{border-color:#9956de}.hover\:border-\[\#9956DE\]\/30:hover{border-color:#9956de4d}.hover\:border-\[\#9956DE\]\/50:hover{border-color:#9956de80}.hover\:border-\[\#9956DE\]\/60:hover{border-color:#9956de99}.hover\:border-\[\#F08386\]:hover{border-color:#f08386}.hover\:border-\[\#F08386\]\/60:hover{border-color:#f0838699}.hover\:border-\[\#a855f7\]:hover{border-color:#a855f7}.hover\:border-\[\#bbf7d0\]:hover{border-color:#bbf7d0}.hover\:border-\[\#bfdbfe\]:hover{border-color:#bfdbfe}.hover\:border-\[\#cbd5e1\]:hover{border-color:#cbd5e1}.hover\:border-\[\#d1cec6\]:hover{border-color:#d1cec6}.hover\:border-\[\#d8b4fe\]:hover{border-color:#d8b4fe}.hover\:border-\[\#dde3eb\]:hover{border-color:#dde3eb}.hover\:border-\[\#e2e8f0\]:hover{border-color:#e2e8f0}.hover\:border-\[\#fecdd3\]:hover{border-color:#fecdd3}.hover\:border-\[\#fed7aa\]:hover{border-color:#fed7aa}.hover\:border-amber-200:hover{border-color:var(--color-amber-200)}.hover\:border-amber-200\/60:hover{border-color:#fee68599}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-200\/60:hover{border-color:color-mix(in oklab,var(--color-amber-200) 60%,transparent)}}.hover\:border-blue-200:hover{border-color:var(--color-blue-200)}.hover\:border-emerald-100:hover{border-color:var(--color-emerald-100)}.hover\:border-emerald-200:hover{border-color:var(--color-emerald-200)}.hover\:border-emerald-300:hover{border-color:var(--color-emerald-300)}.hover\:border-indigo-100:hover{border-color:var(--color-indigo-100)}.hover\:border-indigo-200:hover{border-color:var(--color-indigo-200)}.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:border-indigo-600:hover{border-color:var(--color-indigo-600)}.hover\:border-purple-100:hover{border-color:var(--color-purple-100)}.hover\:border-purple-200:hover{border-color:var(--color-purple-200)}.hover\:border-purple-400:hover{border-color:var(--color-purple-400)}.hover\:border-rose-100:hover{border-color:var(--color-rose-100)}.hover\:border-rose-200:hover{border-color:var(--color-rose-200)}.hover\:border-rose-300:hover{border-color:var(--color-rose-300)}.hover\:border-sky-200:hover{border-color:var(--color-violet-200)}.hover\:border-sky-300:hover{border-color:var(--color-violet-300)}.hover\:border-slate-200:hover{border-color:var(--color-slate-200)}.hover\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\:border-violet-100:hover{border-color:var(--color-violet-100)}.hover\:bg-\[\#1C96CB\]:hover{background-color:#1c96cb}.hover\:bg-\[\#1FA7E1\]\/5:hover{background-color:#1fa7e10d}.hover\:bg-\[\#1a95c9\]:hover{background-color:#1a95c9}.hover\:bg-\[\#4f46e5\]:hover{background-color:#4f46e5}.hover\:bg-\[\#5AB84E\]:hover{background-color:#5ab84e}.hover\:bg-\[\#6ab359\]:hover{background-color:#6ab359}.hover\:bg-\[\#6b4494\]:hover{background-color:#6b4494}.hover\:bg-\[\#7b35c0\]:hover{background-color:#7b35c0}.hover\:bg-\[\#7c3aed\]:hover{background-color:#7c3aed}.hover\:bg-\[\#008f5d\]:hover{background-color:#008f5d}.hover\:bg-\[\#8A3FD3\]\/5:hover{background-color:#8a3fd30d}.hover\:bg-\[\#8A4DCA\]:hover{background-color:#8a4dca}.hover\:bg-\[\#8b5cf6\]:hover{background-color:#8b5cf6}.hover\:bg-\[\#8b45d1\]:hover{background-color:#8b45d1}.hover\:bg-\[\#126b84\]:hover{background-color:#126b84}.hover\:bg-\[\#3730a3\]:hover{background-color:#3730a3}.hover\:bg-\[\#4338ca\]:hover{background-color:#4338ca}.hover\:bg-\[\#6366f1\]:hover{background-color:#6366f1}.hover\:bg-\[\#8544c7\]:hover{background-color:#8544c7}.hover\:bg-\[\#8850CE\]:hover{background-color:#8850ce}.hover\:bg-\[\#9333ea\]:hover{background-color:#9333ea}.hover\:bg-\[\#9956DE\]:hover{background-color:#9956de}.hover\:bg-\[\#9956DE\]\/5:hover{background-color:#9956de0d}.hover\:bg-\[\#9956DE\]\/6:hover{background-color:#9956de0f}.hover\:bg-\[\#9956DE\]\/8:hover{background-color:#9956de14}.hover\:bg-\[\#9956DE\]\/12:hover{background-color:#9956de1f}.hover\:bg-\[\#9956DE\]\/20:hover{background-color:#9956de33}.hover\:bg-\[\#059669\]:hover{background-color:#059669}.hover\:bg-\[\#283042\]:hover{background-color:#283042}.hover\:bg-\[\#334155\]:hover{background-color:#334155}.hover\:bg-\[\#F08386\]\/12:hover{background-color:#f083861f}.hover\:bg-\[\#FA7DA9\]:hover{background-color:#fa7da9}.hover\:bg-\[\#FF7373\]:hover{background-color:#ff7373}.hover\:bg-\[\#dde3eb\]:hover{background-color:#dde3eb}.hover\:bg-\[\#e0e7ff\]:hover{background-color:#e0e7ff}.hover\:bg-\[\#edf1f7\]:hover{background-color:#edf1f7}.hover\:bg-\[\#edf1f7\]\/50:hover{background-color:#edf1f780}.hover\:bg-\[\#f0fbff\]:hover{background-color:#f0fbff}.hover\:bg-\[\#f1f5f9\]:hover{background-color:#f1f5f9}.hover\:bg-\[\#f5f3ff\]:hover{background-color:#f5f3ff}.hover\:bg-\[\#f7f9fc\]:hover{background-color:#f7f9fc}.hover\:bg-\[\#f8fafc\]:hover{background-color:#f8fafc}.hover\:bg-\[\#fafbff\]:hover{background-color:#fafbff}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-amber-50:hover{background-color:var(--color-amber-50)}.hover\:bg-amber-100:hover{background-color:var(--color-amber-100)}.hover\:bg-amber-200\/50:hover{background-color:#fee68580}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-200\/50:hover{background-color:color-mix(in oklab,var(--color-amber-200) 50%,transparent)}}.hover\:bg-amber-400:hover{background-color:var(--color-amber-400)}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-black:hover{background-color:var(--color-black)}.hover\:bg-black\/40:hover{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/40:hover{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.hover\:bg-blue-100:hover{background-color:var(--color-blue-100)}.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}.hover\:bg-emerald-50:hover{background-color:var(--color-emerald-50)}.hover\:bg-emerald-100:hover{background-color:var(--color-emerald-100)}.hover\:bg-emerald-400:hover{background-color:var(--color-emerald-400)}.hover\:bg-emerald-600:hover{background-color:var(--color-emerald-600)}.hover\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-indigo-50:hover{background-color:var(--color-indigo-50)}.hover\:bg-indigo-100:hover{background-color:var(--color-indigo-100)}.hover\:bg-indigo-600:hover{background-color:var(--color-indigo-600)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}.hover\:bg-muted:hover,.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-primary:hover,.hover\:bg-primary\/20:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}.hover\:bg-purple-50:hover{background-color:var(--color-purple-50)}.hover\:bg-purple-50\/10:hover{background-color:#faf5ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-50\/10:hover{background-color:color-mix(in oklab,var(--color-purple-50) 10%,transparent)}}.hover\:bg-purple-50\/20:hover{background-color:#faf5ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-50\/20:hover{background-color:color-mix(in oklab,var(--color-purple-50) 20%,transparent)}}.hover\:bg-purple-50\/30:hover{background-color:#faf5ff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-50\/30:hover{background-color:color-mix(in oklab,var(--color-purple-50) 30%,transparent)}}.hover\:bg-purple-50\/40:hover{background-color:#faf5ff66}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-50\/40:hover{background-color:color-mix(in oklab,var(--color-purple-50) 40%,transparent)}}.hover\:bg-purple-100:hover{background-color:var(--color-purple-100)}.hover\:bg-purple-500:hover{background-color:var(--color-purple-500)}.hover\:bg-purple-700:hover{background-color:var(--color-purple-700)}.hover\:bg-purple-900\/40:hover{background-color:#59168b66}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-900\/40:hover{background-color:color-mix(in oklab,var(--color-purple-900) 40%,transparent)}}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-rose-50:hover{background-color:var(--color-rose-50)}.hover\:bg-rose-100:hover{background-color:var(--color-rose-100)}.hover\:bg-rose-500:hover{background-color:var(--color-rose-500)}.hover\:bg-rose-500\/10:hover{background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-rose-500\/10:hover{background-color:color-mix(in oklab,var(--color-rose-500) 10%,transparent)}}.hover\:bg-rose-600:hover{background-color:var(--color-rose-600)}.hover\:bg-rose-700:hover{background-color:var(--color-rose-700)}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:bg-sky-50:hover{background-color:var(--color-violet-50)}.hover\:bg-sky-50\/80:hover{background-color:#f5f3ffcc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-sky-50\/80:hover{background-color:color-mix(in oklab,var(--color-violet-50) 80%,transparent)}}.hover\:bg-sky-300:hover{background-color:var(--color-violet-300)}.hover\:bg-sky-500:hover{background-color:var(--color-violet-500)}.hover\:bg-sky-600:hover{background-color:var(--color-violet-600)}.hover\:bg-sky-700:hover{background-color:var(--color-violet-700)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-slate-50\/50:hover{background-color:#f8fafc80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-50\/50:hover{background-color:color-mix(in oklab,var(--color-slate-50) 50%,transparent)}}.hover\:bg-slate-50\/60:hover{background-color:#f8fafc99}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-50\/60:hover{background-color:color-mix(in oklab,var(--color-slate-50) 60%,transparent)}}.hover\:bg-slate-50\/70:hover{background-color:#f8fafcb3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-50\/70:hover{background-color:color-mix(in oklab,var(--color-slate-50) 70%,transparent)}}.hover\:bg-slate-50\/80:hover{background-color:#f8fafccc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-50\/80:hover{background-color:color-mix(in oklab,var(--color-slate-50) 80%,transparent)}}.hover\:bg-slate-100:hover{background-color:var(--color-slate-100)}.hover\:bg-slate-100\/50:hover{background-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-100\/50:hover{background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.hover\:bg-slate-200:hover{background-color:var(--color-slate-200)}.hover\:bg-slate-200\/50:hover{background-color:#e2e8f080}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-200\/50:hover{background-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.hover\:bg-slate-200\/70:hover{background-color:#e2e8f0b3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-200\/70:hover{background-color:color-mix(in oklab,var(--color-slate-200) 70%,transparent)}}.hover\:bg-slate-800:hover{background-color:var(--color-slate-800)}.hover\:bg-violet-100:hover{background-color:var(--color-violet-100)}.hover\:bg-violet-500:hover{background-color:var(--color-violet-500)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.hover\:bg-white\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/30:hover{background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.hover\:bg-white\/50:hover{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/50:hover{background-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.hover\:bg-white\/60:hover{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/60:hover{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.hover\:bg-white\/80:hover{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/80:hover{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.hover\:\!from-\[\#8FE4DA\]:hover{--tw-gradient-from:#8fe4da!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.hover\:from-\[\#9333ea\]:hover{--tw-gradient-from:#9333ea;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-\[\#FFA500\]:hover{--tw-gradient-from:orange;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-amber-600:hover{--tw-gradient-from:var(--color-amber-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-purple-500:hover{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-purple-700:hover{--tw-gradient-from:var(--color-purple-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-sky-700:hover{--tw-gradient-from:var(--color-violet-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:\!to-\[\#49BDEB\]:hover{--tw-gradient-to:#49bdeb!important;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))!important}.hover\:to-\[\#7e22ce\]:hover{--tw-gradient-to:#7e22ce;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-\[\#FF7F00\]:hover{--tw-gradient-to:#ff7f00;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-orange-600:hover{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-pink-400:hover{--tw-gradient-to:var(--color-pink-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-purple-600:hover{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-sky-600:hover{--tw-gradient-to:var(--color-violet-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:text-\[\#0a1628\]:hover{color:#0a1628}.hover\:text-\[\#1e293b\]:hover{color:#1e293b}.hover\:text-\[\#4f46e5\]:hover{color:#4f46e5}.hover\:text-\[\#5a6578\]:hover{color:#5a6578}.hover\:text-\[\#7c3aed\]:hover{color:#7c3aed}.hover\:text-\[\#3730a3\]:hover{color:#3730a3}.hover\:text-\[\#9333ea\]:hover{color:#9333ea}.hover\:text-\[\#9956DE\]:hover{color:#9956de}.hover\:text-\[\#64748b\]:hover{color:#64748b}.hover\:text-\[\#F08386\]:hover{color:#f08386}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-amber-500:hover{color:var(--color-amber-500)}.hover\:text-amber-600:hover{color:var(--color-amber-600)}.hover\:text-emerald-500:hover{color:var(--color-emerald-500)}.hover\:text-emerald-600:hover{color:var(--color-emerald-600)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-indigo-300:hover{color:var(--color-indigo-300)}.hover\:text-indigo-500:hover{color:var(--color-indigo-500)}.hover\:text-indigo-600:hover{color:var(--color-indigo-600)}.hover\:text-indigo-700:hover{color:var(--color-indigo-700)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:text-primary:hover{color:var(--primary)}.hover\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\:text-purple-600:hover{color:var(--color-purple-600)}.hover\:text-purple-700:hover{color:var(--color-purple-700)}.hover\:text-purple-900:hover{color:var(--color-purple-900)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:text-rose-300:hover{color:var(--color-rose-300)}.hover\:text-rose-500:hover{color:var(--color-rose-500)}.hover\:text-rose-600:hover{color:var(--color-rose-600)}.hover\:text-rose-700:hover{color:var(--color-rose-700)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:text-sky-300:hover{color:var(--color-violet-300)}.hover\:text-sky-500:hover{color:var(--color-violet-500)}.hover\:text-sky-600:hover{color:var(--color-violet-600)}.hover\:text-sky-700:hover{color:var(--color-violet-700)}.hover\:text-slate-600:hover{color:var(--color-slate-600)}.hover\:text-slate-700:hover{color:var(--color-slate-700)}.hover\:text-slate-800:hover{color:var(--color-slate-800)}.hover\:text-slate-900:hover{color:var(--color-slate-900)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-white\/80:hover{color:#fffc}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/80:hover{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_2px_8px_rgba\(168\,85\,247\,0\.1\)\]:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#a855f71a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_2px_8px_rgba\(168\,85\,247\,0\.08\)\]:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#a855f714);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_2px_10px_rgba\(0\,0\,0\,0\.04\)\]:hover{--tw-shadow:0 2px 10px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_4px_12px_rgba\(168\,85\,247\,0\.08\)\]:hover{--tw-shadow:0 4px 12px var(--tw-shadow-color,#a855f714);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.2\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.04\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(0\,0\,0\,0\.06\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(14\,165\,233\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0ea5e94d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(16\,185\,129\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#10b9814d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(59\,130\,246\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(168\,85\,247\,0\.1\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#a855f71a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(168\,85\,247\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(168\,85\,247\,0\.4\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#a855f766);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_8px_24px_rgba\(249\,115\,22\,0\.3\)\]:hover{--tw-shadow:0 8px 24px var(--tw-shadow-color,#f973164d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_24px_rgba\(16\,185\,129\,0\.35\)\]:hover{--tw-shadow:0 12px 24px var(--tw-shadow-color,#10b98159);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_24px_rgba\(59\,130\,246\,0\.35\)\]:hover{--tw-shadow:0 12px 24px var(--tw-shadow-color,#3b82f659);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_24px_rgba\(168\,85\,247\,0\.35\)\]:hover{--tw-shadow:0 12px 24px var(--tw-shadow-color,#a855f759);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_45px_rgba\(31\,167\,225\,0\.4\)\]:hover{--tw-shadow:0 12px 45px var(--tw-shadow-color,#1fa7e166);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_12px_45px_rgba\(138\,63\,211\,0\.4\)\]:hover{--tw-shadow:0 12px 45px var(--tw-shadow-color,#8a3fd366);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_30px_rgba\(0\,0\,0\,0\.12\)\]:hover{--tw-shadow:0 16px 30px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_40px_-15px_rgba\(0\,0\,0\,0\.12\)\]:hover{--tw-shadow:0 16px 40px -15px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_16px_40px_rgba\(114\,116\,237\,0\.28\)\]:hover{--tw-shadow:0 16px 40px var(--tw-shadow-color,#7274ed47);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-orange-500\/30:hover{--tw-shadow-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-orange-500\/30:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-orange-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-pink-500\/35:hover{--tw-shadow-color:#f6339a59}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-pink-500\/35:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-pink-500) 35%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-purple-500\/30:hover{--tw-shadow-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-purple-500\/30:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-purple-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-sky-300\/50:hover{--tw-shadow-color:#c4b4ff80}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-sky-300\/50:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-violet-300) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-sky-500\/30:hover{--tw-shadow-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-sky-500\/30:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-violet-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:z-10:focus{z-index:10}.focus\:border-\[\#4f46e5\]:focus{border-color:#4f46e5}.focus\:border-\[\#7C3AED\]:focus{border-color:#7c3aed}.focus\:border-\[\#75D06A\]:focus{border-color:#75d06a}.focus\:border-\[\#a855f7\]:focus{border-color:#a855f7}.focus\:border-indigo-300:focus{border-color:var(--color-indigo-300)}.focus\:border-indigo-400:focus{border-color:var(--color-indigo-400)}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:border-indigo-600:focus{border-color:var(--color-indigo-600)}.focus\:border-primary:focus{border-color:var(--primary)}.focus\:border-purple-400:focus{border-color:var(--color-purple-400)}.focus\:border-sky-400:focus{border-color:var(--color-violet-400)}.focus\:border-sky-500:focus{border-color:var(--color-violet-500)}.focus\:border-sky-600:focus{border-color:var(--color-violet-600)}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:bg-primary:focus{background-color:var(--primary)}.focus\:bg-white:focus{background-color:var(--color-white)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:text-primary-foreground:focus{color:var(--primary-foreground)}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-4:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#4f46e5\]:focus{--tw-ring-color:#4f46e5}.focus\:ring-\[\#4f46e5\]\/20:focus{--tw-ring-color:oklab(51.0573% .0278994 -.228355/.2)}.focus\:ring-\[\#9956DE\]\/10:focus{--tw-ring-color:oklab(59.4745% .111053 -.167638/.1)}.focus\:ring-\[\#a855f7\]:focus{--tw-ring-color:#a855f7}.focus\:ring-\[\#a855f7\]\/10:focus{--tw-ring-color:oklab(62.6846% .129701 -.193012/.1)}.focus\:ring-\[\#a855f7\]\/20:focus{--tw-ring-color:oklab(62.6846% .129701 -.193012/.2)}.focus\:ring-\[\#a855f7\]\/30:focus{--tw-ring-color:oklab(62.6846% .129701 -.193012/.3)}.focus\:ring-indigo-100:focus{--tw-ring-color:var(--color-indigo-100)}.focus\:ring-indigo-200:focus{--tw-ring-color:var(--color-indigo-200)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:ring-indigo-500\/30:focus{--tw-ring-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/30:focus{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 30%, transparent)}}.focus\:ring-primary\/20:focus{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/20:focus{--tw-ring-color:color-mix(in oklab, var(--primary) 20%, transparent)}}.focus\:ring-purple-50:focus{--tw-ring-color:var(--color-purple-50)}.focus\:ring-purple-500\/20:focus{--tw-ring-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-purple-500\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-sky-100:focus{--tw-ring-color:var(--color-violet-100)}.focus\:ring-sky-200:focus{--tw-ring-color:var(--color-violet-200)}.focus\:ring-sky-400:focus{--tw-ring-color:var(--color-violet-400)}.focus\:ring-sky-400\/20:focus{--tw-ring-color:#a685ff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-400\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-violet-400) 20%, transparent)}}.focus\:ring-sky-500:focus{--tw-ring-color:var(--color-violet-500)}.focus\:ring-sky-500\/20:focus{--tw-ring-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.focus\:ring-sky-500\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-violet-500) 20%, transparent)}}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-\[\#9956DE\]:focus-visible{border-color:#9956de}.focus-visible\:border-indigo-500:focus-visible{border-color:var(--color-indigo-500)}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#8A3FD3\]\/50:focus-visible{--tw-ring-color:oklab(54.1025% .117281 -.181162/.5)}.focus-visible\:ring-\[\#9956DE\]\/20:focus-visible{--tw-ring-color:oklab(59.4745% .111053 -.167638/.2)}.focus-visible\:ring-\[\#a855f7\]:focus-visible{--tw-ring-color:#a855f7}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-indigo-500\/20:focus-visible{--tw-ring-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-indigo-500\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 20%, transparent)}}.focus-visible\:ring-purple-500\/20:focus-visible{--tw-ring-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-purple-500\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:translate-y-0:active{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.active\:translate-y-\[2px\]:active{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.active\:scale-90:active{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\:scale-\[0\.98\]:active{scale:.98}.active\:scale-\[0\.99\]:active{scale:.99}.active\:border-b-0:active{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:bg-slate-200:active{background-color:var(--color-slate-200)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.disabled\:opacity-70:disabled{opacity:.7}@media(hover:hover){.disabled\:hover\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:hover\:scale-100:disabled:hover{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\:hover\:bg-indigo-600:disabled:hover{background-color:var(--color-indigo-600)}.disabled\:hover\:text-\[\#a855f7\]:disabled:hover{color:#a855f7}.disabled\:hover\:shadow-sm:disabled:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-disabled\:opacity-50:has(:disabled){opacity:.5}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.aria-selected\:bg-accent[aria-selected=true]{background-color:var(--accent)}.aria-selected\:bg-primary[aria-selected=true]{background-color:var(--primary)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:var(--accent-foreground)}.aria-selected\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.aria-selected\:text-primary-foreground[aria-selected=true]{color:var(--primary-foreground)}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[active\=true\]\:z-10[data-active=true]{z-index:10}.data-\[active\=true\]\:border-ring[data-active=true]{border-color:var(--ring)}.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-accent-foreground[data-active=true]{color:var(--accent-foreground)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[active\=true\]\:ring-\[3px\][data-active=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}@media(hover:hover){.data-\[active\=true\]\:hover\:bg-accent[data-active=true]:hover{background-color:var(--accent)}}.data-\[active\=true\]\:focus\:bg-accent[data-active=true]:focus{background-color:var(--accent)}.data-\[active\=true\]\:aria-invalid\:border-destructive[data-active=true][aria-invalid=true]{border-color:var(--destructive)}.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-4[data-orientation=horizontal]{height:calc(var(--spacing) * 4)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing) * 44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing) * 1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing) * 0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing) * 1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:ring-0 *)[data-slot=navigation-menu-link]:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:outline-none *)[data-slot=navigation-menu-link]:focus{--tw-outline-style:none;outline-style:none}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:min-w-0>*)[data-slot=select-value]{min-width:calc(var(--spacing) * 0)}:is(.\*\:data-\[slot\=select-value\]\:flex-1>*)[data-slot=select-value]{flex:1}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}:is(.\*\:data-\[slot\=select-value\]\:truncate>*)[data-slot=select-value]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.data-\[state\=active\]\:bg-card[data-state=active]{background-color:var(--card)}.data-\[state\=active\]\:bg-gradient-to-r[data-state=active]{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.data-\[state\=active\]\:from-blue-600[data-state=active]{--tw-gradient-from:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.data-\[state\=active\]\:to-sky-500[data-state=active]{--tw-gradient-to:var(--color-violet-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.data-\[state\=active\]\:text-white[data-state=active]{color:var(--color-white)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-emerald-500[data-state=checked]{background-color:var(--color-emerald-500)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:bg-red-600[data-state=checked]{background-color:var(--color-red-600)}.data-\[state\=checked\]\:bg-sky-600[data-state=checked]{background-color:var(--color-violet-600)}.data-\[state\=checked\]\:bg-white[data-state=checked]{background-color:var(--color-white)}.data-\[state\=checked\]\:text-\[\#9956DE\][data-state=checked]{color:#9956de}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=on\]\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\[state\=on\]\:text-accent-foreground[data-state=on]{color:var(--accent-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open],.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}@media(hover:hover){.data-\[state\=open\]\:hover\:bg-accent[data-state=open]:hover{background-color:var(--accent)}.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=open\]\:focus\:bg-accent[data-state=open]:focus{background-color:var(--accent)}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-\[\#dde3eb\][data-state=unchecked]{background-color:#dde3eb}.data-\[state\=unchecked\]\:bg-slate-200[data-state=unchecked]{background-color:var(--color-slate-200)}.data-\[state\=unchecked\]\:bg-switch-background[data-state=unchecked]{background-color:var(--switch-background)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}.data-\[variant\=outline\]\:border-l-0[data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.data-\[variant\=outline\]\:shadow-xs[data-variant=outline]{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[variant\=outline\]\:first\:border-l[data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=bottom\]\:inset-x-0[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=bottom\]\:bottom-0[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=bottom\]\:mt-24[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing) * 24)}.data-\[vaul-drawer-direction\=bottom\]\:max-h-\[80vh\][data-vaul-drawer-direction=bottom]{max-height:80vh}.data-\[vaul-drawer-direction\=bottom\]\:rounded-t-lg[data-vaul-drawer-direction=bottom]{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.data-\[vaul-drawer-direction\=bottom\]\:border-t[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\[vaul-drawer-direction\=left\]\:inset-y-0[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=left\]\:left-0[data-vaul-drawer-direction=left]{left:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=left\]\:w-3\/4[data-vaul-drawer-direction=left]{width:75%}.data-\[vaul-drawer-direction\=left\]\:border-r[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\[vaul-drawer-direction\=right\]\:inset-y-0[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=right\]\:right-0[data-vaul-drawer-direction=right]{right:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=right\]\:w-3\/4[data-vaul-drawer-direction=right]{width:75%}.data-\[vaul-drawer-direction\=right\]\:border-l[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=top\]\:inset-x-0[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=top\]\:top-0[data-vaul-drawer-direction=top]{top:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=top\]\:mb-24[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing) * 24)}.data-\[vaul-drawer-direction\=top\]\:max-h-\[80vh\][data-vaul-drawer-direction=top]{max-height:80vh}.data-\[vaul-drawer-direction\=top\]\:rounded-b-lg[data-vaul-drawer-direction=top]{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[vaul-drawer-direction\=top\]\:border-b[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@media(min-width:40rem){.sm\:-top-8{top:calc(var(--spacing) * -8)}.sm\:-right-8{right:calc(var(--spacing) * -8)}.sm\:right-8{right:calc(var(--spacing) * 8)}.sm\:right-\[-15px\]{right:-15px}.sm\:bottom-8{bottom:calc(var(--spacing) * 8)}.sm\:left-12{left:calc(var(--spacing) * 12)}.sm\:-mx-6{margin-inline:calc(var(--spacing) * -6)}.sm\:mx-0{margin-inline:calc(var(--spacing) * 0)}.sm\:mx-2{margin-inline:calc(var(--spacing) * 2)}.sm\:mt-0{margin-top:calc(var(--spacing) * 0)}.sm\:mt-1{margin-top:calc(var(--spacing) * 1)}.sm\:mt-2{margin-top:calc(var(--spacing) * 2)}.sm\:mt-3{margin-top:calc(var(--spacing) * 3)}.sm\:mt-6{margin-top:calc(var(--spacing) * 6)}.sm\:mt-\[24px\]{margin-top:24px}.sm\:mb-0{margin-bottom:calc(var(--spacing) * 0)}.sm\:mb-3{margin-bottom:calc(var(--spacing) * 3)}.sm\:mb-4{margin-bottom:calc(var(--spacing) * 4)}.sm\:mb-5{margin-bottom:calc(var(--spacing) * 5)}.sm\:mb-6{margin-bottom:calc(var(--spacing) * 6)}.sm\:ml-auto{margin-left:auto}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:inline-block{display:inline-block}.sm\:size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20)}.sm\:h-2{height:calc(var(--spacing) * 2)}.sm\:h-4{height:calc(var(--spacing) * 4)}.sm\:h-5{height:calc(var(--spacing) * 5)}.sm\:h-6{height:calc(var(--spacing) * 6)}.sm\:h-7{height:calc(var(--spacing) * 7)}.sm\:h-8{height:calc(var(--spacing) * 8)}.sm\:h-10{height:calc(var(--spacing) * 10)}.sm\:h-11{height:calc(var(--spacing) * 11)}.sm\:h-12{height:calc(var(--spacing) * 12)}.sm\:h-14{height:calc(var(--spacing) * 14)}.sm\:h-16{height:calc(var(--spacing) * 16)}.sm\:h-20{height:calc(var(--spacing) * 20)}.sm\:h-28{height:calc(var(--spacing) * 28)}.sm\:h-32{height:calc(var(--spacing) * 32)}.sm\:h-\[90vh\]{height:90vh}.sm\:h-\[95px\]{height:95px}.sm\:h-\[115\%\]{height:115%}.sm\:h-\[125\%\]{height:125%}.sm\:h-\[140px\]{height:140px}.sm\:h-\[145px\]{height:145px}.sm\:h-\[245px\]{height:245px}.sm\:h-\[360px\]{height:360px}.sm\:h-\[450px\]{height:450px}.sm\:h-auto{height:auto}.sm\:max-h-\[85vh\]{max-height:85vh}.sm\:min-h-\[4rem\]{min-height:4rem}.sm\:min-h-\[130px\]{min-height:130px}.sm\:w-4{width:calc(var(--spacing) * 4)}.sm\:w-5{width:calc(var(--spacing) * 5)}.sm\:w-6{width:calc(var(--spacing) * 6)}.sm\:w-7{width:calc(var(--spacing) * 7)}.sm\:w-8{width:calc(var(--spacing) * 8)}.sm\:w-10{width:calc(var(--spacing) * 10)}.sm\:w-11{width:calc(var(--spacing) * 11)}.sm\:w-12{width:calc(var(--spacing) * 12)}.sm\:w-14{width:calc(var(--spacing) * 14)}.sm\:w-16{width:calc(var(--spacing) * 16)}.sm\:w-20{width:calc(var(--spacing) * 20)}.sm\:w-24{width:calc(var(--spacing) * 24)}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:w-32{width:calc(var(--spacing) * 32)}.sm\:w-64{width:calc(var(--spacing) * 64)}.sm\:w-\[32\%\]{width:32%}.sm\:w-\[40\%\]{width:40%}.sm\:w-\[100px\]{width:100px}.sm\:w-\[300px\]{width:300px}.sm\:w-\[450px\]{width:450px}.sm\:w-auto{width:auto}.sm\:max-w-4xl{max-width:var(--container-4xl)}.sm\:max-w-\[180px\]{max-width:180px}.sm\:max-w-\[220px\]{max-width:220px}.sm\:max-w-\[300px\]{max-width:300px}.sm\:max-w-\[400px\]{max-width:400px}.sm\:max-w-\[500px\]{max-width:500px}.sm\:max-w-\[600px\]{max-width:600px}.sm\:max-w-\[850px\]{max-width:850px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-md{max-width:var(--container-md)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:min-w-\[120px\]{min-width:120px}.sm\:min-w-\[140px\]{min-width:140px}.sm\:flex-none{flex:none}.sm\:-translate-x-\[60px\]{--tw-translate-x: -60px ;translate:var(--tw-translate-x) var(--tw-translate-y)}.sm\:translate-x-\[60px\]{--tw-translate-x:60px;translate:var(--tw-translate-x) var(--tw-translate-y)}.sm\:scale-\[0\.85\]{scale:.85}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:gap-0{gap:calc(var(--spacing) * 0)}.sm\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}.sm\:gap-2{gap:calc(var(--spacing) * 2)}.sm\:gap-2\.5{gap:calc(var(--spacing) * 2.5)}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:gap-5{gap:calc(var(--spacing) * 5)}.sm\:gap-6{gap:calc(var(--spacing) * 6)}.sm\:gap-8{gap:calc(var(--spacing) * 8)}.sm\:gap-\[10px\]{gap:10px}.sm\:gap-\[16px\]{gap:16px}.sm\:gap-\[18px\]{gap:18px}.sm\:gap-\[24px\]{gap:24px}:where(.sm\:space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.sm\:space-y-\[24px\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(24px * var(--tw-space-y-reverse));margin-block-end:calc(24px * calc(1 - var(--tw-space-y-reverse)))}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.sm\:self-auto{align-self:auto}.sm\:rounded-2xl{border-radius:var(--radius-2xl)}.sm\:rounded-\[1\.5rem\]{border-radius:1.5rem}.sm\:rounded-\[2rem\]{border-radius:2rem}.sm\:rounded-\[16px\]{border-radius:16px}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.sm\:rounded-t-\[40px\]{border-top-left-radius:40px;border-top-right-radius:40px}.sm\:rounded-b-\[40px\]{border-bottom-right-radius:40px;border-bottom-left-radius:40px}.sm\:p-2{padding:calc(var(--spacing) * 2)}.sm\:p-3{padding:calc(var(--spacing) * 3)}.sm\:p-4{padding:calc(var(--spacing) * 4)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:p-7{padding:calc(var(--spacing) * 7)}.sm\:p-8{padding:calc(var(--spacing) * 8)}.sm\:p-\[15px\]{padding:15px}.sm\:p-\[18px_20px\]{padding:18px 20px}.sm\:p-\[20px\]{padding:20px}.sm\:p-\[24px\]{padding:24px}.sm\:p-\[32px\]{padding:32px}.sm\:px-0{padding-inline:calc(var(--spacing) * 0)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:px-7{padding-inline:calc(var(--spacing) * 7)}.sm\:px-8{padding-inline:calc(var(--spacing) * 8)}.sm\:px-10{padding-inline:calc(var(--spacing) * 10)}.sm\:px-\[7px\]{padding-inline:7px}.sm\:py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.sm\:py-2{padding-block:calc(var(--spacing) * 2)}.sm\:py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.sm\:py-3{padding-block:calc(var(--spacing) * 3)}.sm\:py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.sm\:py-4{padding-block:calc(var(--spacing) * 4)}.sm\:py-6{padding-block:calc(var(--spacing) * 6)}.sm\:py-8{padding-block:calc(var(--spacing) * 8)}.sm\:pt-2{padding-top:calc(var(--spacing) * 2)}.sm\:pt-3{padding-top:calc(var(--spacing) * 3)}.sm\:pt-6{padding-top:calc(var(--spacing) * 6)}.sm\:pt-10{padding-top:calc(var(--spacing) * 10)}.sm\:pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.sm\:pb-0{padding-bottom:calc(var(--spacing) * 0)}.sm\:pb-3{padding-bottom:calc(var(--spacing) * 3)}.sm\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\:pb-28{padding-bottom:calc(var(--spacing) * 28)}.sm\:pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.sm\:pl-4{padding-left:calc(var(--spacing) * 4)}.sm\:pl-6{padding-left:calc(var(--spacing) * 6)}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.sm\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.sm\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.sm\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.sm\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.sm\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.sm\:text-\[9px\]{font-size:9px}.sm\:text-\[10px\]{font-size:10px}.sm\:text-\[11px\]{font-size:11px}.sm\:text-\[12px\]{font-size:12px}.sm\:text-\[13px\]{font-size:13px}.sm\:text-\[16px\]{font-size:16px}.sm\:text-\[26px\]{font-size:26px}.sm\:text-\[28px\]{font-size:28px}.sm\:text-\[32px\]{font-size:32px}.sm\:text-\[40px\]{font-size:40px}.sm\:tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.data-\[vaul-drawer-direction\=left\]\:sm\:max-w-sm[data-vaul-drawer-direction=left],.data-\[vaul-drawer-direction\=right\]\:sm\:max-w-sm[data-vaul-drawer-direction=right]{max-width:var(--container-sm)}}@media(min-width:48rem){.md\:absolute{position:absolute}.md\:-top-7{top:calc(var(--spacing) * -7)}.md\:-top-8{top:calc(var(--spacing) * -8)}.md\:right-4{right:calc(var(--spacing) * 4)}.md\:right-10{right:calc(var(--spacing) * 10)}.md\:-bottom-7{bottom:calc(var(--spacing) * -7)}.md\:-bottom-8{bottom:calc(var(--spacing) * -8)}.md\:left-4{left:calc(var(--spacing) * 4)}.md\:left-16{left:calc(var(--spacing) * 16)}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-3{grid-column:span 3/span 3}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-6{grid-column:span 6/span 6}.md\:col-span-9{grid-column:span 9/span 9}.md\:mx-0{margin-inline:calc(var(--spacing) * 0)}.md\:mt-1{margin-top:calc(var(--spacing) * 1)}.md\:mt-2{margin-top:calc(var(--spacing) * 2)}.md\:mt-6{margin-top:calc(var(--spacing) * 6)}.md\:mt-8{margin-top:calc(var(--spacing) * 8)}.md\:mt-12{margin-top:calc(var(--spacing) * 12)}.md\:mt-\[-40px\]{margin-top:-40px}.md\:mr-2{margin-right:calc(var(--spacing) * 2)}.md\:mr-4{margin-right:calc(var(--spacing) * 4)}.md\:mb-1{margin-bottom:calc(var(--spacing) * 1)}.md\:mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.md\:mb-2{margin-bottom:calc(var(--spacing) * 2)}.md\:mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.md\:mb-3{margin-bottom:calc(var(--spacing) * 3)}.md\:mb-4{margin-bottom:calc(var(--spacing) * 4)}.md\:mb-5{margin-bottom:calc(var(--spacing) * 5)}.md\:mb-6{margin-bottom:calc(var(--spacing) * 6)}.md\:ml-2{margin-left:calc(var(--spacing) * 2)}.md\:ml-16{margin-left:calc(var(--spacing) * 16)}.md\:line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.md\:block{display:block}.md\:flex{display:flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:table-cell{display:table-cell}.md\:h-2{height:calc(var(--spacing) * 2)}.md\:h-3{height:calc(var(--spacing) * 3)}.md\:h-4{height:calc(var(--spacing) * 4)}.md\:h-5{height:calc(var(--spacing) * 5)}.md\:h-6{height:calc(var(--spacing) * 6)}.md\:h-7{height:calc(var(--spacing) * 7)}.md\:h-9{height:calc(var(--spacing) * 9)}.md\:h-10{height:calc(var(--spacing) * 10)}.md\:h-11{height:calc(var(--spacing) * 11)}.md\:h-12{height:calc(var(--spacing) * 12)}.md\:h-14{height:calc(var(--spacing) * 14)}.md\:h-16{height:calc(var(--spacing) * 16)}.md\:h-20{height:calc(var(--spacing) * 20)}.md\:h-32{height:calc(var(--spacing) * 32)}.md\:h-40{height:calc(var(--spacing) * 40)}.md\:h-48{height:calc(var(--spacing) * 48)}.md\:h-\[10px\]{height:10px}.md\:h-\[72px\]{height:72px}.md\:h-\[85vh\]{height:85vh}.md\:h-\[86px\]{height:86px}.md\:h-\[100px\]{height:100px}.md\:h-\[130px\]{height:130px}.md\:h-\[180px\]{height:180px}.md\:h-\[310px\]{height:310px}.md\:h-\[400vw\]{height:400vw}.md\:h-\[calc\(100\%-24px\)\]{height:calc(100% - 24px)}.md\:h-auto{height:auto}.md\:min-h-\[5rem\]{min-height:5rem}.md\:min-h-\[290px\]{min-height:290px}.md\:w-2{width:calc(var(--spacing) * 2)}.md\:w-3{width:calc(var(--spacing) * 3)}.md\:w-4{width:calc(var(--spacing) * 4)}.md\:w-5{width:calc(var(--spacing) * 5)}.md\:w-6{width:calc(var(--spacing) * 6)}.md\:w-9{width:calc(var(--spacing) * 9)}.md\:w-10{width:calc(var(--spacing) * 10)}.md\:w-11{width:calc(var(--spacing) * 11)}.md\:w-12{width:calc(var(--spacing) * 12)}.md\:w-14{width:calc(var(--spacing) * 14)}.md\:w-20{width:calc(var(--spacing) * 20)}.md\:w-32{width:calc(var(--spacing) * 32)}.md\:w-40{width:calc(var(--spacing) * 40)}.md\:w-48{width:calc(var(--spacing) * 48)}.md\:w-64{width:calc(var(--spacing) * 64)}.md\:w-80{width:calc(var(--spacing) * 80)}.md\:w-\[10px\]{width:10px}.md\:w-\[72px\]{width:72px}.md\:w-\[86px\]{width:86px}.md\:w-\[150px\]{width:150px}.md\:w-\[200vw\]{width:200vw}.md\:w-\[300px\]{width:300px}.md\:w-\[320px\]{width:320px}.md\:w-\[400vw\]{width:400vw}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[200px\]{max-width:200px}.md\:max-w-\[220px\]{max-width:220px}.md\:max-w-\[280px\]{max-width:280px}.md\:max-w-\[300px\]{max-width:300px}.md\:max-w-\[320px\]{max-width:320px}.md\:max-w-none{max-width:none}.md\:min-w-0{min-width:calc(var(--spacing) * 0)}.md\:min-w-\[320px\]{min-width:320px}.md\:shrink{flex-shrink:1}.md\:translate-y-\[21\%\]{--tw-translate-y:21%;translate:var(--tw-translate-x) var(--tw-translate-y)}.md\:scale-\[1\.25\]{scale:1.25}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.md\:flex-col{flex-direction:column}.md\:flex-row{flex-direction:row}.md\:flex-nowrap{flex-wrap:nowrap}.md\:items-center{align-items:center}.md\:items-start{align-items:flex-start}.md\:justify-start{justify-content:flex-start}.md\:gap-1{gap:calc(var(--spacing) * 1)}.md\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}.md\:gap-2{gap:calc(var(--spacing) * 2)}.md\:gap-3{gap:calc(var(--spacing) * 3)}.md\:gap-4{gap:calc(var(--spacing) * 4)}.md\:gap-5{gap:calc(var(--spacing) * 5)}.md\:gap-6{gap:calc(var(--spacing) * 6)}:where(.md\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.md\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}.md\:self-auto{align-self:auto}.md\:overflow-visible{overflow:visible}.md\:rounded-2xl{border-radius:var(--radius-2xl)}.md\:rounded-3xl{border-radius:var(--radius-3xl)}.md\:rounded-\[1\.4rem\]{border-radius:1.4rem}.md\:rounded-\[2rem\]{border-radius:2rem}.md\:rounded-\[14px\]{border-radius:14px}.md\:rounded-lg{border-radius:var(--radius)}.md\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\:rounded-t-xl{border-top-left-radius:calc(var(--radius) + 4px);border-top-right-radius:calc(var(--radius) + 4px)}.md\:border{border-style:var(--tw-border-style);border-width:1px}.md\:bg-transparent{background-color:#0000}.md\:p-3{padding:calc(var(--spacing) * 3)}.md\:p-4{padding:calc(var(--spacing) * 4)}.md\:p-5{padding:calc(var(--spacing) * 5)}.md\:p-6{padding:calc(var(--spacing) * 6)}.md\:p-8{padding:calc(var(--spacing) * 8)}.md\:px-0{padding-inline:calc(var(--spacing) * 0)}.md\:px-1{padding-inline:calc(var(--spacing) * 1)}.md\:px-2{padding-inline:calc(var(--spacing) * 2)}.md\:px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.md\:px-3{padding-inline:calc(var(--spacing) * 3)}.md\:px-4{padding-inline:calc(var(--spacing) * 4)}.md\:px-5{padding-inline:calc(var(--spacing) * 5)}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:px-8{padding-inline:calc(var(--spacing) * 8)}.md\:px-10{padding-inline:calc(var(--spacing) * 10)}.md\:py-1{padding-block:calc(var(--spacing) * 1)}.md\:py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.md\:py-2{padding-block:calc(var(--spacing) * 2)}.md\:py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.md\:py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.md\:py-4{padding-block:calc(var(--spacing) * 4)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}.md\:pt-0{padding-top:calc(var(--spacing) * 0)}.md\:pt-4{padding-top:calc(var(--spacing) * 4)}.md\:pt-6{padding-top:calc(var(--spacing) * 6)}.md\:pr-0{padding-right:calc(var(--spacing) * 0)}.md\:pr-4{padding-right:calc(var(--spacing) * 4)}.md\:pr-10{padding-right:calc(var(--spacing) * 10)}.md\:pr-40{padding-right:calc(var(--spacing) * 40)}.md\:pr-\[240px\]{padding-right:240px}.md\:pb-0{padding-bottom:calc(var(--spacing) * 0)}.md\:pb-5{padding-bottom:calc(var(--spacing) * 5)}.md\:pl-6{padding-left:calc(var(--spacing) * 6)}.md\:pl-16{padding-left:calc(var(--spacing) * 16)}.md\:pl-20{padding-left:calc(var(--spacing) * 20)}.md\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.md\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.md\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.md\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.md\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.md\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.md\:text-\[8px\]{font-size:8px}.md\:text-\[10px\]{font-size:10px}.md\:text-\[11px\]{font-size:11px}.md\:text-\[12px\]{font-size:12px}.md\:text-\[13px\]{font-size:13px}.md\:text-\[15px\]{font-size:15px}.md\:text-\[16px\]{font-size:16px}.md\:text-\[17px\]{font-size:17px}.md\:text-\[18px\]{font-size:18px}.md\:text-\[22px\]{font-size:22px}.md\:text-\[24px\]{font-size:24px}.md\:text-\[26px\]{font-size:26px}.md\:text-\[32px\]{font-size:32px}.md\:text-\[44px\]{font-size:44px}.md\:text-\[70px\]{font-size:70px}.md\:text-\[80px\]{font-size:80px}.md\:text-\[110px\]{font-size:110px}.md\:text-\[140px\]{font-size:140px}.md\:leading-\[1\.1\]{--tw-leading:1.1;line-height:1.1}.md\:leading-\[1\.7\]{--tw-leading:1.7;line-height:1.7}.md\:leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.md\:whitespace-normal{white-space:normal}.md\:opacity-0{opacity:0}.md\:shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing) * 2)}.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing) * 0)}.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing) * 2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media(min-width:64rem){.lg\:static{position:static}.lg\:top-\[5px\]{top:5px}.lg\:right-10{right:calc(var(--spacing) * 10)}.lg\:right-\[-15px\]{right:-15px}.lg\:right-\[250px\]{right:250px}.lg\:bottom-20{bottom:calc(var(--spacing) * 20)}.lg\:z-auto{z-index:auto}.lg\:col-span-1{grid-column:span 1/span 1}.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:-mx-4{margin-inline:calc(var(--spacing) * -4)}.lg\:mx-0{margin-inline:calc(var(--spacing) * 0)}.lg\:-mt-4{margin-top:calc(var(--spacing) * -4)}.lg\:mb-3{margin-bottom:calc(var(--spacing) * 3)}.lg\:mb-6{margin-bottom:calc(var(--spacing) * 6)}.lg\:mb-8{margin-bottom:calc(var(--spacing) * 8)}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:table-cell{display:table-cell}.lg\:h-8{height:calc(var(--spacing) * 8)}.lg\:h-9{height:calc(var(--spacing) * 9)}.lg\:h-12{height:calc(var(--spacing) * 12)}.lg\:h-16{height:calc(var(--spacing) * 16)}.lg\:h-\[265px\]{height:265px}.lg\:min-h-0{min-height:calc(var(--spacing) * 0)}.lg\:min-h-\[160px\]{min-height:160px}.lg\:w-8{width:calc(var(--spacing) * 8)}.lg\:w-9{width:calc(var(--spacing) * 9)}.lg\:w-12{width:calc(var(--spacing) * 12)}.lg\:w-16{width:calc(var(--spacing) * 16)}.lg\:w-\[35\%\]{width:35%}.lg\:w-\[65\%\]{width:65%}.lg\:w-\[260px\]{width:260px}.lg\:w-\[270px\]{width:270px}.lg\:w-auto{width:auto}.lg\:w-full{width:100%}.lg\:w-max{width:max-content}.lg\:translate-y-\[19\%\]{--tw-translate-y:19%;translate:var(--tw-translate-x) var(--tw-translate-y)}.lg\:scale-\[1\.3\]{scale:1.3}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-\[1fr_300px\]{grid-template-columns:1fr 300px}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:items-start{align-items:flex-start}.lg\:justify-end{justify-content:flex-end}.lg\:justify-start{justify-content:flex-start}.lg\:gap-3{gap:calc(var(--spacing) * 3)}.lg\:gap-5{gap:calc(var(--spacing) * 5)}.lg\:gap-6{gap:calc(var(--spacing) * 6)}.lg\:gap-10{gap:calc(var(--spacing) * 10)}.lg\:gap-12{gap:calc(var(--spacing) * 12)}.lg\:gap-14{gap:calc(var(--spacing) * 14)}:where(.lg\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.lg\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.lg\:space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.lg\:p-4{padding:calc(var(--spacing) * 4)}.lg\:p-8{padding:calc(var(--spacing) * 8)}.lg\:p-\[32px\]{padding:32px}.lg\:px-8{padding-inline:calc(var(--spacing) * 8)}.lg\:px-10{padding-inline:calc(var(--spacing) * 10)}.lg\:py-8{padding-block:calc(var(--spacing) * 8)}.lg\:pt-6{padding-top:calc(var(--spacing) * 6)}.lg\:pr-\[280px\]{padding-right:280px}.lg\:text-left{text-align:left}.lg\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.lg\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.lg\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.lg\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.lg\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.lg\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.lg\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.lg\:text-\[11px\]{font-size:11px}.lg\:text-\[18px\]{font-size:18px}.lg\:text-\[46px\]{font-size:46px}}@media(min-width:80rem){.xl\:right-\[32px\]{right:32px}.xl\:col-span-1{grid-column:span 1/span 1}.xl\:col-span-2{grid-column:span 2/span 2}.xl\:col-span-3{grid-column:span 3/span 3}.xl\:col-span-4{grid-column:span 4/span 4}.xl\:col-span-5{grid-column:span 5/span 5}.xl\:col-span-7{grid-column:span 7/span 7}.xl\:col-span-8{grid-column:span 8/span 8}.xl\:col-span-9{grid-column:span 9/span 9}.xl\:-mx-10{margin-inline:calc(var(--spacing) * -10)}.xl\:-mx-\[32px\]{margin-inline:-32px}.xl\:mx-0{margin-inline:calc(var(--spacing) * 0)}.xl\:mb-8{margin-bottom:calc(var(--spacing) * 8)}.xl\:flex{display:flex}.xl\:h-\[80vh\]{height:80vh}.xl\:h-\[600px\]{height:600px}.xl\:h-full{height:100%}.xl\:max-h-\[700px\]{max-height:700px}.xl\:min-h-\[120px\]{min-height:120px}.xl\:w-1\/3{width:33.3333%}.xl\:w-2\/3{width:66.6667%}.xl\:w-\[30\%\]{width:30%}.xl\:w-\[50\%\]{width:50%}.xl\:w-\[70\%\]{width:70%}.xl\:w-\[200px\]{width:200px}.xl\:w-\[350px\]{width:350px}.xl\:w-\[calc\(100\%\+64px\)\]{width:calc(100% + 64px)}.xl\:w-auto{width:auto}.xl\:max-w-\[1080px\]{max-width:1080px}.xl\:max-w-\[1400px\]{max-width:1400px}.xl\:max-w-none{max-width:none}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.xl\:grid-cols-\[1fr_320px\]{grid-template-columns:1fr 320px}.xl\:flex-row{flex-direction:row}.xl\:items-center{align-items:center}.xl\:justify-start{justify-content:flex-start}.xl\:gap-12{gap:calc(var(--spacing) * 12)}.xl\:self-center{align-self:center}.xl\:overflow-hidden{overflow:hidden}.xl\:p-\[32px\]{padding:32px}.xl\:px-8{padding-inline:calc(var(--spacing) * 8)}.xl\:px-10{padding-inline:calc(var(--spacing) * 10)}.xl\:px-\[32px\]{padding-inline:32px}.xl\:py-\[32px\]{padding-block:32px}.xl\:pt-4{padding-top:calc(var(--spacing) * 4)}.xl\:pt-8{padding-top:calc(var(--spacing) * 8)}.xl\:pb-0{padding-bottom:calc(var(--spacing) * 0)}.xl\:text-\[3\.4rem\]{font-size:3.4rem}}@media(min-width:96rem){.\32xl\:block{display:block}.\32xl\:w-\[340px\]{width:340px}}.dark\:border-\[\#1FA7E1\]\/20:is(.dark *){border-color:#1fa7e133}.dark\:border-\[\#2b3140\]:is(.dark *){border-color:#2b3140}.dark\:border-\[\#2f3547\]:is(.dark *){border-color:#2f3547}.dark\:border-\[\#8A3FD3\]\/20:is(.dark *){border-color:#8a3fd333}.dark\:border-\[\#8A3FD3\]\/30:is(.dark *){border-color:#8a3fd34d}.dark\:border-amber-400\/40:is(.dark *){border-color:#fcbb0066}@supports (color:color-mix(in lab,red,red)){.dark\:border-amber-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-amber-400) 40%,transparent)}}.dark\:border-emerald-400\/40:is(.dark *){border-color:#00d29466}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-400) 40%,transparent)}}.dark\:border-emerald-500\/40:is(.dark *){border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-500\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.dark\:border-gray-600:is(.dark *){border-color:var(--color-gray-600)}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:border-purple-700\/50:is(.dark *){border-color:#8200da80}@supports (color:color-mix(in lab,red,red)){.dark\:border-purple-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-purple-700) 50%,transparent)}}.dark\:border-rose-400\/40:is(.dark *){border-color:#ff667f66}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-400\/40:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-400) 40%,transparent)}}.dark\:border-rose-500\/20:is(.dark *){border-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.dark\:border-rose-500\/20:is(.dark *){border-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.dark\:border-rose-900:is(.dark *){border-color:var(--color-rose-900)}.dark\:border-sky-700\/50:is(.dark *){border-color:#7008e780}@supports (color:color-mix(in lab,red,red)){.dark\:border-sky-700\/50:is(.dark *){border-color:color-mix(in oklab,var(--color-violet-700) 50%,transparent)}}.dark\:border-slate-700:is(.dark *){border-color:var(--color-slate-700)}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:border-white\/10:is(.dark *){border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.dark\:bg-\[\#1a1f2e\]\/90:is(.dark *){background-color:#1a1f2ee6}.dark\:bg-\[\#2a3143\]:is(.dark *){background-color:#2a3143}.dark\:bg-\[\#2b2b5f\]:is(.dark *){background-color:#2b2b5f}.dark\:bg-\[\#8A3FD3\]\/10:is(.dark *){background-color:#8a3fd31a}.dark\:bg-\[\#181d27\]:is(.dark *){background-color:#181d27}.dark\:bg-\[\#11151d\]:is(.dark *){background-color:#11151d}.dark\:bg-\[\#15803d\]:is(.dark *){background-color:#15803d}.dark\:bg-\[\#b45309\]:is(.dark *){background-color:#b45309}.dark\:bg-\[\#be123c\]:is(.dark *){background-color:#be123c}.dark\:bg-amber-100\/20:is(.dark *){background-color:#fef3c633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-100\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-100) 20%,transparent)}}.dark\:bg-amber-400\/10:is(.dark *){background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-400\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-400) 10%,transparent)}}.dark\:bg-amber-900\/20:is(.dark *){background-color:#7b330633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-amber-900) 20%,transparent)}}.dark\:bg-black\/30:is(.dark *){background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/30:is(.dark *){background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.dark\:bg-black\/40:is(.dark *){background-color:#0006}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/40:is(.dark *){background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.dark\:bg-black\/50:is(.dark *){background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.dark\:bg-black\/80:is(.dark *){background-color:#000c}@supports (color:color-mix(in lab,red,red)){.dark\:bg-black\/80:is(.dark *){background-color:color-mix(in oklab,var(--color-black) 80%,transparent)}}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 60%,transparent)}}.dark\:bg-emerald-500\/10:is(.dark *){background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.dark\:bg-emerald-500\/30:is(.dark *){background-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-500\/30:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.dark\:bg-emerald-900\/20:is(.dark *){background-color:#004e3b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-900) 20%,transparent)}}.dark\:bg-gray-800:is(.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-900:is(.dark *){background-color:var(--color-gray-900)}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:bg-purple-900\/50:is(.dark *){background-color:#59168b80}@supports (color:color-mix(in lab,red,red)){.dark\:bg-purple-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-purple-900) 50%,transparent)}}.dark\:bg-rose-500\/10:is(.dark *){background-color:#ff23571a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-500\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-rose-500) 10%,transparent)}}.dark\:bg-rose-900\/20:is(.dark *){background-color:#8b083633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-rose-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-rose-900) 20%,transparent)}}.dark\:bg-sky-900\/50:is(.dark *){background-color:#4d179a80}@supports (color:color-mix(in lab,red,red)){.dark\:bg-sky-900\/50:is(.dark *){background-color:color-mix(in oklab,var(--color-violet-900) 50%,transparent)}}.dark\:from-\[\#2b2b5f\]:is(.dark *){--tw-gradient-from:#2b2b5f;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-purple-300:is(.dark *){--tw-gradient-from:var(--color-purple-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.dark\:from-purple-500\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-sky-300:is(.dark *){--tw-gradient-from:var(--color-violet-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-from:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-from:color-mix(in oklab, var(--color-violet-500) 20%, transparent)}}.dark\:from-sky-500\/20:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab, var(--color-cyan-500) 10%, transparent)}}.dark\:via-cyan-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via:#e12afb1a}@supports (color:color-mix(in lab,red,red)){.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via:color-mix(in oklab, var(--color-fuchsia-500) 10%, transparent)}}.dark\:via-fuchsia-500\/10:is(.dark *){--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:to-cyan-200:is(.dark *){--tw-gradient-to:var(--color-cyan-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-fuchsia-200:is(.dark *){--tw-gradient-to:var(--color-fuchsia-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-to:#59168b1a}@supports (color:color-mix(in lab,red,red)){.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab, var(--color-purple-900) 10%, transparent)}}.dark\:to-purple-900\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-to:#4d179a1a}@supports (color:color-mix(in lab,red,red)){.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab, var(--color-violet-900) 10%, transparent)}}.dark\:to-sky-900\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:text-\[\#4bc1f2\]:is(.dark *){color:#4bc1f2}.dark\:text-\[\#7ad8ff\]:is(.dark *){color:#7ad8ff}.dark\:text-\[\#7f88a3\]:is(.dark *){color:#7f88a3}.dark\:text-\[\#8b95ad\]:is(.dark *){color:#8b95ad}.dark\:text-\[\#9aa4be\]:is(.dark *){color:#9aa4be}.dark\:text-\[\#9e8fff\]:is(.dark *){color:#9e8fff}.dark\:text-\[\#95a0bb\]:is(.dark *){color:#95a0bb}.dark\:text-\[\#a8b2c9\]:is(.dark *){color:#a8b2c9}.dark\:text-\[\#a35ceb\]:is(.dark *){color:#a35ceb}.dark\:text-\[\#aab3c7\]:is(.dark *){color:#aab3c7}.dark\:text-\[\#b2bad0\]:is(.dark *){color:#b2bad0}.dark\:text-\[\#c48bfc\]:is(.dark *){color:#c48bfc}.dark\:text-\[\#d3a8ff\]:is(.dark *){color:#d3a8ff}.dark\:text-\[\#e4e7f1\]:is(.dark *){color:#e4e7f1}.dark\:text-\[\#ecf0fb\]:is(.dark *){color:#ecf0fb}.dark\:text-\[\#f5f7fb\]:is(.dark *){color:#f5f7fb}.dark\:text-amber-100:is(.dark *){color:var(--color-amber-100)}.dark\:text-amber-100\/90:is(.dark *){color:#fef3c6e6}@supports (color:color-mix(in lab,red,red)){.dark\:text-amber-100\/90:is(.dark *){color:color-mix(in oklab,var(--color-amber-100) 90%,transparent)}}.dark\:text-amber-200:is(.dark *){color:var(--color-amber-200)}.dark\:text-amber-300:is(.dark *){color:var(--color-amber-300)}.dark\:text-amber-400:is(.dark *){color:var(--color-amber-400)}.dark\:text-emerald-300:is(.dark *){color:var(--color-emerald-300)}.dark\:text-emerald-400:is(.dark *){color:var(--color-emerald-400)}.dark\:text-gray-400:is(.dark *){color:var(--color-gray-400)}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}.dark\:text-purple-300:is(.dark *){color:var(--color-purple-300)}.dark\:text-purple-400:is(.dark *){color:var(--color-purple-400)}.dark\:text-purple-400\/80:is(.dark *){color:#c07effcc}@supports (color:color-mix(in lab,red,red)){.dark\:text-purple-400\/80:is(.dark *){color:color-mix(in oklab,var(--color-purple-400) 80%,transparent)}}.dark\:text-rose-300:is(.dark *){color:var(--color-rose-300)}.dark\:text-rose-400:is(.dark *){color:var(--color-rose-400)}.dark\:text-sky-300:is(.dark *){color:var(--color-violet-300)}.dark\:text-sky-400:is(.dark *){color:var(--color-violet-400)}.dark\:text-sky-400\/80:is(.dark *){color:#a685ffcc}@supports (color:color-mix(in lab,red,red)){.dark\:text-sky-400\/80:is(.dark *){color:color-mix(in oklab,var(--color-violet-400) 80%,transparent)}}.dark\:text-slate-200:is(.dark *){color:var(--color-slate-200)}.dark\:text-slate-400:is(.dark *){color:var(--color-slate-400)}.dark\:text-white:is(.dark *){color:var(--color-white)}.dark\:opacity-10:is(.dark *){opacity:.1}.dark\:opacity-\[0\.25\]:is(.dark *){opacity:.25}.dark\:mix-blend-screen:is(.dark *){mix-blend-mode:screen}.dark\:shadow-\[0_12px_24px_rgba\(0\,0\,0\,0\.22\)\]:is(.dark *){--tw-shadow:0 12px 24px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:ring-offset-\[\#0B0F19\]:is(.dark *){--tw-ring-offset-color:#0b0f19}@media(hover:hover){.dark\:hover\:bg-\[\#1FA7E1\]\/10:is(.dark *):hover{background-color:#1fa7e11a}.dark\:hover\:bg-\[\#8A3FD3\]\/10:is(.dark *):hover{background-color:#8a3fd31a}.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.dark\:hover\:bg-black\/50:is(.dark *):hover{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-black\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.dark\:hover\:bg-black\/60:is(.dark *):hover{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-black\/60:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.dark\:hover\:bg-emerald-500\/20:is(.dark *):hover{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-emerald-500\/20:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.dark\:hover\:bg-rose-900\/30:is(.dark *):hover{background-color:#8b08364d}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-rose-900\/30:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-rose-900) 30%,transparent)}}.dark\:hover\:bg-slate-800:is(.dark *):hover{background-color:var(--color-slate-800)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-card-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--card-foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:var(--muted-foreground)}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:color-mix(in oklab,var(--border) 50%,transparent)}}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:var(--border)}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:#0000}.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:var(--muted)}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:#0000}.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{outline-offset:2px;outline:2px solid #0000}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing) * 0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:var(--accent)}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:first-child:has([aria-selected]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:last-child:has([aria-selected]),.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\:last-child\]\:pb-6:last-child{padding-bottom:calc(var(--spacing) * 6)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>button\]\:hidden>button,.\[\&\>button\:last-child\]\:hidden>button:last-child{display:none}.\[\&\>span\]\:flex>span{display:flex}.\[\&\>span\]\:items-center>span{align-items:center}.\[\&\>span\]\:gap-2>span{gap:calc(var(--spacing) * 2)}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:size-3\.5>svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:h-2\.5>svg{height:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:h-3>svg{height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:w-2\.5>svg{width:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:w-3>svg{width:calc(var(--spacing) * 3)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentColor}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{rotate:180deg}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing) * -2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing) * -2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}@media(hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary) 90%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}:root{--font-size:16px;--font-display:"Nunito", ui-sans-serif, system-ui, sans-serif;--font-body:"Nunito", ui-sans-serif, system-ui, sans-serif;--background:#f7f9fc;--foreground:#0a1628;--card:#fff;--card-foreground:#0a1628;--popover:#fff;--popover-foreground:#0a1628;--amethyst:#9956de;--slate-blue:#7274ed;--summer-sky:#1fa7e1;--downy:#6ed1cf;--pastel-green:#75d06a;--texas-rose:#ffb356;--mona-lisa:#ff8b8b;--illusion:#fb96bb;--primary:#9956de;--primary-foreground:#fff;--secondary:#7274ed;--secondary-foreground:#fff;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#1fa7e1;--accent-foreground:#fff;--destructive:#ff8b8b;--destructive-foreground:#fff;--border:#e4e4e7;--input:transparent;--input-background:#f4f4f5;--switch-background:#d4d4d8;--font-weight-medium:500;--font-weight-normal:400;--ring:#9956de;--chart-1:#9956de;--chart-2:#ff8b8b;--chart-3:#75d06a;--chart-4:#ffb356;--chart-5:#1fa7e1;--radius:1.25rem;--sidebar:#fff;--sidebar-foreground:#09090b;--sidebar-primary:#7c3aed;--sidebar-primary-foreground:#fff;--sidebar-accent:#f3f0ff;--sidebar-accent-foreground:#5b21b6;--sidebar-border:#e4e4e7;--sidebar-ring:#7c3aed}.dark{--background:#050d18;--foreground:#f0f7ff;--card:#0a1628;--card-foreground:#f0f7ff;--popover:#0a1628;--popover-foreground:#f0f7ff;--primary:#a78bfa;--primary-foreground:#fff;--secondary:#2e1065;--secondary-foreground:#c4b5fd;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#f43f5e;--destructive:#ef4444;--destructive-foreground:#09090b;--border:#27272a;--input:#27272a;--input-background:#27272a;--switch-background:#3f3f46;--ring:#a78bfa;--font-weight-medium:500;--font-weight-normal:400;--chart-1:#a78bfa;--chart-2:#fb7185;--chart-3:#34d399;--chart-4:#fb923c;--chart-5:#38bdf8;--sidebar:#09090b;--sidebar-foreground:#fafafa;--sidebar-primary:#a78bfa;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#fafafa;--sidebar-border:#27272a;--sidebar-ring:#a78bfa}html{font-size:var(--font-size)}html,body,#root{height:100%}html[data-density=compact]{--radius:.9rem}html.reduced-motion *,html.reduced-motion :before,html.reduced-motion :after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}html.smart-dark{filter:invert()hue-rotate(180deg);background:#101217}html.smart-dark img,html.smart-dark picture,html.smart-dark video,html.smart-dark canvas,html.smart-dark svg,html.smart-dark iframe,html.smart-dark [data-preserve-color=true]{filter:invert()hue-rotate(180deg)}.font-display{font-family:var(--font-display)}.font-body{font-family:var(--font-body)}.glow-blue{box-shadow:0 0 24px #0284c71f,0 0 64px #0284c70a}.glow-violet{box-shadow:0 0 24px #7c3aed1f,0 0 64px #7c3aed0a}.glow-rose{box-shadow:0 0 24px #f43f5e1f,0 0 64px #f43f5e0a}.glow-emerald{box-shadow:0 0 24px #0596691f,0 0 64px #0596690a}.bg-dot-pattern{background-image:radial-gradient(circle,#7c3aed14 1px,#0000 1px);background-size:24px 24px}.dark .bg-dot-pattern{background-image:radial-gradient(circle,#a78bfa1f 1px,#0000 1px)}.bg-math-pattern{background-color:var(--background);background-image:url("data:image/svg+xml,%3Csvg width='150' height='150' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgba(124, 58, 237, 0.05)' font-family='sans-serif' font-weight='bold' font-size='28'%3E%3Ctext x='20' y='40'%3E%2B%3C/text%3E%3Ctext x='90' y='60'%3E%3D%3C/text%3E%3Ctext x='40' y='110'%3E%25%3C/text%3E%3Ctext x='110' y='130'%3E%C3%97%3C/text%3E%3Ctext x='130' y='30'%3E%C3%B7%3C/text%3E%3C/g%3E%3C/svg%3E");background-size:150px 150px}.lesson-welcome-card{font-family:var(--font-body);position:relative;overflow:hidden}.lesson-welcome-card:before{content:"";pointer-events:none;z-index:0;border-radius:inherit;background-image:url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgba(26,133,164,0.06)' font-family='sans-serif' font-weight='900' font-size='36'%3E%3Ctext x='10' y='50'%3E%2B%3C/text%3E%3Ctext x='120' y='80'%3E%3D%3C/text%3E%3Ctext x='50' y='140'%3E%CF%80%3C/text%3E%3Ctext x='150' y='170'%3E%C3%97%3C/text%3E%3Ctext x='170' y='40'%3E%E2%88%91%3C/text%3E%3Ctext x='80' y='190'%3E%C3%B7%3C/text%3E%3C/g%3E%3C/svg%3E");background-size:200px 200px;position:absolute;inset:0}.lesson-welcome-card>*{z-index:1;position:relative}.lesson-section-heading{font-family:var(--font-display);letter-spacing:-.02em;font-weight:800;line-height:1.2}.lesson-body-text{font-family:var(--font-body);color:#334155;font-size:1rem;line-height:1.75}.lesson-callout-headsup{background:linear-gradient(135deg,#fffbeb,#fef3c7);border:2px solid #f59e0b;border-left-width:5px;border-radius:1rem;padding:1rem 1.25rem;position:relative;overflow:hidden}.lesson-callout-headsup:after{content:"⚠";opacity:.06;pointer-events:none;font-size:3rem;position:absolute;top:50%;right:1rem;transform:translateY(-50%)}.lesson-formula-box{text-align:center;color:#92400e;letter-spacing:.03em;background:linear-gradient(135deg,#fffbeb,#fef9ee);border:1.5px solid #fbbf24;border-radius:.875rem;padding:.875rem 1.25rem;font-family:Courier New,Courier,monospace;font-size:1.05rem;font-weight:700;box-shadow:0 2px 8px #fbbf2426}.lesson-key-term{color:#92400e;background:linear-gradient(135deg,#fef3c7,#fde68a);border-radius:.3em;padding:.1em .4em;font-size:.95em;font-weight:700}.lesson-header-teal{color:#1a85a4;font-family:var(--font-display);font-weight:800}.lesson-header-orange{color:#fbab41;font-family:var(--font-display);font-weight:800}.bg-noise{position:relative}.bg-noise:before{content:"";opacity:.03;pointer-events:none;z-index:1;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");position:absolute;inset:0}.card-elevated{box-shadow:0 16px 40px -8px #7c3aed26,0 0 24px -5px #7c3aed14}.card-elevated-lg{box-shadow:0 24px 60px -12px #7c3aed33,0 0 32px -10px #7c3aed1a}.shadow-3d-button{box-shadow:0 12px 24px -6px var(--tw-shadow-color,#f9731666),0 6px 12px -4px var(--tw-shadow-color,#f973164d)}.dark .card-elevated{box-shadow:0 1px 2px #0003,0 4px 16px #00000026}.dark .card-elevated-lg{box-shadow:0 2px 4px #0003,0 8px 32px #0003}*{scrollbar-width:thin;scrollbar-color:transparent transparent}:hover{scrollbar-color:#0284c733 transparent}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:#0000;border-radius:10px;transition:background-color .3s}:hover::-webkit-scrollbar-thumb{background-color:#0284c733}::-webkit-scrollbar-thumb:hover{background-color:#0284c766}.scrollbar-hide{scrollbar-width:none;-ms-overflow-style:none}.scrollbar-hide::-webkit-scrollbar{display:none}.accent-line{position:relative}.accent-line:after{content:"";background:linear-gradient(90deg,#0284c7,#f43f5e);border-radius:2px;width:48px;height:3px;position:absolute;bottom:0;left:0}.surface-raised{background:linear-gradient(135deg,#fff,#f8fafc);border:1px solid #e2e8f0cc}.surface-inset{background:linear-gradient(135deg,#f1f5f9,#e8eef6);border:1px solid #cbd5e180}.bg-white-20{background-color:#fff3}.bg-white-15{background-color:#ffffff26}.bg-black-15{background-color:#00000026}.e-w{width:var(--w)}.e-bg{background-color:var(--bg)}.e-color{color:var(--c);fill:var(--c);stroke:var(--c)}.e-grid-cols{grid-template-columns:var(--grid-cols)}.e-perspective{perspective:var(--perspective)}.e-transform{transform:var(--tr)}.e-left-top{left:var(--left);top:var(--top)}.e-z{z-index:var(--z)}.e-filter{filter:var(--filter)}.e-opacity{opacity:var(--o)}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{display:none}.module-detail-grid-pattern{opacity:.1;pointer-events:none;background-image:repeating-linear-gradient(0deg,#0000,#0000 39px,#fff 39px 40px),repeating-linear-gradient(90deg,#0000,#0000 39px,#fff 39px 40px)}.leaderboard-mask{-webkit-mask-image:linear-gradient(#0000,#000 15%);mask-image:linear-gradient(#0000,#000 15%)}.app-loader-screen{z-index:50;background:#f7f9fc;justify-content:center;align-items:center;padding:1rem;display:flex;position:fixed;inset:0}.app-loader-card{background:#fff;border:1px solid #dde3eb;border-radius:2rem;flex-direction:column;align-items:center;gap:1.5rem;width:min(100%,24rem);padding:2rem;display:flex;box-shadow:0 24px 40px #38bdf81f}.app-loader-avatar-shell{background:linear-gradient(135deg,#e0f2fe,#e0e7ff);border:2px solid #fff;border-radius:1.5rem;justify-content:center;align-items:center;width:8rem;height:8rem;display:flex;box-shadow:0 12px 24px #0f172a1f}.app-loader-avatar{object-fit:contain;filter:drop-shadow(0 8px 12px #0f172a33);width:5.5rem;height:5.5rem}.app-loader-bot-icon{width:4rem;height:4rem}.app-loader-title{color:#0a1628;margin:0;font-size:1.25rem;font-weight:700}.app-loader-message-row{justify-content:center;align-items:center;gap:.5rem;margin-top:.5rem;display:flex}.app-loader-spinner{border:2px solid #0284c7;border-top-color:#0000;border-radius:999px;width:1rem;height:1rem}.app-loader-message{color:#64748b;margin:0;font-size:.875rem;font-weight:600}.avatar-gloss{clip-path:polygon(15% 0,85% 0,65% 100%,35% 100%);pointer-events:none;background:linear-gradient(#fff6,#ffffff0d 60%,#0000)}.login-bg{background:linear-gradient(135deg,#f0f9ff,#f8fafc,#fff1f2 60%,#f0f9ff)}.login-frost-overlay{pointer-events:none;background:radial-gradient(at 30%,#f0f9ff33,#f8fafc80 50%,#fff1f266 80%,#f8fafcd9)}.login-orb-purple{background:radial-gradient(circle,#a855f74d,#0000 70%)}.login-orb-pink{background:radial-gradient(circle,#ec489940,#0000 70%)}.login-orb-blue{background:radial-gradient(circle,#38bdf833,#0000 70%)}.dynamic-header{background-color:var(--bg);-webkit-backdrop-filter:blur(var(--blur));backdrop-filter:blur(var(--blur));box-shadow:var(--shadow)}.e-max-h{max-height:var(--max-h);transition:max-height .22s;overflow:hidden}.hero-clip-inset{clip-path:inset(-100% -50% 0)}.card-3d{transform-origin:0;backface-visibility:hidden;transition:transform 2s ease-in-out}.card-accent-sky{border-left:3px solid #0284c7}.card-accent-rose{border-left:3px solid #f43f5e}.card-accent-emerald{border-left:3px solid #059669}.app-loader-copy{text-align:center}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes sunburst-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-sunburst-spin{animation:30s linear infinite sunburst-spin}.chat-markdown{font-family:var(--font-body);overflow-wrap:anywhere;word-break:break-word;font-size:.875rem;line-height:1.625}.chat-markdown h1{font-family:var(--font-display);color:var(--foreground);margin-top:.75rem;margin-bottom:.5rem;font-size:1.25rem;font-weight:700}.chat-markdown h2{font-family:var(--font-display);color:var(--foreground);margin-top:.75rem;margin-bottom:.375rem;font-size:1.1rem;font-weight:700}.chat-markdown h3{font-family:var(--font-display);color:var(--muted-foreground);margin-top:.5rem;margin-bottom:.25rem;font-size:1rem;font-weight:600}.chat-markdown p{margin-top:.375rem;margin-bottom:.375rem}.chat-markdown ul,.chat-markdown ol{margin-top:.375rem;margin-bottom:.375rem;padding-left:1.25rem}.chat-markdown ul{list-style-type:disc}.chat-markdown ol{list-style-type:decimal}.chat-markdown li{margin-top:.125rem;margin-bottom:.125rem}.chat-markdown strong{color:var(--foreground);font-weight:700}.chat-markdown em{font-style:italic}.chat-markdown code{background:var(--secondary);color:var(--primary);border-radius:.25rem;padding:.125rem .375rem;font-size:.8125rem}.chat-markdown pre{background:var(--muted);border:1px solid var(--border);border-radius:.5rem;margin-top:.5rem;margin-bottom:.5rem;padding:.75rem;overflow-x:auto}.chat-markdown pre code{color:inherit;background:0 0;padding:0}.chat-markdown hr{border-color:#94a3b873;margin:.75rem 0}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5rem 0;font-size:.8125rem}.chat-markdown th{background:var(--muted);text-align:left;border:1px solid var(--border);padding:.375rem .5rem;font-weight:600}.chat-markdown td{border:1px solid var(--border);padding:.375rem .5rem}.chat-markdown blockquote{border-left:3px solid var(--primary);color:var(--muted-foreground);margin:.5rem 0;padding-left:.75rem;font-style:italic}.chat-markdown a{color:var(--primary);text-decoration:underline}.chat-markdown>:first-child{margin-top:0}.chat-markdown>:last-child{margin-bottom:0}.chat-markdown .katex-display{padding-bottom:.15rem;overflow:auto hidden}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}} diff --git a/assets/index-Cvals0ud.js b/assets/index-D9TvEOZX.js similarity index 71% rename from assets/index-Cvals0ud.js rename to assets/index-D9TvEOZX.js index a3933f2cf072c8b707ba4bb82431f78d12b66975..030b74cc36c6c0af2e154eb098de5ea9c7889edd 100644 --- a/assets/index-Cvals0ud.js +++ b/assets/index-D9TvEOZX.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/automationService-bOdf9kmP.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-BPuEd8FG.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/pipelineService-B7G_svsh.js","assets/chatService-DQPU-_oL.js","assets/trackingService-C4dB8FTD.js","assets/LoginPage-B5PKWXul.js","assets/button-CanHmtQ3.js","assets/input-D6YjrCkj.js","assets/sparkles-Chs7kbc0.js","assets/mail-DYnuuzL1.js","assets/eye-gVkJiC2f.js","assets/shield-check-CtsVo8Il.js","assets/TeacherDashboard-BbvSzo2l.js","assets/ConfirmModal-CzN8U1r6.js","assets/x-cRIR5BcS.js","assets/trash-2-DaNTdmd2.js","assets/log-out-CKjuia0o.js","assets/search-C0dGOTBF.js","assets/check-BVDfRV4g.js","assets/plus-DUNZAuOT.js","assets/NotificationDropdown-BA3YDfYB.js","assets/formatDistanceToNow-CnY6T5Ff.js","assets/bell-oitWfCwK.js","assets/circle-check-Bi1b5YEO.js","assets/circle-alert-lQsWFo4p.js","assets/LogoutActionButton-C7uxe-Am.js","assets/quizService-ADP3v46Q.js","assets/clock-BsCO0o69.js","assets/send-DJ3IeuSS.js","assets/circle-check-big-6fwaSN-C.js","assets/tooltip-ERqatgcd.js","assets/circle-help-Bpd0FWyO.js","assets/info-Nl0vLXXp.js","assets/chevron-up-CzNRBnCs.js","assets/minus-XCv3x7RR.js","assets/chart-column-NTUNS-L9.js","assets/skeleton-2ST8J4tA.js","assets/download-BJi3JOJ-.js","assets/chevron-left-BVt9k3oq.js","assets/chevron-right-DMwHUP8W.js","assets/save-FkmW81ji.js","assets/upload-CEq77VjR.js","assets/lightbulb-BO_q6pvi.js","assets/useQuery-CiaHK9El.js","assets/subjects-jEWdBmnZ.js","assets/useCurriculum-BAkeEYG2.js","assets/ChatMarkdown-Bihf5n-9.js","assets/dialog-BkdNfKs4.js","assets/vendor-xlsx-uZelXSz_.js","assets/moduleWatchService-NMv-sVdb.js","assets/clipboard-check-Dml7qHk3.js","assets/AdminDashboard-BAdMO242.js","assets/Sidebar-Cd6wJUro.js","assets/shirt-Dh8-NVGy.js","assets/select-ClqEN5GF.js","assets/dollar-sign-B2IOYAA6.js","assets/switch-BfAF8D2j.js","assets/useSubjectAvailability-Cze5wmtk.js","assets/HeroBanner-DjkOT5_A.js","assets/RightSidebar-DwQhbcAS.js","assets/quiz_battle_avatar-BXHPSput.js","assets/XPNotification-LB3BKZhf.js","assets/index-CE66MpTE.js","assets/megaphone-BGcgznHr.js","assets/SupplementalBanner-D2jdKCXO.js","assets/SupplementalPillCarousel-Dr0PNxNV.js","assets/deepseekRagService-Bke9fSTt.js","assets/LearningPath-B9zcHS9G.js","assets/ModuleFolderCard-EpvEJfz8.js","assets/CompetencyRadarChart-uhr-7kWw.js","assets/ModulesPage-BBA7i5Vh.js","assets/ScientificCalculator-BU0JSvVT.js","assets/volume-x-D_pMIkOs.js","assets/confetti.module-C94ZD2ww.js","assets/gift-NZiFoj7A.js","assets/funnel-aw0mPVdH.js","assets/AIChatPage-BEasorm4.js","assets/GradesPage-Dm_kgSLp.js","assets/LeaderboardPage-Bn0migR8.js","assets/useFeatureAccess-BtwbTJw1.js","assets/QuizBattlePage-Cgo4YrpT.js","assets/CompositeAvatar-Col05lJc.js","assets/avatarData-BuQSOXo3.js","assets/AvatarShop-DteqBGRd.js","assets/FloatingAITutor-B4EaVyaw.js","assets/maximize-2-Dsjc-Cqw.js","assets/RewardsModal-BADS4F50.js","assets/ProfileModal-B9i8i5JC.js","assets/ProfilePictureUploader-BLdgrysh.js","assets/SettingsModal-BN7tm0SJ.js","assets/InitialAssessmentModal-CA2dqFPM.js","assets/diagnosticService-ByxEbtPN.js","assets/AssessmentPage-D20un3MW.js","assets/DiagnosticBreakdown-CfJCo5qL.js","assets/testResetService-BQ_fz2E4.js"])))=>i.map(i=>d[i]); -import{r as h,j as b,d as I,c as Pp,f as Ep}from"./vendor-react-B4AQeu28.js";import{initializeFirestore as Cp,memoryLocalCache as Ap,setDoc as Ae,doc as q,serverTimestamp as ie,getDoc as ge,getDocFromServer as Ko,onSnapshot as en,query as It,limit as ks,orderBy as vn,collection as Ye,getDocs as $n,updateDoc as dt,arrayUnion as ju,increment as fs,where as At,deleteDoc as vr,Timestamp as zn,runTransaction as Rp}from"./vendor-firebase-firestore-CNv3xXal.js";import{U as Mp,V as Ip,Y as Dp,Z as Op,$ as Lp,a0 as zp,a1 as jp,a2 as Np,a3 as $p}from"./vendor-firebase-core-D7GXCeNu.js";import{browserLocalPersistence as Ka,initializeAuth as Qa,browserSessionPersistence as Fp,inMemoryPersistence as Xa,GoogleAuthProvider as Vp,createUserWithEmailAndPassword as Bp,updateProfile as Up,signInWithEmailAndPassword as qp,signOut as Gp,onAuthStateChanged as Wp,updatePassword as Hp,updateEmail as Zp,deleteUser as Kp,EmailAuthProvider as Qp,reauthenticateWithCredential as Xp}from"./vendor-firebase-auth-T_wvTOvf.js";import{g as Yp}from"./vendor-firebase-storage-Bi7H_66d.js";import{g as Jp}from"./vendor-firebase-analytics-rHarj5hR.js";import{R as em,I as tm,F as nm}from"./vendor-radix-BPuEd8FG.js";import{c as sm}from"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();var Fr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rm=class extends Fr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Nu=new rm,om={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},im=class{#e=om;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Qo=new im;function am(e){setTimeout(e,0)}var cm=typeof window>"u"||"Deno"in globalThis;function vt(){}function lm(e,t){return typeof e=="function"?e(t):e}function um(e){return typeof e=="number"&&e>=0&&e!==1/0}function dm(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xo(e,t){return typeof e=="function"?e(t):e}function fm(e,t){return typeof e=="function"?e(t):e}function Ya(e,t){const{type:n="all",exact:s,fetchStatus:r,predicate:o,queryKey:i,stale:a}=e;if(i){if(s){if(t.queryHash!==$i(i,t.options))return!1}else if(!ps(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||r&&r!==t.state.fetchStatus||o&&!o(t))}function Ja(e,t){const{exact:n,status:s,predicate:r,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(hs(t.options.mutationKey)!==hs(o))return!1}else if(!ps(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||r&&!r(t))}function $i(e,t){return(t?.queryKeyHashFn||hs)(e)}function hs(e){return JSON.stringify(e,(t,n)=>Yo(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function ps(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ps(e[n],t[n])):!1}var hm=Object.prototype.hasOwnProperty;function $u(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=ec(e)&&ec(t);if(!s&&!(Yo(e)&&Yo(t)))return t;const o=(s?e:Object.keys(e)).length,i=s?t:Object.keys(t),a=i.length,c=s?new Array(a):{};let u=0;for(let d=0;d{Qo.setTimeout(t,e)})}function mm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$u(e,t):t}function gm(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function ym(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Fi=Symbol();function Fu(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Fi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _R(e,t){return typeof e=="function"?e(...t):!!e}function bm(e,t,n){let s=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),s||(s=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),e}var Vu=(()=>{let e=()=>cm;return{isServer(){return e()},setIsServer(t){e=t}}})();function vm(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});n.status="pending",n.catch(()=>{});function s(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{s({status:"fulfilled",value:r}),e(r)},n.reject=r=>{s({status:"rejected",reason:r}),t(r)},n}var wm=am;function xm(){let e=[],t=0,n=a=>{a()},s=a=>{a()},r=wm;const o=a=>{t?e.push(a):r(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&r(()=>{s(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{o(()=>{a(...c)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{r=a}}}var Ke=xm(),Sm=class extends Fr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},wr=new Sm;function km(e){return Math.min(1e3*2**e,3e4)}function Bu(e){return(e??"online")==="online"?wr.isOnline():!0}var Jo=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Uu(e){let t=!1,n=0,s;const r=vm(),o=()=>r.status!=="pending",i=y=>{if(!o()){const g=new Jo(y);f(g),e.onCancel?.(g)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>Nu.isFocused()&&(e.networkMode==="always"||wr.isOnline())&&e.canRun(),d=()=>Bu(e.networkMode)&&e.canRun(),l=y=>{o()||(s?.(),r.resolve(y))},f=y=>{o()||(s?.(),r.reject(y))},p=()=>new Promise(y=>{s=g=>{(o()||u())&&y(g)},e.onPause?.()}).then(()=>{s=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let y;const g=n===0?e.initialPromise:void 0;try{y=g??e.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(l).catch(v=>{if(o())return;const k=e.retry??(Vu.isServer()?0:3),S=e.retryDelay??km,x=typeof S=="function"?S(n,v):S,T=k===!0||typeof k=="number"&&nu()?void 0:p()).then(()=>{t?f(v):m()})})};return{promise:r,status:()=>r.status,cancel:i,continue:()=>(s?.(),r),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),r)}}var qu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),um(this.gcTime)&&(this.#e=Qo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vu.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Qo.clearTimeout(this.#e),this.#e=void 0)}};function Tm(e){return{onFetch:(t,n)=>{const s=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const l=m=>{bm(m,()=>t.signal,()=>d=!0)},f=Fu(t.options,t.fetchOptions),p=async(m,y,g)=>{if(d)return Promise.reject(t.signal.reason);if(y==null&&m.pages.length)return Promise.resolve(m);const k=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:y,direction:g?"backward":"forward",meta:t.options.meta};return l(_),_})(),S=await f(k),{maxPages:x}=t.options,T=g?ym:gm;return{pages:T(m.pages,S,x),pageParams:T(m.pageParams,y,x)}};if(r&&o.length){const m=r==="backward",y=m?_m:nc,g={pages:o,pageParams:i},v=y(s,g);a=await p(g,v,m)}else{const m=e??o.length;do{const y=c===0?i[0]??s.initialPageParam:nc(s,a);if(c>0&&y==null)break;a=await p(a,y),c++}while(ct.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function nc(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function _m(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Pm=class extends qu{#e;#t;#n;#r;#o;#s;#c;#i;constructor(e){super(),this.#i=!1,this.#c=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=rc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#c,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=rc(this.options);t.data!==void 0&&(this.setState(sc(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=mm(this.state.data,e,this.options);return this.#a({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#a({type:"setState",state:e})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>fm(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!dm(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#i||this.#l()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#l(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(u=>u.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,s=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},r=()=>{const c=Fu(this.options,t),d=(()=>{const l={client:this.#o,queryKey:this.queryKey,meta:this.meta};return s(l),l})();return this.#i=!1,this.options.persister?this.options.persister(c,d,this):c(d)},i=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:r};return s(c),c})();(this.#e==="infinite"?Tm(this.options.pages):this.options.behavior)?.onFetch(i,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#a({type:"fetch",meta:i.fetchOptions?.meta}),this.#s=Uu({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:c=>{c instanceof Jo&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,u)=>{this.#a({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const c=await this.#s.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#r.config.onSuccess?.(c,this),this.#r.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Jo){if(c.silent)return this.#s.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#a({type:"error",error:c}),this.#r.config.onError?.(c,this),this.#r.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Em(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...sc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?s:void 0,s;case"error":const r=e.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ke.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Em(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Cm=class extends qu{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Am(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Uu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,i)=>{this.#o({type:"failed",failureCount:o,error:i})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",r=!this.#r.canStart();try{if(s)t();else{this.#o({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#o({type:"pending",context:i,variables:e,isPaused:r})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ke.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Am(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rm=class extends Fr{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new Cm({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=Fs(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Fs(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Fs(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(r=>r.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=Fs(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ke.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ja(t,n))}findAll(e={}){return this.getAll().filter(t=>Ja(e,t))}notify(e){Ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ke.batch(()=>Promise.all(e.map(t=>t.continue().catch(vt))))}};function Fs(e){return e.options.scope?.id}var Mm=class extends Fr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,r=t.queryHash??$i(s,t);let o=this.get(r);return o||(o=new Pm({client:e,queryKey:s,queryHash:r,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ya(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ya(e,n)):t}notify(e){Ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Im=class{#e;#t;#n;#r;#o;#s;#c;#i;constructor(e={}){this.#e=e.queryCache||new Mm,this.#t=e.mutationCache||new Rm,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#c=Nu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=wr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#c?.(),this.#c=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(s.queryHash)?.state.data,i=lm(t,o);if(i!==void 0)return this.#e.build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ke.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ke.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ke.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=Ke.batch(()=>this.#e.findAll(e).map(r=>r.cancel(n)));return Promise.all(s).then(vt).catch(vt)}invalidateQueries(e,t={}){return Ke.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=Ke.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let o=r.fetch(void 0,n);return n.throwOnError||(o=o.catch(vt)),r.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(vt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Xo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return wr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(hs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{ps(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(hs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(s=>{ps(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=$i(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Fi&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Gu=h.createContext(void 0),PR=e=>{const t=h.useContext(Gu);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Dm=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(Gu.Provider,{value:e,children:t}));/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/automationService-BZunccIA.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/pipelineService-CMil_uZC.js","assets/chatService-CmuZxVTC.js","assets/trackingService-bDpHteof.js","assets/LoginPage-BIAu03dx.js","assets/button-DC8Fz5kC.js","assets/input-7k8DpmeH.js","assets/sparkles-BLpoopVP.js","assets/mail-BP2vbAZE.js","assets/eye-C42pNDm-.js","assets/shield-check-MDy66tKm.js","assets/TeacherDashboard-DXtFjzFe.js","assets/ConfirmModal-bHzo3ssd.js","assets/x-DM8tXF3P.js","assets/trash-2-BYUCk-BO.js","assets/log-out-Bh-BcVV5.js","assets/search-DhblJahq.js","assets/check-Ceq9J6wq.js","assets/plus-BO4Ob0HD.js","assets/NotificationDropdown-BGvkzRtG.js","assets/formatDistanceToNow-2ba72dLM.js","assets/bell-Ci_PX33B.js","assets/circle-check-C6IXGFgm.js","assets/circle-alert-B7tHo7_X.js","assets/LogoutActionButton-1ArQYuvD.js","assets/quizService-BthGydmr.js","assets/clock-BPtF2Ddk.js","assets/send-Duo9AQbk.js","assets/circle-check-big-yn5lhjQR.js","assets/tooltip-B9-3_gHy.js","assets/circle-help-BNf4DSN0.js","assets/info-Dc8OHnyB.js","assets/chevron-up-C5341jJ8.js","assets/minus-VA5XFKbP.js","assets/chart-column-BwIV9b12.js","assets/skeleton-DpSy2iSj.js","assets/download-BC34EYX_.js","assets/chevron-left-C7NnvvA7.js","assets/chevron-right-Jv12kepm.js","assets/save-BUPludiE.js","assets/upload-OtZe8H1o.js","assets/lightbulb-CVSZ487_.js","assets/useQuery-CpdRUEDx.js","assets/subjects-BJQJlUBm.js","assets/useCurriculum-CNtxEkAg.js","assets/ChatMarkdown-D5DdKmyx.js","assets/dialog-BXd6FyxO.js","assets/vendor-xlsx-uZelXSz_.js","assets/moduleWatchService-C7S4gD7U.js","assets/clipboard-check-DEpL_ccN.js","assets/AdminDashboard-BjFqWILK.js","assets/Sidebar-BbWXfzk2.js","assets/shirt-BptpMBI2.js","assets/select-C0r1OjMk.js","assets/dollar-sign-Bysazpsk.js","assets/switch-CJKtscrK.js","assets/useSubjectAvailability-BGfavHlp.js","assets/HeroBanner-DGpjukPy.js","assets/RightSidebar-rcM5VnyM.js","assets/quiz_battle_avatar-BXHPSput.js","assets/XPNotification-D9mC9Rv1.js","assets/index-Ba8UWZjC.js","assets/megaphone-Bl3_WN0I.js","assets/SupplementalBanner-EZxFiTkk.js","assets/SupplementalPillCarousel-BXn2Q4qs.js","assets/deepseekRagService-Bke9fSTt.js","assets/LearningPath-k1DxhELm.js","assets/ModuleFolderCard-B6KU22sy.js","assets/CompetencyRadarChart-lijh1wQQ.js","assets/ModulesPage--JtlKiDc.js","assets/ScientificCalculator-DPFBENLI.js","assets/volume-x-DPfTjI9k.js","assets/confetti.module-C94ZD2ww.js","assets/gift-Cuw3Q8xP.js","assets/funnel-eKLw0u3T.js","assets/AIChatPage-DVRbQ5Pz.js","assets/GradesPage-CQwtFuyq.js","assets/LeaderboardPage-CiOks7x8.js","assets/useFeatureAccess-B5wpJDpf.js","assets/QuizBattlePage-BFj3_Zrn.js","assets/CompositeAvatar-Col05lJc.js","assets/avatarData-BuQSOXo3.js","assets/AvatarShop-D_3LCLIt.js","assets/FloatingAITutor-CZxAq5Ld.js","assets/maximize-2-hozD_NZl.js","assets/RewardsModal-CfWUlD5I.js","assets/ProfileModal-DLL5dyEP.js","assets/ProfilePictureUploader-CvsZs9bx.js","assets/SettingsModal-D8CZHr4j.js","assets/InitialAssessmentModal-BhFH_8YX.js","assets/diagnosticService-Bx7r3sIn.js","assets/AssessmentPage-BN48M30u.js","assets/DiagnosticBreakdown-DT8To33g.js","assets/testResetService-snr7YPux.js"])))=>i.map(i=>d[i]); +import{r as h,j as b,d as I,c as Ep,f as Cp}from"./vendor-react-B4AQeu28.js";import{initializeFirestore as Ap,memoryLocalCache as Rp,setDoc as Ae,doc as q,serverTimestamp as ie,getDoc as ge,getDocFromServer as Ko,onSnapshot as en,query as It,limit as ks,orderBy as vn,collection as Ye,getDocs as $n,updateDoc as dt,arrayUnion as ju,increment as fs,where as At,deleteDoc as vr,Timestamp as zn,runTransaction as Mp}from"./vendor-firebase-firestore-CNv3xXal.js";import{U as Ip,V as Dp,Y as Op,Z as Lp,$ as zp,a0 as jp,a1 as Np,a2 as $p,a3 as Fp}from"./vendor-firebase-core-D7GXCeNu.js";import{browserLocalPersistence as Ka,initializeAuth as Qa,browserSessionPersistence as Vp,inMemoryPersistence as Xa,GoogleAuthProvider as Bp,createUserWithEmailAndPassword as Up,updateProfile as qp,signInWithEmailAndPassword as Gp,signOut as Wp,onAuthStateChanged as Hp,updatePassword as Zp,updateEmail as Kp,deleteUser as Qp,EmailAuthProvider as Xp,reauthenticateWithCredential as Yp}from"./vendor-firebase-auth-T_wvTOvf.js";import{g as Jp}from"./vendor-firebase-storage-Bi7H_66d.js";import{g as em}from"./vendor-firebase-analytics-rHarj5hR.js";import{R as tm,I as nm,F as sm}from"./vendor-radix-C5nwdvGr.js";import{c as rm}from"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();var Fr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},om=class extends Fr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Nu=new om,im={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},am=class{#e=im;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Qo=new am;function cm(e){setTimeout(e,0)}var lm=typeof window>"u"||"Deno"in globalThis;function vt(){}function um(e,t){return typeof e=="function"?e(t):e}function dm(e){return typeof e=="number"&&e>=0&&e!==1/0}function fm(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xo(e,t){return typeof e=="function"?e(t):e}function hm(e,t){return typeof e=="function"?e(t):e}function Ya(e,t){const{type:n="all",exact:s,fetchStatus:r,predicate:o,queryKey:i,stale:a}=e;if(i){if(s){if(t.queryHash!==$i(i,t.options))return!1}else if(!ps(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||r&&r!==t.state.fetchStatus||o&&!o(t))}function Ja(e,t){const{exact:n,status:s,predicate:r,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(hs(t.options.mutationKey)!==hs(o))return!1}else if(!ps(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||r&&!r(t))}function $i(e,t){return(t?.queryKeyHashFn||hs)(e)}function hs(e){return JSON.stringify(e,(t,n)=>Yo(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function ps(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ps(e[n],t[n])):!1}var pm=Object.prototype.hasOwnProperty;function $u(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=ec(e)&&ec(t);if(!s&&!(Yo(e)&&Yo(t)))return t;const o=(s?e:Object.keys(e)).length,i=s?t:Object.keys(t),a=i.length,c=s?new Array(a):{};let u=0;for(let d=0;d{Qo.setTimeout(t,e)})}function gm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$u(e,t):t}function ym(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function bm(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Fi=Symbol();function Fu(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Fi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function CR(e,t){return typeof e=="function"?e(...t):!!e}function vm(e,t,n){let s=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),s||(s=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),e}var Vu=(()=>{let e=()=>lm;return{isServer(){return e()},setIsServer(t){e=t}}})();function wm(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});n.status="pending",n.catch(()=>{});function s(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{s({status:"fulfilled",value:r}),e(r)},n.reject=r=>{s({status:"rejected",reason:r}),t(r)},n}var xm=cm;function Sm(){let e=[],t=0,n=a=>{a()},s=a=>{a()},r=xm;const o=a=>{t?e.push(a):r(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&r(()=>{s(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{o(()=>{a(...c)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{r=a}}}var Ke=Sm(),km=class extends Fr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},wr=new km;function Tm(e){return Math.min(1e3*2**e,3e4)}function Bu(e){return(e??"online")==="online"?wr.isOnline():!0}var Jo=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Uu(e){let t=!1,n=0,s;const r=wm(),o=()=>r.status!=="pending",i=y=>{if(!o()){const g=new Jo(y);f(g),e.onCancel?.(g)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>Nu.isFocused()&&(e.networkMode==="always"||wr.isOnline())&&e.canRun(),d=()=>Bu(e.networkMode)&&e.canRun(),l=y=>{o()||(s?.(),r.resolve(y))},f=y=>{o()||(s?.(),r.reject(y))},p=()=>new Promise(y=>{s=g=>{(o()||u())&&y(g)},e.onPause?.()}).then(()=>{s=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let y;const g=n===0?e.initialPromise:void 0;try{y=g??e.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(l).catch(v=>{if(o())return;const k=e.retry??(Vu.isServer()?0:3),S=e.retryDelay??Tm,w=typeof S=="function"?S(n,v):S,T=k===!0||typeof k=="number"&&nu()?void 0:p()).then(()=>{t?f(v):m()})})};return{promise:r,status:()=>r.status,cancel:i,continue:()=>(s?.(),r),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),r)}}var qu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dm(this.gcTime)&&(this.#e=Qo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vu.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Qo.clearTimeout(this.#e),this.#e=void 0)}};function _m(e){return{onFetch:(t,n)=>{const s=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const l=m=>{vm(m,()=>t.signal,()=>d=!0)},f=Fu(t.options,t.fetchOptions),p=async(m,y,g)=>{if(d)return Promise.reject(t.signal.reason);if(y==null&&m.pages.length)return Promise.resolve(m);const k=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:y,direction:g?"backward":"forward",meta:t.options.meta};return l(_),_})(),S=await f(k),{maxPages:w}=t.options,T=g?bm:ym;return{pages:T(m.pages,S,w),pageParams:T(m.pageParams,y,w)}};if(r&&o.length){const m=r==="backward",y=m?Pm:nc,g={pages:o,pageParams:i},v=y(s,g);a=await p(g,v,m)}else{const m=e??o.length;do{const y=c===0?i[0]??s.initialPageParam:nc(s,a);if(c>0&&y==null)break;a=await p(a,y),c++}while(ct.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function nc(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function Pm(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Em=class extends qu{#e;#t;#n;#r;#o;#s;#c;#i;constructor(e){super(),this.#i=!1,this.#c=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=rc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#c,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=rc(this.options);t.data!==void 0&&(this.setState(sc(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=gm(this.state.data,e,this.options);return this.#a({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#a({type:"setState",state:e})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>hm(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!fm(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#i||this.#l()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#l(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(u=>u.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,s=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},r=()=>{const c=Fu(this.options,t),d=(()=>{const l={client:this.#o,queryKey:this.queryKey,meta:this.meta};return s(l),l})();return this.#i=!1,this.options.persister?this.options.persister(c,d,this):c(d)},i=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:r};return s(c),c})();(this.#e==="infinite"?_m(this.options.pages):this.options.behavior)?.onFetch(i,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#a({type:"fetch",meta:i.fetchOptions?.meta}),this.#s=Uu({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:c=>{c instanceof Jo&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,u)=>{this.#a({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const c=await this.#s.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#r.config.onSuccess?.(c,this),this.#r.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Jo){if(c.silent)return this.#s.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#a({type:"error",error:c}),this.#r.config.onError?.(c,this),this.#r.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Cm(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...sc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?s:void 0,s;case"error":const r=e.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ke.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Cm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Am=class extends qu{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Rm(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Uu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,i)=>{this.#o({type:"failed",failureCount:o,error:i})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",r=!this.#r.canStart();try{if(s)t();else{this.#o({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#o({type:"pending",context:i,variables:e,isPaused:r})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ke.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Rm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mm=class extends Fr{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new Am({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=Fs(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Fs(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Fs(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(r=>r.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=Fs(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ke.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ja(t,n))}findAll(e={}){return this.getAll().filter(t=>Ja(e,t))}notify(e){Ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ke.batch(()=>Promise.all(e.map(t=>t.continue().catch(vt))))}};function Fs(e){return e.options.scope?.id}var Im=class extends Fr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,r=t.queryHash??$i(s,t);let o=this.get(r);return o||(o=new Em({client:e,queryKey:s,queryHash:r,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ya(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ya(e,n)):t}notify(e){Ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Dm=class{#e;#t;#n;#r;#o;#s;#c;#i;constructor(e={}){this.#e=e.queryCache||new Im,this.#t=e.mutationCache||new Mm,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#c=Nu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=wr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#c?.(),this.#c=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(s.queryHash)?.state.data,i=um(t,o);if(i!==void 0)return this.#e.build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ke.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ke.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ke.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=Ke.batch(()=>this.#e.findAll(e).map(r=>r.cancel(n)));return Promise.all(s).then(vt).catch(vt)}invalidateQueries(e,t={}){return Ke.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=Ke.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let o=r.fetch(void 0,n);return n.throwOnError||(o=o.catch(vt)),r.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(vt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Xo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return wr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(hs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{ps(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(hs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(s=>{ps(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=$i(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Fi&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Gu=h.createContext(void 0),AR=e=>{const t=h.useContext(Gu);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Om=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(Gu.Provider,{value:e,children:t}));/** * react-router v7.14.2 * * Copyright (c) Remix Software Inc. @@ -8,9 +8,9 @@ import{r as h,j as b,d as I,c as Pp,f as Ep}from"./vendor-react-B4AQeu28.js";imp * LICENSE.md file in the root directory of this source tree. * * @license MIT - */var oc="popstate";function ic(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Om(e={}){function t(s,r){let o=r.state?.masked,{pathname:i,search:a,hash:c}=o||s.location;return ei("",{pathname:i,search:a,hash:c},r.state&&r.state.usr||null,r.state&&r.state.key||"default",o?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,r){return typeof r=="string"?r:ms(r)}return zm(t,n,null,e)}function De(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Lm(){return Math.random().toString(36).substring(2,10)}function ac(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ei(e,t,n=null,s,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ts(t):t,state:n,key:t&&t.key||s||Lm(),unstable_mask:r}}function ms({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ts(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function zm(e,t,n,s={}){let{window:r=document.defaultView,v5Compat:o=!1}=s,i=r.history,a="POP",c=null,u=d();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function d(){return(i.state||{idx:null}).idx}function l(){a="POP";let g=d(),v=g==null?null:g-u;u=g,c&&c({action:a,location:y.location,delta:v})}function f(g,v){a="PUSH";let k=ic(g)?g:ei(y.location,g,v);u=d()+1;let S=ac(k,u),x=y.createHref(k.unstable_mask||k);try{i.pushState(S,"",x)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;r.location.assign(x)}o&&c&&c({action:a,location:y.location,delta:1})}function p(g,v){a="REPLACE";let k=ic(g)?g:ei(y.location,g,v);u=d();let S=ac(k,u),x=y.createHref(k.unstable_mask||k);i.replaceState(S,"",x),o&&c&&c({action:a,location:y.location,delta:0})}function m(g){return jm(g)}let y={get action(){return a},get location(){return e(r,i)},listen(g){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(oc,l),c=g,()=>{r.removeEventListener(oc,l),c=null}},createHref(g){return t(r,g)},createURL:m,encodeLocation(g){let v=m(g);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:p,go(g){return i.go(g)}};return y}function jm(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),De(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:ms(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function Wu(e,t,n="/"){return Nm(e,t,n,!1)}function Nm(e,t,n,s){let r=typeof t=="string"?Ts(t):t,o=Ut(r.pathname||"/",n);if(o==null)return null;let i=Hu(e);$m(i);let a=null;for(let c=0;a==null&&c{let d={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(s)&&c)return;De(d.relativePath.startsWith(s),`Absolute route path "${d.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(s.length)}let l=wt([s,d.relativePath]),f=n.concat(d);i.children&&i.children.length>0&&(De(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Hu(i.children,t,f,l,c)),!(i.path==null&&!i.index)&&t.push({path:l,score:Wm(l,i.index),routesMeta:f})};return e.forEach((i,a)=>{if(i.path===""||!i.path?.includes("?"))o(i,a);else for(let c of Zu(i.path))o(i,a,!0,c)}),t}function Zu(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),o=n.replace(/\?$/,"");if(s.length===0)return r?[o,""]:[o];let i=Zu(s.join("/")),a=[];return a.push(...i.map(c=>c===""?o:[o,c].join("/"))),r&&a.push(...i),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function $m(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Hm(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var Fm=/^:[\w-]+$/,Vm=3,Bm=2,Um=1,qm=10,Gm=-2,cc=e=>e==="*";function Wm(e,t){let n=e.split("/"),s=n.length;return n.some(cc)&&(s+=Gm),t&&(s+=Bm),n.filter(r=>!cc(r)).reduce((r,o)=>r+(Fm.test(o)?Vm:o===""?Um:qm),s)}function Hm(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function Zm(e,t,n=!1){let{routesMeta:s}=e,r={},o="/",i=[];for(let a=0;a{if(d==="*"){let m=a[f]||"";i=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const p=a[f];return l&&!p?u[d]=void 0:u[d]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Km(e,t=!1,n=!0){Dt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,c,u,d)=>{if(s.push({paramName:a,isOptional:c!=null}),c){let l=d.charAt(u+i.length);return l&&l!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function Qm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ut(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var Xm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Ym(e,t="/"){let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?Ts(e):e,o;return n?(n=Qu(n),n.startsWith("/")?o=lc(n.substring(1),"/"):o=lc(n,t)):o=t,{pathname:o,search:tg(s),hash:ng(r)}}function lc(e,t){let n=Sr(t).split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function ho(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Jm(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ku(e){let t=Jm(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function Vi(e,t,n,s=!1){let r;typeof e=="string"?r=Ts(e):(r={...e},De(!r.pathname||!r.pathname.includes("?"),ho("?","pathname","search",r)),De(!r.pathname||!r.pathname.includes("#"),ho("#","pathname","hash",r)),De(!r.search||!r.search.includes("#"),ho("#","search","hash",r)));let o=e===""||r.pathname==="",i=o?"/":r.pathname,a;if(i==null)a=n;else{let l=t.length-1;if(!s&&i.startsWith("..")){let f=i.split("/");for(;f[0]==="..";)f.shift(),l-=1;r.pathname=f.join("/")}a=l>=0?t[l]:"/"}let c=Ym(r,a),u=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}var Qu=e=>e.replace(/\/\/+/g,"/"),wt=e=>Qu(e.join("/")),Sr=e=>e.replace(/\/+$/,""),eg=e=>Sr(e).replace(/^\/*/,"/"),tg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ng=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,sg=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function rg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function og(e){let t=e.map(n=>n.route.path).filter(Boolean);return wt(t)||"/"}var Xu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yu(e,t){let n=e;if(typeof n!="string"||!Xm.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,r=!1;if(Xu)try{let o=new URL(window.location.href),i=n.startsWith("//")?new URL(o.protocol+n):new URL(n),a=Ut(i.pathname,t);i.origin===o.origin&&a!=null?n=a+i.search+i.hash:r=!0}catch{Dt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ju=["POST","PUT","PATCH","DELETE"];new Set(Ju);var ig=["GET",...Ju];new Set(ig);var Un=h.createContext(null);Un.displayName="DataRouter";var Vr=h.createContext(null);Vr.displayName="DataRouterState";var ed=h.createContext(!1);function ag(){return h.useContext(ed)}var td=h.createContext({isTransitioning:!1});td.displayName="ViewTransition";var cg=h.createContext(new Map);cg.displayName="Fetchers";var lg=h.createContext(null);lg.displayName="Await";var ft=h.createContext(null);ft.displayName="Navigation";var Br=h.createContext(null);Br.displayName="Location";var Gt=h.createContext({outlet:null,matches:[],isDataRoute:!1});Gt.displayName="Route";var Bi=h.createContext(null);Bi.displayName="RouteError";var nd="REACT_ROUTER_ERROR",ug="REDIRECT",dg="ROUTE_ERROR_RESPONSE";function fg(e){if(e.startsWith(`${nd}:${ug}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function hg(e){if(e.startsWith(`${nd}:${dg}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new sg(t.status,t.statusText,t.data)}catch{}}function pg(e,{relative:t}={}){De(_s(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:s}=h.useContext(ft),{hash:r,pathname:o,search:i}=Ps(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:wt([n,o])),s.createHref({pathname:a,search:i,hash:r})}function _s(){return h.useContext(Br)!=null}function Lt(){return De(_s(),"useLocation() may be used only in the context of a component."),h.useContext(Br).location}var sd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rd(e){h.useContext(ft).static||h.useLayoutEffect(e)}function Ui(){let{isDataRoute:e}=h.useContext(Gt);return e?Eg():mg()}function mg(){De(_s(),"useNavigate() may be used only in the context of a component.");let e=h.useContext(Un),{basename:t,navigator:n}=h.useContext(ft),{matches:s}=h.useContext(Gt),{pathname:r}=Lt(),o=JSON.stringify(Ku(s)),i=h.useRef(!1);return rd(()=>{i.current=!0}),h.useCallback((c,u={})=>{if(Dt(i.current,sd),!i.current)return;if(typeof c=="number"){n.go(c);return}let d=Vi(c,JSON.parse(o),r,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:wt([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,o,r,e])}h.createContext(null);function Ps(e,{relative:t}={}){let{matches:n}=h.useContext(Gt),{pathname:s}=Lt(),r=JSON.stringify(Ku(n));return h.useMemo(()=>Vi(e,JSON.parse(r),s,t==="path"),[e,r,s,t])}function gg(e,t,n){De(_s(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=h.useContext(ft),{matches:r}=h.useContext(Gt),o=r[r.length-1],i=o?o.params:{},a=o?o.pathname:"/",c=o?o.pathnameBase:"/",u=o&&o.route;{let g=u&&u.path||"";id(a,!u||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${a}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + */var oc="popstate";function ic(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Lm(e={}){function t(s,r){let o=r.state?.masked,{pathname:i,search:a,hash:c}=o||s.location;return ei("",{pathname:i,search:a,hash:c},r.state&&r.state.usr||null,r.state&&r.state.key||"default",o?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,r){return typeof r=="string"?r:ms(r)}return jm(t,n,null,e)}function De(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function zm(){return Math.random().toString(36).substring(2,10)}function ac(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ei(e,t,n=null,s,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ts(t):t,state:n,key:t&&t.key||s||zm(),unstable_mask:r}}function ms({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ts(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function jm(e,t,n,s={}){let{window:r=document.defaultView,v5Compat:o=!1}=s,i=r.history,a="POP",c=null,u=d();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function d(){return(i.state||{idx:null}).idx}function l(){a="POP";let g=d(),v=g==null?null:g-u;u=g,c&&c({action:a,location:y.location,delta:v})}function f(g,v){a="PUSH";let k=ic(g)?g:ei(y.location,g,v);u=d()+1;let S=ac(k,u),w=y.createHref(k.unstable_mask||k);try{i.pushState(S,"",w)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;r.location.assign(w)}o&&c&&c({action:a,location:y.location,delta:1})}function p(g,v){a="REPLACE";let k=ic(g)?g:ei(y.location,g,v);u=d();let S=ac(k,u),w=y.createHref(k.unstable_mask||k);i.replaceState(S,"",w),o&&c&&c({action:a,location:y.location,delta:0})}function m(g){return Nm(g)}let y={get action(){return a},get location(){return e(r,i)},listen(g){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(oc,l),c=g,()=>{r.removeEventListener(oc,l),c=null}},createHref(g){return t(r,g)},createURL:m,encodeLocation(g){let v=m(g);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:p,go(g){return i.go(g)}};return y}function Nm(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),De(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:ms(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function Wu(e,t,n="/"){return $m(e,t,n,!1)}function $m(e,t,n,s){let r=typeof t=="string"?Ts(t):t,o=Ut(r.pathname||"/",n);if(o==null)return null;let i=Hu(e);Fm(i);let a=null;for(let c=0;a==null&&c{let d={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(s)&&c)return;De(d.relativePath.startsWith(s),`Absolute route path "${d.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(s.length)}let l=wt([s,d.relativePath]),f=n.concat(d);i.children&&i.children.length>0&&(De(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Hu(i.children,t,f,l,c)),!(i.path==null&&!i.index)&&t.push({path:l,score:Hm(l,i.index),routesMeta:f})};return e.forEach((i,a)=>{if(i.path===""||!i.path?.includes("?"))o(i,a);else for(let c of Zu(i.path))o(i,a,!0,c)}),t}function Zu(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),o=n.replace(/\?$/,"");if(s.length===0)return r?[o,""]:[o];let i=Zu(s.join("/")),a=[];return a.push(...i.map(c=>c===""?o:[o,c].join("/"))),r&&a.push(...i),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function Fm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Zm(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var Vm=/^:[\w-]+$/,Bm=3,Um=2,qm=1,Gm=10,Wm=-2,cc=e=>e==="*";function Hm(e,t){let n=e.split("/"),s=n.length;return n.some(cc)&&(s+=Wm),t&&(s+=Um),n.filter(r=>!cc(r)).reduce((r,o)=>r+(Vm.test(o)?Bm:o===""?qm:Gm),s)}function Zm(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function Km(e,t,n=!1){let{routesMeta:s}=e,r={},o="/",i=[];for(let a=0;a{if(d==="*"){let m=a[f]||"";i=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const p=a[f];return l&&!p?u[d]=void 0:u[d]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Qm(e,t=!1,n=!0){Dt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,c,u,d)=>{if(s.push({paramName:a,isOptional:c!=null}),c){let l=d.charAt(u+i.length);return l&&l!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function Xm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ut(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var Ym=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Jm(e,t="/"){let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?Ts(e):e,o;return n?(n=Qu(n),n.startsWith("/")?o=lc(n.substring(1),"/"):o=lc(n,t)):o=t,{pathname:o,search:ng(s),hash:sg(r)}}function lc(e,t){let n=Sr(t).split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function ho(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function eg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ku(e){let t=eg(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function Vi(e,t,n,s=!1){let r;typeof e=="string"?r=Ts(e):(r={...e},De(!r.pathname||!r.pathname.includes("?"),ho("?","pathname","search",r)),De(!r.pathname||!r.pathname.includes("#"),ho("#","pathname","hash",r)),De(!r.search||!r.search.includes("#"),ho("#","search","hash",r)));let o=e===""||r.pathname==="",i=o?"/":r.pathname,a;if(i==null)a=n;else{let l=t.length-1;if(!s&&i.startsWith("..")){let f=i.split("/");for(;f[0]==="..";)f.shift(),l-=1;r.pathname=f.join("/")}a=l>=0?t[l]:"/"}let c=Jm(r,a),u=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}var Qu=e=>e.replace(/\/\/+/g,"/"),wt=e=>Qu(e.join("/")),Sr=e=>e.replace(/\/+$/,""),tg=e=>Sr(e).replace(/^\/*/,"/"),ng=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,rg=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function og(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ig(e){let t=e.map(n=>n.route.path).filter(Boolean);return wt(t)||"/"}var Xu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yu(e,t){let n=e;if(typeof n!="string"||!Ym.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,r=!1;if(Xu)try{let o=new URL(window.location.href),i=n.startsWith("//")?new URL(o.protocol+n):new URL(n),a=Ut(i.pathname,t);i.origin===o.origin&&a!=null?n=a+i.search+i.hash:r=!0}catch{Dt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ju=["POST","PUT","PATCH","DELETE"];new Set(Ju);var ag=["GET",...Ju];new Set(ag);var Un=h.createContext(null);Un.displayName="DataRouter";var Vr=h.createContext(null);Vr.displayName="DataRouterState";var ed=h.createContext(!1);function cg(){return h.useContext(ed)}var td=h.createContext({isTransitioning:!1});td.displayName="ViewTransition";var lg=h.createContext(new Map);lg.displayName="Fetchers";var ug=h.createContext(null);ug.displayName="Await";var ft=h.createContext(null);ft.displayName="Navigation";var Br=h.createContext(null);Br.displayName="Location";var Gt=h.createContext({outlet:null,matches:[],isDataRoute:!1});Gt.displayName="Route";var Bi=h.createContext(null);Bi.displayName="RouteError";var nd="REACT_ROUTER_ERROR",dg="REDIRECT",fg="ROUTE_ERROR_RESPONSE";function hg(e){if(e.startsWith(`${nd}:${dg}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function pg(e){if(e.startsWith(`${nd}:${fg}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new rg(t.status,t.statusText,t.data)}catch{}}function mg(e,{relative:t}={}){De(_s(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:s}=h.useContext(ft),{hash:r,pathname:o,search:i}=Ps(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:wt([n,o])),s.createHref({pathname:a,search:i,hash:r})}function _s(){return h.useContext(Br)!=null}function Lt(){return De(_s(),"useLocation() may be used only in the context of a component."),h.useContext(Br).location}var sd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rd(e){h.useContext(ft).static||h.useLayoutEffect(e)}function Ui(){let{isDataRoute:e}=h.useContext(Gt);return e?Cg():gg()}function gg(){De(_s(),"useNavigate() may be used only in the context of a component.");let e=h.useContext(Un),{basename:t,navigator:n}=h.useContext(ft),{matches:s}=h.useContext(Gt),{pathname:r}=Lt(),o=JSON.stringify(Ku(s)),i=h.useRef(!1);return rd(()=>{i.current=!0}),h.useCallback((c,u={})=>{if(Dt(i.current,sd),!i.current)return;if(typeof c=="number"){n.go(c);return}let d=Vi(c,JSON.parse(o),r,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:wt([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,o,r,e])}h.createContext(null);function Ps(e,{relative:t}={}){let{matches:n}=h.useContext(Gt),{pathname:s}=Lt(),r=JSON.stringify(Ku(n));return h.useMemo(()=>Vi(e,JSON.parse(r),s,t==="path"),[e,r,s,t])}function yg(e,t,n){De(_s(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=h.useContext(ft),{matches:r}=h.useContext(Gt),o=r[r.length-1],i=o?o.params:{},a=o?o.pathname:"/",c=o?o.pathnameBase:"/",u=o&&o.route;{let g=u&&u.path||"";id(a,!u||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${a}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let d=Lt(),l;l=d;let f=l.pathname||"/",p=f;if(c!=="/"){let g=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=Wu(e,{pathname:p});return Dt(u||m!=null,`No routes matched location "${l.pathname}${l.search}${l.hash}" `),Dt(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${l.pathname}${l.search}${l.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),xg(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},i,g.params),pathname:wt([c,s.encodeLocation?s.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:wt([c,s.encodeLocation?s.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),r,n)}function yg(){let e=Pg(),t=rg(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:s},o={padding:"2px 4px",backgroundColor:s},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:r},n):null,i)}var bg=h.createElement(yg,null),od=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=hg(e.digest);n&&(e=n)}let t=e!==void 0?h.createElement(Gt.Provider,{value:this.props.routeContext},h.createElement(Bi.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(vg,{error:e},t):t}};od.contextType=ed;var po=new WeakMap;function vg({children:e,error:t}){let{basename:n}=h.useContext(ft);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=fg(t.digest);if(s){let r=po.get(t);if(r)throw r;let o=Yu(s.location,n);if(Xu&&!po.get(t))if(o.isExternal||s.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:s.replace}));throw po.set(t,i),i}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function wg({routeContext:e,match:t,children:n}){let s=h.useContext(Un);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Gt.Provider,{value:e},n)}function xg(e,t=[],n){let s=n?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let r=e,o=s?.errors;if(o!=null){let d=r.findIndex(l=>l.route.id&&o?.[l.route.id]!==void 0);De(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,d+1))}let i=!1,a=-1;if(n&&s){i=s.renderFallback;for(let d=0;d=0?r=r.slice(0,a+1):r=[r[0]];break}}}}let c=n?.onError,u=s&&c?(d,l)=>{c(d,{location:s.location,params:s.matches?.[0]?.params??{},unstable_pattern:og(s.matches),errorInfo:l})}:void 0;return r.reduceRight((d,l,f)=>{let p,m=!1,y=null,g=null;s&&(p=o&&l.route.id?o[l.route.id]:void 0,y=l.route.errorElement||bg,i&&(a<0&&f===0?(id("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,g=null):a===f&&(m=!0,g=l.route.hydrateFallbackElement||null)));let v=t.concat(r.slice(0,f+1)),k=()=>{let S;return p?S=y:m?S=g:l.route.Component?S=h.createElement(l.route.Component,null):l.route.element?S=l.route.element:S=d,h.createElement(wg,{match:l,routeContext:{outlet:d,matches:v,isDataRoute:s!=null},children:S})};return s&&(l.route.ErrorBoundary||l.route.errorElement||f===0)?h.createElement(od,{location:s.location,revalidation:s.revalidation,component:y,error:p,children:k(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:u}):k()},null)}function qi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sg(e){let t=h.useContext(Un);return De(t,qi(e)),t}function kg(e){let t=h.useContext(Vr);return De(t,qi(e)),t}function Tg(e){let t=h.useContext(Gt);return De(t,qi(e)),t}function Gi(e){let t=Tg(e),n=t.matches[t.matches.length-1];return De(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function _g(){return Gi("useRouteId")}function Pg(){let e=h.useContext(Bi),t=kg("useRouteError"),n=Gi("useRouteError");return e!==void 0?e:t.errors?.[n]}function Eg(){let{router:e}=Sg("useNavigate"),t=Gi("useNavigate"),n=h.useRef(!1);return rd(()=>{n.current=!0}),h.useCallback(async(r,o={})=>{Dt(n.current,sd),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))},[e,t])}var uc={};function id(e,t,n){!t&&!uc[e]&&(uc[e]=!0,Dt(!1,n))}h.memo(Cg);function Cg({routes:e,future:t,state:n,isStatic:s,onError:r}){return gg(e,void 0,{state:n,isStatic:s,onError:r})}function Ag({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:r,static:o=!1,unstable_useTransitions:i}){De(!_s(),"You cannot render a inside another . You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),c=h.useMemo(()=>({basename:a,navigator:r,static:o,unstable_useTransitions:i,future:{}}),[a,r,o,i]);typeof n=="string"&&(n=Ts(n));let{pathname:u="/",search:d="",hash:l="",state:f=null,key:p="default",unstable_mask:m}=n,y=h.useMemo(()=>{let g=Ut(u,a);return g==null?null:{location:{pathname:g,search:d,hash:l,state:f,key:p,unstable_mask:m},navigationType:s}},[a,u,d,l,f,p,s,m]);return Dt(y!=null,` is not able to match the URL "${u}${d}${l}" because it does not start with the basename, so the won't render anything.`),y==null?null:h.createElement(ft.Provider,{value:c},h.createElement(Br.Provider,{children:t,value:y}))}var or="get",ir="application/x-www-form-urlencoded";function Ur(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Rg(e){return Ur(e)&&e.tagName.toLowerCase()==="button"}function Mg(e){return Ur(e)&&e.tagName.toLowerCase()==="form"}function Ig(e){return Ur(e)&&e.tagName.toLowerCase()==="input"}function Dg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Og(e,t){return e.button===0&&(!t||t==="_self")&&!Dg(e)}var Vs=null;function Lg(){if(Vs===null)try{new FormData(document.createElement("form"),0),Vs=!1}catch{Vs=!0}return Vs}var zg=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mo(e){return e!=null&&!zg.has(e)?(Dt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${ir}"`),null):e}function jg(e,t){let n,s,r,o,i;if(Mg(e)){let a=e.getAttribute("action");s=a?Ut(a,t):null,n=e.getAttribute("method")||or,r=mo(e.getAttribute("enctype"))||ir,o=new FormData(e)}else if(Rg(e)||Ig(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a