!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="810fca64-0e39-4972-80c7-76426102e5a4",e._sentryDebugIdIdentifier="sentry-dbid-810fca64-0e39-4972-80c7-76426102e5a4")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[72240],{4917:(e,t,s)=>{"use strict";s.d(t,{x:()=>c,A:()=>g});var i=s(6029),n=s(55575),r=s.n(n),a=s(95669),l=s.n(a),o=s(55729),d=s(947);let c=(0,o.createContext)({}),u=(e,t,s,i,n,r,a)=>s||(i||n?e.formatMessage({id:"".concat(t,".").concat(i||n),defaultMessage:a},r):a),g=e=>{let{titleKey:t,descriptionKey:s,keywordsKey:n,metaKey:a,values:g={},entityName:h}=e,{meta:x,seoContent:p}=(0,o.useContext)(c),m=(0,d.A)(),y=u(m,"title",(null==p?void 0:p.title)||(null==x?void 0:x.title),t,a,g,h?"".concat(h," | Sofascore"):"Sofascore"),j=u(m,"description",(null==p?void 0:p.description)||(null==x?void 0:x.description),s,a,g),f=u(m,"keywords",null==x?void 0:x.keywords,n,a,g);return(0,i.jsxs)(l(),{children:[(0,i.jsx)("title",{children:r()(y)}),j&&(0,i.jsx)("meta",{name:"description",content:j},"description"),f&&(0,i.jsx)("meta",{name:"keywords",content:f})]})}},8126:(e,t,s)=>{"use strict";s.d(t,{r:()=>p,A:()=>o});var i=s(6029),n=s(20325),r=s(55729),a=s(8041),l=s(53597);let o=e=>{let{entityId:t,blazeSDK:s,sdkId:o,containerId:d,screen:c,location:u,tabLocation:g,reloadTrigger:h,awaitBlazeSDK:x,ref:p,setErrorOccurred:m}=e;return(0,r.useEffect)(()=>{if((0,l.R5)(d)){null==s||s.addDelegateListener(null==s?void 0:s.Delegations.onErrorThrown,()=>{m(!0)});try{let e=null==s?void 0:s.Theme(c!==a.te.Desktop||u===a.D_.Widget||"details"===g?"row-rectangle-horizontal":"row-rectangle","story");e&&(e.layoutStyle.labelStyle.isVisible="details"!=g,e.layoutStyle.statusLiveStyle.isVisible=!1,e.layoutStyle.statusUnreadStyle.isVisible=!1,e.layoutStyle.statusLiveUnreadStyle.isVisible=!1,e.layoutStyle.borderRadius=t?"0":"12px",e.layoutStyle.horizontalItemsSpacing=4,null==s||s.WidgetRowView(d,{dataSource:s.DataSourceBuilder().ids({ids:[o]}),theme:e,maxDisplayItemsCount:1}))}catch(e){m(!0),console.error(e)}}},[o,c,d,h,x]),(0,i.jsx)(n.az,{ref:p,id:d,w:"auto",h:"100%",zIndex:"fixed"})};var d=s(54092),c=s(95084),u=s(82158),g=s(48253),h=s(70893),x=s(85962);let p=e=>{let{entityId:t,blazeSDK:s,provider:p,location:m,screen:y,clip:j,isMobile:f,isLive:v,awaitBlazeSDK:b}=e,[S,C]=(0,r.useState)(!1),[w,_]=(0,r.useState)(!1),T=(0,l.TW)({type:"single",location:m,tournamentId:void 0,roundId:void 0,entityId:t,screen:y,provider:p}),E=(0,d.i)(T,w,"wsc"),M=(0,i.jsx)(o,{containerId:T,blazeSDK:s,ref:E,entityId:t,sdkId:j.sdkId,location:m,screen:f?a.te.Mobile:a.te.Desktop,setErrorOccurred:_,awaitBlazeSDK:b,tabLocation:"media"});return(0,r.useEffect)(()=>{M&&_(!1)},[S]),(0,i.jsx)(x.h,{isWidget:m===a.D_.Widget,children:(0,i.jsxs)(n.so,{w:"100%",h:"100%",position:"absolute",justify:"center",align:"center",overflow:"hidden",children:[v&&(0,i.jsx)(g.m,{}),w?(0,i.jsx)(u.d,{setReloadTrigger:C}):M,(0,i.jsx)(n.so,{h:"100%",w:"100%",cursor:"pointer",justify:"center",position:"absolute",zIndex:"button",onClick:()=>{p&&(0,c.kA)({id:t,location:a.D_.EventMedia,provider:p})}}),(0,i.jsx)(h.Af,{imageUrl:j.storyThumbnailUrl})]})})}},13731:(e,t,s)=>{var i=s(53325),n=s(25725),r=Object.prototype.hasOwnProperty;e.exports=n(function(e,t,s){r.call(e,s)?e[s].push(t):i(e,s,[t])})},14165:e=>{e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},15946:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var i=s(46787),n=s(55729),r=s(494),a=s(41397),l=s(7646);function o(e,t){let s=null==t?void 0:t.shouldRefresh,[o,d]=(0,n.useState)(),[c,u]=(0,n.useState)(),g=(0,r.wA)();(0,n.useEffect)(()=>{(null==t?void 0:t.event)?g((0,l.$n)(t.event)):e&&i.nk6.fetchEvent(e).then(e=>{g((0,l.$n)(e.event)),d(e.event),u(void 0)}).catch(e=>{u(e),(null==t?void 0:t.onFetchError)&&t.onFetchError(),d(void 0)})},[e,null==t?void 0:t.event]);let h=(0,r.d4)(t=>{let{favorites:{events:s}}=t;return e?s[e]:void 0});(0,n.useEffect)(()=>{if(!e||!s)return;let t="event-details-".concat(e);return g((0,l.vB)({entities:[e],refreshTaskId:t},{fetchFunction:i.nk6.fetchEvent.bind(null,e)})),()=>{g((0,l.tM)(t))}},[e,s]);let[x,p]=(0,a.A)(h||(null==t?void 0:t.event),"homeTeam","awayTeam",o||(null==t?void 0:t.event)),[m,y]=(0,a.A)(h||(null==t?void 0:t.event),"homeScore","awayScore",o||(null==t?void 0:t.event));return{event:h,fetchedEvent:o,leftTeam:x,rightTeam:p,leftScore:m,rightScore:y,error:c}}},18970:(e,t,s)=>{"use strict";s.d(t,{y$:()=>a,cb:()=>r,Ws:()=>i.A});var i=s(74664);let n=(0,s(55729).createContext)({});var r=function(e){return e.EventPage="event_details",e.Widget="event_widget",e.BettingWidget="betting_widget",e.MainList="main_list",e.FeaturedMatch="featured_match",e.OddsTable="odds_table",e.FeaturedOdds="featured_odds",e.SpecialEventWidget="special_event_widget",e.FeaturedTournamentTab="featured_tournament_tab",e.AdditionalOdds="additional_odds",e.AdditionalOddsTab="additional_odds_tab",e.MonetizedOddsTab="monetized_odds_tab",e.WeeklyChallenge="weekly_challenge",e.Fantasy="fantasy",e}({});let a=n},23659:(e,t,s)=>{"use strict";s.d(t,{P:()=>a});var i=s(55729),n=s(53597);let r=null;function a(e,t,a,l){(0,i.useEffect)(()=>{let i=async()=>{r=await s.e(55831).then(s.t.bind(s,61985,23)),await r.Initialize("3de57cc21a364c9c918d8899d0aee6bf",{shouldModifyUrlWithStoryId:!1}),r.addDelegateListener(r.Delegations.onEventTriggered,n.hT),a(r),l(e=>!e)};return document.addEventListener("onBlazeSDKConnect",i),!e&&t&&i(),()=>{document.removeEventListener("onBlazeSDKConnect",i)}},[])}},25725:(e,t,s)=>{var i=s(81648),n=s(78492),r=s(68988),a=s(91544);e.exports=function(e,t){return function(s,l){var o=a(s)?i:n,d=t?t():{};return o(s,e,r(l,2),d)}}},26567:(e,t,s)=>{"use strict";s.d(t,{d:()=>k});var i=s(6029),n=s(46787),r=s(51569),a=s(20325),l=s(55729),o=s(947),d=s(494),c=s(45860),u=s(46222),g=s(18970),h=s(6813),x=s(79634),p=s(99121),m=s(98133),y=s(79082),j=s(32523),f=s(22375),v=s(52466),b=s(16503),S=s(95084);let C=e=>{let{count:t,isPositive:s}=e,n=s?v.URl:v.fHS;return(0,i.jsxs)(a.so,{border:"1px solid {colors.neutrals.nLv4}",align:"center",p:"xs",h:"xl",br:"xs",gap:"xs",children:[(0,i.jsx)(n,{width:16,height:16,color:s?"status.success.default":"status.error.default"}),(0,i.jsx)(a.az,{textStyle:"assistive.default",color:"neutrals.nLv3",children:t})]})},w=e=>{let{channel:t}=e;return(0,i.jsx)(a.az,{textStyle:"display.small",color:t.link?"primary.default":"neutrals.nLv1",truncate:!0,children:t.name})},_=e=>{let{channel:t}=e,s=(0,b.e)(()=>(0,S.ke)({action:"impression",location:"event_details",type:"banner_channel_".concat(t.id)}),{delay:500,sendInterval:30*f.Z2});return t.link?(0,i.jsx)(r.Mz,{href:t.link,target:"_blank",rel:"noopener",overflow:"hidden",onClick:()=>{(0,S.ke)({action:"click",location:"event_details",type:"banner_channel_".concat(t.id)})},children:(0,i.jsxs)(a.so,{ref:s,align:"center",gap:"xs",children:[(0,i.jsx)(w,{channel:t}),(0,i.jsx)(a.az,{h:"lg",w:"lg",children:(0,i.jsx)(v.HW5,{color:"primary.default"})})]})}):(0,i.jsx)(w,{channel:t})};function T(e){let{channelId:t,type:s,eventId:r}=e,{data:l}=(0,c.Ay)(n.RMf.eventChannelVotes(t,s,r));return l?(0,i.jsxs)(a.so,{px:"lg",py:"sm",align:"center",justify:"space-between",gap:"xs",children:[(0,i.jsxs)(a.so,{grow:1,align:"center",overflow:"hidden",gap:"sm",children:[(0,i.jsx)(a.az,{w:"xl",h:"xl",children:(0,i.jsx)(v.oIR,{w:24,h:24,color:"neutrals.nLv1"})}),(0,i.jsx)(_,{channel:l.tvChannelVotes.tvChannel})]}),(0,i.jsxs)(a.so,{w:"fit",align:"center",justify:"flex-end",gap:"sm",children:[(0,i.jsx)(C,{count:l.tvChannelVotes.upvote||0,isPositive:!0}),(0,i.jsx)(C,{count:l.tvChannelVotes.downvote||0})]})]}):(0,i.jsx)(j.E,{uniqueKey:"tv-channel-cl",my:"sm",height:24,br:"xs",animate:!0})}var E=s(11219);let M=(e,t)=>(null==e?void 0:e.alpha2)?(0,i.jsxs)(a.so,{align:"center",gap:"lg",children:[(0,i.jsx)("img",{style:{verticalAlign:"top"},src:(0,n.RHm)(e.alpha2),width:24,height:24,alt:e.name},e.alpha2),!t&&(0,i.jsx)(r.EY,{textTransform:"capitalize",children:e.name.replace("-"," ")})]}):null;function k(e){var t,s,j;let{eventId:f,type:v,startTimestamp:b}=e,S=(0,o.A)(),{event:C}=(0,l.useContext)(g.y$),w=(0,d.d4)(e=>{let{locale:t}=e;return t.geoIPAlpha2}),[_,k]=(0,l.useState)(w),{data:I,isLoading:A}=(0,c.Ay)(n.RMf.eventCountryChannels(v,f)),D=(0,l.useMemo)(()=>(null==I?void 0:I.countryChannels)?Object.keys(null==I?void 0:I.countryChannels).map(e=>({alpha2:e,name:S.formatMessage({id:(0,m.K_)(e)})})).sort((e,t)=>e.name>t.name?1:-1):[],[null==I?void 0:I.countryChannels]);if((0,l.useEffect)(()=>{k(w)},[w]),!(null==I?void 0:I.countryChannels)&&!A||void 0===b||!(e=>{let t=Date.now()/1e3;return e-604800t})(b))return null;let P=_&&!!(null==I||null==(t=I.countryChannels[_])?void 0:t.length),z=null==C||null==(j=C.tournament)||null==(s=j.uniqueTournament)?void 0:s.id;return(0,i.jsx)(x.q,{persist:!0,children:(0,i.jsxs)(u.Zp,{children:[(0,i.jsx)(u.Zp.Header,{titleId:"tv_channels",variant:"left-aligned",actionComponent:w&&(0,i.jsx)(r.ms,{label:"Select country in tv channels",items:D,renderItem:M,initialSelectedItem:{alpha2:w,name:S.formatMessage({id:(0,m.K_)(w)})},onSelectedItemChange:e=>{var t;return k(null==(t=e.selectedItem)?void 0:t.alpha2)},alignRight:!0})}),(0,i.jsx)(a.az,{py:"sm",children:P?I.countryChannels[_].map(e=>(0,i.jsx)(T,{type:v,channelId:e,eventId:f},e)):(0,i.jsx)(h.p,{graphic:"no-tv-events",descriptionMessageId:"tv_channels_no_votes"})}),(0,i.jsx)(E.N_,{routeKey:"tvSchedule",hash:(0,y.HL)({tab:p.p5.Tournaments,highlightedTournamentId:null==z?void 0:z.toString()}),children:(0,i.jsx)(u.Zp.Footer,{ctaParams:{messageId:"full_tv_schedule",icon:u.Xb.Right}})})]})})}},27869:(e,t,s)=>{e.exports=s(14165)({"&":"&","<":"<",">":">",""":'"',"'":"'"})},30821:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d,i:()=>l.i});var i=s(6029),n=s(90510),r=s(494),a=s(77264),l=s(13988),o=s(63752);function d(e){let{value:t,fromUnit:s}=e,d=(0,r.d4)(o.Y);if(!t)return null;if((0,a.C)(t,s).to("m")>=1e3)return(0,i.jsx)(c,{value:t,fromUnit:s});if(d===l.i.Imperial){let e=function(e,t){let s=(0,a.C)(e,t).to("feet"),i=Math.floor(s),n=Math.round((0,a.C)(s-Math.floor(s),"ft").to("in"));return 12===n&&(i+=1,n=0),{ft:i,in:n}}(t,s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.Gr,{value:e.ft,style:"unit",unit:"foot",unitDisplay:"narrow"}),"\xa0",(0,i.jsx)(n.Gr,{value:e.in,style:"unit",unit:"inch",unitDisplay:"narrow"})]})}return(0,i.jsx)(n.Gr,{value:(0,a.C)(t,s).to("cm"),style:"unit",unit:"centimeter",unitDisplay:"short"})}function c(e){let{value:t,fromUnit:s}=e,d=(0,r.d4)(o.Y);return t?d===l.i.Imperial?(0,i.jsx)(n.Gr,{value:(0,a.C)(t,s).to("mile"),style:"unit",unit:"mile",maximumFractionDigits:1,unitDisplay:"short"}):(0,i.jsx)(n.Gr,{value:(0,a.C)(t,s).to("km"),style:"unit",unit:"kilometer",maximumFractionDigits:1,unitDisplay:"short"}):null}},33140:(e,t,s)=>{"use strict";s.d(t,{d:()=>o});var i=s(6029),n=s(51569),r=s(20325),a=s(90248),l=s(52466);let o=e=>{let{isOpen:t,onClick:s,style:o}=e;return(0,i.jsx)(r.so,{align:"center",justify:"center",p:"lg",style:o,children:(0,i.jsx)(r.I4.button,{onClick:s,padding:"0",cursor:"pointer",children:(0,i.jsxs)(r.so,{align:"center",children:[(0,i.jsx)(n.EY,{textStyle:"display.small",color:"primary.default",children:(0,i.jsx)(a.A,{id:t?"show_less":"show_more"})}),t?(0,i.jsx)(l.t8v,{color:"primary.default",ml:"xs"}):(0,i.jsx)(l.QtO,{color:"primary.default",ml:"xs"})]})})})}},39975:(e,t,s)=>{"use strict";s.d(t,{A:()=>o,q:()=>l});var i=s(6029),n=s(94565),r=s(55729),a=s(43072);let l=e=>{let{initialVisible:t=!1,defaultHeight:s=0,visibleOffset:l=1e3,persist:o=!1,loader:d,children:c,...u}=e,g={initialInView:t,rootMargin:"".concat(l,"px 0px ").concat(l,"px 0px")},[h,x,p]=(0,a.Wx)(g),m=(0,r.useRef)(t),y=(0,r.useRef)(s);(0,r.useEffect)(()=>{x&&!0!==m.current&&(m.current=!0),x&&y.current!==s&&(y.current=(null==p?void 0:p.boundingClientRect.height)||s)},[x,p]);let j=d||(y.current?(0,i.jsx)(n.az,{h:y.current}):null),f=x||o&&m.current;return(0,i.jsx)(n.az,{ref:h,...u,children:f?c:j})},o=l},40598:(e,t,s)=>{"use strict";s.d(t,{F:()=>d});var i=s(6029),n=s(51569),r=s(20325),a=s(55729),l=s(69352),o=s(46222);let d=Object.assign(e=>{let{activeIndex:t,setActiveIndex:s,children:d,showControls:c=!0,autoScrollDelay:u,transitionDuration:g="normal",asCard:h=!1}=e,{textDirection:x}=(0,n.$c)(),p=a.Children.toArray(d),m=p.length,y=(0,a.useRef)(null),j=()=>{s(t{v(),u&&m>1&&(y.current=setTimeout(()=>{j()},u))};(0,a.useEffect)(()=>(f(),()=>{y.current&&clearTimeout(y.current)}),[t,u,m]),(0,a.useEffect)(()=>{void 0===u?v():f()},[u]);let v=()=>{y.current&&clearTimeout(y.current)};return 0===m?null:(0,i.jsxs)(r.az,{onMouseEnter:u?v:void 0,onMouseLeave:u?f:void 0,children:[(0,i.jsx)(o.Zp,{variant:h?void 0:"never",children:(0,i.jsx)(r.az,{position:"relative",overflow:"hidden",w:"100%",boxSizing:"content-box",children:(0,i.jsx)(r.so,{w:"100%",gap:"lg",transitionProperty:"transform",transitionDuration:g,transitionTimingFunction:"ease-in-out",style:{transform:"rtl"===x?"translateX(calc(".concat(100*t,"% + ").concat(16*t,"px))"):"translateX(calc(-".concat(100*t,"% - ").concat(16*t,"px))")},children:p})})}),c&&(0,i.jsx)(l.M,{activeIndex:t,setActiveIndex:s,goToNext:j,goToPrevious:()=>{s(t>0?t-1:m-1),v()},slideCount:m,onPageClick:v})]})},{Slide:e=>{let{children:t}=e;return(0,i.jsx)(r.az,{w:"100%",minW:"100%",flexShrink:"0",children:t})}})},41397:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var i=s(95700);function n(e,t,s,n){let r=(0,i.A)(n);if(!(e&&void 0!==t&&void 0!==s))return[];let[a,l]=[e[t],e[s]];return r?[l,a]:[a,l]}},45021:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/stageSport",function(){return s(50920)}])},45906:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var i=s(6029),n=s(14092),r=s(51569),a=s(20325),l=s(95669),o=s.n(l),d=s(81278),c=s(947),u=s(90248),g=s(52466),h=s(6813),x=s(25246),p=s(20945),m=s(11219),y=s(27214);function j(e){let{statusCode:t}=e;n.O({statusCode:t});let s=(0,c.A)(),{route:l}=(0,d.useRouter)(),j=s.formatMessage({id:404===t?"error.pageNotFound":"error.anErrorOccurred"});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(o(),{children:[(0,i.jsx)("title",{children:"".concat(t," | ").concat(j||"")}),(0,i.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,i.jsx)("div",{id:"errorPage",children:(0,i.jsx)(x.YW,{children:(0,i.jsx)(p.xA,{children:(0,i.jsx)(p.fv,{flexGrow:1,textAlign:"center",my:"2xl",children:(0,i.jsx)(h.p,{graphic:"no-connection",children:(0,i.jsxs)(a.BJ,{children:[(0,i.jsx)(r.H1,{textStyle:"display.extraLarge",color:"neutrals.nLv3",alignSelf:"center",mt:"[28px]",mb:"2xs",children:t}),(0,i.jsx)(r.H3,{display:"block",textStyle:"display.medium",color:"neutrals.nLv3",alignSelf:"center",children:(0,i.jsx)(u.A,{id:"error.anErrorOccurred"})}),(0,i.jsx)(r.EY,{alignSelf:"center",mb:"2xl",display:"block",children:404===t?(0,i.jsx)(u.A,{id:"error.pageCannotBeFound"}):(0,i.jsx)(u.A,{id:"error.somethingWrongWithPage"})}),(0,i.jsx)(m.N_,{routeKey:(0,y.N5)(l)?"news":"home",children:(0,i.jsxs)(r.$n,{children:[(0,i.jsx)(g.pa2,{})," ",(0,i.jsx)(u.A,{id:"error.backToSofascore"})]})})]})})})})})})]})}j.getInitialProps=async e=>{await n.O(e);let{res:t,err:s}=e;return{statusCode:t?t.statusCode:s?s.statusCode:null}}},48253:(e,t,s)=>{"use strict";s.d(t,{m:()=>d});var i=s(6029),n=s(51569),r=s(20325),a=s(88354),l=s(90248);let o=(0,a.m)(r.az),d=()=>(0,i.jsxs)(r.so,{justify:"space-between",align:"center",w:"4xl",h:"lg",pl:"sm",pr:"xs",br:"sm",bg:"surface.s1",position:"absolute",top:"sm",right:"sm",children:[(0,i.jsx)(n.EY,{textStyle:"assistive.default",color:"status.live",lineHeight:1,children:(0,i.jsx)(l.A,{id:"live"})}),(0,i.jsx)(o,{w:"md",h:"md",br:"md",border:"1px solid {colors.status.live}",position:"absolute",right:"2xs",animate:{opacity:[0,1,0],scale:[.1,.7,1.2]},transition:{type:"tween",duration:1,repeat:1/0,ease:"easeOut"}}),(0,i.jsx)(r.az,{w:"sm",h:"sm",br:"sm",ml:"xs",bg:"status.live"})]})},50920:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>iv});var i=s(6029),n=s(46787),r=s(88715),a=s(97825),l=s(7763),o=s(18153),d=function(e){return e.Categories="categories",e.UniqueStage="uniqueStage",e.EventStage="eventStage",e}({}),c=s(45860);let u={[d.Categories]:"stageSport",[d.UniqueStage]:"stageSport.uniqueStage",[d.EventStage]:"stageSport.race"};async function g(){let e,t,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.QCR.Cycling,i=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;try{if(i.raceId){var a,l;t=null!=(l=null==(a=(e=(await n.hyA.fetchExtendedStage(Number(i.raceId))).stage).uniqueStage)?void 0:a.id)?l:n.Q_.Men}else t=i.uniqueStageId?Number(i.uniqueStageId):n.Q_.Men;let o=(await n.ARL.fetchUniqueStageSeasons(t)).seasons,d=o[0].id,c=(await n.hyA.fetchExtendedStage(d)).stage;return{stageSeasons:o,extendedStage:c,race:e,page:r,params:i,sportSlug:s}}catch(e){return{error:{code:404}}}}var h=s(56737);async function x(e,t,s,i){let r;try{if(i===d.Categories){let t=(await n.Tps.fetchSportCategories(s)).categories.sort((e,t)=>(t.priority||0)-(e.priority||0));for(let s=0;sasync t=>{var i;let l=t.req?t.req._originalUrl:t.asPath,c=(null==(i=t.req)?void 0:i.params)||t.query,h=r.z.getCurrentLocale(l),p=r.z.getSportKey(c.sport,h),m=c.uniqueStageId?d.UniqueStage:c.raceId?d.EventStage:d.Categories,y=(await s(23498)("./route.".concat(u[m],".json"))).default;return(e.dispatch((0,a.Od)(y)),e.dispatch((0,o.Vy)(p)),p===n.QCR.Cycling)?g(p,c,m):x(c.uniqueStageId?Number(c.uniqueStageId):0,c.raceId?Number(c.raceId):0,p,m)});var m=s(20325),y=s(95669),j=s.n(y),f=s(55729),v=s(947),b=s(90248),S=s(88658),C=s(18970),w=s(90438),_=s(94164),T=s(52763),E=s(25246),M=s(36882),k=s(70251),I=s(31830),A=s(11219),D=s(4917),P=s(51569),z=s(18858),L=s(52466),R=s(60235),q=s(65062),F=s(74664);let U=(0,f.createContext)(void 0),K=e=>{let{children:t}=e,[s,n]=(0,f.useState)(new Date);return(0,i.jsx)(U,{value:{selectedDate:s,onSelectedDateChange:e=>n(e)},children:t})},W=()=>{let e=(0,f.useContext)(U);if(!e)throw Error();return e},O=e=>{let{opened:t,onClose:s}=e,n=(0,F.o)(),r=(0,R.hX)(),{isMobile:a}=(0,P.$c)(),{selectedDate:l,onSelectedDateChange:o}=W(),d=e=>{o(e),s()};return!t||r?null:a?(0,i.jsx)(P.Xn,{isOpen:t,onClose:s,size:"contentFit",children:(0,i.jsx)(q.A,{date:l,onChange:d,sport:n})}):(0,i.jsxs)(m.az,{position:"absolute",left:"[0px]",top:"[0px]",bg:"surface.s1",br:"lg",elevation:"3",overflow:"hidden",zIndex:"popover",children:[(0,i.jsx)(m.so,{justify:"flex-end",p:"sm",cursor:"pointer",onClick:s,children:(0,i.jsx)(L.zQC,{icon:"close",color:"primary.default"})}),(0,i.jsx)(q.A,{date:l,onChange:d,sport:n})]})},B=()=>{let{locale:e}=(0,v.A)(),{selectedDate:t}=W(),[s,n]=(0,f.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.az,{flexGrow:1,children:(0,i.jsxs)(P.$n,{bg:"surface.s2",w:"100%",h:"[40px]",display:"inline-flex",justifyContent:"center",alignItems:"center",br:"xs",gap:"sm",onClick:()=>n(!0),children:[(0,i.jsx)(m.az,{display:{mdOnly:"none"},children:(0,i.jsx)(L.zQC,{icon:"calendar-empty",color:"primary.default"})}),(0,i.jsx)(P.EY,{textStyle:"display.small",textTransform:"capitalize",lineHeight:1,children:((e,t)=>{let s=e.getDay(),i=new Date(e);i.setDate(e.getDate()-(s-2+7)%7);let n=new Date(i);n.setDate(i.getDate()+6);let r=e=>"".concat(e.getDate()," ").concat(e.toLocaleString(t,{month:"short"}));return"".concat(r(i)," - ").concat(r(n))})(t,e)})]})}),(0,i.jsx)(O,{opened:s,onClose:()=>n(!1)})]})},Y=e=>{let{type:t}=e,{selectedDate:s,onSelectedDateChange:n}=W(),r="prev"===t?L.pa2:L.CCT;return(0,i.jsx)(P.K0,{bg:"surface.s2",w:"[40px]",h:"[40px]",onClick:()=>{let e=new Date(s);e.setDate(e.getDate()+("prev"===t?-7:7)),n(e)},children:(0,i.jsx)(r,{color:"primary.default"})})},Q=()=>{let e=(0,z.Ay)({isInMobileTabs:!1});return(0,i.jsxs)(m.so,{justify:"space-between",p:"xs",bg:"surface.s1",gap:"xs",position:{mdDown:"sticky"},zIndex:"sticky",style:{top:e},children:[(0,i.jsx)(Y,{type:"prev"}),(0,i.jsx)(B,{}),(0,i.jsx)(Y,{type:"next"})]})};var N=s(93640),J=s(8329),H=s(94156);let V=e=>{let{uniqueStage:t,categoryId:s}=e,n=(0,F.o)();return(0,i.jsx)(A.So,{uniqueStage:t,sportSlug:n,children:(0,i.jsx)(m.so,{align:"center",px:"md",grow:1,py:"md",children:(0,i.jsxs)(m.so,{gap:"lg",align:"center",w:"100%",children:[(0,i.jsx)(J.w,{name:t.name,categoryId:s,size:24}),(0,i.jsx)(P.EY,{textStyle:"body.large",truncate:!0,children:(0,i.jsx)(H.c,{entity:t})})]})})})};var G=s(16480);let $=e=>{let{stages:t,categoryId:s}=e;return t?(0,i.jsx)(i.Fragment,{children:t.map(e=>(0,i.jsx)(G.b,{stage:e,categoryId:s},e.id))}):null},Z=e=>{let{uniqueStage:t,stages:s,isLast:n,categoryId:r}=e,{selectedUniqueStageId:a}=(0,N.F)();return(0,i.jsxs)(m.az,{borderBottom:{md:n?void 0:"1px solid {colors.neutrals.nLv4}"},bg:{base:"surface.s1",md:a===t.id?"neutral.highlight":"surface.s1",_hover:"surface.s0"},br:{mdDown:"sm"},elevation:{mdDown:"2"},children:[(0,i.jsx)(V,{uniqueStage:t,categoryId:r}),(0,i.jsx)($,{stages:s,categoryId:r})]})};var X=s(80577);let ee=e=>{let{uniqueStages:t,stagesPerWeek:s,uniqueStagesWithCategoryId:n}=e;return(0,i.jsx)(m.az,{p:{mdDown:"sm"},bg:"surface.s2",children:(0,i.jsx)(m.BJ,{gap:{mdDown:"sm"},children:t.map((e,r)=>(0,i.jsx)(Z,{uniqueStage:e,stages:(0,X.NW)(e,s),categoryId:null==n?void 0:n[e.id],isLast:t.length-1===r},e.id))})})},et=()=>(0,F.o)()===n.QCR.Motorsport?(0,i.jsx)(m.az,{h:"[800px]",bg:{base:"surface.s0",md:"surface.s1"}}):(0,i.jsx)(m.az,{h:"[100px]",bg:{base:"surface.s0",md:"surface.s1"}});var es=s(22375),ei=s(494),en=s(72753);let er=()=>{let{uniqueStages:e,stagesPerWeek:t,uniqueStagesWithCategoryId:s,stagesFavorite:r,error:a,loading:l}=(()=>{var e,t,s;let i=(0,F.o)(),r=(0,ei.d4)(en.JU),{selectedDate:a}=W(),l=(0,c.Ay)(n.t3g.categories(i)),o=(0,c.Ay)(n.dVR.scheduledStages(i,(0,es.UG)((0,X.IQ)(a)))),d=((null==(e=l.data)?void 0:e.categories)||[]).reduce((e,t)=>t.uniqueStages?e.concat(t.uniqueStages.map(e=>({...e,priority:t.priority||0}))):e,[]),u=null==(t=l.data)?void 0:t.categories.reduce((e,t)=>(t.uniqueStages&&t.uniqueStages.forEach(s=>{e[s.id]=t.id}),e),{});return{uniqueStages:d,stagesPerWeek:[...function(e,t){let s=new Date((0,X.IQ)(e));s.setHours(0,0,0,0);let i=new Date((0,X.CP)(e));i.setHours(23,59,59,999);let n=s.getTime(),r=i.getTime();return t.filter(e=>{let t=e.substageStartDateTimestamps;return!!t&&t.some(e=>{let t=1e3*e;return t>=n&&t<=r})})}(a,(null==(s=o.data)?void 0:s.stages)||[])],stagesFavorite:Object.values(r),uniqueStagesWithCategoryId:u,error:l.error||o.error,loading:l.isLoading||o.isLoading}})();return l?(0,i.jsx)(et,{}):!e.length||a?null:(0,i.jsx)(ee,{uniqueStages:(0,X.Hk)(e,t,r),uniqueStagesWithCategoryId:s,stagesPerWeek:t})},ea=()=>(0,i.jsx)(K,{children:(0,i.jsxs)(m.az,{position:"relative",bg:"surface.s1",py:{md:"md"},br:{md:"lg"},elevation:{md:"2"},w:"100%",children:[(0,i.jsx)(P.EY,{textAlign:"center",textStyle:"display.medium",pb:"sm",display:{base:"none",md:"block"},children:(0,i.jsx)(b.A,{id:"tournament.series"})}),(0,i.jsx)(Q,{}),(0,i.jsx)(er,{})]})});var el=s(46222),eo=s(52229),ed=s(32033),ec=s(62304);let eu=()=>{var e;let{stage:t}=(0,ed.a)(),s=(0,eo.useRouter)(),r=(0,F.o)();return(0,i.jsxs)(m.so,{bg:{mdDown:"surface.s1"},px:"lg",pt:"md",pb:"sm",cursor:"pointer",gap:"md",align:"center",children:[(0,i.jsx)(A.LC,{stage:t,sportSlug:r,children:(0,i.jsx)(ec.Q,{stage:t,size:40})}),(0,i.jsxs)(m.BJ,{flexGrow:1,gap:"2xs",children:[(0,i.jsx)(A.LC,{stage:t,sportSlug:r,children:(0,i.jsx)(P.EY,{textStyle:"display.medium",children:t.description})}),(0,i.jsxs)(m.so,{gap:"xs",align:"center",children:[(null==(e=t.info)?void 0:e.circuit)&&(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:t.info.circuit}),r===n.QCR.Cycling&&(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:t.year})]})]}),r===n.QCR.Cycling?(0,i.jsx)(k.x,{id:t.id,uniqueStage:t.uniqueStage,location:M.y.RacesTab}):(0,i.jsx)(P.K0,{hideBelow:"md",size:"primary",variant:"clear",onClick:()=>s.back(),children:(0,i.jsx)(L.zQC,{icon:"close"})})]})};var eg=s(78762),eh=s(8041),ex=s(61628),ep=s(56132),em=s(95084),ey=s(30821);let ej=()=>{let{stage:{info:e}}=(0,ed.a)();return e?(0,i.jsx)(el.Zp,{children:(0,i.jsxs)(m.BJ,{gap:"lg",p:"md",children:[(null==e?void 0:e.circuitCity)&&(0,i.jsxs)(m.zt,{justify:"space-between",children:[(0,i.jsx)(P.EY,{children:(0,i.jsx)(b.A,{id:"city"})}),(0,i.jsx)(P.EY,{children:e.circuitCity})]}),(null==e?void 0:e.laps)&&(0,i.jsxs)(m.zt,{justify:"space-between",children:[(0,i.jsx)(P.EY,{children:(0,i.jsx)(b.A,{id:"laps"})}),(0,i.jsx)(P.EY,{children:e.laps})]}),(null==e?void 0:e.circuitLength)&&(0,i.jsxs)(m.zt,{justify:"space-between",children:[(0,i.jsx)(P.EY,{children:(0,i.jsx)(b.A,{id:"circuitLength"})}),(0,i.jsx)(P.EY,{children:(0,i.jsx)(ey.Z,{value:Number(e.circuitLength),fromUnit:"m"})})]}),(null==e?void 0:e.raceDistance)&&(0,i.jsxs)(m.zt,{justify:"space-between",children:[(0,i.jsx)(P.EY,{children:(0,i.jsx)(b.A,{id:"raceDistance"})}),(0,i.jsx)(P.EY,{children:(0,i.jsx)(ey.Z,{value:Number(e.raceDistance),fromUnit:"m"})})]}),(null==e?void 0:e.lapRecord)&&(0,i.jsxs)(m.zt,{justify:"space-between",children:[(0,i.jsx)(P.EY,{children:(0,i.jsx)(b.A,{id:"lapRecord"})}),(0,i.jsx)(P.EY,{children:e.lapRecord})]})]})}):null};var ef=s(41735),ev=s(11996);let eb=()=>{var e,t,s,r;let{name:a}=(0,ef.useTheme)(),{stage:l}=(0,ed.a)(),{hasStageMap:o}=(0,ev.A)({hasStageMap:{route:n.dVR.trackImage(l.id,"dark"===a)}},[l]);return(0,i.jsx)(el.Zp,{children:(0,i.jsxs)(m.BJ,{p:"md",children:[(0,i.jsxs)(m.so,{align:"center",justify:"space-between",gap:"md",children:[(0,i.jsxs)(m.zt,{children:[(0,i.jsx)(m.az,{w:"3xl",h:"3xl",display:{md:"none"},children:(0,i.jsx)(ec.Q,{stage:l,size:40})}),(null==(e=l.info)?void 0:e.circuit)&&(0,i.jsx)(P.EY,{textStyle:"display.small",lineHeight:1,children:l.info.circuit})]}),(null==(t=l.info)?void 0:t.weather)&&(0,i.jsx)(m.az,{w:"4xl",h:"4xl",children:(0,i.jsx)(L.qgJ,{weather:l.info.weather})})]}),o&&(0,i.jsx)(m.ov,{children:(0,i.jsx)(P._V,{w:"100%",maxW:"[345px]",h:"auto",d:"block",src:n.dVR.trackImage(l.id,"dark"===a),alt:null!=(r=null==(s=l.info)?void 0:s.circuit)?r:""})})]})})};var eS=s(26567);let eC=()=>{let{stage:e}=(0,ed.a)(),{hasTvChannels:t}=(0,ev.A)({hasTvChannels:{route:n.RMf.eventCountryChannels(n.IAy.Stage,e.id)}});return t?(0,i.jsx)(eS.d,{eventId:e.id,type:n.IAy.Stage,startTimestamp:e.startDateTimestamp}):null},ew=()=>(0,i.jsxs)(el.BU,{children:[(0,i.jsx)(eb,{}),(0,i.jsx)(ej,{}),(0,i.jsx)(eC,{})]});var e_=s(6813),eT=s(173),eE=s(5635),eM=s(53148),ek=s(64046),eI=s(8785),eA=s(78151),eD=s(60376),eP=s(99012),ez=s(70941);let eL=e=>{let{market:t,choice:s,countryOddsProvider:n,onClick:r}=e;return(0,i.jsxs)(m.so,{align:"center",children:[(0,i.jsx)(m.az,{flex:"[1 1 0px]",children:(0,i.jsx)(eD.i,{choice:s})}),(0,i.jsx)(m.az,{flex:"[1 1 0px]",children:(0,i.jsx)(eM.i,{hideChoiceName:!0,choice:{...s,change:(0,ez.zN)(s)},countryOddsProvider:n,betSlipLink:(0,eI.Iz)(s,t,n),isLive:t.isLive,onClick:r})})]})},eR=e=>{let{market:t,countryOddsProvider:s,allItemsShown:n,selectedStageType:r}=e,{stage:a}=(0,ed.a)(),{ref:l,onSendClickImpression:o}=(0,eP.A)({stageId:a.id,category:eA.zK[r],location:eA.ew.StageOdds,position:ek.ki.OddsValue,type:ek.jF.Additional,status:a.status.type}),d=(0,ez.JJ)(t.choices,n);return(0,i.jsx)(m.BJ,{ref:l,children:d.map(e=>(0,i.jsx)(eL,{market:t,choice:e,countryOddsProvider:s,onClick:o},e.team.id))})};var eq=s(54804),eF=s(63464),eU=s(92589),eK=s(20725);let eW=e=>{let{market:t,countryOddsProvider:s}=e,[r,a]=(0,f.useState)(!1);return(0,i.jsxs)(m.BJ,{children:[t.stage&&(0,i.jsx)(P.EY,{textStyle:"display.small",children:(0,i.jsx)(eF.T,{market:t,stage:t.stage})}),(0,i.jsx)(eR,{market:{...t,choices:r?t.choices:t.choices.slice(0,5)},countryOddsProvider:s,allItemsShown:!0,selectedStageType:n.CEM.Stage}),(0,i.jsx)(eE.r,{isOpen:r,onClick:()=>a(e=>!e)})]},t.marketId)},eO=e=>{let{markets:t}=e,{stage:s}=(0,ed.a)(),{countryOddsProvider:r}=(0,eK.D)();return r?(0,i.jsx)(m.az,{p:"sm",mdDown:{elevation:"2",bg:"surface.s0"},children:(0,i.jsxs)(m.BJ,{bg:"surface.s1",gap:"md",mdDown:{elevation:"2",padding:"md",br:"md"},children:[(0,i.jsx)(eq.E,{stageId:s.id,stageTypeId:n.CEM.Stage,location:eA.ew.StageOdds}),(0,i.jsx)(m.BJ,{gap:"2xl",children:t.filter(e=>!e.isLive).map(e=>(0,i.jsx)(eW,{market:e,countryOddsProvider:r},e.marketId))}),(0,i.jsx)(eT.z,{provider:r,showTailingRegulation:!0})]})}):null},eB=()=>{let{stage:e}=(0,ed.a)(),{data:t,isLoading:s,error:n}=(0,eU.r)(e.id);return s?(0,i.jsx)(m.az,{h:"[900px]"}):n||!t?(0,i.jsx)(e_.p,{graphic:"no-data",titleMessageId:"No odds"}):(0,i.jsx)(eO,{markets:t})};var eY=s(68789),eQ=s(81495);let eN=()=>{let{stage:e}=(0,ed.a)(),{data:t,error:s,isLoading:i}=(0,c.Ay)(["STAGE_SPORT_FETCH_ALL_STAGES",n.dVR.substages(e.id)],()=>eJ(e),{refreshInterval:es.pY});return{data:t,error:s,loading:i}};async function eJ(e){if(!e.uniqueStage)throw Error("Please provide unique stage id");try{var t,s;let i=await (0,n.TtD)(n.dVR.substages(e.id));if([eQ.h.CyclingMen,eQ.h.CyclingWomen].includes(e.uniqueStage.id))return{practice:[],qualifying:[],sprint:[],race:i.stages,stages:[],afterStage:[],dayStage:[]};let r=i.stages.map(e=>{var t;return(null==(t=e.uniqueStage)?void 0:t.id)===eQ.h.MotoGP&&"sprint"===e.slug?{...e,type:{id:n.CEM.Sprint,name:"Sprint"}}:e}),a=r.filter(e=>e.type.id===n.CEM.Practice),l=r.find(e=>e.type.id===n.CEM.Qualifying),o=r.find(e=>e.type.id===n.CEM.SprintQualifying),d=r.find(e=>e.type.id===n.CEM.Sprint),c=r.filter(e=>e.type.id===n.CEM.Race),u=r.filter(e=>e.type.id===n.CEM.Stage),g=r.find(e=>e.type.id===n.CEM.AfterStage),h=r.find(e=>e.type.id===n.CEM.Day),[x,p]=await Promise.all([eH(l),eH(o)]);return{practice:a,qualifying:(t=e,s=eV(x,[l]),t.uniqueStage&&t.uniqueStage.id===eQ.h.MotoGP?s.filter(e=>e.type.id!==n.CEM.Qualifying):s),sprint:eV(p,[o,d]),race:c,stages:u,afterStage:g?[g]:[],dayStage:h?[h]:[]}}catch(t){return{practice:[],qualifying:[],sprint:[],race:[e],stages:[],afterStage:[],dayStage:[]}}}async function eH(e){if(!e)return{stages:[]};try{return await (0,n.TtD)(n.dVR.substages(e.id))}catch(e){return{stages:[]}}}function eV(e,t){return[...e.stages,...t].filter(e=>void 0!==e)}var eG=s(97340);let e$=()=>(0,i.jsx)(m.so,{w:"100%",border:"1px solid",borderColor:"neutrals.nLv4",br:"xs",align:"center",justify:"center",children:"-"}),eZ=e=>{let{market:t,choices:s,countryOddsProvider:n,onClick:r}=e,a=s.find(e=>"Yes"===e.name),l=s.find(e=>"No"===e.name);return(0,i.jsxs)(m.so,{flex:"[1 1 0px]",gap:"sm",children:[a?(0,i.jsx)(m.so,{flex:"1",children:(0,i.jsx)(eM.i,{hideChoiceName:!0,choice:{...a,change:(0,ez.zN)(a)},countryOddsProvider:n,betSlipLink:(0,eI.Iz)(a,t,n),isLive:t.isLive,onClick:r})}):(0,i.jsx)(m.so,{flex:"1",children:(0,i.jsx)(e$,{})}),l?(0,i.jsx)(m.so,{flex:"1",children:(0,i.jsx)(eM.i,{hideChoiceName:!0,choice:{...l,change:(0,ez.zN)(l)},countryOddsProvider:n,betSlipLink:(0,eI.Iz)(l,t,n),isLive:t.isLive,onClick:r})}):(0,i.jsx)(m.so,{flex:"1",children:(0,i.jsx)(e$,{})})]})},eX=e=>{let{market:t,countryOddsProvider:s,allItemsShown:n,selectedStageType:r}=e,{stage:a}=(0,ed.a)(),{ref:l,onSendClickImpression:o}=(0,eP.A)({stageId:a.id,category:eA.zK[r],location:eA.ew.StageOdds,position:ek.ki.OddsValue,type:ek.jF.Additional,status:a.status.type}),d=function(e){let t=[];for(let s of[...new Set(e.choices.map(e=>e.team.id))]){let i=e.choices.filter(e=>e.team.id===s);t.push({teamId:s,choices:i})}return t}(t),c=(0,ez.JJ)(d,n);return(0,i.jsxs)(m.BJ,{ref:l,children:[(0,i.jsxs)(m.so,{children:[(0,i.jsx)(m.az,{flex:"[1 1 0px]"}),(0,i.jsxs)(m.so,{flex:"[1 1 0px]",gap:"sm",children:[(0,i.jsx)(m.az,{flex:"[1 1 0px]",textAlign:"center",color:"neutrals.nLv3",children:(0,i.jsx)(P.EY,{textStyle:"assistive.default",children:(0,i.jsx)(b.A,{id:"yes"})})}),(0,i.jsx)(m.az,{flex:"[1 1 0px]",textAlign:"center",color:"neutrals.nLv3",children:(0,i.jsx)(P.EY,{textStyle:"assistive.default",children:(0,i.jsx)(b.A,{id:"no"})})})]})]}),c.map(e=>(0,i.jsxs)(m.so,{align:"center",children:[(0,i.jsx)(m.az,{flex:"[1 1 0px]",children:(0,i.jsx)(eD.i,{choice:e.choices[0]})}),(0,i.jsx)(eZ,{market:t,countryOddsProvider:s,choices:e.choices,onClick:o})]},e.teamId))]})},e0=e=>{let{market:t,countryOddsProvider:s,allItemsShown:n,selectedStageType:r}=e;switch(eA.ot[t.marketId]){case eA.tz.YesNo:return(0,i.jsx)(eX,{market:t,countryOddsProvider:s,allItemsShown:n,selectedStageType:r});case eA.tz.SingleChoice:return(0,i.jsx)(eR,{market:t,countryOddsProvider:s,allItemsShown:n,selectedStageType:r});default:return null}},e1=e=>{let{market:t,selectedStageType:s}=e,[n,r]=(0,f.useState)(!1),{countryOddsProvider:a}=(0,eK.D)();return a?(0,i.jsxs)(m.BJ,{bg:"surface.s1",gap:"md",mdDown:{elevation:"2",padding:"md",br:"md"},children:[(0,i.jsx)(P.EY,{textStyle:"display.small",children:(0,i.jsx)(eG.f,{id:t.marketName})}),(0,i.jsx)(e0,{market:t,countryOddsProvider:a,allItemsShown:n,selectedStageType:s}),(0,i.jsx)(eE.r,{isOpen:n,onClick:()=>r(e=>!e)})]}):null};var e2=s(33140);let e5=e=>{let{markets:t,countryOddsProvider:s,selectedStageType:n}=e,{stage:r}=(0,ed.a)(),{ref:a,onSendClickImpression:l}=(0,eP.A)({stageId:r.id,category:eA.zK[n],location:eA.ew.StageOdds,position:ek.ki.OddsValue,type:ek.jF.Additional,status:r.status.type});return(0,i.jsxs)(m.BJ,{ref:a,children:[(0,i.jsx)(eD.i,{choice:t[0].choices[0]}),(0,i.jsx)(m.so,{gap:"sm",children:t.map(e=>{let t=function(e){if(1===e.choices.length)return{...e.choices[0],change:(0,ez.zN)(e.choices[0]),name:e.marketName};let t=e.choices.find(e=>"Yes"===e.name);if(t)return{...t,change:(0,ez.zN)(t),name:e.marketName}}(e);return t?(0,i.jsx)(m.az,{flex:"[1 1 0px]",children:(0,i.jsx)(eM.i,{choice:t,countryOddsProvider:s,betSlipLink:(0,eI.Iz)(t,e,s),isLive:e.isLive,onClick:l})},e.id):null})})]})},e4=e=>{let{markets:t,selectedStageType:s}=e,[n,r]=(0,f.useState)(!1),{countryOddsProvider:a}=(0,eK.D)();if(!a)return null;let l=(0,ez.E7)(t),o=(0,ez.JJ)(l,n);return(0,i.jsxs)(m.BJ,{bg:"surface.s1",gap:"lg",mdDown:{elevation:"2",padding:"md",br:"md"},children:[o.map(e=>{let{driverId:t,markets:n}=e;return(0,i.jsx)(e5,{markets:n,countryOddsProvider:a,selectedStageType:s},t)}),(0,i.jsx)(e2.d,{isOpen:n,onClick:()=>r(e=>!e)})]})},e9=e=>{let{markets:t,relevantStages:s,selectedStageType:r,selectedMarketType:a}=e,l=(0,ez.D4)(t,s,r,a);return 0===l.length?(0,i.jsx)(e_.p,{graphic:"no-data",titleMessageId:"No odds"}):r===n.CEM.Race&&a===eA.hM.Driver?(0,i.jsx)(e4,{markets:l,selectedStageType:r}):(0,i.jsx)(i.Fragment,{children:l.map(e=>(0,i.jsx)(e1,{market:e,selectedStageType:r},e.id))})},e3=e=>{let t=(0,eY.Ae)();return(0,i.jsxs)(m.BJ,{gap:"sm",children:[(0,i.jsx)(eq.E,{stageId:e.stageId,stageTypeId:e.selectedStageType,location:eA.ew.StageOdds}),(0,i.jsx)(e9,{...e}),(0,i.jsx)(eT.z,{provider:t,showTailingRegulation:!0})]})},e6=e=>{let{stageId:t,selectedStageType:s,selectedMarketType:n}=e,{data:r,error:a,loading:l}=eN(),{data:o,error:d,isLoading:c}=(0,eU.r)(t),u=(0,eY.Ae)();if(c||l)return(0,i.jsx)(m.az,{h:"[900px]"});if(d||a||!o||!r)return(0,i.jsxs)(m.BJ,{gap:"sm",children:[(0,i.jsx)(eq.E,{stageId:t,stageTypeId:s,location:eA.ew.StageOdds}),(0,i.jsx)(e_.p,{graphic:"no-data",titleMessageId:"No odds"}),(0,i.jsx)(eT.z,{provider:u})]});let g=r[eA.Nu[s]];return(0,i.jsx)(e3,{markets:o,relevantStages:g,stageId:t,selectedStageType:s,selectedMarketType:n})},e8=e=>{var t;let{selectedStageType:s,hasTeamTab:r,hasOtherTab:a}=e,{stage:l}=(0,ed.a)(),[o,d]=(0,f.useState)(eA.hM.Driver);return(0,f.useEffect)(()=>{d(eA.hM.Driver)},[s]),(0,i.jsxs)(P.tU,{variant:"tertiary",initialValue:o,onChange:e=>d(e),children:[(0,i.jsx)(m.az,{p:"sm",elevation:"2",display:(r||a)&&s!==n.CEM.Practice?"block":"none",bg:"surface.s1",children:(0,i.jsxs)(P.tU.List,{children:[(0,i.jsx)(P.tU.Tab,{tabKey:eA.hM.Driver,children:(0,i.jsx)(b.A,{id:(null==(t=l.uniqueStage)?void 0:t.category.id)===1325?"riders.bikes":"motorsport_driver"})}),r&&(0,i.jsx)(P.tU.Tab,{tabKey:eA.hM.Team,children:(0,i.jsx)(b.A,{id:"team"})}),a&&(0,i.jsx)(P.tU.Tab,{tabKey:eA.hM.Other,children:(0,i.jsx)(b.A,{id:"other"})})]})}),(0,i.jsx)(m.az,{p:"sm",mdDown:{elevation:"2",bg:"surface.s0"},children:(0,i.jsx)(e6,{stageId:l.id,selectedStageType:s,selectedMarketType:o})})]})},e7=()=>{let[e,t]=(0,f.useState)(n.CEM.Practice),{stage:s}=(0,ed.a)(),{data:r}=(0,eU.r)(s.id),{hasFreePracticeTab:a,hasQualifyingTab:l,hasRaceTab:o}=function(e){return e?{hasFreePracticeTab:e.some(e=>[eA.On.FastestInPractice1,eA.On.FastestInPractice2,eA.On.FastestInPractice3].includes(e.marketId)),hasQualifyingTab:e.some(e=>[eA.On.FastestQualifier,eA.On.QualifyingWinningCar].includes(e.marketId)),hasRaceTab:e.some(e=>[eA.On.RaceWinner,eA.On.ToWinOutright,eA.On.PodiumFinish,eA.On.PointsFinish].includes(e.marketId))}:{hasFreePracticeTab:!1,hasQualifyingTab:!1,hasRaceTab:!1}}(r);return((0,f.useEffect)(()=>{if(r&&r.length){var e,s,i;t((e=a,s=l,i=o,e?n.CEM.Practice:s?n.CEM.Qualifying:i?n.CEM.Race:n.CEM.Practice))}},[r]),r&&r.length)?(0,i.jsxs)(P.tU,{variant:"secondary",initialValue:e,onChange:e=>t(e),centered:!0,children:[(0,i.jsx)(m.az,{p:"sm",borderBottom:"1px solid",borderColor:"neutrals.nLv4",display:[a,l,o].filter(Boolean).length>1?"block":"none",bg:"surface.s1",children:(0,i.jsxs)(P.tU.List,{children:[a&&(0,i.jsx)(P.tU.Tab,{tabKey:n.CEM.Practice,children:(0,i.jsx)(b.A,{id:"motorsport_f1_free_practice"})}),l&&(0,i.jsx)(P.tU.Tab,{tabKey:n.CEM.Qualifying,children:(0,i.jsx)(b.A,{id:"motorsport_qualifying"})}),o&&(0,i.jsx)(P.tU.Tab,{tabKey:n.CEM.Race,children:(0,i.jsx)(b.A,{id:"race"})})]})}),(0,i.jsx)(P.tU.Panel,{tabKey:n.CEM.Practice,children:(0,i.jsx)(e8,{selectedStageType:n.CEM.Practice})}),(0,i.jsx)(P.tU.Panel,{tabKey:n.CEM.Qualifying,children:(0,i.jsx)(e8,{selectedStageType:n.CEM.Qualifying,hasTeamTab:r.some(e=>e.marketId===eA.On.QualifyingWinningCar)})}),(0,i.jsx)(P.tU.Panel,{tabKey:n.CEM.Race,children:(0,i.jsx)(e8,{selectedStageType:n.CEM.Race,hasTeamTab:r.some(e=>[eA.On.WinningCar,eA.On.BothCarsPodiumFinish,eA.On.BothCarsPointsFinish].includes(e.marketId)),hasOtherTab:r.some(e=>[eA.On.SafetyCarPeriodDuringRace,eA.On.TotalClassifiedDrivers,eA.On.FastestLap].includes(e.marketId))})})]}):null},te=()=>{var e;let{stage:t}=(0,ed.a)();return(null==(e=t.uniqueStage)?void 0:e.category.sport.slug)===n.QCR.Cycling?(0,i.jsx)(eB,{}):(0,i.jsx)(e7,{})};var tt=s(92673);let ts=()=>{var e,t;let s=(0,F.o)(),{stage:r}=(0,ed.a)(),a=s===n.QCR.Cycling?r.id:(null==(e=r.stageParent)?void 0:e.id)||r.id;return(0,i.jsx)(el.WC,{variant:"square-mobile",children:(0,i.jsx)(tt.n,{stageId:a,uniqueStageName:(null==(t=r.uniqueStage)?void 0:t.name)||""})})};var ti=s(13731),tn=s.n(ti),tr=s(37455),ta=s(78551);let tl=e=>{let{data:t,error:s,isLoading:i}=(0,c.Ay)(n.dVR.standings(function(e){return e.type.id===n.CEM.Practice&&e.partSubstages&&e.partSubstages.length>0?e.partSubstages[0].id:e.id}(e),n.SNJ.Competitor),{refreshInterval:15*es.Z2});return{data:(null==t?void 0:t.standings)||[],error:s,loading:i}},to=e=>{let{gender:t=n.YT8.Male}=e;return(0,i.jsx)(m.VJ,{inline:"sm",children:(0,i.jsxs)(m.zt,{gap:"lg",p:"sm",h:"4xl",children:[(0,i.jsx)(P.EY,{color:"neutrals.nLv3",textStyle:"table.medium",textAlign:"center",w:"xl",children:(0,i.jsx)(b.A,{id:"position.short"})}),(0,i.jsx)(m.BJ,{gap:"2xs",flexGrow:1,children:(0,i.jsx)(P.EY,{color:"neutrals.nLv3",textStyle:"table.medium",children:(0,i.jsx)(b.A,{id:"cycling_rider",values:{gender:t}})})}),(0,i.jsxs)(m.zt,{children:[(0,i.jsx)(P.EY,{color:"neutrals.nLv3",textAlign:"center",w:"4xl",textStyle:"table.medium",children:(0,i.jsx)(b.A,{id:"time"})}),(0,i.jsx)(P.EY,{color:"neutrals.nLv3",textAlign:"center",w:"4xl",textStyle:"table.medium",children:(0,i.jsx)(b.A,{id:"gap"})})]})]})})},td=e=>{var t;let{data:s}=e;return 0===s.length?null:(0,i.jsxs)(m.BJ,{gap:"0",children:[(0,i.jsx)(to,{gender:null==(t=s[0].team)?void 0:t.gender}),s.map((e,t)=>(0,i.jsx)(ta.p,{row:e,isLast:t===s.length-1},e.team.id))]})},tc=e=>{let{stage:t}=e,{data:s,error:n,loading:r}=tl(t);return n?(0,i.jsx)(e_.p,{graphic:"race-start",descriptionMessageId:"cycling_results_empty_message"}):r?(0,i.jsx)(m.az,{h:"[900px]"}):(0,i.jsx)(td,{data:s})};var tu=s(51755);let tg="Power Stage",th=e=>{let{stage:t}=e;switch(t.type.id){case n.CEM.Practice:var s;if((null==(s=t.uniqueStage)?void 0:s.id)===eQ.h.MotoGP&&"practice"===t.slug)return(0,i.jsx)(b.A,{id:"motorsport_practice_short"});return(0,i.jsx)(b.A,{id:"motorsport_free_practice_short",values:{n:t.sequence}});case n.CEM.QualifyingPart:return(0,i.jsx)(b.A,{id:"motorsport_qualifying_stage_short",values:{n:t.sequence}});case n.CEM.Qualifying:return(0,i.jsx)(b.A,{id:"total",values:{n:t.sequence}});case n.CEM.SprintQualifyingPart:return(0,i.jsx)(b.A,{id:"motorsport_sprint_qualifying_stage_short",values:{n:t.sequence}});case n.CEM.SprintQualifying:return(0,i.jsx)(b.A,{id:"gridPosition"});case n.CEM.Sprint:return(0,i.jsx)(b.A,{id:"race"});case n.CEM.AfterStage:return(0,i.jsx)(b.A,{id:"motorsport_overall_results"});case n.CEM.Day:return(0,i.jsx)(b.A,{id:"motorsport_wrc_super_sunday_stages"});case n.CEM.Stage:if(!t.info)return(0,i.jsx)(i.Fragment,{children:t.description});if(t.description===tg)return(0,i.jsx)(b.A,{id:"motorsport_wrc_power_stage"});switch(t.info.wrcStageDay){case"THU":return(0,i.jsx)(b.A,{id:"motorsport_wrc_stage_thursday_short",values:{n:t.info.stageRound}});case"FRI":return(0,i.jsx)(b.A,{id:"motorsport_wrc_stage_friday_short",values:{n:t.info.stageRound}});case"SAT":return(0,i.jsx)(b.A,{id:"motorsport_wrc_stage_saturday_short",values:{n:t.info.stageRound}});case"SUN":return(0,i.jsx)(b.A,{id:"motorsport_wrc_stage_sunday_short",values:{n:t.info.stageRound}});default:return(0,i.jsx)(i.Fragment,{children:t.description})}default:return(0,i.jsx)(i.Fragment,{children:t.description})}},tx=e=>{let{stages:t}=e;return(0,i.jsx)(m.VJ,{inline:"sm",display:t.length>1?"block":"none",py:"[1px]",children:(0,i.jsx)(P.tU.List,{children:t.map((e,t)=>(0,i.jsx)(P.tU.Tab,{tabKey:e.id,children:(0,i.jsx)(th,{stage:{...e,sequence:e.sequence||t+1}})},e.id))})})},tp=e=>1===e.stages.length?null:(0,i.jsx)(m.az,{md:{px:"sm"},children:(0,i.jsx)(tx,{...e})});var tm=s(25747),ty=s(90510);let tj=e=>{var t;let{stage:s,textStyle:r="display.small"}=e;if(!s.startDateTimestamp)return null;let a=[n.hzM.canceled,n.hzM.cancelled].includes(s.status.type),l=s.status.type===n.hzM.inprogress,o=(0,es.cK)(s.startDateTimestamp);return(0,i.jsxs)(m.so,{justify:"space-between",children:[(0,i.jsxs)(m.zt,{gap:"xs",color:l?"status.live":"neutrals.nLv1",children:[l&&(0,i.jsxs)(m.zt,{gap:"xs",children:[(0,i.jsx)(P.EY,{textStyle:r,color:"[currentcolor]",children:(0,i.jsx)(b.A,{id:"live"})}),(0,i.jsx)(P.EY,{textStyle:r,color:"[currentcolor]",children:"\xb7"})]}),(0,i.jsx)(P.EY,{textStyle:r,color:"[currentcolor]",textDecoration:a?"line-through":"none",children:o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b.A,{id:"today"}),","," ",(0,i.jsx)(ty.ib,{value:1e3*s.startDateTimestamp,hour:"2-digit",minute:"2-digit",hour12:!1})]}):(0,i.jsx)(ty.XU,{value:1e3*s.startDateTimestamp,day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit",hour12:!1})}),s.type.id===n.CEM.AfterStage&&s.status.type===n.hzM.finished&&(0,i.jsxs)(P.EY,{textStyle:r,color:"[currentcolor]",children:["- ",(0,i.jsx)(b.A,{id:"motorsport_wrc_results_after_stage_x",values:{n:null==(t=s.info)?void 0:t.stageRound}})]})]}),a&&(0,i.jsx)(P.EY,{textStyle:r,color:"status.error.default",children:(0,i.jsx)(b.A,{id:"canceled"})})]})},tf={[n.pBY.Flat]:"cycling_stage_type_flat",[n.pBY.Intermediate]:"cycling_stage_type_hilly",[n.pBY.TimeTrial]:"cycling_stage_type_time_trial",[n.pBY.Mountain]:"cycling_stage_type_mountain"},tv=e=>{var t,s,n,r,a,l,o,d;let{selectedStage:c}=e,u=(null==(t=c.info)?void 0:t.departureCity)&&(null==(s=c.info)?void 0:s.arrivalCity),g=null==(n=c.info)?void 0:n.raceDistance,h=null==(r=c.info)?void 0:r.stageType,x=g||h,p=g&&h;return(0,i.jsx)(m.az,{bg:"surface.s2",br:"lg",children:(0,i.jsxs)(m.so,{minH:"[80px]",children:[(0,i.jsxs)(m.BJ,{gap:"xs",px:"lg",py:"sm",flexGrow:1,children:[(0,i.jsx)(tj,{stage:c,textStyle:"assistive.default"}),u&&(0,i.jsxs)(P.EY,{textStyle:"display.small",children:[null==(a=c.info)?void 0:a.departureCity," › ",null==(l=c.info)?void 0:l.arrivalCity]}),x&&(0,i.jsxs)(m.so,{mt:"xs",children:[(null==(o=c.info)?void 0:o.raceDistance)&&(0,i.jsxs)(P.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:[(0,i.jsx)(b.A,{id:"cycling_stage_length"})," ",(0,i.jsx)(ey.Z,{value:c.info.raceDistance,fromUnit:"m"})]}),p&&(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:"\xa0\xb7\xa0"}),h&&(0,i.jsxs)(P.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:[(0,i.jsx)(b.A,{id:"cycling_stage_type"})," ",(0,i.jsx)(b.A,{id:tf[c.info.stageType]})]})]})]}),(null==(d=c.info)?void 0:d.weather)&&(0,i.jsx)(m.az,{p:"lg",children:(0,i.jsx)(L.qgJ,{weather:c.info.weather})})]})})};var tb=s(75837),tS=s(82827),tC=s(17763),tw=s(50526),t_=s(11036);let tT=e=>{let{stage:t,markets:s}=e,{ref:n,onSendClickImpression:r}=(0,eP.A)({stageId:t.id,category:eA.zK[t.type.id],location:eA.ew.StageResults,position:ek.ki.OddsValue,type:ek.jF.Featured,status:t.status.type});return(0,i.jsx)(m.so,{gap:"sm",ref:n,children:s.map(e=>(0,i.jsx)(t_.K,{market:e,choice:e.choice,label:e.marketName,onClick:r},e.marketId))})};var tE=s(22909);let tM=e=>{let{markets:t,stage:s,additionalLabelId:n}=e,r=(0,eY.Ae)();return(0,i.jsxs)(m.BJ,{children:[(0,i.jsx)(tC.A,{countryOddsProvider:r,children:(0,i.jsxs)(m.BJ,{children:[(0,i.jsxs)(m.so,{justify:"space-between",children:[(0,i.jsx)(eD.i,{choice:t[0].choice}),(0,i.jsx)(tE.p,{id:s.id,location:eA.ew.StageResults,category:eA.Nu[s.type.id],type:ek.jF.Featured})]}),n&&(0,i.jsx)(P.EY,{textStyle:"display.micro",children:(0,i.jsx)(b.A,{id:n})}),(0,i.jsx)(tT,{markets:t,stage:s})]})}),(0,i.jsx)(tw.A,{})]})};var tk=s(78148),tI=s(38253);let tA=e=>{let{id:t,stage:s,additionalLabelId:n}=e,{data:r,isLoading:a,error:l}=(0,tk.K)(t),o=(0,eY.Ae)();if(a)return(0,i.jsx)(tS.t1,{provider:o});if(l||!r)return null;let d=r.some(e=>e.isLive),c=r.every(e=>e.marketId===eA.On.ToWinOutright);if(d||c){let e={...r[0],choices:r.map(e=>e.choice)};return(0,i.jsx)(tI.W,{market:e,stage:s})}return(0,i.jsx)(tM,{markets:r,stage:s,additionalLabelId:n})},tD=e=>{let{id:t,stage:s}=e,{data:n,isLoading:r,error:a}=(0,eU.r)(t),l=(0,eY.Ae)();if(r)return(0,i.jsx)(tS.t1,{provider:l});if(a||!n)return null;let o=(0,ez.ls)(n,s);return o?(0,i.jsx)(tI.W,{market:o,stage:s}):(0,i.jsx)(tA,{id:t,stage:s,additionalLabelId:"race"})},tP=e=>{var t;let{selectedStage:s}=e,{stage:r}=(0,ed.a)(),a=(0,ez.bB)(r,s),l=(0,ez.Lh)(s),o=(null==(t=s.uniqueStage)?void 0:t.id)===eQ.h.MotoGP&&s.type.id!==n.CEM.Race;return r.uniqueStage&&![eQ.h.F1,eQ.h.MotoGP].includes(r.uniqueStage.id)||void 0===a?null:(0,i.jsx)(tb.C,{stage:r,children:l===eA.F5.Featured?(0,i.jsx)(tA,{id:a,stage:s,additionalLabelId:o?"race":void 0}):(0,i.jsx)(tD,{id:a,stage:s})})};function tz(e,t){let s=[...t.practice,...t.sprint,...t.qualifying,...t.race],i=s.slice().reverse().find(e=>e.status.type===n.hzM.inprogress),r=s.slice().reverse().find(e=>e.status.type===n.hzM.finished),a=i||r;return void 0!==a?a.type.id===n.CEM.Race?n.CEM.Race:[n.CEM.Qualifying,n.CEM.QualifyingPart].includes(a.type.id)?n.CEM.Qualifying:[n.CEM.Sprint,n.CEM.SprintQualifying,n.CEM.SprintQualifyingPart].includes(a.type.id)?n.CEM.Sprint:n.CEM.Practice:e.hasPracticeTab?n.CEM.Practice:e.hasSprintTab?n.CEM.Sprint:e.hasQualifyingTab?n.CEM.Qualifying:n.CEM.Race}function tL(e){let t=e.slice().reverse().find(e=>e.status.type===n.hzM.inprogress);if(e.find(e=>e.description===tg)){let s=e.find(e=>e.status.type===n.hzM.finished);return t||s||e[0]}let s=e.slice().reverse().find(e=>e.status.type===n.hzM.finished);return t||s||e[0]}let tR={[n.CEM.Practice]:"motorsport_f1_free_practice",[n.CEM.Sprint]:"formula_sprint",[n.CEM.Qualifying]:"motorsport_qualifying",[n.CEM.Race]:"race"};var tq=s(64261);let tF=(0,f.createContext)(void 0),tU=e=>{let{children:t,...s}=e,[n,r]=(0,f.useState)("gap");return(0,i.jsx)(tF,{value:{...s,timeDisplay:n,toggleTimeDisplay:()=>{(0,tq.$)("user_interaction",{location:"race_table",action:"click",type:n}),r(e=>"gap"===e?"interval":"gap")}},children:t})},tK=()=>{let e=(0,f.useContext)(tF);if(!e)throw Error();return e},tW=()=>{let{standings:e}=tK(),t=e.reduce((e,t)=>t.updatedAtTimestamp>e?t.updatedAtTimestamp:e,-1/0);return(0,i.jsx)(m.so,{justify:"flex-end",children:(0,i.jsx)(P.EY,{textStyle:"body.small",children:(0,i.jsx)(b.A,{id:"basic.lastUpdated",values:{dateTime:(0,i.jsx)(ty.XU,{value:1e3*t,...es.or.dateTime})}})})})};var tO=s(94565),tB=function(e){return e[e.Summary=0]="Summary",e[e.Tyres=1]="Tyres",e[e.PitStop=2]="PitStop",e[e.FastestLap=3]="FastestLap",e[e.Generic=4]="Generic",e[e.CyclingTime=5]="CyclingTime",e[e.CyclingYoungRider=6]="CyclingYoungRider",e[e.CyclingSprint=7]="CyclingSprint",e[e.CyclingClimb=8]="CyclingClimb",e}({});let tY={key:"laps",shortTranslationKey:"motorsport_laps_short",translationKey:"motorsport_legend_laps",showZeroIfUndefined:!0},tQ={key:"gap",shortTranslationKey:"gap",translationKey:"gap",maxCellWidth:72,showMinusIfUndefined:!0},tN={key:"time",shortTranslationKey:"time",translationKey:"time",maxCellWidth:72,showMinusIfUndefined:!0},tJ={key:"totalTime",shortTranslationKey:"time",translationKey:"time",maxCellWidth:72,showMinusIfUndefined:!0},tH={key:"lapTime",shortTranslationKey:"time",translationKey:"time",maxCellWidth:80,hideColumnIfAllUndefined:!0,showMinusIfUndefined:!0},tV={key:"gridPosition",shortTranslationKey:"motorsport_grid_short",translationKey:"motorsport_grid_position",hideColumnIfAllUndefined:!0},tG={key:"points",shortTranslationKey:"motorsport_points_short",translationKey:"motorsport_legend_points",hideColumnIfAllUndefined:!0,showZeroIfUndefined:!0},t$=[tY,tQ,tN],tZ=[tY,tQ,tN],tX=[tJ],t0=[tV,tY,tG,tN,tQ],t1=[tY,tQ,tN],t2=[tQ,tN],t5=[tV,{key:"pitStops",shortTranslationKey:"motorsport_pit_stops_short",translationKey:"motorsport_legend_pit_stops",showZeroIfUndefined:!0},tY,tG,tN],t4=[{key:"personalFastestLap",shortTranslationKey:"motorsport_laps_short",translationKey:"fastestLap.label",hideColumnIfAllUndefined:!0},{key:"personalFastestLapTime",shortTranslationKey:"time",translationKey:"time",maxCellWidth:72}],t9=[{key:"startingTyres",shortTranslationKey:"motorsport_starting_tyres_short",translationKey:"motorsport_legend_starting_tyres"},{key:"finishingTyres",shortTranslationKey:"motorsport_finishing_tyres_short",translationKey:"motorsport_legend_finishing_tyres"},{key:"hardTyres",shortTranslationKey:"H",translationKey:"motorsport_legend_laps_on_hard_tyres",renderType:"color"},{key:"mediumTyres",shortTranslationKey:"M",translationKey:"motorsport_legend_laps_on_medium_tyres",renderType:"color"},{key:"softTyres",shortTranslationKey:"S",translationKey:"motorsport_legend_laps_on_soft_tyres",renderType:"color"},{key:"intermediateTyres",shortTranslationKey:"I",translationKey:"motorsport_legend_laps_on_intermediate_tyres",renderType:"color"},{key:"wetTyres",shortTranslationKey:"W",translationKey:"motorsport_legend_laps_on_wet_tyres",renderType:"color"}],t3=[tQ,{...tJ,hideColumnIfAllUndefined:!0}],t6=[tY,tQ],t8=[tY,tH],t7=[tH,tY,tG,{...tQ,maxCellWidth:80}],se=[tQ,tN],st=[tQ,tN],ss=[tQ,tN],si=[tV,tY,tG,tQ],sn=[tV,tY,tG,tN],sr=[{...tY,hideColumnIfAllUndefined:!0},tH],sa=[{...tY,hideColumnIfAllUndefined:!0},tH],sl=[tY,tH,tG,tQ],so=[tY,tH,tG,tQ],sd=[{...tY,maxCellWidth:48},{...tG,maxCellWidth:48}],sc=[tY,tQ],su=[tY],sg=[tY,tH,tG,tQ],sh=[{...tN,maxCellWidth:80}],sx=[{key:"youngRider",shortTranslationKey:"young_rider",translationKey:"young_rider",showMinusIfUndefined:!0,maxCellWidth:80}],sp=[{key:"sprint",shortTranslationKey:"Pts",translationKey:"Pts",showMinusIfUndefined:!0,maxCellWidth:40}],sm=[{key:"climb",shortTranslationKey:"Pts",translationKey:"Pts",showMinusIfUndefined:!0,maxCellWidth:40}],sy=e=>{switch(e){case n.CEM.Race:return so;case n.CEM.Sprint:return sl;case n.CEM.Qualifying:case n.CEM.QualifyingPart:return sa;case n.CEM.Practice:case n.CEM.PracticePart:return sr;default:return[]}},sj=e=>{switch(e){case n.CEM.Practice:return se;case n.CEM.Qualifying:return ss;case n.CEM.QualifyingPart:return st;case n.CEM.Sprint:return si;case n.CEM.Race:return sn;default:return[]}},sf=(e,t,s,i)=>{switch(e){case eQ.h.WRC:return t3;case eQ.h.Indycar:switch(t){case n.CEM.Race:return t7;case n.CEM.Qualifying:case n.CEM.QualifyingPart:return t8;case n.CEM.Practice:case n.CEM.PracticePart:return t6;default:return[]}case eQ.h.Moto3:case eQ.h.Moto2:case eQ.h.Superbike:case eQ.h.DTM:return sy(t);case eQ.h.MotoGP:if(null==i?void 0:i.every(e=>void 0===e.time&&void 0===e.gap))return sy(t);if([n.CEM.Sprint,n.CEM.Race].includes(t))return(null==i?void 0:i.every(e=>void 0===e.time))?sy(t):sj(t);return sj(t);case eQ.h.NascarSprintCup:case eQ.h.NascarXfinity:case eQ.h.NascarCampingWorld:return sd;case eQ.h.FormulaE:switch(t){case n.CEM.Race:return sg;case n.CEM.Qualifying:case n.CEM.QualifyingPart:return su;case n.CEM.Practice:case n.CEM.PracticePart:return sc;default:return[]}case eQ.h.F1:return((e,t)=>{switch(e){case n.CEM.Practice:case n.CEM.PracticePart:return t$;case n.CEM.Sprint:return t0;case n.CEM.SprintQualifying:return tX;case n.CEM.SprintQualifyingPart:return tZ;case n.CEM.Qualifying:return t2;case n.CEM.QualifyingPart:return t1;case n.CEM.Race:switch(t){case tB.Summary:return t5;case tB.Tyres:return t9;case tB.FastestLap:return t4;default:return[]}default:return[]}})(t,s);case eQ.h.CyclingMen:case eQ.h.CyclingWomen:return(e=>{if(!e)return[];switch(e){case tB.CyclingYoungRider:return sx;case tB.CyclingSprint:return sp;case tB.CyclingClimb:return sm;default:return sh}})(s);default:return[]}},sv=(e,t)=>!(e.hideColumnIfAllUndefined&&t.every(t=>void 0===t[e.key])),sb=(e,t,s,i)=>e?sf(e.id,s,i,t).filter(e=>sv(e,t)):[],sS=(e,t)=>t===tB.FastestLap?[...e].sort((e,t)=>{let s=e=>{if(!e)return 1/0;let[t,s]=e.split(":");return 6e4*parseInt(t)+1e3*parseFloat(s)};return s(e.personalFastestLapTime)-s(t.personalFastestLapTime)}):e,sC=(0,s(62042).Fj)({variants:{type:{hard:{bg:"rating.s00"},medium:{bg:"rating.s65"},soft:{bg:"rating.s10"},intermediate:{bg:"rating.s70"},wet:{bg:"rating.s80"}}}}),sw=(0,m.I4)("div",sC);var s_=s(12927);let sT={S:"soft",M:"medium",H:"hard",I:"intermediate",W:"wet"},sE=e=>{let{tyreInfo:t,totalLaps:s}=e;return(0,i.jsx)(m.so,{w:"100%",height:"md",gap:"[1px]",children:void 0!==t&&void 0!==s?t.map((e,t)=>(0,i.jsx)(m.so,{justify:"center",style:{width:"".concat(e.laps/Number(s)*100,"%")},children:(0,i.jsx)(P.EY,{textStyle:"table.small",children:e.laps})},t)):(0,i.jsx)("div",{})})},sM=e=>{let{tyreInfo:t,totalLaps:s}=e;return(0,i.jsx)(m.so,{w:"100%",bg:"neutrals.nLv5",height:"sm",br:"sm",gap:"[1px]",overflow:"hidden",children:void 0!==t&&void 0!==s?t.map((e,t)=>(0,i.jsx)(sw,{type:sT[e.type],style:{width:"".concat(e.laps/Number(s)*100,"%")}},t)):(0,i.jsx)("div",{})})},sk=e=>{var t,s;let{driver:r,tyreInfo:a}=e,{stage:l}=(0,ed.a)();return(0,i.jsx)(s_.A,{team:r.team,outrightType:n.SNJ.Competitor,children:(0,i.jsx)(m.so,{flexGrow:1,justify:"flex-end",h:"4xl",borderBottom:"1px solid",borderBottomColor:"neutrals.nLv4",children:(0,i.jsx)(m.so,{alignItems:"center",justify:"center",px:"sm",maxW:"[250px]",width:"100%",children:(0,i.jsxs)(m.BJ,{gap:"xs",flexGrow:1,children:[(0,i.jsx)(sE,{tyreInfo:a,totalLaps:null==(t=l.info)?void 0:t.laps}),(0,i.jsx)(sM,{tyreInfo:a,totalLaps:null==(s=l.info)?void 0:s.laps})]})})})})},sI=()=>{var e;let{stage:t}=(0,ed.a)(),{selectedRaceCategory:s,selectedStageType:n,standings:r,timeDisplay:a}=tK(),l=sb(t.uniqueStage,r,n,s).filter(e=>e.translationKey!==e.shortTranslationKey);return 0===l.length?null:(0,i.jsx)("div",{children:(0,i.jsx)(tO.nD,{children:(0,i.jsxs)(tO.nD.Item,{defaultOpened:!0,br:"md",overflow:"hidden",children:[(0,i.jsx)(tO.nD.Trigger,{bg:"surface.s2",children:(0,i.jsx)(P.EY,{textStyle:"display.small",children:(0,i.jsx)(b.A,{id:"legend"})})}),(0,i.jsx)(tO.nD.Content,{children:(0,i.jsxs)(m.BJ,{px:"md",bg:"surface.s2",pb:"lg",children:[l.map(e=>(0,i.jsxs)(m.zt,{children:[(0,i.jsx)(m.az,{w:"2xl",children:"color"===e.renderType?(0,i.jsx)(sw,{w:"100%",h:"sm",type:sT[e.shortTranslationKey],br:"lg"}):(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",lineHeight:1,fontSize:"xs",children:(0,i.jsx)(b.A,{id:e.shortTranslationKey})})}),(0,i.jsx)(m.az,{children:(0,i.jsx)(P.EY,{textStyle:"body.small",lineHeight:1,fontSize:"xs",children:(0,i.jsx)(b.A,{id:e.translationKey})})})]},e.key)),(null==(e=t.uniqueStage)?void 0:e.id)===eQ.h.F1&&s===tB.Summary&&"interval"===a&&(0,i.jsxs)(m.zt,{children:[(0,i.jsx)(m.az,{w:"2xl",children:(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",lineHeight:1,fontSize:"xs",textTransform:"uppercase",children:(0,i.jsx)(b.A,{id:"motorsport_interval_short"})})}),(0,i.jsx)(m.az,{children:(0,i.jsx)(P.EY,{textStyle:"body.small",lineHeight:1,fontSize:"xs",children:(0,i.jsx)(b.A,{id:"motorsport_legend_interval"})})})]})]})})]})})})},sA=e=>{let{driver:t}=e,{stage:s}=(0,ed.a)();return s.uniqueStage&&[eQ.h.F1,eQ.h.MotoGP].includes(s.uniqueStage.id)?(0,i.jsx)(m.az,{style:{backgroundColor:null==t?void 0:t.teamColors.primary,borderBottomRightRadius:"2px",borderTopRightRadius:"2px"},w:"[4px]",h:"[100%]"}):(0,i.jsx)(m.az,{w:"xs"})},sD=e=>{let{driver:t,didNotFinish:s}=e;if(s)return(0,i.jsx)(m.so,{w:"xl",justify:"center",children:(0,i.jsx)(P.EY,{textStyle:"table.medium",color:"[currentcolor]",lineHeight:1,textAlign:"center",children:"-"})});let n=function(e,t){if(void 0!==t&&void 0!==e){if(t===e)return;let s=e-t;return{positionsChanged:Math.abs(s),direction:s>0?"up":"down"}}}(t.gridPosition,t.position);return(0,i.jsxs)(m.BJ,{gap:"xs",justify:"center",w:"xl",children:[(0,i.jsx)(P.EY,{textStyle:"table.medium",lineHeight:1,textAlign:"center",children:t.position}),void 0!==n&&(0,i.jsx)(m.so,{align:"center",children:"up"===n.direction?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"status.success.default",lineHeight:1,textAlign:"center",children:n.positionsChanged}),(0,i.jsx)(m.so,{justify:"center",style:{transform:"rotate(180deg)"},children:(0,i.jsx)(L.Bfd,{color:"status.success.default",w:12,h:12})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"status.error.default",lineHeight:1,textAlign:"center",children:n.positionsChanged}),(0,i.jsx)(m.so,{justify:"center",children:(0,i.jsx)(L.Bfd,{color:"status.error.default",w:12,h:12})})]})})]})},sP=e=>{var t;let{driver:s,team:n}=e;return(0,i.jsxs)(m.BJ,{gap:"xs",children:[(0,i.jsxs)(m.zt,{children:[(0,i.jsx)(P.EY,{textStyle:"table.medium",color:"[currentcolor]",lineHeight:1,children:s.shortName||s.name}),(0,i.jsx)(J.w,{alpha2:(null==(t=s.country)?void 0:t.alpha2)||"international",size:12})]}),n&&(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",lineHeight:1,fontWeight:"lighter",maxW:"[120px]",truncate:!0,children:n.name})]})},sz=e=>{let{driver:t}=e,s="DNS"===t.gap,r="DNF"===t.gap,a="Disqualified"===t.comment,l=s||r||a;return(0,i.jsx)(s_.A,{team:t.team,outrightType:n.SNJ.Competitor,children:(0,i.jsxs)(m.zt,{h:"4xl",py:"xs",bg:"surface.s1",gap:"sm",pr:"sm",borderBottom:"1px solid",borderColor:"neutrals.nLv4",color:l?"neutrals.nLv3":"neutrals.nLv1",children:[(0,i.jsx)(sA,{driver:t.parentTeam}),(0,i.jsx)(sD,{driver:t,didNotFinish:l}),(0,i.jsx)(sP,{driver:t.team,team:t.parentTeam})]})})},sL=()=>{let{standings:e,selectedRaceCategory:t}=tK();return(0,i.jsx)(m.az,{children:sS(e,t).map(e=>(0,i.jsx)(m.az,{children:(0,i.jsx)(sz,{driver:e})},e.team.id))})};var sR=s(64183);let sq=()=>{let{stage:e}=(0,ed.a)(),{isDesktop:t}=(0,P.$c)(),s=(0,z.Ay)({isInMobileTabs:!1,isSportMenuVisible:!0}),n=t?sR.Rl+sR.pB:s,r=e.uniqueStage&&[eQ.h.MotoGP,eQ.h.Moto2,eQ.h.Moto3,eQ.h.Superbike,eQ.h.CyclingMen,eQ.h.CyclingWomen].includes(e.uniqueStage.id);return(0,i.jsx)(tO.PI,{top:n,isStickingDisabled:t,children:e=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(m.zt,{gap:"sm",alignItems:"center",py:{mdDown:"xl",md:"sm"},px:"sm",elevation:e?"2":void 0,h:"lg",bg:"surface.s1",children:[(0,i.jsx)(P.EY,{textStyle:"table.medium",color:"neutrals.nLv3",truncate:!0,w:"[28px]",children:(0,i.jsx)(b.A,{id:"position.short"})}),(0,i.jsx)(P.EY,{textStyle:"table.medium",color:"neutrals.nLv3",truncate:!0,children:(0,i.jsx)(b.A,{id:r?"riders.bikes":"motorsport_driver"})})]})})})},sF=()=>(0,i.jsxs)(m.BJ,{flexShrink:0,children:[(0,i.jsx)(sq,{}),(0,i.jsx)(sL,{})]}),sU=e=>{let{isStuck:t}=e,{stage:s}=(0,ed.a)(),{selectedRaceCategory:r,selectedStageType:a,standings:l,timeDisplay:o,toggleTimeDisplay:d}=tK(),c=sb(s.uniqueStage,l,a,r),u=l.some(e=>void 0!==e.interval)&&s.uniqueStage&&[eQ.h.MotoGP,eQ.h.F1].includes(s.uniqueStage.id);return(0,i.jsxs)(m.zt,{gap:"0",alignItems:"center",py:{mdDown:"xl",md:"sm"},h:"lg",elevation:t?"2":void 0,bg:"surface.s1",children:[(0,i.jsx)(m.az,{flexGrow:1}),c.map(e=>u&&"time"===e.key&&r===tB.Summary||u&&"gap"===e.key&&a===n.CEM.Sprint?(0,i.jsx)(m.ov,{style:{minWidth:e.maxCellWidth||28},children:(0,i.jsxs)(m.so,{w:"6xl",justify:"center",align:"center",borderColor:"[currentcolor]",border:"1.5px solid",py:"xs",gap:"xs",br:"xl",color:"action.primary.default",cursor:"pointer",onClick:d,children:[(0,i.jsx)(L.bt9,{w:14,h:14}),(0,i.jsx)(P.EY,{textStyle:"assistive.default",color:"[currentcolor]",textTransform:"uppercase",children:"gap"===o?"Gap":"Int"})]})},e.key):(0,i.jsx)(m.ov,{style:{minWidth:e.maxCellWidth||28},children:(0,i.jsx)(P.EY,{textStyle:"table.medium",color:"neutrals.nLv3",children:(0,i.jsx)(b.A,{id:e.shortTranslationKey})})},e.key))]})},sK=e=>{let{isStuck:t}=e;return(0,i.jsx)(m.so,{flexGrow:1,justify:"flex-end",py:{mdDown:"xl",md:"sm"},h:"lg",elevation:t?"2":void 0,bg:"surface.s1",children:(0,i.jsxs)(m.so,{justify:"space-between",maxW:"[250px]",w:"[100%]",children:[(0,i.jsx)(m.ov,{style:{width:28},children:(0,i.jsx)(P.EY,{textStyle:"table.medium",color:"neutrals.nLv3",children:(0,i.jsx)(b.A,{id:"motorsport_starting_tyres_short"})})}),(0,i.jsx)(m.ov,{style:{width:28},children:(0,i.jsx)(P.EY,{textStyle:"table.medium",color:"neutrals.nLv3",children:(0,i.jsx)(b.A,{id:"motorsport_finishing_tyres_short"})})})]})})},sW=()=>{let{selectedRaceCategory:e}=tK(),{isDesktop:t}=(0,P.$c)(),s=(0,z.Ay)({isInMobileTabs:!1,isSportMenuVisible:!0});return(0,i.jsx)(tO.PI,{top:t?0:s,isStickingDisabled:t,children:t=>e===tB.Tyres?(0,i.jsx)(sK,{isStuck:t}):(0,i.jsx)(sU,{isStuck:t})})},sO=e=>{var t,s,n,r,a;let{driver:l,statistic:o,didNotFinish:d,didNotStart:c,isDisqualified:u}=e,{stage:g}=(0,ed.a)();return["time","totalTime"].includes(o.key)||(null==(t=g.uniqueStage)?void 0:t.id)===eQ.h.MotoGP&&"gap"===o.key?d?(0,i.jsx)(i.Fragment,{children:"DNF"}):c?(0,i.jsx)(i.Fragment,{children:"DNS"}):u?(0,i.jsx)(i.Fragment,{children:"DSQ"}):void 0!==l.lapsBehind?(0,i.jsxs)(i.Fragment,{children:["+ ",o.value," ",1===l.lapsBehind?"lap":"laps"]}):o.showMinusIfUndefined?(0,i.jsx)(i.Fragment,{children:null!=(s=o.value)?s:"-"}):(0,i.jsx)(i.Fragment,{children:null!=(n=o.value)?n:"-"}):o.showZeroIfUndefined?(0,i.jsx)(i.Fragment,{children:null!=(r=o.value)?r:0}):o.showMinusIfUndefined?(0,i.jsx)(i.Fragment,{children:null!=(a=o.value)?a:"-"}):(0,i.jsx)(i.Fragment,{children:o.value})},sB=e=>{let{driver:t,items:s}=e,r="DNS"===t.gap||"Did not start"===t.status,a="DNF"===t.gap||"Out"===t.status,l="Disqualified"===t.comment,o=r||a||l;return(0,i.jsx)(s_.A,{team:t.team,outrightType:n.SNJ.Competitor,children:(0,i.jsxs)(m.zt,{gap:"[0px]",alignItems:"center",h:"4xl",color:o?"neutrals.nLv3":"neutrals.nLv1",children:[(0,i.jsx)(m.az,{flexGrow:1,h:"[100%]",borderBottom:"1px solid",borderBottomColor:"neutrals.nLv4"}),s.map(e=>(0,i.jsx)(m.ov,{style:{minWidth:e.maxCellWidth||28},h:"4xl",borderBottom:"1px solid",borderBottomColor:"neutrals.nLv4",children:(0,i.jsx)(P.EY,{textStyle:"table.medium",color:"[currentcolor]",children:(0,i.jsx)(sO,{driver:t,statistic:e,didNotFinish:a,didNotStart:r,isDisqualified:l})})},e.key))]})})},sY=e=>{let{item:t}=e,{stage:s}=(0,ed.a)(),{selectedRaceCategory:r,selectedStageType:a,standings:l,timeDisplay:o}=tK();return r===tB.Tyres?(0,i.jsx)(sk,{driver:t,tyreInfo:t.tyreInfo}):(0,i.jsx)(sB,{driver:t,items:((e,t,s,i,r,a)=>{if(!e)return[];let l=sf(e.id,i,a,t);return((e,t,s,i,r)=>s.map(s=>{let a=t[s.key];return e.id===eQ.h.WRC?"gap"===s.key&&1===t.position?{...s,value:t.time||t.totalTime}:{...s,value:a||t.totalTime}:([eQ.h.F1,eQ.h.MotoGP].includes(e.id)&&(i===n.CEM.Sprint?"gap"===s.key&&(a=1===t.position?t.time||t.totalTime||t.gap:"interval"===r?t.interval:t.gap):i===n.CEM.Race&&["time","totalTime"].includes(s.key)&&(a=1===t.position?t[s.key]||t.totalTime||t.gap:"interval"===r?t.interval||t.lapsBehind||t.gap:t.lapsBehind||t.gap)),[n.CEM.SprintQualifyingPart,n.CEM.Practice,n.CEM.PracticePart,n.CEM.Qualifying,n.CEM.QualifyingPart].includes(i)&&("gap"===s.key&&1===t.position&&(a=t.time||t.totalTime||t.gap),"time"===s.key&&(a=t.time||t.totalTime)),{...s,value:a})}))(e,s,l,i,r).filter(e=>sv(e,t))})(s.uniqueStage,l,t,a,o,r)})},sQ=()=>{let{standings:e,selectedRaceCategory:t}=tK();return(0,i.jsx)(m.az,{children:sS(e,t).map(e=>(0,i.jsx)(sY,{item:e},e.team.id))})},sN=()=>(0,i.jsxs)(m.BJ,{overflowX:"clip",flexGrow:1,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[(0,i.jsx)(sW,{}),(0,i.jsx)(sQ,{})]}),sJ=()=>(0,i.jsx)(m.VJ,{inline:"sm",children:(0,i.jsxs)(m.so,{children:[(0,i.jsx)(sF,{}),(0,i.jsx)(sN,{})]})}),sH=e=>{let{stage:t,data:s,error:n,loading:r,raceCategory:a}=e;return n?(0,i.jsx)(e_.p,{graphic:"race-start",descriptionMessageId:"motorsport_results_empty_message"}):r?(0,i.jsx)(m.az,{h:"[900px]"}):(0,i.jsx)(tU,{standings:s,selectedStageType:t.type.id,selectedRaceCategory:a,children:(0,i.jsxs)(m.BJ,{gap:"lg",children:[(0,i.jsx)(sJ,{}),(0,i.jsx)(tW,{}),(0,i.jsx)(sI,{})]})})},sV=e=>{let{stages:t}=e,[s,r]=(0,f.useState)(()=>tL(t)),{data:a,error:l,loading:o}=tl(s),d=e=>{r(t.find(t=>t.id===e))};(0,f.useEffect)(()=>{r(tL(t))},[t]);let c=function(e,t){return e.some(e=>e.type.id===n.CEM.Sprint)?e.find(e=>e.type.id===n.CEM.Sprint):t}(t,s);return(0,i.jsx)(P.tU,{variant:"tertiary",initialValue:s.id,onChange:d,children:(0,i.jsxs)(m.BJ,{gap:"lg",children:[c&&(0,i.jsx)(tP,{selectedStage:c}),(0,i.jsx)(m.az,{px:"sm",children:(0,i.jsx)(tp,{selectedStage:s,onStageChange:d,stages:t})}),(0,i.jsxs)(m.BJ,{children:[(0,i.jsx)(tj,{stage:s}),(0,i.jsx)(m.VJ,{inline:"sm",children:(0,i.jsx)(m.az,{w:"100%",h:"[1px]",bg:"neutrals.nLv4"})})]}),t.map(e=>(0,i.jsx)(P.tU.Panel,{tabKey:e.id,children:(0,i.jsx)(sH,{stage:e,data:a,error:l,loading:o})},e.id))]})})},sG=e=>{let{stages:t}=e,{stage:s}=(0,ed.a)();return!s.uniqueStage||t.length<1?null:[eQ.h.F1,eQ.h.MotoGP].includes(s.uniqueStage.id)?(0,i.jsx)(s$,{stage:t[0]}):(0,i.jsx)(sV,{stages:t})},s$=e=>{let{stage:t}=e,{stage:s}=(0,ed.a)(),n=tl(t),[r,a]=(0,f.useState)(tB.Summary),l=n.data.some(e=>void 0!==e.tyreInfo),o=n.data.some(e=>void 0!==e.personalFastestLapTime),d=o||l;return(0,i.jsx)(P.tU,{variant:"tertiary",initialValue:r,onChange:e=>{a(e)},children:(0,i.jsxs)(m.BJ,{gap:"lg",children:[t.stageParent&&(0,i.jsx)(tb.C,{stage:s,children:(0,i.jsx)(tA,{id:t.stageParent.id,stage:t})}),(0,i.jsx)(m.az,{pt:"sm",children:(0,i.jsx)(tj,{stage:t})}),(0,i.jsx)(m.az,{py:"xs",display:d?"flex":"none",children:(0,i.jsxs)(P.tU.List,{children:[(0,i.jsx)(P.tU.Tab,{tabKey:tB.Summary,children:(0,i.jsx)(b.A,{id:"summary"})}),l&&(0,i.jsx)(P.tU.Tab,{tabKey:tB.Tyres,children:(0,i.jsx)(b.A,{id:"motorsport_tyres"})}),o&&(0,i.jsx)(P.tU.Tab,{tabKey:tB.FastestLap,children:(0,i.jsx)(b.A,{id:"fastestLap.label"})})]})}),(0,i.jsx)(P.tU.Panel,{tabKey:tB.Summary,children:(0,i.jsx)(sH,{stage:t,...n,raceCategory:tB.Summary})}),(0,i.jsx)(P.tU.Panel,{tabKey:tB.Tyres,children:(0,i.jsx)(sH,{stage:t,...n,raceCategory:tB.Tyres})}),(0,i.jsx)(P.tU.Panel,{tabKey:tB.FastestLap,children:(0,i.jsx)(sH,{stage:t,...n,raceCategory:tB.FastestLap})})]})})},sZ=()=>{let{isMobile:e}=(0,P.$c)();return e?(0,i.jsxs)(m.BJ,{gap:"sm",px:"sm",mt:"-xs",children:[(0,i.jsx)(eb,{}),(0,i.jsx)(eC,{}),(0,i.jsx)(ej,{})]}):null},sX=["IT"],s0=e=>{let{stages:t}=e,s=(0,eY.Ae)(),{stage:r}=(0,ed.a)(),a=(0,ei.d4)(en.LQ),l=function(e){return{hasPracticeTab:e.practice.length>0,hasSprintTab:e.sprint.length>0,hasQualifyingTab:e.qualifying.length>0,hasRaceTab:e.race.length>0}}(t),[o,d]=(0,f.useState)(()=>tz(l,t));(0,f.useEffect)(()=>{d(tz(l,t))},[t]);let c=Object.values(l).filter(Boolean).length>1,u=function(e,t){var s;let i=[];return(null==(s=e.uniqueStage)?void 0:s.id)===eQ.h.MotoGP?i.push({key:n.CEM.Practice,available:t.hasPracticeTab},{key:n.CEM.Qualifying,available:t.hasQualifyingTab},{key:n.CEM.Sprint,available:t.hasSprintTab},{key:n.CEM.Race,available:t.hasRaceTab}):i.push({key:n.CEM.Practice,available:t.hasPracticeTab},{key:n.CEM.Sprint,available:t.hasSprintTab},{key:n.CEM.Qualifying,available:t.hasQualifyingTab},{key:n.CEM.Race,available:t.hasRaceTab}),i.filter(e=>e.available).map(e=>e.key)}(r,l);return(0,i.jsxs)(m.BJ,{gap:"md",mdDown:{bg:"surface.s0"},children:[(0,i.jsx)(m.az,{p:"sm",elevation:{mdDown:"2"},bg:"surface.s1",br:{md:"lg"},children:(0,i.jsx)(P.tU,{variant:"secondary",initialValue:o,onChange:e=>d(e),centered:!0,children:(0,i.jsxs)(m.BJ,{gap:"md",children:[(0,i.jsx)(m.az,{py:"[1px]",display:c?"flex":"none",children:(0,i.jsx)(P.tU.List,{children:u.map(e=>(0,i.jsx)(P.tU.Tab,{tabKey:e,children:(0,i.jsx)(b.A,{id:tR[e]})},e))})}),l.hasPracticeTab&&(0,i.jsx)(P.tU.Panel,{tabKey:n.CEM.Practice,children:(0,i.jsx)(sV,{stages:t.practice})}),l.hasSprintTab&&(0,i.jsx)(P.tU.Panel,{tabKey:n.CEM.Sprint,children:(0,i.jsx)(sV,{stages:t.sprint})}),l.hasQualifyingTab&&(0,i.jsx)(P.tU.Panel,{tabKey:n.CEM.Qualifying,children:(0,i.jsx)(sV,{stages:t.qualifying})}),t.race&&(0,i.jsx)(P.tU.Panel,{tabKey:n.CEM.Race,children:(0,i.jsx)(sG,{stages:t.race})})]})})}),(0,i.jsx)(sZ,{}),a&&!sX.includes(a)&&(0,i.jsx)(m.az,{md:{px:"sm",pb:"sm"},children:(0,i.jsx)(eT.z,{provider:s})})]})},s1=e=>{let{stages:t}=e,{stage:s}=(0,ed.a)(),r=(0,eY.Ae)(),a=(0,ei.d4)(en.LQ),l=t.some(e=>e.type.id===n.CEM.AfterStage),o=tn()(t,"sequence"),{data:d}=(0,eU.r)(s.id),c=(0,ei.d4)((0,tr.ce)(s)),[u,g]=(0,f.useState)(()=>(0,tu.VL)(t.filter(e=>e.type.id!==n.CEM.AfterStage))),[h,x]=(0,f.useState)(n.CEM.Stage),p=e=>{let s=t.find(t=>t.id===e);s&&g(s)},y=u;if(h===n.CEM.AfterStage&&u.sequence){var j;let e=null==(j=o[u.sequence])?void 0:j[1];e&&(y=e)}return(0,i.jsx)(m.BJ,{gap:"sm",mdDown:{p:"sm",bg:"surface.s0"},children:(0,i.jsx)(m.az,{p:"sm",br:"lg",bg:"surface.s1",children:(0,i.jsx)(P.tU,{variant:"tertiary",value:u.id,onChange:p,children:(0,i.jsxs)(m.BJ,{gap:"sm",children:[(0,i.jsx)(tp,{selectedStage:u,onStageChange:p,stages:t.filter(e=>e.type.id!==n.CEM.AfterStage)}),(0,i.jsxs)(m.BJ,{children:[(0,i.jsx)(tv,{selectedStage:u}),(0,i.jsx)(tm.M,{stage:u})]}),t.map(e=>(0,i.jsxs)(P.tU.Panel,{tabKey:e.id,children:[l&&(0,i.jsx)(P.tU,{variant:"secondary",initialValue:h,onChange:e=>x(e),fullWidthTabs:!0,children:(0,i.jsx)(m.so,{mb:"md",children:(0,i.jsxs)(P.tU.List,{children:[(0,i.jsx)(P.tU.Tab,{tabKey:n.CEM.Stage,children:(0,i.jsx)(m.az,{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",children:(0,i.jsx)(b.A,{id:"motorsport_wrc_stage",values:{n:e.sequence}})})}),(0,i.jsx)(P.tU.Tab,{tabKey:n.CEM.AfterStage,children:(0,i.jsx)(m.az,{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",children:(0,i.jsx)(b.A,{id:"motorsport_wrc_results_after_stage_x",values:{n:e.sequence}})})})]})})}),(0,i.jsx)(tc,{stage:y})]},e.id)),a&&!sX.includes(a)&&void 0!==d&&c&&(0,i.jsx)(m.az,{children:(0,i.jsx)(eT.z,{provider:r})})]})})})})};var s2=function(e){return e[e.Summary=1]="Summary",e[e.Daily=2]="Daily",e}({});let s5=e=>e.filter(e=>[n.CEM.AfterStage,n.CEM.Day].includes(e.type.id)).some(e=>[n.hzM.finished,n.hzM.inprogress].includes(e.status.type))?1:2,s4=e=>{let{stages:t}=e,{summaryStages:s,dailyStages:n}=(e=>{let t=e.stages[e.stages.length-1];return{summaryStages:[...e.afterStage,...e.dayStage,...t&&e.dayStage.length>0?[{...t,description:tg}]:[]],dailyStages:e.stages}})(t),[r,a]=(0,f.useState)(s5(s));return(0,f.useEffect)(()=>{a(s5(s))},[t]),(0,i.jsx)(m.BJ,{gap:"md",mdDown:{bg:"surface.s0"},children:(0,i.jsx)(m.az,{p:"sm",elevation:{mdDown:"2"},bg:"surface.s1",br:{md:"lg"},children:(0,i.jsx)(P.tU,{variant:"secondary",initialValue:r,onChange:e=>a(e),fullWidthTabs:!0,children:(0,i.jsxs)(m.BJ,{gap:"md",children:[(0,i.jsxs)(P.tU.List,{children:[(0,i.jsx)(P.tU.Tab,{tabKey:s2.Summary,children:(0,i.jsx)(b.A,{id:"summary"})}),(0,i.jsx)(m.az,{w:"lg"}),(0,i.jsx)(P.tU.Tab,{tabKey:s2.Daily,children:(0,i.jsx)(b.A,{id:"stages"})})]}),(0,i.jsx)(P.tU.Panel,{tabKey:s2.Summary,children:s.length>0?(0,i.jsx)(sV,{stages:s}):(0,i.jsx)(e_.p,{graphic:"race-start",descriptionMessageId:"motorsport_results_empty_message"})}),(0,i.jsx)(P.tU.Panel,{tabKey:s2.Daily,children:(0,i.jsx)(sV,{stages:n})})]})})})})},s9=e=>{var t;let{data:s}=e,{stage:n}=(0,ed.a)();return n.uniqueStage?n.uniqueStage.id===eQ.h.WRC&&(null==(t=n.info)?void 0:t.version)==="v2"?(0,i.jsx)(s4,{stages:s}):(0,i.jsx)(s0,{stages:s}):null},s3=e=>{var t;let{data:s}=e;return(0,F.o)()===n.QCR.Motorsport?(0,i.jsx)(s9,{data:s}):(0,i.jsx)(s1,{stages:s.race},null==(t=s.race[0])?void 0:t.id)},s6=()=>{let{data:e,error:t,loading:s}=eN();return t?null:s||!e?(0,i.jsx)(m.az,{h:"[900px]"}):(0,i.jsx)(s3,{data:e})};var s8=s(94122);let s7=[n.hzM.inprogress,n.hzM.finished],ie=(e,t,s,i,r)=>{if(e===n.QCR.Motorsport){if(!r)return ep.x.Results;let e=i?ep.x.Rankings:ep.x.Info;return s7.includes(t.status.type)?ep.x.Results:e}return ep.x.Results},it={[n.QCR.Cycling]:{[ep.x.Results]:"cycling_stages",[ep.x.Rankings]:"motorsport_overall_results"},[ep.x.Results]:"basic.results",[ep.x.Info]:"info",[ep.x.Rankings]:"rankings",[ep.x.Odds]:"odds",[ep.x.Media]:"media"},is=()=>{let{stage:e}=(0,ed.a)(),t=(0,F.o)(),{tab:s,setTab:r,hasInfo:a,hasRankings:l,hasMedia:o,hasOdds:d}=(()=>{let{stage:e}=(0,ed.a)(),t=(0,F.o)(),s=(0,ei.d4)(en.LQ),i=(0,ei.d4)(tr.BF),r=(0,ei.d4)((0,tr.ce)(e)),{data:a}=(0,eU.r)(e.id),{isDesktop:l,isMobile:o}=(0,P.$c)(),{hasMedia:d,hasSubstages:c}=(0,ev.A)({hasMedia:{route:n.dVR.highlights(e.id)},hasSubstages:{route:n.dVR.substages(e.id)}}),u=((e,t,s,i,r)=>{var a;return e===n.QCR.Cycling&&!!r&&void 0!==t.info||e===n.QCR.Motorsport&&(null==(a=t.info)?void 0:a.circuitCity)!==void 0&&!!s})(t,e,l,0,!!c),g=((e,t,s,i)=>e===n.QCR.Cycling&&t.type.id!==n.CEM.Discipline||e===n.QCR.Motorsport&&!!i)(t,e,0,o),[h,x]=(0,f.useState)(ie(t,e,l,o,u));return(0,f.useEffect)(()=>{x(ie(t,e,l,o,u))},[e]),{tab:h,setTab:x,hasInfo:u,hasRankings:g,hasMedia:d,hasOdds:s&&!s8.fe.includes(s)&&!i&&r&&void 0!==a}})(),{data:u}=(0,c.Ay)([n.dVR.standings(e.id,n.SNJ.Competitor),"HEAD"],{fetcher:eg.n}),g=function(e,t){let s=[ep.x.Results,t.hasInfo&&ep.x.Info,t.hasRankings&&ep.x.Rankings],i=[t.hasMedia&&ep.x.Media,t.hasOdds&&ep.x.Odds];return[...s,...e.status.type===n.hzM.finished?i:[...i].reverse()].filter(e=>!1!==e)}(e,{hasInfo:!!a&&t===n.QCR.Motorsport,hasRankings:t===n.QCR.Cycling?!!u:!!l,hasMedia:!!o,hasOdds:!!d});return(0,i.jsx)(el.WC,{variant:"inverse-desktop",children:(0,i.jsxs)(P.tU,{variant:"primary",fullWidthTabs:!0,value:s,onChange:e=>{r(e)},children:[(0,i.jsx)(m.az,{bg:"surface.s1",display:g.length>1?"flex":"none",children:(0,i.jsx)(P.tU.List,{children:g.map(s=>{var n;return(0,i.jsx)(P.tU.Tab,{tabKey:s,onClick:t=>{t.nativeEvent.isTrusted&&(0,em.yy)({id:e.id,location:ep.C.StagePage,type:s})},children:(0,i.jsx)(b.A,{id:(null==(n=it[t])?void 0:n[s])||it[s]})},s)})})}),(0,i.jsx)(m.az,{h:g.length<=1?"[53px]":"[1px]",borderBottom:"1px solid",borderBottomColor:"neutrals.nLv4"}),(0,i.jsx)(P.tU.Panel,{tabKey:ep.x.Results,children:(0,i.jsx)(s6,{})}),(0,i.jsx)(P.tU.Panel,{tabKey:ep.x.Info,children:(0,i.jsx)(ew,{})}),(0,i.jsx)(P.tU.Panel,{tabKey:ep.x.Rankings,children:(0,i.jsx)(ts,{})}),(0,i.jsx)(P.tU.Panel,{tabKey:ep.x.Odds,children:(0,i.jsx)(te,{})}),(0,i.jsx)(P.tU.Panel,{tabKey:ep.x.Media,children:(0,i.jsx)(ex.$U,{entityId:e.id,entityType:"stage",location:eh.D_.EventPage})})]})})},ii=e=>{let{stage:t}=e;return(0,n.S$s)()?null:(0,i.jsx)(ed.K,{stage:t,children:(0,i.jsxs)(el.Zp,{variant:"desktop-only",children:[(0,i.jsx)(eu,{}),(0,i.jsx)(is,{})]})})};var ir=s(81278);function ia(e,t,s){let i=(0,ir.useRouter)(),{isMobile:n}=(0,P.$c)();(0,f.useEffect)(()=>{switch(e){case d.Categories:(0,em.Mt)({name:document.title,link:i.asPath,type:i.route});break;case d.UniqueStage:t&&(0,em.u_)(t);break;case d.EventStage:s&&(0,em.vV)(s)}},[e,i,n])}function il(e){var t;let{sportSlug:s,page:n,params:a,eventStage:l}=e,o=(0,I.A)(),d=(0,v.A)();return ia(n,null==(t=l.uniqueStage)?void 0:t.id,l.id),(0,i.jsxs)(f.Fragment,{children:[(0,i.jsxs)(j(),{children:[(0,_.v)(s,o)?(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"}):null,(0,i.jsx)("link",{rel:"canonical",href:"https://www.sofascore.com".concat(r.z.getTranslatedCanonicalRoute(o,u[n],a).route)})]}),(0,i.jsx)(D.A,{metaKey:"categories"===n?s:"".concat(s,".stage"),descriptionKey:"main.".concat("categories"===n?s:"".concat(s,".stage")),values:{stage:"uniqueStage"!==n&&l.startDateTimestamp?"".concat(l.uniqueStage.name," ").concat(l.description," ").concat(d.formatDate(1e3*l.startDateTimestamp,{month:"short",year:"numeric"})):l.stageParent.description}}),(0,i.jsx)(E.YW,{children:(0,i.jsxs)(T.JR,{route:w.xW.StageSport,children:[(0,i.jsxs)(m.so,{bg:{mdDown:"surface.s1"},justify:"space-between",align:"center",children:[(0,i.jsxs)(S.B,{children:["categories"!==n?(0,i.jsx)(S.B.Item,{children:(0,i.jsx)(A.di,{translatedParams:{sport:s},children:(0,i.jsx)(b.A,{id:"sport.".concat(s)})})}):null,"eventStage"===n?(0,i.jsx)(S.B.Item,{children:(0,i.jsx)(A.So,{sportSlug:s,uniqueStage:l.uniqueStage,children:l.uniqueStage.name})}):null,(0,i.jsx)(S.B.Title,{children:"categories"===n?(0,i.jsx)(b.A,{id:"headerTitle.".concat(s)}):"uniqueStage"===n?l.uniqueStage.name:l.description})]}),"eventStage"===n&&(0,i.jsx)(m.az,{bg:"surface.s1",display:{md:"none"},py:"sm",pr:"lg",children:(0,i.jsx)(k.x,{id:l.id,uniqueStage:l.uniqueStage,location:M.y.Header})})]}),(0,i.jsx)(C.Ws,{value:s,children:(0,i.jsx)(N.c,{value:{selectedUniqueStageId:l.uniqueStage.id,selectedSeasonId:l.stageParent.id,selectedEventStageId:l.id},children:(0,i.jsxs)(E.xA,{children:[(0,i.jsxs)(E.fv,{mdDown:{display:"categories"===n?"block":"none"},flexGrow:1,children:[(0,i.jsx)(ea,{}),(0,i.jsx)(T.Aq,{route:w.xW.StageSport})]}),(0,i.jsx)(E.fv,{mdDown:{display:"uniqueStage"===n||"eventStage"===n?"block":"none",w:"100%"},flexGrow:1,children:"eventStage"!==n?(0,i.jsx)(h.GO,{},l.uniqueStage.id):(0,i.jsx)(ii,{stage:l})})]})})})]})})]},s)}var io=s(14676),id=s(74610);let ic=e=>{let{isActive:t,labelId:s,stage:r}=e;return(0,i.jsx)(A.So,{sportSlug:n.QCR.Cycling,uniqueStage:r,children:(0,i.jsx)(P.$n,{bg:t?"neutrals.nLv1":"surface.s2",size:"secondary",color:t?"surface.s1":"neutrals.nLv1",textStyle:"assistive.default",textTransform:"capitalize",children:(0,i.jsx)(b.A,{id:s})})})};function iu(e){var t;let{onChange:s,seasons:n,selectedSeasonId:r,isLoading:a}=e,l=n.findIndex(e=>e.id===r);return(0,i.jsxs)(m.so,{justify:"space-between",align:"center",gap:"xs",p:"xs",bg:"surface.s1",br:"sm",border:"2px solid {colors.neutrals.nLv4}",children:[(0,i.jsx)(P.K0,{variant:"clear",onClick:()=>{let e=l+1;e{let e=l-1;e>=0&&(null==s||s(n[e]))},disabled:n[0].id===r,children:(0,i.jsx)(L.CCT,{})})]})}function ig(e){let{seasons:t,onListTypeChange:s,listType:r,selectedSeasonId:a,selectedUniqueStageId:l,setSelectedSeasonId:o,isLoading:d}=e;return(0,i.jsx)(id.t,{tag:"CyclingRacesListHeader",children:(0,i.jsxs)(m.az,{display:{mdDown:"none"},px:"sm",pt:"sm",pb:"sm",children:[(0,i.jsxs)(m.so,{h:"4xl",align:"center",justify:"space-between",children:[(0,i.jsx)(P.tU,{variant:"primary",value:r,initialValue:r,onChange:s,children:(0,i.jsxs)(P.tU.List,{children:[(0,i.jsx)(P.tU.Tab,{tabKey:"races",children:(0,i.jsx)(b.A,{id:"races"})}),(0,i.jsx)(P.tU.Tab,{tabKey:"favorites",children:(0,i.jsx)(b.A,{id:"eventList.favorites"})})]})}),(0,i.jsx)(m.so,{align:"center",gap:"lg",flexGrow:1,justify:"flex-end",children:(0,i.jsx)(m.so,{align:"center",gap:"sm",children:(0,i.jsx)(iu,{onChange:e=>{o(e.id)},seasons:t,selectedSeasonId:a,isLoading:d})})})]}),(0,i.jsxs)(m.so,{h:"4xl",align:"flex-end",gap:"xs",borderTop:"1px solid {colors.neutrals.nLv4}",mt:"[-1px]",children:[(0,i.jsx)(ic,{labelId:"men",isActive:l===n.Q_.Men,stage:{id:9,slug:"cycling-men"}}),(0,i.jsx)(ic,{labelId:"women",isActive:l===n.Q_.Women,stage:{id:94,slug:"cycling-women"}})]})]})})}function ih(e){var t;let{seasons:s,selectedUniqueStageId:r,selectedSeasonId:a,setSelectedSeasonId:l}=e,o=s.findIndex(e=>e.id===a),d=(0,z.Ay)({isInMobileTabs:!1,isSportMenuVisible:!0});return(0,i.jsx)(tO.PI,{elevation:2,top:d,bg:"surface.s1",zIndex:tO.Py.Sticky-1,children:(0,i.jsxs)(m.so,{justify:"space-between",align:"center",p:"sm",children:[(0,i.jsxs)(m.so,{gap:"xs",children:[(0,i.jsx)(ic,{labelId:"men",isActive:r===n.Q_.Men,stage:{id:n.Q_.Men,slug:"cycling-men"}}),(0,i.jsx)(ic,{labelId:"women",isActive:r===n.Q_.Women,stage:{id:n.Q_.Women,slug:"cycling-women"}})]}),(0,i.jsx)(P.ms,{items:s,label:(0,i.jsx)(P.EY,{textStyle:"display.small",lineHeight:1,children:null==(t=s[o])?void 0:t.year}),selectedItem:s.find(e=>e.id===a),onSelectedItemChange:e=>{e.selectedItem&&l(e.selectedItem.id)},renderItem:e=>e?(0,i.jsx)(i.Fragment,{children:e.year}):null})]})})}function ix(e){var t,s,r;let{category:a,seasons:l,initialSeasonId:o,selectedEventStageId:d,selectedUniqueStageId:u,setSelectedEventStageId:g}=e,{isMobile:h}=(0,P.$c)(),x=(0,ei.d4)(e=>e.favorites.lists.stages),[p,y]=(0,f.useState)("races"),[j,v]=(0,f.useState)(o);(0,f.useEffect)(()=>{v(o)},[o]);let{races:b,error:S,isLoading:C}=function(e,t){let{data:s,error:i,isLoading:r}=(0,c.Ay)(n.dVR.extended(e),{fallbackData:t?{stage:{substages:t}}:void 0,keepPreviousData:!0,revalidateOnMount:!0});return{races:(null==s?void 0:s.stage.substages)||[],error:i,isLoading:r}}(j,a.substages);(0,f.useEffect)(()=>{d&&b.length>0&&requestAnimationFrame(()=>{let e=document.querySelector('[data-stage-id="'.concat(d,'"]'));if(e){let t=e.getBoundingClientRect().top+window.scrollY-112;requestAnimationFrame(()=>{window.scrollTo({top:t,behavior:"smooth"})})}})},[b]);let w=(t=b,s=p,r=x,h?t:"favorites"===s?t.filter(e=>r.includes(e.id)):t);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.az,{hideFrom:"md",children:(0,i.jsx)(ih,{seasons:l,selectedUniqueStageId:u,selectedSeasonId:j,setSelectedSeasonId:v})}),(0,i.jsxs)(el.Zp,{children:[(0,i.jsx)(m.az,{hideBelow:"md",children:(0,i.jsx)(ig,{seasons:l,listType:p,onListTypeChange:e=>{y(e)},selectedSeasonId:j,selectedUniqueStageId:u,setSelectedSeasonId:v,isLoading:C})}),(0,i.jsx)(m.so,{pt:{base:"sm",md:"0"},px:{base:"sm",md:"0"},bg:{base:"surface.s0",md:"[transparent]"},flexDirection:"column",gap:{base:"sm",md:"0"},pb:{md:"xl"},children:S?(0,i.jsx)(e_.p,{graphic:"race-start",descriptionMessageId:"stats.noResults"}):w.length>0?null==w?void 0:w.map((e,t)=>(0,i.jsx)(io._,{stage:e,isLast:t===w.length-1,sport:n.QCR.Cycling,isSelected:e.id===d,onClick:t=>{h||((0,em.vV)(e.id),t.preventDefault()),g(e.id)}},e.id)):(0,i.jsx)(e_.p,{graphic:"race-start",descriptionMessageId:"stats.noResults"})})]})]})}function ip(e){let{sportSlug:t,page:s,params:n,eventStage:a}=e,l=(0,v.A)(),o=(0,I.A)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(j(),{children:[(0,_.v)(t,o)?(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"}):null,(0,i.jsx)("link",{rel:"canonical",href:"https://www.sofascore.com".concat(r.z.getTranslatedCanonicalRoute(o,u[s],n).route)})]}),(0,i.jsx)(D.A,{metaKey:s===d.Categories?t:"".concat(t,".stage"),descriptionKey:"main.".concat(s===d.Categories?t:"".concat(t,".stage")),values:{stage:"uniqueStage"!==s&&a.startDateTimestamp?"".concat(a.uniqueStage.name," ").concat(a.description," ").concat(l.formatDate(1e3*a.startDateTimestamp,{month:"short",year:"numeric"})):a.stageParent.description}})]})}function im(e){var t,s,n,r;let{stageSeasons:a,extendedStage:l,race:o,page:c,params:u,sportSlug:g}=e,[x,p]=(0,f.useState)(()=>{var e,t,s,i;return null!=(i=null==o?void 0:o.id)?i:l.substages&&null!=(s=null==(e=(0,h.CS)(null!=(t=l.substages)?t:[]))?void 0:e.id)?s:0}),{isMobile:y}=(0,P.$c)(),j=null==(t=l.substages)?void 0:t.find(e=>e.id===x);return ia(c,null==(s=l.uniqueStage)?void 0:s.id,null==o?void 0:o.id),(0,i.jsxs)(f.Fragment,{children:[(0,i.jsx)(ip,{sportSlug:g,page:c,params:u,eventStage:o||j||l}),(0,i.jsx)(E.YW,{children:(0,i.jsxs)(T.JR,{route:w.xW.StageSport,children:[(0,i.jsx)(m.so,{bg:{mdDown:"surface.s1"},justify:"space-between",align:"center",children:(0,i.jsxs)(S.B,{children:[c!==d.Categories?(0,i.jsx)(S.B.Item,{children:(0,i.jsx)(A.di,{translatedParams:{sport:g},children:(0,i.jsx)(b.A,{id:"sport.".concat(g)})})}):null,c===d.EventStage?(0,i.jsx)(S.B.Item,{children:(0,i.jsx)(A.So,{sportSlug:g,uniqueStage:l.uniqueStage,children:l.uniqueStage.name})}):null,(0,i.jsx)(S.B.Title,{children:c===d.Categories?(0,i.jsx)(b.A,{id:"headerTitle.".concat(g)}):c===d.UniqueStage?l.uniqueStage.name:null!=(r=null==o?void 0:o.name)?r:l.name})]})}),(0,i.jsx)(C.Ws,{value:g,children:(0,i.jsxs)(E.xA,{children:[(0,i.jsx)(E.fv,{mdDown:{display:c===d.Categories||c===d.UniqueStage?"block":"none"},flexGrow:1,children:(0,i.jsx)(ix,{category:l,seasons:a,initialSeasonId:l.id,selectedEventStageId:x,setSelectedEventStageId:p,selectedUniqueStageId:l.uniqueStage.id})}),(0,i.jsx)(E.fv,{mdDown:{display:c===d.EventStage?"block":"none",w:"100%"},flexGrow:1,children:j&&(y?(0,i.jsx)(ii,{stage:o||j}):(0,i.jsx)(m.az,{position:"sticky",top:"[120px]",br:"lg",overflow:"hidden",style:(null==(n=j.info)?void 0:n.borderColor)?{outline:"2px solid ".concat(j.info.borderColor)}:void 0,children:(0,i.jsx)(P.Ee,{h:"[calc(100vh - 168px)]",resetDeps:[j.id],children:(0,i.jsx)(ii,{stage:j})})}))})]})})]})})]})}var iy=s(45906);let ij=e=>{let{error:t,...s}=e;return t?(0,i.jsx)(iy.default,{statusCode:t.code}):s.sportSlug===n.QCR.Cycling?(0,i.jsx)(im,{...s}):(0,i.jsx)(il,{...s})};ij.getInitialProps=p;let iv=ij},53597:(e,t,s)=>{"use strict";s.d(t,{TW:()=>a,HK:()=>l,qq:()=>c,Dl:()=>u,hT:()=>d,R5:()=>o});var i=s(95084),n=s(8041);let r="___sofa-wsc___",a=e=>{let{type:t,location:s,tournamentId:i,roundId:a,entityId:l,screen:o,provider:d}=e;return s===n.D_.PlayerPage||s===n.D_.TeamPage?"wsc"===d?"".concat(r).concat(o,"--").concat(t,"--").concat(s,"--").concat(l).concat(r):"".concat(o,"--").concat(t,"--").concat(s,"--").concat(l):"wsc"===d?"".concat(r).concat(o,"--").concat(t,"--").concat(s,"--").concat(i,"--").concat(a,"--").concat(l).concat(r):"".concat(o,"--").concat(t,"--").concat(s,"--").concat(i,"--").concat(a,"--").concat(l)},l=(e,t)=>{let[s,i,n,a,l,o]=("wsc"===t?(e=>{let t=new RegExp("".concat(r,"(.*?)").concat(r)),s=e.match(t);return s?s[1]:""})(e||""):e).split("--");return{screen:s,type:i,location:n,tournamentId:"null"===l||"undefined"===l?null:Number(a),roundId:"null"===l||"undefined"===l?null:Number(l),entityId:Number(o)}},o=e=>{let{screen:t,type:s,location:i,tournamentId:r,roundId:a,entityId:o}=l(e,"wsc"),d="Invalid WSC widget containerId: ".concat(e);if(e&&["single","multiple"].includes(s)&&["mobile","desktop"].includes(t)&&Object.values(n.D_).includes(i)){if(r&&isNaN(Number(r)));else if(a&&isNaN(Number(a)));else if(!isNaN(Number(o)))return!0}throw Error(d)},d=e=>{var t,s;let r=null==(t=e.detail)?void 0:t.eventData,a=(null==r?void 0:r.widget_id)||(null==r?void 0:r.origin_widget_id),o=null==(s=e.detail)?void 0:s.eventType;if(o&&a){let{entityId:e,tournamentId:t,location:s}=l(a,"wsc"),d=s===n.D_.TournamentPage&&t?t:e;switch(o){case"widget_click":(0,i.kA)({id:d,location:n.D_.EventMedia,provider:"wsc"});break;case"story_exit":(0,i.G9)({id:d,location:s,timeOnScreen:r.content_duration_viewed,provider:"wsc"})}}};function c(e,t,s,i){let r=Object.values(n.Dj).filter(r=>r===n.Dj.Highlights?!!(null==e?void 0:e.length)||!!(null==t?void 0:t.length):r===n.Dj.Clips?!!(null==s?void 0:s.length):r!==n.Dj.Social||!!(null==i?void 0:i.length));return 2===r.length&&r.shift(),{mediaChips:r}}function u(e){let t=[],s=[];return e.map((e,i)=>{i%2==0?t.push(e):s.push(e)}),{leftColumnPosts:t,rightColumnPosts:s}}},54092:(e,t,s)=>{"use strict";s.d(t,{i:()=>a});var i=s(16503),n=s(95084),r=s(53597);function a(e,t,s){let a=(0,r.HK)(e,s);return(0,i.e)(()=>t?(0,n.LJ)({id:a.entityId,location:a.location,provider:s}):(0,n.WG)({id:a.entityId,location:a.location,provider:s}))}},55575:(e,t,s)=>{var i=s(60567),n=s(27869),r=/&(?:amp|lt|gt|quot|#39);/g,a=RegExp(r.source);e.exports=function(e){return(e=i(e))&&a.test(e)?e.replace(r,n):e}},56132:(e,t,s)=>{"use strict";s.d(t,{C:()=>i,x:()=>n});var i=function(e){return e.EventWidget="event_widget",e.EventPage="event_page",e.FantasyCompetition="fantasy_competition",e.FavoritesPage="favorites_page",e.FightNight="fight_night",e.FighterPage="fighter_page",e.ManagerPage="manager_page",e.Organization="organization_page",e.PlayerPage="player_page",e.RefereePage="referee_page",e.TeamPage="team_page",e.TournamentPage="tournament_page",e.UniqueTournamentPage="unique_tournament_page",e.DroppingOddsPage="dropping_odds_page",e.FantasyLeague="fantasy_league",e.ProfilePage="profile_page",e.VenuePage="venue_page",e.MainPageAll="main_page_all",e.MainPageFavorites="main_page_favourites",e.MainPageCompetitions="main_page_competitions",e.ChallengePage="challenge_page",e.SearchPage="search_page",e.StagePage="stage_page",e.UniqueStagePage="unique_stage_page",e.DriverPage="driver_page",e.ConstructorPage="constructor_page",e}({}),n=function(e){return e.Summary="summary",e.Incidents="incidents",e.Details="details",e.Scorecard="scorecard",e.Overs="overs",e.BoxScore="box_score",e.Lineups="lineups",e.Statistics="statistics",e.Standings="standings",e.Transactions="transactions_tab",e.Graphs="graphs",e.Matches="matches",e.Odds="odds",e.FeaturedOdds="featured_odds",e.AdditionalOdds="additional_odds",e.Commentary="commentary",e.Games="games",e.Media="media",e.List="list",e.Editor="editor",e.Fights="fights",e.Info="info",e.Rankings="rankings",e.Race="race",e.Races="races",e.Squad="squad",e.TopPlayers="top_players",e.TopStats="top_stats",e.TopTeams="top_teams",e.Knockout="knockout",e.EarlyPrelims="early_prelims",e.MainCard="main_card",e.Other="other",e.Prelims="prelims",e.PlayByPlay="play_by_play",e.FantasyHome="fantasy_home",e.FantasyMyTeam="fantasy_my_team",e.FantasyFixtures="fantasy_fixtures",e.FantasyLeagues="fantasy_leagues",e.FantasyStatistics="fantasy_statistics",e.BetBoost="bet_boost",e.DroppingOdds="dropping_odds",e.WinningOdds="winning_odds",e.HighValueStreaks="high_value_streaks",e.Top20TeamStreaks="top_20_team_streaks",e.Top20H2H="top_20_h2h",e.PowerRankings="power_rankings",e.PlayerFantasy="player_fantasy",e.FantasyLeagueLeaderboard="fantasy_league_leaderboard",e.FantasyLeagueDetails="fantasy_league_details",e.FantasyLeagueSettings="fantasy_league_settings",e.Overview="overview",e.MyPredictions="my_predictions",e.Following="following",e.Contributions="contributions",e.Career="career",e.Season="season",e.PlayerStatistics="player_stats",e.All="all",e.Live="live",e.Finished="finished",e.Upcoming="upcoming",e.TodayMatches="today_matches",e.ChallengeCurrentWeek="current_week",e.ChallengePreviousWeek="previous_week",e.History="history",e.AiInsights="ai_insights",e.Players="players",e.Events="events",e.Teams="teams",e.Competitions="competitions",e.Athletes="athletes",e.Suggested="suggested",e.Recent="recent",e.Results="results",e}({})},61628:(e,t,s)=>{"use strict";s.d(t,{$U:()=>L,tl:()=>x});var i=s(6029),n=s(51569),r=s(20325),a=s(55729),l=s(90248),o=s(52466),d=s(95084);let c=()=>(0,i.jsxs)(r.so,{h:"xl",br:"sm",py:"xs",px:"[6px]",position:"absolute",align:"center",top:"sm",right:"sm",gap:"xs",bgColor:"overlay.darken3",children:[(0,i.jsx)(o.sZC,{color:"onColor.primary"}),(0,i.jsx)(n.EY,{textStyle:"assistive.default",fontWeight:550,color:"onColor.primary",children:(0,i.jsx)(l.A,{id:"basic.official"})})]});var u=s(70893);let g=(0,s(62042).Fj)({base:{padding:"sm",borderRadius:"50%",position:"absolute",bgColor:"overlay.darken2"},variants:{mediaType:{video:{top:{base:"[60px]",md:"md"},right:{md:"[175px]"},left:{mdDown:"md"}},story:{top:{base:"[70px]",md:"xl"},right:{md:"xl"},left:{mdDown:"lg"}}}}}),h=(0,r.I4)("div",g),x=e=>{let{url:t,title:s,mediaType:n,showPlayer:a,setShowPlayer:l}=e;return(0,i.jsxs)(r.so,{h:"100%",w:"100%",position:"fixed",display:a?void 0:"none",left:"0",top:"0",zIndex:"modal",children:[(0,i.jsx)(h,{mediaType:n,_hover:{bg:"overlay.darken1"},onClick:()=>l(e=>!e),children:(0,i.jsx)(o.zQC,{h:"30",w:"30",icon:"close",style:{cursor:"pointer"},color:"onColor.primary"})}),(0,i.jsx)("iframe",{src:t,width:"100%",height:"100%",title:s,style:{border:"none"},loading:"lazy"})]})},p=e=>{var t,s,g,h,p;let{entityId:m,entityType:y,highlight:j,videoHighlight:f,location:v,provider:b}=e,[S,C]=(0,a.useState)(!1),w=null!=(t=null==j?void 0:j.url.includes("/embed/"))?t:!(null==f?void 0:f.url),_=null!=(g=null!=(s=null==j?void 0:j.thumbnailUrl)?s:null==f?void 0:f.backgroundUrl)?g:"/static/images/media/media_thumbnail_placeholder.png",T=null!=(h=null==j?void 0:j.url)?h:null==f?void 0:f.url,E=null!=(p=null==j?void 0:j.title)?p:"video_highlights_title";return(0,i.jsxs)(r.so,{w:"100%",h:"[194px]",br:"sm",direction:"column",position:"relative",overflow:"hidden",cursor:"pointer",onClick:()=>{(0,d.Xy)({category:"highlights",id:m,location:v,type:"media"})},children:[(0,i.jsx)(r.I4.a,{href:T,target:"_blank",rel:"noopener noreferrer",w:"100%",h:"100%",position:"absolute",zIndex:"[3]"}),_&&(0,i.jsx)(u.Af,{imageUrl:_}),(0,i.jsxs)(r.so,{w:"100%",h:"100%",justify:"center",align:"center",bg:"overlay.darken1",zIndex:"button",onClick:()=>{w&&C(e=>!e)},children:[(null==j?void 0:j.keyHighlight)&&(0,i.jsx)(c,{}),(0,i.jsx)(o.reY,{w:"48px",h:"48px",color:"onColor.primary"}),"fiba"===b&&"event"===y&&(0,i.jsx)(u.sD,{eventId:m})]}),(0,i.jsxs)(r.so,{w:"100%",maxH:"6xl",direction:"column",bg:"overlay.darken3",px:"lg",py:"sm",gap:"xs",zIndex:"button",cursor:"default",children:[(0,i.jsx)(n.EY,{textStyle:"display.small",color:"onColor.primary",truncate:!0,children:j?E:(0,i.jsx)(l.A,{id:E})}),(0,i.jsx)(n.EY,{textStyle:"assistive.default",color:"onColor.primary",lineClamp:2,children:null==j?void 0:j.subtitle})]}),(0,i.jsx)(r.az,{w:"[350px]",h:"[194px]",cursor:"pointer",bgPosition:"center",bgSize:"cover",position:"absolute",zIndex:"backdrop",alignSelf:"center",style:{backgroundImage:"url(".concat(_,")")}}),w&&S&&T&&(0,i.jsx)(n.ZL,{children:(0,i.jsx)(x,{url:T,title:E,mediaType:"video",showPlayer:!!S,setShowPlayer:C})})]})};var m=s(22375),y=s(90510),j=s(40598);let f=e=>{let{post:t,isMobile:s,entityId:l,location:c}=e,[g,h]=(0,a.useState)(0),[p,f]=(0,a.useState)(!1),[v]=t.text.split(" ").filter(e=>e.includes("https")),b=t.text.replace(v,"").split("\n\n"),S="https://x.com/"+t.account.handle+"/status/"+t.id,C=S.includes("x.com");return(0,i.jsxs)(r.so,{w:"100%",h:"fit",direction:"column",overflow:"hidden",cursor:"pointer",backgroundColor:s?"surface.s1":"surface.s2",br:"sm",pb:"sm",onClick:()=>{(0,d.Xy)({category:"social",id:l,location:c,type:"media"})},children:[(0,i.jsx)(j.F,{autoScrollDelay:5*m.Z2,activeIndex:g,setActiveIndex:h,showControls:t.media.length>1,transitionDuration:"slowest",children:t.media.map(e=>(0,i.jsxs)(j.F.Slide,{children:[(0,i.jsxs)(r.so,{w:"100%",h:"100%",minH:"[200px]",justifyContent:"center",alignItems:"center",children:[e.videoUrl&&(0,i.jsx)(u.Dt,{setShowWebviewContent:f}),(0,i.jsx)(r.az,{w:"100%",h:"100%",backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",zIndex:"button",onClick:()=>{window.open(S)},style:{backgroundImage:"url(".concat(e.imageUrl,")")}}),(0,i.jsx)(u.Af,{imageUrl:e.imageUrl})]}),p&&e.videoUrl&&(0,i.jsx)(n.ZL,{children:(0,i.jsx)(x,{url:e.videoUrl,mediaType:"video",showPlayer:!!p,setShowPlayer:f})})]},e.id))}),(0,i.jsxs)(r.BJ,{gap:"lg",px:"lg",pt:"lg",onClick:()=>{window.open(S)},children:[(0,i.jsxs)(r.so,{justifyContent:"space-between",children:[(0,i.jsxs)(r.so,{gap:"sm",children:[(0,i.jsx)(n._V,{w:"2xl",h:"2xl",src:t.account.profilePictureUrl,alt:"Profile image"}),(0,i.jsxs)(r.so,{direction:"column",children:[(0,i.jsxs)(r.so,{direction:"row",gap:"2xs",children:[(0,i.jsx)(n.EY,{textStyle:"display.small",children:t.account.name}),(0,i.jsx)(o.sZC,{color:"primary.default"})]}),(0,i.jsxs)(n.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:["@",t.account.handle]})]})]}),C&&(0,i.jsx)(o.fOh,{})]}),(0,i.jsx)(n.EY,{textStyle:"body.mediumParagraph",whiteSpace:"pre-line",children:b.join("\n\n")}),(0,i.jsx)(n.EY,{textStyle:"body.mediumParagraph",color:"neutrals.nLv3",children:(0,i.jsx)(y.XU,{value:new Date(1e3*t.createdAtTimestamp),...m.or.dateWithShortMonth,timeZone:"UTC"})})]})]})};var v=s(85962),b=s(8041);let S=e=>{let{sectionType:t,selectedTab:s,location:a,hasMoreContent:d=!1,hasMediaChips:c=!0,children:u,onTabChange:g}=e,h=t===s&&c||a===b.D_.Widget;return(0,i.jsxs)(r.so,{w:"100%",h:"100%",gap:"md",direction:"column",px:"lg",children:[(0,i.jsxs)(r.so,{hideBelow:"md",hideFrom:h?["lg","md"]:void 0,w:"100%",justifyContent:"space-between",alignItems:"center",pt:"md",children:[(0,i.jsx)(n.EY,{textStyle:"display.large",children:(0,i.jsx)(l.A,{id:b.bh[t]})}),d&&(0,i.jsxs)(n.$n,{variant:"clear",size:"tertiary",cursor:"pointer",onClick:()=>g(t),children:[(0,i.jsx)(n.EY,{textStyle:"display.micro",color:"primary.default",children:(0,i.jsx)(l.A,{id:"see_all"})}),(0,i.jsx)(o.CCT,{color:"primary.default"})]})]}),u]})},C=e=>{let{entityId:t,entityType:s,highlights:n,videoHighlights:l,location:o,selectedTab:d,isMobile:c,hasMediaChips:u,onTabChange:g}=e,h=(0,a.useMemo)(()=>{let e=n?[...n]:void 0;return null==e?void 0:e.reverse()},[n]),x=d===b.Dj.All&&!c&&o!==b.D_.Widget&&u,m=n&&n.length>2&&d===b.Dj.All&&u;return(0,i.jsx)(S,{sectionType:b.Dj.Highlights,selectedTab:d,location:o,hasMoreContent:null!=m&&m,hasMediaChips:u,onTabChange:()=>g(b.Dj.Highlights),children:(0,i.jsxs)(r.xA,{gridTemplateColumns:o===b.D_.Widget?"1fr":{base:"1fr 1fr",mdDown:"1fr"},gap:"sm",children:[null==h?void 0:h.map((e,n)=>{if(!x||!(n>1))return(0,i.jsx)(p,{entityId:t,entityType:s,highlight:e,location:o},n)}),null==l?void 0:l.map((e,n)=>{if(!x||!(n>1))return(0,i.jsx)(p,{entityId:t,entityType:s,videoHighlight:e,location:o,provider:"fiba"},n)})]})})};var w=s(53597);let _=e=>{let{entityId:t,socialPosts:s,location:n,selectedTab:a,isMobile:l,hasMediaChips:o,onTabChange:d}=e,c=a===b.Dj.All&&!l&&n!==b.D_.Widget&&o,u=s.length>2&&a===b.Dj.All&&o,{leftColumnPosts:g,rightColumnPosts:h}=(0,w.Dl)(s);return l||n===b.D_.Widget?(0,i.jsx)(r.xA,{gridTemplateColumns:"1fr",gap:"sm",px:"lg",children:s.map((e,s)=>{if(!c||!(s>1))return(0,i.jsx)(f,{entityId:t,post:e,isMobile:l,location:n},s)})}):(0,i.jsx)(S,{sectionType:b.Dj.Social,selectedTab:a,location:n,hasMoreContent:u,hasMediaChips:o,onTabChange:()=>d(b.Dj.Social),children:(0,i.jsxs)(r.xA,{gridTemplateColumns:{base:"1fr 1fr",mdDown:"1fr"},gap:"sm",children:[(0,i.jsx)(r.so,{w:"100%",h:"100%",gap:"sm",direction:"column",children:g.map((e,s)=>c&&s>0||!e?null:(0,i.jsx)(f,{entityId:t,post:e,isMobile:l,location:n},s))}),(0,i.jsx)(r.so,{w:"100%",h:"100%",gap:"sm",direction:"column",children:h.map((e,s)=>{if((!c||!(s>0))&&e)return(0,i.jsx)(f,{entityId:t,post:e,isMobile:l,location:n},s)})})]})})};var T=s(23659),E=s(8126);let M=e=>{let{entityId:t,clips:s,location:l,selectedTab:o,isMobile:d,isLive:c,hasMediaChips:u,onTabChange:g}=e,{isDesktop:h}=(0,n.$c)(),[x,p]=(0,a.useState)(null),[m,y]=(0,a.useState)(!0);(0,T.P)(x,m,p,y);let j=o===b.Dj.All&&!d&&l!==b.D_.Widget&&u,f=s.length>6&&o===b.Dj.All&&u,C=s.filter(e=>!e.storyUrl);return(0,i.jsx)(S,{sectionType:b.Dj.Clips,selectedTab:o,location:l,hasMoreContent:f,hasMediaChips:u,onTabChange:()=>g(b.Dj.Clips),children:(0,i.jsxs)(r.xA,{gridTemplateColumns:l===b.D_.Widget?"1fr":{base:"repeat(6, 1fr)",mdDown:"1fr"},gap:"sm",children:[s.map((e,s)=>{if((!j||!(s>5))&&e.storyUrl)return(0,i.jsx)(v.r,{entityId:t,clip:e,location:l,isDesktop:h,isLive:c},s)}),C.map((e,s)=>(0,i.jsx)(E.r,{type:"single",location:l,entityId:t,screen:h?b.te.Desktop:b.te.Mobile,blazeSDK:x,clip:e,provider:"wsc",awaitBlazeSDK:m},s))]})})},k=e=>{let{mediaChips:t,selectedTab:s,location:r,onTabChange:a}=e;return(0,i.jsx)(n.PI,{p:"sm",bgColor:"surface.s1",borderBottom:r===b.D_.Widget?"1px solid {colors.neutrals.nLv4}":void 0,top:50*(r!==b.D_.Widget),children:(0,i.jsx)(n.tU,{variant:"tertiary",initialValue:t[0],value:s,onChange:e=>a(e),children:(0,i.jsx)(n.tU.List,{children:t.map(e=>(0,i.jsx)(n.tU.Tab,{tabKey:e,children:(0,i.jsx)(l.A,{id:b.bh[e]})},"media-tab-".concat(e)))})})})};var I=s(56132),A=s(46787),D=s(494),P=s(45860),z=s(72753);let L=e=>{let{entityId:t,entityType:s,location:l,isInProgress:o,fetchSocialPosts:d}=e,{isMobile:c}=(0,n.$c)(),[u,g]=(0,a.useState)(b.Dj.All),{highlights:h,videoHighlights:x,clips:p,socialPosts:y}=function(e,t,s,i){let n=(0,D.d4)(z.LQ),r="",a="",l="",o="";"event"===t&&(r=A.bnp.eventHighlights(e),a=n?A.vCt.eventVideoStories(e,n):"",l=n?A.vCt.eventVideoHighlights(e,n):"",o=A.bnp.eventPosts(e)),"stage"===t&&(r=A.dVR.highlights(e));let{data:d}=(0,P.Ay)(r),{data:c}=(0,P.Ay)(a,{refreshInterval:s?3*m.pY:0}),{data:u}=(0,P.Ay)(l),{data:g}=(0,P.Ay)(o,{refreshInterval:i?15*m.Z2:0}),h=null==d?void 0:d.highlights,x=null==c?void 0:c.videoStories,p=null==u?void 0:u.sportVideoHighlights,y=null==g?void 0:g.tweets;return{highlights:h&&h.length>0?h:void 0,videoHighlights:x&&x.length>0?x:void 0,clips:p&&p.length>0?p:void 0,socialPosts:y&&y.length>0?y:void 0}}(t,s,o,d),{mediaChips:j}=(0,a.useMemo)(()=>(0,w.qq)(h,x,p,y),[h,x,p,y]),f=1!==j.length||c||l===b.D_.Widget;(0,a.useEffect)(()=>{g(j[0])},[j]);let{highlights_:v,clips_:S}=(0,a.useMemo)(()=>({highlights_:h,clips_:p}),[h,p]),T=(v||x)&&(u===b.Dj.All||u===b.Dj.Highlights),E=S&&(u===b.Dj.All||u===b.Dj.Clips),L=y&&(u===b.Dj.All||u===b.Dj.Social);return(0,i.jsx)(n.tU.Panel,{tabKey:I.x.Media,children:(0,i.jsxs)(r.BJ,{pb:"md",pt:j?void 0:"md",children:[f&&(0,i.jsx)(k,{mediaChips:j,selectedTab:u,location:l,onTabChange:g}),(0,i.jsxs)(r.BJ,{children:[T&&(0,i.jsx)(C,{entityId:t,entityType:s,highlights:v,videoHighlights:x,location:l,selectedTab:u,isMobile:c,hasMediaChips:f,onTabChange:g}),E&&(0,i.jsx)(M,{entityId:t,clips:S,location:l,selectedTab:u,isMobile:c,onTabChange:g,hasMediaChips:f,isLive:null!=o&&o}),L&&(0,i.jsx)(_,{entityId:t,socialPosts:y,location:l,selectedTab:u,isMobile:c,hasMediaChips:f,onTabChange:g})]})]})})}},67087:(e,t,s)=>{"use strict";s.d(t,{gm:()=>i.A,g3:()=>n.A,mJ:()=>r.A,jr:()=>a.A,AR:()=>o,h2:()=>g});var i=s(81162),n=s(95700),r=s(15946),a=s(41397),l=s(494);function o(e){let t=(0,l.d4)(t=>{let{favorites:{events:s}}=t;return s[e.id]}),[s,i]=(0,a.A)(e,"homeTeam","awayTeam",e),[n,r]=(0,a.A)(e,"homeScore","awayScore",e);return{event:t||e,leftTeam:s,rightTeam:i,leftScore:n,rightScore:r}}var d=s(46787),c=s(55729),u=s(18970);function g(e,t){var s,n;let{event:r,leftTeam:a,rightTeam:l}=(0,c.useContext)(u.y$),o=(0,i.A)(r,"winnerCode"),g=(r.status.code===d.sum.AET||r.status.code===d.sum.AP)&&r.tournament.category.sport.slug===d.QCR.IceHockey,h=e?t=>e===t:t||(()=>!1),x=h(a.id,r.id)||(null==(s=a.subTeams)?void 0:s.some(e=>h(e.id,r.id))),p=h(l.id,r.id)||(null==(n=l.subTeams)?void 0:n.some(e=>h(e.id,r.id)));switch(o){case d.Jfo.Left:if(x)return d.h18.Win;if(p)return g?d.h18.OvertimeLoss:d.h18.Lose;break;case d.Jfo.Right:if(x)return g?d.h18.OvertimeLoss:d.h18.Lose;if(p)return d.h18.Win;break;case d.Jfo.Draw:if(x||p)return d.h18.Draw}}},69352:(e,t,s)=>{"use strict";s.d(t,{M:()=>o});var i=s(6029),n=s(51569),r=s(20325),a=s(90248),l=s(52466);let o=e=>{let{activeIndex:t,setActiveIndex:s,slideCount:o,goToPrevious:d,goToNext:c,onPageClick:u,infinite:g=!0,hideForSingleItem:h=!1}=e;if(h&&o<=1)return null;let x=1===o,p=x||0===t&&!g,m=x||t===o-1&&!g;return(0,i.jsxs)(r.so,{justify:{base:"center",md:"space-between"},align:"center",gap:"sm",pt:"sm",children:[(0,i.jsx)(r.so,{w:"[0]",flexGrow:1,children:(0,i.jsxs)(n.$n,{display:{mdDown:"none"},size:"tertiary",variant:"clear",onClick:d,disabled:p,ps:"0",children:[(0,i.jsx)(l.pa2,{}),(0,i.jsx)(a.A,{id:"previous"})]})}),(0,i.jsx)(r.so,{gap:"sm",w:"[0]",flexGrow:1,justify:"center",children:Array.from({length:o}).map((e,n)=>{let a=()=>{s(n),null==u||u()};return(0,i.jsx)(r.az,{w:"sm",h:"sm",transitionProperty:"background-color",transitionDuration:"normal",transitionTimingFunction:"ease-in-out",backgroundColor:n===t?"primary.default":"primary.highlight",br:"50%",cursor:"pointer",onKeyDown:e=>{"Enter"===e.key&&a()},onClick:a,tabIndex:0,_focusVisible:{outline:"2px solid",outlineColor:"primary.highlight"},role:"button","aria-label":"Slide number ".concat(n+1),"aria-hidden":n!==t},n)})}),(0,i.jsx)(r.so,{w:"[0]",flexGrow:1,justify:"end",children:(0,i.jsxs)(n.$n,{display:{mdDown:"none"},size:"tertiary",variant:"clear",onClick:c,disabled:m,pe:"0",children:[(0,i.jsx)(a.A,{id:"next"}),(0,i.jsx)(l.CCT,{})]})})]})}},70893:(e,t,s)=>{"use strict";s.d(t,{Af:()=>o,sD:()=>c,Dt:()=>d});var i=s(6029),n=s(33144),r=s(20325),a=s(52466),l=s(67087);let o=e=>{let{imageUrl:t}=e;return(0,i.jsx)(r.az,{w:"100%",h:"100%",position:"absolute",overflow:"hidden",bgSize:"[100% 100%]",bgPosition:"center",filter:"auto",blur:"[25px]",scale:"auto",zIndex:"backdrop",style:{backgroundImage:"url(".concat(t,")")}})},d=e=>{let{setShowWebviewContent:t,children:s}=e;return(0,i.jsxs)(r.so,{w:"100%",h:"100%",position:"absolute",justify:"center",align:"center",zIndex:"fixed",overflow:"hidden",bg:"overlay.darken1",onClick:()=>t(e=>!e),children:[(0,i.jsx)(a.reY,{w:40,h:40,color:"onColor.primary"}),s]})},c=e=>{let{eventId:t}=e,{event:s}=(0,l.mJ)(t);return(0,i.jsxs)(r.so,{w:"[374px]",justify:"center",align:"center",gap:"[90px]",position:"absolute",top:"[23%]",children:[(0,i.jsx)(n.p,{id:null==s?void 0:s.homeTeam.id,size:72}),(0,i.jsx)(n.p,{id:null==s?void 0:s.awayTeam.id,size:72})]})}},74664:(e,t,s)=>{"use strict";s.d(t,{A:()=>a,o:()=>l});var i=s(46787),n=s(55729);let r=(0,n.createContext)(i.QCR.Football),a=r,l=()=>{let e=(0,n.useContext)(r);if(!e)throw Error("useSport must be used within SportContext component");return e}},78492:(e,t,s)=>{var i=s(50956);e.exports=function(e,t,s,n){return i(e,function(e,i,r){t(n,e,s(e),r)}),n}},79634:(e,t,s)=>{"use strict";s.d(t,{q:()=>i.q});var i=s(39975)},81162:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var i=s(95700);function n(e,t,s){let n=(0,i.A)(s);if(!(e&&t))return;let r=e[t];if("number"==typeof r)return n&&[1,2].includes(r)?1===r?2:1:r}},81648:e=>{e.exports=function(e,t,s,i){for(var n=-1,r=null==e?0:e.length;++n{"use strict";s.d(t,{d:()=>o});var i=s(6029),n=s(51569),r=s(20325),a=s(90248),l=s(52466);let o=e=>{let{setReloadTrigger:t}=e,{isMobile:s}=(0,n.$c)();return(0,i.jsxs)(r.so,{w:"100%",h:"100%",px:{base:"sm",mdDown:void 0},position:"absolute",bgColor:"neutral.variant",direction:"column",align:"center",justify:"center",rowGap:"sm",cursor:"pointer",zIndex:"fixed",onClick:()=>{t(e=>!e)},children:[(0,i.jsx)(l.iQw,{color:"onColor.primary"}),(0,i.jsxs)(r.so,{direction:"column",children:[(0,i.jsx)(n.EY,{textStyle:"body.mediumParagraph",textAlign:"center",color:"onColor.primary",children:(0,i.jsx)(a.A,{id:"video_not_loading"})}),(0,i.jsx)(n.EY,{textStyle:"body.mediumParagraph",textAlign:"center",color:"onColor.primary",children:(0,i.jsx)(a.A,{id:s?"tap_to_retry":"click_to_retry"})})]})]})}},85962:(e,t,s)=>{"use strict";s.d(t,{h:()=>g,r:()=>h});var i=s(6029),n=s(51569),r=s(62042),a=s(20325),l=s(8041),o=s(95084),d=s(48253),c=s(70893);let u=(0,r.Fj)({base:{w:"100%",maxW:"[116px]",h:"100%",minH:"[174px]",flexGrow:1,position:"relative",overflow:"hidden",br:"sm",cursor:"pointer",mdDown:{maxW:"100%",minH:"[194px]"}},variants:{isWidget:{true:{maxW:"100%",minH:"[194px]"}}}}),g=(0,a.I4)("div",u),h=e=>{let{entityId:t,clip:s,location:r,isLive:u,isDesktop:h}=e,x=h&&r!==l.D_.Widget?s.storyThumbnailUrls[1].url:s.storyThumbnailUrl;return(0,i.jsx)(g,{isWidget:r===l.D_.Widget,children:(0,i.jsxs)(a.so,{w:"100%",h:"100%",position:"absolute",cursor:"pointer",justify:"center",align:"center",children:[u&&(0,i.jsx)(d.m,{}),(0,i.jsx)(a.so,{w:"100%",h:"1/2",p:"sm",alignSelf:"flex-end",zIndex:"stickyTertiary",style:{background:"linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%)",pointerEvents:"none"},children:(0,i.jsx)(n.EY,{textStyle:"display.small",fontWeight:700,color:"onColor.primary",alignSelf:"flex-end",lineClamp:3,children:s.title})}),(0,i.jsx)(a.az,{w:"100%",h:"100%",position:"absolute",zIndex:"fixed",onClick:()=>{window.open(s.storyUrl),(0,o.Xy)({category:"clips",id:t,location:r,type:"media"})}}),(0,i.jsx)(a.az,{w:r!==l.D_.Widget&&h?"100%":"[373px]",h:"100%",br:"sm",position:"absolute",alignSelf:"center",zIndex:"button",bgPosition:"center",bgSize:{base:r===l.D_.Widget?"contain":"cover",mdDown:"contain"},bgRepeat:"no-repeat",style:{backgroundImage:"url(".concat(x,")")}}),(0,i.jsx)(c.Af,{imageUrl:x})]})})}},88658:(e,t,s)=>{"use strict";s.d(t,{B:()=>h});var i=s(6029),n=s(51569),r=s(62042),a=s(20325);let l=(0,r.Fj)({base:{display:"inline-block",verticalAlign:"bottom",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"neutrals.nLv3",textStyle:"assistive.default","& > a":{color:"primary.default",_hover:{textDecoration:"underline"}},"& + li":{_before:{content:'""',display:"inline-block",width:"[0px]",height:"[0px]",borderStyle:"solid",margin:"[1px 5px]",borderYWidth:"[3px]",borderStartWidth:"[5px]",borderEndWidth:"0",borderTopColor:"[transparent]",borderEndColor:"[transparent]",borderBottomColor:"[transparent]",borderStartColor:"[currentColor]"}},"&:first-child:nth-last-child(3)":{maxWidth:"[50%]"},"&:first-child:nth-last-child(3) ~ &":{maxWidth:"[50%]"},"&:first-child:nth-last-child(4)":{maxWidth:"[33.33%]"},"&:first-child:nth-last-child(4) ~ &":{maxWidth:"[33.33%]"},"&:last-child":{display:"inline",whiteSpace:"initial"}},variants:{placement:{onColor:{color:"onColor.primary","& > a":{color:"onColor.primary"}},default:{color:"neutrals.nLv3","& > a":{color:"primary.default"}}}}}),o=(0,a.I4)("li",l),d=(0,r.Fj)({base:{display:"flow-root",lineClamp:1,lineHeight:"[16px]",boxOrient:"vertical",overflow:"hidden",listStyle:"none",margin:"0",padding:"0","&:has(.breadcrumb-title)":{lineClamp:2},"& > li":{lineHeight:"[16px]"}},variants:{placement:{onColor:{color:"onColor.primary"},default:{color:"neutrals.nLv3"}}}}),c=(0,a.I4)("ul",d),u=(0,r.Fj)({base:{mdDown:{bg:"surface.s1"},"&:has(.breadcrumb-title)":{py:"md",px:"lg",md:{px:"0"},"@supports not selector(:has(a, b))":{py:"md",px:"lg",md:{px:"0"}}}},variants:{noBg:{true:{mdDown:{bg:"[transparent]",padding:"[0px !important]"}}}}}),g=(0,a.I4)("div",u),h=e=>{let{children:t,noBg:s,onColor:n}=e;return(0,i.jsx)(g,{noBg:s,children:(0,i.jsx)(c,{placement:n?"onColor":"default",children:t})})};h.Item=e=>{let{children:t,onColor:s}=e;return(0,i.jsx)(o,{placement:s?"onColor":"default",children:t})},h.Title=e=>{let{children:t,onColor:s}=e;return(0,i.jsx)(n.Li,{display:"inline",className:"breadcrumb-title",color:s?"onColor.secondary":void 0,children:(0,i.jsx)(n.H1,{display:"inline",textStyle:"assistive.default",color:s?"onColor.secondary":"neutrals.nLv3",children:t})})}},90510:(e,t,s)=>{"use strict";s.d(t,{XU:()=>u,Gr:()=>h,ib:()=>g});var i,n,r=s(13829),a=s(55729),l=s(947);!function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"}(i||(i={})),function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"}(n||(n={}));var o=function(e){var t=(0,l.A)(),s=e.value,i=e.children,n=(0,r.Tt)(e,["value","children"]);return i(t.formatNumberToParts(s,n))};function d(e){var t=function(t){var s=(0,l.A)(),i=t.value,n=t.children,a=(0,r.Tt)(t,["value","children"]),o="string"==typeof i?new Date(i||0):i;return n("formatDate"===e?s.formatDateToParts(o,a):s.formatTimeToParts(o,a))};return t.displayName=n[e],t}function c(e){var t=function(t){var s=(0,l.A)(),i=t.value,n=t.children,o=(0,r.Tt)(t,["value","children"]),d=s[e](i,o);if("function"==typeof n)return n(d);var c=s.textComponent||a.Fragment;return a.createElement(c,null,d)};return t.displayName=i[e],t}o.displayName="FormattedNumberParts",o.displayName="FormattedNumberParts";var u=c("formatDate"),g=c("formatTime"),h=c("formatNumber");c("formatList"),c("formatDisplayName"),d("formatDate"),d("formatTime")},95700:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var i=s(55729),n=s(494),r=s(18970),a=s(90808);function l(e){var t;let s=(0,i.useContext)(r.y$),l=e||s.event,o=(0,n.d4)(a.xl);return(null==l||null==(t=l.tournament.uniqueTournament)?void 0:t.displayInverseHomeAwayTeams)&&o}}},e=>{e.O(0,[14092,3252,31702,24649,97672,54820,39800,90993,26446,90636,46593,38792],()=>e(e.s=45021)),_N_E=e.O()}]);