import{av as b,l as j,u as N,q as w,r as c,j as e,z as y,W as u,a4 as D,f as E,K as T}from"./index-CHXls9zu.js";import{h as F}from"./service-oL2j9mvJ.js";import{A as L}from"./arrow-left-Bd_5kLEE.js";import{T as k}from"./tag-J9uKP5e6.js";import{C}from"./calendar-C4cui3Vf.js";import{M as $}from"./map-pin-DsozTM_p.js";import"./analytics-Bu8LxldC.js";function R(){const{tag:a}=b(),m=j(),{t:s,i18n:r}=N("events"),{currentLanguage:h,getLocalizedPath:d}=w(),[g,p]=c.useState([]),[f,x]=c.useState(!0);c.useEffect(()=>{async function t(){if(!a)return;x(!0);const n=await F(a);if(n.length===0){m(d("/events"));return}p(n),x(!1)}t()},[a,m,d]);const v=(t,n)=>{const i=new Date(t),o=new Date(n);return i.getMonth()===o.getMonth()&&i.getFullYear()===o.getFullYear()?`${new Intl.DateTimeFormat(r.language,{month:"short",day:"numeric"}).format(i)} - ${new Intl.DateTimeFormat(r.language,{day:"numeric",year:"numeric"}).format(o)}`:`${new Intl.DateTimeFormat(r.language,{month:"short",day:"numeric",year:"numeric"}).format(i)} - ${new Intl.DateTimeFormat(r.language,{month:"short",day:"numeric",year:"numeric"}).format(o)}`},l=a?a.charAt(0).toUpperCase()+a.slice(1).replace("-"," "):"";return e.jsxs(e.Fragment,{children:[e.jsx(y,{noindex:h!=="en",title:s("tags.meta.title","{{tag}} Events | Cendra",{tag:l}),description:s("tags.meta.description","Discover {{tag}} events for vacation rentals and hotels.",{tag:l})}),e.jsxs("section",{className:"relative pt-32 pb-16 md:pt-40 md:pb-20 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary-700 via-primary-600 to-primary-700"}),e.jsx("div",{className:"absolute inset-0 bg-[url('/noise.png')] opacity-[0.03]"}),e.jsxs("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs(u,{to:"/events",className:"inline-flex items-center gap-2 text-white/70 hover:text-white mb-8 transition-colors",children:[e.jsx(L,{className:"w-4 h-4"}),s("detail.backToEvents","Back to events")]}),e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 bg-white/10 border border-white/20 rounded-full text-sm font-medium text-white/90 mb-6",children:[e.jsx(k,{className:"w-4 h-4"}),s("tags.badge","Events by Tag")]}),e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold text-white mb-4",children:l}),e.jsx("p",{className:"text-lg text-white/80",children:s("tags.subtitle","{{count}} events found",{count:g.length})})]})]}),e.jsx("section",{className:"py-16 md:py-24 bg-background content-auto-xl",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:f?e.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsx("div",{className:"animate-pulse bg-muted rounded-xl h-64"},t))}):e.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:g.map(t=>e.jsx(u,{to:`/events/${t.slug}`,className:"group block",children:e.jsx("article",{className:"h-full bg-card border border-border rounded-xl overflow-hidden transition-all duration-300 hover:shadow-lg hover:border-primary/30 hover:-translate-y-1",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-3",children:[e.jsx(C,{className:"w-4 h-4"}),e.jsx("span",{children:v(t.startDate,t.endDate)}),t.isVerified&&e.jsxs(D,{variant:"outline",className:"ml-auto text-success-600 border-success-600/30 bg-success-600/10",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),s("verified","Verified")]})]}),e.jsx("h3",{className:"text-lg font-semibold mb-2 group-hover:text-primary transition-colors line-clamp-2",children:t.name}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-4",children:[e.jsx($,{className:"w-4 h-4"}),e.jsxs("span",{children:[t.city,", ",t.country]})]}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t.description})]})})},t.id))})})}),e.jsx(T,{})]})}export{R as default};