github-actions[bot] commited on
Commit
4649e4d
ยท
1 Parent(s): 9c8453d

๐Ÿš€ Auto-deploy frontend from GitHub (6757e27)

Browse files
Files changed (50) hide show
  1. assets/AIChatPage-BxO8FeVw.js +1 -0
  2. assets/AdminDashboard-DLbi-A8q.js +63 -0
  3. assets/AvatarShop-BMkk-nTf.js +16 -0
  4. assets/ChatMarkdown-yVNm7d0l.js +7 -0
  5. assets/CompositeAvatar-CxBIl8mP.js +1 -0
  6. assets/ConfirmModal-BCd_bhv9.js +1 -0
  7. assets/DiagnosticAssessmentModal-QtbUV7gF.js +1 -0
  8. assets/FloatingAITutor-DFAkWR7R.js +6 -0
  9. assets/GradesPage-Bh8_Kzk7.js +2 -0
  10. assets/LeaderboardPage-CcWilfKB.js +8 -0
  11. assets/LoginPage-B6vI51Px.js +6 -0
  12. assets/MathAnswerInput-D47QiEEM.js +1 -0
  13. assets/ModulesPage-Cj0Y6Ygf.js +0 -0
  14. assets/ProfileModal-CPc0v0EZ.js +16 -0
  15. assets/RewardsModal-D00rO2Ia.js +1 -0
  16. assets/ScientificCalculator-Cik6PszE.js +30 -0
  17. assets/SettingsModal-izOy98SM.js +11 -0
  18. assets/TeacherDashboard-DcIgyxWH.js +0 -0
  19. assets/award-GuQ4hvnk.js +6 -0
  20. assets/button-MTmjd5-I.js +1 -0
  21. assets/calendar-Ac41aFLD.js +6 -0
  22. assets/chevron-up-Dy93ceTz.js +11 -0
  23. assets/circle-help-DAhx2f50.js +6 -0
  24. assets/download-DsF2wqhl.js +6 -0
  25. assets/eye-B9PLXLcy.js +6 -0
  26. assets/eye-off-BY4y1x6t.js +6 -0
  27. assets/globe-DGPprHYb.js +6 -0
  28. assets/index-5uLcs77G.js +0 -0
  29. assets/index-B-KaNIwd.css +0 -0
  30. assets/index-CI58CSTi.css +0 -0
  31. assets/index-Cq4H6CKS.js +0 -0
  32. assets/input-DLYpRUYd.js +1 -0
  33. assets/loader-circle-CqE0ik6T.js +6 -0
  34. assets/lock-Cn8nsuCQ.js +6 -0
  35. assets/mail-QgeDysPt.js +6 -0
  36. assets/pen-line-B8le4w0F.js +11 -0
  37. assets/plus-BgDJ9brI.js +6 -0
  38. assets/quizService-BJk9Vn4i.js +11 -0
  39. assets/save-DxABtV3B.js +6 -0
  40. assets/target-D136l6Dz.js +6 -0
  41. assets/trash-2-CPr8I1eG.js +6 -0
  42. assets/trending-down-CtpIa5V8.js +11 -0
  43. assets/user-CJxrpn3Q.js +6 -0
  44. assets/vendor-firebase-CG7e86Dp.js +0 -0
  45. assets/vendor-markdown-CBmFCdgC.css +1 -0
  46. assets/vendor-markdown-CDZ6ydrN.js +0 -0
  47. assets/vendor-radix-BAHZvx1W.js +0 -0
  48. assets/vendor-react-CCIuKUIB.js +0 -0
  49. assets/video-CeZIu2HZ.js +31 -0
  50. index.html +56 -2
