!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]="a93fe1a5-99ea-4ff0-98e3-513ee302cb37",e._sentryDebugIdIdentifier="sentry-dbid-a93fe1a5-99ea-4ff0-98e3-513ee302cb37")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91381],{3022:(e,t,r)=>{r.d(t,{Q:()=>l});var n=r(46787),s=r(45860);function l(e,t){let{data:r,error:l,isLoading:i}=(0,s.Ay)(n.V3t.cupTrees(e,t));return l?[void 0,i]:[null==r?void 0:r.cupTrees,i]}},12094:(e,t,r)=>{r.d(t,{TI:()=>function e(t,r,n,d,c){if(null===r){let r=t.rounds.length-1;if(r>=0){var u,p,x,m,h;if(t.rounds[r].type>=0&&!((e,t)=>{let r=e.rounds[t];return!!r&&/final/i.test(r.description)&&1===r.type})(t,r)&&t.rounds[r].blocks.length>1)return e((0,s.l)(t),null);if(0===t.rounds[r].blocks.length||1===t.rounds[r].blocks.length&&!t.rounds[r].blocks[0].participants){let n=(e=>{let t=e.rounds.length-1;for(;t>=0&&!e.rounds[t].blocks.some(e=>{var t,r;return(null!=(r=null==(t=e.participants)?void 0:t.length)?r:0)>0});)t--;return t})(t);return e(nl,ne:()=>i});var n=r(46787),s=r(65462);let l=e=>{if(e.rounds.some(e=>1!==e.blocks.length&&e.blocks.length%2!=0))return!0;let t=0;for(let r=0;re.rounds.some(e=>e.blocks.some(e=>e.participants.some(e=>e.sourceBlockId))),o=(e,t)=>"".concat(e,":").concat(t);function a(e,t,r,n,s,l){var i,d,c,u,p,x,m,h,f,v;let g=((e,t,r,n,s)=>{let l=e.rounds[t];if(l){if(void 0!==n){let e=l.blocks.find(e=>e.blockId===n);if(e&&e.blockId>=0)return s.has(o(t,e.blockId))?void 0:e}if(void 0!==r){let e=l.blocks.find(e=>e.order===r);if(e&&!s.has(o(t,e.blockId)))return e}}})(e,r,n,s?t:void 0,l);if(!g)return;l.add(o(r,g.blockId));let b=null!=(h=null!=(m=g.order)?m:n)?h:1,j=null==(d=g.participants)||null==(i=d[0])?void 0:i.sourceBlockId,y=null==(u=g.participants)||null==(c=u[1])?void 0:c.sourceBlockId;return(null!=(f=null==(p=g.participants)?void 0:p.length)?f:0)===1?{...g,roundIndex:r,participantDraw:null==(v=e.rounds[r])?void 0:v.participantDraw,left:a(e,j,r-1,2*b-1,s,l),right:a(e,y,r-1,2*b,s,l)}:{...g,roundIndex:r,participantDraw:null==(x=e.rounds[r])?void 0:x.participantDraw,left:a(e,j,r-1,2*b-1,s,l),right:a(e,y,r-1,2*b,s,l)}}},38809:(e,t,r)=>{r.d(t,{B:()=>l,W:()=>s});var n=r(55729);let s=(0,n.createContext)(void 0),l=()=>{let e=(0,n.useContext)(s);if(void 0===e)throw Error("useCupTreeContext must be used within a CupTreeProvider");return e}},45254:(e,t,r)=>{r.d(t,{r9:()=>n,Fx:()=>l,BE:()=>c,ov:()=>i,KA:()=>p,bs:()=>o,d_:()=>u,TI:()=>a.TI,y6:()=>function e(t){return t?Math.max(e(t.left),e(t.right))+1:0},P4:()=>d}),r(65462);let n=e=>{let{hasWinner:t,isFirstParticipantWinner:r,isSecondParticipantWinner:n,isLive:s,isSeriesInProgress:l}=e;return s?{firstParticipantName:"live",secondParticipantName:"live",firstParticipantScore:"live",secondParticipantScore:"live"}:{firstParticipantName:!t||r?"default":"secondary",secondParticipantName:!t||n?"default":"secondary",firstParticipantScore:l?"success":r?"default":"secondary",secondParticipantScore:l?"success":n?"default":"secondary"}};var s=r(46787);let l=e=>{let{firstParticipant:t,secondParticipant:r,block:n}=e,l=n.result===s.pq_.Walkover,i=n.result===s.pq_.Retired,o=!!(null==t?void 0:t.winner),a=!!(null==r?void 0:r.winner);return{isLive:!!n.eventInProgress,isSeriesInProgress:!n.finished,isRetired:i,isWalkover:l,isSpecial:i||l,isFirstParticipantWinner:o,isSecondParticipantWinner:a,hasWinner:o||a,hasScore:!!n.homeTeamScore&&!!n.awayTeamScore,hasStartTime:!!n.seriesStartDateTimestamp}};function i(e,t){return function e(r){if(void 0===r)return 0;let n=0;return r.isHidden||(t&&r.participants.length>=1?n=1:2===r.participants.length&&(n=1)),n+e(null==r?void 0:r.left)+e(null==r?void 0:r.right)}(e)>0}let o=e=>e.type===s.FFH.Finals||e.type%2==0&&(e.type===s.FFH.ThirdPlace&&1===e.blocks.length||e.type<=8);var a=r(12094);let d=(e,t)=>{let r,n=t||e.rounds;if(e.currentRound){var l;r=(null==(l=n[e.currentRound-1])?void 0:l.type)<=s.FFH.EighthFinals}if(!1===r||1===e.rounds.length&&1===e.rounds[0].type||e.rounds.length>0&&e.rounds[0].blocks.length>8)return!1;let i=e.rounds.filter(e=>{let t;return t=e.description,!/qualif|preliminary/i.test(t)});return!!i.length&&!(i.some(e=>e.blocks.some(t=>(t.order?t.order:0)>e.blocks.length))||i.every(e=>e.blocks.every(e=>e.participants.every(e=>e.team.disabled))))&&i.some(e=>e.blocks.some(e=>e.participants.length>0))};function c(e){let t=[];return e.forEach((e,r)=>{let n=new Set;e.blocks.forEach(e=>{e.participants.forEach(r=>{var s;if((null==r||null==(s=r.team)?void 0:s.id)&&!r.team.disabled){if(t.some(e=>e.has(r.team.id))||1===e.participants.length)return;n.add(r.team.id)}})}),t.push(n)}),t}function u(e,t,r){if(0===t)return!1;let n=null==r?void 0:r[t];if(n){var s;if((null==e||null==(s=e.team)?void 0:s.id)&&n.has(e.team.id))return!0}return!1}function p(e){return!!e&&e.some((e,t)=>t>0&&e.size>0)}},58643:(e,t,r)=>{r.d(t,{AK:()=>l,Dh:()=>n,Gj:()=>o,IT:()=>d,XV:()=>a,Yv:()=>s,ut:()=>i});let n=20,s=.2,l=1.5,i=4,o=32,a=658,d=880},65462:(e,t,r)=>{r.d(t,{l:()=>l});var n=r(9922),s=r.n(n);function l(e){let t=e.rounds.length-1;if(t>=0){let r=s()(e);for(;r.rounds[t].blocks.length>1;){let e=r.rounds[t],n={id:-1,order:e.order+1,description:"",type:-1,blocks:[]};e.blocks.forEach((e,t)=>{if(t%2==0){let r={blockId:e.blockId+9999,events:[],result:"",isHidden:!0,order:Math.ceil((t+1)/2),participants:[{sourceBlockId:e.blockId}]};n.blocks.push(r)}else n.blocks[n.blocks.length-1].participants.push({sourceBlockId:e.blockId})}),r.rounds.push(n),t=r.rounds.length-1}return r}return e}},84668:(e,t,r)=>{r.d(t,{eo:()=>eg,b8:()=>ea,Y9:()=>w,eS:()=>ev,_4:()=>R,Vr:()=>ex,b2:()=>u,Cq:()=>eh,WR:()=>S,Xs:()=>ec,Bg:()=>ep,Dg:()=>em});var n=r(6029),s=r(51569),l=r(20325),i=r(90248),o=r(52676),a=r(9081);let d=e=>{let{isColorless:t}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.so,{mb:"sm",gap:"md",children:[(0,n.jsx)(o.J,{position:"relative",mt:"2xs",seed:1,colorless:t}),(0,n.jsx)(s.EY,{textStyle:"body.mediumParagraph",children:(0,n.jsx)(i.A,{id:"tennis_seeded_player"})})]}),(0,n.jsxs)(l.so,{mb:"sm",gap:"md",children:[(0,n.jsx)(o.J,{position:"relative",mt:"2xs",seed:"WC",colorless:t}),(0,n.jsx)(s.EY,{textStyle:"body.mediumParagraph",children:(0,n.jsx)(i.A,{id:"abbr.wc"})})]}),(0,n.jsxs)(l.so,{mb:"sm",gap:"md",children:[(0,n.jsx)(o.J,{position:"relative",mt:"2xs",seed:"LL",colorless:t}),(0,n.jsx)(s.EY,{textStyle:"body.mediumParagraph",children:(0,n.jsx)(i.A,{id:"abbr.ll"})})]}),(0,n.jsxs)(l.so,{mb:"sm",gap:"md",children:[(0,n.jsx)(o.J,{position:"relative",mt:"2xs",seed:"PR",colorless:t}),(0,n.jsx)(s.EY,{textStyle:"body.mediumParagraph",children:(0,n.jsx)(i.A,{id:"abbr.pr"})})]}),(0,n.jsxs)(l.so,{mb:"sm",gap:"md",children:[(0,n.jsx)(o.J,{position:"relative",mt:"2xs",seed:"Q",colorless:t}),(0,n.jsx)(s.EY,{textStyle:"body.mediumParagraph",children:(0,n.jsx)(i.A,{id:"abbr.qp"})})]}),(0,n.jsxs)(l.so,{mb:"sm",gap:"md",children:[(0,n.jsx)(o.J,{position:"relative",mt:"2xs",seed:"A",colorless:t}),(0,n.jsx)(s.EY,{textStyle:"body.mediumParagraph",children:(0,n.jsx)(i.A,{id:"abbr.a"})})]}),(0,n.jsxs)(l.so,{mb:"sm",gap:"md",children:[(0,n.jsx)(o.J,{position:"relative",mt:"2xs",seed:"SE",colorless:t}),(0,n.jsx)(s.EY,{textStyle:"body.mediumParagraph",children:(0,n.jsx)(i.A,{id:"abbr.se"})})]})]})},c={Quarterfinal:"1/4",Quarterfinals:"1/4",Semifinal:"1/2",Semifinals:"1/2",Final:"1/1","Round 1":"R1","Round 2":"R2","Round 3":"R3","Round 4":"R4","Round 5":"R5","Round 6":"R6","Round 7":"R7","Round 8":"R8","Round 9":"R9","Round 10":"R10","Qualification round 1":"QR1","Qualification round 2":"QR2","Qualification round 3":"QR3","Qualification round 4":"QR4","Qualification round 5":"QR5","Qualification round 6":"QR6","Preliminary round":"PR","Preliminary round 1":"PR1","Preliminary round 2":"PR2","Round of 16":"1/8","Round of 32":"1/16","Round of 64":"1/32","Round of 128":"1/64",R16:"1/8",R32:"1/16",R64:"1/32",R128:"1/64","1/8":"1/8","1/16":"1/16","1/32":"1/32","1/64":"1/64"};function u(e){let{roundName:t}=e;return t in c?(0,n.jsx)(n.Fragment,{children:c[t]}):(0,n.jsx)(a.rC,{roundName:t})}var p=r(46787),x=r(46222),m=r(54246),h=r(55729),f=r(947),v=r(50865),g=r(97431),b=r(79154);let j={};var y=r(52466),k=r(82536);function S(){let[e,t]=(0,h.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.az,{h:"xl",w:"xl",onClick:()=>t(!0),cursor:"pointer",children:(0,n.jsx)(y.G_L,{color:"neutrals.nLv1"})}),(0,n.jsx)(k.A,{isOpen:e,setIsOpen:t,header:"tennis_seedings_title",children:(0,n.jsx)(l.az,{px:"lg",pt:"sm",maxW:{md:"[328px]"},children:(0,n.jsx)(d,{})})})]})}function w(e){let{id:t,name:r,sport:s,phaseSelector:i,embedProps:o}=e,a=s===p.QCR.Tennis,d=function(e,t){let{uniqueTournamentId:r,uniqueTournamentName:n}=(0,h.useContext)(v.O),s=(0,f.A)();if(j[t])return j[t];let l=s.formatMessage({id:e||"tournament.cupTree"});if(!r||!n||!(r in b))return j[t]=l,l;let i=s.formatMessage({id:b[r.toString()]}),o=(0,g.t)(e,p.QCR.Football,s);return(o=o.replace(new RegExp("\\b".concat(n,"\\b")),i))===e?(j[t]=l,l):(j[t]=o,o)}(r,t),c=(0,n.jsx)(l.az,{h:"2xl",children:(0,n.jsxs)(l.so,{align:"center",gap:"lg",children:[i,a&&(0,n.jsx)(S,{}),(0,n.jsx)(m.w,{type:"cup_tree",...o})]})});return(0,n.jsx)(x.Zp.Header,{variant:"left-aligned-desktop",title:(0,n.jsx)("bdi",{children:d}),actionComponent:c})}function R(){return(0,n.jsx)(l.so,{className:"cupTree-instruction-snackbar",position:"absolute",justify:"center",top:"[112px]",left:"0",w:"100%",children:(0,n.jsxs)(l.so,{align:"center",bg:"surface.t",px:"lg",py:"md",br:"lg",h:"4xl",children:[(0,n.jsx)(y.fRW,{color:"surface.s1"}),(0,n.jsx)(s.EY,{ml:"md",textStyle:"body.medium",color:"surface.s1",children:(0,n.jsx)(i.A,{id:"bracket_zoom_snackbar"})})]})})}var I=r(494),T=r(56494),C=r(96016),P=r(36678);function _(e){let[t,r]=(0,h.useState)(!1),{block:s}=e,o=(0,I.wA)(),a=(0,I.d4)(e=>s.events?s.events.map(t=>e.favorites.events[t]).filter(Boolean):[]);async function d(){try{if(s.events&&a.lengthp.nk6.fetchEvent(e)))).map(e=>{let{event:t}=e;return t});o((0,C.oU)(e)),r(!1)}}catch(e){r(!1)}}return(0,h.useEffect)(()=>{d()},[s.blockId,s.events]),(0,n.jsx)(l.az,{children:t?(0,n.jsx)(T.a,{}):a.length?(0,n.jsx)(n.Fragment,{children:a.map(e=>(0,n.jsx)("div",{children:(0,n.jsx)(P.n6,{event:e,isNarrow:!0,isShort:!0,isShortDate:!0,children:null})},e.id))}):(0,n.jsx)(i.A,{id:"basic.noEvents",defaultMessage:"No events"})})}var B=r(67087),E=r(31830),L=r(11219);let H=e=>{let{events:t,children:r}=e,s=(0,E.A)(),l=async e=>{e.preventDefault();let r=null==t?void 0:t[0];if(!r||(null==t?void 0:t.length)>1)return;let{event:n}=await p.nk6.fetchEvent(r);(0,L.zw)(s,"event",{id:n.customId,name:n.slug,sport:n.tournament.category.sport.slug},void 0,"id:".concat(r))};return(0,n.jsx)("a",{href:"#",onClick:l,children:r})};var D=r(33144),A=r(88505),F=r(38809),V=r(62042);let z=(0,V.Fj)({variants:{variant:{default:{color:"neutrals.nLv1"},secondary:{color:"neutrals.nLv3"},live:{color:"status.live"},success:{color:"secondary.default"}}},defaultVariants:{variant:"default"}}),Y=(0,l.I4)("span",z),N=(0,l.I4)("bdi",z),M="cupTreeHighlight-team",W=()=>(0,n.jsx)(l.az,{px:"sm",br:"sm",bg:"secondary.highlight",h:"md",w:"2xl",children:(0,n.jsx)(s.EY,{textStyle:"assistive.micro",color:"secondary.default",verticalAlign:"top",children:"BYE"})}),Q=(0,h.memo)(function(e){var t,r;let{participant:s,seed:a,nameColor:d,scoreColor:c,roundIndex:u,score:p,isFirst:x,isNewEntrant:m,isEmptyBlock:h}=e,{showSingleParticipantByeBlocks:f}=(0,F.B)(),v=(null==s||null==(t=s.team)?void 0:t.id)||0,g=(null==(r=document)?void 0:r.dir)==="rtl",b=f&&(null==s?void 0:s.team)===void 0&&!h&&0===u;return(0,n.jsxs)(l.so,{h:"[34px]",pl:{lgDown:"sm",lg:"md"},pr:{mdDown:"sm",md:p?"sm":void 0,lg:p?"md":void 0},pt:x?"sm":"xs",pb:x?"xs":"sm",align:"center",justify:"space-between",className:v?"".concat(M,"-").concat(v):"",borderStartStartRadius:g?x&&p?"sm":void 0:x?"sm":void 0,borderStartEndRadius:g?x?"sm":void 0:x&&p?"sm":void 0,borderEndEndRadius:g?x?void 0:"sm":x||!p?void 0:"sm",borderEndStartRadius:g?x||!p?void 0:"sm":x?void 0:"sm",children:[(0,n.jsxs)(l.so,{w:"100%",align:"center",overflowX:"clip",h:"xl",children:[(0,n.jsx)(l.az,{position:"relative",children:b?(0,n.jsx)(l.az,{w:"xl",h:"xl"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(D.p,{id:v,name:null==s?void 0:s.team.name,size:"xl",style:{verticalAlign:"top"}}),(0,n.jsx)(o.J,{seed:a,right:"[0px]",bottom:"-xs",h:"md",textStyle:"assistive.micro"})]})}),(0,n.jsx)(N,{ml:"sm",variant:d,textStyle:"body.medium",truncate:!0,maxW:{mdDown:"[124px]",md:"[180px]"},children:b?(0,n.jsx)(W,{}):(null==s?void 0:s.team)?(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)(y.UPF,{color:"playoffs.promotionToX",w:"16",h:"16",mr:"xs",verticalAlign:"middle",style:{transform:g?"rotate(-90deg)":"rotate(90deg)",marginTop:"-1px"}}),(0,n.jsx)(A.Rm,{team:s.team,short:!0})]}):(0,n.jsx)(i.A,{id:"label_to_be_determined",defaultMessage:"TBD"})})]}),p&&(0,n.jsx)(Y,{style:{whiteSpace:"nowrap"},variant:c,children:p})]})});var X=r(22375),q=r(90510);let O=e=>{let{seriesStartDateTimestamp:t,isLive:r}=e,l=1e3*t,o=(0,X.cK)(l)||(0,X.ef)(l);return(0,n.jsx)(s.EY,{textStyle:"assistive.default",textAlign:"end",display:"block",pr:"sm",minW:"[52px]",color:r?"status.live":"neutrals.nLv3",children:r?(0,n.jsx)(i.A,{id:"inProgress"}):(0,n.jsxs)(n.Fragment,{children:[o?(0,n.jsx)(i.A,{id:(0,X.cK)(l)?"today":"tomorrow"}):(0,n.jsx)(q.XU,{day:"numeric",month:"short",value:l}),(0,n.jsx)("br",{}),(0,n.jsx)(q.ib,{value:l})]})})},J=e=>{let{isRetired:t,isWalkover:r}=e;return(0,n.jsx)(s.EY,{textStyle:"assistive.default",display:"block",color:"neutrals.nLv3",px:"sm",truncate:!0,children:(0,n.jsx)(i.A,{id:r?"walkover":t?"retired":""})})},G=e=>{let{isFinals:t}=e;return(0,n.jsx)(l.az,{bg:t?"status.val":"neutral.default",br:"sm",position:"absolute",bottom:"[0px]",left:"[50%]",transform:{base:"translate(-50%,50%)",_rtl:"translate(50%,50%)"},pb:"2xs",children:(0,n.jsx)(s.EY,{textStyle:"assistive.micro",color:"surface.s1",px:"md",display:"block",children:(0,n.jsx)(i.A,{id:t?"final":"3rdPlace"})})})};(0,V.AH)({_after:{content:'""',display:"block",position:"absolute",top:"[50%]",right:"[-21px]",width:"[1px]",height:"var(--participant-connector-height)",borderStyle:"dashed",borderBottomWidth:"xs",borderBottomColor:"surface.s2"}});let K=(0,V.AH)({borderTop:"[4px solid {colors.surface.s1}]",borderRight:"[4px solid {colors.surface.s1}]",animation:"fadeIn 0.2s ease-in-out",_after:{content:'""',display:"block",position:"absolute",bottom:"0",width:"xl",height:"[0px]",borderTop:"[4px solid {colors.surface.s1}]",_ltr:{right:"-xl"},_rtl:{left:"-xl"},md:{borderColor:"surface.s2"}},md:{borderColor:"surface.s2"}}),U=(0,V.AH)({borderBottom:"[4px solid {colors.surface.s1}]",borderRight:"[4px solid {colors.surface.s1}]",animation:"fadeIn 0.2s ease-in-out",_after:{content:'""',display:"block",position:"absolute",top:"[1px]",width:"xl",height:"[0px]",borderTop:"[4px solid {colors.surface.s1}]",_ltr:{right:"-xl"},_rtl:{left:"-xl"},md:{borderColor:"surface.s2"}},md:{borderColor:"surface.s2"}}),Z=(0,V.AH)({borderTop:"[4px dashed {colors.surface.s1}]",borderLeft:"[4px dashed {colors.surface.s1}]",animation:"fadeIn 0.2s ease-in-out",md:{borderColor:"surface.s2"}}),$=(0,V.AH)({borderBottom:"[4px dashed {colors.surface.s1}]",borderLeft:"[4px dashed {colors.surface.s1}]",animation:"fadeIn 0.2s ease-in-out",md:{borderColor:"surface.s2"}});function ee(e){return(0,n.jsx)(l.az,{...e,width:"[calc(100% - 40px)]",position:"relative",marginTop:"xs",marginBottom:"xs",_ltr:{left:"[-20px]"},_rtl:{right:"[-20px]"}})}let et=(0,V.Fj)({base:{_before:{content:'""',position:"absolute",borderLeft:"[4px solid {colors.surface.s1}]",bottom:"[80px]",left:"[calc(50% - 2px)]",height:"lg",display:"block"},_after:{content:'""',position:"absolute",borderLeft:"[4px solid {colors.surface.s1}]",top:"[80px]",left:"[calc(50% - 2px)]",height:"lg",display:"block"}},variants:{hideTopConnector:{true:{_before:{display:"none"}},false:{}},hideBottomConnector:{true:{_after:{display:"none"}},false:{}},inCard:{true:{_before:{borderColor:"surface.s2"},_after:{borderColor:"surface.s2"}},false:{}}},defaultVariants:{hideTopConnector:!1,hideBottomConnector:!1,inCard:!1}});function er(e){let{hideTopConnector:t,hideBottomConnector:r,inCard:s=!1,...i}=e;return(0,n.jsx)(l.so,{...i,userSelect:"none",position:"relative",h:"8xl",borderRadius:"sm",w:"7xl",m:"[14px 4px]",flexDirection:"column",className:(0,V.cx)(et({hideTopConnector:t,hideBottomConnector:r,inCard:s}),i.className)})}var en=r(58643),es=r(45254);function el(e){var t,r,i;let{block:o,highlights:a,selectedRoundIndex:d}=e,c=(0,B.g3)(),{rounds:u,sourceTreeId:p,phaseFilter:x,entrantsPerRound:m,preferSourceBlockId:f}=(0,F.B)(),v=(0,h.useRef)(null),g=(0,h.useRef)(null),b=(0,h.useRef)(null),j=c?o.participants[1]:o.participants[0],k=null==j?void 0:j.teamSeed,S=c?o.awayTeamScore:o.homeTeamScore,w=c?o.participants[0]:o.participants[1],R=null==w?void 0:w.teamSeed,I=c?o.homeTeamScore:o.awayTeamScore,T=(0,es.Fx)({firstParticipant:j,secondParticipant:w,block:o}),C=(0,es.r9)(T),P=(T.hasScore||T.isLive)&&!T.isSpecial,_=!!o.seriesStartDateTimestamp&&!P&&!T.isSpecial;(0,h.useLayoutEffect)(()=>{if(!e.is3rdPlace)return setTimeout(()=>{!function(){var t;let r="rtl"===document.dir,n=document.querySelector('[data-tree-id="'.concat(p,'"]'))||document;if(!n)return;let s=(e=>{let t=e.querySelector(".cuptree-round-descriptions"),r=null==t?void 0:t.style.transform.match(/scaleX\(([^)]+)\)/),n=1;return r&&r[1]&&(n=+r[1]),n})(n),l=f?n.querySelector('[data-blockId="'.concat(null==j?void 0:j.sourceBlockId,'"][data-level="').concat((e.level||0)+1,'"]')):n.querySelector('[data-order="'.concat(2*(o.order||1)-1,'"][data-level="').concat((e.level||0)+1,'"]')),i=f?n.querySelector('[data-blockId="'.concat(null==w?void 0:w.sourceBlockId,'"][data-level="').concat((e.level||0)+1,'"]')):n.querySelector('[data-order="'.concat(2*(o.order||1),'"][data-level="').concat((e.level||0)+1,'"]')),a=null==(t=v.current)?void 0:t.getBoundingClientRect(),d=null==l?void 0:l.getBoundingClientRect(),c=null==i?void 0:i.getBoundingClientRect();if(a){if(d){let t=Math.abs(a.top-d.top)/s;g.current&&(o.participantDraw?g.current.classList.add(...Z.split(" "),"edge-"+(e.edge||"none"),"arrangement-"+(e.arrangement||"none")):g.current.classList.add(...K.split(" ")),r?g.current.style.right="-".concat(2*en.Dh,"px"):g.current.style.left="-".concat(2*en.Dh,"px"),g.current.style.width="".concat(en.Dh,"px"),g.current.style.top=-t+en.Gj+"px",g.current.style.height=t+en.ut+"px")}if(c){let t=Math.abs(c.top-a.top)/s;b.current&&(o.participantDraw?b.current.classList.add(...$.split(" "),"edge-"+(e.edge||"none"),"arrangement-"+(e.arrangement||"none")):b.current.classList.add(...U.split(" ")),r?b.current.style.right="-".concat(2*en.Dh,"px"):b.current.style.left="-".concat(2*en.Dh,"px"),b.current.style.width="".concat(en.Dh,"px"),b.current.style.bottom=-t+en.Gj+"px",b.current.style.height=t+en.ut+"px")}if(o.participantDraw&&"left"===e.edge){let t=document.querySelectorAll('[data-level="'.concat((e.level||0)+1,'"]')),r=t[0],n=t[t.length-1];if(r&&n){let e=r.getBoundingClientRect(),t=n.getBoundingClientRect(),l=Math.abs(e.top-t.top)/s;r.setAttribute("style","--participant-connector-height:".concat(l,"px")),r.classList.add("participant-connector")}}}}()},200),()=>{var e,t;null==(e=g.current)||e.classList.remove(...K.split(" ")),null==(t=b.current)||t.classList.remove(...U.split(" "))}},[d,x]);let E=o.venue&&!j&&!w,L=!j&&!w;return(0,n.jsxs)(ee,{ref:v,"data-blockId":o.blockId,"data-order":o.order,"data-level":e.level,"data-leftBlockId":null==j?void 0:j.sourceBlockId,"data-rightBlockId":null==w?void 0:w.sourceBlockId,position:"relative",onMouseEnter:()=>{var e,t;return a.set([null==j||null==(e=j.team)?void 0:e.id,null==w||null==(t=w.team)?void 0:t.id])},onMouseLeave:a.clear,children:[(0,n.jsx)(l.az,{position:"absolute",top:"[36px]",left:"0",ref:g,pointerEvents:"none"}),(0,n.jsx)(l.az,{position:"absolute",left:"0",ref:b,pointerEvents:"none"}),(0,n.jsx)(H,{events:o.events,children:(0,n.jsxs)(l.so,{position:"relative",bg:{mdDown:"surface.s1",md:"surface.s2"},br:"sm",cursor:(null==(t=o.events)?void 0:t.length)>0?"pointer":"default",align:"center",justify:"space-between",className:"cup-tree-block",elevation:{mdDown:"2"},children:[(0,n.jsx)(l.az,{flexGrow:1,overflow:"hidden",h:"[68px]",children:E?(0,n.jsxs)(l.so,{pl:"md",h:"100%",align:"center",children:[(0,n.jsx)(l.az,{w:"xl",h:"xl",mr:"sm",children:(0,n.jsx)(y.EGm,{w:"24",h:"24",color:"neutrals.nLv1"})}),(0,n.jsxs)(l.az,{children:[(0,n.jsx)(s.EY,{maxW:"[148px]",truncate:!0,display:"block",children:null==(r=o.venue)?void 0:r.name}),(0,n.jsx)(s.EY,{color:"neutrals.nLv3",textStyle:"assistive.default",display:"block",children:null==(i=o.venue)?void 0:i.city.name})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{participant:j,seed:k,nameColor:C.firstParticipantName,scoreColor:C.firstParticipantScore,score:P?S||"-":void 0,isEmptyBlock:L,roundIndex:o.roundIndex,isNewEntrant:(0,es.d_)(j,u.length-(e.level||0)-1,m),isFirst:!0}),(0,n.jsx)(Q,{participant:w,seed:R,nameColor:C.secondParticipantName,scoreColor:C.secondParticipantScore,score:P?I||"-":void 0,isEmptyBlock:L,roundIndex:o.roundIndex,isNewEntrant:(0,es.d_)(w,u.length-(e.level||0)-1,m)})]})}),(e.isFinals||e.is3rdPlace)&&(0,n.jsx)(G,{isFinals:e.isFinals}),T.isSpecial?(0,n.jsx)(J,{isRetired:T.isRetired,isWalkover:T.isWalkover}):_?(0,n.jsx)(O,{isLive:T.isLive,seriesStartDateTimestamp:o.seriesStartDateTimestamp}):null]})})]})}function ei(e){var t;let{thirdPlaceBlock:r,...s}=e,i=s.block.events.length>1,[o,a]=(0,h.useState)(!1),{showSingleParticipantByeBlocks:d,rounds:c}=(0,F.B)(),u=0===s.level&&!s.isRelegationDecider&&(null==(t=c[c.length-1])?void 0:t.type)===p.FFH.Finals,x=d?0===s.block.participants.length:s.block.participants.length<2;return s.ancestorHasParticipants&&x&&!s.block.venue&&!s.block.seriesStartDateTimestamp||s.block.isHidden?null:(0,n.jsxs)(l.az,{position:"relative",role:"button",transitionProperty:"all",transitionDuration:"fast",transitionTimingFunction:"ease-in-out",onClick:e=>{e.stopPropagation(),a(!0)},style:{width:s.isVisibleRound?s.columnWidth:"0",height:s.isVisibleRound?"78px":"0",opacity:+!!s.isVisibleRound},children:[(0,n.jsx)(el,{...s,withLink:!i,isFinals:!s.is3rdPlace&&u,is3rdPlace:s.is3rdPlace}),i&&(0,n.jsx)(k.A,{isOpen:o,setIsOpen:a,header:"tournament.series",children:(0,n.jsx)(l.az,{px:"lg",pt:"sm",maxW:{md:"[360px]"},children:(0,n.jsx)(_,{...s})})}),u&&r&&(0,n.jsx)(l.az,{w:"100%",position:"absolute",bottom:"-2xl",left:"[0px]",transform:"translateY(100%)",children:(0,n.jsx)(ei,{...s,block:r,is3rdPlace:!0})})]})}let eo=e=>{let{status:t,colors:r,block:l}=e,o=l.homeTeamScore&&l.homeTeamScore.length>5||l.awayTeamScore&&l.awayTeamScore.length>5;return t.isWalkover?(0,n.jsx)(s.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",mt:"xs",children:(0,n.jsx)(i.A,{id:"walkover"})}):t.isRetired?(0,n.jsx)(s.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",mt:"xs",children:(0,n.jsx)(i.A,{id:"retired"})}):t.hasScore?(0,n.jsxs)(s.EY,{textAlign:"center",mt:"xs",style:{whiteSpace:"nowrap"},children:[(0,n.jsx)(Y,{textStyle:o?"body.small":"body.large",variant:r.firstParticipantScore,children:l.homeTeamScore.replace(" ","")})," : ",(0,n.jsx)(Y,{textStyle:o?"body.small":"body.large",variant:r.secondParticipantScore,children:l.awayTeamScore.replace(" ","")})]}):t.hasStartTime?(0,n.jsx)(s.EY,{textStyle:"assistive.default",color:t.isLive?"status.live":"neutrals.nLv3",mt:"xs",children:(0,X.cK)(1e3*l.seriesStartDateTimestamp)?(0,n.jsx)(q.ib,{value:1e3*l.seriesStartDateTimestamp}):(0,n.jsx)(q.XU,{day:"numeric",month:"short",value:1e3*l.seriesStartDateTimestamp})}):null};function ea(e){var t,r,a;let{block:d,hideTopConnector:c,hideBottomConnector:u,inCard:p}=e,[x,m]=(0,h.useState)(!1),f=d.participants[0],v=d.participants[1],g=(0,es.Fx)({firstParticipant:f,secondParticipant:v,block:d}),b=(0,es.r9)(g);return(0,n.jsxs)(H,{events:d.events,children:[(0,n.jsxs)(er,{align:"center",justify:"center",bg:p?"surface.s2":"surface.s1",elevation:"2",hideTopConnector:c,hideBottomConnector:u,inCard:p,role:"button",onClick:e=>{var t;((null==(t=d.events)?void 0:t.length)||0)>1&&(e.preventDefault(),e.stopPropagation(),m(!0))},children:[(0,n.jsxs)(l.so,{align:"center",justify:"center",children:[(0,n.jsxs)(l.so,{mx:"xs",w:"1/2",direction:"column",justify:"center",align:"center",textAlign:"center",position:"relative",children:[(0,n.jsx)(D.p,{id:null==f||null==(t=f.team)?void 0:t.id,w:"[28px]",h:"[28px]"}),(null==f?void 0:f.team)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.J,{seed:f.teamSeed,bottom:"lg",h:"md",textStyle:"assistive.micro"}),(0,n.jsx)(Y,{mt:"xs",textStyle:"assistive.default",variant:b.firstParticipantName,children:f.team.nameCode||f.team.name.slice(0,3)})]}):(0,n.jsx)(s.EY,{textTransform:"uppercase",mt:"xs",textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,n.jsx)(i.A,{id:"label_to_be_determined",defaultMessage:"TBD"})})]}),(0,n.jsxs)(l.so,{mx:"xs",w:"1/2",direction:"column",justify:"center",align:"center",textAlign:"center",position:"relative",children:[(0,n.jsx)(D.p,{id:null==v||null==(r=v.team)?void 0:r.id,w:"[28px]",h:"[28px]"}),(null==v?void 0:v.team)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.J,{seed:v.teamSeed,bottom:"lg",h:"md",textStyle:"assistive.micro"}),(0,n.jsx)(Y,{mt:"xs",textStyle:"assistive.default",variant:b.secondParticipantName,children:v.team.nameCode||v.team.name.slice(0,3)})]}):(0,n.jsx)(s.EY,{textTransform:"uppercase",mt:"xs",textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,n.jsx)(i.A,{id:"label_to_be_determined",defaultMessage:"TBD"})})]})]}),(0,n.jsx)(eo,{block:d,colors:b,status:g})]}),((null==(a=d.events)?void 0:a.length)||0)>1&&(0,n.jsx)(k.A,{isOpen:x,setIsOpen:m,header:"tournament.series",children:(0,n.jsx)(l.so,{px:"lg",pt:"sm",direction:"column",maxW:{md:"[360px]"},children:(0,n.jsx)(_,{block:d})})})]})}var ed=r(59721);function ec(){let{tournamentId:e}=(0,F.B)();return(0,n.jsxs)(l.az,{position:"absolute",top:"[calc(50% - 28px)]",right:"[-42px]",children:[(0,n.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.9608 41.0577V39.4808H31.5294V36.3269H24.4706V39.4808H26.0392V41.0577H20.1569L17.8039 43.4231V45H38.1961V43.4231L35.8431 41.0577H29.9608ZM48 7.54808H42.1176V11.4904H44.0784V18.1608L40.549 21.7088V4H15.451V21.7088L11.9216 18.1608V11.4904H13.8824V7.54808H8V19.8008L15.451 27.2912V30.8077L17.8039 32.3846L21.7255 34.75H34.2745L38.1961 32.3846L40.549 30.8077V27.2912L48 19.8008V7.54808Z",fill:"#E8B345"}),(0,n.jsx)("path",{d:"M16.9 44.9V49.9L11.9 49.9V54H43V52.0001L39 52V45L16.9 44.9Z",fill:"#374DF5"}),(0,n.jsx)("rect",{x:"20",y:"10",width:"16",height:"16",fill:"url(#pattern0_2354_307)"}),(0,n.jsx)("defs",{children:(0,n.jsx)("pattern",{id:"pattern0_2354_307",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,n.jsx)("use",{xlinkHref:"#image0_2354_307",transform:"scale(0.015625)"})})})]}),(0,n.jsx)(ed.e,{id:e,size:"lg",style:{position:"absolute",top:8,left:20}})]})}var eu=function(e){return e.Left="left",e.Right="right",e.Inner="inner",e}({});function ep(e){let{tree:t,initialOrientation:r="top",inCard:s}=e;if(!t)return null;let i=t.left||t.right;return(0,n.jsxs)(l.so,{flexGrow:1,flexShrink:1,direction:"top"===r?"column":"column-reverse",children:[(0,n.jsxs)(l.so,{children:[(0,n.jsx)(ep,{tree:t.left,initialOrientation:r,inCard:s}),(0,n.jsx)(ep,{tree:t.right,initialOrientation:r,inCard:s})]}),(0,n.jsxs)(l.so,{justify:"center",position:"relative",children:[i&&(0,n.jsx)(l.az,{position:"absolute",borderTopColor:s?"surface.s2":"surface.s1",borderTopWidth:"4px",borderTopStyle:"solid",w:"[calc(50% + 4px)]",left:"[calc(25% - 2px)]",top:"top"===r?"-2xs":"[calc(100% - 2px)]"}),(0,n.jsx)(ea,{block:t,hideTopConnector:!i&&"top"===r,hideBottomConnector:!i&&"bottom"===r,inCard:s})]})]})}let ex=(0,h.memo)(function e(t){var r;let{selectedRoundIndex:s}=t,{tree:i,level:o=0,depth:a}=t,{rounds:d}=(0,F.B)(),c=a-o-1,u=void 0===s||s===c||s-1===c||s+1===c;if(!i)return null;let x=t.ancestorHasParticipants||!i.isHidden&&i.participants.length>0,{left:m,right:h,...f}=i,v=!t.isRelegationDecider&&0===o&&(null==(r=d[d.length-1])?void 0:r.type)===p.FFH.Finals&&f.finished;return(0,n.jsxs)(l.so,{flexGrow:1,flexShrink:1,flexBasis:"[1px]",justify:"flex-end",children:[(m||h)&&(0,n.jsxs)(l.az,{position:"relative",children:[(0,n.jsx)(e,{...t,ancestorHasParticipants:x,level:o+1,tree:m,arrangement:"left",edge:t.edge===eu.Inner||t.edge===eu.Right?eu.Inner:eu.Left}),(0,n.jsx)(e,{...t,ancestorHasParticipants:x,level:o+1,tree:h,arrangement:"right",edge:t.edge===eu.Inner||t.edge===eu.Left?eu.Inner:eu.Right})]}),(0,n.jsxs)(l.so,{position:"relative",direction:"column",justify:"space-around",children:[v&&u&&(0,n.jsx)(ec,{}),(0,n.jsx)(ei,{block:f,thirdPlaceBlock:f.thirdPlaceBlock,highlights:t.highlights,arrangement:t.arrangement,edge:t.edge,level:o,isRelegationDecider:t.isRelegationDecider,ancestorHasParticipants:t.ancestorHasParticipants,isVisibleRound:u,selectedRoundIndex:s,columnWidth:t.columnWidth},f.blockId||"".concat(o,"-").concat(t.depth,"-").concat(f.order))]})]})});function em(e){let{onZoomIn:t,onZoomOut:r}=e;return(0,n.jsxs)(l.so,{dir:"ltr",direction:"column",position:"absolute",top:"[64px]",right:"xl",gap:"2xs",children:[(0,n.jsx)(s.K0,{size:"primary",onClick:t,children:(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 11H13V4H11V11H4V13H11V20H13V13H20V11Z",fill:"var(--surface-s1)"})})}),(0,n.jsx)(s.K0,{size:"primary",onClick:r,children:(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 11H13H11H4V13H11H13H20V11Z",fill:"var(--surface-s1)"})})})]})}function eh(e){let{x:t,scale:r,roundNames:i}=e,o=(0,h.useMemo)(()=>r>0?1/r:1,[r]),{sport:d}=(0,F.B)();return(0,n.jsx)(l.so,{gap:"3xl",px:"lg",transformOrigin:{base:"0px 0px 0px",_rtl:"top right 0px"},style:{transform:"translateX(".concat(t,"px) scaleX(").concat(r,")")},className:"cuptree-round-descriptions",children:i.map((e,t)=>(0,n.jsx)(l.az,{h:"4xl",py:"lg",flexGrow:0,flexShrink:0,flexBasis:"[260px]",overflowClipMargin:10,overflowX:"clip",children:(0,n.jsx)(s.EY,{display:"block",textStyle:"table.medium",textAlign:"center",style:{transformOrigin:"50% 50%",transform:"scaleX(".concat(o,")")},children:r<.3?(0,n.jsx)(u,{roundName:e}):(0,n.jsx)(a.rC,{roundName:e,sport:d})})},e+t))})}var ef=r(41735);function ev(e){let{onChange:t}=e,[r,s]=(0,h.useState)([]),l=(0,ef.useTheme)();return(0,h.useEffect)(()=>(t.push(e=>{s(e)}),()=>{t.pop()}),[]),(0,n.jsx)("style",{children:r.map(e=>"\n .".concat(M,"-").concat(e," { background: ").concat(l.colors.neutral.highlight,"; }\n .").concat(M,"-").concat(e,":hover { background: ").concat(l.colors.neutral.highlight,"; }\n "))})}function eg(){let e="rtl"===document.dir;return(0,n.jsxs)(l.az,{px:"sm",py:"md",children:[(0,n.jsx)(y.UPF,{color:"playoffs.promotionToX",w:"24",h:"24",mr:"xs",verticalAlign:"middle",style:{transform:e?"rotate(-90deg)":"rotate(90deg)",marginTop:"-1px"}}),(0,n.jsx)(s.EY,{ml:"xs",textStyle:"assistive.default",children:(0,n.jsx)(i.A,{id:"bracket_bye_explainer",defaultMessage:"Bye - automatic advancement"})})]})}}}]);