import{u as V,q as I,s as M,v as q,bX as z,r as l,bY as O,j as e,z as $,a3 as B,n as H,at as U,f as w,B as Y,W as G,a4 as p,K,bZ as Q}from"./index-CHXls9zu.js";import{S as y,a as S,b as E,c as C,d as x}from"./select-FXQ_-9q_.js";import{S as W}from"./switch-Cc0j-vcW.js";import{g as X,E as Z,a as _,b as J,c as ee}from"./service-oL2j9mvJ.js";import{C as f}from"./calendar-C4cui3Vf.js";import{T as se}from"./tag-J9uKP5e6.js";import{E as ae}from"./earth-DJpy2nlu.js";import{M as te}from"./map-pin-DsozTM_p.js";import"./analytics-Bu8LxldC.js";import"./chevron-up-CO_sLnfo.js";function ue(){const{t,i18n:g}=V("events"),{currentLanguage:D}=I();M({pageName:"Events"}),q({pageName:"Events"});const[i,j]=z(),[v,T]=l.useState([]),[A,L]=l.useState([]),[re,P]=l.useState([]),[R,b]=l.useState(!0),c=i.get("tag")||"",o=i.get("region")||"",h=i.get("verified")==="true",d=i.get("q")||"";l.useEffect(()=>{O();async function s(){b(!0);const[a,r,n]=await Promise.all([_(),J(),ee()]);T(a),L(r),P(n),b(!1)}s()},[]);const u=l.useMemo(()=>{let s=v;if(c&&(s=s.filter(a=>a.tags.includes(c))),o&&(s=s.filter(a=>X(a.country)===o)),h&&(s=s.filter(a=>a.isVerified)),d){const a=d.toLowerCase();s=s.filter(r=>r.name.toLowerCase().includes(a)||r.city.toLowerCase().includes(a)||r.country.toLowerCase().includes(a)||r.organizer.toLowerCase().includes(a))}return s},[v,c,o,h,d]),m=(s,a)=>{const r=new URLSearchParams(i);a===""||a==="all"||a===!1?r.delete(s):(r.set(s,String(a)),Q(s,String(a),"events")),j(r)},N=s=>new Intl.DateTimeFormat(g.language,{month:"short",day:"numeric",year:"numeric"}).format(new Date(s)),F=(s,a)=>{const r=new Date(s),n=new Date(a);return r.getMonth()===n.getMonth()&&r.getFullYear()===n.getFullYear()?`${new Intl.DateTimeFormat(g.language,{month:"short",day:"numeric"}).format(r)} - ${new Intl.DateTimeFormat(g.language,{day:"numeric",year:"numeric"}).format(n)}`:`${N(s)} - ${N(a)}`},k={"north-america":t("regions.northAmerica","North America"),europe:t("regions.europe","Europe"),"asia-pacific":t("regions.asiaPacific","Asia Pacific"),"middle-east":t("regions.middleEast","Middle East"),"latin-america":t("regions.latinAmerica","Latin America"),africa:t("regions.africa","Africa")};return e.jsxs(e.Fragment,{children:[e.jsx($,{noindex:D!=="en",title:t("meta.title","Industry Events | Cendra"),description:t("meta.description","Discover upcoming conferences, trade shows, and networking events for vacation rentals and hotels."),canonicalPath:"/events"}),e.jsxs("section",{className:"relative pt-32 pb-16 md:pt-40 md:pb-24 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.jsx("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"text-center",children:[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(f,{className:"w-4 h-4"}),t("hero.badge","Industry Events")]}),e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold text-white mb-6",children:t("hero.title","Hospitality Events Hub")}),e.jsx("p",{className:"text-lg md:text-xl text-white/80 max-w-2xl mx-auto",children:t("hero.subtitle","Conferences, trade shows, and networking opportunities for vacation rental and hotel professionals.")})]})})]}),e.jsx("section",{className:"sticky top-[var(--nav-height)] z-30 bg-background/95 backdrop-blur-md border-b border-border",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(B,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(H,{type:"search",placeholder:t("filters.searchPlaceholder","Search events..."),value:d,onChange:s=>m("q",s.target.value),className:"pl-10"})]}),e.jsxs(y,{value:c||"all",onValueChange:s=>m("tag",s),children:[e.jsxs(S,{className:"w-[180px]",children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),e.jsx(E,{placeholder:t("filters.allTags","All Tags")})]}),e.jsxs(C,{children:[e.jsx(x,{value:"all",children:t("filters.allTags","All Tags")}),A.map(s=>e.jsx(x,{value:s,children:s.charAt(0).toUpperCase()+s.slice(1).replace("-"," ")},s))]})]}),e.jsxs(y,{value:o||"all",onValueChange:s=>m("region",s),children:[e.jsxs(S,{className:"w-[180px]",children:[e.jsx(ae,{className:"w-4 h-4 mr-2"}),e.jsx(E,{placeholder:t("filters.allRegions","All Regions")})]}),e.jsxs(C,{children:[e.jsx(x,{value:"all",children:t("filters.allRegions","All Regions")}),Z.map(s=>e.jsx(x,{value:s,children:k[s]},s))]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{id:"verified-only",checked:h,onCheckedChange:s=>m("verified",s)}),e.jsxs(U,{htmlFor:"verified-only",className:"flex items-center gap-1 text-sm cursor-pointer",children:[e.jsx(w,{className:"w-4 h-4 text-success-600"}),t("filters.verifiedOnly","Verified only")]})]})]})})}),e.jsx("section",{className:"py-16 md:py-24 bg-background",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:R?e.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[1,2,3,4,5,6].map(s=>e.jsx("div",{className:"animate-pulse bg-muted rounded-xl h-64"},s))}):u.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(f,{className:"w-16 h-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:t("empty.title","No events found")}),e.jsx("p",{className:"text-muted-foreground mb-6",children:t("empty.description","Try adjusting your filters or search query.")}),e.jsx(Y,{variant:"outline",onClick:()=>j(new URLSearchParams),children:t("empty.clearFilters","Clear all filters")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("p",{className:"text-muted-foreground",children:t("results.showing","Showing {{count}} events",{count:u.length})})}),e.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:u.map(s=>e.jsx(G,{to:`/events/${s.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(f,{className:"w-4 h-4"}),e.jsx("span",{children:F(s.startDate,s.endDate)}),s.isVerified&&e.jsxs(p,{variant:"outline",className:"ml-auto text-success-600 border-success-600/30 bg-success-600/10",children:[e.jsx(w,{className:"w-3 h-3 mr-1"}),t("verified","Verified")]})]}),e.jsx("h3",{className:"text-lg font-semibold mb-2 group-hover:text-primary transition-colors line-clamp-2",children:s.name}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-4",children:[e.jsx(te,{className:"w-4 h-4"}),e.jsxs("span",{children:[s.city,", ",s.country]})]}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground mb-4 line-clamp-2",children:s.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.tags.slice(0,3).map(a=>e.jsx(p,{variant:"secondary",className:"text-xs",children:a},a)),s.tags.length>3&&e.jsxs(p,{variant:"secondary",className:"text-xs",children:["+",s.tags.length-3]})]})]})})},s.id))})]})})}),e.jsx(K,{})]})}export{ue as default};