!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]="8bdb6778-d7a1-4472-8206-24375dc95182",e._sentryDebugIdIdentifier="sentry-dbid-8bdb6778-d7a1-4472-8206-24375dc95182")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7319],{9643:(e,t,n)=>{n.d(t,{s:()=>d});var i=n(21377),o=n(45860),r=n(24338),l=n(32259),s=n(89194),a=n(17352);function d(e,t){let{data:n,isLoading:d,mutate:c}=(0,o.Ay)(i.bnp.votes(e.id),{refreshInterval:6e4,dedupingInterval:6e4}),{voteModelKey:u,position:p}=(0,a.do)(t),v=(0,l.a)(e,p),m=v[s.m.Left],x=p[s.m.Middle],f=v[s.m.Right],h=(0,r.b)(n,u),g=(0,r.b)(h,null==m?void 0:m.voteApiKey),j=(0,r.b)(h,null==x?void 0:x.voteApiKey),y=(0,r.b)(h,null==f?void 0:f.voteApiKey),b=(!g||g<0?0:g)+(!y||y<0?0:y)+(!j||j<0?0:j),{leftPercentage:w,middlePercentage:T,rightPercentage:_}=(0,a.mK)(g,j,y);return{data:n,isLoading:d,mutate:c,totalVotes:b,eventVotes:{[s.m.Left]:{isAvailable:"number"==typeof g,count:g,percentage:w},[s.m.Middle]:{isAvailable:"number"==typeof j,count:j,percentage:T},[s.m.Right]:{isAvailable:"number"==typeof y,count:y,percentage:_}}}}},17352:(e,t,n)=>{n.d(t,{Iz:()=>j,K$:()=>m,Q3:()=>c,T8:()=>v,bZ:()=>f,d4:()=>h,do:()=>p,kS:()=>g,mK:()=>d,mt:()=>x,w1:()=>u});var i=n(21377),o=n(12962),r=n(98516),l=n(9329),s=n(89194),a=n(75067);let d=(e,t,n)=>{let i=(e||0)+(t||0)+(n||0),o=0===i?0:(e||0)/i*100,l=0===i?0:(t||0)/i*100,s=0===i?0:(n||0)/i*100,a=parseFloat((0,r.M)(o)),d=parseFloat((0,r.M)(l)),c=parseFloat((0,r.M)(s)),u=100-(a+d+c);if(0!==u){let e=o%1,t=s%1,n=Math.max(e,l%1,t);n===e?a+=u:n===t?c+=u:d+=u}return{leftPercentage:a,middlePercentage:d,rightPercentage:c}},c=e=>{let t=Object.keys(a.Qf);return Object.keys(e).some(n=>t.includes(n)&&Object.values(e[+n]).some(e=>!!e))},u=e=>{switch(e){case i.gbi.One:case i.gbi.Yes:return s.m.Left;case i.gbi.Two:case i.gbi.No:return s.m.Right;default:return s.m.Middle}},p=e=>{switch(e){case i.rjx.WillBothTeamsScore:return l.NT;case i.rjx.FirstTeamToScore:return l.dT;default:return l.o3}},v=e=>[o.M.DesktopEventPage,o.M.MobileEventPage].includes(e)?"event_details":e===o.M.DesktopWidget?"event_widget":void 0,m=(e,t)=>{switch(e){case i.rjx.WhoWillWin:return t?"who_will_win_daily_10x":"who_will_win";case i.rjx.WillBothTeamsScore:return"will_both_teams_score";case i.rjx.FirstTeamToScore:return"first_team_to_score";default:return}},x=e=>{switch(e){case i.rjx.WhoWillWin:return"1";case i.rjx.WillBothTeamsScore:return"2";case i.rjx.FirstTeamToScore:return"3";default:return}},f=e=>1e3*e.startTimestamp>Date.now()&&e.status.type===i.XUj.NotStarted;function h(e,t){return Object.values(s.m).find(n=>{var i,o;return(null==e||null==(o=e.position)||null==(i=o[n])?void 0:i.voteOption)===t})}function g(e,t,n,i,o){var r,l;let s=n.voteModelKey,a=null==(r=n.position[i])?void 0:r.voteApiKey,d=o?u(o):void 0,c=d?null==(l=n.position[d])?void 0:l.voteApiKey:void 0,p=c===a;if(e&&a){let n=e[s],i=n[a],o=n[c],r=a in n?p?i:i+1:1,l=c&&c in n?p?o:o-1:0;t({...e,[s]:{...e[s],[a]:r,...c&&{[c]:l}}},{revalidate:!1,populateCache:!0})}}function j(e,t){return e?s.w.Votable:t?s.w.Transform:s.w.NoAnimation}},24338:(e,t,n)=>{n.d(t,{b:()=>i});function i(e,t){if(void 0!==e&&void 0!==t)return t in e?e[t]:void 0}},25355:(e,t,n)=>{n.d(t,{N:()=>d});var i=n(78383),o=n.n(i),r=n(55729),l=n(76410),s=n(29953),a=n(92494);let d=(e,t,n)=>{let i=(0,r.useContext)(s.A),d=(0,r.useRef)({onRewardedSlotReady:o(),onRewardedSlotGranted:o(),onRewardedSlotClosed:o(),onRewardedSlotRenderEnded:o()}),c=(0,r.useCallback)(()=>{googletag.cmd.push(()=>{googletag.pubads().removeEventListener("rewardedSlotReady",d.current.onRewardedSlotReady),googletag.pubads().removeEventListener("rewardedSlotGranted",d.current.onRewardedSlotGranted),googletag.pubads().removeEventListener("rewardedSlotClosed",d.current.onRewardedSlotClosed),googletag.pubads().removeEventListener("slotRenderEnded",d.current.onRewardedSlotRenderEnded)})},[]);return(0,r.useEffect)(()=>c,[]),{showRewardedAd:(0,r.useCallback)(async()=>(c(),new Promise(i=>{let{path:o,format:r,position:s}=e;googletag.cmd.push(()=>{var e;let a;if(d.current.onRewardedSlotReady=e=>{e.slot===a&&(e.makeRewardedVisible(),(0,l.Te)({provider:"google",position:o}),i())},d.current.onRewardedSlotGranted=e=>{var n;e.slot===a&&(null==(n=e.payload)?void 0:n.amount)&&t()},d.current.onRewardedSlotClosed=e=>{e.slot===a&&(googletag.destroySlots([a]),null==n||n())},d.current.onRewardedSlotRenderEnded=e=>{e.slot===a&&e.isEmpty&&(t(),(0,l.Fk)({id:3,provider:"google",position:o,type:"rewarded"}))},!(a=null==(e=googletag.defineOutOfPageSlot(o,googletag.enums.OutOfPageFormat.REWARDED))?void 0:e.setTargeting("ad_format",r).setTargeting("ad_position",s).addService(googletag.pubads())))return void i();googletag.enableServices(),googletag.pubads().addEventListener("rewardedSlotReady",d.current.onRewardedSlotReady),googletag.pubads().addEventListener("rewardedSlotGranted",d.current.onRewardedSlotGranted),googletag.pubads().addEventListener("rewardedSlotClosed",d.current.onRewardedSlotClosed),googletag.pubads().addEventListener("slotRenderEnded",d.current.onRewardedSlotRenderEnded),googletag.display(a)})})),[e]),isEnabled:(null==i?void 0:i.provider)===a.w.Google}}},32259:(e,t,n)=>{n.d(t,{a:()=>r});var i=n(65078),o=n(89194);function r(e,t){return(0,i.g3)(e)?{...t,[o.m.Left]:t[o.m.Right],[o.m.Right]:t[o.m.Left]}:t}},42796:(e,t,n)=>{n.d(t,{e1:()=>r,sJ:()=>o,u_:()=>i});let i=[n(21377).QCR.Football],o=["IT","US"],r="has-voted-daily-10x"},70448:(e,t,n)=>{n.d(t,{_7:()=>v._7,NT:()=>u.NT,w:()=>p.w,il:()=>u.il,dT:()=>u.dT,RI:()=>u.RI,Qf:()=>v.Qf,Ej:()=>u.Ej,HD:()=>v.HD,mR:()=>p.m,o3:()=>u.o3,d4:()=>d.d4,Iz:()=>d.Iz,do:()=>d.do,mt:()=>d.mt,T8:()=>d.T8,mK:()=>d.mK,w1:()=>d.w1,Q3:()=>d.Q3,bZ:()=>d.bZ,kS:()=>d.kS,wH:()=>m.wH,a8:()=>i.a8,$d:()=>i.$d,sr:()=>o.s,N6:()=>r.N,tV:()=>l.t,CU:()=>c});var i=n(84570),o=n(9643),r=n(87966);n(32259);var l=n(77562),s=n(1815),a=n(76410),d=n(17352);function c(e){let{voteType:t,isDailyBonus:n,eventId:i,location:o}=e,r=(0,d.K$)(t,n),l=(0,d.mt)(t)||"";return{impressionRef:(0,s.e)(()=>{r&&(0,a.M_)({type:r,id:i,position:l,location:o})},{sendInterval:3e4}),logOnEventVote:()=>{r&&(0,a.Tc)({id:i,type:r,position:l,location:o})}}}var u=n(9329),p=n(89194),v=n(75067),m=n(39332)},75067:(e,t,n)=>{n.d(t,{HD:()=>s,Qf:()=>l,_7:()=>o,fw:()=>r});var i=n(21377);let o={[i.rjx.WhoWillWin]:"who_will_win",[i.rjx.WillBothTeamsScore]:"will_both_teams_score",[i.rjx.FirstTeamToScore]:"first_team_to_score"},r={[i.rjx.WhoWillWin]:"who_will_win_edit",[i.rjx.WillBothTeamsScore]:"will_both_teams_score_edit",[i.rjx.FirstTeamToScore]:"first_team_to_score_edit"},l={[i.rjx.WhoWillWin]:"fullTime",[i.rjx.WillBothTeamsScore]:"bothTeamsToScore",[i.rjx.FirstTeamToScore]:"firstTeamToScore"},s={[i.rjx.WhoWillWin]:"who_will_win",[i.rjx.WillBothTeamsScore]:"will_both_teams_score_title",[i.rjx.FirstTeamToScore]:"who_will_score_first_title"}},77562:(e,t,n)=>{n.d(t,{t:()=>d});var i=n(21377),o=n(494),r=n(45860),l=n(88339),s=n(75067),a=n(39332);let d=(e,t)=>{var n,d,c;let u=(0,o.d4)(l.$F),p=(0,o.d4)(a.wH),{data:v,isLoading:m,mutate:x}=(0,r.Ay)((null==u?void 0:u.id)?i.VfS.futurePredictions(u.id):null),f=null==v||null==(d=v.predictions)||null==(n=d.find)?void 0:n.call(d,t=>t.eventId===e.id),h=null==(c=p[e.id])?void 0:c[t],g=null==h?void 0:h.current,j=null==h?void 0:h.prev;return{userVote:(null==f?void 0:f.votes[s.Qf[t]])||g,oldVote:j,eventFuturePrediction:f,userFuturePredictions:v,areFuturePredictionsLoading:m,mutateFuturePredictions:x}}},84570:(e,t,n)=>{n.d(t,{a8:()=>y,$d:()=>_,dV:()=>f,NC:()=>m});var i=n(55729),o=n(494),r=n(62859),l=n(75067),s=n(5815);let a=e=>({type:s.UG.ADD_CHANGED_VOTE,payload:e}),d=e=>({type:s.UG.REMOVE_CHANGED_VOTE,payload:e});var c=n(37567),u=n(17352),p=n(9643),v=n(77562);let m=(e,t)=>{let n=(0,o.wA)(),{event:s}=(0,i.useContext)(r.y$),{data:a,mutate:m}=(0,p.s)(s,e),{userVote:x,oldVote:f,userFuturePredictions:h,eventFuturePrediction:g,mutateFuturePredictions:j}=(0,v.t)(s,e),y=(n,i)=>{(0,u.kS)(a,m,t,i,x),(null==h?void 0:h.predictions)&&(null==g?void 0:g.votes)!==void 0&&(g.votes={...g.votes,[l.Qf[e]]:n},j({predictions:[...h.predictions.filter(e=>e.eventId!==s.id),g]},!1))};return{handleChangeVote:(t,i)=>{n(d({eventId:s.id,voteType:e})),y(t,i),f||n((0,c.sP)({eventId:s.id,type:e,vote:t}))}}};var x=n(39332);let f=(e,t)=>!!(0,o.d4)(x.am).find(n=>{var i;return n.eventId===e&&(null==(i=n.voteTypes[t])?void 0:i.isChangeVoteRewarded)});var h=n(81278),g=n(76410),j=n(87966);let y=(e,t,n,r,s)=>{let d=(0,o.wA)(),c=(0,h.useRouter)(),u=f(e.id,t),{userVote:p}=(0,v.t)(e,t),{hasNotStarted:m}=(0,j.N)(e),[x,y]=(0,i.useState)(!1),b=(0,i.useRef)(t);b.current=t;let w=m&&!n&&u,T=m&&!u&&!!p;(0,i.useEffect)(()=>{y("true"===c.query.editVote&&c.query.voteType==="".concat(t))},[]),(0,i.useEffect)(()=>{r(!1)},[t]),(0,i.useEffect)(()=>{s(n&&u)},[n,u]);let _=(0,i.useCallback)(()=>{r(!0);let t=b.current;d(a({eventId:e.id,voteType:t})),x?(0,g.ke)({action:"reward",location:"user_profile",type:l.fw[t]}):(0,g.ke)({action:"reward",location:"event_details",type:l._7[t]})},[e.id,t]);return{hasRevisitedChangeVote:w,canEditVote:T,autoShowAd:x,setAutoShowAd:y,grantReward:_}};var b=n(25355),w=n(98095),T=n(12962);let _=(e,t,n,o,r,s,a,d)=>{let{hasAdBlock:c}=(0,w.j)(),[p,v]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),[f,h]=(0,i.useState)(!1),{showRewardedAd:j,isEnabled:y}=(0,b.N)(T.A[t].Google,a,d),_=(0,i.useCallback)(async n=>{n.preventDefault(),n.stopPropagation(),(0,g.tN)({type:l._7[r],position:(0,u.mt)(r)||"",location:(0,u.T8)(t),id:e}),h(!1),v(!0),await j(),v(!1)},[j,o,r]),S=(0,i.useCallback)(()=>{if(o||!y){null==a||a();return}h(!0)},[o,y,a]);return(0,i.useEffect)(()=>{(async()=>{n&&(c?null==a||a():(m||o||(v(!0),await j(),v(!1)),x(!1)),s())})()},[n,c,j]),{onChangeVote:S,setShowLoader:v,setAdCanceled:x,showLoader:p,onShowAd:_,isModalOpen:f,setIsModalOpen:h}}},87966:(e,t,n)=>{n.d(t,{N:()=>r});var i=n(55729),o=n(17352);let r=e=>{let[t,n]=(0,i.useState)((0,o.bZ)(e));return(0,i.useEffect)(()=>{let t=setInterval(()=>{n((0,o.bZ)(e))},1e3);return()=>{clearInterval(t)}},[]),{hasNotStarted:t}}},89042:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(6029),o=n(21377),r=n(76356),l=n(55729),s=n(494),a=n(62859),d=n(19168),c=n(33144),u=n(41249),p=n(90248),v=n(54409),m=n(58918),x=n(57126),f=n(7067),h=n(41735),g=n(94497),j=n(70448);let y=(0,h.keyframes)(["from{left:50%;transform:translateX(-50%);}to{left:0;}"]),b=(0,h.default)(u.so).withConfig({componentId:"sc-ace7c0c8-0"})(["position:absolute;",""],e=>{let{buttonState:t}=e;return t===j.w.NoAnimation?(0,h.css)(["left:0;"]):t===j.w.Transform?(0,h.css)(["animation:"," 0.35s ease-out forwards;"],y):null}),w=(0,h.default)(u.az).withConfig({componentId:"sc-ace7c0c8-1"})(["position:absolute;right:0;",""],e=>{let{buttonState:t}=e;return t===j.w.NoAnimation?(0,h.css)(["opacity:1;"]):t===j.w.Transform?(0,h.css)(["opacity:0;animation:"," 0.2s 0.35s ease-in forwards;"],g.qG):(0,h.css)(["opacity:0;"])});function T(e){var t;let{isSelected:n,...r}=e,{variant:l}=(0,f.Ay)("web_who_wil_win_new_design"),{percentage:a,team:d,buttonPositionType:h,isVotingEnabled:g,voteConfig:y,animate:T}=r,_=(0,s.d4)(x.xl),S=y.position[h],A=(0,j.Iz)(g,T),R=null==d?void 0:d.sport.slug,I=(null==d||null==(t=d.subTeams)?void 0:t.length)===2&&R===o.QCR.Tennis,C=y.isTranslated&&(null==S?void 0:S.text),E=_&&(null==S?void 0:S.inverseTeamsText);return(0,i.jsxs)(u.so,{position:"relative",w:"100%",align:"center",justify:"center",h:24,children:[(0,i.jsx)(b,{buttonState:A,align:"center",children:I&&(null==d?void 0:d.subTeams)?(0,i.jsx)(m.K,{size:24,sport:R,teams:d.subTeams,hideFlags:!0,ignoreLink:!0}):d?(0,i.jsx)(c.p,{size:24,id:d.id,name:d.name}):(null==S?void 0:S.voteOption)===o.gbi.NoGoal&&l===f.KT.Treatment?(0,i.jsx)(v.U7g,{fill:"onSurface.nLv1"}):(0,i.jsx)(u.EY,{font:"display.micro",c:n?"primary.default":"onSurface.nLv1",mt:1,textTransform:"uppercase",children:C?(0,i.jsx)(p.A,{id:S.text}):E?(0,i.jsx)(i.Fragment,{children:S.inverseTeamsText}):(0,i.jsx)(i.Fragment,{children:null==S?void 0:S.text})})}),!g&&(0,i.jsx)(w,{buttonState:A,children:(0,i.jsxs)(u.EY,{as:"div",font:"display.small",c:n?"primary.default":"onSurface.nLv1",children:[null!=a?a:0,"%"]})})]})}function _(e){let{isVotingEnabled:t,votedPositionType:n,voteConfig:o,buttonPositionType:r,isChangeVoteActive:l,onVote:s}=e,a=!l&&void 0!==n&&n===r;return(0,i.jsx)(u.so,{as:t?"button":"div",align:"center",justify:"center",px:"lg",py:"xs",w:"100%",br:"xxl",bg:a?"primary.highlight":"surface.s1",border:t||a?"primary.default":"onSurface.nLv4",hoverBg:t?"primary.highlight":void 0,cursor:t?"pointer":"default",userSelect:"none",onClick:()=>{if(t){var e;let t=null==(e=o.position[r])?void 0:e.voteOption;t&&s(t,r)}},"data-testid":"prediction_option",children:(0,i.jsx)(T,{isSelected:a,...e})})}var S=n(42796),A=n(84570),R=n(37567);function I(e){var t,n;let{isDailyBonus:c,eventVoteLocation:u,voteType:p,config:v,enableVoteChange:m}=e,x=(0,s.wA)(),{event:f,leftTeam:h,rightTeam:g}=(0,l.useContext)(a.y$),{userVote:y}=(0,j.tV)(f,p),b=(0,A.dV)(f.id,p),{eventVotes:w,data:T,isLoading:I,mutate:C}=(0,j.sr)(f,p),{handleChangeVote:E}=(0,A.NC)(p,v),[V,k]=(0,d.yR)(S.e1,!1),[W,L]=(0,l.useState)(!1),N=(0,j.bZ)(f),F=(0,j.d4)(v,y),z=b&&m,M=N&&!(0,d.ux)(f)&&!y||z;(0,l.useEffect)(()=>{L(!1)},[p]);let{impressionRef:D,logOnEventVote:O}=(0,j.CU)({voteType:p,isDailyBonus:c,eventId:f.id,location:u}),K={voteConfig:v,votedPositionType:F,isVotingEnabled:M,isChangeVoteActive:z,animate:W,onVote:(e,t)=>{L(!0),b&&m?(E(e,t),x((0,R.eM)({eventId:f.id,type:p,vote:e,oldVote:y,isDailyBonus:c}))):((0,j.kS)(T,C,v,t),x((0,R.eM)({eventId:f.id,type:p,vote:e,isDailyBonus:c})),x((0,R.sP)({eventId:f.id,type:p,vote:e}))),O(),c&&k(!0)}},P=w.voteMiddle.isAvailable&&!!v.position[j.mR.Middle],Y=w.voteLeft.isAvailable&&!!v.position[j.mR.Left],B=w.voteRight.isAvailable&&!!v.position[j.mR.Right],$=(null==(t=v.position[j.mR.Left])?void 0:t.voteOption)===o.gbi.One,H=(null==(n=v.position[j.mR.Right])?void 0:n.voteOption)===o.gbi.Two;return I?(0,i.jsx)(r.az,{h:"2xl"}):(0,i.jsxs)(r.so,{ref:D,justify:"center",gap:"sm",children:[Y&&(0,i.jsx)(_,{buttonPositionType:j.mR.Left,percentage:w[j.mR.Left].percentage,team:$?h:void 0,...K}),P&&(0,i.jsx)(_,{buttonPositionType:j.mR.Middle,percentage:w[j.mR.Middle].percentage,...K}),B&&(0,i.jsx)(_,{buttonPositionType:j.mR.Right,percentage:w[j.mR.Right].percentage,team:H?g:void 0,...K})]})}function C(e){let{location:t,voteType:n,isDailyBonus:r,enableVoteChange:l}=e;switch(n){case o.rjx.WhoWillWin:return(0,i.jsx)(I,{config:j.o3,voteType:o.rjx.WhoWillWin,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});case o.rjx.WillBothTeamsScore:return(0,i.jsx)(I,{config:j.NT,voteType:o.rjx.WillBothTeamsScore,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});case o.rjx.FirstTeamToScore:return(0,i.jsx)(I,{config:j.dT,voteType:o.rjx.FirstTeamToScore,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});default:return null}}},97319:(e,t,n)=>{n.d(t,{A:()=>ej});var i=n(6029),o=n(76356),r=n(81278),l=n(55729),s=n(65789),a=n(75751),d=n(19168),c=n(7067),u=n(21377),p=n(41249),v=n(90248),m=n(45860),x=n(1815),f=n(76410),h=n(70448),g=n(494),j=n(75414),y=n(39332),b=n(37567),w=n(90112),T=n(9127),_=n(41735),S=n(22648);let A=e=>{let{isCancelable:t,isOpen:n,portalsContainerId:o,onClose:r}=e,l=(0,_.useTheme)();return((0,p.NF)(n),"undefined"==typeof document)?null:(0,i.jsx)(p.ZL,{id:o,children:(0,i.jsx)(w.N,{children:n&&(0,i.jsxs)(T.m.div,{animate:{backgroundColor:l.colors.overlay.darken2},exit:{backgroundColor:"rgba(0,0,0,0)",transition:{delay:.1}},transition:{duration:.2,ease:"easeIn"},style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",inset:0,overflow:"hidden",zIndex:p.Py.ModalBackdrop},onClick:r,"data-testid":"modal",children:[(0,i.jsx)(S.a,{size:56,spinnerColor:"#fff"}),t&&(0,i.jsx)(p.$n,{borderStyle:"rounded",colorScheme:"onColor",style:{position:"absolute",bottom:"10%",left:"50%",transform:"translateX(-50%)"},color:"secondary",onClick:r,children:(0,i.jsx)(v.A,{id:"basic.cancel"})})]},"overlay")})})};var R=n(98095),I=n(25355),C=n(12962);function E(e){let{id:t,placement:n,autoShowAd:o,preventAd:r,voteType:s,disableAutoShowAd:a,onRewardGranted:d,onRewardedSlotClosed:c}=e,{hasAdBlock:u}=(0,R.j)(),[m,x]=(0,l.useState)(!1),[g,j]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),{showRewardedAd:w,isEnabled:T}=(0,I.N)(C.A[n].Google,d,c),_=(0,l.useCallback)(async e=>{e.preventDefault(),e.stopPropagation(),(0,f.tN)({type:h._7[s],position:(0,h.mt)(s)||"",location:(0,h.T8)(n),id:t}),b(!1),x(!0),await w(),x(!1)},[w,r,s]),S=(0,l.useCallback)(()=>{if(r||!T){null==d||d();return}b(!0)},[r,T,d]);return(0,l.useEffect)(()=>{(async()=>{o&&(u?null==d||d():(g||r||(x(!0),await w(),x(!1)),j(!1)),a())})()},[o,u,w]),(0,i.jsxs)(p.az,{children:[(0,i.jsx)(A,{isOpen:m,isCancelable:!0,onClose:()=>{x(!1),j(!0)}}),(0,i.jsx)(p.EY,{font:"assistive.default",color:"primary.default",cursor:"pointer",onClick:S,children:(0,i.jsx)(v.A,{id:"basic.changeVote"})}),(0,i.jsx)(p.aF,{isOpen:y,children:(0,i.jsxs)(p.az,{w:312,bg:"surface.s1",p:"lg",br:"lg",elevation:3,mx:"auto",children:[(0,i.jsx)(p.EY,{font:"display.large",color:"onSurface.nLv1",lineHeight:"24px",mb:"sm",as:"div",children:(0,i.jsx)(v.A,{id:"profile.changeVoteTooltipDescription"})}),(0,i.jsx)(p.EY,{font:"body.medium",color:"onSurface.nLv1",as:"div",children:(0,i.jsx)(v.A,{id:"change_vote_watch_ad"})}),(0,i.jsxs)(p.so,{justify:"flex-end",mt:"xl",children:[(0,i.jsx)(p.$n,{variant:"unshielded",onClick:()=>b(!1),children:(0,i.jsx)(v.A,{id:"close_window_button"})}),(0,i.jsx)(p.$n,{variant:"unshielded",onClick:_,children:(0,i.jsx)(v.A,{id:"pickem.continue"})})]})]})})]})}let V=[{transId:"who_will_win",voteType:u.rjx.WhoWillWin,predictionsApiKey:h.o3.voteModelKey},{transId:"will_both_teams_score_title",voteType:u.rjx.WillBothTeamsScore,predictionsApiKey:h.NT.voteModelKey},{transId:"who_will_score_first_title",voteType:u.rjx.FirstTeamToScore,predictionsApiKey:h.dT.voteModelKey}],k=e=>{let t=[];return Object.entries(e).forEach(e=>{let[n,i]=e;V.some(e=>e.predictionsApiKey===n)&&i&&"object"==typeof i&&0!==Object.values(i).reduce((e,t)=>"number"==typeof t?e+t:e,0)&&t.push(n)}),t};var W=n(4967),L=n(95083),N=n(54409),F=n(10794);let z=_.default.a.withConfig({componentId:"sc-f4603315-0"})(["width:100%;text-transform:uppercase;transition:background-color 200ms ease 0s,box-shadow 200ms ease 0s,border-color 200ms ease 0s,color 200ms ease 0s;cursor:pointer;user-select:none;appearance:button;font:",";padding:"," ",";letter-spacing:0.5px;color:",";background-color:",";border:1.5px solid ",";border-radius:",";display:flex;align-items:center;justify-content:center;"],e=>e.theme.typography.font.button.primary,e=>e.theme.spacing.sm,e=>e.theme.spacing.lg,e=>e.theme.colors.surface.s1,e=>e.theme.colors.primary.default,e=>e.theme.colors.primary.default,e=>e.theme.spacing.xl),M={},D=e=>{let{onClose:t,geoIPAlpha2:n,...o}=e,{isMobile:r}=(0,L.$c)(),l=r?"":M[n].rulesLink;return(0,i.jsxs)(p.az,{br:["sm","md"],elevation:[void 0,2],p:"lg",mx:["sm",0],...o,children:[(0,i.jsxs)(p.so,{align:"flex-start",justify:"space-between",children:[(0,i.jsx)(p.EY,{as:"h3",font:"display.medium",color:"onSurface.nLv1",align:"left",mt:0,children:(0,i.jsx)(v.A,{id:"toto_promo_text",values:{providerName:M[n].providerName}})}),(0,i.jsx)(p.$n,{variant:"unshielded",p:"0",onClick:t,children:(0,i.jsx)(N.zQC,{icon:"close",width:"24",height:"24",fill:"onSurface.nLv1"})})]}),(0,i.jsx)(z,{rel:"noopener noreferrer",href:l,target:"_blank",children:(0,i.jsx)(v.A,{id:"toto_promo_button"})})]})},O=e=>{let{isOpened:t,setIsOpened:n}=e,o=(0,g.d4)(F.LQ);return o&&M[o]&&(0,W.dS)(M[o].releaseTimestamp)?(0,i.jsx)(w.N,{children:t&&(0,i.jsx)(T.m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,i.jsx)(D,{onClose:()=>n(!1),geoIPAlpha2:o})})}):null};var K=function(e){return e[e.Votable=1]="Votable",e[e.Transform=2]="Transform",e[e.Finish=3]="Finish",e[e.NoAnimation=4]="NoAnimation",e}({});let P=e=>({initial:{opacity:0},animate:{opacity:1},transition:{duration:.3*(e!==K.NoAnimation)}}),Y=(e,t)=>{let n=[K.Votable,K.Transform].includes(e)?{width:"100%",height:"28px",margin:"0 1px",borderRadius:"4px"}:{width:"".concat(t,"%"),height:"28px",margin:"0 1px",borderRadius:"0px",minWidth:"2.2%"},i=e===K.Transform?{borderRadius:["4px","0px","0px","0px"],margin:"0 1px",height:"28px",width:["100%","100%","100%","".concat(t,"%")],minWidth:"2.2%"}:n;return{initial:n,animate:i,transition:{duration:1.25*(e===K.Transform)}}},B=(e,t,n)=>{let i=e.find(e=>e.eventId===n.id);return!i||i[u.rjx.WhoWillWin]||i[u.rjx.WillBothTeamsScore]||i[u.rjx.FirstTeamToScore]?e.map(e=>e.eventId===n.id?{...e,[t]:!1}:e):e.filter(e=>e.eventId===n.id)},$=(e,t,n)=>e.find(e=>e.eventId===n.id)?e.map(e=>e.eventId===n.id?{...e,[t]:!0}:e):[...e.splice(0,h.RI-1),{eventId:n.id,[t]:!0}];var H=n(21501);let Q=(0,_.default)(p.so).withConfig({componentId:"sc-1c395574-0"})(["&.ts-1 > * + *{margin-left:8px;}"]),G=e=>{let{label:t,votePosition:n,value:o,percentage:r,transitionState:s,showNumbers:a,onClick:d,...c}=e,u=(0,l.useRef)(null),[v,m]=(0,l.useState)(!1),x=s===K.Votable,f=10>Math.round(r),h=()=>{let e=!1;if(null==u?void 0:u.current){let t=u.current.offsetWidth;e="X"===n?f?t>=30:t>=34:f?t>=30:t>=38}m(e)};return(0,H.st)(h,100,[null==u?void 0:u.current]),(0,i.jsx)(T.m.div,{...Y(s,r),onAnimationComplete:()=>{h()},ref:u,"data-testid":"prediction_option",children:(0,i.jsx)(p.so,{h:"100%",bg:"1"===n?"secondary.default":"2"===n?"primary.default":"neutral.default",align:"center",br:"inherit",cursor:x?"pointer":"default",onClick:x?()=>d(o):void 0,...c,children:(0,i.jsx)(p.EY,{color:"surface.s1",font:"display.small",align:"center",w:"100%",as:"div",children:x?t:a&&v?(0,i.jsx)(T.m.span,{style:{padding:"0 8px"},...P(s),children:"".concat(r,"%")}):null})})})};function Z(e){let{id:t,vote:n,userVote:o,hasDraw:r,expired:s,leftValue:a,rightValue:d,middleValue:c,leftDisplayValue:u,rightDisplayValue:v,middleDisplayValue:m,isVotingEnabled:x,isRewardedAndRevisited:f,onVote:g}=e,j=(0,l.useRef)(void 0),y=o&&n.voteLeft+n.voteRight+(n.voteMiddle||0)!==0||s?K.NoAnimation:K.Votable,[b,w]=(0,l.useState)(y),T=[K.Finish,K.NoAnimation].includes(y),[_,S]=(0,l.useState)(T),A=(0,h.mK)(n.voteLeft,n.voteMiddle,n.voteRight),R=()=>{w(K.Votable),S(!1),j.current&&clearTimeout(j.current)};(0,l.useEffect)(()=>{w(y),S(T)},[t]),(0,l.useEffect)(()=>{w(K.NoAnimation),S(!0)},[]),(0,l.useEffect)(()=>{x?R():b!==K.NoAnimation&&(w(K.Transform),S(!0))},[x]);let I=e=>{e&&(g(e),w(K.Transform),j.current=setTimeout(()=>S(!0),2500))};return n?(0,i.jsx)(Q,{className:"ts-".concat(f?K.Transform:b),direction:"column",justify:"center",style:{userSelect:"none"},children:(0,i.jsxs)(p.so,{children:[(0,i.jsx)(G,{votePosition:"1",label:u,value:a,percentage:A.leftPercentage,transitionState:f?K.NoAnimation:b,onClick:I,showNumbers:f||_}),r&&(0,i.jsx)(G,{votePosition:"X",label:m,value:c,percentage:A.middlePercentage,transitionState:f?K.NoAnimation:b,onClick:I,showNumbers:f||_}),(0,i.jsx)(G,{votePosition:"2",label:v,value:d,percentage:A.rightPercentage,transitionState:f?K.NoAnimation:b,onClick:I,showNumbers:f||_})]})}):null}var q=n(947),U=n(62859),X=n(65078),J=n(57126),ee=n(24338);let et=(e,t)=>{var n;let i=(0,h.do)(t),o=(0,h.w1)(e);return null==(n=i.position[o])?void 0:n.voteApiKey},en=(e,t)=>{var n,i;let o=(0,q.A)();if(t===u.rjx.WhoWillWin)return e?"Tie":(null==(n=h.o3.position[h.mR.Middle])?void 0:n.text)||"";if(t===u.rjx.FirstTeamToScore){let e=null==(i=h.dT.position[h.mR.Middle])?void 0:i.text;return h.dT.isTranslated&&e?o.formatMessage({id:e}):e||""}return""};function ei(e){var t;let{event:n,placement:o,voteType:s,logVoteImpression:a,impressionSender:c,isInitialized:x,setInitialized:w}=e,T=(0,g.wA)(),_=(0,l.useCallback)((e,t,i)=>T((0,b.eM)({eventId:n.id,type:i,vote:e,oldVote:t})),[n.id,s]),{hasNotStarted:S}=(0,h.N6)(n),A=(0,r.useRouter)(),[R,I]=(0,l.useState)(!1),[C,k]=(0,l.useState)(!1),[W,L]=(0,l.useState)(!1),[N,F]=(0,d.yR)("vote-rewards",[]),z=!!N.find(e=>e.eventId===n.id&&e[s]),M=(0,g.d4)(y.wH)[n.id],D=null==M||null==(t=M[s])?void 0:t.current,{userVote:K,oldVote:P,userFuturePredictions:Y,eventFuturePrediction:H,areFuturePredictionsLoading:Q,mutateFuturePredictions:G}=(0,h.tV)(n,s),ei=!!K&&S&&!z,eo=!W&&S&&z,er=S&&!(0,d.ux)(n)&&!ei&&!eo,{vote:el,onVoteChange:es,onEventVote:ea,...ed}=function(e,t,n){let{voteModelKey:i,isTranslated:o,position:r}=(0,h.do)(t),s=(0,q.A)(),a=(0,X.g3)(e),d=(0,h.bZ)(e),c=e.homeTeam.disabled||e.awayTeam.disabled,{data:p,error:v,mutate:x,isLoading:f}=(0,m.Ay)(u.bnp.votes(e.id),d?{refreshInterval:6e4,dedupingInterval:6e4,onSuccess:()=>{null==n||n()}}:void 0),j=r[h.mR.Left],y=r[h.mR.Middle],b=r[h.mR.Right],w=(0,ee.b)(p,i),T=(0,ee.b)(w,null==j?void 0:j.voteApiKey),_=(0,ee.b)(w,null==y?void 0:y.voteApiKey),S=(0,ee.b)(w,null==b?void 0:b.voteApiKey),A=(!T||T<0?0:T)+(!S||S<0?0:S)+(!_||_<0?0:_),R=!c&&(d||0!==A),[I,C]=a?[S,T]:[T,S],E=null==y?void 0:y.voteOption,V=null==j?void 0:j.voteOption,k=null==b?void 0:b.voteOption,[W,L]=a?[k,V]:[V,k],[N,F]=a?[null==b?void 0:b.text,null==j?void 0:j.text]:[null==j?void 0:j.text,null==b?void 0:b.text];N=o&&N?s.formatMessage({id:N}):N||"",F=o&&F?s.formatMessage({id:F}):F||"";let z=(0,g.d4)(J.xl),{leftTeam:M,rightTeam:D}=(0,l.useContext)(U.y$),O=z&&t!==u.rjx.WillBothTeamsScore&&M.nameCode||N,K=z&&t!==u.rjx.WillBothTeamsScore&&D.nameCode||F,P=en(z,t);return{totalVotes:A,vote:R&&(I||0===I)&&(C||0===C)?{voteLeft:I,voteMiddle:_,voteRight:C}:void 0,leftValue:W,rightValue:L,middleValue:E,leftDisplayValue:O,rightDisplayValue:K,middleDisplayValue:P,notAvailable:!R,isLoading:f,hasDraw:"number"==typeof _,error:v,expired:!d,onEventVote:(0,l.useCallback)(async e=>{let n=et(e,t);if(p&&i&&n){let e=p[i],t=n in e?e[n]:0;x({...p,[i]:{...p[i],[n]:t+1}},!1)}},[p,e.id,x,t]),onVoteChange:(0,l.useCallback)(async(e,n,o)=>{if(e===n)return;let r=et(e,t),l=et(n,t);if(p&&w){let e=r&&r in w?w[r]:0,t=l&&l in w?w[l]:0;x({...p,[i]:{...p[i],...r&&{[r]:e>0?e-1:0},...l&&{[l]:t+1},type:o}},!1)}},[p,e.id,x,t])}}(n,s,()=>{T((0,b.sP)({eventId:n.id,type:s,vote:K}))}),ec=e=>{if(F(e=>B(e,s,n)),es(K,e,s),null==Y?void 0:Y.predictions){if((null==H?void 0:H.votes)===void 0)return;H.votes={...H.votes,[h.Qf[s]]:e},G({predictions:[...Y.predictions.filter(e=>e.eventId!==n.id),H]},!1)}P||T((0,b.sP)({eventId:n.id,type:s,vote:e}))};return((0,l.useEffect)(()=>{if(k("true"===A.query.editVote&&A.query.voteType==="".concat(s)&&!x),!x){let e=P&&(null==el?void 0:el[(0,h.w1)(P)]),t=0===(null==el?void 0:el[(0,h.w1)(K)]);K&&P&&K!==P?(e&&e>0||t)&&es(P,K,s):void 0!==K&&K===P&&t&&ea(K)}null==w||w(s)},[]),ed.error||ed.notAvailable&&!ed.isLoading)?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(O,{isOpened:R,setIsOpened:I}),(0,i.jsxs)(p.az,{w:"100%",mt:"md",px:"sm",ref:a&&er?c:void 0,position:"relative",children:[(0,i.jsx)(p.az,{position:"absolute",top:"-30px",left:"50%",style:{transform:"translateX(-50%)"},children:!er&&(0,i.jsxs)(p.EY,{font:"assistive.default",children:[(0,i.jsx)(v.A,{id:"prediction_total_votes"}),": ",(0,j.A)(ed.totalVotes)]})}),(0,i.jsx)(p.az,{pb:"lg",children:el&&!Q?(0,i.jsx)(Z,{id:n.id,userVote:K,onVote:e=>{z||K&&K!==e?ec(e):(ea(e),T((0,b.sP)({eventId:n.id,type:s,vote:e}))),_(e,K,s),I(!0),(0,f.Tc)({id:n.id,type:h._7[s],position:String(V.findIndex(e=>e.voteType===s)+1),location:(0,h.T8)(o)})},isRewardedAndRevisited:eo,isVotingEnabled:er,voteType:s,...ed,vote:el}):(0,i.jsx)(p.az,{h:28})}),er&&(0,i.jsx)(p.az,{mb:"md",textAlign:"left",children:(0,i.jsx)(p.EY,{as:"span",font:"assistive.default",color:"onSurface.nLv3",children:(0,i.jsx)(v.A,{id:"change_vote_info_text"})})}),o&&(ei||eo||!S&&D)?(0,i.jsxs)(p.so,{align:"center",justify:"space-between",mb:"md",children:[(0,i.jsxs)(p.so,{align:"center",children:[(0,i.jsx)(p.az,{minW:"18px",px:"6px",br:"md",mr:"xs",bg:K===ed.leftValue?"secondary.default":K===ed.rightValue?"primary.default":"neutral.default",children:(0,i.jsx)(p.EY,{font:"assistive.default",color:"surface.s1",children:K===ed.leftValue?ed.leftDisplayValue:K===ed.rightValue?ed.rightDisplayValue:ed.middleDisplayValue})}),(0,i.jsx)(p.EY,{font:"assistive.default",children:(0,i.jsx)(v.A,{id:"prediction_your_vote"})})]}),(ei||eo)&&(0,i.jsx)(p.az,{alignSelf:"end",children:(0,i.jsx)(E,{id:n.id,voteType:s,placement:o,autoShowAd:C,preventAd:eo,disableAutoShowAd:()=>k(!1),onRewardGranted:()=>{L(!0),F(e=>$(e,s,n)),C?(0,f.ke)({action:"reward",location:"user_profile",type:"".concat(h._7[s],"_edit")}):(0,f.ke)({action:"reward",location:"event_details",type:h._7[s]})}})}),!S&&(0,i.jsx)(p.az,{alignSelf:"end",children:(0,i.jsx)(p.EY,{font:"assistive.default",color:"onSurface.nLv3",children:(0,i.jsx)(v.A,{id:"voting_ended_status"})})})]}):!S&&(0,i.jsx)(p.so,{align:"center",justify:"end",mb:"md",pt:"xxs",children:(0,i.jsx)(p.EY,{font:"assistive.default",color:"onSurface.nLv3",children:(0,i.jsx)(v.A,{id:"voting_ended_status"})})})]})]})}var eo=n(70591);function er(e){let{isInWidget:t}=e;return(0,i.jsx)(s.Zp,{isInverseDesktop:t,children:(0,i.jsx)(o.az,{py:"sm",px:"lg",children:(0,i.jsxs)(o.so,{align:"center",justify:"space-between",children:[(0,i.jsx)(p._V,{h:36,w:52,src:"/static/images/weekly-challenge/predictions-cta.svg",alt:"Weekly challenge trophies"}),(0,i.jsx)(eo.N_,{routeKey:"user.weeklyChallenge",onClick:()=>{(0,f.Wk)({type:"weekly_challenge",location:"event_details"})},children:(0,i.jsxs)(o.so,{cursor:"pointer",align:"center",children:[(0,i.jsx)(L.EY,{color:"primary.default",textStyle:"display.micro",children:(0,i.jsx)(v.A,{id:"view_weekly_challenge"})}),(0,i.jsx)(N.CCT,{fill:"primary.default"})]})})]})})})}let el=e=>{let{event:t,placement:n,isInWidget:o}=e,a=(0,r.useRouter)(),c=t.tournament.category.sport.slug===u.QCR.Football,[g,j]=(0,l.useState)(0),[y,b]=(0,l.useState)([]),[w,T]=(0,l.useState)(c?V:[V[0]]),{data:_,error:S}=(0,m.Ay)(u.bnp.votes(t.id)),A=1e3*t.startTimestamp>Date.now()&&t.status.type===u.XUj.NotStarted,R=(0,h.T8)(n),I=(0,x.e)(()=>{(0,f.M_)({type:h._7[u.rjx.WhoWillWin],position:"1",id:t.id,location:R})},{sendInterval:3e4}),C=(0,x.e)(()=>{(0,f.M_)({type:h._7[u.rjx.WillBothTeamsScore],position:"2",id:t.id,location:R})},{sendInterval:3e4}),E=(0,x.e)(()=>{(0,f.M_)({type:h._7[u.rjx.FirstTeamToScore],position:"3",id:t.id,location:R})},{sendInterval:3e4});return((0,l.useEffect)(()=>{a.query.voteType&&j(V.findIndex(e=>"".concat(e.voteType)===a.query.voteType))},[]),(0,l.useEffect)(()=>{if(_&&(!A||(0,d.ux)(t))){let e=k(_);T(V.filter(t=>e.includes(t.predictionsApiKey)))}else A&&(c?T(V):T([V[0]]))},[_,A]),S||0===w.length||t.awayTeam.disabled||t.homeTeam.disabled)?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Zp,{isInverseDesktop:o,children:(0,i.jsxs)(p.az,{position:"relative",textAlign:"center",border:"1px solid transparent","data-testid":"predictions",children:[w.length>1&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.VQ,{mx:"sm",h:"50px",centerVertically:!0,controls:[g,j],buttonProps:{variant:"unshielded"},children:w.map(e=>(0,i.jsx)(p.EY,{font:"display.medium",color:"onSurface.nLv1",as:"h3",children:(0,i.jsx)(v.A,{id:e.transId})},e.voteType))}),(0,i.jsx)(ei,{event:t,placement:n,logVoteImpression:!0,impressionSender:[I,C,E][g],voteType:w[g].voteType,isInitialized:y.includes(w[g].voteType),setInitialized:e=>{b([...y,e])}},g)]}),1===w.length&&(0,i.jsx)(p.az,{children:w.map(e=>(0,i.jsxs)(l.Fragment,{children:[(0,i.jsx)(p.so,{mx:"sm",h:"50px",justify:"center",children:(0,i.jsx)(p.EY,{font:"display.medium",color:"onSurface.nLv1",as:"h3",children:(0,i.jsx)(v.A,{id:e.transId})})}),(0,i.jsx)(ei,{event:t,placement:n,logVoteImpression:!1,voteType:e.voteType,isInitialized:y.includes(e.voteType),setInitialized:e=>{b([...y,e])}})]},e.voteType))})]})}),c&&w&&(0,i.jsx)(p.so,{align:"center",justify:"center",mb:"md",children:w.map((e,t)=>(0,i.jsx)(p.az,{w:t===g?"xl":"sm",h:"sm",br:"xs",mx:"xs",bg:t===g?"primary.default":"onSurface.nLv4"},"".concat(e.voteType,"-nav")))}),(0,i.jsx)(er,{isInWidget:o})]})};function es(e){let{onChangeVote:t,onChangeVoteContinue:n,onChangeVoteClose:r,isModalOpen:l,isLoaderOpen:s,onLoaderExit:a}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(A,{isOpen:s,onClose:a,isCancelable:!0}),(0,i.jsx)(L.$n,{variant:"clear",size:"tertiary",onClick:t,children:(0,i.jsx)(v.A,{id:"basic.changeVote"})}),(0,i.jsx)(p.aF,{isOpen:l,children:(0,i.jsxs)(o.az,{w:"[312px]",bg:"surface.s1",p:"lg",br:"lg",elevation:"3",mx:"auto",children:[(0,i.jsx)(p.EY,{font:"display.large",color:"onSurface.nLv1",lineHeight:"24px",mb:"sm",as:"div",children:(0,i.jsx)(v.A,{id:"profile.changeVoteTooltipDescription"})}),(0,i.jsx)(p.EY,{font:"body.medium",color:"onSurface.nLv1",as:"div",children:(0,i.jsx)(v.A,{id:"change_vote_watch_ad"})}),(0,i.jsxs)(o.so,{justify:"flex-end",mt:"xl",children:[(0,i.jsx)(L.$n,{variant:"clear",onClick:r,children:(0,i.jsx)(v.A,{id:"close_window_button"})}),(0,i.jsx)(L.$n,{variant:"clear",onClick:n,children:(0,i.jsx)(v.A,{id:"pickem.continue"})})]})]})})]})}function ea(e){let{totalVotes:t,isLoading:n}=e;return(0,i.jsx)(L.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:!n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v.A,{id:"prediction_total_votes"}),": ",(0,j.A)(t)]})})}function ed(e){let{event:t,isVotingEnabled:n,activeVoteType:r,changeVoteBtn:l}=e,{totalVotes:s,isLoading:a}=(0,h.sr)(t,r),{hasNotStarted:d}=(0,h.N6)(t);return d?n?(0,i.jsx)(o.so,{justify:"center",align:"center",minH:"2xl",children:(0,i.jsx)(L.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:(0,i.jsx)(v.A,{id:"change_vote_info_text"})})}):(0,i.jsxs)(o.so,{justify:"space-between",align:"center",minH:"2xl",children:[(0,i.jsx)(ea,{totalVotes:s,isLoading:a}),l]}):(0,i.jsxs)(o.so,{justify:"space-between",align:"center",minH:"2xl",children:[(0,i.jsx)(ea,{totalVotes:s,isLoading:a}),(0,i.jsx)(L.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:(0,i.jsx)(v.A,{id:"voting_ended_status"})})]})}function ec(e){let{titleId:t,voteType:n}=e;return t?(0,i.jsx)(L.EY,{textStyle:"display.medium",color:"neutrals.nLv1",children:t&&(0,i.jsx)(v.A,{id:t})},n):null}function eu(e){let{sliderOptions:t,initialIndex:n,setActiveVoteType:o}=e,[r,s]=(0,l.useState)(n);return(0,l.useEffect)(()=>{o(t[r])},[r]),(0,i.jsx)(p.VQ,{mx:"lg",h:"40px",centerVertically:!0,controls:[r,s],buttonProps:{variant:"unshielded"},children:t.map(e=>{let t=h.HD[e];return(0,i.jsx)(ec,{titleId:t,voteType:e},e)})})}function ep(e){let{sliderOptions:t}=e;if(t.length>1)return(0,i.jsx)(eu,{...e});let n=t[0],r=h.HD[n];return(0,i.jsx)(o.so,{h:"3xl",justify:"center",align:"center",children:(0,i.jsx)(ec,{titleId:r,voteType:n})})}var ev=n(89042);let em=(0,n(62042).Fj)({base:{h:"sm",br:"xs",mx:"xs"},variants:{type:{default:{w:"sm",bg:"neutrals.nLv4"},active:{w:"xl",bg:"primary.default"}}}}),ex=(0,o.I4)("div",em);function ef(e){let{sliderOptions:t,activeVoteType:n}=e;return t.length>1?(0,i.jsx)(o.so,{align:"center",justify:"center",mb:"md",children:t.map(e=>(0,i.jsx)(ex,{type:n===e?"active":"default"},"".concat(e,"-dot")))}):null}function eh(e){let{event:t}=e,n=(0,r.useRouter)(),a=e.event.tournament.category.sport.slug,d=h.Ej[a]||h.il,[c,u]=(0,l.useState)(d[0]),[p,v]=(0,l.useState)(0),[m,x]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{if(n.query.voteType&&!m){u(d.find(e=>"".concat(e)===n.query.voteType)||d[0]);let e=d.findIndex(e=>"".concat(e)===n.query.voteType);v(e<0?0:e)}x(!0)},[]),m)?0===d.length||t.awayTeam.disabled||t.homeTeam.disabled?null:(0,i.jsx)(eg,{sliderOptions:d,initialIndex:p,activeVoteType:c,setActiveVoteType:u,...e}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Zp,{isInverseDesktop:e.isInWidget,children:(0,i.jsx)(o.az,{h:"[130px]"})}),(0,i.jsx)(o.az,{h:"sm",mb:"md"})]})}function eg(e){let{event:t,placement:n,isInWidget:r,initialIndex:a,sliderOptions:c,setActiveVoteType:u,activeVoteType:p}=e,v=(0,h.T8)(n),{userVote:m}=(0,h.tV)(t,p),{hasNotStarted:x}=(0,h.N6)(t),[f,g]=(0,l.useState)(!1),[j,y]=(0,l.useState)(!1),b=x&&!(0,d.ux)(t)&&!m||j,{autoShowAd:w,canEditVote:T,grantReward:_,hasRevisitedChangeVote:S,setAutoShowAd:A}=(0,h.a8)(t,p,f,g,y),{isModalOpen:R,onChangeVote:I,onShowAd:C,setAdCanceled:E,setIsModalOpen:V,setShowLoader:k,showLoader:W}=(0,h.$d)(t.id,n,w,S,p,()=>A(!1),()=>{_(),k(!1)});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.Zp,{isInverseDesktop:r,"data-testid":"predictions",children:[(0,i.jsx)(ep,{sliderOptions:c,initialIndex:a,setActiveVoteType:u}),(0,i.jsx)(o.az,{px:"lg",py:"sm",children:(0,i.jsx)(ev.A,{location:v,voteType:p,enableVoteChange:f})}),(0,i.jsx)(o.az,{px:"lg",children:(0,i.jsx)(ed,{event:t,activeVoteType:p,isVotingEnabled:b,changeVoteBtn:(T||S)&&(0,i.jsx)(es,{onChangeVote:I,onChangeVoteClose:()=>V(!1),onChangeVoteContinue:C,isModalOpen:R,isLoaderOpen:W,onLoaderExit:()=>{k(!1),E(!0)}})})}),(0,i.jsx)(s.Zp.Footer,{defaultHeight:"sm"})]}),(0,i.jsx)(ef,{sliderOptions:c,activeVoteType:p}),(0,i.jsx)(er,{isInWidget:r})]})}function ej(e){let{variant:t,isLoading:n}=(0,c.Ay)("web_who_wil_win_new_design");return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Zp,{isInverseDesktop:e.isInWidget,children:(0,i.jsx)(o.az,{h:"[139px]"})}),(0,i.jsx)(o.az,{mb:"2xl"}),(0,i.jsx)(o.az,{h:"[52px]"})]}):t===c.KT.Treatment?(0,i.jsx)(a.t,{tag:"EventVotes",children:(0,i.jsx)(eh,{...e})}):(0,i.jsx)(a.t,{tag:"EventVotes",children:(0,i.jsx)(el,{...e})})}}}]);