1import{u as C,aH as A,r as d,q as P,cO as q,j as e,P as F,g as N,v as E,bS as $,p as k,m as B,M,a7 as I,L as T,bu as z,b as O}from"./index-BGXoFh6q.js";import{f as R,p as D,a as G}from"./hotel-discount-DEp3zhAP.js";import{P as S,a as W}from"./PromoCodeCopy-EDGUUjTI.js";import{S as J}from"./search-Y2d20jtb.js";import{S as v}from"./star-B1ozljov.js";import{B as Q}from"./building-2-Be_iPpL3.js";import"./copy--uPiLgLo.js";const U=[0,5,4,3],L=["https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&w=900&q=70","https://images.unsplash.com/photo-1551882547-ff40c63fe5fa?auto=format&fit=crop&w=900&q=70","https://images.unsplash.com/photo-1564501049412-61c2a3083791?auto=format&fit=crop&w=900&q=70","https://images.unsplash.com/photo-1542314831-068cd1dbfeeb?auto=format&fit=crop&w=900&q=70","https://images.unsplash.com/photo-1455587734955-081b22074882?auto=format&fit=crop&w=900&q=70","https://images.unsplash.com/photo-1520250497591-112f2f40a3f4?auto=format&fit=crop&w=900&q=70","https://images.unsplash.com/photo-1582719508461-905c673771fd?auto=format&fit=crop&w=900&q=70","https://images.unsplash.com/photo-1571896349842-33c89424de2d?auto=format&fit=crop&w=900&q=70"];function j(t){let a=0;for(let i=0;i<t.length;i++)a=a*31+t.charCodeAt(i)>>>0;return L[a%L.length]}function V(t,a){return t?/^(data:|blob:)/i.test(t)?t:/^https?:\/\/d2tp95qjx4xkde\.cloudfront\.net\//i.test(t)?j(a):/^https?:\/\//i.test(t)?t:O(t)??j(a):j(a)}function X({hotel:t,lng:a,showCompetitorDiscount:i,isAthleteLoggedIn:u}){const{t:f}=C(),n=a.startsWith("ar"),h=k(a,t.name_en,t.name_ar,{key:`cms.hotel.${t.id}.name`,t:f}),c=k(a,t.description_en,t.description_ar,{key:`cms.hotel.${t.id}.description`,t:f}),g=!!t.has_discount,o=!!t.show_discount_banner,l=R(t.discount_percent),x=D(n,u,t),b=G(u,t);return e.jsxs(B.article,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3},className:"group flex flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-sm transition-all hover:-translate-y-1 hover:border-primary/30 hover:shadow-lg",children:[e.jsxs("div",{className:"relative aspect-[16/10] overflow-hidden bg-muted",children:[e.jsx("img",{src:V(t.image??"",t.id),alt:h,loading:"lazy",onError:w=>{const m=w.currentTarget;m.dataset.fallback||(m.dataset.fallback="1",m.src=j(t.id))},className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"}),e.jsxs("div",{className:"absolute start-3 top-3 flex flex-col items-start gap-1.5",children:[t.is_games_hotel&&e.jsx("span",{className:"rounded-full bg-brand-gold px-2.5 py-1 text-[10px] font-bold uppercase tracking-wider text-brand-navy shadow",children:"GAMES HOTEL"}),t.is_new_hotel&&e.jsx("span",{className:"rounded-full bg-brand-red px-2.5 py-1 text-[10px] font-bold uppercase tracking-wider text-white shadow",children:n?"ÙÙØ¯Ù Ø¬Ø¯ÙØ¯":"New Hotel"})]}),i&&o&&g&&l&&e.jsxs("span",{className:"absolute end-3 top-3 inline-flex items-center gap-1 rounded-full bg-brand-red px-2.5 py-1 text-[10px] font-bold uppercase tracking-wider text-white shadow",children:[e.jsx(S,{className:"h-3 w-3"}),l," ",n?"خصÙ
":"OFF"]})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-3 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h3",{className:"text-lg font-bold leading-tight text-foreground",children:h}),e.jsx("div",{className:"flex flex-shrink-0 items-center gap-0.5",children:Array.from({length:t.stars}).map((w,m)=>e.jsx(v,{className:"h-3.5 w-3.5 fill-amber-400 text-amber-400"},m))})]}),c&&e.jsx("p",{className:"line-clamp-2 text-sm text-muted-foreground",children:c}),(t.drive_distance_km??t.distance_km)!=null&&e.jsxs("div",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(M,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[Number(t.drive_distance_km??t.distance_km).toLocaleString(a)," km",t.drive_time_min!=null&&e.jsxs(e.Fragment,{children:[" · ",t.drive_time_min," min"]})]})]}),i&&o&&g&&l&&e.jsxs("p",{className:"inline-flex items-center gap-1.5 text-xs font-semibold text-brand-red",children:[e.jsx(S,{className:"h-3.5 w-3.5"}),n?`خصÙ
اÙÙ
ÙØ§ÙسÙÙ: ${l}`:`Competitor discount: ${l}`]}),t.show_promo_code&&t.promo_code&&e.jsx(W,{code:t.promo_code,label:n?"برÙÙ
Ù":"Promo",size:"sm",className:"w-fit border-0 bg-brand-red/10"}),e.jsxs("div",{className:"mt-auto flex flex-wrap items-center justify-end gap-2 pt-3",children:[b&&e.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-md bg-brand-red px-4 py-2 text-sm font-bold text-white shadow-sm transition hover:bg-brand-red/90",children:[x,e.jsx(I,{className:"h-3.5 w-3.5 opacity-80"})]}),e.jsxs(T,{to:"/hotels/$slug",params:{slug:t.slug},className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground shadow-sm transition-all hover:bg-primary/90",children:[n?"اÙÙ
Ø²ÙØ¯":"More"," ",e.jsx(z,{className:"h-3.5 w-3.5 rtl:rotate-180"})]})]})]})]})}function re(){const{i18n:t}=C(),a=t.language?.startsWith("ar"),{profile:i,isLoggedIn:u}=A(),f=!!String(i?.competitorId??"").trim(),[n,h]=d.useState(""),[c,g]=d.useState(0),[o,l]=d.useState(""),[x,b]=d.useState([]),[w,m]=d.useState(!0),H=P(q);d.useEffect(()=>{let s=!1;return(async()=>{try{const r=await H();s||b(r.hotels??[])}finally{s||m(!1)}})(),()=>{s=!0}},[]);const _=d.useMemo(()=>{const s=new Set;for(const r of x){const y=String(r.hotel_chain??"").trim().toLowerCase();y&&s.add(y)}return Array.from(s).sort()},[x]),p=d.useMemo(()=>{const s=n.trim().toLowerCase();return x.filter(r=>!(c>0&&r.stars!==c||o&&String(r.hotel_chain??"").trim().toLowerCase()!==o||s&&!`${r.name_en??""} ${r.name_ar??""}`.toLowerCase().includes(s)))},[x,n,c,o]);return e.jsxs("div",{className:"bg-background",children:[e.jsx(F,{kicker:a?"Ø§ÙØ¨Ø±Ø§Ù
ج":"Programs",title:a?"اÙÙÙØ§Ø¯Ù":"Hotels",isAr:a}),e.jsx("section",{className:"sticky top-16 z-30 bg-background/95 py-6 backdrop-blur",children:e.jsxs("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsxs("div",{className:"relative w-full max-w-md",children:[e.jsx(J,{className:"pointer-events-none absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{type:"search",value:n,onChange:s=>h(s.target.value),placeholder:a?"Ø§Ø¨ØØ« ع٠ÙÙØ¯Ù...":"Search hotels...",className:"w-full rounded-full border border-input bg-card py-2.5 ps-10 pe-3 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20"})]})}),e.jsxs("div",{className:"flex w-full flex-col gap-3 rounded-2xl bg-card/80 p-4 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.18)] ring-1 ring-border/60 backdrop-blur",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-brand-gold text-brand-navy shadow-sm",children:e.jsx(v,{className:"h-4 w-4 fill-brand-navy text-brand-navy"})}),e.jsx("span",{className:"text-sm font-bold text-foreground sm:text-base",children:a?"تصÙÙØ© ØØ³Ø¨ اÙÙØ¬ÙÙ
":"Filter by stars"})]}),e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:U.map(s=>{const r=c===s;return e.jsxs("button",{type:"button",onClick:()=>g(s),className:N("inline-flex h-9 min-w-[3.5rem] items-center justify-center gap-1.5 rounded-full px-4 text-sm font-semibold transition-all",r?"bg-brand-navy text-white shadow-md":"bg-white text-foreground shadow-sm ring-1 ring-border/60 hover:bg-muted"),"aria-pressed":r,children:[e.jsx(v,{className:"h-3.5 w-3.5 fill-amber-400 text-amber-400"}),e.jsx("span",{children:s===0?a?"اÙÙÙ":"All":s})]},s)})})]}),_.length>0&&e.jsxs("div",{className:"mt-3 flex w-full flex-col gap-3 rounded-2xl bg-card/80 p-4 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.18)] ring-1 ring-border/60 backdrop-blur",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-brand-gold text-brand-navy shadow-sm",children:e.jsx(Q,{className:"h-4 w-4 text-brand-navy"})}),e.jsx("span",{className:"text-sm font-bold text-foreground sm:text-base",children:a?"Ø³ÙØ§Ø³Ù اÙÙÙØ§Ø¯Ù":"Hotel chains"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>l(""),className:N("inline-flex h-9 items-center justify-center rounded-full px-4 text-sm font-semibold transition-all",o?"bg-white text-foreground shadow-sm ring-1 ring-border/60 hover:bg-muted":"bg-brand-navy text-white shadow-md"),"aria-pressed":!o,children:a?"اÙÙÙ":"All"}),_.map(s=>{const r=o===s;return e.jsx("button",{type:"button",onClick:()=>l(s),className:N("inline-flex h-9 items-center justify-center rounded-full px-4 text-sm font-semibold capitalize transition-all",r?"bg-brand-navy text-white shadow-md":"bg-white text-foreground shadow-sm ring-1 ring-border/60 hover:bg-muted"),"aria-pressed":r,children:s},s)})]})]})]})}),e.jsx("section",{className:"mx-auto max-w-6xl px-4 py-12",children:w?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(E,{className:"h-6 w-6 animate-spin text-primary"})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-6 flex items-center justify-between",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:a?`${p.length} ÙØªÙجة`:`${p.length} result${p.length===1?"":"s"}`})}),p.length===0?e.jsx("div",{className:"rounded-xl border border-dashed border-border bg-card/50 px-6 py-16 text-center",children:e.jsx("p",{className:"text-muted-foreground",children:a?"ÙØ§ ØªÙØ¬Ø¯ ÙÙØ§Ø¯Ù Ù
Ø·Ø§Ø¨ÙØ©.":"No matching hotels."})}):e.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:e.jsx($,{mode:"popLayout",children:p.map(s=>e.jsx(X,{hotel:s,lng:t.language??"en",showCompetitorDiscount:f,isAthleteLoggedIn:u},s.id))})})]})})]})}export{re as component};
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.