assets/AIChatPage-BxO8FeVw.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as a,j as e}from"./vendor-react-CCIuKUIB.js";import{B as F}from"./button-MTmjd5-I.js";import{I as N}from"./input-DLYpRUYd.js";import{ax as $,ay as z,W as H,K as k,m as S}from"./index-Cq4H6CKS.js";import{C as O,S as W}from"./ChatMarkdown-yVNm7d0l.js";import{P as Y}from"./plus-BgDJ9brI.js";import{T as _}from"./trash-2-CPr8I1eG.js";import"./vendor-radix-BAHZvx1W.js";import"./vendor-firebase-CG7e86Dp.js";import"./vendor-markdown-CDZ6ydrN.js";const ee=()=>{const{sessions:C,activeSessionId:r,isLoading:l,loadingSessionId:I,setActiveSessionId:i,createNewSession:f,sendMessage:A,deleteSession:L,getActiveSession:T}=$(),[d,M]=a.useState(""),[o,p]=a.useState(""),[b,y]=a.useState(!1),c=a.useRef(null),x=a.useRef(!0),m=a.useRef(!1),n=T(),h=n?.messages||[],B=h.some(s=>s.sender==="ai"&&s.id.startsWith("stream-")),g=l&&r===I&&!B,j=(s="auto")=>{const t=c.current;t&&t.scrollTo({top:t.scrollHeight,behavior:s})},P=()=>{const s=c.current;return s?s.scrollHeight-s.scrollTop-s.clientHeight<=120:!0},R=()=>{x.current=P()};a.useEffect(()=>{z()},[]),a.useEffect(()=>{if(!x.current)return;const s=window.requestAnimationFrame(()=>j("auto"));return()=>window.cancelAnimationFrame(s)},[h,g]),a.useEffect(()=>{x.current=!0,j("auto")},[r]);const v=async()=>{if(!(!o.trim()||l||b||m.current)){m.current=!0,y(!0);try{let s=r;s||(s=f(),i(s));const t=o.trim();p(""),await A(s,t)}finally{m.current=!1,y(!1)}}},w=()=>{const s=f();i(s)},E=(s,t)=>{t.stopPropagation(),L(s)},u=C.filter(s=>s.title.toLowerCase().includes(d.toLowerCase())||s.preview.toLowerCase().includes(d.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex gap-4 px-4 sm:px-6 xl:px-10 py-6",children:[e.jsxs("div",{className:"w-80 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl 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 gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-2xl flex items-center justify-center",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-10 h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"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:w,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-4 py-3 rounded-xl text-sm font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-2",children:[e.jsx(Y,{size:18}),"New Chat"]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(H,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(N,{type:"text",placeholder:"Search conversations...",value:d,onChange:s=>M(s.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:[u.length," Conversations"]})}),e.jsx(k,{children:u.map(s=>e.jsxs(S.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>i(s.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${r===s.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 ${r===s.id?"text-sky-700":"text-[#0a1628]"}`,children:s.title}),e.jsx("button",{onClick:t=>E(s.id,t),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(_,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:s.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:s.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${r===s.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[s.messageCount," msgs"]})]})]},s.id))}),u.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:"flex-1 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628]",children:n?.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:n?.date})]}),e.jsx("div",{className:"flex items-center gap-2",children:n?.topics.map((s,t)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:s},t))})]}),e.jsxs("div",{ref:c,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(k,{children:h.map(s=>e.jsx(S.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${s.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${s.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[s.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:s.text}):e.jsx(O,{children:s.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${s.sender==="user"?"text-sky-200":"text-slate-500"}`,children:s.timestamp})]})},s.id))}),g&&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-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(N,{type:"text",value:o,onChange:s=>p(s.target.value),onKeyPress:s=>s.key==="Enter"&&v(),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(F,{onClick:v,disabled:!o.trim()||l||b,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(W,{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:w,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(s=>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:s}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",s.toLowerCase()]})]},s))})]})})]})};export{ee as default};
assets/AdminDashboard-DLbi-A8q.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{j as e,r as x}from"./vendor-react-CCIuKUIB.js";import{c as O,X as Je,ae as P,J as T,M as Ne,O as z,m as R,a0 as Ke,W as we,U as ne,a as _,a1 as be,R as ae,af as Z,a7 as Ze,Z as Le,a6 as Ye,ag as et,ah as tt,ai as st,G as Se,aa as at,aj as lt,B as rt,V as je,T as nt,ak as it}from"./index-Cq4H6CKS.js";import ke from"./ConfirmModal-BCd_bhv9.js";import{B as U}from"./button-MTmjd5-I.js";import{I}from"./input-DLYpRUYd.js";import{b as ct,c as dt,d as ot,e as xt,D as mt,f as ht,O as ut,g as pt,h as gt,I as ft,V as bt,i as jt,j as vt,k as yt,l as Nt,m as wt,n as St,S as kt,o as At,p as Ct,q as Dt,F as zt}from"./vendor-radix-BAHZvx1W.js";import{a as Ae,C as Tt}from"./chevron-up-Dy93ceTz.js";import{C as Mt,P as Te}from"./pen-line-B8le4w0F.js";import{t as $,o as M,q as ie,p as ce,r as Re,w as Pt,v as Ie,h as J,e as de,z as Ce,m as Ee}from"./vendor-firebase-CG7e86Dp.js";import{R as De,F as Lt,V as Rt,I as le,D as ee,M as It}from"./video-CeZIu2HZ.js";import{P as Ue}from"./plus-BgDJ9brI.js";import{L as B}from"./loader-circle-CqE0ik6T.js";import{T as ve}from"./trash-2-CPr8I1eG.js";import{C as Et}from"./circle-help-DAhx2f50.js";import{C as ye}from"./calendar-Ac41aFLD.js";import{E as Ut}from"./eye-B9PLXLcy.js";import{G as $t}from"./globe-DGPprHYb.js";import{S as Ft}from"./save-DxABtV3B.js";import{T as $e}from"./target-D136l6Dz.js";import{A as re}from"./award-GuQ4hvnk.js";import{F as Bt,T as Ot}from"./trending-down-CtpIa5V8.js";import{D as _t}from"./download-DsF2wqhl.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Gt=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Me=O("activity",Gt);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Vt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],qt=O("ban",Vt);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Ht=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["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"}]],Wt=O("book-marked",Ht);/**
17
+ * @license lucide-react v0.487.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Xt=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],Qt=O("chart-pie",Xt);/**
22
+ * @license lucide-react v0.487.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Jt=[["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"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Kt=O("grid-3x3",Jt);/**
27
+ * @license lucide-react v0.487.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Zt=[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7.382a1 1 0 0 1 .553-.894L6 10",key:"1xqip1"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 7.106-3.553a2 2 0 0 1 1.788 0L20 6",key:"9d2mlk"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]],Yt=O("school",Zt);/**
32
+ * @license lucide-react v0.487.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const es=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ts=O("server",es);/**
37
+ * @license lucide-react v0.487.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const ss=[["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:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],as=O("square-pen",ss);/**
42
+ * @license lucide-react v0.487.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const ls=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],rs=O("type",ls);/**
47
+ * @license lucide-react v0.487.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const ns=[["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"}]],is=O("user-check",ns);function Fe({...t}){return e.jsx(ct,{"data-slot":"dialog",...t})}function cs({...t}){return e.jsx(ht,{"data-slot":"dialog-portal",...t})}function ds({className:t,...a}){return e.jsx(ut,{"data-slot":"dialog-overlay",className:P("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",t),...a})}function Be({className:t,children:a,...n}){return e.jsxs(cs,{"data-slot":"dialog-portal",children:[e.jsx(ds,{}),e.jsxs(dt,{"data-slot":"dialog-content",className:P("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(ot,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(Je,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Oe({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:P("flex flex-col gap-2 text-center sm:text-left",t),...a})}function _e({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:P("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function Ge({className:t,...a}){return e.jsx(xt,{"data-slot":"dialog-title",className:P("text-lg leading-none font-semibold",t),...a})}function Ve({className:t,...a}){return e.jsx(mt,{"data-slot":"dialog-description",className:P("text-muted-foreground text-sm",t),...a})}function q({...t}){return e.jsx(pt,{"data-slot":"select",...t})}function H({...t}){return e.jsx(bt,{"data-slot":"select-value",...t})}function W({className:t,size:a="default",children:n,...s}){return e.jsxs(gt,{"data-slot":"select-trigger","data-size":a,className:P("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]: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 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[n,e.jsx(ft,{asChild:!0,children:e.jsx(Ae,{className:"size-4 opacity-50"})})]})}function X({className:t,children:a,position:n="popper",...s}){return e.jsx(jt,{children:e.jsxs(vt,{"data-slot":"select-content",className:P("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...s,children:[e.jsx(os,{}),e.jsx(yt,{className:P("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(xs,{})]})})}function A({className:t,children:a,...n}){return e.jsxs(Nt,{"data-slot":"select-item",className:P("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(wt,{children:e.jsx(Mt,{className:"size-4"})})}),e.jsx(St,{children:a})]})}function os({className:t,...a}){return e.jsx(kt,{"data-slot":"select-scroll-up-button",className:P("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(Tt,{className:"size-4"})})}function xs({className:t,...a}){return e.jsx(At,{"data-slot":"select-scroll-down-button",className:P("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(Ae,{className:"size-4"})})}function ms(t){return t?t.charAt(0).toUpperCase()+t.slice(1):"Student"}function hs(t){if(t.role==="student"){const a=t.grade||"",n=t.section||"";return[a,n].filter(Boolean).join(" - ")||"Student"}return t.role==="teacher"?t.department||"Mathematics":t.role==="admin"?t.department||"System":""}function us(t){if(!t||!t.toDate)return"Never";const a=t.toDate(),s=new Date().getTime()-a.getTime(),c=Math.floor(s/6e4);if(c<1)return"Just now";if(c<60)return`${c} minute${c!==1?"s":""} ago`;const d=Math.floor(c/60);if(d<24)return`${d} hour${d!==1?"s":""} ago`;const p=Math.floor(d/24);return p<7?`${p} day${p!==1?"s":""} ago`:a.toLocaleDateString()}function qe(t){if(!t||!t.toDate)return new Date().toISOString().replace("T"," ").slice(0,19);const a=t.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 ps(){return qe({toDate:()=>new Date})}async function gs(){try{const t=ie(M(T,"users"),ce("createdAt","desc"));return(await $(t)).docs.map(n=>{const s=n.data();return{id:n.id,name:s.name||"Unknown",email:s.email||"",role:ms(s.role),status:s.status||"Active",department:hs(s),grade:s.grade||"",section:s.section||"",classSection:[s.grade||"",s.section||""].filter(Boolean).join(" - "),lrn:s.lrn||"",photo:s.photo||s.photoURL||"",lastLogin:us(s.lastLogin)}})}catch(t){return console.error("[adminService] getAllUsers error:",t),[]}}async function Pe(t,a){const n=de(T,"users",t),s={updatedAt:J()};if(a.name!==void 0&&(s.name=a.name),a.email!==void 0&&(s.email=a.email),a.status!==void 0&&(s.status=a.status),a.role!==void 0&&(s.role=a.role.toLowerCase()),a.department!==void 0&&(s.department=a.department,a.role?.toLowerCase()==="student"&&(s.grade=a.department)),a.grade!==void 0&&(s.grade=a.grade),a.section!==void 0&&(s.section=a.section),a.lrn!==void 0&&(s.lrn=a.lrn),s.grade||s.section){const c=s.grade||"",d=s.section||"";s.classSectionId=[c,d].filter(Boolean).join("_").replace(/\s+/g,"_").toLowerCase()}await Ie(n,s)}async function fs(t){await Ee(de(T,"users",t))}async function bs(t,a,n,s,c){const d=n.toLowerCase(),p={email:t,name:a,role:d,status:"Active",department:s,photo:`https://ui-avatars.com/api/?name=${encodeURIComponent(a)}&background=0d9488&color=fff`,createdAt:J(),updatedAt:J()};if(d==="student"){const f=c?.grade||s||"Grade 11",o=c?.section||"Section A";Object.assign(p,{lrn:c?.lrn||`${Date.now()}`.slice(-12).padStart(12,"0"),grade:f,section:o,classSectionId:[f,o].join("_").replace(/\s+/g,"_").toLowerCase(),level:1,currentXP:0,totalXP:0,streak:0,atRiskSubjects:[],hasTakenDiagnostic:!1})}else d==="teacher"?Object.assign(p,{teacherId:`TCH-${Date.now()}`,subject:"Mathematics",yearsOfExperience:"0",qualification:"",students:[]}):d==="admin"&&Object.assign(p,{adminId:`ADM-${Date.now()}`,position:"Administrator"});return(await Ce(M(T,"users"),p)).id}async function He(){try{const t=ie(M(T,"auditLogs"),ce("timestampRaw","desc"),Re(100));return(await $(t)).docs.map(n=>{const s=n.data();return{id:n.id,severity:s.severity||"Info",timestamp:s.timestamp||qe(s.timestampRaw),user:s.user||{name:"System",role:"Admin",avatar:null},action:s.action||"",category:s.category||"System",details:s.details||""}})}catch(t){return console.error("[adminService] getAuditLogs error:",t),[]}}async function Q(t,a,n,s,c){await Ce(M(T,"auditLogs"),{severity:n,timestamp:ps(),timestampRaw:J(),user:c,action:t,category:a,details:s})}async function js(){try{const t=ie(M(T,"modules"),ce("createdAt","desc"));return(await $(t)).docs.map(n=>{const s=n.data(),c=s.createdAt;return{id:n.id,title:s.title||"",subject:s.subject||"",type:s.type||"Video",difficulty:s.difficulty||"Beginner",status:s.status||"Draft",assigned:s.assigned||0,created:s.created||(c?.toDate?.()?.toLocaleDateString()??"")}})}catch(t){return console.error("[adminService] getModules error:",t),[]}}async function vs(t){return(await Ce(M(T,"modules"),{...t,createdAt:J(),updatedAt:J()})).id}async function ys(t,a){await Ie(de(T,"modules",t),{...a,updatedAt:J()})}async function Ns(t){await Ee(de(T,"modules",t))}async function ws(){try{const t=await $(M(T,"users"));let a=0,n=0,s=0;t.docs.forEach(j=>{const f=j.data();f.role==="student"&&(a++,f.overallRisk==="High"&&s++),f.role==="teacher"&&f.status!=="Inactive"&&n++});let c=0;try{c=(await $(M(T,"classrooms"))).size}catch{}let d=0;try{d=(await $(M(T,"xpActivities"))).size}catch{}let p=0;try{const j=await $(M(T,"progress")),f=[];j.docs.forEach(o=>{const u=o.data();typeof u.averageScore=="number"&&f.push(u.averageScore)}),p=f.length>0?Math.round(f.reduce((o,u)=>o+u,0)/f.length):0}catch{}return{totalStudents:a,activeTeachers:n,totalClasses:c,atRiskStudents:s,avgPerformance:p,aiPredictions:d}}catch(t){return console.error("[adminService] getDashboardStats error:",t),{totalStudents:0,activeTeachers:0,totalClasses:0,atRiskStudents:0,avgPerformance:0,aiPredictions:0}}}async function Ss(t=3){try{const a=ie(M(T,"users"),Pt("role","==","student"),ce("level","desc"),Re(t));return(await $(a)).docs.map(s=>{const c=s.data(),d=c.level||1,p=c.currentXP||0,j=Math.min(100,d*8+Math.round(p/100));return{id:s.id,name:c.name||"Student",avatar:c.photo||c.photoURL||`https://ui-avatars.com/api/?name=${encodeURIComponent(c.name||"S")}&background=0d9488&color=fff`,class:c.grade||"Math",performance:j,level:d}})}catch(a){return console.error("[adminService] getTopPerformers error:",a),[]}}async function ks(){try{const t=await $(M(T,"users"));let a=0,n=0,s=0,c=0,d=0;t.docs.forEach(f=>{const o=f.data();o.role==="student"&&(a++,o.overallRisk==="High"&&s++,o.streak>0&&d++,c+=o.totalXP||0),o.role==="teacher"&&n++});let p=0;try{p=(await $(M(T,"achievements"))).size}catch{}let j=0;try{j=(await $(M(T,"chatSessions"))).size}catch{}return{totalActiveUsers:a+n,totalStudents:a,totalTeachers:n,atRiskStudents:s,achievementsUnlocked:p,totalXPEarned:c,activeStreaks:d,aiTutorSessions:j}}catch(t){return console.error("[adminService] getAnalyticsSummary error:",t),{totalActiveUsers:0,totalStudents:0,totalTeachers:0,atRiskStudents:0,achievementsUnlocked:0,totalXPEarned:0,activeStreaks:0,aiTutorSessions:0}}}const As=()=>{const{userProfile:t}=Ne(),[a,n]=x.useState([]),[s,c]=x.useState(!0),[d,p]=x.useState(!1),[j,f]=x.useState(!1),[o,u]=x.useState(""),[C,b]=x.useState("All Types"),[S,g]=x.useState("All Status"),[v,y]=x.useState(!1),[E,N]=x.useState(!1),[h,r]=x.useState(null),[w,D]=x.useState(null),[m,k]=x.useState({title:"",subject:"",type:"Video",difficulty:"Beginner",status:"Draft",assigned:0,created:new Date().toLocaleDateString()}),F=x.useCallback(async()=>{c(!0);try{const i=await js();n(i)}catch{z.error("Failed to load modules")}finally{c(!1)}},[]);x.useEffect(()=>{F()},[F]);const G=()=>{D(null),k({title:"",subject:"",type:"Video",difficulty:"Beginner",status:"Draft",assigned:0,created:new Date().toLocaleDateString()}),y(!0)},oe=i=>{D(i),k({title:i.title,subject:i.subject,type:i.type,difficulty:i.difficulty,status:i.status,assigned:i.assigned,created:i.created}),y(!0)},xe=async()=>{if(!m.title.trim()||!m.subject.trim()){z.error("Title and subject are required");return}p(!0);try{w?(await ys(w.id,m),await Q("Module Updated","Content","Info",`Updated module: "${m.title}"`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),z.success("Module updated")):(await vs(m),await Q("Module Created","Content","Info",`Created new module: "${m.title}" (${m.subject})`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),z.success("Module created")),await F(),y(!1)}catch{z.error("Failed to save module")}finally{p(!1)}},me=i=>{r(i),N(!0)},he=async()=>{if(!(!h||j)){f(!0);try{await Ns(h.id),await Q("Module Deleted","Content","Warning",`Deleted module: "${h.title}"`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),z.success("Module deleted"),n(i=>i.filter(ge=>ge.id!==h.id)),N(!1),r(null)}catch{z.error("Failed to delete module")}finally{f(!1)}}},ue=a.length,te=a.filter(i=>i.status==="Published").length,pe=a.filter(i=>i.status==="Draft").length,l=a.filter(i=>i.status==="Archived").length,L=i=>{switch(i){case"Published":return"bg-green-100 text-green-700 border-green-200";case"Draft":return"bg-rose-100 text-rose-700 border-rose-200";case"Archived":return"bg-[#edf1f7] text-[#0a1628] border-[#dde3eb]";default:return"bg-[#edf1f7] text-[#0a1628]"}},K=i=>{switch(i){case"Beginner":return"bg-sky-50 text-sky-700";case"Intermediate":return"bg-sky-50 text-sky-700";case"Advanced":return"bg-sky-50 text-sky-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},V=i=>{switch(i){case"Video":return e.jsx(Rt,{size:16,className:"text-sky-600"});case"Quiz":return e.jsx(Et,{size:16,className:"text-teal-600"});default:return e.jsx(Lt,{size:16,className:"text-[#5a6578]"})}},We=i=>{switch(i){case"Video":return"bg-sky-100 text-sky-700";case"Quiz":return"bg-teal-100 text-teal-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},ze=a.filter(i=>{const ge=i.title.toLowerCase().includes(o.toLowerCase())||i.subject.toLowerCase().includes(o.toLowerCase()),Xe=C==="All Types"||i.type===C,Qe=S==="All Status"||i.status===S;return ge&&Xe&&Qe});return e.jsxs(R.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Content Management"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Manage learning modules, templates, and educational content"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(U,{variant:"outline",className:"gap-2 border-[#dde3eb] hover:bg-[#edf1f7]",onClick:F,children:[e.jsx(De,{size:16}),"Refresh"]}),e.jsxs(U,{className:"gap-2 bg-sky-600 hover:bg-sky-700 text-white",onClick:G,children:[e.jsx(Ue,{size:16}),"Create Module"]})]}),s?e.jsx("div",{className:"flex items-center justify-center h-24",children:e.jsx(B,{size:24,className:"animate-spin text-sky-500"})}):null,e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[e.jsx("p",{className:"text-xs font-bold text-[#5a6578] mb-1",children:"Total Modules"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:ue})]}),e.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Ke,{size:14,className:"text-green-500"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Published"})]}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:te})]})}),e.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Te,{size:14,className:"text-rose-500"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Drafts"})]}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:pe})]})}),e.jsx("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(ve,{size:14,className:"text-slate-500"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Archived"})]}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:l})]})})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(we,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx(I,{type:"text",placeholder:"Search modules by title or topic...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:o,onChange:i=>u(i.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:C,onChange:i=>b(i.target.value),children:[e.jsx("option",{children:"All Types"}),e.jsx("option",{children:"Video"}),e.jsx("option",{children:"Quiz"}),e.jsx("option",{children:"Document"})]}),e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:S,onChange:i=>g(i.target.value),children:[e.jsx("option",{children:"All Status"}),e.jsx("option",{children:"Published"}),e.jsx("option",{children:"Draft"}),e.jsx("option",{children:"Archived"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:[e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#edf1f7] border-b border-[#dde3eb]",children:[e.jsx("th",{className:"p-4 w-10",children:e.jsx("input",{type:"checkbox",className:"rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Module"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Type"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Difficulty"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Status"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Assigned"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Created"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:ze.map(i=>e.jsxs("tr",{className:"hover:bg-[#edf1f7] transition-colors group",children:[e.jsx("td",{className:"p-4",children:e.jsx("input",{type:"checkbox",className:"rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"})}),e.jsx("td",{className:"p-4",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 ${i.type==="Video"?"bg-sky-100 text-sky-600":i.type==="Quiz"?"bg-teal-100 text-teal-600":"bg-[#edf1f7] text-[#5a6578]"}`,children:V(i.type)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-[#0a1628] text-sm",children:i.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:i.subject})]})]})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${We(i.type)}`,children:i.type})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${K(i.difficulty)}`,children:i.difficulty})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-bold border ${L(i.status)}`,children:i.status})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-1 text-[#5a6578] text-sm",children:[e.jsx(ne,{size:14}),e.jsx("span",{children:i.assigned})]})}),e.jsx("td",{className:"p-4 text-sm text-[#5a6578]",children:i.created}),e.jsx("td",{className:"p-4 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:()=>oe(i),className:"p-2 hover:bg-[#dde3eb] rounded-lg text-[#5a6578] hover:text-sky-600 transition-colors",children:e.jsx(Te,{size:16})}),e.jsx("button",{onClick:()=>me(i),className:"p-2 hover:bg-red-50 rounded-lg text-[#5a6578] hover:text-red-600 transition-colors",children:e.jsx(ve,{size:16})})]})})]},i.id))})]}),ze.length===0&&!s&&e.jsxs("div",{className:"p-12 text-center text-[#5a6578]",children:[e.jsx(_,{size:48,className:"mx-auto mb-4 text-slate-500"}),e.jsx("p",{className:"font-medium",children:"No modules found"}),e.jsx("p",{className:"text-sm",children:a.length===0?"Create your first module to get started":"Try adjusting your search or filters"})]})]}),e.jsx(Fe,{open:v,onOpenChange:y,children:e.jsxs(Be,{className:"sm:max-w-[480px]",children:[e.jsxs(Oe,{children:[e.jsx(Ge,{children:w?"Edit Module":"Create New Module"}),e.jsx(Ve,{children:w?"Update module details below.":"Fill in the details to create a new learning module."})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Title"}),e.jsx(I,{value:m.title,onChange:i=>k({...m,title:i.target.value}),placeholder:"Module title",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Subject"}),e.jsx(I,{value:m.subject,onChange:i=>k({...m,subject:i.target.value}),placeholder:"e.g. Algebra, Calculus",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Type"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(q,{value:m.type,onValueChange:i=>k({...m,type:i}),children:[e.jsx(W,{children:e.jsx(H,{})}),e.jsxs(X,{children:[e.jsx(A,{value:"Video",children:"Video"}),e.jsx(A,{value:"Quiz",children:"Quiz"}),e.jsx(A,{value:"Document",children:"Document"})]})]})})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Difficulty"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(q,{value:m.difficulty,onValueChange:i=>k({...m,difficulty:i}),children:[e.jsx(W,{children:e.jsx(H,{})}),e.jsxs(X,{children:[e.jsx(A,{value:"Beginner",children:"Beginner"}),e.jsx(A,{value:"Intermediate",children:"Intermediate"}),e.jsx(A,{value:"Advanced",children:"Advanced"}),e.jsx(A,{value:"N/A",children:"N/A"})]})]})})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{className:"text-right text-sm font-medium text-[#0a1628]",children:"Status"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(q,{value:m.status,onValueChange:i=>k({...m,status:i}),children:[e.jsx(W,{children:e.jsx(H,{})}),e.jsxs(X,{children:[e.jsx(A,{value:"Draft",children:"Draft"}),e.jsx(A,{value:"Published",children:"Published"}),e.jsx(A,{value:"Archived",children:"Archived"})]})]})})]})]}),e.jsxs(_e,{children:[e.jsx(U,{variant:"outline",onClick:()=>y(!1),disabled:d,children:"Cancel"}),e.jsxs(U,{onClick:xe,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:d,children:[d?e.jsx(B,{size:16,className:"animate-spin mr-2"}):null,w?"Save Changes":"Create Module"]})]})]})}),e.jsx(ke,{isOpen:E,onClose:()=>{j||(N(!1),r(null))},onConfirm:he,title:"Delete Module?",message:h?`Delete "${h.title}"? This cannot be undone.`:"Delete this module? This cannot be undone.",confirmText:j?"Deleting...":"Delete",cancelText:"Cancel",type:"danger",icon:"delete"})]})},Cs=()=>{const[t,a]=x.useState([]),[n,s]=x.useState(!0),[c,d]=x.useState(""),[p,j]=x.useState("All Categories"),[f,o]=x.useState("All Severity"),[u,C]=x.useState("All Roles"),b=x.useCallback(async()=>{s(!0);try{const r=await He();a(r)}catch{z.error("Failed to load audit logs")}finally{s(!1)}},[]);x.useEffect(()=>{b()},[b]);const S=t.filter(r=>r.severity==="Info").length,g=t.filter(r=>r.severity==="Warning").length,v=t.filter(r=>r.severity==="Error"||r.severity==="Critical").length,y=r=>{switch(r){case"Info":return e.jsx(le,{size:16,className:"text-sky-600"});case"Warning":return e.jsx(be,{size:16,className:"text-rose-600"});case"Error":return e.jsx(ae,{size:16,className:"text-red-600"});case"Critical":return e.jsx(ae,{size:16,className:"text-red-600"});default:return e.jsx(le,{size:16,className:"text-[#5a6578]"})}},E=r=>{switch(r){case"Info":return"bg-sky-100 text-sky-700 border-sky-200";case"Warning":return"bg-rose-100 text-rose-700 border-rose-200";case"Error":return"bg-red-100 text-red-700 border-red-200";case"Critical":return"bg-red-100 text-red-700 border-red-200 ring-2 ring-red-500";default:return"bg-[#edf1f7] text-[#0a1628] border-[#dde3eb]"}},N=r=>{switch(r){case"Auth":return"bg-sky-100 text-sky-700";case"Data":return"bg-rose-100 text-rose-700";case"User":return"bg-sky-100 text-sky-700";case"System":return"bg-[#edf1f7] text-[#0a1628]";case"Content":return"bg-green-100 text-green-700";default:return"bg-[#edf1f7] text-[#0a1628]"}},h=t.filter(r=>{const w=r.action.toLowerCase().includes(c.toLowerCase())||r.details.toLowerCase().includes(c.toLowerCase())||r.user.name.toLowerCase().includes(c.toLowerCase()),D=p==="All Categories"||r.category===p,m=f==="All Severity"||r.severity===f,k=u==="All Roles"||r.user.role===u;return w&&D&&m&&k});return e.jsxs(R.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Audit Log"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"System activity monitoring and security events"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"bg-white px-3 py-2 rounded-xl border border-[#dde3eb] flex items-center gap-2 text-[#5a6578] text-sm font-medium",children:[e.jsx(ye,{size:16}),e.jsx("span",{children:"Last 100 events"})]}),e.jsxs(U,{variant:"outline",className:"gap-2 border-[#dde3eb] hover:bg-[#edf1f7]",onClick:b,children:[e.jsx(De,{size:16}),"Refresh"]})]}),n?e.jsx("div",{className:"flex items-center justify-center h-24",children:e.jsx(B,{size:24,className:"animate-spin text-sky-500"})}):null,e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[e.jsx("p",{className:"text-xs font-bold text-[#5a6578] mb-1",children:"Total Events"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:t.length})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-sky-200 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(le,{size:14,className:"text-sky-600"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Info"})]}),e.jsx("p",{className:"text-2xl font-bold text-sky-600",children:S})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-rose-200 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(be,{size:14,className:"text-rose-600"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Warnings"})]}),e.jsx("p",{className:"text-2xl font-bold text-rose-600",children:g})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-red-200 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(ae,{size:14,className:"text-red-600"}),e.jsx("p",{className:"text-xs font-bold text-[#5a6578]",children:"Errors"})]}),e.jsx("p",{className:"text-2xl font-bold text-red-600",children:v})]})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(we,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx(I,{type:"text",placeholder:"Search by user, action, or details...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:c,onChange:r=>d(r.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:p,onChange:r=>j(r.target.value),children:[e.jsx("option",{children:"All Categories"}),e.jsx("option",{children:"Auth"}),e.jsx("option",{children:"Data"}),e.jsx("option",{children:"User"}),e.jsx("option",{children:"System"}),e.jsx("option",{children:"Content"})]}),e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:f,onChange:r=>o(r.target.value),children:[e.jsx("option",{children:"All Severity"}),e.jsx("option",{children:"Info"}),e.jsx("option",{children:"Warning"}),e.jsx("option",{children:"Error"}),e.jsx("option",{children:"Critical"})]}),e.jsxs("select",{className:"px-3 py-2 rounded-lg border border-[#dde3eb] bg-white text-sm font-medium text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",value:u,onChange:r=>C(r.target.value),children:[e.jsx("option",{children:"All Roles"}),e.jsx("option",{children:"Admin"}),e.jsx("option",{children:"Teacher"}),e.jsx("option",{children:"Student"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:[e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#edf1f7] border-b border-[#dde3eb]",children:[e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Severity"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Timestamp"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"User"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Action"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Category"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider",children:"Details"}),e.jsx("th",{className:"p-4 text-xs font-bold text-[#5a6578] uppercase tracking-wider text-right",children:"View"})]})}),e.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:h.map(r=>e.jsxs("tr",{className:"hover:bg-[#edf1f7] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold border ${E(r.severity)}`,children:[y(r.severity),r.severity]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2 text-[#5a6578] text-sm",children:[e.jsx("div",{className:"p-1 bg-[#edf1f7] rounded",children:e.jsx(ye,{size:12})}),r.timestamp]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[r.user.avatar?e.jsx("img",{src:r.user.avatar,alt:r.user.name,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 bg-sky-100 rounded-full flex items-center justify-center",children:e.jsx(Z,{size:16,className:"text-sky-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-[#0a1628] text-sm",children:r.user.name}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:r.user.role})]})]})}),e.jsx("td",{className:"p-4",children:e.jsx("p",{className:"font-medium text-[#0a1628] text-sm",children:r.action})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${N(r.category)}`,children:r.category})}),e.jsx("td",{className:"p-4 text-sm text-[#5a6578] max-w-xs truncate",title:r.details,children:r.details}),e.jsx("td",{className:"p-4 text-right",children:e.jsx("button",{className:"p-2 hover:bg-[#dde3eb] rounded-lg text-slate-500 hover:text-sky-600 transition-colors",children:e.jsx(Ut,{size:16})})})]},r.id))})]}),h.length===0&&!n&&e.jsxs("div",{className:"p-12 text-center text-[#5a6578]",children:[e.jsx(Z,{size:48,className:"mx-auto mb-4 text-slate-500"}),e.jsx("p",{className:"font-medium",children:"No logs found"}),e.jsx("p",{className:"text-sm",children:t.length===0?"Audit events will appear here as actions are performed":"Try adjusting your search or filters"})]})]})]})},Ds=()=>JSON.parse(JSON.stringify(et)),zs=()=>{const{userProfile:t}=Ne(),[a,n]=x.useState("General"),[s,c]=x.useState(Ds()),[d,p]=x.useState(!1),[j,f]=x.useState(!1),o=[{id:"General",label:"General",icon:Ze},{id:"Security",label:"Security",icon:Z},{id:"AI Features",label:"AI Features",icon:Le},{id:"Academic",label:"Academic",icon:_},{id:"Notifications",label:"Notifications",icon:Ye},{id:"Backup & Data",label:"Backup & Data",icon:ee}];x.useEffect(()=>{(async()=>{if(t?.uid){p(!0);try{const S=await tt(t.uid);c(S)}catch(S){console.error("Failed loading admin settings:",S),z.error("Failed to load admin settings")}finally{p(!1)}}})()},[t?.uid]);const u=b=>{c(S=>({...S,adminPanel:{...S.adminPanel,...b}}))},C=async()=>{if(t?.uid){f(!0);try{const b=await st(t.uid,s);c(b),z.success("Admin settings updated")}catch(b){console.error("Failed saving admin settings:",b),z.error("Failed to save admin settings")}finally{f(!1)}}};return e.jsx(R.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsx("div",{className:"col-span-12 md:col-span-3",children:e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-[#dde3eb] overflow-hidden",children:e.jsx("nav",{className:"flex flex-col py-2",children:o.map(b=>{const S=b.icon,g=a===b.id;return e.jsxs("button",{onClick:()=>n(b.id),className:`flex items-center gap-3 px-4 py-3 text-sm font-medium transition-all relative ${g?"text-sky-600 bg-sky-50/50":"text-[#5a6578] hover:bg-[#edf1f7] hover:text-[#0a1628]"}`,children:[g&&e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-sky-600 rounded-r-full"}),e.jsx(S,{size:18,className:g?"text-sky-600":"text-slate-500"}),b.label]},b.id)})})})}),e.jsx("div",{className:"col-span-12 md:col-span-9",children:e.jsx(R.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-6",children:e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-[#dde3eb] p-6",children:d?e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Loading settings..."}):e.jsxs(e.Fragment,{children:[a==="General"&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Site Name"}),e.jsx(I,{value:s.adminPanel.siteName,onChange:b=>u({siteName:b.target.value}),className:"bg-white"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Site Description"}),e.jsx("textarea",{className:"w-full min-h-[80px] px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm focus:outline-none focus:ring-2 focus:ring-sky-500/20 placeholder:text-slate-500 resize-none",value:s.adminPanel.siteDescription,onChange:b=>u({siteDescription:b.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Default Language"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:s.adminPanel.defaultLanguage,onChange:b=>u({defaultLanguage:b.target.value}),className:"w-full px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[e.jsx("option",{children:"English"}),e.jsx("option",{children:"Spanish"}),e.jsx("option",{children:"French"}),e.jsx("option",{children:"German"})]}),e.jsx($t,{size:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),e.jsxs("div",{className:"mt-6 p-4 bg-red-50 border border-red-100 rounded-xl flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg text-red-600 shadow-sm border border-red-100",children:e.jsx(ts,{size:18})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-red-900",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-red-700 mt-0.5",children:"Temporarily disable access for non-admins"})]})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:s.adminPanel.maintenanceMode,onChange:()=>u({maintenanceMode:!s.adminPanel.maintenanceMode})}),e.jsx("div",{className:"w-11 h-6 bg-[#dde3eb] peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-red-300 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-[#dde3eb] after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-red-600"})]})]})]}),a==="Security"&&e.jsxs("div",{className:"space-y-5",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]",children:"Enforce Strong Passwords"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Require stronger passwords for all users"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.enforceStrongPasswords,onChange:()=>u({enforceStrongPasswords:!s.adminPanel.enforceStrongPasswords})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Session Timeout (minutes)"}),e.jsx(I,{type:"number",value:s.adminPanel.sessionTimeoutMinutes,onChange:b=>u({sessionTimeoutMinutes:Number(b.target.value||0)}),className:"max-w-xs"})]})]}),a==="AI Features"&&e.jsxs("div",{className:"space-y-5",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]",children:"AI Tutor"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Enable AI tutoring experience"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.aiTutorEnabled,onChange:()=>u({aiTutorEnabled:!s.adminPanel.aiTutorEnabled})})]}),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]",children:"Auto Recommendations"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Enable AI-generated recommendations"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.aiAutoRecommendations,onChange:()=>u({aiAutoRecommendations:!s.adminPanel.aiAutoRecommendations})})]}),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]",children:"Risk Alerts"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Send proactive risk alerts for at-risk learners"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.aiRiskAlertsEnabled,onChange:()=>u({aiRiskAlertsEnabled:!s.adminPanel.aiRiskAlertsEnabled})})]})]}),a==="Academic"&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Grading Scale"}),e.jsxs("div",{className:"relative max-w-xs",children:[e.jsxs("select",{value:s.adminPanel.gradingScale,onChange:b=>u({gradingScale:b.target.value}),className:"w-full px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[e.jsx("option",{value:"percentage",children:"Percentage"}),e.jsx("option",{value:"gpa",children:"GPA"})]}),e.jsx(rs,{size:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Passing Grade"}),e.jsx(I,{type:"number",value:s.adminPanel.passingGrade,onChange:b=>u({passingGrade:Number(b.target.value||0)}),className:"max-w-xs"})]})]}),a==="Notifications"&&e.jsxs("div",{className:"space-y-5",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]",children:"Parent Summary Emails"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Weekly summaries for guardians"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.parentSummaryEmails,onChange:()=>u({parentSummaryEmails:!s.adminPanel.parentSummaryEmails})})]}),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]",children:"Teacher Digest Emails"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Daily teacher performance digest"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.teacherDigestEmails,onChange:()=>u({teacherDigestEmails:!s.adminPanel.teacherDigestEmails})})]}),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]",children:"Weekly Platform Report"}),e.jsx("p",{className:"text-xs text-slate-500",children:"System report for administrators"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.weeklyPlatformReport,onChange:()=>u({weeklyPlatformReport:!s.adminPanel.weeklyPlatformReport})})]})]}),a==="Backup & Data"&&e.jsxs("div",{className:"space-y-5",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]",children:"Automatic Backups"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Create scheduled backups of platform data"})]}),e.jsx("input",{type:"checkbox",checked:s.adminPanel.autoBackupEnabled,onChange:()=>u({autoBackupEnabled:!s.adminPanel.autoBackupEnabled})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-[#0a1628]",children:"Backup Frequency"}),e.jsxs("select",{value:s.adminPanel.backupFrequency,onChange:b=>u({backupFrequency:b.target.value}),className:"w-full max-w-xs px-3 py-2 rounded-xl border border-[#dde3eb] bg-white text-sm appearance-none focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]})]}),e.jsx("div",{className:"mt-8 pt-6 border-t border-[#dde3eb] flex justify-end",children:e.jsxs(U,{className:"bg-sky-600 hover:bg-sky-700 text-white gap-2",onClick:C,disabled:j,children:[e.jsx(Ft,{size:16}),j?"Saving...":"Save Changes"]})})]})})})})]})})};function Ts({className:t,...a}){return e.jsx(Ct,{"data-slot":"avatar",className:P("relative flex size-10 shrink-0 overflow-hidden rounded-full",t),...a})}function Ms({className:t,...a}){return e.jsx(Dt,{"data-slot":"avatar-image",className:P("aspect-square size-full",t),...a})}function Ps({className:t,...a}){return e.jsx(zt,{"data-slot":"avatar-fallback",className:P("bg-muted flex size-full items-center justify-center rounded-full",t),...a})}const Ls=()=>{const{userProfile:t}=Ne(),[a,n]=x.useState([]),[s,c]=x.useState(!0),[d,p]=x.useState(!1),[j,f]=x.useState(!1),[o,u]=x.useState(""),[C,b]=x.useState("All Roles"),[S,g]=x.useState("All Status"),[v,y]=x.useState(!1),[E,N]=x.useState(!1),[h,r]=x.useState(null),[w,D]=x.useState(null),[m,k]=x.useState({name:"",email:"",role:"Student",status:"Active",department:"",grade:"Grade 11",section:"Section A",lrn:""}),F=x.useCallback(async()=>{c(!0);try{const l=await gs();n(l)}catch{z.error("Failed to load users")}finally{c(!1)}},[]);x.useEffect(()=>{F()},[F]);const G=()=>{D(null),k({name:"",email:"",role:"Student",status:"Active",department:"",grade:"Grade 11",section:"Section A",lrn:""}),y(!0)},oe=l=>{D(l),k({name:l.name,email:l.email,role:l.role,status:l.status,department:l.department,grade:l.grade||"Grade 11",section:l.section||"Section A",lrn:l.lrn||""}),y(!0)},xe=async()=>{if(!m.name.trim()||!m.email.trim()){z.error("Name and email are required");return}p(!0);try{w?(await Pe(w.id,m),await Q("User Updated","User","Info",`Updated user: ${m.name} (${m.email})`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),z.success("User updated successfully")):(await bs(m.email,m.name,m.role,m.role==="Student"?m.grade:m.department,m.role==="Student"?{grade:m.grade,section:m.section,lrn:m.lrn}:void 0),await Q("Created New User","User","Info",`Created new ${m.role.toLowerCase()} account: ${m.name} (${m.email})`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),z.success("User created successfully")),await F(),y(!1)}catch(l){z.error(l instanceof Error?l.message:"Failed to save user")}finally{p(!1)}},me=(l,L)=>{r({id:l,name:L}),N(!0)},he=async()=>{if(!(!h||j)){f(!0);try{await fs(h.id),await Q("User Deleted","User","Warning",`Deleted user account: ${h.name}`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),z.success("User deleted"),n(l=>l.filter(L=>L.id!==h.id)),N(!1),r(null)}catch{z.error("Failed to delete user")}finally{f(!1)}}},ue=async l=>{const L=l.status==="Active"?"Inactive":"Active";try{await Pe(l.id,{status:L}),await Q("User Status Changed","User","Warning",`${L==="Active"?"Activated":"Deactivated"} user: ${l.email}`,{name:t?.name||"Admin",role:"Admin",avatar:t?.photo||null}),z.success(`User ${L==="Active"?"activated":"deactivated"}`),n(K=>K.map(V=>V.id===l.id?{...V,status:L}:V))}catch{z.error("Failed to update user status")}},te=a.filter(l=>{const L=l.name.toLowerCase().includes(o.toLowerCase())||l.email.toLowerCase().includes(o.toLowerCase()),K=C==="All Roles"||l.role===C,V=S==="All Status"||l.status===S;return L&&K&&V}),pe=[{label:"Total Users",value:a.length,color:"text-[#0a1628]"},{label:"Active",value:a.filter(l=>l.status==="Active").length,color:"text-green-600"},{label:"Admins",value:a.filter(l=>l.role==="Admin").length,color:"text-sky-600"},{label:"Teachers",value:a.filter(l=>l.role==="Teacher").length,color:"text-sky-600"},{label:"Students",value:a.filter(l=>l.role==="Student").length,color:"text-emerald-600"}];return e.jsxs("div",{className:"space-y-6",children:[s?e.jsx("div",{className:"flex items-center justify-center h-32",children:e.jsx(B,{size:28,className:"animate-spin text-sky-500"})}):null,e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:pe.map((l,L)=>e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm",children:[e.jsx("h3",{className:`text-2xl font-bold ${l.color}`,children:l.value}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:l.label})]},L))}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-[#dde3eb] shadow-sm space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(we,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx(I,{placeholder:"Search users by name or email...",className:"pl-10 bg-[#edf1f7] border-[#dde3eb]",value:o,onChange:l=>u(l.target.value)})]}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-between gap-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{value:C,onValueChange:b,children:[e.jsx(W,{className:"w-[140px] bg-[#edf1f7] border-[#dde3eb]",children:e.jsx(H,{placeholder:"All Roles"})}),e.jsxs(X,{children:[e.jsx(A,{value:"All Roles",children:"All Roles"}),e.jsx(A,{value:"Admin",children:"Admin"}),e.jsx(A,{value:"Teacher",children:"Teacher"}),e.jsx(A,{value:"Student",children:"Student"})]})]}),e.jsxs(q,{value:S,onValueChange:g,children:[e.jsx(W,{className:"w-[140px] bg-[#edf1f7] border-[#dde3eb]",children:e.jsx(H,{placeholder:"All Status"})}),e.jsxs(X,{children:[e.jsx(A,{value:"All Status",children:"All Status"}),e.jsx(A,{value:"Active",children:"Active"}),e.jsx(A,{value:"Inactive",children:"Inactive"})]})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(U,{variant:"outline",className:"gap-2 border-[#dde3eb] text-[#5a6578]",onClick:F,children:[e.jsx(De,{size:16}),"Refresh"]}),e.jsxs(U,{className:"gap-2 bg-sky-500 hover:bg-sky-600 text-white",onClick:G,children:[e.jsx(Ue,{size:16}),"Add User"]})]})]})]}),e.jsx("div",{className:"bg-white rounded-xl border border-[#dde3eb] shadow-sm overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm text-left",children:[e.jsx("thead",{className:"text-xs text-[#5a6578] uppercase bg-[#edf1f7] border-b border-[#dde3eb]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 font-semibold",children:"User"}),e.jsx("th",{className:"px-6 py-4 font-semibold",children:"Role"}),e.jsx("th",{className:"px-6 py-4 font-semibold",children:"Status"}),e.jsx("th",{className:"px-6 py-4 font-semibold",children:"Class/Department"}),e.jsx("th",{className:"px-6 py-4 font-semibold",children:"Last Login"}),e.jsx("th",{className:"px-6 py-4 font-semibold text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-[#dde3eb]",children:te.length>0?te.map(l=>e.jsxs("tr",{className:"hover:bg-[#edf1f7]/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(Ts,{children:[e.jsx(Ms,{src:l.photo}),e.jsx(Ps,{children:l.name.charAt(0)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-[#0a1628]",children:l.name}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:l.email})]})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[l.role==="Admin"&&e.jsx(Z,{size:14,className:"text-sky-600"}),l.role==="Teacher"&&e.jsx(Se,{size:14,className:"text-sky-600"}),l.role==="Student"&&e.jsx(Yt,{size:14,className:"text-emerald-600"}),e.jsx("span",{className:`
52
+ font-medium text-xs px-2 py-0.5 rounded-full
53
+ ${l.role==="Admin"?"bg-sky-100 text-sky-700":""}
54
+ ${l.role==="Teacher"?"bg-sky-100 text-sky-700":""}
55
+ ${l.role==="Student"?"bg-emerald-100 text-emerald-700":""}
56
+ `,children:l.role})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("span",{className:`
57
+ inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border
58
+ ${l.status==="Active"?"bg-green-50 text-green-700 border-green-200":"bg-[#edf1f7] text-[#5a6578] border-[#dde3eb]"}
59
+ `,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${l.status==="Active"?"bg-green-500":"bg-[#a8a5b3]"}`}),l.status]})}),e.jsx("td",{className:"px-6 py-4 text-[#5a6578]",children:l.role==="Student"&&l.classSection||l.department}),e.jsx("td",{className:"px-6 py-4 text-[#5a6578]",children:l.lastLogin}),e.jsx("td",{className:"px-6 py-4 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>oe(l),className:"p-1.5 text-slate-500 hover:text-sky-600 hover:bg-sky-50 rounded-lg transition-colors",children:e.jsx(as,{size:16})}),e.jsx("button",{onClick:()=>ue(l),className:`p-1.5 rounded-lg transition-colors ${l.status==="Active"?"text-slate-500 hover:text-orange-600 hover:bg-orange-50":"text-orange-500 hover:text-green-600 hover:bg-green-50"}`,title:l.status==="Active"?"Deactivate User":"Activate User",children:l.status==="Active"?e.jsx(qt,{size:16}):e.jsx(is,{size:16})}),e.jsx("button",{onClick:()=>me(l.id,l.name),className:"p-1.5 text-slate-500 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:e.jsx(ve,{size:16})})]})})]},l.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-6 py-12 text-center text-[#5a6578]",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"p-3 bg-[#edf1f7] rounded-full",children:e.jsx(ne,{size:24,className:"text-slate-500"})}),e.jsx("p",{children:"No users found matching your filters"})]})})})})]})})}),e.jsx(Fe,{open:v,onOpenChange:y,children:e.jsxs(Be,{className:"sm:max-w-[425px]",children:[e.jsxs(Oe,{children:[e.jsx(Ge,{children:w?"Edit User Access":"Add New User"}),e.jsx(Ve,{children:w?"Update user details and manage access permissions.":"Create a new user account and assign roles."})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"name",className:"text-right text-sm font-medium text-[#0a1628]",children:"Name"}),e.jsx(I,{id:"name",value:m.name,onChange:l=>k({...m,name:l.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"email",className:"text-right text-sm font-medium text-[#0a1628]",children:"Email"}),e.jsx(I,{id:"email",type:"email",value:m.email,onChange:l=>k({...m,email:l.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"role",className:"text-right text-sm font-medium text-[#0a1628]",children:"Role"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(q,{value:m.role,onValueChange:l=>k({...m,role:l}),children:[e.jsx(W,{children:e.jsx(H,{placeholder:"Select role"})}),e.jsxs(X,{children:[e.jsx(A,{value:"Student",children:"Student"}),e.jsx(A,{value:"Teacher",children:"Teacher"}),e.jsx(A,{value:"Admin",children:"Admin"})]})]})})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"status",className:"text-right text-sm font-medium text-[#0a1628]",children:"Status"}),e.jsx("div",{className:"col-span-3",children:e.jsxs(q,{value:m.status,onValueChange:l=>k({...m,status:l}),children:[e.jsx(W,{children:e.jsx(H,{placeholder:"Select status"})}),e.jsxs(X,{children:[e.jsx(A,{value:"Active",children:"Active"}),e.jsx(A,{value:"Inactive",children:"Inactive"})]})]})})]}),m.role==="Student"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"lrn",className:"text-right text-sm font-medium text-[#0a1628]",children:"LRN"}),e.jsx(I,{id:"lrn",value:m.lrn,onChange:l=>k({...m,lrn:l.target.value}),placeholder:"12-digit learner reference",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"grade",className:"text-right text-sm font-medium text-[#0a1628]",children:"Grade"}),e.jsx(I,{id:"grade",value:m.grade,onChange:l=>k({...m,grade:l.target.value}),placeholder:"e.g. Grade 11",className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"section",className:"text-right text-sm font-medium text-[#0a1628]",children:"Section"}),e.jsx(I,{id:"section",value:m.section,onChange:l=>k({...m,section:l.target.value}),placeholder:"e.g. STEM A",className:"col-span-3"})]})]}):e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"department",className:"text-right text-sm font-medium text-[#0a1628]",children:"Department"}),e.jsx(I,{id:"department",value:m.department,onChange:l=>k({...m,department:l.target.value}),placeholder:"e.g. Mathematics",className:"col-span-3"})]})]}),e.jsxs(_e,{children:[e.jsx(U,{variant:"outline",onClick:()=>y(!1),disabled:d,children:"Cancel"}),e.jsxs(U,{onClick:xe,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:d,children:[d?e.jsx(B,{size:16,className:"animate-spin mr-2"}):null,w?"Save Changes":"Create User"]})]})]})}),e.jsx(ke,{isOpen:E,onClose:()=>{j||(N(!1),r(null))},onConfirm:he,title:"Delete User?",message:h?`Delete user "${h.name}"? This cannot be undone.`:"Delete this user? This cannot be undone.",confirmText:j?"Deleting...":"Delete",cancelText:"Cancel",type:"danger",icon:"delete"})]})},Y=({icon:t,title:a,subtitle:n})=>e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-10 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-[#edf1f7] flex items-center justify-center",children:t}),e.jsx("p",{className:"text-sm font-semibold text-[#5a6578]",children:a}),n&&e.jsx("p",{className:"text-xs text-[#a0aec0] max-w-xs",children:n})]}),Rs=()=>{const[t,a]=x.useState("30d"),[n,s]=x.useState(null),[c,d]=x.useState(!0);x.useEffect(()=>{ks().then(s).catch(console.error).finally(()=>d(!1))},[]);const p={"7d":"Last 7 Days","30d":"Last 30 Days","90d":"Last 90 Days","12m":"Last 12 Months"},j=[{label:"Total Active Users",value:c?null:(n?.totalActiveUsers??0).toLocaleString(),icon:ne,color:"from-sky-500 to-blue-600"},{label:"Avg. Completion Rate",value:null,icon:$e,color:"from-teal-500 to-emerald-600"},{label:"Avg. Session Duration",value:null,icon:at,color:"from-violet-500 to-purple-600"},{label:"At-Risk Students",value:c?null:(n?.atRiskStudents??0).toString(),icon:Me,color:"from-rose-500 to-orange-600"}],f=[{label:"Achievements Unlocked",icon:re,color:"text-rose-600",bg:"bg-rose-50",value:c?null:(n?.achievementsUnlocked??0).toLocaleString()},{label:"XP Earned (Platform)",icon:Le,color:"text-violet-600",bg:"bg-violet-50",value:c?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:lt,color:"text-orange-600",bg:"bg-orange-50",value:c?null:(n?.activeStreaks??0).toLocaleString()},{label:"AI Tutor Sessions",icon:rt,color:"text-sky-600",bg:"bg-sky-50",value:c?null:(n?.aiTutorSessions??0).toLocaleString()}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(R.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.3},className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-2 bg-white rounded-xl p-1 shadow-sm border border-[#dde3eb]",children:Object.entries(p).map(([o,u])=>e.jsx("button",{onClick:()=>a(o),className:`px-4 py-2 rounded-lg text-sm font-semibold transition-all ${t===o?"bg-sky-600 text-white shadow-sm":"text-[#5a6578] hover:bg-[#edf1f7]"}`,children:u},o))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(U,{variant:"outline",disabled:!0,className:"px-4 py-2 gap-2 rounded-xl border-[#dde3eb] font-semibold text-sm opacity-50 cursor-not-allowed",children:[e.jsx(Bt,{size:16}),"Filters"]}),e.jsxs(U,{variant:"outline",disabled:!0,className:"px-4 py-2 gap-2 rounded-xl border-[#dde3eb] font-semibold text-sm opacity-50 cursor-not-allowed",children:[e.jsx(_t,{size:16}),"Export"]})]})]}),!c&&!n?.totalActiveUsers&&e.jsxs(R.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.35},className:"flex items-center gap-3 bg-rose-50 border border-rose-200 rounded-2xl px-5 py-4",children:[e.jsx(ee,{size:18,className:"text-rose-600 shrink-0"}),e.jsxs("p",{className:"text-sm text-rose-800",children:[e.jsx("span",{className:"font-semibold",children:"Limited analytics data."})," ","KPI cards will populate automatically as students, quizzes, and sessions accumulate in the platform. Chart visualisations require time-series data."]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:j.map((o,u)=>{const C=o.icon;return e.jsxs(R.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.35,delay:u*.06},className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("div",{className:`w-11 h-11 rounded-xl bg-gradient-to-br ${o.color} flex items-center justify-center shadow-sm`,children:e.jsx(C,{size:20,className:"text-white"})}),e.jsx("div",{className:"w-[120px] h-8 rounded bg-[#f0f3f8]"})]}),c?e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(B,{size:16,className:"animate-spin text-[#a0aec0]"}),e.jsx("div",{className:"w-14 h-6 bg-[#edf1f7] rounded-lg animate-pulse"})]}):o.value!==null?e.jsx("p",{className:"text-2xl font-bold text-[#0a1628] mb-2",children:o.value}):e.jsx("div",{className:"w-16 h-7 bg-[#edf1f7] rounded-lg mb-2"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-[#5a6578] font-medium",children:o.label}),e.jsx("span",{className:"text-xs text-[#a0aec0] font-medium",children:o.value===null?"โ€”":p[t]})]})]},o.label)})}),e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsxs(R.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.15},className:"col-span-8 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Performance Trends"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Average scores โ€” students vs. teacher targets"})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-sky-300"}),e.jsx("span",{className:"text-[#a0aec0] font-medium",children:"Students"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-violet-300"}),e.jsx("span",{className:"text-[#a0aec0] font-medium",children:"Teacher Targets"})]})]})]}),e.jsx(Y,{icon:e.jsx(je,{size:24,className:"text-[#c2cad8]"}),title:"No performance data yet",subtitle:"Import student and class records to generate trend charts."})]}),e.jsxs(R.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.2},className:"col-span-4 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-violet-100 rounded-xl flex items-center justify-center",children:e.jsx(Qt,{size:20,className:"text-violet-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Grade Distribution"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"All students, current term"})]})]}),e.jsx(Y,{icon:e.jsx(ee,{size:24,className:"text-[#c2cad8]"}),title:"No grade data",subtitle:"Import quiz and assessment results to see grade breakdowns."})]})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsxs(R.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.25},className:"col-span-7 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center",children:e.jsx(_,{size:20,className:"text-sky-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Subject Engagement"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Enrollment, completion, and average scores"})]})]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-[#dde3eb]",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#f7f9fc]",children:[e.jsx("th",{className:"text-left text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Subject"}),e.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Enrolled"}),e.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Completion"}),e.jsx("th",{className:"text-right text-xs font-semibold text-[#5a6578] px-4 py-3",children:"Avg. Score"}),e.jsx("th",{className:"text-left text-xs font-semibold text-[#5a6578] px-4 py-3 w-36",children:"Progress"})]})}),e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-4 py-10",children:e.jsx(Y,{icon:e.jsx(ee,{size:22,className:"text-[#c2cad8]"}),title:"No subject data available",subtitle:"Import class enrollment records to view subject engagement."})})})})]})})]}),e.jsxs(R.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.3},className:"col-span-5 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-orange-100 rounded-xl flex items-center justify-center",children:e.jsx(ye,{size:20,className:"text-orange-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Weekly Activity"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Sessions per day of week"})]})]}),e.jsx(Y,{icon:e.jsx(Me,{size:24,className:"text-[#c2cad8]"}),title:"No session activity yet",subtitle:"Student logins and session data will appear here after data is imported."})]})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsxs(R.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.35},className:"col-span-5 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-rose-100 rounded-xl flex items-center justify-center",children:e.jsx(re,{size:20,className:"text-rose-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Gamification Overview"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Engagement & motivation metrics"})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:f.map(o=>{const u=o.icon;return e.jsxs("div",{className:`${o.bg} border border-[#dde3eb] rounded-xl p-4`,children:[e.jsx(u,{size:20,className:o.color}),c?e.jsx("div",{className:"w-12 h-5 bg-white/60 rounded mt-2 mb-1 animate-pulse"}):o.value!==null?e.jsx("p",{className:"text-lg font-bold text-[#0a1628] mt-2 mb-1",children:o.value}):e.jsx("div",{className:"w-12 h-5 bg-white/60 rounded mt-2 mb-1"}),e.jsx("p",{className:"text-xs text-[#5a6578] font-medium",children:o.label}),!c&&o.value===null&&e.jsx("p",{className:"text-[10px] text-[#a0aec0] mt-1",children:"No data yet"})]},o.label)})})]}),e.jsxs(R.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,delay:.4},className:"col-span-7 bg-white rounded-2xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-teal-100 rounded-xl flex items-center justify-center",children:e.jsx(Se,{size:20,className:"text-teal-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Top Performing Classes"}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:"Ranked by average score this term"})]})]}),e.jsx(Y,{icon:e.jsx(ee,{size:24,className:"text-[#c2cad8]"}),title:"No class data yet",subtitle:"Import class and student records to see top performers ranked here."})]})]})]})},se=[{id:"gen-math",name:"Gen Math",shortName:"GM",color:"#3B82F6"},{id:"stats-prob",name:"Stats & Prob",shortName:"SP",color:"#0ea5e9"},{id:"pre-calc",name:"Pre-Calc",shortName:"PC",color:"#F97316"},{id:"basic-calc",name:"Basic Calc",shortName:"BC",color:"#EF4444"}],fe={"gen-math":[{name:"Functions & Relations",unit:"Functions"},{name:"Rational Functions",unit:"Functions"},{name:"Exponential Functions",unit:"Functions"},{name:"Logarithmic Functions",unit:"Functions"},{name:"Simple Interest",unit:"Business Math"},{name:"Compound Interest",unit:"Business Math"},{name:"Annuities",unit:"Business Math"},{name:"Propositions",unit:"Logic"},{name:"Truth Tables",unit:"Logic"}],"stats-prob":[{name:"Random Variables",unit:"Random Variables"},{name:"Probability Distributions",unit:"Random Variables"},{name:"Normal Distribution",unit:"Normal Dist"},{name:"Z-scores",unit:"Normal Dist"},{name:"Sampling Distributions",unit:"Sampling"},{name:"Central Limit Theorem",unit:"Sampling"},{name:"Confidence Intervals",unit:"Estimation"},{name:"Hypothesis Testing",unit:"Testing"},{name:"Correlation",unit:"Regression"}],"pre-calc":[{name:"Parabola",unit:"Conics"},{name:"Ellipse",unit:"Conics"},{name:"Hyperbola",unit:"Conics"},{name:"Arithmetic Seq",unit:"Series"},{name:"Geometric Seq",unit:"Series"},{name:"Math Induction",unit:"Series"},{name:"Trig Functions",unit:"Trigonometry"},{name:"Trig Identities",unit:"Trigonometry"},{name:"Polar Coords",unit:"Trigonometry"}],"basic-calc":[{name:"Limits",unit:"Limits"},{name:"Continuity",unit:"Limits"},{name:"Definition of Deriv.",unit:"Derivatives"},{name:"Diff. Rules",unit:"Derivatives"},{name:"Chain Rule",unit:"Derivatives"},{name:"Related Rates",unit:"Derivatives"},{name:"Optimization",unit:"Derivatives"},{name:"Antiderivatives",unit:"Integration"},{name:"Definite Integrals",unit:"Integration"}]};function Is(t){return t>=85?"bg-emerald-500":t>=70?"bg-emerald-300":t>=55?"bg-rose-300":t>=40?"bg-orange-400":t>=20?"bg-red-400":"bg-red-600"}function Es(t){return t>=70||t>=40,"text-white"}const Us=({title:t="Platform-Wide Subject Mastery"})=>{const[a,n]=x.useState(null),[s,c]=x.useState("all"),[d,p]=x.useState([]),[j,f]=x.useState(!0);x.useEffect(()=>{(async()=>{f(!0);try{const v=await $(M(T,"progress")),y={};v.forEach(N=>{const r=N.data().subjects||{};for(const[w,D]of Object.entries(r)){const m=fe[w]||[],k=D?.progress??0;for(const F of m){const G=`${w}::${F.name}`;y[G]||(y[G]={totalMastery:0,count:0}),y[G].totalMastery+=k,y[G].count+=1}}});const E=[];for(const N of se){const h=fe[N.id]||[];for(const r of h){const w=`${N.id}::${r.name}`,D=y[w];E.push({subject:N.id,topic:r.name,mastery:D&&D.count>0?Math.round(D.totalMastery/D.count):0,students:D?.count??0})}}p(E)}catch(v){console.error("[MasteryHeatmap] Error fetching progress data:",v)}finally{f(!1)}})()},[]);const o=s==="all"?se:se.filter(g=>g.id===s),u=d.filter(g=>g.students>0),C=u.length>0?Math.round(u.reduce((g,v)=>g+v.mastery,0)/u.length):0,b=u.length>0?u.reduce((g,v)=>v.mastery<g.mastery?v:g,u[0]):null,S=u.length>0?u.reduce((g,v)=>v.mastery>g.mastery?v:g,u[0]):null;return j?e.jsx("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb] flex items-center justify-center min-h-[200px]",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(B,{size:28,className:"text-sky-500 animate-spin"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Loading mastery data..."})]})}):e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",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 bg-gradient-to-br from-indigo-500 to-sky-500 rounded-xl flex items-center justify-center",children:e.jsx(Kt,{size:20,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578]",children:["Aggregated mastery levels across all classes โ€ข ",d.filter(g=>g.students>0).length," tracked combinations"]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:s,onChange:g=>c(g.target.value),className:"appearance-none bg-[#edf1f7] border border-[#dde3eb] rounded-lg px-3 py-1.5 pr-8 text-xs font-semibold text-[#5a6578] focus:outline-none focus:ring-2 focus:ring-sky-500/20",children:[e.jsx("option",{value:"all",children:"All Subjects"}),se.map(g=>e.jsx("option",{value:g.id,children:g.name},g.id))]}),e.jsx(Ae,{size:12,className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-5",children:[e.jsxs("div",{className:"bg-[#edf1f7] rounded-xl p-3 flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${C>=70?"bg-emerald-100":"bg-rose-100"}`,children:e.jsx(It,{size:16,className:C>=70?"text-emerald-600":"text-rose-600"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-lg font-bold text-[#0a1628]",children:[C,"%"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider",children:"Platform Average"})]})]}),e.jsxs("div",{className:"bg-red-50 rounded-xl p-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-red-100 rounded-lg flex items-center justify-center",children:e.jsx(Ot,{size:16,className:"text-red-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628] truncate",children:b?.topic}),e.jsxs("p",{className:"text-[10px] text-red-600 font-semibold",children:[b?.mastery,"% โ€” Lowest"]})]})]}),e.jsxs("div",{className:"bg-emerald-50 rounded-xl p-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-emerald-100 rounded-lg flex items-center justify-center",children:e.jsx(nt,{size:16,className:"text-emerald-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628] truncate",children:S?.topic}),e.jsxs("p",{className:"text-[10px] text-emerald-600 font-semibold",children:[S?.mastery,"% โ€” Highest"]})]})]})]}),e.jsx("div",{className:"overflow-x-auto",children:o.map(g=>{const v=fe[g.id]||[],y=d.filter(N=>N.subject===g.id),E=y.length>0?Math.round(y.reduce((N,h)=>N+h.mastery,0)/y.length):0;return e.jsxs("div",{className:"mb-5 last:mb-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:g.color}}),e.jsx("span",{className:"text-xs font-bold text-[#0a1628]",children:g.name}),e.jsxs("span",{className:"text-[10px] text-slate-500 ml-1",children:["Avg: ",E,"%"]})]}),e.jsxs("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${v.length}, minmax(0, 1fr))`},children:[v.map((N,h)=>e.jsx("div",{className:"text-center",children:e.jsx("p",{className:"text-[9px] text-slate-500 truncate px-0.5 mb-1",title:N.name,children:N.name})},`label-${h}`)),v.map((N,h)=>{const r=y.find(m=>m.topic===N.name),w=r?.mastery||0,D=a?.topic===N.name&&a?.subject===g.id;return e.jsxs(R.div,{onMouseEnter:()=>r&&n(r),onMouseLeave:()=>n(null),whileHover:{scale:1.05},className:`relative h-10 rounded-lg flex items-center justify-center cursor-pointer transition-all ${Is(w)} ${D?"ring-2 ring-white shadow-lg z-10":""}`,children:[e.jsxs("span",{className:`text-xs font-bold ${Es(w)}`,children:[w,"%"]}),D&&r&&e.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 bg-slate-800 text-white rounded-lg px-3 py-2 text-xs whitespace-nowrap z-20 shadow-xl pointer-events-none",children:[e.jsx("p",{className:"font-bold mb-0.5",children:r.topic}),e.jsxs("p",{children:["Mastery: ",e.jsxs("strong",{children:[r.mastery,"%"]})]}),e.jsxs("p",{children:["Students: ",e.jsx("strong",{children:r.students})]}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-full w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[6px] border-t-slate-800"})]})]},`cell-${h}`)})]})]},g.id)})}),e.jsxs("div",{className:"flex items-center justify-center gap-4 mt-5 pt-4 border-t border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#5a6578]",children:[e.jsx(le,{size:10}),e.jsx("span",{children:"Color scale:"})]}),[{label:"0-19%",color:"bg-red-600"},{label:"20-39%",color:"bg-red-400"},{label:"40-54%",color:"bg-orange-400"},{label:"55-69%",color:"bg-rose-300"},{label:"70-84%",color:"bg-emerald-300"},{label:"85-100%",color:"bg-emerald-500"}].map((g,v)=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:`w-3 h-3 rounded-sm ${g.color}`}),e.jsx("span",{className:"text-[10px] text-[#5a6578]",children:g.label})]},v))]})]})},$s=[{id:"gen-math",title:"General Mathematics",icon:_,bg:"bg-[#9956DE]",tags:["Algebra","Fractions","Integers"],level:1,progress:25,isAtRisk:!0},{id:"pre-calc",title:"Pre-Calculus",icon:_,bg:"bg-[#1FA7E1]",tags:["Functions","Limits","Graphs"],level:2,progress:15,isAtRisk:!0},{id:"stats-prob",title:"Statistics & Probability",icon:_,bg:"bg-[#FFB356]",tags:["Probability","Mean/Median"],level:2,progress:40,isAtRisk:!1},{id:"basic-calc",title:"Basic Calculus",icon:_,bg:"bg-[#FB96BB]",tags:["Derivatives","Integrals"],level:3,progress:50,isAtRisk:!1},{id:"adv-math",title:"Advanced Algebra",icon:_,bg:"bg-[#7274ED]",tags:["Math","Logic"],level:4,progress:10,isAtRisk:!0}].slice(0,5),Fs=()=>{const t=x.useRef(null),[a,n]=x.useState(0),s=()=>{if(!t.current)return;const{scrollLeft:d,scrollWidth:p,clientWidth:j}=t.current,f=d/(p-j),o=3;let u=Math.round(f*(o-1));u<0&&(u=0),u>=o&&(u=o-1),n(u)},c=d=>{if(!t.current)return;const{scrollWidth:p,clientWidth:j}=t.current,o=(p-j)/2*d;t.current.scrollTo({left:o,behavior:"smooth"}),n(d)};return e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb] mb-6",children:[e.jsx("div",{className:"flex items-center justify-between mb-5",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-1",children:"Priority Attention Modules"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Highly recommended to be reviewed (lowest performance)."})]})}),e.jsx("div",{className:"relative",children:e.jsx("div",{ref:t,onScroll:s,className:"flex overflow-x-auto snap-x snap-mandatory gap-5 pb-6 hide-scrollbar",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:$s.map(d=>{const p=d.icon;return e.jsxs("div",{className:`snap-center shrink-0 w-[280px] sm:w-[300px] ${d.bg} rounded-[2rem] p-5 min-h-[290px] relative overflow-hidden transition-all duration-300 flex flex-col group shadow-sm`,children:[e.jsx("div",{className:"absolute -bottom-8 right-[-20%] w-32 h-32 bg-white opacity-10 rounded-full"}),e.jsx("div",{className:"absolute bottom-4 right-12 w-20 h-20 bg-white opacity-10 rounded-full"}),e.jsxs("div",{className:"flex justify-between items-start mb-4 relative z-10",children:[e.jsx("div",{className:"w-12 h-12 rounded-[1rem] bg-white/20 flex flex-shrink-0 items-center justify-center text-white backdrop-blur-sm",children:e.jsx(p,{size:24,className:"opacity-90"})}),e.jsxs("div",{className:"px-4 py-1.5 rounded-full bg-white/20 text-white/90 text-sm font-bold backdrop-blur-sm",children:["Lv ",d.level]})]}),e.jsxs("div",{className:"relative z-10 flex-1",children:[e.jsx("h3",{className:"text-2xl font-display font-black text-white leading-[1.1] mb-3 drop-shadow-sm pr-4 line-clamp-2",children:d.title}),e.jsx("div",{className:"flex flex-wrap gap-2 pb-4",children:d.tags.map(j=>e.jsx("span",{className:"px-3 py-1 rounded-full bg-white/20 text-white text-[13px] font-bold shadow-sm backdrop-blur-sm",children:j},j))})]}),e.jsxs("div",{className:"relative z-10 mt-auto pt-4 flex flex-col gap-2.5",children:[e.jsxs("div",{className:"flex justify-between text-white/90 text-[13px] font-bold",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsx("span",{children:"Avg Mastery"})}),e.jsxs("span",{children:[d.progress,"%"]})]}),e.jsx("div",{className:"w-full h-2 rounded-full bg-white/30 overflow-hidden shadow-inner mt-1",children:e.jsx("div",{className:"h-full bg-white rounded-full",style:{width:`${d.progress}%`}})}),d.isAtRisk&&e.jsxs("div",{className:"absolute -top-12 right-0 bg-red-500 text-white px-3 py-1 rounded-full text-[11px] font-bold flex items-center gap-1 shadow-lg animate-pulse",children:[e.jsx(be,{size:12})," At Risk"]})]})]},d.id)})})}),e.jsx("div",{className:"flex justify-center items-center gap-2 mt-2",children:[0,1,2].map(d=>e.jsx("button",{onClick:()=>c(d),className:`w-2.5 h-2.5 rounded-full transition-all duration-300 ${a===d?"bg-sky-600 w-6":"bg-sky-200 hover:bg-sky-300"}`,"aria-label":`Go to slide ${d+1}`},d))}),e.jsx("style",{children:`
60
+ .hide-scrollbar::-webkit-scrollbar {
61
+ display: none;
62
+ }
63
+ `})]})},ca=({onLogout:t,onOpenProfile:a,onOpenSettings:n})=>{const[s,c]=x.useState("Overview"),[d,p]=x.useState(!1),[j,f]=x.useState(!1),[o,u]=x.useState(null),[C,b]=x.useState([]),[S,g]=x.useState([]),[v,y]=x.useState(!0);x.useEffect(()=>{if(s!=="Overview")return;let h=!1;return y(!0),Promise.all([ws(),He(),Ss(3)]).then(([r,w,D])=>{h||(u(r),b(w.slice(0,4)),g(D))}).catch(console.error).finally(()=>{h||y(!1)}),()=>{h=!0}},[s]);const E=[{label:"Total Students",value:v?"...":(o?.totalStudents??0).toLocaleString(),icon:ne,color:"bg-sky-100",iconColor:"text-sky-600"},{label:"Active Teachers",value:v?"...":(o?.activeTeachers??0).toString(),icon:Se,color:"bg-teal-100",iconColor:"text-teal-600"},{label:"Total Classes",value:v?"...":(o?.totalClasses??0).toString(),icon:_,color:"bg-sky-100",iconColor:"text-sky-600"},{label:"At-Risk Students",value:v?"...":(o?.atRiskStudents??0).toString(),icon:ae,color:"bg-red-100",iconColor:"text-red-600"},{label:"Avg Performance",value:v?"...":`${o?.avgPerformance??0}%`,icon:je,color:"bg-orange-100",iconColor:"text-orange-600"},{label:"AI Interactions",value:v?"...":(o?.aiPredictions??0).toLocaleString(),icon:$e,color:"bg-sky-100",iconColor:"text-sky-600"}],N=h=>h==="Error"||h==="Critical"?{text:"text-red-600",bg:"bg-red-50"}:h==="Warning"?{text:"text-rose-600",bg:"bg-rose-50"}:{text:"text-sky-600",bg:"bg-sky-50"};return e.jsxs("div",{className:"flex h-screen w-full bg-[#edf1f7] overflow-hidden",children:[e.jsx(it,{activeTab:s,setActiveTab:c,userRole:"admin",onOpenSettings:n,onLogout:()=>p(!0),sidebarCollapsed:j,setSidebarCollapsed:f}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("header",{className:"bg-white/80 backdrop-blur-md border-b border-[#dde3eb] px-6 py-3 flex items-center justify-between sticky top-0 z-30",children:[e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-display font-bold text-[#0a1628] leading-tight",children:[s==="Overview"&&"Admin Dashboard",s==="Content"&&"Content",s==="Audit Log"&&"Audit Log",s==="User Management"&&"User Management",s==="Analytics"&&"Analytics",s==="Settings"&&"Settings"]}),e.jsxs("p",{className:"text-xs text-[#5a6578] font-body",children:[s==="Overview"&&"System Overview & Management",s==="Content"&&"Manage platform content",s==="Audit Log"&&"Monitor system activity",s==="User Management"&&"Manage all user accounts",s==="Analytics"&&"Detailed performance metrics",s==="Settings"&&"Configure platform settings"]})]})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{onClick:a,className:"flex items-center gap-2.5 w-[152px] h-11 shrink-0 bg-[#edf1f7] p-1.5 pr-3 rounded-lg cursor-pointer hover:bg-[#dde3eb] transition-all group",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-sky-600 to-indigo-600 rounded-lg flex items-center justify-center",children:e.jsx(Z,{size:16,className:"text-white"})}),e.jsx("div",{className:"min-w-0 flex-1 text-left",children:e.jsx("p",{className:"text-sm font-semibold text-[#0a1628] leading-none group-hover:text-sky-600 transition-colors truncate",children:"Admin"})})]})})]}),e.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[s==="Overview"&&e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[e.jsxs("div",{className:"col-span-8 space-y-6",children:[e.jsx("div",{className:"grid grid-cols-3 gap-4",children:E.map((h,r)=>{const w=h.icon;return e.jsxs("div",{className:"bg-white rounded-2xl p-5 shadow-sm border border-[#dde3eb] hover:shadow-md transition-all",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsx("div",{className:`w-12 h-12 ${h.color} rounded-xl flex items-center justify-center`,children:e.jsx(w,{size:24,className:h.iconColor})})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628] mb-1",children:v?e.jsx(B,{size:20,className:"animate-spin text-slate-400"}):h.value}),e.jsx("p",{className:"text-sm text-[#5a6578] font-medium",children:h.label})]},r)})}),e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsx("div",{className:"flex items-center justify-between mb-6",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-1",children:"System Performance Overview"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Last 30 days"})]})}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[e.jsx(je,{size:32,className:"text-[#dde3eb]"}),e.jsx("p",{className:"text-sm font-medium text-[#5a6578]",children:"No performance data yet"}),e.jsx("p",{className:"text-xs text-[#a0aec0]",children:"Import class records to populate analytics."})]})]}),e.jsx(Fs,{}),e.jsx(Us,{}),e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-5",children:"Recent System Activity"}),v?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(B,{className:"animate-spin text-sky-500"})}):C.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3",children:[e.jsx(Wt,{size:28,className:"text-[#dde3eb]"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"No audit events yet"})]}):e.jsx("div",{className:"space-y-3",children:C.map(h=>{const r=N(h.severity);return e.jsxs("div",{className:`${r.bg} border border-[#dde3eb] rounded-2xl p-4 flex items-start gap-4`,children:[e.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(Z,{size:18,className:r.text})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628] mb-0.5",children:h.action}),e.jsx("p",{className:"text-xs text-[#5a6578] truncate",children:h.details}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:[h.timestamp," ยท ",h.user.name]})]})]},h.id)})})]})]}),e.jsxs("div",{className:"col-span-4 space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-600 to-sky-600 rounded-3xl p-6 text-white shadow-lg",children:[e.jsx("h2",{className:"text-lg font-bold mb-4",children:"Quick Actions"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[e.jsx("p",{className:"text-sm font-bold",children:"Add New Teacher"}),e.jsx("p",{className:"text-xs text-sky-100",children:"Create teacher account"})]}),e.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[e.jsx("p",{className:"text-sm font-bold",children:"Add New Student"}),e.jsx("p",{className:"text-xs text-sky-100",children:"Register new student"})]}),e.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[e.jsx("p",{className:"text-sm font-bold",children:"System Settings"}),e.jsx("p",{className:"text-xs text-sky-100",children:"Configure platform"})]}),e.jsxs("button",{className:"w-full bg-white/20 hover:bg-white/30 backdrop-blur-sm border border-slate-300 rounded-xl p-3 text-left transition-all",children:[e.jsx("p",{className:"text-sm font-bold",children:"Generate Report"}),e.jsx("p",{className:"text-xs text-sky-100",children:"Export analytics"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsx("div",{className:"w-10 h-10 bg-rose-100 rounded-xl flex items-center justify-center",children:e.jsx(re,{size:20,className:"text-rose-600"})}),e.jsx("h2",{className:"text-lg font-bold text-[#0a1628]",children:"Top Performers"})]}),v?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(B,{className:"animate-spin text-sky-500"})}):S.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-3",children:[e.jsx(re,{size:28,className:"text-[#dde3eb]"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"No student data yet"}),e.jsx("p",{className:"text-xs text-[#a0aec0]",children:"Students will appear here as they progress."})]}):e.jsx("div",{className:"space-y-3",children:S.map((h,r)=>e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:h.avatar,alt:h.name,className:"w-12 h-12 rounded-xl object-cover"}),e.jsx("span",{className:"absolute -top-1 -right-1 w-6 h-6 bg-rose-500 text-white text-xs font-bold rounded-full flex items-center justify-center",children:r+1})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628]",children:h.name}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:h.class})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-white rounded-xl p-2",children:[e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-1",children:"Performance"}),e.jsxs("p",{className:"text-lg font-bold text-teal-600",children:[h.performance,"%"]})]}),e.jsxs("div",{className:"bg-white rounded-xl p-2",children:[e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-1",children:"Level"}),e.jsx("p",{className:"text-lg font-bold text-sky-600",children:h.level})]})]})]},h.id))})]}),e.jsxs("div",{className:"bg-white rounded-3xl p-6 shadow-sm border border-[#dde3eb]",children:[e.jsx("h2",{className:"text-lg font-bold text-[#0a1628] mb-5",children:"AI Model Status"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-[#5a6578]",children:"Prediction Accuracy"}),e.jsx("span",{className:"text-sm font-bold text-[#5a6578]",children:"No data"})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#dde3eb] rounded-full",style:{width:"0%"}})}),e.jsxs("div",{className:"flex items-center justify-between mt-4",children:[e.jsx("span",{className:"text-sm text-[#5a6578]",children:"Model Performance"}),e.jsx("span",{className:"text-sm font-bold text-[#5a6578]",children:"Untrained"})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#dde3eb] rounded-full",style:{width:"0%"}})}),e.jsx("div",{className:"mt-4 p-3 bg-sky-50 border border-sky-200 rounded-xl",children:e.jsxs("p",{className:"text-xs text-sky-800",children:[e.jsx("strong",{children:"Status:"})," Import student data to enable AI predictions."]})})]})]})]})]}),s==="Content"&&e.jsx(As,{}),s==="Audit Log"&&e.jsx(Cs,{}),s==="User Management"&&e.jsx(Ls,{}),s==="Analytics"&&e.jsx(Rs,{}),s==="Settings"&&e.jsx(zs,{})]})]}),e.jsx(ke,{isOpen:d,onClose:()=>p(!1),onConfirm:t,title:"Logout Confirmation",message:"Are you sure you want to log out? This will end your current session.",confirmText:"Logout",cancelText:"Cancel"})]})};export{ca as default};
assets/AvatarShop-BMkk-nTf.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{r as n,j as e}from"./vendor-react-CCIuKUIB.js";import{r as R,L as O,s as V,t as $}from"./vendor-radix-BAHZvx1W.js";import{c as k,M as B,S as C,aC as K,aD as Y,aE as Z,aF as M,aA as E,m as d,K as D,aG as G,O as l,aH as H,aI as W,aJ as J}from"./index-Cq4H6CKS.js";import{C as U}from"./CompositeAvatar-CxBIl8mP.js";import{L as Q}from"./lock-Cn8nsuCQ.js";import{S as ee}from"./save-DxABtV3B.js";import"./vendor-firebase-CG7e86Dp.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const te=[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]],se=k("footprints",te);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ae=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],re=k("scissors",ae);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const oe=[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]],N=k("shopping-bag",oe),pe=({onSaveProfile:P,onNavigateToModules:A})=>{const{userProfile:r,refreshProfile:h}=B(),[x,S]=n.useState({top:r?.avatarLayers?.top||"top_pink",bottom:r?.avatarLayers?.bottom||"",shoes:r?.avatarLayers?.shoes||"",accessory:r?.avatarLayers?.accessory||""}),[m,f]=n.useState(!1),[b,g]=n.useState([]),[_,w]=n.useState(0),[u,p]=n.useState(null),[c,v]=n.useState(null),z=["Wow!","Cute!","I love it!","Perfect!","So cool!","Awesome!"],y=["Gain more XP to buy me more clothes!","Help me get stylish!","Let's earn some XP to unlock more!","I'd love to try on more outfits!","Keep learning to unlock new looks!"];n.useEffect(()=>{if(r&&r.role==="student"){const t=r;g(t.ownedAvatarItems||[]),w(t.currentXP||0)}},[r]),n.useEffect(()=>{if(!c){const t=setInterval(()=>{Math.random()>.6&&v(y[Math.floor(Math.random()*y.length)])},4e3);return()=>clearInterval(t)}},[c,y]),n.useEffect(()=>{if(c){const t=setTimeout(()=>{v(null)},3500);return()=>clearTimeout(t)}},[c]);const T=(t,o)=>{const s=M.find(a=>a.id===o);if(s&&s.price&&s.price>0&&!b.includes(o)){l.error("This item is locked. Purchase it first!");return}S(a=>({...a,[t]:a[t]===o?"":o})),v(z[Math.floor(Math.random()*z.length)])},X=async(t,o,s)=>{if(t.stopPropagation(),!r?.uid){l.error("You must be logged in to purchase items");return}if(b.includes(o)){l.info("You already own this item");return}p(o);try{const a=await W(r.uid,o,s);a.success?(l.success(a.message||"Item purchased!"),g(j=>[...j,o]),a.currentXP!==void 0&&w(a.currentXP),await h()):l.error(a.message||"Failed to purchase item")}catch(a){console.error("Purchase error:",a),l.error("Error purchasing item")}finally{p(null)}},L=async()=>{if(r?.uid&&u!=="resetting"){p("resetting");try{const t=await G(r.uid);t.success?(g([]),S({top:"top_pink",bottom:"",shoes:"",accessory:""}),w(t.newXP),l.success(`Purchases reset and XP updated to ${t.newXP}! (Test Mode)`),await h()):l.error("Failed to reset purchases")}catch(t){console.error("Reset error:",t),l.error("Error resetting purchases")}finally{p(null)}}},q=async()=>{if(r?.uid){f(!0);try{await J(r.uid,{avatarLayers:x}),P&&P(x),l.success("Avatar saved successfully"),await h(),f(!1)}catch(t){console.error(t),f(!1)}}},I=[{id:"top",label:"Tops",icon:e.jsx(H,{size:16})},{id:"bottom",label:"Bottoms",icon:e.jsx(re,{size:16,className:"rotate-90"})},{id:"shoes",label:"Shoes",icon:e.jsx(se,{size:16})},{id:"accessory",label:"Accessories",icon:e.jsx(E,{size:16})}];return e.jsx("div",{className:"h-full w-full flex items-center justify-center p-4 sm:p-6 lg:p-8 overflow-hidden",children:e.jsxs("div",{className:"relative w-full max-w-[1200px] h-[85vh] min-h-[600px] max-h-[850px] rounded-[2rem] p-8 lg:p-12 bg-gradient-to-br from-white via-sky-50/30 to-white border border-slate-200/80 shadow-[0_8px_30px_rgb(0,0,0,0.04)] flex flex-col xl:flex-row gap-12",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden 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/30 to-transparent"}),e.jsx("div",{className:"absolute -top-40 -right-40 w-96 h-96 bg-blue-100/40 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute -bottom-40 -left-40 w-96 h-96 bg-purple-100/30 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"flex flex-col h-full relative z-10 w-full xl:w-7/12 mx-auto xl:mx-0",children:[e.jsxs("div",{className:"mb-8 flex flex-col sm:flex-row items-start justify-between gap-6 shrink-0",children:[e.jsxs("div",{className:"pr-4",children:[e.jsxs("h1",{className:"text-4xl md:text-5xl font-display font-black text-[#0a1628] tracking-tight flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"whitespace-nowrap",children:"Avatar Studio"})," ",e.jsx(C,{className:"text-blue-500 fill-blue-500",size:32})]}),e.jsx("p",{className:"text-slate-500 font-medium text-lg mt-2",children:"Design your perfect learning companion."})]}),e.jsxs("div",{className:"flex items-center gap-4 sm:ml-auto",children:[e.jsx("button",{onClick:L,disabled:u==="resetting",className:"hidden sm:flex self-stretch items-center bg-slate-100 hover:bg-red-50 text-slate-500 hover:text-red-500 px-3 py-2 rounded-2xl font-bold text-xs transition-colors border border-slate-200",children:"Reset (Test)"}),e.jsxs("div",{className:"bg-gradient-to-br from-amber-400 to-orange-500 rounded-2xl px-4 py-3 shadow-lg flex items-center gap-2 h-fit",children:[e.jsx(N,{className:"text-white",size:20}),e.jsxs(K,{children:[e.jsx(Y,{asChild:!0,children:e.jsxs("button",{onClick:A,className:"cursor-pointer hover:opacity-90 transition-opacity active:scale-95",children:[e.jsx("p",{className:"text-white text-xs font-bold uppercase tracking-wider",children:"XP Balance"}),e.jsx("p",{className:"text-white text-2xl font-black",children:_})]})}),e.jsx(Z,{side:"bottom",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]})]})]}),e.jsxs(R,{defaultValue:"top",className:"flex flex-col flex-1 min-h-0",children:[e.jsx(O,{className:"flex flex-nowrap shrink-0 justify-start space-x-2 sm:space-x-4 mb-4 sm:mb-8 bg-white shadow-sm p-1.5 rounded-full border border-slate-100 w-fit overflow-x-auto max-w-full scrollbar-hide",children:I.map(t=>e.jsxs(V,{value:t.id,className:"flex items-center gap-2 px-6 py-2.5 rounded-full font-bold text-sm text-slate-500 hover:bg-slate-50 data-[state=active]:bg-gradient-to-r data-[state=active]:from-blue-600 data-[state=active]:to-sky-500 data-[state=active]:text-white transition-all shadow-sm outline-none whitespace-nowrap",children:[t.icon,t.label]},t.id))}),e.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden min-h-0 pb-6 scrollbar-hide px-2 -mx-2",children:I.map(t=>{const o=M.filter(s=>s.category===t.id);return e.jsx($,{value:t.id,className:"outline-none pt-2 h-full",children:o.length===0?e.jsxs("div",{className:"w-full h-full min-h-[250px] flex flex-col items-center justify-center border-2 border-dashed border-slate-200 rounded-[2rem] bg-slate-50/50 p-8 text-center",children:[e.jsx(E,{size:48,className:"text-slate-300 mb-4 opacity-50"}),e.jsx("h3",{className:"font-bold text-xl text-slate-500 mb-2",children:"Accessories coming soon"}),e.jsx("p",{className:"text-slate-400 text-sm max-w-xs",children:"We're crafting some awesome gear for your avatar! Check back later."})]}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-8",children:o.map(s=>{const a=x[t.id]===s.id,j=b.includes(s.id),i=!!(s.price&&s.price>0&&!j);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("button",{onClick:()=>!i&&T(t.id,s.id),disabled:i,className:`relative w-full aspect-square rounded-[1.5rem] border-[3px] transition-all flex flex-col items-center justify-center group ${a&&!i?"bg-white border-blue-500 shadow-md scale-[1.02] z-10":i?"bg-slate-50 border-slate-200 opacity-50 cursor-not-allowed":"bg-white border-slate-100 hover:border-sky-300 hover:shadow-lg hover:scale-[1.02] hover:z-10"}`,children:[a&&!i&&e.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 px-2 py-1 bg-gradient-to-r from-blue-500 to-sky-400 text-white text-[9px] font-black rounded-full flex items-center gap-1 z-10 whitespace-nowrap",children:["Equipped ",e.jsx(C,{size:9,className:"fill-white"})]}),i&&e.jsx("div",{className:"absolute inset-0 bg-black/20 z-20 flex items-center justify-center rounded-[1.3rem]",children:e.jsx(Q,{className:"text-white",size:24})}),e.jsx("img",{src:s.thumbnail,alt:s.name,className:`w-4/5 h-4/5 object-contain transition-transform ${!i&&"group-hover:scale-110"}`,style:{filter:i?"grayscale(70%)":"none"}})]}),e.jsx("p",{className:"text-xs font-bold text-slate-700 text-center line-clamp-2",children:s.name}),i&&e.jsx(d.button,{initial:{opacity:0},animate:{opacity:1},onClick:F=>X(F,s.id,s.price||0),disabled:u===s.id,className:"w-full py-1.5 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white text-[10px] font-bold flex items-center justify-center gap-1.5 rounded-lg shadow-md transition-all disabled:opacity-70",children:u===s.id?e.jsx(d.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1},children:e.jsx(N,{size:11})}):e.jsxs(e.Fragment,{children:[e.jsx(N,{size:11}),s.price," XP"]})})]},s.id)})})},t.id)})})]})]}),e.jsxs("div",{className:"flex flex-col gap-6 relative z-10 w-full xl:w-[450px] shrink-0 xl:self-center",children:[e.jsxs("div",{className:"bg-[#0f1422] rounded-[3rem] overflow-hidden relative shadow-[0_20px_50px_rgba(15,20,34,0.3)] h-[400px] xl:h-[480px] w-full flex items-center justify-center mx-auto border-8 border-slate-800",children:[e.jsx("div",{className:"absolute top-[-10%] left-0 right-0 h-[110%] pointer-events-none mix-blend-screen opacity-70",style:{background:"linear-gradient(to bottom, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 60%, transparent 100%)",clipPath:"polygon(15% 0, 85% 0, 65% 100%, 35% 100%)"}}),e.jsx("div",{className:"absolute bottom-12 left-1/2 -translate-x-1/2 w-[220px] h-[25px] bg-sky-500/20 blur-xl rounded-full"}),e.jsxs(d.div,{animate:{y:[-8,8,-8]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},className:"relative w-full h-[80%] z-10 flex justify-center items-center",children:[e.jsx(U,{layers:x,className:"w-full h-full absolute inset-0 z-20"}),e.jsx(D,{children:c&&e.jsxs(d.div,{initial:{opacity:0,y:-10,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.8},transition:{duration:.3},className:"absolute -top-24 left-1/2 -translate-x-1/2 z-30 bg-white text-slate-800 px-4 py-2 rounded-full shadow-lg border-2 border-sky-300 whitespace-nowrap font-bold text-sm max-w-xs text-center",children:[c,e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-white"})]})})]})]}),e.jsxs("button",{onClick:q,disabled:m,className:"w-full max-w-[450px] mx-auto h-[64px] bg-blue-600 hover:bg-blue-500 text-white rounded-2xl font-bold text-lg flex items-center justify-center gap-3 transition-colors shadow-md disabled:opacity-70 disabled:cursor-not-allowed active:scale-[0.98]",children:[m?e.jsx(d.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},children:e.jsx(ee,{size:24,className:"opacity-50"})}):null,m?"Saving...":"Save Profile Avatar"]})]})]})})};export{pe as default};
assets/ChatMarkdown-yVNm7d0l.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-CDZ6ydrN.js","assets/vendor-react-CCIuKUIB.js","assets/vendor-markdown-CBmFCdgC.css"])))=>i.map(i=>d[i]);
2
+ import{c,aK as i,aL as h}from"./index-Cq4H6CKS.js";import{r as m,j as r}from"./vendor-react-CCIuKUIB.js";import{M as x,r as y,a as b}from"./vendor-markdown-CDZ6ydrN.js";/**
3
+ * @license lucide-react v0.487.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */const u=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],f=c("send",u);let s=null;const p=()=>(s||(s=h(()=>import("./vendor-markdown-CDZ6ydrN.js").then(a=>a.k),__vite__mapDeps([0,1,2]))),s),N=({children:a})=>{if(m.useEffect(()=>{p()},[]),!a||typeof a!="string")return null;const n=i(a);return r.jsx("div",{className:"chat-markdown",children:r.jsx(x,{remarkPlugins:[b],rehypePlugins:[y],components:{a:({href:e,children:l})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:l}),code:e=>{const{inline:l,className:t,children:d,...o}=e;return r.jsx("code",{className:`${l?"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"} ${t||""}`,...o,children:d})},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:n})})};export{N as C,f as S};
assets/CompositeAvatar-CxBIl8mP.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as t}from"./vendor-react-CCIuKUIB.js";import{aN as e,m as s}from"./index-Cq4H6CKS.js";const h=({layers:a,className:o="w-10 h-10 bg-slate-200 rounded-full",fallbackSrc:m})=>{const n=e(a?.top),i=e(a?.bottom),l=e(a?.shoes),r=e(a?.accessory),c=t.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"base body",className:"absolute inset-0 w-full h-full object-contain z-10"}),u=t.jsxs(s.div,{className:"absolute inset-0 w-full h-full z-50 pointer-events-none",animate:{rotate:[-2,2,-2],y:[0,-3,0]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},style:{originY:.7,originX:.5},children:[t.jsx(s.img,{src:"/avatar/left_horn.png",alt:"left horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[-4,4,-4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),t.jsx(s.img,{src:"/avatar/right_horn.png",alt:"right horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[4,-4,4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),t.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"head base",className:"absolute inset-0 w-full h-full object-contain z-10"}),t.jsx(s.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:"absolute inset-0 w-full h-full object-contain z-10",style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),r&&t.jsx("img",{src:r,alt:"accessory",className:"absolute inset-0 w-full h-full object-contain z-20"})]});return!a||!a.top&&!a.bottom&&!a.shoes&&!a.accessory?t.jsxs("div",{className:`relative overflow-hidden ${o}`,children:[c,u]}):t.jsxs("div",{className:`relative overflow-hidden ${o}`,children:[c,i&&t.jsx("img",{src:i,alt:"bottom",className:"absolute inset-0 w-full h-full object-contain z-20"}),l&&t.jsx("img",{src:l,alt:"shoes",className:"absolute inset-0 w-full h-full object-contain z-30"}),n&&t.jsx("img",{src:n,alt:"top",className:"absolute inset-0 w-full h-full object-contain z-40"}),u]})};export{h as C};
assets/ConfirmModal-BCd_bhv9.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as e}from"./vendor-react-CCIuKUIB.js";import{B as r}from"./button-MTmjd5-I.js";import{K as f,m as s,X as p,a1 as y,aO as j}from"./index-Cq4H6CKS.js";import{T as w}from"./trash-2-CPr8I1eG.js";import"./vendor-radix-BAHZvx1W.js";import"./vendor-firebase-CG7e86Dp.js";const $=({isOpen:i,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:x="warning",icon:g="warning",zIndexClass:m="z-50"})=>{const b=()=>{switch(g){case"logout":return e.jsx(j,{size:32});case"delete":return e.jsx(w,{size:32});case"warning":default:return e.jsx(y,{size:32})}},o=(()=>{switch(x){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"}}})(),u=async()=>{try{await n(),t()}catch{}};return e.jsx(f,{children:i&&e.jsx(e.Fragment,{children:e.jsx(s.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${m} flex items-center justify-center p-4`,children:e.jsxs(s.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(p,{size:20})}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(s.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(r,{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(r,{onClick:u,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${o.buttonBg} ${o.buttonText} transition-colors shadow-lg`,children:c})]})]})]})})})})};export{$ as default};
assets/DiagnosticAssessmentModal-QtbUV7gF.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as u,c as z,j as e}from"./vendor-react-CCIuKUIB.js";import{B as E}from"./button-MTmjd5-I.js";import{M as ye}from"./MathAnswerInput-D47QiEEM.js";import be from"./ScientificCalculator-Cik6PszE.js";import{m as g,B as J,Y as T,K as O,X as Z,a0 as ee,a1 as Q,a3 as ge,V as ve,T as we,aP as je}from"./index-Cq4H6CKS.js";import"./vendor-radix-BAHZvx1W.js";import"./chevron-up-Dy93ceTz.js";import"./vendor-firebase-CG7e86Dp.js";const H="iar-v2-deped-g11-core-g12-candidate-shortform",re=[{id:"iar-fn-01",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"basic",competencyCode:"M11GM-Ia-2",competencyDescription:"Evaluates a function and solves basic linear expressions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Solve for x: 3x - 4 = 17",options:["5","6","7","8"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-fn-02",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"standard",competencyCode:"M11GM-Ib-5",competencyDescription:"Finds the domain of a rational function.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"What is the domain of f(x) = 5 / (x - 2)?",options:["All real numbers","x > 2","x โ‰  2","x < 2"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-fn-03",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Ie-f-1",competencyDescription:"Solves exponential equations in real-life growth contexts.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"A quantity doubles every hour. If it starts at 3, what is the value after 4 hours?",acceptableNumericAnswers:[48],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-04",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"challenge",competencyCode:"M11GM-Ii-4",competencyDescription:"Determines intercepts and asymptotic behavior of logarithmic functions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement is true for f(x) = log(x - 1)?",options:["Domain is all real numbers.","Vertical asymptote is x = 1.","x-intercept is always 0.","Range is x > 1."],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-c1",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Id-2",competencyDescription:"Determines the inverse of a one-to-one function.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"If f(x) = 2x + 3, what is fโปยน(11)?",acceptableNumericAnswers:[4],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-bm-01",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"basic",competencyCode:"M11GM-IIa-b-1",competencyDescription:"Computes simple interest and maturity value.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Find the simple interest on PHP 8,000 at 5% annual rate for 2 years.",acceptableNumericAnswers:[800],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-02",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIa-2",competencyDescription:"Distinguishes simple and compound interest contexts.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement correctly describes compound interest?",options:["Interest is based only on original principal.","Interest is computed once at maturity.","Interest is computed on principal plus accumulated interest.","Interest is always lower than simple interest."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-03",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Computes annuity future value in basic settings.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A student saves PHP 1,000 monthly for 6 months with no interest. What is the accumulated amount?",options:["PHP 5,000","PHP 6,000","PHP 7,000","PHP 12,000"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-bm-04",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"challenge",competencyCode:"M11GM-IIf-3",competencyDescription:"Solves business and consumer loan scenarios.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A borrower receives PHP 20,000 and repays PHP 22,400 after 1 year. What is the annual simple interest rate?",options:["8%","10%","12%","14%"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-bm-c1",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Finds future value and present value of annuities.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Without interest, what is the present value of a 12-month annuity paying PHP 500 each month?",acceptableNumericAnswers:[6e3],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-01",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"basic",competencyCode:"M11GM-IIg-1",competencyDescription:"Identifies and negates propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'If p is "All triangles have three sides," what is not p?',options:["Some triangles have three sides.","No triangle has three sides.","At least one triangle does not have three sides.","All triangles are polygons."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-lg-02",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIh-1",competencyDescription:"Determines truth values of compound propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"When p is true and q is false, what is the truth value of p -> q?",options:["True","False","Cannot be determined","Both true and false"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-03",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIi-1",competencyDescription:"Identifies common reasoning fallacies in short arguments.",answerType:"shortAnswerText",depedBasis:"depedPattern",prompt:'A post says, "Everyone in my class passed because we used this lucky pen." Type the best label for this weak reasoning.',acceptableTextAnswers:["false cause","false causation","post hoc","hasty generalization"],isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-lg-04",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"challenge",competencyCode:"M11GM-IIi-2",competencyDescription:"Determines the validity of categorical syllogisms.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"All squares are rectangles. All rectangles are quadrilaterals. Therefore all squares are quadrilaterals. This argument is:",options:["Valid","Invalid","A fallacy of composition","A contradiction"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-lg-c1",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIj-1",competencyDescription:"Illustrates methods of proof and disproof.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'To prove "if n is even then nยฒ is even," which method is commonly used?',options:["Direct proof","Proof by contradiction only","Survey method","Graph sketch only"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40}];function Ne(s){return s>=75?"Mastered":s>=40?"NeedsReview":"HighRisk"}function Ce(){return re.filter(s=>s.depedBasis==="depedPattern"&&!!s.competencyCode)}function ke(s=re){const n=s.reduce((p,h)=>p+h.estimatedSeconds,0);return Math.round(n/60*10)/10}const te={Functions:"Functions and Graphs",BusinessMath:"Business and Financial Mathematics",Logic:"Logic and Reasoning"},Me={atRiskSubjectIds:[],questionSetVersion:H},x=Ce(),se=s=>s.trim().toLowerCase().replace(/\s+/g," "),ae=(s,n)=>{if(!s.scorable)return!1;if(s.answerType==="MCQ")return typeof n=="number"&&n===s.correctOptionIndex;if(s.answerType==="shortAnswerNumeric"){if(typeof n!="string")return!1;const p=Number(n);if(Number.isNaN(p))return!1;const h=s.numericTolerance??0;return(s.acceptableNumericAnswers||[]).some(B=>Math.abs(p-B)<=h)}if(s.answerType==="shortAnswerText"){if(typeof n!="string")return!1;const p=se(n);return(s.acceptableTextAnswers||[]).some(h=>se(h)===p)}return!1},Ae=s=>s==="Mastered"?"text-teal-600 bg-teal-50":s==="NeedsReview"?"text-amber-700 bg-amber-50":"text-red-600 bg-red-50",Ie=s=>s==="NeedsReview"?"Needs Review":s==="HighRisk"?"High Risk":"Mastered",Oe=({isOpen:s,onClose:n,onComplete:p,lrn:h,gradeLevel:B="Grade 11",workflowMode:ie="iar_only",assessmentType:N="initial_assessment"})=>{const[v,L]=u.useState("intro"),[y,W]=u.useState(0),[ne,_]=u.useState([]),[C,I]=u.useState(""),[w,j]=u.useState(!1),[oe,b]=u.useState(!1),[r,q]=u.useState(null),[m,$]=u.useState(null),[k,V]=u.useState([]),[Se,U]=u.useState(!1);z.useEffect(()=>{s&&(L("intro"),W(0),_([]),I(""),j(!1),b(!1),q(null),$(null),V([]))},[s]),z.useEffect(()=>{if(!s||v!=="test"){b(!1);return}if(y>0||w){b(!1);return}b(!0);const t=window.setTimeout(()=>{b(!1)},2800);return()=>window.clearTimeout(t)},[s,v,y,w]);const ce=()=>{p({status:"skipped",...Me}),n()},R=()=>{n()};z.useEffect(()=>{if(!s)return;const t=i=>{i.key==="Escape"&&R()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[s]);const le=()=>{L("test")},de=t=>{_(t),I(""),j(!1),y<x.length-1?setTimeout(()=>{W(i=>i+1)},300):pe(t)},K=t=>{const i=[...ne];i[y]=t,de(i)},G=()=>{C.trim()&&K(C.trim())},pe=async t=>{const i=[],S={Functions:{correct:0,total:0},BusinessMath:{correct:0,total:0},Logic:{correct:0,total:0}},fe={Functions:[],BusinessMath:[],Logic:[]},P={};x.forEach((a,c)=>{const l=t[c];if(a.answerType==="confidenceLikert"&&typeof l=="number"&&fe[a.topicArea].push(l+1),!a.scorable)return;const d=ae(a,l);S[a.topicArea].total+=1,d&&(S[a.topicArea].correct+=1),P[a.topicArea]||(P[a.topicArea]=[]),P[a.topicArea].push({correct:d,questionId:a.id,difficulty:a.difficulty,gradeLevelTag:a.gradeLevel,quarter:a.quarter,answerType:a.answerType})});const o=Object.keys(S).reduce((a,c)=>{const{correct:l,total:d}=S[c],M=d>0?Math.round(l/d*100):0,A=Ne(M);return A!=="Mastered"&&i.push(c),a[c]={correct:l,total:d,scorePercent:M,classification:A},a},{}),D=x.filter(a=>a.scorable&&a.gradeLevel==="G12Candidate"),xe=D.reduce((a,c)=>{const l=x.findIndex(d=>d.id===c.id);return a+(ae(c,t[l])?1:0)},0),F=D.length>0?xe/D.length:1,he={readyForFiniteMath:Object.values(o).filter(a=>a.classification==="Mastered").length/3>=.67&&o.Functions.classification!=="HighRisk"&&o.BusinessMath.classification!=="HighRisk"&&F>=.5,readyForAdvancedStats:o.Logic.classification==="Mastered"&&F>=.67,readyForCalcIntro:o.Functions.classification==="Mastered"&&F>=.67,needsStrongerFunctions:o.Functions.classification!=="Mastered",needsStrongerBusinessMath:o.BusinessMath.classification!=="Mastered"};if(Object.keys(o).sort((a,c)=>{const l=o[a],d=o[c],M=X=>X==="HighRisk"?0:X==="NeedsReview"?1:2,A=M(l.classification)-M(d.classification);return A!==0?A:l.scorePercent-d.scorePercent}),V(i),q(o),$(he),L("results"),h){U(!0);try{const a=Object.keys(o).map(c=>({subject:c,score:o[c].scorePercent}));await je(h,a,B,P,ie,N),console.log("[OK] Automation: diagnostic pipeline completed")}catch(a){console.error("[WARN] Automation: diagnostic pipeline failed:",a)}finally{U(!1)}}},ue=()=>{if(!r||!m){p({status:"completed",atRiskSubjectIds:k,questionSetVersion:H}),n();return}p({status:"completed",atRiskSubjectIds:k,topicScores:{Functions:r.Functions.scorePercent,BusinessMath:r.BusinessMath.scorePercent,Logic:r.Logic.scorePercent},topicClassifications:{Functions:r.Functions.classification,BusinessMath:r.BusinessMath.classification,Logic:r.Logic.classification},priorityTopics:Object.keys(r).sort((t,i)=>r[t].scorePercent-r[i].scorePercent),g12ReadinessIndicators:m,questionSetVersion:H}),n()},f=x[y],Y=Math.round(y/x.length*100),me=ke(x);return s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:()=>{R()},children:[e.jsxs(g.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"bg-white rounded-3xl shadow-2xl max-w-2xl w-full flex flex-col max-h-[90vh] pointer-events-auto overflow-hidden relative z-[51]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"px-8 py-6 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-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center text-sky-600",children:e.jsx(J,{size:24})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:N==="followup_diagnostic"?"Deep Diagnostic":"Initial Assessment"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 relative",children:[e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>{j(!w),b(!1)},className:`relative w-10 h-10 rounded-xl flex items-center justify-center transition-all duration-200 border-2 ${w?"bg-sky-100 border-sky-300 text-sky-700 shadow-sm":"bg-white border-[#dde3eb] text-slate-500 hover:text-sky-600 hover:border-sky-200 hover:bg-sky-50"}`,title:"Toggle Calculator",children:e.jsx(T,{size:20})}),e.jsx(O,{children:s&&v==="test"&&oe&&!w&&e.jsxs(g.div,{initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},className:"absolute right-0 top-full mt-3 w-[260px] bg-[#0a1628] text-white border border-[#2a3648] rounded-2xl p-4 shadow-2xl z-50 pointer-events-none",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-sky-500/20 flex items-center justify-center flex-shrink-0",children:e.jsx(T,{size:16,className:"text-sky-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-sm mb-1",children:"Calculator Available"}),e.jsx("p",{className:"text-xs text-slate-300 leading-relaxed",children:"You can freely use the scientific calculator at any time during this quiz."})]})]}),e.jsx("div",{className:"absolute -top-2 right-4 w-4 h-4 bg-[#0a1628] border-l border-t border-[#2a3648] rotate-45 rounded-tl-sm"})]})})]}),e.jsx("button",{onClick:()=>{R()},className:"w-10 h-10 rounded-xl flex items-center justify-center text-slate-500 border-2 border-transparent hover:text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] transition-all",title:"Close assessment",children:e.jsx(Z,{size:20})})]})]}),e.jsx("div",{className:"p-8 overflow-y-auto",children:e.jsxs(O,{mode:"wait",children:[v==="intro"&&e.jsxs(g.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"text-center space-y-6",children:[e.jsx("div",{className:"w-32 h-32 bg-sky-50 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx(T,{size:64,className:"text-sky-600"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:N==="followup_diagnostic"?"Let's close the gaps":"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[#5a6578] max-w-md mx-auto leading-relaxed",children:N==="followup_diagnostic"?"You have pending weak-area checks from your initial assessment. Complete this deep diagnostic to unlock regular modules and practice.":`To personalize your learning path, complete a DepEd competency-based SHS diagnostic (${x.length} items, around ${me} minutes).`}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 max-w-lg mx-auto text-left",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[e.jsx(ee,{size:16,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[e.jsx(Q,{size:16,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Spot areas that need more attention early."})]})]}),e.jsxs("div",{className:"pt-4 space-y-3",children:[e.jsx(E,{onClick:le,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-8 py-6 rounded-xl text-lg font-bold shadow-lg shadow-sky-200 w-full max-w-xs mx-auto",children:N==="followup_diagnostic"?"Start Deep Diagnostic":"Start Assessment"}),e.jsx("button",{onClick:()=>{ce()},className:"block mx-auto text-sm text-slate-500 hover:text-[#5a6578] transition-colors font-medium",children:"Skip for now โ†’"})]})]},"intro"),v==="test"&&e.jsxs(g.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm font-bold text-[#5a6578] mb-2",children:[e.jsxs("span",{children:["Question ",y+1," of ",x.length]}),e.jsxs("span",{children:[Y,"% Completed"]})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden mb-8",children:e.jsx(g.div,{className:"h-full bg-sky-600 rounded-full",initial:{width:0},animate:{width:`${Y}%`}})}),e.jsxs("div",{className:"bg-[#edf1f7] p-6 rounded-2xl border border-[#dde3eb] mb-6",children:[e.jsxs("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500 mb-2",children:[te[f.topicArea]," โ€ข ",f.difficulty]}),e.jsx("h3",{className:"text-xl font-bold text-[#0a1628] leading-relaxed",children:f.prompt})]}),(f.answerType==="MCQ"||f.answerType==="confidenceLikert")&&e.jsx("div",{className:"grid grid-cols-1 gap-3",children:(f.options||[]).map((t,i)=>e.jsxs("button",{onClick:()=>K(i),className:"w-full text-left p-4 rounded-xl border-2 border-[#dde3eb] hover:border-indigo-600 hover:bg-sky-50 transition-all font-medium text-[#0a1628] group flex items-center justify-between",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-8 h-8 rounded-lg bg-white border border-[#dde3eb] flex items-center justify-center text-sm font-bold text-[#5a6578] group-hover:border-sky-300 group-hover:text-sky-600",children:String.fromCharCode(65+i)}),t]}),e.jsx(ge,{size:18,className:"opacity-0 group-hover:opacity-100 text-sky-600 transition-opacity"})]},i))}),(f.answerType==="shortAnswerNumeric"||f.answerType==="shortAnswerText")&&e.jsxs("div",{className:"space-y-3",children:[f.answerType==="shortAnswerNumeric"?e.jsx(e.Fragment,{children:e.jsx(ye,{value:C,onChange:I,placeholder:"Type numeric answer",onSubmit:G,onCalculatorOpen:()=>{j(!0),b(!1)}})}):e.jsx("input",{value:C,onChange:t=>I(t.target.value),onKeyDown:t=>{t.key==="Enter"&&G()},className:"w-full p-4 rounded-xl border-2 border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-200 focus:border-sky-500",placeholder:"Type short answer"}),e.jsx(E,{onClick:G,disabled:!C.trim(),className:"w-full bg-sky-600 hover:bg-sky-700 text-white py-3 rounded-xl font-bold",children:"Submit Answer"})]})]},"test"),v==="results"&&e.jsxs(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center space-y-6",children:[e.jsx("div",{className:"w-24 h-24 bg-teal-100 rounded-full flex items-center justify-center mx-auto mb-4 animate-bounce",children:e.jsx(ee,{size:48,className:"text-teal-600"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:"Assessment Completed!"}),e.jsx("p",{className:"text-[#5a6578]",children:"We computed topic-level placement from your IAR responses."}),e.jsxs("div",{className:"bg-[#edf1f7] rounded-2xl p-6 border border-[#dde3eb] text-left space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(ve,{size:18,strokeWidth:2.4})}),e.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Topic Analysis"})]}),e.jsx("div",{className:"space-y-3",children:r&&Object.keys(r).map(t=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-[#0a1628]",children:te[t]}),e.jsxs("p",{className:"text-xs text-slate-500",children:[r[t].correct,"/",r[t].total," correct โ€ข ",r[t].scorePercent,"%"]})]}),e.jsxs("span",{className:`text-xs font-bold px-2 py-1 rounded-lg flex items-center gap-1 ${Ae(r[t].classification)}`,children:[r[t].classification==="Mastered"?e.jsx(we,{size:12}):e.jsx(Q,{size:12}),Ie(r[t].classification)]})]},t))})]}),m&&e.jsxs("div",{className:"bg-sky-50 rounded-2xl p-6 border border-sky-100 text-left space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(J,{size:18,strokeWidth:2.4})}),e.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Grade 12 Readiness Signals"})]}),e.jsx("p",{className:"text-xs text-slate-600",children:"These indicators come from challenge and candidate items only."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 text-xs",children:[e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${m.readyForFiniteMath?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Finite Math: ",m.readyForFiniteMath?"Ready":"Build More"]}),e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${m.readyForAdvancedStats?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Advanced Stats: ",m.readyForAdvancedStats?"Ready":"Build More"]}),e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${m.readyForCalcIntro?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Calculus Intro: ",m.readyForCalcIntro?"Ready":"Build More"]})]})]}),k.length>0&&e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-rose-50 border border-rose-100 rounded-xl text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-rose-100 border border-rose-200 flex items-center justify-center text-rose-600 shadow-inner shrink-0",children:e.jsx(Q,{size:18,strokeWidth:2.3})}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-display font-black text-[20px] tracking-tight text-rose-800 leading-none mb-1",children:"Attention Needed"}),e.jsxs("p",{className:"text-rose-700 text-xs mt-1",children:["We flagged ",k.length," topic area",k.length>1?"s":""," for review. In IAR + Diagnostic mode, focused deep diagnostics may launch before full unlock."]})]})]}),e.jsx("div",{className:"pt-4",children:e.jsx(E,{onClick:ue,className:"bg-sky-600 hover:bg-sky-700 text-white px-8 py-4 rounded-xl text-lg font-bold w-full",children:"Go to Dashboard"})})]},"results")]})})]}),e.jsx(O,{children:w&&e.jsxs(g.div,{drag:!0,dragMomentum:!1,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{type:"spring",damping:25,stiffness:200},style:{position:"absolute",top:"50%",left:"calc(50% + 390px)",y:"-50%"},className:"w-[420px] max-w-[calc(100vw-24px)] bg-white rounded-3xl shadow-2xl border border-slate-200 flex flex-col pointer-events-auto overflow-hidden z-[60]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0 cursor-move",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-sky-100 flex items-center justify-center text-sky-600",children:e.jsx(T,{size:18})}),e.jsx("h3",{className:"font-bold text-[#0a1628] select-none",children:"Scientific Calc"})]}),e.jsx("button",{onClick:t=>{t.stopPropagation(),j(!1)},className:"w-8 h-8 flex items-center justify-center text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-lg transition-colors cursor-pointer",title:"Close Calculator",children:e.jsx(Z,{size:16})})]}),e.jsx("div",{className:"p-4 bg-[#f7f9fc]",children:e.jsx(be,{isOpen:!0,onClose:()=>j(!1),inline:!0})})]})})]}):null};export{Oe as default};
assets/FloatingAITutor-DFAkWR7R.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{r as a,j as e}from"./vendor-react-CCIuKUIB.js";import{c as j,ax as v,ay as N,X as m,m as k}from"./index-Cq4H6CKS.js";import{C as I,S}from"./ChatMarkdown-yVNm7d0l.js";import"./vendor-firebase-CG7e86Dp.js";import"./vendor-radix-BAHZvx1W.js";import"./vendor-markdown-CDZ6ydrN.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const C=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],A=j("maximize-2",C),_=({constraintsRef:L,onFullScreen:u})=>{const{activeSessionId:n,setActiveSessionId:h,createNewSession:p,getActiveSession:b,sendMessage:f,isLoading:o}=v(),[t,r]=a.useState(!1),[i,l]=a.useState(""),d=a.useRef(null);a.useEffect(()=>{t&&N()},[t]),a.useEffect(()=>{if(t&&!n){const s={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"})},w=p(s);h(w)}},[t]);const c=b()?.messages||[],y=()=>{d.current?.scrollIntoView({behavior:"smooth"})};a.useEffect(()=>{y()},[c]);const x=async()=>{if(!i.trim()||!n||o)return;const s=i.trim();l(""),await f(n,s)},g=()=>{u()};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 ${t?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{maxHeight:t?"32rem":"0"},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:g,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-slate-200/70 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(A,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>r(!1),className:"p-2 hover:bg-slate-200/70 rounded-lg transition-colors",children:e.jsx(m,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[c.map(s=>e.jsx("div",{className:`flex ${s.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${s.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[s.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:s.text}):e.jsx(I,{children:s.text}),e.jsx("p",{className:`text-[10px] mt-1 ${s.sender==="user"?"text-sky-200":"text-slate-500"}`,children:s.timestamp})]})},s.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:d})]}),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:i,onChange:s=>l(s.target.value),onKeyPress:s=>s.key==="Enter"&&x(),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:x,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:!i.trim()||o,children:e.jsx(S,{size:18})})]})})]}),e.jsxs("div",{className:"pointer-events-auto relative group self-end",children:[!t&&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"})]}),e.jsx(k.button,{onClick:()=>r(!t),whileHover:{scale:1.1},whileTap:{scale:.9},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",children:t?e.jsx(m,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})]})};export{_ as default};
assets/GradesPage-Bh8_Kzk7.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{r as n,j as e}from"./vendor-react-CCIuKUIB.js";import{B as S}from"./button-MTmjd5-I.js";import{M as B,$ as H,_ as k,T,m as W,a3 as _,a4 as V}from"./index-Cq4H6CKS.js";import{A}from"./award-GuQ4hvnk.js";import{T as C}from"./target-D136l6Dz.js";import{C as P}from"./calendar-Ac41aFLD.js";import{D as J}from"./download-DsF2wqhl.js";import{T as K,F as X}from"./trending-down-CtpIa5V8.js";import"./vendor-radix-BAHZvx1W.js";import"./vendor-firebase-CG7e86Dp.js";const ne=()=>{const{currentUser:p,userProfile:Q}=B(),[o,u]=n.useState("all"),[h,D]=n.useState("all"),[Y,j]=n.useState(!0),[i,M]=n.useState(null),R=Q?.grade,g=H(R),y=new Set(g);n.useEffect(()=>{(async()=>{if(p){j(!0);try{const s=await V(p.uid);M(s)}catch(s){console.error("Error loading grades:",s)}finally{j(!1)}}})()},[p]);const N=i?.quizAttempts||[],E=i?.totalQuizzesCompleted||0,f=i?.averageScore||0,U=f>0?Math.min(f/25,4).toFixed(2):"0.00",F={"gen-math":"blue","stats-prob":"cyan","pre-calc":"teal","basic-calc":"orange"},b=k.reduce((t,s)=>(t[s.id]={label:s.name,color:F[s.id]||"slate"},t),{}),c=k.filter(t=>y.has(t.id)).map(t=>t.name),v=Object.entries(i?.subjects||{}).filter(([t])=>y.has(t)).map(([t,s])=>{const a=b[t]||{label:t,color:"slate"},d=N.filter(l=>l.quizId?.startsWith(t)),m=d.length>0?Math.round(d.reduce((l,r)=>l+r.score,0)/d.length):Math.round(s.progress);return{subject:a.label,average:m,quizzes:d.length||s.completedModules,color:a.color,trend:"up"}}),G=g.map(t=>{const s=b[t]||{label:t,color:"slate"};return{subject:s.label,average:0,quizzes:0,color:s.color,trend:"up"}}),I=v.length>0?v:G,w=N.sort((t,s)=>new Date(s.completedAt).getTime()-new Date(t.completedAt).getTime()).slice(0,10).map((t,s)=>({id:s+1,title:t.quizId?.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())||`Quiz ${s+1}`,subject:Object.entries(b).find(([a])=>t.quizId?.startsWith(a))?.[1]?.label||"General",score:t.score,total:100,date:t.completedAt instanceof Date?t.completedAt.toISOString().split("T")[0]:new Date(t.completedAt).toISOString().split("T")[0],type:t.quizId?.includes("practice")?"practice":"module",status:t.score>=60?"passed":"failed"})).filter(t=>c.includes(t.subject)),x={gpa:parseFloat(U),totalQuizzes:E,averageScore:f,trendValue:0},z=w.filter(t=>{if(!c.includes(t.subject))return!1;const s=o==="all"||t.subject===o,a=h==="all"||t.type===h;return s&&a});n.useEffect(()=>{o!=="all"&&(c.includes(o)||u("all"))},[c,o]);const O=()=>{const t=["Quiz","Subject","Type","Score","Date","Status"],s=w.map(r=>[r.title,r.subject,r.type,`${r.score}%`,r.date,r.status]),a=[t,...s].map(r=>r.join(",")).join(`
2
+ `),d=new Blob([a],{type:"text/csv;charset=utf-8;"}),m=URL.createObjectURL(d),l=document.createElement("a");l.href=m,l.download=`mathpulse-grades-${new Date().toISOString().split("T")[0]}.csv`,l.click(),URL.revokeObjectURL(m)},L=t=>t>=90?"text-emerald-600 bg-emerald-50":t>=80?"text-sky-600 bg-sky-50":t>=70?"text-rose-600 bg-rose-50":"text-red-600 bg-red-50",$=t=>t>=90?"A":t>=80?"B":t>=70?"C":t>=60?"D":"F";return e.jsxs("div",{className:"space-y-6 px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:[e.jsxs("div",{className:"bg-gradient-to-br from-white via-sky-50/30 to-white rounded-2xl p-7 card-elevated-lg relative overflow-hidden border border-slate-200/80",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/40 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-sky-100/40 rounded-full -translate-y-1/2 translate-x-1/2"}),e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(A,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Overall GPA"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:x.gpa}),e.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[e.jsx(T,{size:14,className:"text-emerald-500"}),e.jsxs("span",{className:"text-xs text-slate-500 font-body",children:["+",x.trendValue,"% this month"]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(C,{size:18,className:"text-sky-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Average Score"})]}),e.jsxs("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:[x.averageScore,"%"]}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"Across all subjects"})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(P,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Total Quizzes"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:x.totalQuizzes}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"Completed"})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(A,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Grade Rank"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:"Top 15%"}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"In your class"})]})]})]}),e.jsxs("div",{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 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(C,{size:20,strokeWidth:2.5})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Subject Performance"})]}),e.jsxs(S,{variant:"outline",size:"sm",className:"rounded-lg font-body border-[#dde3eb] text-[#5a6578]",onClick:O,children:[e.jsx(J,{size:16,className:"mr-2"}),"Export Report"]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:I.map(t=>e.jsxs(W.div,{whileHover:{scale:1.02},className:"bg-white rounded-xl p-5 border border-[#dde3eb] card-elevated cursor-pointer",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-display font-bold text-[#0a1628] mb-1",children:t.subject}),e.jsxs("p",{className:"text-xs text-[#5a6578] font-body",children:[t.quizzes," quizzes completed"]})]}),e.jsx("div",{className:`w-14 h-14 rounded-lg bg-${t.color}-50 flex items-center justify-center`,children:e.jsx("span",{className:`text-xl font-display font-bold text-${t.color}-600`,children:$(t.average)})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:[t.average,"%"]}),e.jsx("p",{className:"text-xs text-[#5a6578] font-body mt-1",children:"Average"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[t.trend==="up"?e.jsx(T,{size:18,className:"text-green-500"}):e.jsx(K,{size:18,className:"text-red-500"}),e.jsx(_,{size:16,className:"text-[#d1cec6]"})]})]})]},t.subject))})]}),e.jsxs("div",{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 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:e.jsx(P,{size:20,strokeWidth:2.5})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Quiz History"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:o,onChange:t=>u(t.target.value),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm font-body bg-white text-[#0a1628]",children:[e.jsx("option",{value:"all",children:"All Subjects"}),c.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("select",{value:h,onChange:t=>D(t.target.value),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm font-body bg-white text-[#0a1628]",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"practice",children:"Practice"}),e.jsx("option",{value:"module",children:"Module"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] card-elevated overflow-hidden",children:[e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-[#f7f9fc] border-b border-[#dde3eb]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Quiz"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Subject"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Type"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Score"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Date"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Action"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{className:"border-b border-[#edf1f7] hover:bg-[#f7f9fc] transition-colors",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsx("p",{className:"font-body font-semibold text-[#0a1628] text-sm",children:t.title})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-[#5a6578] font-body",children:t.subject})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"px-2.5 py-1 bg-[#edf1f7] text-[#5a6578] text-xs font-body font-semibold rounded-md capitalize",children:t.type})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:`px-2.5 py-1 rounded-md text-sm font-body font-semibold ${L(t.score)}`,children:[t.score,"%"]}),e.jsxs("span",{className:"text-xs text-slate-500 font-body",children:["(",t.score,"/",t.total,")"]})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-[#5a6578] font-body",children:t.date})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx(S,{variant:"outline",size:"sm",className:"rounded-lg",children:"Review"})})]},t.id))})]}),z.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(X,{size:40,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] font-body",children:"No quizzes found with current filters"}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-1",children:"Try adjusting your filters"})]})]})]})]})};export{ne as default};
assets/LeaderboardPage-CcWilfKB.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import{r as o,j as e}from"./vendor-react-CCIuKUIB.js";import{c as O,az as R,K as W,m as d,X as $,aj as A,a as y,aa as H,al as v,T as B,aA as X,am as U,M as q,aB as K}from"./index-Cq4H6CKS.js";import{T as P}from"./target-D136l6Dz.js";import{A as k}from"./award-GuQ4hvnk.js";import{L as M}from"./loader-circle-CqE0ik6T.js";import{U as L}from"./user-CJxrpn3Q.js";import"./vendor-firebase-CG7e86Dp.js";import"./vendor-radix-BAHZvx1W.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const G=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Q=O("badge-check",G),V=({student:s,onClose:w})=>{const[n,N]=o.useState([]),[h,p]=o.useState(!1);if(o.useEffect(()=>{s?.uid&&(p(!0),R(s.uid).then(N).catch(c=>console.error("Failed to load achievements:",c)).finally(()=>p(!1)))},[s?.uid]),!s)return null;const x={trophy:e.jsx(v,{size:24,className:"text-rose-500"}),flame:e.jsx(A,{size:24,className:"text-orange-500"}),star:e.jsx(U,{size:24,className:"text-rose-400"}),"book-open":e.jsx(y,{size:24,className:"text-sky-600"}),"badge-check":e.jsx(Q,{size:24,className:"text-emerald-600"}),crown:e.jsx(X,{size:24,className:"text-rose-500"}),target:e.jsx(P,{size:24,className:"text-rose-500"})};return e.jsx(W,{children:e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(d.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:w,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(d.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[90vh] overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-8 text-white relative overflow-hidden",children:[e.jsx("div",{className:"accent-line absolute top-0 left-0 right-0"}),e.jsx("button",{onClick:w,className:"absolute top-4 right-4 p-2 hover:bg-slate-100 rounded-xl transition-colors z-10",children:e.jsx($,{size:20})}),e.jsx("div",{className:"relative z-10",children:e.jsxs("div",{className:"flex items-start gap-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-24 h-24 bg-white/10 backdrop-blur-sm rounded-2xl flex items-center justify-center text-6xl border border-slate-300",children:s.avatar}),s.isOnline&&e.jsx("div",{className:"absolute -bottom-2 -right-2 w-6 h-6 bg-green-500 rounded-full border-4 border-white"})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-3xl font-display font-bold mb-2",children:s.name}),e.jsx("p",{className:"text-slate-500 mb-4",children:s.section}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[e.jsx("p",{className:"text-xs text-slate-500",children:"Level"}),e.jsx("p",{className:"text-xl font-bold",children:s.level})]}),e.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[e.jsx("p",{className:"text-xs text-slate-500",children:"Total XP"}),e.jsx("p",{className:"text-xl font-bold",children:s.totalXP})]}),e.jsxs("div",{className:"bg-slate-100 backdrop-blur-sm rounded-xl px-4 py-2 border border-slate-200",children:[e.jsx("p",{className:"text-xs text-slate-500",children:"Streak"}),e.jsxs("p",{className:"text-xl font-bold flex items-center gap-1",children:[e.jsx(A,{size:16,className:"text-orange-300"}),s.currentStreak]})]})]})]})]})}),e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-sky-500/5 rounded-full -translate-y-1/2 translate-x-1/2"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-rose-500/5 rounded-full translate-y-1/2 -translate-x-1/2"})]}),e.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-320px)]",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Performance Stats"}),e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[e.jsx(y,{size:24,className:"text-sky-600 mx-auto mb-2"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:s.stats.quizzesCompleted}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Quizzes"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[e.jsx(P,{size:24,className:"text-emerald-600 mx-auto mb-2"}),e.jsxs("p",{className:"text-2xl font-bold text-[#0a1628]",children:[s.stats.averageScore,"%"]}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Avg Score"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[e.jsx(k,{size:24,className:"text-rose-600 mx-auto mb-2"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:s.stats.modulesCompleted}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Modules"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] p-4 text-center",children:[e.jsx(H,{size:24,className:"text-rose-600 mx-auto mb-2"}),e.jsx("p",{className:"text-2xl font-bold text-[#0a1628]",children:s.stats.studyHours}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Hours"})]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Rankings"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-4",children:[e.jsx(v,{size:20,className:"text-rose-600 mb-2"}),e.jsxs("p",{className:"text-2xl font-bold text-rose-900",children:["#",s.rank.global]}),e.jsx("p",{className:"text-xs text-rose-700 mt-1 font-body",children:"School"})]}),e.jsxs("div",{className:"bg-sky-50 border border-sky-200 rounded-xl p-4",children:[e.jsx(v,{size:20,className:"text-sky-600 mb-2"}),e.jsxs("p",{className:"text-2xl font-bold text-sky-900",children:["#",s.rank.section]}),e.jsx("p",{className:"text-xs text-sky-700 mt-1 font-body",children:"Section"})]}),e.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded-xl p-4",children:[e.jsx(v,{size:20,className:"text-rose-600 mb-2"}),e.jsx("p",{className:"text-2xl font-bold text-rose-900",children:s.rank.change>0?e.jsxs("span",{className:"flex items-center gap-1 text-emerald-600",children:[e.jsx(B,{size:20}),"+",s.rank.change]}):s.rank.change<0?e.jsxs("span",{className:"flex items-center gap-1 text-red-600",children:[e.jsx(B,{size:20,className:"rotate-180"}),s.rank.change]}):"0"}),e.jsx("p",{className:"text-xs text-rose-700 mt-1 font-body",children:"This Week"})]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Achievements"}),h?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(M,{size:24,className:"text-sky-500 animate-spin"})}):n.length>0?e.jsx("div",{className:"grid grid-cols-3 gap-3",children:n.map(c=>e.jsxs("div",{className:"rounded-xl p-4 text-center transition-all bg-white border-2 border-sky-200",children:[e.jsx("div",{className:"text-3xl mb-2",children:x[c.icon]||e.jsx(k,{size:24,className:"text-slate-500 mx-auto"})}),e.jsx("p",{className:"font-bold text-xs text-[#0a1628] mb-1 font-body",children:c.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:c.description})]},c.id))}):e.jsxs("div",{className:"flex flex-col items-center py-8 gap-2",children:[e.jsx(k,{size:32,className:"text-[#d1cec6]"}),e.jsx("p",{className:"text-sm text-[#5a6578] font-body",children:"No achievements unlocked yet"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-lg text-[#0a1628] mb-4",children:"Recent Activity"}),e.jsxs("div",{className:"flex flex-col items-center py-8 gap-2",children:[e.jsx(y,{size:32,className:"text-[#d1cec6]"}),e.jsx("p",{className:"text-sm text-[#5a6578] font-body",children:"Activity history coming soon"})]})]})]})]})]})})},de=({currentUserPhoto:s,onBack:w})=>{const{currentUser:n,userProfile:N}=q(),h=N,[p]=o.useState("section"),[x,c]=o.useState("weekly"),[I,z]=o.useState(null),[T,_]=o.useState(!0),[E,Y]=o.useState([]),b=[h?.grade,h?.section].filter(Boolean).join(" - "),f=["","","","","","","",""];o.useEffect(()=>{(async()=>{if(n){_(!0);try{const a={daily:"week",weekly:"week",all:"all"},l=x==="daily"?"week":x==="all"?"all":"week",g=(await K(n.uid,!1,l,20)).map((r,C)=>({id:r.userId,uid:r.userId,name:r.name,avatar:r.userId===n.uid?s||r.photo||f[C%f.length]:r.photo||f[C%f.length],level:r.level,totalXP:r.xp,currentStreak:0,section:b||"Grade 11 - STEM A",rank:{global:r.rank,section:r.rank,change:0},stats:{quizzesCompleted:0,averageScore:0,modulesCompleted:0,studyHours:0},isOnline:!1,isYou:r.userId===n.uid}));Y(g)}catch(a){console.error("Error loading leaderboard:",a)}finally{_(!1)}}})()},[n,b,x,s]);const m=(()=>{let t=E;if(p==="section"){const l=b||"";l&&(t=t.filter(j=>j.section===l))}const a=t.sort((l,j)=>{const g=p==="section"?"section":"global";return(l.rank[g]||999)-(j.rank[g]||999)});for(;a.length>0&&a.length<3;){const l=a.length+1;a.push({id:`mock-${l}`,uid:`mock-${l}`,name:`Student ${l}`,avatar:"",level:1,totalXP:0,currentStreak:0,section:b||"",rank:{global:l,section:l,change:0},stats:{quizzesCompleted:0,averageScore:0,modulesCompleted:0,studyHours:0},isOnline:!1,isYou:!1})}return a})(),S=m.find(t=>t.isYou)?.rank.section||4,D=Math.max(10,Math.min(99,100-S/Math.max(1,m.length)*100)),i=m.length>=3?m.slice(0,3):[],F=m.length>=3?m.slice(3):[],u=(t,a)=>t?t.startsWith("http")||t.startsWith("data:")?e.jsx("img",{src:t,alt:"Avatar",className:"w-full h-full object-cover rounded-full"}):e.jsx(L,{size:a,className:"text-slate-400 opacity-70"}):e.jsx(L,{size:a,className:"text-slate-400 opacity-70"});return T?e.jsx("div",{className:"flex justify-center items-center h-[500px]",children:e.jsx(M,{className:"w-8 h-8 animate-spin text-purple-600"})}):e.jsxs("div",{className:"w-full min-h-screen relative flex flex-col items-center font-body text-white",children:[e.jsxs("div",{className:"absolute inset-x-[-20px] top-0 bottom-[-50px] z-[-1] pointer-events-none overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,#9333ea_0%,#c084fc_40%,transparent_80%)]"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[250vw] md:w-[200vw] h-[150vh] opacity-75 pointer-events-none",style:{WebkitMaskImage:"radial-gradient(circle at 50% 100%, black 10%, transparent 60%)"},children:e.jsx(d.div,{className:"absolute bottom-0 left-1/2 w-[300vw] h-[300vw] md:w-[200vw] md:h-[200vw]",style:{x:"-50%",originX:.5,originY:1,background:`repeating-conic-gradient(from 0deg at 50% 100%,
7
+ rgba(255,255,255,0.7) 0deg, rgba(255,255,255,0.7) 6deg,
8
+ transparent 6deg, transparent 12deg)`},animate:{rotate:360},transition:{duration:160,repeat:1/0,ease:"linear"}})}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[150vw] h-[100vh] bg-[radial-gradient(ellipse_at_50%_100%,#7e22ce_10%,transparent_60%)] mix-blend-overlay"})]}),e.jsx("div",{className:"absolute inset-0 bg-math-pattern opacity-[0.03] mix-blend-overlay pointer-events-none z-[-1]",style:{WebkitMaskImage:"linear-gradient(to bottom, transparent, black 15%)"}}),e.jsxs("div",{className:"relative z-10 w-full px-4 sm:px-8 py-4 md:py-6 flex flex-col items-center",children:[e.jsx("div",{className:"w-full flex justify-center items-center mb-4 mt-2",children:e.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold tracking-wide text-slate-800 drop-shadow-sm",children:"Leaderboard"})}),e.jsx("div",{className:"bg-slate-800/5 backdrop-blur-md rounded-full p-1 flex gap-1 mb-3 shadow-[inset_0_2px_4px_rgba(0,0,0,0.05)] border border-slate-800/10 w-full max-w-[340px]",children:["daily","weekly","all"].map(t=>e.jsx("button",{onClick:()=>c(t),className:`flex-1 py-1.5 rounded-full text-[13px] md:text-sm font-semibold transition-all capitalize inline-flex justify-center items-center ${x===t?"bg-white text-purple-700 shadow-md border border-white/50 backdrop-blur-lg":"text-slate-600 hover:text-purple-700 hover:bg-white/50"}`,children:t==="all"?"All Time":t},t))}),e.jsxs(d.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"w-full max-w-[420px] mb-4 bg-[#FFB356] p-2.5 md:p-3 rounded-full shadow-lg flex items-center gap-3 relative overflow-hidden ring-1 ring-white/20",children:[e.jsx("div",{className:"absolute inset-0 bg-noise opacity-[0.15] mix-blend-overlay pointer-events-none"}),e.jsx("div",{className:"bg-white/25 backdrop-blur-md px-4 py-2 min-w-[60px] rounded-full flex flex-col items-center justify-center shadow-sm z-10 border border-white/20",children:e.jsxs("span",{className:"text-xl md:text-2xl font-display font-bold text-white leading-none",children:["#",S]})}),e.jsx("div",{className:"z-10 flex-1 pr-2 md:pr-4",children:e.jsxs("p",{className:"font-medium text-white/90 text-sm md:text-[15px] leading-snug text-center",children:["You are doing better than ",e.jsxs("span",{className:"font-black text-white drop-shadow-sm",children:[Math.round(D),"%"]})," of other players!"]})})]}),e.jsxs("div",{className:"w-full max-w-[800px] flex items-end justify-center gap-2 md:gap-4 h-[280px] md:h-[310px] relative z-20 mt-8 md:mt-12 mx-auto px-2 sm:px-4 group perspective-1000",children:[e.jsxs(d.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.15,type:"spring",stiffness:90},className:"flex flex-col items-center relative z-10 w-[28%] sm:w-[30%] max-w-[145px] mx-1 md:mr-2",children:[e.jsxs("div",{className:"flex flex-col items-center mb-2 md:mb-4 relative z-40 w-full",children:[e.jsx("div",{className:"w-14 h-14 md:w-[72px] md:h-[72px] rounded-full border-[3px] border-[#FF8B8B] bg-[#111827] flex items-center justify-center shadow-[0_0_18px_rgba(255,139,139,0.6)] overflow-hidden",children:u(i[1]?.avatar,26)}),e.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-xs md:text-sm drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:i[1]?.name||"---"})]}),e.jsxs("div",{className:"w-[90%] relative mt-2",children:[e.jsx("div",{className:"w-full h-10 md:h-14 absolute -bottom-5 md:-bottom-7 bg-[#D96C6A] rounded-[50%] shadow-[0_15px_25px_rgba(0,0,0,0.4)] z-0"}),e.jsx("div",{className:"w-full h-[100px] md:h-[130px] bg-[#D96C6A] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:e.jsx("span",{className:"absolute inset-x-0 top-3 flex items-center justify-center text-[60px] md:text-[80px] font-black text-white/10 drop-shadow",children:"2"})}),e.jsx("div",{className:"w-full h-10 md:h-14 absolute -top-5 md:-top-7 bg-[#FF8B8B] rounded-[50%] z-20 shadow-[0_4px_8px_rgba(0,0,0,0.3)] flex flex-col items-center justify-center",children:e.jsxs("div",{className:"text-black/25 font-black text-[18px] md:text-[26px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[i[1]?.totalXP||0," XP"]})})]})]}),e.jsxs(d.div,{initial:{opacity:0,y:60},animate:{opacity:1,y:0},transition:{delay:.05,type:"spring",stiffness:100},className:"flex flex-col items-center relative z-30 w-[35%] sm:w-[38%] max-w-[190px]",children:[e.jsxs("div",{className:"flex flex-col items-center mb-3 md:mb-5 relative z-40 w-full",children:[e.jsx(d.div,{animate:{y:[0,-6,0]},transition:{repeat:1/0,duration:2.2,ease:"easeInOut"},className:"mb-[-10px] z-30",children:e.jsx(X,{size:30,className:"text-yellow-300 fill-yellow-300 drop-shadow-[0_0_12px_rgba(250,204,21,0.9)] md:w-9 md:h-9"})}),e.jsx("div",{className:"w-16 h-16 md:w-[86px] md:h-[86px] rounded-full border-[4px] border-[#fde68a] bg-[#111827] flex items-center justify-center shadow-[0_0_24px_rgba(250,204,21,0.6)] overflow-hidden",children:u(i[0]?.avatar,34)}),e.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-sm md:text-base drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:i[0]?.name||"---"})]}),e.jsxs("div",{className:"w-[95%] relative mt-2",children:[e.jsx("div",{className:"w-full h-12 md:h-16 absolute -bottom-6 md:-bottom-8 bg-[#6F2BAF] rounded-[50%] shadow-[0_20px_30px_rgba(0,0,0,0.5)] z-0"}),e.jsx("div",{className:"w-full h-[140px] md:h-[180px] bg-[#6F2BAF] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:e.jsx("span",{className:"absolute inset-x-0 top-4 flex items-center justify-center text-[80px] md:text-[110px] font-black text-white/10 drop-shadow",children:"1"})}),e.jsx("div",{className:"w-full h-12 md:h-16 absolute -top-6 md:-top-8 bg-[#9956DE] rounded-[50%] z-20 shadow-[0_5px_12px_rgba(0,0,0,0.4)] flex flex-col items-center justify-center",children:e.jsxs("div",{className:"text-black/25 font-black text-[22px] md:text-[32px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[i[0]?.totalXP||0," XP"]})})]})]}),e.jsxs(d.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.25,type:"spring",stiffness:90},className:"flex flex-col items-center relative z-10 w-[28%] sm:w-[30%] max-w-[145px] mx-1 md:ml-2",children:[e.jsxs("div",{className:"flex flex-col items-center mb-2 md:mb-4 relative z-40 w-full",children:[e.jsx("div",{className:"w-14 h-14 md:w-[72px] md:h-[72px] rounded-full border-[3px] border-[#FFB356] bg-[#111827] flex items-center justify-center shadow-[0_0_18px_rgba(255,179,86,0.6)] overflow-hidden",children:u(i[2]?.avatar,26)}),e.jsx("h3",{className:"font-semibold text-white mt-1.5 md:mt-2 text-xs md:text-sm drop-shadow-md w-full text-center pb-1 px-1 whitespace-normal break-words leading-tight relative z-50",children:i[2]?.name||"---"})]}),e.jsxs("div",{className:"w-[90%] relative mt-2",children:[e.jsx("div",{className:"w-full h-10 md:h-14 absolute -bottom-5 md:-bottom-7 bg-[#DE7949] rounded-[50%] shadow-[0_15px_25px_rgba(0,0,0,0.4)] z-0"}),e.jsx("div",{className:"w-full h-[75px] md:h-[100px] bg-[#DE7949] relative z-10 flex flex-col items-center justify-start overflow-hidden",children:e.jsx("span",{className:"absolute inset-x-0 top-1 flex items-center justify-center text-[50px] md:text-[70px] font-black text-white/10 drop-shadow",children:"3"})}),e.jsx("div",{className:"w-full h-10 md:h-14 absolute -top-5 md:-top-7 bg-[#FFB356] rounded-[50%] z-20 shadow-[0_4px_8px_rgba(0,0,0,0.3)] flex flex-col items-center justify-center",children:e.jsxs("div",{className:"text-black/25 font-black text-[16px] md:text-[22px] transform scale-y-75 uppercase tracking-widest pointer-events-none z-30",children:[i[2]?.totalXP||0," XP"]})})]})]})]})]}),e.jsxs("div",{className:"w-full flex-grow relative z-20 pt-6 pb-32 px-4 sm:px-10 flex flex-col items-center mt-[-20px] md:mt-[-40px] bg-white transition-all duration-300 hover:-translate-y-2 rounded-t-[2.5rem] shadow-[0_-15px_50px_rgba(0,0,0,0.2)] hover:shadow-[0_-20px_60px_rgba(0,0,0,0.3)] border-t border-slate-100 min-h-[50vh]",children:[e.jsx("div",{className:"absolute top-[50%] bottom-[-500px] left-0 right-0 bg-white z-[-1]"}),e.jsx("div",{className:"w-12 h-1.5 bg-slate-300/80 rounded-full mb-6 mt-[-10px]"}),e.jsxs("div",{className:"w-full max-w-4xl space-y-3.5",children:[F.map((t,a)=>{const l=t.rank.global||a+4;return e.jsxs(d.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:a*.05+.3},onClick:()=>z(t),className:`flex items-center gap-4 p-3.5 md:p-4 rounded-3xl cursor-pointer bg-white border transition-all duration-300 ${t.isYou?"border-[#8B5CF6]/40 shadow-xl shadow-[#8B5CF6]/20 ring-2 ring-[#8B5CF6]/10":"border-slate-100 shadow-[0_12px_25px_rgba(0,0,0,0.08)] hover:shadow-[0_16px_30px_rgba(0,0,0,0.12)]"}`,children:[e.jsx("div",{className:"w-9 h-9 md:w-11 md:h-11 rounded-full border-2 border-slate-100 bg-white flex items-center justify-center font-display font-bold text-slate-500 shadow-sm text-sm",children:l}),e.jsx("div",{className:"w-11 h-11 md:w-14 md:h-14 bg-slate-100 rounded-full flex items-center justify-center text-xl overflow-hidden shadow-sm relative border-[3px] border-[#F1F5F9]",children:u(t.avatar,24)}),e.jsxs("div",{className:"flex-1 flex justify-between items-center pr-2",children:[e.jsx("div",{children:e.jsxs("h4",{className:"font-display font-bold text-[#1E293B] text-[15px] md:text-lg flex items-center gap-2 tracking-wide",children:[t.name,t.isYou&&e.jsx("span",{className:"text-[9px] uppercase tracking-wider bg-[#8B5CF6] text-white px-1.5 py-0.5 rounded font-bold",children:"You"})]})}),e.jsx("div",{children:e.jsxs("p",{className:"text-[13px] md:text-[15px] font-bold text-slate-500 text-right",children:[t.totalXP," ",e.jsx("span",{className:"text-[10px] text-slate-400 font-normal uppercase",children:"XP"})]})})]})]},t.id)}),F.length===0&&e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-slate-400 font-medium",children:"No other participants found in this view."})})]})]}),e.jsx(V,{student:I,onClose:()=>z(null)})]})};export{de as default};
assets/LoginPage-B6vI51Px.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{r as l,j as e}from"./vendor-react-CCIuKUIB.js";import{B as Q}from"./button-MTmjd5-I.js";import{I as N}from"./input-DLYpRUYd.js";import{c as K,m as s,S as X,B as Z,T as ee,U as T,G as C,a as z,A as B,s as G,b as te,d as D}from"./index-Cq4H6CKS.js";import{A as se}from"./award-GuQ4hvnk.js";import{M as ae}from"./mail-QgeDysPt.js";import{L}from"./lock-Cn8nsuCQ.js";import{E as le}from"./eye-off-BY4y1x6t.js";import{E as re}from"./eye-B9PLXLcy.js";import"./vendor-radix-BAHZvx1W.js";import"./vendor-firebase-CG7e86Dp.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ie=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],oe=K("shield-check",ie),ne="/assets/shader-bg-DA7bEbBA.mp4",R=(h,d)=>{const r=h instanceof Error?h.message:d;return r.includes("auth/invalid-credential")||r.includes("auth/wrong-password")||r.includes("auth/user-not-found")?"Invalid email or password. Please check your credentials and try again.":r.includes("auth/email-already-in-use")?"This email is already registered. Please sign in instead.":r.includes("auth/weak-password")?"Password is too weak. It should be at least 6 characters.":r.includes("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.":r.includes("auth/network-request-failed")?"Network error. Please check your internet connection and try again.":r.includes("Firebase:")||r.includes("auth/")?d:r},ve=()=>{const h=["Grade 11","Grade 12"],d={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"],"Grade 12":["STEM A","STEM B","ABM A","HUMSS A"]},r={teacher:["Mathematics","Science","English","Technology","Humanities"]},[b,k]=l.useState(""),[f,w]=l.useState(""),[g,q]=l.useState(!1),[i,S]=l.useState(!1),[v,U]=l.useState(""),[o,A]=l.useState("student"),[m,$]=l.useState("Grade 11"),[y,P]=l.useState(d["Grade 11"][0]),[u,E]=l.useState("Mathematics"),[M,c]=l.useState(!1),[I,n]=l.useState(null),[O,_]=l.useState(!1),j=l.useRef(null);l.useEffect(()=>{j.current&&j.current.play().catch(()=>{})},[]),l.useEffect(()=>{o==="teacher"&&!r.teacher.includes(u)&&E(r.teacher[0])},[u,o]),l.useEffect(()=>{const t=d[m]||[];t.length>0&&!t.includes(y)&&P(t[0])},[m,y]);const H=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:C,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:z,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:oe,color:"rose"}],Y=async(t,a,x)=>{n(null),c(!0),k(t),w(a),A(x),S(!1);try{G(x),await D(t,a)}catch(p){n(R(p,"Demo sign-in failed")),c(!1)}},F=async t=>{t.preventDefault(),n(null),c(!0);try{if(i){if(!v.trim()){n("Please enter your name"),c(!1);return}if(o==="student"&&!m){n("Please select a grade level"),c(!1);return}if(o!=="student"&&!u){n("Please select a department"),c(!1);return}if(o==="admin"){n("Admin account creation is restricted. Please contact an existing administrator."),c(!1);return}G(o),await te(b,f,v,o,o==="student"?{grade:m,section:y}:{department:u})}else await D(b,f)}catch(a){n(R(a,"Authentication failed")),c(!1)}},V=["โˆซ","ฯ€","โˆ‘","ฮ”","โˆž","ฯ†","โˆš","ฮป","ฮธ","โˆ‚"];return e.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative",style:{background:"linear-gradient(135deg, #f0f9ff 0%, #f8fafc 30%, #fff1f2 60%, #f0f9ff 100%)"},children:[e.jsx("video",{ref:j,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,onCanPlay:()=>_(!0),className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-1000 ${O?"opacity-40":"opacity-0"}`,src:ne}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 50%, rgba(240,249,255,0.4) 0%, rgba(248,250,252,0.65) 50%, rgba(255,241,242,0.5) 80%, rgba(248,250,252,0.85) 100%)"}}),e.jsx("div",{className:"absolute top-[-20%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[120px] pointer-events-none",style:{background:"radial-gradient(circle, rgba(14,165,233,0.12) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute bottom-[-20%] right-[-10%] w-[50%] h-[50%] rounded-full blur-[120px] pointer-events-none",style:{background:"radial-gradient(circle, rgba(244,63,94,0.08) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03]",style:{backgroundImage:"radial-gradient(circle, rgba(15,23,42,0.4) 1px, transparent 1px)",backgroundSize:"24px 24px"}}),V.map((t,a)=>e.jsx(s.span,{className:"absolute text-sky-700/[0.08] font-display select-none pointer-events-none",style:{fontSize:`${20+Math.random()*40}px`,left:`${5+a*9.5}%`,top:`${10+a*8}%`},animate:{y:[0,-30,0],opacity:[.04,.1,.04],rotate:[0,10,0]},transition:{duration:8+a*2,repeat:1/0,ease:"easeInOut",delay:a*.5},children:t},a)),e.jsx("div",{className:"absolute top-0 left-1/4 w-px h-full bg-gradient-to-b from-transparent via-sky-400/15 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-1/3 w-px h-full bg-gradient-to-b from-transparent via-rose-300/10 to-transparent"}),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(s.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col justify-center space-y-8",children:[e.jsxs(s.div,{className:"flex items-center gap-2.5",children:[e.jsx(s.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI Logo",className:"w-16 h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-display font-extrabold tracking-tight text-slate-900",children:["MathPulse",e.jsx("span",{className:"text-sky-500",children:"AI"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(X,{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(s.div,{className:"space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"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-base text-slate-500 leading-relaxed max-w-md 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-3",children:[{icon:Z,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:ee,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:se,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,a)=>{const x=t.icon,p={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"},W={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},J={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(s.div,{className:`bg-white/80 backdrop-blur-xl border ${p[t.color]} rounded-xl 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+a*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-9 h-9 rounded-lg ${J[t.color]} flex items-center justify-center mb-3`,children:e.jsx(x,{size:18,className:W[t.color]})}),e.jsx("h3",{className:"text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-xs text-slate-400 font-body",children:t.desc})]},a)})})]}),e.jsx(s.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-2xl p-7 w-full max-w-md relative overflow-hidden shadow-2xl shadow-slate-900/[0.08]",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-sky-500/50 to-transparent"}),e.jsx("div",{className:"absolute -top-20 left-1/2 -translate-x-1/2 w-72 h-36 bg-sky-400/10 rounded-full blur-3xl pointer-events-none"}),e.jsxs("div",{className:"text-center mb-6 relative",children:[e.jsx(s.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:i?"Create Account":"Welcome Back"}),e.jsx(s.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:i?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:F,className:"space-y-4 mb-5 relative",children:[I&&e.jsx(s.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:I}),i&&e.jsxs(s.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(T,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(N,{type:"text",placeholder:"Your Name",value:v,onChange:t=>U(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})]})]}),i&&e.jsxs(s.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 a=o===t.role;return e.jsx("button",{type:"button",onClick:()=>A(t.role),className:`rounded-lg border px-3 py-2 text-xs font-body font-semibold transition-all ${a?"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)})})]}),i&&o==="student"&&e.jsxs(s.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:"Grade Level"}),e.jsxs("div",{className:"relative",children:[e.jsx(C,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:m,onChange:t=>$(t.target.value),className:"w-full pl-11 pr-4 py-3 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:h.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),i&&o==="student"&&e.jsxs(s.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:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(T,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:y,onChange:t=>P(t.target.value),className:"w-full pl-11 pr-4 py-3 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:(d[m]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),i&&o!=="student"&&e.jsxs(s.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:"Department"}),e.jsxs("div",{className:"relative",children:[e.jsx(z,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:u,onChange:t=>E(t.target.value),className:"w-full pl-11 pr-4 py-3 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:r.teacher.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs(s.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(ae,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(N,{type:"email",placeholder:"your.email@school.edu",value:b,onChange:t=>k(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(s.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(L,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(N,{type:g?"text":"password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",value:f,onChange:t=>w(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:6}),e.jsx(s.button,{type:"button",onClick:()=>q(!g),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:g?e.jsx(le,{size:16}):e.jsx(re,{size:16})})]})]}),e.jsx(s.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(Q,{type:"submit",disabled:M,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-500 hover:to-cyan-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-sky-600/25 hover:shadow-sky-500/35 hover:scale-[1.01] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(s.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:[M?"Please wait...":i?"Create Account":"Sign In",e.jsx(B,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{S(!i),n(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:i?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!i&&e.jsxs(s.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:H.map(t=>{const a=t.icon,x={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},p={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(s.button,{type:"button",onClick:()=>Y(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 ${x[t.color]}`,children:e.jsx(a,{size:15,className:p[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(B,{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(s.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(L,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{ve as default};
assets/MathAnswerInput-D47QiEEM.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as c,c as y,j as e}from"./vendor-react-CCIuKUIB.js";import{Y as P}from"./index-Cq4H6CKS.js";const N={0:"โฐ",1:"ยน",2:"ยฒ",3:"ยณ",4:"โด",5:"โต",6:"โถ",7:"โท",8:"โธ",9:"โน"};function S(i){let t=i;return t=t.replace(/sinโปยน/g,"sin<sup>-1</sup>"),t=t.replace(/cosโปยน/g,"cos<sup>-1</sup>"),t=t.replace(/tanโปยน/g,"tan<sup>-1</sup>"),t=t.replace(/โปยน/g,"<sup>-1</sup>"),t=t.replace(/ยฒ/g,"<sup>2</sup>"),t=t.replace(/ยณ/g,"<sup>3</sup>"),t=t.replace(/[โฐยนโดโตโถโทโธโน]/g,d=>`<sup>${{"โฐ":"0","ยน":"1","โด":"4","โต":"5","โถ":"6","โท":"7","โธ":"8","โน":"9"}[d]??d}</sup>`),t=t.replace(/โˆš/g,"โˆš"),t=t.replace(/ฯ€/g,"ฯ€"),t=t.replace(/<(?!\/?(?:sup|sub)\b)[^>]*>/gi,""),t}const R=({value:i,onChange:t,placeholder:d,onCalculatorOpen:f,onSubmit:h})=>{const[b,g]=c.useState(!1),[m,j]=c.useState(null),[k,v]=c.useState({top:0,left:0}),p=c.useRef(null),x=c.useRef(!1),s=c.useCallback(n=>{const o=p.current;if(!o){t(i+n);return}const l=o.selectionStart??i.length,u=o.selectionEnd??i.length,D=i.slice(0,l)+n+i.slice(u);t(D),setTimeout(()=>{o.setSelectionRange(l+n.length,l+n.length),o.focus()},0)},[i,t]),C=c.useCallback(n=>{const o=n.key;if(o==="Enter"){n.preventDefault(),h?.();return}if(o==="^"){x.current=!0,n.preventDefault();return}if(x.current){if(o==="-"){s("โป"),n.preventDefault();return}if(/^[0-9]$/.test(o)&&N[o]){s(N[o]),x.current=!1,n.preventDefault();return}x.current=!1}if(o==="Tab"&&m!==null){s(m),j(null),n.preventDefault();return}setTimeout(()=>{const l=p.current?.value??i;if(l.endsWith("pi"))t(l.slice(0,-2)+"ฯ€"),j(null);else if(l.endsWith("sqrt"))t(l.slice(0,-4)+"โˆš");else if(l.endsWith("sin-1")||l.endsWith("sin^-1")){const u=l.endsWith("sin^-1")?6:5;t(l.slice(0,-u)+"sinโปยน")}else if(l.endsWith("cos-1")||l.endsWith("cos^-1")){const u=l.endsWith("cos^-1")?6:5;t(l.slice(0,-u)+"cosโปยน")}else if(l.endsWith("tan-1")||l.endsWith("tan^-1")){const u=l.endsWith("tan^-1")?6:5;t(l.slice(0,-u)+"tanโปยน")}},0)},[i,t,m,s,h]),a=c.useCallback(()=>{if(p.current){const n=p.current.getBoundingClientRect();v({top:Math.max(20,n.bottom-280),left:Math.max(10,n.left-240)})}},[]),E=c.useCallback(()=>{a(),g(!0)},[a]);y.useEffect(()=>{const n=setTimeout(()=>{a(),g(!0)},50);return()=>clearTimeout(n)},[a]),y.useEffect(()=>{if(b)return window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[b,a]);const T=c.useCallback(()=>{},[]),w=S(i),W=w!==i&&i.length>0,r="bg-slate-100 hover:bg-slate-200 text-[#0a1628] text-sm px-2 py-1 rounded-lg transition-colors";return e.jsxs("div",{className:"relative",children:[b&&e.jsxs("div",{className:"fixed z-[60] bg-white border border-slate-200 rounded-xl shadow-xl px-3 py-3 flex flex-col gap-3 w-[220px] pointer-events-auto",style:{top:k.top,left:k.left},onMouseDown:n=>n.preventDefault(),children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Powers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Square",onClick:()=>s("ยฒ"),children:"xยฒ"}),e.jsx("button",{type:"button",className:r,title:"Cube",onClick:()=>s("ยณ"),children:"xยณ"}),e.jsx("button",{type:"button",className:r,title:"Power",onClick:()=>s("^"),children:"xโฟ"}),e.jsx("button",{type:"button",className:r,title:"Inverse",onClick:()=>s("โปยน"),children:"xโปยน"}),e.jsx("button",{type:"button",className:r,title:"Square root",onClick:()=>s("โˆš("),children:"โˆš"}),e.jsx("button",{type:"button",className:r,title:"Cube root",onClick:()=>s("โˆ›("),children:"โˆ›"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Inverse Trig"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Inverse sine",onClick:()=>s("sinโปยน("),children:"sinโปยน"}),e.jsx("button",{type:"button",className:r,title:"Inverse cosine",onClick:()=>s("cosโปยน("),children:"cosโปยน"}),e.jsx("button",{type:"button",className:r,title:"Inverse tangent",onClick:()=>s("tanโปยน("),children:"tanโปยน"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Symbols"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Pi",onClick:()=>s("ฯ€"),children:"ฯ€"}),e.jsx("button",{type:"button",className:r,title:"Euler's number",onClick:()=>s("e"),children:"e"}),e.jsx("button",{type:"button",className:r,title:"Infinity",onClick:()=>s("โˆž"),children:"โˆž"}),e.jsx("button",{type:"button",className:r,title:"Plus-minus",onClick:()=>s("ยฑ"),children:"ยฑ"}),e.jsx("button",{type:"button",className:r,title:"Approximately",onClick:()=>s("โ‰ˆ"),children:"โ‰ˆ"}),e.jsx("button",{type:"button",className:r,title:"Degree",onClick:()=>s("ยฐ"),children:"ยฐ"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Other"}),e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsx("button",{type:"button",className:r,title:"Fraction",onClick:()=>s("(/)"),children:"a/b"}),e.jsx("div",{className:"ml-auto",children:e.jsxs("button",{type:"button",className:"bg-sky-600 hover:bg-rose-500 text-white text-xs px-3 py-1 rounded-lg flex items-center gap-1",onClick:()=>f?.(),children:[e.jsx(P,{size:12}),"Use Calc"]})})]})]})]}),e.jsx("input",{ref:p,type:"text",value:i,onChange:n=>t(n.target.value),onKeyDown:C,onFocus:E,onBlur:T,placeholder:d||"Type your answer... use ^ for powers e.g. x^2 for xยฒ",className:"w-full bg-white border border-slate-200 focus:border-sky-500 rounded-xl px-4 py-3 text-[#0a1628] font-mono text-base outline-none transition-colors"}),W&&e.jsx("div",{className:"text-rose-300 text-sm font-mono mt-1",dangerouslySetInnerHTML:{__html:w}})]})};export{R as M};
assets/ModulesPage-Cj0Y6Ygf.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/ProfileModal-CPc0v0EZ.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{r as o,j as e}from"./vendor-react-CCIuKUIB.js";import{B as c}from"./button-MTmjd5-I.js";import{I as l}from"./input-DLYpRUYd.js";import{c as f,K as S,m as N,X as P,U as h,a as k,aB as A,aM as B}from"./index-Cq4H6CKS.js";import{C as R}from"./CompositeAvatar-CxBIl8mP.js";import{M as D}from"./mail-QgeDysPt.js";import{A as b}from"./award-GuQ4hvnk.js";import{C as F}from"./calendar-Ac41aFLD.js";import{G as U}from"./globe-DGPprHYb.js";import{S as _}from"./save-DxABtV3B.js";import"./vendor-radix-BAHZvx1W.js";import"./vendor-firebase-CG7e86Dp.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const T=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]],q=f("building",T);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const $=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],G=f("camera",$);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const X=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],Y=f("phone",X),de=({isOpen:i,onClose:n,profileData:u,onSave:w})=>{const[s,t]=o.useState(u),[d,x]=o.useState(!1),[z,p]=o.useState(!1),[m,g]=o.useState([]),[y,v]=o.useState(0);o.useEffect(()=>{if(!i)return;const a=r=>{r.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[i,n]),o.useEffect(()=>{if(!i||s.role!=="student"||!s.uid)return;(async()=>{p(!0);try{const[r,I]=await Promise.all([A(void 0,!1,"all",5),B(s.uid)]);g(r),v(I)}catch(r){console.error("Failed to load leaderboard for profile modal:",r),g([]),v(0)}finally{p(!1)}})()},[i,s.role,s.uid]);const C=()=>{const a=["https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=200&fit=crop","https://images.unsplash.com/photo-1573497019940-1c28c88b4f3e?w=200&h=200&fit=crop"],r=a[Math.floor(Math.random()*a.length)];t({...s,photo:r})},L=()=>{w(s),x(!1)},E=()=>{t(u),x(!1)},M=a=>{switch(a){case"student":return"bg-sky-100 text-sky-700 border-sky-200";case"teacher":return"bg-rose-100 text-rose-700 border-rose-200";case"admin":return"bg-rose-100 text-rose-700 border-rose-200";default:return"bg-zinc-100 text-zinc-700 border-zinc-200"}},j=m.find(a=>a.userId===s.uid);return e.jsx(S,{children:i&&e.jsxs(e.Fragment,{children:[e.jsx(N.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50"}),e.jsx(N.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},className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:a=>a.stopPropagation(),children:e.jsxs("div",{className:"bg-[#f7f9fc] rounded-2xl shadow-2xl w-full max-w-3xl max-h-[90vh] overflow-hidden border border-[#dde3eb]",children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-6 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-white/30 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full -mr-24 -mt-24"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-36 h-36 bg-white/5 rounded-full -ml-18 -mb-18"}),e.jsxs("div",{className:"relative z-10 flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-white mb-1",children:"Profile Settings"}),e.jsx("p",{className:"text-zinc-400 text-sm font-body",children:"Manage your account information"})]}),e.jsx("button",{onClick:n,className:"text-zinc-500 hover:text-sky-700 hover:bg-slate-100 p-2 rounded-lg transition-all",children:e.jsx(P,{size:20})})]})]}),e.jsxs("div",{className:"overflow-y-auto max-h-[calc(90vh-200px)] p-6 scrollbar-thin scrollbar-thumb-[#d1cec6] scrollbar-track-[#edf1f7]",children:[e.jsxs("div",{className:"flex flex-col items-center mb-8",children:[e.jsxs("div",{className:"relative group",children:[e.jsx(R,{layers:s.avatarLayers,className:"w-28 h-28 rounded-xl bg-[#0B1021] shadow-lg border-2 border-[#dde3eb] ring-4 ring-sky-100",fallbackSrc:s.photo}),d&&e.jsx("button",{onClick:C,className:"absolute inset-0 bg-black/60 rounded-xl flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-50",children:e.jsxs("div",{className:"text-center text-white",children:[e.jsx(G,{size:32,className:"mx-auto mb-1"}),e.jsx("span",{className:"text-xs font-bold",children:"Change Photo"})]})})]}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628]",children:s.name}),e.jsx("span",{className:`inline-block mt-2 px-3 py-1 rounded-full text-xs font-body font-semibold border ${M(s.role)}`,children:s.role.charAt(0).toUpperCase()+s.role.slice(1)})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-sky-600 rounded-full"}),"Basic Information"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(h,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.name,onChange:a=>t({...s,name:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(D,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{type:"email",value:s.email,onChange:a=>t({...s,email:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Phone Number"}),e.jsxs("div",{className:"relative",children:[e.jsx(Y,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.phone,onChange:a=>t({...s,phone:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:s.role==="student"?"School":s.role==="teacher"?"Department":"Office Location"}),e.jsxs("div",{className:"relative",children:[e.jsx(q,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.school||s.department||s.office||"",onChange:a=>{s.role==="student"?t({...s,school:a.target.value}):s.role==="teacher"?t({...s,department:a.target.value}):t({...s,office:a.target.value})},disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),s.role==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-teal-600 rounded-full"}),"Academic Information"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Learner's Reference Number (LRN)"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.lrn||"",onChange:a=>t({...s,lrn:a.target.value}),disabled:!d,className:"pl-10 bg-[#edf1f7] border-[#dde3eb] rounded-xl disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Grade Level"}),e.jsxs("div",{className:"relative",children:[e.jsx(k,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.grade||"",onChange:a=>t({...s,grade:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(h,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.section||"",onChange:a=>t({...s,section:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-rose-600 rounded-full"}),"Leaderboard Overview"]}),z?e.jsx("div",{className:"rounded-lg border border-[#dde3eb] bg-white p-4 text-sm font-body text-[#5a6578]",children:"Loading leaderboard data..."}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"rounded-lg border border-rose-200 bg-rose-50 p-3",children:[e.jsx("p",{className:"text-xs font-body font-semibold text-rose-700 uppercase tracking-wider",children:"Your Rank"}),e.jsx("p",{className:"text-2xl font-display font-bold text-rose-800 mt-1",children:y>0?`#${y}`:"Unranked"})]}),e.jsxs("div",{className:"rounded-lg border border-sky-200 bg-sky-50 p-3",children:[e.jsx("p",{className:"text-xs font-body font-semibold text-sky-700 uppercase tracking-wider",children:"Total XP"}),e.jsx("p",{className:"text-2xl font-display font-bold text-sky-800 mt-1",children:j?.xp??0})]}),e.jsxs("div",{className:"rounded-lg border border-emerald-200 bg-emerald-50 p-3",children:[e.jsx("p",{className:"text-xs font-body font-semibold text-emerald-700 uppercase tracking-wider",children:"Level"}),e.jsx("p",{className:"text-2xl font-display font-bold text-emerald-800 mt-1",children:j?.level??"-"})]})]}),e.jsxs("div",{className:"rounded-lg border border-[#dde3eb] bg-white overflow-hidden",children:[e.jsx("div",{className:"px-4 py-2 border-b border-[#dde3eb] bg-[#f7f9fc]",children:e.jsx("p",{className:"text-xs font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Top Students"})}),e.jsx("div",{className:"divide-y divide-[#edf1f7]",children:m.length>0?m.map(a=>e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-[#edf1f7] text-[#0a1628] text-xs font-display font-bold flex items-center justify-center",children:a.rank}),e.jsxs("p",{className:"text-sm font-body font-semibold text-[#0a1628] truncate",children:[a.name,a.userId===s.uid?" (You)":""]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-sm font-body font-semibold text-[#0a1628]",children:[a.xp," XP"]}),e.jsxs("p",{className:"text-xs font-body text-[#5a6578]",children:["Lv ",a.level]})]})]},a.userId)):e.jsx("div",{className:"px-4 py-6 text-center text-sm font-body text-[#5a6578]",children:"No leaderboard data available yet."})})]})]})]})]}),s.role==="teacher"&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-rose-500 rounded-full"}),"Teaching Information"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Teacher ID"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.teacherId||"",onChange:a=>t({...s,teacherId:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Subject/Specialization"}),e.jsxs("div",{className:"relative",children:[e.jsx(k,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.subject||"",onChange:a=>t({...s,subject:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Years of Experience"}),e.jsxs("div",{className:"relative",children:[e.jsx(F,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.yearsOfExperience||"",onChange:a=>t({...s,yearsOfExperience:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Qualification"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.qualification||"",onChange:a=>t({...s,qualification:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]}),s.role==="admin"&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-display font-bold text-[#0a1628] mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-4 bg-rose-600 rounded-full"}),"Administrative Information"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Admin ID"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.adminId||"",onChange:a=>t({...s,adminId:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Position/Title"}),e.jsxs("div",{className:"relative",children:[e.jsx(h,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.position||"",onChange:a=>t({...s,position:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-[#5a6578] mb-2 uppercase tracking-wider",children:"Access Level/Permissions"}),e.jsxs("div",{className:"relative",children:[e.jsx(U,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),e.jsx(l,{value:s.permissions||"",onChange:a=>t({...s,permissions:a.target.value}),disabled:!d,className:"pl-10 bg-white border-[#dde3eb] rounded-lg font-body text-[#0a1628] focus:border-sky-400 focus:ring-sky-400/20 disabled:opacity-100 disabled:cursor-default"})]})]})]})]})]})]}),e.jsx("div",{className:"border-t border-[#dde3eb] p-5 bg-[#edf1f7]",children:e.jsx("div",{className:"flex gap-3 justify-end",children:d?e.jsxs(e.Fragment,{children:[e.jsx(c,{onClick:E,variant:"outline",className:"px-5 py-2 rounded-lg border-[#d1cec6] hover:bg-white font-body font-medium text-[#5a6578]",children:"Cancel"}),e.jsxs(c,{onClick:L,className:"px-5 py-2 rounded-lg bg-sky-600 hover:bg-sky-700 text-white font-body font-semibold flex items-center gap-2",children:[e.jsx(_,{size:16}),"Save Changes"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{onClick:n,variant:"outline",className:"px-5 py-2 rounded-lg border-[#d1cec6] hover:bg-white font-body font-medium text-[#5a6578]",children:"Close"}),e.jsx(c,{onClick:()=>x(!0),className:"px-5 py-2 rounded-lg bg-sky-600 hover:bg-sky-700 text-white font-body font-semibold",children:"Edit Profile"})]})})})]})})]})})};export{de as default};
assets/RewardsModal-D00rO2Ia.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as e}from"./vendor-react-CCIuKUIB.js";import{X as h,aA as o,am as d,aj as n,al as f,a as g,Z as j,U as u,T as N}from"./index-Cq4H6CKS.js";import{T as v}from"./target-D136l6Dz.js";import{A as w}from"./award-GuQ4hvnk.js";import{C as y}from"./calendar-Ac41aFLD.js";import"./vendor-firebase-CG7e86Dp.js";import"./vendor-radix-BAHZvx1W.js";const B=({isOpen:c,onClose:a,userLevel:t,currentXP:i,xpToNextLevel:r,totalXP:x,streak:m})=>{if(!c)return null;const b=[{id:"1",icon:d,title:"First Steps",description:"Complete your first video lesson",unlocked:!0,color:"text-[#9956DE]",bgColor:"bg-[#FB96BB]/20"},{id:"2",icon:f,title:"Quiz Master",description:"Score 100% on any quiz",unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"3",icon:n,title:"Week Warrior",description:"Maintain a 7-day login streak",progress:2,total:7,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"4",icon:v,title:"Practice Makes Perfect",description:"Complete 10 practice sets",progress:2,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"5",icon:g,title:"Knowledge Seeker",description:"Watch 20 video lessons",unlocked:!0,color:"text-[#1FA7E1]",bgColor:"bg-[#6ED1CF]/20"},{id:"6",icon:j,title:"Speed Learner",description:"Complete 5 lessons in one day",unlocked:!0,color:"text-[#FFB356]",bgColor:"bg-[#FFB356]/20"},{id:"7",icon:o,title:"Crown Achiever",description:"Reach Level 10",progress:4,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"8",icon:w,title:"XP Hunter",description:"Earn 1000 XP",unlocked:!0,color:"text-[#7274ED]",bgColor:"bg-[#7274ED]/15"},{id:"9",icon:y,title:"Dedicated Learner",description:"Maintain a 14-day streak",progress:2,total:14,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"10",icon:u,title:"Monthly Champion",description:"Maintain a 30-day streak",progress:2,total:30,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"}],p=[{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 login streak",xp:25}];return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:a}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[85vh] overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-6 text-white relative overflow-hidden",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-2xl font-display font-bold",children:"Rewards & Achievements"}),e.jsx("p",{className:"text-white/90 text-sm font-body",children:"Track your learning progress and unlock badges"})]}),e.jsx("button",{onClick:a,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(h,{size:24})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 relative z-10",children:[e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(o,{size:18,className:"text-[#FFB356]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Level"})]}),e.jsx("p",{className:"text-2xl font-bold",children:t})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(d,{size:18,className:"text-[#6ED1CF]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),e.jsx("p",{className:"text-2xl font-bold",children:x.toLocaleString()})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(n,{size:18,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Day Streak"})]}),e.jsxs("p",{className:"text-2xl font-bold",children:[m," days"]})]})]}),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 ",t]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",t+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:[i," / ",r," 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",style:{width:`${i/r*100}%`}})})]})]})]}),e.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(85vh-280px)]",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-2 gap-3",children:b.map(s=>{const l=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(l,{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&&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",style:{width:`${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(N,{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-2 gap-2",children:p.map((s,l)=>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"]})]},l))})]})]})]})]})};export{B as default};
assets/ScientificCalculator-Cik6PszE.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{r as o,j as e}from"./vendor-react-CCIuKUIB.js";import{c as Z,N as de,K as U,m as ue,X as fe}from"./index-Cq4H6CKS.js";import{C as be,a as pe}from"./chevron-up-Dy93ceTz.js";import"./vendor-firebase-CG7e86Dp.js";import"./vendor-radix-BAHZvx1W.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const xe=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],me=Z("grip-horizontal",xe);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ge=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],ve=Z("keyboard",ge);function ye(a){const f=[];let n=0;for(;n<a.length;){const s=a[n];if(s===" "){n++;continue}if(s==="-"){const d=f[f.length-1];if(!d||["+","-","ร—","รท","*","/","%","^","("].includes(d)){const b=a[n+1];if(b&&(/\d/.test(b)||b===".")){let p="-";for(n++;n<a.length&&/[\d.]/.test(a[n]);)p+=a[n],n++;if(n<a.length&&(a[n]==="e"||a[n]==="E")&&n+1<a.length&&/[\d+-]/.test(a[n+1]))for(p+=a[n],n++,(a[n]==="+"||a[n]==="-")&&(p+=a[n],n++);n<a.length&&/\d/.test(a[n]);)p+=a[n],n++;f.push(p);continue}f.push("neg"),n++;continue}}if(/\d/.test(s)||s==="."&&n+1<a.length&&/\d/.test(a[n+1])){let d="";for(;n<a.length&&/[\d.]/.test(a[n]);)d+=a[n],n++;if(n<a.length&&(a[n]==="e"||a[n]==="E")&&n+1<a.length&&/[\d+-]/.test(a[n+1]))for(d+=a[n],n++,(a[n]==="+"||a[n]==="-")&&(d+=a[n],n++);n<a.length&&/\d/.test(a[n]);)d+=a[n],n++;f.push(d);continue}if(/[a-zA-Zฯ€]/.test(s)){let d="";for(;n<a.length&&/[a-zA-Zฯ€โปยน]/.test(a[n]);)d+=a[n],n++;f.push(d);continue}f.push(s),n++}return f}function je(a,f){const n=[],s=[],d={"+":1,"-":1,"ร—":2,"รท":2,"*":2,"/":2,"%":2,"^":4},g=new Set(["^"]),b=new Set(["sin","cos","tan","asin","acos","atan","sinh","cosh","tanh","log","ln","sqrt","cbrt","abs","factorial","nroot","tenPow","ePow","neg"]),p=[];for(let l=0;l<a.length;l++){const u=a[l];if(l>0){const x=p[p.length-1],y=x===")"||x==="ฯ€"||x==="e"||x==="Ans"||/^\d/.test(x),N=u==="("||u==="ฯ€"||u==="e"||u==="Ans"||b.has(u)||/^\d/.test(u);y&&N&&p.push("ร—")}p.push(u)}for(const l of p)if(/^-?[\d.]+([eE][+-]?\d+)?$/.test(l))n.push(l);else if(l==="ฯ€")n.push(String(Math.PI));else if(l==="e"&&!b.has(l))n.push(String(Math.E));else if(l==="Ans")n.push("__ANS__");else if(b.has(l))s.push(l);else if(l==="(")s.push(l);else if(l===")"){for(;s.length&&s[s.length-1]!=="(";)n.push(s.pop());s.pop(),s.length&&b.has(s[s.length-1])&&n.push(s.pop())}else if(l in d){const u=d[l];for(;s.length&&s[s.length-1]!=="("&&s[s.length-1]in d&&(d[s[s.length-1]]>u||d[s[s.length-1]]===u&&!g.has(l));)n.push(s.pop());s.push(l)}for(;s.length;)n.push(s.pop());return n}function we(a){if(a<0||!Number.isInteger(a))return NaN;if(a>170)return 1/0;let f=1;for(let n=2;n<=a;n++)f*=n;return f}function Ne(a){return a*Math.PI/180}function ke(a){return a*180/Math.PI}function Ae(a,f,n){const s=[],d=f==="DEG"?Ne:b=>b,g=f==="DEG"?ke:b=>b;for(const b of a){if(b==="__ANS__"){s.push(n);continue}const p=parseFloat(b);if(!isNaN(p)&&/^-?[\d.]+([eE][+-]?\d+)?$/.test(b)){s.push(p);continue}if(["+","-","ร—","รท","*","/","^","%"].includes(b)){const u=s.pop(),x=s.pop();switch(b){case"+":s.push(x+u);break;case"-":s.push(x-u);break;case"ร—":case"*":s.push(x*u);break;case"รท":case"/":if(u===0){s.push(NaN);break}s.push(x/u);break;case"^":s.push(Math.pow(x,u));break;case"%":s.push(x*u/100);break}continue}const l=s.pop();switch(b){case"sin":s.push(Math.sin(d(l)));break;case"cos":s.push(Math.cos(d(l)));break;case"tan":{const u=d(l);if(Math.abs(Math.cos(u))<1e-15){s.push(NaN);break}s.push(Math.tan(u));break}case"asin":if(l<-1||l>1){s.push(NaN);break}s.push(g(Math.asin(l)));break;case"acos":if(l<-1||l>1){s.push(NaN);break}s.push(g(Math.acos(l)));break;case"atan":s.push(g(Math.atan(l)));break;case"sinh":s.push(Math.sinh(l));break;case"cosh":s.push(Math.cosh(l));break;case"tanh":s.push(Math.tanh(l));break;case"log":s.push(l<=0?NaN:Math.log10(l));break;case"ln":s.push(l<=0?NaN:Math.log(l));break;case"sqrt":s.push(l<0?NaN:Math.sqrt(l));break;case"cbrt":s.push(Math.cbrt(l));break;case"abs":s.push(Math.abs(l));break;case"factorial":s.push(we(l));break;case"tenPow":s.push(Math.pow(10,l));break;case"ePow":s.push(Math.exp(l));break;case"neg":s.push(-l);break;case"nroot":{const u=s.pop();s.push(Math.pow(u,1/l));break}default:s.push(NaN)}}return s.length===1?s[0]:NaN}function Ee(a){let f=0;for(const n of a)n==="("?f++:n===")"&&f--;return a+")".repeat(Math.max(0,f))}function Se(a){if(!isFinite(a))return isNaN(a)?"Math Error":a>0?"โˆž":"-โˆž";if(Number.isInteger(a)&&Math.abs(a)<1e15)return a.toString();if(Math.abs(a)>=1e10||Math.abs(a)<1e-10&&a!==0)return a.toExponential(6);const f=a.toPrecision(10);return parseFloat(f).toString()}function De(a,f,n){try{const s=Ee(a),d=ye(s);if(d.length===0)return"0";const g=je(d,f),b=Ae(g,f,n);return Se(b)}catch{return"Error"}}const Pe=({isOpen:a,onClose:f,inline:n=!1})=>{const[s,d]=o.useState(""),[g,b]=o.useState("0"),[p,l]=o.useState(""),[u,x]=o.useState("DEG"),[y,N]=o.useState(!1),[R,T]=o.useState(!1),[k,J]=o.useState(0),[M,Q]=o.useState([]),[O,A]=o.useState(!1),[P,H]=o.useState(!1),[j,E]=o.useState(null),[w,ee]=o.useState(()=>{try{return localStorage.getItem("mathpulse_calc_minimized")==="true"}catch{return!1}}),[V,q]=o.useState(!1),[te,se]=o.useState(!1),C=o.useRef(null),z=o.useRef(null),X=o.useRef(!1),[S,I]=o.useState({x:0,y:0});o.useEffect(()=>{a&&I({x:Math.round((window.innerWidth-380)/2),y:Math.max(20,Math.round((window.innerHeight-600)/2))})},[a]),o.useEffect(()=>{try{localStorage.setItem("mathpulse_calc_minimized",String(w))}catch{}},[w]),o.useEffect(()=>{C.current&&(C.current.scrollLeft=C.current.scrollWidth)},[s]),o.useEffect(()=>{const r=c=>{z.current&&!z.current.contains(c.target)&&q(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]),o.useEffect(()=>{if(!a)return;const r=c=>{if(!V)return;const t=c.key;if(c.altKey){if(c.preventDefault(),c.shiftKey){if(t==="S"||t==="s"){h("asin");return}if(t==="C"||t==="c"){h("acos");return}if(t==="T"||t==="t"){h("atan");return}}if(t==="s"||t==="S"){h("sin");return}if(t==="c"||t==="C"){h("cos");return}if(t==="t"||t==="T"){h("tan");return}if(t==="l"||t==="L"){h("log");return}if(t==="n"||t==="N"){h("ln");return}if(t==="r"||t==="R"){h("sqrt");return}if(t==="p"||t==="P"){i("ฯ€");return}if(t==="e"||t==="E"){i("e");return}if(t==="2"){i("ยฒ");return}if(t==="3"){i("ยณ");return}if(t==="^"||t==="6"){i("^");return}if(t==="a"||t==="A"){i("Ans");return}if(t==="d"||t==="D"){K();return}return}c.stopPropagation(),/^[0-9.]$/.test(t)?(i(t),c.preventDefault()):t==="+"?(i("+"),c.preventDefault()):t==="-"?(i("-"),c.preventDefault()):t==="*"?(i("ร—"),c.preventDefault()):t==="/"?(i("รท"),c.preventDefault()):t==="%"?(i("%"),c.preventDefault()):t==="("?(i("("),c.preventDefault()):t===")"?(i(")"),c.preventDefault()):t==="^"?(i("^"),c.preventDefault()):t==="Enter"||t==="="?(G(),c.preventDefault()):t==="Backspace"?(_(),c.preventDefault()):(t==="Escape"||t==="Delete")&&(B(),c.preventDefault())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[a,V,s,k,u]);const i=o.useCallback(r=>{A(!1),E(null),d(c=>c+r)},[]),h=o.useCallback(r=>{A(!1),E(null),d(c=>c+r+"("),N(!1)},[]),_=o.useCallback(()=>{d(r=>r.slice(0,-1)),A(!1)},[]),B=o.useCallback(()=>{d(""),b("0"),l(""),A(!1),E(null)},[]),G=o.useCallback(()=>{if(!s.trim())return;const r=De(s,u,k),c=r==="Error"||r==="Math Error";if(A(c),b(r),!c){const t=parseFloat(r);isNaN(t)||J(t),Q(m=>[...m.slice(-19),{expression:s,result:r}]),l(s+" =")}d("")},[s,u,k]),K=o.useCallback(()=>{x(r=>r==="DEG"?"RAD":"DEG")},[]),ae=o.useCallback(()=>{N(r=>!r),T(!1)},[]),ne=o.useCallback(()=>{T(r=>!r),N(!1)},[]),le=o.useCallback(()=>{i("Ans")},[i]),W=o.useCallback(()=>{i("ร—10^")},[i]),ie=o.useCallback(async()=>{const r=s.trim()||(M.length>0?M[M.length-1].expression:"");if(r){H(!0);try{const c=r.replace(/ร—/g,"*").replace(/รท/g,"/").replace(/ฯ€/g,"pi").replace(/Ans/g,String(k)).replace(/(\d)\(/g,"$1*(").replace(/\)(\d)/g,")*$1"),t=await de.evaluateExpression(c);E(t)}catch{E({expression:r,result:"Verification unavailable",steps:["Backend unavailable โ€” using client-side result"],simplified:null,latex:null})}finally{H(!1)}}},[s,M,k]),re=[[{label:"SHIFT",action:ae,variant:"shift"},{label:"ALPHA",action:ne,variant:"shift"},{label:u,action:K,variant:"mode"},{label:"โ—€",action:()=>{_()},variant:"mode"},{label:"โ–ถ",action:()=>{i(" ")},variant:"mode"}],[{label:"xยฒ",shiftLabel:"โˆš",action:()=>i("^2"),shiftAction:()=>h("sqrt"),variant:"func"},{label:"xยณ",shiftLabel:"ยณโˆš",action:()=>i("^3"),shiftAction:()=>h("cbrt"),variant:"func"},{label:"xสธ",shiftLabel:"สธโˆšx",action:()=>i("^"),shiftAction:()=>h("nroot"),variant:"func"},{label:"log",shiftLabel:"10หฃ",action:()=>h("log"),shiftAction:()=>h("tenPow"),variant:"func"},{label:"ln",shiftLabel:"eหฃ",action:()=>h("ln"),shiftAction:()=>h("ePow"),variant:"func"}],[{label:"โˆš",shiftLabel:"xยฒ",action:()=>h("sqrt"),shiftAction:()=>i("^2"),variant:"func"},{label:"ยณโˆš",shiftLabel:"xยณ",action:()=>h("cbrt"),shiftAction:()=>i("^3"),variant:"func"},{label:"สธโˆšx",shiftLabel:"xสธ",action:()=>h("nroot"),shiftAction:()=>i("^"),variant:"func"},{label:"sin",shiftLabel:"sinโปยน",action:()=>h("sin"),shiftAction:()=>h("asin"),variant:"func"},{label:"cos",shiftLabel:"cosโปยน",action:()=>h("cos"),shiftAction:()=>h("acos"),variant:"func"}],[{label:"tan",shiftLabel:"tanโปยน",action:()=>h("tan"),shiftAction:()=>h("atan"),variant:"func"},{label:"sinโปยน",shiftLabel:"sinh",action:()=>h("asin"),shiftAction:()=>h("sinh"),variant:"func"},{label:"cosโปยน",shiftLabel:"cosh",action:()=>h("acos"),shiftAction:()=>h("cosh"),variant:"func"},{label:"tanโปยน",shiftLabel:"tanh",action:()=>h("atan"),shiftAction:()=>h("tanh"),variant:"func"},{label:"ฯ€",action:()=>i("ฯ€"),variant:"func"}],[{label:"(",action:()=>i("("),variant:"func"},{label:")",action:()=>i(")"),variant:"func"},{label:"e",action:()=>i("e"),variant:"func"},{label:"EXP",action:W,variant:"func"},{label:"%",action:()=>i("%"),variant:"func"}],[{label:"7",action:()=>i("7"),variant:"number"},{label:"8",action:()=>i("8"),variant:"number"},{label:"9",action:()=>i("9"),variant:"number"},{label:"DEL",action:_,variant:"del"},{label:"AC",action:B,variant:"del"}],[{label:"4",action:()=>i("4"),variant:"number"},{label:"5",action:()=>i("5"),variant:"number"},{label:"6",action:()=>i("6"),variant:"number"},{label:"ร—",action:()=>i("ร—"),variant:"op"},{label:"รท",action:()=>i("รท"),variant:"op"}],[{label:"1",action:()=>i("1"),variant:"number"},{label:"2",action:()=>i("2"),variant:"number"},{label:"3",action:()=>i("3"),variant:"number"},{label:"+",action:()=>i("+"),variant:"op"},{label:"โˆ’",action:()=>i("-"),variant:"op"}],[{label:"0",action:()=>i("0"),variant:"number"},{label:".",action:()=>i("."),variant:"number"},{label:"ร—10หฃ",action:W,variant:"func"},{label:"Ans",action:le,variant:"op"},{label:"=",action:G,variant:"equals"}]],ce=(r,c)=>{const t="flex items-center justify-center rounded-2xl font-bold transition-all duration-150 active:scale-95 select-none cursor-pointer touch-manipulation relative overflow-hidden",m="min-h-[56px] text-[16px]",v="min-h-[56px] text-[14px]";switch(r){case"number":return`${t} ${m} bg-white hover:bg-[#edf1f7] text-[#0a1628] border border-[#dde3eb] shadow-sm`;case"op":return`${t} ${m} bg-[#edf1f7] hover:bg-[#dde3eb] text-[#7274ED] border border-[#dde3eb] shadow-sm font-bold`;case"func":return`${t} ${v} bg-[#9956DE] hover:bg-[#8A4DCA] text-white shadow-md shadow-[#9956DE]/20`;case"del":return`${t} ${m} ${c==="AC"?"bg-[#FF8B8B] hover:bg-[#FF7373]":"bg-[#FB96BB] hover:bg-[#FA7DA9]"} text-[#8A1A1A] shadow-md shadow-red-900/10 font-bold border-none`;case"equals":return`${t} ${m} bg-[#1FA7E1] hover:bg-[#1C96CB] text-white shadow-lg shadow-[#1FA7E1]/30 font-bold text-lg`;case"shift":return`${t} ${v} bg-white hover:bg-[#edf1f7] text-[#9956DE] border border-[#dde3eb] shadow-sm font-bold uppercase tracking-wider text-[11px]`;case"mode":return`${t} ${v} bg-white hover:bg-[#edf1f7] text-[#1FA7E1] border border-[#dde3eb] shadow-sm font-bold`;default:return`${t} ${m} bg-slate-100 text-[#0a1628] border border-slate-200`}},oe=o.useCallback(r=>{r.preventDefault(),X.current=!0;const c=r.clientX,t=r.clientY,m=S.x,v=S.y,L=D=>{const $=m+(D.clientX-c),he=v+(D.clientY-t);I({x:$,y:he})},F=D=>{X.current=!1;const $={x:m+(D.clientX-c),y:v+(D.clientY-t)};I($);try{localStorage.setItem("mathpulse_calc_position",JSON.stringify($))}catch{}document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",F)};document.addEventListener("mousemove",L),document.addEventListener("mouseup",F)},[S]);if(!a)return null;const Y=e.jsxs("div",{className:"flex flex-col w-full select-none",children:[e.jsxs("div",{className:"bg-white rounded-t-2xl p-4 border border-slate-200 border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("span",{className:`
12
+ text-[10px] font-bold px-2 py-0.5 rounded-full
13
+ ${u==="DEG"?"bg-rose-500/20 text-rose-400 border border-sky-500/30":"bg-rose-500/20 text-rose-400 border border-rose-500/30"}
14
+ `,children:u}),y&&e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-[#6ED1CF]/30 text-[#1FA7E1] border border-[#1FA7E1]/40 animate-pulse",children:"SHIFT"}),R&&e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-sky-500/20 text-sky-400 border border-indigo-500/30",children:"ALPHA"}),P&&e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-sky-500/20 text-sky-400 border border-sky-500/30 animate-pulse",children:"Verifyingโ€ฆ"})]}),e.jsx("div",{ref:C,className:"text-right text-slate-500 text-[14px] font-mono h-6 overflow-x-auto overflow-y-hidden whitespace-nowrap scrollbar-hide",children:p||"ย "}),e.jsx("div",{className:`
15
+ text-right font-mono font-bold text-[32px] leading-tight h-10 overflow-hidden whitespace-nowrap
16
+ ${O?"text-red-400":"text-[#0a1628]"}
17
+ `,children:s||g}),e.jsx(U,{children:j&&e.jsxs(ue.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-2 pt-2 border-t border-slate-300",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-sky-400"}),e.jsx("span",{className:"text-[10px] text-rose-400 font-semibold uppercase tracking-wider",children:"SymPy Verified"})]}),e.jsx("p",{className:"text-xs text-slate-500 font-mono",children:j.result}),j.latex&&e.jsxs("p",{className:"text-[10px] text-[#5a6578] font-mono mt-0.5",children:["LaTeX: ",j.latex]}),j.steps.length>1&&e.jsx("div",{className:"mt-1 space-y-0.5",children:j.steps.slice(1).map((r,c)=>e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:r},c))})]})})]}),e.jsxs("button",{onClick:ie,disabled:P,className:`
18
+ w-full py-1.5 bg-slate-50 border-x border-slate-200
19
+ text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:bg-slate-100
20
+ transition-colors disabled:opacity-50 disabled:cursor-not-allowed
21
+ flex items-center justify-center gap-1.5
22
+ `,children:[e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),P?"Verifying with SymPyโ€ฆ":"Verify with SymPy"]}),e.jsx("div",{className:"bg-white rounded-b-2xl p-4 border border-slate-200 border-t-0 space-y-1.5",children:re.map((r,c)=>e.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:r.map((t,m)=>{const v=y&&t.shiftAction,L=v&&t.shiftLabel||t.label,F=v?t.shiftAction:t.action;return e.jsxs("button",{onClick:F,className:`
23
+ ${ce(t.variant,t.label)}
24
+ ${t.variant==="shift"&&t.label==="SHIFT"&&y?"!bg-[#6ED1CF]/35 !text-[#1FA7E1] ring-2 ring-[#1FA7E1]/35 border-[#1FA7E1]/30":""}
25
+ ${t.variant==="shift"&&t.label==="ALPHA"&&R?"!bg-[#7274ED] !text-white ring-2 ring-[#9956DE]/50":""}
26
+ ${t.colSpan?`col-span-${t.colSpan}`:""}
27
+ ${v&&t.variant==="func"?"!bg-gradient-to-br !from-[#6ED1CF] !to-[#1FA7E1] hover:!from-[#8FE4DA] hover:!to-[#49BDEB] !text-white shadow-md shadow-[#1FA7E1]/20":""}
28
+ ${t.variant==="op"&&!["DEL","AC"].includes(t.label)?"bg-gradient-to-br from-[#FFB356] to-[#FF8B8B] !text-white font-bold shadow-md":""}
29
+ relative
30
+ `,title:t.shiftLabel?`SHIFT: ${t.shiftLabel}`:void 0,children:[t.shiftLabel&&!y&&e.jsx("span",{className:"absolute top-1 right-1 text-[10px] leading-none bg-white/95 text-[#9956DE] font-black px-1.5 py-0.5 rounded-md shadow-sm",children:t.shiftLabel}),e.jsx("span",{className:v?"text-[#EAFBFF]":"",children:L})]},m)})},c))}),te&&e.jsx("div",{className:"bg-slate-50 border-t border-slate-200 text-xs text-slate-500 p-3 rounded-b-2xl",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+S"}),e.jsx("span",{children:"sin("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+S"}),e.jsx("span",{children:"sinโปยน("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+C"}),e.jsx("span",{children:"cos("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+C"}),e.jsx("span",{children:"cosโปยน("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+T"}),e.jsx("span",{children:"tan("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+Shift+T"}),e.jsx("span",{children:"tanโปยน("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+L"}),e.jsx("span",{children:"log("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+N"}),e.jsx("span",{children:"ln("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+R"}),e.jsx("span",{children:"โˆš("})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+P"}),e.jsx("span",{children:"ฯ€"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+E"}),e.jsx("span",{children:"e"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+2"}),e.jsx("span",{children:"ยฒ"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+3"}),e.jsx("span",{children:"ยณ"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+^"}),e.jsx("span",{children:"^"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+A"}),e.jsx("span",{children:"Ans"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[#5a6578]",children:"Alt+D"}),e.jsx("span",{children:"DEG/RAD"})]})]})})]});return n?Y:e.jsx(U,{children:a&&e.jsxs("div",{ref:z,className:"fixed z-50",style:{top:S.y,left:S.x,width:380},onClick:()=>q(!0),children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 rounded-t-2xl px-4 py-2.5 flex items-center justify-between",style:{cursor:"move"},onMouseDown:oe,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(me,{size:14,className:"text-white/50"}),e.jsx("h3",{className:"text-white font-bold text-sm",children:"Scientific Calculator"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>se(r=>!r),className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",title:"Keyboard shortcuts",children:e.jsx(ve,{size:14,className:"text-white"})}),e.jsx("button",{onClick:()=>ee(!w),className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",children:w?e.jsx(be,{size:14,className:"text-white"}):e.jsx(pe,{size:14,className:"text-white"})}),e.jsx("button",{onClick:f,className:"p-1.5 rounded-lg hover:bg-slate-200/70 transition-colors",children:e.jsx(fe,{size:14,className:"text-white"})})]})]}),!w&&Y,w&&e.jsx("div",{className:"bg-slate-50 rounded-b-2xl p-3 border border-slate-200 border-t-0",children:e.jsx("p",{className:"text-right text-[#0a1628] font-mono font-bold text-lg",children:g})})]})})};export{Pe as default};
assets/SettingsModal-izOy98SM.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{j as e,r as i}from"./vendor-react-CCIuKUIB.js";import{c as te,ae as W,a6 as be,af as fe,K as pe,m as S,X as Y,aa as ye,ag as ge,O as c}from"./index-Cq4H6CKS.js";import{B as x}from"./button-MTmjd5-I.js";import{I as l}from"./input-DLYpRUYd.js";import{u as je,v as Ne}from"./vendor-radix-BAHZvx1W.js";import Z from"./ConfirmModal-BCd_bhv9.js";import{U as ve}from"./user-CJxrpn3Q.js";import{G as ke}from"./globe-DGPprHYb.js";import{D as ee}from"./download-DsF2wqhl.js";import{L as we}from"./lock-Cn8nsuCQ.js";import{T as Ce}from"./trash-2-CPr8I1eG.js";import"./vendor-firebase-CG7e86Dp.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Se=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],Ee=te("palette",Se);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ze=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Pe=te("smartphone",ze);function m({className:h,...f}){return e.jsx(je,{"data-slot":"switch",className:W("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",h),...f,children:e.jsx(Ne,{"data-slot":"switch-thumb",className:W("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const F=()=>JSON.parse(JSON.stringify(ge)),Ge=({isOpen:h,onClose:f,profileData:o,onSave:I,settingsData:v,onSaveSettings:L,onApplySettingsPreview:N,onUpdatePassword:E,onExportData:O,onClearCache:H,onDeleteAccount:z,onResetData:k})=>{const[u,se]=i.useState("account"),[a,d]=i.useState({}),[n,U]=i.useState(F()),[P,G]=i.useState(!1),[y,_]=i.useState(!1),[A,Q]=i.useState(!1),[R,V]=i.useState(!1),[g,X]=i.useState(!1),[ae,w]=i.useState(!1),[ne,C]=i.useState(!1),[re,j]=i.useState(!1),[b,J]=i.useState(!1),[B,p]=i.useState(""),T=i.useRef(!1),M=i.useRef(F());i.useEffect(()=>{if(!h){T.current=!1;return}if(T.current)return;T.current=!0;const t=v?JSON.parse(JSON.stringify(v)):F();M.current=t,d({uid:o?.uid,name:o?.name||"",email:o?.email||"",phone:o?.phone||"",photo:o?.photo||"",avatarLayers:o?.avatarLayers,role:o?.role,lrn:o?.lrn||"",grade:o?.grade||"",section:o?.section||"",school:o?.school||"",department:o?.department||"",subject:o?.subject||"",yearsOfExperience:o?.yearsOfExperience||"",qualification:o?.qualification||"",position:o?.position||""}),U(t)},[h,o,v]),i.useEffect(()=>{h&&N?.(n)},[h,n,N]),i.useEffect(()=>{if(!h)return;const t=s=>{s.key==="Escape"&&(N?.(M.current),f())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[h,f,N,v]);const K=i.useMemo(()=>[{id:"account",label:"Account",icon:ve},{id:"notifications",label:"Notifications",icon:be},{id:"appearance",label:"Appearance",icon:Ee},{id:"privacy",label:"Privacy & Security",icon:fe},{id:"learning",label:"Learning",icon:ke},{id:"data",label:"Data & Storage",icon:ee}],[]),r=t=>{U(s=>t(s))},ie=async()=>{G(!0);try{I&&await I(a),L&&await L(n),f()}catch(t){console.error("Error saving settings:",t),c.error(t instanceof Error?t.message:"Failed to save settings")}finally{G(!1)}},q=()=>{w(!1),C(!1),j(!1),p(""),N?.(M.current),f()},le=()=>{!k||y||w(!0)},oe=async()=>{if(!(!k||y)){w(!1),_(!0);try{await k(),c.success("Testing data reset completed")}catch(t){console.error("Error resetting testing data:",t),c.error(t instanceof Error?t.message:"Failed to reset testing data")}finally{_(!1)}}},ce=async()=>{if(!E){c.info("Password update is not available in this environment.");return}p(""),j(!0)},$=async()=>{if(!E||b)return;const t=B.trim();if(!t){c.error("Password is required.");return}if(t.length<8){c.error("Password must be at least 8 characters long.");return}J(!0);try{await E(t),c.success("Password updated successfully."),j(!1),p("")}catch(s){console.error("Error updating password:",s),c.error(s instanceof Error?s.message:"Failed to update password")}finally{J(!1)}},de=()=>{c.info("Two-factor authentication setup is not enabled for this project yet.")},xe=async()=>{if(!O||A){c.info("Data export is not available right now.");return}Q(!0);try{await O()}catch(t){console.error("Error exporting data:",t),c.error(t instanceof Error?t.message:"Failed to export data")}finally{Q(!1)}},me=async()=>{if(!H||R){c.info("Cache clearing is not available right now.");return}V(!0);try{await H()}catch(t){console.error("Error clearing cache:",t),c.error(t instanceof Error?t.message:"Failed to clear cache")}finally{V(!1)}},he=()=>{if(!z||g){c.info("Account deletion is not available right now.");return}C(!0)},ue=async()=>{if(!(!z||g)){C(!1),X(!0);try{await z(),f()}catch(t){console.error("Error deleting account:",t),c.error(t instanceof Error?t.message:"Failed to delete account")}finally{X(!1)}}};return h?e.jsx(pe,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:q,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(S.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-2xl shadow-2xl border border-[#dde3eb] w-full max-w-4xl max-h-[85vh] overflow-hidden flex",children:[e.jsxs("div",{className:"w-64 bg-slate-50 border-r border-slate-200 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:K.map(t=>{const s=t.icon;return e.jsxs("button",{onClick:()=>se(t.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${u===t.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(s,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:t.label})]},t.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628]",children:K.find(t=>t.id===u)?.label}),e.jsx("button",{onClick:q,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(Y,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[u==="account"&&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:"Full Name"}),e.jsx(l,{type:"text",value:a.name||"",onChange:t=>d(s=>({...s,name:t.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:"Email Address"}),e.jsx(l,{type:"email",value:a.email||"",onChange:t=>d(s=>({...s,email:t.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:"Phone Number"}),e.jsx(l,{type:"tel",value:a.phone||"",onChange:t=>d(s=>({...s,phone:t.target.value})),className:"max-w-md"})]}),a.role==="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:"Learner's Reference Number (LRN)"}),e.jsx(l,{type:"text",value:a.lrn||"",onChange:t=>d(s=>({...s,lrn:t.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(l,{type:"text",value:a.grade||"",onChange:t=>d(s=>({...s,grade:t.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(l,{type:"text",value:a.section||"",onChange:t=>d(s=>({...s,section:t.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(l,{type:"text",value:a.school||"",onChange:t=>d(s=>({...s,school:t.target.value})),className:"max-w-md"})]})]}),a.role==="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(l,{type:"text",value:a.department||"",onChange:t=>d(s=>({...s,department:t.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(l,{type:"text",value:a.subject||"",onChange:t=>d(s=>({...s,subject:t.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(l,{type:"text",value:a.yearsOfExperience||"",onChange:t=>d(s=>({...s,yearsOfExperience:t.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:"Qualification"}),e.jsx(l,{type:"text",value:a.qualification||"",onChange:t=>d(s=>({...s,qualification:t.target.value})),className:"max-w-md"})]})]}),a.role==="admin"&&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:"Position"}),e.jsx(l,{type:"text",value:a.position||"",onChange:t=>d(s=>({...s,position:t.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:"Department"}),e.jsx(l,{type:"text",value:a.department||"",onChange:t=>d(s=>({...s,department:t.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:"Role"}),e.jsx(l,{type:"text",value:a.role||"",className:"max-w-md bg-slate-100",disabled:!0})]}),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(x,{variant:"outline",className:"rounded-xl",onClick:ce,children:[e.jsx(we,{size:16,className:"mr-2"}),"Update Password"]})]}),e.jsx("div",{className:"pt-4 border-t border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Two-Factor Authentication"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Add an extra layer of security"})]}),e.jsx(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:de,children:"Enable"})]})})]}),u==="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:"Email Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Receive updates via email"})]}),e.jsx(m,{checked:n.notifications.emailNotifications,onCheckedChange:t=>r(s=>({...s,notifications:{...s.notifications,emailNotifications:t}}))})]}),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(m,{checked:n.notifications.pushNotifications,onCheckedChange:t=>r(s=>({...s,notifications:{...s.notifications,pushNotifications:t}}))})]}),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(m,{checked:n.notifications.soundEnabled,onCheckedChange:t=>r(s=>({...s,notifications:{...s.notifications,soundEnabled:t}}))})]}),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(t=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:n.notifications.notificationTypes[t.key],onChange:s=>r(D=>({...D,notifications:{...D.notifications,notificationTypes:{...D.notifications.notificationTypes,[t.key]:s.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:t.label})]},t.key))})]}),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(ye,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{type:"time",value:n.notifications.quietHours.start,onChange:t=>r(s=>({...s,notifications:{...s.notifications,quietHours:{...s.notifications.quietHours,start:t.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(l,{type:"time",value:n.notifications.quietHours.end,onChange:t=>r(s=>({...s,notifications:{...s.notifications,quietHours:{...s.notifications.quietHours,end:t.target.value}}})),className:"w-32"})]}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"No notifications during this time"})]})]}),u==="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:"Smart invert colors like extension dark mode"})]}),e.jsx(m,{checked:n.appearance.darkMode,onCheckedChange:t=>r(s=>({...s,appearance:{...s.appearance,darkMode:t}}))})]}),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:n.appearance.fontSize,onChange:t=>r(s=>({...s,appearance:{...s.appearance,fontSize:Number(t.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"})]})]}),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(m,{checked:n.appearance.compactView,onCheckedChange:t=>r(s=>({...s,appearance:{...s.appearance,compactView:t}}))})]}),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(m,{checked:n.appearance.reduceAnimations,onCheckedChange:t=>r(s=>({...s,appearance:{...s.appearance,reduceAnimations:t}}))})]})]}),u==="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:n.privacy.profileVisibility,onChange:t=>r(s=>({...s,privacy:{...s.privacy,profileVisibility:t.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(m,{checked:n.privacy.showActivityStatus,onCheckedChange:t=>r(s=>({...s,privacy:{...s.privacy,showActivityStatus:t}}))})]}),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(m,{checked:n.privacy.dataSharing,onCheckedChange:t=>r(s=>({...s,privacy:{...s.privacy,dataSharing:t}}))})]})]}),u==="learning"&&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(l,{type:"number",value:n.learning.dailyXpGoal,onChange:t=>r(s=>({...s,learning:{...s.learning,dailyXpGoal:Number(t.target.value||0)}})),className:"max-w-xs"}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Set your daily learning target"})]}),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:n.learning.preferredStudyTime,onChange:t=>r(s=>({...s,learning:{...s.learning,preferredStudyTime:t.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 - 12AM)"}),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(m,{checked:n.learning.autoPlayLessons,onCheckedChange:t=>r(s=>({...s,learning:{...s.learning,autoPlayLessons:t}}))})]}),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(m,{checked:n.learning.showHints,onCheckedChange:t=>r(s=>({...s,learning:{...s.learning,showHints:t}}))})]}),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:n.learning.quizDifficultyPreference,onChange:t=>r(s=>({...s,learning:{...s.learning,quizDifficultyPreference:t.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(Pe,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(l,{type:"time",value:n.learning.studyReminderTime,onChange:t=>r(s=>({...s,learning:{...s.learning,studyReminderTime:t.target.value}})),className:"w-32"}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Daily reminder to study"})]})]}),u==="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(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:xe,disabled:A,children:[e.jsx(ee,{size:16,className:"mr-2"}),A?"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(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:me,disabled:R,children:R?"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:[(a.role||"student")==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",a.role==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts for retesting.",a.role==="admin"&&"Reset admin testing artifacts like personal audit/content update records for QA loops."]}),e.jsx(x,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!k||y,onClick:le,children:y?"Resetting...":"Reset Testing Data"})]}),a.role==="admin"?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(x,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:he,disabled:g,children:[e.jsx(Ce,{size:16,className:"mr-2"}),g?"Deleting...":"Delete Account"]})]}):e.jsxs("div",{className:"p-4 bg-emerald-50 border border-emerald-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-emerald-900 mb-1 font-body",children:"Protected Account Controls"}),e.jsx("p",{className:"text-xs text-emerald-700",children:"Account deletion is restricted to administrator accounts."})]})]})]}),e.jsxs("div",{className:"p-6 border-t border-[#dde3eb] bg-[#edf1f7] flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"outline",onClick:q,className:"rounded-lg border-[#dde3eb]",disabled:P,children:"Cancel"}),e.jsx(x,{onClick:ie,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white",disabled:P,children:P?"Saving...":"Save Changes"})]})]})]})]})]}),re?e.jsx(S.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:()=>{b||(j(!1),p(""))},children:e.jsxs(S.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:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsx("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:"Update Password"}),e.jsx("button",{onClick:()=>{b||(j(!1),p(""))},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close password update dialog",children:e.jsx(Y,{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 a new password with at least 8 characters."}),e.jsx(l,{type:"password",value:B,onChange:t=>p(t.target.value),placeholder:"New password",autoFocus:!0,onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),$())},disabled:b}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(x,{variant:"outline",onClick:()=>{b||(j(!1),p(""))},disabled:b,children:"Cancel"}),e.jsx(x,{onClick:$,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:b,children:b?"Updating...":"Update Password"})]})]})]})}):null,e.jsx(Z,{isOpen:ae,onClose:()=>{y||w(!1)},onConfirm:oe,title:"Reset Testing Data?",message:`Reset ${a.role||"student"} testing data? This action is for QA/demo use and cannot be undone.`,confirmText:y?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(Z,{isOpen:ne,onClose:()=>{g||C(!1)},onConfirm:ue,title:"Delete Account?",message:"Delete account permanently? This action cannot be undone.",confirmText:g?"Deleting...":"Delete Account",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{Ge as default};
assets/TeacherDashboard-DcIgyxWH.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/award-GuQ4hvnk.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const a=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],e=c("award",a);export{e as A};
assets/button-MTmjd5-I.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as y}from"./vendor-react-CCIuKUIB.js";import{w as k}from"./vendor-radix-BAHZvx1W.js";import{k as V,ae as j}from"./index-Cq4H6CKS.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,p=(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=p("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:j(N({variant:r,size:e,className:n})),...u})}export{w as B};
assets/calendar-Ac41aFLD.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as e}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const t=[["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"}]],a=e("calendar",t);export{a as C};
assets/chevron-up-Dy93ceTz.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as o}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],r=o("chevron-down",n);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const c=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],t=o("chevron-up",c);export{t as C,r as a};
assets/circle-help-DAhx2f50.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],p=c("circle-help",e);export{p as C};
assets/download-DsF2wqhl.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as o}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],a=o("download",e);export{a as D};
assets/eye-B9PLXLcy.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r=c("eye",e);export{r as E};
assets/eye-off-BY4y1x6t.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as e}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const a=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],t=e("eye-off",a);export{t as E};
assets/globe-DGPprHYb.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],a=c("globe",e);export{a as G};
assets/index-5uLcs77G.js DELETED
The diff for this file is too large to render. See raw diff
 
assets/index-B-KaNIwd.css DELETED
The diff for this file is too large to render. See raw diff
 
assets/index-CI58CSTi.css ADDED
The diff for this file is too large to render. See raw diff
 
assets/index-Cq4H6CKS.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/input-DLYpRUYd.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as t}from"./vendor-react-CCIuKUIB.js";import{ae as n}from"./index-Cq4H6CKS.js";function d({className:e,type:i,...r}){return t.jsx("input",{type:i,"data-slot":"input",className:n("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","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",e),...r})}export{d as I};
assets/loader-circle-CqE0ik6T.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=c("loader-circle",e);export{a as L};
assets/lock-Cn8nsuCQ.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],t=c("lock",e);export{t as L};
assets/mail-QgeDysPt.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],t=c("mail",e);export{t as M};
assets/pen-line-B8le4w0F.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],n=c("check",e);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const o=[["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"}]],t=c("pen-line",o);export{n as C,t as P};
assets/plus-BgDJ9brI.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as e}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],c=e("plus",o);export{c as P};
assets/quizService-BJk9Vn4i.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as A,J as i}from"./index-Cq4H6CKS.js";import{e as o,o as d,f,q as z,w as m,p as L,t as b,v as g,m as M,h as r}from"./vendor-firebase-CG7e86Dp.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const D=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],x=A("layers",D);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const I=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],R=A("lightbulb",I),N=e=>{if(!(e instanceof Error))return!1;const t=e.code,s=(e.message||"").toLowerCase();return t==="failed-precondition"&&s.includes("requires an index")},w=e=>{if(!e)return 0;if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;if(typeof e=="string"){const t=Date.parse(e);return Number.isNaN(t)?0:t}if(typeof e=="object"){const t=e;if(typeof t.toMillis=="function")return t.toMillis();if(typeof t.seconds=="number")return t.seconds*1e3}return 0};async function _(e,t,s){const a=s?.documentId?o(i,"generatedQuizzes",s.documentId):o(d(i,"generatedQuizzes")),n={...e,teacherId:t,createdAt:r(),status:"draft"};return s?.documentId?await f(a,n,{merge:!0}):await f(a,n),a.id}async function B(e){await g(o(i,"generatedQuizzes",e),{status:"published",publishedAt:r()})}async function C(e){await M(o(i,"generatedQuizzes",e))}async function j(e,t,s){await g(o(i,"generatedQuizzes",e),{status:"assigned","metadata.assignedTo":t,assignedBy:s,assignedAt:r()});const a=o(d(i,"quizAssignments"));await f(a,{quizId:e,lrn:t,teacherId:s,status:"pending",assignedAt:r(),dueDate:null});const n=o(d(i,"notifications"));await f(n,{userId:t,type:"quiz_assigned",title:"New Quiz Assigned",message:"Your teacher has assigned you a new quiz. Complete it to earn XP!",quizId:e,read:!1,createdAt:r()})}async function E(e){try{const t=z(d(i,"generatedQuizzes"),m("teacherId","==",e),L("createdAt","desc"));return(await b(t)).docs.map(a=>({id:a.id,...a.data()}))}catch(t){if(!N(t))throw t;const s=z(d(i,"generatedQuizzes"),m("teacherId","==",e));return(await b(s)).docs.map(n=>({id:n.id,...n.data()})).sort((n,l)=>w(l.createdAt)-w(n.createdAt))}}async function G(e,t,s,a,n,l,Q,q,p,y){const h=o(d(i,"quizSubmissions"));if(await f(h,{submissionId:h.id,lrn:e,quizId:t,generatedQuizId:s??null,subject:a,source:n,score:l,xpEarned:Q,totalTime:q,answers:p,correctCount:p.filter(c=>c.correct).length,totalQuestions:p.length,questionBreakdown:p.map((c,u)=>({questionId:c.questionId,topic:y[u]?.topic??a,difficulty:y[u]?.difficulty??"medium",bloomLevel:y[u]?.bloomLevel??"understand",correct:c.correct,timeSpent:c.timeSpent})),submittedAt:r()}),s){const c=z(d(i,"quizAssignments"),m("quizId","==",s),m("lrn","==",e)),u=await b(c);for(const k of u.docs)await g(k.ref,{status:"completed",completedAt:r(),score:l});try{await g(o(i,"generatedQuizzes",s),{status:"completed"})}catch{}}}export{R as L,x as a,j as b,G as c,C as d,E as f,B as p,_ as s};
assets/save-DxABtV3B.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as a}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],o=a("save",e);export{o as S};
assets/target-D136l6Dz.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],o=c("target",e);export{o as T};
assets/trash-2-CPr8I1eG.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as e}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const c=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],a=e("trash-2",c);export{a as T};
assets/trending-down-CtpIa5V8.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as n}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const o=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],t=n("funnel",o);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const e=[["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"}]],c=n("trending-down",e);export{t as F,c as T};
assets/user-CJxrpn3Q.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],r=c("user",e);export{r as U};
assets/vendor-firebase-CG7e86Dp.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/vendor-markdown-CBmFCdgC.css ADDED
@@ -0,0 +1 @@
 
 
1
+ @font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.28"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
assets/vendor-markdown-CDZ6ydrN.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/vendor-radix-BAHZvx1W.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/vendor-react-CCIuKUIB.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/video-CeZIu2HZ.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as e}from"./index-Cq4H6CKS.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const t=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],y=e("database",t);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const a=[["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:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],n=e("file-text",a);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const o=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],i=e("info",o);/**
17
+ * @license lucide-react v0.487.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const c=[["path",{d:"M5 12h14",key:"1ays0h"}]],k=e("minus",c);/**
22
+ * @license lucide-react v0.487.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const s=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],p=e("refresh-cw",s);/**
27
+ * @license lucide-react v0.487.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const h=[["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"}]],r=e("video",h);export{y as D,n as F,i as I,k as M,p as R,r as V};
index.html CHANGED
@@ -8,12 +8,66 @@
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
  <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  <title>MathPulse AI</title>
12
- <script type="module" crossorigin src="/assets/index-5uLcs77G.js"></script>
13
- <link rel="stylesheet" crossorigin href="/assets/index-B-KaNIwd.css">
 
 
 
14
  </head>
15
 
16
  <body>
 
 
 
 
 
 
17
  <div id="root"></div>
18
  </body>
19
  </html>
 
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
  <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet" />
11
+ <style>
12
+ #boot-shell {
13
+ position: fixed;
14
+ inset: 0;
15
+ z-index: 9999;
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ background: linear-gradient(140deg, #f8fbff 0%, #eef4ff 55%, #fff5dc 100%);
20
+ font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
21
+ color: #0a1628;
22
+ }
23
+
24
+ #boot-shell-card {
25
+ display: flex;
26
+ align-items: center;
27
+ gap: 0.75rem;
28
+ padding: 0.95rem 1.15rem;
29
+ border-radius: 999px;
30
+ border: 1px solid rgba(143, 166, 205, 0.3);
31
+ background: rgba(255, 255, 255, 0.84);
32
+ box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
33
+ }
34
+
35
+ #boot-shell-spinner {
36
+ width: 0.9rem;
37
+ height: 0.9rem;
38
+ border-radius: 999px;
39
+ border: 2px solid rgba(88, 119, 177, 0.25);
40
+ border-top-color: #5877b1;
41
+ animation: boot-spin 0.8s linear infinite;
42
+ }
43
+
44
+ #boot-shell-label {
45
+ font-size: 0.9rem;
46
+ font-weight: 700;
47
+ letter-spacing: 0.01em;
48
+ }
49
+
50
+ @keyframes boot-spin {
51
+ to {
52
+ transform: rotate(360deg);
53
+ }
54
+ }
55
+ </style>
56
  <title>MathPulse AI</title>
57
+ <script type="module" crossorigin src="/assets/index-Cq4H6CKS.js"></script>
58
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-CCIuKUIB.js">
59
+ <link rel="modulepreload" crossorigin href="/assets/vendor-firebase-CG7e86Dp.js">
60
+ <link rel="modulepreload" crossorigin href="/assets/vendor-radix-BAHZvx1W.js">
61
+ <link rel="stylesheet" crossorigin href="/assets/index-CI58CSTi.css">
62
  </head>
63
 
64
  <body>
65
+ <div id="boot-shell" aria-live="polite" aria-busy="true">
66
+ <div id="boot-shell-card">
67
+ <div id="boot-shell-spinner" aria-hidden="true"></div>
68
+ <span id="boot-shell-label">Starting MathPulse AI...</span>
69
+ </div>
70
+ </div>
71
  <div id="root"></div>
72
  </body>
73
  </html>