1import{j as e}from"./motion-CghpQXKE.js";import{r as d}from"./router-epi9CWfp.js";import{A as Q}from"./AdminTabs-CCJH3r_r.js";import{A as G}from"./AdminPageHeader-B8DHzsUR.js";import{s as T,T as z,ak as D,bK as O,A as $,bL as K,bM as B,n as H,bN as P,ad as R}from"./index-_-9kgWZ5.js";import{K as y}from"./KpiCard-DstGqr2F.js";import{C as q}from"./calendar-DrNo2-T3.js";import{L as E}from"./loader-jX3qRWad.js";import"./supabase-CTBn71hm.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"19ca80bcc68db376b793c8a886be03b6d5ea8a5c"};var l=new s.Error().stack;l&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[l]="28eed582-1916-4cf8-a791-96a78c48791c",s._sentryDebugIdIdentifier="sentry-dbid-28eed582-1916-4cf8-a791-96a78c48791c")}catch{}})();const Y=[{value:"all",label:"Tous"},{value:"active",label:"Actifs"},{value:"upcoming",label:"à venir"},{value:"completed",label:"Terminés"}],b={active:"bg-emerald-500/15 text-emerald-300 border-emerald-500/30",upcoming:"bg-amber-500/15 text-amber-300 border-amber-500/30",completed:"bg-zinc-500/15 text-zinc-300 border-zinc-500/30",cancelled:"bg-rose-500/15 text-rose-300 border-rose-500/30"},U={performance:"Performance",consistency:"Constance",habit_stacking:"Habitudes combinées",exploration:"Découverte",recovery:"Récupération",nutrition:"Nutrition",connected:"Données connectées",multimedia:"Multimédia",streak_perfect:"Régularité parfaite",social:"Social",express:"Express (3 jours)",seasonal:"Saisonnier",discovery:"Découverte"};function J(s){return s?new Date(s).toLocaleDateString("fr-FR",{day:"2-digit",month:"short",year:"numeric"}):"â"}function M(s,l){const i=new Date(s),c=new Date(l),p=i.toLocaleDateString("fr-FR",{day:"2-digit",month:"short"}),o=c.toLocaleDateString("fr-FR",{day:"2-digit",month:"short"});return`${p} â ${o}`}function V(){const[s,l]=d.useState([]),[i,c]=d.useState(!0),[p,o]=d.useState(null),[x,h]=d.useState("all"),[r,n]=d.useState(null);d.useEffect(()=>{let a=!1;return c(!0),o(null),T.rpc("admin_challenges_overview",{p_status:x,p_days_back:60}).then(({data:j,error:F})=>{a||(F?(o(F.message),l([])):l(j??[]),c(!1))}),()=>{a=!0}},[x]);const m=s.length,u=s.filter(a=>a.status==="active").length,f=s.filter(a=>a.status==="upcoming").length,g=s.filter(a=>a.status==="active").reduce((a,j)=>a+j.active_count,0),t=s.length>0?Math.round(s.reduce((a,j)=>a+Number(j.completion_pct_avg||0),0)/s.length):0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsx(y,{icon:z,label:"Challenges actifs",value:String(u),sublabel:`${f} à venir · ${m} total`}),e.jsx(y,{icon:D,label:"Participants actifs",value:String(g),sublabel:"Tous challenges actifs cumulés",alert:g<=1}),e.jsx(y,{icon:O,label:"Complétion moyenne",value:`${t}%`,sublabel:"Sur la fenêtre 60j"}),e.jsx(y,{icon:q,label:"Prochain upcoming",value:s.find(a=>a.status==="upcoming")?.title?.slice(0,24)||(f===0?"â":"Sans titre"),sublabel:s.find(a=>a.status==="upcoming")?.start_date?`démarre ${J(s.find(a=>a.status==="upcoming").start_date)}`:"aucun planifié"})]}),e.jsx("div",{className:"flex gap-1 bg-surface/50 border border-white/10 rounded-lg p-1 inline-flex",children:Y.map(a=>e.jsx("button",{onClick:()=>h(a.value),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${x===a.value?"bg-accent/20 text-accent":"text-text-tertiary hover:text-text-secondary"}`,children:a.label},a.value))}),i?e.jsxs("div",{className:"flex items-center gap-2 text-text-tertiary text-sm py-12 justify-center",children:[e.jsx(E,{className:"w-4 h-4 animate-spin"}),"Chargement des challengesâ¦"]}):p?e.jsxs("div",{className:"flex items-center gap-2 text-rose-300 text-sm py-12 justify-center",children:[e.jsx($,{className:"w-4 h-4"}),p]}):s.length===0?e.jsx("div",{className:"text-text-tertiary text-sm py-12 text-center",children:"Aucun challenge sur cette fenêtre."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-white/10",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-surface/40 text-text-tertiary text-xs uppercase tracking-wider",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Titre"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Catégorie"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Statut"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Dates"}),e.jsx("th",{className:"px-3 py-2 text-right",children:"Participants"}),e.jsx("th",{className:"px-3 py-2 text-right",children:"Auto"}),e.jsx("th",{className:"px-3 py-2 text-right",children:"Compl. moy."}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Top"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Annonce"})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:s.map(a=>{const j=a.status==="active"&&a.active_count<=1;return e.jsxs("tr",{onClick:()=>n(a),className:"hover:bg-white/[0.03] cursor-pointer transition-colors",children:[e.jsx("td",{className:"px-3 py-2 text-text-primary font-medium",children:a.title}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-secondary",children:U[a.challenge_type]||a.challenge_type}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] uppercase tracking-wider border ${b[a.status]||b.completed}`,children:a.status})}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-tertiary whitespace-nowrap",children:M(a.start_date,a.end_date)}),e.jsxs("td",{className:`px-3 py-2 text-right ${j?"text-rose-300 font-medium":"text-text-primary"}`,children:[a.active_count,e.jsxs("span",{className:"text-text-tertiary text-xs",children:[" / ",a.participants_count]})]}),e.jsx("td",{className:"px-3 py-2 text-right text-text-tertiary text-xs",children:a.auto_enrolled_count}),e.jsxs("td",{className:"px-3 py-2 text-right text-text-secondary",children:[Number(a.completion_pct_avg).toFixed(1),"%"]}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-secondary",children:a.top_scorer_first_name||"â"}),e.jsx("td",{className:"px-3 py-2 text-center",children:a.announcement_sent?e.jsx("span",{className:"text-emerald-400 text-xs",children:"â"}):e.jsx("span",{className:"text-text-tertiary text-xs",children:"â"})})]},a.challenge_id)})})]})}),r&&e.jsx(W,{challenge:r,onClose:()=>n(null)})]})}function W({challenge:s,onClose:l}
1){const[i,c]=d.useState([]),[p,o]=d.useState(!0),[x,h]=d.useState(null);return d.useEffect(()=>{let r=!1;return o(!0),h(null),T.rpc("admin_challenge_leaderboard",{p_challenge_id:s.challenge_id}).then(({data:n,error:m})=>{r||(m?(h(m.message),c([])):c(n??[]),o(!1))}),()=>{r=!0}},[s.challenge_id]),e.jsxs(K,{open:!0,onClose:l,eyebrow:`${U[s.challenge_type]||s.challenge_type} · ${M(s.start_date,s.end_date)}`,title:s.title,maxWidthClassName:"sm:max-w-4xl",children:[s.description&&e.jsx("p",{className:"px-5 pt-4 text-sm text-text-secondary",children:s.description}),e.jsx("div",{className:"overflow-auto flex-1",children:p?e.jsxs("div",{className:"flex items-center gap-2 text-text-tertiary text-sm py-12 justify-center",children:[e.jsx(E,{className:"w-4 h-4 animate-spin"}),"Chargement du classementâ¦"]}):x?e.jsxs("div",{className:"flex items-center gap-2 text-rose-300 text-sm py-12 justify-center",children:[e.jsx($,{className:"w-4 h-4"}),x]}):i.length===0?e.jsx("div",{className:"text-text-tertiary text-sm py-12 text-center",children:"Aucun participant inscrit à ce challenge."}):e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-surface/40 text-text-tertiary text-xs uppercase tracking-wider sticky top-0",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-center w-12",children:"#"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"User"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Email"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Statut"}),e.jsx("th",{className:"px-3 py-2 text-right",children:"Actions"}),e.jsx("th",{className:"px-3 py-2 text-right",children:"Compl."}),e.jsx("th",{className:"px-3 py-2 text-right",children:"Points"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Détails"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Auto"})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:i.map((r,n)=>e.jsxs("tr",{className:"hover:bg-white/[0.02]",children:[e.jsx("td",{className:"px-3 py-2 text-center text-text-tertiary text-xs",children:n<3?e.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[e.jsx(B,{className:"w-3 h-3",style:{color:n===0?"#F5A623":n===1?"#9CA3AF":"#FF6B35"}}),n+1]}):n+1}),e.jsx("td",{className:"px-3 py-2 text-text-primary",children:r.first_name||"â"}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-secondary",children:r.email||"â"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] uppercase tracking-wider border ${r.participant_status==="completed"?b.active:r.participant_status==="dropped"?b.cancelled:b.upcoming}`,children:r.participant_status})}),e.jsxs("td",{className:"px-3 py-2 text-right text-text-secondary",children:[r.total_actions," / ",r.target_actions]}),e.jsxs("td",{className:"px-3 py-2 text-right text-text-primary font-medium",children:[Number(r.completion_pct).toFixed(0),"%"]}),e.jsx("td",{className:"px-3 py-2 text-right text-text-tertiary",children:r.total_points}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-tertiary max-w-xs",children:e.jsx("div",{className:"line-clamp-2 break-words",children:Object.keys(r.action_counts||{}).length>0?Object.entries(r.action_counts).map(([m,u])=>`${m}:${u}`).join(" · "):"â"})}),e.jsx("td",{className:"px-3 py-2 text-center",children:r.auto_enrolled?e.jsx("span",{className:"text-amber-300 text-xs",title:"Auto-enrolled",children:"A"}):e.jsx("span",{className:"text-emerald-300 text-xs",title:"Manual enroll",children:"M"})})]},r.participant_id))})]})}),e.jsxs("div",{className:"px-5 py-3 border-t border-white/10 text-xs text-text-tertiary shrink-0 flex justify-between",children:[e.jsxs("span",{children:[i.length," participant",i.length>1?"s":""," ·"," ",i.filter(r=>r.auto_enrolled).length," auto-enrolled"]}),e.jsxs("span",{children:["Top scorer : ",i[0]?.first_name||"â"," (",i[0]?`${Number(i[0].completion_pct).toFixed(0)}%`:"â",")"]})]})]})}const L={active:"bg-emerald-500/15 text-emerald-300 border-emerald-500/30",pending_a:"bg-amber-500/15 text-amber-300 border-amber-500/30",pending_b:"bg-amber-500/15 text-amber-300 border-amber-500/30",paused:"bg-zinc-500/15 text-zinc-300 border-zinc-500/30",ended:"bg-rose-500/15 text-rose-300 border-rose-500/30"},I={proposed:"bg-amber-500/15 text-amber-300 border-amber-500/30",accepted:"bg-cyan-500/15 text-cyan-300 border-cyan-500/30",active:"bg-emerald-500/15 text-emerald-300 border-emerald-500/30",completed:"bg-zinc-500/15 text-zinc-300 border-zinc-500/30",expired:"bg-rose-500/15 text-rose-300 border-rose-500/30",declined:"bg-rose-500/15 text-rose-300 border-rose-500/30"},X={bronze:"#CD7F32",silver:"#9CA3AF",gold:"#F5A623",platinum:"#06B6D4"};function N(s){return s?new Date(s).toLocaleDateString("fr-FR",{day:"2-digit",month:"short"}):"â"}
1function _(s){return s?new Date(s).toLocaleString("fr-FR",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}):"â"}function v(s){const l=Object.entries(s||{});return l.length===0?"â":l.map(([i,c])=>`${i}:${c}`).join(" · ")}function w(s,l,i){const[c,p]=d.useState([]),[o,x]=d.useState(!0),[h,r]=d.useState(null);return d.useEffect(()=>{let n=!1;return x(!0),r(null),T.rpc(s,l).then(({data:m,error:u})=>{n||(u?(r(u.message),p([])):p(m??[]),x(!1))}),()=>{n=!0}},i),{data:c,loading:o,error:h}}function Z(){const{data:s,loading:l,error:i}=w("admin_buddy_overview",{p_days_back:60},[]),{data:c,loading:p,error:o}=w("admin_buddy_active_quests",{p_days_back:14},[]),{data:x,loading:h,error:r}=w("admin_buddy_pending_invitations",{},[]),n=s.filter(t=>t.pair_status==="active").length,m=s.reduce((t,a)=>t+(a.current_streak||0),0),u=n>0?Math.round(m/n):0,f=c.filter(t=>t.quest_status==="active").length,g=x.length;return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsx(y,{icon:D,label:"Pairs actives",value:String(n),sublabel:`${s.length} total (60j)`,alert:n===0}),e.jsx(y,{icon:H,label:"Streak moyen",value:`${u}j`,sublabel:`max : ${s.reduce((t,a)=>Math.max(t,a.longest_streak||0),0)}j`}),e.jsx(y,{icon:P,label:"Quêtes actives",value:String(f),sublabel:`${c.length} (14j)`}),e.jsx(y,{icon:R,label:"Invitations pending",value:String(g),sublabel:g>0?`${x.filter(t=>t.invite_type==="link").length} liens · ${x.filter(t=>t.invite_type!=="link").length} directes`:"aucune en attente"})]}),e.jsx(S,{title:"Pairs actives & récentes",icon:D,children:l?e.jsx(k,{}):i?e.jsx(A,{message:i}):s.length===0?e.jsx(C,{text:"Aucune pair active sur la fenêtre 60j."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-white/10",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-surface/40 text-text-tertiary text-xs uppercase tracking-wider",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"User A"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"User B"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Statut"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Rang"}),e.jsx("th",{className:"px-3 py-2 text-right",children:"Streak"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Activé"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Quête en cours"}),e.jsx("th",{className:"px-3 py-2 text-right",children:"Quêtes â"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Boost"})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:s.map(t=>{const a=t.active_boost_until&&new Date(t.active_boost_until)>new Date;return e.jsxs("tr",{className:"hover:bg-white/[0.02]",children:[e.jsxs("td",{className:"px-3 py-2 text-text-primary",children:[e.jsx("div",{className:"font-medium",children:t.user_a_first_name||"â"}),e.jsx("div",{className:"text-text-tertiary text-xs",children:t.user_a_email||"â"})]}),e.jsxs("td",{className:"px-3 py-2 text-text-primary",children:[e.jsx("div",{className:"font-medium",children:t.user_b_first_name||"â"}),e.jsx("div",{className:"text-text-tertiary text-xs",children:t.user_b_email||"â"})]}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] uppercase tracking-wider border ${L[t.pair_status]||L.paused}`,children:t.pair_status})}),e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium",style:{color:X[t.duo_rank]||"#9CA3AF"},title:`Duo rank: ${t.duo_rank}`,children:[e.jsx(B,{className:"w-3 h-3"}),t.duo_rank]})}),e.jsxs("td",{className:"px-3 py-2 text-right text-text-primary",children:[t.current_streak,"j",t.longest_streak>t.current_streak&&e.jsxs("span",{className:"text-text-tertiary text-xs",children:[" ","(max ",t.longest_streak,")"]})]}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-tertiary whitespace-nowrap",children:N(t.activated_at)}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-secondary max-w-xs",children:t.active_quest_title?e.jsxs("div",{className:"line-clamp-1",children:[t.active_quest_title," ",e.jsxs("span",{className:"text-text-tertiary",children:["(",t.active_quest_status,")"]})]}):e.jsx("span",{className:"text-text-tertiary",children:"â"})}),e.jsx("td",{className:"px-3 py-2 text-right text-text-secondary",children:t.completed_quests_count}),e.jsx("td",{className:"px-3 py-2 text-center",children:a?e.jsx("span",{className:"text-emerald-300 text-xs",title:`Jusqu'à ${_(t.active_boost_until)}`,children:"â¡"}):e.jsx("span",{className:"text-text-tertiary text-xs",children:"â"})})]},t.pair_id)})})]})})}),e.jsx(S,{title:"Forge quests (14 derniers jours)",icon:P,children:p?e.jsx(k,{}):o?e.jsx(A,{message:o}):c.length===0?e.jsx(C,{text:"Aucune quête forge sur la fenêtre 14j."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-white/10",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-surface/40 text-text-tertiary text-xs uppercase tracking-wider",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Pair"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Quête"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Type"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Statut"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Cible"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Progrès A"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Progrès B"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Semaine"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Expire"})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:c.map(t=>e.jsxs("tr",{className:"hover:bg-white/[0.02]",children:[e.jsxs("td",{className:"px-3 py-2 text-xs text-text-secondary",children:[t.user_a_first_name||"â"," & ",t.user_b_first_name||"â"]}),e.jsxs("td",{className:"px-3 py-2 text-text-primary max-w-xs",children:[e.jsx("div",{className:"font-medium line-clamp-1",children:t.title}),e.jsx("div",{className:"text-text-tertiary text-xs line-clamp-1",children:t.description})]}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-secondary",children:t.quest_type}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] uppercase tracking-wider border ${I[t.quest_status]||I.proposed}`,children:t.quest_status})}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-tertiary",children:v(t.target)}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-secondary",children:v(t.progress_a)}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-secondary",children:v(t.progress_b)}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-tertiary whitespace-nowrap",children:N(t.week_start)}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-tertiary whitespace-nowrap",children:N(t.expires_at)})]},t.quest_id))})]})})}),e.jsx(S,{title:"Invitations en attente",icon:R,children:h?e.jsx(k,{}):r?e.jsx(A,{message:r}
1):x.length===0?e.jsx(C,{text:"Aucune invitation en attente."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-white/10",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-surface/40 text-text-tertiary text-xs uppercase tracking-wider",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Inviteur"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Invité"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Type"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Code / Contact"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Créée"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Expire"})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:x.map(t=>e.jsxs("tr",{className:"hover:bg-white/[0.02]",children:[e.jsxs("td",{className:"px-3 py-2 text-text-primary",children:[e.jsx("div",{className:"font-medium",children:t.inviter_first_name||"â"}),e.jsx("div",{className:"text-text-tertiary text-xs",children:t.inviter_email||"â"})]}),e.jsx("td",{className:"px-3 py-2 text-text-primary",children:t.invitee_id?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-medium",children:t.invitee_first_name||"â"}),e.jsx("div",{className:"text-text-tertiary text-xs",children:t.invitee_email||"â"})]}):e.jsx("span",{className:"text-text-tertiary text-xs italic",children:t.contact_info||"lien public"})}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-secondary",children:t.invite_type}),e.jsx("td",{className:"px-3 py-2 text-xs font-mono text-text-tertiary",children:t.invite_code||t.contact_info||"â"}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-tertiary whitespace-nowrap",children:_(t.created_at)}),e.jsx("td",{className:"px-3 py-2 text-xs text-text-tertiary whitespace-nowrap",children:_(t.expires_at)})]},t.invitation_id))})]})})})]})}function S({title:s,icon:l,children:i}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(l,{className:"w-4 h-4 text-text-tertiary"}),e.jsx("h2",{className:"text-sm font-semibold text-text-primary uppercase tracking-wider",children:s})]}),i]})}function k(){return e.jsxs("div",{className:"flex items-center gap-2 text-text-tertiary text-sm py-8 justify-center",children:[e.jsx(E,{className:"w-4 h-4 animate-spin"}),"Chargementâ¦"]})}function A({message:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-rose-300 text-sm py-8 justify-center",children:[e.jsx($,{className:"w-4 h-4"}),s]})}function C({text:s}){return e.jsx("div",{className:"text-text-tertiary text-sm py-8 text-center",children:s})}function xe(){const[s,l]=d.useState("challenges");return e.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[e.jsx(G,{icon:z,title:"Gaming",subtitle:"Challenges globaux + buddy challenges. Visibilité ops + drill-down par user."}),e.jsx("div",{className:"mb-6",children:e.jsx(Q,{tabs:[{key:"challenges",label:"Challenges globaux"},{key:"buddy",label:"Buddy challenges"}],active:s,onChange:l,layoutIdPrefix:"admin-gaming"})}),s==="challenges"?e.jsx(V,{}):e.jsx(Z,{})]})}export{xe as AdminGaming};
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.