1import{r as u,u as Ds,j as e,L as _e,e as ks,p as Ss}from"./react-vendor-oGnIhQt2.js";import{m as Be,c as B,A as ne,n as ye,o as re,p as je,q as ve,T as Re,r as Ne,t as Fe,j as Cs,U as Ms,k as Ts,B as A,h as ie,s as $e,u as H,L as S,I as T,F as Ee,v as Ls,X as As,i as zs,w as ns}from"./index-DVrUGVMO.js";import{u as Ge}from"./useTrips-Ds8lUKJ0.js";import{u as _s}from"./useGuides-Cy0X452B.js";import{p as $}from"./dateOnly-qgaHYHLv.js";import Rs from"./arrow-up-down-CbqEOj5D.js";import{D as Ie,a as Pe,b as Ue,c as Oe,d as $s,e as Ve}from"./dialog-D5Nmo3zm.js";import Es from"./circle-alert-COEYGdJO.js";import{D as Bs,f as es,S as Fs}from"./date-range-picker-Dt5Esja5.js";import{A as rs,b as is,c as ls,d as ds,e as os,f as cs,g as ms,h as us}from"./alert-dialog-C2--BmRE.js";import Gs from"./pencil-CCNnYUi6.js";import be from"./trash-2-CuVn9ViH.js";import{T as ss}from"./textarea-BVnLWlN2.js";import{S as ae}from"./switch-B37GH_ek.js";import{S as ue,a as xe,b as he,c as pe,d as Y}from"./select-BXVXY3ZZ.js";import{C as Is}from"./country-select-1LfGMznm.js";import{H as Ps}from"./HeroFocalPicker-CqK3GBAD.js";import Us from"./settings-2-juoSykGJ.js";import Os from"./file-question-BA9yLqK_.js";import Vs from"./image-plus-CFosx6uN.js";import Ys from"./message-circle-DwKaGQxl.js";import fe from"./plus-aAdZ4Lkx.js";import Ks from"./square-check-big-DLZQRZjK.js";import qs from"./chevron-up-D4F-9ALS.js";import{u as Hs}from"./useTripTemplates-CMwQx4ar.js";import{f as Ws}from"./focalPoint-CMrB3-z1.js";import Qs from"./layout-grid-DNGW5upu.js";import Js from"./calendar-range-BmilsEup.js";import Zs from"./search-DThSfS5O.js";import Xs from"./calendar-Cn9C9HMT.js";import"./radix-core-kiNkrX5-.js";import"./date-fns-DU_j6nL5.js";import"./de-Djqs-V1s.js";import"./file-pen-CTw4GoAp.js";import"./popover-BDK8a9im.js";import"./useCountries-BUjGPM8t.js";import"./chevrons-up-down-DkrYjszi.js";import"./crosshair-DKhZ-a5b.js";import"./rotate-ccw-Bhfu5AxX.js";function et(t,x=new Date){const m=new Date(x.getFullYear(),x.getMonth(),1),n=new Date(m.getFullYear(),m.getMonth()+t,1),N=m.getTime(),i=n.getTime(),p=[];for(let j=0;j<t;j++){const w=new Date(m.getFullYear(),m.getMonth()+j,1);p.push({date:w,label:w.toLocaleDateString("de-DE",{month:"short"}),year:w.getFullYear(),month:w.getMonth()})}return{start:m,end:n,startMs:N,endMs:i,totalMs:i-N,months:p}}function ts(t,x,m,n){return t<n&&m<x}function ze(t,x){return Math.max(0,Math.round((x-t)/(1e3*60*60*24)))}function st(t){const{trips:x,loading:m}=Ge(),{data:n=[],isLoading:N}=_s(),i=u.useMemo(()=>et(t),[t]),p=u.useMemo(()=>x.map(a=>{const h=$(a.startDate).getTime(),l=$(a.endDate).getTime(),v=a.maxGroupSize?Math.min(100,Math.round(a.totalParticipants/a.maxGroupSize*100)):0,D=ze(h,l)+1,d=(!a.guides||a.guides.length===0)&&a.status!=="completed"&&a.status!=="draft";return{...a,startMs:h,endMs:l,durationDays:D,occupancy:v,isUnassigned:d}}).filter(a=>ts(a.startMs,a.endMs,i.startMs,i.endMs)).sort((a,h)=>a.startMs-h.startMs),[x,i]),j=u.useMemo(()=>n.map(a=>{const h=`${a.first_name} ${a.last_name}`.trim().toLowerCase(),l=p.filter(f=>(f.guides||[]).some(y=>`${y.first_name} ${y.last_name}`.trim().toLowerCase()===h)),v=new Set;for(let f=0;f<l.length;f++)for(let y=f+1;y<l.length;y++){const C=l[f],c=l[y];ts(C.startMs,C.endMs,c.startMs,c.endMs)&&(v.add(C.id),v.add(c.id))}let D=0;const d=new Array(i.months.length).fill(0);for(const f of l){const y=Math.max(f.startMs,i.startMs),C=Math.min(f.endMs,i.endMs);D+=ze(y,C)+1;for(let c=0;c<i.months.length;c++){const k=i.months[c].date.getTime(),L=c+1<i.months.length?i.months[c+1].date.getTime():i.endMs,z=Math.max(y,k),_=Math.min(C,L);z<_&&(d[c]+=ze(z,_))}}return{guide:a,travelDays:D,tripCount:l.length,trips:l,conflictTripIds:v,monthlyDays:d}}).sort((a,h)=>h.travelDays-a.travelDays),[n,p,i]),w=u.useMemo(()=>{const a=new Set;return j.forEach(h=>h.conflictTripIds.forEach(l=>a.add(l))),a},[j]),b=u.useMemo(()=>p.filter(a=>
1a.isUnassigned),[p]);return{loading:m||N,window:i,trips:p,guides:n,guideUtilization:j,allConflictTripIds:w,unassignedTrips:b}}const as={draft:"bg-muted-foreground/40 hover:bg-muted-foreground/60",planning:"bg-primary/70 hover:bg-primary",confirmed:"bg-emerald-500/80 hover:bg-emerald-500",completed:"bg-muted/60 hover:bg-muted",cancelled:"bg-destructive/60 hover:bg-destructive/80"};function tt(t,x,m){const n=Math.max(x,t.startMs),N=Math.min(m,t.endMs),i=(n-t.startMs)/t.totalMs*100,p=Math.max(.5,(N-n)/t.totalMs*100);return{left:i,width:p}}function at({trip:t,window:x,isConflict:m,onClick:n}){const{left:N,width:i}=tt(x,t.startMs,t.endMs),p=as[t.status]||as.planning,j=t.maxGroupSize?`${t.totalParticipants}/${t.maxGroupSize}`:`${t.totalParticipants}`;return e.jsxs(je,{delayDuration:150,children:[e.jsx(ve,{asChild:!0,children:e.jsxs("button",{onClick:n,className:B("absolute top-1.5 bottom-1.5 rounded-md text-xs font-medium text-white shadow-sm transition-all overflow-hidden flex items-center gap-2 px-2",p,m&&"ring-2 ring-destructive ring-offset-1 ring-offset-background"),style:{left:`${N}%`,width:`${i}%`},children:[e.jsx("span",{className:"truncate flex-1 text-left",children:t.name}),t.maxGroupSize&&e.jsx("span",{className:"text-[10px] opacity-90 whitespace-nowrap shrink-0 hidden sm:inline",children:j}),m&&e.jsx(Re,{className:"h-3 w-3 shrink-0"})]})}),e.jsx(Ne,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-semibold",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.destination}),e.jsxs("p",{className:"text-xs",children:[$(t.startDate).toLocaleDateString("de-DE")," â ",$(t.endDate).toLocaleDateString("de-DE"),e.jsxs("span",{className:"text-muted-foreground",children:[" · ",t.durationDays," Tage"]})]}),e.jsxs("p",{className:"text-xs flex items-center gap-1",children:[e.jsx(Fe,{className:"h-3 w-3"})," ",j," (",t.occupancy,"%)"]}),t.guides&&t.guides.length>0&&e.jsxs("p",{className:"text-xs",children:["Guides: ",t.guides.map(w=>`${w.first_name} ${w.last_name}`).join(", ")]}),m&&e.jsxs("p",{className:"text-xs text-destructive flex items-center gap-1",children:[e.jsx(Re,{className:"h-3 w-3"})," Ãberschneidung mit anderem Einsatz"]})]})})]})}function nt({window:t,trips:x,guideUtilization:m,conflictTripIds:n,mode:N}){const i=Ds(),p=Date.now(),j=p>=t.startMs&&p<=t.endMs?(p-t.startMs)/t.totalMs*100:null,w=N==="by-trip"?x.map(a=>({id:a.id,label:a.name,sublabel:a.destination,bars:[a],conflictIds:n})):m.filter(a=>a.trips.length>0).map(a=>({id:a.guide.id,label:`${a.guide.first_name} ${a.guide.last_name}`,sublabel:`${a.travelDays} Tage · ${a.tripCount} Reisen`,image:a.guide.profile_image,bars:a.trips,conflictIds:a.conflictTripIds})),b="w-48 md:w-56";return e.jsx(Be,{children:e.jsxs("div",{className:"glass-card overflow-hidden",children:[e.jsxs("div",{className:"flex border-b border-border bg-muted/30",children:[e.jsx("div",{className:B(b,"shrink-0 p-3 text-xs font-semibold text-muted-foreground"),children:N==="by-trip"?"Reise":"Guide"}),e.jsx("div",{className:"flex-1 relative h-10",children:e.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${t.months.length}, minmax(0, 1fr))`},children:t.months.map((a,h)=>e.jsxs("div",{className:B("flex flex-col items-center justify-center text-[10px] font-medium border-l border-border/40",a.month===0&&"border-l-foreground
1/30"),children:[e.jsx("span",{className:"text-muted-foreground",children:a.label}),a.month===0&&e.jsx("span",{className:"text-foreground/70",children:a.year})]},h))})})]}),e.jsxs("div",{className:"max-h-[70vh] overflow-y-auto",children:[w.length===0&&e.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"Keine Daten im gewählten Zeitraum."}),w.map(a=>e.jsxs("div",{className:"flex border-b border-border/40 hover:bg-muted/20 transition-colors",children:[e.jsxs("div",{className:B(b,"shrink-0 p-3 flex items-center gap-2 min-w-0"),children:[a.image!==void 0&&e.jsxs(ne,{className:"h-7 w-7 shrink-0",children:[e.jsx(ye,{src:a.image||void 0}),e.jsx(re,{className:"text-[10px] bg-primary/20 text-primary",children:a.label.split(" ").map(h=>h[0]).slice(0,2).join("")})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:a.label}),a.sublabel&&e.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:a.sublabel})]})]}),e.jsxs("div",{className:"flex-1 relative h-12",children:[e.jsx("div",{className:"absolute inset-0 grid pointer-events-none",style:{gridTemplateColumns:`repeat(${t.months.length}, minmax(0, 1fr))`},children:t.months.map((h,l)=>e.jsx("div",{className:B("border-l border-border/30",h.month===0&&"border-l-foreground
1/20")},l))}),j!==null&&e.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-primary z-10 pointer-events-none",style:{left:`${j}%`}}),a.bars.map(h=>e.jsx(at,{trip:h,window:t,isConflict:a.conflictIds.has(h.id),onClick:()=>i(`/admin/trips/${h.id}`)},`${a.id}-${h.id}`))]})]},a.id))]})]})})}function rt({values:t,max:x}){const m=Math.max(x,1);return e.jsx("div",{className:"flex items-end gap-px h-6 w-full",children:t.map((n,N)=>e.jsx("div",{className:B("flex-1 rounded-sm transition-colors",n>0?"bg-primary/60":"bg-muted"),style:{height:`${Math.max(8,n/m*100)}%`},title:`Monat ${N+1}: ${n} Tage`},N))})}function it({utilization:t}){const[x,m]=u.useState("days"),n=[...t].sort((i,p)=>x==="name"?`${i.guide.last_name}${i.guide.first_name}`.localeCompare(`${p.guide.last_name}${p.guide.first_name}`):x==="trips"?p.tripCount-i.tripCount:p.travelDays-i.travelDays),N=Math.max(1,...t.flatMap(i=>i.monthlyDays));return e.jsxs("div",{className:"glass-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-semibold text-sm",children:"Guide-Auslastung"}),e.jsxs("button",{onClick:()=>m(i=>i==="days"?"trips":i==="trips"?"name":"days"),className:"text-[11px] text-muted-foreground hover:text-foreground flex items-center gap-1",title:"Sortierung ändern",children:[e.jsx(Rs,{className:"h-3 w-3"}),x==="days"&&"Tage",x==="trips"&&"Reisen",x==="name"&&"Name"]})]}),n.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"Keine Guides im Zeitraum."}),e.jsx("div",{className:"space-y-3 max-h-[60vh] overflow-y-auto pr-1",children:n.map(i=>e.jsxs("div",{className:"space-y-1.5 pb-3 border-b border-border/40 last:border-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ne,{className:"h-7 w-7",children:[e.jsx(ye,{src:i.guide.profile_image||void 0}),e.jsxs(re,{className:"text-[10px] bg-primary/20 text-primary",children:[i.guide.first_name[0],i.guide.last_name[0]]})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"text-sm font-medium truncate",children:[i.guide.first_name," ",i.guide.last_name]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[i.travelDays," Tage · ",i.tripCount," Reisen"]})]}),i.conflictTripIds.size>0&&e.jsxs(Cs,{variant:"destructive",className:"gap-1 h-5 text-[10px]",children:[e.jsx(Re,{className:"h-3 w-3"}),"Konflikt"]})]}),e.jsx(rt,{values:i.monthlyDays,max:N})]},i.guide.id))})]})}function lt({trips:t,guides:x,onAssigned:m}){const[n,N]=u.useState(null),[i,p]=u.useState(new Set),[j,w]=u.useState(!1);if(t.length===0)return null;const b=l=>{N(l),p(new Set)},a=l=>{p(v=>{const D=new Set(v);return D.has(l)?D.delete(l):D.add(l),D})},h=async()=>{if(!(!n||i.size===0)){w(!0);try{const v=x.filter(d=>i.has(d.id)).map(d=>({trip_id:n.id,is_guide:!0,first_name:d.first_name,last_name:d.last_name,email:d.email||null,phone:d.phone||null,profile_id:d.profile_id||d.id,questionnaire_status:"pending",questionnaire_progress:0})),{error:D}=await $e.from("participants").insert(v);if(D)throw D;H.success(`${v.length} Guide(s) zugewiesen`),N(null),m()}catch(l){console.error(l),H.error("Fehler beim Zuweisen",{description:l==null?void 0:l.message})}finally{w(!1)}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"glass-card border-l-4 border-l-warning p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Es,{className:"h-5 w-5 text-warning shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("h3",{className:"font-semibold text-sm",children:[t.length," Reise",t.length===1?"":"n"," ohne Guide"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Diese geplanten/bestätigten Reisen brauchen noch eine Zuweisung."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[t.slice(0,8).map(l=>e.jsxs("button",{onClick:()=>b(l),className:"inline-flex items-center gap-1.5 rounded-md bg-warning/10 hover:bg-warning/20 text-warning-foreground border border-warning/30 px-2.5 py-1 text-xs font-medium transition-colors",children:[e.jsx(Ms,{className:"h-3 w-3"}),l.name,e.jsx("span",{className:"text-[10px] opacity-70",children:$(l.startDate).toLocaleDateString("de-DE",{day:"2-digit",month:"short"})})]},l.id)),t.length>8&&e.jsxs("span",{className:"text-xs text-muted-foreground self-center",children:["+",t.length-8," weitere"]})]})]})]})}),e.jsx(Ie,{open:!!n,onOpenChange:l=>!l&&N(null),children:e.jsxs(Pe,{className:"max-w-md",children:[e.jsxs(Ue,{children:[e.jsx(Oe,{children:"Guide zuweisen"}),e.jsxs($s,{children:[n==null?void 0:n.name," ·"," ",n&&$(n.startDate).toLocaleDateString("de-DE")," â"," ",n&&$(n.endDate).toLocaleDateString("de-DE")]})]}),e.jsxs("div",{className:"max-h-[50vh] overflow-y-auto space-y-1",children:[x.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"Keine Guides vorhanden."}),x.map(l=>{const v=i.has(l.id);return e.jsxs("button",{onClick:()=>a(l.id),className:B("w-full flex items-center gap-3 p-2 rounded-md transition-colors text-left",v?"bg-primary/10 border border-primary/40":"hover:bg-muted border border-transparent"),children:[e.jsxs(ne,{className:"h-8 w-8",children:[e.jsx(ye,{src:l.profile_image||void 0}),e.jsxs(re,{className:"text-xs bg-primary/20 text-primary",children:[l.first_name[0],l.last_name[0]]})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium truncate",children:[l.first_name," ",l.last_name]}),l.email&&e.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:l.email})]}),v&&e.jsx(Ts,{className:"h-4 w-4 text-primary shrink-0"})]},l.id)})]}),e.jsxs(Ve,{children:[e.jsx(A,{variant:"outline",onClick:()=>N(null),disabled:j,children:"Abbrechen"}),e.jsxs(A,{onClick:h,disabled:j||i.size===0,children:[j&&e.jsx(ie,{className:"h-4 w-4 animate-spin"}),i.size>0?`${i.size} zuweisen`:"Auswählen"]})]})]})})]})}const ge=["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dt=["So","Mo","Di","Mi","Do","Fr","Sa"];function ot(t,x=!1){const m=x?"/40":"/80";switch(t){case"draft":return`bg-muted-foreground${m}`;case"planning":return`bg-primary${m}`;case"confirmed":return`bg-emerald-500${m}`;case"completed":return`bg-muted${x?"/40":"/70"} border border-border`;default:return`bg-muted-foreground${m}`}}function ct(t,x,m){const n=new Date(x,m,1).getTime(),N=new Date(x,m+1,1).getTime(),i=new Date(x,m+1,0).getDate(),p=t.filter(b=>b.startMs<N&&b.endMs>=n).map(b=>{const a=new Date(Math.max(b.startMs,n)),h=new Date(Math.min(b.endMs,N-1));return{trip:b,startDay:a.getFullYear()===x&&a.getMonth()===m?a.getDate():1,endDay:h.getFullYear()===x&&h.getMonth()===m?h.getDate():i,continuesLeft:b.startMs<n,continuesRight:b.endMs>=N}}).sort((b,a)=>b.startDay-a.startDay||a.endDay-b.endDay),j=[];return{segments:p.map(b=>{let a=j.findIndex(h=>h<b.startDay);return a===-1?(a=j.length,j.push(b.endDay)):j[a]=b.endDay,{...b,lane:a}}),laneCount:Math.max(1,j.length)}}function mt(){const{trips:t,loading:x}=Ge(),m=u.useMemo(()=>t.map(d=>({...d,startMs:$(d.startDate).getTime(),endMs:$(d.endDate).getTime()})),[t]),n=u.useMemo(()=>{const d=new Set;m.forEach(y=>{const C=new Date(y.startMs).getFullYear(),c=new Date(y.endMs).getFullYear();for(let k=C;k<=c;k++)d.add(k)});const f=[...d].sort();return f.length===0&&f.push(new Date().getFullYear()),f},[m]),N=u.useMemo(()=>{const d=new Date().getFullYear();return n.includes(d)?d:n.find(y=>y>=d)??n[n.length-1]},[n]),[i,p]=u.useState(N),[j,w]=u.useState("all"),b=u.useMemo(()=>{const d=new Map;return m.forEach(f=>
1{(f.guides||[]).forEach(y=>{const C=`${y.first_name} ${y.last_name}`.trim(),c=C.toLowerCase();d.has(c)||d.set(c,{key:c,name:C,profile_image:y.profile_image})})}),[...d.values()].sort((f,y)=>f.name.localeCompare(y.name,"de"))},[m]),a=u.useMemo(()=>j==="all"?m:j==="unassigned"?m.filter(d=>!d.guides||d.guides.length===0):m.filter(d=>(d.guides||[]).some(f=>`${f.first_name} ${f.last_name}`.trim().toLowerCase()===j)),[m,j]),h=u.useMemo(()=>ge.map((d,f)=>ct(a,i,f)),[a,i]),l=26,v=90,D=56;return x?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(ie,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsx(Be,{delayDuration:150,children:e.jsxs("div",{className:"glass-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Jahreskalender"}),e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-muted/50 p-1",children:n.map(d=>e.jsx("button",{onClick:()=>p(d),className:B("px-3 py-1.5 text-xs font-medium rounded-md transition-colors",i===d?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:d},d))}),e.jsxs("select",{value:j,onChange:d=>w(d.target.value),className:"text-xs rounded-md border border-border bg-background px-2 py-1.5 text-foreground",children:[e.jsx("option",{value:"all",children:"Alle Guides"}),e.jsx("option",{value:"unassigned",children:"Ohne Guide"}),b.map(d=>e.jsx("option",{value:d.key,children:d.name},d.key))]}),e.jsxs("div",{className:"ml-auto text-xs text-muted-foreground",children:[a.filter(d=>{const f=new Date(d.startMs).getFullYear(),y=new Date(d.endMs).getFullYear();return f<=i&&y>=i}).length," ","Reisen in ",i]})]}),e.jsx("div",{className:"overflow-auto rounded-lg border border-border/50",children:e.jsxs("div",{className:"inline-block min-w-full",children:[e.jsxs("div",{className:"flex sticky top-0 z-20 bg-background/95 backdrop-blur border-b border-border",children:[e.jsx("div",{className:"shrink-0 border-r border-border bg-muted/40 text-[11px] font-semibold text-muted-foreground flex items-center justify-center",style:{width:D,height:32},children:"Tag"}),ge.map((d,f)=>{const y=Math.max(1,h[f].laneCount)*v;return e.jsx("div",{className:"shrink-0 border-r border-border text-center text-xs font-semibold text-foreground flex items-center justify-center",style:{width:y,height:32},children:d},d)})]}),Array.from({length:31},(d,f)=>f+1).map(d=>e.jsxs("div",{className:"flex border-b border-border/40",children:[e.jsx("div",{className:"shrink-0 border-r border-border bg-muted/20 text-[11px] text-muted-foreground flex items-center justify-center sticky left-0 z-10",style:{width:D,height:l},children:e.jsx("span",{className:"tabular-nums",children:d})}),ge.map((f,y)=>{const c=Math.max(1,h[y].laneCount)*v,k=new Date(i,y+1,0).getDate(),L=d<=k,z=L?new Date(i,y,d):null,_=z?z.getDay():0,G=L&&(_===0||_===6);return e.jsx("div",{className:B("shrink-0 border-r border-border/60 relative",!L&&"bg-muted/30",L&&G&&"bg-muted/20"),style:{width:c,height:l},children:L&&z&&e.jsx("span",{className:"absolute left-1 top-0.5 text-[9px] text-muted-foreground/60 select-none",children:dt[_]})},y)})]},d)),e.jsx("div",{className:"relative",style:{marginTop:-(31*l),height:31*l,pointerEvents:"none"},children:e.jsxs("div",{className:"flex h-full",children:[e.jsx("div",{className:"shrink-0",style:{width:D}}),ge.map((d,f)=>{const C=Math.max(1,h[f].laneCount)*v;return e.jsx("div",{className:"shrink-0 relative",style:{width:C,height:"100%"},children:h[f].segments.map((c,k)=>{var I,U;const L=(c.startDay-1)*l+2,z=(c.endDay-c.startDay+1)*l-4,_=c.lane*v+2,G=v-4;return e.jsxs(je,{children:[e.jsx(ve,{asChild:!0,children:e.jsxs(_e,{to:`/admin/trips/${c.trip.id}`,className:B("absolute rounded-md px-1.5 py-1 text-[10px] font-medium text-white shadow-sm hover:ring-2 hover:ring-primary transition overflow-hidden flex flex-col",ot(c.trip.status),c.continuesLeft&&"rounded-l-none",c.continuesRight&&"rounded-r-none"),style:{top:L,height:z,left:_,width:G,pointerEvents:"auto"},children:[e.jsx("span",{className:"leading-tight line-clamp-2 break-words pr-1",children:c.trip.name}),e.jsxs("span",{className:"mt-auto text-[9px] opacity-80 truncate pr-9",children:[c.trip.totalParticipants,c.trip.maxGroupSize?`/${c.trip.maxGroupSize}`:""," TN"]}),c.trip.guides&&c.trip.guides.length>0&&e.jsxs("div",{className:"absolute bottom-1 right-1 flex items-center gap-0.5",children:[c.trip.guides[0].profile_image?e.jsx("img",{src:c.trip.guides[0].profile_image,alt:`${c.trip.guides[0].first_name} ${c.trip.guides[0].last_name}`,className:"w-4 h-4 rounded-full object-cover ring-1 ring-white/80"}):e.jsx("span",{className:"w-4 h-4 rounded-full bg-background/90 text-foreground text-[8px] font-semibold flex items-center justify-center ring-1 ring-white/80",children:(((I=c.trip.guides[0].first_name)==null?void 0:I[0])??"")+(((U=c.trip.guides[0].last_name)==null?void 0:U[0])??"")}),c.trip.guides.length>1&&e.jsxs("span",{className:"text-[8px] font-semibold bg-background/90 text-foreground rounded-full px-1 leading-tight ring-1 ring-white/80",children:["+",c.trip.guides.length-1]})]})]})}),e.jsxs(Ne,{side:"right",className:"max-w-xs",children:[e.jsx("div",{className:"font-semibold",children:c.trip.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:c.trip.destination}),e.jsxs("div",{className:"text-xs mt-1",children:[new Date(c.trip.startMs).toLocaleDateString("de-DE")," â"," ",new Date(c.trip.endMs).toLocaleDateString("de-DE")]}),e.jsxs("div",{className:"text-xs",children:[c.trip.totalParticipants,c.trip.maxGroupSize?` / ${c.trip.maxGroupSize}`:""," Teilnehmer"]}),c.trip.guides&&c.trip.guides.length>0&&e.jsxs("div",{className:"text-xs mt-1",children:["Guide: ",c.trip.guides.map(O=>`${O.first_name} ${O.last_name}
1`).join(", ")]})]})]},`${c.trip.id}-${k}`)})},f)})]})})]})}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Klick auf eine Reise öffnet die Detailseite. Reisen über Monatswechsel werden in beiden Monatsspalten dargestellt."})]})})}function ut(){const[t,x]=u.useState(12),[m,n]=u.useState("by-trip"),N=ks(),{loading:i,window:p,trips:j,guides:w,guideUtilization:b,allConflictTripIds:a,unassignedTrips:h}=st(t),l=()=>{N.invalidateQueries({queryKey:["all-guides"]}),N.invalidateQueries()};return i?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(ie,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-4 animate-fade-in",children:[e.jsxs("div",{className:"glass-card p-3 flex flex-wrap items-center gap-3",children:[e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-muted/50 p-1",children:[12,24].map(v=>e.jsxs("button",{onClick:()=>x(v),className:B("px-3 py-1.5 text-xs font-medium rounded-md transition-colors",t===v?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[v," Monate"]},v))}),e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-muted/50 p-1",children:[{v:"by-trip",l:"Nach Reise"},{v:"by-guide",l:"Nach Guide"},{v:"year",l:"Jahreskalender"}].map(v=>e.jsx("button",{onClick:()=>n(v.v),className:B("px-3 py-1.5 text-xs font-medium rounded-md transition-colors",m===v.v?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:v.l},v.v))}),e.jsxs("div",{className:"ml-auto text-xs text-muted-foreground",children:[p.start.toLocaleDateString("de-DE",{month:"short",year:"numeric"})," â"," ",new Date(p.endMs-1).toLocaleDateString("de-DE",{month:"short",year:"numeric"})]})]}),e.jsx(lt,{trips:h,guides:w,onAssigned:l}),m==="year"?e.jsx(mt,{}):e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[1fr_320px] gap-4",children:[e.jsx(nt,{window:p,trips:j,guideUtilization:b,conflictTripIds:a,mode:m}),e.jsx(it,{utilization:b})]}),e.jsxs("div",{className:"glass-card p-3 flex flex-wrap items-center gap-4 text-[11px] text-muted-foreground",children:[e.jsx("span",{className:"font-semibold text-foreground",children:"Status:"}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-muted-foreground/40"})," Entwurf"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-primary/70"})," Veröffentlicht"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-emerald-500/80"})," Bestätigt"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-muted/60 border"})," Abgeschlossen"]}),e.jsxs("span",{className:"ml-auto flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block w-3 h-3 rounded ring-2 ring-destructive"})," Guide-Konflikt"]})]})]})}function xt({open:t,onOpenChange:x,templates:m,onDeleteTemplate:n,onUpdateTemplate:N}){const[i,p]=u.useState(null),[j,w]=u.useState(""),[b,a]=u.useState(""),[h,l]=u.useState(null),[v,D]=u.useState(!1),d=k=>{p(k),w(k.name),a(k.destination)},f=()=>{p(null),w(""),a("")},y=async()=>{if(!(!i||!j.trim()||!b.trim())){D(!0);try{await N(i.id,{name:j.trim(),destination:b.trim()}),f()}finally{D(!1)}}},C=async()=>{if(h){D(!0);try{await n(h),l(null)}finally{D(!1)}}},c=m.find(k=>k.id===h);return e.jsxs(e.Fragment,{children:[e.jsx(Ie,{open:t,onOpenChange:x,children:e.jsxs(Pe,{className:"glass-modal sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[e.jsx(Ue,{children:e.jsx(Oe,{className:"text-xl",children:"Vorlagen verwalten"})}),e.jsx("div",{className:"space-y-2 py-4",children:m.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Keine Vorlagen vorhanden. Wiederkehrende Reisen werden automatisch als Vorlage gespeichert."}):m.map(k=>e.jsx("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-muted/30 hover:bg-muted/50 transition-colors group",children:(i==null?void 0:i.id)===k.id?e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Name"}),e.jsx(T,{value:j,onChange:L=>w(L.target.value),className:"rounded-lg h-9",autoFocus:!0})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Destination"}),e.jsx(T,{value:b,onChange:L=>a(L.target.value),className:"rounded-lg h-9"})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(A,{variant:"ghost",size:"sm",onClick:f,disabled:v,children:"Abbrechen"}),e.jsx(A,{size:"sm",onClick:y,disabled:v||!j.trim()||!b.trim(),children:"Speichern"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:k.name}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:k.destination})]}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(A,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>d(k),children:e.jsx(Gs,{className:"h-4 w-4"})}),e.jsx(A,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>l(k.id),children:e.jsx(be,{className:"h-4 w-4"})})]})]})},k.id))}),e.jsx(Ve,{children:e.jsx(A,{variant:"outline",onClick:()=>x(!1),children:"SchlieÃen"})})]})}),e.jsx(rs,{open:!!h,onOpenChange:k=>!k&&l(null),children:e.jsxs(is,{children:[e.jsxs(ls,{children:[e.jsx(ds,{children:"Vorlage löschen?"}),e.jsxs(os,{children:['Möchten Sie die Vorlage "',c==null?void 0:c.name,'" wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.']})]}),e.jsxs(cs,{children:[e.jsx(ms,{disabled:v,children:"Abbrechen"}),e.jsx(us,{onClick:C,disabled:v,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Löschen"})]})]})})]})}const ht=[{title:"Visum beantragen",category:"visa",description:"Visum für die Einreise beantragen",dueDaysBefore:"30",isRequired:!0},{title:"Reiseversicherung abschlieÃen",category:"documents",description:"Auslandskrankenversicherung und Reiserücktritt",dueDaysBefore:"14",isRequired:!0},{title:"Impfungen prüfen",category:"health",description:"Empfohlene Impfungen für das Reiseland",dueDaysBefore:"60",isRequired:!1},{title:"Reisepass gültig?",category:"documents",description:"Reisepass muss mind. 6 Monate über Reiseende hinaus gültig sein",dueDaysBefore:"90",isRequired:!0}],pt=[{value:"visa",label:"Visum"},{value:"documents",label:"Dokumente"},{value:"preparation",label:"Vorbereitung"},{value:"health",label:"Gesundheit"}];function gt({open:t,onOpenChange:x,onSave:m,templates:n=[],onDeleteTemplate:N,onUpdateTemplate:i}){var Je,Ze;const[p,j]=u.useState(!1),[w,b]=u.useState(""),[a,h]=u.useState(""),[l,v]=u.useState(""),[D,d]=u.useState(),[f,y]=u.useState(),[C,c]=u.useState(),[k,L]=u.useState(),[z,_]=u.useState(""),[G,I]=u.useState(null),[U,O]=u.useState(""),[W,Q]=u.useState(""),[o,R]=u.useState(""),[we,le]=u.useState("0"),[J,De]=u.useState("0"),[Ye,ke]=u.useState(""),[Ke,Se]=u.useState(""),[Ce,Me]=u.useState(!1),[Z,X]=u.useState([]),[Te,Le]=u.useState(!1),[V,K]=u.useState([]),[qe,He]=u.useState(!1),de=u.useRef(null),xs=async s=>{var r;const g=(r=s.target.files)==null?void 0:r[0];if(g){if(!g.type.startsWith("image/")){H.error("Bitte wählen Sie eine Bilddatei aus.");return}if(g.size>5*1024*1024){H.error("Das Bild darf maximal 5MB groà sein.");return}He(!0);try{const E=g.name.split(".").pop(),ee=`trip-heroes/${`${Date.now()}-${Math.random().toString(36).substring(2)}.${E}`}`,{error:se}=await $e.storage.from("trip-images").upload(ee,g);if(se)throw se;
1const{data:{publicUrl:me}}=$e.storage.from("trip-images").getPublicUrl(ee);_(me),H.success("Bild erfolgreich hochgeladen!")}catch(E){console.error("Upload error:",E),H.error("Fehler beim Hochladen des Bildes.")}finally{He(!1),de.current&&(de.current.value="")}}},hs=()=>{_(""),I(null)},ps=s=>{var r,E,Ae,ee,se,me;if(b(s),s==="none"){Qe();return}const g=n.find(M=>M.id===s);g&&(h(g.name),v(g.destination),d(g.countryId),y(g.countryName),_(g.image||""),I(null),O(((r=g.minGroupSize)==null?void 0:r.toString())||""),Q(((E=g.maxGroupSize)==null?void 0:E.toString())||""),R(((Ae=g.price)==null?void 0:Ae.toString())||""),De(((ee=g.vatRate)==null?void 0:ee.toString())||"0"),ke(g.whatsappGroupLink||""),Se(g.bookletLink||""),Me((((se=g.addOns)==null?void 0:se.length)||0)>0),X((g.addOns||[]).map(M=>{var te,Xe;return{id:`addon_${Date.now()}_${Math.random()}`,name:M.name,description:M.description,price:M.price.toString(),priceType:M.priceType,limitedSpots:((te=M.limitedSpots)==null?void 0:te.toString())||"",deadlineDaysBefore:((Xe=M.deadlineDaysBefore)==null?void 0:Xe.toString())||"",isActive:M.isActive,externalUrl:M.externalUrl||"",isHighlighted:M.isHighlighted??!1,templateAddonId:M.id}})),Le((((me=g.checklists)==null?void 0:me.length)||0)>0),K((g.checklists||[]).map(M=>{var te;return{id:`checklist_${Date.now()}_${Math.random()}
1`,title:M.title,description:M.description||"",details:M.details||"",externalLink:M.externalLink||"",externalLinkLabel:M.externalLinkLabel||"",attachmentUrl:M.attachmentUrl||"",dueDaysBefore:((te=M.dueDaysBefore)==null?void 0:te.toString())||"",category:M.category,isRequired:M.isRequired,isActive:M.isActive,expanded:!1}})),c(void 0),L(void 0))},P=n.find(s=>s.id===w),oe=((Je=P==null?void 0:P.partnerServices)==null?void 0:Je.length)||0,ce=((Ze=P==null?void 0:P.guides)==null?void 0:Ze.length)||0,We=!!(P!=null&&P.hasQuestionnaire),Qe=()=>{b(""),h(""),v(""),d(void 0),y(void 0),c(void 0),L(void 0),_(""),O(""),Q(""),R(""),De("0"),le("0"),ke(""),Se(""),Me(!1),X([]),Le(!1),K([])},gs=()=>{X([...Z,{id:`addon_${Date.now()}`,name:"",description:"",price:"",priceType:"per_person",limitedSpots:"",deadlineDaysBefore:"",isActive:!0,externalUrl:"",isHighlighted:!1}])},q=(s,g,r)=>{X(Z.map(E=>E.id===s?{...E,[g]:r}:E))},fs=s=>{X(Z.filter(g=>g.id!==s))},js=()=>{K([...V,{id:`checklist_${Date.now()}`,title:"",description:"",details:"",externalLink:"",externalLinkLabel:"",attachmentUrl:"",dueDaysBefore:"",category:"preparation",isRequired:!1,isActive:!0,expanded:!0}])},vs=s=>{if(V.some(g=>g.title.toLowerCase()===s.title.toLowerCase())){H.info("Dieses Element ist bereits in der Liste.");return}K([...V,{id:`checklist_${Date.now()}`,title:s.title,description:s.description,details:"",externalLink:"",externalLinkLabel:"",attachmentUrl:"",dueDaysBefore:s.dueDaysBefore,category:s.category,isRequired:s.isRequired,isActive:!0,expanded:!1}])},F=(s,g,r)=>{K(V.map(E=>E.id===s?{...E,[g]:r}:E))},Ns=s=>{K(V.filter(g=>g.id!==s))},bs=s=>{K(V.map(g=>g.id===s?{...g,expanded:!g.expanded}:g))},ys=()=>{if(!a||!l||!C||!k)return;const s=Ce?Z.filter(r=>r.name).map(r=>({id:r.id,name:r.name,description:r.description,price:parseFloat(r.price)||0,priceType:r.priceType,limitedSpots:r.limitedSpots?parseInt(r.limitedSpots):void 0,deadlineDaysBefore:r.deadlineDaysBefore?parseInt(r.deadlineDaysBefore):void 0,isActive:r.isActive,externalUrl:r.externalUrl,isHighlighted:r.isHighlighted,templateAddonId:r.templateAddonId??null})):void 0,g=Te?V.filter(r=>r.title).map(r=>({id:r.id,title:r.title,description:r.description,details:r.details,externalLink:r.externalLink,externalLinkLabel:r.externalLinkLabel,attachmentUrl:r.attachmentUrl,dueDaysBefore:r.dueDaysBefore,category:r.category,isRequired:r.isRequired,isActive:r.isActive})):void 0;m({name:a,destination:l,countryId:D,countryName:f,startDate:es(C),endDate:es(k),status:"draft",image:z||void 0,imageFocalPoint:z?G:null,isRecurring:w&&w!=="none",minGroupSize:U?parseInt(U):void 0,maxGroupSize:W?parseInt(W):void 0,price:o?parseFloat(o):void 0,vatRate:J?parseFloat(J):0,whatsappGroupLink:Ye||void 0,bookletLink:Ke||void 0,addOns:s,checklists:g,templateId:w&&w!=="none"?w:void 0}),Qe(),x(!1)},ws=a&&l&&C&&k;return e.jsxs(e.Fragment,{children:[e.jsx(Ie,{open:t,onOpenChange:x,children:e.jsxs(Pe,{className:"glass-modal sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(Ue,{children:e.jsx(Oe,{className:"text-xl",children:"Neue Reise erstellen"})}),e.jsxs("div",{className:"space-y-6 py-4",children:[n.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(S,{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"h-4 w-4 text-primary"}),"Aus Vorlage erstellen"]}),N&&i&&e.jsxs(A,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:()=>j(!0),children:[e.jsx(Us,{className:"h-4 w-4 mr-1"}),"Verwalten"]})]}),e.jsxs(ue,{value:w,onValueChange:ps,children:[e.jsx(xe,{className:"rounded-xl",children:e.jsx(he,{placeholder:"Vorlage wählen (optional)"})}),e.jsxs(pe,{children:[e.jsx(Y,{value:"none",children:"Keine Vorlage"}),n.map(s=>e.jsxs(Y,{value:s.id,children:[s.name," â ",s.destination]},s.id))]})]}),(oe>0||ce>0||We)&&e.jsxs("div",{className:"space-y-2",children:[oe>0&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-primary bg-primary/10 px-3 py-2 rounded-lg",children:[e.jsx(Ls,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[oe," Partner-Dienstleistung",oe!==1?"en":""," werden automatisch hinzugefügt"]})]}),ce>0&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-primary bg-primary/10 px-3 py-2 rounded-lg",children:[e.jsx(Fe,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[ce," Guide",ce!==1?"s":""," werden automatisch hinzugefügt"]})]}),We&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-primary bg-primary/10 px-3 py-2 rounded-lg",children:[e.jsx(Os,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:"1 Fragebogen wird automatisch hinzugefügt"})]})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"name",children:"Reisename *"}),e.jsx(T,{id:"name",value:a,onChange:s=>h(s.target.value),placeholder:"z.B. Wanderreise Alpen",className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"destination",children:"Destination *"}
1),e.jsx(T,{id:"destination",value:l,onChange:s=>v(s.target.value),placeholder:"z.B. Ãsterreich, Tirol",className:"rounded-xl"})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"price",children:"Preis pro Person (â¬)"}),e.jsx(T,{id:"price",type:"number",min:"0",step:"0.01",value:o,onChange:s=>R(s.target.value),placeholder:"z.B. 1990.00",className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"vatRate",children:"MwSt-Satz (%)"}),e.jsxs(ue,{value:J,onValueChange:De,children:[e.jsx(xe,{className:"rounded-xl",children:e.jsx(he,{})}),e.jsxs(pe,{children:[e.jsx(Y,{value:"0",children:"0% (Drittland)"}),e.jsx(Y,{value:"7",children:"7% (ermäÃigt)"}),e.jsx(Y,{value:"19",children:"19% (EU-Margenbesteuerung)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:J==="0"?"Keine MwSt für Reisen auÃerhalb der EU":J==="19"?"Margenbesteuerung für EU-Reisen":"ErmäÃigter Steuersatz"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"permitAmount",children:"Permit-Betrag (â¬)"}),e.jsx(T,{id:"permitAmount",type:"number",min:"0",step:"1",value:we,onChange:s=>le(s.target.value),placeholder:"0",className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Betrag für Permits, der zusätzlich zu 25% des Restbetrags als Anzahlung berechnet wird. 0 = normale 25%-Anzahlung."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Land"}),e.jsx(Is,{value:D,onChange:(s,g)=>{d(s),y(g)},placeholder:"Land wählen oder hinzufügen..."}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Wählen Sie ein bestehendes Land oder fügen Sie ein neues hinzu."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Reisezeitraum *"}),e.jsx(Bs,{startDate:C,endDate:k,onStartDateChange:c,onEndDateChange:L,startLabel:"Startdatum",endLabel:"Enddatum"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"heroImage",children:"Hero Foto"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T,{id:"heroImage",value:z,onChange:s=>_(s.target.value),placeholder:"URL eingeben oder Bild hochladen",className:"rounded-xl"}),e.jsx("input",{ref:de,type:"file",accept:"image/*",onChange:xs,className:"hidden"}),e.jsx(A,{type:"button",variant:"outline",className:"rounded-xl shrink-0",onClick:()=>{var s;return(s=de.current)==null?void 0:s.click()},disabled:qe,children:qe?e.jsx(ie,{className:"h-4 w-4 animate-spin"}):e.jsx(Vs,{className:"h-4 w-4"})})]}),z&&e.jsxs("div",{className:"mt-2 relative group",children:[e.jsx(Ps,{imageUrl:z,value:G,onChange:I,heightClass:"h-40",alt:"Hero Foto der Reise",hint:"Klicke ins Bild, um den Bildmittelpunkt zu setzen â dieser Punkt bleibt in allen Portalen sichtbar."}),e.jsx(A,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",onClick:hs,children:e.jsx(As,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(S,{htmlFor:"whatsappGroupLink",className:"flex items-center gap-2",children:[e.jsx(Ys,{className:"h-4 w-4 text-green-500"}),"WhatsApp Gruppenlink"]}),e.jsx(T,{id:"whatsappGroupLink",value:Ye,onChange:s=>ke(s.target.value),placeholder:"https://chat.whatsapp.com/...",className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Link zur WhatsApp-Gruppe für Teilnehmer dieser Reise"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(S,{htmlFor:"bookletLink",className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"h-4 w-4 text-primary"}),"Booklet Link"]}),e.jsx(T,{id:"bookletLink",value:Ke,onChange:s=>Se(s.target.value),placeholder:"https://...",className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Link zum Reise-Booklet für Teilnehmer"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"minGroupSize",children:"Minimum GruppengröÃe"}),e.jsx(T,{id:"minGroupSize",type:"number",min:"1",value:U,onChange:s=>O(s.target.value),placeholder:"z.B. 10",className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"maxGroupSize",children:"Maximum GruppengröÃe"}),e.jsx(T,{id:"maxGroupSize",type:"number",min:"1",value:W,onChange:s=>Q(s.target.value),placeholder:"z.B. 25",className:"rounded-xl"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-muted/30 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:"Add-Ons"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Optionale Zusatzleistungen für Teilnehmer"})]}),e.jsx(ae,{checked:Ce,onCheckedChange:Me})]}),Ce&&e.jsxs("div",{className:"space-y-4",children:[Z.map((s,g)=>e.jsxs("div",{className:"rounded-xl border border-border bg-muted/20 p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h4",{className:"font-medium text-foreground",children:["Add-On ",g+1]}),e.jsx(A,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>fs(s.id),children:e.jsx(be,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Name"}),e.jsx(T,{value:s.name,onChange:r=>q(s.id,"name",r.target.value),placeholder:"z.B. Flughafentransfer",className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Preis (â¬)"}),e.jsx(T,{type:"number",min:"0",step:"0.01",value:s.price,onChange:r=>q(s.id,"price",r.target.value),placeholder:"0.00",className:"rounded-xl"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Beschreibung"}),e.jsx(ss,{value:s.description,onChange:r=>q(s.id,"description",r.target.value),placeholder:"Kurze Beschreibung des Add-Ons",className:"rounded-xl resize-none",rows:2})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Preistyp"}),e.jsxs(ue,{value:s.priceType,onValueChange:r=>q(s.id,"priceType",r),children:[e.jsx(xe,{className:"rounded-xl",children:e.jsx(he,{})}),e.jsxs(pe,{children:[e.jsx(Y,{value:"per_person",children:"Pro Person"}),e.jsx(Y,{value:"flat",children:"Pauschal"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Limitierte Plätze"}),e.jsx(T,{type:"number",min:"0",value:s.limitedSpots,onChange:r=>q(s.id,"limitedSpots",r.target.value),placeholder:"Unbegrenzt",className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Deadline (Tage vor Reise)"}),e.jsx(T,{type:"number",min:"0",value:s.deadlineDaysBefore,onChange:r=>q(s.id,"deadlineDaysBefore",r.target.value),placeholder:"z.B. 14",className:"rounded-xl"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{checked:s.isActive,onCheckedChange:r=>q(s.id,"isActive",r)}),e.jsx(S,{className:"text-sm",children:"Add-On aktiv"})]})]},s.id)),e.jsxs(A,{variant:"outline",className:"w-full gap-2 rounded-xl border-dashed",onClick:gs,children:[e.jsx(fe,{className:"h-4 w-4"}),"Add-On hinzufügen"]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-muted/30 p-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium text-foreground flex items-center gap-2",children:[e.jsx(Ks,{className:"h-4 w-4"}),"Checkliste"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Aufgaben die Teilnehmer vor der Reise erledigen müssen"})]}),e.jsx(ae,{checked:Te,onCheckedChange:Le})]}),Te&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:ht.map((s,g)=>e.jsxs(A,{type:"button",variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:()=>vs(s),children:[e.jsx(fe,{className:"h-3 w-3 mr-1"}),s.title]},g))}),V.map((s,g)=>e.jsxs("div",{className:"rounded-xl border border-border bg-muted/20 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[g+1,"."]}),e.jsx(T,{value:s.title,onChange:r=>F(s.id,"title",r.target.value),placeholder:"Titel des Checklist-Items",className:"rounded-xl flex-1"})]}),e.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[e.jsx(A,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>bs(s.id),children:s.expanded?e.jsx(qs,{className:"h-4 w-4"}):e.jsx(zs,{className:"h-4 w-4"})}),e.jsx(A,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>Ns(s.id),children:e.jsx(be,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Kategorie"}),e.jsxs(ue,{value:s.category,onValueChange:r=>F(s.id,"category",r),children:[e.jsx(xe,{className:"rounded-xl h-9",children:e.jsx(he,{})}),e.jsx(pe,{children:pt.map(r=>e.jsx(Y,{value:r.value,children:r.label},r.value))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Deadline (Tage vor Reise)"}),e.jsx(T,{type:"number",min:"0",value:s.dueDaysBefore,onChange:r=>F(s.id,"dueDaysBefore",r.target.value),placeholder:"z.B. 14",className:"rounded-xl h-9"})]}),e.jsxs("div",{className:"flex items-end gap-4 pb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{checked:s.isRequired,onCheckedChange:r=>F(s.id,"isRequired",r)}),e.jsx(S,{className:"text-xs",children:"Pflicht"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{checked:s.isActive,onCheckedChange:r=>F(s.id,"isActive",r)}),e.jsx(S,{className:"text-xs",children:"Aktiv"})]})]})]}),s.expanded&&e.jsxs("div",{className:"space-y-3 pt-2 border-t border-border/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Kurzbeschreibung"}),e.jsx(T,{value:s.description,onChange:r=>F(s.id,"description",r.target.value),placeholder:"Kurze Beschreibung für Teilnehmer",className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Details (mehrzeilig)"}),e.jsx(ss,{value:s.details,onChange:r=>F(s.id,"details",r.target.value),placeholder:"Ausführliche Informationen, z.B. Adresse der Botschaft...",className:"rounded-xl resize-none",rows:3})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Exter
1ner Link"}),e.jsx(T,{value:s.externalLink,onChange:r=>F(s.id,"externalLink",r.target.value),placeholder:"https://...",className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Link-Button Text"}),e.jsx(T,{value:s.externalLinkLabel,onChange:r=>F(s.id,"externalLinkLabel",r.target.value),placeholder:"z.B. Zur Botschaft",className:"rounded-xl"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(S,{className:"text-xs",children:"Anhang URL"}),e.jsx(T,{value:s.attachmentUrl,onChange:r=>F(s.id,"attachmentUrl",r.target.value),placeholder:"https://...",className:"rounded-xl"})]})]})]},s.id)),e.jsxs(A,{variant:"outline",className:"w-full gap-2 rounded-xl border-dashed",onClick:js,children:[e.jsx(fe,{className:"h-4 w-4"}),"Checklist-Item hinzufügen"]})]})]})]}),e.jsxs(Ve,{className:"gap-2",children:[e.jsx(A,{variant:"outline",className:"rounded-xl",onClick:()=>x(!1),children:"Abbrechen"}),e.jsx(A,{className:"rounded-xl",onClick:ys,disabled:!ws,children:"Reise erstellen"})]})]})}),N&&i&&e.jsx(xt,{open:p,onOpenChange:j,templates:n,onDeleteTemplate:N,onUpdateTemplate:i})]})}function aa(){const[t,x]=Ss(),m=t.get("status")||"all",n=t.get("view")==="planning"?"planning":"list",[N,i]=u.useState(""),[p,j]=u.useState(m),[w,b]=u.useState("all"),[a,h]=u.useState(!1),[l,v]=u.useState(null),{trips:D,loading:d,error:f,createTrip:y,deleteTrip:C}=Ge(),{templates:c,deleteTemplate:k,updateTemplate:L}=Hs(),z=o=>{const R=new URLSearchParams(t);o==="planning"?R.set("view","planning"):R.delete("view"),x(R,{replace:!0})};u.useEffect(()=>{const o=t.get("status");o&&o!==p&&j(o)},[t]);const _=[...new Set(D.filter(o=>o.status==="completed").map(o=>$(o.endDate).getFullYear()))].sort((o,R)=>R-o),G={all:D.filter(o=>o.status!=="completed").length,draft:D.filter(o=>o.status==="draft").length,planning:D.filter(o=>o.status==="planning").length,confirmed:D.filter(o=>o.status==="confirmed").length,completed:D.filter(o=>o.status==="completed").length},I=D.filter(o=>{const R=o.name.toLowerCase().includes(N.toLowerCase())||o.destination.toLowerCase().includes(N.toLowerCase()),we=p==="all"?o.status!=="completed":o.status===p,le=p==="completed"&&w!=="all"?$(o.endDate).getFullYear().toString()===w:!0;return R&&we&&le}).sort((o,R)=>p==="completed"?$(R.endDate).getTime()-$(o.endDate).getTime():0),U=async o=>{await y(o),h(!1)},O=async()=>{l&&(await C(l.id),v(null))},W=async o=>k(o),Q=async(o,R)=>L(o,R);return e.jsxs("div",{className:"space-y-8 animate-fade-in",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Reisen"}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:n==="planning"?"Jahresplanung & Guide-Koordination im Ãberblick.":"Verwalten Sie alle Ihre Gruppenreisen an einem Ort."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1 rounded-xl bg-muted/50 p-1",children:[e.jsxs("button",{onClick:()=>z("list"),className:B("flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg transition-colors",n==="list"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.jsx(Qs,{className:"h-4 w-4"}),"Liste"]}),e.jsxs("button",{onClick:()=>z("planning"),className:B("flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg transition-colors",n==="planning"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.jsx(Js,{className:"h-4 w-4"}),"Planung"]})]}),e.jsxs(A,{className:"gap-2 rounded-xl",onClick:()=>h(!0),children:[e.jsx(fe,{className:"h-4 w-4"}),"Neue Reise"]})]})]}),n==="planning"&&e.jsx(ut,{}),e.jsx(gt,{open:a,onOpenChange:h,onSave:U,templates:c,onDeleteTemplate:W,onUpdateTemplate:Q}),e.jsx(rs,{open:!!l,onOpenChange:o=>!o&&v(null),children:e.jsxs(is,{className:"glass-modal",children:[e.jsxs(ls,{children:[e.jsx(ds,{children:"Reise löschen?"}),e.jsxs(os,{children:['Möchten Sie die Reise "',l==null?void 0:l.name,'" wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.',l&&l.totalParticipants>0&&e.jsxs("span",{className:"block mt-2 text-warning font-medium",children:["Achtung: Diese Reise hat ",l.totalParticipants," Teilnehmer."]})]})]}),e.jsxs(cs,{children:[e.jsx(ms,{className:"rounded-xl",children:"Abbrechen"}),e.jsx(us,{onClick:O,className:"rounded-xl bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Löschen"})]})]})}),n==="list"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"glass-card p-4",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(Zs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(T,{type:"text",placeholder:"Reise suchen...",value:N,onChange:o=>i(o.target.value),className:"pl-10 rounded-xl bg-muted/50 border-0"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[["all","draft","planning","confirmed"].map(o=>e.jsxs("button",{onClick:()=>j(o),className:`rounded-lg px-4 py-2 text-sm font-medium transition-all flex items-center gap-2 ${p===o?"bg-primary text-primary-foreground":"bg-muted/50 text-muted-foreground hover:bg-muted"}`,children:[o==="all"&&"Aktiv",o==="draft"&&"Entwürfe",o==="planning"&&"Veröffentlicht",o==="confirmed"&&"Bestätigt",e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs ${p===o?"bg-primary-foreground
1/20 text-primary-foreground":"bg-muted text-muted-foreground"}`,children:G[o]})]},o)),e.jsxs("button",{onClick:()=>{j("completed"),b("all")},className:`rounded-lg px-4 py-2 text-sm font-medium transition-all flex items-center gap-2 ${p==="completed"?"bg-muted text-foreground":"bg-muted/50 text-muted-foreground hover:bg-muted"}`,children:["Archiv",e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs ${p==="completed"?"bg-foreground/20 text-foreground":"bg-muted text-muted-foreground"}`,children:G.completed})]}),p==="completed"&&_.length>0&&e.jsxs("div",{className:"flex items-center gap-2 ml-4 pl-4 border-l border-border",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Jahr:"}),e.jsxs("select",{value:w,onChange:o=>b(o.target.value),className:"rounded-lg px-3 py-2 text-sm font-medium bg-muted/50 text-foreground border-0 focus:ring-2 focus:ring-primary",children:[e.jsx("option",{value:"all",children:"Alle Jahre"}),_.map(o=>e.jsx("option",{value:o.toString(),children:o},o))]})]})]})]})}),d&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(ie,{className:"h-8 w-8 animate-spin text-primary"})}),f&&e.jsx("div",{className:"glass-card p-12 text-center",children:e.jsx("p",{className:"text-destructive",children:f})}),!d&&!f&&e.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:I.map(o=>e.jsx(ft,{trip:o,onDelete:()=>v(o)},o.id))}),!d&&!f&&I.length===0&&e.jsxs("div",{className:"glass-card p-12 text-center",children:[e.jsx(ns,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-medium text-foreground",children:"Keine Reisen gefunden"}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:D.length===0?"Erstellen Sie Ihre erste Reise, um loszulegen.":"Versuchen Sie einen anderen Suchbegriff oder Filter."})]})]})]})}function ft({trip:t,onDelete:x}){const m=n=>{n.preventDefault(),n.stopPropagation(),x()};return e.jsxs(_e,{to:`/admin/trips/${t.id}`,className:"glass-card overflow-hidden card-hover group relative",children:[e.jsxs("div",{className:"relative h-40 bg-gradient-to-br from-primary/20 to-secondary/20",children:[t.image?e.jsx("img",{src:t.image,alt:t.name,className:"absolute inset-0 w-full h-full object-cover",style:Ws(t.imageFocalPoint)}):e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(ns,{className:"h-12 w-12 text-primary/40"})}),e.jsx("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:e.jsx(Fs,{status:t.status})}),e.jsx("button",{onClick:m,className:"absolute top-4 left-4 p-2 rounded-lg bg-destructive/90 text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity hover:bg-destructive",title:"Reise löschen",children:e.jsx(be,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-primary transition-colors truncate",children:t.name}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t.destination})]}),t.templateId&&e.jsxs(_e,{to:`/admin/templates/${t.templateId}`,onClick:n=>n.stopPropagation(),className:"shrink-0 flex items-center gap-1 px-2 py-1 rounded-md text-xs bg-primary/10 text-primary hover:bg-primary/20 transition-colors",title:"Vorlage bearbeiten",children:[e.jsx(Ee,{className:"h-3 w-3"}),"Vorlage"]})]}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Xs,{className:"h-4 w-4"}),e.jsxs("span",{children:[$(t.startDate).toLocaleDateString("de-DE",{day:"2-digit",month:"short"})," â ",$(t.endDate).toLocaleDateString("de-DE",{day:"2-digit",month:"short"})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsxs("span",{children:[t.totalParticipants," TN"]})]})]}),t.guides&&t.guides.length>
10&&e.jsx(Be,{children:e.jsxs("div",{className:"flex -space-x-2",children:[t.guides.slice(0,3).map(n=>e.jsxs(je,{children:[e.jsx(ve,{asChild:!0,children:e.jsxs(ne,{className:"h-7 w-7 border-2 border-background",children:[e.jsx(ye,{src:n.profile_image||void 0,alt:`${n.first_name} ${n.last_name}`}),e.jsxs(re,{className:"text-xs bg-primary/20 text-primary",children:[n.first_name[0],n.last_name[0]]})]})}),e.jsx(Ne,{children:e.jsxs("p",{children:[n.first_name," ",n.last_name]})})]},n.id)),t.guides.length>3&&e.jsxs(je,{children:[e.jsx(ve,{asChild:!0,children:e.jsx(ne,{className:"h-7 w-7 border-2 border-background",children:e.jsxs(re,{className:"text-xs bg-muted text-muted-foreground",children:["+",t.guides.length-3]})})}),e.jsx(Ne,{children:e.jsx("p",{children:t.guides.slice(3).map(n=>`${n.first_name} ${n.last_name}`).join(", ")})})]})]})})]}),e.jsxs("div",{className:"mt-4 flex items-center justify-between border-t border-border pt-4",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Umsatz"}),e.jsx("span",{className:"font-semibold text-foreground",children:new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t.totalRevenue)})]})]})]})}export{aa as TripsPage};
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.