Spaces:
Running
Running
github-actions[bot] commited on
Commit Β·
ba0c442
1
Parent(s): f2581fa
π Auto-deploy frontend from GitHub (2c31ae5)
Browse filesThis view is limited to 50 files because it contains too many changes. Β See raw diff
- assets/{AIChatPage-DcGfVQjX.js β AIChatPage-CZPJTGvo.js} +2 -2
- assets/{AdminDashboard-C42SbQoX.js β AdminDashboard-B3V_f98_.js} +1 -1
- assets/{AssessmentPage-Bf02LBPz.js β AssessmentPage-B-axolaD.js} +1 -1
- assets/{AvatarShop-BfAC4iSo.js β AvatarShop-Bn9Ru-By.js} +2 -2
- assets/{ChatMarkdown-C-_pyfsw.js β ChatMarkdown-Dqp-2Avv.js} +1 -1
- assets/{CompetencyRadarChart-Dj3tHzDW.js β CompetencyRadarChart-Czkg0oSg.js} +1 -1
- assets/{ConfirmModal-Bs6qCyoa.js β ConfirmModal-CGEO_l_6.js} +1 -1
- assets/{FloatingAITutor-CZdidaqQ.js β FloatingAITutor-CK0p1jTY.js} +3 -3
- assets/{GradesPage-OZOkejf2.js β GradesPage-BANrJIHK.js} +1 -1
- assets/{HeroBanner-B-jp-_T1.js β HeroBanner-C7eH_2x2.js} +1 -1
- assets/{InitialAssessmentModal-B6OcOqjq.js β InitialAssessmentModal-CKoRHDsn.js} +1 -1
- assets/{LeaderboardPage-fMeUqEhL.js β LeaderboardPage-8P9vlsJH.js} +1 -1
- assets/{LearningPath-D6nfM5qD.js β LearningPath-CnmA03m9.js} +1 -1
- assets/{LoginPage-C8bC1ar4.js β LoginPage-BmZHRSsl.js} +1 -1
- assets/{LogoutActionButton-w1PkauXp.js β LogoutActionButton-XXsvBOAH.js} +1 -1
- assets/{ModuleFolderCard-BJl0S3M8.js β ModuleFolderCard-DFi0m1Zn.js} +1 -1
- assets/ModulesPage-CaIkpigw.js +0 -0
- assets/ModulesPage-DHibj58D.js +0 -0
- assets/{ProfileModal-CCkbSstb.js β ProfileModal-D0s9Ytgo.js} +1 -1
- assets/{ProfilePictureUploader-BVT_TKTZ.js β ProfilePictureUploader-CmusgPWl.js} +1 -1
- assets/QuizBattlePage-1dVgBLvH.js +0 -0
- assets/QuizBattlePage-DP7m_bnv.js +0 -0
- assets/{RewardsModal-C5DMk9fO.js β RewardsModal-MXZjyis_.js} +1 -1
- assets/{RightSidebar-CB4PJstQ.js β RightSidebar-CfqBTJ6T.js} +1 -1
- assets/{ScientificCalculator-YnJAbv_n.js β ScientificCalculator-3ObnUHS8.js} +1 -1
- assets/{SettingsModal-D8-maWNc.js β SettingsModal-BlGAAMMC.js} +1 -1
- assets/{Sidebar-D_VIy77A.js β Sidebar-SiyazvIi.js} +1 -1
- assets/{SupplementalBanner-BWRH1BJK.js β SupplementalBanner-2F2CcBwT.js} +1 -1
- assets/{TeacherDashboard-DNWwq_ue.js β TeacherDashboard-DlC2jUJq.js} +0 -0
- assets/{XPNotification-B39PrFBD.js β XPNotification-CRyPsEGd.js} +1 -1
- assets/{automationService-DoO5SNeM.js β automationService-ChmA_Dh7.js} +1 -1
- assets/{award-DBHp-ybd.js β award-ZQxHm68j.js} +1 -1
- assets/{bell-BwBudSvY.js β bell-CVB0-Rn1.js} +1 -1
- assets/{book-open-D5mR6gz9.js β book-open-cmOvedFO.js} +1 -1
- assets/{brain-COga8OrM.js β brain-CEG2uNCc.js} +1 -1
- assets/{button-BSRmUN27.js β button-C6pFOjcg.js} +1 -1
- assets/{calendar-ClpJmmLI.js β calendar-DguKdDEr.js} +1 -1
- assets/{card-SHcaFLA_.js β card-BdmZcu-T.js} +1 -1
- assets/{chart-column-V8fKqOo0.js β chart-column-Cqncpeum.js} +1 -1
- assets/{chatService-DzDq5mQE.js β chatService-CNolNpDv.js} +1 -1
- assets/{check-Cs-4n4yC.js β check-BAMSfVKd.js} +1 -1
- assets/{chevron-left-KucdseP8.js β chevron-left-mWdIDmIc.js} +1 -1
- assets/{chevron-right-mxUv3EB7.js β chevron-right-CFOFOVBg.js} +1 -1
- assets/{chevron-up-Bup_RJHP.js β chevron-up-Dmffgx6p.js} +1 -1
- assets/{circle-alert-KkqOOEPJ.js β circle-alert-mPiSlvKL.js} +1 -1
- assets/{circle-check-big-Qn5jJKfH.js β circle-check-big-DC9utj0Y.js} +1 -1
- assets/{clipboard-check-DbpvA-N4.js β clipboard-check-fEagN09v.js} +1 -1
- assets/{clock-BJCraYVD.js β clock-BtWjBj1h.js} +1 -1
- assets/{diagnosticService-BbwguGxN.js β diagnosticService-EjsgXhrt.js} +2 -2
- assets/{dialog-TlKhS4yO.js β dialog-fRGvTlwY.js} +1 -1
assets/{AIChatPage-DcGfVQjX.js β AIChatPage-CZPJTGvo.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
| 2 |
-
import{
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Du57tmo9.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-BW5XT768.js","assets/vendor-firebase-core-y3En_kpN.js","assets/vendor-firebase-firestore-52DD1vc9.js","assets/vendor-firebase-storage-DNmrKfQ-.js","assets/vendor-firebase-analytics-DZd0u9yk.js","assets/vendor-radix-DnWAlVSW.js","assets/vendor-charts-BHw0fhqZ.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-BQ2D57Uc.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{ak as F,u as $,_ as z,h as k,m as S,U as O}from"./index-Du57tmo9.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{B as H}from"./button-C6pFOjcg.js";import{I as C}from"./input-DtBdbulD.js";import Y from"./ChatMarkdown-Dqp-2Avv.js";import{P as D}from"./plus-gReuWg-C.js";import{S as G}from"./search-Dz1wkXyZ.js";import{T as Q}from"./trash-2-uIChez5o.js";import{S as U}from"./send-DWW_bMCz.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";const ce=()=>{const{sessions:I,activeSessionId:r,isLoading:l,loadingSessionId:A,setActiveSessionId:i,createNewSession:u,sendMessage:L,deleteSession:_,getActiveSession:T}=F(),{userProfile:f}=$(),[d,P]=a.useState(""),[o,b]=a.useState(""),[y,g]=a.useState(!1),c=a.useRef(null),x=a.useRef(!0),m=a.useRef(!1),n=T(),h=n?.messages||[],M=h.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),j=l&&r===A&&!M,v=(t="auto")=>{const s=c.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},E=()=>{const t=c.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{x.current=E()};a.useEffect(()=>{z(async()=>{const{warmupBackend:t}=await import("./index-Du57tmo9.js").then(s=>s.ay);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),a.useEffect(()=>{if(!x.current)return;const t=window.requestAnimationFrame(()=>v("auto"));return()=>window.cancelAnimationFrame(t)},[h,j]),a.useEffect(()=>{x.current=!0,v("auto")},[r]);const w=async()=>{if(!(!o.trim()||l||y||m.current)){m.current=!0,g(!0);try{let t=r;t||(t=u(),i(t));const s=o.trim();b(""),await L(t,s)}finally{m.current=!1,g(!1)}}},N=()=>{const t=u();i(t)},B=(t,s)=>{s.stopPropagation(),_(t)},p=I.filter(t=>t.title.toLowerCase().includes(d.toLowerCase())||t.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:N,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(D,{size:18}),"New Chat"]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(G,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(C,{type:"text",placeholder:"Search conversations...",value:d,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[p.length," Conversations"]})}),e.jsx(k,{children:p.map(t=>e.jsxs(S.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>i(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${r===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${r===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>B(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${r===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),p.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((t,s)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:t},s))})]}),e.jsxs("div",{ref: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(t=>e.jsxs(S.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(Y,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:t.timestamp})]}),t.sender==="user"&&e.jsx(O,{src:f?.photo,name:f?.name,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),j&&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(C,{type:"text",value:o,onChange:t=>b(t.target.value),onKeyPress:t=>t.key==="Enter"&&w(),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(H,{onClick:w,disabled:!o.trim()||l||y,className:"px-6 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:e.jsx(U,{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:N,className:"px-6 py-3 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl font-bold shadow-lg hover:shadow-xl transition-all",children:"Start Your First Chat"}),e.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(t=>e.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",t.toLowerCase()]})]},t))})]})})]})};export{ce as default};
|
assets/{AdminDashboard-C42SbQoX.js β AdminDashboard-B3V_f98_.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r,d as Rt,j as e}from"./vendor-react-B4AQeu28.js";import Ts from"./Sidebar-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r,d as Rt,j as e}from"./vendor-react-B4AQeu28.js";import Ts from"./Sidebar-SiyazvIi.js";import He from"./ConfirmModal-CGEO_l_6.js";import{c as ae,e as Ne,t as T,T as de,d as se,p as It,q as Lt,i as Js,m as U,j as Ge,u as Ke,Z as hs,D as Ut,r as $t,v as Ft,f as Bt,w as Ms,x as Rs,y as Is,F as Ks,k as Ot,M as qt,U as Gt}from"./index-Du57tmo9.js";import{B as L}from"./button-C6pFOjcg.js";import{S as Q,a as J,b as K,c as Y,d as C}from"./select-BO-JyJ96.js";import{I as O}from"./input-DtBdbulD.js";import{S as _e}from"./subjects-DLaBFkP9.js";import{U as os}from"./upload-CONq3UoZ.js";import{F as us,I as Ee,D as Ys,f as Zs,g as et,h as st,i as tt,l as ze,j as _t,k as Ht,T as Wt,a as Vt,b as Ls,c as Ce,d as Xt,e as Ae}from"./dialog-fRGvTlwY.js";import{C as Us,L as Qt}from"./lightbulb-2ipA_Yda.js";import{L as Z}from"./loader-circle-Bluo8e0c.js";import{C as We}from"./chart-column-Cqncpeum.js";import{R as Te}from"./refresh-cw-BDWpfygR.js";import{C as Ve}from"./circle-check-big-DC9utj0Y.js";import{h as le,e as te,q as gs,o as at,l as ps,w as $s,m as Jt,a as Kt}from"./vendor-firebase-firestore-52DD1vc9.js";import{C as fs}from"./calendar-DguKdDEr.js";import{C as ye,a as Yt}from"./circle-alert-mPiSlvKL.js";import{S as rt}from"./search-Dz1wkXyZ.js";import{E as Xe,a as Fs}from"./eye-Duf559JU.js";import{S as Me}from"./shield-QK9XTLqm.js";import{S as ne}from"./switch-YVS1owKs.js";import{S as Zt,M as ea}from"./LogoutActionButton-XXsvBOAH.js";import{B as he}from"./book-open-cmOvedFO.js";import{B as sa}from"./bell-CVB0-Rn1.js";import{S as lt}from"./save-BYv1sqTn.js";import{C as ta,b as aa}from"./vendor-radix-DnWAlVSW.js";import{C as ra}from"./check-BAMSfVKd.js";import{P as la}from"./plus-gReuWg-C.js";import{M as ia}from"./mail-B4r1HZjf.js";import{D as it}from"./download-VEXmhhD6.js";import{T as Bs}from"./trash-2-uIChez5o.js";import{U as Qe}from"./users--M0GUX5u.js";import{G as js}from"./graduation-cap-D6QMIGIe.js";import{T as nt}from"./target-B_JwHjFq.js";import{C as dt}from"./clock-BtWjBj1h.js";import{A as Je}from"./award-ZQxHm68j.js";import{B as na}from"./brain-CEG2uNCc.js";import{F as da}from"./funnel-N-2rOOix.js";import{S as X}from"./skeleton-08qYl7s6.js";import{T as ct}from"./trending-up-BgWHLAjl.js";import{u as ca,t as oa,a as ma}from"./useSubjectAvailability-BhYsHQ11.js";import{L as xa}from"./lock-CtsU7Hj2.js";import{u as ha}from"./useQuery-CDdIlAcl.js";import{a as ua}from"./chevron-up-Dmffgx6p.js";import{M as ga}from"./minus-DyrqHtmD.js";import"./tooltip-C0JcTMbS.js";import"./x-Cwkkamrh.js";import"./chevron-right-CFOFOVBg.js";import"./chevron-left-mWdIDmIc.js";import"./swords-Bu0_wc8h.js";import"./trophy-8udS7pQx.js";import"./shirt-wJF8-Ry8.js";import"./log-out-SC88Jnul.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{AssessmentPage-Bf02LBPz.js β AssessmentPage-B-axolaD.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as n,j as e}from"./vendor-react-B4AQeu28.js";import{B as T}from"./button-
|
|
|
|
| 1 |
+
import{r as n,j as e}from"./vendor-react-B4AQeu28.js";import{B as T}from"./button-C6pFOjcg.js";import{s as $}from"./diagnosticService-EjsgXhrt.js";import{C as B}from"./clock-BtWjBj1h.js";import{m}from"./index-Du57tmo9.js";import{C as M}from"./chevron-right-CFOFOVBg.js";import{L as Q}from"./loader-circle-Bluo8e0c.js";import{C as q}from"./circle-check-big-DC9utj0Y.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-markdown-yqZQ_iQm.js";const se=({testId:N,questions:u,userName:v,onComplete:y,onCancel:w})=>{const[d,p]=n.useState("testing"),[i,S]=n.useState(0),[a,f]=n.useState(null),[_,C]=n.useState(()=>{try{const t=sessionStorage.getItem("mathpulse_diagnostic_responses");return t?JSON.parse(t):[]}catch{return[]}}),[k,I]=n.useState(0),[h,b]=n.useState(null),l=n.useRef(null),x=n.useRef(Date.now()),c=u.length,o=u[i],g=Math.round((i+(a?1:0))/c*100),j=n.useCallback(()=>{x.current=Date.now(),l.current&&clearInterval(l.current),l.current=setInterval(()=>{I(Math.floor((Date.now()-x.current)/1e3))},200)},[]);n.useEffect(()=>(j(),()=>{l.current&&clearInterval(l.current)}),[i,j]);const R=t=>{a||f(t)},z=()=>{if(!a)return;l.current&&clearInterval(l.current);const t=Math.floor((Date.now()-x.current)/1e3),s=[..._,{question_id:o.question_id,student_answer:a,time_spent_seconds:t}];C(s),f(null),i<c-1?S(r=>r+1):A(s)},A=async t=>{p("submitting"),b(null);try{sessionStorage.setItem("mathpulse_diagnostic_responses",JSON.stringify(t))}catch{}try{const s=await $(N,t);sessionStorage.removeItem("mathpulse_diagnostic"),sessionStorage.removeItem("mathpulse_diagnostic_responses"),p("results"),setTimeout(()=>{y({overallRisk:s.overall_risk,overallScorePercent:s.overall_score_percent,intervention:s.recommended_intervention,xpEarned:s.xp_earned,badgeUnlocked:s.badge_unlocked})},3e3)}catch(s){const r=s instanceof Error?s.message:"Submission failed. Your answers are saved locally.";b(r)}},D=t=>{const s=Math.floor(t/60),r=t%60;return`${s}:${r.toString().padStart(2,"0")}`},E=["A","B","C","D"];return e.jsxs("div",{className:"fixed inset-0 z-50 bg-white flex flex-col",children:[d==="testing"&&e.jsxs("div",{className:"flex flex-col h-full max-w-2xl mx-auto w-full px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-4 border-b border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-bold text-[#5a6578]",children:["Question ",i+1," of ",c]}),e.jsxs("span",{className:"text-xs text-slate-400 flex items-center gap-1",children:[e.jsx(B,{size:12}),D(k)]})]}),e.jsx("button",{onClick:w,className:"text-xs text-slate-400 hover:text-slate-600 font-medium transition-colors",children:"Cancel"})]}),e.jsx("div",{className:"h-1.5 bg-[#edf1f7] rounded-full overflow-hidden mt-3",children:e.jsx(m.div,{className:"h-full bg-purple-600 rounded-full origin-left",initial:{scaleX:0},animate:{scaleX:g/100},transition:{duration:.3,ease:"easeOut"},style:{willChange:"transform"}})}),e.jsxs("p",{className:"text-[11px] text-slate-400 text-right mt-1",children:[g,"%"]}),e.jsxs("div",{className:"flex-1 flex flex-col justify-center py-6 space-y-6",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-5 rounded-2xl border border-[#dde3eb]",children:[e.jsxs("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500 mb-2",children:[o.domain," β’ ",o.difficulty]}),e.jsx("h3",{className:"text-lg font-bold text-[#0a1628] leading-relaxed",children:o.question_text})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2.5",children:E.map(t=>{const s=o.options[t];if(!s)return null;const r=a===t;return e.jsxs("button",{onClick:()=>R(t),disabled:!!a,className:`w-full text-left p-3.5 rounded-xl border-2 transition-all font-medium text-sm flex items-center gap-3 ${r?"border-purple-600 bg-purple-50 text-[#0a1628]":"border-[#dde3eb] hover:border-purple-400 hover:bg-purple-50/50 text-[#0a1628]"} ${a&&!r?"opacity-50":""}`,children:[e.jsx("span",{className:`w-8 h-8 rounded-lg flex items-center justify-center text-xs font-bold flex-shrink-0 ${r?"bg-purple-600 text-white":"bg-white border border-[#dde3eb] text-[#5a6578]"}`,children:t}),e.jsx("span",{className:"flex-1",children:s}),r&&e.jsx(M,{size:18,className:"text-purple-600 flex-shrink-0"})]},t)})})]}),e.jsx("div",{className:"py-4 border-t border-[#dde3eb]",children:e.jsx(T,{onClick:z,disabled:!a,className:"w-full bg-purple-600 hover:bg-purple-700 text-white py-3 rounded-xl font-bold text-sm disabled:opacity-40",children:i<c-1?"Next Question":"Submit Assessment"})})]}),d==="submitting"&&e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:e.jsxs(m.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"space-y-4",children:[e.jsx(Q,{size:48,className:"animate-spin text-purple-600 mx-auto"}),e.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:"Analyzing your results..."}),e.jsx("p",{className:"text-sm text-[#5a6578] max-w-xs mx-auto",children:"We're evaluating your responses and building your personalized learning path."}),h&&e.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("p",{className:"text-sm text-red-700",children:h})})]})}),d==="results"&&e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:e.jsxs(m.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{type:"spring",damping:25,stiffness:200},className:"space-y-4",children:[e.jsx("div",{className:"w-20 h-20 bg-teal-100 rounded-full flex items-center justify-center mx-auto",children:e.jsx(q,{size:40,className:"text-teal-600"})}),e.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:"Assessment Complete!"}),e.jsxs("p",{className:"text-sm text-[#5a6578] max-w-xs mx-auto",children:["Great job, ",v,"! Your personalized learning path is ready."]}),e.jsx("p",{className:"text-xs text-slate-400",children:"Redirecting to dashboard..."})]})})]})};export{se as default};
|
assets/{AvatarShop-BfAC4iSo.js β AvatarShop-Bn9Ru-By.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{f as W,L as Q,s as ee,g as te}from"./vendor-radix-DnWAlVSW.js";import{c as N,u as se,E as R,m as w,h as ae,t as c,
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
@@ -28,4 +28,4 @@ import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{f as W,L as Q,s as
|
|
| 28 |
.animate-spin-slow {
|
| 29 |
animation: spin-slow 1s linear infinite;
|
| 30 |
}
|
| 31 |
-
`,V=["Wow!","Cute!","I love it!","Perfect!","So cool!","Awesome!"],X=["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!"],q="top_blue",Y="mathpulse:avatar-inventory:v2",ve=600*1e3,ge=2e4,Oe=({onSaveProfile:S,onNavigateToModules:F})=>{const{userProfile:i,refreshProfile:U}=se(),$=!1,[m,k]=l.useState({top:i?.avatarLayers?.top??q,bottom:i?.avatarLayers?.bottom||"",shoes:i?.avatarLayers?.shoes||"",accessory:i?.avatarLayers?.accessory||""}),[x,p]=l.useState(!1),[f,A]=l.useState([]),[D,E]=l.useState(0),[T,_]=l.useState(null),[d,h]=l.useState(null),[I,P]=l.useState(y),[B,H]=l.useState("top"),C=l.useRef(i);C.current=i;const b=l.useRef(!1),v=l.useRef(null);l.useEffect(()=>{if(typeof window>"u")return;const t=Date.now();try{const o=sessionStorage.getItem(Y);if(o){const s=JSON.parse(o);if(Array.isArray(s.items)&&typeof s.expiresAt=="number"&&s.expiresAt>t){P(s.items);return}}}catch{}P(y);try{sessionStorage.setItem(Y,JSON.stringify({expiresAt:t+ve,items:y}))}catch{}},[]),l.useEffect(()=>{if(i&&i.role==="student"){const t=i;A(t.ownedAvatarItems||[]),E(t.currentXP||0)}},[i]),l.useEffect(()=>{k({top:i?.avatarLayers?.top??q,bottom:i?.avatarLayers?.bottom||"",shoes:i?.avatarLayers?.shoes||"",accessory:i?.avatarLayers?.accessory||""})},[]),l.useEffect(()=>{if(!d){const t=setInterval(()=>{Math.random()>.6&&h(X[Math.floor(Math.random()*X.length)])},4e3);return()=>clearInterval(t)}},[d]),l.useEffect(()=>{if(d){const t=setTimeout(()=>{h(null)},3500);return()=>clearTimeout(t)}},[d]);const G=(t,o)=>{const s=I.find(n=>n.id===o);if(s&&(s.price&&s.price>0||s.isReward)&&!f.includes(o)){c.error("This item is locked. Earn or purchase it first!");return}const a={...m,[t]:m[t]===o?"":o};k(a),h(V[Math.floor(Math.random()*V.length)]),g(a,{showSuccessToast:!1,showSavingState:!1})},K=async(t,o,s)=>{if(t.stopPropagation(),!i?.uid){c.error("You must be logged in to purchase items");return}if(f.includes(o)){c.info("You already own this item");return}_(o);try{const a=await re(i.uid,o,s);a.success?(c.success(a.message||"Item purchased!"),A(n=>[...n,o]),a.currentXP!==void 0&&E(a.currentXP),await U()):c.error(a.message||"Failed to purchase item")}catch(a){console.error("Purchase error:",a),c.error("Error purchasing item")}finally{_(null)}},z=t=>({top:typeof t.top=="string"?t.top:"",bottom:typeof t.bottom=="string"?t.bottom:"",shoes:typeof t.shoes=="string"?t.shoes:"",accessory:typeof t.accessory=="string"?t.accessory:""}),Z=(t,o,s)=>{let a;const n=new Promise((r,u)=>{a=setTimeout(()=>{u(new Error(`${s} timed out after ${Math.round(o/1e3)}s`))},o)});return Promise.race([t,n]).finally(()=>{a!==void 0&&clearTimeout(a)})},g=async(t,o={})=>{const s=C.current;if(!s?.uid)return;const{showSuccessToast:a=!0,showSavingState:n=!0}=o;if(b.current){v.current={layers:z(t),options:{showSuccessToast:a,showSavingState:n}},n&&p(!0);return}b.current=!0,n&&p(!0);try{const r=z(t);await Z(oe(s.uid,{avatarLayers:r}),ge,"Avatar save"),S&&S(r),a&&c.success("Avatar saved successfully")}catch(r){if(console.error(r),a){const u=r instanceof Error&&r.message.includes("timed out");c.error(u?"Avatar save timed out. Please try again.":"Failed to save avatar")}}finally{const r=v.current;if(v.current=null,b.current=!1,r){g(r.layers,r.options);return}(n||x)&&p(!1)}},J=async()=>{await g(m,{showSuccessToast:!0,showSavingState:!0})},M=[{id:"top",label:"Tops",icon:e.jsx(me,{size:16})},{id:"bottom",label:"Bottoms",icon:e.jsx(fe,{size:16,className:"rotate-90"})},{id:"shoes",label:"Shoes",icon:e.jsx(xe,{size:16})},{id:"accessory",label:"Accessories",icon:e.jsx(R,{size:16})}];return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:be}),e.jsx("div",{className:"h-full w-full flex items-start xl:items-center justify-center p-4 sm:p-6 lg:p-8 overflow-y-auto xl:overflow-hidden",children:e.jsxs("div",{className:"relative w-full max-w-[1000px] min-h-[500px] xl:h-[80vh] xl:max-h-[700px] rounded-[2rem] p-6 lg:p-8 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-8 xl:gap-12 overflow-visible xl:overflow-hidden",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 xl:h-full min-h-0 relative z-10 w-full xl:w-[50%] mx-auto xl:mx-0 flex-1",children:[e.jsxs("div",{className:"mb-6 flex flex-col gap-2 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between xl:justify-start gap-4",children:[e.jsxs("h1",{className:"text-3xl md:text-4xl font-display font-black text-[#0a1628] tracking-tight flex items-center gap-2.5",children:[e.jsx("span",{className:"whitespace-nowrap",children:"Avatar Studio"})," ",e.jsx(L,{className:"text-blue-500 fill-blue-500",size:28})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[$,e.jsxs("div",{className:"bg-gradient-to-br from-amber-400 to-orange-500 rounded-xl px-3 py-1.5 shadow-md flex items-center gap-2 h-fit",children:[e.jsx(j,{className:"text-white shrink-0",size:16}),e.jsxs(ie,{children:[e.jsx(le,{asChild:!0,children:e.jsxs("button",{onClick:F,className:"cursor-pointer hover:opacity-90 transition-opacity active:scale-95 text-left",children:[e.jsx("p",{className:"text-white text-[9px] font-bold uppercase tracking-wider leading-none mb-0.5",children:"XP Balance"}),e.jsx("p",{className:"text-white text-base font-black leading-none",children:D})]})}),e.jsx(ne,{side:"bottom",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]})]})]}),e.jsx("p",{className:"text-slate-500 font-medium text-sm md:text-base",children:"Design your perfect learning companion."})]}),e.jsxs(W,{value:B,onValueChange:t=>H(t),className:"flex flex-col flex-1 min-h-0",children:[e.jsx(Q,{className:"flex flex-nowrap shrink-0 justify-start space-x-1 sm:space-x-2 mb-4 bg-white shadow-sm p-1 rounded-full border border-slate-100 w-fit overflow-x-auto max-w-full scrollbar-hide",children:M.map(t=>e.jsxs(ee,{value:t.id,className:"flex items-center gap-1.5 px-4 py-2 rounded-full font-bold text-[13px] 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:M.map(t=>{const o=I.filter(s=>s.category===t.id);return e.jsx(te,{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(R,{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 md:grid-cols-3 gap-4 lg:gap-6",children:o.map(s=>{const a=m[t.id]===s.id,n=f.includes(s.id),r=!!((s.price&&s.price>0||s.isReward)&&!n);return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{onClick:()=>!r&&G(t.id,s.id),disabled:r,className:`relative w-full aspect-square rounded-2xl border-2 transition-all flex flex-col items-center justify-center group ${a&&!r?"bg-white border-blue-500 shadow-md scale-[1.02] z-10":r?"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&&!r&&e.jsxs("div",{className:"absolute top-1.5 left-1/2 -translate-x-1/2 px-1.5 py-0.5 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(L,{size:9,className:"fill-white"})]}),r&&e.jsx("div",{className:"absolute inset-0 bg-black/20 z-20 flex items-center justify-center rounded-[1rem]",children:e.jsx(O,{className:"text-white",size:24})}),e.jsx("img",{src:s.thumbnail,alt:s.name,className:`w-3/4 h-3/4 object-contain transition-transform e-filter ${!r&&"group-hover:scale-110"}`,style:{"--filter":r?"grayscale(70%)":"none"}})]}),e.jsx("p",{className:"text-xs font-bold text-slate-700 text-center line-clamp-2",children:s.name}),r&&(s.isReward?e.jsxs("div",{className:"w-full py-1 bg-slate-200 text-slate-500 text-[9px] font-bold flex items-center justify-center gap-1 rounded shadow-sm border border-slate-300",children:[e.jsx(O,{size:11})," Exclusive Reward"]}):e.jsx(w.button,{initial:{opacity:0},animate:{opacity:1},onClick:u=>K(u,s.id,s.price||0),disabled:T===s.id,className:"w-full py-1 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white text-[9px] font-bold flex items-center justify-center gap-1 rounded shadow-sm transition-all disabled:opacity-70",children:T===s.id?e.jsx(w.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1},children:e.jsx(j,{size:11})}):e.jsxs(e.Fragment,{children:[e.jsx(j,{size:11}),s.price," XP"]})}))]},s.id)})})},t.id)})})]})]}),e.jsxs("div",{className:"flex flex-col gap-4 relative z-10 w-full xl:w-[350px] max-w-[420px] xl:max-w-none shrink-0 xl:self-center mx-auto xl:mx-0",children:[e.jsxs("div",{className:"bg-[#0f1422] rounded-[2rem] overflow-hidden relative shadow-[0_20px_50px_rgba(15,20,34,0.2)] h-[400px] w-full flex items-center justify-center mx-auto border-4 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 avatar-gloss"}),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("div",{className:"relative w-full h-[80%] z-10 flex justify-center items-center animate-avatar-float",children:[e.jsx(ce,{layers:m,className:"w-full h-full absolute inset-0 z-20"}),e.jsx(ae,{children:d&&e.jsxs(w.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:[d,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:J,disabled:x,className:"w-full max-w-[450px] mx-auto h-[54px] bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-bold text-base flex items-center justify-center gap-2 transition-colors shadow-md disabled:opacity-70 disabled:cursor-not-allowed active:scale-[0.98]",children:[x?e.jsx("div",{className:"animate-spin-slow",children:e.jsx(de,{size:24,className:"opacity-50"})}):null,x?"Saving...":"Save Profile Avatar"]})]})]})})]})};export{Oe as default};
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{f as W,L as Q,s as ee,g as te}from"./vendor-radix-DnWAlVSW.js";import{c as N,u as se,E as R,m as w,h as ae,t as c,aq as re,ar as oe}from"./index-Du57tmo9.js";import{T as ie,a as le,b as ne}from"./tooltip-C0JcTMbS.js";import{C as ce}from"./CompositeAvatar-Col05lJc.js";import{M as y}from"./avatarData-BuQSOXo3.js";import{S as L}from"./sparkles-DseoQb3m.js";import{L as O}from"./lock-CtsU7Hj2.js";import{S as de}from"./save-BYv1sqTn.js";import{S as me}from"./shirt-wJF8-Ry8.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 28 |
.animate-spin-slow {
|
| 29 |
animation: spin-slow 1s linear infinite;
|
| 30 |
}
|
| 31 |
+
`,q=["Wow!","Cute!","I love it!","Perfect!","So cool!","Awesome!"],V=["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!"],X="top_blue",Y="mathpulse:avatar-inventory:v2",ve=600*1e3,ge=2e4,Oe=({onSaveProfile:S,onNavigateToModules:F})=>{const{userProfile:i,refreshProfile:U}=se(),$=!1,[m,k]=l.useState({top:i?.avatarLayers?.top??X,bottom:i?.avatarLayers?.bottom||"",shoes:i?.avatarLayers?.shoes||"",accessory:i?.avatarLayers?.accessory||""}),[x,p]=l.useState(!1),[f,A]=l.useState([]),[D,E]=l.useState(0),[T,_]=l.useState(null),[d,h]=l.useState(null),[I,P]=l.useState(y),[B,H]=l.useState("top"),C=l.useRef(i);C.current=i;const b=l.useRef(!1),v=l.useRef(null);l.useEffect(()=>{if(typeof window>"u")return;const t=Date.now();try{const o=sessionStorage.getItem(Y);if(o){const s=JSON.parse(o);if(Array.isArray(s.items)&&typeof s.expiresAt=="number"&&s.expiresAt>t){P(s.items);return}}}catch{}P(y);try{sessionStorage.setItem(Y,JSON.stringify({expiresAt:t+ve,items:y}))}catch{}},[]),l.useEffect(()=>{if(i&&i.role==="student"){const t=i;A(t.ownedAvatarItems||[]),E(t.currentXP||0)}},[i]),l.useEffect(()=>{k({top:i?.avatarLayers?.top??X,bottom:i?.avatarLayers?.bottom||"",shoes:i?.avatarLayers?.shoes||"",accessory:i?.avatarLayers?.accessory||""})},[]),l.useEffect(()=>{if(!d){const t=setInterval(()=>{Math.random()>.6&&h(V[Math.floor(Math.random()*V.length)])},4e3);return()=>clearInterval(t)}},[d]),l.useEffect(()=>{if(d){const t=setTimeout(()=>{h(null)},3500);return()=>clearTimeout(t)}},[d]);const G=(t,o)=>{const s=I.find(n=>n.id===o);if(s&&(s.price&&s.price>0||s.isReward)&&!f.includes(o)){c.error("This item is locked. Earn or purchase it first!");return}const a={...m,[t]:m[t]===o?"":o};k(a),h(q[Math.floor(Math.random()*q.length)]),g(a,{showSuccessToast:!1,showSavingState:!1})},K=async(t,o,s)=>{if(t.stopPropagation(),!i?.uid){c.error("You must be logged in to purchase items");return}if(f.includes(o)){c.info("You already own this item");return}_(o);try{const a=await re(i.uid,o,s);a.success?(c.success(a.message||"Item purchased!"),A(n=>[...n,o]),a.currentXP!==void 0&&E(a.currentXP),await U()):c.error(a.message||"Failed to purchase item")}catch(a){console.error("Purchase error:",a),c.error("Error purchasing item")}finally{_(null)}},z=t=>({top:typeof t.top=="string"?t.top:"",bottom:typeof t.bottom=="string"?t.bottom:"",shoes:typeof t.shoes=="string"?t.shoes:"",accessory:typeof t.accessory=="string"?t.accessory:""}),Z=(t,o,s)=>{let a;const n=new Promise((r,u)=>{a=setTimeout(()=>{u(new Error(`${s} timed out after ${Math.round(o/1e3)}s`))},o)});return Promise.race([t,n]).finally(()=>{a!==void 0&&clearTimeout(a)})},g=async(t,o={})=>{const s=C.current;if(!s?.uid)return;const{showSuccessToast:a=!0,showSavingState:n=!0}=o;if(b.current){v.current={layers:z(t),options:{showSuccessToast:a,showSavingState:n}},n&&p(!0);return}b.current=!0,n&&p(!0);try{const r=z(t);await Z(oe(s.uid,{avatarLayers:r}),ge,"Avatar save"),S&&S(r),a&&c.success("Avatar saved successfully")}catch(r){if(console.error(r),a){const u=r instanceof Error&&r.message.includes("timed out");c.error(u?"Avatar save timed out. Please try again.":"Failed to save avatar")}}finally{const r=v.current;if(v.current=null,b.current=!1,r){g(r.layers,r.options);return}(n||x)&&p(!1)}},J=async()=>{await g(m,{showSuccessToast:!0,showSavingState:!0})},M=[{id:"top",label:"Tops",icon:e.jsx(me,{size:16})},{id:"bottom",label:"Bottoms",icon:e.jsx(fe,{size:16,className:"rotate-90"})},{id:"shoes",label:"Shoes",icon:e.jsx(xe,{size:16})},{id:"accessory",label:"Accessories",icon:e.jsx(R,{size:16})}];return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:be}),e.jsx("div",{className:"h-full w-full flex items-start xl:items-center justify-center p-4 sm:p-6 lg:p-8 overflow-y-auto xl:overflow-hidden",children:e.jsxs("div",{className:"relative w-full max-w-[1000px] min-h-[500px] xl:h-[80vh] xl:max-h-[700px] rounded-[2rem] p-6 lg:p-8 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-8 xl:gap-12 overflow-visible xl:overflow-hidden",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 xl:h-full min-h-0 relative z-10 w-full xl:w-[50%] mx-auto xl:mx-0 flex-1",children:[e.jsxs("div",{className:"mb-6 flex flex-col gap-2 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between xl:justify-start gap-4",children:[e.jsxs("h1",{className:"text-3xl md:text-4xl font-display font-black text-[#0a1628] tracking-tight flex items-center gap-2.5",children:[e.jsx("span",{className:"whitespace-nowrap",children:"Avatar Studio"})," ",e.jsx(L,{className:"text-blue-500 fill-blue-500",size:28})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[$,e.jsxs("div",{className:"bg-gradient-to-br from-amber-400 to-orange-500 rounded-xl px-3 py-1.5 shadow-md flex items-center gap-2 h-fit",children:[e.jsx(j,{className:"text-white shrink-0",size:16}),e.jsxs(ie,{children:[e.jsx(le,{asChild:!0,children:e.jsxs("button",{onClick:F,className:"cursor-pointer hover:opacity-90 transition-opacity active:scale-95 text-left",children:[e.jsx("p",{className:"text-white text-[9px] font-bold uppercase tracking-wider leading-none mb-0.5",children:"XP Balance"}),e.jsx("p",{className:"text-white text-base font-black leading-none",children:D})]})}),e.jsx(ne,{side:"bottom",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]})]})]}),e.jsx("p",{className:"text-slate-500 font-medium text-sm md:text-base",children:"Design your perfect learning companion."})]}),e.jsxs(W,{value:B,onValueChange:t=>H(t),className:"flex flex-col flex-1 min-h-0",children:[e.jsx(Q,{className:"flex flex-nowrap shrink-0 justify-start space-x-1 sm:space-x-2 mb-4 bg-white shadow-sm p-1 rounded-full border border-slate-100 w-fit overflow-x-auto max-w-full scrollbar-hide",children:M.map(t=>e.jsxs(ee,{value:t.id,className:"flex items-center gap-1.5 px-4 py-2 rounded-full font-bold text-[13px] 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:M.map(t=>{const o=I.filter(s=>s.category===t.id);return e.jsx(te,{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(R,{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 md:grid-cols-3 gap-4 lg:gap-6",children:o.map(s=>{const a=m[t.id]===s.id,n=f.includes(s.id),r=!!((s.price&&s.price>0||s.isReward)&&!n);return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{onClick:()=>!r&&G(t.id,s.id),disabled:r,className:`relative w-full aspect-square rounded-2xl border-2 transition-all flex flex-col items-center justify-center group ${a&&!r?"bg-white border-blue-500 shadow-md scale-[1.02] z-10":r?"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&&!r&&e.jsxs("div",{className:"absolute top-1.5 left-1/2 -translate-x-1/2 px-1.5 py-0.5 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(L,{size:9,className:"fill-white"})]}),r&&e.jsx("div",{className:"absolute inset-0 bg-black/20 z-20 flex items-center justify-center rounded-[1rem]",children:e.jsx(O,{className:"text-white",size:24})}),e.jsx("img",{src:s.thumbnail,alt:s.name,className:`w-3/4 h-3/4 object-contain transition-transform e-filter ${!r&&"group-hover:scale-110"}`,style:{"--filter":r?"grayscale(70%)":"none"}})]}),e.jsx("p",{className:"text-xs font-bold text-slate-700 text-center line-clamp-2",children:s.name}),r&&(s.isReward?e.jsxs("div",{className:"w-full py-1 bg-slate-200 text-slate-500 text-[9px] font-bold flex items-center justify-center gap-1 rounded shadow-sm border border-slate-300",children:[e.jsx(O,{size:11})," Exclusive Reward"]}):e.jsx(w.button,{initial:{opacity:0},animate:{opacity:1},onClick:u=>K(u,s.id,s.price||0),disabled:T===s.id,className:"w-full py-1 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white text-[9px] font-bold flex items-center justify-center gap-1 rounded shadow-sm transition-all disabled:opacity-70",children:T===s.id?e.jsx(w.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1},children:e.jsx(j,{size:11})}):e.jsxs(e.Fragment,{children:[e.jsx(j,{size:11}),s.price," XP"]})}))]},s.id)})})},t.id)})})]})]}),e.jsxs("div",{className:"flex flex-col gap-4 relative z-10 w-full xl:w-[350px] max-w-[420px] xl:max-w-none shrink-0 xl:self-center mx-auto xl:mx-0",children:[e.jsxs("div",{className:"bg-[#0f1422] rounded-[2rem] overflow-hidden relative shadow-[0_20px_50px_rgba(15,20,34,0.2)] h-[400px] w-full flex items-center justify-center mx-auto border-4 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 avatar-gloss"}),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("div",{className:"relative w-full h-[80%] z-10 flex justify-center items-center animate-avatar-float",children:[e.jsx(ce,{layers:m,className:"w-full h-full absolute inset-0 z-20"}),e.jsx(ae,{children:d&&e.jsxs(w.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:[d,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:J,disabled:x,className:"w-full max-w-[450px] mx-auto h-[54px] bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-bold text-base flex items-center justify-center gap-2 transition-colors shadow-md disabled:opacity-70 disabled:cursor-not-allowed active:scale-[0.98]",children:[x?e.jsx("div",{className:"animate-spin-slow",children:e.jsx(de,{size:24,className:"opacity-50"})}):null,x?"Saving...":"Save Profile Avatar"]})]})]})})]})};export{Oe as default};
|
assets/{ChatMarkdown-C-_pyfsw.js β ChatMarkdown-Dqp-2Avv.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{
|
|
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{aw as d,_ as c}from"./index-Du57tmo9.js";import{r as m,j as r}from"./vendor-react-B4AQeu28.js";import{M as h,r as x,a as y}from"./vendor-markdown-yqZQ_iQm.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";let s=null;const p=()=>(s||(s=c(()=>import("./vendor-markdown-yqZQ_iQm.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),s),M=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=d(l);return r.jsx("div",{className:"chat-markdown",children:r.jsx(h,{remarkPlugins:[y],rehypePlugins:[x],components:{a:({href:e,children:a})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:a}),code:e=>{const{inline:a,className:o,children:n,...i}=e;return r.jsx("code",{className:`${a?"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 text-sm":"block bg-gray-100 dark:bg-gray-900 rounded p-3 overflow-x-auto my-2"} ${o||""}`,...i,children:n})},blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),h1:({children:e})=>r.jsx("h1",{className:"text-2xl font-bold my-2",children:e}),h2:({children:e})=>r.jsx("h2",{className:"text-xl font-bold my-2",children:e}),h3:({children:e})=>r.jsx("h3",{className:"text-lg font-bold my-2",children:e}),h4:({children:e})=>r.jsx("h4",{className:"text-base font-bold my-2",children:e}),h5:({children:e})=>r.jsx("h5",{className:"text-sm font-bold my-2",children:e}),h6:({children:e})=>r.jsx("h6",{className:"text-xs font-bold my-2",children:e}),ul:({children:e})=>r.jsx("ul",{className:"list-disc list-inside my-2",children:e}),ol:({children:e})=>r.jsx("ol",{className:"list-decimal list-inside my-2",children:e}),li:({children:e})=>r.jsx("li",{className:"ml-2",children:e}),hr:()=>r.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:e})=>r.jsx("p",{className:"my-1",children:e})},children:t})})};export{M as default};
|
assets/{CompetencyRadarChart-Dj3tHzDW.js β CompetencyRadarChart-Czkg0oSg.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as d,j as e}from"./vendor-react-B4AQeu28.js";import{u as W,L as H,m as K}from"./index-
|
|
|
|
| 1 |
+
import{r as d,j as e}from"./vendor-react-B4AQeu28.js";import{u as W,L as H,m as K}from"./index-Du57tmo9.js";import{g as O,s as P}from"./subjects-DLaBFkP9.js";import{B as U}from"./brain-CEG2uNCc.js";import{S as Y}from"./sparkles-DseoQb3m.js";import{R as J,d as Q,P as V,e as X,f as Z,g as $,T as ee}from"./vendor-charts-BHw0fhqZ.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-Cqncpeum.js";const fe=()=>{const{userProfile:u}=W(),[F,D]=d.useState([]),[p,R]=d.useState([]),[B,I]=d.useState("N/A"),[b,f]=d.useState(!0),[T,j]=d.useState(!1),v=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];return d.useEffect(()=>{if(!u?.uid){f(!1);return}const s=u.role==="student"?u.grade:null,r=O(s)[0]??"gen-math",h=P.find(t=>t.id===r)?.modules||[],y=new Map;P.forEach(t=>{t.modules.forEach(i=>y.set(i.id,t.id))});const N=h.map((t,i)=>({id:t.id,name:t.title.length>15?t.title.substring(0,15).trim()+"...":t.title,color:v[i%v.length]}));R(N);const k=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}],_=t=>{let i=-1,w="N/A";const M=k.map(l=>{const x={metric:l.label,fullMark:100};return h.forEach(a=>{const n=y.get(a.id),o=n?t?.subjects?.[n]?.modulesProgress?.[a.id]:null,E=o?.progress||0,q=t?.lessons??{},S=a.lessons.length?a.lessons.reduce((A,C)=>{const g=q?.[C.id]?.progressPercent;if(typeof g=="number"&&Number.isFinite(g))return A+Math.max(0,Math.min(100,g));const G=!!o?.lessonsCompleted?.includes?.(C.id);return A+(G?100:0)},0)/a.lessons.length:0,z=a.quizzes.length?(o?.quizzesCompleted?.length||0)/a.quizzes.length*100:0;let c=0;l.key==="progress"?c=E:l.key==="concept"?c=S:l.key==="application"?c=z:l.key==="engagement"?c=Math.min(100,(S+z*2)/1.5):l.key==="consistency"&&(c=Math.min(100,40+E*.6)),x[a.id]=c||0}),x});h.forEach(l=>{let x=0;M.forEach(n=>{const o=n[l.id];x+=typeof o=="number"?o:0});const a=x/k.length;a>i&&(i=a,w=N.find(n=>n.id===l.id)?.name||"N/A")}),I(w),D(M),f(!1)};f(!0);const L=H(u.uid,t=>{_(t)});return()=>L()},[u?.uid]),e.jsxs(K.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white/80 backdrop-blur-xl border border-white/50 shadow-[0_8px_30px_rgb(0,0,0,0.04)] rounded-[2rem] p-6 lg:p-8 isolate group",onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-violet-400/5 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-rose-400/5 rounded-full blur-3xl translate-y-1/3 -translate-x-1/3"}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 relative z-10 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"p-2 bg-violet-100 text-violet-600 rounded-xl",children:e.jsx(U,{size:20,className:"stroke-[2.5]"})}),e.jsx("h3",{className:"text-xl font-display font-extrabold text-[#0a1628] tracking-tight",children:"Competency Matrix"})]}),e.jsx("p",{className:"text-sm text-[#5a6578] font-body ml-12",children:"Your realtime performance across modules"})]}),e.jsxs("div",{className:"flex items-center gap-3 bg-slate-50 border border-slate-100 px-4 py-2 rounded-2xl ml-12 sm:ml-0",children:[e.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white shadow-sm border border-slate-100",children:e.jsx(Y,{size:14,className:"text-amber-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:"Top Module"}),e.jsx("p",{className:"text-sm font-bold text-slate-700",children:B})]})]})]}),e.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:b?e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 border-4 border-violet-200 border-t-violet-500 rounded-full animate-spin"}),e.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):e.jsx(J,{width:"100%",height:"100%",children:e.jsxs(Q,{cx:"50%",cy:"50%",outerRadius:T?"75%":"70%",data:F,children:[e.jsx(V,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),e.jsx(X,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600,fontFamily:"Inter, sans-serif"}}),e.jsx(Z,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),p.map(s=>e.jsx($,{name:s.name,dataKey:s.id,stroke:s.color,strokeWidth:2,fill:s.color,fillOpacity:.35,dot:{r:3,fill:"#fff",stroke:s.color,strokeWidth:2},activeDot:{r:5,fill:s.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},s.id)),e.jsx(ee,{cursor:!1,content:({active:s,payload:m})=>s&&m&&m.length?e.jsxs("div",{className:"bg-white/95 backdrop-blur shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)] border border-slate-100 rounded-xl p-4",children:[e.jsx("p",{className:"font-display font-bold text-slate-800 text-sm mb-3",children:m[0].payload.metric}),e.jsx("div",{className:"flex flex-col gap-2",children:m.map(r=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full e-bg",style:{"--bg":r.stroke}}),e.jsx("span",{className:"text-xs font-bold text-slate-600 uppercase tracking-wide truncate max-w-[120px]",title:String(r.name),children:String(r.name)})]}),e.jsxs("span",{className:"text-sm font-black e-color",style:{"--c":r.stroke},children:[Math.round(r.value),"%"]})]},r.name))})]}):null})]})})}),!b&&p.length>0&&e.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 md:gap-5 mt-[5px] z-10 relative",children:p.map(s=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full e-bg",style:{"--bg":s.color}}),e.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-widest",children:s.name.length>15?s.name.substring(0,12)+"...":s.name})]},s.id))})]})};export{fe as CompetencyRadarChart};
|
assets/{ConfirmModal-Bs6qCyoa.js β ConfirmModal-CGEO_l_6.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-
|
|
|
|
| 1 |
+
import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-C6pFOjcg.js";import{h as u,m as r,T as f}from"./index-Du57tmo9.js";import{X as y}from"./x-Cwkkamrh.js";import{T as j}from"./trash-2-uIChez5o.js";import{L as w}from"./log-out-SC88Jnul.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-markdown-yqZQ_iQm.js";const O=({isOpen:s,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:m="warning",icon:x="warning",zIndexClass:g="z-50"})=>{const b=()=>{switch(x){case"logout":return e.jsx(w,{size:32});case"delete":return e.jsx(j,{size:32});case"warning":default:return e.jsx(f,{size:32})}},o=(()=>{switch(m){case"danger":return{iconBg:"bg-red-100",iconColor:"text-red-600",buttonBg:"bg-red-600 hover:bg-red-700",buttonText:"text-white"};case"warning":return{iconBg:"bg-rose-100",iconColor:"text-rose-600",buttonBg:"bg-rose-600 hover:bg-rose-700",buttonText:"text-white"};case"info":default:return{iconBg:"bg-sky-100",iconColor:"text-sky-600",buttonBg:"bg-sky-600 hover:bg-sky-700",buttonText:"text-white"}}})(),p=async()=>{try{await n(),t()}catch{}};return e.jsx(u,{children:s&&e.jsx(e.Fragment,{children:e.jsx(r.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${g} flex items-center justify-center p-4`,children:e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:h=>h.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl max-w-md w-full overflow-hidden border border-[#dde3eb]",children:[e.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-xl transition-colors z-10",children:e.jsx(y,{size:20})}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(r.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",damping:15},className:`w-20 h-20 ${o.iconBg} rounded-full flex items-center justify-center mx-auto mb-6 ${o.iconColor}`,children:b()}),e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] mb-3",children:a}),e.jsx("p",{className:"text-[#5a6578] mb-8 leading-relaxed",children:l}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(i,{onClick:t,variant:"outline",size:"lg",className:"flex-1 h-12 rounded-xl border-[#dde3eb] hover:border-[#d1cec6] hover:bg-[#edf1f7] font-bold",children:d}),e.jsx(i,{onClick:p,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${o.buttonBg} ${o.buttonText} transition-colors shadow-lg`,children:c})]})]})]})})})})};export{O as default};
|
assets/{FloatingAITutor-CZdidaqQ.js β FloatingAITutor-CK0p1jTY.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-
|
| 2 |
-
import{c as S,
|
| 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 L=[["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"}]],E=S("maximize-2",L),O=a.lazy(()=>y(()=>import("./ChatMarkdown-
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-Dqp-2Avv.js","assets/index-Du57tmo9.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-BW5XT768.js","assets/vendor-firebase-core-y3En_kpN.js","assets/vendor-firebase-firestore-52DD1vc9.js","assets/vendor-firebase-storage-DNmrKfQ-.js","assets/vendor-firebase-analytics-DZd0u9yk.js","assets/vendor-radix-DnWAlVSW.js","assets/vendor-charts-BHw0fhqZ.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-BQ2D57Uc.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{c as S,ak as C,_ as y,m as f,B as A}from"./index-Du57tmo9.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{M as b}from"./minus-DyrqHtmD.js";import{X as w}from"./x-Cwkkamrh.js";import{S as M}from"./send-DWW_bMCz.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.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 L=[["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"}]],E=S("maximize-2",L),O=a.lazy(()=>y(()=>import("./ChatMarkdown-Dqp-2Avv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),Q=({constraintsRef:R,onFullScreen:g})=>{const{activeSessionId:n,setActiveSessionId:j,createNewSession:v,getActiveSession:N,sendMessage:k,isLoading:o}=C(),[s,r]=a.useState(!1),[l,d]=a.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[i,u]=a.useState(""),m=a.useRef(null);a.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",l?"1":"0")},[l]),a.useEffect(()=>{s&&y(async()=>{const{warmupBackend:t}=await import("./index-Du57tmo9.js").then(c=>c.ay);return{warmupBackend:t}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),a.useEffect(()=>{if(s&&!n){const t={id:"1",sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},c=v(t);j(c)}},[s]);const x=N()?.messages||[],I=()=>{m.current?.scrollIntoView({behavior:"smooth"})};a.useEffect(()=>{I()},[x]);const h=async()=>{if(!i.trim()||!n||o)return;const t=i.trim();u(""),await k(n,t)},_=()=>{g()},p=()=>{r(!1),d(!0)},z=()=>{d(!1)};return e.jsxs("div",{className:"pointer-events-none flex flex-col items-end",children:[e.jsxs("div",{className:`pointer-events-auto mb-4 w-80 bg-[#f7f9fc] rounded-3xl shadow-2xl border border-[#dde3eb] flex flex-col overflow-hidden transition-all duration-300 origin-bottom-right select-none ${s?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{"--max-h":s?"32rem":"0",willChange:"transform, opacity"},children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),e.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",e.jsx("br",{}),"Learning Intelligence"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:_,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(E,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:p,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(b,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>r(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(w,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[x.map(t=>e.jsx("div",{className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${t.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}):e.jsx(a.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(O,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:t.timestamp})]})},t.id)),o&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb] rounded-2xl px-4 py-2.5 max-w-[75%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})}),e.jsx("div",{ref:m})]}),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:t=>u(t.target.value),onKeyPress:t=>t.key==="Enter"&&h(),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:h,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(M,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:l?e.jsx(f.button,{type:"button",onClick:z,whileHover:{scale:1.08},whileTap:{scale:.95},transition:{duration:.15,ease:"easeOut"},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",style:{willChange:"transform"},children:e.jsx(A,{size:14})}):e.jsxs("div",{className:"relative group",children:[!s&&e.jsxs("div",{className:"absolute right-full mr-4 top-1/2 -translate-y-1/2 px-4 py-2 bg-slate-800 text-white text-sm rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap shadow-xl z-50",children:["Hello! I'm L.O.L.I., how may I help you?",e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -right-1 w-3 h-3 bg-slate-800 rotate-45"})]}),!s&&e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:p,className:"absolute -top-2 -left-2 z-10 h-6 w-6 rounded-full bg-white text-slate-700 border border-slate-200 shadow-md hover:bg-slate-100 transition-colors flex items-center justify-center",children:e.jsx(b,{size:12})}),e.jsx(f.button,{type:"button",onClick:()=>r(!s),whileHover:{scale:1.1},whileTap:{scale:.9},transition:{duration:.15,ease:"easeOut"},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":s?"Close AI tutor chat":"Open AI tutor chat",style:{willChange:"transform"},children:s?e.jsx(w,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{Q as default};
|
assets/{GradesPage-OZOkejf2.js β GradesPage-BANrJIHK.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{B as v}from"./button-
|
| 2 |
`),x=new Blob([n],{type:"text/csv;charset=utf-8;"}),b=window.URL.createObjectURL(x),p=document.createElement("a"),W=r.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";p.href=b,p.setAttribute("download",`grade-report-${W}-${l}.csv`),document.body.appendChild(p),p.click(),document.body.removeChild(p),window.URL.revokeObjectURL(b)};return F?e.jsx("div",{className:"p-8 flex justify-center items-center h-full",children:e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-8 max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-white p-6 rounded-[2rem] shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] border border-slate-50",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black text-slate-800 tracking-tight",children:"Assessment"}),e.jsx("p",{className:"text-slate-400 font-bold mt-1 text-[13px]",children:"Review your performance across subjects"})]}),e.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[e.jsxs(v,{variant:"outline",className:"flex-1 sm:flex-none border-slate-200 text-slate-500 font-bold rounded-xl h-11 px-5 hover:bg-slate-50 hover:text-slate-700",children:[e.jsx(Z,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Semester"]}),e.jsxs(v,{className:"flex-1 sm:flex-none bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl h-11 px-5 shadow-[0_8px_20px_-8px_rgba(79,70,229,0.5)] hover:-translate-y-0.5 transition-all",onClick:V,children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-indigo-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-indigo-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-indigo-100 text-indigo-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(ee,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Overall GPA"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsx("h3",{className:"text-4xl font-display font-black text-slate-800",children:B})})]})]}),e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-emerald-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-emerald-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-emerald-100 text-emerald-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(D,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Average Score"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsxs("h3",{className:"text-4xl font-display font-black text-slate-800",children:[f,"%"]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-violet-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-violet-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-violet-100 text-violet-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(L,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Quizzes Completed"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsx("h3",{className:"text-4xl font-display font-black text-slate-800",children:G})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black text-xl text-slate-800",children:"Recent Assessments"}),e.jsx("p",{className:"text-slate-400 font-bold text-[13px] mt-1",children:"Your latest quiz and practice results"})]}),e.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:o,onChange:t=>N(t.target.value),className:"appearance-none w-full pl-4 pr-10 py-2.5 border-none bg-slate-50 rounded-xl text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),d.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsx(M,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:m,onChange:t=>Q(t.target.value),className:"appearance-none w-full pl-4 pr-10 py-2.5 border-none bg-slate-50 rounded-xl text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"module",children:"Module Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(M,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]})]}),e.jsx("div",{className:"overflow-x-auto flex-1 p-2",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 px-4 sm:px-6 mb-4",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Assessment"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent min-w-[120px]",children:"Subject"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right border-b border-transparent",children:"Score"})]})}),e.jsx("tbody",{children:h.length>0?h.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/70 transition-colors",children:[e.jsxs("td",{className:"px-4 py-4 rounded-l-2xl",children:[e.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:t.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:t.date})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:"inline-flex flex-col gap-1 items-start",children:e.jsx("span",{className:"text-[13px] font-bold text-slate-600 truncate max-w-[140px] block",children:t.subject})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-[11px] font-bold uppercase tracking-wide ${t.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:t.type==="practice"?"Practice":"Quiz"})}),e.jsx("td",{className:"px-4 py-4 text-right rounded-r-2xl",children:e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-xl text-[13px] font-black ${t.score>=80?"bg-emerald-100 text-emerald-700":t.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[t.score,"%"]})})]},t.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4",children:e.jsx(D,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-slate-500 font-bold text-sm",children:"No recent assessments match the selected filters."})]})})})})]})})]})}),e.jsxs("div",{className:"space-y-6 lg:space-y-8 flex flex-col",children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)]",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("h3",{className:"font-display font-black text-lg text-slate-800",children:"Subject Performance"})}),e.jsx("div",{className:"space-y-7",children:E.map((t,s)=>{const r=z[t.color]||z.slate;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[14px] font-bold text-slate-800 flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${r.dot} group-hover:scale-125 transition-transform`}),t.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[t.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[t.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${r.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(t.average,5)}%`},children:e.jsx("div",{className:"absolute inset-0 bg-white/20 w-1/2 -skew-x-12 translate-x-[-100%] group-hover:animate-[shimmer_1.5s_ease-out]"})})})]},s)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[2rem] p-6 sm:p-8 shadow-[0_12px_30px_-10px_rgba(79,70,229,0.5)] text-white overflow-hidden group",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full blur-3xl -mt-10 -mr-10 group-hover:bg-white/20 transition-all duration-700 ease-in-out"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-indigo-400/30 rounded-full blur-2xl -mb-10 -ml-10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center mb-5 backdrop-blur-sm border border-white/20 shadow-sm group-hover:scale-110 transition-transform",children:e.jsx(L,{className:"w-6 h-6 text-white"})}),e.jsx("h3",{className:"text-2xl font-display font-black tracking-tight mb-2 leading-tight",children:"Keep up the momentum!"}),e.jsxs("p",{className:"text-white/80 text-[13px] font-medium leading-relaxed mb-8 max-w-[90%]",children:["You've completed ",e.jsx("span",{className:"font-black text-white",children:$.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(v,{className:"w-full bg-white text-indigo-600 hover:bg-slate-50 border-0 font-black h-12 rounded-xl shadow-[0_8px_16px_rgba(0,0,0,0.15)] hover:shadow-[0_8px_24px_rgba(0,0,0,0.2)] hover:-translate-y-0.5 transition-all",children:"Start Practice Session"})]})]})]})]})]})};export{we as default};
|
|
|
|
| 1 |
+
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{B as v}from"./button-C6pFOjcg.js";import{u as Y,l as J}from"./index-Du57tmo9.js";import{g as K,S as R}from"./subjects-DLaBFkP9.js";import{u as X}from"./useCurriculum-7SWvm23j.js";import{C as Z}from"./calendar-DguKdDEr.js";import{D as q}from"./download-VEXmhhD6.js";import{A as ee}from"./award-ZQxHm68j.js";import{T as D}from"./target-B_JwHjFq.js";import{T as L}from"./trending-up-BgWHLAjl.js";import{F as M}from"./funnel-N-2rOOix.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-Cqncpeum.js";const we=()=>{const{currentUser:c,userProfile:w}=Y(),[o,N]=i.useState("all"),[m,Q]=i.useState("all"),[F,y]=i.useState(!0),[u,U]=i.useState(null),S=w?.grade,_=K(S),k=new Set(_),{isLoading:A,refetch:T}=X(S);i.useEffect(()=>{A||(console.log("[GradesPage] Curriculum ready"),T())},[A,T]);const O=t=>{if(t==null)return"N/A";const s=t instanceof Date?t:new Date(t);return Number.isNaN(s.getTime())?"N/A":s.toISOString().split("T")[0]};i.useEffect(()=>{(async()=>{if(c){y(!0);try{const s=await J(c.uid);U(s)}catch(s){console.error("Failed to load progress for grades:",s)}finally{y(!1)}}})()},[c]);const C=u?.quizAttempts||[],G=u?.totalQuizzesCompleted||0,f=u?.averageScore||0,B=f>0?Math.min(f/25,4).toFixed(2):"0.00",I={"gen-math":"indigo","stats-prob":"violet"},z={indigo:{dot:"bg-indigo-500",bar:"bg-indigo-500"},violet:{dot:"bg-violet-500",bar:"bg-violet-500"},fuchsia:{dot:"bg-fuchsia-500",bar:"bg-fuchsia-500"},purple:{dot:"bg-purple-500",bar:"bg-purple-500"},slate:{dot:"bg-slate-500",bar:"bg-slate-500"}},g=R.reduce((t,s)=>(t[s.id]={label:s.name,color:I[s.id]||"slate"},t),{}),d=R.filter(t=>k.has(t.id)).map(t=>t.name),P=Object.entries(u?.subjects||{}).filter(([t])=>k.has(t)).map(([t,s])=>{const r=g[t]||{label:t,color:"slate"},l=C.filter(x=>x.quizId?.startsWith(t)),n=l.length>0?Math.round(l.reduce((x,b)=>x+b.score,0)/l.length):Math.round(s?.progress??0);return{subject:r.label,average:n,quizzes:l.length||s?.completedModules,color:r.color}}),H=_.map(t=>{const s=g[t]||{label:t,color:"slate"};return{subject:s.label,average:0,quizzes:0,color:s.color}}),E=P.length>0?P:H,$=C.slice().sort((t,s)=>new Date(s.completedAt).getTime()-new Date(t.completedAt).getTime()).slice(0,10).map((t,s)=>{const l=Object.entries(g).find(([n])=>t.quizId?.startsWith(n))?.[1]?.label||"General";return{id:s+1,title:t.quizId?.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())||`Quiz ${s+1}`,subject:l,score:t.score,date:O(t.completedAt),type:t.quizId?.includes("practice")?"practice":"module",status:t.score>=80?"Excellent":t.score>=60?"Passing":"Needs Review"}}).filter(t=>d.includes(t.subject)),h=$.filter(t=>{if(!d.includes(t.subject))return!1;const s=o==="all"||t.subject===o,r=m==="all"||t.type===m;return s&&r});i.useEffect(()=>{o!=="all"&&(d.includes(o)||N("all"))},[d,o]);const V=()=>{const t=a=>{const j=String(a??"");return/[",\n]/.test(j)?`"${j.replace(/"/g,'""')}"`:j},s=[],r=w?.name||c?.displayName||c?.email||"Student",l=new Date().toISOString().split("T")[0];s.push("Grade Report"),s.push(`Student,${t(r)}`),s.push(`Export Date,${t(l)}`),s.push(`Subject Filter,${t(o)}`),s.push(`Type Filter,${t(m)}`),s.push(""),s.push("Subject Performance"),s.push("Subject,Average Score"),E.forEach(a=>{s.push([t(a.subject),t(a.average)].join(","))}),s.push(""),s.push("Recent Quizzes"),s.push("Title,Subject,Score,Date,Type,Status"),h.length===0?s.push("No quiz data available for the selected filters"):h.forEach(a=>{s.push([t(a.title),t(a.subject),t(a.score),t(a.date),t(a.type),t(a.status)].join(","))});const n=s.join(`
|
| 2 |
`),x=new Blob([n],{type:"text/csv;charset=utf-8;"}),b=window.URL.createObjectURL(x),p=document.createElement("a"),W=r.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";p.href=b,p.setAttribute("download",`grade-report-${W}-${l}.csv`),document.body.appendChild(p),p.click(),document.body.removeChild(p),window.URL.revokeObjectURL(b)};return F?e.jsx("div",{className:"p-8 flex justify-center items-center h-full",children:e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-8 max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-white p-6 rounded-[2rem] shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] border border-slate-50",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black text-slate-800 tracking-tight",children:"Assessment"}),e.jsx("p",{className:"text-slate-400 font-bold mt-1 text-[13px]",children:"Review your performance across subjects"})]}),e.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[e.jsxs(v,{variant:"outline",className:"flex-1 sm:flex-none border-slate-200 text-slate-500 font-bold rounded-xl h-11 px-5 hover:bg-slate-50 hover:text-slate-700",children:[e.jsx(Z,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Semester"]}),e.jsxs(v,{className:"flex-1 sm:flex-none bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl h-11 px-5 shadow-[0_8px_20px_-8px_rgba(79,70,229,0.5)] hover:-translate-y-0.5 transition-all",onClick:V,children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-indigo-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-indigo-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-indigo-100 text-indigo-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(ee,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Overall GPA"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsx("h3",{className:"text-4xl font-display font-black text-slate-800",children:B})})]})]}),e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-emerald-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-emerald-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-emerald-100 text-emerald-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(D,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Average Score"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsxs("h3",{className:"text-4xl font-display font-black text-slate-800",children:[f,"%"]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-violet-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-violet-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-violet-100 text-violet-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(L,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Quizzes Completed"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsx("h3",{className:"text-4xl font-display font-black text-slate-800",children:G})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black text-xl text-slate-800",children:"Recent Assessments"}),e.jsx("p",{className:"text-slate-400 font-bold text-[13px] mt-1",children:"Your latest quiz and practice results"})]}),e.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:o,onChange:t=>N(t.target.value),className:"appearance-none w-full pl-4 pr-10 py-2.5 border-none bg-slate-50 rounded-xl text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),d.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsx(M,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:m,onChange:t=>Q(t.target.value),className:"appearance-none w-full pl-4 pr-10 py-2.5 border-none bg-slate-50 rounded-xl text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"module",children:"Module Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(M,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]})]}),e.jsx("div",{className:"overflow-x-auto flex-1 p-2",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 px-4 sm:px-6 mb-4",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Assessment"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent min-w-[120px]",children:"Subject"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right border-b border-transparent",children:"Score"})]})}),e.jsx("tbody",{children:h.length>0?h.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/70 transition-colors",children:[e.jsxs("td",{className:"px-4 py-4 rounded-l-2xl",children:[e.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:t.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:t.date})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:"inline-flex flex-col gap-1 items-start",children:e.jsx("span",{className:"text-[13px] font-bold text-slate-600 truncate max-w-[140px] block",children:t.subject})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-[11px] font-bold uppercase tracking-wide ${t.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:t.type==="practice"?"Practice":"Quiz"})}),e.jsx("td",{className:"px-4 py-4 text-right rounded-r-2xl",children:e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-xl text-[13px] font-black ${t.score>=80?"bg-emerald-100 text-emerald-700":t.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[t.score,"%"]})})]},t.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4",children:e.jsx(D,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-slate-500 font-bold text-sm",children:"No recent assessments match the selected filters."})]})})})})]})})]})}),e.jsxs("div",{className:"space-y-6 lg:space-y-8 flex flex-col",children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)]",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("h3",{className:"font-display font-black text-lg text-slate-800",children:"Subject Performance"})}),e.jsx("div",{className:"space-y-7",children:E.map((t,s)=>{const r=z[t.color]||z.slate;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[14px] font-bold text-slate-800 flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${r.dot} group-hover:scale-125 transition-transform`}),t.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[t.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[t.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${r.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(t.average,5)}%`},children:e.jsx("div",{className:"absolute inset-0 bg-white/20 w-1/2 -skew-x-12 translate-x-[-100%] group-hover:animate-[shimmer_1.5s_ease-out]"})})})]},s)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[2rem] p-6 sm:p-8 shadow-[0_12px_30px_-10px_rgba(79,70,229,0.5)] text-white overflow-hidden group",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full blur-3xl -mt-10 -mr-10 group-hover:bg-white/20 transition-all duration-700 ease-in-out"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-indigo-400/30 rounded-full blur-2xl -mb-10 -ml-10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center mb-5 backdrop-blur-sm border border-white/20 shadow-sm group-hover:scale-110 transition-transform",children:e.jsx(L,{className:"w-6 h-6 text-white"})}),e.jsx("h3",{className:"text-2xl font-display font-black tracking-tight mb-2 leading-tight",children:"Keep up the momentum!"}),e.jsxs("p",{className:"text-white/80 text-[13px] font-medium leading-relaxed mb-8 max-w-[90%]",children:["You've completed ",e.jsx("span",{className:"font-black text-white",children:$.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(v,{className:"w-full bg-white text-indigo-600 hover:bg-slate-50 border-0 font-black h-12 rounded-xl shadow-[0_8px_16px_rgba(0,0,0,0.15)] hover:shadow-[0_8px_24px_rgba(0,0,0,0.2)] hover:-translate-y-0.5 transition-all",children:"Start Practice Session"})]})]})]})]})]})};export{we as default};
|
assets/{HeroBanner-B-jp-_T1.js β HeroBanner-C7eH_2x2.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-CbAKGmA6.js","assets/vendor-react-B4AQeu28.js","assets/avatarData-BuQSOXo3.js"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{c as x,m as t,Z as c,A as p,_ as b}from"./index-
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-CbAKGmA6.js","assets/vendor-react-B4AQeu28.js","assets/avatarData-BuQSOXo3.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{c as x,m as t,Z as c,A as p,_ as b}from"./index-Du57tmo9.js";import{j as e,r}from"./vendor-react-B4AQeu28.js";import{B as h}from"./brain-CEG2uNCc.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
assets/{InitialAssessmentModal-B6OcOqjq.js β InitialAssessmentModal-CKoRHDsn.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{B as g}from"./button-
|
|
|
|
| 1 |
+
import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{B as g}from"./button-C6pFOjcg.js";import{g as b}from"./diagnosticService-EjsgXhrt.js";import{s as j,d as y,a as N}from"./vendor-firebase-firestore-52DD1vc9.js";import{m,T as v,d as w}from"./index-Du57tmo9.js";import{B as k}from"./brain-CEG2uNCc.js";import{C as L}from"./circle-check-big-DC9utj0Y.js";import{L as z}from"./loader-circle-Bluo8e0c.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-markdown-yqZQ_iQm.js";const W=({isOpen:x,onClose:a,userId:r,strand:i,gradeLevel:l,onAssessmentStart:p})=>{const[s,o]=c.useState(!1),[n,d]=c.useState(null),u=async()=>{o(!0),d(null);try{const t=await b(i,l);sessionStorage.setItem("mathpulse_diagnostic",JSON.stringify({testId:t.test_id,questions:t.questions,totalItems:t.total_items,estimatedMinutes:t.estimated_minutes})),p(t.test_id,t.questions)}catch(t){const f=t instanceof Error?t.message:"Failed to load assessment";d(f),o(!1)}},h=async()=>{try{await j(y(w,"diagnosticResults",r),{userId:r,status:"skipped",skippedAt:N(),strand:i,gradeLevel:l})}catch(t){console.error("[diagnostic] Failed to save skip state:",t)}a()};return x?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:a,children:e.jsxs(m.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"bg-white rounded-2xl shadow-2xl max-w-[36rem] w-full flex flex-col overflow-hidden pointer-events-auto",onClick:t=>t.stopPropagation(),style:{willChange:"transform, opacity"},children:[e.jsx("div",{className:"px-5 py-3 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600",children:e.jsx(k,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-[#0a1628] leading-tight",children:"Initial Assessment"}),e.jsx("p",{className:"text-[11px] text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]})}),e.jsx("div",{className:"p-5 text-center space-y-3",children:e.jsxs(m.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut"},children:[e.jsx("div",{className:"w-20 h-20 bg-purple-50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx("svg",{className:"w-9 h-9 text-purple-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}),e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[13px] text-[#5a6578] max-w-[19rem] mx-auto leading-relaxed",children:"To personalize your learning path, complete a DepEd competency-based SHS diagnostic (15 items, around 11.6 minutes)."}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5 max-w-[22rem] mx-auto text-left mt-4",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(L,{size:14,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(v,{size:14,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Spot areas that need more attention early."})]})]}),n&&e.jsx("div",{className:"mt-3 p-2.5 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("p",{className:"text-xs text-red-700",children:n})}),e.jsxs("div",{className:"pt-3 space-y-2.5",children:[e.jsx(g,{onClick:u,disabled:s,className:"bg-gradient-to-r from-purple-600 to-purple-500 hover:from-purple-700 hover:to-purple-600 text-white px-5 py-3 rounded-xl text-sm font-bold shadow-lg shadow-purple-200 w-full max-w-[190px] mx-auto",children:s?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:16,className:"animate-spin mr-2"}),"Crafting your assessment..."]}):"Start Assessment"}),s&&e.jsx("p",{className:"text-[10px] text-slate-400 max-w-[18rem] mx-auto text-center leading-relaxed",children:"This may take up to 90 seconds while AI generates your personalized test."}),!s&&e.jsx("button",{onClick:h,disabled:s,className:"block mx-auto text-xs text-slate-500 hover:text-[#5a6578] transition-colors font-medium disabled:opacity-40",children:"Skip for now β"})]})]})})]})}):null};export{W as default};
|
assets/{LeaderboardPage-fMeUqEhL.js β LeaderboardPage-8P9vlsJH.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{c as Y,
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{c as Y,am as O,h as U,m as x,F as B,E as T,u as H,an as W}from"./index-Du57tmo9.js";import{X as q}from"./x-Cwkkamrh.js";import{B as w}from"./book-open-cmOvedFO.js";import{T as L}from"./target-B_JwHjFq.js";import{A as y}from"./award-ZQxHm68j.js";import{C as $}from"./clock-BtWjBj1h.js";import{T as h}from"./trophy-8udS7pQx.js";import{T as P}from"./trending-up-BgWHLAjl.js";import{L as X}from"./loader-circle-Bluo8e0c.js";import{S as G}from"./star-BBetp7Wf.js";import{R as K}from"./refresh-cw-BDWpfygR.js";import{U as E}from"./user-DPqSTqXe.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{LearningPath-D6nfM5qD.js β LearningPath-CnmA03m9.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as m,d as p,j as r}from"./vendor-react-B4AQeu28.js";import{u as j,J as P,K as I,l as N,A as k}from"./index-
|
|
|
|
| 1 |
+
import{r as m,d as p,j as r}from"./vendor-react-B4AQeu28.js";import{u as j,J as P,K as I,l as N,A as k}from"./index-Du57tmo9.js";import{M as L}from"./ModuleFolderCard-DFi0m1Zn.js";import{B as S}from"./book-open-cmOvedFO.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-BhYsHQ11.js";import"./clock-BtWjBj1h.js";import"./lock-CtsU7Hj2.js";const U=({onNavigateToModules:c,atRiskSubjects:d=[],priorityTopics:o=[],modules:a})=>{const{userProfile:l}=j(),[u,h]=m.useState(null),i=p.useMemo(()=>{const e=o.length>0?o:d.map(s=>P(s)).filter(s=>s!==null),t=new Set;return e.filter(s=>t.has(s)?!1:(t.add(s),!0))},[o,d]),x=p.useMemo(()=>{if(i.length===0)return a.slice(0,3);const e=new Map(i.map((t,s)=>[I[t],s]));return[...a].sort((t,s)=>{const n=e.get(t.id)??Number.POSITIVE_INFINITY,b=e.get(s.id)??Number.POSITIVE_INFINITY;return n-b}).slice(0,3)},[a,i]);m.useEffect(()=>{l?.uid&&N(l.uid).then(h).catch(console.error)},[l?.uid]);const g=x.slice(0,3).map(e=>{const t=u?.subjects?.[e.subject]?.modulesProgress?.[e.id],s=e.lessons.length,n=t?.progress??(s>0?Math.round((t?.lessonsCompleted?.length||0)/s*100):0);return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),f=g.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-6 px-1",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.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:r.jsx(S,{size:20,strokeWidth:2.5})}),r.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:f})]}),r.jsxs("button",{onClick:()=>c?.(),className:"text-primary font-bold text-sm flex items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-4 py-2 rounded-xl hover:bg-primary/20",children:["View All ",r.jsx(k,{size:16})]})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-6",children:g.map((e,t)=>r.jsx(L,{module:e,index:t,onClick:()=>c?.(e.id),isAtRisk:i.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0},e.id))})]})};export{U as default};
|
assets/{LoginPage-C8bC1ar4.js β LoginPage-BmZHRSsl.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as Me}from"./button-BSRmUN27.js";import{I as D}from"./input-B3NSXxdz.js";import{m as r,A as te,s as se,a as Ee,b as ae}from"./index-fWY85Kyg.js";import{S as Te}from"./sparkles-BY90tCLG.js";import{B as Re}from"./brain-COga8OrM.js";import{T as Ce}from"./trending-up-Do7UgIZi.js";import{A as Ie}from"./award-DBHp-ybd.js";import{U as re}from"./users-CX_H_2cY.js";import{G as oe}from"./graduation-cap-B4Q4YTk8.js";import{B as ie}from"./book-open-D5mR6gz9.js";import{M as Le}from"./mail-BS9lcBqF.js";import{L as le}from"./lock-6q-juSdu.js";import{E as De,a as Be}from"./eye-DQlJQwuY.js";import{S as ze}from"./shield-check-DJHCbiaj.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-markdown-yqZQ_iQm.js";const ne="/assets/shader-bg-DA7bEbBA.mp4",qe=[{id:"length",label:"At least 8 characters",test:o=>o.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:o=>/[A-Z]/.test(o)&&/[a-z]/.test(o)},{id:"number",label:"Contains at least one number",test:o=>/\d/.test(o)},{id:"special",label:"Contains at least one special character",test:o=>/[^A-Za-z0-9]/.test(o)}],B="Use at least 8 characters with uppercase, lowercase, number, and special character.",Oe=o=>{const c=typeof o=="object"&&o!==null?o:null,i=o instanceof Error?o.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:i};const d=i.match(/auth\/[a-z-]+/i);return{code:d?d[0].toLowerCase():"",message:i}},_e=o=>o.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ce=(o,c)=>{const{code:i,message:d}=Oe(o),h=_e(d);return i==="auth/invalid-credential"||i==="auth/wrong-password"||i==="auth/user-not-found"?"Invalid email or password. Please check your credentials and try again.":i==="auth/email-already-in-use"?"This email is already registered. Please sign in instead.":i==="auth/weak-password"||i==="auth/password-does-not-meet-requirements"?h?`Password does not meet signup requirements. ${h}`:`Password does not meet signup requirements. ${B}`:i==="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.":i==="auth/network-request-failed"?"Network error. Please check your internet connection and try again.":i.startsWith("auth/")?h||c:d.includes("Firebase:")||d.includes("auth/")?c:d||c},mt=()=>{const o=["Grade 11","Grade 12"],c={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"],"Grade 12":["STEM A","STEM B","ABM A","HUMSS A"]},i={teacher:["Mathematics","Science","English","Technology","Humanities"]},[d,h]=s.useState(""),[b,z]=s.useState(""),[A,de]=s.useState(!1),[l,q]=s.useState(!1),[M,me]=s.useState(""),[n,O]=s.useState("student"),[f,ue]=s.useState("Grade 11"),[w,_]=s.useState(c["Grade 11"][0]),[g,G]=s.useState("Mathematics"),[V,x]=s.useState(!1),[v,u]=s.useState(null),[pe,xe]=s.useState(!1),[ye,he]=s.useState(!1),[E,fe]=s.useState(16),[F,U]=s.useState("primary"),[$,T]=s.useState(0),R=s.useRef(null),C=s.useRef(null),N=pe&&ye,j=s.useRef("primary"),k=s.useRef(0),S=s.useRef(!1),W=1.1,H=.34,Y=t=>{const a=Math.max(0,Math.min(1,t));Math.abs(k.current-a)<.02||(k.current=a,T(a))},Z=t=>{!Number.isFinite(t)||t<=0||Math.abs(E-t)>.05&&fe(t)},I=s.useMemo(()=>qe.map(t=>({...t,met:t.test(b)})),[b]),be=s.useMemo(()=>I.every(t=>t.met),[I]),J=s.useMemo(()=>{if(!l||!v)return!1;const t=v.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[v,l]),ge=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&Z(t)},ve=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&Z(t)};s.useEffect(()=>{if(!N)return;const t=R.current,a=C.current;if(!t||!a)return;let m=!1,p=0;j.current="primary",U("primary"),S.current=!1,k.current=0,T(0),t.loop=!1,a.loop=!1,t.currentTime=0,a.currentTime=0,a.pause(),t.play().catch(()=>{});const P=()=>{if(m)return;const y=j.current==="primary"?t:a,K=j.current==="primary"?a:t,Pe=Number.isFinite(y.duration)&&y.duration>0?y.duration:E,L=Math.max(Pe-y.currentTime,0);if(L<=W){S.current||(S.current=!0,K.currentTime=0,K.play().catch(()=>{}));const Ae=1-L/W;if(Y(Ae),L<=.03||y.ended){y.pause(),y.currentTime=0;const ee=j.current==="primary"?"secondary":"primary";j.current=ee,U(ee),S.current=!1,k.current=0,T(0)}}else Y(0);p=window.requestAnimationFrame(P)};return p=window.requestAnimationFrame(P),()=>{m=!0,p&&window.cancelAnimationFrame(p)}},[E,N]);const Q=N?H*(1-$):0,X=N?H*$:0,je=F==="primary"?Q:X,we=F==="secondary"?Q:X;s.useEffect(()=>{n==="teacher"&&!i.teacher.includes(g)&&G(i.teacher[0])},[g,n]),s.useEffect(()=>{const t=c[f]||[];t.length>0&&!t.includes(w)&&_(t[0])},[f,w]);const Ne=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:oe,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:ie,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:ze,color:"rose"}],ke=async(t,a,m)=>{u(null),x(!0),h(t),z(a),O(m),q(!1);try{se(m),await ae(t,a)}catch(p){u(ce(p,"Demo sign-in failed. Please try again.")),x(!1)}},Se=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!M.trim()){u("Please enter your name"),x(!1);return}if(n==="student"&&!f){u("Please select a grade level"),x(!1);return}if(n!=="student"&&!g){u("Please select a department"),x(!1);return}if(n==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!be){u(`Password does not meet signup requirements. ${B}`),x(!1);return}se(n),await Ee(d,b,M,n,n==="student"?{grade:f,section:w}:{department:g})}else await ae(d,b)}catch(a){const m=l?`Sign-up failed. ${B}`:"Sign-in failed. Please check your credentials and try again.";u(ce(a,m)),x(!1)}};return e.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>xe(!0),onLoadedMetadata:ge,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":je},src:ne}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>he(!0),onLoadedMetadata:ve,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":we},src:ne}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(r.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(r.div,{className:"flex items-center gap-2.5",children:[e.jsx(r.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.jsx("h1",{className:"text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Te,{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(r.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:Re,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ce,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:Ie,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,a)=>{const m=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"},P={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},y={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(r.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 ${y[t.color]} flex items-center justify-center mb-3`,children:e.jsx(m,{size:18,className:P[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(r.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.15,ease:[.22,1,.36,1]},className:"relative flex justify-center lg:justify-end",children:e.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)]",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-purple-500 via-pink-500 to-sky-500"}),e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-80 h-80 bg-gradient-to-br from-purple-400/20 to-pink-400/20 rounded-full blur-[60px] pointer-events-none"}),e.jsxs("div",{className:"text-center mb-6 relative",children:[e.jsx(r.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:l?"Create Account":"Welcome Back"}),e.jsx(r.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:l?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:Se,className:"space-y-4 mb-5 relative",children:[v&&!J&&e.jsx(r.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:v}),l&&e.jsxs(r.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(re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:"text",placeholder:"Your Name",value:M,onChange:t=>me(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),l&&e.jsxs(r.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=n===t.role;return e.jsx("button",{type:"button",onClick:()=>O(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)})})]}),l&&n==="student"&&e.jsxs(r.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(oe,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:f,onChange:t=>ue(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:o.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l&&n==="student"&&e.jsxs(r.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(re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:w,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:(c[f]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l&&n!=="student"&&e.jsxs(r.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(ie,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:g,onChange:t=>G(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:i.teacher.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs(r.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(Le,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:"email",placeholder:"your.email@school.edu",value:d,onChange:t=>h(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(r.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(le,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:A?"text":"password",placeholder:"β’β’β’β’β’β’β’β’",value:b,onChange:t=>z(t.target.value),className:"w-full pl-11 pr-11 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0,minLength:l?8:6}),e.jsx(r.button,{type:"button",onClick:()=>de(!A),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:A?e.jsx(De,{size:16}):e.jsx(Be,{size:16})})]}),l&&e.jsxs("div",{className:"mt-2 rounded-lg border border-sky-100/80 bg-sky-50/70 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] font-body font-semibold uppercase tracking-wider text-slate-600",children:"Password requirements"}),e.jsx("ul",{className:"mt-2 space-y-1",children:I.map(t=>e.jsxs("li",{className:`flex items-center gap-2 text-[11px] font-body ${t.met?"text-emerald-700":"text-slate-500"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${t.met?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{children:t.label})]},t.id))}),J&&e.jsx("p",{className:"mt-2 text-[11px] font-body font-semibold text-rose-600",children:"Password does not meet signup requirements."})]})]}),e.jsx(r.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(Me,{type:"submit",disabled:V,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-500 hover:to-pink-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-purple-600/25 hover:shadow-pink-500/35 hover:scale-[1.02] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(r.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:[V?"Please wait...":l?"Create Account":"Sign In",e.jsx(te,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{q(!l),u(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:l?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!l&&e.jsxs(r.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:Ne.map(t=>{const a=t.icon,m={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(r.button,{type:"button",onClick:()=>ke(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 ${m[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(te,{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(r.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(le,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{mt as default};
|
|
|
|
| 1 |
+
import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as Me}from"./button-C6pFOjcg.js";import{I as D}from"./input-DtBdbulD.js";import{m as r,A as te,s as se,a as Ee,b as ae}from"./index-Du57tmo9.js";import{S as Te}from"./sparkles-DseoQb3m.js";import{B as Re}from"./brain-CEG2uNCc.js";import{T as Ce}from"./trending-up-BgWHLAjl.js";import{A as Ie}from"./award-ZQxHm68j.js";import{U as re}from"./users--M0GUX5u.js";import{G as oe}from"./graduation-cap-D6QMIGIe.js";import{B as ie}from"./book-open-cmOvedFO.js";import{M as Le}from"./mail-B4r1HZjf.js";import{L as le}from"./lock-CtsU7Hj2.js";import{E as De,a as Be}from"./eye-Duf559JU.js";import{S as ze}from"./shield-check-DJtXN0Ez.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-markdown-yqZQ_iQm.js";const ne="/assets/shader-bg-DA7bEbBA.mp4",qe=[{id:"length",label:"At least 8 characters",test:o=>o.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:o=>/[A-Z]/.test(o)&&/[a-z]/.test(o)},{id:"number",label:"Contains at least one number",test:o=>/\d/.test(o)},{id:"special",label:"Contains at least one special character",test:o=>/[^A-Za-z0-9]/.test(o)}],B="Use at least 8 characters with uppercase, lowercase, number, and special character.",Oe=o=>{const c=typeof o=="object"&&o!==null?o:null,i=o instanceof Error?o.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:i};const d=i.match(/auth\/[a-z-]+/i);return{code:d?d[0].toLowerCase():"",message:i}},_e=o=>o.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ce=(o,c)=>{const{code:i,message:d}=Oe(o),h=_e(d);return i==="auth/invalid-credential"||i==="auth/wrong-password"||i==="auth/user-not-found"?"Invalid email or password. Please check your credentials and try again.":i==="auth/email-already-in-use"?"This email is already registered. Please sign in instead.":i==="auth/weak-password"||i==="auth/password-does-not-meet-requirements"?h?`Password does not meet signup requirements. ${h}`:`Password does not meet signup requirements. ${B}`:i==="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.":i==="auth/network-request-failed"?"Network error. Please check your internet connection and try again.":i.startsWith("auth/")?h||c:d.includes("Firebase:")||d.includes("auth/")?c:d||c},mt=()=>{const o=["Grade 11","Grade 12"],c={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"],"Grade 12":["STEM A","STEM B","ABM A","HUMSS A"]},i={teacher:["Mathematics","Science","English","Technology","Humanities"]},[d,h]=s.useState(""),[b,z]=s.useState(""),[A,de]=s.useState(!1),[l,q]=s.useState(!1),[M,me]=s.useState(""),[n,O]=s.useState("student"),[f,ue]=s.useState("Grade 11"),[w,_]=s.useState(c["Grade 11"][0]),[g,G]=s.useState("Mathematics"),[V,x]=s.useState(!1),[v,u]=s.useState(null),[pe,xe]=s.useState(!1),[ye,he]=s.useState(!1),[E,fe]=s.useState(16),[F,U]=s.useState("primary"),[$,T]=s.useState(0),R=s.useRef(null),C=s.useRef(null),N=pe&&ye,j=s.useRef("primary"),k=s.useRef(0),S=s.useRef(!1),W=1.1,H=.34,Y=t=>{const a=Math.max(0,Math.min(1,t));Math.abs(k.current-a)<.02||(k.current=a,T(a))},Z=t=>{!Number.isFinite(t)||t<=0||Math.abs(E-t)>.05&&fe(t)},I=s.useMemo(()=>qe.map(t=>({...t,met:t.test(b)})),[b]),be=s.useMemo(()=>I.every(t=>t.met),[I]),J=s.useMemo(()=>{if(!l||!v)return!1;const t=v.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[v,l]),ge=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&Z(t)},ve=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&Z(t)};s.useEffect(()=>{if(!N)return;const t=R.current,a=C.current;if(!t||!a)return;let m=!1,p=0;j.current="primary",U("primary"),S.current=!1,k.current=0,T(0),t.loop=!1,a.loop=!1,t.currentTime=0,a.currentTime=0,a.pause(),t.play().catch(()=>{});const P=()=>{if(m)return;const y=j.current==="primary"?t:a,K=j.current==="primary"?a:t,Pe=Number.isFinite(y.duration)&&y.duration>0?y.duration:E,L=Math.max(Pe-y.currentTime,0);if(L<=W){S.current||(S.current=!0,K.currentTime=0,K.play().catch(()=>{}));const Ae=1-L/W;if(Y(Ae),L<=.03||y.ended){y.pause(),y.currentTime=0;const ee=j.current==="primary"?"secondary":"primary";j.current=ee,U(ee),S.current=!1,k.current=0,T(0)}}else Y(0);p=window.requestAnimationFrame(P)};return p=window.requestAnimationFrame(P),()=>{m=!0,p&&window.cancelAnimationFrame(p)}},[E,N]);const Q=N?H*(1-$):0,X=N?H*$:0,je=F==="primary"?Q:X,we=F==="secondary"?Q:X;s.useEffect(()=>{n==="teacher"&&!i.teacher.includes(g)&&G(i.teacher[0])},[g,n]),s.useEffect(()=>{const t=c[f]||[];t.length>0&&!t.includes(w)&&_(t[0])},[f,w]);const Ne=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:oe,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:ie,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:ze,color:"rose"}],ke=async(t,a,m)=>{u(null),x(!0),h(t),z(a),O(m),q(!1);try{se(m),await ae(t,a)}catch(p){u(ce(p,"Demo sign-in failed. Please try again.")),x(!1)}},Se=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!M.trim()){u("Please enter your name"),x(!1);return}if(n==="student"&&!f){u("Please select a grade level"),x(!1);return}if(n!=="student"&&!g){u("Please select a department"),x(!1);return}if(n==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!be){u(`Password does not meet signup requirements. ${B}`),x(!1);return}se(n),await Ee(d,b,M,n,n==="student"?{grade:f,section:w}:{department:g})}else await ae(d,b)}catch(a){const m=l?`Sign-up failed. ${B}`:"Sign-in failed. Please check your credentials and try again.";u(ce(a,m)),x(!1)}};return e.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>xe(!0),onLoadedMetadata:ge,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":je},src:ne}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>he(!0),onLoadedMetadata:ve,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":we},src:ne}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(r.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(r.div,{className:"flex items-center gap-2.5",children:[e.jsx(r.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.jsx("h1",{className:"text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Te,{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(r.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:Re,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ce,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:Ie,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,a)=>{const m=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"},P={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},y={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(r.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 ${y[t.color]} flex items-center justify-center mb-3`,children:e.jsx(m,{size:18,className:P[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(r.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.15,ease:[.22,1,.36,1]},className:"relative flex justify-center lg:justify-end",children:e.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)]",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-purple-500 via-pink-500 to-sky-500"}),e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-80 h-80 bg-gradient-to-br from-purple-400/20 to-pink-400/20 rounded-full blur-[60px] pointer-events-none"}),e.jsxs("div",{className:"text-center mb-6 relative",children:[e.jsx(r.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:l?"Create Account":"Welcome Back"}),e.jsx(r.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:l?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:Se,className:"space-y-4 mb-5 relative",children:[v&&!J&&e.jsx(r.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:v}),l&&e.jsxs(r.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(re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:"text",placeholder:"Your Name",value:M,onChange:t=>me(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),l&&e.jsxs(r.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=n===t.role;return e.jsx("button",{type:"button",onClick:()=>O(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)})})]}),l&&n==="student"&&e.jsxs(r.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(oe,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:f,onChange:t=>ue(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:o.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l&&n==="student"&&e.jsxs(r.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(re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:w,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:(c[f]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l&&n!=="student"&&e.jsxs(r.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(ie,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:g,onChange:t=>G(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:i.teacher.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs(r.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(Le,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:"email",placeholder:"your.email@school.edu",value:d,onChange:t=>h(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(r.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(le,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:A?"text":"password",placeholder:"β’β’β’β’β’β’β’β’",value:b,onChange:t=>z(t.target.value),className:"w-full pl-11 pr-11 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0,minLength:l?8:6}),e.jsx(r.button,{type:"button",onClick:()=>de(!A),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:A?e.jsx(De,{size:16}):e.jsx(Be,{size:16})})]}),l&&e.jsxs("div",{className:"mt-2 rounded-lg border border-sky-100/80 bg-sky-50/70 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] font-body font-semibold uppercase tracking-wider text-slate-600",children:"Password requirements"}),e.jsx("ul",{className:"mt-2 space-y-1",children:I.map(t=>e.jsxs("li",{className:`flex items-center gap-2 text-[11px] font-body ${t.met?"text-emerald-700":"text-slate-500"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${t.met?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{children:t.label})]},t.id))}),J&&e.jsx("p",{className:"mt-2 text-[11px] font-body font-semibold text-rose-600",children:"Password does not meet signup requirements."})]})]}),e.jsx(r.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(Me,{type:"submit",disabled:V,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-500 hover:to-pink-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-purple-600/25 hover:shadow-pink-500/35 hover:scale-[1.02] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(r.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:[V?"Please wait...":l?"Create Account":"Sign In",e.jsx(te,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{q(!l),u(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:l?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!l&&e.jsxs(r.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:Ne.map(t=>{const a=t.icon,m={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(r.button,{type:"button",onClick:()=>ke(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 ${m[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(te,{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(r.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(le,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{mt as default};
|
assets/{LogoutActionButton-w1PkauXp.js β LogoutActionButton-XXsvBOAH.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as a,m as s,f as i}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as a,m as s,f as i}from"./index-Du57tmo9.js";import{j as t}from"./vendor-react-B4AQeu28.js";import{L as l}from"./log-out-SC88Jnul.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ModuleFolderCard-BJl0S3M8.js β ModuleFolderCard-DFi0m1Zn.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{j as e}from"./vendor-react-B4AQeu28.js";import{u as g}from"./useSubjectAvailability-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{j as e}from"./vendor-react-B4AQeu28.js";import{u as g}from"./useSubjectAvailability-BhYsHQ11.js";import{c as u,m as w,T as f}from"./index-Du57tmo9.js";import{B as j}from"./book-open-cmOvedFO.js";import{C as v}from"./clock-BtWjBj1h.js";import{L as k}from"./lock-CtsU7Hj2.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/ModulesPage-CaIkpigw.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/ModulesPage-DHibj58D.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{ProfileModal-CCkbSstb.js β ProfileModal-D0s9Ytgo.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as c}from"./button-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as c}from"./button-C6pFOjcg.js";import{I as l}from"./input-DtBdbulD.js";import{c as w,h as M,m as N,an as P,as as A}from"./index-Du57tmo9.js";import{P as R,G as U}from"./ProfilePictureUploader-CmusgPWl.js";import{X as B}from"./x-Cwkkamrh.js";import{U as u}from"./users--M0GUX5u.js";import{M as D}from"./mail-B4r1HZjf.js";import{A as b}from"./award-ZQxHm68j.js";import{B as k}from"./book-open-cmOvedFO.js";import{C as F}from"./calendar-DguKdDEr.js";import{S as T}from"./save-BYv1sqTn.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-markdown-yqZQ_iQm.js";import"./minus-DyrqHtmD.js";import"./plus-gReuWg-C.js";import"./upload-CONq3UoZ.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ProfilePictureUploader-BVT_TKTZ.js β ProfilePictureUploader-CmusgPWl.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as ue,f as B,O as q,
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as ue,f as B,O as q,at as ge,au as ve,u as we,w as xe,x as ye,y as be,h as Ce,m as V,t as K}from"./index-Du57tmo9.js";import{g as Pe,r as v,j as p}from"./vendor-react-B4AQeu28.js";import{_ as Re,B as b,E as Ee,G as Se,H as _e,J as ze}from"./vendor-radix-DnWAlVSW.js";import{B as J}from"./button-C6pFOjcg.js";import{updateProfile as De}from"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import{r as Me,u as Ae,a as Ne}from"./vendor-firebase-storage-DNmrKfQ-.js";import{X as Te}from"./x-Cwkkamrh.js";import{M as je}from"./minus-DyrqHtmD.js";import{P as Ue}from"./plus-gReuWg-C.js";import{U as Fe}from"./upload-CONq3UoZ.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/QuizBattlePage-1dVgBLvH.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/QuizBattlePage-DP7m_bnv.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{RewardsModal-C5DMk9fO.js β RewardsModal-MXZjyis_.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./vendor-react-B4AQeu28.js";import{X as f}from"./x-
|
|
|
|
| 1 |
+
import{j as e}from"./vendor-react-B4AQeu28.js";import{X as f}from"./x-Cwkkamrh.js";import{E as o,F as d,Z as h}from"./index-Du57tmo9.js";import{S as n}from"./star-BBetp7Wf.js";import{T as g}from"./trophy-8udS7pQx.js";import{T as j}from"./target-B_JwHjFq.js";import{B as u}from"./book-open-cmOvedFO.js";import{A as N}from"./award-ZQxHm68j.js";import{C as v}from"./calendar-DguKdDEr.js";import{U as w}from"./users--M0GUX5u.js";import{T as y}from"./trending-up-BgWHLAjl.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";const W=({isOpen:c,onClose:r,userLevel:t,currentXP:i,xpToNextLevel:a,totalXP:x,streak:m})=>{if(!c)return null;const p=[{id:"1",icon:n,title:"First Steps",description:"Complete your first video lesson",unlocked:!0,color:"text-[#9956DE]",bgColor:"bg-[#FB96BB]/20"},{id:"2",icon:g,title:"Quiz Master",description:"Score 100% on any quiz",unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"3",icon:d,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:j,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:u,title:"Knowledge Seeker",description:"Watch 20 video lessons",unlocked:!0,color:"text-[#1FA7E1]",bgColor:"bg-[#6ED1CF]/20"},{id:"6",icon:h,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:N,title:"XP Hunter",description:"Earn 1000 XP",unlocked:!0,color:"text-[#7274ED]",bgColor:"bg-[#7274ED]/15"},{id:"9",icon:v,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:w,title:"Monthly Champion",description:"Maintain a 30-day streak",progress:2,total:30,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"}],b=[{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:r}),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:r,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(f,{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(n,{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(d,{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," / ",a," XP"]})}),e.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500 e-w",style:{"--w":`${i/a*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:p.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 e-w",style:{"--w":`${s.progress/s.total*100}%`}})})]})]})]})},s.id)})})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:e.jsx(y,{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:b.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{W as default};
|
assets/{RightSidebar-CB4PJstQ.js β RightSidebar-CfqBTJ6T.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as m,j as e}from"./vendor-react-B4AQeu28.js";import{q as R}from"./quiz_battle_avatar-BXHPSput.js";import{h as q,m as h,Z as P,F as $,z as W,E as N}from"./index-fWY85Kyg.js";import{S as Y}from"./swords-Btzyg4ct.js";import{C as M}from"./circle-check-big-Qn5jJKfH.js";import{T as O,a as X,b as Z}from"./tooltip-DQuc9Ksp.js";import{T as H}from"./trophy-fJOOsc_0.js";import{C}from"./chevron-right-mxUv3EB7.js";import{S as J}from"./star-BKdRsvg1.js";import{L as K}from"./loader-circle-id_hZlNw.js";import{U as k}from"./user-Cp86-wJG.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";const D=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(Y,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Keep It Up!",subtitle:"Maintain your daily learning streak",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx($,{size:24,fill:"currentColor",className:"text-white"}),buttonText:null,actionType:null,avatarText:"You are doing great!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],G=(r=[])=>{const a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],o=new Date,d=o.getDay(),l=[];for(let i=0;i<7;i++){const t=new Date(o);t.setDate(o.getDate()-d+i);const s=i===d,n=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,g=r.includes(n);l.push({dayName:a[i],dateNumber:t.getDate(),isToday:s,hasDot:g})}return l},Q=({streakHistory:r=[],onNavigateToQuizBattle:a,userPhoto:o})=>{const[d,l]=m.useState(0),i=G(r);m.useEffect(()=>{const s=setInterval(()=>{l(n=>(n+1)%D.length)},5e3);return()=>clearInterval(s)},[]);const t=D[d];return e.jsxs("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:[e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(q,{mode:"wait",children:e.jsxs(h.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:R,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:s=>{s.stopPropagation(),t.actionType==="quiz-battle"&&a&&a()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[o?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:o,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(P,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display text-[15px] font-bold text-[#141b2d] mb-4 px-1",children:"Your streak"}),e.jsx("div",{className:"flex justify-between items-center gap-1.5 px-0.5",children:i.map((s,n)=>e.jsxs("div",{className:`flex flex-col items-center pt-2 pb-3 w-[46px] h-[72px] rounded-[24px] border ${s.isToday?"bg-[#12192b] text-white border-transparent shadow-[0_8px_16px_rgba(18,25,43,0.3)] transform -translate-y-1":"bg-white text-slate-400 border-slate-200/80 hover:border-slate-300"} transition-all duration-200 cursor-pointer`,children:[e.jsx("div",{className:"h-1.5 flex items-center justify-center mb-1.5",children:s.hasDot?e.jsx("div",{className:`w-[5px] h-[5px] rounded-full ${s.isToday?"bg-white":"bg-slate-300"}`}):e.jsx("div",{className:`text-[10px] ${s.isToday?"text-white/50":"text-slate-200"} font-bold`,children:"+"})}),e.jsx("span",{className:`text-[11px] font-bold mb-1 ${s.isToday?"text-slate-300":"text-slate-400/80"}`,children:s.dayName}),e.jsx("span",{className:`text-[15px] font-bold leading-none ${s.isToday?"text-white":"text-[#334155]"}`,children:s.dateNumber})]},n))})]})]})},U=r=>{if(r>=1e3){const a=r/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${r}`},V=({entry:r,rank:a,isYou:o,userPhoto:d,rankColor:l})=>{const i=o&&d||r?.photo,t=o?"You":r?.name||"---",s=r?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(h.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(N,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${l.border} z-10 relative overflow-hidden ${l.shadow} bg-white`,children:i?e.jsx("img",{src:i,alt:t,className:"w-full h-full object-cover",onError:n=>{n.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${l.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:t}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${l.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[U(s)," XP"]})]})]})},ge=({currentUserId:r,onOpenRewards:a,onOpenLeaderboard:o,onNavigateToModules:d,onNavigateToQuizBattle:l,userLevel:i,userPhoto:t,currentXP:s,xpToNextLevel:n,streak:g,streakHistory:_=[]})=>{const y=s/n*100,[F,S]=m.useState([]),[E,b]=m.useState(!0),[T,j]=m.useState(null),u=m.useRef(null);m.useEffect(()=>{if(!r){b(!1);return}b(!0),j(null);const x=W(f=>{S(f),b(!1),j(null)},r,!1,"all",3);u.current=x;const p=setTimeout(()=>{b&&(b(!1),j("Leaderboard data unavailable"))},12e3);return()=>{clearTimeout(p),u.current&&(u.current(),u.current=null)}},[r]);const c=F.slice(0,3);c.some(x=>x.userId===r);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],L=["74px","54px","38px"],A=["w-[78px]","w-[70px]","w-[70px]"],w=(x,p,f,B,v)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(V,{entry:x,rank:f,isYou:B==="You",userPhoto:t,rankColor:z[v]}),e.jsxs(h.div,{initial:{height:0},animate:{height:L[p]},transition:{delay:.2+p*.1,duration:.5,ease:"easeOut"},className:`${A[p]} bg-gradient-to-b ${z[v].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${v===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:f}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(h.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(H,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(C,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(N,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",i]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(X,{asChild:!0,children:e.jsxs("button",{onClick:x=>{x.stopPropagation(),d?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(J,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[s," XP"]})]})}),e.jsx(Z,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx($,{size:12,className:"text-[#FF8B8B]"}),e.jsxs("span",{className:"font-bold",children:[g,"d"]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",i+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(y),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(h.div,{initial:{width:0},animate:{width:`${y}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(h.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(Q,{streakHistory:_,onNavigateToQuizBattle:l,userPhoto:t})}),e.jsxs(h.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:o,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(N,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(C,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:E?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(K,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):T||c.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:T||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[w(c[1],1,2,c[1]?.name||"---",1),w(c[0],0,1,c[0]?.name||"---",0),w(c[2],2,3,c[2]?.name||"---",2)]})})]})]})};export{ge as default};
|
|
|
|
| 1 |
+
import{r as m,j as e}from"./vendor-react-B4AQeu28.js";import{q as R}from"./quiz_battle_avatar-BXHPSput.js";import{h as q,m as h,Z as P,F as $,z as W,E as N}from"./index-Du57tmo9.js";import{S as Y}from"./swords-Bu0_wc8h.js";import{C as M}from"./circle-check-big-DC9utj0Y.js";import{T as O,a as X,b as Z}from"./tooltip-C0JcTMbS.js";import{T as H}from"./trophy-8udS7pQx.js";import{C}from"./chevron-right-CFOFOVBg.js";import{S as J}from"./star-BBetp7Wf.js";import{L as K}from"./loader-circle-Bluo8e0c.js";import{U as k}from"./user-DPqSTqXe.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";const D=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(Y,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Keep It Up!",subtitle:"Maintain your daily learning streak",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx($,{size:24,fill:"currentColor",className:"text-white"}),buttonText:null,actionType:null,avatarText:"You are doing great!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],G=(r=[])=>{const a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],o=new Date,d=o.getDay(),l=[];for(let i=0;i<7;i++){const t=new Date(o);t.setDate(o.getDate()-d+i);const s=i===d,n=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,g=r.includes(n);l.push({dayName:a[i],dateNumber:t.getDate(),isToday:s,hasDot:g})}return l},Q=({streakHistory:r=[],onNavigateToQuizBattle:a,userPhoto:o})=>{const[d,l]=m.useState(0),i=G(r);m.useEffect(()=>{const s=setInterval(()=>{l(n=>(n+1)%D.length)},5e3);return()=>clearInterval(s)},[]);const t=D[d];return e.jsxs("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:[e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(q,{mode:"wait",children:e.jsxs(h.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:R,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:s=>{s.stopPropagation(),t.actionType==="quiz-battle"&&a&&a()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[o?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:o,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(P,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display text-[15px] font-bold text-[#141b2d] mb-4 px-1",children:"Your streak"}),e.jsx("div",{className:"flex justify-between items-center gap-1.5 px-0.5",children:i.map((s,n)=>e.jsxs("div",{className:`flex flex-col items-center pt-2 pb-3 w-[46px] h-[72px] rounded-[24px] border ${s.isToday?"bg-[#12192b] text-white border-transparent shadow-[0_8px_16px_rgba(18,25,43,0.3)] transform -translate-y-1":"bg-white text-slate-400 border-slate-200/80 hover:border-slate-300"} transition-all duration-200 cursor-pointer`,children:[e.jsx("div",{className:"h-1.5 flex items-center justify-center mb-1.5",children:s.hasDot?e.jsx("div",{className:`w-[5px] h-[5px] rounded-full ${s.isToday?"bg-white":"bg-slate-300"}`}):e.jsx("div",{className:`text-[10px] ${s.isToday?"text-white/50":"text-slate-200"} font-bold`,children:"+"})}),e.jsx("span",{className:`text-[11px] font-bold mb-1 ${s.isToday?"text-slate-300":"text-slate-400/80"}`,children:s.dayName}),e.jsx("span",{className:`text-[15px] font-bold leading-none ${s.isToday?"text-white":"text-[#334155]"}`,children:s.dateNumber})]},n))})]})]})},U=r=>{if(r>=1e3){const a=r/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${r}`},V=({entry:r,rank:a,isYou:o,userPhoto:d,rankColor:l})=>{const i=o&&d||r?.photo,t=o?"You":r?.name||"---",s=r?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(h.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(N,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${l.border} z-10 relative overflow-hidden ${l.shadow} bg-white`,children:i?e.jsx("img",{src:i,alt:t,className:"w-full h-full object-cover",onError:n=>{n.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${l.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:t}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${l.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[U(s)," XP"]})]})]})},ge=({currentUserId:r,onOpenRewards:a,onOpenLeaderboard:o,onNavigateToModules:d,onNavigateToQuizBattle:l,userLevel:i,userPhoto:t,currentXP:s,xpToNextLevel:n,streak:g,streakHistory:_=[]})=>{const y=s/n*100,[F,S]=m.useState([]),[E,b]=m.useState(!0),[T,j]=m.useState(null),u=m.useRef(null);m.useEffect(()=>{if(!r){b(!1);return}b(!0),j(null);const x=W(f=>{S(f),b(!1),j(null)},r,!1,"all",3);u.current=x;const p=setTimeout(()=>{b&&(b(!1),j("Leaderboard data unavailable"))},12e3);return()=>{clearTimeout(p),u.current&&(u.current(),u.current=null)}},[r]);const c=F.slice(0,3);c.some(x=>x.userId===r);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],L=["74px","54px","38px"],A=["w-[78px]","w-[70px]","w-[70px]"],w=(x,p,f,B,v)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(V,{entry:x,rank:f,isYou:B==="You",userPhoto:t,rankColor:z[v]}),e.jsxs(h.div,{initial:{height:0},animate:{height:L[p]},transition:{delay:.2+p*.1,duration:.5,ease:"easeOut"},className:`${A[p]} bg-gradient-to-b ${z[v].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${v===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:f}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(h.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(H,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(C,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(N,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",i]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(X,{asChild:!0,children:e.jsxs("button",{onClick:x=>{x.stopPropagation(),d?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(J,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[s," XP"]})]})}),e.jsx(Z,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx($,{size:12,className:"text-[#FF8B8B]"}),e.jsxs("span",{className:"font-bold",children:[g,"d"]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",i+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(y),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(h.div,{initial:{width:0},animate:{width:`${y}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(h.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(Q,{streakHistory:_,onNavigateToQuizBattle:l,userPhoto:t})}),e.jsxs(h.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:o,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(N,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(C,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:E?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(K,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):T||c.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:T||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[w(c[1],1,2,c[1]?.name||"---",1),w(c[0],0,1,c[0]?.name||"---",0),w(c[2],2,3,c[2]?.name||"---",2)]})})]})]})};export{ge as default};
|
assets/{ScientificCalculator-YnJAbv_n.js β ScientificCalculator-3ObnUHS8.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{c as Z,e as de,h as U,m as ue}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{c as Z,e as de,h as U,m as ue}from"./index-Du57tmo9.js";import{C as fe,a as pe}from"./chevron-up-Dmffgx6p.js";import{X as be}from"./x-Cwkkamrh.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{SettingsModal-D8-maWNc.js β SettingsModal-BlGAAMMC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{c as se,h as be,m as E,D as pe,t as d}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{c as se,h as be,m as E,D as pe,t as d}from"./index-Du57tmo9.js";import{B as x}from"./button-C6pFOjcg.js";import{I as l}from"./input-DtBdbulD.js";import{S as m}from"./switch-YVS1owKs.js";import Z from"./ConfirmModal-CGEO_l_6.js";import{G as ye,P as je}from"./ProfilePictureUploader-CmusgPWl.js";import{U as ge}from"./user-DPqSTqXe.js";import{B as Ne}from"./bell-CVB0-Rn1.js";import{S as ve}from"./shield-QK9XTLqm.js";import{D as ee}from"./download-VEXmhhD6.js";import{X as te}from"./x-Cwkkamrh.js";import{L as we}from"./lock-CtsU7Hj2.js";import{C as ke}from"./clock-BtWjBj1h.js";import{T as Ce}from"./trash-2-uIChez5o.js";import{E as Se,a as Ee}from"./eye-Duf559JU.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";import"./log-out-SC88Jnul.js";import"./minus-DyrqHtmD.js";import"./plus-gReuWg-C.js";import"./upload-CONq3UoZ.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{Sidebar-D_VIy77A.js β Sidebar-SiyazvIi.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as h,j as e}from"./vendor-react-B4AQeu28.js";import{S as N,a as $,L as u,M as D}from"./LogoutActionButton-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as h,j as e}from"./vendor-react-B4AQeu28.js";import{S as N,a as $,L as u,M as D}from"./LogoutActionButton-XXsvBOAH.js";import{c as G,m as c,f as P}from"./index-Du57tmo9.js";import{T as S,a as M,b as L}from"./tooltip-C0JcTMbS.js";import{X as U}from"./x-Cwkkamrh.js";import{C as _}from"./chevron-right-CFOFOVBg.js";import{C as q}from"./chevron-left-mWdIDmIc.js";import{U as C}from"./users--M0GUX5u.js";import{G as A}from"./graduation-cap-D6QMIGIe.js";import{B as f}from"./book-open-cmOvedFO.js";import{C as T}from"./chart-column-Cqncpeum.js";import{S as F}from"./shield-QK9XTLqm.js";import{S as Q}from"./swords-Bu0_wc8h.js";import{T as W}from"./trophy-8udS7pQx.js";import{S as X}from"./shirt-wJF8-Ry8.js";import"./log-out-SC88Jnul.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{SupplementalBanner-BWRH1BJK.js β SupplementalBanner-2F2CcBwT.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,r as y}from"./vendor-react-B4AQeu28.js";import{h as j,m as p,T as h}from"./index-
|
|
|
|
| 1 |
+
import{j as e,r as y}from"./vendor-react-B4AQeu28.js";import{h as j,m as p,T as h}from"./index-Du57tmo9.js";import{X as v}from"./x-Cwkkamrh.js";import{S as w}from"./sparkles-DseoQb3m.js";import{C as f}from"./chevron-right-CFOFOVBg.js";import{B as g}from"./book-open-cmOvedFO.js";import{T as m}from"./trending-up-BgWHLAjl.js";import{B as x}from"./brain-CEG2uNCc.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";const b={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:e.jsx(m,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:e.jsx(g,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:e.jsx(m,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:e.jsx(x,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:e.jsx(m,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:e.jsx(x,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:e.jsx(m,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:e.jsx(x,{size:14})}]};function u(i){const s=i.toLowerCase();return s==="functions"||s.includes("function")||s==="businessmath"||s.includes("business")||s==="logic"||s.includes("reason")||s.includes("general")||s.includes("gen-math")||s.includes("gen math")?"General Mathematics":s.includes("stat")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("basic")||s.includes("calc")?"Basic Calculus":null}function N(i){const s=i.trim().toLowerCase();return s==="functions"?"Functions and Graphs":s==="businessmath"?"Business and Financial Mathematics":s==="logic"?"Logic and Reasoning":i}const k=({atRiskSubjects:i=[],onAction:s,onDismiss:n})=>{const[l,a]=y.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(j,{children:!l&&e.jsx(p.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-10,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"relative bg-gradient-to-r from-sky-600 via-sky-500 to-sky-600 rounded-2xl p-5 text-white shadow-lg shadow-sky-500/20",children:[e.jsx("button",{onClick:r,className:"absolute top-3 right-3 w-7 h-7 bg-white/20 hover:bg-white/30 rounded-full flex items-center justify-center transition-colors",children:e.jsx(v,{size:14})}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(w,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold text-lg mb-1",children:"Supplemental Materials Available"}),e.jsx("p",{className:"text-sky-100 text-sm mb-3",children:"Based on your diagnostic assessment, we've identified topics that could use extra practice. Strengthening these areas will improve your overall performance."}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:i.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full text-xs font-semibold",children:[e.jsx(h,{size:12}),N(t)]},t))}),e.jsxs("button",{onClick:s,className:"inline-flex items-center gap-2 bg-white text-sky-600 font-bold text-sm px-4 py-2 rounded-xl hover:bg-sky-50 transition-colors",children:["Review Topics",e.jsx(f,{size:16})]})]})]})]})})})},z=({quizSubject:i,atRiskSubjects:s=[]})=>{const n=i?u(i):null;if(!s.some(r=>{const t=u(r);return t&&t===n})||!n)return null;const a=b[n]||[];return e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(h,{size:14,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area β ",n]})]}),e.jsx("p",{className:"text-xs text-rose-700 mb-2",children:"This topic was flagged in your diagnostic. Take your time and review the explanations carefully."}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.slice(0,2).map((r,t)=>e.jsxs("span",{className:"inline-flex items-center gap-1 bg-rose-100 text-rose-700 px-2 py-0.5 rounded-md text-xs font-medium",children:[r.icon,r.label]},t))})]})})},C=({quizSubject:i,quizScore:s=0,atRiskSubjects:n=[],onAction:l})=>{const a=i?u(i):null,r=n.some(c=>{const d=u(c);return d&&d===a});if(s>=70&&!r)return null;const t=a?b[a]||[]:[],o=s<70;return e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:e.jsx("div",{className:`rounded-2xl p-4 border-2 ${o?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${o?"bg-orange-500":"bg-sky-500"}`,children:e.jsx(g,{size:20,className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:o?"Review Recommended":"Supplemental Materials"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:o?`You scored ${s}% on this quiz. We recommend reviewing the following resources to strengthen your understanding.`:"This topic was identified as an area for growth. Check out these additional resources."}),t.length>0&&e.jsx("div",{className:"space-y-1.5 mb-3",children:t.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${o?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),e.jsxs("span",{className:"text-slate-500",children:["β ",c.description]})]},d))}),l&&e.jsxs("button",{onClick:l,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${o?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Review Topics",e.jsx(f,{size:12})]})]})]})})})},V=i=>{switch(i.variant){case"compact":return e.jsx(z,{...i});case"results":return e.jsx(C,{...i});case"full":default:return e.jsx(k,{...i})}};export{V as default};
|
assets/{TeacherDashboard-DNWwq_ue.js β TeacherDashboard-DlC2jUJq.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{XPNotification-B39PrFBD.js β XPNotification-CRyPsEGd.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{h as n,m as s}from"./index-
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{h as n,m as s}from"./index-Du57tmo9.js";import{S as m}from"./star-BBetp7Wf.js";import{S as c}from"./sparkles-DseoQb3m.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-firebase-firestore-52DD1vc9.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";const w=({xp:r,message:a,show:t,onComplete:i})=>(l.useEffect(()=>{if(t){const o=setTimeout(()=>{i()},3e3);return()=>clearTimeout(o)}},[t,i]),e.jsx(n,{children:t&&e.jsx(s.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-8 left-1/2 -translate-x-1/2 z-50",style:{willChange:"transform, opacity"},children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-400 via-orange-500 to-rose-500 text-white px-6 py-4 rounded-2xl shadow-2xl border-2 border-rose-300 flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(m,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(s.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:e.jsx(c,{size:16,className:"text-rose-200"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:a}),e.jsxs("p",{className:"text-2xl font-black",children:["+",r," XP"]})]})]})})}));export{w as default};
|
assets/{automationService-DoO5SNeM.js β automationService-ChmA_Dh7.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as g,e as a,a as c,s as l,m as D,q as z,w as b,h as A,u as C,n as Q}from"./vendor-firebase-firestore-52DD1vc9.js";import{d as r,
|
|
|
|
| 1 |
+
import{d as g,e as a,a as c,s as l,m as D,q as z,w as b,h as A,u as C,n as Q}from"./vendor-firebase-firestore-52DD1vc9.js";import{d as r,av as $}from"./index-Du57tmo9.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";const m=async(e,n,o,u,i)=>{try{const t=g(a(r,"notifications")),s={id:t.id,userId:e,type:n,title:o,message:u,read:!1,...i?{actionUrl:i}:{},createdAt:new Date},d={id:s.id,userId:s.userId,type:s.type,title:s.title,message:s.message,read:s.read,createdAt:c(),link:i||null};return await l(t,{...d}),s}catch(t){throw console.error("Error creating notification:",t),t}};async function E(e){if(!e)return 0;const n=a(r,"deepDiagnosticAssignments"),o=z(n,b("lrn","==",e));return(await A(o)).docs.filter(i=>{const t=i.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function M(e,n,o="Grade 11",u,i="iar_only",t="initial_assessment"){if(t==="followup_diagnostic"){const s=a(r,"deepDiagnosticAssignments"),d=z(s,b("lrn","==",e)),f=await A(d);if(!f.empty){const p=Q(r);let w=!1;for(const h of f.docs){const I=h.data().status;(I==="pending"||I==="queued")&&(p.update(h.ref,{status:"in_progress",startedAt:c()}),w=!0)}w&&await p.commit()}}return await l(g(r,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:o,workflowMode:i,assessmentType:t,questionBreakdown:u||null,completedAt:c(),processed:!1,processing:!1}),{success:!0,event:"diagnostic_completed",lrn:e,message:`Diagnostic submitted for ${e}. Processing will begin automatically.`,remedialQuizzesCreated:0,notifications:["Your diagnostic results are being processed. Check back shortly!"]}}async function x(e){return await D(a(r,"quizResults"),{lrn:e.lrn,studentId:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:c()}),{success:!0,event:"quiz_submitted",lrn:e.lrn,message:`Quiz submitted for ${e.lrn}. Risk recalculation will run automatically.`,remedialQuizzesCreated:0,notifications:[`Quiz result recorded for ${e.subject}.`]}}async function N(e){return await $(e.lrn),await m(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await m(e.teacherId,"message","New Student Enrolled",`${e.name} has joined. Diagnostic assessment is pending.`),{success:!0,event:"student_enrolled",lrn:e.lrn,message:`Student ${e.name} enrolled and initialised`,remedialQuizzesCreated:0,notifications:[`Welcome ${e.name}! Please complete the diagnostic assessment.`]}}async function W(e){return await D(a(r,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:c(),processed:!1}),await m(e.teacherId,"message","Data Import Processed",`Data import complete β ${e.students.length} student records processed.`),{success:!0,event:"data_imported",message:`Data import processed for ${e.students.length} students`,remedialQuizzesCreated:0,notifications:[`Data import complete β ${e.students.length} student records processed.`]}}async function G(e){const n=g(r,"curriculumContent",e.contentId);return e.action==="delete"?await C(n,{deleted:!0,deletedBy:e.adminId,deletedAt:c(),contentType:e.contentType,subjectId:e.subjectId||null}):await l(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:c()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{E as getPendingDeepDiagnosticCount,G as triggerContentUpdated,W as triggerDataImported,M as triggerDiagnosticCompleted,x as triggerQuizSubmitted,N as triggerStudentEnrolled};
|
assets/{award-DBHp-ybd.js β award-ZQxHm68j.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{bell-BwBudSvY.js β bell-CVB0-Rn1.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as e}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{book-open-D5mR6gz9.js β book-open-cmOvedFO.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as o}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as o}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{brain-COga8OrM.js β brain-CEG2uNCc.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as a}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as a}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{button-BSRmUN27.js β button-C6pFOjcg.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-DnWAlVSW.js";import{c as V}from"./vendor-charts-BHw0fhqZ.js";import{f as p}from"./index-
|
|
|
|
| 1 |
+
import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-DnWAlVSW.js";import{c as V}from"./vendor-charts-BHw0fhqZ.js";import{f as p}from"./index-Du57tmo9.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,j=(n,r)=>e=>{var o;if(r?.variants==null)return m(n,e?.class,e?.className);const{variants:u,defaultVariants:i}=r,b=Object.keys(u).map(t=>{const a=e?.[t],d=i?.[t];if(a===null)return null;const s=g(a)||g(d);return u[t][s]}),v=e&&Object.entries(e).reduce((t,a)=>{let[d,s]=a;return s===void 0||(t[d]=s),t},{}),f=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((t,a)=>{let{class:d,className:s,...h}=a;return Object.entries(h).every(x=>{let[c,l]=x;return Array.isArray(l)?l.includes({...i,...v}[c]):{...i,...v}[c]===l})?[...t,d,s]:t},[]);return m(n,b,f,e?.class,e?.className)},N=j("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function w({className:n,variant:r,size:e,asChild:o=!1,...u}){const i=o?k:"button";return y.jsx(i,{"data-slot":"button",className:p(N({variant:r,size:e,className:n})),...u})}export{w as B,j as c};
|
assets/{calendar-ClpJmmLI.js β calendar-DguKdDEr.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as e}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{card-SHcaFLA_.js β card-BdmZcu-T.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as o,f as r}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as o,f as r}from"./index-Du57tmo9.js";import{j as e}from"./vendor-react-B4AQeu28.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chart-column-V8fKqOo0.js β chart-column-Cqncpeum.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as t}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as t}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chatService-DzDq5mQE.js β chatService-CNolNpDv.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as c,e as u,g,a as i,s as w,u as p,q as l,w as d,o as y,h as A}from"./vendor-firebase-firestore-52DD1vc9.js";import{d as o}from"./index-
|
|
|
|
| 1 |
+
import{d as c,e as u,g,a as i,s as w,u as p,q as l,w as d,o as y,h as A}from"./vendor-firebase-firestore-52DD1vc9.js";import{d as o}from"./index-Du57tmo9.js";import"./vendor-firebase-core-y3En_kpN.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-BW5XT768.js";import"./vendor-firebase-storage-DNmrKfQ-.js";import"./vendor-firebase-analytics-DZd0u9yk.js";import"./vendor-radix-DnWAlVSW.js";import"./vendor-charts-BHw0fhqZ.js";import"./vendor-markdown-yqZQ_iQm.js";const q=async(s,t="New Conversation")=>{try{const e=c(u(o,"chatSessions")),n={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...n,createdAt:i(),updatedAt:i()}),n}catch(e){throw console.error("Error creating chat session:",e),e}},Q=async s=>{try{const t=l(u(o,"chatSessions"),d("userId","==",s),d("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(n=>{const r=n.data();return{...r,createdAt:r.createdAt?.toDate()||new Date,updatedAt:r.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},R=async s=>{try{const t=await g(c(o,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},b=async(s,t,e,n)=>{try{const r=c(u(o,"chatMessages")),a={id:r.id,userId:"",role:t,content:e,timestamp:new Date,...n?{context:n}:{}},h=await g(c(o,"chatSessions",s));h.exists()&&(a.userId=h.data().userId);const m={id:a.id,userId:a.userId,role:a.role,content:a.content,sessionId:s,timestamp:i()};return a.context&&(m.context=a.context),await w(r,m),await p(c(o,"chatSessions",s),{updatedAt:i()}),a}catch(r){throw console.error("Error adding message:",r),r}},B=async(s,t)=>{try{const e=l(u(o,"chatMessages"),d("sessionId","==",s),d("userId","==",t),y("timestamp","asc"));return(await A(e)).docs.map(r=>{const a=r.data();return{...a,timestamp:a.timestamp?.toDate()||new Date}})}catch(e){return console.error("Error getting session messages:",e),[]}},N=async(s,t)=>{try{await p(c(o,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},U=async s=>{try{await p(c(o,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{b as addMessageToSession,q as createChatSession,U as deleteSession,R as getChatSession,B as getSessionMessages,Q as getUserChatSessions,N as updateSessionTitle};
|
assets/{check-Cs-4n4yC.js β check-BAMSfVKd.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-left-KucdseP8.js β chevron-left-mWdIDmIc.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as e}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-right-mxUv3EB7.js β chevron-right-CFOFOVBg.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as o}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as o}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-up-Bup_RJHP.js β chevron-up-Dmffgx6p.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as o}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as o}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-alert-KkqOOEPJ.js β circle-alert-mPiSlvKL.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as e}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-check-big-Qn5jJKfH.js β circle-check-big-DC9utj0Y.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{clipboard-check-DbpvA-N4.js β clipboard-check-fEagN09v.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{clock-BJCraYVD.js β clock-BtWjBj1h.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c}from"./index-Du57tmo9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{diagnosticService-BbwguGxN.js β diagnosticService-EjsgXhrt.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
| 2 |
-
import{_ as u}from"./index-
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Du57tmo9.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-BW5XT768.js","assets/vendor-firebase-core-y3En_kpN.js","assets/vendor-firebase-firestore-52DD1vc9.js","assets/vendor-firebase-storage-DNmrKfQ-.js","assets/vendor-firebase-analytics-DZd0u9yk.js","assets/vendor-radix-DnWAlVSW.js","assets/vendor-charts-BHw0fhqZ.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-BQ2D57Uc.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{_ as u}from"./index-Du57tmo9.js";const d="https://deign86-mathpulse-api-v3test.hf.space";async function f(r,s){const i=`${d}/api/diagnostic/generate`,n=new Headers({"Content-Type":"application/json"}),{auth:c}=await u(async()=>{const{auth:t}=await import("./index-Du57tmo9.js").then(e=>e.ax);return{auth:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),o=c.currentUser;if(o){const t=await o.getIdToken(!1);t&&n.set("Authorization",`Bearer ${t}`)}const a=new AbortController,l=setTimeout(()=>a.abort(),9e4);try{const t=await fetch(i,{method:"POST",headers:n,body:JSON.stringify({strand:r,grade_level:s}),signal:a.signal});if(!t.ok){const e=await t.text().catch(()=>"Unknown error");throw new Error(`Diagnostic generation failed (${t.status}): ${e.slice(0,300)}`)}return t.json()}finally{clearTimeout(l)}}async function g(r,s){const i=`${d}/api/diagnostic/submit`,n=new Headers({"Content-Type":"application/json"}),{auth:c}=await u(async()=>{const{auth:t}=await import("./index-Du57tmo9.js").then(e=>e.ax);return{auth:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),o=c.currentUser;if(o){const t=await o.getIdToken(!1);t&&n.set("Authorization",`Bearer ${t}`)}const a=new AbortController,l=setTimeout(()=>a.abort(),6e4);try{const t=await fetch(i,{method:"POST",headers:n,body:JSON.stringify({test_id:r,responses:s}),signal:a.signal});if(!t.ok){const e=await t.text().catch(()=>"Unknown error");throw new Error(`Diagnostic submission failed (${t.status}): ${e.slice(0,300)}`)}return t.json()}finally{clearTimeout(l)}}export{f as g,g as s};
|
assets/{dialog-TlKhS4yO.js β dialog-fRGvTlwY.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as r,f as o}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as r,f as o}from"./index-Du57tmo9.js";import{j as t,r as l}from"./vendor-react-B4AQeu28.js";import{c as p,d as n,e as x,T as d,D as i,P as m,O as c}from"./vendor-radix-DnWAlVSW.js";import{X as g}from"./x-Cwkkamrh.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|