1import{al as w,b8 as n,b6 as s,S as c,ad as l,s as d,n as _,h as g,A as u,o as m,aG as C,b7 as j,b as y,j as r,C as z,e as A,g as S,d as N,b9 as v,a as E,l as L}from"./index-F66J0iB8.js";import{S as I}from"./useBackClose-Bs1EmEwd.js";const a=[{id:"streak_3",name:"3-Day Streak",description:"Learn 3 days in a row",icon:n,color:"text-orange-500",bg:"bg-orange-100",category:"streak",requirement:3},{id:"streak_7",name:"Week Warrior",description:"7-day learning streak",icon:n,color:"text-orange-600",bg:"bg-orange-100",category:"streak",requirement:7},{id:"streak_30",name:"Monthly Master",description:"30-day streak",icon:n,color:"text-red-500",bg:"bg-red-100",category:"streak",requirement:30},{id:"streak_100",name:"Centurion",description:"100-day streak!",icon:s,color:"text-yellow-500",bg:"bg-yellow-100",category:"streak",requirement:100},{id:"streak_365",name:"Year of Dedication",description:"365-day streak",icon:s,color:"text-primary",bg:"bg-primary/10",category:"streak",requirement:365},{id:"points_100",name:"Getting Started",description:"Earn 100 points",icon:c,color:"text-blue-500",bg:"bg-blue-100",category:"points",requirement:100},{id:"points_500",name:"Rising Star",description:"Earn 500 points",icon:c,color:"text-blue-600",bg:"bg-blue-100",category:"points",requirement:500},{id:"points_1000",name:"Points Master",description:"Earn 1000 points",icon:l,color:"text-yellow-500",bg:"bg-yellow-100",category:"points",requirement:1e3},{id:"points_5000",name:"Point Pioneer",description:"Earn 5000 points",icon:l,color:"text-amber-500",bg:"bg-amber-100",category:"points",requirement:5e3},{id:"quiz_first",name:"Quiz Taker",description:"Complete your first quiz",icon:d,color:"text-green-500",bg:"bg-green-100",category:"quiz",requirement:1},{id:"quiz_10",name:"Quiz Regular",description:"Complete 10 quizzes",icon:d,color:"text-green-600",bg:"bg-green-100",category:"quiz",requirement:10},{id:"quiz_perfect",name:"Flawless Quiz",description:"Get 100% on a quiz",icon:_,color:"text-pink-500",bg:"bg-pink-100",category:"quiz",requirement:1},{id:"quiz_perfect_5",name:"Accuracy King",description:"5 perfect quizzes",icon:s,color:"text-pink-600",bg:"bg-pink-100",category:"quiz",requirement:5},{id:"vocab_50",name:"Word Learner",description:"Learn 50 words",icon:g,color:"text-primary",bg:"bg-primary/10",category:"learning",requirement:50},{id:"vocab_200",name:"Vocabulary Builder",description:"Learn 200 words",icon:g,color:"text-primary",bg:"bg-primary/10",category:"learning",requirement:200},{id:"vocab_500",name:"Word Master",description:"Learn 500 words",icon:u,color:"text-primary",bg:"bg-primary/10",category:"learning",requirement:500},{id:"ai_first",name:"AI Explorer",description:"First AI conversation",icon:m,color:"text-cyan-500",bg:"bg-cyan-100",category:"ai",requirement:1},{id:"ai_10",name:"Conversation Pro",description:"10 AI sessions",icon:m,color:"text-cyan-600",bg:"bg-cyan-100",category:"ai",requirement:10},{id:"ai_50",name:"Chat Champion",description:"50 AI sessions",icon:C,color:"text-emerald-500",bg:"bg-emerald-100",category:"ai",requirement:50},{id:"level_up",name:"Level Up!",description:"Reach Junior level",icon:j,color:"text-primary",bg:"bg-primary/10",category:"special",requirement:1},{id:"certificate",name:"Certified",description:"Earn a certificate",icon:u,color:"text-yellow-500",bg:"bg-yellow-100",category:"special",requirement:1},{id:"early_bird",name:"Sunrise Scholar",description:"Study before 7am",icon:y,color:"text-amber-500",bg:"bg-amber-100",category:"special",requirement:1},{id:"night_owl",name:"Midnight Learner",description:"Study after 11pm",icon:y,color:"text-primary",bg:"bg-primary/10",category:"special",requirement:1}],M=[{id:"streak",name:"Streaks",icon:n},{id:"points",name:"Points",icon:c},{id:"quiz",name:"Quizzes",icon:d},{id:"learning",name:"Learning",icon:g},{id:"ai",name:"AI Tutor",icon:m},{id:"special",name:"Special",icon:v}];function $({earnedBadges:x=[],showAll:h=!0}){const[t,p]=w.useState("all"),o=x.map(e=>e.badge_id),b=t==="all"?a:a.filter(e=>e.category===t),f=h?b:b.filter(e=>o.includes(e.id)),q=a.filter(e=>o.includes(e.id)).length;return r.jsxs(z,{className:I,children:[r.jsxs(A,{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(S,{className:"flex items-center gap-2 text-lg font-bold text-gray-900",children:[r.jsx(l,{className:"w-5 h-5 text-amber-600"}),"Achievements"]}),r.jsxs(N,{className:"bg-slate-700 text-white text-xs font-semibold",children:[q,"/",a.length," Unlocked"]})]}),r.jsxs("div",{className:"flex gap-2 flex-wrap mt-3",children:[r.jsx("button",{onClick:()=>p("all"),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors ${t==="all"?"bg-slate-700 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:"All"}),M.map(e=>r.jsxs("button",{onClick:()=>p(e.id),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors flex items-center gap-1 ${t===e.id?"bg-slate-700 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[r.jsx(e.icon,{className:"w-3 h-3"}),e.name]},e.id))]})]}),r.jsx(E,{children:r.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 ga
1p-3",children:f.map(e=>{const i=o.includes(e.id),k=e.icon;return r.jsxs("div",{className:`relative p-3 rounded-xl text-center transition-all border ${i?"bg-white border-gray-200":"bg-gray-50 border-gray-200 opacity-60"}`,title:`${e.name}: ${e.description}`,children:[r.jsx("div",{className:`w-10 h-10 mx-auto rounded-xl flex items-center justify-center ${i?"bg-primary":"bg-gray-200"}`,children:r.jsx(k,{className:`w-5 h-5 ${i?"text-white":"text-gray-400"}`})}),r.jsx("p",{className:`text-xs mt-2 font-medium ${i?"text-gray-900":"text-gray-500"}`,children:e.name}),i&&r.jsx("div",{className:"absolute -top-1 -right-1 w-5 h-5 bg-green-600 rounded-full flex items-center justify-center",children:r.jsx(L,{className:"w-3 h-3 text-white"})})]},e.id)})})})]})}export{$ as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.