1import{B}from"./D10wWOVR.js";import{cc as K,dj as Q,dk as U,dl as Y,dm as ee}from"#entry";import{e as j,g as F,u as ae,S as te,a as le}from"./BT6aBA5N.js";import{_ as se}from"./BGdetcTl.js";import{D as re,E as N,m as z,aI as oe,ay as ie,$ as M,L as G,Z as ne,X as k,aa as O,C as y,a9 as ue,az as pe,a8 as q,W as de,aA as ce}from"./BZS6mqMC.js";import"./C99plMEu.js";import"./214M18Yl.js";import"./GglzSuJ3.js";import"./C7_eb5qT.js";import"./BpErUTaN.js";import"./Z9EXHVsN.js";import"./B54D-DUX.js";import"./CViM96fn.js";function fe(D){let{swiper:e,extendParams:L,on:s}=D;L({parallax:{enabled:!1}});const u="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",b=(i,r)=>{const{rtl:n}=e,d=n?-1:1,c=i.getAttribute("data-swiper-parallax")||"0";let o=i.getAttribute("data-swiper-parallax-x"),l=i.getAttribute("data-swiper-parallax-y");const m=i.getAttribute("data-swiper-parallax-scale"),f=i.getAttribute("data-swiper-parallax-opacity"),p=i.getAttribute("data-swiper-parallax-rotate");if(o||l?(o=o||"0",l=l||"0"):e.isHorizontal()?(o=c,l="0"):(l=c,o="0"),o.indexOf("%")>=0?o=`${parseInt(o,10)*r*d}%`:o=`${o*r*d}px`,l.indexOf("%")>=0?l=`${parseInt(l,10)*r}%`:l=`${l*r}px`,typeof f<"u"&&f!==null){const w=f-(f-1)*(1-Math.abs(r));i.style.opacity=w}let T=`translate3d(${o}, ${l}, 0px)`;if(typeof m<"u"&&m!==null){const w=m-(m-1)*(1-Math.abs(r));T+=` scale(${w})`}if(p&&typeof p<"u"&&p!==null){const w=p*r*-1;T+=` rotate(${w}deg)`}i.style.transform=T},h=()=>{const{el:i,slides:r,progress:n,snapGrid:d,isElement:c}=e,o=j(i,u);e.isElement&&o.push(...j(e.hostEl,u)),o.forEach(l=>{b(l,n)}),r.forEach((l,m)=>{let f=l.progress;e.params.slidesPerGroup>1&&e.params.slidesPerView!=="auto"&&(f+=Math.ceil(m/2)-n*(d.length-1)),f=Math.min(Math.max(f,-1),1),l.querySelectorAll(`${u}, [data-swiper-parallax-rotate]`).forEach(p=>{b(p,f)})})},P=function(i){i===void 0&&(i=e.params.speed);const{el:r,hostEl:n}=e,d=[...r.querySelectorAll(u)];e.isElement&&d.push(...n.querySelectorAll(u)),d.forEach(c=>{let o=parseInt(c.getAttribute("data-swiper-parallax-duration"),10)||i;i===0&&(o=0),c.style.transitionDuration=`${o}ms`})};s("beforeInit",()=>{e.params.parallax.enabled&&(e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)}),s("init",()=>{e.params.parallax.enabled&&h()}),s("setTranslate",()=>{e.params.parallax.enabled&&h()}),s("setTransition",(i,r)=>{e.params.parallax.enabled&&P(r)})}function ye(D){let{swiper:e,extendParams:L,on:s,emit:u,params:b}=D;e.autoplay={running:!1,paused:!1,timeLeft:0},L({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let h,P,i=b&&b.autoplay?b.autoplay.delay:3e3,r=b&&b.autoplay?b.autoplay.delay:3e3,n,d=new Date().getTime(),c,o,l,m,f,p,T;function w(t){!e||e.destroyed||!e.wrapperEl||t.target===e.wrapperEl&&(e.wrapperEl.removeEventListener("transitionend",w),!(T||t.detail&&t.detail.bySwiperTouchMove)&&S())}const C=()=>{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?c=!0:c&&(r=n,c=!1);const t=e.autoplay.paused?n:d+r-new Date().getTime();e.autoplay.timeLeft=t,u("autoplayTimeLeft",t,t/i),P=requestAnimationFrame(()=>{C()})},$=()=>{let t;return e.virtual&&e.params.virtual.enabled?t=e.slides.find(g=>g.classList.contains("swiper-slide-active")):t=e.slides[e.activeIndex],t?parseInt(t.getAttribute("data-swiper-autoplay"),10):void 0},a=t=>{if(e.destroyed||!e.autoplay.running)return;cancelAnimationFrame(P),C();let A=typeof t>"u"?e.params.autoplay.delay:t;i=e.params.autoplay.delay,r=e.params.autoplay.delay;const g=$();!Number.isNaN(g)&&g>0&&typeof t>"u"&&(A=g,i=g,r=g),n=A;const _=e.params.speed,H=()=>{!e||e.destroyed||(e.params.autoplay.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(_,!0,!0),u("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(e.slides.length-1,_,!0,!0),u("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(_,!0,!0),u("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(0,_,!0,!0),u("autoplay")),e.params.cssMode&&(d=new Date().getTime(),requestAnimationFrame(()=>{a()})))};return A>0?(clearTimeout(h),h=setTimeout(()=>{H()},A)):requestAnimationFrame(()=>{H()}),A},v=()=>{d=new Date().getTime(),e.autoplay.running=!0,a(),u("autoplayStart")},E=()=>
1{e.autoplay.running=!1,clearTimeout(h),cancelAnimationFrame(P),u("autoplayStop")},x=(t,A)=>{if(e.destroyed||!e.autoplay.running)return;clearTimeout(h),t||(p=!0);const g=()=>{u("autoplayPause"),e.params.autoplay.waitForTransition?e.wrapperEl.addEventListener("transitionend",w):S()};if(e.autoplay.paused=!0,A){f&&(n=e.params.autoplay.delay),f=!1,g();return}n=(n||e.params.autoplay.delay)-(new Date().getTime()-d),!(e.isEnd&&n<0&&!e.params.loop)&&(n<0&&(n=0),g())},S=()=>{e.isEnd&&n<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(d=new Date().getTime(),p?(p=!1,a(n)):a(),e.autoplay.paused=!1,u("autoplayResume"))},I=()=>{if(e.destroyed||!e.autoplay.running)return;const t=F();t.visibilityState==="hidden"&&(p=!0,x(!0)),t.visibilityState==="visible"&&S()},R=t=>{t.pointerType==="mouse"&&(p=!0,T=!0,!(e.animating||e.autoplay.paused)&&x(!0))},V=t=>{t.pointerType==="mouse"&&(T=!1,e.autoplay.paused&&S())},W=()=>{e.params.autoplay.pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",R),e.el.addEventListener("pointerleave",V))},X=()=>{e.el&&typeof e.el!="string"&&(e.el.removeEventListener("pointerenter",R),e.el.removeEventListener("pointerleave",V))},Z=()=>{F().addEventListener("visibilitychange",I)},J=()=>{F().removeEventListener("visibilitychange",I)};s("init",()=>{e.params.autoplay.enabled&&(W(),Z(),v())}),s("destroy",()=>{X(),J(),e.autoplay.running&&E()}),s("_freeModeStaticRelease",()=>{(l||p)&&S()}),s("_freeModeNoMomentumRelease",()=>{e.params.autoplay.disableOnInteraction?E():x(!0,!0)}),s("beforeTransitionStart",(t,A,g)=>{e.destroyed||!e.autoplay.running||(g||!e.params.autoplay.disableOnInteraction?x(!0,!0):E())}),s("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(e.params.autoplay.disableOnInteraction){E();return}o=!0,l=!1,p=!1,m=setTimeout(()=>{p=!0,l=!0,x(!0)},200)}}),s("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!o)){if(clearTimeout(m),clearTimeout(h),e.params.autoplay.disableOnInteraction){l=!1,o=!1;return}l&&e.params.cssMode&&S(),l=!1,o=!1}}),s("slideChange",()=>{e.destroyed||!e.autoplay.running||(f=!0)}),Object.assign(e.autoplay,{start:v,stop:E,pause:x,resume:S})}const De=re({__name:"HeroSlider",props:{blok:{}},setup(D){const e=D,{isInEditorMode:L}=K(),{swiperInstance:s,autoplayProgress:u,onSwiperReady:b,handleSlidePrev:h,handleSlideNext:P}=ae(!0),i=N(()=>{const a=parseInt(e.blok.auto_play_delay??"6")*1e3;return isNaN(a)?6e3:a}),r=z(!L.value),n=z(!1),d=N(()=>r.value?"Pause":"Play"),c=z(0),o=N(()=>{var a;return(a=e.blok.slides)==null?void 0:a[c.value]}),l=oe("slideElements"),m=()=>{u.value=1,s.value&&(c.value=s.value.realIndex)},f=()=>{r.value?w():C()},p=()=>{n.value||(n.value=!0,w())},T=a=>{const v=a.currentTarget;v!=null&&v.contains(a.relatedTarget)||(n.value=!1)},w=()=>{var a;r.value=!1,(a=s==null?void 0:s.value)==null||a.autoplay.stop()},C=()=>{var a;r.value=!0,(a=s==null?void 0:s.value)==null||a.autoplay.start()},$=a=>{var v,E;(v=s==null?void 0:s.value)==null||v.slideToLoop(a,void 0,!1),c.value=a,u.value=1,(E=l.value)==null||E[a].focusPaginator(a)};return(a,v)=>{var x;const E=pe("editable");return ie((M(),G("div",{class:"full-bleed relative md:mt-[-90px]",onFocusin:p,onFocusout:T},[ne("div",{class:ue(["absolute top-0 aspect-4/3 w-full sm:aspect-video lg:static lg:aspect-auto",{"bg-petrol-dark":((x=o.value)==null?void 0:x.style)!=="light"}])},[k(y(B),{"aria-label":d.value,class:"absolute left-sm top-6xl z-10 sr-only-focusable",onClick:v[0]||(v[0]=S=>f())},{default:O(()=>[r.value?(M(),q(y(Q),{key:0})):(M(),q(y(U),{key:1}))]),_:1},8,["aria-label"]),k(y(B),{"aria-label":"Previous slide",class:"absolute left-sm top-1/2 z-20 -translate-y-1/2 sr-only-focusable",size:"lg",onClick:y(h)},{default:O(()=>[k(y(Y))]),_:1},8,["onClick"]),k(y(B),{"aria-label":"Next slide",class:"absolute right-sm top-1/2 z-20 -translate-y-1/2 sr-only-focusable",size:"lg",onClick:y(P)},{default:O(()=>[k(y(ee))]),_:1},8,["onClick"])],2),k(y(te),{class:"flex",loop:!0,speed:1e3,autoplay:{delay:i.value,pauseOnMouseEnter:!0},parallax:!0,modules:[y(ye),y(fe)],onSwiper:y(b),onSwiperslidechangetransitionend:m,onSwiperautoplay:m},{default:O(()=>[(M(!0),G(de,null,ce(a.blok.slides,(S,I)=>(M(),q(y(le),{key:`${S._uid}`,class:"z-10 flex-none"},{default:O(()=>[k(se,{ref_for:!0,ref_key:"slideElements",ref:l,blok:S,"is-active":I===c.value,autoplay:y(u),preload:I===0,slides:a.blok.slides??[],delay:i.value,"auto-playing":r.value,onActivateSlide:$},null,8,["blok","is-active","autoplay","preload","slides","delay","auto-playing"])]),_:2},1024))),128))]),_:1}
1,8,["autoplay","modules","onSwiper"])],32)),[[E,a.blok]])}}});export{De 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.