1import{c as S,t as x,r as m,j as e,Y as B,P as T,Z as k,_ as U,B as L,X as z,g as _,L as H,A as X,m as $,$ as F,h as Y,C as Z,a0 as q,v as J,w as K,G as V}from"./index-C9BAOTn9.js";import{C as ee}from"./credit-card-BHJgfKE_.js";import{C as P}from"./chart-column-BjRD8jGG.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const se=S("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const te=S("WalletCards",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2",key:"4125el"}],["path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21",key:"1dpki6"}]]),v={slug:"",title:"",description:"",category:"Ø§ÙØ¨Ø±Ù جة",level:"٠بتدئ",price:0,isFree:1,active:1},j={title:"",description:"",content:"",lessonOrder:1,active:1};function ae(){const l=x.useUtils(),o=x.admin.courseContent.useQuery(void 0,{refetchOnWindowFocus:!0}),[c,d]=m.useState(null),[s,r]=m.useState(v),[n,t]=m.useState(j),[h,p]=m.useState(null),[f,i]=m.useState(""),g=o.data??[],A=g.find(a=>a.id===c)??null;m.useEffect(()=>{c===null&&g[0]&&(d(g[0].id),r(g[0]))},[g,c]);const u=()=>{i("ت٠ØÙظ Ø§ÙØªØºÙÙØ±Ø§Øª."),l.admin.courseContent.invalidate()},y=x.admin.createCourse.useMutation({onSuccess:a=>{u();const D=a[a.length-1];D&&(d(D.id),r(D))}}),C=x.admin.updateCourse.useMutation({onSuccess:u}),O=x.admin.deleteCourse.useMutation({onSuccess:()=>{d(null),r(v),u()}}),w=x.admin.createLesson.useMutation({onSuccess:()=>{t(j),p(null),u()}}),M=x.admin.updateLesson.useMutation({onSuccess:()=>{t(j),p(null),u()}}),I=x.admin.deleteLesson.useMutation({onSuccess:u}),W=a=>{d(a.id),r(a),t(j),p(null),i("")},E=()=>{i(""),s.id?C.mutate(s):y.mutate(s)},R=()=>{c&&(h?M.mutate({...n,id:h}):w.mutate({...n,courseId:c}))},G=()=>{s.id&&window.confirm("ÙÙ ØªØ±ÙØ¯ ØØ°Ù Ø§ÙØ¯Ùرة ÙØ¬Ù ÙØ¹ Ø¯Ø±ÙØ³ÙØ§Ø ÙØ§ ÙÙ ÙÙ Ø§ÙØªØ±Ø§Ø¬Ø¹ Ø¹Ù ÙØ°Ø§ Ø§ÙØ¥Ø¬Ø±Ø§Ø¡.")&&O.mutate({id:s.id})},Q=a=>{window.confirm("ÙÙ ØªØ±ÙØ¯ ØØ°Ù ÙØ°Ø§ Ø§ÙØ¯Ø±Ø³Ø")&&I.mutate({id:a})};return e.jsxs("section",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-8 rounded-[1.75rem] border border-[#72d7ca]/20 bg-[#0e1422] p-5 sm:p-7",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center gap-2",children:[e.jsx(B,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"text-[#72d7ca]"}),e.jsx("h2",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"font-display text-2xl font-extrabold",children:"إدارة Ø§ÙØ¯Ùرات ÙØ§ÙØ¯Ø±ÙØ³"})]}),e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-2 text-sm leading-7 text-slate-500",children:"أض٠اÙÙ ØØªÙÙ ÙØ¹Ø¯ÙÙÙ Ø£Ù Ø§ØØ°ÙÙ Ù Ù Ù ÙØ§Ù ÙØ§ØØ¯. Ø§ÙØªØ¹Ø¯ÙÙØ§Øª Ù ØÙ ÙØ© Ø¨ØµÙØ§ØÙØ© اÙ٠اÙÙ."})]}),e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>{d(null),r(v),i("")},className:"inline-flex items-center justify-center gap-2 rounded-xl bg-[#72d7ca] px-4 py-3 text-sm font-bold text-[#101426] hover:brightness-110",children:[e.jsx(T,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})," Ø¯ÙØ±Ø© Ø¬Ø¯ÙØ¯Ø©"]})]}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-7 grid gap-6 lg:grid-cols-[0.34fr_0.66fr]",children:[e.jsxs("aside",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"space-y-2 rounded-2xl border border-white/10 bg-[#070a12] p-3",children:[g.map(a=>e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>W(a),className:`w-full rounded-xl p-3 text-right transition ${c===a.id?"bg-[#9f9cff]/15 text-[#d7d5ff]":"text-slate-400 hover:bg-white/[0.05]"}`,children:[e.jsx("span",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"block text-sm font-bold",children:a.title}),e.jsxs("span",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-1 block text-[11px] text-slate-500",children:[a.lessons.length," Ø¯Ø±ÙØ³ ⢠",a.isFree?"٠جاÙÙ":`${a.price} Ø±ÙØ§Ù`]})]},a.id)),g.length===0&&e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"p-4 text-center text-xs text-slate-600",children:"ÙØ§ ØªÙØ¬Ø¯ Ø¯ÙØ±Ø§Øª بعد."})]}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"space-y-6",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"rounded-2xl border border-white/10 bg-[#111827] p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center justify-between",children:[e.jsx("h3",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"font-bold",children:s.id?"تعدÙÙ Ø§ÙØ¯Ùرة":"Ø¥Ø¶Ø§ÙØ© Ø¯ÙØ±Ø©"}),s.id&&e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:G,className:"inline-flex items-center gap-1 text-xs font-bold text-rose-300 hover:text-rose-200",children:[e.jsx(k,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-3.5 w-3.5"})," ØØ°Ù Ø§ÙØ¯Ùرة"]})]}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-4 grid gap-3 sm:grid-cols-2",children:[e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"Ø§Ø³Ù Ø§ÙØ¯Ùرة",value:s.title,onChange:a=>r({...s,title:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"اÙ٠عرÙÙ slug",value:s.slug,onChange:a=>r({...s,slug:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"اÙÙØ¦Ø©",value:s.category,onChange:a=>r({...s,category:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"اÙ٠ستÙÙ",value:s.level,onChange:a=>r({...s,level:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"Ø§ÙØ³Ø¹Ø± Ø¨Ø§ÙØ±ÙاÙ",type:"number",value:String(s.price),onChange:a=>r({...s,price:Number(a)||0,isFree:Number(a)>0?0:1}
11)}),e.jsxs("label",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center gap-2 rounded-xl border border-white/10 px-3 py-2 text-xs text-slate-400",children:[e.jsx("input",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"checkbox",checked:s.isFree===1,onChange:a=>r({...s,isFree:a.target.checked?1:0,price:a.target.checked?0:Math.max(1,s.price)})})," Ø¯ÙØ±Ø© Ù
جاÙÙØ©"]})]}),e.jsxs("label",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-3 block text-xs text-slate-500",children:["اÙÙØµÙ",e.jsx("textarea",{"data-loc":"client/src/components/CourseManager.tsx:33",value:s.description,onChange:a=>r({...s,description:a.target.value}),rows:3,className:"mt-2 w-full rounded-xl border border-white/10 bg-[#070a12] p-3 text-sm text-slate-200 outline-none focus:border-[#9f9cff]/60"})]}),e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",disabled:y.isPending||C.isPending,onClick:E,className:"mt-4 inline-flex items-center gap-2 rounded-xl bg-[#9f9cff] px-4 py-3 text-sm font-bold text-[#101426] disabled:opacity-50",children:[e.jsx(U,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})," ØÙظ Ø§ÙØ¯Ùرة"]})]}),A&&e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"rounded-2xl border border-white/10 bg-[#111827] p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",children:[e.jsxs("h3",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center gap-2 font-bold",children:[e.jsx(L,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4 text-[#72d7ca]"})," Ø¯Ø±ÙØ³ ",A.title]}),e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-1 text-xs text-slate-500",children:"Ø£Ø¶Ù Ø§ÙØ¯Ø±Ø³ Ø§ÙØ£Ù٠أ٠عدÙÙ ØªØ±ØªÙØ¨ ÙÙ
ØØªÙÙ Ø§ÙØ¯Ø±Ùس."})]}),h&&e.jsx("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>{p(null),t(j)},className:"text-slate-500 hover:text-white",children:e.jsx(z,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})})]}),e.jsx("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-4 space-y-2",children:A.lessons.map(a=>e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-start gap-3 rounded-xl border border-white/10 bg-[#070a12] p-3",children:[e.jsx("span",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"grid h-7 w-7 shrink-0 place-items-center rounded-lg bg-[#72d7ca]/10 text-xs font-bold text-[#9be9df]",children:a.lessonOrder}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"min-w-0 flex-1",children:[e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"font-bold text-slate-200",children:a.title}),e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-1 truncate text-xs text-slate-500",children:a.description})]}),e.jsx("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>{p(a.id),t(a)},className:"text-[#b9b7ff] hover:text-white","aria-label":"تعدÙÙ Ø§ÙØ¯Ø±Ø³",children:e.jsx(se,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})}),e.jsx("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>Q(a.id),className:"text-rose-300 hover:text-rose-200","aria-label":"ØØ°Ù Ø§ÙØ¯Ø±Ø³",children:e.jsx(k,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})})]},a.id))}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-4 grid gap-3",children:[e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"عÙÙØ§Ù Ø§ÙØ¯Ø±Ø³",value:n.title,onChange:a=>t({...n,title:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"ÙØµÙ Ù
ختصر",value:n.description,onChange:a=>t({...n,description:a})}),e.jsxs("label",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"text-xs text-slate-500",children:["Ù
ØØªÙÙ Ø§ÙØ¯Ø±Ø³",e.jsx("textarea",{"data-loc":"client/src/components/CourseManager.tsx:33",value:n.content,onChange:a=>t({...n,content:a.target.value}),rows:5,className:"mt-2 w-full rounded-xl border border-white/10 bg-[#070a12] p-3 text-sm text-slate-200 outline-none focus:border-[#9f9cff]/60"})]}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center gap-3",children:[e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"Ø§ÙØªØ±ØªÙب",type:"number",value:String(n.lessonOrder),onChange:a=>t({...n,lessonOrder:Number(a)||1})}),e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",disabled:w.isPending||M.isPending,onClick:R,className:"mt-5 inline-flex items-center gap-2 rounded-xl bg-[#72d7ca] px-4 py-3 text-sm font-bold text-[#101426] disabled:opacity-50",children:[e.jsx(_,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})," ",h?"ØÙظ تعدÙÙ Ø§ÙØ¯Ø±Ø³":"Ø¥Ø¶Ø§ÙØ© Ø§ÙØ¯Ø±Ø³"]}
11)]})]})]}),f&&e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",role:"status",className:"rounded-xl border border-[#72d7ca]/20 bg-[#72d7ca]/10 px-4 py-3 text-sm text-[#9be9df]",children:f})]})]})]})}function b({label:l,value:o,onChange:c,type:d="text"}){return e.jsxs("label",{"data-loc":"client/src/components/CourseManager.tsx:36",className:"block text-xs text-slate-500",children:[l,e.jsx("input",{"data-loc":"client/src/components/CourseManager.tsx:36",type:d,value:o,onChange:s=>c(s.target.value),className:"mt-2 w-full rounded-xl border border-white/10 bg-[#070a12] px-3 py-2.5 text-sm text-slate-200 outline-none focus:border-[#9f9cff]/60"})]})}const ce={"student-plus":"Ø§ÙØ·Ø§Ùب Ø¨ÙØ³","teacher-pro":"اÙÙ
عÙÙ
برÙ",school:"اÙÙ
دارس"};function pe(){const[l,o]=m.useState("all"),[c,d]=m.useState("revenue"),s=x.admin.billingOverview.useQuery(void 0,{refetchOnWindowFocus:!0}),r=x.admin.entertainmentStats.useQuery(void 0,{refetchInterval:3e4,refetchOnWindowFocus:!0}),n=m.useMemo(()=>(s.data?.subscriptions??[]).filter(t=>l==="all"||l==="paid"&&t.paymentStatus==="paid"||l==="pending"&&t.paymentStatus==="pending"||l==="active"&&t.status==="active"),[s.data,l]);return e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",dir:"rtl",className:"min-h-screen bg-[#070a12] px-5 py-8 text-white sm:px-10 sm:py-10",children:[e.jsxs("header",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mx-auto flex max-w-7xl items-center justify-between",children:[e.jsxs(H,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",href:"/owner-dashboard",className:"inline-flex items-center gap-2 text-sm text-slate-400 transition hover:text-white",children:[e.jsx(X,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"h-4 w-4"})," ÙÙØØ© اÙÙ
اÙÙ"]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex items-center gap-3",children:[e.jsx(oe,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),e.jsx($,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"text-[#72d7ca]"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"font-display font-bold",children:"ÙÙØØ© Ø§ÙØ¥Ø¯Ø§Ø±Ø©"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"text-[11px] text-slate-500",children:"Ø£Ø¯ÙØ¨ ÙÙØªØ·ÙÙØ± â¢ Ø¨ÙØ§Ùات Ù
ØÙ
ÙØ©"})]})]})]}),e.jsxs("main",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mx-auto mt-10 max-w-7xl",children:[e.jsx("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"rounded-[2rem] border border-[#9f9cff]/25 bg-gradient-to-br from-[#292657] via-[#18253f] to-[#0d1629] p-8 sm:p-10",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex flex-col gap-5 sm:flex-row sm:items-end sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"text-sm font-bold text-[#d7d5ff]",children:"Ù
Ø±ÙØ² Ø§ÙØ¥Ø¯Ø§Ø±Ø© اÙÙ
اÙÙ"}),e.jsx("h1",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-3 font-display text-3xl font-extrabold sm:text-5xl",children:"اÙÙ
شترÙÙÙ ÙØ§ÙÙ
دÙÙØ¹Ø§Øª"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-4 max-w-2xl leading-8 text-slate-300",children:"تابع ØØ§ÙØ© Ø§ÙØ§Ø´ØªØ±Ø§Ùات ÙØ§ÙÙ
دÙÙØ¹Ø§Øª اÙÙ
Ø¤ÙØ¯Ø©. ÙØ§ تعرض اÙÙÙØØ© Ø£Ø±ÙØ§Ù
Ø§ÙØ¨Ø·Ø§Ùات Ø£Ù Ø§ÙØ¨ÙØ§ÙØ§Øª Ø§ÙØØ³Ø§Ø³Ø©."})]}),e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",type:"button",onClick:()=>s.refetch(),className:"inline-flex items-center justify-center gap-2 rounded-xl border border-white/10 bg-white/[0.06] px-4 py-3 text-sm font-bold text-slate-200 hover:bg-white/[0.1]",children:[e.jsx(F,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:`h-4 w-4 ${s.isFetching?"animate-spin":""}`})," ØªØØ¯ÙØ« Ø§ÙØ¨ÙØ§ÙØ§Øª"]})]})}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-5",children:[e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(ee,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"إجÙ
اÙÙ Ø§ÙØ¥Ùرادات",value:`${s.data?.stats.totalRevenue??"â"} Ø±ÙØ§Ù`,tone:"blue",active:c==="revenue",onClick:()=>d("revenue")}),e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(Y,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"عدد Ø§ÙØ·Ùاب",value:s.data?.stats.students??"â",tone:"teal",active:c==="students",onClick:()=>d("students")}),e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(L,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"Ø§ÙØ¯Ùرات اÙÙØ´Ø·Ø©",value:s.data?.stats.activeCourses??"â",tone:"purple",active:c==="courses",onClick:()=>d("courses")}),e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(Z,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"Ø§Ø´ØªØ±Ø§ÙØ§Øª ÙØ´Ø·Ø©",value:s.data?.stats.active??"â",tone:"purple"}),e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(te,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"Ù
دÙÙØ¹Ø§Øª Ù
عÙÙØ©",value:s.data?.stats.pending??"â",tone:"orange"})]}),e.jsx("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-5 rounded-2xl border border-white/10 bg-[#0e1422] p-5",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex items-center gap-3",children:[e.jsx(P,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"h-5 w-5 text-[#9be9df]"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"text-sm font-bold text-slate-200",children:c==="revenue"?"Ù
ÙØ®Øµ Ø§ÙØ¥Ùرادات":c==="students"?"Ù
ÙØ®Øµ Ø§ÙØ·Ùاب":"Ù
ÙØ®Øµ Ø§ÙØ¯Ùرات"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-1 text-xs leading-6 text-slate-500",children:c==="revenue"?"Ø§ÙØ¥Ø¬Ù
اÙÙ Ù
Ù Ø§ÙØ§Ø´ØªØ±Ø§Ùات ÙØ§ÙÙ
دÙÙØ¹Ø§Øª اÙÙ
Ø¤ÙØ¯Ø© ÙÙØ¯Ùرات.":c==="students"?"عدد Ø§ÙØØ³Ø§Ø¨Ø§Øª Ø§ÙØªØ¹ÙÙÙ
ÙØ© اÙÙ
Ø³Ø¬ÙØ© ÙÙ ÙØ§Ø¹Ø¯Ø© Ø§ÙØ¨ÙØ§ÙØ§Øª.":"Ø§ÙØ¯Ùرات اÙÙ
ÙØ´Ùرة ÙØ§ÙÙ
ØªØ§ØØ© ØØ§ÙÙØ§Ù ÙÙØ·Ùاب."})]})]})}),e.jsx(re,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",trend:s.data?.trend??[]}),e.jsx(de,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",stats:r.data})," ",e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-8 overflow-hidden rounded-[1.75rem] border border-white/10 bg-[#0e1422]",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex flex-col gap-4 border-b border-white/10 p-5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"font-display text-xl font-extrabold",children:"Ø³Ø¬Ù Ø§ÙØ§Ø´ØªØ±Ø§Ùات"}),e.jsxs("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-1 text-xs text-slate-500",children:[n.length," Ø³Ø¬Ù Ø¸Ø§ÙØ±"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex flex-wrap gap-2",children:[e.jsx(q,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-2 h-4 w-4 text-slate-500"}),[["all","اÙÙÙ"],["paid","Ù
دÙÙØ¹"],["pending","Ù
عÙÙ"],["active","ÙØ´Ø·"]].map(([t,h])=>e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",type:"button",onClick:()=>o(t),className:`rounded-lg px-3 py-2 text-xs font-bold transition ${l===t?"bg-[#9f9cff] text-[#101426]":"bg-white/[0.05] text-slate-400 hover:bg-white/[0.1]"}`,children:h},t))]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"overflow-x-auto",children:[e.jsxs("table",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"w-full min-w-[760px] text-right text-sm",children:[e.jsx("thead",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"bg-white/[0.03] text-xs text-slate-500",children:e.jsxs("tr",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"اÙÙ
شترÙ"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"Ø§ÙØ®Ø·Ø©"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"اÙÙ
Ø¨ÙØº"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"ØØ§ÙØ© Ø§ÙØ¯Ùع"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"Ø§ÙØØ§ÙØ©"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"آخر ØªØØ¯ÙØ«"})]})}),e.jsx("tbody",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:n.map(t=>e.jsxs("tr",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"border-t border-white/[0.06] transition hover:bg-white/[0.025]",children:[e.jsxs("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"font-bold text-slate-200",children:t.userName||"Ù
ستخدÙ
"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-1 text-xs text-slate-500",children:t.email||"بدÙÙ Ø¨Ø±ÙØ¯"})]}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 text-slate-300",children:ce[t.planSlug]||t.planSlug}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold text-[#9be9df]",children:t.amountSar?`${t.amountSar} Ø±ÙØ§Ù`:"ØØ³Ø¨ Ø§ÙØ§ØªÙاÙ"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4",children:e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:`rounded-full px-2.5 py-1 text-[11px] font-bold ${t.paymentStatus==="paid"?"bg-[#72d7ca]/10 text-[#9be9df]":"bg-[#f3a243]/10 text-[#ffd18f]"}`,children:t.paymentStatus==="paid"?"Ù
دÙÙØ¹":t.paymentStatus==="failed"?"ÙØ´Ù":"Ù
عÙÙ"})}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 text-slate-400",children:t.status==="active"?"ÙØ´Ø·":t.status==="canceled"?"Ù
ÙØºÙ":"Ù
عÙÙ"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 text-xs text-slate-500",children:new Date(t.updatedAt).toLocaleDateString("ar-SA")})]},t.id))})]}),!s.isLoading&&n.length===0&&e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"p-10 text-center text-sm text-slate-500",children:"ÙØ§ ØªÙØ¬Ø¯ Ø³Ø¬ÙØ§Øª Ù
Ø·Ø§Ø¨ÙØ© ÙÙØ°Ø§ اÙÙÙØªØ±."}),s.isLoading&&e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"p-10 text-center text-sm text-slate-500",children:"جار٠تØÙ
ÙÙ Ø¨ÙØ§Ùات اÙÙÙØªØ±Ø©â¦"})]})]}),e.jsx(le,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),e.jsx(ne,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),e.jsx(ae,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-5 text-xs leading-6 text-slate-600",children:"Ø§ÙØ¥Ø¬Ù
اÙ٠اÙÙ
ØØ³Ùب ÙØ¹ØªÙ
د عÙ٠أسعار Ø§ÙØ®Ø·Ø· Ø§ÙØØ§ÙÙØ©. بعد ربط Moyasar سÙÙØ¹ØªÙ
د ÙÙØ· عÙ٠إشعار Ø§ÙØ¯Ùع اÙÙ
ÙØ«ÙÙ ÙØªØØ¯ÙØ« Ø§ÙØØ§ÙØ©."})]})]})}function ne(){const l=x.admin.accessAttempts.useQuery(void 0,{refetchInterval:3e4}),o=l.data??[];return e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"mt-8 overflow-hidden rounded-[1.75rem] border border-[#78a9ff]/20 bg-[#0e1422]",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"flex items-center justify-between border-b border-white/10 p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"font-display text-xl font-extrabold",children:"سج٠أÙ
Ø§Ù Ø§ÙØ¯Ø®ÙÙ"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"mt-1 text-xs text-slate-500",children:"آخر Ù
ØØ§ÙÙØ§Øª ÙØªØ خصائص Ø§ÙØ¥Ø¯Ø§Ø±Ø© â ÙØ§ ÙØªÙ
ØÙظ Ø§ÙØ±Ù
ز Ø§ÙØ³Ø±Ù."})]}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",type:"button",onClick:()=>l.refetch(),className:"rounded-xl border border-white/10 px-3 py-2 text-xs font-bold text-slate-300 hover:bg-white/[0.06]",children:"ØªØØ¯ÙØ«"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"overflow-x-auto",children:[e.jsxs("table",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"w-full min-w-[680px] text-right text-sm",children:[e.jsx("thead",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"bg-white/[0.03] text-xs text-slate-500",children:e.jsxs("tr",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",children:[e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"Ø§ÙØØ§ÙØ©"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"Ø§ÙØ³Ø¨Ø¨"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"عÙÙØ§Ù Ø§ÙØ´Ø¨ÙØ©"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"اÙÙ
ØªØµÙØ"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"اÙÙÙØª"})]})}),e.jsx("tbody",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",children:o.map(c=>e.jsxs("tr",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"border-t border-white/[0.06]",children:[e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:`rounded-full px-2.5 py-1 text-[11px] font-bold ${c.success?"bg-emerald-300/10 text-emerald-300":"bg-rose-300/10 text-rose-300"}`,children:c.success?"ÙØ§Ø¬Ø":"ÙØ§Ø´Ù"})}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3 text-slate-300",children:c.reason==="success"?"تÙ
Ø§ÙØªØÙÙ":c.reason==="invalid-code"?"رÙ
ز ØºÙØ± صØÙØ":"ØØ³Ø§Ø¨ ØºÙØ± Ù
صرØ"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3 text-xs text-slate-500",children:c.ipAddress||"ØºÙØ± Ù
تاØ"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"max-w-[220px] truncate px-5 py-3 text-xs text-slate-500",title:c.userAgent||"",children:c.userAgent||"ØºÙØ± Ù
تاØ"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3 text-xs text-slate-500",children:new Date(c.attemptedAt).toLocaleStr
11ing("ar-SA")})]},c.id))})]}),!l.isLoading&&o.length===0&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"p-8 text-center text-sm text-slate-500",children:"ÙØ§ ØªÙØ¬Ø¯ Ù
ØØ§ÙÙØ§Øª Ù
Ø³Ø¬ÙØ© بعد."}),l.isLoading&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"p-8 text-center text-sm text-slate-500",children:"جار٠تØÙ
ÙÙ Ø³Ø¬Ù Ø§ÙØ£Ù
اÙâ¦"})]})]})}function le(){const[l,o]=m.useState(""),[c,d]=m.useState(""),[s,r]=m.useState(""),n=x.admin.changeOwnerCode.useMutation({onSuccess:()=>{o(""),d(""),r("تÙ
تغÙÙØ± رÙ
ز دخÙÙ Ø§ÙØ¥Ø¯Ø§Ø±Ø© Ø¨ÙØ¬Ø§Ø.")},onError:t=>r(t.message||"تعذر تغÙÙØ± Ø§ÙØ±Ù
ز.")});return e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"mt-8 rounded-[1.75rem] border border-rose-300/20 bg-[#0e1422] p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"flex items-start gap-3",children:[e.jsx($,{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"mt-1 h-5 w-5 text-rose-200"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"font-display text-xl font-extrabold",children:"تغÙÙØ± رÙ
ز دخÙÙ Ø§ÙØ¥Ø¯Ø§Ø±Ø©"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"mt-2 text-sm leading-7 text-slate-400",children:"ÙØªØ·Ùب Ø§ÙØ±Ù
ز Ø§ÙØØ§ÙÙ. ÙÙØÙØ¸ Ø§ÙØ±Ù
ز Ù
Ø´ÙØ±Ø§Ù ÙÙØ§ ÙØ¸Ùر ÙÙ ÙÙØØ© Ø§ÙØªØÙÙ
."})]})]}),e.jsxs("form",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",onSubmit:t=>{t.preventDefault(),r(""),c.length===18&&n.mutate({currentCode:l,nextCode:c})},className:"mt-5 grid gap-3 sm:grid-cols-3",children:[e.jsx("input",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",value:l,onChange:t=>o(t.target.value.replace(/\D/g,"").slice(0,64)),type:"password",inputMode:"numeric",autoComplete:"current-password",placeholder:"Ø§ÙØ±Ù
ز Ø§ÙØØ§ÙÙ",className:"h-11 rounded-xl border border-white/10 bg-black/20 px-4 text-sm text-white outline-none focus:border-rose-200/50"}),e.jsx("input",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",value:c,onChange:t=>d(t.target.value.replace(/\D/g,"").slice(0,18)),type:"password",inputMode:"numeric",autoComplete:"new-password",placeholder:"Ø§ÙØ±Ù
ز Ø§ÙØ¬Ø¯Ùد: 18 رÙÙ
اÙ",className:"h-11 rounded-xl border border-white/10 bg-black/20 px-4 text-sm text-white outline-none focus:border-rose-200/50"}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",disabled:n.isPending||l.length<8||c.length!==18,className:"rounded-xl bg-rose-200 px-4 py-3 text-sm font-bold text-[#28151d] disabled:cursor-not-allowed disabled:opacity-40",children:n.isPending?"Ø¬Ø§Ø±Ù Ø§ÙØÙØ¸â¦":"ØÙظ Ø§ÙØ±Ù
ز Ø§ÙØ¬Ø¯Ùد"})]}),s&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:`mt-3 text-sm ${s.startsWith("تÙ
")?"text-emerald-300":"text-rose-300"}`,children:s})]})}function N({icon:l,label:o,value:c,tone:d,active:s=!1,onClick:r}){const n={teal:"text-[#72d7ca] border-[#72d7ca]/20",purple:"text-[#9f9cff] border-[#9f9cff]/20",orange:"text-[#f3a243] border-[#f3a243]/20",blue:"text-[#78a9ff] border-[#78a9ff]/20"},t=e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"flex items-center justify-between",children:[e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"opacity-80",children:l}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"text-xs text-slate-500",children:o})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"mt-4 font-display text-2xl font-extrabold text-white",children:c}),s&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"mt-2 text-[11px] font-bold text-[#9be9df]",children:"تÙ
Ø§ÙØªØØ¯Ùد"})]});return r?e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",type:"button",onClick:r,className:`rounded-2xl border bg-[#0e1422] p-5 text-right transition hover:-translate-y-1 hover:bg-white/[0.06] ${n[d]} ${s?"ring-2 ring-[#9be9df]/40":""}`,children:t}):e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:`rounded-2xl border bg-[#0e1422] p-5 ${n[d]}`,children:t})}function de({stats:l}){const o=(c,d,s)=>e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"rounded-2xl border border-white/10 bg-white/[0.03] p-4",children:[e.jsx("h3",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:`font-bold ${s}`,children:c}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"mt-3 space-y-2",children:[d.map((r,n)=>e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"flex items-center justify-between gap-3 rounded-lg bg-black/15 px-3 py-2 text-xs",children:[e.jsxs("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"truncate text-slate-300",children:[n+1,". ",r.gameTitle]}),e.jsxs("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"shrink-0 font-bold text-slate-500",children:[r.plays," تشغÙÙ"]})]},r.gameId)),!d.length&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"py-3 text-center text-xs text-slate-500",children:"ÙØ§ ØªÙØ¬Ø¯ Ø¨ÙØ§Ùات بعد."})]})]});return e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-5 rounded-[1.75rem] border border-[#f3a243]/20 bg-gradient-to-br from-[#1b1822] to-[#0e1422] p-5 sm:p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"flex items-center gap-3",children:[e.jsx(V,{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"h-5 w-5 text-[#f3a243]"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"font-display text-xl font-extrabold",children:"Ø¥ÙØ¨Ø§Ù Ø§ÙØ£Ùعاب"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-1 text-xs text-slate-500",children:"Ù
ÙØ§Ø±ÙØ© ÙØ§Ø¶ØØ© بÙÙ Ø§ÙØ£Ùعاب اÙÙ
جاÙÙØ© ÙØ§ÙÙ
Ù
ÙØ²Ø©."})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"flex flex-wrap gap-2 text-xs",children:[e.jsxs("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"rounded-lg bg-[#72d7ca]/10 px-3 py-2 font-bold text-[#9be9df]",children:[l?.activeUsers??"â"," Ù
ستخدÙ
ÙØ´Ø·"]}),e.jsxs("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"rounded-lg bg-[#9f9cff]/10 px-3 py-2 font-bold text-[#c9c8ff]",children:[l?.totalPlays??"â"," إجÙ
اÙÙ Ø§ÙØªØ´ØºÙÙ"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-5 grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"rounded-xl border border-[#72d7ca]/20 bg-[#72d7ca]/[0.06] p-4",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"text-xs text-slate-400",children:"تشغÙÙ Ø§ÙØ£Ùعاب اÙÙ
جاÙÙØ©"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-2 font-display text-3xl font-extrabold text-[#9be9df]",children:l?.freePlays??"â"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"rounded-xl border border-[#c9c8ff]/20 bg-[#9f9cff]/[0.06] p-4",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"text-xs text-slate-400",children:"تشغÙÙ Ø§ÙØ£Ùعاب اÙÙ
Ù
ÙØ²Ø©"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-2 font-display text-3xl font-extrabold text-[#c9c8ff]",children:l?.premiumPlays??"â"})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-4 grid gap-3 md:grid-cols-2",children:[o("Ø§ÙØ£Ùثر ÙØ¹Ø¨Ø§Ù Ù
Ø¬Ø§ÙØ§Ù",l?.topFreeGames??[],"text-[#9be9df]"),o("Ø§ÙØ£Ùثر ÙØ¹Ø¨Ø§Ù Ù
٠اÙÙ
Ù
ÙØ²",l?.to
11pPremiumGames??[],"text-[#c9c8ff]")]})]})}function re({trend:l}){const[o,c]=m.useState("revenue"),d=l.map(n=>o==="revenue"?n.revenue:n.students),s=Math.max(...d,1),r=d.map((n,t)=>`${t*(100/Math.max(d.length-1,1))},${94-n/s*78}`).join(" ");return e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"mt-5 rounded-[1.75rem] border border-white/10 bg-[#0e1422] p-5 sm:p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"flex items-center gap-2",children:[e.jsx(P,{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"h-5 w-5 text-[#9be9df]"}),e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"font-display text-xl font-extrabold",children:"ÙÙ
Ù Ø§ÙØ£Ø¯Ø§Ø¡ Ø®ÙØ§Ù 7 Ø£ÙØ§Ù
"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"mt-1 text-xs text-slate-500",children:"ØªÙØ§Ø¹Ù Ù
ع اÙÙ
خطط ÙØªØ¨Ø¯ÙÙ Ù
Ø¹Ø¯Ù Ø§ÙØ¥Ùرادات ÙØªØ³Ø¬ÙÙ Ø§ÙØ·Ùاب."})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"flex gap-2",children:[e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",type:"button",onClick:()=>c("revenue"),className:`rounded-lg px-3 py-2 text-xs font-bold ${o==="revenue"?"bg-[#78a9ff] text-[#101426]":"bg-white/[0.05] text-slate-400"}`,children:"Ø§ÙØ¥Ùرادات"}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",type:"button",onClick:()=>c("students"),className:`rounded-lg px-3 py-2 text-xs font-bold ${o==="students"?"bg-[#72d7ca] text-[#101426]":"bg-white/[0.05] text-slate-400"}`,children:"تسجÙÙ Ø§ÙØ·Ùاب"})]})]}),e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"mt-6 overflow-x-auto",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"min-w-[560px]",children:[e.jsxs("svg",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",viewBox:"0 0 100 100",className:"h-52 w-full overflow-visible",role:"img","aria-label":o==="revenue"?"Ù
خطط ÙÙ
Ù Ø§ÙØ¥Ùرادات":"Ù
خطط تسجÙÙ Ø§ÙØ·Ùاب",children:[e.jsx("defs",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",children:e.jsxs("linearGradient",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",id:"growthLine",x1:"0",x2:"1",children:[e.jsx("stop",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",offset:"0%",stopColor:"#78a9ff"}),e.jsx("stop",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",offset:"100%",stopColor:"#9f9cff"})]})}),e.jsx("line",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",x1:"0",y1:"94",x2:"100",y2:"94",stroke:"rgba(255,255,255,.12)",strokeWidth:".5"}),e.jsx("polyline",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",points:r,fill:"none",stroke:"url(#growthLine)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),d.map((n,t)=>e.jsx("circle",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",cx:t*(100/Math.max(d.length-1,1)),cy:94-n/s*78,r:"1.8",fill:"#f3a243",children:e.jsx("title",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",children:`${l[t]?.label??""}: ${n}${o==="revenue"?" Ø±ÙØ§Ù":" Ø·Ø§ÙØ¨"}`})},l[t]?.key??t))]}),e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"mt-2 flex justify-between text-[10px] text-slate-600",children:l.map(n=>e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",children:n.label},n.key))})]})})]})}function oe(){const[l,o]=m.useState(!1),[c,d]=m.useState("all"),s=x.admin.notifications.useQuery(void 0,{refetchInterval:1e4,refetchOnWindowFocus:!0}),r=x.useUtils(),n=x.admin.markNotificationRead.useMutation({onSuccess:()=>r.admin.notifications.invalidate()}),t=x.admin.markAllNotificationsRead.useMutation({onSuccess:()=>r.admin.notifications.invalidate()}),h=s.data??[],p=h.filter(i=>!i.readAt).length,f=h.filter(i=>c==="all"||i.type===c);return e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"relative",children:[e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>o(i=>
11!i),className:"relative grid h-10 w-10 place-items-center rounded-xl border border-white/10 bg-white/[0.05] text-slate-300 transition hover:bg-white/[0.1]","aria-label":"إشعارات Ø§ÙØ¥Ø¯Ø§Ø±Ø©",children:[e.jsx(J,{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"h-4 w-4"}),p>0&&e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"absolute -right-1 -top-1 grid min-h-5 min-w-5 place-items-center rounded-full bg-[#f3a243] px-1 text-[10px] font-extrabold text-[#101426]",children:p>99?"99+":p})]}),l&&e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"absolute left-0 top-12 z-30 w-[min(22rem,calc(100vw-2rem))] rounded-2xl border border-white/10 bg-[#111827] p-3 shadow-2xl",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"flex items-center justify-between border-b border-white/10 px-2 pb-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"text-sm font-bold text-white",children:"إشعارات Ø§ÙØ¥Ø¯Ø§Ø±Ø©"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-1 text-[11px] text-slate-500",children:"ØªØªØØ¯Ø« تÙÙØ§Ø¦Ùا٠ÙÙ 10 Ø«ÙØ§ÙÙ"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"flex items-center gap-3",children:[e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>s.refetch(),disabled:s.isFetching,className:"inline-flex items-center gap-1 text-[11px] font-bold text-[#78a9ff] disabled:opacity-50",title:"ØªØØ¯ÙØ« Ø§ÙØ¥Ø´Ø¹Ø§Ø±Ø§Øª",children:[e.jsx(F,{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:`h-3.5 w-3.5 ${s.isFetching?"animate-spin":""}`})," ØªØØ¯ÙØ«"]}),e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",disabled:!p||t.isPending,onClick:()=>t.mutate(),className:"inline-flex items-center gap-1 text-[11px] font-bold text-[#9be9df] disabled:opacity-40",children:[e.jsx(K,{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"h-3.5 w-3.5"})," تعÙÙÙ
اÙÙÙ ÙÙ
ÙØ±ÙØ¡"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-3 flex gap-1 rounded-xl bg-white/[0.03] p-1",children:[e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>d("all"),className:`flex-1 rounded-lg px-2 py-2 text-[10px] font-bold ${c==="all"?"bg-white/[0.1] text-white":"text-slate-500"}`,children:"اÙÙÙ"}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>d("student-registered"),className:`flex-1 rounded-lg px-2 py-2 text-[10px] font-bold ${c==="student-registered"?"bg-[#72d7ca]/15 text-[#9be9df]":"text-slate-500"}`,children:"تسجÙÙ Ø§ÙØ·Ùاب"}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>d("payment-received"),className:`flex-1 rounded-lg px-2 py-2 text-[10px] font-bold ${c==="payment-received"?"bg-[#f3a243]/15 text-[#ffd18f]":"text-slate-500"}`,children:"Ø§ÙØ¯Ùعات"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-2 max-h-80 space-y-2 overflow-y-auto",children:[f.length===0&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"px-2 py-8 text-center text-xs text-slate-500",children:"ÙØ§ ØªÙØ¬Ø¯ إشعارات ضÙ
Ù ÙØ°Ø§ Ø§ÙØªØµÙÙÙ."}),f.slice(0,20).map(i=>e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>!i.readAt&&n.mutate({notificationId:i.id}),className:`w-full rounded-xl border p-3 text-right transition hover:bg-white/[0.06] ${i.readAt?"border-white/5 bg-white/[0.02]":"border-[#72d7ca]/25 bg-[#72d7ca]/[0.08]"}`,children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"flex items-start gap-2",children:[e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:`mt-1 h-2 w-2 shrink-0 rounded-full ${i.readAt?"bg-slate-700":"bg-[#72d7ca]"}`}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"min-w-0",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"text-xs font-bold text-slate-200",children:i.title}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-1 text-[11px] leading-5 text-slate-400",children:i.detail}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-1 text-[10px] text-slate-600",children:new Date(i.createdAt).toLocaleStr
11ing("ar-SA")})]})]})},i.id))]})]})]})}export{pe 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.