import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$ as t,A as n,B as r,F as i,K as a,N as o,Q as s,X as c,_ as l,f as u,g as d,h as f,m as p,n as m,p as h,s as g,x as _}from"./vendor-vue-D9nMs6_1.js";import{i as v,r as y,t as b}from"./backendApi-CRLUmnjv.js";import{n as x,t as S}from"./renderReady-m0ZpQ02H.js";import{i as C,o as w}from"./placeholderResolver-DrfuyaOo.js";import{a as T,n as E}from"./styleDecoder-BtKxnsm0.js";import{t as D}from"./ChampionInfo-BhONFT4o.js";var O={class:`flex flex-col w-full h-full items-between justify-center gap-12`},k={class:`flex flex-row font-bold w-full justify-between items-center h-32 px-8`},A={class:`text-white mr-5 uppercase drop-shadow-lg leading-none`,style:{fontSize:`5em`,textShadow:`0 2px 8px #000, 0 0px 2px #000`,fontFamily:`Roboto Flex, Arial, Helvetica, sans-serif`,maxWidth:`100%`,width:`fit-content`,overflow:`visible`,whiteSpace:`nowrap`}},j=_({__name:`PlayerstatFullScreen`,props:{gameId:{},playerIndex:{},componentSettings:{}},setup(e){let _=a(null),j=y(),M=a(``),N=a(`blue`),{style:P}=x(`ChampionStats`),F=g(),{t:I,te:L}=m({useScope:`global`}),R=e,z=h(()=>{if(R.gameId!==void 0)return R.gameId;let e=F.params.gameId;if(typeof e==`string`)return parseInt(e);let t=F.query.gameId;if(typeof t==`string`)return parseInt(t)}),B=h(()=>{if(R.playerIndex!==void 0)return R.playerIndex;let e=F.params.playerIndex;if(typeof e==`string`)return parseInt(e);let t=F.query.playerIndex;if(typeof t==`string`)return parseInt(t)}),V=h(()=>{let e=R.componentSettings?.stats??(typeof F.query.stats==`string`?F.query.stats:void 0);return e?.trim()?new Set(e.split(`,`).map(e=>e.trim())):null}),H=h(()=>_.value?V.value?{..._.value,infoRows:_.value.infoRows.filter(e=>V.value.has(e.key))}:{..._.value,infoRows:_.value.infoRows.slice(0,5)}:null),U=h(()=>!P.value||P.value.container.useCustomBackground),W=h(()=>{if(!H.value||!P.value)return``;let e=C({nameWithTag:H.value.nameWithTag,displayName:H.value.displayName,champion:H.value.champion,team:H.value.team});return w(P.value.championInfoContainer.nameTemplate??`{{playerName}}`,e)}),G=h(()=>{if(!H.value||!P.value)return``;let e=C({nameWithTag:H.value.nameWithTag,displayName:H.value.displayName,champion:H.value.champion,team:H.value.team});return w(P.value.championInfoContainer.subHeadingTemplate??`{{championName}}`,e)});function K(e){let t=`postgame.playerStats.labels.${e}`;return L(t)?I(t):e.replace(/_/g,` `).toUpperCase()}async function q(){let e;if(j.mocking)e=`/postgame/player_stats/mock`;else{if(z.value===void 0||B.value===void 0)return console.warn(`No gameId or playerIndex provided`),null;e=`/postgame/player_stats/${z.value}/${B.value}`}return v.get(e).then(e=>e.data?e.data:null).catch(e=>(console.error(`Error fetching player data:`,e),null))}return n(async()=>{_.value=await q(),_.value&&await S()}),r(()=>j.mocking,async()=>{_.value=await q()}),r(()=>j.statsVersion,async()=>{_.value=await q()}),(e,n)=>c(P)&&H.value?(o(),l(`div`,{key:0,style:s([{background:U.value===!1?`radial-gradient(circle at 30% 40%,${M.value} 40%, ${N.value} 80% )`:c(E)(c(P).container.background,H.value.team).background,...c(T)(c(P).container.layoutStyle)},{height:`100vh`,width:`100vw`,overflow:`hidden`}]),class:`grid grid-cols-2`},[p(`div`,{style:s({...c(T)(c(P).championInfoContainer.layoutStyle),width:`100%`,height:`100%`}),class:`flex items-center justify-center`},[H.value&&H.value.champion?(o(),f(D,{key:0,"custom-background":c(P).container.background,"onUpdate:customBackground":n[0]||=e=>c(P).container.background=e,"use-custom-background":U.value,"onUpdate:useCustomBackground":n[1]||=e=>U.value=e,style:s(c(P).championInfoContainer),"onUpdate:style":n[2]||=e=>c(P).championInfoContainer=e,"second-color":N.value,"onUpdate:secondColor":n[3]||=e=>N.value=e,"bg-color":M.value,"onUpdate:bgColor":n[4]||=e=>M.value=e,team:H.value.team,"champion-image-src":c(b).getCacheUrl(H.value.champion.splashCenteredImg),"player-name":W.value,"champion-name":G.value},null,8,[`custom-background`,`use-custom-background`,`style`,`second-color`,`bg-color`,`team`,`champion-image-src`,`player-name`,`champion-name`])):d(``,!0)],4),p(`div`,O,[(o(!0),l(u,null,i(H.value.infoRows,(e,r)=>(o(),l(`div`,{key:r,class:`w-full h-auto`},[p(`div`,k,[p(`p`,{class:`uppercase text-3xl drop-shadow-lg leading-none whitespace-nowrap`,style:s([{"font-family":`'Roboto Flex', Arial, Helvetica, sans-serif`},{color:`white`,textShadow:`0 2px 8px #000, 0 0px 2px #000`}])},t(K(e.key)),1),p(`p`,A,t(e.value),1)]),n[5]||=p(`div`,{class:`bg-white/30 w-full h-1`},null,-1)]))),128))])],4)):d(``,!0)}}),M=e({default:()=>N}),N=j;export{M as n,N as t};