1import ie from"./BJkBoTL7.js";import{N as se,ag as le,aW as ce,aD as ue,P as v,ax as de,a0 as pe,W as me,aU as fe,a3 as j,aX as ve,a6 as D,a7 as y,a8 as b,aB as he,ai as O,aj as U,af as o,ak as w,ap as W,av as Q,a9 as ge,ah as ye,az as be,aE as X}from"./C4DTFQLm.js";import{u as we}from"./D6exqEJX.js";import{_ as $e}from"./DlAUqK2U.js";import"./CnffHLoe.js";import"./C7omXjIn.js";import"./DQSqsE9U.js";import"./WjvoOl1_.js";import"./D0RPKx-r.js";import"./BQM3aigP.js";import"./p0lNNOe1.js";import"./nuPXTILC.js";import"./CJkz5hUB.js";import"./D_uHQ6lX.js";import"./CVLVhzRH.js";const ke=["aria-label"],Se=["onClick","onKeydown","tabindex","aria-label","aria-current"],Pe={class:"relative block h-px w-full"},_e={class:"sr-only","aria-live":"polite"},M="polygon(0% 100%,100% 100%,100% 100%,0% 100%)",q="polygon(0% 0%,100% 0%,100% 100%,0% 100%)",xe=se({__name:"HeroSlider",props:{data:{},index:{}},setup(G){const p=G;le();const V=ce(),$=ue("$el"),m=v([]),r=v(0),H=v(0),F=v(!1);let h=5e3,f=0,g=0;const B=be(),J=de("(min-width: 1024px)"),k=pe(),{traits:Y}=we(),E=me(()=>Y.value.navLayout!=="overlay"&&k.value!=="frilandsmuseet"),L=e=>{(e==null?void 0:e.$video)instanceof HTMLVideoElement&&e.$video.play().catch(t=>{console.warn("Failed to play video:",t)})},T=e=>{if((e==null?void 0:e.$video)instanceof HTMLVideoElement)try{e.$video.pause(),e.$video.currentTime=0}catch(t){console.warn("Failed to pause video:",t)}},Z=e=>{var s,n;const t=e+1;return t>=((n=(s=p.data)==null?void 0:s.entries)==null?void 0:n.length)?0:t},{pause:S,resume:z,isActive:A}=fe(async()=>{var s,n,c;f||(f=Date.now());const t=Date.now()-f;if(H.value=t/h,t>=h){F.value=!0,S(),f=0;const u=Z(r.value),a=m.value[u];h=a.duration;const _=[{clipPath:M},{clipPath:q,offset:.98}],d=[{clipPath:M},{clipPath:q}],i={duration:B.value=="reduce"?0:1400,easing:"cubic-bezier(0.55, 0.01, 0, 1)"};a!=null&&a.$right&&(a.$right.style.clipPath=M),a.$el.style.opacity="1",a.$el.animate(_,i),a.$right.animate(J.value||p.data.type=="split"&&p.data.textPosition==="overlay"?d:[],{...i,delay:50});const l=((s=a.$entrySlide)==null?void 0:s.$media)||((c=(n=a.$entrySlide)==null?void 0:n.$card)==null?void 0:c.$media);l==null||l.animate([{scale:1.5},{scale:1}],{easing:"cubic-bezier(0, 0.22, 0, 0.98)",duration:B.value=="reduce"?0:2e3}),L(a);const x=m.value[r.value];T(x),a!=null&&a.$right&&(a.$right.style.clipPath=""),a.$el.style.opacity="",r.value=u,F.value=!1,z()}}),C=()=>{A.value&&(S(),g=Date.now())},R=()=>{var e;X()||A.value||N.value&&((e=$.value)!=null&&e.contains(document.activeElement)||(g&&(f+=Date.now()-g),g=0,z()))},ee=()=>C(),te=e=>{var t;(t=$.value)!=null&&t.contains(e.relatedTarget)||R()},ae=()=>{f=0,g=0,H.value=0},K=v([]),I=v(0);j(r,e=>{I.value=e});const oe=(e,t)=>{const n=((e==null?void 0:e.title)||"").replace(/<[^>]*>/g," ").trim()||V.t("a11y.featured item",{number:t+1});return`${V.t("navigate.to")} ${n}`},ne=e=>{var t;e===r.value||F.value||(T(m.value[r.value]),ae(),h=((t=m.value[e])==null?void 0:t.duration)??h,r.value=e,L(m.value[e]))},P=e=>{var n,c,u;const t=((c=(n=p.data)==null?void 0:n.entries)==null?void 0:c.length)??0;if(!t)return;const s=(e+t)%t;I.value=s,(u=K.value[s])==null||u.focus()},re=(e,t)=>{var s,n;switch(e.key){case"ArrowRight":case"ArrowDown":e.preventDefault(),P(t+1);break;case"ArrowLeft":case"ArrowUp":e.preventDefault(),P(t-1);break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),P((((n=(s=p.data)==null?void 0:s.entries)==null?void 0:n.length)??1)-1);break}},N=ve($);return j(N,e=>{if(X()){S();return}e?z():S()},{immediate:!0}),(e,t)=>{var n,c,u,a,_;const s=ie;return y(),D("div",{ref_key:"$el",ref:$,onFocusin:ee,onFocusout:te,class:w(("cn"in e?e.cn:o(Q))("b-hero relative h-[calc(100svh-var(--navigation-height))] w-full overflow-hidden lg:h-screen",{"max-md:mt-[var(--navigation-height)]":e.index===0&&o(E)}))},[b("div",{role:"toolbar","aria-label":e.$t("a11y.featured items"),"aria-orientation":"horizontal",class:w(("cn"in e?e.cn:o(Q))("z-top absolute left-0 flex w-full space-x-2 px-5 md:w-1/2 lg:left-1/2 lg:top-5 lg:w-[calc(calc(100vw/12)*4)]",{"top-[1.25rem]":e.index===0,"top-spacing-5":e.index!==0,"max-lg:top-[calc(var(--navigation-height)+20px)]":e.index===0&&!o(E),"md:top-[calc(var(--navigation-height)+20px)]":o(k)==="kronborg"}))},[(y(!0),D(O,null,U((n=e.data)==null?void 0:n.entries,(d,i)=>(y(),D("button",{type:"button",ref_for:!0,ref_key:"$indicators",ref:K,key:`hero.indicator.${d.id}`,onClick:l=>ne(i),onKeydown:l=>re(l,i),tabindex:o(I)===i?0:-1,"aria-label":oe(d,i),"aria-current":o(r)===i?"true":void 0,class:"relative block w-full cursor-pointer py-2 -my-2"},[b("span",Pe,[b("span",{class:w([o(k)==="frihedsmuseet"?"bg-[var(--light-color)]":"bg-theme-primary-1","absolute left-0 top-0 h-full w-full opacity-50"])},null,2),b("span",{style:W({width:`${o(r)>i?100:o(r)===i?100*o(H):0}%`}),class:w([o(k)==="frihedsmuseet"?"bg-[var(--light-color)]":"bg-theme-primary-1","absolute left-0 top-0 h-full"])},null,6)])],40,Se))),128))],10,ke),he(e.$slots,"breadcrumbs",{theme:(c=e.data.entries[o(r)])==null?void 0:c.theme},void 0,!0),b("span",_e,ge(e.$t("slider.position",{current:o(r)+1,total:((a=(u=e.data)==null?void 0:u.entries)==null?void 0:a.length)??0})),1),(y(!0),D(O,null,U((_=e.data)==null?void 0:_.entries,(d,i)=>{var l,x;return y(),ye(s,{onMouseenter:C,onMouseleave:R,inert:o(r)!==i||void 0,ref_for:!0,ref_key:"$slides",ref:m,type:e.data.type,textPosition:(l=e.data)==null?void 0:l.textPosition,imagePosition:(x=e.data)==null?void 0:x.imagePosition,key:d.id,index:e.index,entry:d,isSli
1der:!0,"heading-type":p.index===0&&i===0?"h1":"h2",class:w({"pointer-events-none opacity-0":o(r)!==i}),style:W({zIndex:o(r)===i?1:10})},null,8,["inert","type","textPosition","imagePosition","index","entry","heading-type","class","style"])}),128))],34)}}}),Ne=Object.assign($e(xe,[["__scopeId","data-v-f9b33ea1"]]),{__name:"BlocksHeroSlider"});export{Ne 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.