!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]="6cbac757-01d5-4aa5-9568-5454df0893af",e._sentryDebugIdIdentifier="sentry-dbid-6cbac757-01d5-4aa5-9568-5454df0893af")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[38085],{24536:(e,t,a)=>{a.d(t,{d:()=>ee});var s=a(6029),n=a(76356),r=a(55729),l=a(46222),i=a(89721),o=a(28349),d=a(25940),c=a(6813),u=a(90248),m=a(52466);function x(){return(0,s.jsx)(d.AM,{trigger:(0,s.jsx)(m.G_L,{minW:24,fill:"onSurface.nLv1",cursor:"pointer"}),closeOnOutsideClick:!0,children:(0,s.jsxs)(d.AM.Content,{position:"absolute",w:"320px",style:{right:"100%"},elevation:3,children:[(0,s.jsx)(o.EY,{textStyle:"display.large",display:"block",my:"sm",children:(0,s.jsx)(u.A,{id:"standings_tracker_title"})}),(0,s.jsx)(o.EY,{textStyle:"body.mediumParagraph",children:(0,s.jsx)(u.A,{id:"standings_tracker_general"})}),(0,s.jsxs)(n.so,{direction:"column",mt:"md",children:[(0,s.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",ml:"2xl",children:(0,s.jsx)(u.A,{id:"position"})}),(0,s.jsxs)(n.so,{children:[(0,s.jsx)(o._V,{src:"/static/images/performance-graph/chart-info-popover-graphic.png",width:"[180px]",height:"[176px]",alt:"Standings tracker info graphic"}),(0,s.jsxs)(n.az,{children:[(0,s.jsx)(o.EY,{textStyle:"assistive.default",color:"secondary.default",display:"block",mt:"[54px]",children:(0,s.jsx)(u.A,{id:"standings_tracker_team_one"})}),(0,s.jsx)(o.EY,{textStyle:"assistive.default",color:"primary.default",display:"block",mt:"[14px]",children:(0,s.jsx)(u.A,{id:"standings_tracker_team_two"})})]})]}),(0,s.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",ml:"[58px]",children:(0,s.jsx)(u.A,{id:"standings_tracker_week_date"})})]})]})})}var h=a(93338),p=a(78488),g=a(14297),v=a(36729),y=a(28446),f=a(56591),j=a(51384);a(14632);var b=a(41735);function w(e){switch(e){case 0:return"secondary.default";case 1:return"primary.default";case 2:return"status.val";case 3:return"tertiary.default";default:return"neutrals.nLv2"}}let k=e=>{let{teamCount:t,selectedWeek:a,setSelectedWeek:n,data:l}=e,i=(0,b.useTheme)(),o="rtl"===i.settings.textDirection,d=221/(t-1),c=Math.max(...l.map(e=>(null==e?void 0:e.length)||0)),u=745/(c-1),m=(0,r.useRef)(null),[x,k]=(0,r.useState)(0),_=(0,j.A)().x(e=>e.x).y(e=>e.y),A=e=>{let t=Math.round((e.x-25)/u);t=0&&(k(x+e.dx),n(t))};return(0,r.useEffect)(()=>{if(!m.current)return;let e=(0,f.A)(m.current).select("svg").attr("viewBox","0 0 ".concat(780," ").concat(256)).attr("width","100%").attr("height","100%"),a=(0,y.A)().domain([1,t]).range([0,d*(t-1)]),s=(0,p.V4)(a).tickSize(745).tickValues([...Array(t)].map((e,t)=>t+1).filter(e=>1===e||e%5==0||e===t)).tickPadding(12.5).tickFormat(e=>e.toString());e.select(".yAxis").remove(),e.append("g").classed("yAxis",!0).classed("hidePath",!0).classed("isRTL",o).call(s).style("stroke-dasharray","3 6").style("stroke-opacity","0.5").attr("transform","translate(".concat(770,", ").concat(10,")"))},[t]),(0,r.useEffect)(()=>{if(!m.current)return;let e=(0,f.A)(m.current).select("svg"),t=(0,y.A)().domain([1,c]).range([0,745]),s=(0,p.l7)(t).tickSize(0).ticks(c);e.select(".xAxis").remove(),e.append("g").classed("xAxis",!0).classed("hidePath",!0).classed("isRTL",o).call(s).attr("transform","translate(".concat(25,", ").concat(246,")")),l.forEach((t,a)=>{((e,t,a)=>{if(!t)return e.select("svg g.graph").selectAll("line.class-".concat(a)).remove();let s=t?t.map(e=>{let t=10;return{x:25+(e.week-1)*u,y:t+=(e.position-1)*d}}):[],n=e.select("svg g.graph").selectAll("line.class-".concat(a)).data(s);n.exit().remove(),n.enter().append("line").classed("class-".concat(a),!0).merge(n).transition().ease(v.wq).duration(350).attr("fill","none").attr("stroke",h.S.var("colors.".concat(w(a)))).attr("stroke-width","2").attr("x1",(e,t)=>s[t+1]?e.x:null).attr("y1",(e,t)=>s[t+1]?e.y:null).attr("x2",(e,t)=>{var a;return null==(a=s[t+1])?void 0:a.x}).attr("y2",(e,t)=>{var a;return null==(a=s[t+1])?void 0:a.y})})(e,t,a)}),((e,t)=>{if(e.select(".slider").remove(),!t)return;let s=e.append("g").classed("slider",!0),n=Math.max(25+a*u,25);s.append("path").attr("fill","none").attr("stroke",i.colors.neutral.variant).attr("stroke-width","1").attr("d",_([{x:n,y:0},{x:n,y:241}])||"").transition().ease(v.wq).duration(350),s.append("rect").attr("x",25+a*u).attr("y",0).attr("width",Math.max(745-a*u,1)).attr("height",241).classed("rect-overlay",!0),s.append("rect").classed("track",!0).attr("x",25).attr("y",0).attr("width",745).attr("height",241).attr("fill","transparent")})(e,Math.max(...l.map(e=>(null==e?void 0:e.length)||0))),e.select(".slider").call((0,g.A)().on("drag",A))},[l,a]),(0,s.jsx)("div",{ref:m,style:{marginTop:"22px"},children:(0,s.jsx)("svg",{style:o?{transform:"scale(-1,1)"}:void 0,children:(0,s.jsx)("g",{className:"graph"})})})};var _=a(4967),A=a(90510);let S=e=>{let{week:t}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.A,{id:"standings_tracker_week_date"}),t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:" ("}),(0,s.jsx)(A.XU,{value:1e3*t.timeframeStart,..._.or.fullDate}),(0,s.jsx)("span",{children:" - "}),(0,s.jsx)(A.XU,{value:1e3*t.timeframeEnd,..._.or.fullDate}),(0,s.jsx)("span",{children:")"})]})]})};function C(e){let{setVisibleTeamsCount:t,maxComparisonCount:a,visibleTeamsCount:r,setSelectedTeamIds:l}=e;return(0,s.jsxs)(n.so,{gap:"sm",children:[r>1&&(0,s.jsx)(o.K0,{variant:"clear",size:"primary",onClick:()=>{r>1&&t(e=>e-1),l(e=>{let t=[...e];return t[r-1]=void 0,t})},children:(0,s.jsx)(m.zQC,{icon:"close",width:24})}),rt(e=>e+1),children:(0,s.jsx)(u.A,{id:"compare"})}):(0,s.jsx)(o.K0,{br:"50%",size:"primary",onClick:()=>t(e=>e+1),children:(0,s.jsx)(m.xZp,{width:24})}))]})}function T(e){let{maxMatches:t,position:a,teamIndex:r,children:l}=e,i=48*t+4*(t-1)+16+24+4;return(0,s.jsx)(n.az,{style:{minHeight:i},children:(0,s.jsxs)(n.so,{bg:"surface.s2",align:"center",justify:"flex-start",br:"xs",direction:"column",style:{borderTop:"".concat(4,"px solid ").concat(h.S.var("colors.".concat(w(r))))},children:[(0,s.jsxs)(n.so,{gap:"xs",align:"center",py:"xs",style:{height:24},children:[(0,s.jsx)(o.EY,{color:"neutrals.nLv3",textStyle:"assistive.default",children:(0,s.jsx)(u.A,{id:"position.short"})}),(0,s.jsx)(o.EY,{textStyle:"display.small",children:a})]}),l]})})}var E=a(33144),L=a(88505);let I=e=>{let{availableTeams:t,selectedTeam:a,setSelectedTeams:r,teamIndex:l,showSelectedTeamName:i,isFullWidth:d}=e,c=t.every(e=>e.shortName)?t.sort((e,t)=>e.shortName>t.shortName?1:t.shortName>e.shortName?-1:0).map(e=>({value:e.id,label:(0,s.jsx)(L.Rm,{team:e,short:!0})})):t.sort((e,t)=>e.name>t.name?1:t.name>e.name?-1:0).map(e=>({value:e.id,label:(0,s.jsx)(L.Rm,{team:e})})),u=i&&(null==a?void 0:a.shortName)||"",m=a?{value:a.id,label:u}:void 0;return(0,s.jsx)(o.ms,{width:"100%",buttonStyles:{width:d?"100%":"fit"},label:null==m?void 0:m.value,items:c,selectedItem:m,alignRight:l>1,onSelectedItemChange:e=>{r(t=>{var a;let s=[...t];return s[l]=Number(null==(a=e.selectedItem)?void 0:a.value),s})},renderItem:e=>e?(0,s.jsxs)(n.so,{align:"center",gap:"sm",children:[(0,s.jsx)(E.p,{id:e.value,size:24}),(0,s.jsx)(o.EY,{truncate:!0,children:e.label})]}):(0,s.jsx)(n.so,{align:"center",children:(0,s.jsx)("img",{width:24,src:"/static/images/placeholders/team.svg",alt:"Placeholder team"})})})};var z=a(21377),D=a(67087),R=a(64006),Y=a(81484),N=a(14831);function M(e){let{event:t}=e,[a,r]=(0,D.jr)(t,"homeScore","awayScore",t),l=t.winnerCode===z.Jfo.Right||t.winnerCode===z.Jfo.Draw,i=t.winnerCode===z.Jfo.Left||t.winnerCode===z.Jfo.Draw;return(0,s.jsx)(n.so,{align:"center",justify:"center",color:"neutrals.nLv3",py:"xs",w:"100%",children:(0,N.ux)(t)||N.dp.includes(t.status.type)?(0,s.jsx)(o.EY,{textStyle:"assistive.default",color:"status.error.default",minW:"[0px]",truncate:!0,children:(0,s.jsx)(Y.fP,{id:t.status.type,short:!0})}):(0,s.jsxs)(n.so,{gap:"2xs",children:[(0,s.jsx)(o.EY,{textStyle:"display.small",display:"block",color:l?"[inherit]":"neutrals.nLv1",children:a.display}),(0,s.jsx)(o.EY,{display:"block",color:"[inherit]",children:"-"}),(0,s.jsx)(o.EY,{textStyle:"display.small",display:"block",color:i?"[inherit]":"neutrals.nLv1",children:r.display})]})})}let V=e=>{let{event:t,isWideRow:a}=e,[r,l]=(0,D.jr)(t,"homeTeam","awayTeam",t);return t?(0,s.jsx)(R.tj,{event:t,style:{width:"100%"},children:(0,s.jsxs)(n.so,{direction:"column",justify:"center",align:"center",gap:"xs",br:"sm",md:{px:"sm",py:"xs"},_hover:{bg:"neutral.highlight"},children:[(0,s.jsxs)(n.so,{gap:"md",align:"center",children:[(0,s.jsx)(E.p,{id:r.id,size:20,name:r.name}),a&&(0,s.jsx)(M,{event:t}),(0,s.jsx)(E.p,{id:l.id,size:20,name:l.name})]}),!a&&(0,s.jsx)(M,{event:t})]})}):null};function P(e){let{events:t,visibleTeamsCount:a}=e,{isDesktop:r}=(0,o.$c)();if(!(null==t?void 0:t.length))return(0,s.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",textAlign:"center",p:"sm",children:(0,s.jsx)(u.A,{id:"standings_tracker_no_games_played_short"})});let l=r||a<3;return(0,s.jsx)(n.so,{direction:"column",p:"sm",gap:l?"sm":"xs",w:"100%",children:t.map(e=>(0,s.jsx)(V,{event:e,isWideRow:l},e.id))})}var K=a(45860);let W=(0,n.I4)(n.az,{base:{"& svg .hidePath path":{display:"none"},"& svg .xAxis.isRTL text":{transform:"scale(-1, 1)"},"& svg .yAxis.isRTL text":{transform:"scale(-1, 1) translateX(193%)"},"& .rect-overlay":{fill:"surface.s1/65"}}}),F=e=>{var t,a;let{uniqueTournamentId:i,seasonId:u,preselectedTeamIds:m,availableTeams:h}=e,{isMobile:p}=(0,o.$c)(),g=h.map(e=>e.id),v=Math.min(g.length,4),[y,f]=(0,r.useState)(!1),[j,b]=(0,r.useState)(0),[w,_]=(0,r.useState)((null==m?void 0:m.length)?m:[g[0],g[1]]),[A,E]=(0,r.useState)(w.length),{data:L,isLoading:D}=((e,t,a)=>{let[s,n,r,l]=a,{data:i,isLoading:o}=(0,K.Ay)(s?z.V3t.performanceGraphData(e,t,s):null),{data:d,isLoading:c}=(0,K.Ay)(n?z.V3t.performanceGraphData(e,t,n):null),{data:u,isLoading:m}=(0,K.Ay)(r?z.V3t.performanceGraphData(e,t,r):null),{data:x,isLoading:h}=(0,K.Ay)(l?z.V3t.performanceGraphData(e,t,l):null);return{data:[null==i?void 0:i.graphData,null==d?void 0:d.graphData,null==u?void 0:u.graphData,null==x?void 0:x.graphData],isLoading:o||c||m||h}})(i,u,w),R=(null==(a=L[0])||null==(t=a[j])?void 0:t.week)||0,Y=(e=>{if(!e)return[];let t=[];return null==e||e.forEach((e,a)=>{null==e||e.forEach((e,s)=>{t[s]||(t[s]=[]),t[s][a]=e.events})}),[...t]})(L),N=Math.max(0,...Y.flat().map(e=>e.length));return((0,r.useEffect)(()=>{!y&&!D&&(null==L?void 0:L.length)&&(b(Math.min(...L.filter(e=>null==e?void 0:e.length).map(e=>((null==e?void 0:e.length)||1)-1))),f(!0))},[L,D,y]),(0,r.useEffect)(()=>{f(!1)},[u]),L.find(e=>null==e?void 0:e.length)&&Y.length)?(0,s.jsxs)(l.Zp,{children:[(0,s.jsx)(l.Zp.Header,{titleId:"standings_tracker_title",actionComponent:(0,s.jsx)(x,{})}),(0,s.jsx)(W,{children:(0,s.jsxs)(n.az,{p:{base:"sm",md:"lg"},children:[(0,s.jsx)(n.az,{pb:"lg",children:(0,s.jsx)(k,{teamCount:h.length,data:L,selectedWeek:j,setSelectedWeek:b})}),(0,s.jsx)(d.VQ,{controls:[j,b],buttonProps:{variant:"unshielded"},align:"flex-start",my:"md",children:Array.from({length:Y.length},(e,t)=>t).map(e=>{var t,a;return(0,s.jsxs)(n.so,{align:"center",gap:"xs",children:[(0,s.jsx)(o.EY,{textStyle:"display.large",children:R}),(0,s.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,s.jsx)(S,{week:L[0]&&L[0][j]})})]},(null==(a=L[0])||null==(t=a[j])?void 0:t.week)||e)})}),(0,s.jsxs)(n.so,{gap:"sm",py:"sm",children:[Array.from({length:A},(e,t)=>t).map(e=>{var t,a,r;if(e>v)return null;let l=w[e],i=null==(a=L[e])||null==(t=a[j])?void 0:t.position,o=null==(r=Y[j])?void 0:r[e];return(0,s.jsxs)(n.so,{gap:"md",direction:"column",w:"100%",minW:"[0px]",children:[(0,s.jsxs)(n.so,{justify:"space-between",children:[(0,s.jsx)(I,{teamIndex:e,availableTeams:h.filter(e=>!w.includes(e.id)),selectedTeam:h.find(e=>e.id===l),setSelectedTeams:_,showSelectedTeamName:A<3&&p||!p,isFullWidth:A>1}),1===A&&(0,s.jsx)(C,{visibleTeamsCount:A,maxComparisonCount:v,setVisibleTeamsCount:E,setSelectedTeamIds:_})]}),l&&void 0!==i&&(0,s.jsx)(T,{maxMatches:N,position:i,teamIndex:e,children:(0,s.jsx)(P,{events:o,visibleTeamsCount:A})})]},"".concat(l,"-").concat(e,"-").concat(u))}),A>1&&(0,s.jsx)(C,{visibleTeamsCount:A,maxComparisonCount:v,setVisibleTeamsCount:E,setSelectedTeamIds:_})]})]})})]}):(0,s.jsxs)(l.Zp,{children:[(0,s.jsx)(l.Zp.Header,{titleId:"standings_tracker_title",actionComponent:(0,s.jsx)(x,{})}),(0,s.jsx)(c.p,{graphic:"performance-chart",descriptionMessageId:"standings_tracker_empty_season"})]})};var Z=a(947),q=a(20288),B=a(90438),G=a(31830),H=a(88715),J=a(79082);let U=e=>{let{tournamentId:t,uniqueTournamentId:a,tournamentSlug:r,categorySlug:l,sport:i,seasonId:o,standingsName:d,rowCount:c,hasHomeAwayStandings:m}=e,x=(0,Z.A)(),h=(0,G.A)(),p=(0,B.vf)(x.locale),g="".concat(z.yuv).concat(p?"/".concat(p):"","/embed/tournament/").concat(t,"/season/").concat(o,"/standings/").concat(encodeURIComponent(d)),v="?widgetTitle=".concat(encodeURIComponent(d),"&showCompetitionLogo=true"),y="sofa-standings-embed-".concat(t,"-").concat(o),f=(0,z.Lo9)(H.z.getTranslatedRoute(h,void 0!==a?"uniqueTournament":"tournament",{sport:i,category:l,tournament:r,id:void 0!==a?a:t},(0,J.HL)({id:o})).route,{isApiRoute:!1}),j=x.formatMessage({id:"standings.embed.backLink"},{linkToSofascore:'Sofascore')}),b='\n
\n ').concat(j,"\n
");return(0,s.jsx)(n.az,{hideBelow:"md",children:(0,s.jsx)(q.C,{callToAction:(0,s.jsx)(u.A,{id:"live_standings_embed"}),embedString:b,mt:"0",px:"0"})})};var O=a(81526),X=a(83918),$=a(64327),Q=a(4284);function ee(e){var t;let{children:a,title:o,subheader:d,tableId:c,branding:u}=e,{seasonId:m,uniqueTournamentId:x,standings:h,hasPerformanceGraphFeature:p,selectedTeamId:g,homeTeamId:v,awayTeamId:y,hasHomeAwayStandings:f,isStandingsTableEmpty:j}=(0,r.useContext)($.P),b=h.find(e=>e.id===c),w=(null==(t=h[0])?void 0:t.id)===c,[k,_]=(0,r.useMemo)(()=>{var e;return(0,Q.Yp)(null!=(e=null==b?void 0:b.rows)?e:[])},[null==b?void 0:b.id,m]);if(!b)return null;let A=b.tournament,S=A.id,C=A.slug,T=A.category.slug,E=A.category.sport.slug,L=p&&x&&m;return(0,s.jsxs)(X.C.Provider,{value:{colors:k,texts:_},children:[(0,s.jsxs)(l.Zp,{children:[x&&(0,s.jsx)(i.U,{entityId:x,title:o,branding:u,location:"league_standings"}),d,a,(m||!j)&&(0,s.jsxs)(n.BJ,{px:"sm",pt:"sm",pb:{mdDown:"sm",md:L?void 0:"sm"},gap:"sm",children:[!j&&(0,s.jsx)(O.K,{rows:b.rows,descriptions:b.descriptions,tieBreakingRule:b.tieBreakingRule,defaultOpenedFirstRules:w}),m&&(0,s.jsx)(U,{sport:E,categorySlug:T,tournamentSlug:C,uniqueTournamentId:x,tournamentId:S,seasonId:m,standingsName:b.name,rowCount:b.rows.length,hasHomeAwayStandings:!!f})]})]}),L&&(0,s.jsx)(n.az,{id:"performance-graph-box",mt:"sm",children:(0,s.jsx)(F,{uniqueTournamentId:x,seasonId:m,preselectedTeamIds:g?[g]:[v,y].filter(e=>"number"==typeof e),availableTeams:b.rows.map(e=>e.team)})},"".concat(m,"-").concat(c))]})}},57203:(e,t,a)=>{a.d(t,{v:()=>r});var s=a(6029),n=a(9081);let r=e=>{let{table:t}=e;return t?t.tournament.groupName?(0,s.jsx)(n.__,{name:t.tournament.groupName}):(0,s.jsx)(s.Fragment,{children:t.name}):null}},77994:(e,t,a)=>{a.d(t,{A:()=>d});var s=a(6029),n=a(76356),r=a(55729),l=a(24414),i=a(69588),o=a(64327);function d(e){let{children:t,hideDisplayTypeDropdown:a}=e,[d,c]=(0,r.useState)("all"),{hasHomeAwayStandings:u,displayType:m,setDisplayType:x,displayTypeOptions:h,isNarrowLayout:p}=(0,r.useContext)(o.P),g=!a&&p;return u||g?!u&&g?(0,s.jsxs)(n.az,{pt:"sm",children:[(0,s.jsx)(i.u,{displayType:m,setDisplayType:x,items:h,isNarrowLayout:p}),t]}):(0,s.jsx)(n.az,{pt:"sm",position:"relative",children:(0,s.jsxs)(l.n,{activeTabKey:d,onChange:c,tabs:u?[{tabKey:"all",tabValue:"basic.all"},{tabKey:"home",tabValue:"home"},{tabKey:"away",tabValue:"away"}]:[],variant:"secondary",children:[g&&(0,s.jsx)(n.so,{gap:"sm",p:"sm",position:"absolute",right:"0",top:"0",children:(0,s.jsx)(i.A,{displayType:m,setDisplayType:x,items:h,isNarrowLayout:p})}),(0,s.jsx)(n.az,{pt:"sm",children:t})]})}):(0,s.jsx)(n.az,{pt:"sm",children:t})}}}]);