Comparing version 0.1.3 to 0.1.4
declare enum ErrorCode { | ||
NO_API_KEY = "No API has been provided. An API key is required to get `pubg.ts`", | ||
INVALID_API_KEY = "An invalid API key has been provided. Please check the key is valid", | ||
INVALID_SHARD = "The shard argument provided is invalid. Please validate you have passed the correct shard value", | ||
HOOK_FETCH_MATCH = "Failed to fetch data for getMatch hook", | ||
HOOK_FETCH_PLAYER = "Failed to fetch data for getPlayer hook", | ||
HOOK_FETCH_PLAYER_SEASON = "Failed to fetch data for getPlayerSeason hook", | ||
HOOK_FETCH_SAMPLES = "Failed to fetch data for getSampels hook", | ||
HOOK_FETCH_SEASON = "Failed to fetch data for getSeason hook", | ||
HOOK_FETCH_SEASONS = "Failed to fetch data for getSeasons hook", | ||
HOOK_FETCH_STATUS = "Failed to fetch the status of the API", | ||
HOOK_FETCH_TELEMETRY = "Failed to fetch data for getTelemetry hook", | ||
HOOK_FETCH_TOURNAMENT = "Failed to fetch data for getTournament hook" | ||
INVALID_SHARD = "The shard argument provided is invalid. Please validate you have passed the correct shard value" | ||
} | ||
interface ResponseError { | ||
interface PubgResponseError { | ||
detail: string; | ||
@@ -28,3 +19,3 @@ title: string; | ||
declare const PlayerErrors: { | ||
[Error in PlayerError]: ResponseError; | ||
[Error in PlayerError]: PubgResponseError; | ||
}; | ||
@@ -897,2 +888,11 @@ | ||
declare type Result<T> = { | ||
data: T; | ||
error: null; | ||
} | { | ||
data: null; | ||
error: PubgResponseError; | ||
status?: number; | ||
}; | ||
declare type PromiseResult<T> = Promise<Result<T>>; | ||
declare enum ResponseObjectType { | ||
@@ -958,3 +958,3 @@ ASSET = "asset", | ||
interface ErrorsResponse { | ||
errors: ResponseError; | ||
errors: PubgResponseError; | ||
} | ||
@@ -1675,3 +1675,3 @@ | ||
*/ | ||
getMatch({ id }: ClientFnOptions<MatchOptions>): Promise<Match>; | ||
getMatch({ id }: ClientFnOptions<MatchOptions>): Promise<Result<Match>>; | ||
/** | ||
@@ -1684,3 +1684,3 @@ * Get player by the given id or name | ||
*/ | ||
getPlayer({ id, value }: ClientFnOptions<PlayerOptions>): Promise<Player | Player[]>; | ||
getPlayer({ id, skipFailed, value, }: ClientFnOptions<PlayerOptions>): Promise<Result<Player[]>>; | ||
/** | ||
@@ -1691,3 +1691,3 @@ * Get data for a single season of a player(s) by a given id or name | ||
*/ | ||
getPlayerSeason(options: ClientFnOptions<PlayerSeasonOptions>): Promise<PlayerSeason>; | ||
getPlayerSeason(options: ClientFnOptions<PlayerSeasonOptions>): Promise<Result<PlayerSeason>>; | ||
/** | ||
@@ -1699,6 +1699,6 @@ * Get a list of all past matches from the api | ||
*/ | ||
getSamples({ createdAt }?: ClientFnOptions<SamplesOptions>): Promise<Sample & { | ||
getSamples({ createdAt }?: ClientFnOptions<SamplesOptions>): Promise<Result<Sample & { | ||
id: string; | ||
matches: SampleMatches; | ||
}>; | ||
}>>; | ||
/** | ||
@@ -1711,14 +1711,14 @@ * Get data on a specified season. Whether current or a player(s) | ||
*/ | ||
getSeason({ id }?: ClientFnOptions<SeasonOptions>): Promise<Season | undefined>; | ||
getSeason({ id }?: ClientFnOptions<SeasonOptions>): Promise<Result<Season | undefined>>; | ||
/** | ||
* Get an array of all seasons | ||
*/ | ||
getSeasons(): Promise<Season[]>; | ||
getSeasons(): Promise<Result<Season[]>>; | ||
/** | ||
* Gets the status of the API | ||
*/ | ||
getStatus(): Promise<{ | ||
getStatus(): Promise<Result<{ | ||
id: string; | ||
type: ResponseObjectType.STATUS; | ||
}>; | ||
}>>; | ||
/** | ||
@@ -1737,3 +1737,3 @@ * Fetches telemetry data object | ||
*/ | ||
getTournament({ id }?: ClientFnOptions<TournamentOptions>): Promise<Tournament | Tournaments[]>; | ||
getTournament({ id }?: ClientFnOptions<TournamentOptions>): Promise<Result<Tournament | Tournaments[]>>; | ||
} | ||
@@ -1747,3 +1747,3 @@ | ||
} | ||
declare type MatchResponse = Promise<Match>; | ||
declare type MatchResponse = PromiseResult<Match>; | ||
/** | ||
@@ -1765,2 +1765,13 @@ * Get a match from a specificed match id | ||
/** | ||
* Throw an error if not all players are returned / found | ||
* | ||
* By default this will throw an error if the length of the array of player names / id's | ||
* and length of response data objects are not the same. | ||
* This is because if you provide a valid & invalid name to the PUBG api it will return the valid | ||
* name & swallow the invalid name with no errors or warnings. | ||
* | ||
* @default false | ||
*/ | ||
skipFailed?: boolean; | ||
/** | ||
* Player or array of players to fetch | ||
@@ -1775,3 +1786,3 @@ */ | ||
*/ | ||
declare type PlayerResponse = Promise<Player | Array<Player>>; | ||
declare type PlayerResponse = PromiseResult<Array<Player>>; | ||
/** | ||
@@ -1786,3 +1797,3 @@ * Get player(s) by a given name(s) or id(s) | ||
*/ | ||
declare function getPlayer({ id, value, ...rest }: PlayerOptions): PlayerResponse; | ||
declare function getPlayer({ id, skipFailed, value, ...rest }: PlayerOptions): PlayerResponse; | ||
@@ -1803,3 +1814,3 @@ interface PlayerSeasonOptions extends WithApiShard { | ||
} | ||
declare type PlayerSeasonResponse = Promise<PlayerSeason>; | ||
declare type PlayerSeasonResponse = PromiseResult<PlayerSeason>; | ||
/** | ||
@@ -1825,3 +1836,3 @@ * Get data for a single season of a player(s) by a given id or name | ||
*/ | ||
declare type SamplesResponse = Promise<Sample & { | ||
declare type SamplesResponse = PromiseResult<Sample & { | ||
/** | ||
@@ -1852,3 +1863,3 @@ * ID of the sample | ||
} | ||
declare type SeasonResponse = Promise<Season | undefined>; | ||
declare type SeasonResponse = PromiseResult<Season | undefined>; | ||
/** | ||
@@ -1873,3 +1884,3 @@ * Get data on a specified season. Whether current or a player(s) | ||
*/ | ||
declare type SeasonsResponse = Promise<Array<Season>>; | ||
declare type SeasonsResponse = PromiseResult<Array<Season>>; | ||
/** | ||
@@ -1891,3 +1902,3 @@ * Get an array of all seasons of a provided shard | ||
*/ | ||
declare type StatusResponse = Promise<{ | ||
declare type StatusResponse = PromiseResult<{ | ||
id: string; | ||
@@ -1927,3 +1938,3 @@ type: ResponseObjectType.STATUS; | ||
} | ||
declare type TournamentResponse = Promise<Tournament | Array<Tournaments>>; | ||
declare type TournamentResponse = PromiseResult<Tournament | Array<Tournaments>>; | ||
/** | ||
@@ -1940,3 +1951,3 @@ * Gets a specific tournament using a provided match id | ||
} | ||
declare type TournamentsResponse = Promise<Tournament | Array<Tournaments>>; | ||
declare type TournamentsResponse = PromiseResult<Tournament | Array<Tournaments>>; | ||
/** | ||
@@ -1947,2 +1958,2 @@ * Gets all tournaments | ||
export { ApiAssets, ApiMatch, ApiPlayer, ApiPlayerSeason, ApiSampleMatches, ApiSeason, ApiTelemetry, ApiTournament, ApiTournaments, Asset, Assets, BaseResponse, Client, DeathType, ErrorCode, ErrorsResponse, GameModeStatGamemode, Gamemode, Links, Map, Match, MatchAttributes, MatchOptions, MatchResponse, MatchType, Participant, Player, PlayerErrors, PlayerOptions, PlayerResponse, PlayerSeason, PlayerSeasonOptions, PlayerSeasonResponse, Region, ResponseError, ResponseObjectType, Roster, Sample, SampleMatches, SamplesOptions, SamplesResponse, Season, SeasonOptions, SeasonResponse, SeasonState, SeasonsOptions, SeasonsResponse, Shard, StatusOptions, StatusResponse, Telemetry, TelemetryOptions, TelemetryResponse, Tournament, TournamentOptions, TournamentResponse, Tournaments, TournamentsOptions, TournamentsResponse, getMatch, getPlayer, getPlayerSeason, getSamples, getSeason, getSeasons, getStatus, getTelemetry, getTournament, getTournaments }; | ||
export { ApiAssets, ApiMatch, ApiPlayer, ApiPlayerSeason, ApiSampleMatches, ApiSeason, ApiTelemetry, ApiTournament, ApiTournaments, Asset, Assets, BaseResponse, Client, DeathType, ErrorCode, ErrorsResponse, GameModeStatGamemode, Gamemode, Links, Map, Match, MatchAttributes, MatchOptions, MatchResponse, MatchType, Participant, Player, PlayerErrors, PlayerOptions, PlayerResponse, PlayerSeason, PlayerSeasonOptions, PlayerSeasonResponse, PromiseResult, PubgResponseError, Region, ResponseObjectType, Result, Roster, Sample, SampleMatches, SamplesOptions, SamplesResponse, Season, SeasonOptions, SeasonResponse, SeasonState, SeasonsOptions, SeasonsResponse, Shard, StatusOptions, StatusResponse, Telemetry, TelemetryOptions, TelemetryResponse, Tournament, TournamentOptions, TournamentResponse, Tournaments, TournamentsOptions, TournamentsResponse, getMatch, getPlayer, getPlayerSeason, getSamples, getSeason, getSeasons, getStatus, getTelemetry, getTournament, getTournaments }; |
@@ -1,7 +0,7 @@ | ||
(()=>{var Ss=Object.create;var he=Object.defineProperty,bs=Object.defineProperties,Os=Object.getOwnPropertyDescriptor,vs=Object.getOwnPropertyDescriptors,Es=Object.getOwnPropertyNames,me=Object.getOwnPropertySymbols,Cs=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var Ie=(t,e,r)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S=(t,e)=>{for(var r in e||(e={}))De.call(e,r)&&Ie(t,r,e[r]);if(me)for(var r of me(e))Et.call(e,r)&&Ie(t,r,e[r]);return t},b=(t,e)=>bs(t,vs(e)),Rs=t=>he(t,"__esModule",{value:!0});var F=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var H=(t,e)=>{var r={};for(var s in t)De.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&me)for(var s of me(t))e.indexOf(s)<0&&Et.call(t,s)&&(r[s]=t[s]);return r};var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var xs=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Es(e))!De.call(t,s)&&s!=="default"&&he(t,s,{get:()=>e[s],enumerable:!(r=Os(e,s))||r.enumerable});return t},Ct=t=>xs(Rs(he(t!=null?Ss(Cs(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Be=(t,e,r)=>(Ie(t,typeof e!="symbol"?e+"":e,r),r);var He=y((wi,Ht)=>{"use strict";Ht.exports=function(e,r){return function(){for(var i=new Array(arguments.length),o=0;o<i.length;o++)i[o]=arguments[o];return e.apply(r,i)}}});var w=y((qi,Wt)=>{"use strict";var Ts=He(),Y=Object.prototype.toString;function Ke(t){return Y.call(t)==="[object Array]"}function je(t){return typeof t=="undefined"}function gs(t){return t!==null&&!je(t)&&t.constructor!==null&&!je(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ws(t){return Y.call(t)==="[object ArrayBuffer]"}function qs(t){return typeof FormData!="undefined"&&t instanceof FormData}function Fs(t){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function Ns(t){return typeof t=="string"}function Ls(t){return typeof t=="number"}function Kt(t){return t!==null&&typeof t=="object"}function Ae(t){if(Y.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Ms(t){return Y.call(t)==="[object Date]"}function Us(t){return Y.call(t)==="[object File]"}function Ds(t){return Y.call(t)==="[object Blob]"}function jt(t){return Y.call(t)==="[object Function]"}function Is(t){return Kt(t)&&jt(t.pipe)}function Bs(t){return typeof URLSearchParams!="undefined"&&t instanceof URLSearchParams}function ks(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Hs(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function We(t,e){if(!(t===null||typeof t=="undefined"))if(typeof t!="object"&&(t=[t]),Ke(t))for(var r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}function ze(){var t={};function e(i,o){Ae(t[o])&&Ae(i)?t[o]=ze(t[o],i):Ae(i)?t[o]=ze({},i):Ke(i)?t[o]=i.slice():t[o]=i}for(var r=0,s=arguments.length;r<s;r++)We(arguments[r],e);return t}function Ks(t,e,r){return We(e,function(i,o){r&&typeof i=="function"?t[o]=Ts(i,r):t[o]=i}),t}function js(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}Wt.exports={isArray:Ke,isArrayBuffer:ws,isBuffer:gs,isFormData:qs,isArrayBufferView:Fs,isString:Ns,isNumber:Ls,isObject:Kt,isPlainObject:Ae,isUndefined:je,isDate:Ms,isFile:Us,isBlob:Ds,isFunction:jt,isStream:Is,isURLSearchParams:Bs,isStandardBrowserEnv:Hs,forEach:We,merge:ze,extend:Ks,trim:ks,stripBOM:js}});var _e=y((Fi,Yt)=>{"use strict";var V=w();function zt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Yt.exports=function(e,r,s){if(!r)return e;var i;if(s)i=s(r);else if(V.isURLSearchParams(r))i=r.toString();else{var o=[];V.forEach(r,function(f,d){f===null||typeof f=="undefined"||(V.isArray(f)?d=d+"[]":f=[f],V.forEach(f,function(c){V.isDate(c)?c=c.toISOString():V.isObject(c)&&(c=JSON.stringify(c)),o.push(zt(d)+"="+zt(c))}))}),i=o.join("&")}if(i){var u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}});var Qt=y((Ni,$t)=>{"use strict";var Ws=w();function Se(){this.handlers=[]}Se.prototype.use=function(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};Se.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};Se.prototype.forEach=function(e){Ws.forEach(this.handlers,function(s){s!==null&&e(s)})};$t.exports=Se});var Jt=y((Li,Vt)=>{"use strict";var zs=w();Vt.exports=function(e,r){zs.forEach(e,function(i,o){o!==r&&o.toUpperCase()===r.toUpperCase()&&(e[r]=i,delete e[o])})}});var be=y((Mi,Xt)=>{"use strict";Xt.exports=function(e,r,s,i,o){return e.config=r,s&&(e.code=s),e.request=i,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}});var Oe=y((Ui,Zt)=>{"use strict";var Ys=be();Zt.exports=function(e,r,s,i,o){var u=new Error(e);return Ys(u,r,s,i,o)}});var Ye=y((Di,Gt)=>{"use strict";var $s=Oe();Gt.exports=function(e,r,s){var i=s.config.validateStatus;!s.status||!i||i(s.status)?e(s):r($s("Request failed with status code "+s.status,s.config,null,s.request,s))}});var tr=y((Ii,er)=>{"use strict";var ve=w();er.exports=ve.isStandardBrowserEnv()?function(){return{write:function(r,s,i,o,u,a){var f=[];f.push(r+"="+encodeURIComponent(s)),ve.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),ve.isString(o)&&f.push("path="+o),ve.isString(u)&&f.push("domain="+u),a===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var sr=y((Bi,rr)=>{"use strict";rr.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}});var ir=y((ki,nr)=>{"use strict";nr.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}});var $e=y((Hi,or)=>{"use strict";var Qs=sr(),Vs=ir();or.exports=function(e,r){return e&&!Qs(r)?Vs(e,r):r}});var ur=y((Ki,ar)=>{"use strict";var Qe=w(),Js=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];ar.exports=function(e){var r={},s,i,o;return e&&Qe.forEach(e.split(` | ||
`),function(a){if(o=a.indexOf(":"),s=Qe.trim(a.substr(0,o)).toLowerCase(),i=Qe.trim(a.substr(o+1)),s){if(r[s]&&Js.indexOf(s)>=0)return;s==="set-cookie"?r[s]=(r[s]?r[s]:[]).concat([i]):r[s]=r[s]?r[s]+", "+i:i}}),r}});var lr=y((ji,cr)=>{"use strict";var pr=w();cr.exports=pr.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function i(o){var u=o;return e&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=i(window.location.href),function(u){var a=pr.isString(u)?i(u):u;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}()});var J=y((Wi,fr)=>{"use strict";function Ve(t){this.message=t}Ve.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Ve.prototype.__CANCEL__=!0;fr.exports=Ve});var hr=y((zi,dr)=>{"use strict";var Ee=w(),Xs=Ye(),Zs=tr(),Gs=_e(),en=$e(),tn=ur(),rn=lr(),Je=Oe(),sn=X(),nn=J();dr.exports=function(e){return new Promise(function(s,i){var o=e.data,u=e.headers,a=e.responseType,f;function d(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}Ee.isFormData(o)&&delete u["Content-Type"];var n=new XMLHttpRequest;if(e.auth){var c=e.auth.username||"",l=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";u.Authorization="Basic "+btoa(c+":"+l)}var x=en(e.baseURL,e.url);n.open(e.method.toUpperCase(),Gs(x,e.params,e.paramsSerializer),!0),n.timeout=e.timeout;function j(){if(!!n){var m="getAllResponseHeaders"in n?tn(n.getAllResponseHeaders()):null,O=!a||a==="text"||a==="json"?n.responseText:n.response,T={data:O,status:n.status,statusText:n.statusText,headers:m,config:e,request:n};Xs(function(h){s(h),d()},function(h){i(h),d()},T),n=null}}if("onloadend"in n?n.onloadend=j:n.onreadystatechange=function(){!n||n.readyState!==4||n.status===0&&!(n.responseURL&&n.responseURL.indexOf("file:")===0)||setTimeout(j)},n.onabort=function(){!n||(i(Je("Request aborted",e,"ECONNABORTED",n)),n=null)},n.onerror=function(){i(Je("Network Error",e,null,n)),n=null},n.ontimeout=function(){var O="timeout of "+e.timeout+"ms exceeded",T=e.transitional||sn.transitional;e.timeoutErrorMessage&&(O=e.timeoutErrorMessage),i(Je(O,e,T.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",n)),n=null},Ee.isStandardBrowserEnv()){var P=(e.withCredentials||rn(x))&&e.xsrfCookieName?Zs.read(e.xsrfCookieName):void 0;P&&(u[e.xsrfHeaderName]=P)}"setRequestHeader"in n&&Ee.forEach(u,function(O,T){typeof o=="undefined"&&T.toLowerCase()==="content-type"?delete u[T]:n.setRequestHeader(T,O)}),Ee.isUndefined(e.withCredentials)||(n.withCredentials=!!e.withCredentials),a&&a!=="json"&&(n.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&n.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&n.upload&&n.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(m){!n||(i(!m||m&&m.type?new nn("canceled"):m),n.abort(),n=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),o||(o=null),n.send(o)})}});var yr=y((Yi,mr)=>{var Z=1e3,G=Z*60,ee=G*60,$=ee*24,on=$*7,an=$*365.25;mr.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return un(t);if(r==="number"&&isFinite(t))return e.long?cn(t):pn(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function un(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return r*an;case"weeks":case"week":case"w":return r*on;case"days":case"day":case"d":return r*$;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ee;case"minutes":case"minute":case"mins":case"min":case"m":return r*G;case"seconds":case"second":case"secs":case"sec":case"s":return r*Z;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function pn(t){var e=Math.abs(t);return e>=$?Math.round(t/$)+"d":e>=ee?Math.round(t/ee)+"h":e>=G?Math.round(t/G)+"m":e>=Z?Math.round(t/Z)+"s":t+"ms"}function cn(t){var e=Math.abs(t);return e>=$?Ce(t,e,$,"day"):e>=ee?Ce(t,e,ee,"hour"):e>=G?Ce(t,e,G,"minute"):e>=Z?Ce(t,e,Z,"second"):t+" ms"}function Ce(t,e,r,s){var i=e>=r*1.5;return Math.round(t/r)+" "+s+(i?"s":"")}});var Xe=y(($i,Ar)=>{function ln(t){r.debug=r,r.default=r,r.coerce=f,r.disable=o,r.enable=i,r.enabled=u,r.humanize=yr(),r.destroy=d,Object.keys(t).forEach(n=>{r[n]=t[n]}),r.names=[],r.skips=[],r.formatters={};function e(n){let c=0;for(let l=0;l<n.length;l++)c=(c<<5)-c+n.charCodeAt(l),c|=0;return r.colors[Math.abs(c)%r.colors.length]}r.selectColor=e;function r(n){let c,l=null,x,j;function P(...m){if(!P.enabled)return;let O=P,T=Number(new Date),ne=T-(c||T);O.diff=ne,O.prev=c,O.curr=T,c=T,m[0]=r.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let h=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(ie,U)=>{if(ie==="%%")return"%";h++;let I=r.formatters[U];if(typeof I=="function"){let le=m[h];ie=I.call(O,le),m.splice(h,1),h--}return ie}),r.formatArgs.call(O,m),(O.log||r.log).apply(O,m)}return P.namespace=n,P.useColors=r.useColors(),P.color=r.selectColor(n),P.extend=s,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(x!==r.namespaces&&(x=r.namespaces,j=r.enabled(n)),j),set:m=>{l=m}}),typeof r.init=="function"&&r.init(P),P}function s(n,c){let l=r(this.namespace+(typeof c=="undefined"?":":c)+n);return l.log=this.log,l}function i(n){r.save(n),r.namespaces=n,r.names=[],r.skips=[];let c,l=(typeof n=="string"?n:"").split(/[\s,]+/),x=l.length;for(c=0;c<x;c++)!l[c]||(n=l[c].replace(/\*/g,".*?"),n[0]==="-"?r.skips.push(new RegExp("^"+n.substr(1)+"$")):r.names.push(new RegExp("^"+n+"$")))}function o(){let n=[...r.names.map(a),...r.skips.map(a).map(c=>"-"+c)].join(",");return r.enable(""),n}function u(n){if(n[n.length-1]==="*")return!0;let c,l;for(c=0,l=r.skips.length;c<l;c++)if(r.skips[c].test(n))return!1;for(c=0,l=r.names.length;c<l;c++)if(r.names[c].test(n))return!0;return!1}function a(n){return n.toString().substring(2,n.toString().length-2).replace(/\.\*\?$/,"*")}function f(n){return n instanceof Error?n.stack||n.message:n}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Ar.exports=ln});var _r=y((N,Re)=>{N.formatArgs=dn;N.save=hn;N.load=mn;N.useColors=fn;N.storage=yn();N.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();N.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function fn(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function dn(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Re.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}N.log=console.debug||console.log||(()=>{});function hn(t){try{t?N.storage.setItem("debug",t):N.storage.removeItem("debug")}catch(e){}}function mn(){let t;try{t=N.storage.getItem("debug")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function yn(){try{return localStorage}catch(t){}}Re.exports=Xe()(N);var{formatters:An}=Re.exports;An.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var br=y((Qi,Sr)=>{"use strict";Sr.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",s=e.indexOf(r+t),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}});var Er=y((Vi,vr)=>{"use strict";var _n=F("os"),Or=F("tty"),D=br(),{env:v}=process,K;D("no-color")||D("no-colors")||D("color=false")||D("color=never")?K=0:(D("color")||D("colors")||D("color=true")||D("color=always"))&&(K=1);"FORCE_COLOR"in v&&(v.FORCE_COLOR==="true"?K=1:v.FORCE_COLOR==="false"?K=0:K=v.FORCE_COLOR.length===0?1:Math.min(parseInt(v.FORCE_COLOR,10),3));function Ze(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Ge(t,e){if(K===0)return 0;if(D("color=16m")||D("color=full")||D("color=truecolor"))return 3;if(D("color=256"))return 2;if(t&&!e&&K===void 0)return 0;let r=K||0;if(v.TERM==="dumb")return r;if(process.platform==="win32"){let s=_n.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in v)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(s=>s in v)||v.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in v)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(v.TEAMCITY_VERSION)?1:0;if(v.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in v){let s=parseInt((v.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(v.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(v.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(v.TERM)||"COLORTERM"in v?1:r}function Sn(t){let e=Ge(t,t&&t.isTTY);return Ze(e)}vr.exports={supportsColor:Sn,stdout:Ze(Ge(!0,Or.isatty(1))),stderr:Ze(Ge(!0,Or.isatty(2)))}});var Rr=y((E,Pe)=>{var bn=F("tty"),xe=F("util");E.init=Pn;E.log=Cn;E.formatArgs=vn;E.save=Rn;E.load=xn;E.useColors=On;E.destroy=xe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");E.colors=[6,2,3,4,5,1];try{let t=Er();t&&(t.stderr||t).level>=2&&(E.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}E.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function On(){return"colors"in E.inspectOpts?Boolean(E.inspectOpts.colors):bn.isatty(process.stderr.fd)}function vn(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} [0m`;t[0]=o+t[0].split(` | ||
(()=>{var Ss=Object.create;var he=Object.defineProperty,Rs=Object.defineProperties,Os=Object.getOwnPropertyDescriptor,Cs=Object.getOwnPropertyDescriptors,Es=Object.getOwnPropertyNames,me=Object.getOwnPropertySymbols,xs=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable;var Be=(t,e,r)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b=(t,e)=>{for(var r in e||(e={}))De.call(e,r)&&Be(t,r,e[r]);if(me)for(var r of me(e))Ot.call(e,r)&&Be(t,r,e[r]);return t},_=(t,e)=>Rs(t,Cs(e)),Ps=t=>he(t,"__esModule",{value:!0});var q=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var K=(t,e)=>{var r={};for(var s in t)De.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&me)for(var s of me(t))e.indexOf(s)<0&&Ot.call(t,s)&&(r[s]=t[s]);return r};var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var gs=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Es(e))!De.call(t,s)&&s!=="default"&&he(t,s,{get:()=>e[s],enumerable:!(r=Os(e,s))||r.enumerable});return t},Ct=t=>gs(Ps(he(t!=null?Ss(xs(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Ue=(t,e,r)=>(Be(t,typeof e!="symbol"?e+"":e,r),r);var Ke=y((Li,jt)=>{"use strict";jt.exports=function(e,r){return function(){for(var i=new Array(arguments.length),o=0;o<i.length;o++)i[o]=arguments[o];return e.apply(r,i)}}});var g=y((Mi,zt)=>{"use strict";var qs=Ke(),$=Object.prototype.toString;function je(t){return $.call(t)==="[object Array]"}function He(t){return typeof t=="undefined"}function Ns(t){return t!==null&&!He(t)&&t.constructor!==null&&!He(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Fs(t){return $.call(t)==="[object ArrayBuffer]"}function Ls(t){return typeof FormData!="undefined"&&t instanceof FormData}function Ms(t){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function Is(t){return typeof t=="string"}function Ds(t){return typeof t=="number"}function Ht(t){return t!==null&&typeof t=="object"}function Ae(t){if($.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Bs(t){return $.call(t)==="[object Date]"}function Us(t){return $.call(t)==="[object File]"}function ks(t){return $.call(t)==="[object Blob]"}function Wt(t){return $.call(t)==="[object Function]"}function Ks(t){return Ht(t)&&Wt(t.pipe)}function js(t){return typeof URLSearchParams!="undefined"&&t instanceof URLSearchParams}function Hs(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ws(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function We(t,e){if(!(t===null||typeof t=="undefined"))if(typeof t!="object"&&(t=[t]),je(t))for(var r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}function ze(){var t={};function e(i,o){Ae(t[o])&&Ae(i)?t[o]=ze(t[o],i):Ae(i)?t[o]=ze({},i):je(i)?t[o]=i.slice():t[o]=i}for(var r=0,s=arguments.length;r<s;r++)We(arguments[r],e);return t}function zs(t,e,r){return We(e,function(i,o){r&&typeof i=="function"?t[o]=qs(i,r):t[o]=i}),t}function $s(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}zt.exports={isArray:je,isArrayBuffer:Fs,isBuffer:Ns,isFormData:Ls,isArrayBufferView:Ms,isString:Is,isNumber:Ds,isObject:Ht,isPlainObject:Ae,isUndefined:He,isDate:Bs,isFile:Us,isBlob:ks,isFunction:Wt,isStream:Ks,isURLSearchParams:js,isStandardBrowserEnv:Ws,forEach:We,merge:ze,extend:zs,trim:Hs,stripBOM:$s}});var be=y((Ii,Yt)=>{"use strict";var V=g();function $t(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Yt.exports=function(e,r,s){if(!r)return e;var i;if(s)i=s(r);else if(V.isURLSearchParams(r))i=r.toString();else{var o=[];V.forEach(r,function(c,d){c===null||typeof c=="undefined"||(V.isArray(c)?d=d+"[]":c=[c],V.forEach(c,function(l){V.isDate(l)?l=l.toISOString():V.isObject(l)&&(l=JSON.stringify(l)),o.push($t(d)+"="+$t(l))}))}),i=o.join("&")}if(i){var u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}});var Vt=y((Di,Qt)=>{"use strict";var Ys=g();function ve(){this.handlers=[]}ve.prototype.use=function(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};ve.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};ve.prototype.forEach=function(e){Ys.forEach(this.handlers,function(s){s!==null&&e(s)})};Qt.exports=ve});var Xt=y((Bi,Jt)=>{"use strict";var Qs=g();Jt.exports=function(e,r){Qs.forEach(e,function(i,o){o!==r&&o.toUpperCase()===r.toUpperCase()&&(e[r]=i,delete e[o])})}});var _e=y((Ui,Zt)=>{"use strict";Zt.exports=function(e,r,s,i,o){return e.config=r,s&&(e.code=s),e.request=i,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}});var Se=y((ki,Gt)=>{"use strict";var Vs=_e();Gt.exports=function(e,r,s,i,o){var u=new Error(e);return Vs(u,r,s,i,o)}});var $e=y((Ki,er)=>{"use strict";var Js=Se();er.exports=function(e,r,s){var i=s.config.validateStatus;!s.status||!i||i(s.status)?e(s):r(Js("Request failed with status code "+s.status,s.config,null,s.request,s))}});var rr=y((ji,tr)=>{"use strict";var Re=g();tr.exports=Re.isStandardBrowserEnv()?function(){return{write:function(r,s,i,o,u,a){var c=[];c.push(r+"="+encodeURIComponent(s)),Re.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),Re.isString(o)&&c.push("path="+o),Re.isString(u)&&c.push("domain="+u),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var nr=y((Hi,sr)=>{"use strict";sr.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}});var or=y((Wi,ir)=>{"use strict";ir.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}});var Ye=y((zi,ar)=>{"use strict";var Xs=nr(),Zs=or();ar.exports=function(e,r){return e&&!Xs(r)?Zs(e,r):r}});var pr=y(($i,ur)=>{"use strict";var Qe=g(),Gs=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];ur.exports=function(e){var r={},s,i,o;return e&&Qe.forEach(e.split(` | ||
`),function(a){if(o=a.indexOf(":"),s=Qe.trim(a.substr(0,o)).toLowerCase(),i=Qe.trim(a.substr(o+1)),s){if(r[s]&&Gs.indexOf(s)>=0)return;s==="set-cookie"?r[s]=(r[s]?r[s]:[]).concat([i]):r[s]=r[s]?r[s]+", "+i:i}}),r}});var fr=y((Yi,cr)=>{"use strict";var lr=g();cr.exports=lr.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function i(o){var u=o;return e&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=i(window.location.href),function(u){var a=lr.isString(u)?i(u):u;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}()});var J=y((Qi,dr)=>{"use strict";function Ve(t){this.message=t}Ve.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Ve.prototype.__CANCEL__=!0;dr.exports=Ve});var mr=y((Vi,hr)=>{"use strict";var Oe=g(),en=$e(),tn=rr(),rn=be(),sn=Ye(),nn=pr(),on=fr(),Je=Se(),an=X(),un=J();hr.exports=function(e){return new Promise(function(s,i){var o=e.data,u=e.headers,a=e.responseType,c;function d(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}Oe.isFormData(o)&&delete u["Content-Type"];var n=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";u.Authorization="Basic "+btoa(l+":"+f)}var v=sn(e.baseURL,e.url);n.open(e.method.toUpperCase(),rn(v,e.params,e.paramsSerializer),!0),n.timeout=e.timeout;function M(){if(!!n){var m="getAllResponseHeaders"in n?nn(n.getAllResponseHeaders()):null,S=!a||a==="text"||a==="json"?n.responseText:n.response,x={data:S,status:n.status,statusText:n.statusText,headers:m,config:e,request:n};en(function(h){s(h),d()},function(h){i(h),d()},x),n=null}}if("onloadend"in n?n.onloadend=M:n.onreadystatechange=function(){!n||n.readyState!==4||n.status===0&&!(n.responseURL&&n.responseURL.indexOf("file:")===0)||setTimeout(M)},n.onabort=function(){!n||(i(Je("Request aborted",e,"ECONNABORTED",n)),n=null)},n.onerror=function(){i(Je("Network Error",e,null,n)),n=null},n.ontimeout=function(){var S="timeout of "+e.timeout+"ms exceeded",x=e.transitional||an.transitional;e.timeoutErrorMessage&&(S=e.timeoutErrorMessage),i(Je(S,e,x.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",n)),n=null},Oe.isStandardBrowserEnv()){var O=(e.withCredentials||on(v))&&e.xsrfCookieName?tn.read(e.xsrfCookieName):void 0;O&&(u[e.xsrfHeaderName]=O)}"setRequestHeader"in n&&Oe.forEach(u,function(S,x){typeof o=="undefined"&&x.toLowerCase()==="content-type"?delete u[x]:n.setRequestHeader(x,S)}),Oe.isUndefined(e.withCredentials)||(n.withCredentials=!!e.withCredentials),a&&a!=="json"&&(n.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&n.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&n.upload&&n.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(c=function(m){!n||(i(!m||m&&m.type?new un("canceled"):m),n.abort(),n=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c))),o||(o=null),n.send(o)})}});var Ar=y((Ji,yr)=>{var Z=1e3,G=Z*60,ee=G*60,Y=ee*24,pn=Y*7,ln=Y*365.25;yr.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return cn(t);if(r==="number"&&isFinite(t))return e.long?dn(t):fn(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function cn(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return r*ln;case"weeks":case"week":case"w":return r*pn;case"days":case"day":case"d":return r*Y;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ee;case"minutes":case"minute":case"mins":case"min":case"m":return r*G;case"seconds":case"second":case"secs":case"sec":case"s":return r*Z;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function fn(t){var e=Math.abs(t);return e>=Y?Math.round(t/Y)+"d":e>=ee?Math.round(t/ee)+"h":e>=G?Math.round(t/G)+"m":e>=Z?Math.round(t/Z)+"s":t+"ms"}function dn(t){var e=Math.abs(t);return e>=Y?Ce(t,e,Y,"day"):e>=ee?Ce(t,e,ee,"hour"):e>=G?Ce(t,e,G,"minute"):e>=Z?Ce(t,e,Z,"second"):t+" ms"}function Ce(t,e,r,s){var i=e>=r*1.5;return Math.round(t/r)+" "+s+(i?"s":"")}});var Xe=y((Xi,br)=>{function hn(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=u,r.humanize=Ar(),r.destroy=d,Object.keys(t).forEach(n=>{r[n]=t[n]}),r.names=[],r.skips=[],r.formatters={};function e(n){let l=0;for(let f=0;f<n.length;f++)l=(l<<5)-l+n.charCodeAt(f),l|=0;return r.colors[Math.abs(l)%r.colors.length]}r.selectColor=e;function r(n){let l,f=null,v,M;function O(...m){if(!O.enabled)return;let S=O,x=Number(new Date),ne=x-(l||x);S.diff=ne,S.prev=l,S.curr=x,l=x,m[0]=r.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let h=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(ie,I)=>{if(ie==="%%")return"%";h++;let B=r.formatters[I];if(typeof B=="function"){let ce=m[h];ie=B.call(S,ce),m.splice(h,1),h--}return ie}),r.formatArgs.call(S,m),(S.log||r.log).apply(S,m)}return O.namespace=n,O.useColors=r.useColors(),O.color=r.selectColor(n),O.extend=s,O.destroy=r.destroy,Object.defineProperty(O,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(v!==r.namespaces&&(v=r.namespaces,M=r.enabled(n)),M),set:m=>{f=m}}),typeof r.init=="function"&&r.init(O),O}function s(n,l){let f=r(this.namespace+(typeof l=="undefined"?":":l)+n);return f.log=this.log,f}function i(n){r.save(n),r.namespaces=n,r.names=[],r.skips=[];let l,f=(typeof n=="string"?n:"").split(/[\s,]+/),v=f.length;for(l=0;l<v;l++)!f[l]||(n=f[l].replace(/\*/g,".*?"),n[0]==="-"?r.skips.push(new RegExp("^"+n.substr(1)+"$")):r.names.push(new RegExp("^"+n+"$")))}function o(){let n=[...r.names.map(a),...r.skips.map(a).map(l=>"-"+l)].join(",");return r.enable(""),n}function u(n){if(n[n.length-1]==="*")return!0;let l,f;for(l=0,f=r.skips.length;l<f;l++)if(r.skips[l].test(n))return!1;for(l=0,f=r.names.length;l<f;l++)if(r.names[l].test(n))return!0;return!1}function a(n){return n.toString().substring(2,n.toString().length-2).replace(/\.\*\?$/,"*")}function c(n){return n instanceof Error?n.stack||n.message:n}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}br.exports=hn});var vr=y((N,Ee)=>{N.formatArgs=yn;N.save=An;N.load=bn;N.useColors=mn;N.storage=vn();N.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();N.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function mn(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function yn(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Ee.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}N.log=console.debug||console.log||(()=>{});function An(t){try{t?N.storage.setItem("debug",t):N.storage.removeItem("debug")}catch(e){}}function bn(){let t;try{t=N.storage.getItem("debug")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function vn(){try{return localStorage}catch(t){}}Ee.exports=Xe()(N);var{formatters:_n}=Ee.exports;_n.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Sr=y((Zi,_r)=>{"use strict";_r.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",s=e.indexOf(r+t),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}});var Cr=y((Gi,Or)=>{"use strict";var Sn=q("os"),Rr=q("tty"),D=Sr(),{env:R}=process,j;D("no-color")||D("no-colors")||D("color=false")||D("color=never")?j=0:(D("color")||D("colors")||D("color=true")||D("color=always"))&&(j=1);"FORCE_COLOR"in R&&(R.FORCE_COLOR==="true"?j=1:R.FORCE_COLOR==="false"?j=0:j=R.FORCE_COLOR.length===0?1:Math.min(parseInt(R.FORCE_COLOR,10),3));function Ze(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Ge(t,e){if(j===0)return 0;if(D("color=16m")||D("color=full")||D("color=truecolor"))return 3;if(D("color=256"))return 2;if(t&&!e&&j===void 0)return 0;let r=j||0;if(R.TERM==="dumb")return r;if(process.platform==="win32"){let s=Sn.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in R)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(s=>s in R)||R.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in R)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(R.TEAMCITY_VERSION)?1:0;if(R.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in R){let s=parseInt((R.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(R.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(R.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(R.TERM)||"COLORTERM"in R?1:r}function Rn(t){let e=Ge(t,t&&t.isTTY);return Ze(e)}Or.exports={supportsColor:Rn,stdout:Ze(Ge(!0,Rr.isatty(1))),stderr:Ze(Ge(!0,Rr.isatty(2)))}});var xr=y((C,Pe)=>{var On=q("tty"),xe=q("util");C.init=Tn;C.log=Pn;C.formatArgs=En;C.save=gn;C.load=wn;C.useColors=Cn;C.destroy=xe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");C.colors=[6,2,3,4,5,1];try{let t=Cr();t&&(t.stderr||t).level>=2&&(C.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}C.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function Cn(){return"colors"in C.inspectOpts?Boolean(C.inspectOpts.colors):On.isatty(process.stderr.fd)}function En(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} [0m`;t[0]=o+t[0].split(` | ||
`).join(` | ||
`+o),t.push(i+"m+"+Pe.exports.humanize(this.diff)+"[0m")}else t[0]=En()+e+" "+t[0]}function En(){return E.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Cn(...t){return process.stderr.write(xe.format(...t)+` | ||
`)}function Rn(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function xn(){return process.env.DEBUG}function Pn(t){t.inspectOpts={};let e=Object.keys(E.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=E.inspectOpts[e[r]]}Pe.exports=Xe()(E);var{formatters:Cr}=Pe.exports;Cr.o=function(t){return this.inspectOpts.colors=this.useColors,xe.inspect(t,this.inspectOpts).split(` | ||
`).map(e=>e.trim()).join(" ")};Cr.O=function(t){return this.inspectOpts.colors=this.useColors,xe.inspect(t,this.inspectOpts)}});var xr=y((Ji,et)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?et.exports=_r():et.exports=Rr()});var Tr=y((Xi,Pr)=>{var ue;Pr.exports=function(){if(!ue){try{ue=xr()("follow-redirects")}catch(t){}typeof ue!="function"&&(ue=function(){})}ue.apply(null,arguments)}});var it=y((Zi,nt)=>{var te=F("url"),tt=te.URL,Tn=F("http"),gn=F("https"),gr=F("stream").Writable,wn=F("assert"),wr=Tr(),Q=["abort","aborted","connect","error","socket","timeout"],rt=Object.create(null);Q.forEach(function(t){rt[t]=function(e,r,s){this._redirectable.emit(t,e,r,s)}});var qn=Te("ERR_FR_REDIRECTION_FAILURE",""),Fn=Te("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Nn=Te("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Ln=Te("ERR_STREAM_WRITE_AFTER_END","write after end");function L(t,e){gr.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var r=this;this._onNativeResponse=function(s){r._processResponse(s)},this._performRequest()}L.prototype=Object.create(gr.prototype);L.prototype.abort=function(){Nr(this._currentRequest),this.emit("abort")};L.prototype.write=function(t,e,r){if(this._ending)throw new Ln;if(!(typeof t=="string"||typeof t=="object"&&"length"in t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(typeof e=="function"&&(r=e,e=null),t.length===0){r&&r();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,r)):(this.emit("error",new Nn),this.abort())};L.prototype.end=function(t,e,r){if(typeof t=="function"?(r=t,t=e=null):typeof e=="function"&&(r=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var s=this,i=this._currentRequest;this.write(t,e,function(){s._ended=!0,i.end(null,null,r)}),this._ending=!0}};L.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)};L.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)};L.prototype.setTimeout=function(t,e){var r=this;function s(u){u.setTimeout(t),u.removeListener("timeout",u.destroy),u.addListener("timeout",u.destroy)}function i(u){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},t),s(u)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),e&&r.removeListener("timeout",e),r.socket||r._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",s),this.once("response",o),this.once("error",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){L.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(L.prototype,t,{get:function(){return this._currentRequest[t]}})});L.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}};L.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e){this.emit("error",new TypeError("Unsupported protocol "+t));return}if(this._options.agents){var r=t.substr(0,t.length-1);this._options.agent=this._options.agents[r]}var s=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=te.format(this._options),s._redirectable=this;for(var i=0;i<Q.length;i++)s.on(Q[i],rt[Q[i]]);if(this._isRedirect){var o=0,u=this,a=this._requestBodyBuffers;(function f(d){if(s===u._currentRequest)if(d)u.emit("error",d);else if(o<a.length){var n=a[o++];s.finished||s.write(n.data,n.encoding,f)}else u._ended&&s.end()})()}};L.prototype._processResponse=function(t){var e=t.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e});var r=t.headers.location;if(r&&this._options.followRedirects!==!1&&e>=300&&e<400){if(Nr(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new Fn);return}((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],st(/^content-/i,this._options.headers));var s=st(/^host$/i,this._options.headers)||te.parse(this._currentUrl).hostname,i=te.resolve(this._currentUrl,r);wr("redirecting to",i),this._isRedirect=!0;var o=te.parse(i);if(Object.assign(this._options,o),o.hostname!==s&&st(/^authorization$/i,this._options.headers),typeof this._options.beforeRedirect=="function"){var u={headers:t.headers};try{this._options.beforeRedirect.call(null,this._options,u)}catch(f){this.emit("error",f);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(f){var a=new qn("Redirected request failed: "+f.message);a.cause=f,this.emit("error",a)}}else t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[]};function qr(t){var e={maxRedirects:21,maxBodyLength:10*1024*1024},r={};return Object.keys(t).forEach(function(s){var i=s+":",o=r[i]=t[s],u=e[s]=Object.create(o);function a(d,n,c){if(typeof d=="string"){var l=d;try{d=Fr(new tt(l))}catch(x){d=te.parse(l)}}else tt&&d instanceof tt?d=Fr(d):(c=n,n=d,d={protocol:i});return typeof n=="function"&&(c=n,n=null),n=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},d,n),n.nativeProtocols=r,wn.equal(n.protocol,i,"protocol mismatch"),wr("options",n),new L(n,c)}function f(d,n,c){var l=u.request(d,n,c);return l.end(),l}Object.defineProperties(u,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:f,configurable:!0,enumerable:!0,writable:!0}})}),e}function Mn(){}function Fr(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};return t.port!==""&&(e.port=Number(t.port)),e}function st(t,e){var r;for(var s in e)t.test(s)&&(r=e[s],delete e[s]);return r}function Te(t,e){function r(s){Error.captureStackTrace(this,this.constructor),this.message=s||e}return r.prototype=new Error,r.prototype.constructor=r,r.prototype.name="Error ["+t+"]",r.prototype.code=t,r}function Nr(t){for(var e=0;e<Q.length;e++)t.removeListener(Q[e],rt[Q[e]]);t.on("error",Mn),t.abort()}nt.exports=qr({http:Tn,https:gn});nt.exports.wrap=qr});var ge=y((Gi,Lr)=>{Lr.exports={version:"0.22.0"}});var kr=y((eo,Br)=>{"use strict";var pe=w(),Mr=Ye(),Un=$e(),Dn=_e(),In=F("http"),Bn=F("https"),kn=it().http,Hn=it().https,Ur=F("url"),Kn=F("zlib"),jn=ge().version,we=Oe(),ot=be(),Wn=X(),zn=J(),Dr=/https:?/;function Ir(t,e,r){if(t.hostname=e.host,t.host=e.host,t.port=e.port,t.path=r,e.auth){var s=Buffer.from(e.auth.username+":"+e.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+s}t.beforeRedirect=function(o){o.headers.host=o.host,Ir(o,e,o.href)}}Br.exports=function(e){return new Promise(function(s,i){var o;function u(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}var a=function(A){u(),s(A)},f=function(A){u(),i(A)},d=e.data,n=e.headers,c={};if(Object.keys(n).forEach(function(A){c[A.toLowerCase()]=A}),"user-agent"in c?n[c["user-agent"]]||delete n[c["user-agent"]]:n["User-Agent"]="axios/"+jn,d&&!pe.isStream(d)){if(!Buffer.isBuffer(d))if(pe.isArrayBuffer(d))d=Buffer.from(new Uint8Array(d));else if(pe.isString(d))d=Buffer.from(d,"utf-8");else return f(we("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));c["content-length"]||(n["Content-Length"]=d.length)}var l=void 0;if(e.auth){var x=e.auth.username||"",j=e.auth.password||"";l=x+":"+j}var P=Un(e.baseURL,e.url),m=Ur.parse(P),O=m.protocol||"http:";if(!l&&m.auth){var T=m.auth.split(":"),ne=T[0]||"",h=T[1]||"";l=ne+":"+h}l&&c.authorization&&delete n[c.authorization];var Me=Dr.test(O),ie=Me?e.httpsAgent:e.httpAgent,U={path:Dn(m.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:n,agent:ie,agents:{http:e.httpAgent,https:e.httpsAgent},auth:l};e.socketPath?U.socketPath=e.socketPath:(U.hostname=m.hostname,U.port=m.port);var I=e.proxy;if(!I&&I!==!1){var le=O.slice(0,-1)+"_proxy",mt=process.env[le]||process.env[le.toUpperCase()];if(mt){var oe=Ur.parse(mt),yt=process.env.no_proxy||process.env.NO_PROXY,At=!0;if(yt){var _s=yt.split(",").map(function(A){return A.trim()});At=!_s.some(function(A){return A?A==="*"||A[0]==="."&&m.hostname.substr(m.hostname.length-A.length)===A?!0:m.hostname===A:!1})}if(At&&(I={host:oe.hostname,port:oe.port,protocol:oe.protocol},oe.auth)){var _t=oe.auth.split(":");I.auth={username:_t[0],password:_t[1]}}}}I&&(U.headers.host=m.hostname+(m.port?":"+m.port:""),Ir(U,I,O+"//"+m.hostname+(m.port?":"+m.port:"")+U.path));var fe,St=Me&&(I?Dr.test(I.protocol):!0);e.transport?fe=e.transport:e.maxRedirects===0?fe=St?Bn:In:(e.maxRedirects&&(U.maxRedirects=e.maxRedirects),fe=St?Hn:kn),e.maxBodyLength>-1&&(U.maxBodyLength=e.maxBodyLength),e.insecureHTTPParser&&(U.insecureHTTPParser=e.insecureHTTPParser);var g=fe.request(U,function(A){if(!g.aborted){var W=A,p=A.req||g;if(A.statusCode!==204&&p.method!=="HEAD"&&e.decompress!==!1)switch(A.headers["content-encoding"]){case"gzip":case"compress":case"deflate":W=W.pipe(Kn.createUnzip()),delete A.headers["content-encoding"];break}var de={status:A.statusCode,statusText:A.statusMessage,headers:A.headers,config:e,request:p};if(e.responseType==="stream")de.data=W,Mr(a,f,de);else{var bt=[],Ot=0;W.on("data",function(B){bt.push(B),Ot+=B.length,e.maxContentLength>-1&&Ot>e.maxContentLength&&(W.destroy(),f(we("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,p)))}),W.on("error",function(B){g.aborted||f(ot(B,e,null,p))}),W.on("end",function(){var B=Buffer.concat(bt);e.responseType!=="arraybuffer"&&(B=B.toString(e.responseEncoding),(!e.responseEncoding||e.responseEncoding==="utf8")&&(B=pe.stripBOM(B))),de.data=B,Mr(a,f,de)})}}});if(g.on("error",function(A){g.aborted&&A.code!=="ERR_FR_TOO_MANY_REDIRECTS"||f(ot(A,e,null,g))}),e.timeout){var Ue=parseInt(e.timeout,10);if(isNaN(Ue)){f(we("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",g));return}g.setTimeout(Ue,function(){g.abort();var A=e.transitional||Wn.transitional;f(we("timeout of "+Ue+"ms exceeded",e,A.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",g))})}(e.cancelToken||e.signal)&&(o=function(q){g.aborted||(g.abort(),f(!q||q&&q.type?new zn("canceled"):q))},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o))),pe.isStream(d)?d.on("error",function(A){f(ot(A,e,null,g))}).pipe(g):g.end(d)})}});var X=y((to,jr)=>{"use strict";var C=w(),Hr=Jt(),Yn=be(),$n={"Content-Type":"application/x-www-form-urlencoded"};function Kr(t,e){!C.isUndefined(t)&&C.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Qn(){var t;return typeof XMLHttpRequest!="undefined"?t=hr():typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&(t=kr()),t}function Vn(t,e,r){if(C.isString(t))try{return(e||JSON.parse)(t),C.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var qe={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Qn(),transformRequest:[function(e,r){return Hr(r,"Accept"),Hr(r,"Content-Type"),C.isFormData(e)||C.isArrayBuffer(e)||C.isBuffer(e)||C.isStream(e)||C.isFile(e)||C.isBlob(e)?e:C.isArrayBufferView(e)?e.buffer:C.isURLSearchParams(e)?(Kr(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):C.isObject(e)||r&&r["Content-Type"]==="application/json"?(Kr(r,"application/json"),Vn(e)):e}],transformResponse:[function(e){var r=this.transitional||qe.transitional,s=r&&r.silentJSONParsing,i=r&&r.forcedJSONParsing,o=!s&&this.responseType==="json";if(o||i&&C.isString(e)&&e.length)try{return JSON.parse(e)}catch(u){if(o)throw u.name==="SyntaxError"?Yn(u,this,"E_JSON_PARSE"):u}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};C.forEach(["delete","get","head"],function(e){qe.headers[e]={}});C.forEach(["post","put","patch"],function(e){qe.headers[e]=C.merge($n)});jr.exports=qe});var zr=y((ro,Wr)=>{"use strict";var Jn=w(),Xn=X();Wr.exports=function(e,r,s){var i=this||Xn;return Jn.forEach(s,function(u){e=u.call(i,e,r)}),e}});var at=y((so,Yr)=>{"use strict";Yr.exports=function(e){return!!(e&&e.__CANCEL__)}});var Vr=y((no,Qr)=>{"use strict";var $r=w(),ut=zr(),Zn=at(),Gn=X(),ei=J();function pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ei("canceled")}Qr.exports=function(e){pt(e),e.headers=e.headers||{},e.data=ut.call(e,e.data,e.headers,e.transformRequest),e.headers=$r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),$r.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var r=e.adapter||Gn.adapter;return r(e).then(function(i){return pt(e),i.data=ut.call(e,i.data,i.headers,e.transformResponse),i},function(i){return Zn(i)||(pt(e),i&&i.response&&(i.response.data=ut.call(e,i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})}});var ct=y((io,Jr)=>{"use strict";var M=w();Jr.exports=function(e,r){r=r||{};var s={};function i(n,c){return M.isPlainObject(n)&&M.isPlainObject(c)?M.merge(n,c):M.isPlainObject(c)?M.merge({},c):M.isArray(c)?c.slice():c}function o(n){if(M.isUndefined(r[n])){if(!M.isUndefined(e[n]))return i(void 0,e[n])}else return i(e[n],r[n])}function u(n){if(!M.isUndefined(r[n]))return i(void 0,r[n])}function a(n){if(M.isUndefined(r[n])){if(!M.isUndefined(e[n]))return i(void 0,e[n])}else return i(void 0,r[n])}function f(n){if(n in r)return i(e[n],r[n]);if(n in e)return i(void 0,e[n])}var d={url:u,method:u,data:u,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:f};return M.forEach(Object.keys(e).concat(Object.keys(r)),function(c){var l=d[c]||o,x=l(c);M.isUndefined(x)&&l!==f||(s[c]=x)}),s}});var Gr=y((oo,Zr)=>{"use strict";var ti=ge().version,lt={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){lt[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});var Xr={};lt.transitional=function(e,r,s){function i(o,u){return"[Axios v"+ti+"] Transitional option '"+o+"'"+u+(s?". "+s:"")}return function(o,u,a){if(e===!1)throw new Error(i(u," has been removed"+(r?" in "+r:"")));return r&&!Xr[u]&&(Xr[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,u,a):!0}};function ri(t,e,r){if(typeof t!="object")throw new TypeError("options must be an object");for(var s=Object.keys(t),i=s.length;i-- >0;){var o=s[i],u=e[o];if(u){var a=t[o],f=a===void 0||u(a,o,t);if(f!==!0)throw new TypeError("option "+o+" must be "+f);continue}if(r!==!0)throw Error("Unknown option "+o)}}Zr.exports={assertOptions:ri,validators:lt}});var is=y((ao,ns)=>{"use strict";var es=w(),si=_e(),ts=Qt(),rs=Vr(),Fe=ct(),ss=Gr(),re=ss.validators;function ce(t){this.defaults=t,this.interceptors={request:new ts,response:new ts}}ce.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=Fe(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;r!==void 0&&ss.assertOptions(r,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1);var s=[],i=!0;this.interceptors.request.forEach(function(l){typeof l.runWhen=="function"&&l.runWhen(e)===!1||(i=i&&l.synchronous,s.unshift(l.fulfilled,l.rejected))});var o=[];this.interceptors.response.forEach(function(l){o.push(l.fulfilled,l.rejected)});var u;if(!i){var a=[rs,void 0];for(Array.prototype.unshift.apply(a,s),a=a.concat(o),u=Promise.resolve(e);a.length;)u=u.then(a.shift(),a.shift());return u}for(var f=e;s.length;){var d=s.shift(),n=s.shift();try{f=d(f)}catch(c){n(c);break}}try{u=rs(f)}catch(c){return Promise.reject(c)}for(;o.length;)u=u.then(o.shift(),o.shift());return u};ce.prototype.getUri=function(e){return e=Fe(this.defaults,e),si(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};es.forEach(["delete","get","head","options"],function(e){ce.prototype[e]=function(r,s){return this.request(Fe(s||{},{method:e,url:r,data:(s||{}).data}))}});es.forEach(["post","put","patch"],function(e){ce.prototype[e]=function(r,s,i){return this.request(Fe(i||{},{method:e,url:r,data:s}))}});ns.exports=ce});var as=y((uo,os)=>{"use strict";var ni=J();function se(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(i){e=i});var r=this;this.promise.then(function(s){if(!!r._listeners){var i,o=r._listeners.length;for(i=0;i<o;i++)r._listeners[i](s);r._listeners=null}}),this.promise.then=function(s){var i,o=new Promise(function(u){r.subscribe(u),i=u}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i){r.reason||(r.reason=new ni(i),e(r.reason))})}se.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};se.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};se.prototype.unsubscribe=function(e){if(!!this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}};se.source=function(){var e,r=new se(function(i){e=i});return{token:r,cancel:e}};os.exports=se});var ps=y((po,us)=>{"use strict";us.exports=function(e){return function(s){return e.apply(null,s)}}});var ls=y((co,cs)=>{"use strict";cs.exports=function(e){return typeof e=="object"&&e.isAxiosError===!0}});var hs=y((lo,ft)=>{"use strict";var fs=w(),ii=He(),Ne=is(),oi=ct(),ai=X();function ds(t){var e=new Ne(t),r=ii(Ne.prototype.request,e);return fs.extend(r,Ne.prototype,e),fs.extend(r,e),r.create=function(i){return ds(oi(t,i))},r}var k=ds(ai);k.Axios=Ne;k.Cancel=J();k.CancelToken=as();k.isCancel=at();k.VERSION=ge().version;k.all=function(e){return Promise.all(e)};k.spread=ps();k.isAxiosError=ls();ft.exports=k;ft.exports.default=k});var dt=y((fo,ms)=>{ms.exports=hs()});var _;(function(l){l.NO_API_KEY="No API has been provided. An API key is required to get `pubg.ts`",l.INVALID_API_KEY="An invalid API key has been provided. Please check the key is valid",l.INVALID_SHARD="The shard argument provided is invalid. Please validate you have passed the correct shard value",l.HOOK_FETCH_MATCH="Failed to fetch data for getMatch hook",l.HOOK_FETCH_PLAYER="Failed to fetch data for getPlayer hook",l.HOOK_FETCH_PLAYER_SEASON="Failed to fetch data for getPlayerSeason hook",l.HOOK_FETCH_SAMPLES="Failed to fetch data for getSampels hook",l.HOOK_FETCH_SEASON="Failed to fetch data for getSeason hook",l.HOOK_FETCH_SEASONS="Failed to fetch data for getSeasons hook",l.HOOK_FETCH_STATUS="Failed to fetch the status of the API",l.HOOK_FETCH_TELEMETRY="Failed to fetch data for getTelemetry hook",l.HOOK_FETCH_TOURNAMENT="Failed to fetch data for getTournament hook"})(_||(_={}));var ke;(function(e){e.NOT_FOUND="not-found"})(ke||(ke={}));var pi={[ke.NOT_FOUND]:{detail:"No player(s) found matching the criteria",title:"Not found"}};var Rt;(function(o){o.ALIVE="alive",o.BYPLAYER="byplayer",o.BYZONE="byzone",o.LOGOUT="logout",o.SUICIDE="suicide"})(Rt||(Rt={}));var xt;(function(a){a.BALTIC_MAIN="Baltic_Main",a.DESERT_MAIN="Desert_Main",a.DIHOROTOK_MAIN="DihorOtok_Main",a.ERANGEL_MAIN="Erangel_Main",a.RANGE_MAIN="Range_Main",a.SAVAGE_MAIN="Savage_Main",a.SUMMERLAND_MAIN="Summerland_Main"})(xt||(xt={}));var Pt;(function(a){a.AIROYALE="airoyale",a.ARCADE="arcade",a.CUSTOM="custom",a.EVENT="event",a.OFFICIAL="official",a.SEASONAL="seasonal",a.TRAINING="training"})(Pt||(Pt={}));var Tt;(function(p){p.CONQUEST_DUO="conquest_duo",p.CONQUEST_DUO_FPP="conquest_duo_fpp",p.CONQUEST_SOLO="conquest_solo",p.CONQUEST_SOLO_FPP="conquest_solo_fpp",p.CONQUEST_SQUAD="conquest_squad",p.CONQUEST_SQUAD_FPP="conquest_squad_fpp",p.DUO="duo",p.DUO_FPP="duo_fpp",p.ESPORTS_DUO="esports_duo",p.ESPORTS_DUO_FPP="esports_duo_fpp",p.ESPORTS_SOLO="esports_solo",p.ESPORTS_SOLO_FPP="esports_solo_fpp",p.ESPORTS_SQUAD="esports_squad",p.ESPORTS_SQUAD_FPP="esports_squad_fpp",p.LAB_FPP="lab_fpp",p.LAB_TPP="lab_tpp",p.NORMAL_DUO="normal_duo",p.NORMAL_DUO_FPP="normal_duo_fpp",p.NORMAL_SOLO="normal_solo",p.NORMAL_SOLO_FPP="normal_solo_fpp",p.NORMAL_SQUAD="normal_squad",p.NORMAL_SQUAD_FPP="normal_squad_fpp",p.SOLO="solo",p.SOLO_FPP="solo_fpp",p.SQUAD="squad",p.SQUAD_FPP="squad_fpp",p.TDM="tdm",p.WAR_DUO="war_duo",p.WAR_DUO_FPP="war_duo_fpp",p.WAR_SOLO="war_solo",p.WAR_SOLO_FPP="war_solo_fpp",p.WAR_SQUAD="war_squad",p.WAR_SQUAD_FPP="war_squad_fpp",p.ZOMBIE_DUO="zombie_duo",p.ZOMBIE_DUO_FPP="zombie_duo_fpp",p.ZOMBIE_SOLO="zombie_solo",p.ZOMBIE_SOLO_FPP="zombie_solo_fpp",p.ZOMBIE_SQUAD="zombie_squad",p.ZOMBIE_SQUAD_FPP="zombie_squad_fpp"})(Tt||(Tt={}));var z;(function(a){a.CONSOLE="console",a.KAKAO="kakao",a.PSN="psn",a.STADIA="stadia",a.STEAM="steam",a.TOURNAMENT="tournament",a.XBOX="xbox"})(z||(z={}));var gt;(function(h){h.PC_AS="pc-as",h.PC_EU="pc-eu",h.PC_JP="pc-jp",h.PC_KAKAO="pc-kakao",h.PC_KRJP="pc-krjp",h.PC_NA="pc-na",h.PC_OC="pc-oc",h.PC_RU="pc-ru",h.PC_SA="pc-sa",h.PC_SEA="pc-sea",h.PC_TOURNAMENT="pc-tournament",h.PSN_AS="psn-as",h.PSN_EU="psn-eu",h.PSN_NA="psn-na",h.PSN_OC="psn-oc",h.XBOX_AS="xbox-as",h.XBOX_EU="xbox-eu",h.XBOX_NA="xbox-na",h.XBOX_OC="xbox-oc",h.XBOX_SA="xbox-sa"})(gt||(gt={}));var ae;(function(n){n.ASSET="asset",n.MATCH="match",n.PARTICIPANT="participant",n.PLAYER="player",n.PLAYER_SEASON="playerSeason",n.RANKED_PLAYER_SEASON="rankedplayerstats",n.ROSTER="roster",n.SEASON="season",n.STATUS="status",n.TOURNAMENT="tournament"})(ae||(ae={}));var wt;(function(s){s.CLOSED="closed",s.PREPARE="prepare",s.PROGRESS="progress"})(wt||(wt={}));var qt;(function(u){u.DUO="duo",u.DUO_FPP="duo-fpp",u.SOLO="solo",u.SOLO_FPP="solo-fpp",u.SQUAD="squad",u.SQUAD_FPP="squad-fpp"})(qt||(qt={}));var Ps=class{constructor({apiKey:e,shard:r=z.STEAM}){Be(this,"_apiKey");Be(this,"_shard");if(this._apiKey=e,this._shard=r,!this._apiKey)throw new Error(_.NO_API_KEY);if(this._apiKey.length<=0)throw new Error(_.INVALID_API_KEY)}async getMatch({id:e}){return await Ft({apiKey:this._apiKey,id:e,shard:this._shard})}async getPlayer({id:e,value:r}){return await Nt({apiKey:this._apiKey,id:e,shard:this._shard,value:r})}async getPlayerSeason(e){return await Lt(S({apiKey:this._apiKey,shard:this._shard},e))}async getSamples({createdAt:e}={}){return await Mt({apiKey:this._apiKey,createdAt:e,shard:this._shard})}async getSeason({id:e}={}){return await Ut({apiKey:this._apiKey,id:e,shard:this._shard})}async getSeasons(){return await ye({apiKey:this._apiKey,shard:this._shard})}async getStatus(){return await Dt({apiKey:this._apiKey})}async getTelemetry({url:e}){return await It({apiKey:this._apiKey,url:e})}async getTournament({id:e}={}){return e?await Bt({apiKey:this._apiKey,id:e}):await kt({apiKey:this._apiKey})}};var ys=Ct(dt());var Le={accept:"application/vnd.api+json"},ht="https://api.pubg.com";async function R({apiKey:t,endpoint:e,headers:r={},params:s={},root:i=!1,shard:o=z.STEAM}){if(!Object.values(z).includes(o))throw new Error(_.INVALID_SHARD);let u=i?`${ht}/${e}`:`${ht}/shards/${o}/${e}`;try{let{data:a}=await(0,ys.default)(u,{headers:S(b(S({},Le),{Authorization:`Bearer ${t}`}),r),params:s,responseType:"json"});return a}catch(a){throw console.error(a),a}}async function Ft(r){var s=r,{id:t}=s,e=H(s,["id"]);try{let{data:i,included:o}=await R(b(S({},e),{endpoint:`matches/${t}`}));return b(S({},i.attributes),{assets:i.relationships.assets.data,id:i.id,members:o,type:i.type})}catch(i){throw console.error(_.HOOK_FETCH_MATCH,i),i}}async function Nt(s){var i=s,{id:t=!1,value:e}=i,r=H(i,["id","value"]);let o=Array.isArray(e),u=!o&&t?`players/${e}`:"players",a=t?o?{"filter[playerIds]":e.join(",")}:void 0:{"filter[playerNames]":o?e.join(","):e};try{let{data:f}=await R(b(S({},r),{endpoint:u,params:a}));if(f.length===1){let d=f[0];return b(S({},d.attributes),{assets:d.relationships.assets.data,id:d.id,matches:d.relationships.matches.data,type:d.type})}return f.map(({attributes:d,id:n,relationships:c,type:l})=>b(S({},d),{assets:c.assets.data,id:n,matches:c.matches.data,type:l}))}catch(f){throw console.error(_.HOOK_FETCH_PLAYER,f),f}}async function Lt(i){var o=i,{player:t,ranked:e=!1,season:r}=o,s=H(o,["player","ranked","season"]);var d;let{playerId:u,shard:a}=typeof t=="object"?{playerId:t.id,shard:t.shardId}:{playerId:t,shard:s.shard},f=typeof r=="object"?r.id:r;try{let{data:n}=await R(b(S({},s),{endpoint:`players/${u}/seasons/${f}${e?"/ranked":""}`,shard:a}));switch(n.type){case ae.PLAYER_SEASON:let c=Object.fromEntries(Object.entries(n.relationships).map(([l,x])=>l==="player"||l==="season"?[]:[l,x]));return{bestRankPoint:(d=n.attributes.bestRankPoint)!=null?d:void 0,gamemodeStats:n.attributes.gameModeStats,matches:c,playerId:n.relationships.player.data.id,seasonId:n.relationships.season.data.id,type:n.type};case ae.RANKED_PLAYER_SEASON:return{playerId:n.relationships.player.data.id,rankedGameModeStats:n.attributes.rankedGameModeStats,seasonId:n.relationships.season.data.id,type:n.type}}}catch(n){throw console.error(_.HOOK_FETCH_PLAYER_SEASON,n),n}}async function Mt({apiKey:t,createdAt:e,shard:r}){try{let{data:s}=await R({apiKey:t,endpoint:"samples",params:e?{"filter[createdAt-start]":e.toISOString()}:void 0,shard:r});return b(S({},s.attributes),{id:s.id,matches:s.relationships.matches.data})}catch(s){throw console.error(_.HOOK_FETCH_SAMPLES,s),s}}async function Ut(r){var s=r,{id:t}=s,e=H(s,["id"]);try{return(await ye(S({},e))).find(o=>t?t===o.id:o.isCurrentSeason)}catch(i){throw console.error(_.HOOK_FETCH_SEASON,i),i}}async function ye(t){try{let{data:e}=await R(b(S({},t),{endpoint:"seasons"}));return e.map(({attributes:r,id:s,type:i})=>({id:s,isCurrentSeason:r.isCurrentSeason,isOffseason:r.isOffseason,type:i}))}catch(e){throw console.error(_.HOOK_FETCH_SEASONS,e),e}}async function Dt({apiKey:t}){try{let{data:e}=await R({apiKey:t,endpoint:"status",root:!0});return e}catch(e){throw console.error(_.HOOK_FETCH_STATUS,e),e}}var As=Ct(dt());async function It({apiKey:t,url:e}){try{let{data:r}=await(0,As.default)(e,{headers:b(S({},Le),{Authorization:`Bearer ${t}`}),responseType:"json"});return r}catch(r){throw console.error(_.HOOK_FETCH_TELEMETRY,r),r}}async function Bt({apiKey:t,id:e}){try{let{data:r,included:s}=await R({apiKey:t,endpoint:`tournaments/${e}`,root:!0});return b(S({},r),{matches:s})}catch(r){throw console.error(_.HOOK_FETCH_TOURNAMENT,r),r}}async function kt({apiKey:t}){try{let{data:e}=await R({apiKey:t,endpoint:"tournaments",root:!0});return e.map(({attributes:r,id:s,type:i})=>({createdAt:r.createdAt,id:s,type:i}))}catch(e){throw console.error(_.HOOK_FETCH_TOURNAMENT,e),e}}})(); | ||
`+o),t.push(i+"m+"+Pe.exports.humanize(this.diff)+"[0m")}else t[0]=xn()+e+" "+t[0]}function xn(){return C.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Pn(...t){return process.stderr.write(xe.format(...t)+` | ||
`)}function gn(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function wn(){return process.env.DEBUG}function Tn(t){t.inspectOpts={};let e=Object.keys(C.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=C.inspectOpts[e[r]]}Pe.exports=Xe()(C);var{formatters:Er}=Pe.exports;Er.o=function(t){return this.inspectOpts.colors=this.useColors,xe.inspect(t,this.inspectOpts).split(` | ||
`).map(e=>e.trim()).join(" ")};Er.O=function(t){return this.inspectOpts.colors=this.useColors,xe.inspect(t,this.inspectOpts)}});var Pr=y((eo,et)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?et.exports=vr():et.exports=xr()});var wr=y((to,gr)=>{var ue;gr.exports=function(){if(!ue){try{ue=Pr()("follow-redirects")}catch(t){}typeof ue!="function"&&(ue=function(){})}ue.apply(null,arguments)}});var it=y((ro,nt)=>{var te=q("url"),tt=te.URL,qn=q("http"),Nn=q("https"),Tr=q("stream").Writable,Fn=q("assert"),qr=wr(),Q=["abort","aborted","connect","error","socket","timeout"],rt=Object.create(null);Q.forEach(function(t){rt[t]=function(e,r,s){this._redirectable.emit(t,e,r,s)}});var Ln=ge("ERR_FR_REDIRECTION_FAILURE",""),Mn=ge("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),In=ge("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Dn=ge("ERR_STREAM_WRITE_AFTER_END","write after end");function F(t,e){Tr.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var r=this;this._onNativeResponse=function(s){r._processResponse(s)},this._performRequest()}F.prototype=Object.create(Tr.prototype);F.prototype.abort=function(){Lr(this._currentRequest),this.emit("abort")};F.prototype.write=function(t,e,r){if(this._ending)throw new Dn;if(!(typeof t=="string"||typeof t=="object"&&"length"in t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(typeof e=="function"&&(r=e,e=null),t.length===0){r&&r();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,r)):(this.emit("error",new In),this.abort())};F.prototype.end=function(t,e,r){if(typeof t=="function"?(r=t,t=e=null):typeof e=="function"&&(r=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var s=this,i=this._currentRequest;this.write(t,e,function(){s._ended=!0,i.end(null,null,r)}),this._ending=!0}};F.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)};F.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)};F.prototype.setTimeout=function(t,e){var r=this;function s(u){u.setTimeout(t),u.removeListener("timeout",u.destroy),u.addListener("timeout",u.destroy)}function i(u){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},t),s(u)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),e&&r.removeListener("timeout",e),r.socket||r._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",s),this.once("response",o),this.once("error",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){F.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(F.prototype,t,{get:function(){return this._currentRequest[t]}})});F.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}};F.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e){this.emit("error",new TypeError("Unsupported protocol "+t));return}if(this._options.agents){var r=t.substr(0,t.length-1);this._options.agent=this._options.agents[r]}var s=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=te.format(this._options),s._redirectable=this;for(var i=0;i<Q.length;i++)s.on(Q[i],rt[Q[i]]);if(this._isRedirect){var o=0,u=this,a=this._requestBodyBuffers;(function c(d){if(s===u._currentRequest)if(d)u.emit("error",d);else if(o<a.length){var n=a[o++];s.finished||s.write(n.data,n.encoding,c)}else u._ended&&s.end()})()}};F.prototype._processResponse=function(t){var e=t.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e});var r=t.headers.location;if(r&&this._options.followRedirects!==!1&&e>=300&&e<400){if(Lr(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new Mn);return}((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],st(/^content-/i,this._options.headers));var s=st(/^host$/i,this._options.headers)||te.parse(this._currentUrl).hostname,i=te.resolve(this._currentUrl,r);qr("redirecting to",i),this._isRedirect=!0;var o=te.parse(i);if(Object.assign(this._options,o),o.hostname!==s&&st(/^authorization$/i,this._options.headers),typeof this._options.beforeRedirect=="function"){var u={headers:t.headers};try{this._options.beforeRedirect.call(null,this._options,u)}catch(c){this.emit("error",c);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(c){var a=new Ln("Redirected request failed: "+c.message);a.cause=c,this.emit("error",a)}}else t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[]};function Nr(t){var e={maxRedirects:21,maxBodyLength:10*1024*1024},r={};return Object.keys(t).forEach(function(s){var i=s+":",o=r[i]=t[s],u=e[s]=Object.create(o);function a(d,n,l){if(typeof d=="string"){var f=d;try{d=Fr(new tt(f))}catch(v){d=te.parse(f)}}else tt&&d instanceof tt?d=Fr(d):(l=n,n=d,d={protocol:i});return typeof n=="function"&&(l=n,n=null),n=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},d,n),n.nativeProtocols=r,Fn.equal(n.protocol,i,"protocol mismatch"),qr("options",n),new F(n,l)}function c(d,n,l){var f=u.request(d,n,l);return f.end(),f}Object.defineProperties(u,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function Bn(){}function Fr(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};return t.port!==""&&(e.port=Number(t.port)),e}function st(t,e){var r;for(var s in e)t.test(s)&&(r=e[s],delete e[s]);return r}function ge(t,e){function r(s){Error.captureStackTrace(this,this.constructor),this.message=s||e}return r.prototype=new Error,r.prototype.constructor=r,r.prototype.name="Error ["+t+"]",r.prototype.code=t,r}function Lr(t){for(var e=0;e<Q.length;e++)t.removeListener(Q[e],rt[Q[e]]);t.on("error",Bn),t.abort()}nt.exports=Nr({http:qn,https:Nn});nt.exports.wrap=Nr});var we=y((so,Mr)=>{Mr.exports={version:"0.22.0"}});var Kr=y((no,kr)=>{"use strict";var pe=g(),Ir=$e(),Un=Ye(),kn=be(),Kn=q("http"),jn=q("https"),Hn=it().http,Wn=it().https,Dr=q("url"),zn=q("zlib"),$n=we().version,Te=Se(),ot=_e(),Yn=X(),Qn=J(),Br=/https:?/;function Ur(t,e,r){if(t.hostname=e.host,t.host=e.host,t.port=e.port,t.path=r,e.auth){var s=Buffer.from(e.auth.username+":"+e.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+s}t.beforeRedirect=function(o){o.headers.host=o.host,Ur(o,e,o.href)}}kr.exports=function(e){return new Promise(function(s,i){var o;function u(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}var a=function(A){u(),s(A)},c=function(A){u(),i(A)},d=e.data,n=e.headers,l={};if(Object.keys(n).forEach(function(A){l[A.toLowerCase()]=A}),"user-agent"in l?n[l["user-agent"]]||delete n[l["user-agent"]]:n["User-Agent"]="axios/"+$n,d&&!pe.isStream(d)){if(!Buffer.isBuffer(d))if(pe.isArrayBuffer(d))d=Buffer.from(new Uint8Array(d));else if(pe.isString(d))d=Buffer.from(d,"utf-8");else return c(Te("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));l["content-length"]||(n["Content-Length"]=d.length)}var f=void 0;if(e.auth){var v=e.auth.username||"",M=e.auth.password||"";f=v+":"+M}var O=Un(e.baseURL,e.url),m=Dr.parse(O),S=m.protocol||"http:";if(!f&&m.auth){var x=m.auth.split(":"),ne=x[0]||"",h=x[1]||"";f=ne+":"+h}f&&l.authorization&&delete n[l.authorization];var Me=Br.test(S),ie=Me?e.httpsAgent:e.httpAgent,I={path:kn(m.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:n,agent:ie,agents:{http:e.httpAgent,https:e.httpsAgent},auth:f};e.socketPath?I.socketPath=e.socketPath:(I.hostname=m.hostname,I.port=m.port);var B=e.proxy;if(!B&&B!==!1){var ce=S.slice(0,-1)+"_proxy",mt=process.env[ce]||process.env[ce.toUpperCase()];if(mt){var oe=Dr.parse(mt),yt=process.env.no_proxy||process.env.NO_PROXY,At=!0;if(yt){var _s=yt.split(",").map(function(A){return A.trim()});At=!_s.some(function(A){return A?A==="*"||A[0]==="."&&m.hostname.substr(m.hostname.length-A.length)===A?!0:m.hostname===A:!1})}if(At&&(B={host:oe.hostname,port:oe.port,protocol:oe.protocol},oe.auth)){var bt=oe.auth.split(":");B.auth={username:bt[0],password:bt[1]}}}}B&&(I.headers.host=m.hostname+(m.port?":"+m.port:""),Ur(I,B,S+"//"+m.hostname+(m.port?":"+m.port:"")+I.path));var fe,vt=Me&&(B?Br.test(B.protocol):!0);e.transport?fe=e.transport:e.maxRedirects===0?fe=vt?jn:Kn:(e.maxRedirects&&(I.maxRedirects=e.maxRedirects),fe=vt?Wn:Hn),e.maxBodyLength>-1&&(I.maxBodyLength=e.maxBodyLength),e.insecureHTTPParser&&(I.insecureHTTPParser=e.insecureHTTPParser);var P=fe.request(I,function(A){if(!P.aborted){var H=A,p=A.req||P;if(A.statusCode!==204&&p.method!=="HEAD"&&e.decompress!==!1)switch(A.headers["content-encoding"]){case"gzip":case"compress":case"deflate":H=H.pipe(zn.createUnzip()),delete A.headers["content-encoding"];break}var de={status:A.statusCode,statusText:A.statusMessage,headers:A.headers,config:e,request:p};if(e.responseType==="stream")de.data=H,Ir(a,c,de);else{var _t=[],St=0;H.on("data",function(U){_t.push(U),St+=U.length,e.maxContentLength>-1&&St>e.maxContentLength&&(H.destroy(),c(Te("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,p)))}),H.on("error",function(U){P.aborted||c(ot(U,e,null,p))}),H.on("end",function(){var U=Buffer.concat(_t);e.responseType!=="arraybuffer"&&(U=U.toString(e.responseEncoding),(!e.responseEncoding||e.responseEncoding==="utf8")&&(U=pe.stripBOM(U))),de.data=U,Ir(a,c,de)})}}});if(P.on("error",function(A){P.aborted&&A.code!=="ERR_FR_TOO_MANY_REDIRECTS"||c(ot(A,e,null,P))}),e.timeout){var Ie=parseInt(e.timeout,10);if(isNaN(Ie)){c(Te("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",P));return}P.setTimeout(Ie,function(){P.abort();var A=e.transitional||Yn.transitional;c(Te("timeout of "+Ie+"ms exceeded",e,A.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",P))})}(e.cancelToken||e.signal)&&(o=function(T){P.aborted||(P.abort(),c(!T||T&&T.type?new Qn("canceled"):T))},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o))),pe.isStream(d)?d.on("error",function(A){c(ot(A,e,null,P))}).pipe(P):P.end(d)})}});var X=y((io,Wr)=>{"use strict";var E=g(),jr=Xt(),Vn=_e(),Jn={"Content-Type":"application/x-www-form-urlencoded"};function Hr(t,e){!E.isUndefined(t)&&E.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Xn(){var t;return typeof XMLHttpRequest!="undefined"?t=mr():typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&(t=Kr()),t}function Zn(t,e,r){if(E.isString(t))try{return(e||JSON.parse)(t),E.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var qe={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Xn(),transformRequest:[function(e,r){return jr(r,"Accept"),jr(r,"Content-Type"),E.isFormData(e)||E.isArrayBuffer(e)||E.isBuffer(e)||E.isStream(e)||E.isFile(e)||E.isBlob(e)?e:E.isArrayBufferView(e)?e.buffer:E.isURLSearchParams(e)?(Hr(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):E.isObject(e)||r&&r["Content-Type"]==="application/json"?(Hr(r,"application/json"),Zn(e)):e}],transformResponse:[function(e){var r=this.transitional||qe.transitional,s=r&&r.silentJSONParsing,i=r&&r.forcedJSONParsing,o=!s&&this.responseType==="json";if(o||i&&E.isString(e)&&e.length)try{return JSON.parse(e)}catch(u){if(o)throw u.name==="SyntaxError"?Vn(u,this,"E_JSON_PARSE"):u}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};E.forEach(["delete","get","head"],function(e){qe.headers[e]={}});E.forEach(["post","put","patch"],function(e){qe.headers[e]=E.merge(Jn)});Wr.exports=qe});var $r=y((oo,zr)=>{"use strict";var Gn=g(),ei=X();zr.exports=function(e,r,s){var i=this||ei;return Gn.forEach(s,function(u){e=u.call(i,e,r)}),e}});var at=y((ao,Yr)=>{"use strict";Yr.exports=function(e){return!!(e&&e.__CANCEL__)}});var Jr=y((uo,Vr)=>{"use strict";var Qr=g(),ut=$r(),ti=at(),ri=X(),si=J();function pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new si("canceled")}Vr.exports=function(e){pt(e),e.headers=e.headers||{},e.data=ut.call(e,e.data,e.headers,e.transformRequest),e.headers=Qr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Qr.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var r=e.adapter||ri.adapter;return r(e).then(function(i){return pt(e),i.data=ut.call(e,i.data,i.headers,e.transformResponse),i},function(i){return ti(i)||(pt(e),i&&i.response&&(i.response.data=ut.call(e,i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})}});var lt=y((po,Xr)=>{"use strict";var L=g();Xr.exports=function(e,r){r=r||{};var s={};function i(n,l){return L.isPlainObject(n)&&L.isPlainObject(l)?L.merge(n,l):L.isPlainObject(l)?L.merge({},l):L.isArray(l)?l.slice():l}function o(n){if(L.isUndefined(r[n])){if(!L.isUndefined(e[n]))return i(void 0,e[n])}else return i(e[n],r[n])}function u(n){if(!L.isUndefined(r[n]))return i(void 0,r[n])}function a(n){if(L.isUndefined(r[n])){if(!L.isUndefined(e[n]))return i(void 0,e[n])}else return i(void 0,r[n])}function c(n){if(n in r)return i(e[n],r[n]);if(n in e)return i(void 0,e[n])}var d={url:u,method:u,data:u,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return L.forEach(Object.keys(e).concat(Object.keys(r)),function(l){var f=d[l]||o,v=f(l);L.isUndefined(v)&&f!==c||(s[l]=v)}),s}});var es=y((lo,Gr)=>{"use strict";var ni=we().version,ct={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){ct[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});var Zr={};ct.transitional=function(e,r,s){function i(o,u){return"[Axios v"+ni+"] Transitional option '"+o+"'"+u+(s?". "+s:"")}return function(o,u,a){if(e===!1)throw new Error(i(u," has been removed"+(r?" in "+r:"")));return r&&!Zr[u]&&(Zr[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,u,a):!0}};function ii(t,e,r){if(typeof t!="object")throw new TypeError("options must be an object");for(var s=Object.keys(t),i=s.length;i-- >0;){var o=s[i],u=e[o];if(u){var a=t[o],c=a===void 0||u(a,o,t);if(c!==!0)throw new TypeError("option "+o+" must be "+c);continue}if(r!==!0)throw Error("Unknown option "+o)}}Gr.exports={assertOptions:ii,validators:ct}});var os=y((co,is)=>{"use strict";var ts=g(),oi=be(),rs=Vt(),ss=Jr(),Ne=lt(),ns=es(),re=ns.validators;function le(t){this.defaults=t,this.interceptors={request:new rs,response:new rs}}le.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=Ne(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;r!==void 0&&ns.assertOptions(r,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1);var s=[],i=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(i=i&&f.synchronous,s.unshift(f.fulfilled,f.rejected))});var o=[];this.interceptors.response.forEach(function(f){o.push(f.fulfilled,f.rejected)});var u;if(!i){var a=[ss,void 0];for(Array.prototype.unshift.apply(a,s),a=a.concat(o),u=Promise.resolve(e);a.length;)u=u.then(a.shift(),a.shift());return u}for(var c=e;s.length;){var d=s.shift(),n=s.shift();try{c=d(c)}catch(l){n(l);break}}try{u=ss(c)}catch(l){return Promise.reject(l)}for(;o.length;)u=u.then(o.shift(),o.shift());return u};le.prototype.getUri=function(e){return e=Ne(this.defaults,e),oi(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};ts.forEach(["delete","get","head","options"],function(e){le.prototype[e]=function(r,s){return this.request(Ne(s||{},{method:e,url:r,data:(s||{}).data}))}});ts.forEach(["post","put","patch"],function(e){le.prototype[e]=function(r,s,i){return this.request(Ne(i||{},{method:e,url:r,data:s}))}});is.exports=le});var us=y((fo,as)=>{"use strict";var ai=J();function se(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(i){e=i});var r=this;this.promise.then(function(s){if(!!r._listeners){var i,o=r._listeners.length;for(i=0;i<o;i++)r._listeners[i](s);r._listeners=null}}),this.promise.then=function(s){var i,o=new Promise(function(u){r.subscribe(u),i=u}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i){r.reason||(r.reason=new ai(i),e(r.reason))})}se.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};se.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};se.prototype.unsubscribe=function(e){if(!!this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}};se.source=function(){var e,r=new se(function(i){e=i});return{token:r,cancel:e}};as.exports=se});var ls=y((ho,ps)=>{"use strict";ps.exports=function(e){return function(s){return e.apply(null,s)}}});var fs=y((mo,cs)=>{"use strict";cs.exports=function(e){return typeof e=="object"&&e.isAxiosError===!0}});var ms=y((yo,ft)=>{"use strict";var ds=g(),ui=Ke(),Fe=os(),pi=lt(),li=X();function hs(t){var e=new Fe(t),r=ui(Fe.prototype.request,e);return ds.extend(r,Fe.prototype,e),ds.extend(r,e),r.create=function(i){return hs(pi(t,i))},r}var k=hs(li);k.Axios=Fe;k.Cancel=J();k.CancelToken=us();k.isCancel=at();k.VERSION=we().version;k.all=function(e){return Promise.all(e)};k.spread=ls();k.isAxiosError=fs();ft.exports=k;ft.exports.default=k});var dt=y((Ao,ys)=>{ys.exports=ms()});var W;(function(s){s.NO_API_KEY="No API has been provided. An API key is required to get `pubg.ts`",s.INVALID_API_KEY="An invalid API key has been provided. Please check the key is valid",s.INVALID_SHARD="The shard argument provided is invalid. Please validate you have passed the correct shard value"})(W||(W={}));var ke;(function(e){e.NOT_FOUND="not-found"})(ke||(ke={}));var fi={[ke.NOT_FOUND]:{detail:"No player(s) found matching the criteria",title:"Not found"}};var Et;(function(o){o.ALIVE="alive",o.BYPLAYER="byplayer",o.BYZONE="byzone",o.LOGOUT="logout",o.SUICIDE="suicide"})(Et||(Et={}));var xt;(function(a){a.BALTIC_MAIN="Baltic_Main",a.DESERT_MAIN="Desert_Main",a.DIHOROTOK_MAIN="DihorOtok_Main",a.ERANGEL_MAIN="Erangel_Main",a.RANGE_MAIN="Range_Main",a.SAVAGE_MAIN="Savage_Main",a.SUMMERLAND_MAIN="Summerland_Main"})(xt||(xt={}));var Pt;(function(a){a.AIROYALE="airoyale",a.ARCADE="arcade",a.CUSTOM="custom",a.EVENT="event",a.OFFICIAL="official",a.SEASONAL="seasonal",a.TRAINING="training"})(Pt||(Pt={}));var gt;(function(p){p.CONQUEST_DUO="conquest_duo",p.CONQUEST_DUO_FPP="conquest_duo_fpp",p.CONQUEST_SOLO="conquest_solo",p.CONQUEST_SOLO_FPP="conquest_solo_fpp",p.CONQUEST_SQUAD="conquest_squad",p.CONQUEST_SQUAD_FPP="conquest_squad_fpp",p.DUO="duo",p.DUO_FPP="duo_fpp",p.ESPORTS_DUO="esports_duo",p.ESPORTS_DUO_FPP="esports_duo_fpp",p.ESPORTS_SOLO="esports_solo",p.ESPORTS_SOLO_FPP="esports_solo_fpp",p.ESPORTS_SQUAD="esports_squad",p.ESPORTS_SQUAD_FPP="esports_squad_fpp",p.LAB_FPP="lab_fpp",p.LAB_TPP="lab_tpp",p.NORMAL_DUO="normal_duo",p.NORMAL_DUO_FPP="normal_duo_fpp",p.NORMAL_SOLO="normal_solo",p.NORMAL_SOLO_FPP="normal_solo_fpp",p.NORMAL_SQUAD="normal_squad",p.NORMAL_SQUAD_FPP="normal_squad_fpp",p.SOLO="solo",p.SOLO_FPP="solo_fpp",p.SQUAD="squad",p.SQUAD_FPP="squad_fpp",p.TDM="tdm",p.WAR_DUO="war_duo",p.WAR_DUO_FPP="war_duo_fpp",p.WAR_SOLO="war_solo",p.WAR_SOLO_FPP="war_solo_fpp",p.WAR_SQUAD="war_squad",p.WAR_SQUAD_FPP="war_squad_fpp",p.ZOMBIE_DUO="zombie_duo",p.ZOMBIE_DUO_FPP="zombie_duo_fpp",p.ZOMBIE_SOLO="zombie_solo",p.ZOMBIE_SOLO_FPP="zombie_solo_fpp",p.ZOMBIE_SQUAD="zombie_squad",p.ZOMBIE_SQUAD_FPP="zombie_squad_fpp"})(gt||(gt={}));var z;(function(a){a.CONSOLE="console",a.KAKAO="kakao",a.PSN="psn",a.STADIA="stadia",a.STEAM="steam",a.TOURNAMENT="tournament",a.XBOX="xbox"})(z||(z={}));var wt;(function(h){h.PC_AS="pc-as",h.PC_EU="pc-eu",h.PC_JP="pc-jp",h.PC_KAKAO="pc-kakao",h.PC_KRJP="pc-krjp",h.PC_NA="pc-na",h.PC_OC="pc-oc",h.PC_RU="pc-ru",h.PC_SA="pc-sa",h.PC_SEA="pc-sea",h.PC_TOURNAMENT="pc-tournament",h.PSN_AS="psn-as",h.PSN_EU="psn-eu",h.PSN_NA="psn-na",h.PSN_OC="psn-oc",h.XBOX_AS="xbox-as",h.XBOX_EU="xbox-eu",h.XBOX_NA="xbox-na",h.XBOX_OC="xbox-oc",h.XBOX_SA="xbox-sa"})(wt||(wt={}));var ae;(function(n){n.ASSET="asset",n.MATCH="match",n.PARTICIPANT="participant",n.PLAYER="player",n.PLAYER_SEASON="playerSeason",n.RANKED_PLAYER_SEASON="rankedplayerstats",n.ROSTER="roster",n.SEASON="season",n.STATUS="status",n.TOURNAMENT="tournament"})(ae||(ae={}));var Tt;(function(s){s.CLOSED="closed",s.PREPARE="prepare",s.PROGRESS="progress"})(Tt||(Tt={}));var qt;(function(u){u.DUO="duo",u.DUO_FPP="duo-fpp",u.SOLO="solo",u.SOLO_FPP="solo-fpp",u.SQUAD="squad",u.SQUAD_FPP="squad-fpp"})(qt||(qt={}));var ws=class{constructor({apiKey:e,shard:r=z.STEAM}){Ue(this,"_apiKey");Ue(this,"_shard");if(this._apiKey=e,this._shard=r,!this._apiKey)throw new Error(W.NO_API_KEY);if(this._apiKey.length<=0)throw new Error(W.INVALID_API_KEY)}async getMatch({id:e}){return await Nt({apiKey:this._apiKey,id:e,shard:this._shard})}async getPlayer({id:e,skipFailed:r,value:s}){return await Ft({apiKey:this._apiKey,id:e,shard:this._shard,skipFailed:r,value:s})}async getPlayerSeason(e){return await Lt(b({apiKey:this._apiKey,shard:this._shard},e))}async getSamples({createdAt:e}={}){return await Mt({apiKey:this._apiKey,createdAt:e,shard:this._shard})}async getSeason({id:e}={}){return await It({apiKey:this._apiKey,id:e,shard:this._shard})}async getSeasons(){return await ye({apiKey:this._apiKey,shard:this._shard})}async getStatus(){return await Dt({apiKey:this._apiKey})}async getTelemetry({url:e}){return await Bt({apiKey:this._apiKey,url:e})}async getTournament({id:e}={}){return e?await Ut({apiKey:this._apiKey,id:e}):await kt({apiKey:this._apiKey})}};var Ts=10;function Kt(t,e=Ts){let r=[];for(;t.length;)r.push(t.splice(0,e));return r}var As=Ct(dt());var Le={accept:"application/vnd.api+json"},ht="https://api.pubg.com";async function w({apiKey:t,endpoint:e,headers:r={},params:s={},root:i=!1,shard:o=z.STEAM}){if(!Object.values(z).includes(o))throw new Error(W.INVALID_SHARD);let u=i?`${ht}/${e}`:`${ht}/shards/${o}/${e}`;try{return{data:(await(0,As.default)(u,{headers:b(_(b({},Le),{Authorization:`Bearer ${t}`}),r),params:s,responseType:"json"})).data,error:null}}catch({response:a}){let{data:c,status:d}=a,n=c.errors[0];return console.error(`${n.title}: ${n.detail}`),{data:null,error:n,status:d}}}async function bs(t){let e=await Promise.all(t.map(r=>w(r)));return e.forEach(r=>{if(r.error)return r}),e}async function Nt(r){var s=r,{id:t}=s,e=K(s,["id"]);let i=await w(_(b({},e),{endpoint:`matches/${t}`}));if(i.error)return i;let{data:o,included:u}=i.data;return{data:_(b({},o.attributes),{assets:o.relationships.assets.data,id:o.id,members:u,type:o.type}),error:null}}async function Ft(i){var o=i,{id:t=!1,skipFailed:e=!1,value:r}=o,s=K(o,["id","skipFailed","value"]);let u=Array.isArray(r),a=!u&&t?`players/${r}`:"players",c=u?Kt([...r]).map(f=>_(b({},s),{endpoint:a,params:{[`filter[${t?"playerIds":"playerNames"}]`]:f.join(",")}})):[_(b({},s),{endpoint:a,params:t?void 0:{"filter[playerNames]":r}})],d=await bs(c),n=d.find(f=>f.error!==null);if(n&&n.error)return n;let l=d.map(({data:f})=>f.data).flat();return!e&&u&&r.length!==l.length?{data:null,error:{title:"Failed data length validation",detail:"Input array length does not match response length. Some data might be missing from the response."},status:400}:{data:l.map(({attributes:f,id:v,relationships:M,type:O})=>_(b({},f),{assets:M.assets.data,id:v,matches:M.matches.data,type:O})),error:null}}async function Lt(i){var o=i,{player:t,ranked:e=!1,season:r}=o,s=K(o,["player","ranked","season"]);var l;let{playerId:u,shard:a}=typeof t=="object"?{playerId:t.id,shard:t.shardId}:{playerId:t,shard:s.shard},c=typeof r=="object"?r.id:r,d=await w(_(b({},s),{endpoint:`players/${u}/seasons/${c}${e?"/ranked":""}`,shard:a}));if(d.error)return d;let{data:n}=d.data;switch(n.type){case ae.PLAYER_SEASON:let f=Object.fromEntries(Object.entries(n.relationships).map(([v,M])=>v==="player"||v==="season"?[]:[v,M]));return{data:{bestRankPoint:(l=n.attributes.bestRankPoint)!=null?l:void 0,gamemodeStats:n.attributes.gameModeStats,matches:f,playerId:n.relationships.player.data.id,seasonId:n.relationships.season.data.id,type:n.type},error:null};case ae.RANKED_PLAYER_SEASON:return{data:{playerId:n.relationships.player.data.id,rankedGameModeStats:n.attributes.rankedGameModeStats,seasonId:n.relationships.season.data.id,type:n.type},error:null}}}async function Mt({apiKey:t,createdAt:e,shard:r}){let s=await w({apiKey:t,endpoint:"samples",params:e?{"filter[createdAt-start]":e.toISOString()}:void 0,shard:r});if(s.error)return s;let{data:i}=s.data;return{data:_(b({},i.attributes),{id:i.id,matches:i.relationships.matches.data}),error:null}}async function It(r){var s=r,{id:t}=s,e=K(s,["id"]);let i=await ye(b({},e));return i.error?i:{data:i.data.find(o=>t?t===o.id:o.isCurrentSeason),error:null}}async function ye(t){let e=await w(_(b({},t),{endpoint:"seasons"}));if(e.error)return e;let{data:r}=e.data;return{data:r.map(({attributes:s,id:i,type:o})=>({id:i,isCurrentSeason:s.isCurrentSeason,isOffseason:s.isOffseason,type:o})),error:null}}async function Dt({apiKey:t}){let e=await w({apiKey:t,endpoint:"status",root:!0});return e.error?e:{data:e.data.data,error:null}}var vs=Ct(dt());async function Bt({apiKey:t,url:e}){let r=await(0,vs.default)(e,{headers:_(b({},Le),{Authorization:`Bearer ${t}`}),responseType:"json"});return"error"in r?r:r.data}async function Ut({apiKey:t,id:e}){let r=await w({apiKey:t,endpoint:`tournaments/${e}`,root:!0});if(r.error)return r;let{data:s,included:i}=r.data;return{data:_(b({},s),{matches:i}),error:null}}async function kt({apiKey:t}){let e=await w({apiKey:t,endpoint:"tournaments",root:!0});if(e.error)return e;let{data:r}=e.data;return{data:r.map(({attributes:s,id:i,type:o})=>({createdAt:s.createdAt,id:i,type:o})),error:null}}})(); | ||
//# sourceMappingURL=index.global.js.map |
@@ -1,2 +0,2 @@ | ||
var et=Object.create;var b=Object.defineProperty,rt=Object.defineProperties,st=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertyNames,E=Object.getOwnPropertySymbols,ot=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var N=(r,t,s)=>t in r?b(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s,A=(r,t)=>{for(var s in t||(t={}))g.call(t,s)&&N(r,s,t[s]);if(E)for(var s of E(t))X.call(t,s)&&N(r,s,t[s]);return r},y=(r,t)=>rt(r,nt(t)),z=r=>b(r,"__esModule",{value:!0});var f=(r,t)=>{var s={};for(var a in r)g.call(r,a)&&t.indexOf(a)<0&&(s[a]=r[a]);if(r!=null&&E)for(var a of E(r))t.indexOf(a)<0&&X.call(r,a)&&(s[a]=r[a]);return s};var it=(r,t)=>{z(r);for(var s in t)b(r,s,{get:t[s],enumerable:!0})},pt=(r,t,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of at(t))!g.call(r,a)&&a!=="default"&&b(r,a,{get:()=>t[a],enumerable:!(s=st(t,a))||s.enumerable});return r},V=r=>pt(z(b(r!=null?et(ot(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var M=(r,t,s)=>(N(r,typeof t!="symbol"?t+"":t,s),s);it(exports,{Client:()=>Z,DeathType:()=>k,ErrorCode:()=>u,GameModeStatGamemode:()=>U,Gamemode:()=>I,Map:()=>w,MatchType:()=>D,PlayerErrors:()=>ut,Region:()=>F,ResponseObjectType:()=>P,SeasonState:()=>L,Shard:()=>O,getMatch:()=>C,getPlayer:()=>H,getPlayerSeason:()=>B,getSamples:()=>W,getSeason:()=>v,getSeasons:()=>x,getStatus:()=>q,getTelemetry:()=>Y,getTournament:()=>Q,getTournaments:()=>j});var c=typeof document=="undefined"?new(require("url")).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var u;(function(p){p.NO_API_KEY="No API has been provided. An API key is required to get `pubg.ts`",p.INVALID_API_KEY="An invalid API key has been provided. Please check the key is valid",p.INVALID_SHARD="The shard argument provided is invalid. Please validate you have passed the correct shard value",p.HOOK_FETCH_MATCH="Failed to fetch data for getMatch hook",p.HOOK_FETCH_PLAYER="Failed to fetch data for getPlayer hook",p.HOOK_FETCH_PLAYER_SEASON="Failed to fetch data for getPlayerSeason hook",p.HOOK_FETCH_SAMPLES="Failed to fetch data for getSampels hook",p.HOOK_FETCH_SEASON="Failed to fetch data for getSeason hook",p.HOOK_FETCH_SEASONS="Failed to fetch data for getSeasons hook",p.HOOK_FETCH_STATUS="Failed to fetch the status of the API",p.HOOK_FETCH_TELEMETRY="Failed to fetch data for getTelemetry hook",p.HOOK_FETCH_TOURNAMENT="Failed to fetch data for getTournament hook"})(u||(u={}));var K;(function(t){t.NOT_FOUND="not-found"})(K||(K={}));var ut={[K.NOT_FOUND]:{detail:"No player(s) found matching the criteria",title:"Not found"}};var k;(function(l){l.ALIVE="alive",l.BYPLAYER="byplayer",l.BYZONE="byzone",l.LOGOUT="logout",l.SUICIDE="suicide"})(k||(k={}));var w;(function(n){n.BALTIC_MAIN="Baltic_Main",n.DESERT_MAIN="Desert_Main",n.DIHOROTOK_MAIN="DihorOtok_Main",n.ERANGEL_MAIN="Erangel_Main",n.RANGE_MAIN="Range_Main",n.SAVAGE_MAIN="Savage_Main",n.SUMMERLAND_MAIN="Summerland_Main"})(w||(w={}));var D;(function(n){n.AIROYALE="airoyale",n.ARCADE="arcade",n.CUSTOM="custom",n.EVENT="event",n.OFFICIAL="official",n.SEASONAL="seasonal",n.TRAINING="training"})(D||(D={}));var I;(function(e){e.CONQUEST_DUO="conquest_duo",e.CONQUEST_DUO_FPP="conquest_duo_fpp",e.CONQUEST_SOLO="conquest_solo",e.CONQUEST_SOLO_FPP="conquest_solo_fpp",e.CONQUEST_SQUAD="conquest_squad",e.CONQUEST_SQUAD_FPP="conquest_squad_fpp",e.DUO="duo",e.DUO_FPP="duo_fpp",e.ESPORTS_DUO="esports_duo",e.ESPORTS_DUO_FPP="esports_duo_fpp",e.ESPORTS_SOLO="esports_solo",e.ESPORTS_SOLO_FPP="esports_solo_fpp",e.ESPORTS_SQUAD="esports_squad",e.ESPORTS_SQUAD_FPP="esports_squad_fpp",e.LAB_FPP="lab_fpp",e.LAB_TPP="lab_tpp",e.NORMAL_DUO="normal_duo",e.NORMAL_DUO_FPP="normal_duo_fpp",e.NORMAL_SOLO="normal_solo",e.NORMAL_SOLO_FPP="normal_solo_fpp",e.NORMAL_SQUAD="normal_squad",e.NORMAL_SQUAD_FPP="normal_squad_fpp",e.SOLO="solo",e.SOLO_FPP="solo_fpp",e.SQUAD="squad",e.SQUAD_FPP="squad_fpp",e.TDM="tdm",e.WAR_DUO="war_duo",e.WAR_DUO_FPP="war_duo_fpp",e.WAR_SOLO="war_solo",e.WAR_SOLO_FPP="war_solo_fpp",e.WAR_SQUAD="war_squad",e.WAR_SQUAD_FPP="war_squad_fpp",e.ZOMBIE_DUO="zombie_duo",e.ZOMBIE_DUO_FPP="zombie_duo_fpp",e.ZOMBIE_SOLO="zombie_solo",e.ZOMBIE_SOLO_FPP="zombie_solo_fpp",e.ZOMBIE_SQUAD="zombie_squad",e.ZOMBIE_SQUAD_FPP="zombie_squad_fpp"})(I||(I={}));var O;(function(n){n.CONSOLE="console",n.KAKAO="kakao",n.PSN="psn",n.STADIA="stadia",n.STEAM="steam",n.TOURNAMENT="tournament",n.XBOX="xbox"})(O||(O={}));var F;(function(o){o.PC_AS="pc-as",o.PC_EU="pc-eu",o.PC_JP="pc-jp",o.PC_KAKAO="pc-kakao",o.PC_KRJP="pc-krjp",o.PC_NA="pc-na",o.PC_OC="pc-oc",o.PC_RU="pc-ru",o.PC_SA="pc-sa",o.PC_SEA="pc-sea",o.PC_TOURNAMENT="pc-tournament",o.PSN_AS="psn-as",o.PSN_EU="psn-eu",o.PSN_NA="psn-na",o.PSN_OC="psn-oc",o.XBOX_AS="xbox-as",o.XBOX_EU="xbox-eu",o.XBOX_NA="xbox-na",o.XBOX_OC="xbox-oc",o.XBOX_SA="xbox-sa"})(F||(F={}));var P;(function(i){i.ASSET="asset",i.MATCH="match",i.PARTICIPANT="participant",i.PLAYER="player",i.PLAYER_SEASON="playerSeason",i.RANKED_PLAYER_SEASON="rankedplayerstats",i.ROSTER="roster",i.SEASON="season",i.STATUS="status",i.TOURNAMENT="tournament"})(P||(P={}));var L;(function(a){a.CLOSED="closed",a.PREPARE="prepare",a.PROGRESS="progress"})(L||(L={}));var U;(function(S){S.DUO="duo",S.DUO_FPP="duo-fpp",S.SOLO="solo",S.SOLO_FPP="solo-fpp",S.SQUAD="squad",S.SQUAD_FPP="squad-fpp"})(U||(U={}));var Z=class{constructor({apiKey:t,shard:s=O.STEAM}){M(this,"_apiKey");M(this,"_shard");if(this._apiKey=t,this._shard=s,!this._apiKey)throw new Error(u.NO_API_KEY);if(this._apiKey.length<=0)throw new Error(u.INVALID_API_KEY)}async getMatch({id:t}){return await C({apiKey:this._apiKey,id:t,shard:this._shard})}async getPlayer({id:t,value:s}){return await H({apiKey:this._apiKey,id:t,shard:this._shard,value:s})}async getPlayerSeason(t){return await B(A({apiKey:this._apiKey,shard:this._shard},t))}async getSamples({createdAt:t}={}){return await W({apiKey:this._apiKey,createdAt:t,shard:this._shard})}async getSeason({id:t}={}){return await v({apiKey:this._apiKey,id:t,shard:this._shard})}async getSeasons(){return await x({apiKey:this._apiKey,shard:this._shard})}async getStatus(){return await q({apiKey:this._apiKey})}async getTelemetry({url:t}){return await Y({apiKey:this._apiKey,url:t})}async getTournament({id:t}={}){return t?await Q({apiKey:this._apiKey,id:t}):await j({apiKey:this._apiKey})}};var J=V(require("axios"));var R={accept:"application/vnd.api+json"},$="https://api.pubg.com";async function d({apiKey:r,endpoint:t,headers:s={},params:a={},root:m=!1,shard:l=O.STEAM}){if(!Object.values(O).includes(l))throw new Error(u.INVALID_SHARD);let S=m?`${$}/${t}`:`${$}/shards/${l}/${t}`;try{let{data:n}=await(0,J.default)(S,{headers:A(y(A({},R),{Authorization:`Bearer ${r}`}),s),params:a,responseType:"json"});return n}catch(n){throw console.error(n),n}}async function C(s){var a=s,{id:r}=a,t=f(a,["id"]);try{let{data:m,included:l}=await d(y(A({},t),{endpoint:`matches/${r}`}));return y(A({},m.attributes),{assets:m.relationships.assets.data,id:m.id,members:l,type:m.type})}catch(m){throw console.error(u.HOOK_FETCH_MATCH,m),m}}async function H(a){var m=a,{id:r=!1,value:t}=m,s=f(m,["id","value"]);let l=Array.isArray(t),S=!l&&r?`players/${t}`:"players",n=r?l?{"filter[playerIds]":t.join(",")}:void 0:{"filter[playerNames]":l?t.join(","):t};try{let{data:_}=await d(y(A({},s),{endpoint:S,params:n}));if(_.length===1){let h=_[0];return y(A({},h.attributes),{assets:h.relationships.assets.data,id:h.id,matches:h.relationships.matches.data,type:h.type})}return _.map(({attributes:h,id:i,relationships:T,type:p})=>y(A({},h),{assets:T.assets.data,id:i,matches:T.matches.data,type:p}))}catch(_){throw console.error(u.HOOK_FETCH_PLAYER,_),_}}async function B(m){var l=m,{player:r,ranked:t=!1,season:s}=l,a=f(l,["player","ranked","season"]);var h;let{playerId:S,shard:n}=typeof r=="object"?{playerId:r.id,shard:r.shardId}:{playerId:r,shard:a.shard},_=typeof s=="object"?s.id:s;try{let{data:i}=await d(y(A({},a),{endpoint:`players/${S}/seasons/${_}${t?"/ranked":""}`,shard:n}));switch(i.type){case P.PLAYER_SEASON:let T=Object.fromEntries(Object.entries(i.relationships).map(([p,tt])=>p==="player"||p==="season"?[]:[p,tt]));return{bestRankPoint:(h=i.attributes.bestRankPoint)!=null?h:void 0,gamemodeStats:i.attributes.gameModeStats,matches:T,playerId:i.relationships.player.data.id,seasonId:i.relationships.season.data.id,type:i.type};case P.RANKED_PLAYER_SEASON:return{playerId:i.relationships.player.data.id,rankedGameModeStats:i.attributes.rankedGameModeStats,seasonId:i.relationships.season.data.id,type:i.type}}}catch(i){throw console.error(u.HOOK_FETCH_PLAYER_SEASON,i),i}}async function W({apiKey:r,createdAt:t,shard:s}){try{let{data:a}=await d({apiKey:r,endpoint:"samples",params:t?{"filter[createdAt-start]":t.toISOString()}:void 0,shard:s});return y(A({},a.attributes),{id:a.id,matches:a.relationships.matches.data})}catch(a){throw console.error(u.HOOK_FETCH_SAMPLES,a),a}}async function v(s){var a=s,{id:r}=a,t=f(a,["id"]);try{return(await x(A({},t))).find(l=>r?r===l.id:l.isCurrentSeason)}catch(m){throw console.error(u.HOOK_FETCH_SEASON,m),m}}async function x(r){try{let{data:t}=await d(y(A({},r),{endpoint:"seasons"}));return t.map(({attributes:s,id:a,type:m})=>({id:a,isCurrentSeason:s.isCurrentSeason,isOffseason:s.isOffseason,type:m}))}catch(t){throw console.error(u.HOOK_FETCH_SEASONS,t),t}}async function q({apiKey:r}){try{let{data:t}=await d({apiKey:r,endpoint:"status",root:!0});return t}catch(t){throw console.error(u.HOOK_FETCH_STATUS,t),t}}var G=V(require("axios"));async function Y({apiKey:r,url:t}){try{let{data:s}=await(0,G.default)(t,{headers:y(A({},R),{Authorization:`Bearer ${r}`}),responseType:"json"});return s}catch(s){throw console.error(u.HOOK_FETCH_TELEMETRY,s),s}}async function Q({apiKey:r,id:t}){try{let{data:s,included:a}=await d({apiKey:r,endpoint:`tournaments/${t}`,root:!0});return y(A({},s),{matches:a})}catch(s){throw console.error(u.HOOK_FETCH_TOURNAMENT,s),s}}async function j({apiKey:r}){try{let{data:t}=await d({apiKey:r,endpoint:"tournaments",root:!0});return t.map(({attributes:s,id:a,type:m})=>({createdAt:s.createdAt,id:a,type:m}))}catch(t){throw console.error(u.HOOK_FETCH_TOURNAMENT,t),t}}0&&(module.exports={Client,DeathType,ErrorCode,GameModeStatGamemode,Gamemode,Map,MatchType,PlayerErrors,Region,ResponseObjectType,SeasonState,Shard,getMatch,getPlayer,getPlayerSeason,getSamples,getSeason,getSeasons,getStatus,getTelemetry,getTournament,getTournaments}); | ||
var ae=Object.create;var R=Object.defineProperty,ie=Object.defineProperties,oe=Object.getOwnPropertyDescriptor,pe=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,le=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var k=(r,e,s)=>e in r?R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s,l=(r,e)=>{for(var s in e||(e={}))M.call(e,s)&&k(r,s,e[s]);if(g)for(var s of g(e))V.call(e,s)&&k(r,s,e[s]);return r},A=(r,e)=>ie(r,pe(e)),Z=r=>R(r,"__esModule",{value:!0});var f=(r,e)=>{var s={};for(var n in r)M.call(r,n)&&e.indexOf(n)<0&&(s[n]=r[n]);if(r!=null&&g)for(var n of g(r))e.indexOf(n)<0&&V.call(r,n)&&(s[n]=r[n]);return s};var ce=(r,e)=>{Z(r);for(var s in e)R(r,s,{get:e[s],enumerable:!0})},me=(r,e,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ue(e))!M.call(r,n)&&n!=="default"&&R(r,n,{get:()=>e[n],enumerable:!(s=oe(e,n))||s.enumerable});return r},J=r=>me(Z(R(r!=null?ae(le(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var I=(r,e,s)=>(k(r,typeof e!="symbol"?e+"":e,s),s);ce(exports,{Client:()=>G,DeathType:()=>K,ErrorCode:()=>h,GameModeStatGamemode:()=>B,Gamemode:()=>L,Map:()=>w,MatchType:()=>U,PlayerErrors:()=>Ae,Region:()=>C,ResponseObjectType:()=>_,SeasonState:()=>F,Shard:()=>P,getMatch:()=>v,getPlayer:()=>W,getPlayerSeason:()=>q,getSamples:()=>Q,getSeason:()=>Y,getSeasons:()=>T,getStatus:()=>$,getTelemetry:()=>j,getTournament:()=>X,getTournaments:()=>H});var u=typeof document=="undefined"?new(require("url")).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var h;(function(n){n.NO_API_KEY="No API has been provided. An API key is required to get `pubg.ts`",n.INVALID_API_KEY="An invalid API key has been provided. Please check the key is valid",n.INVALID_SHARD="The shard argument provided is invalid. Please validate you have passed the correct shard value"})(h||(h={}));var D;(function(e){e.NOT_FOUND="not-found"})(D||(D={}));var Ae={[D.NOT_FOUND]:{detail:"No player(s) found matching the criteria",title:"Not found"}};var K;(function(p){p.ALIVE="alive",p.BYPLAYER="byplayer",p.BYZONE="byzone",p.LOGOUT="logout",p.SUICIDE="suicide"})(K||(K={}));var w;(function(a){a.BALTIC_MAIN="Baltic_Main",a.DESERT_MAIN="Desert_Main",a.DIHOROTOK_MAIN="DihorOtok_Main",a.ERANGEL_MAIN="Erangel_Main",a.RANGE_MAIN="Range_Main",a.SAVAGE_MAIN="Savage_Main",a.SUMMERLAND_MAIN="Summerland_Main"})(w||(w={}));var U;(function(a){a.AIROYALE="airoyale",a.ARCADE="arcade",a.CUSTOM="custom",a.EVENT="event",a.OFFICIAL="official",a.SEASONAL="seasonal",a.TRAINING="training"})(U||(U={}));var L;(function(t){t.CONQUEST_DUO="conquest_duo",t.CONQUEST_DUO_FPP="conquest_duo_fpp",t.CONQUEST_SOLO="conquest_solo",t.CONQUEST_SOLO_FPP="conquest_solo_fpp",t.CONQUEST_SQUAD="conquest_squad",t.CONQUEST_SQUAD_FPP="conquest_squad_fpp",t.DUO="duo",t.DUO_FPP="duo_fpp",t.ESPORTS_DUO="esports_duo",t.ESPORTS_DUO_FPP="esports_duo_fpp",t.ESPORTS_SOLO="esports_solo",t.ESPORTS_SOLO_FPP="esports_solo_fpp",t.ESPORTS_SQUAD="esports_squad",t.ESPORTS_SQUAD_FPP="esports_squad_fpp",t.LAB_FPP="lab_fpp",t.LAB_TPP="lab_tpp",t.NORMAL_DUO="normal_duo",t.NORMAL_DUO_FPP="normal_duo_fpp",t.NORMAL_SOLO="normal_solo",t.NORMAL_SOLO_FPP="normal_solo_fpp",t.NORMAL_SQUAD="normal_squad",t.NORMAL_SQUAD_FPP="normal_squad_fpp",t.SOLO="solo",t.SOLO_FPP="solo_fpp",t.SQUAD="squad",t.SQUAD_FPP="squad_fpp",t.TDM="tdm",t.WAR_DUO="war_duo",t.WAR_DUO_FPP="war_duo_fpp",t.WAR_SOLO="war_solo",t.WAR_SOLO_FPP="war_solo_fpp",t.WAR_SQUAD="war_squad",t.WAR_SQUAD_FPP="war_squad_fpp",t.ZOMBIE_DUO="zombie_duo",t.ZOMBIE_DUO_FPP="zombie_duo_fpp",t.ZOMBIE_SOLO="zombie_solo",t.ZOMBIE_SOLO_FPP="zombie_solo_fpp",t.ZOMBIE_SQUAD="zombie_squad",t.ZOMBIE_SQUAD_FPP="zombie_squad_fpp"})(L||(L={}));var P;(function(a){a.CONSOLE="console",a.KAKAO="kakao",a.PSN="psn",a.STADIA="stadia",a.STEAM="steam",a.TOURNAMENT="tournament",a.XBOX="xbox"})(P||(P={}));var C;(function(o){o.PC_AS="pc-as",o.PC_EU="pc-eu",o.PC_JP="pc-jp",o.PC_KAKAO="pc-kakao",o.PC_KRJP="pc-krjp",o.PC_NA="pc-na",o.PC_OC="pc-oc",o.PC_RU="pc-ru",o.PC_SA="pc-sa",o.PC_SEA="pc-sea",o.PC_TOURNAMENT="pc-tournament",o.PSN_AS="psn-as",o.PSN_EU="psn-eu",o.PSN_NA="psn-na",o.PSN_OC="psn-oc",o.XBOX_AS="xbox-as",o.XBOX_EU="xbox-eu",o.XBOX_NA="xbox-na",o.XBOX_OC="xbox-oc",o.XBOX_SA="xbox-sa"})(C||(C={}));var _;(function(i){i.ASSET="asset",i.MATCH="match",i.PARTICIPANT="participant",i.PLAYER="player",i.PLAYER_SEASON="playerSeason",i.RANKED_PLAYER_SEASON="rankedplayerstats",i.ROSTER="roster",i.SEASON="season",i.STATUS="status",i.TOURNAMENT="tournament"})(_||(_={}));var F;(function(n){n.CLOSED="closed",n.PREPARE="prepare",n.PROGRESS="progress"})(F||(F={}));var B;(function(c){c.DUO="duo",c.DUO_FPP="duo-fpp",c.SOLO="solo",c.SOLO_FPP="solo-fpp",c.SQUAD="squad",c.SQUAD_FPP="squad-fpp"})(B||(B={}));var G=class{constructor({apiKey:e,shard:s=P.STEAM}){I(this,"_apiKey");I(this,"_shard");if(this._apiKey=e,this._shard=s,!this._apiKey)throw new Error(h.NO_API_KEY);if(this._apiKey.length<=0)throw new Error(h.INVALID_API_KEY)}async getMatch({id:e}){return await v({apiKey:this._apiKey,id:e,shard:this._shard})}async getPlayer({id:e,skipFailed:s,value:n}){return await W({apiKey:this._apiKey,id:e,shard:this._shard,skipFailed:s,value:n})}async getPlayerSeason(e){return await q(l({apiKey:this._apiKey,shard:this._shard},e))}async getSamples({createdAt:e}={}){return await Q({apiKey:this._apiKey,createdAt:e,shard:this._shard})}async getSeason({id:e}={}){return await Y({apiKey:this._apiKey,id:e,shard:this._shard})}async getSeasons(){return await T({apiKey:this._apiKey,shard:this._shard})}async getStatus(){return await $({apiKey:this._apiKey})}async getTelemetry({url:e}){return await j({apiKey:this._apiKey,url:e})}async getTournament({id:e}={}){return e?await X({apiKey:this._apiKey,id:e}):await H({apiKey:this._apiKey})}};var ye=10;function ee(r,e=ye){let s=[];for(;r.length;)s.push(r.splice(0,e));return s}var te=J(require("axios"));var N={accept:"application/vnd.api+json"},z="https://api.pubg.com";async function y({apiKey:r,endpoint:e,headers:s={},params:n={},root:m=!1,shard:p=P.STEAM}){if(!Object.values(P).includes(p))throw new Error(h.INVALID_SHARD);let c=m?`${z}/${e}`:`${z}/shards/${p}/${e}`;try{return{data:(await(0,te.default)(c,{headers:l(A(l({},N),{Authorization:`Bearer ${r}`}),s),params:n,responseType:"json"})).data,error:null}}catch({response:a}){let{data:O,status:S}=a,i=O.errors[0];return console.error(`${i.title}: ${i.detail}`),{data:null,error:i,status:S}}}async function re(r){let e=await Promise.all(r.map(s=>y(s)));return e.forEach(s=>{if(s.error)return s}),e}async function v(s){var n=s,{id:r}=n,e=f(n,["id"]);let m=await y(A(l({},e),{endpoint:`matches/${r}`}));if(m.error)return m;let{data:p,included:c}=m.data;return{data:A(l({},p.attributes),{assets:p.relationships.assets.data,id:p.id,members:c,type:p.type}),error:null}}async function W(m){var p=m,{id:r=!1,skipFailed:e=!1,value:s}=p,n=f(p,["id","skipFailed","value"]);let c=Array.isArray(s),a=!c&&r?`players/${s}`:"players",O=c?ee([...s]).map(d=>A(l({},n),{endpoint:a,params:{[`filter[${r?"playerIds":"playerNames"}]`]:d.join(",")}})):[A(l({},n),{endpoint:a,params:r?void 0:{"filter[playerNames]":s}})],S=await re(O),i=S.find(d=>d.error!==null);if(i&&i.error)return i;let b=S.map(({data:d})=>d.data).flat();return!e&&c&&s.length!==b.length?{data:null,error:{title:"Failed data length validation",detail:"Input array length does not match response length. Some data might be missing from the response."},status:400}:{data:b.map(({attributes:d,id:x,relationships:E,type:ne})=>A(l({},d),{assets:E.assets.data,id:x,matches:E.matches.data,type:ne})),error:null}}async function q(m){var p=m,{player:r,ranked:e=!1,season:s}=p,n=f(p,["player","ranked","season"]);var b;let{playerId:c,shard:a}=typeof r=="object"?{playerId:r.id,shard:r.shardId}:{playerId:r,shard:n.shard},O=typeof s=="object"?s.id:s,S=await y(A(l({},n),{endpoint:`players/${c}/seasons/${O}${e?"/ranked":""}`,shard:a}));if(S.error)return S;let{data:i}=S.data;switch(i.type){case _.PLAYER_SEASON:let d=Object.fromEntries(Object.entries(i.relationships).map(([x,E])=>x==="player"||x==="season"?[]:[x,E]));return{data:{bestRankPoint:(b=i.attributes.bestRankPoint)!=null?b:void 0,gamemodeStats:i.attributes.gameModeStats,matches:d,playerId:i.relationships.player.data.id,seasonId:i.relationships.season.data.id,type:i.type},error:null};case _.RANKED_PLAYER_SEASON:return{data:{playerId:i.relationships.player.data.id,rankedGameModeStats:i.attributes.rankedGameModeStats,seasonId:i.relationships.season.data.id,type:i.type},error:null}}}async function Q({apiKey:r,createdAt:e,shard:s}){let n=await y({apiKey:r,endpoint:"samples",params:e?{"filter[createdAt-start]":e.toISOString()}:void 0,shard:s});if(n.error)return n;let{data:m}=n.data;return{data:A(l({},m.attributes),{id:m.id,matches:m.relationships.matches.data}),error:null}}async function Y(s){var n=s,{id:r}=n,e=f(n,["id"]);let m=await T(l({},e));return m.error?m:{data:m.data.find(p=>r?r===p.id:p.isCurrentSeason),error:null}}async function T(r){let e=await y(A(l({},r),{endpoint:"seasons"}));if(e.error)return e;let{data:s}=e.data;return{data:s.map(({attributes:n,id:m,type:p})=>({id:m,isCurrentSeason:n.isCurrentSeason,isOffseason:n.isOffseason,type:p})),error:null}}async function $({apiKey:r}){let e=await y({apiKey:r,endpoint:"status",root:!0});return e.error?e:{data:e.data.data,error:null}}var se=J(require("axios"));async function j({apiKey:r,url:e}){let s=await(0,se.default)(e,{headers:A(l({},N),{Authorization:`Bearer ${r}`}),responseType:"json"});return"error"in s?s:s.data}async function X({apiKey:r,id:e}){let s=await y({apiKey:r,endpoint:`tournaments/${e}`,root:!0});if(s.error)return s;let{data:n,included:m}=s.data;return{data:A(l({},n),{matches:m}),error:null}}async function H({apiKey:r}){let e=await y({apiKey:r,endpoint:"tournaments",root:!0});if(e.error)return e;let{data:s}=e.data;return{data:s.map(({attributes:n,id:m,type:p})=>({createdAt:n.createdAt,id:m,type:p})),error:null}}0&&(module.exports={Client,DeathType,ErrorCode,GameModeStatGamemode,Gamemode,Map,MatchType,PlayerErrors,Region,ResponseObjectType,SeasonState,Shard,getMatch,getPlayer,getPlayerSeason,getSamples,getSeason,getSeasons,getStatus,getTelemetry,getTournament,getTournaments}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "pubg.ts", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A lightweight PUBG TypeScript API Wrapper", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -18,24 +18,19 @@ <div align="center"> | ||
<br /> | ||
<a href="https://www.npmjs.com/package/pubg.ts"> | ||
<img src="https://img.shields.io/npm/v/pubg.ts?label=%20&style=for-the-badge" alt="Package Version" /> | ||
</a> | ||
<a href="https://www.npmjs.com/package/pubg.ts"> | ||
<img src="https://img.shields.io/npm/dm/pubg.ts?label=%20&style=for-the-badge" alt="Package Monthly Downloads" /> | ||
</a> | ||
<a href="https://github.com/nurodev/pubg.ts"> | ||
<img src="https://img.shields.io/badge/-Docs-blue.svg?style=for-the-badge" alt="Docs" /> | ||
</a> | ||
<a href="https://documentation.pubg.com/"> | ||
<img src="https://img.shields.io/badge/-API-yellow.svg?style=for-the-badge" alt="API" /> | ||
</a> | ||
<a href="https://github.com/nurodev/pubg.ts"> | ||
<img src="https://img.shields.io/badge/-Example-white.svg?style=for-the-badge" alt="Example" /> | ||
</a> | ||
</sup> | ||
<br /> | ||
<br /> | ||
<br /> | ||
<br /> | ||
[![Tests](https://img.shields.io/github/workflow/status/nurodev/pubg.ts/CI?label=%20&logo=github&logoColor=white&style=for-the-badge)](https://github.com/nurodev/pubg.ts) | ||
[![Package Version](https://img.shields.io/npm/v/pubg.ts?label=%20&style=for-the-badge)](https://www.npmjs.com/package/pubg.ts) | ||
[![Package Monthly Downloads](https://img.shields.io/npm/dm/pubg.ts?color=blue&label=%20&style=for-the-badge)](https://www.npmjs.com/package/pubg.ts) | ||
[![API](https://img.shields.io/badge/-API-yellow.svg?style=for-the-badge)](https://documentation.pubg.com) | ||
</div> | ||
## ✨ Features | ||
- ❗ Stirctly typed | ||
- ⚡ Request batching | ||
- ✍️ Verbose documentation | ||
- 🪝 Hooks support | ||
- ⚠️ Error handling | ||
## 🚀 Install | ||
@@ -80,3 +75,4 @@ | ||
// Get a single or multiple player(s) using their name or ID | ||
const player = await api.getPlayer({ | ||
const { data: player } = await api.getPlayer({ | ||
skipFailed: false, // Optional: fail silently (Default: false) | ||
value: "single_name_or_id_or_array_of_such", | ||
@@ -86,3 +82,3 @@ }); | ||
// Fetch a data from a single match | ||
const match = await client.getMatch({ | ||
const { data: match } = await client.getMatch({ | ||
id: "a036c694-be29-4dea-833d-b6ff84323de7", | ||
@@ -92,6 +88,6 @@ }); | ||
// Get the current active season | ||
const activeSeason = await client.getSeason(); | ||
const { data: activeSeason } = await client.getSeason(); | ||
// Get season stats for a specific player | ||
const playerSeason = await client.getPlayerSeason({ | ||
const { data: playerSeason } = await client.getPlayerSeason({ | ||
player: player.id, | ||
@@ -109,5 +105,6 @@ season: activeSeason, | ||
// Get a single or multiple player(s) using their name or ID | ||
const player = await getPlayer({ | ||
const { data: player } = await getPlayer({ | ||
apiKey: "your_key_goes_here", | ||
shard: Shard.STEAM, // Optional for all hooks (Default: Steam) | ||
shard: Shard.STEAM, // Optional: for all hooks (Default: Steam) | ||
skipFailed: false, // Optional: fail silently (Default: false) | ||
value: "single_name_or_id_or_array_of_such", | ||
@@ -117,3 +114,3 @@ }); | ||
// Fetch a data from a single match | ||
const match = await getMatch({ | ||
const { data: match } = await getMatch({ | ||
apiKey: "your_key_goes_here", | ||
@@ -124,3 +121,3 @@ id: "a036c694-be29-4dea-833d-b6ff84323de7", | ||
// Get the current active season | ||
const activeSeason = await getSeason({ | ||
const { data: activeSeason } = await getSeason({ | ||
apiKey: "your_key_goes_here", | ||
@@ -130,3 +127,3 @@ }); | ||
// Get season stats for a specific player | ||
const playerSeason = await getPlayerSeason({ | ||
const { data: playerSeason } = await getPlayerSeason({ | ||
apiKey: "your_key_goes_here", | ||
@@ -133,0 +130,0 @@ player: player.id, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
429841
2186
131