import{d as f}from"./BITtZpNW.js";import{_}from"./FvgwuZVK.js";import{_ as y,aa as b,e as n,c as r,d as s,n as c,t as u,f as l,N as w,T as x,g,E as k}from"./CSGWN0Ke.js";const p={setup(){return{annoucementVisible:b()}},props:{content:{type:Object,required:!0,default:()=>{}},autoplayvideo:{type:Boolean,required:!1,default:!0}},data(){return{videoStarted:null,videoStopped:!0,slowConnection:!1,videoFailFallback:!1,videoSuspended:!1,srcForVideo:""}},computed:{imageStyle(){return{"h-screen-head-an":this.annoucementVisible&&this.content.layout!=="right","h-screen-head":this.content.layout==="bottom","md:w-1/2 md:h-50vw":this.content.layout==="right"}},srcDesktop(){return this.content.video_inline},srcMobile(){return this.content.video_inline_mobile||this.content.video_inline}},mounted(){this.content.video&&"embed_url"in this.content.video&&this.autoplayvideo&&this.$refs.herovideo&&"IntersectionObserver"in window&&new IntersectionObserver((e,h)=>{e[0].isIntersecting&&this.videoStarted===!1?this.$refs.herovideo.play():this.videoStarted&&this.$refs.herovideo&&this.$refs.herovideo.pause()}).observe(this.$el),"video_inline"in this.content&&this.content.video_inline&&setTimeout(()=>{this.$refs.herovideo&&this.$refs.herovideo.paused&&(this.slowConnection=!0)},2e3);const o=document.createElement("video");o.onerror=()=>{this.videoFailFallback=!0},o.src=this.srcForVideo},beforeMount(){this.srcForVideo=window.screen.width<768?this.srcMobile:this.srcDesktop},methods:{videoFailed(o){console.log("error on iframe",o)},videoReady(){setTimeout(()=>{this.$refs.herovideo&&this.$refs.herovideo.addEventListener("suspend",()=>{this.$refs.herovideo&&!this.videoStarted&&(this.videoSuspended=!0)})},1e3)}}},S={class:"n-hero"},F={key:0,class:"font-sans text-sm md:text-base tracking-wider uppercase mb-3 md:mb-5"},V={key:1,class:"font-serif text-3xl md:text-5xl lg:text-6xl tracking-wider uppercase max-w-3xl mx-auto"},C={key:0,class:"hero-media absolute top-0 left-0 flex flex-col h-full w-full overflow-hidden cover-video"},T={key:0,class:"flex items-center justify-center h-full bg-red-300"},z=["src"],B={key:0},j=["srcset"],A=["srcset"],E=["src","alt"],M={class:"fill-current text-white cursor-pointer"};function N(o,i,e,h,t,a){const v=f,m=_;return n(),r("section",S,[s("div",{class:c(["n-hero__group",o.$styling(`n-hero__group-${e.content.layout||"top"}`,e.content.backgroundColour)])},["headline"in e.content?(n(),r("header",{key:0,class:c(["flex flex-col w-full px-4",e.content.layout==="right"?"justify-center md:w-1/2":"pt-5 md:mt-16 md:mb-8"])},[e.content.eyebrow_headline?(n(),r("h2",F,u(o.$prismic.asText(e.content.eyebrow_headline)),1)):l("",!0),e.content.headline?(n(),r("h1",V,u(o.$prismic.asText(e.content.headline)),1)):l("",!0)],2)):l("",!0),s("section",{class:c(["hero-media block w-full p-4 overflow-hidden",a.imageStyle])},[s("div",{class:"relative h-full overflow-hidden",style:w({"max-height: calc(56.25vw - 2rem)":e.content.layout==="top"})},[!t.videoSuspended&&!t.videoFailFallback&&"video_inline"in e.content&&e.content.video_inline||!t.videoSuspended&&!t.videoFailFallback&&"video_inline_mobile"in e.content&&e.content.video_inline_mobile?(n(),r("div",C,[t.slowConnection&&!t.videoStarted?(n(),r("div",T,i[5]||(i[5]=[s("svg",{class:"animate-spin h-10 w-10 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor"}),s("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0A12 12 0 000 12h4zm2 5.3A7.96 7.96 0 014 12H0c0 3.04 1.14 5.82 3 7.94l3-2.65z"})],-1)]))):l("",!0),t.srcForVideo?(n(),r("video",{key:1,ref:"herovideo",class:"nl-md:object-contain",playsinline:"",autoplay:"",muted:"",loop:"",onPlay:i[0]||(i[0]=d=>t.videoStarted=!0),onPause:i[1]||(i[1]=d=>t.videoStarted=!1),onLoadeddata:i[2]||(i[2]=(...d)=>a.videoReady&&a.videoReady(...d))},[s("source",{type:"video/mp4",src:t.srcForVideo},null,8,z)],544)):l("",!0)])):(n(),r(x,{key:1},["image"in e.content?(n(),r("picture",B,[s("source",{srcset:e.content.image.mediumsquare.url,media:"(max-width: 767px)"},null,8,j),s("source",{srcset:e.content.image.largeorientland.url,media:"(max-width: 1366px)"},null,8,A),s("img",{src:e.content.image.xlargeorientland.url,alt:e.content.image.alt||o.$prismic.asText(e.content.headline),class:c(["relative block object-cover h-full w-full transition duration-300 z-10",t.videoStarted?"opacity-0":"opacity-100"]),onClick:i[3]||(i[3]=d=>!e.autoplayvideo||!t.videoStarted&&o.$refs.herovideo?o.$refs.herovideo.pause():"")},null,10,E)])):l("",!0),e.content.video&&e.content.video.embed_url&&!e.autoplayvideo&&(t.videoStopped||!t.videoStarted)?(n(),r("button",{key:1,class:"absolute inset-x-0 inset-y-0 w-full z-10",onClick:i[4]||(i[4]=d=>(t.videoStarted=!0,o.$refs.herovideo.play()))},[g(v,{colour:{"text-white":!0},class:"mx-auto"}),s("span",M,u(o.staticText.video_play||"Play"),1)])):l("",!0)],64))],4)],2),e.content.addScrollPrompt!==!1?(n(),k(m,{key:1})):l("",!0)],2)])}const I=y(p,[["render",N]]);export{I as _};