1import{a as e}from"./fiyb4wbz.js";import{$ as t,A as n,At as r,C as i,D as a,E as o,Et as s,I as c,O as l,Vt as u,Yt as d,gn as f,gt as p,ht as m,k as h,kt as g,st as _}from"./CzV_kOVb.js";import{c as v,l as y,t as b}from"./CKJdEpBz.js";import{f as x,p as S}from"./0wwsd2r8.js";import{t as C}from"./BKAFin4c.js";import{n as w}from"./PBfplg_b.js";import{t as T}from"./aOH5IPPb.js";import{Q as E,nt as D,st as O}from"./CYST3QQt.js";import{yt as k}from"./B_H4q8gt.js";import{t as A}from"./BXzYUksg.js";import{t as j}from"./Dlk-DJ7h.js";import{t as M}from"./BDNMzG2s2.js";var N=class{fetch;resource=`/api/v2/Splash`;hiddenResource=`/api/v2/Hidden/Splash`;clickResource=`/api/v2/Splash/click`;constructor({fetch:e}){this.fetch=e}async get(e){let t=e.hidden?this.hiddenResource:this.resource,n={};return e.splashId?n.splashId=e.splashId:t+=`/${e.sportId}`,e.hidden&&(t+=`?t=${Date.now()}`),this.fetch(t,{params:n,onResponse:({response:e})=>{e.status===204&&(e._data=null)}}).then(e=>e&&e?.data?k(e.data):null).catch(e=>(O.error(`[SplashRepo] Splash Page Request Failed`,e),null))}async click(e){this.fetch(`${this.clickResource}/${e}`,{onResponse:({response:e})=>{e.status===204&&(e._data=null)}}).catch(e=>{O.error(`[SplashRepo] Splash Page Click Request Failed`,e)})}},P=w(`splashPage`,{state:()=>({splashPages:{},isLoading:!1,error:null}),actions:{async fetchSplashPageContent({payload:e,fetch:t}){let n=D(e);this.isLoading=!0;let r=await new N({fetch:t}).get(e);this.splashPages[n]=r,this.isLoading=!1},async trackClick({payload:e,fetch:t}){e.splashId&&await new N({fetch:t}).click(e.splashId)}},getters:{getSplashPageContent:e=>t=>{let n=D(t);return e.splashPages[n]||null},getLoadingFlag:e=>e.isLoading,getError:e=>e.error}}),F={key:0,class:`s-splash-screen-picture`},I={class:`s-splash-screen-picture--image hover:cursor-pointer`},L={__name:`SSplashScreenPicture`,props:{data:{type:Object,required:!0}},emits:[`clicked`],setup(e,{emit:t}){let r=e,i=t,s=()=>{i(`clicked`)},l=o(()=>r?.data?.picture?.images?.map(e=>({image:e.url,breakpoint:e?.breakpoint??0,alt:e?.alt})));return(e,t)=>{let r=C;return d(l)&&d(l)?.length&&d(l).length>0?(_(),n(`div`,F,[a(`div`,I,[c(r,{tabindex:`1`,preload:``,class:`w-full object-cover`,alt:d(l)[0].alt,images:d(l),onKeyup:v(s,[`enter`]),onClick:s},null,8,[`alt`,`images`])])])):h(``,!0)}}},R={class:`relative top-0 bottom-0 aspect-video`,tabindex:`1`},z=M({__name:`SSplashScreenVideo`,props:{data:{type:Object,required:!0}},emits:[`clicked`],setup(e,{emit:t}){let i=e,s=t,c=o(()=>({youtube:i.data.video.youTube,title:`Video`,component:`youtube`})),l=()=>{s(`clicked`)};return(e,t)=>{let i=m(`showcase-player`);return _(),n(`div`,{class:`s-splash-screen-video hover:cursor-pointer`,onClick:y(l,[`prevent`])},[r(a(`div`,R,null,512),[[i,{showcase:d(c),options:{autoplay:!0}}]])])}}},[[`__scopeId`,`data-v-c6f25337`]]),B=[`innerHTML`],V=M({__name:`SSplashScreen`,props:{splashId:{type:Number,required:!1},hidden:{type:Boolean,required:!0}},setup(y){let C=y,w=u(!1),D=S(),O=x(),k=P(),M=A(),N=T(),F=u(null),{$customFetch:I}=e(),R={picture:L,video:z},V=o(()=>U.value&&U.value.id?U.value.id:0),H=o(()=>U.value&&U.value.video?R.video:R.picture),U=o(()=>k.getSplashPageContent(q.value)),W=o(()=>{let e=`#000`;return U.value&&U.value.backgroundColor&&(e=U.value.backgroundColor),{backgroundColor:e}}),G=o(()=>{let e=`#fff`;return U.value&&U.value.foregroundColor&&(e=U.value.foregroundColor),{backgroundColor:e}}),K=o(()=>{let e=`#fff`;return U.value&&U.value.foregroundColor&&(e=U.value.foregroundColor),{color:e}}),ee=o(()=>N.getCurrentSport?.id??0),q=o(()=>({sportId:ee.value,splashId:C.splashId,hidden:C.hidden})),J=o(()=>`splash_${V.value}`),Y=async()=>{await k.fetchSplashPageContent({payload:q.value,fetch:I})},te=()=>{k.trackClick({payload:{splashId:V.value},fetch:I})},ne=()=>{te(),window.location.href=U.value?.link?.length?U.value.link:`/`},re=()=>{if(Z(J.value,31536e5),w.value=!1,O.name===`splash`)return D.push({path:`/`})},X=()=>{if(Z(J.value,14400),w.value=!1,O.name===`splash`)return D.push({path:`/`})},ie=()=>{let e=document.body.querySelector(`a`);e&&e.focus(),X()},Z=(e,t)=>{document.cookie=`${e}=true; path=/; max-age=${t}; SameSite=Lax`},Q=()=>{let e=j(J.value);
1if(U.value){if(O.path.includes(`/splash`)){w.value=!0;return}if(e.value){w.value=!1;return}let t=new Date(U.value.startDate),n=U.value.endDate?new Date(U.value.endDate):null,r=new Date;r>=t&&(!n||r<=n)?w.value=!0:w.value=!1}else w.value=!1},$=()=>{O.path.includes(`/splash`)&&M.setMetaTokens([{token:`@title`,value:U.value?.title}]),w.value&&(Z(J.value,300),setTimeout(()=>{F.value&&F.value.focus()},1500))};return s(()=>O.path,async()=>{E(O.path)||O.path.includes(`/splash/`)?(await Y(),O.path.includes(`/splash/`)&&!U.value&&await D.push({path:`/`}),Q(),$()):w.value=!1}),t(async()=>{E(O.path)||O.path.includes(`/splash/`)?(await Y(),O.path.includes(`/splash/`)&&!U.value&&await D.push({path:`/`}),Q(),$()):w.value=!1}),(e,t)=>{let o=m(`focusTrap`);return _(),l(i,{to:`#teleports`},[c(b,{name:`fade`},{default:g(()=>[d(w)?(_(),n(`div`,{key:0,class:`s-splash-screen s-splash-screen__backdrop fixed inset-0 z-[10000] flex h-full w-full flex-col items-center justify-center overflow-auto`,style:f(d(W)),onKeyup:v(ie,[`esc`])},[r((_(),n(`div`,{ref_key:`splashScreenRef`,ref:F,class:`s-splash-screen__wrapper max-h-screen w-11/12 max-w-5xl p-4 md:w-10/12 lg:w-7/12`,tabindex:`-1`},[a(`div`,{class:`s-splash-screen__content select-none`,style:f(d(G))},[d(U)?(_(),l(p(d(H)),{key:0,data:d(U),onClicked:ne},null,40,[`data`])):h(``,!0)],4),d(U)?.html?(_(),n(`div`,{key:0,class:`s-splash-screen__html-container flex justify-center px-4 pt-2`,innerHTML:d(U).html},null,8,B)):h(``,!0),a(`div`,{class:`s-splash-screen__footer flex select-none items-center justify-center gap-4 px-2 pt-4 text-white underline`,style:f(d(K))},[a(`button`,{type:`button`,class:`s-text-title-small xs:s-text-title hover:cursor-pointer`,"aria-label":`Continue to Home`,tabindex:`2`,onClick:X},` Continue to Home `),a(`button`,{type:`button`,class:`s-text-title-small xs:s-text-title hover:cursor-pointer`,"aria-label":`Skip Permanently`,tabindex:`3`,onClick:re},` Skip Permanently `)],4)])),[[o]])],36)):h(``,!0)]),_:1})])}}},[[`__scopeId`,`data-v-71fa337c`]]);export{P as n,V as t};
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.