1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MatchFactsView-CnWrtRiB.js","assets/vendor-react-DbsVTsKS.js","assets/index-Dirtnqiz.js","assets/vendor-i18n-DiTKF2NC.js","assets/vendor-ui-B_XW8Pya.js","assets/vendor-charts-CG7l663-.js","assets/vendor-otel-B3hnpEUX.js","assets/app-constants-D3ojol5R.js","assets/vendor-virtuoso-CT6D0QVj.js","assets/vendor-markdown-CiT-VfZw.js","assets/index-DcmdFSLe.css"])))=>i.map(i=>d[i]); 2import{r as e,c as t,j as a,R as s,k as l}from"./vendor-react-DbsVTsKS.js";import{d as r,M as n,e as i,f as m,h as o,j as d,k as c,l as x,m as h,n as g,o as y,P as u,p as b,q as p,r as v,t as f,H as w,v as j,S as N,w as _,L as S,x as A,y as C,z as k,A as P,B as T,C as D,D as K,E as M,F}from"./index-Dirtnqiz.js";import{a6 as $,a8 as B,bh as G,bi as E,af as H,ag as I,aN as V,aO as O,aM as L,aP as z,aQ as W,bj as U,bk as R,bl as X,bm as q,bn as Q,bo as Y,bp as J,bq as Z,br as ee,bs as te,ae,aL as se,bt as le}from"./app-constants-D3ojol5R.js";import re from"./PredictionsDetailPopup-tofHisk3.js";import{u as ne,_ as ie}from"./vendor-i18n-DiTKF2NC.js";import{I as me,w as oe,x as de,y as ce,z as xe}from"./vendor-ui-B_XW8Pya.js";import he from"./MatchPodcastPlayer-BSeYEMmg.js";import{M as ge,r as ye}from"./vendor-markdown-CiT-VfZw.js";import ue from"./MatchEventsView-CUUchwEP.js";import{S as be}from"./SokaChatView-DpGkErno.js";import"./vendor-charts-CG7l663-.js";import"./vendor-otel-B3hnpEUX.js";import"./vendor-virtuoso-CT6D0QVj.js";import"./SokapalAIChatCard-CEttPGxv.js";const pe=()=>{const{t:s}=ne(),{isDarkMode:l}=r(),{matchDetailsData:f}=e.useContext(n),{matchExtraStatsData:w}=e.useContext(i),{matchPlayersData:j}=e.useContext(m),N=t(),{shouldLockMatchCards:_}=o(),[S,A]=e.useState(!1),[C,k]=e.useState(""),[P,T]=e.useState(""),[D,K]=e.useState(""),M=null==f?void 0:f.match,F=null==f?void 0:f.league,V=(null==f?void 0:f.isPremiumUnlocked)??!1,O=_&&!V&&"complete"!==(null==M?void 0:M.status),L=e.useMemo(()=>{if(!M)return M;const e=Array.isArray(M.events)&&M.events.length>0?M.events:(null==w?void 0:w.events)||[];return{...M,events:e}},[M,w]),{homeGoals:z,awayGoals:W,homeShootoutScore:U,awayShootoutScore:R,hasPenaltyShootout:X}=e.useMemo(()=>d(L),[L]),{home:q,away:Q}=e.useMemo(()=>{const e=c(L);if(e.home.length>0||e.away.length>0)return e;const t=(e,t)=>Array.isArray(e)&&0!==e.length&&j?e.map(e=>({playerName:E(j,e.player_id,t)||"",minuteLabel:void 0!==e.time&&null!==e.time?`${e.time}'`:"",isOwnGoal:"(OG)"===e.extra,isPenalty:"(PG)"===e.extra,_time:parseInt(e.time,10)||0})).sort((e,t)=>e._time-t._time):[];return{home:t(null==w?void 0:w.team_a_goal_details,"home"),away:t(null==w?void 0:w.team_b_goal_details,"away")}},[L,w,j]),Y=("complete"===(null==M?void 0:M.status)||"complete"===C)&&(q.length>0||Q.length>0),J=(e,t="left")=>e.length?a.jsx("div",{className:`flex flex-col gap-0.5 text-[10px] leading-tight ${"right"===t?"items-end text-right":"items-start text-left"} ${l?"text-gray-400":"text-gray-500"}`,children:e.map((e,t)=>{var l;const r=null==(l=e.playerName)?void 0:l.trim(),n=r?r.split(/\s+/).pop():null;return a.jsxs("span",{className:"truncate max-w-[80px] sm:max-w-[100px]",children:[n||a.jsx("span",{title:s("matchCard.goalScorer.unknown","Goal scorer"),children:"â½"}),e.isOwnGoal?" (OG)":"",e.isPenalty?" (P)":""," ",e.minuteLabel]},`${e.playerName}-${e.minuteLabel}-${t}`)})}):null,Z=e.useCallback(()=>{if(!(null==M?void 0:M.date_unix))return!1;const e=Math.floor(Date.now()/1e3),t=M.date_unix;return e>=t&&e<=t+6900&&"complete"!==M.status},[null==M?void 0:M.date_unix,null==M?void 0:M.status]),ee=e.useCallback(()=>x(M,Z()),[M,Z]),te=e.useCallback(()=>{const e=$(M,s);if("live"===e.status){const t=ee();if(t)return{...e,text:`${e.text} ${t}`}}return e},[M,s,ee]);if(e.useEffect(()=>{if(!M)return;const e=()=>{const e=te();K(e.text),T(e.className),k(e.status)};e();const t=setInterval(()=>{e()},6e4);return()=>clearInterval(t)},[null==M?void 0:M.date_unix,null==M?void 0:M.status,te,M]),!f)return null;if(!M)return null;if(!F)return null;const ae=(e,t)=>{e.stopPropagation();const a=t?M.homeID:M.awayID,s=t?M.home_name:M.away_name,l=t?M.home_image:M.away_image;if(!a)return;const r=H({id:a,name:s,cleanName:s,image:l,stats:{matchesPlayed:0,seasonWins_overall:0,seasonPPG_overall:0},recent:[]},{id:null==F?void 0:F.id,leagueName:(null==F?void 0:F.leagueName)||(null==F?void 0:F.name),country:null==F?void 0:F.country,season:null==F?void 0:F.season});I(N,a,r)},se={text:D||te().text,className:P||te().className};return a.jsxs("div",{className:"mb-1 sm:mb-2 overflow-hidden rounded-lg relative shadow-sm "+(l?"bg-gray-800":"bg-gray-50"),children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b opacity-30 "+(l?"from-green-900 via-green-950 to-transparent":"from-green-100 via-green-50 to-transparent")}),a.jsxs("div",{className:"p-1 sm:p-2 md:p-3 text-center relative z-10",children:[a.jsx("div",{className:"mb-0.5 text-xs sm:text-sm font-medium "+(l?"text-gray-200":"text-gray-700"),children:F.leagueName}),a.jsx("div",{className:"mb-0.5 text-xs "+(l?"text-gray-400":"text-gray-600"),children:M.stadium_name}),a.jsx("div",{className:"mb-1 sm:mb-2 text-xs "+(l?"text-gray-400":"text-gray-600"),children:B(M.date_unix)}),a.jsx("div",{className:"flex justify-center items-center gap-2 flex-wrap mb-1 sm:mb-2",children:a.jsx("span",{className:`text-xs px-2 sm:px-3 py-0.5
2sm:py-1 rounded-sm font-medium whitespace-nowrap ${se.className}`,children:se.text})}),((null==M?void 0:M.isBankerTip)||(null==M?void 0:M.isTopTip))&&a.jsx("div",{className:"absolute top-2 right-2 z-20",children:(null==M?void 0:M.isBankerTip)?a.jsxs("span",{title:s("matchCard.bankerBadge.tooltip","Banker Tip â strong multi-signal confidence"),className:"text-xs px-1.5 py-0.5 rounded-sm font-bold bg-amber-500 text-white flex flex-col items-center leading-tight select-none",children:[a.jsx("span",{children:"ð¥"}),a.jsx("span",{children:s("matchCard.bankerBadge.label","Banker")})]}):a.jsxs("span",{title:s("matchCard.topTipBadge.tooltip","Top Tip â high confidence prediction"),className:"text-xs px-1.5 py-0.5 rounded-sm font-bold bg-sky-500 text-white flex flex-col items-center leading-tight select-none",children:[a.jsx("span",{children:"â"}),a.jsx("span",{children:s("matchCard.topTipBadge.label","Top Tip")})]})}),a.jsxs("div",{className:"flex items-center justify-between mb-1 sm:mb-2 md:mb-3",children:[a.jsxs("div",{className:"flex flex-col items-center text-center cursor-pointer rounded-lg p-1 transition-colors flex-shrink-0 "+(l?"hover:bg-gray-700":"hover:bg-gray-100"),onClick:e=>ae(e,!0),children:[a.jsx("img",{src:G(M.home_image),alt:`${M.home_name} logo`,className:"w-8 h-8 sm:w-12 sm:h-12 md:w-16 md:h-16 mb-0.5 sm:mb-1 object-contain",loading:"lazy",decoding:"async",onError:e=>e.target.src="/placeholder-team.png"}),a.jsx("span",{className:"text-xs sm:text-sm font-semibold w-full max-w-[80px] sm:max-w-[110px] md:max-w-[130px] px-1 leading-tight break-words transition-colors "+(l?"text-gray-100 hover:text-blue-400":"text-gray-800 hover:text-blue-600"),children:M.home_name})]}),Y&&a.jsx("div",{className:"flex-1 min-w-0 flex justify-end pr-1.5 sm:pr-2",children:J(q,"right")}),a.jsxs("div",{className:"flex items-center justify-center flex-shrink-0",children:[a.jsxs("div",{className:`h-6 sm:h-8 md:h-10 ${X?"min-w-[1.5rem] sm:min-w-[2rem] md:min-w-[2.5rem] px-1":"w-6 sm:w-8 md:w-10"} rounded-md flex items-center justify-center mr-0.5 sm:mr-1 font-bold text-sm sm:text-base shadow-sm ${l?"bg-gray-700 text-gray-100":"bg-white text-gray-800"}`,children:[a.jsx("span",{children:"complete"===M.status||"complete"===C||"live"===C?z:"-"}),X&&a.jsxs("span",{className:"ml-0.5 text-[9px] sm:text-[10px] font-semibold "+(U>R?l?"text-amber-400":"text-amber-600":l?"text-gray-400":"text-gray-500"),title:s("matchCard.penaltyShootoutScore","Penalty shootout score"),children:["(",U,")"]})]}),a.jsxs("div",{className:`h-6 sm:h-8 md:h-10 ${X?"min-w-[1.5rem] sm:min-w-[2rem] md:min-w-[2.5rem] px-1":"w-6 sm:w-8 md:w-10"} rounded-md flex items-center justify-center font-bold text-sm sm:text-base shadow-sm ${l?"bg-gray-700 text-gray-100":"bg-white text-gray-800"}`,children:[a.jsx("span",{children:"complete"===M.status||"complete"===C||"live"===C?W:"-"}),X&&a.jsxs("span",{className:"ml-0.5 text-[9px] sm:text-[10px] font-semibold "+(R>U?l?"text-amber-400":"text-amber-600":l?"text-gray-400":"text-gray-500"),title:s("matchCard.penaltyShootoutScore","Penalty shootout score"),children:["(",R,")"]})]})]}),Y&&a.jsx("div",{className:"flex-1 min-w-0 flex justify-start pl-1.5 sm:pl-2",children:J(Q,"left")}),a.jsxs("div",{className:"flex flex-col items-center text-center cursor-pointer rounded-lg p-1 transition-colors flex-shrink-0 "+(l?"hover:bg-gray-700":"hover:bg-gray-100"),onClick:e=>ae(e,!1),children:[a.jsx("img",{src:G(M.away_image),alt:`${M.away_name} logo`,className:"w-8 h-8 sm:w-12 sm:h-12 md:w-16 md:h-16 mb-0.5 sm:mb-1 object-contain",loading:"lazy",decoding:"async",onError:e=>e.target.src="/placeholder-team.png"}),a.jsx("span",{className:"text-xs sm:text-sm font-semibold w-full max-w-[80px] sm:max-w-[110px] md:max-w-[130px] px-1 leading-tight break-words transition-colors "+(l?"text-gray-100 hover:text-blue-400":"text-gray-800 hover:text-blue-600"),children:M.away_name})]})]}),a.jsxs("div",{className:"flex justify-around items-center text-xs font-medium mt-0.5 sm:mt-1 mb-0.5 px-2 sm:px-4 "+(l?"text-gray-400":"text-gray-600"),children:[a.jsx("span",{children:"1"}),a.jsx("span",{children:"X"}),a.jsx("span",{children:"2"})]}),a.jsxs("div",{className:"flex justify-around items-center text-xs sm:text-sm font-semibold mb-1 sm:mb-2 md:mb-3 px-2 sm:px-4 "+(l?"text-gray-100":"text-gray-800"),children:[a.jsx("span",{className:"px-1 sm:px-2 md:px-3 py-0.5 rounded shadow-sm border min-w-[24px] sm:min-w-[32px] md:min-w-[40px] text-center transition-all "+(!O&&h(M,"1")?"bg-yellow-300 dark:bg-yellow-600/50 border-yellow-400 dark:border-yellow-500 font-bold ring-1 ring-yellow-400 dark:ring-yellow-500":l?"bg-gray-700 border-gray-600":"bg-white border-gray-200"),children:null!==M.odds_ft_1?M.odds_ft_1.toFixed(2):"-"}),a.jsx("span",{className:"px-1 sm:px-2 md:px-3 py-0.5 rounded shadow-sm border min-w-[24px] sm:min-w-[32px] md:min-w-[40px] text-center transition-all "+(!O&&h(M,"X")?"bg-yellow-300 dark:bg-yellow-600/50 border-yellow-400 dark:border-yellow-500 font-bold ring-1 ring-yellow-400 dark:ring-yellow-500":l?"bg-gray-700 border-gray-600":"bg-white border-gray-200"),children:null!==M.odds_ft_x?M.odds_ft_x.toFixed(2):"-"}),a.jsx("span",{className:"px-1 sm:px-2 md:px-3 py-0.5 rounded shadow-sm border min-w-[24px] sm:min-w-[32px] md:min-w-[40px] text-center transition-all "+(!O&&h(M,"2")?"bg-yellow-300 dark:bg-yellow-600/50 border-yellow-400 dark:border-yellow-500 font-bold ring-1 ring-yellow-400 dark:ring-yellow-500":l?"bg-gray-700 border-gray-600":"bg-white border-gray-200"),children:null!==M.odds_ft_2?M.odds_ft_2.toFixed(2):"-"})]}),(()=>{var e,t;if(!g(M))return null;const s=y(M);if(!s.length)return null;if(_&&!V&&"complete"!==(null==M?void 0:M.status))return a.jsx(u,{variant:"predictions"});
2const r=b(M),n=!!r&&"complete"!==M.status&&!(null==(e=M.prediction)?void 0:e.predictionOutcomeUpdated);return a.jsxs("div",{className:"mt-1.5 pt-1.5 border-t flex flex-wrap justify-center gap-1 "+(l?"border-gray-700":"border-gray-300"),children:[s.map(({label:e,value:t,obj:s})=>{const i=r&&e===r,m=i&&n;return a.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium leading-tight border flex items-center gap-0.5 ${m?l?"border-sky-400 text-sky-300 bg-sky-900/40 ring-1 ring-sky-400":"border-sky-500 text-sky-700 bg-sky-50 ring-1 ring-sky-400":p(s,l)}`,title:`${e} prediction: ${t}${i?" â Top Tip":""}${(null==s?void 0:s.outcomeVerifiedAt)?s.isAccurate?" (Correct)":" (Incorrect)":""}`,children:[i&&a.jsx("span",{className:"mr-0.5",children:"â"}),a.jsxs("span",{className:"opacity-70",children:[e,":"]})," ",a.jsx("span",{children:t})]},e)}),a.jsx("button",{onClick:e=>{e.stopPropagation(),A(!0)},className:"ml-auto flex items-center justify-center rounded-full p-0.5 transition-colors animate-pulse "+(l?"text-blue-400 hover:text-blue-300":"text-blue-500 hover:text-blue-700"),title:"More prediction details",children:a.jsx(me,{size:16,strokeWidth:2})}),S&&a.jsx(re,{items:s,bestTip:v(M),tips:null==M?void 0:M.tips,isBankerTip:null==M?void 0:M.isBankerTip,bankerSignalCount:null==(t=null==M?void 0:M.tips)?void 0:t.bankerSignalCount,topTipLabel:r,highlightTopTip:n,match:M,onClose:()=>A(!1)})]})})()]})]})},ve=e=>e&&e.split(" ").filter(e=>e&&e.length>0).map(e=>e[0].toUpperCase()).join("").slice(0,2)||"?",fe=e=>{const t=["bg-red-300","bg-green-300","bg-blue-300","bg-yellow-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"];return t[e%t.length]},we=({name:t,number:s,position:l,photoUrl:r,goals:n=0,country:i="",rating:m=0,isDarkMode:o,onClick:d})=>{const[c,x]=e.useState(!1);return a.jsxs("div",{onClick:d,className:`flex items-center justify-between text-sm mb-1.5 py-1 px-1 rounded-md transition-colors ${d?"cursor-pointer":""} ${o?"hover:bg-gray-700":"hover:bg-gray-50"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-1",children:[r&&!c?a.jsx("img",{src:r,alt:t,className:"w-8 h-8 sm:w-10 sm:h-10 rounded-full object-cover border flex-shrink-0",onError:()=>x(!0)}):a.jsx("div",{className:`w-8 h-8 sm:w-10 sm:h-10 rounded-full ${fe(t.length)} text-gray-800 flex items-center justify-center text-xs sm:text-sm font-medium border flex-shrink-0`,children:ve(t)}),a.jsx("span",{className:"font-normal text-xs sm:text-sm truncate max-w-[120px] sm:max-w-[150px] md:max-w-[180px] "+(o?"text-gray-200":""),children:t})]}),a.jsxs("div",{className:"flex items-center space-x-2 ml-1 flex-shrink-0 whitespace-nowrap",children:[a.jsxs("span",{className:"text-xs text-right flex-shrink-0 "+(o?"text-gray-400":"text-gray-500"),children:["#",s]}),a.jsxs("span",{className:"text-xs text-center flex-shrink-0 "+(o?"text-gray-300":"text-gray-700"),children:["â½ ",n]})]})]})},je=({title:e,players:t,isPredicted:s=!1,isDarkMode:l,onPlayerClick:r})=>{const{t:n}=ne(),i=s&&"Starting XI"===e?n("lineup.predictedStartingXI","Predicted Starting XI"):"Starting XI"===e?n("lineup.startingXI","Starting XI"):"Substitutes"===e?n("lineup.substitutes","Substitutes"):e,m=t.reduce((e,t)=>{let a="Others";return"GK"===t.position?a="Goalkeeper":["CB","RB","LB","D"].includes(t.position)?a="Defenders":["CDM","CM","CAM","M"].includes(t.position)?a="Midfielders":["RW","LW","ST","F"].includes(t.position)&&(a="Forwards"),e[a]||(e[a]=[]),e[a].push(t),e},{}),o=["Goalkeeper","Defenders","Midfielders","Forwards","Others"],d={Goalkeeper:n("lineup.goalkeeper"),Defenders:n("lineup.defenders"),Midfielders:n("lineup.midfielders"),Forwards:n("lineup.forwards"),Others:n("lineup.others")},c=Object.keys(m).sort((e,t)=>o.indexOf(e)-o.indexOf(t));return a.jsxs("div",{className:"mb-3",children:[a.jsx("h3",{className:"text-sm font-semibold mb-1.5 "+(l?"text-gray-300":"text-gray-600"),children:i}),a.jsx("div",{className:"space-y-2",children:c.map((e,t)=>a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] uppercase font-semibold mb-0.5 "+(l?"text-gray-400":"text-gray-500"),children:d[e]||e}),a.jsx("hr",{className:"border-t my-1 "+(l?"border-gray-600":"border-gray-200")}),m[e].map((e,t)=>a.jsx(we,{name:e.name,number:e.number,position:e.position,photoUrl:e.photoUrl,goals:e.goals,country:e.country,rating:e.rating,isDarkMode:l,onClick:r&&e.id?()=>r(e):void 0},t))]},e))})]})},Ne=({teamName:e,teamLogo:t,starters:s,substitutes:l,alignRight:r=!1,isPredicted:n=!1,isDarkMode:i,onPlayerClick:m})=>a.jsx("div",{className:"w-full md:w-1/2 xl:w-5/12 px-1",children:a.jsxs("div",{className:"shadow rounded-lg p-2 sm:p-3 "+(i?"bg-gray-800":"bg-gray-100"),children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2 sm:mb-3 "+(r?"justify-end":""),children:[!r&&t&&a.jsx("img",{src:t,alt:e,className:"w-5 h-5 sm:w-6 sm:h-6 object-contain",loading:"lazy",decoding:"async",onError:e=>e.target.src="/placeholder-team.png"}),a.jsx("span",{className:"text-sm sm:text-base font-medium truncate max-w-[120px] sm:max-w-[150px] "+(i?"text-gray-200":""),children:e}),r&&t&&a.jsx("img",{src:t,alt:e,className:"w-5 h-5 sm:w-6 sm:h-6 object-contain ml-1",loading:"lazy",decoding:"async",onError:e=>e.target.src="/placeholder-team.png"})]}),a.jsx(je,{title:"Starting XI",players:s,isPredicted:n,isDarkMode:i,onPlayerClick:m}),a.jsx(je,{title:"Substitutes",players:l,isDarkMode:i,onPlayerClick:m})]})}),_e=()=>{var s,l,o,d,c,x,h,g,y,u;const{matchExtraStatsData:b}=e.useContext(i),{matchDetailsData:p}=e.useContext(n),{matchPlayersData:v}=e.useContext(m),{isDarkMode:f}=r(),w=t();if(!b||!p||!v)return null;const j=(null==(s=p.match)?void 0:s.home_name)||"Home Team",N=(null==(l=p.match)?void 0:l.away_name)||"Away Team",_=(null==(o=p.match)?void 0:o.home_image)?G(null==(d=p.match)?void 0:d.home_image):null,S=(null==(c=p.match)?void 0:c.away_image)?G(null==(x=p.match)?void 0:x.away_image):null,A=(null==(g=null==(h=b.lineups)?void 0:h.team_a)?void 0:g.length)>0||(null==(u=null==(y=b.lineups)?void 0:y.team_b)?void 0:u.length)>0,C=A?b.lineups:b.predictedLineups,k=!A,P=((null==C?void 0:C.team_a)||[]).map(e=>{var t;
2const a=null==(t=v.homePlayers)?void 0:t.get(e.player_id),s=(null==a?void 0:a.goals_overall)||0;return{id:null==a?void 0:a.id,name:L((null==a?void 0:a.known_as)||`${null==a?void 0:a.first_name} ${null==a?void 0:a.last_name}`||`PID: ${null==a?void 0:a.id}`),number:e.shirt_number,position:O((null==a?void 0:a.position)||"NA"),url:null==a?void 0:a.url,photoUrl:(null==a?void 0:a.url)?V(a.url):null,goals:s,country:(null==a?void 0:a.country_code)||"",rating:(null==a?void 0:a.rating)||0}}).filter(e=>"undefined undefined"!==e.name),T=((null==C?void 0:C.team_b)||[]).map(e=>{var t,a;const s=null==(t=v.awayPlayers)?void 0:t.get(e.player_id),l=(null==(a=e.player_events)?void 0:a.filter(e=>"Goal"===e.event_type).length)||0;return{id:null==s?void 0:s.id,name:L((null==s?void 0:s.known_as)||`${null==s?void 0:s.first_name} ${null==s?void 0:s.last_name}`||`PID: ${null==s?void 0:s.id}`),number:e.shirt_number,position:O((null==s?void 0:s.position)||"NA"),url:null==s?void 0:s.url,photoUrl:(null==s?void 0:s.url)?V(s.url):null,goals:l,country:(null==s?void 0:s.country_code)||"",rating:(null==s?void 0:s.rating)||0}}).filter(e=>"undefined undefined"!==e.name),D=A?b.bench:b.predictedBench,K=((null==D?void 0:D.team_a)||[]).map(e=>{var t;const a=null==(t=v.homePlayers)?void 0:t.get(e.player_in_id);return{id:null==a?void 0:a.id,name:L((null==a?void 0:a.known_as)||`${null==a?void 0:a.first_name} ${null==a?void 0:a.last_name}`||`PID: ${null==a?void 0:a.id}`),number:e.player_in_shirt_number,position:O((null==a?void 0:a.position)||"SUB"),url:null==a?void 0:a.url,photoUrl:(null==a?void 0:a.url)?V(a.url):null,goals:0,country:(null==a?void 0:a.country_code)||"",rating:(null==a?void 0:a.rating)||0}}).filter(e=>"undefined undefined"!==e.name),M=((null==D?void 0:D.team_b)||[]).map(e=>{var t;const a=null==(t=v.awayPlayers)?void 0:t.get(e.player_in_id);return{id:null==a?void 0:a.id,name:L((null==a?void 0:a.known_as)||`${null==a?void 0:a.first_name} ${null==a?void 0:a.last_name}`||`PID: ${null==a?void 0:a.id}`),number:e.player_in_shirt_number,position:O((null==a?void 0:a.position)||"SUB"),url:null==a?void 0:a.url,photoUrl:(null==a?void 0:a.url)?V(a.url):null,goals:0,country:(null==a?void 0:a.country_code)||"",rating:(null==a?void 0:a.rating)||0}}).filter(e=>"undefined undefined"!==e.name),F={teamName:j,teamLogo:_,starters:P,substitutes:K},$={teamName:N,teamLogo:S,starters:T,substitutes:M},B=(e,t,a,s)=>{var l,r,n,i;if(!(null==e?void 0:e.id))return;const m={id:null==(l=p.match)?void 0:l.competition_id,leagueName:(null==(r=p.match)?void 0:r.league_name)||(null==(n=p.match)?void 0:n.competition_name),season:null==(i=p.match)?void 0:i.season},o={id:e.id,name:e.name,image:e.url,position:e.position,nationality:e.country},d=z(o,{id:a,name:t,image:s},m);W(w,e.id,d)};return a.jsx("div",{className:"max-w-4xl mx-auto px-4 py-4 my-1 rounded-lg shadow "+(f?"bg-gray-900":"bg-gray-100"),children:a.jsxs("div",{className:"flex flex-col md:flex-row gap-4 p-0",children:[a.jsx(Ne,{...F,alignRight:!1,isPredicted:k,isDarkMode:f,onPlayerClick:e=>{var t;return B(e,j,null==(t=p.match)?void 0:t.homeID,_)}}),a.jsx(Ne,{...$,alignRight:!0,isPredicted:k,isDarkMode:f,onPlayerClick:e=>{var t;return B(e,N,null==(t=p.match)?void 0:t.awayID,S)}})]})})},Se=()=>{var t;const{matchExtraStatsData:s}=e.useContext(i),{matchDetailsData:l}=e.useContext(n),{isDarkMode:m}=r(),{t:d}=ne(),[c,x]=e.useState(!1),{shouldLockAISummary:h}=o(),g=(null==l?void 0:l.isPremiumUnlocked)??!1,y=null==l?void 0:l.match,b=h&&!g&&!U(y),{createCounter:p}=f("match-analysis"),v=p("ai_summary_views",{description:"Number of AI summary card views",unit:"views"}),w=p("ai_summary_expansions",{description:"Number of AI summary expansions",unit:"expansions"}),j=null==s?void 0:s.gpt_en,N=(()=>{var e,t,a,s,r,n;if(!(null==l?void 0:l.match))return{url:null,title:null};const i=l.match;return U(i)?{url:(null==(e=i.postmatchPodcast)?void 0:e.audio_url)||(null==(t=i.prematchPodcast)?void 0:t.audio_url)||null,title:(null==(a=i.postmatchPodcast)?void 0:a.title)||(null==(s=i.prematchPodcast)?void 0:s.title)||d("matchAnalysis.aiSummary.podcastAnalysisTitle")}:{url:(null==(r=i.prematchPodcast)?void 0:r.audio_url)||null,title:(null==(n=i.prematchPodcast)?void 0:n.title)||d("matchAnalysis.aiSummary.podcastPreviewTitle")}})();e.useEffect(()=>{const e=null==l?void 0:l.match;v(1,{has_content:!!_,has_podcast:!!N.url,match_status:e?U(e)?"complete":"upcoming":"unknown",match_id:(null==e?void 0:e.id)||"unknown"})},[null==(t=null==l?void 0:l.match)?void 0:t.id]);const _=(()=>
2{if(!j)return null;if("string"!=typeof j)return null;const e=j.trim();return 0===e.length?null:(e=>{if(!e||"string"!=typeof e)return e;let t=e;return t=t.replace(/(\d+)-(\d+)/g,"**$1-$2**"),t=t.replace(/(\d+\.?\d*%)/g,"**$1**"),t})((t=e)&&"string"==typeof t?t.replace(/\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\r/g,"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"):t);var t})(),S=_&&_.length>400;return a.jsxs("div",{className:"mb-4 p-4 rounded-lg "+(m?"bg-gray-800":"bg-gray-100"),children:[a.jsx("div",{className:"space-y-3 text-sm "+(m?"text-gray-300":"text-gray-700"),children:_?a.jsxs(a.Fragment,{children:[a.jsx(ge,{remarkPlugins:[ye],components:{p:({children:e})=>a.jsx("p",{className:"mb-2 last:mb-0 leading-relaxed text-left",children:e}),strong:({children:e})=>a.jsx("strong",{className:"font-bold px-1 py-0.5 rounded "+(m?"text-blue-300 bg-blue-950":"text-blue-900 bg-blue-50"),children:e}),em:({children:e})=>a.jsx("em",{className:"italic "+(m?"text-gray-300":"text-gray-800"),children:e}),ul:({children:e})=>a.jsx("ul",{className:"list-disc list-inside mb-2 space-y-1 ml-2",children:e}),ol:({children:e})=>a.jsx("ol",{className:"list-decimal list-inside mb-2 space-y-1 ml-2",children:e}),li:({children:e})=>a.jsx("li",{className:"text-sm leading-relaxed "+(m?"text-gray-200":""),children:e}),h1:({children:e})=>a.jsx("h1",{className:"text-lg font-bold mb-3 border-b pb-1 "+(m?"text-gray-100 border-gray-700":"text-gray-900 border-gray-200"),children:e}),h2:({children:e})=>a.jsx("h2",{className:"text-base font-bold mb-2 "+(m?"text-gray-100":"text-gray-900"),children:e}),h3:({children:e})=>a.jsx("h3",{className:"text-sm font-bold mb-2 "+(m?"text-gray-100":"text-gray-900"),children:e}),code:({children:e})=>a.jsx("code",{className:"px-1.5 py-0.5 rounded text-xs font-mono "+(m?"bg-gray-700 text-gray-200":"bg-gray-100"),children:e}),blockquote:({children:e})=>a.jsx("blockquote",{className:"border-l-4 pl-3 py-1 italic mb-2 "+(m?"border-blue-700 bg-blue-950 text-gray-300":"border-blue-300 bg-blue-50 text-gray-700"),children:e}),hr:()=>a.jsx("hr",{className:"my-3 "+(m?"border-gray-700":"border-gray-200")}),a:({children:e,href:t})=>a.jsx("a",{href:t,className:"underline "+(m?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-800"),target:"_blank",rel:"noopener noreferrer",children:e}),table:({children:e})=>a.jsx("div",{className:"my-3 overflow-x-auto",children:a.jsx("table",{className:"min-w-full border-collapse border text-sm rounded-lg shadow-sm "+(m?"border-gray-700 bg-gray-900":"border-gray-300 bg-white"),children:e})}),thead:({children:e})=>a.jsx("thead",{className:m?"bg-gradient-to-r from-blue-950 to-blue-900":"bg-gradient-to-r from-blue-50 to-blue-100",children:e}),tbody:({children:e})=>a.jsx("tbody",{className:"divide-y "+(m?"divide-gray-700":"divide-gray-200"),children:e}),th:({children:e})=>a.jsx("th",{className:"border px-3 py-2 text-left font-bold text-xs "+(m?"border-gray-700 text-gray-200 bg-blue-950":"border-gray-300 text-gray-800 bg-blue-50"),children:e}),td:({children:e})=>a.jsx("td",{className:"border px-3 py-2 text-xs "+(m?"border-gray-700 text-gray-300":"border-gray-300 text-gray-700"),children:e})},children:c||!S?_:`${_.substring(0,400)}...`}),S&&(b?a.jsx(u,{variant:"ai-summary"}):a.jsx("button",{onClick:()=>{var e;const t=!c;x(t),t&&w(1,{content_length:(null==_?void 0:_.length)||0,match_id:(null==(e=null==l?void 0:l.match)?void 0:e.id)||"unknown"})},className:"flex items-center mx-auto mt-2 text-sm "+(m?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-800"),children:c?a.jsxs(a.Fragment,{children:[d("matchAnalysis.aiSummary.showLess")," ",a.jsx(oe,{size:16,className:"ml-1"})]}):a.jsxs(a.Fragment,{children:[d("matchAnalysis.aiSummary.readMore")," ",a.jsx(de,{size:16,className:"ml-1"})]})}))]}):a.jsx("p",{className:"italic "+(m?"text-gray-400":"text-gray-600"),children:d("matchAnalysis.aiSummary.generatingText")})}),N.url&&a.jsx("div",{className:"mt-3",children:b?a.jsx(u,{variant:"podcast"}):a.jsx(he,{audioUrl:N.url,title:N.title,matchInfo:null==l?void 0:l.match,variant:"full",className:"max-w-sm mx-auto",onPlay:()=>{},onPause:()=>{},onEnded:()=>{}})})]})},Ae=(e,t)=>
2{if("number"!=typeof e||isNaN(e))return"-";switch(t){case"percentage":return`${e.toFixed(0)}%`;case"double":return e.toFixed(2);case"int":return e.toFixed(0);default:return e.toString()}},Ce=()=>{const{homeAwayTeamsStatsData:t}=e.useContext(w),{isDarkMode:s}=r(),{t:l}=ne(),[n,i]=e.useState(!1);if(e.useEffect(()=>{const e=setTimeout(()=>i(!0),50);return()=>clearTimeout(e)},[]),!t||!t.home||!t.away)return a.jsx("div",{className:"p-4 text-center "+(s?"text-gray-400":"text-gray-500"),children:l("matchAnalysis.teamsPerformance.noData")});const m=[{name:l("matchAnalysis.teamsPerformance.statWins"),homeKey:"winPercentage_home",awayKey:"winPercentage_away",format:"percentage"},{name:l("matchAnalysis.teamsPerformance.statPpg"),homeKey:"seasonPPG_home",awayKey:"seasonPPG_away",format:"double"},{name:l("matchAnalysis.teamsPerformance.statAvg"),homeKey:"seasonAVG_home",awayKey:"seasonAVG_away",format:"double"},{name:l("matchAnalysis.teamsPerformance.statScored"),homeKey:"seasonScoredAVG_home",awayKey:"seasonScoredAVG_away",format:"double"},{name:l("matchAnalysis.teamsPerformance.statConceded"),homeKey:"seasonConcededAVG_home",awayKey:"seasonConcededAVG_away",format:"double"},{name:l("matchAnalysis.teamsPerformance.statBtts"),homeKey:"seasonBTTSPercentage_home",awayKey:"seasonBTTSPercentage_away",format:"percentage"},{name:l("matchAnalysis.teamsPerformance.statCs"),homeKey:"seasonCSPercentage_home",awayKey:"seasonCSPercentage_away",format:"percentage"},{name:l("matchAnalysis.teamsPerformance.statFts"),homeKey:"seasonFTSPercentage_home",awayKey:"seasonFTSPercentage_away",format:"percentage"},{name:l("matchAnalysis.teamsPerformance.statXg"),homeKey:"xg_for_avg_home",awayKey:"xg_for_avg_away",format:"double"},{name:l("matchAnalysis.teamsPerformance.statXga"),homeKey:"xg_against_avg_home",awayKey:"xg_against_avg_away",format:"double"}].map(e=>R(t,e.name,e.homeKey,e.awayKey,e.format));return a.jsxs("div",{className:"mb-4 p-3 sm:p-4 rounded-lg shadow-sm "+(s?"bg-gray-800":"bg-gray-100"),children:[a.jsxs("div",{className:"flex items-center justify-between mb-3 sm:mb-5",children:[a.jsxs("div",{className:"flex items-center max-w-[45%]",children:[t.home.image&&a.jsx("img",{src:t.home.image,alt:`${t.home.cleanName} logo`,className:"w-5 h-5 sm:w-6 sm:h-6 mr-1 sm:mr-2 object-contain flex-shrink-0",loading:"lazy",decoding:"async"}),a.jsx("span",{className:"font-medium text-xs sm:text-sm truncate "+(s?"text-gray-200":"text-gray-700"),children:t.home.cleanName})]}),a.jsxs("div",{className:"flex items-center max-w-[45%] justify-end",children:[a.jsx("span",{className:"font-medium text-xs sm:text-sm truncate "+(s?"text-gray-200":"text-gray-700"),children:t.away.cleanName}),t.away.image&&a.jsx("img",{src:t.away.image,alt:`${t.away.cleanName} logo`,className:"w-5 h-5 sm:w-6 sm:h-6 ml-1 sm:ml-2 object-contain flex-shrink-0",loading:"lazy",decoding:"async"})]})]}),a.jsx("div",{className:"space-y-3 sm:space-y-4",children:m.map((e,t)=>a.jsxs("div",{className:"mb-2 sm:mb-3",children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsx("div",{className:"text-xs sm:text-sm font-medium w-[30%] text-center "+(s?"text-gray-100":"text-gray-800"),children:Ae(e.teamAStat,e.format)}),a.jsx("div",{className:"text-xs sm:text-sm font-medium w-[40%] text-center px-1 "+(s?"text-gray-200":"text-gray-700"),children:e.statName}),a.jsx("div",{className:"text-xs sm:text-sm font-medium w-[30%] text-center "+(s?"text-gray-100":"text-gray-800"),children:Ae(e.teamBStat,e.format)})]}
2),a.jsxs("div",{className:"relative h-1.5 sm:h-2 rounded-full overflow-hidden "+(s?"bg-gray-700":"bg-gray-300"),children:[a.jsx("div",{className:"absolute left-0 h-full bg-green-500 rounded-l-full",style:{width:n?e.teamAStatWidth:"0%",transition:"width 1.5s ease-out"}}),a.jsx("div",{className:"absolute right-0 h-full bg-red-500 rounded-r-full",style:{width:n?e.teamBStatWidth:"0%",transition:"width 1.5s ease-out"}})]})]},t))})]})},ke=()=>{var t,s,l,i;const[m,o]=e.useState("home"),[d,c]=e.useState("away"),[x,h]=e.useState(!1),[g,y]=e.useState({homeTeamMatches:{allMatches:[],homeMatches:[],awayMatches:[]},awayTeamMatches:{allMatches:[],homeMatches:[],awayMatches:[]}}),[u,b]=e.useState(!1),{matchDetailsData:p}=e.useContext(n),{isDarkMode:v}=r(),{t:f}=ne();e.useEffect(()=>{const e=()=>{h(window.innerWidth<640)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.useEffect(()=>{var e,t,a,s;const l=null==(e=null==p?void 0:p.match)?void 0:e.homeID,r=null==(t=null==p?void 0:p.match)?void 0:t.awayID,n=null==(a=null==p?void 0:p.match)?void 0:a.competition_id,i=null==(s=null==p?void 0:p.match)?void 0:s.id;if(l&&r&&n){(async()=>{b(!0);try{const e=X(i);if(e)y(e);else{const[e,t]=await Promise.all([j(l,n),j(r,n)]),a=w(e,l,5),s={homeTeamMatches:a,awayTeamMatches:w(t,r,5)};q(i,s),y(s)}}catch(e){const t=Q(l,r,n);t&&y(t)}finally{b(!1)}})()}},[null==(t=null==p?void 0:p.match)?void 0:t.homeID,null==(s=null==p?void 0:p.match)?void 0:s.awayID,null==(l=null==p?void 0:p.match)?void 0:l.competition_id,null==(i=null==p?void 0:p.match)?void 0:i.id]);const w=(e,t,a=5)=>{if(!e||!e.length)return{allMatches:[],homeMatches:[],awayMatches:[]};const s=[...e].sort((e,t)=>new Date(t.matchDate||t.date)-new Date(e.matchDate||e.date)),l=s.filter(e=>e.homeID===t).slice(0,a),r=s.filter(e=>e.awayID===t).slice(0,a);return{allMatches:s.slice(0,a),homeMatches:l,awayMatches:r}},N=(e,t,s)=>{var l,r,n,i,m,o;const d=e?g.homeTeamMatches:g.awayTeamMatches,c=e?null==(l=null==p?void 0:p.match)?void 0:l.homeID:null==(r=null==p?void 0:p.match)?void 0:r.awayID,x=e?null==(n=null==p?void 0:p.match)?void 0:n.home_name:null==(i=null==p?void 0:p.match)?void 0:i.away_name;let h=[];"all"===t&&d.allMatches?h=d.allMatches:"home"===t&&d.homeMatches?h=d.homeMatches:"away"===t&&d.awayMatches&&(h=d.awayMatches);const y=h.map(e=>{const t=e.homeID===c,a=t?e.homeGoalCount:e.awayGoalCount,s=t?e.awayGoalCount:e.homeGoalCount;return a>s?{result:"W",color:"bg-green-700"}:a<s?{result:"L",color:"bg-red-700"}:{result:"D",color:"bg-yellow-600"}});return a.jsxs("div",{className:"flex flex-col rounded-lg shadow-md "+(v?"bg-gray-800":"bg-white"),children:[a.jsxs("div",{className:`flex ${e?"flex-row":"flex-row-reverse"} items-center mb-3 sm:mb-4 w-full justify-between`,children:[a.jsx("div",{className:"w-12 h-12 sm:w-16 sm:h-16 lg:w-20 lg:h-20 p-1 sm:p-2 flex items-center justify-center",children:a.jsx("img",{src:e?G(null==(m=null==p?void 0:p.match)?void 0:m.home_image):G(null==(o=null==p?void 0:p.match)?void 0:o.away_image)||"/api/placeholder/80/80",alt:x,className:"max-w-full max-h-full",loading:"lazy",decoding:"async"})}),a.jsxs("div",{className:"flex flex-col flex-1 "+(e?"items-start pl-2":"items-end pr-2"),children:[a.jsx("div",{className:"flex space-x-1 mb-1 sm:mb-2",children:y.length>0?[...y].reverse().map((e,t)=>a.jsx("div",{className:`${e.color} w-4 h-4 sm:w-5 sm:h-5 lg:w-6 lg:h-6 flex items-center justify-center text-white text-xs font-semibold rounded-sm`,children:e.result},t)):a.jsx("div",{className:"w-4 h-4 sm:w-5 sm:h-5 lg:w-6 lg:h-6 flex items-center justify-center text-white text-xs font-semibold rounded-sm "+(v?"bg-gray-600":"bg-gray-300"),children:"-"})}),a.jsx("div",{className:"text-center font-semibold text-xs sm:text-sm lg:text-base "+(v?"text-gray-100":"text-gray-900"),children:x})]})]}),a.jsxs("div",{className:"flex justify-center overflow-x-auto mb-3 sm:mb-4",children:[a.jsx("button",{className:"px-2 sm:px-3 py-1 text-xs sm:text-sm lg:text-base rounded-md mr-1 sm:mr-2 "+("all"===t?v?"bg-blue-600 text-white":"bg-blue-100 text-blue-800":v?"bg-gray-700 text-gray-300":"bg-gray-100 text-gray-700"),onClick:()=>s("all"),children:f("matchAnalysis.formGuide.tabAll")}),a.jsx("button",{className:"px-2 sm:px-3 py-1 text-xs sm:text-sm lg:text-base rounded-md mr-1 sm:mr-2 "+("home"===t?v?"bg-blue-600 text-white":"bg-blue-100 text-blue-800":v?"bg-gray-700 text-gray-300":"bg-gray-100 text-gray-700"),onClick:()=>s("home"),children:f("matchAnalysis.formGuide.tabHome")}),a.jsx("button",{className:"px-2 sm:px-3 py-1 text-xs sm:text-sm lg:text-base rounded-md "+("away"===t?v?"bg-blue-600 text-white":"bg-blue-100 text-blue-800":v?"bg-gray-700 text-gray-300":"bg-gray-100 text-gray-700"),onClick:()=>s("away"),children:f("matchAnalysis.formGuide.tabAway")})]}),a.jsx("div",{className:"space-y-2",children:u?a.jsx("div",{className:"text-center py-3 "+(v?"text-gray-400":"text-gray-500"),children:f("matchAnalysis.formGuide.loadingMatchData")}):h.length>0?h.map((e,t)=>{const s=e.homeID===c,l=s?e.homeGoalCount:e.awayGoalCount,r=s?e.awayGoalCount:e.homeGoalCount;let n="bg-yellow-600";return l>r?n="bg-green-700":l<r&&(n="bg-red-700"),a.jsxs("div",{className:"p-1.5 sm:p-2 rounded-md flex flex-col border shadow-sm "+(v?"border-gray-600 bg-gray-700":"border-gray-200 bg-white"),children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("img",{src:G(e.home_image),alt:e.home_name,className:"w-3 h-3 sm:w-4 sm:h-4 lg:w-5 lg:h-5 ml-0.5 sm:ml-1 object-contain flex-shrink-0"}),a.jsx("div",{className:"text-left flex-1 truncate text-xs sm:text-sm px-1 "+(v?"text-gray-200":"text-gray-900"),children:e.home_name}),a.jsxs("div",{className:`${n} font-semibold mx-1 sm:mx-2 whitespace-nowrap text-xs text-white rounded-md px-1.5 sm:px-2 py-0.5
2sm:py-1 flex-shrink-0`,children:[e.homeGoalCount," - ",e.awayGoalCount]}),a.jsx("div",{className:"text-right flex-1 truncate text-xs sm:text-sm px-1 "+(v?"text-gray-200":"text-gray-900"),children:e.away_name}),a.jsx("img",{src:G(e.away_image),alt:e.away_name,className:"w-3 h-3 sm:w-4 sm:h-4 lg:w-5 lg:h-5 ml-0.5 sm:ml-1 object-contain flex-shrink-0"})]}),a.jsx("div",{className:"text-center text-xs mt-0.5 sm:mt-1 opacity-80 "+(v?"text-gray-300":"text-gray-700"),children:B(e.date_unix)})]},t)}):a.jsx("div",{className:"text-center py-3 "+(v?"text-gray-400":"text-gray-500"),children:f("matchAnalysis.formGuide.noMatchData")})})]})};return a.jsx("div",{className:"font-sans w-full max-w-none sm:max-w-4xl mx-auto rounded-lg shadow-lg overflow-hidden "+(v?"bg-gray-900":"bg-gray-100"),children:a.jsx("div",{className:"p-2 sm:p-3 lg:p-4",children:a.jsxs("div",{className:""+(x?"space-y-6":"grid grid-cols-2 gap-6 lg:gap-8"),children:[N(!0,m,o),N(!1,d,c)]})})})},Pe=()=>{const{homeAwayTeamsStatsData:t}=e.useContext(w),{matchExtraStatsData:s}=e.useContext(i),{isDarkMode:l}=r(),{t:n}=ne();if(!(t&&t.home&&t.away&&s&&s.h2h))return a.jsx("div",{className:"mt-6 mb-4 p-4 rounded-lg "+(l?"bg-gray-800":"bg-gray-200"),children:a.jsx("div",{className:"text-center "+(l?"text-gray-400":"text-gray-500"),children:n("matchAnalysis.pastMatches.noData")})});const m=t.home,o=t.away,d=s.h2h,{totalMatches:c,team_a_wins:x,team_b_wins:h,draw:g,team_a_win_percent:y,team_b_win_percent:u}=d.previous_matches_results||{},{total_goals:b,avg_goals:p}=d.betting_stats||{},v=100-(y+u);return a.jsxs("div",{className:"mt-3 sm:mt-4 mb-3 sm:mb-6 p-2 sm:p-4 rounded-lg max-w-4xl mx-auto "+(l?"bg-gray-800":"bg-gray-100"),children:[a.jsxs("div",{className:"text-sm sm:text-base xs:text-xs font-semibold mb-0.5 sm:mb-1 "+(l?"text-gray-100":"text-gray-800"),children:[n("matchAnalysis.pastMatches.sectionTitle")," ",a.jsxs("span",{className:"text-xs sm:text-sm xs:text-[10px] font-normal "+(l?"text-gray-300":"text-gray-700"),children:["- ",m.cleanName," vs ",o.cleanName]})]}),a.jsx("div",{className:"flex justify-center items-center",children:a.jsx("div",{className:"text-lg sm:text-xl xs:text-base font-bold "+(l?"text-gray-100":"text-gray-800"),children:c})}),a.jsx("div",{className:"text-xs sm:text-sm xs:text-[10px] "+(l?"text-gray-400":"text-gray-600"),children:n("matchAnalysis.pastMatches.matchesLabel")}),a.jsxs("div",{className:"flex items-center mb-1",children:[a.jsxs("div",{className:"text-center",children:[m.image?a.jsx("img",{src:m.image,alt:`${m.cleanName} logo`,className:"h-8 w-8 md:h-8 md:w-8 sm:h-6 sm:w-6 xs:h-5 xs:w-5 mx-auto mb-0.5 sm:mb-1 object-contain p-1",loading:"lazy",decoding:"async"}):a.jsx("div",{className:"h-8 w-8 md:h-8 md:w-8 sm:h-6 sm:w-6 xs:h-5 xs:w-5 rounded-full mx-auto mb-0.5 sm:mb-1 flex items-center justify-center "+(l?"bg-green-500":"bg-green-600"),children:a.jsx("div",{className:"text-white text-xs md:text-xs sm:text-[10px] font-bold",children:m.cleanName.charAt(0)})}),a.jsx("div",{className:"text-xs sm:text-xs sm:text-[10px] font-medium mt-0.5 "+(l?"text-gray-200":"text-gray-900"),children:m.cleanName}),a.jsxs("div",{className:"text-[9px] sm:text-[9px] "+(l?"text-gray-400":"text-gray-600"),children:["(",y,"%)"]})]}),a.jsxs("div",{className:"w-4/6 px-1 md:px-1 sm:px-0.5 xs:px-0.5 mb-4 md:mb-4 sm:mb-2 xs:mb-1",children:[a.jsxs("div",{className:"relative h-3 sm:h-3 xs:h-2 rounded-full overflow-hidden flex",children:[a.jsx("div",{className:"bg-green-500 h-full",style:{width:`${y}%`}}),a.jsx("div",{className:"bg-yellow-500 h-full",style:{width:`${v}%`}}),a.jsx("div",{className:"bg-red-500 h-full",style:{width:`${u}%`}})]}),a.jsxs("div",{className:"flex justify-between mt-0.5 sm:mt-1 text-[9px] sm:text-[9px]",children:[a.jsx("div",{children:n("matchAnalysis.pastMatches.winsCount",{count:x})}),a.jsx("div",{children:n("matchAnalysis.pastMatches.drawsWithPct",{count:g,pct:v})}),a.jsx("div",{children:n("matchAnalysis.pastMatches.winsCount",{count:h})})]})]}),a.jsxs("div",{className:"text-center",children:[o.image?a.jsx("img",{src:o.image,alt:`${o.cleanName} logo`,className:"h-8 w-8 md:h-8 md:w-8 sm:h-6 sm:w-6 xs:h-5 xs:w-5 mx-auto mb-0.5 sm:mb-1 object-contain p-1",loading:"lazy",decoding:"async"}):a.jsx("div",{className:"h-8 w-8 md:h-8 md:w-8 sm:h-6 sm:w-6 xs:h-5 xs:w-5 rounded-full mx-auto mb-0.5 sm:mb-1 flex items-center justify-center "+(l?"bg-yellow-500":"bg-yellow-600"),children:a.jsx("div",{className:"text-white text-xs md:text-xs sm:text-[10px] font-bold",children:o.cleanName.charAt(0)})}),a.jsx("div",{className:"text-xs sm:text-xs sm:text-[10px] font-medium mt
2-0.5 "+(l?"text-gray-200":"text-gray-900"),children:o.cleanName}),a.jsxs("div",{className:"text-[9px] sm:text-[9px] "+(l?"text-gray-400":"text-gray-600"),children:["(",u,"%)"]})]})]}),a.jsx("div",{className:"text-[10px] md:text-[10px] sm:text-[9px] mb-3 sm:mb-4 text-left "+(l?"text-gray-300":"text-gray-600"),children:n("matchAnalysis.pastMatches.h2hSummary",{homeTeam:m.cleanName,awayTeam:o.cleanName,totalMatches:c,teamAWins:x,teamBWins:h,draw:g,totalGoals:b,avgGoals:p})}),d.previous_matches_ids&&d.previous_matches_ids.length>0&&a.jsxs("div",{className:"mt-1 mb-2",children:[a.jsx("div",{className:"text-sm sm:text-xs font-semibold mb-1 "+(l?"text-gray-200":"text-gray-900"),children:n("matchAnalysis.pastMatches.h2hResultsTitle",{homeTeam:m.cleanName,awayTeam:o.cleanName})}),a.jsx("div",{className:"overflow-y-auto max-h-52 border rounded "+(l?"border-gray-600":"border-gray-300"),children:a.jsxs("table",{className:"min-w-full text-xs sm:text-[10px] table-fixed",children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"w-[25%] sm:w-[22%]"}),a.jsx("col",{className:"w-[55%] sm:w-[60%]"}),a.jsx("col",{className:"w-[20%] sm:w-[18%]"})]}),a.jsx("thead",{className:"sticky top-0 z-10",children:a.jsxs("tr",{className:l?"bg-gray-700":"bg-gray-300",children:[a.jsx("th",{className:"px-1 py-1 sm:px-1 sm:py-0.5 "+(l?"text-gray-200":"text-gray-900"),children:n("matchAnalysis.pastMatches.tableDate")}),a.jsx("th",{className:"px-2 py-1 sm:px-1 sm:py-0.5 "+(l?"text-gray-200":"text-gray-900"),children:n("matchAnalysis.pastMatches.tableFixture")}),a.jsx("th",{className:"px-1 py-1 sm:px-1 sm:py-0.5 "+(l?"text-gray-200":"text-gray-900"),children:n("matchAnalysis.pastMatches.tableResult")})]})}),a.jsx("tbody",{children:d.previous_matches_ids.map(e=>{const t=new Date(1e3*e.date_unix),s=`${t.getDate().toString().padStart(2,"0")}/${(t.getMonth()+1).toString().padStart(2,"0")}/${t.getFullYear()} ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`,r=e.team_a_id===d.team_a_id,n=r?m.cleanName:o.cleanName,i=r?o.cleanName:m.cleanName,c=r?e.team_a_goals:e.team_b_goals,x=r?e.team_b_goals:e.team_a_goals;return a.jsxs("tr",{className:"border-t "+(l?"border-gray-600 hover:bg-gray-700":"border-gray-300 hover:bg-gray-100"),children:[a.jsx("td",{className:"px-1 py-1 sm:px-1 sm:py-0.5 text-[10px] sm:text-[9px] "+(l?"text-gray-300":"text-gray-700"),children:s}),a.jsx("td",{className:"px-2 py-1 sm:px-1 sm:py-0.5",children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("div",{className:"font-medium truncate max-w-full "+(l?"text-gray-200":"text-gray-900"),children:n}),a.jsx("div",{className:"truncate max-w-full "+(l?"text-gray-400":"text-gray-600"),children:i})]})}),a.jsx("td",{className:"px-1 py-1 sm:px-1 sm:py-0.5",children:a.jsxs("div",{className:"flex flex-col items-center "+(l?"text-gray-200":"text-gray-900"),children:[a.jsx("div",{className:"font-bold",children:c}),a.jsx("div",{className:"font-bold",children:x})]})})]},e.id)})})]})})]})]})},Te=({team:e,isDarkMode:t})=>{const{t:s}=ne(),l=e=>{const t="W"===e?"bg-green-700":"D"===e?"bg-yellow-600":"bg-red-700";return a.jsx("span",{className:`inline-flex items-center justify-center w-3.5 h-3.5 sm:w-4 sm:h-4 ${t} text-white font-bold rounded-sm mx-0.5 text-[9px] sm:text-xs`,children:e})};return e?a.jsx("div",{className:"w-full md:w-1/2 p-1 sm:p-2",children:a.jsxs("div",{className:"rounded-lg overflow-hidden shadow-lg "+(t?"bg-gray-800":"bg-gray-100"),children:[a.jsxs("div",{className:"p-1.5 sm:p-2 flex items-center",children:[a.jsx("div",{className:"p-1 rounded mr-1 sm:mr-2 w-8 h-8 sm:w-10 sm:h-10 flex items-center justify-center shadow "+(t?"bg-gray-700":"bg-white"),children:e.logo?a.jsx("img",{src:e.logo,alt:`${e.name} logo`,className:"w-6 h-6 sm:w-8 sm:h-8 object-contain",loading:"lazy",decoding:"async"}):a.jsx(ce,{className:"w-5 h-5 sm:w-6 sm:h-6 "+(t?"text-gray-400":"text-gray-800")})}),a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center",children:a.jsx("h2",{className:"text-xs sm:text-sm font-bold truncate max-w-[120px] sm:max-w-[150px] "+(t?"text-gray-100":"text-gray-800"),children:e.name})}),a.jsx("p",{className:"text-[10px] sm:text-xs truncate max-w-[150px] sm:max-w-[180px] "+(t?"text-gray-400":"text-gray-600"),children:e.league})]})]}),a.jsx("div",{className:"border-t "+(t?"border-gray-600":"border-gray-300"),children:a.jsxs("table",{className:"w-full text-[10px] sm:text-xs "+(t?"text-gray-200":"text-gray-800"),children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b "+(t?"border-gray-600 bg-gray-700":"border-gray-300 bg-gray-200"),children:[a.jsx("th",{className:"p-0.5
2sm:p-1 text-left w-1/5",children:s("matchAnalysis.teamsStats.tableHeaderForm")}),a.jsx("th",{className:"p-0.5 sm:p-1 text-center w-3/5",children:s("matchAnalysis.teamsStats.tableHeaderLast5")}),a.jsx("th",{className:"p-0.5 sm:p-1 text-center w-1/5",children:s("matchAnalysis.teamsStats.tableHeaderPpg")})]})}),a.jsx("tbody",{children:e.formPpg&&e.formPpg.map(e=>{return a.jsxs("tr",{className:"border-b "+(t?"border-gray-600":"border-gray-300"),children:[a.jsx("td",{className:"p-0.5 sm:p-1 text-[10px] sm:text-xs",children:e.statName}),a.jsx("td",{className:"p-0.5 sm:p-1 text-center",children:a.jsx("div",{className:"flex justify-center items-center",children:e.formValue&&e.formValue.length>0?e.formValue.map((t,s)=>a.jsx("span",{children:l(t)},`${e.statName}-${s}`)):a.jsx("span",{className:"text-[9px] sm:text-xs text-gray-500",children:s("matchAnalysis.teamsStats.na")})})}),a.jsx("td",{className:"p-0.5 sm:p-1 text-center",children:e.ppgValue?a.jsx("span",{className:"px-1 py-0.5 rounded text-white text-[9px] sm:text-xs "+(r=e.ppgValue,r>=2?"bg-green-700":r>=1.5?"bg-green-500":r>=1?"bg-yellow-600":"bg-red-700"),children:e.ppgValue.toFixed(2)}):a.jsx("span",{className:"text-[9px] sm:text-xs text-gray-500",children:s("matchAnalysis.teamsStats.na")})})]},e.statName);var r})})]})}),a.jsx("div",{className:"border-t "+(t?"border-gray-600":"border-gray-300"),children:a.jsxs("table",{className:"w-full text-[10px] sm:text-xs "+(t?"text-gray-200":"text-gray-800"),children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b "+(t?"border-gray-600":"border-gray-300"),children:[a.jsx("th",{className:"p-0.5 sm:p-1 text-left",children:s("matchAnalysis.teamsStats.tableHeaderStats")}),a.jsx("th",{className:"p-0.5 sm:p-1 text-center "+(t?"bg-gray-700":"bg-gray-200"),children:s("matchAnalysis.teamsStats.columnOverall")}),a.jsx("th",{className:"p-0.5 sm:p-1 text-center "+("home"===e.highlightColumn?t?"bg-blue-900":"bg-blue-100":t?"bg-gray-700":"bg-gray-200"),children:s("matchAnalysis.teamsStats.columnHome")}),a.jsx("th",{className:"p-0.5 sm:p-1 text-center "+("away"===e.highlightColumn?t?"bg-blue-900":"bg-blue-100":t?"bg-gray-700":"bg-gray-200"),children:s("matchAnalysis.teamsStats.columnAway")})]})}),a.jsx("tbody",{children:e.stats&&e.stats.map(s=>a.jsxs("tr",{className:"border-b "+(t?"border-gray-600":"border-gray-300"),children:[a.jsx("td",{className:"p-0.5 sm:p-1",children:s.statName}),a.jsx("td",{className:"p-0.5 sm:p-1 text-center "+(t?"bg-gray-700":"bg-gray-200"),children:s.overallStat}),a.jsx("td",{className:"p-0.5 sm:p-1 text-center "+("home"===e.highlightColumn?t?"bg-blue-900":"bg-blue-100":t?"bg-gray-700":"bg-gray-200"),children:s.homeStat}),a.jsx("td",{className:"p-0.5 sm:p-1 text-center "+("away"===e.highlightColumn?t?"bg-blue-900":"bg-blue-100":t?"bg-gray-700":"bg-gray-200"),children:s.awayStat})]},s.statName))})]})})]})}):a.jsx("div",{className:"w-full md:w-1/2 p-1 sm:p-2",children:a.jsx("div",{className:"rounded-lg overflow-hidden shadow-lg p-2 sm:p-3 text-center "+(t?"bg-gray-800":"bg-gray-100"),children:a.jsx("p",{className:"text-xs "+(t?"text-gray-300":"text-gray-700"),children:s("matchAnalysis.teamsStats.teamDataUnavailable")})})})},De=()=>{const{matchDetailsData:t}=e.useContext(n),{homeAwayTeamsStatsData:s}=e.useContext(w),{isDarkMode:l}=r(),{t:i}=ne(),m=[{statName:i("matchAnalysis.teamsStats.statWinPct"),overallKey:"winPercentage_overall",homeKey:"winPercentage_home",awayKey:"winPercentage_away",formatType:"percentage"},{statName:i("matchAnalysis.teamsStats.statAvg"),overallKey:"seasonAVG_overall",homeKey:"seasonAVG_home",awayKey:"seasonAVG_away",formatType:"double"},{statName:i("matchAnalysis.teamsStats.statScored"),overallKey:"seasonScoredAVG_overall",homeKey:"seasonScoredAVG_home",awayKey:"seasonScoredAVG_away",formatType:"double"},{statName:i("matchAnalysis.teamsStats.statConceded"),overallKey:"seasonConcededAVG_overall",homeKey:"seasonConcededAVG_home",awayKey:"seasonConcededAVG_away",formatType:"double"},{statName:i("matchAnalysis.teamsStats.statBtts"),overallKey:"seasonBTTSPercentage_overall",homeKey:"seasonBTTSPercentage_home",awayKey:"seasonBTTSPercentage_away",formatType:"percentage"},{statName:i("matchAnalysis.teamsStats.statCs"),overallKey:"seasonCSPercentage_overall",homeKey:"seasonCSPercentage_home",awayKey:"seasonCSPercentage_away",formatType:"percentage"},{statName:i("matchAnalysis.teamsStats.statFts"),overallKey:"seasonFTSPercentage_overall",homeKey:"seasonFTSPercentage_home",awayKey:"seasonFTSPercentage_away",formatType:"percentage"},{statName:i("matchAnalysis.teamsStats.statXg"),overallKey:"xg_for_avg_overall",homeKey:"xg_for_avg_home",awayKey:"xg_for_avg_away",formatType:"double"},{statName:i("matchAnalysis.teamsStats.statXga"),overallKey:"xg_against_avg_overall",homeKey:"xg_against_avg_home",awayKey:"xg_against_avg_away",formatType:"double"}],o=[{statName:i("matchAnalysis.teamsStats.columnOverall"),formKey:"formRun_overall",ppgKey:"seasonPPG_overall"},{statName:i("matchAnalysis.teamsStats.columnHome"),formKey:"formRun_home",ppgKey:"seasonPPG_home"},{statName:i("matchAnalysis.teamsStats.columnAway"),formKey:"formRun_away",ppgKey:"seasonPPG_away"}],d=e=>{var a;const l=null==t?void 0:t.match,r=e?null==s?void 0:s.home:null==s?void 0:s.away;if(!l||!r)return null;const n=m.map(e=>Y(r.stats,e.statName,e.overallKey,e.homeKey,e.awayKey,e.formatType)),d=o.map(e=>J(r.stats,e.statName,e.formKey,e.ppgKey));return{name:e?l.home_name:l.away_name,league:(null==(a=null==t?void 0:t.league)?void 0:a.leagueName)||i("matchAnalysis.teamsStats.leagueNotSpecified"),recent:r.recent,countryFlag:r.flag_element||"/api/placeholder/24/16",logo:G(e?l.home_image:l.away_image),formPpg:d,stats:n,highlightColumn:e?"home":"away"}},c=d(!0),x=d(!1);return a.jsxs("div",{className:"flex flex-wrap",children:[a.jsx(Te,{team:c,isDarkMode:l}),a.jsx(Te,{team:x,isDarkMode:l})]})},Ke=()=>{const[t,s]=e.useState("FullTime"),{homeAwayTeamsStatsData:l}=e.useContext(w),{isDarkMode:n}=r(),i=null==l?void 0:l.home,m=null==l?void 0:l.away,o=R(l,"Goals/Match","seasonScoredAVG_home","seasonScoredAVG_away","double"),d=[{name:"Over 0.5",homeKey:"seasonOver05Percentage_home",awayKey:"seasonOver05Percentage_away",format:"percentage"},{name:"Over 1.5",homeKey:"seasonOver15Percentage_home",awayKey:"seasonOver15Percentage_away",format:"percentage"},{name:"Over 2.5",homeKey:"seasonOver25Percentage_home",awayKey:"seasonOver25Percentage_away",format:"percentage"},{name:"Over 3.5",homeKey:"seasonOver35Percentage_home",awayKey:"seasonOver35Percentage_away",format:"percentage"},{name:"Over 4.5",homeKey:"seasonOver45Percentage_home",awayKey:"seasonOver45Percentage_away",format:"percentage"},{name:"Over 5.5",homeKey:"seasonOver55Percentage_home",awayKey:"seasonOver55Percentage_away",format:"percentage"},{name:"Failed to Score",homeKey:"seasonFTSPercentage_home",awayKey:"seasonFTSPercentage_away",format:"percentage"}].map(e=>Z(l,e.name,e.homeKey,e.awayKey,e.format)),c=[{name:"Scored in 1H",homeKey:"seasonFTSPercentageHT_home",awayKey:"seasonFTSPercentageHT_away",format:"percentage"},{name:"Scored in 2H",homeKey:"fts_2hg_percentage_home",awayKey:"fts_2hg_percentage_away",format:"percentage"},{name:"Scored in Both Halves",homeKey:"scoredBothHalvesPercentage_home",awayKey:"scoredBothHalvesPercentage_away",format:"percentage"},{name:"Scored Average 1H",homeKey:"scoredAVGHT_home",awayKey:"scoredAVGHT_away",format:"number"},{name:"Scored Average 2H",homeKey:"scored_2hg_avg_home",awayKey:"scored_2hg_avg_away",format:"number"}].map(e=>Z(l,e.name,e.homeKey,e.awayKey,e.format)),x=o.teamAStat||0,h=o.teamBStat||0,g=(null==i?void 0:i.cleanName)||"Home Team",y=(null==m?void 0:m.cleanName)||"Away Team",u=Math.round((x-h
2)/(h||1)*100),b=u>0,p=(e,t)=>{const a=parseFloat(e);if("Failed to Score"===t)return a<25?"bg-[#0AB365]/80 text-white":a<40?"bg-[#0AB365]/50":a<55?"bg-[#F59E0B]/50":a<70?"bg-[#F43F5E]/40":"bg-[#F43F5E]/80 text-white";if("Scored Average 1H"===t||"Scored Average 2H"===t){const e=100*a;return e>=90?"bg-[#0AB365]/90 text-white":e>=75?"bg-[#0AB365]/70 text-white":e>=60?"bg-[#0AB365]/50":e>=50?"bg-[#0AB365]/30":e>=35?"bg-[#F59E0B]/50":e>=25?"bg-[#F43F5E]/40":"bg-[#F43F5E]/80 text-white"}return a>=90?"bg-[#0AB365]/90 text-white":a>=75?"bg-[#0AB365]/70 text-white":a>=60?"bg-[#0AB365]/50":a>=50?"bg-[#0AB365]/30":a>=35?"bg-[#F59E0B]/50":a>=25?"bg-[#F43F5E]/40":"bg-[#F43F5E]/80 text-white"};return a.jsxs("div",{children:[a.jsxs("div",{className:"p-3 border-b "+(n?"border-gray-600":"border-gray-200"),children:[a.jsxs("div",{className:"mb-2 text-xs",children:[a.jsxs("span",{className:"font-medium "+(n?"text-gray-200":"text-gray-800"),children:[b?g:y," is "]}),a.jsxs("span",{className:"font-semibold "+(b?"text-[#0AB365]":"text-[#C91C3C]"),children:[b?"+":"",Math.abs(u),"%"]}),a.jsx("span",{className:"font-medium "+(n?"text-gray-200":"text-gray-800"),children:" better in terms of Goals Scored"})]}),a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsxs("div",{className:"flex items-center space-x-1 w-2/5",children:[(null==i?void 0:i.image)?a.jsx("img",{src:i.image,alt:`${g} logo`,className:"w-6 h-6 object-contain",loading:"lazy",decoding:"async"}):a.jsx("div",{className:`w-6 h-6 rounded-full ${(null==i?void 0:i.color)||"bg-[#0AB365]"} flex items-center justify-center`,children:a.jsx("span",{className:"text-white font-bold text-xs",children:g.charAt(0)})}),a.jsx("span",{className:"text-xs font-medium "+(n?"text-gray-300":"text-gray-700"),children:x.toFixed(2)})]}),a.jsx("div",{className:"text-center w-1/5",children:a.jsx("span",{className:"text-xs font-medium",children:"Goals/Match"})}),a.jsxs("div",{className:"flex items-center justify-end space-x-1 w-2/5",children:[a.jsx("span",{className:"text-xs font-medium "+(n?"text-gray-300":"text-gray-700"),children:h.toFixed(2)}),(null==m?void 0:m.image)?a.jsx("img",{src:m.image,alt:`${y} logo`,className:"w-6 h-6 object-contain",loading:"lazy",decoding:"async"}):a.jsx("div",{className:`w-6 h-6 rounded-full ${(null==m?void 0:m.color)||"bg-yellow-600"} flex items-center justify-center`,children:a.jsx("span",{className:"text-white font-bold text-xs",children:y.charAt(0)})})]})]}),a.jsxs("div",{className:"relative h-2 rounded-full overflow-hidden "+(n?"bg-gray-700":"bg-gray-300"),children:[a.jsx("div",{className:"absolute left-0 h-full bg-[#0AB365]",style:{width:o.teamAStatWidth}}),a.jsx("div",{className:"absolute right-0 h-full bg-[#C91C3C]",style:{width:o.teamBStatWidth}})]}),a.jsxs("div",{className:"flex justify-between mt-1",children:[a.jsx("div",{className:"text-xs "+(n?"text-gray-300":"text-gray-700"),children:g}),a.jsx("div",{className:"text-xs "+(n?"text-gray-300":"text-gray-700"),children:y})]})]})]}),a.jsxs("div",{className:"flex border-b text-xs "+(n?"border-gray-600":"border-gray-200"),children:[a.jsx("button",{className:"flex-1 py-2 text-center "+("FullTime"===t?n?"bg-blue-900 text-blue-300 font-medium":"bg-blue-50 text-blue-600 font-medium":n?"text-gray-400":"text-gray-500"),onClick:()=>s("FullTime"),children:"Full-Time"}),a.jsx("button",{className:"flex-1 py-2 text-center "+("HalfTime"===t?n?"bg-blue-900 text-blue-300 font-medium":"bg-blue-50 text-blue-600 font-medium":n?"text-gray-400":"text-gray-500"),onClick:()=>s("HalfTime"),children:"First Half / 2nd Half"})]}),"FullTime"===t&&a.jsxs("div",{children:[a.jsxs("div",{className:"grid grid-cols-3 p-1 border-b text-xs "+(n?"bg-gray-700 border-gray-600":"bg-gray-100 border-gray-200"),children:[a.jsx("div",{className:"font-medium text-left pl-2 "+(n?"text-gray-200":"text-gray-800"),children:"Scored Per Game"}),a.jsx("div",{className:"text-center font-medium "+(n?"text-gray-200":"text-gray-800"),children:g}),a.jsx("div",{className:"text-center font-medium "+(n?"text-gray-200":"text-gray-800"),children:y})]}),d.map((e,t)=>a.jsxs("div",{className:"grid grid-cols-3 border-b text-xs "+(n?"border-gray-700":"border-gray-100"),children:[a.jsx("div",{className:"pl-2 text-left flex items-center min-h-[28px] "+(n?"text-gray-300":"text-gray-800"),children:e.statName}),a.jsx("div",{className:`text-center ${p(e.teamAStat,e.statName)} rounded-sm mx-0.5 flex items-center justify-center min-h-[28px]`,children:e.teamAStat}),a.jsx("div",{className:`text-center ${p(e.teamBStat,e.statName)} rounded-sm mx-0.5 flex items-center justify-center min-h-[28px]`,children:e.teamBStat})]},t))]}),"HalfTime"===t&&a.jsxs("div",{children:[a.jsxs("div",{className:"grid grid-cols-3 p-1 border-b text-xs "+(n?"bg-gray-700 border-gray-600":"bg-gray-100 border-gray-200"),children:[a.jsx("div",{className:"font-medium text-left pl-2 "+(n?"text-gray-200":"text-gray-800"),children:"Scored 1st/2nd Half"}),a.jsx("div",{className:"text-center font-medium "+(n?"text-gray-200":"text-gray-800"),children:g}),a.jsx("div",{className:"text-center font-medium "+(n?"text-gray-200":"text-gray-800"),children:y})]}),c.map((e,t)=>a.jsxs("div",{className:"grid grid-cols-3 border-b text-xs "+(n?"border-gray-700":"border-gray-100"),children:[a.jsx("div",{className:"pl-2 text-left flex items-center min-h-[28px] "+(n?"text-gray-300":"text-gray-800"),children:e.statName}),a.jsx("div",{className:`text-center ${p(e.teamAStat,e.statName)} rounded-sm mx-0.5 flex items-center justify-center min-h-[28px]`,children:e.teamAStat}),a.jsx("div",{className:`text-center ${p(e.teamBStat,e.statName)} rounded-sm mx-0.5 flex items-center justify-center min-h-[28px]`,children:e.teamBStat})]},t))]}),a.jsxs("div",{className:"p-2 text-xs italic "+(n?"text-gray-400 bg-gray-800":"text-gray-500 bg-gray-50"),children:["* Stats from ",g,"'s home scoring record and ",y,"'s data at away fixtures."]})]})},Me=()=>{const[t,s]=e.useState("FullTime"),{homeAwayTeamsStatsData:l}=e.useContext(w),{isDarkMode:n}=r(),i=null==l?void 0:l.home,m=null==l?void 0:l.away,o=R(l,"Goals Conceded/Match","seasonConcededAVG_home","seasonConcededAVG_away","double"),d=[{name:"Over 0.5",homeKey:"seasonConcededOver05Percentage_home",awayKey:"seasonConcededOver05Percentage_away",format:"percentage"},{name:"Over 1.5",homeKey:"seasonConcededOver15Percentage_home",awayKey:"seasonConcededOver15Percentage_away",format:"percentage"},{name:"Over 2.5",homeKey:"seasonConcededOver25Percentage_home",awayKey:"seasonConcededOver25Percentage_away",format:"percentage"},{name:"Over 3.5",homeKey:"seasonConcededOver35Percentage_home",awayKey:"seasonConcededOver35Percentage_away",format:"percentage"},{name:"Clean Sheets",homeKey:"seasonCSPercentage_home",awayKey:"seasonCSPercentage_away",format:"percentage"}].map(e=>Z(l,e.name,e.homeKey,e.awayKey,e.format)),c=[{name:"1H Clean Sheet",homeKey:"seasonCSPercentageHT_home",awayKey:"seasonCSPercentageHT_away",format:"percentage"},{name:"2H Clean Sheet",homeKey:"cs_2hg_percentage_home",awayKey:"cs_2hg_percentage_away",format:"percentage"},{name:"Conceded Average 1H",homeKey:"concededAVGHT_home",awayKey:"concededAVGHT_away",format:"number"},{name:"Conceded Average 2H",homeKey:"conceded_2hg_avg_home",awayKey:"conceded_2hg_avg_away",format:"number"}].map(e=>Z(l,e.name,e.homeKey,e.awayKey,e.format)),x=o.teamAStat||1.08,h=o.teamBStat||1.33,g=(null==i?void 0:i.cleanName)||"Home Team",y=(null==m?void 0:m.cleanName)||"Away Team",u=Math.round((h-x)/x*100),b=u>0,p=(e,t)=>{const a=parseFloat(e);
2if("Clean Sheets"===t||"1H Clean Sheet"===t||"2H Clean Sheet"===t)return a>=60?"bg-[#0AB365]/90 text-white":a>=45?"bg-[#0AB365]/70 text-white":a>=30?"bg-[#0AB365]/50":a>=20?"bg-[#0AB365]/30":a>=15?"bg-[#F59E0B]/50":a>=10?"bg-[#F43F5E]/40":"bg-[#F43F5E]/80 text-white";if(t.includes("Average")){const e=100*a;return e<=20?"bg-[#0AB365]/90 text-white":e<=35?"bg-[#0AB365]/70 text-white":e<=50?"bg-[#0AB365]/50":e<=65?"bg-[#0AB365]/30":e<=80?"bg-[#F59E0B]/50":e<=95?"bg-[#F43F5E]/40":"bg-[#F43F5E]/80 text-white"}return a<=15?"bg-[#0AB365]/90 text-white":a<=30?"bg-[#0AB365]/70 text-white":a<=45?"bg-[#0AB365]/50":a<=60?"bg-[#0AB365]/30":a<=75?"bg-[#F59E0B]/50":a<=90?"bg-[#F43F5E]/40":"bg-[#F43F5E]/80 text-white"};return a.jsxs("div",{children:[a.jsxs("div",{className:"p-3 border-b "+(n?"border-gray-600":"border-gray-200"),children:[a.jsxs("div",{className:"mb-2 text-xs",children:[a.jsxs("span",{className:"font-medium "+(n?"text-gray-200":"text-gray-800"),children:[b?g:y," is "]}),a.jsxs("span",{className:"font-semibold "+(b?"text-[#0AB365]":"text-[#C91C3C]"),children:[b?"+":"",Math.abs(u),"%"]}),a.jsx("span",{className:"font-medium "+(n?"text-gray-200":"text-gray-800"),children:" better in terms of Goals Conceded"})]}),a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsxs("div",{className:"flex items-center space-x-1 w-2/5",children:[(null==i?void 0:i.image)?a.jsx("img",{src:i.image,alt:`${g} logo`,className:"w-6 h-6 object-contain"}):a.jsx("div",{className:`w-6 h-6 rounded-full ${(null==i?void 0:i.color)||"bg-blue-800"} flex items-center justify-center`,children:a.jsx("span",{className:"text-white font-bold text-xs",children:g.charAt(0)})}),a.jsx("span",{className:"text-xs font-medium "+(n?"text-gray-300":"text-gray-700"),children:x.toFixed(2)})]}),a.jsx("div",{className:"text-center w-1/5",children:a.jsx("span",{className:"text-xs font-medium",children:"Conceded/Match"})}),a.jsxs("div",{className:"flex items-center justify-end space-x-1 w-2/5",children:[a.jsx("span",{className:"text-xs font-medium "+(n?"text-gray-300":"text-gray-700"),children:h.toFixed(2)}),(null==m?void 0:m.image)?a.jsx("img",{src:m.image,alt:`${y} logo`,className:"w-6 h-6 object-contain"}):a.jsx("div",{className:`w-6 h-6 rounded-full ${(null==m?void 0:m.color)||"bg-black"} flex items-center justify-center`,children:a.jsx("span",{className:"text-white font-bold text-xs",children:y.charAt(0)})})]})]}),a.jsxs("div",{className:"relative h-2 rounded-full overflow-hidden "+(n?"bg-gray-700":"bg-gray-300"),children:[a.jsx("div",{className:"absolute left-0 h-full bg-[#0AB365]",style:{width:o.teamAStatWidth}}),a.jsx("div",{className:"absolute right-0 h-full bg-[#C91C3C]",style:{width:o.teamBStatWidth}})]}),a.jsxs("div",{className:"flex justify-between mt-1",children:[a.jsx("div",{className:"text-xs "+(n?"text-gray-300":"text-gray-700"),children:g}),a.jsx("div",{className:"text-xs "+(n?"text-gray-300":"text-gray-700"),children:y})]})]})]}),a.jsxs("div",{className:"flex border-b text-xs "+(n?"border-gray-600":"border-gray-200"),children:[a.jsx("button",{className:"flex-1 py-2 text-center "+("FullTime"===t?n?"bg-blue-900 text-blue-300 font-medium":"bg-blue-50 text-blue-600 font-medium":n?"text-gray-400":"text-gray-500"),onClick:()=>s("FullTime"),children:"Full-Time"}),a.jsx("button",{className:"flex-1 py-2 text-center "+("HalfTime"===t?n?"bg-blue-900 text-blue-300 font-medium":"bg-blue-50 text-blue-600 font-medium":n?"text-gray-400":"text-gray-500"),onClick:()=>s("HalfTime"),children:"First Half / 2nd Half"})]}),"FullTime"===t&&a.jsxs("div",{children:[a.jsxs("div",{className:"grid grid-cols-3 p-1 border-b text-xs "+(n?"bg-gray-700 border-gray-600":"bg-gray-100 border-gray-200"),children:[a.jsx("div",{className:"font-medium text-left pl-2 "+(n?"text-gray-200":"text-gray-800"),children:"Conceded Per Game"}),a.jsx("div",{className:"text-center font-medium "+(n?"text-gray-200":"text-gray-800"),children:g}),a.jsx("div",{className:"text-center font-medium "+(n?"text-gray-200":"text-gray-800"),children:y})]}),d.map((e,t)=>a.jsxs("div",{className:"grid grid-cols-3 border-b text-xs "+(n?"border-gray-700":"border-gray-100"),children:[a.jsx("div",{className:"pl-2 text-left flex items-center min-h-[28px] "+(n?"text-gray-300":"text-gray-800"),children:e.statName}),a.jsx("div",{className:`text-center ${p(e.teamAStat,e.statName)} rounded-sm mx-0.5 flex items-center justify-center min-h-[28px]`,children:e.teamAStat}),a.jsx("div",{className:`text-center ${p(e.teamBStat,e.statName)} rounded-sm mx-0.5 flex items-center justify-center min-h-[28px]`,children:e.teamBStat})]},t))]}),"HalfTime"===t&&a.jsxs("div",{children:[a.jsxs("div",{className:"grid grid-cols-3 p-1 border-b text-xs "+(n?"bg-gray-700 border-gray-600":"bg-gray-100 border-gray-200"),children:[a.jsx("div",{className:"font-medium text-left pl-2 "+(n?"text-gray-200":"text-gray-800"),children:"Conceded 1st/2nd Half"}),a.jsx("div",{className:"text-center font-medium "+(n?"text-gray-200":"text-gray-800"),children:g}),a.jsx("div",{className:"text-center font-medium "+(n?"text-gray-200":"text-gray-800"),children:y})]}),c.map((e,t)=>a.jsxs("div",{className:"grid grid-cols-3 border-b text-xs "+(n?"border-gray-700":"border-gray-100"),children:[a.jsx("div",{className:"pl-2 text-left flex items-center min-h-[28px] "+(n?"text-gray-300":"text-gray-800"),children:e.statName}),a.jsx("div",{className:`text-center ${p(e.teamAStat,e.statName)} rounded-sm mx-0.5 flex items-center justify-center min-h-[28px]`,children:e.teamAStat}),a.jsx("div",{className:`text-center ${p(e.teamBStat,e.statName)} rounded-sm mx-0.5 flex items-center justify-center min-h-[28px]`,children:e.teamBStat})]},t))]}),a.jsxs("div",{className:"p-2 text-xs italic "+(n?"text-gray-400 bg-gray-800":"text-gray-500 bg-gray-50"),children:["* Stats from ",g,"'s home conceding record and ",y,"'s data at away fixtures."]})]})},Fe=()=>{const[t,s]=e.useState("scored"),{isDarkMode:l}
2=r(),{t:n}=ne();return a.jsxs("div",{className:"mb-3 sm:mb-4 rounded-lg overflow-hidden shadow-sm mt-4 "+(l?"bg-gray-800":"bg-white"),children:[a.jsxs("div",{className:"grid grid-cols-2 rounded-lg overflow-hidden "+(l?"bg-gray-700":"bg-gray-200"),children:[a.jsx("button",{className:"py-1.5 sm:py-2 text-center text-xs sm:text-sm "+("scored"===t?l?"bg-gray-900 text-white":"bg-gray-700 text-white":l?"text-gray-300 hover:bg-gray-600":"text-gray-700 hover:bg-gray-300"),onClick:()=>s("scored"),children:n("matchAnalysis.goalsTab.goalsScored")}),a.jsx("button",{className:"py-1.5 sm:py-2 text-center text-xs sm:text-sm "+("conceded"===t?l?"bg-gray-900 text-white":"bg-gray-700 text-white":l?"text-gray-300 hover:bg-gray-600":"text-gray-700 hover:bg-gray-300"),onClick:()=>s("conceded"),children:n("matchAnalysis.goalsTab.goalsConceded")})]}),a.jsx("div",{className:l?"bg-gray-800":"bg-white",children:"scored"===t?a.jsx(Ke,{}):a.jsx(Me,{})})]})},$e=()=>{const{t:t}=ne(),[s,l]=e.useState("AISummary");return a.jsxs("div",{className:"flex flex-col w-full",children:[a.jsxs("div",{className:"grid grid-cols-3 mb-2 mt-4 bg-gray-200 rounded-lg overflow-hidden mx-4",children:[a.jsxs("button",{className:"py-2 text-center text-xs sm:text-sm "+("AISummary"===s?"bg-gray-700 text-white":"text-gray-700 hover:bg-gray-300"),onClick:()=>l("AISummary"),children:[a.jsx("span",{className:"hidden xs:inline",children:t("prematchView.tabs.aiSummary")}),a.jsx("span",{className:"xs:hidden",children:t("prematchView.tabs.aiSummary")})]}),a.jsxs("button",{className:"py-2 text-center text-xs sm:text-sm "+("Performance"===s?"bg-gray-700 text-white":"text-gray-700 hover:bg-gray-300"),onClick:()=>l("Performance"),children:[a.jsx("span",{className:"hidden sm:inline",children:t("prematchView.tabs.performance")}),a.jsx("span",{className:"hidden xs:inline sm:hidden",children:t("prematchView.tabs.performance")}),a.jsx("span",{className:"xs:hidden sm:hidden",children:t("prematchView.tabs.performance")})]}),a.jsxs("button",{className:"py-2 text-center text-xs sm:text-sm "+("PastMatches"===s?"bg-gray-700 text-white":"text-gray-700 hover:bg-gray-300"),onClick:()=>l("PastMatches"),children:[a.jsx("span",{className:"hidden xs:inline",children:t("prematchView.tabs.formGuide")}),a.jsx("span",{className:"xs:hidden",children:t("prematchView.tabs.formGuide")})]})]}),"Performance"===s&&a.jsx(Ce,{}),"PastMatches"===s&&a.jsx(ke,{}),"AISummary"===s&&a.jsx(Se,{}),a.jsx(Pe,{}),a.jsx(De,{}),a.jsx(Fe,{})]})},Be=s.lazy(()=>ie(()=>import("./MatchFactsView-CnWrtRiB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),Ge=()=>{const{isDarkMode:t}=r(),{t:l}=ne(),{matchDetailsData:m}=e.useContext(n),{matchExtraStatsData:o}=e.useContext(i),d=null==m?void 0:m.match,c=!!d&&ee(d),x=Array.isArray(null==d?void 0:d.events)&&d.events.length>0,h=Array.isArray(null==o?void 0:o.events)&&o.events.length>0,g=x?d.events:h?o.events:null,[y,u]=e.useState("timeline");return c?a.jsx("div",{className:"w-full px-4 py-4 my-1 rounded-lg shadow "+(t?"bg-gray-800":"bg-gray-100"),children:a.jsx(ue,{events:g})}):a.jsxs("div",{className:"w-full px-4 py-4 my-1 rounded-lg shadow "+(t?"bg-gray-800":"bg-gray-100"),children:[a.jsxs("div",{className:"grid grid-cols-2 mb-4 rounded-lg overflow-hidden "+(t?"bg-gray-700":"bg-gray-200"),children:[a.jsx("button",{onClick:()=>u("timeline"),className:"py-2 text-center text-xs sm:text-sm "+("timeline"===y?t?"bg-gray-900 text-white":"bg-gray-700 text-white":t?"text-gray-300 hover:bg-gray-600":"text-gray-700 hover:bg-gray-300"),children:l("matchEventsAndFacts.tabs.events")}),a.jsx("button",{onClick:()=>u("stats"),className:"py-2 text-center text-xs sm:text-sm "+("stats"===y?t?"bg-gray-900 text-white":"bg-gray-700 text-white":t?"text-gray-300 hover:bg-gray-600":"text-gray-700 hover:bg-gray-300"),children:l("matchEventsAndFacts.tabs.facts")})]}),"timeline"===y&&a.jsx(ue,{events:g}),"stats"===y&&a.jsx(s.Suspense,{fallback:null,children:a.jsx(Be,{})}),a.jsx("style",{children:"\n @keyframes grow {\n from { width: 0; }\n to { width: 100%; }\n }\n "})]})},Ee=()=>{const{t:t}=ne(),{matchDetailsData:s}=e.useContext(n),{matchExtraStatsData:l}=e.useContext(i),r=null==s?void 0:s.match,m=!!r&&U(r),o=!!r&&ee(r),d=o&&Array.isArray(null==r?void 0:r.events)&&r.events.length>0,c=Array.isArray(null==l?void 0:l.events)&&l.events.length>
20||!(!((null==l?void 0:l.team_a_goal_details)&&(null==l?void 0:l.team_b_goal_details)&&(null==l?void 0:l.team_a_card_details)&&(null==l?void 0:l.team_b_card_details)&&(null==l?void 0:l.bench))||null==(null==l?void 0:l.team_a_possession)&&null==(null==l?void 0:l.team_a_shots)),x=o&&d||m&&c,[h,g]=e.useState(()=>o||m&&c?"Events":"Prematch");return e.useEffect(()=>{o&&g("Events")},[o]),e.useEffect(()=>{!o&&m&&c&&g("Events")},[o,m,c]),a.jsxs("div",{className:"flex flex-col w-full",children:[a.jsxs("div",{className:"flex border-b border-gray-300 mx-4 mt-0 mb-6",children:[a.jsx("button",{className:"flex-1 py-3 text-center text-sm font-medium border-b-2 transition-colors duration-200 "+("Prematch"===h?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),onClick:()=>g("Prematch"),children:t("analysisView.tabs.prematch")}),a.jsx("button",{className:"flex-1 py-3 text-center text-sm font-medium border-b-2 transition-colors duration-200 "+("Standings"===h?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),onClick:()=>g("Standings"),children:t("analysisView.tabs.standings","Standings")}),x&&a.jsx("button",{className:"flex-1 py-3 text-center text-sm font-medium border-b-2 transition-colors duration-200 "+("Events"===h?o?"border-red-500 text-red-600":"border-blue-500 text-blue-600":o?"border-transparent text-red-400 hover:text-red-600 hover:border-red-300":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),onClick:()=>g("Events"),children:o?a.jsxs("span",{className:"flex items-center justify-center gap-1",children:[a.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-red-500 animate-pulse"}),t("analysisView.tabs.live","Live")]}):t("analysisView.tabs.postmatch")})]}),"Prematch"===h&&a.jsx($e,{}),"Standings"===h&&a.jsx(N,{}),"Events"===h&&a.jsx(Ge,{})]})},He=()=>{var t;const{matchDetailsData:s}=e.useContext(n),l=null==(t=null==s?void 0:s.match)?void 0:t.id;return a.jsx(_,{context:"match",entityId:l})},Ie=e=>{var t,a,s;const l=null==(t=null==e?void 0:e.match)?void 0:t.homeID,r=null==(a=null==e?void 0:e.match)?void 0:a.awayID;return Boolean((null==(s=null==e?void 0:e.league)?void 0:s.id)&&l&&-1!==l&&r&&-1!==r)},Ve=()=>{var s,o,d,c;const{t:x}=ne(),{matchId:h}=l(),{isDarkMode:g}=r(),{setLeagueTeamsStatsData:y}=e.useContext(S),{matchDetailsData:u,setMatchDetailsData:b}=e.useContext(n),{setHomeAwayTeamsStatsData:p}=e.useContext(w),{setMatchExtraStatsData:v}=e.useContext(i),{setLeaguePlayersData:f}=e.useContext(A),{setLeagueTablesData:j}=e.useContext(C),{setMatchPlayersData:N}=e.useContext(m),[_,$]=e.useState("Analysis"),B=t(),[G,E]=e.useState(!0),[H,I]=e.useState(null),V=e.useRef(!1);e.useEffect(()=>{if(V.current)return;let e=u;if(!e){const t=te();if(t)b(t),e=t;else{if(!h)return b(null),I(x("errors.match.leagueMissing")),void E(!1);e={match:{id:Number(h)},league:{},isPremiumUnlocked:!1}}}(async()=>{var t;if(V.current=!0,E(!0),I(null),Ie(e)||(e=await(async e=>{var t,a,s,l,r,n,i;if(Ie(e))return e;const m=null==(t=null==e?void 0:e.match)?void 0:t.id;if(!m||-1===m)return e;let o=null,d=null;const c=se(m);if(c&&(o=c),!o){const t=le(m,null==(a=null==e?void 0:e.match)?void 0:a.date_unix);t&&(o=t.match,d=t.league)}if(!o)try{const e=await F(m);e&&(o=e)}catch(h){}if(!o)return e;const x=d??((null==(s=null==e?void 0:e.league)?void 0:s.id)?e.league:{id:o.competition_id||null,leagueName:o.league_name||(null==(l=null==e?void 0:e.league)?void 0:l.leagueName)||"",leagueCountry:(null==(r=null==e?void 0:e.league)?void 0:r.leagueCountry)||"",leagueLogo:(null==(n=null==e?void 0:e.league)?void 0:n.leagueLogo)||null,season:(null==(i=null==e?void 0:e.league)?void 0:i.season)||""});return{...e,match:{...null==e?void 0:e.match,...o},league:x}})(e),Ie(e)&&(b(e),ae(e))),!Ie(e))return I(x("errors.match.missingData")),void E(!1);const a=null==e?void 0:e.league,s=null==e?void 0:e.match.homeID,l=null==e?void 0:e.match.awayID,r=null==(t=null==e?void 0:e.match)?void 0:t.id;try{const t=await D(r,a.id);if(t.leagueTeamsStats){y(t.leagueTeamsStats);const e=K(t.leagueTeamsStats,s,l);p(e)}if(t.leagueTables&&j(t.leagueTables),t.leaguePlayersStats){f(t.leaguePlayersStats);const a=M(e,t.leaguePlayersStats);N(a)}t.matchDetails&&v(t.matchDetails)}catch(n){return I(x("errors.match.leagueLoadFailed")),void E(!1)}E(!1)})()},[h,u,y,p,v,f,j,N,b,x]);const O=()=>{B(-1)};if(G)return a.jsx("div",{className:"flex flex-col items-center justify-center w-full h-screen "+(g?"bg-[#0a1628]":"bg-gray-100"),children:a.jsxs("div",{className:"p-4 rounded-lg shadow-md text-center "+(g?"bg-[#0f1e36]":"bg-white"),children:[a.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-blue-500 border-t-transparent roun
2ded-full mx-auto mb-4"}),a.jsx("p",{className:g?"text-gray-300":"text-gray-700",children:x("matchAnalysis.loading")})]})});if(H)return a.jsx("div",{className:"flex flex-col items-center justify-center w-full h-screen "+(g?"bg-[#0a1628]":"bg-gray-100"),children:a.jsxs("div",{className:"p-4 rounded-lg shadow-md text-center "+(g?"bg-[#0f1e36]":"bg-white"),children:[a.jsx("div",{className:"text-red-500 mb-2",children:"â ï¸"}),a.jsx("p",{className:g?"text-gray-300":"text-gray-700",children:H}),a.jsx("button",{className:"mt-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",onClick:O,children:x("matchAnalysis.goBack")})]})});const L=(null==u?void 0:u.match)?`${u.match.home_name} vs ${u.match.away_name} - Match Analysis`:"Match Analysis",z=(null==u?void 0:u.match)?`AI-powered analysis and predictions for ${u.match.home_name} vs ${u.match.away_name}. View team stats, player lineups, and expert insights.`:"View detailed match analysis and AI-powered predictions",W=(null==u?void 0:u.match)?k({homeTeam:u.match.home_name,awayTeam:u.match.away_name,startTime:u.match.startTime,venue:u.match.venue||(null==(s=u.league)?void 0:s.name)}):null,U=(null==u?void 0:u.match)?P([{name:"Home",url:"https://sokapal.ai"},{name:"Matches",url:"https://sokapal.ai/all-matches"},{name:L,url:`https://sokapal.ai/match/${h}`}]):null;return a.jsxs("div",{className:"flex flex-col items-center w-full min-h-screen "+(g?"bg-[#0a1628]":"bg-gray-100"),children:[a.jsx(T,{title:L,description:z,keywords:`${(null==(o=null==u?void 0:u.match)?void 0:o.homeTeam)||""}, ${(null==(d=null==u?void 0:u.match)?void 0:d.awayTeam)||""}, match prediction, soccer analysis, team stats`,url:`https://sokapal.ai/match/${h}`,structuredData:U?{"@context":"https://schema.org","@graph":[W,U]}:W}),a.jsxs("div",{className:"w-full rounded-lg shadow-md relative "+(g?"bg-[#0f1e36]":"bg-white"),children:[a.jsx("div",{className:"absolute top-2 left-2 z-50",children:a.jsx("button",{className:"p-2 rounded-full shadow transition-colors "+(g?"bg-[#1e3a5f] bg-opacity-70 hover:bg-opacity-100":"bg-white bg-opacity-70 hover:bg-opacity-100"),onClick:O,"aria-label":"Go back",children:a.jsx(xe,{className:"w-5 h-5 "+(g?"text-gray-300":"text-gray-700")})})}),a.jsx(pe,{}),"Analysis"===_&&a.jsx(Ee,{}),"SokaChat"===_&&a.jsx(be,{contextType:"MATCH",contextId:null==(c=null==u?void 0:u.match)?void 0:c.id,isEmbedded:!0}),"Lineup"===_&&a.jsx(_e,{}),"Media"===_&&a.jsx(He,{}),a.jsxs("div",{className:"grid grid-cols-4 rounded-t-lg overflow-hidden fixed bottom-0 left-1/2 -translate-x-1/2 w-full max-w-7xl z-20 "+(g?"bg-[#1e3a5f]":"bg-gray-800"),children:[a.jsx("button",{className:"py-3 text-center text-xs "+("Analysis"===_?g?"bg-[#2d4a6f] text-white":"bg-gray-700 text-white":g?"text-gray-300 hover:bg-[#2d4a6f]":"text-gray-300 hover:bg-gray-700"),onClick:()=>$("Analysis"),children:x("matchAnalysis.tabs.analysis")}),a.jsx("button",{className:"py-3 text-center text-xs "+("SokaChat"===_?g?"bg-[#2d4a6f] text-white":"bg-gray-700 text-white":g?"text-gray-300 hover:bg-[#2d4a6f]":"text-gray-300 hover:bg-gray-700"),onClick:()=>$("SokaChat"),children:x("matchAnalysis.tabs.sokaChat")}),a.jsx("button",{className:"py-3 text-center text-xs "+("Lineup"===_?g?"bg-[#2d4a6f] text-white":"bg-gray-700 text-white":g?"text-gray-300 hover:bg-[#2d4a6f]":"text-gray-300 hover:bg-gray-700"),onClick:()=>$("Lineup"),children:x("matchAnalysis.tabs.lineup")}),a.jsx("button",{className:"py-3 text-center text-xs "+("Media"===_?g?"bg-[#2d4a6f] text-white":"bg-gray-700 text-white":g?"text-gray-300 hover:bg-[#2d4a6f]":"text-gray-300 hover:bg-gray-700"),onClick:()=>$("Media"),children:x("matchAnalysis.tabs.media","Media")})]}),a.jsx("div",{className:"pb-16"})]})]})};export{Ve as default};
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.