!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]="3028ae9a-032b-41b9-ad5f-928bf53d2094",e._sentryDebugIdIdentifier="sentry-dbid-3028ae9a-032b-41b9-ad5f-928bf53d2094")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9727],{970:(e,t,i)=>{i.d(t,{z:()=>L});var n=i(6029),r=i(21377),a=i(95083),s=i(76356),l=i(6695),o=i(59411),c=i(27956),d=i(14632),u=i(55729),m=i(90248),g=i(947),h=i(41735),p=i(8703),x=i(14395),f=i(19168),v=i(74843),y=i(65789),j=i(73022);let b=Object.assign({},c,d,l,o);function w(e){let{event:t}=e;return t.time&&!f.p2.includes(t.status.code)?(0,n.jsx)(j.lx,{time:t.time,status:t.status,hasMinuteBlinker:!0}):t.status.code===r.sum["Extra time halftime"]?(0,n.jsx)(m.A,{id:"extraTimeHalftime.short"}):t.status.code===r.sum["Awaiting penalties"]?(0,n.jsx)(m.A,{id:"awaitingPenalties.short"}):t.status.code===r.sum.Penalties||t.status.code===r.sum["Penalties alt."]?(0,n.jsx)(m.A,{id:"penalties"}):(0,n.jsx)(n.Fragment,{children:(0,p.Sw)(t)})}function L(e){var t;let{event:i}=e,l=(0,u.useRef)(null),o=(0,u.useRef)(null),{colors:c,typography:d,spacing:m,settings:p}=(0,h.useTheme)(),f=(0,g.A)(),j="rtl"===p.textDirection,L=i.status.type===r.XUj.InProgress;function k(){let e=l.current;if(!e)return;let t=b.select(e),n=e.getBoundingClientRect(),r=v.rj(i);if(r<0)return;let a=v.Ol(i);if(!a)return;let s=b.scaleLinear().domain([0,a]).range([0,n.width]),u=t.selectAll("rect").data([r]);u.enter().append("rect").merge(u).attr("fill",L?c.sofaSingles.live:c.secondary.default).attr("x",0).attr("y",0).transition().duration(200).ease(b.easeCubicInOut).attr("width",e=>s(e)).attr("height",2);let m=v.EX(i,f),g=t.selectAll("circle").data(m);g.exit().remove(),g.enter().append("circle").merge(g).attr("fill",c.surface.s1).attr("r",3).transition().duration(200).ease(b.easeCubicInOut).attr("stroke",e=>s(r)>=s(e.x)?L?c.sofaSingles.live:c.secondary.default:c.neutral.default).attr("stroke-width",2).attr("cx",e=>s(e.x)).attr("cy",1);let h=t.selectAll("text").data(m);if(h.exit().remove(),h.enter().append("text").merge(h).attr("font",d.family.sofascoreSans).attr("font-weight",d.weight.medium).attr("font-size",d.size.small).attr("text-anchor",e=>0===e.x?"start":"middle").transition().duration(200).ease(b.easeCubicInOut).attr("fill",c.neutral.default).attr("x",e=>e.x>0?s(e.x):-4).attr("transform",e=>j?"scale(-1,1) translate(-".concat(2*s(e.x),",0)"):"").attr("y",20).text(e=>e.label),o.current){let e=o.current.getBoundingClientRect().width;b.select(o.current).style("display","inline-block").transition().duration(200).ease(b.easeCubicInOut).style("transform",()=>{let t=s(r);return(t=t{if(i.status.type!==r.XUj.InProgress)return;k();let e=window.setInterval(()=>{k()},1e3);return()=>window.clearInterval(e)},[l.current,i.time,i.startTimestamp,c]),i.tournament.category.sport.slug===r.QCR.Football||(null==(t=i.time)?void 0:t.totalPeriodCount)&&i.time.periodLength)?i.status.type!==r.XUj.InProgress?(0,n.jsx)(x.n,{event:i}):(0,n.jsx)(y.Zp,{isInverseDesktop:!0,children:(0,n.jsxs)(s.az,{pt:"xs",h:"5xl",children:[(0,n.jsx)(a.Ym,{ref:o,textStyle:"assistive.default",color:"status.live",textAlign:"center",children:(0,n.jsx)(w,{event:i})}),(0,n.jsx)("svg",{ref:l,width:"calc(100% - 32px)",height:"2",style:{backgroundColor:c.onSurface.nLv4,display:"block",margin:"auto",marginTop:m.xs,overflow:"visible",transform:j?"scale(-1,1)":void 0}})]})}):null}},59727:(e,t,i)=>{i.r(t),i.d(t,{default:()=>U});var n=i(6029);let r=e=>e.filter(e=>"goal"===e.incidentType||"inGamePenalty"===e.incidentType||"card"===e.incidentType&&("red"===e.incidentClass||"yellowRed"===e.incidentClass)&&e.time&&e.time>-1).map(e=>({incidentType:e.incidentType,incidentClass:e.incidentClass,time:e.time,isHome:e.isHome})).reverse();var a=i(21377),s=i(21501),l=i(41249),o=i(55729),c=i(45860),d=i(65789),u=i(62859),m=i(970),g=i(14395),h=i(99382),p=i(64082),x=i(67930),f=i(99220),v=i(14544),y=i(41735);let j=(e,t)=>{if(e.length<2)return;let i=48;for(;i;){for(let i=0;i1&&(n.x-=1),r.x90.5?120:90,u=(s=[...e],o=n.getBoundingClientRect().width,s&&s.length?(s.forEach(e=>{let t=(e.time>d?d:e.time)/d*o,i=function(e,t,i){if(e<=16)return e;if(t-e<=16)return 16-(t-e);if(90===i){let i=t/2;return e>i&&e<=i+16?e-i:e>=i-16&&e<=i?16-(i-e):8}{if(120!==i)return 8;let n=45/i*t,r=90/i*t,a=105/i*t;if(e>n&&e<=n+16)return e-n;if(e>=n-16&&e<=n)return 16-(n-e)+3;if(e>r&&e<=r+16)return e-r;else if(e>=r-16&&e<=r)return 16-(r-e)+3;else if(e>a&&e<=a+16)return e-a;else if(e>=a-16&&e<=a)return 16-(a-e)+3;else return 8}}(t,o,d);e.x=t-i}),j(s.filter(e=>e.isHome),o),j(s.filter(e=>!e.isHome),o),s):[]);(0,b.A)(l.current).selectAll("*").remove();let m=(0,b.A)("g.incident-group").selectAll("svg").data(u.filter(e=>"goal"===e.incidentType||"inGamePenalty"===e.incidentType),e=>`${e.time}-${e.incidentType}-${e.isHome}`),g=m.enter().append("svg").attr("viewBox","0 0 16 16").attr("x",e=>e.x).attr("width",16).attr("height",16).attr("opacity",0).attr("y",e=>e.isHome?-4:68).style("fill",e=>"ownGoal"===e.incidentClass||"missed"===e.incidentClass?a.colors.error.default:e.isHome?i.primary:i.secondary);m.merge(g),g.append("path").attr("d",e=>"penalty"===e.incidentClass?"M8.07 5.45c2.63 0 4.77 2.14 4.77 4.77 0 2.63-2.14 4.77-4.77 4.77-2.63 0-4.77-2.14-4.77-4.77 0-2.63 2.14-4.77 4.77-4.77zm.19 1.2h-.2c-.92 0-1.75.35-2.39.92l.63.37-.45 1.69-1.37.49v.12c0 .45.08.89.24 1.29l.64-.33 1.06 1.18-.17.94c.54.32 1.16.5 1.82.5 1.98 0 3.59-1.61 3.59-3.59 0-1.04-.44-1.96-1.14-2.62l-.6.55-1.86-.78.2-.73zm1.52 2.78.95 1.73-1.42 1.56-1.41-.55v-2.06l1.88-.68zM15 1v6.75h-1.5V2.5h-11v5.25H1V1h14z":"ownGoal"===e.incidentClass?"M5 1v2.25h8.75V7.1c.77.84 1.25 1.94 1.25 3.17 0 2.61-2.12 4.73-4.73 4.73a4.74 4.74 0 0 1-4.73-4.73c0-2.6 2.13-4.72 4.73-4.72.71 0 1.38.17 1.98.45V4.75H5V7H4L1 4l3-3h1zm5.46 5.73h-.19c-.91 0-1.73.35-2.36.91l.62.37-.45 1.67-1.36.48v.12c0 .45.09.88.24 1.28l.63-.32 1.05 1.17-.17.93c.53.31 1.14.49 1.8.49l.01-.01a3.55 3.55 0 0 0 3.55-3.55c0-1.02-.44-1.94-1.13-2.59l-.59.55-1.84-.78.19-.72zm1.5 2.75.94 1.72-1.4 1.55-1.4-.55v-2.04l1.86-.68z":"missed"===e.incidentClass?"m10.6 7 1.399 1.524-2.522 2.474L12 13.474 10.6 15 8 12.448 5.399 15 4 13.474l2.522-2.476L4 8.524 5.399 7l2.6 2.549L10.6 7zM15 1v6.75h-1.5V2.5h-11v5.25H1V1h14z":"M8 1c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.14-7-7 3.14-7 7-7zm-.01 1.73c-1.35 0-2.57.52-3.5 1.35l.92.55-.66 2.48-2.01.72V8c0 .67.13 1.31.36 1.9l.94-.48 1.55 1.73-.25 1.38c.78.46 1.69.73 2.66.73a5.29 5.29 0 0 0 5.26-5.28c0-1.51-.65-2.87-1.67-3.83l-.88.81-2.72-1.15.29-1.07c-.1-.01-.19-.01-.29-.01zm2.51 4.1 1.39 2.54-2.07 2.29-2.08-.81V7.83l2.76-1z"),g.transition().attr("opacity",1).attr("y",e=>e.isHome?-20:84);let h=(0,b.A)("g.incident-group").selectAll("image").data(u.filter(e=>"goal"!==e.incidentType&&"inGamePenalty"!==e.incidentType),e=>`${e.time}-${e.incidentType}-${e.incidentClass}-${e.isHome}`),p=h.enter().append("image").attr("width",16).attr("height",16).attr("y",e=>e.isHome?-4:68).attr("opacity",0).attr("href",e=>`${r}icon-${e.incidentClass}-card.svg`).attr("x",e=>e.x);h.merge(p),p.transition().attr("opacity",1).attr("y",e=>e.isHome?-20:84)}(s)},100,[e,t,i]),(0,n.jsx)("g",{className:"incident-group",ref:l})}let L=y.default.svg` overflow: visible; height: ${80}px; width: 100%; shape-rendering: crispEdges; user-select: none; -webkit-tap-highlight-color: transparent; .start, .live { shape-rendering: geometricPrecision; } .incident-group svg { shape-rendering: auto; } `,k=[a.XUj.Postponed,a.XUj.Delayed,a.XUj.Canceled,a.XUj.Interrupted,a.XUj.Suspended,a.XUj.WillContinue],C=Object.assign({},f,v,x);function z(e){var t,{colors:i={},hideIncidents:r}=e,c=(0,p.T)(e,["colors","hideIncidents"]);let d=(0,o.useRef)(null),u=(0,s.ZC)(c.isLive),m=(0,y.useTheme)(),g=k.includes(null==(t=c.status)?void 0:t.type),h="rtl"===m.settings.textDirection,x=(0,o.useMemo)(()=>Object.assign({primary:m.colors.secondary.default,secondary:m.colors.primary.default,primaryBackground:m.colors.secondary.highlight,secondaryBackground:m.colors.primary.highlight},i),[...Object.values(i),m]),{primary:f,secondary:v,primaryBackground:j,secondaryBackground:b}=x;return(0,s.st)(function(){var e,t,i,n,r,s,l;let o,u,h,p,x,y;if(!c.liveForm.length)return;let{liveForm:w,isLive:L}=c,k=d.current,z=C.select(k),{duration:A,halftimeDuration:T,endDuration:I}=(o=90,u=90,h=105,p=120,x=45,y=90,(null==(i=w[45])?void 0:i.minute)===45.5&&(o+=1,x+=1,y+=1,u+=1,h+=1,p+=1),(null==(n=w[u])?void 0:n.minute)===90.5&&(o+=1,y+=1,h+=1,p+=1,u+=1),(null==(r=w[h])?void 0:r.minute)===105.5&&(o+=1,p+=1),(null==(s=w[p])?void 0:s.minute)===120.5&&(o+=1),(null==(l=w[u])?void 0:l.minute)===91&&(o+=30),{duration:o,halftimeDuration:x,endDuration:y}),P=null==k?void 0:k.getBoundingClientRect();if(!P)return;let X=P.height,_=P.width/A,H=P.height/2,S=H/3,O=(null!=(e=c.bg)?e:c.backgroundColor)?"rgba(0, 0, 0, 0)":void 0,M=[{height:P.height,y:0,fill:null!=O?O:m.colors.surface.s1},{height:H,y:0,fill:null!=O?O:j},{height:H,y:H,fill:null!=O?O:b}],U=z.select("g.background-group").selectAll("rect").data(M);U.enter().append("rect").attr("width",L?0:w.length*_).merge(U).attr("x",0).attr("y",e=>e.y).attr("height",e=>e.height).attr("fill",e=>e.fill).transition().attr("width",w.length*_).duration(300*(L?2:1)).ease(C.easeLinear);let E=z.select("g.bars-group").selectAll("rect").data(w),N=e=>Math.min(Math.abs(e.value)/100,1)*H,D=e=>Math.min(H-Math.sign(e.value)*N(e),H);E.exit().transition().attr("height",0).attr("y",H).duration(300).remove();let $=E.enter().append("rect").attr("x",(e,t)=>_*t+1).attr("y",e=>L?H:e.value>=0?2*S:H).attr("height",()=>L?0:S).attr("width",_-1).attr("fill",e=>e.value>=0?f:v).attr("stroke-width",1).transition().attr("y",e=>D(e)).attr("height",e=>N(e));L?$.delay((e,t)=>t*(600/w.length)):$.duration(300),$=E.transition().attr("x",(e,t)=>_*t+1).attr("y",e=>D(e)).attr("height",e=>N(e)).attr("width",_-1).attr("fill",e=>e.value>=0?f:v),L&&$.delay((e,t)=>t*(600/w.length)),$.duration(300).ease(C.easeLinear);let F=[{x1:w.length*_+.5,y1:0,x2:w.length*_+.5,y2:X,isLiveLine:L},{x1:_*T,y1:0,x2:_*T,y2:X}];if(A>100){let e=_*I;F.push({x1:e,y1:0,x2:e,y2:X}),e=_*(I+(A-I)/2),F.push({x1:e,y1:0,x2:e,y2:X})}c.hideLastLine&&F.shift();let R=z.select("g.lines-group").selectAll("line").data(F);R.exit().remove(),R.enter().append("line").attr("x1",e=>e.isLiveLine?0:e.x1).attr("y1",e=>e.y1).attr("x2",e=>e.isLiveLine?0:e.x2).attr("y2",e=>e.y2).attr("stroke-width",1).merge(R).transition().attr("x1",e=>e.x1).attr("x2",e=>e.x2).attr("stroke",e=>e.isLiveLine||!1===e.isLiveLine&&g?c.isLive||!1===e.isLiveLine&&g?m.colors.sofaSingles.live:"transparent":e.x1===e.x2?m.colors.surface.s1:m.colors.onSurface.nLv5).duration(300*(L?2:1)).ease(C.easeLinear);let V=z.select("g.lines-group").selectAll("circle.live").data(F.slice(0,1)),B=z.select("g.lines-group").selectAll("circle.start").data([{}]);L||g?(V.enter().append("circle").attr("cy",0).attr("r",0).attr("cx",e=>e.x1).attr("stroke",m.colors.sofaSingles.live).attr("stroke-width",2).attr("fill",m.colors.surface.s1).attr("class","live").transition().delay(1e3).duration(100).attr("r",3),V.merge(V).attr("r",3*((null==(t=c.status)?void 0:t.code)!==a.sum.Halftime)).transition().duration(300*(L?2:1)).ease(C.easeLinear).attr("cx",e=>e.x1),B.enter().append("circle").attr("cy",78).attr("r",3).attr("cx",0).attr("stroke",m.colors.secondary.default).attr("stroke-width",2).attr("fill",m.colors.surface.s1).attr("class","start")):V.remove()},100,[c.liveForm,c.incidents,c.isLive,u,c.status,m.colors,c.bg,c.backgroundColor]),(0,n.jsx)(l.az,Object.assign({grow:1,bg:"onSurface.nLv5",h:80},c,{children:(0,n.jsxs)(L,Object.assign({ref:d,transform:h?"scale(-1,1)":void 0},{children:[(0,n.jsx)("g",{className:"background-group"}),(0,n.jsx)("g",{className:"bars-group"}),(0,n.jsx)("g",{className:"lines-group"}),!r&&(0,n.jsx)(w,{liveForm:c.liveForm,incidents:c.incidents,colors:x,incidentIconPath:c.incidentIconPath})]}))}))}var A=i(91603),T=i(73022),I=i(33144),P=i(90248),X=i(54053);function _(e){let{isOpen:t,setIsOpen:i,leftTeamId:r,leftTeamName:a,rightTeamId:s,rightTeamName:o}=e;return(0,n.jsxs)(X.A,{isOpen:t,setIsOpen:i,header:"attack_momentum",children:[(0,n.jsx)(l.az,{px:"lg",maxW:[void 0,320],children:(0,n.jsx)(l.EY,{align:"left",font:"body.mediumParagraph",color:"onSurface.nLv1",mb:"sm",as:"div",children:(0,n.jsx)(P.A,{id:"attack_momentum_description"})})}),(0,n.jsxs)(l.az,{px:"lg",maxW:[void 0,320],children:[(0,n.jsx)(l.EY,{color:"secondary.default",as:"div",font:"assistive.default",py:"xs",children:(0,n.jsx)(P.A,{id:"attack_momentum_first",values:{teamName:a}})}),(0,n.jsxs)(l.so,{align:"center",children:[(0,n.jsxs)(l.so,{pr:"md",direction:"column",gap:"lg",children:[(0,n.jsx)(I.p,{size:24,id:r}),(0,n.jsx)(I.p,{size:24,id:s})]}),(0,n.jsx)(l._V,{width:"127",height:"140",srcSet:"/static/images/exportable-bitmap-info@2x.png 2x, /static/images/exportable-bitmap-info@3x.png 3x",src:"/static/images/exportable-bitmap-info.png",alt:"Attack Momentum Legend"})]}),(0,n.jsx)(l.EY,{color:"primary.default",as:"div",font:"assistive.default",py:"xs",children:(0,n.jsx)(P.A,{id:"attack_momentum_away",values:{teamName:o}})})]})]})}let H=e=>{let{liveForm:t,isLive:i,time:r,leftTeamId:a,leftTeamName:s,rightTeamId:c,rightTeamName:d,incidents:u,status:m}=e,[g,h]=(0,o.useState)(!1);return(0,n.jsxs)(l.az,{position:"relative",px:"sm",children:[(0,n.jsxs)(l.so,{direction:"row",align:"flex-end",overflow:"hidden",children:[(0,n.jsxs)(l.so,{direction:"column",justify:"space-around",h:"108px",pb:"28px",mr:"xxs",children:[(0,n.jsx)(A.p,{id:a,size:16,name:s}),(0,n.jsx)(A.p,{id:c,size:16,name:d})]}),(0,n.jsxs)(l.so,{direction:"column",grow:1,children:[i&&(0,n.jsx)(l.EY,{font:"display.medium",color:"sofaSingles.live",py:"6px",letterSpacing:"-0.2px",align:"center",block:!0,children:(0,n.jsx)(T.lx,{time:r,status:m})}),(0,n.jsx)(l.az,{py:"28px",children:(0,n.jsx)(z,{isLive:i,liveForm:t,incidents:u,status:m,cursor:"pointer",onClick:()=>{h(!0)}})})]})]}),(0,n.jsx)(_,{isOpen:g,setIsOpen:h,leftTeamId:a,leftTeamName:s,rightTeamId:c,rightTeamName:d})]})};var S=i(83736),O=i(71046),M=i(73324);let U=e=>{let{...t}=e,{event:i,leftTeam:p,rightTeam:x}=(0,o.useContext)(u.y$),{status:f,detailId:v,time:y}=i,j=(0,s.hX)(),b=f.type===a.XUj.NotStarted,w=f.type===a.XUj.Finished||i.isAwarded,L=f.type===a.XUj.InProgress,k=[a.XUj.Postponed,a.XUj.Canceled].includes(f.type),{graphPoints:C,error:z}=(0,M._)(i),{data:A}=(0,c.Ay)(a.bnp.incidents(i.id),(0,O.rf)(i)),T=(0,o.useMemo)(()=>(null==A?void 0:A.incidents)?r(A.incidents):void 0,[null==A?void 0:A.incidents]),I=(0,n.jsx)(h.jP,{event:i});return j?(0,n.jsx)(S.u,{}):z?L?(0,n.jsx)(m.z,{event:i,...t}):w?(0,n.jsx)(g.n,{event:i}):k?null:(0,n.jsx)(n.Fragment,{children:1===v&&I}):C?b?null:(0,n.jsxs)(l.az,{children:[(0,n.jsx)(d.Zp,{isInverseDesktop:!0,children:(0,n.jsx)(H,{leftTeamId:p.id,leftTeamName:p.name,rightTeamId:x.id,rightTeamName:x.name,isLive:L,time:y,liveForm:C||[],incidents:T,status:i.status})}),(0,n.jsx)(l.az,{mt:"sm",children:1===v&&I})]}):(0,n.jsx)(S.u,{})}},73324:(e,t,i)=>{i.d(t,{_:()=>l});var n=i(21377),r=i(45860),a=i(65078),s=i(71046);function l(e,t){let i=t?n.bnp.graphDataWinProbability(e.id):n.bnp.graphData(e.id),l=(0,s.rf)(e),o=(0,a.g3)(),{data:c,error:d}=(0,r.Ay)(i,l);return{graphPoints:o?null==c?void 0:c.graphPoints.map(e=>({...e,value:-1*e.value})):null==c?void 0:c.graphPoints,error:d,periodCount:null==c?void 0:c.periodCount,periodTime:null==c?void 0:c.periodTime}}}}]);