1import{u as Ce,r as x,j as e}from"./react-vendor-oGnIhQt2.js";import{p as g}from"./dateOnly-qgaHYHLv.js";import{K as Ae,h as U,B as V,C as w,b as A,d as D,t as ie,e as _,f as Y,T as H,G as ne,a5 as me,I as De,A as Se,n as Le,o as Me,p as E,q as I,r as F,j as oe,s as q,F as Re,i as $e}from"./index-DVrUGVMO.js";import{T as Ee,a as Ie,b as ce,c as y,d as Fe,e as N}from"./table-DvG70JRn.js";import{S as K,a as Q,b as J,c as W,d as m}from"./select-BXVXY3ZZ.js";import{u as qe}from"./useAllBookings-B68BY2DY.js";import{u as Be}from"./useTrips-Ds8lUKJ0.js";import{m as Ge}from"./useParticipantProfile-oAZegWqB.js";import ze from"./download-BgqbOjMr.js";import Oe from"./refresh-cw-C0LGWFkR.js";import X from"./award-Bf_HnOzj.js";import xe from"./plane-Bdijs-LI.js";import Ue from"./search-DThSfS5O.js";import Ve from"./percent-C7LTGFLa.js";import He from"./circle-user-h9O11xSO.js";import{d as Ke,c as j,A as Qe,B as Je}from"./date-fns-DU_j6nL5.js";import We from"./clock-EadJ_jlU.js";import Ye from"./image-BnGZTxN1.js";import Xe from"./clipboard-check-DjNFiKz7.js";import Ze from"./square-pen-wi6jbLu-.js";import et from"./log-in-DlaTGfhf.js";import tt from"./chevron-up-D4F-9ALS.js";import{d as p}from"./de-Djqs-V1s.js";import"./radix-core-kiNkrX5-.js";import"./profileDataService-CB86fkBl.js";function B(d){return d>=1e3?{name:"Platin",color:"bg-gradient-to-r from-purple-500 to-indigo-500 text-white",discount:100,icon:e.jsx(xe,{className:"h-3 w-3"})}:d>=500?{name:"Gold",color:"bg-gradient-to-r from-amber-400 to-yellow-500 text-white",discount:10,icon:e.jsx(X,{className:"h-3 w-3"}),nextTier:{name:"Platin",pointsNeeded:1e3-d}}:d>=100?{name:"Silber",color:"bg-gradient-to-r from-gray-300 to-gray-400 text-gray-800",discount:5,icon:e.jsx(Y,{className:"h-3 w-3"}),nextTier:{name:"Gold",pointsNeeded:500-d}}:{name:"Bronze",color:"bg-gradient-to-r from-amber-600 to-amber-700 text-white",discount:0,icon:e.jsx(me,{className:"h-3 w-3"}),nextTier:{name:"Silber",pointsNeeded:100-d}}}function S(d){return d?Qe(new Date(d),3):null}function L(d){const u=S(d);if(!u)return!1;const v=Je(u,new Date);return v<=6&&v>0}function de(d){const u=S(d);return u?new Date>u:!1}function Tt(){const d=Ce(),{toast:u}=Ae(),[v,ue]=x.useState(""),[M,he]=x.useState("all"),[b,fe]=x.useState("all"),[P,ge]=x.useState("all"),[Z,ee]=x.useState(null),[te,se]=x.useState(!1),[R,je]=x.useState("activity"),[G,ae]=x.useState("desc"),{bookings:ye,participants:k,isLoading:Ne,refetch:pe}=qe(),{trips:ve}=Be(),be=async t=>{ee(t.id);try{const s=k.find(n=>n.id===t.id);if(s!=null&&s.profile_id){d(`/admin/participants/${s.profile_id}`);return}if(t.email){const{data:n}=await q.from("participant_profiles").select("id").eq("email",t.email).single();if(n){await q.from("participants").update({profile_id:n.id}).eq("id",t.id),d(`/admin/participants/${n.id}`);return}}const{data:a,error:o}=await q.from("participant_profiles").insert({email:t.email||null,first_name:t.firstName,last_name:t.lastName,phone:t.phone||null,date_of_birth:t.dateOfBirth||null,passport_number:t.passportNumber||null,dietary_requirements:t.dietaryRequirements||null,allergies:t.allergies||null,emergency_contact:t.emergencyContact||null,loyalty_points:t.loyaltyPoints||0,loyalty_last_activity:t.loyaltyLastActivity||null,referral_count:t.referralCount||0,total_nights_stayed:t.totalNightsStayed||0}).select().single();if(o)throw o;await q.from("participants").update({profile_id:a.id}).eq("id",t.id),d(`/admin/participants/${a.id}`)}catch(s){console.error("Error creating profile:",s),u({title:"Fehler",description:"Profil konnte nicht erstellt werden.",variant:"destructive"})}finally{ee(null)}},f=x.useMemo(()=>{const t=new Map;return k.forEach(s=>{var n;const a={id:s.id,bookingId:s.booking_id,firstName:s.first_name,lastName:s.last_name,email:s.email||"",phone:s.phone||"",dateOfBirth:s.date_of_birth||"",passportNumber:s.passport_number||"",questionnaireStatus:s.questionnaire_status,questionnaireProgress:s.questionnaire_progress||0,dietaryRequirements:s.dietary_requirements||"",allergies:s.allergies||"",emergencyContact:s.emergency_contact||"",roomAssignment:s.room_assignment||"",loyaltyPoints:s.profile_loyalty_points??s.loyalty_points??0,loyaltyLastActivity:s.profile_loyalty_last_activity||s.loyalty_last_activity||"",referralCount:s.profile_referral_count??s.referral_count??0,totalNightsStayed:s.profile_total_nights_stayed??s.total_nights_stayed??0,profileImage:s.profile_image||null,discount_used_at:s.profile_discount_used_at||null,profileId:s.profile_id||null,lastPortalActivity:s.last_portal_activity||null,lastPortalActivityType:s.last_portal_activity_type||null},o=s.profile_id||a.email||`${a.firstName}-${a.lastName}-${a.dateOfBirth}`;
1(!t.has(o)||(a.loyaltyPoints||0)>(((n=t.get(o))==null?void 0:n.loyaltyPoints)||0))&&t.set(o,a)}),Array.from(t.values())},[k]),h=x.useMemo(()=>{const t=f.length,s=f.filter(i=>(i.loyaltyPoints||0)>=1e3).length,a=f.filter(i=>(i.loyaltyPoints||0)>=500&&(i.loyaltyPoints||0)<1e3).length,o=f.filter(i=>L(i.loyaltyLastActivity)).length,n=f.reduce((i,$)=>i+($.loyaltyPoints||0),0),c=f.filter(i=>B(i.loyaltyPoints||0).discount>0&&!i.discount_used_at),r=c.length,l=c.filter(i=>L(i.loyaltyLastActivity)).length;return{total:t,platin:s,gold:a,approaching:o,totalPoints:n,openDiscounts:r,openDiscountsExpiring:l}},[f]),le=x.useMemo(()=>f.filter(t=>{const s=`${t.firstName} ${t.lastName}`.toLowerCase().includes(v.toLowerCase())||t.email.toLowerCase().includes(v.toLowerCase()),a=B(t.loyaltyPoints||0),o=M==="all"||a.name.toLowerCase()===M,n=de(t.loyaltyLastActivity),c=L(t.loyaltyLastActivity),r=b==="all"||b==="approaching"&&c||b==="expired"&&n||b==="active"&&!n&&!c||b==="recently-active"&&t.lastPortalActivity&&Ke(new Date,new Date(t.lastPortalActivity))<=30,l=a.discount>0&&!t.discount_used_at,i=P==="all"||P==="available"&&l||P==="expiring"&&l&&c||P==="redeemed"&&!!t.discount_used_at;return s&&o&&r&&i}),[f,v,M,b,P]),z=x.useMemo(()=>[...le].sort((t,s)=>{var o,n;let a=0;switch(R){case"name":a=`${t.lastName} ${t.firstName}`.localeCompare(`${s.lastName} ${s.firstName}`,"de");break;case"email":a=(t.email||"").localeCompare(s.email||"","de");break;case"tier":case"points":a=(t.loyaltyPoints||0)-(s.loyaltyPoints||0);break;case"activity":const c=t.lastPortalActivity?new Date(t.lastPortalActivity).getTime():0,r=s.lastPortalActivity?new Date(s.lastPortalActivity).getTime():0;a=c-r;break;case"reset":const l=((o=S(t.loyaltyLastActivity))==null?void 0:o.getTime())||0,i=((n=S(s.loyaltyLastActivity))==null?void 0:n.getTime())||0;a=l-i;break}return G==="asc"?a:-a}),[le,R,G]),we=()=>{const t=["Vorname","Nachname","E-Mail","Punkte","Stufe","Rabatt","Rabatt-Status","Punkte-Reset"],s=z.map(l=>{const i=B(l.loyaltyPoints||0),$=S(l.loyaltyLastActivity),Te=L(l.loyaltyLastActivity);let O="";return i.discount>0&&(l.discount_used_at?O=`Eingelöst am ${j(new Date(l.discount_used_at),"dd.MM.yyyy",{locale:p})}`:O=Te?"Verfügbar â läuft bald ab":"Verfügbar"),[l.firstName||"",l.lastName||"",l.email||"",String(l.loyaltyPoints||0),i.name,i.discount>0?i.discount===100?"Gratis-Reise":`${i.discount}%`:"",O,$?j($,"dd.MM.yyyy",{locale:p}):""]}),a=l=>`"${l.replace(/"/g,'""')}
1"`,o=[t,...s].map(l=>l.map(a).join(";")).join(`\r 2`),n=new Blob(["\uFEFF"+o],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(n),r=document.createElement("a");r.href=c,r.download=`teilnehmer-export-${j(new Date,"yyyy-MM-dd")}.csv`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(c),u({title:"Export erstellt",description:`${s.length} Teilnehmer exportiert.`})},T=t=>{R===t?ae(s=>s==="asc"?"desc":"asc"):(je(t),ae("asc"))},_e=t=>{switch(t){case"login":return{label:"Login",icon:e.jsx(et,{className:"h-3 w-3"})};case"profile_update":return{label:"Profil aktualisiert",icon:e.jsx(Ze,{className:"h-3 w-3"})};case"questionnaire_update":return{label:"Fragebogen ausgefüllt",icon:e.jsx(Re,{className:"h-3 w-3"})};case"checklist_update":return{label:"Checkliste aktualisiert",icon:e.jsx(Xe,{className:"h-3 w-3"})};case"avatar_update":return{label:"Avatar geändert",icon:e.jsx(Ye,{className:"h-3 w-3"})};default:return{label:"Unbekannt",icon:e.jsx(We,{className:"h-3 w-3"})}}},C=({field:t})=>R!==t?null:G==="asc"?e.jsx(tt,{className:"h-4 w-4"}):e.jsx($e,{className:"h-4 w-4"}),Pe=t=>{const s=ye.filter(r=>r.id===t.bookingId||t.profileId&&k.filter(l=>l.profile_id===t.profileId).some(l=>l.booking_id===r.id));if(s.length===0)return null;const a=s.map(r=>ve.find(l=>l.id===r.trip_id)).filter(Boolean);if(a.length===0)return null;const o=new Date,n=a.filter(r=>g(r.startDate)>o).sort((r,l)=>g(r.startDate).getTime()-g(l.startDate).getTime());return n.length>0?n[0]:a.filter(r=>g(r.startDate)<=o).sort((r,l)=>g(l.startDate).getTime()-g(r.startDate).getTime())[0]||null},re=x.useMemo(()=>k.filter(t=>!t.profile_id).length,[k]);if(Ne)return e.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:e.jsx(U,{className:"h-8 w-8 animate-spin text-primary"})});const ke=async()=>{se(!0);try{const t=await Ge();t.errors.length>0&&console.error("Migration errors:",t.errors),u({title:"Migration abgeschlossen",description:`${t.created} Profile erstellt, ${t.linked} Teilnehmer verknüpft${t.skipped>0?`, ${t.skipped} übersprungen`:""}.`}),pe()}catch{u({title:"Fehler",description:"Migration konnte nicht durchgeführt werden.",variant:"destructive"})}finally{se(!1)}};return e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Teilnehmer"}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:"Ãbersicht aller Teilnehmer und Loyalitätsprogramm"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(V,{onClick:we,variant:"outline",className:"gap-2",children:[e.jsx(ze,{className:"h-4 w-4"}),"Export (CSV)"]}),re>0&&e.jsxs(V,{onClick:ke,disabled:te,variant:"outline",className:"gap-2",children:[te?e.jsx(U,{className:"h-4 w-4 animate-spin"}):e.jsx(Oe,{className:"h-4 w-4"}),re," Teilnehmer zu Profilen migrieren"]})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-5",children:[e.jsxs(w,{className:"glass-card",children:[e.jsxs(A,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(D,{className:"text-sm font-medium text-muted-foreground",children:"Gesamt Teilnehmer"}),e.jsx(ie,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(_,{children:e.jsx("div",{className:"text-2xl font-bold",children:h.total})})]}),e.jsxs(w,{className:"glass-card",children:[e.jsxs(A,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(D,{className:"text-sm font-medium text-muted-foreground",children:"Platin & Gold Mitglieder"}),e.jsx(X,{className:"h-4 w-4 text-amber-500"})]}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:h.platin+h.gold}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.platin," Platin, ",h.gold," Gold"]})]})]}),e.jsxs(w,{className:"glass-card",children:[e.jsxs(A,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(D,{className:"text-sm font-medium text-muted-foreground",children:"Gesamte Punkte"}),e.jsx(Y,{className:"h-4 w-4 text-primary"})]}),e.jsx(_,{children:e.jsx("div",{className:"text-2xl font-bold",children:h.totalPoints.toLocaleStr
2ing("de-DE")})})]}),e.jsxs(w,{className:"glass-card border-warning/50",children:[e.jsxs(A,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(D,{className:"text-sm font-medium text-warning",children:"Reset in 6 Monaten"}),e.jsx(H,{className:"h-4 w-4 text-warning"})]}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold text-warning",children:h.approaching}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"E-Mail-Erinnerung wird gesendet"})]})]}),e.jsxs(w,{className:"glass-card border-emerald-500/40",children:[e.jsxs(A,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(D,{className:"text-sm font-medium text-emerald-600",children:"Offene Rabatte"}),e.jsx(ne,{className:"h-4 w-4 text-emerald-600"})]}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold text-emerald-600",children:h.openDiscounts}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h.openDiscountsExpiring>0?`davon ${h.openDiscountsExpiring} laufen bald ab`:"noch nicht eingelöst"})]})]})]}),e.jsxs(w,{className:"glass-card bg-gradient-to-r from-primary/5 to-secondary/5",children:[e.jsx(A,{children:e.jsxs(D,{className:"flex items-center gap-2 text-lg",children:[e.jsx(ne,{className:"h-5 w-5 text-primary"}),"Loyalitätsprogramm"]})}),e.jsxs(_,{children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-600/20",children:e.jsx(me,{className:"h-5 w-5 text-amber-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Bronze"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"0-99 Punkte"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-gray-400/20",children:e.jsx(Y,{className:"h-5 w-5 text-gray-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Silber"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"100+ Punkte = 5% Rabatt"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-400/20",children:e.jsx(X,{className:"h-5 w-5 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Gold"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"500+ Punkte = 10% Rabatt"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-purple-500/20",children:e.jsx(xe,{className:"h-5 w-5 text-purple-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Platin"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"1000+ Punkte = Gratis-Reise"})]})]})]}),e.jsxs("div",{className:"mt-4 flex gap-4 text-sm text-muted-foreground",children:[e.jsx("span",{children:"ð 10 Punkte pro Nacht"}),e.jsx("span",{children:"ð¥ 100 Punkte pro Empfehlung"}),e.jsx("span",{children:"â° Punkte verfallen nach 3 Jahren Inaktivität"})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Ue,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(De,{placeholder:"Teilnehmer suchen...",value:v,onChange:t=>ue(t.target.value),className:"pl-10"})]}),e.jsxs(K,{value:M,onValueChange:he,children:[e.jsx(Q,{className:"w-[180px]",children:e.jsx(J,{placeholder:"Alle Status"})}),e.jsxs(W,{children:[e.jsx(m,{value:"all",children:"Alle Stufen"}),e.jsx(m,{value:"platin",children:"Platin"}),e.jsx(m,{value:"gold",children:"Gold"}),e.jsx(m,{value:"silber",children:"Silber"}),e.jsx(m,{value:"bronze",children:"Bronze"})]})]}),e.jsxs(K,{value:b,onValueChange:fe,children:[e.jsx(Q,{className:"w-[200px]",children:e.jsx(J,{placeholder:"Alle Status"})}),e.jsxs(W,{children:[e.jsx(m,{value:"all",children:"Alle"}),e.jsx(m,{value:"active",children:"Aktiv"}),e.jsx(m,{value:"recently-active",children:"Kürzlich aktiv (30 Tage)"}),e.jsx(m,{value:"approaching",children:"Reset bald"}),e.jsx(m,{value:"expired",children:"Abgelaufen"})]})]}),e.jsxs(K,{value:P,onValueChange:ge,children:[e.jsx(Q,{className:"w-[220px]",children:e.jsx(J,{placeholder:"Rabatt"})}),e.jsxs(W,{children:[e.jsx(m,{value:"all",children:"Alle Rabatte"}),e.jsx(m,{value:"available",children:"Verfügbar (nicht genutzt)"}),e.jsx(m,{value:"expiring",children:"Läuft bald ab"}),e.jsx(m,{value:"redeemed",children:"Eingelöst"})]})]})]}),e.jsx(w,{className:"glass-card",children:e.jsx(_,{className:"p-0",children:e.jsxs(Ee,{children:[e.jsx(Ie,{children:e.jsxs(ce,{children:[e.jsx(y,{className:"cursor-pointer hover:bg-muted/50 select-none",onClick:()=>T("name"),children:e.jsxs("div",{className:"flex items-center gap-1",children:["Name",e.jsx(C,{field:"name"})]})}),e.jsx(y,{className:"cursor-pointer hover:bg-muted/50 select-none",onClick:()=>T("email"),children:e.jsxs("div",{className:"flex items-center gap-1",children:["E-Mail",e.jsx(C,{field:"email"})]})}),e.jsx(y,{className:"cursor-pointer hover:bg-muted/50 select-none",onClick:()=>T("tier"),children:e.jsxs("div",{className:"flex items-center gap-1",children:["Stufe",e.jsx(C,{field:"tier"})]})}),e.jsx(y,{className:"cursor-pointer hover:bg-muted/50 select-none text-right",onClick:()=>T("points"),children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:["Punkte",e.jsx(C,{field:"points"})]})}),e.jsx(y,{className:"cursor-pointer hover:bg-muted/50 select-none",onClick:()=>T("activity"),children:e.jsxs("div",{className:"flex items-center gap-1",children:["Letzte Aktivität",e.jsx(C,{field:"activity"})]})}),e.jsx(y,{className:"cursor-pointer hover:bg-muted/50 select-none",onClick:()=>T("reset"),children:e.jsxs("div",{className:"flex items-center gap-1",children:["Reset am",e.jsx(C,{field:"reset"})]})}),e.jsx(y,{children:"Rabatt"}),e.jsx(y,{})]})}),e.jsx(Fe,{children:z.map(t=>{const s=B(t.loyaltyPoints||0),a=S(t.loyaltyLastActivity),o=de(t.loyaltyLastActivity),n=L(t.loyaltyLastActivity),c=Pe(t),r=_e(t.lastPortalActivityType);return e.jsxs(ce,{className:o?"opacity-50":"",children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(Se,{className:"h-9 w-9",children:[e.jsx(Le,{src:t.profileImage||void 0,alt:`${t.firstName} ${t.lastName}`}),e.jsxs(Me,{className:"bg-primary/10 text-primary text-sm font-medium",children:[t.firstName[0],t.lastName[0]]})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium",children:[t.firstName," ",t.lastName]}),c&&e.jsxs(E,{children:[e.jsx(I,{asChild:!0,children:e.jsxs("p",{className:"text-xs text-muted-foreground cursor-help",children:[g(c.startDate)>new Date?"Nächste":"Letzte"," Reise: ",c.name]})}),e.jsxs(F,{children:[j(g(c.startDate),"dd.MM.yyyy",{locale:p})," - ",j(g(c.endDate),"dd.MM.yyyy",{locale:p})]})]})]})]})}),e.jsx(N,{className:"text-muted-foreground",children:t.email||"-"}),e.jsx(N,{children:e.jsxs(oe,{className:`gap-1 ${s.color}`,children:[s.icon,s.name]})}),e.jsx(N,{className:"text-right",children:e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("span",{className:"font-semibold",children:(t.loyaltyPoints||0).toLocaleStr
2ing("de-DE")}),s.nextTier&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["noch ",s.nextTier.pointsNeeded," bis ",s.nextTier.name]})]})}),e.jsx(N,{children:t.lastPortalActivity?e.jsxs(E,{children:[e.jsx(I,{children:e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[r.icon,e.jsx("span",{children:j(new Date(t.lastPortalActivity),"dd.MM.yyyy",{locale:p})})]})}),e.jsxs(F,{children:[r.label," am ",j(new Date(t.lastPortalActivity),"dd.MM.yyyy, HH:mm",{locale:p})," Uhr"]})]}):e.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"Noch nie aktiv"})}),e.jsx(N,{children:a&&e.jsxs(E,{children:[e.jsx(I,{children:e.jsxs("div",{className:`flex items-center gap-1 ${n?"text-warning":o?"text-destructive":"text-muted-foreground"}`,children:[(n||o)&&e.jsx(H,{className:"h-3 w-3"}),j(a,"dd.MM.yyyy",{locale:p})]})}),e.jsx(F,{children:o?"Punkte sind verfallen":n?"Punkte verfallen bald - Erinnerung wird gesendet":"Punkte verfallen bei Inaktivität"})]})}),e.jsx(N,{children:s.discount>0&&(()=>{const i=!t.discount_used_at&&n;return e.jsxs(E,{children:[e.jsx(I,{asChild:!0,children:e.jsxs(oe,{variant:t.discount_used_at?"secondary":"outline",className:`gap-1 ${t.discount_used_at?"line-through opacity-60":""} ${i?"border-warning text-warning":""}`,children:[i?e.jsx(H,{className:"h-3 w-3"}):e.jsx(Ve,{className:"h-3 w-3"}),s.discount===100?"Gratis-Reise":`${s.discount}%`]})}),e.jsx(F,{children:t.discount_used_at?`Eingelöst am ${j(new Date(t.discount_used_at),"dd.MM.yyyy",{locale:p})}`:i?"Rabatt verfügbar â Anspruch läuft bald ab (Punkte-Reset)":"Rabatt verfügbar"})]})})()}),e.jsx(N,{children:e.jsxs(V,{variant:"ghost",size:"sm",onClick:()=>be(t),disabled:Z===t.id,children:[Z===t.id?e.jsx(U,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(He,{className:"mr-2 h-4 w-4"}),"Profil"]})})]},t.id)})})]})})}),z.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(ie,{className:"h-12 w-12 text-muted-foreground/50"}),e.jsx("h3",{className:"mt-4 text-lg font-medium",children:"Keine Teilnehmer gefunden"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Passen Sie Ihre Filter an, um Teilnehmer zu finden."})]})]})}export{Tt as AllParticipantsPage};
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.