twisted
Version:
Fetching riot games api data
2 lines • 41.9 kB
JavaScript
'use strict';var jr=require('promise-queue');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var jr__default=/*#__PURE__*/_interopDefault(jr);var rt=Object.defineProperty;var Mr=(i,r)=>{for(var t in r)rt(i,t,{get:r[t],enumerable:true});};var ue={};Mr(ue,{Champions:()=>se,DataSeed:()=>me,Divisions:()=>Pr,GameModes:()=>Nr,GameTypes:()=>Ur,Games:()=>vr,Levels:()=>Kr,Queues:()=>_r,RealmServers:()=>qr,RegionGroups:()=>Vr,Regions:()=>Br,Seasons:()=>wr,Tiers:()=>Gr,getChampionName:()=>kr,getChampionNameCapital:()=>ae,regionToRegionGroup:()=>Hr,regionToRegionGroupForAccountAPI:()=>nt});var Pr=(o=>(o.I="I",o.II="II",o.III="III",o.IV="IV",o))(Pr||{});var Nr=(g=>(g.CLASSIC="CLASSIC",g.ODIN="ODIN",g.ARAM="ARAM",g.TUTORIAL="TUTORIAL",g.URF="URF",g.DOOMBOTSTEEMO="DOOMBOTSTEEMO",g.ONEFORALL="ONEFORALL",g.ASCENSION="ASCENSION",g.FIRSTBLOOD="FIRSTBLOOD",g.KINGPORO="KINGPORO",g.SIEGE="SIEGE",g.ASSASSINATE="ASSASSINATE",g.ARSR="ARSR",g.DARKSTAR="DARKSTAR",g.STARGUARDIAN="STARGUARDIAN",g.PROJECT="PROJECT",g.GAMEMODEX="GAMEMODEX",g.ODYSSEY="ODYSSEY",g))(Nr||{});var Ur=(n=>(n.CUSTOM_GAME="CUSTOM_GAME",n.TUTORIAL_GAME="TUTORIAL_GAME",n.MATCHED_GAME="MATCHED_GAME",n))(Ur||{});var vr=(t=>(t.LOL="lol",t.TFT="tft",t))(vr||{});var _r=(o=>(o.RANKED_SOLO_5x5="RANKED_SOLO_5x5",o.RANKED_TFT="RANKED_TFT",o.RANKED_FLEX_SR="RANKED_FLEX_SR",o.RANKED_FLEX_TT="RANKED_FLEX_TT",o))(_r||{});var wr=(m=>(m[m.PRESEASON_3=0]="PRESEASON_3",m[m.SEASON_3=1]="SEASON_3",m[m.PRESEASON_2014=2]="PRESEASON_2014",m[m.SEASON_2014=3]="SEASON_2014",m[m.PRESEASON_2015=4]="PRESEASON_2015",m[m.SEASON_2015=5]="SEASON_2015",m[m.PRESEASON_2016=6]="PRESEASON_2016",m[m.SEASON_2016=7]="SEASON_2016",m[m.PRESEASON_2017=8]="PRESEASON_2017",m[m.SEASON_2017=9]="SEASON_2017",m[m.PRESEASON_2018=10]="PRESEASON_2018",m[m.SEASON_2018=11]="SEASON_2018",m))(wr||{});var Gr=(l=>(l.CHALLENGER="CHALLENGER",l.GRANDMASTER="GRANDMASTER",l.MASTER="MASTER",l.DIAMOND="DIAMOND",l.EMERALD="EMERALD",l.PLATINUM="PLATINUM",l.GOLD="GOLD",l.SILVER="SILVER",l.BRONZE="BRONZE",l.IRON="IRON",l))(Gr||{});var se=(e=>(e[e.EMPTY_CHAMPION=0]="EMPTY_CHAMPION",e[e.ANNIE=1]="ANNIE",e[e.OLAF=2]="OLAF",e[e.GALIO=3]="GALIO",e[e.TWISTED_FATE=4]="TWISTED_FATE",e[e.XIN_ZHAO=5]="XIN_ZHAO",e[e.URGOT=6]="URGOT",e[e.LEBLANC=7]="LEBLANC",e[e.VLADIMIR=8]="VLADIMIR",e[e.FIDDLESTICKS=9]="FIDDLESTICKS",e[e.KAYLE=10]="KAYLE",e[e.MASTER_YI=11]="MASTER_YI",e[e.ALISTAR=12]="ALISTAR",e[e.RYZE=13]="RYZE",e[e.SION=14]="SION",e[e.SIVIR=15]="SIVIR",e[e.SORAKA=16]="SORAKA",e[e.TEEMO=17]="TEEMO",e[e.TRISTANA=18]="TRISTANA",e[e.WARWICK=19]="WARWICK",e[e.NUNU=20]="NUNU",e[e.MISS_FORTUNE=21]="MISS_FORTUNE",e[e.ASHE=22]="ASHE",e[e.TRYNDAMERE=23]="TRYNDAMERE",e[e.JAX=24]="JAX",e[e.MORGANA=25]="MORGANA",e[e.ZILEAN=26]="ZILEAN",e[e.SINGED=27]="SINGED",e[e.EVELYNN=28]="EVELYNN",e[e.TWITCH=29]="TWITCH",e[e.KARTHUS=30]="KARTHUS",e[e.CHOGATH=31]="CHOGATH",e[e.AMUMU=32]="AMUMU",e[e.RAMMUS=33]="RAMMUS",e[e.ANIVIA=34]="ANIVIA",e[e.SHACO=35]="SHACO",e[e.DR_MUNDO=36]="DR_MUNDO",e[e.SONA=37]="SONA",e[e.KASSADIN=38]="KASSADIN",e[e.IRELIA=39]="IRELIA",e[e.JANNA=40]="JANNA",e[e.GANGPLANK=41]="GANGPLANK",e[e.CORKI=42]="CORKI",e[e.KARMA=43]="KARMA",e[e.TARIC=44]="TARIC",e[e.VEIGAR=45]="VEIGAR",e[e.TRUNDLE=48]="TRUNDLE",e[e.SWAIN=50]="SWAIN",e[e.CAITLYN=51]="CAITLYN",e[e.BLITZCRANK=53]="BLITZCRANK",e[e.MALPHITE=54]="MALPHITE",e[e.KATARINA=55]="KATARINA",e[e.NOCTURNE=56]="NOCTURNE",e[e.MAOKAI=57]="MAOKAI",e[e.RENEKTON=58]="RENEKTON",e[e.JARVAN_IV=59]="JARVAN_IV",e[e.ELISE=60]="ELISE",e[e.ORIANNA=61]="ORIANNA",e[e.MONKEY_KING=62]="MONKEY_KING",e[e.BRAND=63]="BRAND",e[e.LEE_SIN=64]="LEE_SIN",e[e.VAYNE=67]="VAYNE",e[e.RUMBLE=68]="RUMBLE",e[e.CASSIOPEIA=69]="CASSIOPEIA",e[e.SKARNER=72]="SKARNER",e[e.HEIMERDINGER=74]="HEIMERDINGER",e[e.NASUS=75]="NASUS",e[e.NIDALEE=76]="NIDALEE",e[e.UDYR=77]="UDYR",e[e.POPPY=78]="POPPY",e[e.GRAGAS=79]="GRAGAS",e[e.PANTHEON=80]="PANTHEON",e[e.EZREAL=81]="EZREAL",e[e.MORDEKAISER=82]="MORDEKAISER",e[e.YORICK=83]="YORICK",e[e.AKALI=84]="AKALI",e[e.KENNEN=85]="KENNEN",e[e.GAREN=86]="GAREN",e[e.LEONA=89]="LEONA",e[e.MALZAHAR=90]="MALZAHAR",e[e.TALON=91]="TALON",e[e.RIVEN=92]="RIVEN",e[e.KOG_MAW=96]="KOG_MAW",e[e.SHEN=98]="SHEN",e[e.LUX=99]="LUX",e[e.XERATH=101]="XERATH",e[e.SHYVANA=102]="SHYVANA",e[e.AHRI=103]="AHRI",e[e.GRAVES=104]="GRAVES",e[e.FIZZ=105]="FIZZ",e[e.VOLIBEAR=106]="VOLIBEAR",e[e.RENGAR=107]="RENGAR",e[e.VARUS=110]="VARUS",e[e.NAUTILUS=111]="NAUTILUS",e[e.VIKTOR=112]="VIKTOR",e[e.SEJUANI=113]="SEJUANI",e[e.FIORA=114]="FIORA",e[e.ZIGGS=115]="ZIGGS",e[e.LULU=117]="LULU",e[e.DRAVEN=119]="DRAVEN",e[e.HECARIM=120]="HECARIM",e[e.KHAZIX=121]="KHAZIX",e[e.DARIUS=122]="DARIUS",e[e.JAYCE=126]="JAYCE",e[e.LISSANDRA=127]="LISSANDRA",e[e.DIANA=131]="DIANA",e[e.QUINN=133]="QUINN",e[e.SYNDRA=134]="SYNDRA",e[e.AURELION_SOL=136]="AURELION_SOL",e[e.KAYN=141]="KAYN",e[e.ZOE=142]="ZOE",e[e.ZYRA=143]="ZYRA",e[e.KAISA=145]="KAISA",e[e.GNAR=150]="GNAR",e[e.ZAC=154]="ZAC",e[e.YASUO=157]="YASUO",e[e.VELKOZ=161]="VELKOZ",e[e.TALIYAH=163]="TALIYAH",e[e.CAMILLE=164]="CAMILLE",e[e.BRAUM=201]="BRAUM",e[e.JHIN=202]="JHIN",e[e.KINDRED=203]="KINDRED",e[e.JINX=222]="JINX",e[e.TAHM_KENCH=223]="TAHM_KENCH",e[e.LUCIAN=236]="LUCIAN",e[e.ZED=238]="ZED",e[e.KLED=240]="KLED",e[e.EKKO=245]="EKKO",e[e.QIYANA=246]="QIYANA",e[e.VI=254]="VI",e[e.AATROX=266]="AATROX",e[e.NAMI=267]="NAMI",e[e.AZIR=268]="AZIR",e[e.YUUMI=350]="YUUMI",e[e.THRESH=412]="THRESH",e[e.ILLAOI=420]="ILLAOI",e[e.REKSAI=421]="REKSAI",e[e.IVERN=427]="IVERN",e[e.KALISTA=429]="KALISTA",e[e.BARD=432]="BARD",e[e.RAKAN=497]="RAKAN",e[e.XAYAH=498]="XAYAH",e[e.ORNN=516]="ORNN",e[e.SYLAS=517]="SYLAS",e[e.NEEKO=518]="NEEKO",e[e.APHELIOS=523]="APHELIOS",e[e.PYKE=555]="PYKE",e[e.SENNA=235]="SENNA",e[e.SETT=875]="SETT",e[e.LILLIA=876]="LILLIA",e[e.YONE=777]="YONE",e[e.SAMIRA=360]="SAMIRA",e[e.SERAPHINE=147]="SERAPHINE",e[e.RELL=526]="RELL",e[e.VIEGO=234]="VIEGO",e[e.GWEN=887]="GWEN",e[e.AKSHAN=166]="AKSHAN",e[e.VEX=711]="VEX",e[e.ZERI=221]="ZERI",e[e.RENATA_GLASC=888]="RENATA_GLASC",e[e.BELVETH=200]="BELVETH",e[e.NILAH=895]="NILAH",e[e.KSANTE=897]="KSANTE",e[e.MILIO=902]="MILIO",e[e.HWEI=910]="HWEI",e[e.AURORA=893]="AURORA",e[e.AMBESSA=799]="AMBESSA",e[e.MEL=800]="MEL",e[e.NAAFIRI=950]="NAAFIRI",e[e.SMOLDER=901]="SMOLDER",e[e.BRIAR=233]="BRIAR",e[e.YUNARA=804]="YUNARA",e))(se||{}),D={};for(let[i,r]of Object.entries(se))D[String(r)]=i;function tt(i){return i.split(/[^a-zA-Z0-9]+/).filter(r=>r.length>0).map((r,t)=>t===0?r:r.charAt(0).toUpperCase()+r.slice(1)).join("")}if(process.env.UPDATE_CHAMPION_IDS){let i=()=>{fetch("https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json").then(t=>t.json()).then(t=>{t.forEach(({id:n,alias:o})=>{let s=o.replace(/[a-z][A-Z]/g,c=>c[0]+"_"+c[1]).toUpperCase();D[n]||(D[n]=D[n]||s,D[s]=D[s]||""+n);});}).catch(()=>{console.warn("Updating champion IDs failed");});};setInterval(i,1e3*60*60*24),i();}function kr(i){let r=D[i];if(!r)throw new Error(`Invalid champ id ${i}`);return r}function ae(i){let r=typeof i=="number"?kr(i):i;switch(r=tt(r.toLowerCase()),r=r.charAt(0).toUpperCase()+r.slice(1),r){case "Reksai":return "RekSai";case "JarvanIv":return "JarvanIV"}return r}var Br=(b=>(b.BRAZIL="BR1",b.EU_EAST="EUN1",b.EU_WEST="EUW1",b.KOREA="KR",b.LAT_NORTH="LA1",b.LAT_SOUTH="LA2",b.AMERICA_NORTH="NA1",b.OCEANIA="OC1",b.TURKEY="TR1",b.RUSSIA="RU",b.JAPAN="JP1",b.VIETNAM="VN2",b.TAIWAN="TW2",b.SINGAPORE="SG2",b.MIDDLE_EAST="ME1",b.PBE="PBE1",b))(Br||{}),Vr=(o=>(o.ASIA="ASIA",o.AMERICAS="AMERICAS",o.EUROPE="EUROPE",o.SEA="SEA",o))(Vr||{});function Hr(i){switch(i){case "NA1":case "BR1":case "LA1":case "LA2":return "AMERICAS";case "EUN1":case "EUW1":case "TR1":case "RU":case "ME1":return "EUROPE";case "JP1":case "KR":return "ASIA";case "OC1":case "SG2":case "TW2":case "VN2":return "SEA"}throw new Error(`Unexpected region: ${i}`)}function nt(i){let r=Hr(i);return r==="SEA"?"ASIA":r}var qr=(f=>(f.BRAZIL="br",f.EU_WEST="euw",f.KOREA="kr",f.LAT_NORTH="lan",f.LAT_SOUTH="las",f.AMERICA_NORTH="na",f.OCEANIA="oce",f.TURKEY="tr",f.RUSSIA="ru",f.JAPAN="jp",f.PBE="pbe",f))(qr||{});var me=(r=>(r.BASE="https://s3-us-west-1.amazonaws.com/riot-developer-portal/seed-data",r))(me||{});var Kr=(y=>(y.NONE="NONE",y.IRON="IRON",y.BRONZE="BRONZE",y.SILVER="SILVER",y.GOLD="GOLD",y.PLATINUM="PLATINUM",y.DIAMOND="DIAMOND",y.MASTER="MASTER",y.GRANDMASTER="GRANDMASTER",y.CHALLENGER="CHALLENGER",y.HIGHEST_NOT_LEADERBOARD_ONLY="HIGHEST_NOT_LEADERBOARD_ONLY",y.HIGHEST="HIGHEST",y.LOWEST="LOWEST",y))(Kr||{});var Er={};Mr(Er,{ApiResponseDTO:()=>ce,BannedChampion:()=>Ge,ChampionMasteryDTO:()=>pe,ChampionRotationV3DTO:()=>le,ChampionsDataDragon:()=>Re,ChampionsDataDragonDetails:()=>v,ChampionsDataDragonDetailsSolo:()=>ye,ChampionsScoreDTO:()=>ge,CompanionDto:()=>Ye,CurrentGameInfoDTO:()=>Ce,CurrentGameParticipantDTO:()=>er,FeaturedGameInfo:()=>rr,FeaturedGamesDTO:()=>tr,GameCustomizationObjectDTO:()=>nr,GameModesDataDragonDTO:()=>Ae,InfoDto:()=>We,LeagueEntryDTO:()=>he,LeagueItemDTO:()=>Ee,LeagueListDTO:()=>De,LolStatusContentDTO:()=>yr,LolStatusDTO:()=>lr,LolStatusIncidentsUpdateTranslations:()=>br,LolStatusPlatformDataDTO:()=>Rr,LolStatusServiceDTO:()=>gr,LolStatusServiceIncidentsUpdate:()=>dr,LolStatusServiceStatusIncident:()=>fr,LolStatusStatusDTO:()=>Ir,LolStatusUpdateDTO:()=>Tr,MapsDataDragonDTO:()=>Te,MatchDto:()=>Le,MatchEventDto:()=>Ve,MatchListingDto:()=>ke,MatchListingMatches:()=>Be,MatchParticipantDTO:()=>Oe,MatchParticipantFrameDto:()=>He,MatchParticipantsIdentitiesDto:()=>Me,MatchParticipantsIdentitiesPlayerDto:()=>Pe,MatchParticipantsMasteryDto:()=>Ne,MatchParticipantsRuneDto:()=>Ue,MatchParticipantsStatsDto:()=>ve,MatchParticipantsTimelineDto:()=>_e,MatchPositionDto:()=>qe,MatchQueryDTO:()=>$e,MatchTFTDTO:()=>je,MatchTeamsDto:()=>we,MatchTimeLineFrameDto:()=>Fe,MatchTimelineDto:()=>Ke,MatchV5TimelineDTOs:()=>Fr,MetadataDto:()=>Qe,MiniSeriesDTO:()=>xe,ObserverDTO:()=>ir,ParticipantDTO:()=>or,ParticipantDto:()=>Ze,PerksDTO:()=>sr,QueuesDataDragonDTO:()=>Ie,RateLimitDto:()=>Xe,RealmDTO:()=>be,RealmNTO:()=>fe,SeasonMilestone:()=>de,SpectatorNotAvailableDTO:()=>ar,SummonerLeagueDto:()=>Se,SummonerV4DTO:()=>Ar,TFTChampionsDTO:()=>mr,TFTHexesDto:()=>ur,TFTItemsDTO:()=>cr,TFTTraitsDTO:()=>pr,ThirdPartyCodeDTO:()=>hr,TraitDto:()=>Je,UnitDto:()=>ze});var ce=class{};var pe=class{};var le=class{};var ge=class{};var de=class{};var fe=class{},be=class{};var v=class{},ye=class extends v{},Re=class{};var Ie=class{};var Te=class{};var Ae=class{};var he=class{};var Ee=class{};var De=class{};var xe=class{};var Se=class{};var Le=class{};var Oe=class{};var Me=class{};var Pe=class{};var Ne=class{};var Ue=class{};var ve=class{};var _e=class{};var we=class{};var Ge=class{};var Fr;(n=>{(a=>(a.Ashe="Ashe",a.Braum="Braum",a.Darius="Darius",a.Evelynn="Evelynn",a.Graves="Graves",a.Gwen="Gwen",a.HAAPChaosTurret="HA_AP_ChaosTurret",a.HAAPChaosTurret2="HA_AP_ChaosTurret2",a.HAAPChaosTurret3="HA_AP_ChaosTurret3",a.HAAPOrderTurret="HA_AP_OrderTurret",a.HAAPOrderTurret3="HA_AP_OrderTurret3",a.HAChaosMinionMelee="HA_ChaosMinionMelee",a.HAChaosMinionRanged="HA_ChaosMinionRanged",a.HAChaosMinionSiege="HA_ChaosMinionSiege",a.HAChaosMinionSuper="HA_ChaosMinionSuper",a.HAOrderMinionMelee="HA_OrderMinionMelee",a.HAOrderMinionRanged="HA_OrderMinionRanged",a.HAOrderMinionSiege="HA_OrderMinionSiege",a.HAOrderMinionSuper="HA_OrderMinionSuper",a.Jax="Jax",a.Jinx="Jinx",a.Kassadin="Kassadin",a.Khazix="Khazix",a.Lissandra="Lissandra",a.Nami="Nami",a.Nidalee="Nidalee",a.Pyke="Pyke",a.SRUAPTurretChaos1="SRUAP_Turret_Chaos1",a.SRUAPTurretOrder1="SRUAP_Turret_Order1",a.SRUChaosMinionMelee="SRU_ChaosMinionMelee",a.SRUChaosMinionRanged="SRU_ChaosMinionRanged",a.SRUChaosMinionSiege="SRU_ChaosMinionSiege",a.SRUKrug="SRU_Krug",a.SRUKrugMini="SRU_KrugMini",a.SRUOrderMinionMelee="SRU_OrderMinionMelee",a.SRUOrderMinionRanged="SRU_OrderMinionRanged",a.SRUOrderMinionSiege="SRU_OrderMinionSiege",a.SRURazorbeakMini="SRU_RazorbeakMini",a.Sylas="Sylas",a.TwistedFate="TwistedFate",a.Varus="Varus",a.Vayne="Vayne",a.Yone="Yone"))(n.Name||={});(d=>(d.Minion="MINION",d.Monster="MONSTER",d.Other="OTHER",d.Tower="TOWER"))(n.VictimDamageDealtType||={});(R=>(R.BlueTrinket="BLUE_TRINKET",R.ControlWard="CONTROL_WARD",R.SightWard="SIGHT_WARD",R.Undefined="UNDEFINED",R.YellowTrinket="YELLOW_TRINKET"))(n.WardType||={});})(Fr||={});var ke=class{};var Be=class{};var Ve=class{};var He=class{};var qe=class{};var Ke=class{};var Fe=class{};var $e=class{};var Ye=class{};var We=class{};var je=class{};var Qe=class{};var Ze=class{};var Je=class{};var ze=class{};var Xe=class{};var Ce=class{};var er=class{};var rr=class{};var tr=class{};var nr=class{};var ir=class{};var or=class{};var sr=class{};var ar=class{};var mr=class{};var ur=class{};var cr=class{};var pr=class{};var lr=class{};var gr=class{};var dr=class{};var fr=class{};var br=class{};var yr=class{};var Rr=class{};var Ir=class{};var Tr=class{};var Ar=class{};var hr=class{};var L=404,N=429,$r=500,Yr=501,U=503;var it="Api key not found",_=class i extends Error{constructor(){super(it);this.status=Yr;this.name="ApiKeyNotFound";Object.setPrototypeOf(this,i.prototype);}};var ot="Rate limit error",w=class i extends Error{constructor(t){super(ot);this.status=N;this.rateLimits=t,Object.setPrototypeOf(this,i.prototype);}};var st="Generic error",G=class i extends Error{constructor(t,n){super(n.message||st);this.name="GenericError";this.status=n.response?.status||$r,this.body=n.response?.data,this.rateLimits=t,this.error=n,Object.setPrototypeOf(this,i.prototype);}};var at="Riot games api unavailable check: https://developer.riotgames.com/api-status/",k=class i extends Error{constructor(t,n){super(at);this.rateLimits=t;this.error=n;this.name="RiotUnavailable";this.status=U,this.error=n,Object.setPrototypeOf(this,i.prototype);}};function Wr(i){return new Promise(r=>{setTimeout(()=>{r();},i);})}function mt(i){let r=new URLSearchParams;for(let t of Object.keys(i)){let n=i[t];if(n!=null)if(Array.isArray(n))for(let o of n)o!=null&&r.append(t,String(o));else r.append(t,String(n));}return r.toString()}function B(i){let r=i.url;if(i.params){let t=mt(i.params);t&&(r+=`?${t}`);}return r}var x=class i{static parseName(r,t){let n=`${r.prefix}/${r.path}`;return t&&(n+=` (${t})`),n}static start(r,t){let n=i.parseName(r,t);console.time(n);}static end(r,t){let n=i.parseName(r,t);console.timeEnd(n);}static uri(r,t){let n=B(r);console.log(`Calling method url: ${n} (${t.path})`);}static rateLimit(r,t){let n=i.parseName(r);console.log(`Waiting ${(t/1e3).toFixed(2)} seconds by rate limit (${n})`);}};var Dr=class i extends Error{constructor(r,t,n,o){super(t||`Request failed with status code ${r}`),this.name="HttpError",this.status=r,this.response={status:r,data:n,headers:o},Object.setPrototypeOf(this,i.prototype);}};function ut(i){let r={};return i.forEach((t,n)=>{r[n]=t;}),r}async function ct(i){let r=await i.text();if(r)try{return JSON.parse(r)}catch{return r}}var O=class i{static async sendRequest(r){let t=B(r),n=await fetch(t,{method:r.method||"GET",headers:r.headers}),o=ut(n.headers),s=await ct(n);if(!n.ok)throw new Dr(n.status,n.statusText,s,o);return {data:s,headers:o,status:n.status}}static getQueue(){return i.queue||(i.queue=new jr__default.default(1/0,1/0)),i.queue}static setConcurrency(r){i.queue=new jr__default.default(r,1/0);}static request(r){return i.getQueue().add(()=>i.sendRequest(r))}};var E=class{constructor(r){this.game="lol";this.baseUrl="https://$(region).api.riotgames.com/:game";this.rateLimitRetry=true;this.rateLimitRetryAttempts=1;this.debug={logTime:false,logUrls:false,logRatelimits:false};this.key=process.env.RIOT_API_KEY||"",typeof r=="string"?this.key=r:r&&(typeof r.key=="string"&&(this.key=r.key),this.setParams(r));}setParams(r){typeof r.rateLimitRetry<"u"&&(this.rateLimitRetry=r.rateLimitRetry),typeof r.rateLimitRetryAttempts<"u"&&(this.rateLimitRetryAttempts=r.rateLimitRetryAttempts),typeof r.debug<"u"&&(typeof r.debug.logTime<"u"&&(this.debug.logTime=r.debug.logTime),typeof r.debug.logUrls<"u"&&(this.debug.logUrls=r.debug.logUrls),typeof r.debug.logRatelimits<"u"&&(this.debug.logRatelimits=r.debug.logRatelimits)),typeof r.baseURL<"u"&&(this.baseUrl=r.baseURL),this.concurrency=r.concurrency,typeof r.concurrency<"u"?O.setConcurrency(r.concurrency):O.setConcurrency(1/0);}getRateLimits(r){let t=r||{};return {Type:t["x-rate-limit-type"]??null,AppRateLimit:t["x-app-rate-limit"]??null,AppRateLimitCount:t["x-app-rate-limit-count"]??null,MethodRateLimit:t["x-method-rate-limit"],MethodRatelimitCount:t["x-method-rate-limit-count"]??null,RetryAfter:+(t["retry-after"]??0),EdgeTraceId:t["x-riot-edge-trace-id"]}}getBaseUrl(){return this.baseUrl.replace(":game",this.game)}getApiUrl(r,t){let{prefix:n,version:o,path:s}=r,c=`${n}/v${o}/${s}`,I=/\$\(([^)]+)?\)/g,d=`${this.getBaseUrl()}/${c}`,R;for(;R=I.exec(d);){let[l]=R,f=encodeURI(String(t[R[1]]));d=d.replace(l,f),I.lastIndex=0;}return d}isRateLimitError(r){return r?r.status===N||r.response?.status===N:false}isServiceUnavailableError(r){return r?r.status===U||r.response?.status===U:false}getError(r){let t=this.getRateLimits(r?.response?.headers);return this.isRateLimitError(r)?new w(t):this.isServiceUnavailableError(r)?new k(t,r):new G(t,r)}internalRequest(r){return O.request(r)}async retryRateLimit(r,t,n,o,s){let c=this.getError(o),I=this.isRateLimitError(o)||this.isServiceUnavailableError(o);if(!this.rateLimitRetry||!I||this.rateLimitRetryAttempts<1)throw c;let d=true;for(let R=0;R<=this.rateLimitRetryAttempts;R++)try{return await this.request(r,t,n,d,s)}catch(l){let f=this.getError(l);if(!this.isRateLimitError(l)&&!this.isServiceUnavailableError(l))throw f;let{rateLimits:{RetryAfter:m}}=f,y=this.isServiceUnavailableError(o)?4:1,Or=(m||0)*1e3+y*1e3*Math.random();this.debug.logRatelimits&&x.rateLimit(t,Or),await Wr(Or);}throw c}getParam(){return {key:this.key,rateLimitRetry:this.rateLimitRetry,rateLimitRetryAttempts:this.rateLimitRetryAttempts,concurrency:this.concurrency,baseURL:this.baseUrl,debug:this.debug}}async request(r,t,n,o,s){if(!this.key)throw new _;n=n||{},n.region=r.toLowerCase();let c=this.getApiUrl(t,n);this.debug.logTime&&x.start(t,c);let I={url:c,method:"GET",headers:{"X-Riot-Token":this.key},params:s};this.debug.logUrls&&x.uri(I,t);try{let d=await this.internalRequest(I),{data:R,headers:l}=d;return {rateLimits:this.getRateLimits(l),response:R}}catch(d){if(o)throw d;return await this.retryRateLimit(r,t,n,d,s)}finally{this.debug.logTime&&x.end(t,c);}}};var M=class extends E{constructor(){super(...arguments);this.game="riot";}};var h={MatchListing:{path:"matches/by-puuid/$(summonerPUUID)/ids",prefix:"match",version:5},Match:{path:"matches/$(matchId)",prefix:"match",version:5},MatchTimeline:{path:"matches/$(matchId)/timeline",prefix:"match",version:5},MatchReplays:{path:"matches/by-puuid/$(puuid)/replays",prefix:"match",version:5},SpectatorFeaturedGames:{path:"featured-games",prefix:"spectator",version:5},SpectatorSummoner:{path:"active-games/by-summoner/$(summonerPUUID)",prefix:"spectator",version:5}},p={LolStatus:{path:"platform-data",prefix:"status",version:4},Summoner:{path:"summoners/$(by)/$(summonerName)",prefix:"summoner",version:4},LeagueByPUUID:{path:"entries/by-puuid/$(summonerPUUID)",prefix:"league",version:4},SummonerLeague:{path:"entries/by-summoner/$(encryptedSummonerId)",prefix:"league",version:4},MatchListing:{path:"matchlists/by-account/$(encryptedAccountId)",prefix:"match",version:4},Match:{path:"matches/$(matchId)",prefix:"match",version:4},MatchTimeline:{path:"timelines/by-match/$(matchId)",prefix:"match",version:4},League:{path:"leagues/$(leagueId)",prefix:"league",version:4},ChallengerLeaguesByQueue:{path:"challengerleagues/by-queue/$(queue)",prefix:"league",version:4},GrandMasterLeaguesByQueue:{path:"grandmasterleagues/by-queue/$(queue)",prefix:"league",version:4},MasterLeaguesByQueue:{path:"masterleagues/by-queue/$(queue)",prefix:"league",version:4},LeagueEntries:{path:"entries/$(queue)/$(tier)/$(division)",prefix:"league",version:4},LeagueExp:{path:"entries/$(queue)/$(tier)/$(division)",prefix:"league-exp",version:4},ThirdPartyCode:{path:"third-party-code/by-summoner/$(encryptedSummonerId)",prefix:"platform",version:4},ChampionMasteryByPUUID:{path:"champion-masteries/by-puuid/$(summonerPUUID)",prefix:"champion-mastery",version:4},ChampionMasteryByPUUIDChampion:{path:"champion-masteries/by-puuid/$(summonerPUUID)/by-champion/$(championId)",prefix:"champion-mastery",version:4},ChampionsScore:{path:"scores/by-puuid/$(summonerPUUID)",prefix:"champion-mastery",version:4},SpectatorFeaturedGames:{path:"featured-games",prefix:"spectator",version:4},SpectatorSummoner:{path:"active-games/by-summoner/$(encryptedSummonerId)",prefix:"spectator",version:4}},V={ChampionRotation:{path:"champion-rotations",prefix:"platform",version:3},LolStatus:{path:"shard-data",prefix:"status",version:3}},Sr={SpectateSummoner:{path:"active-games/by-puuid/$(encryptedPUUID)",prefix:"spectator/tft",version:5},SpectatorFeaturedGames:{path:"featured-games",prefix:"spectator/tft",version:5}},T={Match:{path:"matches/$(matchId)",prefix:"match",version:1},MatchListing:{path:"matches/by-puuid/$(summonerPUUID)/ids",prefix:"match",version:1},Summoner:{path:"summoners/$(by)/$(summonerName)",prefix:"summoner",version:1},LeagueMaster:{path:"master",prefix:"league",version:1},LeagueGrandMaster:{path:"grandmaster",prefix:"league",version:1},LeagueChallenger:{path:"challenger",prefix:"league",version:1},LeagueBySummoner:{path:"by-summoner/$(encryptedSummonerId)",prefix:"league",version:1},LeagueByPuuid:{path:"by-puuid/$(puuid)",prefix:"league",version:1},LeagueByTierDivision:{path:"entries/$(tier)/$(division)",prefix:"league",version:1}},P={GetPlayers:{path:"players/by-puuid/$(puuid)",prefix:"clash",version:1},GetTeam:{path:"teams/$(teamId)",prefix:"clash",version:1},GetTournaments:{path:"tournaments",prefix:"clash",version:1},GetTournamentByTeamId:{path:"tournaments/by-team/$(teamId)",prefix:"clash",version:1},GetTournamentById:{path:"tournaments/$(tournamentId)",prefix:"clash",version:1}},H={AccountPUUID:{path:"accounts/by-puuid/$(summonerPUUID)",prefix:"account",version:1},RiotId:{path:"accounts/by-riot-id/$(gameName)/$(tagLine)",prefix:"account",version:1},ActiveRegion:{path:"region/by-game/$(game)/by-puuid/$(summonerPUUID)",prefix:"account",version:1}},S={Config:{path:"challenges/config",prefix:"challenges",version:1},Percentiles:{path:"challenges/percentiles",prefix:"challenges",version:1},ChallengeConfig:{path:"challenges/$(challengeId)/config",prefix:"challenges",version:1},Leaderboards:{path:"challenges/$(challengeId)/leaderboards/by-level/$(level)",prefix:"challenges",version:1},ChallengePercentiles:{path:"challenges/$(challengeId)/percentiles",prefix:"challenges",version:1},PlayerChallenges:{path:"player-data/$(summonerPUUID)",prefix:"challenges",version:1}};var q=class extends M{async getByPUUID(r,t){let n={summonerPUUID:r};return this.request(t,H.AccountPUUID,n)}async getByRiotId(r,t,n){let o={gameName:r,tagLine:t};return this.request(n,H.RiotId,o)}async getActiveRegion(r,t,n){let o={summonerPUUID:r,game:t};return this.request(n,H.ActiveRegion,o)}};var Qr=class extends M{constructor(){super(...arguments);this.Account=new q(this.getParam());}};var u=class extends E{};var K=class extends u{generateResponse(r){return {rateLimits:r.rateLimits,response:{matches:[],startIndex:0,endIndex:0,totalGames:0}}}map(r){return r.response.teams=r.response.teams.map(t=>(t.win=String(t.win)==="Win",t)),r.response.remake=r.response.teams.every(t=>!t.firstTower),r}async get(r,t){let n={matchId:r},o=await this.request(t,p.Match,n);return this.map(o)}async list(r,t,n){let o={encryptedAccountId:r};try{return await this.request(t,p.MatchListing,o,!1,n)}catch(s){if(typeof s=="object"&&s!==null&&"status"in s&&s.status!==L)throw s;return this.generateResponse(s)}}async timeline(r,t){let n={matchId:r};return this.request(t,p.MatchTimeline,n)}};var F=class extends u{async byPUUID(r,t){let n={summonerPUUID:r};return this.request(t,p.LeagueByPUUID,n)}async bySummoner(r,t){let n={encryptedSummonerId:r};return this.request(t,p.SummonerLeague,n)}async exp(r,t,n,o,s=1){let c={queue:r,tier:t,division:n};return this.request(o,p.LeagueExp,c,false,{page:s})}async entries(r,t,n,o,s=1){let c={queue:r,tier:t,division:n};return this.request(o,p.LeagueEntries,c,false,{page:s})}async get(r,t){let n={leagueId:r};return this.request(t,p.League,n)}async getChallengerLeaguesByQueue(r,t){let n={queue:r};return this.request(t,p.ChallengerLeaguesByQueue,n)}async getGrandMasterLeagueByQueue(r,t){let n={queue:r};return this.request(t,p.GrandMasterLeaguesByQueue,n)}async getMasterLeagueByQueue(r,t){let n={queue:r};return this.request(t,p.MasterLeaguesByQueue,n)}};var $=class extends u{parsePath(r,t){let{path:n}=r;return t===""&&(n=n.replace("/$(by)/","/")),n}genericRequest(r,t,n){let o={...p.Summoner};o.path=this.parsePath(o,r);let s={summonerName:t,by:r};return this.request(n,o,s)}async getById(r,t){return this.genericRequest("",r,t)}async getByPUUID(r,t){return this.genericRequest("by-puuid",r,t)}async getByAccountID(r,t){return this.genericRequest("by-account",r,t)}};var Y=class extends u{async rotation(r){return this.request(r,V.ChampionRotation)}async masteryByPUUID(r,t){let n={summonerPUUID:r};return this.request(t,p.ChampionMasteryByPUUID,n)}async masteryByPUUIDChampion(r,t,n){let o={summonerPUUID:r,championId:t};return this.request(n,p.ChampionMasteryByPUUIDChampion,o)}async championsScore(r,t){let n={summonerPUUID:r},{response:o}=await this.request(t,p.ChampionsScore,n);return typeof o!="number"&&(o=0),{score:o}}};var W=class extends u{errorHandler(r){let{statusCode:t}=r.error||r;if(t!==L)throw r}async featuredGames(r){return this.request(r,h.SpectatorFeaturedGames)}async activeGame(r,t){let n={summonerPUUID:r};try{return await this.request(t,h.SpectatorSummoner,n)}catch(o){return this.errorHandler(o),{message:"No active game found"}}}};var j=class extends u{errorHandler(r){let{statusCode:t}=r.error||r;if(t!==404)throw r}async featuredGames(r){return this.request(r,h.SpectatorFeaturedGames)}async activeGame(r,t){let n={summonerPUUID:r};try{return await this.request(t,h.SpectatorSummoner,n)}catch(o){return this.errorHandler(o),{message:"No active game found"}}}};var Q=class extends u{async get(r){return this.request(r,V.LolStatus)}};var Lr="en_US",Z=class{async request(r,t="https://ddragon.leagueoflegends.com"){let n=await fetch(`${t}/${r}`);if(!n.ok)throw new Error(`Data Dragon request failed (${n.status} ${n.statusText}): ${t}/${r}`);return await n.json()}async getRealms(r){let t=`realms/${r}.json`;return this.request(t)}async getVersions(){return this.request("api/versions.json")}async getLanguages(){return this.request("cdn/languages.json")}async getRunesReforged(r){let o=`cdn/${(await this.getVersions())[0]}/data/${r||Lr}/runesReforged.json`;return this.request(o)}async getChampionList(r){let o=`cdn/${(await this.getVersions())[0]}/data/${r||Lr}/champion.json`;return this.request(o)}async getChampion(r,t){let n=(await this.getVersions())[0],o=t||Lr,s="",c=`cdn/${n}/data/${o}/champion`;r?(s=ae(r),c+=`/${s}.json`):c+=".json";let I=await this.request(c);return r?I.data[s]:I}async getQueues(){return this.request("docs/lol/queues.json","http://static.developer.riotgames.com")}async getSeasons(){return this.request("docs/lol/seasons.json","http://static.developer.riotgames.com")}async getMaps(){return this.request("docs/lol/maps.json","http://static.developer.riotgames.com")}async getGameModes(){return this.request("docs/lol/gameModes.json","http://static.developer.riotgames.com")}async getGameTypes(){return this.request("docs/lol/gameTypes.json","http://static.developer.riotgames.com")}};var J=class{constructor(){this.baseUrl="https://s3-us-west-1.amazonaws.com/riot-developer-portal/seed-data";}async request(r){let t=`${this.baseUrl}/${r}`,n=await fetch(t);if(!n.ok)throw new Error(`Seed request failed (${n.status} ${n.statusText}): ${t}`);return await n.json()}async matches(r){if(r<1||r>10)throw new Error("Invalid index");let t=`matches${r}.json`;return this.request(t)}};var z=class extends u{playersList(r,t){return this.request(t,P.GetPlayers,{puuid:r})}getTeamById(r,t){return this.request(t,P.GetTeam,{teamId:r})}getTournaments(r){return this.request(r,P.GetTournaments)}getTeamTournament(r,t){return this.request(t,P.GetTournamentByTeamId,{teamId:r})}getTournamentById(r,t){return this.request(t,P.GetTournamentById,{tournamentId:r})}};var X=class extends u{generateResponse(r){return {rateLimits:r.rateLimits,response:[]}}async get(r,t){let n={matchId:r};return await this.request(t,h.Match,n)}async list(r,t,n){let o={summonerPUUID:r};try{return await this.request(t,h.MatchListing,o,!1,n)}catch(s){if(typeof s=="object"&&s!==null&&"status"in s&&s.status!==L)throw s;return this.generateResponse(s)}}async timeline(r,t){let n={matchId:r};return this.request(t,h.MatchTimeline,n)}async replays(r,t){let n={puuid:r};return this.request(t,h.MatchReplays,n)}};var C=class extends u{async get(r){return this.request(r,p.LolStatus)}};var ee=class extends u{async Configs(r){return this.request(r,S.Config)}async Percentiles(r){return this.request(r,S.Percentiles)}async ChallengeConfig(r,t){let n={challengeId:r};return this.request(t,S.ChallengeConfig,n)}async Leaderboards(r,t,n,o){let s={challengeId:r,level:t};return this.request(n,S.Leaderboards,s,false,o)}async ChallengePercentiles(r,t){let n={challengeId:r};return this.request(t,S.ChallengePercentiles,n)}async PlayerChallenges(r,t){let n={summonerPUUID:r};return this.request(t,S.PlayerChallenges,n)}};var Zr=class extends u{constructor(){super(...arguments);this.Challenges=new ee(this.getParam());this.Match=new K(this.getParam());this.MatchV5=new X(this.getParam());this.League=new F(this.getParam());this.Summoner=new $(this.getParam());this.Champion=new Y(this.getParam());this.SpectatorV5=new j(this.getParam());this.Spectator=new W(this.getParam());this.Status=new Q(this.getParam());this.StatusV4=new C(this.getParam());this.Clash=new z(this.getParam());this.DataDragon=new Z;this.Seed=new J;}};var A=class extends E{constructor(){super(...arguments);this.game="tft";}};var re=class extends A{async get(r,t){let n={matchId:r};return this.request(t,T.Match,n)}async list(r,t,n){let o={summonerPUUID:r};return this.request(t,T.MatchListing,o,false,n)}async listWithDetails(r,t,n){let o=[],{response:s}=await this.list(r,t,n);for(let c of s){let{response:I}=await this.get(c,t);o.push(I);}return o}};var te=class extends A{parsePath(r,t){let{path:n}=r;return t===""&&(n=n.replace("/$(by)/","/")),n}genericRequest(r,t,n){let o={...T.Summoner};o.path=this.parsePath(o,r);let s={summonerName:t,by:r};return this.request(n,o,s)}async getById(r,t){return this.genericRequest("",r,t)}async getByPUUID(r,t){return this.genericRequest("by-puuid",r,t)}async getByAccountID(r,t){return this.genericRequest("by-account",r,t)}};var Jr=[{champion:"Aatrox",cost:3,traits:["Light","Blademaster"]},{champion:"Annie",cost:4,traits:["Inferno","Summoner"]},{champion:"Ashe",cost:4,traits:["Crystal","Ranger"]},{champion:"Azir",cost:3,traits:["Desert","Summoner"]},{champion:"Brand",cost:4,traits:["Inferno","Mage"]},{champion:"Braum",cost:2,traits:["Glacial","Warden"]},{champion:"Diana",cost:1,traits:["Inferno","Assassin"]},{champion:"DrMundo",cost:3,traits:["Poison","Berserker"]},{champion:"Ezreal",cost:3,traits:["Glacial","Ranger"]},{champion:"Ivern",cost:1,traits:["Woodland","Druid"]},{champion:"Janna",cost:4,traits:["Cloud","Mystic"]},{champion:"Jax",cost:2,traits:["Light","Berserker"]},{champion:"KhaZix",cost:4,traits:["Desert","Assassin"]},{champion:"Kindred",cost:3,traits:["Shadow","Inferno"]},{champion:"KogMaw",cost:1,traits:["Poison","Predator"]},{champion:"LeBlanc",cost:2,traits:["Woodland","Assassin"]},{champion:"Lux",cost:7,traits:["Crystal","Electric","Glacial","Inferno","Light","Steel","Ocean","Shadow","Cloud","Woodland","Avatar"]},{champion:"Malphite",cost:4,traits:["Mountain","Warden"]},{champion:"Malzahar",cost:2,traits:["Shadow","Summoner"]},{champion:"Maokai",cost:1,traits:["Woodland","Druid"]},{champion:"MasterYi",cost:5,traits:["Shadow","Mystic"]},{champion:"Nami",cost:5,traits:["Ocean","Mystic"]},{champion:"Nasus",cost:1,traits:["Light","Warden"]},{champion:"Nautilus",cost:3,traits:["Ocean","Warden"]},{champion:"Neeko",cost:2,traits:["Woodland","Druid"]},{champion:"Nocturne",cost:3,traits:["Steel","Assassin"]},{champion:"Olaf",cost:4,traits:["Glacial","Berserker"]},{champion:"Ornn",cost:1,traits:["Electric","Warden"]},{champion:"Qiyana",cost:3,traits:["Ocean","Inferno","Cloud","Woodland","Assassin"]},{champion:"RekSai",cost:2,traits:["Steel","Predator"]},{champion:"Renekton",cost:1,traits:["Desert","Berserker"]},{champion:"Singed",cost:5,traits:["Poison","Alchemist"]},{champion:"Sion",cost:3,traits:["Shadow","Berserker"]},{champion:"Sivir",cost:3,traits:["Desert","Blademaster"]},{champion:"Skarner",cost:2,traits:["Crystal","Predator"]},{champion:"Soraka",cost:3,traits:["Light","Mystic"]},{champion:"Syndra",cost:2,traits:["Ocean","Mage"]},{champion:"Taliyah",cost:1,traits:["Mountain","Mage"]},{champion:"Taric",cost:5,traits:["Crystal","Warden"]},{champion:"Thresh",cost:2,traits:["Ocean","Warden"]},{champion:"Twitch",cost:4,traits:["Poison","Ranger"]},{champion:"Varus",cost:2,traits:["Inferno","Ranger"]},{champion:"Vayne",cost:1,traits:["Light","Ranger"]},{champion:"Veigar",cost:3,traits:["Shadow","Mage"]},{champion:"Vladimir",cost:1,traits:["Ocean","Mage"]},{champion:"Volibear",cost:2,traits:["Glacial","Electric"]},{champion:"Warwick",cost:1,traits:["Glacial","Predator"]},{champion:"Yasuo",cost:2,traits:["Cloud","Blademaster"]},{champion:"Yorick",cost:4,traits:["Light","Summoner"]},{champion:"Zed",cost:5,traits:["Electric","Summoner","Assassin"]},{champion:"Zyra",cost:1,traits:["Inferno","Summoner"]}];var zr=[{name:"Inferno Hex",description:"Gain attack speed for the duration of combat."},{name:"Mountain Hex",description:"Gain permanent health that stacks between rounds and remains even if the champion is moved off the Elemental Hex."},{name:"Ocean Hex",description:"Start combat with additional mana."},{name:"Cloud Hex",description:"Gain dodge chance for the duration of combat."}];var Xr=[{id:1,name:"B.F. Sword"},{id:5,name:"Chain Vest"},{id:7,name:"Giant's Belt"},{id:3,name:"Needlessly Large Rod"},{id:6,name:"Negatron Cloak"},{id:2,name:"Recurve Bow"},{id:8,name:"Spatula"},{id:9,name:"Sparring Gloves"},{id:4,name:"Tear of the Goddess"},{id:89,name:"Berserker Axe"},{id:28,name:"Blade of the Ruined King"},{id:16,name:"Bloodthirster"},{id:11,name:"Deathblade"},{id:66,name:"Dragon's Claw"},{id:88,name:"Force of Nature"},{id:45,name:"Frozen Heart"},{id:78,name:"Frozen Mallet"},{id:12,name:"Giant Slayer"},{id:15,name:"Guardian Angel"},{id:23,name:"Guinsoo's Rageblade"},{id:49,name:"Hand of Justice"},{id:13,name:"Hextech Gunblade"},{id:46,name:"Hush"},{id:59,name:"Iceborne Gauntlet"},{id:38,name:"Inferno Cinder"},{id:19,name:"Infinity Edge"},{id:36,name:"Ionic Spark"},{id:39,name:"Jeweled Guantlet"},{id:35,name:"Locked of the Iron Solari"},{id:34,name:"Luden's Echo"},{id:48,name:"Mage's Cap"},{id:37,name:"Morellonomicon"},{id:25,name:"Phantom Dancer"},{id:69,name:"Quicksilver"},{id:33,name:"Rabadon's Deathcap"},{id:22,name:"Rapid Firecannon"},{id:57,name:"Red Buff"},{id:47,name:"Redemption"},{id:29,name:"Repeating Crossbow"},{id:26,name:"Runaan's Hurricane"},{id:44,name:"Seraph's Embrace"},{id:14,name:"Spear of Shojin"},{id:24,name:"Statikk Shiv"},{id:56,name:"Sword Breaker"},{id:68,name:"Talisman of Light"},{id:99,name:"Thief's Gloves"},{id:55,name:"Thornmail"},{id:27,name:"Titanic Hydra"},{id:79,name:"Trap Claw"},{id:58,name:"Warden's Mail"},{id:77,name:"Warmog's Armor"},{id:18,name:"Youmuu's Ghostblade"},{id:17,name:"Zeke's Herald"},{id:67,name:"Zephyr"},{id:10201,name:"Inferno Hex"},{id:10202,name:"Mountain Hex"},{id:10203,name:"Ocean Hex"},{id:10204,name:"Cloud Hex"}];var Cr=[{name:"Alchemist",innate:"Alchemists move through other units and never stop moving."},{name:"Assassin",innate:"Assassins sneak across the battlefield at the start of combat, placing themselves opposite from where they started.",description:"Deploying multiple Assassins grant them critical strike chance and increased critical strike damage, increasing with more Assassins.",sets:[3,6]},{name:"Avatar",description:"An Avatar's element is counted twice for trait bonuses."},{name:"Beserker",innate:"At the start of combat, Berserkers leap to the nearest enemy.",description:"Deploying multiple Berserkers grants their attacks a chance to deal damage in a cone behind the target. The chance increases with more Berserkers.",sets:[3,6]},{name:"Blademaster",description:"Deploying multiple Blademasters grants their attacks a chance to hit extra times, increasing with more Blademasters.",sets:[2,4,6]},{name:"Cloud",description:"Deploying multiple Cloud champions grants your team dodge change. The dodge chance increases if more Cloud champions are deployed.",sets:[2,3,4]},{name:"Crystal",description:"Deploying multiple Crystal champions grants them a maximum amount of damage they can take from a single attack or ability hit.",sets:[2,4]},{name:"Desert",description:"Deploying multiple Desert champions reduces the enemy team's armor. The reduction increases if more Desert champions are deployed.",sets:[2,4]},{name:"Druid",description:"Deploying two Druids grants all Druids health regeneration.",sets:[2]},{name:"Eletric",description:"Deploying multiple Electric champions causes them to damage adjacent enemies whenever they critically strike or are critically struck.",sets:[2,3,4]},{name:"Glacial",description:"Deploying multiple Glacial champions grants their attacks a chance to stun their target, increasing with more Glacials.",sets:[2,4,6]},{name:"Inferno",description:"Deploying multiple Inferno champions causes their abilities to temporarily ignite the ground beneath their targets, damaging enemies standing in the fire. Damage increases with more Inferno champions.",sets:[3,6,9]},{name:"Light",description:"Deploying multiple Light champions causes them to, on death, heal other Light champions for a percentage of their max health and grant them attack speed for the remainer of the round (stacking with multiple Light champion deaths). Heal and attack speed increse with more Light champions.",sets:[3,6,9]},{name:"Mage",description:"Deploying multiple Mages grants them a chance after casting an ability to cast it again. This chance increases with more Mages.",sets:[3,6]},{name:"Mountain",description:"Deploying multiple Mountain champions grants a massive shield to a random ally at the start of combat.",sets:[2]},{name:"Mystic",description:"Deploying multiple Mystics grants all allies magic resist, increasing with more Mystics.",sets:[2,4]},{name:"Ocean",description:"Deploying multiple Ocean champions periodically grants allies mana. The amount increases with more Ocean champions.",sets:[2,4,6]},{name:"Poison",description:"Deploying mutliple Poison champions causes their damaging attacks and abilities to increase the mana costs of their targets' abilities.",sets:[3]},{name:"Predator",description:"Deploying multiple Predators causes their attacks and abilities to immediately kill low-health enemies.",sets:[3]},{name:"Ranger",description:"Deploying multiple Rangers periodically grants them a chance to gain a burst of attack speed, increasing with more Rangers.",sets:[2,4,6]},{name:"Shadow",description:"Deploying multiple Shadow champions causes them to deal increased damage for the first few seconds of combat, as well as for a few seconds when they score a takedown. Deploying more Shadow champions causes all of them to deal increased damage when any of them score a takedown.",sets:[2,4]},{name:"Steel",description:"Deploying multiple Steel champions causes them to briefly become immune to damage when they drop below 50% health.",sets:[2,3,4]},{name:"Summoner",description:"Deploying multiple Summoners increases the health and duration of their spawned allies, increasing with more Summoners. Summoners' pets benefit from Element and Class bonuses, but don't count as additional units toward activiating higher levels of those bonuses.",sets:[3,6]},{name:"Warden",description:"Deploying multiple Wardens grants them armor, increasing with more Wardens.",sets:[2,4,6]},{name:"Woodland",description:"Deploying multiple Woodland champions causes one of them to randomly create a clone of themselves (including items) at the start of combat.",sets:[3]}];var ne=class{Champions(){return Jr}Hexes(){return zr}Items(){return Xr}Traits(){return Cr}};var ie=class extends A{async get(r,t){let n={encryptedSummonerId:r};return this.request(t,T.LeagueBySummoner,n)}async getByPUUID(r,t){let n={puuid:r};return this.request(t,T.LeagueByPuuid,n)}async getMasterLeague(r){return this.request(r,T.LeagueMaster)}async getGrandMasterLeague(r){return this.request(r,T.LeagueGrandMaster)}async getChallengerLeague(r){return this.request(r,T.LeagueChallenger)}async getByTierDivision(r,t,n,o=1,s="RANKED_TFT"){let c={tier:t,division:n};return this.request(r,T.LeagueByTierDivision,c,false,{queue:s,page:o})}};var oe=class extends A{constructor(){super(...arguments);this.game="lol";}async activeGame(t,n){let o={encryptedPUUID:t};return this.request(n,Sr.SpectateSummoner,o)}async featuredGames(t){return this.request(t,Sr.SpectatorFeaturedGames)}};var et=class extends A{constructor(){super(...arguments);this.Match=new re(this.getParam());this.Summoner=new te(this.getParam());this.League=new ie(this.getParam());this.SpectatorV5=new oe(this.getParam());this.StaticFiles=new ne;}};var Jm=ue,zm=Er;
exports.ApiKeyNotFound=_;exports.Constants=Jm;exports.Dto=zm;exports.GenericError=G;exports.LolApi=Zr;exports.RateLimitError=w;exports.RiotApi=Qr;exports.ServiceUnavailable=k;exports.TftApi=et;