function e(e){let n={};return e.season&&(n.seasonName=e.season.seasonName||``,n.seasonId=e.season.seasonId),e.matchDate&&t(n,new Date(e.matchDate)),e.matchCount!==void 0&&(n.matchCount=e.matchCount),n}function t(e,t){e.matchDay=t.toLocaleDateString(void 0,{month:`long`,day:`numeric`,year:`numeric`}),e.matchDate=t.toLocaleDateString(void 0,{month:`long`,day:`numeric`,year:`numeric`}),e.matchDateShort=t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),e.dayOfWeek=t.toLocaleDateString(void 0,{weekday:`long`}),e.time24h=t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,hour12:!1}),e.time12h=t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,hour12:!0}),e.firstMatchTime24h=e.time24h,e.firstMatchTime12h=e.time12h;let n=new Date(t.getTime()-9e5);e.firstMatchTime24h15minBefore=n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,hour12:!1}),e.firstMatchTime12h15minBefore=n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,hour12:!0});let r=new Date(t.getTime()-18e5);e.firstMatchTime24h30minBefore=r.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,hour12:!1}),e.firstMatchTime12h30minBefore=r.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,hour12:!0})}function n(e){let n={...e.baseCtx??{}};return n.leftTeamName=e.leftTeam?.name||``,n.rightTeamName=e.rightTeam?.name||``,n.leftTeamTag=e.leftTeam?.tag||``,n.rightTeamTag=e.rightTeam?.tag||``,n.matchName=e.matchName||``,e.matchDate&&(t(n,new Date(e.matchDate)),e.showDate?(n.matchDateOptional=n.matchDate,n.matchDateShortOptional=n.matchDateShort):(n.matchDateOptional=``,n.matchDateShortOptional=``)),n}function r(e,t){let n={...t};if(e.gameDate){let t=typeof e.gameDate==`string`?new Date(e.gameDate):e.gameDate;n.matchDay=t.toLocaleDateString(void 0,{month:`long`,day:`numeric`,year:`numeric`}),n.matchDate=n.matchDay,n.matchDateShort=t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),n.dayOfWeek=t.toLocaleDateString(void 0,{weekday:`long`}),n.time24h=t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,hour12:!1}),n.time12h=t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,hour12:!0}),n.gameNumber=e.gameNumber+1,e.gameTime&&(n.gameTime=`${Math.floor(e.gameTime/60)}:${Math.floor(e.gameTime%60).toString().padStart(2,`0`)}`)}return n}function i(e,t){return{...e,teamName:t.name||``,teamTag:t.tag||``}}function a(e){return e!=null&&e!==``&&e!==0}function o(e,t){if(!e)return``;let n=t,r=e,i=/\{\{#\s*(\w+)\s*\}\}((?:(?!\{\{#).)*)\{\{\/\s*\1\s*\}\}/gs,o=``;for(;o!==r;)o=r,r=r.replace(i,(e,t,r)=>a(n[t])?r:``);return r=r.replace(/\{\{\s*(\w+)\s*\}\}/g,(e,t)=>{let r=n[t];return r==null?``:String(r)}),r}function s(e){let[t=``,n=``]=e.nameWithTag.split(`#`),r=e.team?.members.find(t=>`${t.alias}#${t.tag}`===e.nameWithTag||n.length>0&&t.tag===n),i=e.displayName||r?.displayName||t,a=r?.tag||n;return{...e.baseCtx??{},playerName:i,playerHashtag:a,displayName:i,givenName:r?.givenName??``,familyName:r?.familyName??``,championName:e.champion?.name??``,championAlias:e.champion?.alias??``}}export{i as a,s as i,n,o,e as r,r as t};