1import{d as P,r as l,j as e,J as L,o as r,E as v,f as M,K as T,Q as G}from"./index-DIZaCY_y.js";import{r as I}from"./supabase-DgPCwmhx.js";import{u as O}from"./useAuth-CNFG4pnh.js";const i={initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"}},y=a=>a?new Date(a).toLocaleDateString("en-GB",{month:"short",day:"numeric",year:"numeric"}):"",d=a=>a.main_image_url||a.hero_image_url||null,Q=({label:a})=>e.jsx("span",{className:"pointer-events-none absolute left-4 top-4 rounded-full border border-white/25 bg-black/35 px-3 py-1 text-[11px] font-medium text-white backdrop-blur-md",children:a}),q=()=>{const a=P(),{user:g}=O(),[o,w]=l.useState([]),[E,p]=l.useState(!0),[m,f]=l.useState(null),[n,C]=l.useState("All"),[x,A]=l.useState(""),[D,B]=l.useState(!1),[k,c]=l.useState(!1),b=async()=>{try{p(!0),f(null);const t=await I(!g);w(t)}catch(t){f(t instanceof Error?t.message:"Failed to load posts"),console.error("Error loading posts:",t)}finally{p(!1)}};l.useEffect(()=>{b()},[g]);const S=["All",...Array.from(new Set(o.map(t=>t.category).filter(Boolean)))],h=x.trim().toLowerCase(),F=o.filter(t=>{const u=n==="All"||t.category===n,_=!h||t.title.toLowerCase().includes(h)||(t.snippet||"").toLowerCase().includes(h);return u&&_}),s=o[0]??null,j=F.filter(t=>t.id!==(s==null?void 0:s.id)),N=t=>{window.scrollTo(0,0),a(`/blog/${t}`)};return e.jsxs("div",{className:"min-h-screen bg-[#FAFAF8] font-['DM_Sans',sans-serif] text-[#1a1a1a]",children:[e.jsx(L,{mobileMenuOpen:D,setMobileMenuOpen:B,navigate:a,isLightTheme:!0,onBookDemoClick:()=>{c(!0)}}),e.jsx("main",{"data-navbar-theme":"light",className:"pb-24 pt-32 md:pb-32 md:pt-40",children:e.jsxs("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:[e.jsxs(r.header,{...i,className:"mb-14 max-w-2xl md:mb-20",children:[e.jsx("p",{className:"mb-4 text-sm font-medium uppercase tracking-[0.15em] text-[#9CA3AF]",children:"Blog"}),e.jsx("h1",{className:"font-['Playfair_Display',serif] text-4xl leading-[1.1] text-[#1a1a1a] sm:text-5xl md:text-6xl",children:"Notes on operating AI in hotels."})]}),m&&e.jsxs("div",{className:"mb-16 rounded-2xl border border-[#E2E0DB] bg-white p-8 text-center",children:[e.jsxs("p",{className:"mb-4 text-sm text-[#B91C1C]",children:["Couldn't load posts: ",m]}),e.jsx("button",{onClick:b,className:"inline-flex items-center gap-2 rounded-full bg-[#09090B] px-5 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-[#1a1a1a]",children:"Try again"})]}),!m&&s&&e.jsxs(r.article,{...i,onClick:()=>N(s.slug),className:"group grid cursor-pointer grid-cols-1 items-center gap-8 lg:grid-cols-12 lg:gap-12",children:[e.jsx("div",{className:"relative overflow-hidden rounded-2xl bg-[#EEECE7] lg:col-span-8",children:e.jsx("div",{className:"aspect-[16/10] w-full",children:d(s)?e.jsx("img",{src:d(s),alt:s.title,className:"h-full w-full object-cover transition-transform duration-[900ms] ease-out group-hover:scale-[1.03]"}):e.jsx("div",{className:"h-full w-full bg-gradient-to-br from-[#E7E4DD] to-[#D8D4CB]"})})}),e.jsxs("div",{className:"lg:col-span-4",children:[e.jsx("p",{className:"mb-4 text-sm text-[#9CA3AF]",children:y(s.published_at)}),e.jsx("h2",{className:"mb-4 font-['Playfair_Display',serif] text-2xl leading-[1.2] text-[#1a1a1a] md:text-3xl lg:text-[2rem]",children:s.title}),s.snippet&&e.jsx("p",{className:"mb-6 text-base leading-relaxed text-[#6B7280]",children:s.snippet}),e.jsxs("span",{className:"inline-flex items-center gap-2 text-sm font-semibold text-[#1a1a1a]",children:["Read the post",e.jsx(v,{className:"h-4 w-4 transition-transform duration-300 group-hover:translate-x-1"})]})]})]}),e.jsxs("div",{className:"mt-16 border-t border-[#E2E0DB] pt-14 md:mt-20 md:pt-20",children:[e.jsxs(r.div,{...i,className:"mb-10",children:[e.jsx("h2",{className:"mb-3 font-['Playfair_Display',serif] text-3xl leading-tight text-[#1a1a1a] md:text-4xl",children:"All posts"}),e.jsx("p",{className:"text-base leading-relaxed text-[#6B7280]",children:"Stories, announcements, and product updates."})]}),e.jsxs(r.div,{...i,className:"mb-12 flex flex-col gap-5 md:flex-row md:items-center md:justify-between md:gap-8",children:[e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:S.map(t=>e.jsx("button",{onClick:()=>C(t),className:`rounded-full px-4 py-2 text-sm transition-colors ${n===t?"bg-[#EAE8E2] font-medium text-[#1a1a1a]":"text-[#6B7280] hover:bg-[#F0EEE9] hover:text-[#1a1a1a]"}`,children:t},t))}),e.jsxs("div",{className:"relative md:w-64 md:flex-shrink-0",children:[e.jsx(M,{className:"pointer-events-none absolute left-0 top-1/2 h-4 w-4 -translate-y-1/2 text-[#9CA3AF]"}),e.jsx("input",{type:"text",value:x,onChange:t=>A(t.target.value),placeholder:"Search posts",className:"w-full border-b border-[#
1E2E0DB] bg-transparent py-2 pl-6 text-sm text-[#1a1a1a] transition-colors placeholder:text-[#9CA3AF] focus:border-[#1a1a1a] focus:outline-none"})]})]}),E&&o.length===0?e.jsx("div",{className:"grid grid-cols-1 gap-x-6 gap-y-12 sm:grid-cols-2 lg:grid-cols-3",children:[0,1,2,3,4,5].map(t=>e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"aspect-[16/11] w-full rounded-2xl bg-[#EAE8E2]"}),e.jsx("div",{className:"mt-5 h-4 w-4/5 rounded-full bg-[#EAE8E2]"}),e.jsx("div",{className:"mt-3 h-3 w-24 rounded-full bg-[#EFEDE8]"})]},t))}):j.length>0?e.jsx("div",{className:"grid grid-cols-1 gap-x-6 gap-y-12 sm:grid-cols-2 lg:grid-cols-3",children:j.map((t,u)=>e.jsxs(r.article,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{delay:Math.min(u,5)*.06},onClick:()=>N(t.slug),className:"group cursor-pointer",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-[#EEECE7]",children:[e.jsx("div",{className:"aspect-[16/11] w-full",children:d(t)?e.jsx("img",{src:d(t),alt:t.title,loading:"lazy",decoding:"async",className:"h-full w-full object-cover transition-transform duration-[900ms] ease-out group-hover:scale-[1.04]"}):e.jsx("div",{className:"h-full w-full bg-gradient-to-br from-[#E7E4DD] to-[#D8D4CB]"})}),t.category&&e.jsx(Q,{label:t.category})]}),e.jsx("h3",{className:"mt-5 text-lg leading-snug text-[#1a1a1a] transition-colors group-hover:text-[#4B5563] md:text-xl",children:t.title}),e.jsxs("p",{className:"mt-2 text-sm text-[#9CA3AF]",children:[y(t.published_at),t.read_time_minutes?` · ${t.read_time_minutes} min read`:""]})]},t.id))}):e.jsxs("div",{className:"border-t border-[#E2E0DB] py-20 text-center",children:[e.jsx("p",{className:"mb-2 text-lg text-[#1a1a1a]",children:"No posts match that."}),e.jsx("p",{className:"text-sm text-[#9CA3AF]",children:x||n!=="All"?"Try a different category or clear the search.":"Check back shortly â the first posts are on their way."})]})]})]})}),e.jsx("section",{"data-navbar-theme":"light",className:"bg-[#FAFAF8] pb-24 md:pb-32",children:e.jsx("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:e.jsxs(r.div,{...i,className:"flex flex-col gap-8 border-t border-[#E2E0DB] pt-10 md:flex-row md:items-end md:justify-between md:pt-12",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-['Playfair_Display',serif] text-xl text-[#1a1a1a] md:text-2xl",children:"See how Venli fits on top of your hotel stack."}),e.jsx("p",{className:"mt-3 text-sm text-[#9CA3AF]",children:"No setup fees · Live in 2 days · No credit card required"})]}),e.jsxs("div",{className:"flex flex-shrink-0 flex-wrap items-center gap-3",children:[e.jsxs("button",{onClick:()=>{c(!0)},className:"group inline-flex items-center gap-2.5 rounded-full bg-[#09090B] px-6 py-3 text-sm font-semibold text-white transition-all duration-200 hover:scale-[1.02] hover:bg-[#1a1a1a] active:scale-[0.98]",children:["Get started",e.jsx(v,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5"})]}),e.jsx("button",{onClick:()=>{c(!0)},className:"inline-flex items-center rounded-full border border-black/12 bg-white/70 px-6 py-3 text-sm font-semibold text-[#1F2937] transition-all duration-200 hover:border-black/20 hover:bg-white",children:"Book a demo"})]})]})})}),e.jsx(T,{navigate:a}),e.jsx(G,{isOpen:k,onClose:()=>c(!1),isLightTheme:!0})]})};export{q as default};
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.