1import{j as e}from"./vendor-three-Bmn2g83e.js";import{r as i}from"./vendor-react-kRHgybFd.js";import{a as p}from"./adminAxios-ByTPVtHS.js";import{b1 as D,g as z,d as $,b0 as G,a6 as A,bc as P,U as L,f as K,az as E,bd as I,aN as Q,aF as Z,ao as V,ba as ee,a9 as te,X as _,aL as se,ar as ae}from"./vendor-misc-DSUDoLcJ.js";const le={active:"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30",pending:"bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",suspended:"bg-red-500/20 text-red-400 border border-red-500/30"},b=()=>({Authorization:`Bearer ${localStorage.getItem("adminToken")}`});function U({title:l,message:h,confirmLabel:d="Confirm",confirmColor:x="bg-red-600 hover:bg-red-500",onConfirm:n,onCancel:o}){return e.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-slate-800 rounded-2xl w-full max-w-md border border-slate-700",children:[e.jsxs("div",{className:"flex items-center gap-3 p-5 border-b border-slate-700",children:[e.jsx("div",{className:"w-10 h-10 bg-red-500/20 rounded-xl flex items-center justify-center border border-red-500/30",children:e.jsx(D,{className:"w-5 h-5 text-red-400"})}),e.jsx("h2",{className:"text-white font-bold text-lg",children:l})]}),e.jsx("div",{className:"p-5",children:e.jsx("p",{className:"text-slate-300 text-sm",children:h})}),e.jsxs("div",{className:"flex justify-end gap-3 p-5 border-t border-slate-700",children:[e.jsx("button",{onClick:o,className:"px-4 py-2 text-slate-400 hover:text-white transition-colors text-sm",children:"Cancel"}),e.jsx("button",{onClick:n,className:`${x} text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors`,children:d})]})]})})}function re({school:l,onClose:h,onSaved:d,showMessage:x}){const[n,o]=i.useState({name:l.name||"",slug:l.slug||"",type:l.type||"university",domain:l.domain||"",location:l.location||"",country:l.country||"USA",colorPrimary:l.colorPrimary||"#6366f1",colorSecondary:l.colorSecondary||"#FFFFFF",status:l.status||"active",verified:l.verified||!1}),[u,N]=i.useState(!1),y=async()=>{if(!n.name||!n.name.trim()){x("School name is required","error");return}N(!0);try{await p.put(`/api/admin/schools/${l.id}`,n,{headers:b()}),x("School updated successfully"),d(),h()}catch(s){x(s.response?.data?.error||"Failed to update school","error")}finally{N(!1)}};return e.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-slate-800 rounded-2xl w-full max-w-lg border border-slate-700",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-slate-700",children:[e.jsx("h2",{className:"text-white font-bold text-lg",children:"Edit School"}),e.jsx("button",{onClick:h,className:"text-slate-400 hover:text-white transition-colors",children:e.jsx(_,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"p-5 space-y-4 max-h-[70vh] overflow-y-auto",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"text-slate-400 text-xs mb-1 block",children:"School Name"}),e.jsx("input",{value:n.name,onChange:s=>o(a=>({...a,name:s.target.value})),className:"w-full bg-slate-700 text-white rounded-lg px-3 py-2 text-sm border border-slate-600 focus:border-purple-500 outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-slate-400 text-xs mb-1 block",children:"Slug (URL)"}),e.jsx("input",{value:n.slug,onChange:s=>o(a=>({...a,slug:s.target.value})),className:"w-full bg-slate-700 text-white rounded-lg px-3 py-2 text-sm border border-slate-600 focus:border-purple-500 outline-none font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-slate-400 text-xs mb-1 block",children:"Type"}),e.jsx("select",{value:n.type,onChange:s=>o(a=>({...a,type:s.target.value})),className:"w-full bg-slate-700 text-white rounded-lg px-3 py-2 text-sm border border-slate-600 focus:border-purple-500 outline-none",children:["university","college","community_college","high_school","trade_school","international","other"].map(s=>e.jsx("option",{value:s,children:s.replace(/_/g," ")},s))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-slate-400 text-xs mb-1 block",children:"Email Domain"}),e.jsx("input",{placeholder:"linfield.edu",value:n.domain,onChange:s=>o(a=>({...a,domain:s.target.value})),className:"w-full bg-slate-700 text-white rounded-lg px-3 py-2 text-sm border border-slate-600 focus:border-purple-500 outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-slate-400 text-xs mb-1 block",children:"Location"}),e.jsx("input",{placeholder:"McMinnville, OR",value:n.location,onChange:s=>o(a=>({...a,location:s.target.value})),className:"w-full bg-slate-700 text-white rounded-lg px-3 py-2 text-sm border border-slate-600 focus:border-purple-500 outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-slate-400 text-xs mb-1 block",children:"Primary Color"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"color",value:n.colorPrimary,onChange:s=>o(a=>({...a,colorPrimary:s.target.value})),className:"w-10 h-9 rounded cursor-pointer bg-transparent border-0 p-0"}),e.jsx("input",{value:n.colorPrimary,onChange:s=>o(a=>({...a,colorPrimary:s.target.value})),className:"flex-1 bg-slate-700 text-white rounded-lg px-3 py-2 text-sm border border-slate-600 focus:border-purple-500 outline-none font-mono"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-slate-400 text-xs mb-1 block",children:"Secondary Color"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"color",value:n.colorSecondary,onChange:s=>o(a=>({...a,colorSecondary:s.target.value})),className:"w-10 h-9 rounded cursor-pointer bg-transparent border-0 p-0"}),e.jsx("input",{value:n.colorSecondary,onChange:s=>o(a=>({...a,colorSecondary:s.target.value})),className:"flex-1 bg-slate-700 text-white rounded-lg px-3 py-2 text-sm border border-slate-600 focus:border-purple-500 outline-none font-mono"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-slate-400 text-xs mb-1 block",children:"Status"}),e.jsxs("select",{value:n.status,onChange:s=>o(a=>({...a,status:s.target.value})),className:"w-full bg-slate-700 text-white rounded-lg px-3 py-2 text-sm border border-slate-600 focus:border-purple-500 outline-none",children:[e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"pending",children:"Pending"}),e.jsx("option",{value:"suspended",children:"Suspended"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 col-span-2 bg-slate-700/50 rounded-lg p-3",children:[e.jsx("input",{type:"checkbox",id:"verified-check",checked:n.verified,onChange:s=>o(a=>({...a,verified:s.target.checked})),className:"w-4 h-4 accent-purple-500"}),e.jsxs("label",{htmlFor:"verified-check",className:"text-white text-sm cursor-pointer",children:["Mark as verified school ",e.jsx("span",{className:"text-slate-400",children:"(shows verified badge on leaderboard)"})]})]})]})}),e.jsxs("div",{className:"flex justify-end gap-3 p-5 border-t border-slate-700",children:[e.jsx("button",{onClick:h,className:"px-4 py-2 text-slate-400 hover:text-white transition-colors text-sm",children:"Cancel"}),e.jsxs("button",{onClick:y,disabled:u,className:"flex items-center gap-2 bg-purple-600 hover:bg-purple-500 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:[e.jsx(se,{className:"w-4 h-4"}),u?"Savingâ¦":"Save Changes"]})]})]})})}function ne({school:l,onClose:h,showMessage:d}){const[x,n]=i.useState([]),[o,u]=i.useState(!0),[N,y]=i.useState(0),[s,a]=i.useState(null),m=i.useCallback(async()=>{u(!0);try{const{data:r}=await p.get(`/api/admin/schools/${l.id}/members`,{headers:b()});n(r.members||[]),y(r.total||0)}catch{d("Failed to load members","error")}finally{u(!1)}},[l.id]);i.useEffect(()=>{m()},[m]);const j=async(r,S)=>{try{await p.put(`/api/admin/schools/${l.id}/members/${r}/verify`,{verified:S},{headers:b()}),d(`Member ${S?"verified":"unverified"}`),m()}catch{d("Failed to update verification","error")}},C=async r=>{a(null);try{await p.delete(`/api/admin/schools/${l.id}/members/${r}`,{headers:b()}),d("Member removed"),m()}catch{d("Failed to remove member","error")}};return e.jsx("div",{className:"fixed inset-0 bg-black/60 flex justify-end z-50",children:e.jsxs("div",{className:"bg-slate-900 w-full max-w-2xl h-full flex flex-col border-l border-slate-700 shadow-2xl",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-slate-700",style:{borderTop:`4px s
1olid ${l.colorPrimary||"#6366f1"}`},children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-white font-bold text-lg",children:l.name}),e.jsxs("p",{className:"text-slate-400 text-sm",children:[N," members"]})]}),e.jsx("button",{onClick:h,className:"text-slate-400 hover:text-white transition-colors p-2",children:e.jsx(_,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:o?e.jsx("div",{className:"flex items-center justify-center h-40 text-slate-400",children:"Loadingâ¦"}):x.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-slate-400",children:[e.jsx(L,{className:"w-8 h-8 mb-2 opacity-40"}),e.jsx("p",{children:"No members yet"})]}):e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-slate-800 sticky top-0",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left text-slate-400 font-medium px-4 py-3",children:"Member"}),e.jsx("th",{className:"text-right text-slate-400 font-medium px-4 py-3",children:"Points"}),e.jsx("th",{className:"text-center text-slate-400 font-medium px-4 py-3",children:"Battles"}),e.jsx("th",{className:"text-center text-slate-400 font-medium px-4 py-3",children:"Verified"}),e.jsx("th",{className:"text-center text-slate-400 font-medium px-4 py-3",children:"Plan"}),e.jsx("th",{className:"px-4 py-3"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-800",children:x.map(r=>e.jsxs("tr",{className:"hover:bg-slate-800/50 transition-colors",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("div",{className:"font-medium text-white",children:r.name||"â"}),e.jsx("div",{className:"text-slate-400 text-xs",children:r.email}),e.jsxs("div",{className:"text-slate-500 text-xs",children:["Joined ",r.joinedAt?new Date(r.joinedAt).toLocaleDateString():"â"]})]}),e.jsx("td",{className:"px-4 py-3 text-right",children:e.jsx("span",{className:"text-purple-400 font-semibold",children:r.pointsContributed.toLocaleString()})}),e.jsx("td",{className:"px-4 py-3 text-center text-slate-300",children:r.matchesPlayed}),e.jsx("td",{className:"px-4 py-3 text-center",children:r.verified?e.jsx("button",{onClick:()=>j(r.userId,!1),title:"Click to unverify",className:"inline-flex items-center gap-1 text-emerald-400 hover:text-red-400 transition-colors",children:e.jsx(z,{className:"w-4 h-4"})}):e.jsx("button",{onClick:()=>j(r.userId,!0),title:"Click to verify",className:"inline-flex items-center gap-1 text-slate-500 hover:text-emerald-400 transition-colors",children:e.jsx(ae,{className:"w-4 h-4"})})}),e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("span",{className:`px-2 py-0.5 rounded text-xs ${r.subscriptionType==="free"?"bg-slate-700 text-slate-400":"bg-purple-500/20 text-purple-300"}`,children:r.subscriptionType||"free"})}),e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{onClick:()=>a({userId:r.userId,name:r.name||r.email}),className:"text-slate-500 hover:text-red-400 transition-colors",title:"Remove from school",children:e.jsx(V,{className:"w-4 h-4"})})})]},r.membershipId))})]})}),s&&e.jsx(U,{title:"Remove Member",message:`Remove ${s.name||s.userId} from ${l.name}?`,confirmLabel:"Remove",onConfirm:()=>C(s.userId),onCancel:()=>a(null)})]})})}function xe(){const[l,h]=i.useState([]),[d,x]=i.useState(!0),[n,o]=i.useState(""),[u,N]=i.useState("all"),[y,s]=i.useState(0),[a,m]=i.useState(1),[j,C]=i.useState(1),[r,S]=i.useState(null),[R,T]=i.useState(null),[M,k]=i.useState(null),[w,g]=i.useState(null);i.useEffect(()=>{if(!localStorage.getItem("adminToken")){window.location.href="/admin/login";return}v()},[a,u]);const v=async()=>{x(!0);try{const{data:t}=await p.get("/api/admin/schools",{params:{page:a,limit:50,status:u,search:n},headers:b()});h(t.schools||[]),s(t.total||0),C(t.totalPages||1)}catch(t){t.response?.status===401&&(localStorage.removeItem("adminToken"),window.location.href="/admin/login")}finally{x(!1)}},f=(t,c="success")=>{S({text:t,type:c}),setTimeout(()=>S(null),3e3)},B=t=>{t.preventDefault(),m(1),v()},O=t=>{const c=t.status==="suspended"?"activate":"suspend";g({title:c==="activate"?"Reactivate School":"Suspend School",message:`${c==="activate"?"Reactivate":"Suspend"} ${t.name}?`,confirmLabel:c==="activate"?"Reactivate":"Suspend",confirmColor:c==="activate"?"bg-emerald-600 hover:bg-emerald-500":"bg-orange-600 hover:bg-orange-500",onConfirm:async()=>{g(null);try{c==="suspend"?await p.delete(`/api/admin/schools/${t.id}`,{data:{action:"suspend"},headers:b()}):await p.put(`/api/admin/schools/${t.id}`,{status:"active"},{headers:b()}),f(`${t.name} ${c==="suspend"?"suspended":"reactivated"}`),v()}catch{f("Failed to update school status","error")}}})},X=t=>{g({title:"Reset Battle Points",message:`Reset ALL battle points for ${t.name}? This cannot be undone.`,confirmLabel:"Reset Points",confirmColor:"bg-yellow-600 hover:bg-yellow-500",onConfirm:async()=>{g(null);try{await p.post(`/api/admin/schools/${t.id}/reset-points`,{},{headers:b()}),f(`Points reset for ${t.name}`),v()}catch{f("Failed to reset points","error")}}})},q=t=>{g({title:"Delete School Permanently",message:`PERMANENTLY DELETE ${t.name}? This will remove all members and battle history.`,confirmLabel:"Delete Permanently",confirmColor:"bg-red-600 hover:bg-red-500",onConfirm:async()=>{g(null);try{await p.delete(`/api/admin/schools/${t.id}`,{data:{action:"delete"},headers:b()}),f(`${t.name} deleted`),v()}catch{f("Failed to delete school","error")}}})},H=l.filter(t=>t.status==="active").length,J=l.filter(t=>t.verified).length,W=l.reduce((t,c)=>t+(c.memberCount||0),0);return e.jsxs("div",{className:"min-h-screen bg-slate-950 text-white p-6",children:[r&&e.jsxs("div",{className:`fixed top-4 right-4 z-50 px-4 py-3 rounded-lg shadow-lg text-sm font-medium flex items-center gap-2 ${r.type==="error"?"bg-red-500/90 text-white":"bg-emerald-500/90 text-white"}`,children:[r.type==="error"?e.jsx(D,{className:"w-4 h-4"}):e.jsx(z,{className:"w-4 h-4"}),r.text]}),e.jsxs("div",{className:"flex items-start justify-between mb-8",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-purple-600/20 rounded-xl flex items-center justify-center border border-purple-500/30",children:e.jsx($,{className:"w-6 h-6 text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"School Management"}),e.jsx("p",{className:"text-slate-400 text-sm",children:"Manage schools, members, and battle points"})]})]}),e.jsxs("a",{href:"/schools",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-slate-400 hover:text-white text-sm transition-colors",children:[e.jsx(G,{className:"w-4 h-4"}),"Public Leaderboard"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[{label:"Total Schools",value:y,icon:$,color:"text-purple-400"},{label:"Active",value:H,icon:A,color:"text-emerald-400"},{label:"Verified",value:J,icon:P,color:"text-blue-400"}
1,{label:"Total Members",value:W.toLocaleString(),icon:L,color:"text-yellow-400"}].map(({label:t,value:c,icon:Y,color:F})=>e.jsxs("div",{className:"bg-slate-800/50 border border-slate-700 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-slate-400 text-xs",children:t}),e.jsx(Y,{className:`w-4 h-4 ${F}`})]}),e.jsx("div",{className:`text-2xl font-bold ${F}`,children:c})]},t))}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mb-6",children:[e.jsxs("form",{onSubmit:B,className:"flex-1 flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(K,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),e.jsx("input",{value:n,onChange:t=>o(t.target.value),placeholder:"Search by name, slug, or domainâ¦",className:"w-full bg-slate-800 border border-slate-700 text-white rounded-lg pl-9 pr-4 py-2 text-sm focus:border-purple-500 outline-none"})]}),e.jsx("button",{type:"submit",className:"bg-purple-600 hover:bg-purple-500 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors",children:"Search"})]}),e.jsxs("div",{className:"flex gap-2",children:[["all","active","pending","suspended"].map(t=>e.jsx("button",{onClick:()=>{N(t),m(1)},className:`px-3 py-2 rounded-lg text-sm font-medium transition-colors capitalize ${u===t?"bg-purple-600 text-white":"bg-slate-800 text-slate-400 hover:text-white border border-slate-700"}`,children:t},t)),e.jsx("button",{onClick:()=>{m(1),v()},className:"bg-slate-800 border border-slate-700 text-slate-400 hover:text-white px-3 py-2 rounded-lg transition-colors",title:"Refresh",children:e.jsx(E,{className:"w-4 h-4"})})]})]}),e.jsx("div",{className:"bg-slate-800/40 border border-slate-700 rounded-2xl overflow-hidden",children:d?e.jsxs("div",{className:"flex items-center justify-center h-40 text-slate-400",children:[e.jsx(E,{className:"w-5 h-5 animate-spin mr-2"}),"Loading schoolsâ¦"]}):l.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-slate-400",children:[e.jsx($,{className:"w-8 h-8 mb-2 opacity-40"}),e.jsx("p",{children:"No schools found"})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-slate-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left text-slate-400 font-medium px-5 py-4",children:"School"}),e.jsx("th",{className:"text-right text-slate-400 font-medium px-4 py-4",children:"Points"}),e.jsx("th",{className:"text-center text-slate-400 font-medium px-4 py-4",children:"Members"}),e.jsx("th",{className:"text-center text-slate-400 font-medium px-4 py-4",children:"W / L"}),e.jsx("th",{className:"text-center text-slate-400 font-medium px-4 py-4",children:"Status"}),e.jsx("th",{className:"text-center text-slate-400 font-medium px-4 py-4",children:"Verified"}),e.jsx("th",{className:"text-center text-slate-400 font-medium px-5 py-4",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-700/50",children:l.map(t=>e.jsxs("tr",{className:"hover:bg-slate-700/20 transition-colors group",children:[e.jsx("td",{className:"px-5 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex-shrink-0 border border-white/25",style:{background:`linear-gradient(135deg, ${t.colorPrimary}, ${t.colorSecondary})`}}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-semibold text-white flex items-center gap-2",children:[t.name,t.verified&&e.jsx(P,{className:"w-3.5 h-3.5 text-blue-400",title:"Verified"})]}),e.jsx("div",{className:"text-slate-400 text-xs font-mono",children:t.slug}),t.domain&&e.jsx("div",{className:"text-slate-500 text-xs",children:t.domain})]})]})}),e.jsx("td",{className:"px-4 py-4 text-right",children:e.jsx("span",{className:"text-purple-400 font-bold",children:t.totalPoints.toLocaleString()})}),e.jsx("td",{className:"px-4 py-4 text-center",children:e.jsx("button",{onClick:()=>k(t),className:"text-slate-300 hover:text-purple-400 transition-colors font-medium hover:underline",children:t.memberCount})}),e.jsxs("td",{className:"px-4 py-4 text-center text-slate-300",children:[e.jsx("span",{className:"text-emerald-400",children:t.wins}),e.jsx("span",{className:"text-slate-600 mx-1",children:"/"}),e.jsx("span",{className:"text-red-400",children:t.losses})]}),e.jsx("td",{className:"px-4 py-4 text-center",children:e.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-medium ${le[t.status]||""}`,children:t.status})}),e.jsx("td",{className:"px-4 py-4 text-center",children:t.verified?e.jsx(P,{className:"w-4 h-4 text-blue-400 mx-auto"}):e.jsx(I,{className:"w-4 h-4 text-slate-600 mx-auto"})}),e.jsx("td",{className:"px-5 py-4",children:e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx("button",{onClick:()=>k(t),className:"p-1.5 text-slate-400 hover:text-purple-400 transition-colors rounded",title:"View members",children:e.jsx(L,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>T(t),className:"p-1.5 text-slate-400 hover:text-blue-400 transition-colors rounded",title:"Edit school",children:e.jsx(Q,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>X(t),className:"p-1.5 text-slate-400 hover:text-yellow-400 transition-colors rounded",title:"Reset battle points",children:e.jsx(Z,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>O(t),className:`p-1.5 transition-colors rounded ${t.status==="suspended"?"text-slate-400 hover:text-emerald-400":"text-slate-400 hover:text-orange-400"}`,title:t.status==="suspended"?"Reactivate school":"Suspend school",children:t.status==="suspended"?e.jsx(A,{className:"w-4 h-4"}):e.jsx(I,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>q(t),className:"p-1.5 text-slate-400 hover:text-red-400 transition-colors rounded",title:"Delete school permanently",children:e.jsx(V,{className:"w-4 h-4"})})]})})]},t.id))})]})})}),j>1&&e.jsxs("div",{className:"flex items-center justify-between mt-4 text-sm text-slate-400",children:[e.jsxs("span",{children:["Showing page ",a," of ",j," (",y," schools total)"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>m(t=>Math.max(1,t-1)),disabled:a===1,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-800 border border-slate-700 rounded-lg hover:text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(ee,{className:"w-4 h-4"})," Prev"]}),e.jsxs("button",{onClick:()=>m(t=>Math.min(j,t+1)),disabled:a===j,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-800 border border-slate-700 rounded-lg hover:text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:["Next ",e.jsx(te,{className:"w-4 h-4"})]})]})]}),R&&e.jsx(re,{school:R,onClose:()=>T(null),onSaved:v,showMessage:f}),M&&e.jsx(ne,{school:M,onClose:()=>k(null),showMessage:f}),w&&e.jsx(U,{title:w.title,message:w.message,confirmLabel:w.confirmLabel,confirmColor:w.confirmColor,onConfirm:w.onConfirm,onCancel:()=>g(null)})]})}export{xe 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.