import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{a as t,o as n,r}from"./vendor-motion-COLzAB1Q.js";import{c as i}from"./vendor-react-CSSUNbfU.js";import{c as a,r as o}from"./index-DLFWvoW-.js";var s=e(n(),1);function c(e){let[t,n]=(0,s.useState)([]),[r,i]=(0,s.useState)(!0);return(0,s.useEffect)(()=>{a.from(`page_sections`).select(`*`).eq(`page_slug`,e).order(`sort_order`).then(({data:e})=>{n((e||[]).map(e=>({...e,content:typeof e.content==`object`&&e.content!==null?e.content:{}}))),i(!1)})},[e]),{sections:t,hero:t.find(e=>e.section_type===`hero`),customSections:t.filter(e=>e.section_type===`custom`),loading:r}}var l=t(),u=[.22,1,.36,1];function d(e){return/\.(mp4|webm|mov|ogg)(\?|$)/i.test(e)||/supabase\.co\/storage/i.test(e)}var f=({section:e})=>{if(!e.is_visible)return null;let t=e.media_type===`video`&&e.media_url,n=e.media_type===`image`&&e.media_url,a=t?d(e.media_url):!1,s=e.content?.body||``,c=e.media_position||`center`,f=e.media_layout||`background`,p={objectPosition:c},m=e.content?.video_muted===void 0?!0:!!e.content.video_muted,h=e.content?.video_autoplay===void 0?!0:!!e.content.video_autoplay,g=e.content?.video_loop===void 0?!0:!!e.content.video_loop,_=e.content?.video_controls===void 0?!1:!!e.content.video_controls,v=e.content?.video_preload||`auto`,y=t||n;if(y&&(f===`left`||f===`right`)){let c=f===`left`,d=(0,l.jsxs)(`div`,{className:`relative w-full aspect-video overflow-hidden`,style:{background:`var(--surface-2)`},children:[t&&a&&(0,l.jsx)(`video`,{src:e.media_url,loop:g,muted:m,autoPlay:h,controls:_,playsInline:!0,preload:v,className:`w-full h-full object-cover`,style:p}),t&&!a&&(0,l.jsx)(`iframe`,{src:`https://player.vimeo.com/video/${e.media_url.match(/vimeo\.com\/(\d+)/)?.[1]||``}?background=${+!_}&autoplay=${+!!h}&loop=${+!!g}&muted=${+!!m}&controls=${+!!_}&dnt=1`,className:`w-full h-full`,allow:`autoplay; fullscreen`,frameBorder:`0`,title:e.title}),n&&(0,l.jsx)(`img`,{src:e.media_url,alt:``,className:`w-full h-full object-cover`,style:p})]}),y=(0,l.jsxs)(`div`,{className:`flex flex-col justify-center`,children:[e.subtitle&&(0,l.jsx)(`p`,{className:`text-meta text-brand-red mb-4 tracking-[0.15em]`,children:e.subtitle}),e.title&&(0,l.jsx)(`h2`,{className:`heading-section text-white mb-6`,children:e.title}),s&&(0,l.jsx)(`p`,{className:`text-body leading-relaxed whitespace-pre-line`,children:s}),e.cta_text&&e.cta_link&&(0,l.jsx)(`div`,{className:`mt-8`,children:(0,l.jsx)(o,{variant:`hero`,size:`xl`,asChild:!0,children:(0,l.jsx)(i,{to:e.cta_link,children:e.cta_text})})})]});return(0,l.jsx)(`section`,{className:`relative py-20 sm:py-28 lg:py-36 overflow-hidden`,style:{background:`var(--surface-1)`},children:(0,l.jsx)(`div`,{className:`container mx-auto px-4 md:px-8`,children:(0,l.jsx)(r.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:`-100px`},transition:{duration:.8,ease:u},className:`grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-center`,children:c?(0,l.jsxs)(l.Fragment,{children:[d,y]}):(0,l.jsxs)(l.Fragment,{children:[y,d]})})})})}return(0,l.jsxs)(`section`,{className:`relative py-20 sm:py-28 lg:py-36 overflow-hidden`,style:{background:`var(--surface-1)`},children:[t&&a&&(0,l.jsx)(`video`,{src:e.media_url,loop:g,muted:m,autoPlay:h,controls:_,playsInline:!0,preload:v,className:`absolute inset-0 w-full h-full object-cover`,style:p}),t&&!a&&(0,l.jsx)(`iframe`,{src:`https://player.vimeo.com/video/${e.media_url.match(/vimeo\.com\/(\d+)/)?.[1]||``}?background=${+!_}&autoplay=${+!!h}&loop=${+!!g}&muted=${+!!m}&controls=${+!!_}&dnt=1`,className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${_?``:`pointer-events-none`}`,style:{width:`177.78vh`,height:`56.25vw`,minWidth:`100%`,minHeight:`100%`},allow:`autoplay; fullscreen`,frameBorder:`0`,title:e.title}),n&&(0,l.jsx)(`img`,{src:e.media_url,alt:``,className:`absolute inset-0 w-full h-full object-cover`,style:p}),y&&(0,l.jsx)(`div`,{className:`absolute inset-0 pointer-events-none`,style:{background:`rgba(10,10,11,0.70)`}}),(0,l.jsx)(`div`,{className:`container mx-auto px-4 md:px-8 relative z-10`,children:(0,l.jsxs)(r.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:`-100px`},transition:{duration:.8,ease:u},className:`max-w-4xl mx-auto text-center`,children:[e.subtitle&&(0,l.jsx)(`p`,{className:`text-meta text-brand-red mb-4 sm:mb-6 tracking-[0.15em]`,children:e.subtitle}),e.title&&(0,l.jsx)(`h2`,{className:`heading-section text-white mb-6 sm:mb-8`,children:e.title}),s&&(0,l.jsx)(`p`,{className:`text-body max-w-2xl mx-auto leading-relaxed whitespace-pre-line`,children:s}),e.cta_text&&e.cta_link&&(0,l.jsx)(`div`,{className:`mt-8 sm:mt-10`,children:(0,l.jsx)(o,{variant:`hero`,size:`xl`,asChild:!0,children:(0,l.jsx)(i,{to:e.cta_link,children:e.cta_text})})})]})})]})},p=({pageSlug:e})=>{let{customSections:t}=c(e);return t.length===0?null:(0,l.jsx)(l.Fragment,{children:t.map(e=>(0,l.jsx)(f,{section:e},e.id))})};export{p as default};