!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="727d9408-34bd-466a-97c8-b04f9777772a",e._sentryDebugIdIdentifier="sentry-dbid-727d9408-34bd-466a-97c8-b04f9777772a")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7433],{29814:(e,n,t)=>{t.r(n),t.d(n,{default:()=>A});var s=t(6029),a=t(21377),r=t(90248),i=t(45860),d=t(7263),l=t(19168),o=t(91816),u=t(83318),x=t(42078),b=t(56663),c=t(76356),h=t(41249),y=t(55729),j=t(68543),m=t(53422),p=t(2438),v=t(7079),f=t(66757);function g(e){let{tableIndex:n,type:t,loaderHeight:r}=e,{standings:d,seasonId:l,tournamentId:u}=(0,y.useContext)(o.P),{data:x,error:b}=(0,i.Ay)(u&&l?a.yKR.standings(u,l,t):null,{refreshInterval:3e4,fallbackData:{standings:d},revalidateOnMount:!0}),{data:c}=(0,i.Ay)(u&&l?a.yKR.teamEvents(u,l,t):null,{refreshInterval:3e4});if(b)return null;if(!x)return(0,s.jsx)(f.e,{rows:r});let h=function(e,n,t){if(void 0!==t){let s=t.map(e=>e.id)||[],a=e.filter(e=>s.includes(e.id));return a.length>0?a[n]:e[n]}return e[n]}(x.standings,n,d),j=c?c.teamEvents:void 0;return(0,s.jsx)(v.X,{type:t,table:h,teamEvents:j})}function w(e){let{tableIndex:n,Header:t,subheader:r,title:i,hasDropdown:d,isInlineLayout:l,branding:u}=e,{standings:x,hasHomeAwayStandings:b}=(0,y.useContext)(o.P),c=x[n];return(0,s.jsx)(m.d,{title:i,subheader:r,tableIndex:n,isInlineLayout:l,branding:u,children:b?(0,s.jsxs)(h.tU,{variant:"secondary",children:[(0,s.jsx)(j.A,{hideDisplayTypeDropdown:d}),t&&(0,s.jsx)(t,{title:(0,s.jsx)(p.v,{table:c})}),(0,s.jsx)(h.tU.Panel,{tabKey:1,children:(0,s.jsx)(g,{type:a.lpv.Total,tableIndex:n})}),(0,s.jsx)(h.tU.Panel,{tabKey:2,children:(0,s.jsx)(g,{type:a.lpv.Home,tableIndex:n,loaderHeight:c.rows.length})}),(0,s.jsx)(h.tU.Panel,{tabKey:3,children:(0,s.jsx)(g,{type:a.lpv.Away,tableIndex:n,loaderHeight:c.rows.length})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.A,{hideDisplayTypeDropdown:d}),t&&(0,s.jsx)(t,{title:(0,s.jsx)(p.v,{table:c})}),(0,s.jsx)(g,{type:a.lpv.Total,tableIndex:n})]})})}var I=t(65457);function T(e){var n;let{isInlineLayout:t,subheader:i}=e,d=(0,y.useContext)(o.P),{selectedTeamId:l,homeTeamId:u,awayTeamId:x,seasonId:b,standings:j,isNarrowLayout:m,displayType:v,displayTypeOptions:f,setDisplayType:g}=d,[T,A]=(0,y.useState)(0),D=(n=l||u)?j.filter(e=>e.rows.find(e=>e.team.id===n||e.team.id===x)):j,P=D[T];if((0,y.useEffect)(()=>{A(0)},[b]),!P)return null;let L=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.az,{p:"sm",borderBottom:"1px solid {colors.neutrals.nLv4}",children:(0,s.jsx)(h.ms,{items:D,selectedItem:P,renderItem:(e,n)=>{if(n&&e){var t,r;return(0,s.jsxs)(c.so,{align:"center",children:[(0,s.jsx)(h._V,{src:e.tournament.uniqueTournament&&a.V3t.image(null==(t=e.tournament.uniqueTournament)?void 0:t.id),width:"24",height:"24",ml:"-4",mr:"4",alt:null==(r=e.tournament.uniqueTournament)?void 0:r.name}),(0,s.jsx)(p.v,{table:e})]})}return(0,s.jsx)(p.v,{table:e})},onSelectedItemChange:e=>{let{selectedItemIndex:n}=e;"number"==typeof n&&A(n)}})}),m&&(0,s.jsx)(I.u,{items:f,displayType:v,setDisplayType:g,isNarrowLayout:m})]});return(0,s.jsx)(o.P.Provider,{value:{...d,standings:D},children:(0,s.jsx)(w,{tableIndex:T,hasDropdown:!0,subheader:(0,s.jsxs)(s.Fragment,{children:[i,L]}),title:m||t?void 0:(0,s.jsx)(r.A,{id:"tournament.standings"}),isInlineLayout:t})})}function A(e){let{tournamentId:n,seasonId:t,isNarrowLayout:c,homeTeamId:h,awayTeamId:y,selectedTeamId:j,Header:m,subheader:p,isInlineLayout:v,isTabbedHeader:f,isTeamStandings:g,branding:I,loaderNumberOfRows:A}=e,{data:D,error:P}=(0,i.Ay)(a.yKR.standings(n,t,a.lpv.Total),{revalidateOnMount:!0}),{data:L}=(0,i.Ay)([a.yKR.standings(n,t,a.lpv.Home),"HEAD"],{fetcher:d.n}),[K,k]=(0,l.yR)(u.s4,"short");if(P)return null;if(void 0===D||void 0===L)return g?(0,s.jsx)(b.s,{isTabbedHeader:f,noSeasonPicker:!p,isNarrowLayout:c,branding:I}):(0,s.jsx)(x.d,{noSeasonPicker:!0,isNarrowLayout:c,branding:I,numberOfRows:A});let{uniqueTournament:U}=D.standings[0].tournament,_=D.standings[0].rows.map(e=>e.team),z=!v&&!!(null==U?void 0:U.hasPerformanceGraphFeature)&&[j,h,y].filter(e=>e).every(e=>_.map(e=>e.id).includes(e));return(0,s.jsx)(o.P.Provider,{value:{displayType:K,setDisplayType:k,isNarrowLayout:!!c,uniqueTournamentId:null==U?void 0:U.id,seasonId:t,standings:D.standings,homeTeamId:h,awayTeamId:y,selectedTeamId:j,hasPerformanceGraphFeature:z,displayTypeOptions:(null==U?void 0:U.id)===u.nJ?["short","form"]:void 0,hasHomeAwayStandings:L,tournamentId:n,selectedSeason:void 0},children:D.standings.length>1?(0,s.jsx)(T,{isInlineLayout:!!v,subheader:p}):(0,s.jsx)(w,{tableIndex:0,Header:m,subheader:p,title:c||v?void 0:(0,s.jsx)(r.A,{id:"tournament.standings"}),isInlineLayout:v,branding:I})})}},56663:(e,n,t)=>{t.d(n,{s:()=>u});var s=t(6029),a=t(76356),r=t(41249),i=t(90248),d=t(65789),l=t(85568),o=t(66757);let u=e=>{let{noSeasonPicker:n,isNarrowLayout:t,isTabbedHeader:u,branding:x}=e;return(0,s.jsxs)(d.Zp,{isInverseDesktop:t,children:[!t&&(0,s.jsx)(l.U,{titleId:"app.standings",branding:x}),(0,s.jsxs)(a.az,{pb:"[120px]",children:[!n&&(0,s.jsx)(a.az,{px:"sm",py:{mdDown:"sm"},children:(0,s.jsx)(a.az,{h:"2xl",bg:"surface.s2",br:"sm"})}),u?(0,s.jsx)(r.tU,{variant:"secondary",children:(0,s.jsx)(a.so,{p:"sm",justify:"space-between",borderBottom:"1px solid {colors.neutrals.nLv4}",children:(0,s.jsxs)(a.az,{h:"[36px]",children:[(0,s.jsx)(r.tU.Tab,{tabKey:1,children:(0,s.jsx)(i.A,{id:"basic.all"})}),(0,s.jsx)(r.tU.Tab,{tabKey:2,children:(0,s.jsx)(i.A,{id:"home"})}),(0,s.jsx)(r.tU.Tab,{tabKey:3,children:(0,s.jsx)(i.A,{id:"away"})})]})})}):(0,s.jsx)(a.az,{p:"sm",borderBottom:"onSurface.nLv4",children:(0,s.jsx)(a.az,{h:"2xl",bg:"surface.s2",br:"sm"})}),(0,s.jsx)(a.az,{h:"xl"}),(0,s.jsx)(o.e,{rows:20})]})]})}}}]);