import{g as z,_ as F}from"./DsrJ1HUj.js";import{L as K,v as P,r as s,B as Q,h as M,V as m,C as D,D as N,M as j,G as R,J as U,E as W,e as v,m as X}from"./BWemZcnb.js";import{u as Y}from"./DqZa6FN3.js";import{u as Z}from"./0dUtZt7y.js";const $={class:"flex flex-col items-center justify-center flex-shrink-0 gap-4 lg:flex-row"},tt={class:"flex flex-col items-start gap-4 mt-2"},ut=K({name:"NextLiveMatchHero",__name:"index",async setup(at){let f,x;Y();const i=([f,x]=P(()=>Z()),f=await f,x(),f),u=s(null),t=s(null),c=s(null),l=s(!0),n=s(),B=s(),E=s(),G=s(),p=X().public.club.features.streamline;Q(()=>{H()});const H=()=>p?V():J(),J=()=>{if(t.value=i==null?void 0:i[0],!t.value)return l.value=!1,void(n.value="no-fixture");c.value=t.value.attributes.streamamgData.assetData,l.value=!1,n.value="other"},V=()=>{var a,r,e,o,b,d,y,g,A,O,S,T,_,w,k,C,I;if(t.value=i==null?void 0:i.find(h=>{var L;return(h.attributes.streamlineData.streamType==="match"||h.attributes.streamlineData.streamType==="other")&&((L=h.attributes)==null?void 0:L.type)==="streamline"}),!t.value)return l.value=!1,void(n.value="no-fixture");t.value.attributes.streamlineData.streamType=="match"?(u.value=(a=t.value.relationships)==null?void 0:a.match[0],c.value=t.value.attributes.streamlineData.assetData,B.value=(o=(e=(r=u.value)==null?void 0:r.attributes)==null?void 0:e.teamData)==null?void 0:o[0],E.value=(y=(d=(b=u.value)==null?void 0:b.attributes)==null?void 0:d.teamData)==null?void 0:y[1],G.value={name:(g=u.value)==null?void 0:g.competitionName,icons:(S=(O=(A=u.value)==null?void 0:A.attributes)==null?void 0:O.competitionCrests)==null?void 0:S.competitionIcons},l.value=!1,n.value="fixture"):((w=(_=(T=t.value)==null?void 0:T.attributes)==null?void 0:_.streamlineData)==null?void 0:w.streamType)=="other"&&(c.value=(I=(C=(k=t.value)==null?void 0:k.attributes)==null?void 0:C.streamlineData)==null?void 0:I.assetData,l.value=!1,n.value="other")};M(()=>{const a=m.now();let r,e;return p?(e=m.fromISO(t.value.attributes.startAt).minus({minutes:z()}),r=m.fromISO(t.value.attributes.finishAt)):(e=m.fromISO(t.value.attributes.offset),r=m.fromISO(t.value.attributes.finishAt)),a>e&&a<r});const q=M(()=>{var a;if(p)return(a=t.value.relationships)==null?void 0:a.streamline});return(a,r)=>{const e=F;return D(),N("div",null,[j("div",$,[j("div",tt,[(D(!0),N(R,null,U(v(c),(o,b)=>(D(),W(e,{key:o.assetID,asset:o,relationships:v(q),"finish-at":v(t).attributes.finishAt,"start-at":v(t).attributes.startAt,offset:v(t).attributes.offset},null,8,["asset","relationships","finish-at","start-at","offset"]))),128))])])])}}});export{ut as _};