!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]="ae6cbad7-8698-4152-bf8e-2830aabdc86c",e._sentryDebugIdIdentifier="sentry-dbid-ae6cbad7-8698-4152-bf8e-2830aabdc86c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1105],{7447:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(6029),r=n(41249),o=n(54409);function i(e){let{isFollowed:t,disabled:n,onClick:i,isOnOverlay:s,...l}=e;return(0,a.jsx)(r.$n,{m:"0",p:"0",onClick:i,noFocus:!0,noActive:!0,variant:"unshielded",disabled:n,...l,children:t?(0,a.jsx)(o.zQC,{icon:"follow-active",fill:s?"onColor.primary":"primary.default",width:24,height:24,"data-testid":"follow-icon-star-button"}):(0,a.jsx)(o.zQC,{icon:"follow-default",fill:s?"onColor.primary":"neutral.default",width:24,height:24,"data-testid":"deselected-icon-star-button"})})}},8973:(e,t,n)=>{n.d(t,{b:()=>a,y:()=>r});var a=function(e){return e.Event="event",e.Team="team",e.UniqueTournament="unique_tournament",e.Tournament="tournament",e.Player="player",e.Stage="stage",e.Substage="substage",e.UniqueStages="unique_stage",e}({}),r=function(e){return e.MainMatches="main_matches",e.MainLeagues="main_leagues",e.Header="header",e.EventHeader="event_header",e.EventsTab="events_tab",e.EventWidget="event_widget",e.MatchesSection="matches_section",e.H2HSection="h2h_section",e.FloatingHeader="floating_header",e.Favorites="favorites",e.PlayerStatistics="player_statistics",e.RacesTab="races_tab",e.FightNight="fight_night",e.Fights="fights",e.PopularPlayers="popular_players",e.Search="search",e.Popup="popup",e}({})},39969:(e,t,n)=>{n.d(t,{h:()=>j,x:()=>S});var a=n(6029),r=n(21377),o=n(41249),i=n(55729),s=n(494),l=n(24313),d=n(70757),c=n(76410),u=n(10794),f=n(95083),h=n(90248),m=n(54409);let v=(e,t,n)=>{if(n)switch(t){case"right":return{top:"-8px",left:0,transform:"translateY(-100%)"};case"bottom":return{};default:return{top:"-8px",right:0,transform:"translateY(-100%)"}}switch(t){case"right":return{bottom:"-8px",left:0,transform:"translateY(100%)"};case"bottom":return e?{transform:"translateX(-100%)"}:{};default:return{bottom:"-8px",right:0,transform:"translateY(100%)"}}},p=e=>{let{image:t,name:n,LinkComponent:r}=e,i=(0,a.jsxs)(o.so,{align:"center",cursor:"pointer",children:[t,(0,a.jsx)(o.EY,{ml:"lg",color:"onSurface.nLv1",font:"body.medium",block:!0,style:{width:"102px"},children:n})]});return(0,a.jsx)(o.az,{my:"md",children:r?(0,a.jsx)(r,{children:i}):i})},g=(0,i.forwardRef)((e,t)=>{let{isEventFollowed:n,entities:r=[],onDeleteClick:i,menuPosition:s,isMenuInverted:l}=e,{isMobile:d}=(0,f.$c)();return(0,a.jsx)(o.az,{ref:t,position:"absolute",w:174,bg:"surface.s1",elevation:3,br:"md",py:"sm",zIndex:o.Py.Popover,style:{...v(d,s,l),whiteSpace:"normal"},children:n&&i?(0,a.jsxs)(o.so,{tabIndex:0,px:"lg",py:"sm",minH:"48",align:"center",br:"md",onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(null==i||i(e))},onClick:i,cursor:"pointer",children:[(0,a.jsx)(m.xV8,{fill:"error.default",width:24,height:24,mr:"lg"}),(0,a.jsx)(o.EY,{color:"onSurface.nLv1",font:"body.medium",block:!0,style:{width:"102px"},children:(0,a.jsx)(h.A,{id:"remove_from_favourites"})})]}):(0,a.jsxs)(o.az,{px:"lg",minH:"48",children:[(0,a.jsx)(o.EY,{color:"onSurface.nLv3",font:"assistive.default",pb:"sm",align:"left",as:"div",children:(0,a.jsx)(h.A,{id:"favorites.becauseYouFollow"})}),r.map(e=>(0,a.jsx)(p,{...e},e.entityType+e.id))]})})});var b=n(37356),x=n(7447);let y=e=>{e.stopPropagation(),e.preventDefault()};function j(e){let{id:t,leftTeam:n,rightTeam:f,tournament:h,menuPosition:m,isMenuInverted:v,isOnOverlay:p,location:j,type:w}=e,C=(0,i.useMemo)(()=>(0,b.fB)(),[]),k=(0,i.useMemo)(()=>(0,b.KL)(),[]),S=(0,s.d4)(e=>C(e,t)),E=(0,s.d4)(e=>k(e,{leftTeam:n,rightTeam:f,tournament:h})),_=(0,s.d4)(u.fg),P=S!==u.dE.NotFollowed&&!!S,I=P||!!E.length,{invertedMenu:F}=(0,l.l)(),M=(0,s.wA)(),T=()=>{M((0,d.q$)(r.bq7.Events,t)),M((0,d.q$)(r.bq7.MutedEvents,t)),(0,c.g2)({id:t,type:w,location:j,isFollowed:!1})},D=()=>{M((0,d.UQ)(r.bq7.Events,t)),(0,c.g2)({id:t,type:w,location:j,isFollowed:!0})},[L,z]=(0,i.useState)(!1),q=()=>z(e=>!e),A=(0,i.useCallback)(()=>z(!1),[]),Y=(0,o.jz)(A);return(0,a.jsxs)(o.az,{ref:Y,w:"fit-content",children:[(0,a.jsx)(x.A,{"aria-label":I?"Remove from favourites":"Add to favourites",disabled:_,isFollowed:I,isOnOverlay:p,onClick:e=>{y(e),_||(I?P?T():q():D())}}),I&&L&&!P&&(0,a.jsx)(g,{isEventFollowed:P,entities:E,menuPosition:m,isMenuInverted:F||v,onDeleteClick:e=>{y(e),T(),A()}})]})}var w=n(62859),C=n(8973),k=n(37470);function S(e){let{id:t,uniqueStage:n,menuPosition:f,location:h,isSubstageCell:m}=e,v=(0,i.useContext)(w.Ws),p=(0,i.useMemo)(()=>(0,b.BD)(),[]),y=(0,i.useMemo)(()=>(0,b.jM)(),[]),j=(0,s.d4)(e=>p(e,t)),S=(0,s.d4)(e=>y(e,null==n?void 0:n.id)),E=(0,s.d4)(u.fg),_=S&&n?(0,k.P3)({uniqueStage:n,sportSlug:v}):void 0,{invertedMenu:P}=(0,l.l)(),I=(0,s.wA)(),F=()=>{I((0,d.UQ)(r.bq7.Stages,t)),(0,c.g2)({id:t,type:m?C.b.Substage:C.b.Stage,location:h,isFollowed:!0})},M=()=>{I((0,d.q$)(r.bq7.Stages,t)),(0,c.g2)({id:t,type:m?C.b.Substage:C.b.Stage,location:h,isFollowed:!1})},[T,D]=(0,i.useState)(!1),L=()=>D(e=>!e),z=()=>D(!1),q=(0,o.jz)(z),A=j||S,Y=S&&!m;return(0,a.jsxs)(o.az,{ref:q,position:"relative",w:"fit-content",children:[(0,a.jsx)(x.A,{disabled:E,isFollowed:A,onClick:e=>{e.stopPropagation(),e.preventDefault(),E||(A?L():F())}}),A&&T&&(0,a.jsx)(g,{entities:_?[_]:void 0,isEventFollowed:j&&!Y,menuPosition:f,isMenuInverted:P,onDeleteClick:e=>{e.stopPropagation(),e.preventDefault(),M(),z()}})]})}},53486:(e,t,n)=>{n.d(t,{n6:()=>E,MC:()=>h.MC,gY:()=>P,G:()=>T,ey:()=>M});var a=n(6029),r=n(87827),o=n(21377),i=n(21501),s=n(41249),l=n(55729),d=n(90248),c=n(494),u=n(62859),f=n(54409),h=n(60988),m=n(41735);let v=m.default.span.withConfig({componentId:"sc-8e60f6ed-0"})(["padding:3px;color:white;font-size:12px;font-weight:600;min-width:44px;border-radius:4px;text-align:center;display:inline-block;background:",";"],e=>e.isWinner?e.theme.colors.secondary.default:e.theme.colors.onSurface.nLv3),p=function(e){let{points:t,isWinner:n,...r}=e;return(0,a.jsx)(v,{isWinner:n,...r,children:"number"==typeof t?"".concat(t," pts"):"-"})};var g=n(8703),b=n(65078),x=n(16620),y=n(48886),j=n(8973),w=n(39969),C=n(70591);let k=(0,m.default)(C.tj).withConfig({componentId:"sc-3f813a14-0"})(["display:block;border-radius:2px;:hover{background:",";}:active{background:",";}"],e=>e.theme.colors.surface.s2,e=>e.theme.colors.surface.s0),S=(0,m.default)(s.$n).withConfig({componentId:"sc-3f813a14-1"})(["display:inline-block;&:hover > *{transform:scale(1.1);}"]);function E(e){let t=(0,l.useRef)(null),n=(0,c.d4)(t=>t.favorites.events[e.event.id],c.bN),[r,o]=(0,b.jr)(n,"homeTeam","awayTeam",n),[s,d]=(0,b.jr)(n,"homeScore","awayScore",n),f=(0,i.ZC)(null==n?void 0:n.status.type);return((0,l.useEffect)(()=>{e.mutate&&f&&(null==n?void 0:n.status.type)&&f!==n.status.type&&e.mutate()},[e.mutate,f,null==n?void 0:n.status.type]),n)?(0,a.jsx)(u.y$.Provider,{value:{event:n,leftTeam:r,rightTeam:o,leftScore:s,rightScore:d},children:(0,a.jsx)(k,{event:n,"data-testid":"event_cell",className:"event-hl-".concat(n.id),onClick:t=>{e.onClick&&e.onClick(t,(null==n?void 0:n.id)||-1,e.isMobile)},children:(0,a.jsx)("div",{ref:t,children:(0,a.jsx)(h.n6,{...e,event:n,location:e.location})})})}):null}let _=()=>{let{event:e,leftTeam:t,rightTeam:n}=(0,l.useContext)(u.y$),{location:r}=(0,h.lv)();return(0,a.jsx)(w.h,{id:e.id,tournament:e.tournament,leftTeam:t,rightTeam:n,type:j.b.Event,location:r})},P=e=>(0,a.jsx)(E,{...e,children:_}),I=e=>{let{referenceId:t,isReferenceTeamId:n}=e,r=(0,b.h2)(t,n),i={background:"onSurface.nLv3",char:"?"};switch(r){case o.h18.Win:i={background:"secondary.default",char:"W"};break;case o.h18.OvertimeLoss:case o.h18.Lose:i={background:"error.default",char:"L"};break;case o.h18.Draw:i={background:"onSurface.nLv3",char:"D"}}return(0,a.jsx)(s.az,{w:24,h:24,br:"50%",bg:i.background,mx:1,children:(0,a.jsx)(s.EY,{font:"display.small",color:"onColor.primary",lineHeight:"24px",w:24,align:"center",as:"div",children:i.char})})},F=e=>{let{event:t,leftTeam:n,rightTeam:r}=(0,l.useContext)(u.y$);return[o.XUj.NotStarted,o.XUj.InProgress].includes(t.status.type)?(0,a.jsx)(w.h,{type:j.b.Event,location:j.y.MatchesSection,id:t.id,tournament:t.tournament,leftTeam:n,rightTeam:r}):(0,a.jsx)(I,{...e})},M=e=>{let{referenceId:t,isReferenceTeamId:n,incidentsMap:r,...o}=e;return e=>(0,a.jsx)(E,{incidents:r?r[e.event.id]:void 0,isReferenceTeamId:n,...o,...e,children:()=>(0,a.jsx)(F,{referenceId:t,isReferenceTeamId:n})})},T=e=>{let{rating:t,points:n,player:i,playedFor:c,isOnBench:h,incidents:m,isReferenceTeamId:v}=e;return e=>(0,a.jsx)(E,{incidents:m,entity:o.wNW.Player,...e,isReferenceTeamId:v,children:(0,g.rK)(e.event)?()=>{let{openEventPlayerStatistics:e}=(0,x.d)(),{event:m,leftTeam:v,rightTeam:g}=(0,l.useContext)(u.y$),b=m.status.type,C=m.tournament.category.sport,k=m.winnerCode===o.Jfo.Left?v.id:g.id,E=C.slug===o.QCR.Football,_=C.slug===o.QCR.Basketball,P=b===o.XUj.NotStarted,I=_&&void 0!==n,F=!E&&!I;return h&&C.slug===o.QCR.Football?(0,a.jsx)(s.az,{w:"28",h:"28",children:(0,a.jsx)(f.IKQ,{width:24,height:24,fill:"onSurface.nLv3"})}):P?(0,a.jsx)(w.h,{id:m.id,type:j.b.Event,location:j.y.MatchesSection,tournament:m.tournament,leftTeam:v,rightTeam:g}):m.hasEventPlayerStatistics?(0,a.jsxs)(S,{onClickCapture:t=>{t.preventDefault(),t.stopPropagation(),m.hasEventPlayerStatistics&&i&&e({event:m,player:i},y._.EventCell)},variant:F?void 0:"unshielded",colorScheme:F?"secondary":void 0,p:"0",w:I?48:28,h:"28",children:[E&&(0,a.jsx)(r.G,{rating:t}),I&&(0,a.jsx)(p,{points:n,isWinner:k===c}),F&&(0,a.jsx)(f.Abd,{width:24,height:24,fill:"onColor.primary"})]}):(0,a.jsx)(s.so,{w:"28",h:"28",align:"center",justify:"center",children:(0,a.jsx)(s.EY,{font:"assistive.default",color:"onSurface.nLv3",children:(0,a.jsx)(d.A,{id:"N/A"})})})}:null})}}}]);