1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9644],{99644:(e,t,l)=>{l.d(t,{default:()=>N});var i=l(21302),n=l(74774),a=l(82104),r=l(16912),o=l.n(r),d=l(12083);let s="var(--bracket-line, #d1d5db)";function u(e){return e?e.replace("https://media.api-sports.io","https://viasport.b-cdn.net"):e}function c(e){let{team:t,score:l,isLoser:n,isWinner:r}=e;return t?(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2.5 h-[24px]",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.jsx)("div",{className:"relative w-[22px] h-[22px] flex-shrink-0",children:t.logo?(0,i.jsx)(a.default,{src:u(t.logo),alt:t.name,fill:!0,sizes:"22px",className:"object-contain",unoptimized:!0}):(0,i.jsx)("div",{className:"w-full h-full rounded-sm bg-[#f3f4f6] dark:bg-[#222222]"})}),(0,i.jsx)("span",{className:"text-[12px] font-semibold tracking-wide truncate ".concat(n?"text-[#9ca3af] dark:text-gray-500 line-through decoration-[1.5px] decoration-[#d1d5db] dark:decoration-[#3a3a3a]":"text-[#0f1419] dark:text-white"),children:t.abbreviation})]}),(0,i.jsx)("span",{className:"text-[12px] font-semibold tabular-nums ".concat(n?"text-[#9ca3af] dark:text-gray-500":"text-[#0f1419] dark:text-white"),children:l})]}):(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2.5 h-[24px]",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.jsx)("div",{className:"w-[22px] h-[22px] rounded-sm bg-[#f3f4f6] dark:bg-[#222222]"}),(0,i.jsx)("span",{className:"text-[12px] font-medium text-[#9ca3af] dark:text-gray-500 tracking-wide",children:"TBD"})]}),(0,i.jsx)("span",{className:"text-[12px] font-semibold tabular-nums text-[#9ca3af] dark:text-gray-500",children:"â"})]})}function m(e){var t,l,n,a,r,d,s,u,m,f,h,v,x;let{tie:g,isFinal:p,finalTeams:b,finalFixture:j,isHighlighted:k}=e,y=k?"border-[#00985f] bg-[#f0fdf4] dark:bg-[#0f2a1d] hover:bg-[#dcfce7] dark:hover:bg-[#143b29]":"border-[#e6e8eb] dark:border-[#2a2a2a] hover:border-[#cdd1d6] dark:hover:border-[#3a3a3a] hover:bg-[#fafbfc] dark:hover:bg-[#1f1f1f]";if(!g&&!p)return(0,i.jsxs)("div",{className:"rounded-md border border-dashed border-[#e6e8eb] dark:border-[#2a2a2a] bg-white dark:bg-[#202020] px-2.5 py-1.5 w-full",children:[(0,i.jsx)(c,{team:null,score:"â",isLoser:!1,isWinner:!1}),(0,i.jsx)(c,{team:null,score:"â",isLoser:!1,isWinner:!1})]});if(p){let e;let t=null!==(h=null==b?void 0:b.teamA)&&void 0!==h?h:null,l=null!==(v=null==b?void 0:b.teamB)&&void 0!==v?v:null,n=["FT","AET","PEN"].includes(null==j?void 0:null===(r=j.fixture)||void 0===r?void 0:null===(a=r.status)||void 0===a?void 0:a.short),g=null==j?void 0:null===(d=j.goals)||void 0===d?void 0:d.home,p=null==j?void 0:null===(s=j.goals)||void 0===s?void 0:s.away,k="â",B="â";n&&null!=g&&null!=p&&(k=String(g),B=String(p)),n&&(g>p?e=null==t?void 0:t.id:p>g&&(e=null==l?void 0:l.id));let N=n?"":(x=null==j?void 0:null===(u=j.fixture)||void 0===u?void 0:u.date)?new Date(x).toLocaleDateString("nb-NO",{month:"short",day:"numeric"}).replace(".",""):"",w=(null==j?void 0:null===(m=j.fixture)||void 0===m?void 0:m.id)?"/fotball/kamp/".concat(j.fixture.id):"#",R=(null==j?void 0:null===(f=j.fixture)||void 0===f?void 0:f.id)?o():"div";return(0,i.jsxs)(R,{href:w,className:"block rounded-md border bg-white dark:bg-[#202020] px-2.5 py-1.5 w-full transition-colors ".concat(y),children:[(0,i.jsx)(c,{team:t,score:k,isLoser:!!e&&e!==(null==t?void 0:t.id),isWinner:e===(null==t?void 0:t.id)}),(0,i.jsx)(c,{team:l,score:B,isLoser:!!e&&e!==(null==l?void 0:l.id),isWinner:e===(null==l?void 0:l.id)}),N&&(0,i.jsx)("div",{className:"text-center text-[11px] font-medium text-[#9ca3af] dark:text-gray-500 mt-1",children:N})]})}let B=g.winnerId,N=!!B&&B===g.teamA.id,w=!!B&&B===g.teamB.id,R=String(g.aggA),A=String(g.aggB);"upcoming"===g.status&&(R="â",A="â");let C=null===(n=g.legs)||void 0===n?void 0:null===(l=n[0])||void 0===l?void 0:null===(t=l.fixture)||void 0===t?void 0:t.id;return(0,i.jsxs)(o(),{href:C?"/fotball/kamp/".concat(C):"#",className:"block rounded-md border bg-white dark:bg-[#202020] px-2.5 py-1.5 w-full transition-colors ".concat(y),children:[(0,i.jsx)(c,{team:g.teamA,score:R,isLoser:!!B&&!N,isWinner:N}),(0,i.jsx)(c,{team:g.teamB,score:A,isLoser:!!B&&!w,isWinner:w}),null!=g.penA&&null!=g.penB&&(0,i.jsxs)("div",{className:"text-center text-[10px] font-medium text-[#9ca3af] dark:text-gray-500 mt-1 tabular-nums",children:["str. ",g.penA,"â",g.penB]})]})}let f="calc(50% - ".concat(1,"px)"),h="calc(50% + ".concat(2,"px)");function v(e){let{side:t,kind:l,width:n=16}=e,a="left"===t?{right:-n}:{left:-n},r="".concat(2,"px solid ").concat(s);
1return"single"===l?(0,i.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute",style:{top:f,width:n,height:2,backgroundColor:s,...a}}):"top"===l?(0,i.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute",style:{top:f,height:h,width:n,borderTop:r,..."left"===t?{right:-n,borderRight:r,borderTopRightRadius:6}:{left:-n,borderLeft:r,borderTopLeftRadius:6}}}):(0,i.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute",style:{bottom:f,height:h,width:n,borderBottom:r,..."left"===t?{right:-n,borderRight:r,borderBottomRightRadius:6}:{left:-n,borderLeft:r,borderBottomLeftRadius:6}}})}function x(e){let{side:t}=e;return(0,i.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute",style:{top:f,width:12,height:2,backgroundColor:s,..."left"===t?{left:-12}:{right:-12}}})}function g(e){let{side:t}=e;return(0,i.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute",style:{top:f,width:12,height:2,backgroundColor:s,..."left"===t?{left:-12}:{right:-12}}})}function p(e){let{column:t,totalRows:l,side:n,hasNextColumn:a,hasPrevColumn:r,nextColumnIsCenter:o=!1,highlightedTieId:d}=e,s=t.length;if(0===s)return null;let u=l/s;return(0,i.jsx)("div",{className:"grid",style:{gridTemplateRows:"repeat(".concat(l,", minmax(0, 1fr))")},children:t.map((e,t)=>{let l=Math.round(t*u)+1,s=Math.round(u),c="pair-top"===e.feedKind?"top":"pair-bottom"===e.feedKind?"bottom":"single";return(0,i.jsxs)("div",{className:"relative flex items-center justify-stretch",style:{gridRow:"".concat(l," / span ").concat(s)},children:[(0,i.jsx)(m,{tie:e.tie,isHighlighted:!!e.tie&&!!d&&e.tie.id===d}),a&&(0,i.jsx)(v,{side:n,kind:c,width:o&&"single"===c?36:16}),r&&(0,i.jsx)(x,{side:n})]},e.key)})})}function b(e){let{won:t}=e,l=t?"#f59e0b":"var(--bracket-trophy-stroke, #cbd5e1)",n=t?"#fef3c7":"var(--bracket-trophy-fill, #f8fafc)";return(0,i.jsxs)("svg",{width:56,height:64,viewBox:"0 0 64 72",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"block","aria-hidden":!0,children:[(0,i.jsx)("path",{d:"M32 4 H50 V20 C50 32 42 40 32 40 C22 40 14 32 14 20 V4 H32Z",fill:n,stroke:l,strokeWidth:2}),(0,i.jsx)("path",{d:"M14 8 H6 C4 8 2 10 2 14 V18 C2 24 6 28 14 28",fill:"none",stroke:l,strokeWidth:2}),(0,i.jsx)("path",{d:"M50 8 H58 C60 8 62 10 62 14 V18 C62 24 58 28 50 28",fill:"none",stroke:l,strokeWidth:2}),(0,i.jsx)("rect",{x:"22",y:"40",width:"20",height:"6",rx:"1",fill:n,stroke:l,strokeWidth:2}),(0,i.jsx)("rect",{x:"16",y:"46",width:"32",height:"8",rx:"2",fill:n,stroke:l,strokeWidth:2}),(0,i.jsx)("rect",{x:"12",y:"56",width:"40",height:"10",rx:"2",fill:n,stroke:l,strokeWidth:2})]})}function j(e){let{tree:t,totalRows:l,isFinalHighlighted:n,hasLeftBracket:a,hasRightBracket:r}=e;return(0,i.jsx)("div",{className:"grid",style:{gridTemplateRows:"repeat(".concat(l,", minmax(0, 1fr))")},children:(0,i.jsxs)("div",{className:"relative flex items-center justify-center",style:{gridRow:"1 / span ".concat(l)},children:[(0,i.jsxs)("div",{className:"relative",style:{width:154},children:[(0,i.jsx)(m,{isFinal:!0,finalTeams:{teamA:t.final.teamA,teamB:t.final.teamB},finalFixture:t.final.fixture,isHighlighted:n}),a&&(0,i.jsx)(g,{side:"left"}),r&&(0,i.jsx)(g,{side:"right"})]}),(0,i.jsx)("div",{className:"absolute inset-x-0 bottom-0 top-1/2 flex flex-col items-center justify-center px-1",children:(0,i.jsx)("div",{className:"rounded-sm bg-[#f59e0b] text-white text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5",children:"Finale"})})]})})}function k(e){let{champion:t,leftColCount:l,rightColCount:n,gridTemplate:r}=e;return(0,i.jsxs)("div",{className:"grid items-start",style:{gridTemplateColumns:r,columnGap:28,marginBottom:8,height:124},children:[Array.from({length:l}).map((e,t)=>(0,i.jsx)("div",{},"l-trophy-".concat(t))),(0,i.jsxs)("div",{className:"flex flex-col items-center justify-start gap-1.5 px-1",children:[(0,i.jsx)(b,{won:!!t}),(0,i.jsx)("div",{className:"text-[10px] font-semibold uppercase tracking-[0.12em] text-[#9ca3af] dark:text-gray-500",children:t?"Mester":"Champion"}),t?(0,i.jsxs)(o(),{href:"/lag/".concat(function(e,t){let l=(e||"").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");return"".concat(l,"-").concat(t)}(t.name,t.id)),className:"flex items-center gap-1.5",children:[(0,i.jsx)("div",{className:"relative w-7 h-7",children:t.logo&&(0,i.jsx)(a.default,{src:u(t.logo),alt:t.name,fill:!0,sizes:"28px",className:"object-contain",unoptimized:!0})}),(0,i.jsx)("span",{className:"text-[12px] font-semibold text-[#0f1419] dar
1k:text-white",children:t.abbreviation})]}):(0,i.jsx)("div",{className:"text-[10px] text-[#9ca3af] dark:text-gray-500 text-center max-w-[90px] leading-snug",children:"Avgj\xf8res i finalen"})]}),Array.from({length:n}).map((e,t)=>(0,i.jsx)("div",{},"r-trophy-".concat(t)))]})}let y={"Round of 32":"16-delsfinale","Round of 16":"\xc5ttedelsfinale","3rd Round":"3. runde","4th Round":"4. runde","5th Round":"5. runde","Quarter-finals":"Kvartfinale","Semi-finals":"Semifinale",Final:"Finale"};function B(e){var t;let{round:l}=e;return(0,i.jsx)("div",{className:"text-center text-[10px] font-semibold uppercase tracking-[0.1em] text-[#6b7280] dark:text-gray-400 py-2",children:null!==(t=y[l])&&void 0!==t?t:l})}function N(e){let{data:t,highlightedTieId:l,highlightFinal:a=!1}=e,r=(0,n.useMemo)(()=>{var e,l,i,n;let a=(0,d.HH)(t),r=Math.max(null!==(i=null===(e=a.left.columns[0])||void 0===e?void 0:e.length)&&void 0!==i?i:0,null!==(n=null===(l=a.right.columns[0])||void 0===l?void 0:l.length)&&void 0!==n?n:0,2),o=a.left.columns.map((e,l)=>{var i;return null!==(i=t.rounds[l])&&void 0!==i?i:""}),s=a.right.columns.map((e,l)=>{var i;return null!==(i=t.rounds[l])&&void 0!==i?i:""}),u=a.left.columns.length,c=a.right.columns.length,m=130*u+194+130*c+28*Math.max(0,u+1+c-1);return{tree:a,totalRows:r,leftLabels:o,rightLabels:s,leftColCount:u,rightColCount:c,naturalWidth:m,naturalHeight:188+88*r+12}}
1,[t]),o=(0,n.useRef)(null),[s,u]=(0,n.useState)(1);if((0,n.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{let t=e.clientWidth;t<=0||u(Math.min(1,t/r.naturalWidth))};t();let l=new ResizeObserver(t);return l.observe(e),()=>l.disconnect()},[r.naturalWidth]),!t.hasBracket)return(0,i.jsx)("div",{className:"rounded-xl border border-[#f3f4f6] dark:border-[#232323] bg-white dark:bg-[#181818] p-8 text-center",children:(0,i.jsx)("p",{className:"text-[14px] text-[#6b7280] dark:text-gray-400",children:"Ingen sluttspill-data tilgjengelig enn\xe5."})});let{tree:c,totalRows:m,leftLabels:f,rightLabels:h,leftColCount:v,rightColCount:x}=r,g=["repeat(".concat(v,", ").concat(130,"px)"),"".concat(194,"px"),"repeat(".concat(x,", ").concat(130,"px)")].join(" "),b=[...h].reverse(),y=[...c.right.columns].reverse(),N=r.naturalHeight*s;return(0,i.jsx)("div",{className:"rounded-xl border border-[#f3f4f6] dark:border-[#232323] bg-white dark:bg-[#181818] p-3 sm:p-5 [--bracket-line:#d1d5db] dark:[--bracket-line:#3a3a3a] [--bracket-trophy-stroke:#cbd5e1] dark:[--bracket-trophy-stroke:#3a3a3a] [--bracket-trophy-fill:#f8fafc] dark:[--bracket-trophy-fill:#202020]",children:(0,i.jsx)("div",{ref:o,className:"w-full",children:(0,i.jsx)("div",{style:{width:"100%",height:N,position:"relative",overflow:"hidden"},children:(0,i.jsxs)("div",{style:{transform:"scale(".concat(s,")"),transformOrigin:"top left",width:r.naturalWidth,position:"absolute",top:0,left:0},children:[(0,i.jsxs)("div",{className:"grid items-end",style:{gridTemplateColumns:g,columnGap:28,marginBottom:12},children:[f.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(B,{round:e})},"l-h-".concat(t))),(0,i.jsx)("div",{children:(0,i.jsx)(B,{round:"Final"})}),b.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(B,{round:e})},"r-h-".concat(t)))]}),(0,i.jsx)(k,{champion:c.champion,leftColCount:v,rightColCount:x,gridTemplate:g}),(0,i.jsxs)("div",{className:"grid items-stretch",style:{gridTemplateColumns:g,columnGap:28,height:88*m},children:[c.left.columns.map((e,t)=>(0,i.jsx)(p,{column:e,totalRows:m,side:"left",hasNextColumn:!0,hasPrevColumn:t>0,nextColumnIsCenter:t===v-1,highlightedTieId:l},"l-c-".concat(t))),(0,i.jsx)(j,{tree:c,totalRows:m,isFinalHighlighted:a,hasLeftBracket:v>0,hasRightBracket:x>0}),y.map((e,t)=>{let n=x-1-t;return(0,i.jsx)(p,{column:e,totalRows:m,side:"right",hasNextColumn:!0,hasPrevColumn:n>0,nextColumnIsCenter:n===x-1,highlightedTieId:l},"r-c-".concat(n))})]})]})})})})}},12083:(e,t,l)=>{l.d(t,{HH:()=>m,Jt:()=>s});let i={"Paris Saint Germain":"PSG","Paris Saint-Germain":"PSG","AS Monaco":"ASM",Monaco:"ASM",Marseille:"OM","Olympique Marseille":"OM",Lyon:"OL",Lille:"LIL",Brest:"BRE",Rennes:"REN",Lens:"RCL","Real Madrid":"RMA","FC Barcelona":"FCB",Barcelona:"FCB","Atletico Madrid":"ATM","Atl\xe9tico Madrid":"ATM",Sevilla:"SEV","Real Betis":"BET","Real Sociedad":"RSO","Athletic Club":"ATH",Villarreal:"VIL",Valencia:"VAL",Inter:"INT",Internazionale:"INT",Juventus:"JUV","AC Milan":"MIL",Milan:"MIL",Napoli:"NAP","AS Roma":"ROM",Roma:"ROM",Lazio:"LAZ",Atalanta:"ATA",Fiorentina:"FIO",Bologna:"BOL","Bayern M\xfcnchen":"FCB","Bayern Munich":"FCB","Borussia Dortmund":"BVB","Bayer Leverkusen":"B04","RB Leipzig":"RBL",Leipzig:"RBL","Eintracht Frankfurt":"SGE","VfB Stuttgart":"VFB",Stuttgart:"VFB","Borussia Monchengladbach":"BMG","Manchester City":"MCI","Manchester United":"MUN",Liverpool:"LIV",Arsenal:"ARS",Chelsea:"CHE",Tottenham:"TOT",Newcastle:"NEW","Aston Villa":"AVL","West Ham":"WHU",Brighton:"BHA",Brentford:"BRE","Crystal Palace":"CRY",Everton:"EVE",Fulham:"FUL",Wolves:"WOL",Leeds:"LEE","Nottingham Forest":"NFO",Bournemouth:"BOU",Sunderland:"SUN",Burnley:"BUR",Benfica:"BEN","Sporting CP":"SCP","Sporting Lisbon":"SCP",Porto:"POR","FC Porto":"POR","PSV Eindhoven":"PSV",Ajax:"AJA",Feyenoord:"FEY",Galatasaray:"GAL",Fenerbahce:"FEN",Celtic:"CEL",Rangers:"RAN","Club Brugge KV":"CLB","Club Brugge":"CLB",Anderlecht:"AND",Olympiacos:"OLY","Olympiakos Piraeus":"OLY",QarabaÄ:"QRB",Qarabag:"QRB","Bodo/Glimt":"BOD","Bod\xf8/Glimt":"BOD",Salzburg:"RBS","Slavia Praha":"SLA","Sparta Praha":"SPA","Shakhtar Donetsk":"SHK","Dynamo Kyiv":"DYK","Red Star Belgrade":"RSB"},n={157:"BAY"};function a(e,t){return null!=t&&n[t]?n[t]:i[e]?i[e]:e.replace(/^(FC|AS|AC|FK|HNK|RB|SK|SC)\s+/i,"").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"???"}let r=["FT","AET","PEN","AWD","WO"],o=["1H","HT","2H","ET","BT","P","LIVE","INT","SUSP"],d=["3rd Round","4th Round","5th Round","Round of 32","Round of 16","Quarter-finals","Semi-finals"];function s(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={},n=[];for(let t of d){let l=function(e,t){var l,i,n,d,s,u,c,m,f,h,v,x;let g=e.filter(e=>{var l;return(null==e?void 0:null===(l=e.league)||void 0===l?void 0:l.round)===t}),p=new Map;
1for(let e of g){let t=null==e?void 0:null===(i=e.teams)||void 0===i?void 0:null===(l=i.home)||void 0===l?void 0:l.id,a=null==e?void 0:null===(d=e.teams)||void 0===d?void 0:null===(n=d.away)||void 0===n?void 0:n.id;if(!t||!a)continue;let r=[t,a].sort((e,t)=>e-t).join("-");p.has(r)||p.set(r,[]),p.get(r).push(e)}let b=[];for(let[e,l]of p){let i,n,d;l.sort((e,t)=>new Date(e.fixture.date).getTime()-new Date(t.fixture.date).getTime());let g=l[0],p=g.teams.home,j=g.teams.away,k=0,y=0,B=!0,N=!1,w=!1;for(let e of l){let t=function(e){var t,l;return r.includes(null==e?void 0:null===(l=e.fixture)||void 0===l?void 0:null===(t=l.status)||void 0===t?void 0:t.short)}(e),l=function(e){var t,l;return o.includes(null==e?void 0:null===(l=e.fixture)||void 0===l?void 0:null===(t=l.status)||void 0===t?void 0:t.short)}(e);t||(B=!1),l&&(N=!0),(t||l)&&(w=!0);let a=Number(null!==(v=null==e?void 0:null===(s=e.goals)||void 0===s?void 0:s.home)&&void 0!==v?v:0)||0,d=Number(null!==(x=null==e?void 0:null===(u=e.goals)||void 0===u?void 0:u.away)&&void 0!==x?x:0)||0;e.teams.home.id===p.id?(k+=a,y+=d):(k+=d,y+=a);let g=null==e?void 0:null===(m=e.score)||void 0===m?void 0:null===(c=m.penalty)||void 0===c?void 0:c.home,b=null==e?void 0:null===(h=e.score)||void 0===h?void 0:null===(f=h.penalty)||void 0===f?void 0:f.away;null!=g&&null!=b&&(e.teams.home.id===p.id?(i=Number(g),n=Number(b)):(i=Number(b),n=Number(g)))}B&&(k>y?d=p.id:y>k?d=j.id:null!=i&&null!=n&&i!==n&&(d=i>n?p.id:j.id));let R="upcoming";N?R="live":B?R="finished":w&&(R="partial"),b.push({id:e,round:t,teamA:{id:p.id,name:p.name,logo:p.logo,abbreviation:a(p.name,p.id)},teamB:{id:j.id,name:j.name,logo:j.logo,abbreviation:a(j.name,j.id)},aggA:k,aggB:y,penA:i,penB:n,status:R,winnerId:d,legs:l,earliestDate:g.fixture.date})}return b.sort((e,t)=>e.earliestDate.localeCompare(t.earliestDate)),b}(e,t);l.length>0&&(i[t]=l,n.push(t))}let s=n.includes("Semi-finals"),u=n.filter(e=>"Semi-finals"!==e);if(u.length>3){let e=u.length-3;for(let t=0;t<e;t++)delete i[u[t]];let t=u.slice(e);n=s?[...t,"Semi-finals"]:t}if(l.focusRound){if("Final"===l.focusRound){let e=n[n.length-1],t=e?[e]:[];for(let e of n)t.includes(e)||delete i[e];n=t}else{let e=n.indexOf(l.focusRound);if(e>0){let t=e-1;for(let e of n.slice(0,t))delete i[e];
1n=n.slice(t)}}}let c=null!==(t=e.filter(e=>{var t;return(null==e?void 0:null===(t=e.league)||void 0===t?void 0:t.round)==="Final"}).sort((e,t)=>new Date(e.fixture.date).getTime()-new Date(t.fixture.date).getTime())[0])&&void 0!==t?t:null,m=n.reduce((e,t)=>{var l,n;return e+(null!==(n=null===(l=i[t])||void 0===l?void 0:l.length)&&void 0!==n?n:0)},0);return{rounds:n,byRound:i,finalFixture:c,hasBracket:m>=2||null!=c}}function u(e,t,l,i){let n="A"===l?e.teamA.id:e.teamB.id;for(let e of t)if(!i.has(e.id)&&e.winnerId===n)return e;for(let e of t)if(!i.has(e.id)&&(e.teamA.id===n||e.teamB.id===n))return e;return null}function c(e,t,l,i){var n,a,r;if(0===t.length)return[];let o=null!==(n=l[t[t.length-1]])&&void 0!==n?n:[],d=null,s=null;e&&((d=u(e,o,"A",i))&&i.add(d.id),(s=u(e,o,"B",i))&&i.add(s.id));let m=t.slice(0,-1),f=d?c(d,m,l,i):[],h=s?c(s,m,l,i):[],v=[];if(d&&s)v=[{tie:d,key:d.id,feedKind:"pair-top"},{tie:s,key:s.id,feedKind:"pair-bottom"}];else if(d||s){let e=null!=d?d:s;v=[{tie:e,key:e.id,feedKind:"single"}]}let x=[];for(let e=0;e<m.length;e++)x.push([...null!==(a=f[e])&&void 0!==a?a:[],...null!==(r=h[e])&&void 0!==r?r:[]]);return[...x,v]}function m(e){var t,l,i,n,o,d,s,u,m,f,h,v,x,g,p;let{rounds:b,byRound:j,finalFixture:k}=e,y=null!==(i=j["Semi-finals"])&&void 0!==i?i:[],B=null,N=null;y.length>=2?[B,N]=y:1===y.length&&(B=y[0]);let w=null,R=null,A=e=>e&&e.winnerId?e.winnerId===e.teamA.id?e.teamA:e.winnerId===e.teamB.id?e.teamB:null:null;if(w=A(B),R=A(N),k){let e=null===(n=k.teams)||void 0===n?void 0:n.home,t=null===(o=k.teams)||void 0===o?void 0:o.away;if(null==e?void 0:e.id){let t={id:e.id,name:e.name,logo:e.logo,abbreviation:a(e.name,e.id)};w&&w.id===e.id?w=t:R&&R.id===e.id?R=t:w?R||(R=t):w=t}if(null==t?void 0:t.id){let e={id:t.id,name:t.name,logo:t.logo,abbreviation:a(t.name,t.id)};w&&w.id===t.id?w=e:R&&R.id===t.id?R=e:R?w||(w=e):R=e}}let C=null;if(k&&r.includes(null===(l=k.fixture)||void 0===l?void 0:null===(t=l.status)||void 0===t?void 0:t.short)){let e=Number(null!==(u=null===(d=k.goals)||void 0===d?void 0:d.home)&&void 0!==u?u:0)||0,t=Number(null!==(m=null===(s=k.goals)||void 0===s?void 0:s.away)&&void 0!==m?m:0)||0;if(e>t)C=w;else if(t>e)C=R;else{let e=null===(h=k.score)||void 0===h?void 0:null===(f=h.penalty)||void 0===f?void 0:f.home,t=null===(x=k.score)||void 0===x?void 0:null===(v=x.penalty)||void 0===v?void 0:v.away;null!=e&&null!=t&&e!==t&&(C=e>t?w:R)}}let S=b.filter(e=>"Semi-finals"!==e),L=new Set,M=c(B,S,j,L),T=c(N,S,j,L);return{left:{columns:[...M,...b.includes("Semi-finals")?[[{tie:B,key:null!==(g=null==B?void 0:B.id)&&void 0!==g?g:"left-sf",feedKind:"single"}]]:[]]},right:{columns:[...T,...b.includes("Semi-finals")?[[{tie:N,key:null!==(p=null==N?void 0:N.id)&&void 0!==p?p:"right-sf",feedKind:"single"}]]:[]]},final:{teamA:w,teamB:R,fixture:k},champion:C}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.