@mkody/twitch-emoticons 2.8.1 → 2.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TwitchEmoticons.min.js +22 -0
- package/dist/TwitchEmoticons.min.js.map +7 -0
- package/docs/BTTVEmote.html +1 -111
- package/docs/Channel.html +4 -4
- package/docs/Collection.html +1 -1
- package/docs/Emote.html +2 -107
- package/docs/EmoteFetcher.html +1 -1
- package/docs/EmoteParser.html +1 -1
- package/docs/FFZEmote.html +1 -111
- package/docs/SevenTVEmote.html +1 -111
- package/docs/TwitchEmote.html +1 -111
- package/docs/index.html +2 -2
- package/docs/struct_BTTVEmote.js.html +1 -1
- package/docs/struct_Channel.js.html +6 -1
- package/docs/struct_Emote.js.html +8 -1
- package/docs/struct_EmoteFetcher.js.html +2 -2
- package/docs/struct_EmoteParser.js.html +1 -1
- package/docs/struct_FFZEmote.js.html +1 -1
- package/docs/struct_SevenTVEmote.js.html +1 -1
- package/docs/struct_TwitchEmote.js.html +1 -1
- package/docs/util_Collection.js.html +1 -1
- package/jest.config.js +198 -0
- package/package.json +12 -8
- package/src/struct/Channel.js +5 -0
- package/src/struct/Emote.js +7 -0
- package/src/struct/EmoteFetcher.js +1 -1
- package/test/BTTV.test.js +48 -0
- package/test/FFZ.test.js +71 -0
- package/test/SevenTV.test.js +70 -0
- package/test/ToFromObject.test.js +155 -0
- package/test/Twitch.test.js +64 -0
- package/test/__snapshots__/ToFromObject.test.js.snap +121 -0
- package/test/other.test.js +13 -0
- package/typings/index.d.ts +1 -1
- package/.github/codeql/codeql-config.yml +0 -5
- package/.github/workflows/codeql.yml +0 -50
- package/.github/workflows/eslint.yml +0 -51
- package/.github/workflows/release.yml +0 -22
- package/.github/workflows/yarn-test.yml +0 -17
- package/test/index.js +0 -482
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var bn=Object.defineProperty;var TC=Object.getOwnPropertyDescriptor;var IC=Object.getOwnPropertyNames;var RC=Object.prototype.hasOwnProperty;var n=(r,e)=>bn(r,"name",{value:e,configurable:!0});var DC=(r,e)=>()=>(r&&(e=r(r=0)),e);var l=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),OC=(r,e)=>{for(var t in e)bn(r,t,{get:e[t],enumerable:!0})},BC=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of IC(e))!RC.call(r,a)&&a!==t&&bn(r,a,{get:()=>e[a],enumerable:!(i=TC(e,a))||i.enumerable});return r};var g=r=>BC(bn({},"__esModule",{value:!0}),r);var _r=l((QG,Ty)=>{var pc=class r{static{n(this,"Emote")}constructor(e,t,i){if(new.target.name===r.name)throw new Error("Base Emote class cannot be used");this.fetcher=e.fetcher,this.channel=e,this.id=t,this.type=null,this._setup(i)}_setup(e){this.code=e.code}toLink(){return null}toString(){return this.code}toObject(){return{code:this.code,id:this.id,channel_id:this.channel.channel_id}}};Ty.exports=pc});var xt=l((VG,Iy)=>{Iy.exports={Twitch:{CDN:(r,e)=>`https://static-cdn.jtvnw.net/emoticons/v2/${r}/default/dark/${e+1}.0`},BTTV:{Global:"https://api.betterttv.net/3/cached/emotes/global",Channel:r=>`https://api.betterttv.net/3/cached/users/twitch/${r}`,CDN:(r,e)=>`https://cdn.betterttv.net/emote/${r}/${e+1}x.webp`},SevenTV:{Global:"https://7tv.io/v3/emote-sets/global",Channel:r=>`https://7tv.io/v3/users/twitch/${r}`,CDN:(r,e)=>`https://cdn.7tv.app/emote/${r}/${e}`},FFZ:{sets:{Global:3,Modifiers:1532818},Set:r=>`https://api.frankerfacez.com/v1/set/${r}`,Channel:r=>`https://api.frankerfacez.com/v1/room/id/${r}`,CDN:(r,e)=>`https://cdn.frankerfacez.com/emote/${r}/${e}`,CDNAnimated:(r,e)=>`https://cdn.frankerfacez.com/emote/${r}/animated/${e}.webp`},Templates:{html:'<img alt="{name}" title="{name}" class="twitch-emote twitch-emote-{size}" src="{link}">',markdown:'',bbcode:"[img]{link}[/img]",plain:"{link}"}}});var fc=l(($G,Ry)=>{var UC=_r(),jC=xt(),hc=class r extends UC{static{n(this,"BTTVEmote")}constructor(e,t,i){super(e,t,i),this.type="bttv"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.ownerName="user"in e?e.user.name:null,this.animated=e.animated,this.imageType="webp"}toLink(e=0){return jC.BTTV.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,ownerName:this.ownerName,type:this.type})}static fromObject(e,t=null){return new r(t,e.id,{code:e.code,animated:e.animated,user:{name:e.ownerName}})}};Ry.exports=hc});var vn=l((zG,Dy)=>{var mc=class extends Map{static{n(this,"Collection")}find(e,t){if(typeof e=="string"){if(typeof t>"u")return null;for(let i of this.values())if(i[e]===t)return i;return null}if(typeof e=="function"){let i=0;for(let a of this.values()){if(e(a,i,this))return a;i++}return null}return null}filter(e,t){t&&(e=e.bind(t));let i=new this.constructor,a=0;for(let[o,s]of this)e(s,a,this)&&i.set(o,s),a++;return i}map(e,t){t&&(e=e.bind(t));let i=new Array(this.size),a=0;for(let o of this.values())i[a]=e(o,a,this),a++;return i}};Dy.exports=mc});var _c=l((JG,Oy)=>{var kC=vn(),yc=class{static{n(this,"Channel")}constructor(e,t){this.fetcher=e,this.channel_id=t,this.emotes=new kC}fetchBTTVEmotes(){return this.fetcher.fetchBTTVEmotes(this.id)}fetchFFZEmotes(){return this.fetcher.fetchFFZEmotes(this.id)}fetchSevenTVEmotes(){return this.fetcher.fetchSevenTVEmotes(this.id)}};Oy.exports=yc});var bc=l((YG,Uy)=>{var LC=_r(),By=xt(),gc=class r extends LC{static{n(this,"FFZEmote")}constructor(e,t,i){super(e,t,i),this.type="ffz"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.code=e.name,this.ownerName="owner"in e?e.owner.name:null,this.sizes="animated"in e?Object.keys(e.animated):Object.keys(e.urls),this.animated="animated"in e,this.imageType="animated"in e?"webp":"png",this.modifier=e.modifier&&(e.modifier_flags&1)!==0}toLink(e=0){return e=this.sizes[e],this.animated?By.FFZ.CDNAnimated(this.id,e):By.FFZ.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,sizes:this.sizes,ownerName:this.ownerName,type:this.type,modifier:this.modifier})}static fromObject(e,t=null){let i=e.sizes.reduce((a,o)=>(a[o]=o,a),{});return new r(t,e.id,{code:e.code,name:e.code,urls:i,...e.animated?{animated:i}:{},owner:{name:e.ownerName},modifier:e.modifier,modifier_flags:e.modifier})}};Uy.exports=gc});var wc=l((e2,jy)=>{var MC=_r(),FC=xt(),vc=class r extends MC{static{n(this,"SevenTVEmote")}constructor(e,t,i){super(e,t,i),this.type="7tv"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.code=e.name,this.ownerName="owner"in e?e.owner.display_name:null,this.sizes=e.host.files.filter(t=>t.format===this.channel.format.toUpperCase()).map(t=>t.name),this.animated=e.animated,this.imageType=this.channel.format}toLink(e=0){return e=this.sizes[e],FC.SevenTV.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,sizes:this.sizes,ownerName:this.ownerName,type:this.type,imageType:this.imageType})}static fromObject(e,t){let i=e.sizes.map(a=>({format:t.format.toUpperCase(),name:a}));return new r(t,e.id,{code:e.code,name:e.code,animated:e.animated,owner:{display_name:e.ownerName},host:{files:i}})}};jy.exports=vc});var Sc=l((r2,ky)=>{var NC=_r(),QC=xt(),xc=class r extends NC{static{n(this,"TwitchEmote")}constructor(e,t,i){super(e,t,i),this.type="twitch"}get owner(){return this.channel}_setup(e){super._setup(e),this.set=e.emoticon_set,this.animated="animated"in e.formats,this.imageType="animated"in e.formats?"gif":"png"}toLink(e=0){return QC.Twitch.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,set:this.set,type:this.type})}static fromObject(e,t=null){return new r(t,e.id,{code:e.code,animated:e.animated,emoticon_set:e.set,formats:e.animated?{animated:e.animated}:{}})}};ky.exports=xc});var __=l((n2,y_)=>{"use strict";function Jy(r,e){return n(function(){return r.apply(e,arguments)},"wrap")}n(Jy,"bind");var{toString:GC}=Object.prototype,{getPrototypeOf:Bc}=Object,qn=(r=>e=>{let t=GC.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),ze=n(r=>(r=r.toLowerCase(),e=>qn(e)===r),"kindOfTest"),Pn=n(r=>e=>typeof e===r,"typeOfTest"),{isArray:wr}=Array,gi=Pn("undefined");function VC(r){return r!==null&&!gi(r)&&r.constructor!==null&&!gi(r.constructor)&&Oe(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}n(VC,"isBuffer");var Zy=ze("ArrayBuffer");function $C(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Zy(r.buffer),e}n($C,"isArrayBufferView");var WC=Pn("string"),Oe=Pn("function"),Yy=Pn("number"),Cn=n(r=>r!==null&&typeof r=="object","isObject"),zC=n(r=>r===!0||r===!1,"isBoolean"),wn=n(r=>{if(qn(r)!=="object")return!1;let e=Bc(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},"isPlainObject"),KC=ze("Date"),JC=ze("File"),ZC=ze("Blob"),YC=ze("FileList"),XC=n(r=>Cn(r)&&Oe(r.pipe),"isStream"),eH=n(r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Oe(r.append)&&((e=qn(r))==="formdata"||e==="object"&&Oe(r.toString)&&r.toString()==="[object FormData]"))},"isFormData"),tH=ze("URLSearchParams"),rH=n(r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function bi(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let i,a;if(typeof r!="object"&&(r=[r]),wr(r))for(i=0,a=r.length;i<a;i++)e.call(null,r[i],i,r);else{let o=t?Object.getOwnPropertyNames(r):Object.keys(r),s=o.length,u;for(i=0;i<s;i++)u=o[i],e.call(null,r[u],u,r)}}n(bi,"forEach");function Xy(r,e){e=e.toLowerCase();let t=Object.keys(r),i=t.length,a;for(;i-- >0;)if(a=t[i],e===a.toLowerCase())return a;return null}n(Xy,"findKey");var e_=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),t_=n(r=>!gi(r)&&r!==e_,"isContextDefined");function Ec(){let{caseless:r}=t_(this)&&this||{},e={},t=n((i,a)=>{let o=r&&Xy(e,a)||a;wn(e[o])&&wn(i)?e[o]=Ec(e[o],i):wn(i)?e[o]=Ec({},i):wr(i)?e[o]=i.slice():e[o]=i},"assignValue");for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&bi(arguments[i],t);return e}n(Ec,"merge");var iH=n((r,e,t,{allOwnKeys:i}={})=>(bi(e,(a,o)=>{t&&Oe(a)?r[o]=Jy(a,t):r[o]=a},{allOwnKeys:i}),r),"extend"),nH=n(r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),"stripBOM"),aH=n((r,e,t,i)=>{r.prototype=Object.create(e.prototype,i),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},"inherits"),oH=n((r,e,t,i)=>{let a,o,s,u={};if(e=e||{},r==null)return e;do{for(a=Object.getOwnPropertyNames(r),o=a.length;o-- >0;)s=a[o],(!i||i(s,r,e))&&!u[s]&&(e[s]=r[s],u[s]=!0);r=t!==!1&&Bc(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},"toFlatObject"),sH=n((r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let i=r.indexOf(e,t);return i!==-1&&i===t},"endsWith"),uH=n(r=>{if(!r)return null;if(wr(r))return r;let e=r.length;if(!Yy(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},"toArray"),lH=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&Bc(Uint8Array)),cH=n((r,e)=>{let i=(r&&r[Symbol.iterator]).call(r),a;for(;(a=i.next())&&!a.done;){let o=a.value;e.call(r,o[0],o[1])}},"forEachEntry"),dH=n((r,e)=>{let t,i=[];for(;(t=r.exec(e))!==null;)i.push(t);return i},"matchAll"),pH=ze("HTMLFormElement"),hH=n(r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,n(function(t,i,a){return i.toUpperCase()+a},"replacer")),"toCamelCase"),Ly=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),fH=ze("RegExp"),r_=n((r,e)=>{let t=Object.getOwnPropertyDescriptors(r),i={};bi(t,(a,o)=>{let s;(s=e(a,o,r))!==!1&&(i[o]=s||a)}),Object.defineProperties(r,i)},"reduceDescriptors"),mH=n(r=>{r_(r,(e,t)=>{if(Oe(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let i=r[t];if(Oe(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},"freezeMethods"),yH=n((r,e)=>{let t={},i=n(a=>{a.forEach(o=>{t[o]=!0})},"define");return wr(r)?i(r):i(String(r).split(e)),t},"toObjectSet"),_H=n(()=>{},"noop"),gH=n((r,e)=>(r=+r,Number.isFinite(r)?r:e),"toFiniteNumber"),qc="abcdefghijklmnopqrstuvwxyz",My="0123456789",i_={DIGIT:My,ALPHA:qc,ALPHA_DIGIT:qc+qc.toUpperCase()+My},bH=n((r=16,e=i_.ALPHA_DIGIT)=>{let t="",{length:i}=e;for(;r--;)t+=e[Math.random()*i|0];return t},"generateString");function vH(r){return!!(r&&Oe(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}n(vH,"isSpecCompliantForm");var wH=n(r=>{let e=new Array(10),t=n((i,a)=>{if(Cn(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[a]=i;let o=wr(i)?[]:{};return bi(i,(s,u)=>{let c=t(s,a+1);!gi(c)&&(o[u]=c)}),e[a]=void 0,o}}return i},"visit");return t(r,0)},"toJSONObject"),xH=ze("AsyncFunction"),SH=n(r=>r&&(Cn(r)||Oe(r))&&Oe(r.then)&&Oe(r.catch),"isThenable"),w={isArray:wr,isArrayBuffer:Zy,isBuffer:VC,isFormData:eH,isArrayBufferView:$C,isString:WC,isNumber:Yy,isBoolean:zC,isObject:Cn,isPlainObject:wn,isUndefined:gi,isDate:KC,isFile:JC,isBlob:ZC,isRegExp:fH,isFunction:Oe,isStream:XC,isURLSearchParams:tH,isTypedArray:lH,isFileList:YC,forEach:bi,merge:Ec,extend:iH,trim:rH,stripBOM:nH,inherits:aH,toFlatObject:oH,kindOf:qn,kindOfTest:ze,endsWith:sH,toArray:uH,forEachEntry:cH,matchAll:dH,isHTMLForm:pH,hasOwnProperty:Ly,hasOwnProp:Ly,reduceDescriptors:r_,freezeMethods:mH,toObjectSet:yH,toCamelCase:hH,noop:_H,toFiniteNumber:gH,findKey:Xy,global:e_,isContextDefined:t_,ALPHABET:i_,generateString:bH,isSpecCompliantForm:vH,toJSONObject:wH,isAsyncFn:xH,isThenable:SH};function R(r,e,t,i,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),a&&(this.response=a)}n(R,"AxiosError");w.inherits(R,Error,{toJSON:n(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:w.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}},"toJSON")});var n_=R.prototype,a_={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{a_[r]={value:r}});Object.defineProperties(R,a_);Object.defineProperty(n_,"isAxiosError",{value:!0});R.from=(r,e,t,i,a,o)=>{let s=Object.create(n_);return w.toFlatObject(r,s,n(function(c){return c!==Error.prototype},"filter"),u=>u!=="isAxiosError"),R.call(s,r.message,e,t,i,a),s.cause=r,s.name=r.name,o&&Object.assign(s,o),s};var qH=null;function Ac(r){return w.isPlainObject(r)||w.isArray(r)}n(Ac,"isVisitable");function o_(r){return w.endsWith(r,"[]")?r.slice(0,-2):r}n(o_,"removeBrackets");function Fy(r,e,t){return r?r.concat(e).map(n(function(a,o){return a=o_(a),!t&&o?"["+a+"]":a},"each")).join(t?".":""):e}n(Fy,"renderKey");function PH(r){return w.isArray(r)&&!r.some(Ac)}n(PH,"isFlatArray");var CH=w.toFlatObject(w,{},null,n(function(e){return/^is[A-Z]/.test(e)},"filter"));function Hn(r,e,t){if(!w.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=w.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,n(function(x,A){return!w.isUndefined(A[x])},"defined"));let i=t.metaTokens,a=t.visitor||d,o=t.dots,s=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&w.isSpecCompliantForm(e);if(!w.isFunction(a))throw new TypeError("visitor must be a function");function h(v){if(v===null)return"";if(w.isDate(v))return v.toISOString();if(!c&&w.isBlob(v))throw new R("Blob is not supported. Use a Buffer instead.");return w.isArrayBuffer(v)||w.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}n(h,"convertValue");function d(v,x,A){let O=v;if(v&&!A&&typeof v=="object"){if(w.endsWith(x,"{}"))x=i?x:x.slice(0,-2),v=JSON.stringify(v);else if(w.isArray(v)&&PH(v)||(w.isFileList(v)||w.endsWith(x,"[]"))&&(O=w.toArray(v)))return x=o_(x),O.forEach(n(function(le,te){!(w.isUndefined(le)||le===null)&&e.append(s===!0?Fy([x],te,o):s===null?x:x+"[]",h(le))},"each")),!1}return Ac(v)?!0:(e.append(Fy(A,x,o),h(v)),!1)}n(d,"defaultVisitor");let _=[],b=Object.assign(CH,{defaultVisitor:d,convertValue:h,isVisitable:Ac});function q(v,x){if(!w.isUndefined(v)){if(_.indexOf(v)!==-1)throw Error("Circular reference detected in "+x.join("."));_.push(v),w.forEach(v,n(function(O,z){(!(w.isUndefined(O)||O===null)&&a.call(e,O,w.isString(z)?z.trim():z,x,b))===!0&&q(O,x?x.concat(z):[z])},"each")),_.pop()}}if(n(q,"build"),!w.isObject(r))throw new TypeError("data must be an object");return q(r),e}n(Hn,"toFormData");function Ny(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,n(function(i){return e[i]},"replacer"))}n(Ny,"encode$1");function Uc(r,e){this._pairs=[],r&&Hn(r,this,e)}n(Uc,"AxiosURLSearchParams");var s_=Uc.prototype;s_.append=n(function(e,t){this._pairs.push([e,t])},"append");s_.toString=n(function(e){let t=e?function(i){return e.call(this,i,Ny)}:Ny;return this._pairs.map(n(function(a){return t(a[0])+"="+t(a[1])},"each"),"").join("&")},"toString");function HH(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n(HH,"encode");function u_(r,e,t){if(!e)return r;let i=t&&t.encode||HH,a=t&&t.serialize,o;if(a?o=a(e,t):o=w.isURLSearchParams(e)?e.toString():new Uc(e,t).toString(i),o){let s=r.indexOf("#");s!==-1&&(r=r.slice(0,s)),r+=(r.indexOf("?")===-1?"?":"&")+o}return r}n(u_,"buildURL");var Tc=class{static{n(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){w.forEach(this.handlers,n(function(i){i!==null&&e(i)},"forEachHandler"))}},Qy=Tc,l_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},EH=typeof URLSearchParams<"u"?URLSearchParams:Uc,AH=typeof FormData<"u"?FormData:null,TH=typeof Blob<"u"?Blob:null,IH=(()=>{let r;return typeof navigator<"u"&&((r=navigator.product)==="ReactNative"||r==="NativeScript"||r==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),RH=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),We={isBrowser:!0,classes:{URLSearchParams:EH,FormData:AH,Blob:TH},isStandardBrowserEnv:IH,isStandardBrowserWebWorkerEnv:RH,protocols:["http","https","file","blob","url","data"]};function DH(r,e){return Hn(r,new We.classes.URLSearchParams,Object.assign({visitor:function(t,i,a,o){return We.isNode&&w.isBuffer(t)?(this.append(i,t.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}n(DH,"toURLEncodedForm");function OH(r){return w.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}n(OH,"parsePropPath");function BH(r){let e={},t=Object.keys(r),i,a=t.length,o;for(i=0;i<a;i++)o=t[i],e[o]=r[o];return e}n(BH,"arrayToObject");function c_(r){function e(t,i,a,o){let s=t[o++],u=Number.isFinite(+s),c=o>=t.length;return s=!s&&w.isArray(a)?a.length:s,c?(w.hasOwnProp(a,s)?a[s]=[a[s],i]:a[s]=i,!u):((!a[s]||!w.isObject(a[s]))&&(a[s]=[]),e(t,i,a[s],o)&&w.isArray(a[s])&&(a[s]=BH(a[s])),!u)}if(n(e,"buildPath"),w.isFormData(r)&&w.isFunction(r.entries)){let t={};return w.forEachEntry(r,(i,a)=>{e(OH(i),a,t,0)}),t}return null}n(c_,"formDataToJSON");function UH(r,e,t){if(w.isString(r))try{return(e||JSON.parse)(r),w.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(r)}n(UH,"stringifySafely");var jc={transitional:l_,adapter:["xhr","http"],transformRequest:[n(function(e,t){let i=t.getContentType()||"",a=i.indexOf("application/json")>-1,o=w.isObject(e);if(o&&w.isHTMLForm(e)&&(e=new FormData(e)),w.isFormData(e))return a&&a?JSON.stringify(c_(e)):e;if(w.isArrayBuffer(e)||w.isBuffer(e)||w.isStream(e)||w.isFile(e)||w.isBlob(e))return e;if(w.isArrayBufferView(e))return e.buffer;if(w.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return DH(e,this.formSerializer).toString();if((u=w.isFileList(e))||i.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return Hn(u?{"files[]":e}:e,c&&new c,this.formSerializer)}}return o||a?(t.setContentType("application/json",!1),UH(e)):e},"transformRequest")],transformResponse:[n(function(e){let t=this.transitional||jc.transitional,i=t&&t.forcedJSONParsing,a=this.responseType==="json";if(e&&w.isString(e)&&(i&&!this.responseType||a)){let s=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e)}catch(u){if(s)throw u.name==="SyntaxError"?R.from(u,R.ERR_BAD_RESPONSE,this,null,this.response):u}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:We.classes.FormData,Blob:We.classes.Blob},validateStatus:n(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};w.forEach(["delete","get","head","post","put","patch"],r=>{jc.headers[r]={}});var kc=jc,jH=w.toObjectSet(["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"]),kH=n(r=>{let e={},t,i,a;return r&&r.split(`
|
|
2
|
+
`).forEach(n(function(s){a=s.indexOf(":"),t=s.substring(0,a).trim().toLowerCase(),i=s.substring(a+1).trim(),!(!t||e[t]&&jH[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)},"parser")),e},"parseHeaders"),Gy=Symbol("internals");function _i(r){return r&&String(r).trim().toLowerCase()}n(_i,"normalizeHeader");function xn(r){return r===!1||r==null?r:w.isArray(r)?r.map(xn):String(r)}n(xn,"normalizeValue");function LH(r){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=t.exec(r);)e[i[1]]=i[2];return e}n(LH,"parseTokens");var MH=n(r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()),"isValidHeaderName");function Pc(r,e,t,i,a){if(w.isFunction(i))return i.call(this,e,t);if(a&&(e=t),!!w.isString(e)){if(w.isString(i))return e.indexOf(i)!==-1;if(w.isRegExp(i))return i.test(e)}}n(Pc,"matchHeaderValue");function FH(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}n(FH,"formatHeader");function NH(r,e){let t=w.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(r,i+t,{value:function(a,o,s){return this[i].call(this,e,a,o,s)},configurable:!0})})}n(NH,"buildAccessors");var gr=class{static{n(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,t,i){let a=this;function o(u,c,h){let d=_i(c);if(!d)throw new Error("header name must be a non-empty string");let _=w.findKey(a,d);(!_||a[_]===void 0||h===!0||h===void 0&&a[_]!==!1)&&(a[_||c]=xn(u))}n(o,"setHeader");let s=n((u,c)=>w.forEach(u,(h,d)=>o(h,d,c)),"setHeaders");return w.isPlainObject(e)||e instanceof this.constructor?s(e,t):w.isString(e)&&(e=e.trim())&&!MH(e)?s(kH(e),t):e!=null&&o(t,e,i),this}get(e,t){if(e=_i(e),e){let i=w.findKey(this,e);if(i){let a=this[i];if(!t)return a;if(t===!0)return LH(a);if(w.isFunction(t))return t.call(this,a,i);if(w.isRegExp(t))return t.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=_i(e),e){let i=w.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||Pc(this,this[i],i,t)))}return!1}delete(e,t){let i=this,a=!1;function o(s){if(s=_i(s),s){let u=w.findKey(i,s);u&&(!t||Pc(i,i[u],u,t))&&(delete i[u],a=!0)}}return n(o,"deleteHeader"),w.isArray(e)?e.forEach(o):o(e),a}clear(e){let t=Object.keys(this),i=t.length,a=!1;for(;i--;){let o=t[i];(!e||Pc(this,this[o],o,e,!0))&&(delete this[o],a=!0)}return a}normalize(e){let t=this,i={};return w.forEach(this,(a,o)=>{let s=w.findKey(i,o);if(s){t[s]=xn(a),delete t[o];return}let u=e?FH(o):String(o).trim();u!==o&&delete t[o],t[u]=xn(a),i[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return w.forEach(this,(i,a)=>{i!=null&&i!==!1&&(t[a]=e&&w.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
|
3
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let i=new this(e);return t.forEach(a=>i.set(a)),i}static accessor(e){let i=(this[Gy]=this[Gy]={accessors:{}}).accessors,a=this.prototype;function o(s){let u=_i(s);i[u]||(NH(a,s),i[u]=!0)}return n(o,"defineAccessor"),w.isArray(e)?e.forEach(o):o(e),this}};gr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);w.reduceDescriptors(gr.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(i){this[t]=i}}});w.freezeMethods(gr);var lt=gr;function Cc(r,e){let t=this||kc,i=e||t,a=lt.from(i.headers),o=i.data;return w.forEach(r,n(function(u){o=u.call(t,o,a.normalize(),e?e.status:void 0)},"transform")),a.normalize(),o}n(Cc,"transformData");function d_(r){return!!(r&&r.__CANCEL__)}n(d_,"isCancel");function vi(r,e,t){R.call(this,r??"canceled",R.ERR_CANCELED,e,t),this.name="CanceledError"}n(vi,"CanceledError");w.inherits(vi,R,{__CANCEL__:!0});function QH(r,e,t){let i=t.config.validateStatus;!t.status||!i||i(t.status)?r(t):e(new R("Request failed with status code "+t.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}n(QH,"settle");var GH=We.isStandardBrowserEnv?n(function(){return{write:n(function(t,i,a,o,s,u){let c=[];c.push(t+"="+encodeURIComponent(i)),w.isNumber(a)&&c.push("expires="+new Date(a).toGMTString()),w.isString(o)&&c.push("path="+o),w.isString(s)&&c.push("domain="+s),u===!0&&c.push("secure"),document.cookie=c.join("; ")},"write"),read:n(function(t){let i=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},"read"),remove:n(function(t){this.write(t,"",Date.now()-864e5)},"remove")}},"standardBrowserEnv")():n(function(){return{write:n(function(){},"write"),read:n(function(){return null},"read"),remove:n(function(){},"remove")}},"nonStandardBrowserEnv")();function VH(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}n(VH,"isAbsoluteURL");function $H(r,e){return e?r.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):r}n($H,"combineURLs");function p_(r,e){return r&&!VH(e)?$H(r,e):e}n(p_,"buildFullPath");var WH=We.isStandardBrowserEnv?n(function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),i;function a(o){let s=o;return e&&(t.setAttribute("href",s),s=t.href),t.setAttribute("href",s),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n(a,"resolveURL"),i=a(window.location.href),n(function(s){let u=w.isString(s)?a(s):s;return u.protocol===i.protocol&&u.host===i.host},"isURLSameOrigin")},"standardBrowserEnv")():n(function(){return n(function(){return!0},"isURLSameOrigin")},"nonStandardBrowserEnv")();function zH(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}n(zH,"parseProtocol");function KH(r,e){r=r||10;let t=new Array(r),i=new Array(r),a=0,o=0,s;return e=e!==void 0?e:1e3,n(function(c){let h=Date.now(),d=i[o];s||(s=h),t[a]=c,i[a]=h;let _=o,b=0;for(;_!==a;)b+=t[_++],_=_%r;if(a=(a+1)%r,a===o&&(o=(o+1)%r),h-s<e)return;let q=d&&h-d;return q?Math.round(b*1e3/q):void 0},"push")}n(KH,"speedometer");function Vy(r,e){let t=0,i=KH(50,250);return a=>{let o=a.loaded,s=a.lengthComputable?a.total:void 0,u=o-t,c=i(u),h=o<=s;t=o;let d={loaded:o,total:s,progress:s?o/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s&&h?(s-o)/c:void 0,event:a};d[e?"download":"upload"]=!0,r(d)}}n(Vy,"progressEventReducer");var JH=typeof XMLHttpRequest<"u",ZH=JH&&function(r){return new Promise(n(function(t,i){let a=r.data,o=lt.from(r.headers).normalize(),s=r.responseType,u;function c(){r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}n(c,"done");let h;w.isFormData(a)&&(We.isStandardBrowserEnv||We.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?w.isString(h=o.getContentType())&&o.setContentType(h.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let d=new XMLHttpRequest;if(r.auth){let v=r.auth.username||"",x=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";o.set("Authorization","Basic "+btoa(v+":"+x))}let _=p_(r.baseURL,r.url);d.open(r.method.toUpperCase(),u_(_,r.params,r.paramsSerializer),!0),d.timeout=r.timeout;function b(){if(!d)return;let v=lt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),A={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:v,config:r,request:d};QH(n(function(z){t(z),c()},"_resolve"),n(function(z){i(z),c()},"_reject"),A),d=null}if(n(b,"onloadend"),"onloadend"in d?d.onloadend=b:d.onreadystatechange=n(function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(b)},"handleLoad"),d.onabort=n(function(){d&&(i(new R("Request aborted",R.ECONNABORTED,r,d)),d=null)},"handleAbort"),d.onerror=n(function(){i(new R("Network Error",R.ERR_NETWORK,r,d)),d=null},"handleError"),d.ontimeout=n(function(){let x=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",A=r.transitional||l_;r.timeoutErrorMessage&&(x=r.timeoutErrorMessage),i(new R(x,A.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,r,d)),d=null},"handleTimeout"),We.isStandardBrowserEnv){let v=(r.withCredentials||WH(_))&&r.xsrfCookieName&&GH.read(r.xsrfCookieName);v&&o.set(r.xsrfHeaderName,v)}a===void 0&&o.setContentType(null),"setRequestHeader"in d&&w.forEach(o.toJSON(),n(function(x,A){d.setRequestHeader(A,x)},"setRequestHeader")),w.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),s&&s!=="json"&&(d.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&d.addEventListener("progress",Vy(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Vy(r.onUploadProgress)),(r.cancelToken||r.signal)&&(u=n(v=>{d&&(i(!v||v.type?new vi(null,r,d):v),d.abort(),d=null)},"onCanceled"),r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));let q=zH(_);if(q&&We.protocols.indexOf(q)===-1){i(new R("Unsupported protocol "+q+":",R.ERR_BAD_REQUEST,r));return}d.send(a||null)},"dispatchXhrRequest"))},Ic={http:qH,xhr:ZH};w.forEach(Ic,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var $y=n(r=>`- ${r}`,"renderReason"),YH=n(r=>w.isFunction(r)||r===null||r===!1,"isResolvedHandle"),h_={getAdapter:r=>{r=w.isArray(r)?r:[r];let{length:e}=r,t,i,a={};for(let o=0;o<e;o++){t=r[o];let s;if(i=t,!YH(t)&&(i=Ic[(s=String(t)).toLowerCase()],i===void 0))throw new R(`Unknown adapter '${s}'`);if(i)break;a[s||"#"+o]=i}if(!i){let o=Object.entries(a).map(([u,c])=>`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build")),s=e?o.length>1?`since :
|
|
4
|
+
`+o.map($y).join(`
|
|
5
|
+
`):" "+$y(o[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i},adapters:Ic};function Hc(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new vi(null,r)}n(Hc,"throwIfCancellationRequested");function Wy(r){return Hc(r),r.headers=lt.from(r.headers),r.data=Cc.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),h_.getAdapter(r.adapter||kc.adapter)(r).then(n(function(i){return Hc(r),i.data=Cc.call(r,r.transformResponse,i),i.headers=lt.from(i.headers),i},"onAdapterResolution"),n(function(i){return d_(i)||(Hc(r),i&&i.response&&(i.response.data=Cc.call(r,r.transformResponse,i.response),i.response.headers=lt.from(i.response.headers))),Promise.reject(i)},"onAdapterRejection"))}n(Wy,"dispatchRequest");var zy=n(r=>r instanceof lt?r.toJSON():r,"headersToObject");function br(r,e){e=e||{};let t={};function i(h,d,_){return w.isPlainObject(h)&&w.isPlainObject(d)?w.merge.call({caseless:_},h,d):w.isPlainObject(d)?w.merge({},d):w.isArray(d)?d.slice():d}n(i,"getMergedValue");function a(h,d,_){if(w.isUndefined(d)){if(!w.isUndefined(h))return i(void 0,h,_)}else return i(h,d,_)}n(a,"mergeDeepProperties");function o(h,d){if(!w.isUndefined(d))return i(void 0,d)}n(o,"valueFromConfig2");function s(h,d){if(w.isUndefined(d)){if(!w.isUndefined(h))return i(void 0,h)}else return i(void 0,d)}n(s,"defaultToConfig2");function u(h,d,_){if(_ in e)return i(h,d);if(_ in r)return i(void 0,h)}n(u,"mergeDirectKeys");let c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(h,d)=>a(zy(h),zy(d),!0)};return w.forEach(Object.keys(Object.assign({},r,e)),n(function(d){let _=c[d]||a,b=_(r[d],e[d],d);w.isUndefined(b)&&_!==u||(t[d]=b)},"computeConfigValue")),t}n(br,"mergeConfig");var f_="1.5.1",Lc={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{Lc[r]=n(function(i){return typeof i===r||"a"+(e<1?"n ":" ")+r},"validator")});var Ky={};Lc.transitional=n(function(e,t,i){function a(o,s){return"[Axios v"+f_+"] Transitional option '"+o+"'"+s+(i?". "+i:"")}return n(a,"formatMessage"),(o,s,u)=>{if(e===!1)throw new R(a(s," has been removed"+(t?" in "+t:"")),R.ERR_DEPRECATED);return t&&!Ky[s]&&(Ky[s]=!0,console.warn(a(s," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,s,u):!0}},"transitional");function XH(r,e,t){if(typeof r!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);let i=Object.keys(r),a=i.length;for(;a-- >0;){let o=i[a],s=e[o];if(s){let u=r[o],c=u===void 0||s(u,o,r);if(c!==!0)throw new R("option "+o+" must be "+c,R.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new R("Unknown option "+o,R.ERR_BAD_OPTION)}}n(XH,"assertOptions");var Rc={assertOptions:XH,validators:Lc},St=Rc.validators,vr=class{static{n(this,"Axios")}constructor(e){this.defaults=e,this.interceptors={request:new Qy,response:new Qy}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=br(this.defaults,t);let{transitional:i,paramsSerializer:a,headers:o}=t;i!==void 0&&Rc.assertOptions(i,{silentJSONParsing:St.transitional(St.boolean),forcedJSONParsing:St.transitional(St.boolean),clarifyTimeoutError:St.transitional(St.boolean)},!1),a!=null&&(w.isFunction(a)?t.paramsSerializer={serialize:a}:Rc.assertOptions(a,{encode:St.function,serialize:St.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&w.merge(o.common,o[t.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],v=>{delete o[v]}),t.headers=lt.concat(s,o);let u=[],c=!0;this.interceptors.request.forEach(n(function(x){typeof x.runWhen=="function"&&x.runWhen(t)===!1||(c=c&&x.synchronous,u.unshift(x.fulfilled,x.rejected))},"unshiftRequestInterceptors"));let h=[];this.interceptors.response.forEach(n(function(x){h.push(x.fulfilled,x.rejected)},"pushResponseInterceptors"));let d,_=0,b;if(!c){let v=[Wy.bind(this),void 0];for(v.unshift.apply(v,u),v.push.apply(v,h),b=v.length,d=Promise.resolve(t);_<b;)d=d.then(v[_++],v[_++]);return d}b=u.length;let q=t;for(_=0;_<b;){let v=u[_++],x=u[_++];try{q=v(q)}catch(A){x.call(this,A);break}}try{d=Wy.call(this,q)}catch(v){return Promise.reject(v)}for(_=0,b=h.length;_<b;)d=d.then(h[_++],h[_++]);return d}getUri(e){e=br(this.defaults,e);let t=p_(e.baseURL,e.url);return u_(t,e.params,e.paramsSerializer)}};w.forEach(["delete","get","head","options"],n(function(e){vr.prototype[e]=function(t,i){return this.request(br(i||{},{method:e,url:t,data:(i||{}).data}))}},"forEachMethodNoData"));w.forEach(["post","put","patch"],n(function(e){function t(i){return n(function(o,s,u){return this.request(br(u||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))},"httpMethod")}n(t,"generateHTTPMethod"),vr.prototype[e]=t(),vr.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var Sn=vr,Dc=class r{static{n(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(n(function(o){t=o},"promiseExecutor"));let i=this;this.promise.then(a=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](a);i._listeners=null}),this.promise.then=a=>{let o,s=new Promise(u=>{i.subscribe(u),o=u}).then(a);return s.cancel=n(function(){i.unsubscribe(o)},"reject"),s},e(n(function(o,s,u){i.reason||(i.reason=new vi(o,s,u),t(i.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new r(n(function(a){e=a},"executor")),cancel:e}}},eE=Dc;function tE(r){return n(function(t){return r.apply(null,t)},"wrap")}n(tE,"spread");function rE(r){return w.isObject(r)&&r.isAxiosError===!0}n(rE,"isAxiosError");var Oc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Oc).forEach(([r,e])=>{Oc[e]=r});var iE=Oc;function m_(r){let e=new Sn(r),t=Jy(Sn.prototype.request,e);return w.extend(t,Sn.prototype,e,{allOwnKeys:!0}),w.extend(t,e,null,{allOwnKeys:!0}),t.create=n(function(a){return m_(br(r,a))},"create"),t}n(m_,"createInstance");var J=m_(kc);J.Axios=Sn;J.CanceledError=vi;J.CancelToken=eE;J.isCancel=d_;J.VERSION=f_;J.toFormData=Hn;J.AxiosError=R;J.Cancel=J.CanceledError;J.all=n(function(e){return Promise.all(e)},"all");J.spread=tE;J.isAxiosError=rE;J.mergeConfig=br;J.AxiosHeaders=lt;J.formToJSON=r=>c_(w.isHTMLForm(r)?new FormData(r):r);J.getAdapter=h_.getAdapter;J.HttpStatusCode=iE;J.default=J;y_.exports=J});var m={};OC(m,{__addDisposableResource:()=>k_,__assign:()=>En,__asyncDelegator:()=>T_,__asyncGenerator:()=>A_,__asyncValues:()=>I_,__await:()=>xr,__awaiter:()=>S_,__classPrivateFieldGet:()=>B_,__classPrivateFieldIn:()=>j_,__classPrivateFieldSet:()=>U_,__createBinding:()=>Tn,__decorate:()=>v_,__disposeResources:()=>L_,__esDecorate:()=>nE,__exportStar:()=>P_,__extends:()=>g_,__generator:()=>q_,__importDefault:()=>O_,__importStar:()=>D_,__makeTemplateObject:()=>R_,__metadata:()=>x_,__param:()=>w_,__propKey:()=>oE,__read:()=>Fc,__rest:()=>b_,__runInitializers:()=>aE,__setFunctionName:()=>sE,__spread:()=>C_,__spreadArray:()=>E_,__spreadArrays:()=>H_,__values:()=>An,default:()=>cE});function g_(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Mc(r,e);function t(){this.constructor=r}n(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function b_(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(r);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(r,i[a])&&(t[i[a]]=r[i[a]]);return t}function v_(r,e,t,i){var a=arguments.length,o=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var u=r.length-1;u>=0;u--)(s=r[u])&&(o=(a<3?s(o):a>3?s(e,t,o):s(e,t))||o);return a>3&&o&&Object.defineProperty(e,t,o),o}function w_(r,e){return function(t,i){e(t,i,r)}}function nE(r,e,t,i,a,o){function s(O){if(O!==void 0&&typeof O!="function")throw new TypeError("Function expected");return O}n(s,"accept");for(var u=i.kind,c=u==="getter"?"get":u==="setter"?"set":"value",h=!e&&r?i.static?r:r.prototype:null,d=e||(h?Object.getOwnPropertyDescriptor(h,i.name):{}),_,b=!1,q=t.length-1;q>=0;q--){var v={};for(var x in i)v[x]=x==="access"?{}:i[x];for(var x in i.access)v.access[x]=i.access[x];v.addInitializer=function(O){if(b)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(O||null))};var A=(0,t[q])(u==="accessor"?{get:d.get,set:d.set}:d[c],v);if(u==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(_=s(A.get))&&(d.get=_),(_=s(A.set))&&(d.set=_),(_=s(A.init))&&a.unshift(_)}else(_=s(A))&&(u==="field"?a.unshift(_):d[c]=_)}h&&Object.defineProperty(h,i.name,d),b=!0}function aE(r,e,t){for(var i=arguments.length>2,a=0;a<e.length;a++)t=i?e[a].call(r,t):e[a].call(r);return i?t:void 0}function oE(r){return typeof r=="symbol"?r:"".concat(r)}function sE(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function x_(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function S_(r,e,t,i){function a(o){return o instanceof t?o:new t(function(s){s(o)})}return n(a,"adopt"),new(t||(t=Promise))(function(o,s){function u(d){try{h(i.next(d))}catch(_){s(_)}}n(u,"fulfilled");function c(d){try{h(i.throw(d))}catch(_){s(_)}}n(c,"rejected");function h(d){d.done?o(d.value):a(d.value).then(u,c)}n(h,"step"),h((i=i.apply(r,e||[])).next())})}function q_(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(h){return function(d){return c([h,d])}}function c(h){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,h[0]&&(t=0)),t;)try{if(i=1,a&&(o=h[0]&2?a.return:h[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,h[1])).done)return o;switch(a=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,a=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){t.label=h[1];break}if(h[0]===6&&t.label<o[1]){t.label=o[1],o=h;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(h);break}o[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(d){h=[6,d],a=0}finally{i=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function P_(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Tn(e,r,t)}function An(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fc(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),a,o=[],s;try{for(;(e===void 0||e-- >0)&&!(a=i.next()).done;)o.push(a.value)}catch(u){s={error:u}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(s)throw s.error}}return o}function C_(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Fc(arguments[e]));return r}function H_(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),a=0,e=0;e<t;e++)for(var o=arguments[e],s=0,u=o.length;s<u;s++,a++)i[a]=o[s];return i}function E_(r,e,t){if(t||arguments.length===2)for(var i=0,a=e.length,o;i<a;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return r.concat(o||Array.prototype.slice.call(e))}function xr(r){return this instanceof xr?(this.v=r,this):new xr(r)}function A_(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),a,o=[];return a={},s("next"),s("throw"),s("return"),a[Symbol.asyncIterator]=function(){return this},a;function s(b){i[b]&&(a[b]=function(q){return new Promise(function(v,x){o.push([b,q,v,x])>1||u(b,q)})})}function u(b,q){try{c(i[b](q))}catch(v){_(o[0][3],v)}}function c(b){b.value instanceof xr?Promise.resolve(b.value.v).then(h,d):_(o[0][2],b)}function h(b){u("next",b)}function d(b){u("throw",b)}function _(b,q){b(q),o.shift(),o.length&&u(o[0][0],o[0][1])}}function T_(r){var e,t;return e={},i("next"),i("throw",function(a){throw a}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(a,o){e[a]=r[a]?function(s){return(t=!t)?{value:xr(r[a](s)),done:!1}:o?o(s):s}:o}}function I_(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof An=="function"?An(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=r[o]&&function(s){return new Promise(function(u,c){s=r[o](s),a(u,c,s.done,s.value)})}}function a(o,s,u,c){Promise.resolve(c).then(function(h){o({value:h,done:u})},s)}}function R_(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function D_(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Tn(e,r,t);return uE(e,r),e}function O_(r){return r&&r.__esModule?r:{default:r}}function B_(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}function U_(r,e,t,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!a:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(r,t):a?a.value=t:e.set(r,t),t}function j_(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}function k_(r,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose]}if(typeof i!="function")throw new TypeError("Object not disposable.");r.stack.push({value:e,dispose:i,async:t})}else t&&r.stack.push({async:!0});return e}function L_(r){function e(i){r.error=r.hasError?new lE(i,r.error,"An error was suppressed during disposal."):i,r.hasError=!0}n(e,"fail");function t(){for(;r.stack.length;){var i=r.stack.pop();try{var a=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(a).then(t,function(o){return e(o),t()})}catch(o){e(o)}}if(r.hasError)throw r.error}return n(t,"next"),t()}var Mc,En,Tn,uE,lE,cE,y=DC(()=>{Mc=n(function(r,e){return Mc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])},Mc(r,e)},"extendStatics");n(g_,"__extends");En=n(function(){return En=Object.assign||n(function(e){for(var t,i=1,a=arguments.length;i<a;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},"__assign"),En.apply(this,arguments)},"__assign");n(b_,"__rest");n(v_,"__decorate");n(w_,"__param");n(nE,"__esDecorate");n(aE,"__runInitializers");n(oE,"__propKey");n(sE,"__setFunctionName");n(x_,"__metadata");n(S_,"__awaiter");n(q_,"__generator");Tn=Object.create?function(r,e,t,i){i===void 0&&(i=t);var a=Object.getOwnPropertyDescriptor(e,t);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,a)}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]};n(P_,"__exportStar");n(An,"__values");n(Fc,"__read");n(C_,"__spread");n(H_,"__spreadArrays");n(E_,"__spreadArray");n(xr,"__await");n(A_,"__asyncGenerator");n(T_,"__asyncDelegator");n(I_,"__asyncValues");n(R_,"__makeTemplateObject");uE=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e};n(D_,"__importStar");n(O_,"__importDefault");n(B_,"__classPrivateFieldGet");n(U_,"__classPrivateFieldSet");n(j_,"__classPrivateFieldIn");n(k_,"__addDisposableResource");lE=typeof SuppressedError=="function"?SuppressedError:function(r,e,t){var i=new Error(t);return i.name="SuppressedError",i.error=r,i.suppressed=e,i};n(L_,"__disposeResources");cE={__extends:g_,__assign:En,__rest:b_,__decorate:v_,__param:w_,__metadata:x_,__awaiter:S_,__generator:q_,__createBinding:Tn,__exportStar:P_,__values:An,__read:Fc,__spread:C_,__spreadArrays:H_,__spreadArray:E_,__await:xr,__asyncGenerator:A_,__asyncDelegator:T_,__asyncValues:I_,__makeTemplateObject:R_,__importStar:D_,__importDefault:O_,__classPrivateFieldGet:B_,__classPrivateFieldSet:U_,__classPrivateFieldIn:j_,__addDisposableResource:k_,__disposeResources:L_}});var wi=l((s2,M_)=>{M_.exports.isNode=!1});var Jt=l(Pt=>{"use strict";var qt;Object.defineProperty(Pt,"__esModule",{value:!0});Pt.LogLevelToConsoleFunction=Pt.resolveLogLevel=Pt.LogLevel=void 0;var dE=wi(),_e;(function(r){r[r.CRITICAL=0]="CRITICAL",r[r.ERROR=1]="ERROR",r[r.WARNING=2]="WARNING",r[r.INFO=3]="INFO",r[r.DEBUG=4]="DEBUG",r[r.TRACE=7]="TRACE"})(_e||(_e={}));Pt.LogLevel=_e;function pE(r){if(typeof r=="number"){if(Object.prototype.hasOwnProperty.call(_e,r))return r;var e=Object.keys(_e).map(function(i){return parseInt(i,10)}).filter(function(i){return!isNaN(i)&&i<r});return e.length?Math.max.apply(Math,e):_e.WARNING}var t=r.replace(/\d+$/,"").toUpperCase();if(!Object.prototype.hasOwnProperty.call(_e,t))throw new Error("Unknown log level string: ".concat(r));return _e[t]}n(pE,"resolveLogLevel");Pt.resolveLogLevel=pE;var hE=dE.isNode?console.log.bind(console):console.debug.bind(console);Pt.LogLevelToConsoleFunction=(qt={},qt[_e.CRITICAL]=console.error.bind(console),qt[_e.ERROR]=console.error.bind(console),qt[_e.WARNING]=console.warn.bind(console),qt[_e.INFO]=console.info.bind(console),qt[_e.DEBUG]=hE.bind(console),qt[_e.TRACE]=console.trace.bind(console),qt)});var F_=l(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.Enumerable=void 0;function fE(r){return r===void 0&&(r=!0),function(e,t){Object.defineProperty(e,t,{get:function(){},set:function(i){Object.defineProperty(this,t,{value:i,writable:!0,enumerable:r})},enumerable:r})}}n(fE,"Enumerable");In.Enumerable=fE});var Q_=l(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.flatten=void 0;var N_=(y(),g(m));function mE(r){var e;return(e=[]).concat.apply(e,N_.__spreadArray([],N_.__read(r),!1))}n(mE,"flatten");Rn.flatten=mE});var G_=l(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.partitionedFlatMap=void 0;var Nc=(y(),g(m));function yE(r,e,t){var i,a,o,s={};try{for(var u=Nc.__values(r),c=u.next();!c.done;c=u.next()){var h=c.value,d=e(h),_=t(h);Array.isArray(_)||(_=[_]),Object.prototype.hasOwnProperty.call(s,d)?(o=s[d]).push.apply(o,Nc.__spreadArray([],Nc.__read(_),!1)):s[d]=_}}catch(b){i={error:b}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}return s}n(yE,"partitionedFlatMap");Dn.partitionedFlatMap=yE});var $_=l(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.resolveConfigValueSync=Sr.resolveConfigValue=void 0;var V_=(y(),g(m));function _E(r){return V_.__awaiter(this,void 0,void 0,function(){return V_.__generator(this,function(e){switch(e.label){case 0:return typeof r!="function"?[3,2]:[4,r()];case 1:return[2,e.sent()];case 2:return[2,r]}})})}n(_E,"resolveConfigValue");Sr.resolveConfigValue=_E;function gE(r){return typeof r=="function"?r():r}n(gE,"resolveConfigValueSync");Sr.resolveConfigValueSync=gE});var W_=l(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.deprecateClass=void 0;var Qc=(y(),g(m));function bE(r,e){var t=!1;return function(i){Qc.__extends(a,i);function a(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return t||(console.warn(e),t=!0),i.apply(this,Qc.__spreadArray([],Qc.__read(o),!1))||this}return n(a,"class_1"),a}(r)}n(bE,"deprecateClass");On.deprecateClass=bE});var K_=l(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.match=Zt.eq=void 0;var z_=n(function(r){return{otherwise:function(){return r},on:function(){return z_(r)}}},"matched"),Gc=n(function(r){return{on:function(e,t){return e(r)?z_(t(r)):Gc(r)},otherwise:function(e){return e(r)}}},"match");Zt.match=Gc;var vE=n(function(r){return function(e){return r===e}},"eq");Zt.eq=vE;Gc.eq=Zt.eq});var Z_=l(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.fibWithLimit=void 0;var J_=(y(),g(m));function wE(r){var e,t,i;return J_.__generator(this,function(a){switch(a.label){case 0:e=0,t=1,a.label=1;case 1:return e<r?[4,e]:[3,3];case 2:return a.sent(),i=J_.__read([t,e+t],2),e=i[0],t=i[1],[3,1];case 3:return[4,r];case 4:return a.sent(),[3,3];case 5:return[2]}})}n(wE,"fibWithLimit");Bn.fibWithLimit=wE});var jn=l(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.arrayToObject=void 0;var Y_=(y(),g(m));function xE(r,e){return Object.assign.apply(Object,Y_.__spreadArray([{}],Y_.__read(r.map(e)),!1))}n(xE,"arrayToObject");Un.arrayToObject=xE});var X_=l(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.entriesToObject=void 0;var SE=(y(),g(m)),qE=jn();function PE(r){return(0,qE.arrayToObject)(r,function(e){var t,i=SE.__read(e,2),a=i[0],o=i[1];return t={},t[a]=o,t})}n(PE,"entriesToObject");kn.entriesToObject=PE});var eg=l(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.forEachObjectEntry=void 0;var CE=(y(),g(m));function HE(r,e){Object.entries(r).forEach(function(t){var i=CE.__read(t,2),a=i[0],o=i[1];return e(o,a)})}n(HE,"forEachObjectEntry");Ln.forEachObjectEntry=HE});var tg=l(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.groupBy=void 0;var EE=(y(),g(m));function AE(r,e){var t,i,a;if(typeof e!="function"){var o=e;e=n(function(_){return _[o].toString()},"keyFn")}var s={};try{for(var u=EE.__values(r),c=u.next();!c.done;c=u.next()){var h=c.value,d=e(h);((a=s[d])!==null&&a!==void 0?a:s[d]=[]).push(h)}}catch(_){t={error:_}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(t)throw t.error}}return s}n(AE,"groupBy");Mn.groupBy=AE});var rg=l(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.indexBy=void 0;var TE=jn();function IE(r,e){if(typeof e!="function"){var t=e;e=n(function(i){return i[t].toString()},"keyFn")}return(0,TE.arrayToObject)(r,function(i){var a;return a={},a[e(i)]=i,a})}n(IE,"indexBy");Fn.indexBy=IE});var ig=l(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.mapObject=void 0;var Vc=(y(),g(m));function RE(r,e){var t=Object.entries(r).map(function(i){var a,o=Vc.__read(i,2),s=o[0],u=o[1];return a={},a[s]=e(u,s),a});return Object.assign.apply(Object,Vc.__spreadArray([{}],Vc.__read(t),!1))}n(RE,"mapObject");Nn.mapObject=RE});var $c=l(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.pick=void 0;var Qn=(y(),g(m));function DE(r,e){return Object.assign.apply(Object,Qn.__spreadArray([{}],Qn.__read(Object.entries(r).filter(function(t){var i=Qn.__read(t,1),a=i[0];return e.includes(a)}).map(function(t){var i,a=Qn.__read(t,2),o=a[0],s=a[1];return i={},i[o]=s,i})),!1))}n(DE,"pick");Gn.pick=DE});var ng=l(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.omit=void 0;var OE=$c();function BE(r,e){return(0,OE.pick)(r,Object.keys(r).filter(function(t){return!e.includes(t)}))}n(BE,"omit");Vn.omit=BE});var ag=l(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.mapOptional=Ct.mapNullable=Ct.isNullish=void 0;function Wc(r){return r==null}n(Wc,"isNullish");Ct.isNullish=Wc;function UE(r,e){return Wc(r)?null:e(r)}n(UE,"mapNullable");Ct.mapNullable=UE;function jE(r,e){return Wc(r)?void 0:e(r)}n(jE,"mapOptional");Ct.mapOptional=jE});var sg=l($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.delay=void 0;var og=(y(),g(m));function kE(r){return og.__awaiter(this,void 0,void 0,function(){return og.__generator(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t){return setTimeout(t,r)})];case 1:return e.sent(),[2]}})})}n(kE,"delay");$n.delay=kE});var ug=l(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.promiseWithResolvers=void 0;function LE(){var r,e,t=new Promise(function(i,a){r=i,e=a});return{promise:t,resolve:r,reject:e}}n(LE,"promiseWithResolvers");Wn.promiseWithResolvers=LE});var lg=l(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.padLeft=void 0;function ME(r,e,t){if(typeof r=="number"&&(r=r.toString()),e=e-r.length,e<=0)return r;t===void 0&&(t=" ");var i="";do(e&1)===1&&(i+=t),e>>=1,e&&(t+=t);while(e);return i+r}n(ME,"padLeft");zn.padLeft=ME});var cg=l(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.splitWithLimit=void 0;var zc=(y(),g(m));function FE(r,e,t){var i=r.split(e);return i.length<=t?i:zc.__spreadArray(zc.__spreadArray([],zc.__read(i.slice(0,t-1)),!1),[i.slice(t-1).join(e)],!1)}n(FE,"splitWithLimit");Kn.splitWithLimit=FE});var dg=l(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.utf8Substring=qr.utf8Length=void 0;var Jn=(y(),g(m));function NE(r){return Jn.__spreadArray([],Jn.__read(r),!1).length}n(NE,"utf8Length");qr.utf8Length=NE;function QE(r,e,t){return Jn.__spreadArray([],Jn.__read(r),!1).slice(e,t).join("")}n(QE,"utf8Substring");qr.utf8Substring=QE});var S=l(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.utf8Substring=P.utf8Length=P.splitWithLimit=P.padLeft=P.promiseWithResolvers=P.delay=P.mapOptional=P.mapNullable=P.isNullish=P.pick=P.omit=P.mapObject=P.indexBy=P.groupBy=P.forEachObjectEntry=P.entriesToObject=P.arrayToObject=P.fibWithLimit=P.eq=P.match=P.deprecateClass=P.resolveConfigValueSync=P.resolveConfigValue=P.partitionedFlatMap=P.flatten=P.Enumerable=void 0;var GE=F_();Object.defineProperty(P,"Enumerable",{enumerable:!0,get:function(){return GE.Enumerable}});var VE=Q_();Object.defineProperty(P,"flatten",{enumerable:!0,get:function(){return VE.flatten}});var $E=G_();Object.defineProperty(P,"partitionedFlatMap",{enumerable:!0,get:function(){return $E.partitionedFlatMap}});var pg=$_();Object.defineProperty(P,"resolveConfigValue",{enumerable:!0,get:function(){return pg.resolveConfigValue}});Object.defineProperty(P,"resolveConfigValueSync",{enumerable:!0,get:function(){return pg.resolveConfigValueSync}});var WE=W_();Object.defineProperty(P,"deprecateClass",{enumerable:!0,get:function(){return WE.deprecateClass}});var hg=K_();Object.defineProperty(P,"match",{enumerable:!0,get:function(){return hg.match}});Object.defineProperty(P,"eq",{enumerable:!0,get:function(){return hg.eq}});var zE=Z_();Object.defineProperty(P,"fibWithLimit",{enumerable:!0,get:function(){return zE.fibWithLimit}});var KE=jn();Object.defineProperty(P,"arrayToObject",{enumerable:!0,get:function(){return KE.arrayToObject}});var JE=X_();Object.defineProperty(P,"entriesToObject",{enumerable:!0,get:function(){return JE.entriesToObject}});var ZE=eg();Object.defineProperty(P,"forEachObjectEntry",{enumerable:!0,get:function(){return ZE.forEachObjectEntry}});var YE=tg();Object.defineProperty(P,"groupBy",{enumerable:!0,get:function(){return YE.groupBy}});var XE=rg();Object.defineProperty(P,"indexBy",{enumerable:!0,get:function(){return XE.indexBy}});var eA=ig();Object.defineProperty(P,"mapObject",{enumerable:!0,get:function(){return eA.mapObject}});var tA=ng();Object.defineProperty(P,"omit",{enumerable:!0,get:function(){return tA.omit}});var rA=$c();Object.defineProperty(P,"pick",{enumerable:!0,get:function(){return rA.pick}});var Kc=ag();Object.defineProperty(P,"isNullish",{enumerable:!0,get:function(){return Kc.isNullish}});Object.defineProperty(P,"mapNullable",{enumerable:!0,get:function(){return Kc.mapNullable}});Object.defineProperty(P,"mapOptional",{enumerable:!0,get:function(){return Kc.mapOptional}});var iA=sg();Object.defineProperty(P,"delay",{enumerable:!0,get:function(){return iA.delay}});var nA=ug();Object.defineProperty(P,"promiseWithResolvers",{enumerable:!0,get:function(){return nA.promiseWithResolvers}});var aA=lg();Object.defineProperty(P,"padLeft",{enumerable:!0,get:function(){return aA.padLeft}});var oA=cg();Object.defineProperty(P,"splitWithLimit",{enumerable:!0,get:function(){return oA.splitWithLimit}});var fg=dg();Object.defineProperty(P,"utf8Length",{enumerable:!0,get:function(){return fg.utf8Length}});Object.defineProperty(P,"utf8Substring",{enumerable:!0,get:function(){return fg.utf8Substring}})});var Xc=l(Yn=>{"use strict";var Jc,Zc;Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getMinLogLevelFromEnv=void 0;var sA=Jt(),Zn=typeof process>"u"?[]:(Zc=(Jc=process.env.LOGGING)===null||Jc===void 0?void 0:Jc.split(";").map(function(r){var e=r.split("=",2),t=e[0],i=e[1];return i?[t==="default"?void 0:t.split(":"),(0,sA.resolveLogLevel)(i)]:null}).filter(function(r){return!!r}).sort(function(r,e){var t,i,a=r[0],o=e[0];return((t=o?.length)!==null&&t!==void 0?t:0)-((i=a?.length)!==null&&i!==void 0?i:0)}))!==null&&Zc!==void 0?Zc:[],Yc=Zn.findIndex(function(r){var e=r[0];return!e}),mg=void 0;Yc!==-1&&(mg=Zn[Yc][1],Zn.splice(Yc));function uA(r,e){return e.length<=r.length&&e.every(function(t,i){return t===r[i]})}n(uA,"isPrefix");function lA(r){for(var e=r.split(":"),t=0,i=Zn;t<i.length;t++){var a=i[t],o=a[0],s=a[1];if(uA(e,o))return s}return mg}n(lA,"getMinLogLevelFromEnv");Yn.getMinLogLevelFromEnv=lA});var ed=l(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.BaseLogger=void 0;var cA=S(),dA=wi(),pA=Xc(),Ht=Jt(),hA=function(){function r(e){var t=e.name,i=e.minLevel,a=e.emoji,o=a===void 0?!1:a,s=e.colors,u=e.timestamps,c=u===void 0?dA.isNode:u,h,d;this._name=t,this._minLevel=(d=(h=(0,cA.mapOptional)(i,function(_){return(0,Ht.resolveLogLevel)(_)}))!==null&&h!==void 0?h:(0,pA.getMinLogLevelFromEnv)(t))!==null&&d!==void 0?d:Ht.LogLevel.WARNING,this._emoji=o,this._colors=s,this._timestamps=c}return n(r,"BaseLogger"),r.prototype.crit=function(e){this.log(Ht.LogLevel.CRITICAL,e)},r.prototype.error=function(e){this.log(Ht.LogLevel.ERROR,e)},r.prototype.warn=function(e){this.log(Ht.LogLevel.WARNING,e)},r.prototype.info=function(e){this.log(Ht.LogLevel.INFO,e)},r.prototype.debug=function(e){this.log(Ht.LogLevel.DEBUG,e)},r.prototype.trace=function(e){this.log(Ht.LogLevel.TRACE,e)},r}();Xn.BaseLogger=hA});var yg=l(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.BrowserLogger=void 0;var fA=(y(),g(m)),mA=Jt(),yA=ed(),_A=function(r){fA.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return n(e,"BrowserLogger"),e.prototype.log=function(t,i){if(!(t>this._minLevel)){var a=mA.LogLevelToConsoleFunction[t],o="[".concat(this._name,"] ").concat(i);this._timestamps&&(o="[".concat(new Date().toISOString(),"] ").concat(i)),a(o)}},e}(yA.BaseLogger);ea.BrowserLogger=_A});var _g=l(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.CustomLoggerWrapper=void 0;var gA=S(),bA=Xc(),Ce=Jt(),vA=function(){function r(e){var t=e.name,i=e.minLevel,a=e.custom,o;this._minLevel=(o=(0,gA.mapOptional)(i,function(s){return(0,Ce.resolveLogLevel)(s)}))!==null&&o!==void 0?o:(0,bA.getMinLogLevelFromEnv)(t),this._override=typeof a=="function"?{log:a}:a}return n(r,"CustomLoggerWrapper"),r.prototype.log=function(e,t){this._shouldLog(e)&&this._override.log(e,t)},r.prototype.crit=function(e){this._override.crit?this._shouldLog(Ce.LogLevel.CRITICAL)&&this._override.crit(e):this.log(Ce.LogLevel.CRITICAL,e)},r.prototype.error=function(e){this._override.error?this._shouldLog(Ce.LogLevel.ERROR)&&this._override.error(e):this.log(Ce.LogLevel.ERROR,e)},r.prototype.warn=function(e){this._override.warn?this._shouldLog(Ce.LogLevel.WARNING)&&this._override.warn(e):this.log(Ce.LogLevel.WARNING,e)},r.prototype.info=function(e){this._override.info?this._shouldLog(Ce.LogLevel.INFO)&&this._override.info(e):this.log(Ce.LogLevel.INFO,e)},r.prototype.debug=function(e){this._override.debug?this._shouldLog(Ce.LogLevel.DEBUG)&&this._override.debug(e):this.log(Ce.LogLevel.DEBUG,e)},r.prototype.trace=function(e){this._override.trace?this._shouldLog(Ce.LogLevel.TRACE)&&this._override.trace(e):this.log(Ce.LogLevel.TRACE,e)},r.prototype._shouldLog=function(e){return this._minLevel===void 0||this._minLevel>=e},r}();ta.CustomLoggerWrapper=vA});var gg=l(ge=>{"use strict";var Et,At,Tt;Object.defineProperty(ge,"__esModule",{value:!0});ge.NodeLogger=ge.LogLevelToBackgroundColor=ge.LogLevelToColor=ge.LogLevelToEmoji=void 0;var wA=(y(),g(m)),K=Jt(),xA=ed();ge.LogLevelToEmoji=(Et={},Et[K.LogLevel.CRITICAL]="\u{1F6D1}",Et[K.LogLevel.ERROR]="\u274C",Et[K.LogLevel.WARNING]="\u26A0\uFE0F ",Et[K.LogLevel.INFO]="\u2139\uFE0F ",Et[K.LogLevel.DEBUG]="\u{1F41E}",Et[K.LogLevel.TRACE]="\u{1F43E}",Et);var SA={black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,blackBright:90,redBright:91,greenBright:92,yellowBright:93,blueBright:94,magentaBright:95,cyanBright:96,whiteBright:97},qA={bgBlack:40,bgRed:41,bgGreen:42,bgYellow:43,bgBlue:44,bgMagenta:45,bgCyan:46,bgWhite:47,bgBlackBright:100,bgRedBright:101,bgGreenBright:102,bgYellowBright:103,bgBlueBright:104,bgMagentaBright:105,bgCyanBright:106,bgWhiteBright:107};function ra(r,e,t){return function(i){return"\x1B[".concat(r,"m").concat(t?t(i):i,"\x1B[").concat(e,"m")}}n(ra,"createGenericWrapper");function Ke(r){return ra(SA[r],39)}n(Ke,"createColorWrapper");function xi(r,e){return ra(qA[r],49,e)}n(xi,"createBgWrapper");ge.LogLevelToColor=(At={},At[K.LogLevel.CRITICAL]=Ke("red"),At[K.LogLevel.ERROR]=Ke("redBright"),At[K.LogLevel.WARNING]=Ke("yellow"),At[K.LogLevel.INFO]=Ke("blue"),At[K.LogLevel.DEBUG]=Ke("magenta"),At[K.LogLevel.TRACE]=ra(0,0),At);ge.LogLevelToBackgroundColor=(Tt={},Tt[K.LogLevel.CRITICAL]=xi("bgRed",Ke("white")),Tt[K.LogLevel.ERROR]=xi("bgRedBright",Ke("white")),Tt[K.LogLevel.WARNING]=xi("bgYellow",Ke("black")),Tt[K.LogLevel.INFO]=xi("bgBlue",Ke("white")),Tt[K.LogLevel.DEBUG]=xi("bgMagenta",Ke("black")),Tt[K.LogLevel.TRACE]=ra(7,27),Tt);var PA=function(r){wA.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return n(e,"NodeLogger"),e.prototype.log=function(t,i){var a,o,s;if(!(t>this._minLevel)){var u=K.LogLevelToConsoleFunction[t],c="";if(this._timestamps&&(c+="[".concat(new Date().toISOString(),"] ")),this._emoji){var h=ge.LogLevelToEmoji[t];c+="".concat(h," ")}var d=(s=(a=this._colors)!==null&&a!==void 0?a:(o=process.stdout)===null||o===void 0?void 0:o.isTTY)!==null&&s!==void 0?s:!0;d?c+="".concat(ge.LogLevelToBackgroundColor[t](this._name)," ").concat(ge.LogLevelToBackgroundColor[t](K.LogLevel[t])," ").concat(ge.LogLevelToColor[t](i)):c+="[".concat(this._name,":").concat(K.LogLevel[t].toLowerCase(),"] ").concat(i),u(c)}},e}(xA.BaseLogger);ge.NodeLogger=PA});var bg=l(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.createLogger=void 0;var CA=wi(),HA=yg(),EA=_g(),AA=gg();function TA(r){return r.custom?new EA.CustomLoggerWrapper(r):CA.isNode?new AA.NodeLogger(r):new HA.BrowserLogger(r)}n(TA,"createLogger");ia.createLogger=TA});var Si=l(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.LogLevel=Pr.createLogger=void 0;var IA=bg();Object.defineProperty(Pr,"createLogger",{enumerable:!0,get:function(){return IA.createLogger}});var RA=Jt();Object.defineProperty(Pr,"LogLevel",{enumerable:!0,get:function(){return RA.LogLevel}})});var rd=l(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.CustomError=void 0;var td=(y(),g(m)),DA=function(r){td.__extends(e,r);function e(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var a=this.constructor,o=this,s;return o=r.apply(this,td.__spreadArray([],td.__read(t),!1))||this,Object.setPrototypeOf(o,a.prototype),(s=Error.captureStackTrace)===null||s===void 0||s.call(Error,o,a.constructor),o}return n(e,"CustomError"),Object.defineProperty(e.prototype,"name",{get:function(){return this.constructor.name},enumerable:!1,configurable:!0}),e}(Error);na.CustomError=DA});var id=l(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.RetryAfterError=void 0;var OA=(y(),g(m)),BA=rd(),UA=function(r){OA.__extends(e,r);function e(t){var i=r.call(this,"Need to retry after ".concat(t," ms"))||this;return i._retryAt=Date.now()+t,i}return n(e,"RetryAfterError"),Object.defineProperty(e.prototype,"retryAt",{get:function(){return this._retryAt},enumerable:!1,configurable:!0}),e}(BA.CustomError);aa.RetryAfterError=UA});var qi=l(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.RateLimitReachedError=void 0;var jA=(y(),g(m)),kA=rd(),LA=function(r){jA.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return n(e,"RateLimitReachedError"),e}(kA.CustomError);oa.RateLimitReachedError=LA});var wg=l(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.NullRateLimiter=void 0;var vg=(y(),g(m)),MA=function(){function r(e){this._callback=e}return n(r,"NullRateLimiter"),r.prototype.request=function(e){return vg.__awaiter(this,void 0,void 0,function(){return vg.__generator(this,function(t){switch(t.label){case 0:return[4,this._callback(e)];case 1:return[2,t.sent()]}})})},r.prototype.clear=function(){},r.prototype.pause=function(){},r.prototype.resume=function(){},r}();sa.NullRateLimiter=MA});var Sg=l((vV,xg)=>{"use strict";var FA="Function.prototype.bind called on incompatible ",nd=Array.prototype.slice,NA=Object.prototype.toString,QA="[object Function]";xg.exports=n(function(e){var t=this;if(typeof t!="function"||NA.call(t)!==QA)throw new TypeError(FA+t);for(var i=nd.call(arguments,1),a,o=n(function(){if(this instanceof a){var d=t.apply(this,i.concat(nd.call(arguments)));return Object(d)===d?d:this}else return t.apply(e,i.concat(nd.call(arguments)))},"binder"),s=Math.max(0,t.length-i.length),u=[],c=0;c<s;c++)u.push("$"+c);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var h=n(function(){},"Empty");h.prototype=t.prototype,a.prototype=new h,h.prototype=null}return a},"bind")});var ua=l((xV,qg)=>{"use strict";var GA=Sg();qg.exports=Function.prototype.bind||GA});var la=l((SV,Pg)=>{"use strict";Pg.exports=n(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,t);if(s.value!==a||s.enumerable!==!0)return!1}return!0},"hasSymbols")});var ca=l((PV,Hg)=>{"use strict";var Cg=typeof Symbol<"u"&&Symbol,VA=la();Hg.exports=n(function(){return typeof Cg!="function"||typeof Symbol!="function"||typeof Cg("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:VA()},"hasNativeSymbols")});var ad=l((HV,Ag)=>{"use strict";var Eg={foo:{}},$A=Object;Ag.exports=n(function(){return{__proto__:Eg}.foo===Eg.foo&&!({__proto__:null}instanceof $A)},"hasProto")});var ct=l((AV,Tg)=>{"use strict";var WA=ua();Tg.exports=WA.call(Function.call,Object.prototype.hasOwnProperty)});var I=l((TV,Bg)=>{"use strict";var T,Ar=SyntaxError,Og=Function,Er=TypeError,od=n(function(r){try{return Og('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),Yt=Object.getOwnPropertyDescriptor;if(Yt)try{Yt({},"")}catch{Yt=null}var sd=n(function(){throw new Er},"throwTypeError"),zA=Yt?function(){try{return arguments.callee,sd}catch{try{return Yt(arguments,"callee").get}catch{return sd}}}():sd,Cr=ca()(),KA=ad()(),re=Object.getPrototypeOf||(KA?function(r){return r.__proto__}:null),Hr={},JA=typeof Uint8Array>"u"||!re?T:re(Uint8Array),Xt={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":Cr&&re?re([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":Hr,"%AsyncGenerator%":Hr,"%AsyncGeneratorFunction%":Hr,"%AsyncIteratorPrototype%":Hr,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?T:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?T:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":Og,"%GeneratorFunction%":Hr,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Cr&&re?re(re([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Cr||!re?T:re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Cr||!re?T:re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Cr&&re?re(""[Symbol.iterator]()):T,"%Symbol%":Cr?Symbol:T,"%SyntaxError%":Ar,"%ThrowTypeError%":zA,"%TypedArray%":JA,"%TypeError%":Er,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet};if(re)try{null.error}catch(r){Ig=re(re(r)),Xt["%Error.prototype%"]=Ig}var Ig,ZA=n(function r(e){var t;if(e==="%AsyncFunction%")t=od("async function () {}");else if(e==="%GeneratorFunction%")t=od("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=od("async function* () {}");else if(e==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&re&&(t=re(a.prototype))}return Xt[e]=t,t},"doEval"),Rg={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Pi=ua(),da=ct(),YA=Pi.call(Function.call,Array.prototype.concat),XA=Pi.call(Function.apply,Array.prototype.splice),Dg=Pi.call(Function.call,String.prototype.replace),pa=Pi.call(Function.call,String.prototype.slice),eT=Pi.call(Function.call,RegExp.prototype.exec),tT=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rT=/\\(\\)?/g,iT=n(function(e){var t=pa(e,0,1),i=pa(e,-1);if(t==="%"&&i!=="%")throw new Ar("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new Ar("invalid intrinsic syntax, expected opening `%`");var a=[];return Dg(e,tT,function(o,s,u,c){a[a.length]=u?Dg(c,rT,"$1"):s||o}),a},"stringToPath"),nT=n(function(e,t){var i=e,a;if(da(Rg,i)&&(a=Rg[i],i="%"+a[0]+"%"),da(Xt,i)){var o=Xt[i];if(o===Hr&&(o=ZA(i)),typeof o>"u"&&!t)throw new Er("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:i,value:o}}throw new Ar("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Bg.exports=n(function(e,t){if(typeof e!="string"||e.length===0)throw new Er("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Er('"allowMissing" argument must be a boolean');if(eT(/^%?[^%]*%?$/,e)===null)throw new Ar("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=iT(e),a=i.length>0?i[0]:"",o=nT("%"+a+"%",t),s=o.name,u=o.value,c=!1,h=o.alias;h&&(a=h[0],XA(i,YA([0,1],h)));for(var d=1,_=!0;d<i.length;d+=1){var b=i[d],q=pa(b,0,1),v=pa(b,-1);if((q==='"'||q==="'"||q==="`"||v==='"'||v==="'"||v==="`")&&q!==v)throw new Ar("property names with quotes must have matching quotes");if((b==="constructor"||!_)&&(c=!0),a+="."+b,s="%"+a+"%",da(Xt,s))u=Xt[s];else if(u!=null){if(!(b in u)){if(!t)throw new Er("base intrinsic for "+e+" exists, but the property is not available.");return}if(Yt&&d+1>=i.length){var x=Yt(u,b);_=!!x,_&&"get"in x&&!("originalValue"in x.get)?u=x.get:u=u[b]}else _=da(u,b),u=u[b];_&&!c&&(Xt[s]=u)}}return u},"GetIntrinsic")});var Ir=l((RV,ha)=>{"use strict";var ud=ua(),Tr=I(),kg=Tr("%Function.prototype.apply%"),Lg=Tr("%Function.prototype.call%"),Mg=Tr("%Reflect.apply%",!0)||ud.call(Lg,kg),Ug=Tr("%Object.getOwnPropertyDescriptor%",!0),er=Tr("%Object.defineProperty%",!0),aT=Tr("%Math.max%");if(er)try{er({},"a",{value:1})}catch{er=null}ha.exports=n(function(e){var t=Mg(ud,Lg,arguments);if(Ug&&er){var i=Ug(t,"length");i.configurable&&er(t,"length",{value:1+aT(0,e.length-(arguments.length-1))})}return t},"callBind");var jg=n(function(){return Mg(ud,kg,arguments)},"applyBind");er?er(ha.exports,"apply",{value:jg}):ha.exports.apply=jg});var ld=l((OV,Ng)=>{"use strict";var Fg=Object.prototype.toString;Ng.exports=n(function(e){var t=Fg.call(e),i=t==="[object Arguments]";return i||(i=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Fg.call(e.callee)==="[object Function]"),i},"isArguments")});var Zg=l((UV,Jg)=>{"use strict";var Kg;Object.keys||(Ci=Object.prototype.hasOwnProperty,cd=Object.prototype.toString,Qg=ld(),dd=Object.prototype.propertyIsEnumerable,Gg=!dd.call({toString:null},"toString"),Vg=dd.call(function(){},"prototype"),Hi=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],fa=n(function(r){var e=r.constructor;return e&&e.prototype===r},"equalsConstructorPrototype"),$g={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Wg=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!$g["$"+r]&&Ci.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{fa(window[r])}catch{return!0}}catch{return!0}return!1}(),zg=n(function(r){if(typeof window>"u"||!Wg)return fa(r);try{return fa(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),Kg=n(function(e){var t=e!==null&&typeof e=="object",i=cd.call(e)==="[object Function]",a=Qg(e),o=t&&cd.call(e)==="[object String]",s=[];if(!t&&!i&&!a)throw new TypeError("Object.keys called on a non-object");var u=Vg&&i;if(o&&e.length>0&&!Ci.call(e,0))for(var c=0;c<e.length;++c)s.push(String(c));if(a&&e.length>0)for(var h=0;h<e.length;++h)s.push(String(h));else for(var d in e)!(u&&d==="prototype")&&Ci.call(e,d)&&s.push(String(d));if(Gg)for(var _=zg(e),b=0;b<Hi.length;++b)!(_&&Hi[b]==="constructor")&&Ci.call(e,Hi[b])&&s.push(Hi[b]);return s},"keys"));var Ci,cd,Qg,dd,Gg,Vg,Hi,fa,$g,Wg,zg;Jg.exports=Kg});var tb=l((kV,eb)=>{"use strict";var oT=Array.prototype.slice,sT=ld(),Yg=Object.keys,ma=Yg?n(function(e){return Yg(e)},"keys"):Zg(),Xg=Object.keys;ma.shim=n(function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=n(function(i){return sT(i)?Xg(oT.call(i)):Xg(i)},"keys"))}else Object.keys=ma;return Object.keys||ma},"shimObjectKeys");eb.exports=ma});var fd=l((MV,rb)=>{"use strict";var uT=I(),pd=uT("%Object.defineProperty%",!0),hd=n(function(){if(pd)try{return pd({},"a",{value:1}),!0}catch{return!1}return!1},"hasPropertyDescriptors");hd.hasArrayLengthDefineBug=n(function(){if(!hd())return null;try{return pd([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");rb.exports=hd});var tr=l((NV,ob)=>{"use strict";var lT=tb(),cT=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",dT=Object.prototype.toString,pT=Array.prototype.concat,ib=Object.defineProperty,hT=n(function(r){return typeof r=="function"&&dT.call(r)==="[object Function]"},"isFunction"),fT=fd()(),nb=ib&&fT,mT=n(function(r,e,t,i){if(e in r){if(i===!0){if(r[e]===t)return}else if(!hT(i)||!i())return}nb?ib(r,e,{configurable:!0,enumerable:!1,value:t,writable:!0}):r[e]=t},"defineProperty"),ab=n(function(r,e){var t=arguments.length>2?arguments[2]:{},i=lT(e);cT&&(i=pT.call(i,Object.getOwnPropertySymbols(e)));for(var a=0;a<i.length;a+=1)mT(r,i[a],e[i[a]],t[i[a]])},"defineProperties");ab.supportsDescriptors=!!nb;ob.exports=ab});var Ei=l((GV,sb)=>{"use strict";sb.exports=n(function(){if(typeof Promise!="function")throw new TypeError("`Promise.allSettled` requires a global `Promise` be available.")},"requirePromise")});var db=l(($V,cb)=>{"use strict";var yT=I(),_T=Ir(),ub=yT("%Promise.resolve%",!0),lb=ub&&_T(ub);cb.exports=n(function(e,t){if(!lb)throw new SyntaxError("This environment does not support Promises.");return lb(e,t)},"PromiseResolve")});var md=l((zV,pb)=>{"use strict";pb.exports=n(function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(typeof e=="function"||typeof e=="object")return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},"Type")});var fb=l((JV,hb)=>{"use strict";var gT=md();hb.exports=n(function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":gT(e)},"Type")});var Ai=l((YV,mb)=>{"use strict";var bT=la();mb.exports=n(function(){return bT()&&!!Symbol.toStringTag},"hasToStringTagShams")});var He=l((e$,gb)=>{"use strict";var yb=I(),_b=Ir(),vT=_b(yb("String.prototype.indexOf"));gb.exports=n(function(e,t){var i=yb(e,!!t);return typeof i=="function"&&vT(e,".prototype.")>-1?_b(i):i},"callBoundIntrinsic")});var wb=l((r$,vb)=>{"use strict";var wT=Ai()(),xT=He(),yd=xT("Object.prototype.toString"),ya=n(function(e){return wT&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:yd(e)==="[object Arguments]"},"isArguments"),bb=n(function(e){return ya(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&yd(e)!=="[object Array]"&&yd(e.callee)==="[object Function]"},"isArguments"),ST=function(){return ya(arguments)}();ya.isLegacyArguments=bb;vb.exports=ST?ya:bb});var xb=l(()=>{});var Ad=l((o$,Fb)=>{var Cd=typeof Map=="function"&&Map.prototype,_d=Object.getOwnPropertyDescriptor&&Cd?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ga=Cd&&_d&&typeof _d.get=="function"?_d.get:null,Sb=Cd&&Map.prototype.forEach,Hd=typeof Set=="function"&&Set.prototype,gd=Object.getOwnPropertyDescriptor&&Hd?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ba=Hd&&gd&&typeof gd.get=="function"?gd.get:null,qb=Hd&&Set.prototype.forEach,qT=typeof WeakMap=="function"&&WeakMap.prototype,Ii=qT?WeakMap.prototype.has:null,PT=typeof WeakSet=="function"&&WeakSet.prototype,Ri=PT?WeakSet.prototype.has:null,CT=typeof WeakRef=="function"&&WeakRef.prototype,Pb=CT?WeakRef.prototype.deref:null,HT=Boolean.prototype.valueOf,ET=Object.prototype.toString,AT=Function.prototype.toString,TT=String.prototype.match,Ed=String.prototype.slice,Rt=String.prototype.replace,IT=String.prototype.toUpperCase,Cb=String.prototype.toLowerCase,Bb=RegExp.prototype.test,Hb=Array.prototype.concat,Je=Array.prototype.join,RT=Array.prototype.slice,Eb=Math.floor,wd=typeof BigInt=="function"?BigInt.prototype.valueOf:null,bd=Object.getOwnPropertySymbols,xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",he=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Rr||"symbol")?Symbol.toStringTag:null,Ub=Object.prototype.propertyIsEnumerable,Ab=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Tb(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Bb.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-Eb(-r):Eb(r);if(i!==r){var a=String(i),o=Ed.call(e,a.length+1);return Rt.call(a,t,"$&_")+"."+Rt.call(Rt.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Rt.call(e,t,"$&_")}n(Tb,"addNumericSeparator");var Sd=xb(),Ib=Sd.custom,Rb=kb(Ib)?Ib:null;Fb.exports=n(function r(e,t,i,a){var o=t||{};if(It(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(It(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=It(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(It(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(It(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Mb(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return u?Tb(e,c):c}if(typeof e=="bigint"){var h=String(e)+"n";return u?Tb(e,h):h}var d=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=d&&d>0&&typeof e=="object")return qd(e)?"[Array]":"[Object]";var _=JT(o,i);if(typeof a>"u")a=[];else if(Lb(a,e)>=0)return"[Circular]";function b(yr,gn,AC){if(gn&&(a=RT.call(a),a.push(gn)),AC){var Ay={depth:o.depth};return It(o,"quoteStyle")&&(Ay.quoteStyle=o.quoteStyle),r(yr,Ay,i+1,a)}return r(yr,o,i+1,a)}if(n(b,"inspect"),typeof e=="function"&&!Db(e)){var q=FT(e),v=_a(e,b);return"[Function"+(q?": "+q:" (anonymous)")+"]"+(v.length>0?" { "+Je.call(v,", ")+" }":"")}if(kb(e)){var x=Rr?Rt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):xd.call(e);return typeof e=="object"&&!Rr?Ti(x):x}if(WT(e)){for(var A="<"+Cb.call(String(e.nodeName)),O=e.attributes||[],z=0;z<O.length;z++)A+=" "+O[z].name+"="+jb(DT(O[z].value),"double",o);return A+=">",e.childNodes&&e.childNodes.length&&(A+="..."),A+="</"+Cb.call(String(e.nodeName))+">",A}if(qd(e)){if(e.length===0)return"[]";var le=_a(e,b);return _&&!KT(le)?"["+Pd(le,_)+"]":"[ "+Je.call(le,", ")+" ]"}if(BT(e)){var te=_a(e,b);return!("cause"in Error.prototype)&&"cause"in e&&!Ub.call(e,"cause")?"{ ["+String(e)+"] "+Je.call(Hb.call("[cause]: "+b(e.cause),te),", ")+" }":te.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Je.call(te,", ")+" }"}if(typeof e=="object"&&s){if(Rb&&typeof e[Rb]=="function"&&Sd)return Sd(e,{depth:d-i});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(NT(e)){var Py=[];return Sb&&Sb.call(e,function(yr,gn){Py.push(b(gn,e,!0)+" => "+b(yr,e))}),Ob("Map",ga.call(e),Py,_)}if(VT(e)){var Cy=[];return qb&&qb.call(e,function(yr){Cy.push(b(yr,e))}),Ob("Set",ba.call(e),Cy,_)}if(QT(e))return vd("WeakMap");if($T(e))return vd("WeakSet");if(GT(e))return vd("WeakRef");if(jT(e))return Ti(b(Number(e)));if(LT(e))return Ti(b(wd.call(e)));if(kT(e))return Ti(HT.call(e));if(UT(e))return Ti(b(String(e)));if(!OT(e)&&!Db(e)){var lc=_a(e,b),Hy=Ab?Ab(e)===Object.prototype:e instanceof Object||e.constructor===Object,cc=e instanceof Object?"":"null prototype",Ey=!Hy&&he&&Object(e)===e&&he in e?Ed.call(Dt(e),8,-1):cc?"Object":"",EC=Hy||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",dc=EC+(Ey||cc?"["+Je.call(Hb.call([],Ey||[],cc||[]),": ")+"] ":"");return lc.length===0?dc+"{}":_?dc+"{"+Pd(lc,_)+"}":dc+"{ "+Je.call(lc,", ")+" }"}return String(e)},"inspect_");function jb(r,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+r+i}n(jb,"wrapQuotes");function DT(r){return Rt.call(String(r),/"/g,""")}n(DT,"quote");function qd(r){return Dt(r)==="[object Array]"&&(!he||!(typeof r=="object"&&he in r))}n(qd,"isArray");function OT(r){return Dt(r)==="[object Date]"&&(!he||!(typeof r=="object"&&he in r))}n(OT,"isDate");function Db(r){return Dt(r)==="[object RegExp]"&&(!he||!(typeof r=="object"&&he in r))}n(Db,"isRegExp");function BT(r){return Dt(r)==="[object Error]"&&(!he||!(typeof r=="object"&&he in r))}n(BT,"isError");function UT(r){return Dt(r)==="[object String]"&&(!he||!(typeof r=="object"&&he in r))}n(UT,"isString");function jT(r){return Dt(r)==="[object Number]"&&(!he||!(typeof r=="object"&&he in r))}n(jT,"isNumber");function kT(r){return Dt(r)==="[object Boolean]"&&(!he||!(typeof r=="object"&&he in r))}n(kT,"isBoolean");function kb(r){if(Rr)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!xd)return!1;try{return xd.call(r),!0}catch{}return!1}n(kb,"isSymbol");function LT(r){if(!r||typeof r!="object"||!wd)return!1;try{return wd.call(r),!0}catch{}return!1}n(LT,"isBigInt");var MT=Object.prototype.hasOwnProperty||function(r){return r in this};function It(r,e){return MT.call(r,e)}n(It,"has");function Dt(r){return ET.call(r)}n(Dt,"toStr");function FT(r){if(r.name)return r.name;var e=TT.call(AT.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}n(FT,"nameOf");function Lb(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,i=r.length;t<i;t++)if(r[t]===e)return t;return-1}n(Lb,"indexOf");function NT(r){if(!ga||!r||typeof r!="object")return!1;try{ga.call(r);try{ba.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}n(NT,"isMap");function QT(r){if(!Ii||!r||typeof r!="object")return!1;try{Ii.call(r,Ii);try{Ri.call(r,Ri)}catch{return!0}return r instanceof WeakMap}catch{}return!1}n(QT,"isWeakMap");function GT(r){if(!Pb||!r||typeof r!="object")return!1;try{return Pb.call(r),!0}catch{}return!1}n(GT,"isWeakRef");function VT(r){if(!ba||!r||typeof r!="object")return!1;try{ba.call(r);try{ga.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}n(VT,"isSet");function $T(r){if(!Ri||!r||typeof r!="object")return!1;try{Ri.call(r,Ri);try{Ii.call(r,Ii)}catch{return!0}return r instanceof WeakSet}catch{}return!1}n($T,"isWeakSet");function WT(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}n(WT,"isElement");function Mb(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return Mb(Ed.call(r,0,e.maxStringLength),e)+i}var a=Rt.call(Rt.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,zT);return jb(a,"single",e)}n(Mb,"inspectString");function zT(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+IT.call(e.toString(16))}n(zT,"lowbyte");function Ti(r){return"Object("+r+")"}n(Ti,"markBoxed");function vd(r){return r+" { ? }"}n(vd,"weakCollectionOf");function Ob(r,e,t,i){var a=i?Pd(t,i):Je.call(t,", ");return r+" ("+e+") {"+a+"}"}n(Ob,"collectionOf");function KT(r){for(var e=0;e<r.length;e++)if(Lb(r[e],`
|
|
6
|
+
`)>=0)return!1;return!0}n(KT,"singleLineValues");function JT(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=Je.call(Array(r.indent+1)," ");else return null;return{base:t,prev:Je.call(Array(e+1),t)}}n(JT,"getIndent");function Pd(r,e){if(r.length===0)return"";var t=`
|
|
7
|
+
`+e.prev+e.base;return t+Je.call(r,","+t)+`
|
|
8
|
+
`+e.prev}n(Pd,"indentedJoin");function _a(r,e){var t=qd(r),i=[];if(t){i.length=r.length;for(var a=0;a<r.length;a++)i[a]=It(r,a)?e(r[a],r):""}var o=typeof bd=="function"?bd(r):[],s;if(Rr){s={};for(var u=0;u<o.length;u++)s["$"+o[u]]=o[u]}for(var c in r)It(r,c)&&(t&&String(Number(c))===c&&c<r.length||Rr&&s["$"+c]instanceof Symbol||(Bb.call(/[^\w$]/,c)?i.push(e(c,r)+": "+e(r[c],r)):i.push(c+": "+e(r[c],r))));if(typeof bd=="function")for(var h=0;h<o.length;h++)Ub.call(r,o[h])&&i.push("["+e(o[h])+"]: "+e(r[o[h]],r));return i}n(_a,"arrObjKeys")});var Qb=l((u$,Nb)=>{"use strict";var Td=I(),Dr=He(),ZT=Ad(),YT=Td("%TypeError%"),va=Td("%WeakMap%",!0),wa=Td("%Map%",!0),XT=Dr("WeakMap.prototype.get",!0),e1=Dr("WeakMap.prototype.set",!0),t1=Dr("WeakMap.prototype.has",!0),r1=Dr("Map.prototype.get",!0),i1=Dr("Map.prototype.set",!0),n1=Dr("Map.prototype.has",!0),Id=n(function(r,e){for(var t=r,i;(i=t.next)!==null;t=i)if(i.key===e)return t.next=i.next,i.next=r.next,r.next=i,i},"listGetNode"),a1=n(function(r,e){var t=Id(r,e);return t&&t.value},"listGet"),o1=n(function(r,e,t){var i=Id(r,e);i?i.value=t:r.next={key:e,next:r.next,value:t}},"listSet"),s1=n(function(r,e){return!!Id(r,e)},"listHas");Nb.exports=n(function(){var e,t,i,a={assert:function(o){if(!a.has(o))throw new YT("Side channel does not contain "+ZT(o))},get:function(o){if(va&&o&&(typeof o=="object"||typeof o=="function")){if(e)return XT(e,o)}else if(wa){if(t)return r1(t,o)}else if(i)return a1(i,o)},has:function(o){if(va&&o&&(typeof o=="object"||typeof o=="function")){if(e)return t1(e,o)}else if(wa){if(t)return n1(t,o)}else if(i)return s1(i,o);return!1},set:function(o,s){va&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new va),e1(e,o,s)):wa?(t||(t=new wa),i1(t,o,s)):(i||(i={key:{},next:null}),o1(i,o,s))}};return a},"getSideChannel")});var Vb=l((c$,Gb)=>{"use strict";var u1=I(),l1=ct(),Di=Qb()(),dt=u1("%TypeError%"),Rd={assert:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new dt("`O` is not an object");if(typeof e!="string")throw new dt("`slot` must be a string");if(Di.assert(r),!Rd.has(r,e))throw new dt("`"+e+"` is not present on `O`")},get:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new dt("`O` is not an object");if(typeof e!="string")throw new dt("`slot` must be a string");var t=Di.get(r);return t&&t["$"+e]},has:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new dt("`O` is not an object");if(typeof e!="string")throw new dt("`slot` must be a string");var t=Di.get(r);return!!t&&l1(t,"$"+e)},set:function(r,e,t){if(!r||typeof r!="object"&&typeof r!="function")throw new dt("`O` is not an object");if(typeof e!="string")throw new dt("`slot` must be a string");var i=Di.get(r);i||(i={},Di.set(r,i)),i["$"+e]=t}};Object.freeze&&Object.freeze(Rd);Gb.exports=Rd});var zb=l((d$,Wb)=>{"use strict";var Oi=Vb(),c1=SyntaxError,$b=typeof StopIteration=="object"?StopIteration:null;Wb.exports=n(function(e){if(!$b)throw new c1("this environment lacks StopIteration");Oi.set(e,"[[Done]]",!1);var t={next:n(function(){var a=Oi.get(this,"[[Iterator]]"),o=Oi.get(a,"[[Done]]");try{return{done:o,value:o?void 0:a.next()}}catch(s){if(Oi.set(a,"[[Done]]",!0),s!==$b)throw s;return{done:!0,value:void 0}}},"next")};return Oi.set(t,"[[Iterator]]",e),t},"getStopIterationIterator")});var Jb=l((h$,Kb)=>{var d1={}.toString;Kb.exports=Array.isArray||function(r){return d1.call(r)=="[object Array]"}});var Dd=l((f$,Zb)=>{"use strict";var p1=String.prototype.valueOf,h1=n(function(e){try{return p1.call(e),!0}catch{return!1}},"tryStringObject"),f1=Object.prototype.toString,m1="[object String]",y1=Ai()();Zb.exports=n(function(e){return typeof e=="string"?!0:typeof e!="object"?!1:y1?h1(e):f1.call(e)===m1},"isString")});var tv=l((y$,ev)=>{"use strict";var Od=typeof Map=="function"&&Map.prototype?Map:null,_1=typeof Set=="function"&&Set.prototype?Set:null,xa;Od||(xa=n(function(e){return!1},"isMap"));var Xb=Od?Map.prototype.has:null,Yb=_1?Set.prototype.has:null;!xa&&!Xb&&(xa=n(function(e){return!1},"isMap"));ev.exports=xa||n(function(e){if(!e||typeof e!="object")return!1;try{if(Xb.call(e),Yb)try{Yb.call(e)}catch{return!0}return e instanceof Od}catch{}return!1},"isMap")});var av=l((g$,nv)=>{"use strict";var g1=typeof Map=="function"&&Map.prototype?Map:null,Bd=typeof Set=="function"&&Set.prototype?Set:null,Sa;Bd||(Sa=n(function(e){return!1},"isSet"));var rv=g1?Map.prototype.has:null,iv=Bd?Set.prototype.has:null;!Sa&&!iv&&(Sa=n(function(e){return!1},"isSet"));nv.exports=Sa||n(function(e){if(!e||typeof e!="object")return!1;try{if(iv.call(e),rv)try{rv.call(e)}catch{return!0}return e instanceof Bd}catch{}return!1},"isSet")});var _v=l((v$,Ca)=>{"use strict";var ov=wb(),sv=zb();ca()()||la()()?(qa=Symbol.iterator,Ca.exports=n(function(e){if(e!=null&&typeof e[qa]<"u")return e[qa]();if(ov(e))return Array.prototype[qa].call(e)},"getIterator")):(uv=Jb(),lv=Dd(),Ud=I(),cv=Ud("%Map%",!0),dv=Ud("%Set%",!0),Be=He(),jd=Be("Array.prototype.push"),kd=Be("String.prototype.charCodeAt"),pv=Be("String.prototype.slice"),hv=n(function(e,t){var i=e.length;if(t+1>=i)return t+1;var a=kd(e,t);if(a<55296||a>56319)return t+1;var o=kd(e,t+1);return o<56320||o>57343?t+1:t+2},"advanceStringIndex"),Pa=n(function(e){var t=0;return{next:n(function(){var a=t>=e.length,o;return a||(o=e[t],t+=1),{done:a,value:o}},"next")}},"getArrayIterator"),Ld=n(function(e,t){if(uv(e)||ov(e))return Pa(e);if(lv(e)){var i=0;return{next:n(function(){var o=hv(e,i),s=pv(e,i,o);return i=o,{done:o>e.length,value:s}},"next")}}if(t&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()},"getNonCollectionIterator"),!cv&&!dv?Ca.exports=n(function(e){if(e!=null)return Ld(e,!0)},"getIterator"):(fv=tv(),mv=av(),Md=Be("Map.prototype.forEach",!0),Fd=Be("Set.prototype.forEach",!0),(typeof process>"u"||!process.versions||!process.versions.node)&&(Nd=Be("Map.prototype.iterator",!0),Qd=Be("Set.prototype.iterator",!0)),Gd=Be("Map.prototype.@@iterator",!0)||Be("Map.prototype._es6-shim iterator_",!0),Vd=Be("Set.prototype.@@iterator",!0)||Be("Set.prototype._es6-shim iterator_",!0),yv=n(function(e){if(fv(e)){if(Nd)return sv(Nd(e));if(Gd)return Gd(e);if(Md){var t=[];return Md(e,function(a,o){jd(t,[o,a])}),Pa(t)}}if(mv(e)){if(Qd)return sv(Qd(e));if(Vd)return Vd(e);if(Fd){var i=[];return Fd(e,function(a){jd(i,a)}),Pa(i)}}},"getCollectionIterator"),Ca.exports=n(function(e){return yv(e)||Ld(e)},"getIterator")));var qa,uv,lv,Ud,cv,dv,Be,jd,kd,pv,hv,Pa,Ld,fv,mv,Md,Fd,Nd,Qd,Gd,Vd,yv});var vv=l((x$,bv)=>{"use strict";var gv=TypeError;bv.exports=n(function(e){if(!e||typeof e.next!="function")throw new gv("iterator must be an object with a `next` method");if(arguments.length>1){var t=arguments[1];if(typeof t!="function")throw new gv("`callback`, if provided, must be a function")}for(var i=t||[],a;(a=e.next())&&!a.done;)t?t(a.value):i.push(a.value);if(!t)return i},"iterateIterator")});var Sv=l((q$,xv)=>{"use strict";var b1=_v(),v1=TypeError,wv=vv();xv.exports=n(function(e){var t=b1(e);if(!t)throw new v1("non-iterable value provided");return arguments.length>1?wv(t,arguments[1]):wv(t)},"iterateValue")});var Pv=l((C$,qv)=>{"use strict";var w1=I(),x1=w1("%TypeError%");qv.exports=n(function(e,t){if(e==null)throw new x1(t||"Cannot call method on "+e);return e},"CheckObjectCoercible")});var Bi=l((E$,Cv)=>{"use strict";Cv.exports=Pv()});var Ha=l((A$,Hv)=>{"use strict";Hv.exports=Number.isNaN||n(function(e){return e!==e},"isNaN")});var $d=l((I$,Ev)=>{"use strict";var S1=Ha();Ev.exports=function(r){return(typeof r=="number"||typeof r=="bigint")&&!S1(r)&&r!==1/0&&r!==-1/0}});var Ea=l((R$,Tv)=>{"use strict";var Av=I(),q1=Av("%Math.abs%"),P1=Av("%Math.floor%"),C1=Ha(),H1=$d();Tv.exports=n(function(e){if(typeof e!="number"||C1(e)||!H1(e))return!1;var t=q1(e);return P1(t)===t},"isInteger")});var Ov=l((O$,Dv)=>{"use strict";var Ui=I(),Iv=Ui("%Array.prototype%"),E1=Ui("%RangeError%"),A1=Ui("%SyntaxError%"),T1=Ui("%TypeError%"),I1=Ea(),R1=Math.pow(2,32)-1,D1=ad()(),Rv=Ui("%Object.setPrototypeOf%",!0)||(D1?function(r,e){return r.__proto__=e,r}:null);Dv.exports=n(function(e){if(!I1(e)||e<0)throw new T1("Assertion failed: `length` must be an integer Number >= 0");if(e>R1)throw new E1("length is greater than (2**32 - 1)");var t=arguments.length>1?arguments[1]:Iv,i=[];if(t!==Iv){if(!Rv)throw new A1("ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]");Rv(i,t)}return e!==0&&(i.length=e),i},"ArrayCreate")});var Ot=l((U$,Bv)=>{"use strict";Bv.exports=n(function(e){return typeof e=="string"||typeof e=="symbol"},"IsPropertyKey")});var fe=l((k$,Uv)=>{"use strict";var O1=md();Uv.exports=n(function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":O1(e)},"Type")});var Wd=l((M$,kv)=>{"use strict";var B1=I(),jv=B1("%TypeError%"),U1=Ad(),j1=Ot(),k1=fe();kv.exports=n(function(e,t){if(k1(e)!=="Object")throw new jv("Assertion failed: Type(O) is not Object");if(!j1(t))throw new jv("Assertion failed: IsPropertyKey(P) is not true, got "+U1(t));return e[t]},"Get")});var zd=l((N$,Mv)=>{"use strict";var L1=I(),Lv=L1("%Array%"),M1=!Lv.isArray&&He()("Object.prototype.toString");Mv.exports=Lv.isArray||n(function(e){return M1(e)==="[object Array]"},"IsArray")});var Kd=l((G$,Fv)=>{"use strict";Fv.exports=zd()});var Qv=l((V$,Nv)=>{"use strict";Nv.exports=I()});var Aa=l(($$,Gv)=>{"use strict";var F1=I(),N1=ct(),Q1=F1("%TypeError%");Gv.exports=n(function(e,t){if(e.Type(t)!=="Object")return!1;var i={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var a in t)if(N1(t,a)&&!i[a])return!1;if(e.IsDataDescriptor(t)&&e.IsAccessorDescriptor(t))throw new Q1("Property Descriptors may not be both accessor and data descriptors");return!0},"IsPropertyDescriptor")});var Jd=l((z$,zv)=>{"use strict";var $v=fd(),G1=I(),Vv=$v()&&G1("%Object.defineProperty%",!0),Wv=$v.hasArrayLengthDefineBug(),V1=Wv&&zd(),$1=He(),W1=$1("Object.prototype.propertyIsEnumerable");zv.exports=n(function(e,t,i,a,o,s){if(!Vv){if(!e(s)||!s["[[Configurable]]"]||!s["[[Writable]]"]||o in a&&W1(a,o)!==!!s["[[Enumerable]]"])return!1;var u=s["[[Value]]"];return a[o]=u,t(a[o],u)}return Wv&&o==="length"&&"[[Value]]"in s&&V1(a)&&a.length!==s["[[Value]]"]?(a.length=s["[[Value]]"],a.length===s["[[Value]]"]):(Vv(a,o,i(s)),!0)},"DefineOwnProperty")});var Zv=l((J$,Jv)=>{"use strict";var Kv=ct();Jv.exports=n(function(e){return Kv(e,"[[StartIndex]]")&&Kv(e,"[[EndIndex]]")&&e["[[StartIndex]]"]>=0&&e["[[EndIndex]]"]>=e["[[StartIndex]]"]&&String(parseInt(e["[[StartIndex]]"],10))===String(e["[[StartIndex]]"])&&String(parseInt(e["[[EndIndex]]"],10))===String(e["[[EndIndex]]"])},"isMatchRecord")});var ji=l((Y$,tw)=>{"use strict";var Yv=I(),Xv=Yv("%TypeError%"),z1=Yv("%SyntaxError%"),ce=ct(),K1=Ea(),J1=Zv(),ew={"Property Descriptor":n(function(e){var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!e)return!1;for(var i in e)if(ce(e,i)&&!t[i])return!1;var a=ce(e,"[[Value]]"),o=ce(e,"[[Get]]")||ce(e,"[[Set]]");if(a&&o)throw new Xv("Property Descriptors may not be both accessor and data descriptors");return!0},"isPropertyDescriptor"),"Match Record":J1,"Iterator Record":n(function(e){return ce(e,"[[Iterator]]")&&ce(e,"[[NextMethod]]")&&ce(e,"[[Done]]")},"isIteratorRecord"),"PromiseCapability Record":n(function(e){return!!e&&ce(e,"[[Resolve]]")&&typeof e["[[Resolve]]"]=="function"&&ce(e,"[[Reject]]")&&typeof e["[[Reject]]"]=="function"&&ce(e,"[[Promise]]")&&e["[[Promise]]"]&&typeof e["[[Promise]]"].then=="function"},"isPromiseCapabilityRecord"),"AsyncGeneratorRequest Record":n(function(e){return!!e&&ce(e,"[[Completion]]")&&ce(e,"[[Capability]]")&&ew["PromiseCapability Record"](e["[[Capability]]"])},"isAsyncGeneratorRequestRecord"),"RegExp Record":n(function(e){return e&&ce(e,"[[IgnoreCase]]")&&typeof e["[[IgnoreCase]]"]=="boolean"&&ce(e,"[[Multiline]]")&&typeof e["[[Multiline]]"]=="boolean"&&ce(e,"[[DotAll]]")&&typeof e["[[DotAll]]"]=="boolean"&&ce(e,"[[Unicode]]")&&typeof e["[[Unicode]]"]=="boolean"&&ce(e,"[[CapturingGroupsCount]]")&&typeof e["[[CapturingGroupsCount]]"]=="number"&&K1(e["[[CapturingGroupsCount]]"])&&e["[[CapturingGroupsCount]]"]>=0},"isRegExpRecord")};tw.exports=n(function(e,t,i,a){var o=ew[t];if(typeof o!="function")throw new z1("unknown record type: "+t);if(e(a)!=="Object"||!o(a))throw new Xv(i+" must be a "+t)},"assertRecord")});var iw=l((eW,rw)=>{"use strict";rw.exports=n(function(e){if(typeof e>"u")return e;var t={};return"[[Value]]"in e&&(t.value=e["[[Value]]"]),"[[Writable]]"in e&&(t.writable=!!e["[[Writable]]"]),"[[Get]]"in e&&(t.get=e["[[Get]]"]),"[[Set]]"in e&&(t.set=e["[[Set]]"]),"[[Enumerable]]"in e&&(t.enumerable=!!e["[[Enumerable]]"]),"[[Configurable]]"in e&&(t.configurable=!!e["[[Configurable]]"]),t},"fromPropertyDescriptor")});var Zd=l((rW,nw)=>{"use strict";var Z1=ji(),Y1=iw(),X1=fe();nw.exports=n(function(e){return typeof e<"u"&&Z1(X1,"Property Descriptor","Desc",e),Y1(e)},"FromPropertyDescriptor")});var ki=l((nW,ow)=>{"use strict";var aw=ct(),eI=fe(),tI=ji();ow.exports=n(function(e){return!(typeof e>"u"||(tI(eI,"Property Descriptor","Desc",e),!aw(e,"[[Get]]")&&!aw(e,"[[Set]]")))},"IsAccessorDescriptor")});var Li=l((oW,uw)=>{"use strict";var sw=ct(),rI=fe(),iI=ji();uw.exports=n(function(e){return!(typeof e>"u"||(iI(rI,"Property Descriptor","Desc",e),!sw(e,"[[Value]]")&&!sw(e,"[[Writable]]")))},"IsDataDescriptor")});var Ta=l((uW,cw)=>{"use strict";var lw=Ha();cw.exports=n(function(e,t){return e===t?e===0?1/e===1/t:!0:lw(e)&&lw(t)},"SameValue")});var pw=l((cW,dw)=>{"use strict";dw.exports=n(function(e){return!!e},"ToBoolean")});var rp=l((pW,mw)=>{"use strict";var fw=Function.prototype.toString,Or=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Xd,Ia;if(typeof Or=="function"&&typeof Object.defineProperty=="function")try{Xd=Object.defineProperty({},"length",{get:function(){throw Ia}}),Ia={},Or(function(){throw 42},null,Xd)}catch(r){r!==Ia&&(Or=null)}else Or=null;var nI=/^\s*class\b/,ep=n(function(e){try{var t=fw.call(e);return nI.test(t)}catch{return!1}},"isES6ClassFunction"),Yd=n(function(e){try{return ep(e)?!1:(fw.call(e),!0)}catch{return!1}},"tryFunctionToStr"),Ra=Object.prototype.toString,aI="[object Object]",oI="[object Function]",sI="[object GeneratorFunction]",uI="[object HTMLAllCollection]",lI="[object HTML document.all class]",cI="[object HTMLCollection]",dI=typeof Symbol=="function"&&!!Symbol.toStringTag,pI=!(0 in[,]),tp=n(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(hw=document.all,Ra.call(hw)===Ra.call(document.all)&&(tp=n(function(e){if((pI||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Ra.call(e);return(t===uI||t===lI||t===cI||t===aI)&&e("")==null}catch{}return!1},"isDocumentDotAll")));var hw;mw.exports=n(Or?function(e){if(tp(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Or(e,null,Xd)}catch(t){if(t!==Ia)return!1}return!ep(e)&&Yd(e)}:function(e){if(tp(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(dI)return Yd(e);if(ep(e))return!1;var t=Ra.call(e);return t!==oI&&t!==sI&&!/^\[object HTML/.test(t)?!1:Yd(e)},"isCallable")});var ip=l((fW,yw)=>{"use strict";yw.exports=rp()});var ap=l((mW,gw)=>{"use strict";var Ze=ct(),hI=I(),Da=hI("%TypeError%"),fI=fe(),np=pw(),_w=ip();gw.exports=n(function(e){if(fI(e)!=="Object")throw new Da("ToPropertyDescriptor requires an object");var t={};if(Ze(e,"enumerable")&&(t["[[Enumerable]]"]=np(e.enumerable)),Ze(e,"configurable")&&(t["[[Configurable]]"]=np(e.configurable)),Ze(e,"value")&&(t["[[Value]]"]=e.value),Ze(e,"writable")&&(t["[[Writable]]"]=np(e.writable)),Ze(e,"get")){var i=e.get;if(typeof i<"u"&&!_w(i))throw new Da("getter must be a function");t["[[Get]]"]=i}if(Ze(e,"set")){var a=e.set;if(typeof a<"u"&&!_w(a))throw new Da("setter must be a function");t["[[Set]]"]=a}if((Ze(t,"[[Get]]")||Ze(t,"[[Set]]"))&&(Ze(t,"[[Value]]")||Ze(t,"[[Writable]]")))throw new Da("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},"ToPropertyDescriptor")});var xw=l((_W,ww)=>{"use strict";var mI=I(),op=mI("%TypeError%"),bw=Aa(),yI=Jd(),_I=Zd(),vw=ki(),sp=Li(),gI=Ot(),bI=Ta(),vI=ap(),up=fe();ww.exports=n(function(e,t,i){if(up(e)!=="Object")throw new op("Assertion failed: Type(O) is not Object");if(!gI(t))throw new op("Assertion failed: IsPropertyKey(P) is not true");var a=bw({Type:up,IsDataDescriptor:sp,IsAccessorDescriptor:vw},i)?i:vI(i);if(!bw({Type:up,IsDataDescriptor:sp,IsAccessorDescriptor:vw},a))throw new op("Assertion failed: Desc is not a valid Property Descriptor");return yI(sp,bI,_I,e,t,a)},"DefinePropertyOrThrow")});var qw=l((bW,dp)=>{"use strict";var wI=Qv(),Sw=wI("%Reflect.construct%",!0),Oa=xw();try{Oa({},"",{"[[Get]]":function(){}})}catch{Oa=null}Oa&&Sw?(lp={},cp={},Oa(cp,"length",{"[[Get]]":function(){throw lp},"[[Enumerable]]":!0}),dp.exports=n(function(e){try{Sw(e,cp)}catch(t){return t===lp}},"IsConstructor")):dp.exports=n(function(e){return typeof e=="function"&&!!e.prototype},"IsConstructor");var lp,cp});var Iw=l((wW,Tw)=>{"use strict";var Aw=I(),Pw=Aw("%Symbol.species%",!0),Cw=Aw("%TypeError%"),Hw=Ov(),Ew=Wd(),xI=Kd(),SI=qw(),qI=fe(),PI=Ea();Tw.exports=n(function(e,t){if(!PI(t)||t<0)throw new Cw("Assertion failed: length must be an integer >= 0");var i=xI(e);if(!i)return Hw(t);var a=Ew(e,"constructor");if(Pw&&qI(a)==="Object"&&(a=Ew(a,Pw),a===null&&(a=void 0)),typeof a>"u")return Hw(t);if(!SI(a))throw new Cw("C must be a constructor");return new a(t)},"ArraySpeciesCreate")});var Ow=l((SW,Dw)=>{"use strict";var Rw=I(),CI=He(),HI=Rw("%TypeError%"),EI=Kd(),AI=Rw("%Reflect.apply%",!0)||CI("Function.prototype.apply");Dw.exports=n(function(e,t){var i=arguments.length>2?arguments[2]:[];if(!EI(i))throw new HI("Assertion failed: optional `argumentsList`, if provided, must be a List");return AI(e,t,i)},"Call")});var Uw=l((PW,Bw)=>{"use strict";var TI=I(),Ba=TI("%Object.getOwnPropertyDescriptor%",!0);if(Ba)try{Ba([],"length")}catch{Ba=null}Bw.exports=Ba});var pp=l((CW,jw)=>{"use strict";jw.exports=n(function(e){return e===null||typeof e!="function"&&typeof e!="object"},"isPrimitive")});var Fw=l((EW,Mw)=>{"use strict";var Lw=I(),II=Lw("%Object.preventExtensions%",!0),RI=Lw("%Object.isExtensible%",!0),kw=pp();Mw.exports=n(II?function(e){return!kw(e)&&RI(e)}:function(e){return!kw(e)},"IsExtensible")});var Qw=l((TW,Nw)=>{"use strict";Nw.exports=n(function(e,t){return!!t&&typeof t=="object"&&"[[Enumerable]]"in t&&"[[Configurable]]"in t&&(e.IsAccessorDescriptor(t)||e.IsDataDescriptor(t))},"isFullyPopulatedPropertyDescriptor")});var Vw=l((RW,Gw)=>{"use strict";var DI=ji(),OI=ki(),BI=Li(),UI=fe();Gw.exports=n(function(e){return typeof e>"u"?!1:(DI(UI,"Property Descriptor","Desc",e),!OI(e)&&!BI(e))},"IsGenericDescriptor")});var zw=l((OW,Ww)=>{"use strict";var jI=I(),Br=jI("%TypeError%"),Mi=Jd(),kI=Qw(),$w=Aa(),Fi=Zd(),pt=ki(),Ye=Li(),LI=Vw(),MI=Ot(),Xe=Ta(),Ur=fe();Ww.exports=n(function(e,t,i,a,o){var s=Ur(e);if(s!=="Undefined"&&s!=="Object")throw new Br("Assertion failed: O must be undefined or an Object");if(!MI(t))throw new Br("Assertion failed: P must be a Property Key");if(Ur(i)!=="Boolean")throw new Br("Assertion failed: extensible must be a Boolean");if(!$w({Type:Ur,IsDataDescriptor:Ye,IsAccessorDescriptor:pt},a))throw new Br("Assertion failed: Desc must be a Property Descriptor");if(Ur(o)!=="Undefined"&&!$w({Type:Ur,IsDataDescriptor:Ye,IsAccessorDescriptor:pt},o))throw new Br("Assertion failed: current must be a Property Descriptor, or undefined");if(Ur(o)==="Undefined")return i?s==="Undefined"?!0:pt(a)?Mi(Ye,Xe,Fi,e,t,a):Mi(Ye,Xe,Fi,e,t,{"[[Configurable]]":!!a["[[Configurable]]"],"[[Enumerable]]":!!a["[[Enumerable]]"],"[[Value]]":a["[[Value]]"],"[[Writable]]":!!a["[[Writable]]"]}):!1;if(!kI({IsAccessorDescriptor:pt,IsDataDescriptor:Ye},o))throw new Br("`current`, when present, must be a fully populated and valid Property Descriptor");if(!o["[[Configurable]]"]){if("[[Configurable]]"in a&&a["[[Configurable]]"]||"[[Enumerable]]"in a&&!Xe(a["[[Enumerable]]"],o["[[Enumerable]]"])||!LI(a)&&!Xe(pt(a),pt(o)))return!1;if(pt(o)){if("[[Get]]"in a&&!Xe(a["[[Get]]"],o["[[Get]]"])||"[[Set]]"in a&&!Xe(a["[[Set]]"],o["[[Set]]"]))return!1}else if(!o["[[Writable]]"]&&("[[Writable]]"in a&&a["[[Writable]]"]||"[[Value]]"in a&&!Xe(a["[[Value]]"],o["[[Value]]"])))return!1}if(s!=="Undefined"){var u,c;return Ye(o)&&pt(a)?(u=("[[Configurable]]"in a?a:o)["[[Configurable]]"],c=("[[Enumerable]]"in a?a:o)["[[Enumerable]]"],Mi(Ye,Xe,Fi,e,t,{"[[Configurable]]":!!u,"[[Enumerable]]":!!c,"[[Get]]":("[[Get]]"in a?a:o)["[[Get]]"],"[[Set]]":("[[Set]]"in a?a:o)["[[Set]]"]})):pt(o)&&Ye(a)?(u=("[[Configurable]]"in a?a:o)["[[Configurable]]"],c=("[[Enumerable]]"in a?a:o)["[[Enumerable]]"],Mi(Ye,Xe,Fi,e,t,{"[[Configurable]]":!!u,"[[Enumerable]]":!!c,"[[Value]]":("[[Value]]"in a?a:o)["[[Value]]"],"[[Writable]]":!!("[[Writable]]"in a?a:o)["[[Writable]]"]})):Mi(Ye,Xe,Fi,e,t,a)}return!0},"ValidateAndApplyPropertyDescriptor")});var tx=l((UW,ex)=>{"use strict";var Xw=I(),Kw=Uw(),Jw=Xw("%SyntaxError%"),hp=Xw("%TypeError%"),FI=Aa(),Zw=ki(),NI=Li(),QI=Fw(),GI=Ot(),VI=ap(),$I=Ta(),Yw=fe(),WI=zw();ex.exports=n(function(e,t,i){if(Yw(e)!=="Object")throw new hp("Assertion failed: O must be an Object");if(!GI(t))throw new hp("Assertion failed: P must be a Property Key");if(!FI({Type:Yw,IsDataDescriptor:NI,IsAccessorDescriptor:Zw},i))throw new hp("Assertion failed: Desc must be a Property Descriptor");if(!Kw){if(Zw(i))throw new Jw("This environment does not support accessor property descriptors.");var a=!(t in e)&&i["[[Writable]]"]&&i["[[Enumerable]]"]&&i["[[Configurable]]"]&&"[[Value]]"in i,o=t in e&&(!("[[Configurable]]"in i)||i["[[Configurable]]"])&&(!("[[Enumerable]]"in i)||i["[[Enumerable]]"])&&(!("[[Writable]]"in i)||i["[[Writable]]"])&&"[[Value]]"in i;if(a||o)return e[t]=i["[[Value]]"],$I(e[t],i["[[Value]]"]);throw new Jw("This environment does not support defining non-writable, non-enumerable, or non-configurable properties")}var s=Kw(e,t),u=s&&VI(s),c=QI(e);return WI(e,t,c,i,u)},"OrdinaryDefineOwnProperty")});var nx=l((kW,ix)=>{"use strict";var zI=I(),rx=zI("%TypeError%"),KI=Ot(),JI=tx(),ZI=fe();ix.exports=n(function(e,t,i){if(ZI(e)!=="Object")throw new rx("Assertion failed: Type(O) is not Object");if(!KI(t))throw new rx("Assertion failed: IsPropertyKey(P) is not true");var a={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Value]]":i,"[[Writable]]":!0};return JI(e,t,a)},"CreateDataProperty")});var ox=l((MW,ax)=>{"use strict";var YI=I(),fp=YI("%TypeError%"),XI=nx(),eR=Ot(),tR=fe();ax.exports=n(function(e,t,i){if(tR(e)!=="Object")throw new fp("Assertion failed: Type(O) is not Object");if(!eR(t))throw new fp("Assertion failed: IsPropertyKey(P) is not true");var a=XI(e,t,i);if(!a)throw new fp("unable to create data property")},"CreateDataPropertyOrThrow")});var lx=l((NW,ux)=>{"use strict";var rR=I(),sx=rR("%TypeError%"),iR=Ot(),nR=fe();ux.exports=n(function(e,t){if(nR(e)!=="Object")throw new sx("Assertion failed: `O` must be an Object");if(!iR(t))throw new sx("Assertion failed: `P` must be a Property Key");return t in e},"HasProperty")});var dx=l((GW,cx)=>{"use strict";var aR=Math.floor;cx.exports=n(function(e,t){var i=e%t;return aR(i>=0?i:i+t)},"mod")});var hx=l(($W,px)=>{"use strict";var oR=dx();px.exports=n(function(e,t){return oR(e,t)},"modulo")});var mx=l((zW,fx)=>{"use strict";fx.exports=n(function(e){return e===null||typeof e!="function"&&typeof e!="object"},"isPrimitive")});var _x=l((JW,yx)=>{"use strict";var sR=Date.prototype.getDay,uR=n(function(e){try{return sR.call(e),!0}catch{return!1}},"tryDateGetDayCall"),lR=Object.prototype.toString,cR="[object Date]",dR=Ai()();yx.exports=n(function(e){return typeof e!="object"||e===null?!1:dR?uR(e):lR.call(e)===cR},"isDateObject")});var wx=l((YW,mp)=>{"use strict";var pR=Object.prototype.toString,hR=ca()();hR?(gx=Symbol.prototype.toString,bx=/^Symbol\(.*\)$/,vx=n(function(e){return typeof e.valueOf()!="symbol"?!1:bx.test(gx.call(e))},"isRealSymbolObject"),mp.exports=n(function(e){if(typeof e=="symbol")return!0;if(pR.call(e)!=="[object Symbol]")return!1;try{return vx(e)}catch{return!1}},"isSymbol")):mp.exports=n(function(e){return!1},"isSymbol");var gx,bx,vx});var Px=l((e3,qx)=>{"use strict";var fR=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",yp=mx(),Sx=rp(),mR=_x(),xx=wx(),yR=n(function(e,t){if(typeof e>"u"||e===null)throw new TypeError("Cannot call method on "+e);if(typeof t!="string"||t!=="number"&&t!=="string")throw new TypeError('hint must be "string" or "number"');var i=t==="string"?["toString","valueOf"]:["valueOf","toString"],a,o,s;for(s=0;s<i.length;++s)if(a=e[i[s]],Sx(a)&&(o=a.call(e),yp(o)))return o;throw new TypeError("No default value")},"OrdinaryToPrimitive"),_R=n(function(e,t){var i=e[t];if(i!==null&&typeof i<"u"){if(!Sx(i))throw new TypeError(i+" returned for property "+t+" of object "+e+" is not a function");return i}},"GetMethod");qx.exports=n(function(e){if(yp(e))return e;var t="default";arguments.length>1&&(arguments[1]===String?t="string":arguments[1]===Number&&(t="number"));var i;if(fR&&(Symbol.toPrimitive?i=_R(e,Symbol.toPrimitive):xx(e)&&(i=Symbol.prototype.valueOf)),typeof i<"u"){var a=i.call(e,t);if(yp(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return t==="default"&&(mR(e)||xx(e))&&(t="string"),yR(e,t==="default"?"number":t)},"ToPrimitive")});var Ex=l((r3,Hx)=>{"use strict";var Cx=Px();Hx.exports=n(function(e){return arguments.length>1?Cx(e,arguments[1]):Cx(e)},"ToPrimitive")});var Dx=l((n3,Rx)=>{"use strict";var _p=He(),Ax=Ai()(),Tx,Ix,gp,bp;Ax&&(Tx=_p("Object.prototype.hasOwnProperty"),Ix=_p("RegExp.prototype.exec"),gp={},Ua=n(function(){throw gp},"throwRegexMarker"),bp={toString:Ua,valueOf:Ua},typeof Symbol.toPrimitive=="symbol"&&(bp[Symbol.toPrimitive]=Ua));var Ua,gR=_p("Object.prototype.toString"),bR=Object.getOwnPropertyDescriptor,vR="[object RegExp]";Rx.exports=n(Ax?function(e){if(!e||typeof e!="object")return!1;var t=bR(e,"lastIndex"),i=t&&Tx(t,"value");if(!i)return!1;try{Ix(e,bp)}catch(a){return a===gp}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:gR(e)===vR},"isRegex")});var Bx=l((o3,Ox)=>{"use strict";var wR=He(),xR=I(),SR=Dx(),qR=wR("RegExp.prototype.exec"),PR=xR("%TypeError%");Ox.exports=n(function(e){if(!SR(e))throw new PR("`regex` must be a RegExp");return n(function(i){return qR(e,i)!==null},"test")},"regexTester")});var vp=l((u3,jx)=>{"use strict";var Ux=I(),CR=Ux("%String%"),HR=Ux("%TypeError%");jx.exports=n(function(e){if(typeof e=="symbol")throw new HR("Cannot convert a Symbol value to a string");return CR(e)},"ToString")});var wp=l((c3,Mx)=>{"use strict";var ER=Bi(),AR=vp(),TR=He(),kx=TR("String.prototype.replace"),Lx=/^\s$/.test("\u180E"),IR=Lx?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,RR=Lx?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;Mx.exports=n(function(){var e=AR(ER(this));return kx(kx(e,IR,""),RR,"")},"trim")});var xp=l((p3,Nx)=>{"use strict";var DR=wp(),Fx="\u200B",jr="\u180E";Nx.exports=n(function(){return String.prototype.trim&&Fx.trim()===Fx&&jr.trim()===jr&&("_"+jr).trim()==="_"+jr&&(jr+"_").trim()===jr+"_"?String.prototype.trim:DR},"getPolyfill")});var Gx=l((f3,Qx)=>{"use strict";var OR=tr(),BR=xp();Qx.exports=n(function(){var e=BR();return OR(String.prototype,{trim:e},{trim:n(function(){return String.prototype.trim!==e},"testTrim")}),e},"shimStringTrim")});var zx=l((y3,Wx)=>{"use strict";var UR=Ir(),jR=tr(),kR=Bi(),LR=wp(),Vx=xp(),MR=Gx(),FR=UR(Vx()),$x=n(function(e){return kR(e),FR(e)},"trim");jR($x,{getPolyfill:Vx,implementation:LR,shim:MR});Wx.exports=$x});var Yx=l((g3,Zx)=>{"use strict";var ja=I(),Sp=ja("%Number%"),NR=ja("%RegExp%"),QR=ja("%TypeError%"),Kx=ja("%parseInt%"),GR=He(),ka=Bx(),Jx=GR("String.prototype.slice"),VR=ka(/^0b[01]+$/i),$R=ka(/^0o[0-7]+$/i),WR=ka(/^[-+]0x[0-9a-f]+$/i),zR=["\x85","\u200B","\uFFFE"].join(""),KR=new NR("["+zR+"]","g"),JR=ka(KR),ZR=zx(),YR=fe();Zx.exports=n(function r(e){if(YR(e)!=="String")throw new QR("Assertion failed: `argument` is not a String");if(VR(e))return Sp(Kx(Jx(e,2),2));if($R(e))return Sp(Kx(Jx(e,2),8));if(JR(e)||WR(e))return NaN;var t=ZR(e);return t!==e?r(t):Sp(e)},"StringToNumber")});var iS=l((v3,rS)=>{"use strict";var tS=I(),Xx=tS("%TypeError%"),eS=tS("%Number%"),XR=pp(),eD=Ex(),tD=Yx();rS.exports=n(function(e){var t=XR(e)?e:eD(e,eS);if(typeof t=="symbol")throw new Xx("Cannot convert a Symbol value to a number");if(typeof t=="bigint")throw new Xx("Conversion from 'BigInt' to 'number' is not allowed.");return typeof t=="string"?tD(t):eS(t)},"ToNumber")});var aS=l((x3,nS)=>{"use strict";var rD=fe(),iD=Math.floor;nS.exports=n(function(e){return rD(e)==="BigInt"?e:iD(e)},"floor")});var uS=l((q3,sS)=>{"use strict";var nD=I(),oS=aS(),aD=nD("%TypeError%");sS.exports=n(function(e){if(typeof e!="number"&&typeof e!="bigint")throw new aD("argument must be a Number or a BigInt");var t=e<0?-oS(-e):oS(e);return t===0?0:t},"truncate")});var cS=l((C3,lS)=>{"use strict";var oD=hx(),sD=iS(),uD=uS(),lD=$d(),cD=4294967296;lS.exports=n(function(e){var t=sD(e);if(!lD(t)||t===0)return 0;var i=uD(t),a=oD(i,cD);return a===0?0:a},"ToUint32")});var pS=l((E3,dS)=>{"use strict";var dD=I(),pD=dD("%Object%"),hD=Bi();dS.exports=n(function(e){return hD(e),pD(e)},"ToObject")});var qp=l((T3,fS)=>{"use strict";var fD=Iw(),mD=Ow(),yD=ox(),_D=Wd(),gD=lx(),bD=ip(),vD=cS(),wD=pS(),xD=vp(),SD=He(),qD=Dd(),hS=Object("a"),PD=hS[0]!=="a"||!(0 in hS),CD=SD("String.prototype.split");fS.exports=n(function(e){var t=wD(this),i=PD&&qD(t)?CD(t,""):t,a=vD(i.length);if(!bD(e))throw new TypeError("Array.prototype.map callback must be a function");var o;arguments.length>1&&(o=arguments[1]);for(var s=fD(t,a),u=0;u<a;){var c=xD(u),h=gD(t,c);if(h){var d=_D(t,c),_=mD(e,o,[d,u,t]);yD(s,c,_)}u+=1}return s},"map")});var yS=l((R3,mS)=>{mS.exports=n(function(e){var t=!0,i=!0,a=!1;if(typeof e=="function"){try{e.call("f",function(o,s,u){typeof u!="object"&&(t=!1)}),e.call([null],function(){"use strict";i=typeof this=="string"},"x")}catch{a=!0}return!a&&t&&i}return!1},"properlyBoxed")});var Pp=l((O3,_S)=>{"use strict";var HD=yS(),ED=qp();_S.exports=n(function(){var e=Array.prototype.map;return HD(e)?e:ED},"getPolyfill")});var bS=l((U3,gS)=>{"use strict";var AD=tr(),TD=Pp();gS.exports=n(function(){var e=TD();return AD(Array.prototype,{map:e},{map:function(){return Array.prototype.map!==e}}),e},"shimArrayPrototypeMap")});var SS=l((k3,xS)=>{"use strict";var ID=tr(),RD=Bi(),DD=He(),OD=qp(),vS=Pp(),BD=vS(),UD=bS(),jD=DD("Array.prototype.slice"),wS=n(function(e,t){return RD(e),BD.apply(e,jD(arguments,1))},"map");ID(wS,{getPolyfill:vS,implementation:OD,shim:UD});xS.exports=wS});var Cp=l((M3,CS)=>{"use strict";var kD=Ei();kD();var LD=db(),MD=fb(),FD=Sv(),ND=SS(),qS=I(),PS=Ir(),QD=PS(qS("%Promise.all%")),GD=PS(qS("%Promise.reject%"));CS.exports=n(function(e){var t=this;if(MD(t)!=="Object")throw new TypeError("`this` value must be an object");var i=FD(e);return QD(t,ND(i,function(a){var o=n(function(c){return{status:"fulfilled",value:c}},"onFulfill"),s=n(function(c){return{status:"rejected",reason:c}},"onReject"),u=LD(t,a);try{return u.then(o,s)}catch(c){return GD(t,c)}}))},"allSettled")});var Hp=l((N3,HS)=>{"use strict";var VD=Ei(),$D=Cp();HS.exports=n(function(){return VD(),typeof Promise.allSettled=="function"?Promise.allSettled:$D},"getPolyfill")});var AS=l((G3,ES)=>{"use strict";var WD=Ei(),zD=Hp(),KD=tr();ES.exports=n(function(){WD();var e=zD();return KD(Promise,{allSettled:e},{allSettled:n(function(){return Promise.allSettled!==e},"testAllSettled")}),e},"shimAllSettled")});var IS=l(($3,Ap)=>{"use strict";var JD=Ir(),ZD=tr(),YD=Ei(),XD=Cp(),TS=Hp(),eO=AS();YD();var tO=JD(TS()),Ep=n(function(e){return tO(typeof this>"u"?Promise:this,e)},"allSettled");ZD(Ep,{getPolyfill:TS,implementation:XD,shim:eO});Ap.exports=Ep;Ap.exports.default=Ep});var Tp=l(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.ResponseBasedRateLimiter=void 0;var ht=(y(),g(m)),rO=Si(),iO=IS(),nO=S(),aO=qi(),RS=id(),oO=function(){function r(e){var t=e.logger;this._queue=[],this._batchRunning=!1,this._paused=!1,this._logger=(0,rO.createLogger)(ht.__assign({name:"rate-limiter",emoji:!0},t))}return n(r,"ResponseBasedRateLimiter"),r.prototype.request=function(e,t){return ht.__awaiter(this,void 0,void 0,function(){var i=this;return ht.__generator(this,function(a){switch(a.label){case 0:return this._logger.trace("request start"),[4,new Promise(function(o,s){var u,c={req:e,resolve:o,reject:s,limitReachedBehavior:(u=t?.limitReachedBehavior)!==null&&u!==void 0?u:"enqueue"};i._batchRunning||i._nextBatchTimer||i._paused?(i._logger.trace("request queued batchRunning:".concat(i._batchRunning.toString()," hasNextBatchTimer:").concat((!!i._nextBatchTimer).toString()," paused:").concat(i._paused.toString())),i._queue.push(c)):i._runRequestBatch([c])})];case 1:return[2,a.sent()]}})})},r.prototype.clear=function(){this._queue=[]},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1,this._runNextBatch()},Object.defineProperty(r.prototype,"stats",{get:function(){var e,t,i,a,o;return{lastKnownLimit:(t=(e=this._parameters)===null||e===void 0?void 0:e.limit)!==null&&t!==void 0?t:null,lastKnownRemainingRequests:(a=(i=this._parameters)===null||i===void 0?void 0:i.remaining)!==null&&a!==void 0?a:null,lastKnownResetDate:(0,nO.mapNullable)((o=this._parameters)===null||o===void 0?void 0:o.resetsAt,function(s){return new Date(s)})}},enumerable:!1,configurable:!0}),r.prototype._runRequestBatch=function(e){return ht.__awaiter(this,void 0,void 0,function(){var t,i,a,o,s,u,c,h,d=this;return ht.__generator(this,function(_){switch(_.label){case 0:return this._logger.trace("runRequestBatch start specs:".concat(e.length)),this._batchRunning=!0,this._parameters&&this._logger.debug("Remaining requests: ".concat(this._parameters.remaining)),this._logger.debug("Doing ".concat(e.length," requests, new queue length is ").concat(this._queue.length)),t=e.map(function(b){return ht.__awaiter(d,void 0,void 0,function(){var q,v,x,A,O,z,le;return ht.__generator(this,function(te){switch(te.label){case 0:q=b.req,v=b.resolve,x=b.reject,te.label=1;case 1:return te.trys.push([1,3,,4]),[4,this.doRequest(q)];case 2:if(A=te.sent(),O=this.needsToRetryAfter(A),O!==null)throw this._queue.unshift(b),this._logger.info("Retrying after ".concat(O," ms")),new RS.RetryAfterError(O);return z=this.getParametersFromResponse(A),v(A),[2,z];case 3:if(le=te.sent(),le instanceof RS.RetryAfterError)throw le;return x(le),[2,void 0];case 4:return[2]}})})}),[4,iO.default.call(Promise,t)];case 1:return i=_.sent(),a=i.filter(function(b){return b.status==="rejected"}),o=Date.now(),a.length?(this._logger.trace("runRequestBatch some rejected"),s=Math.max.apply(Math,ht.__spreadArray([o],ht.__read(a.map(function(b){return b.reason.retryAt})),!1)),u=s-o,this._logger.warn("Waiting for ".concat(u," ms because the rate limit was exceeded")),this._nextBatchTimer=setTimeout(function(){d._parameters=void 0,d._runNextBatch()},u)):(this._logger.trace("runRequestBatch none rejected"),c=i.filter(function(b){return b.status==="fulfilled"&&b.value!==void 0}).map(function(b){return b.value}).reduce(function(b,q){return b?q.remaining<b.remaining?q:b:q},void 0),this._batchRunning=!1,c&&(this._parameters=c,c.resetsAt<o||c.remaining>0?(this._logger.trace("runRequestBatch canRunMore"),this._runNextBatch()):(h=c.resetsAt-o,this._logger.trace("runRequestBatch delay:".concat(h)),this._logger.warn("Waiting for ".concat(h," ms because the rate limit was reached")),this._queue=this._queue.filter(function(b){switch(b.limitReachedBehavior){case"enqueue":return!0;case"null":return b.resolve(null),!1;case"throw":return b.reject(new aO.RateLimitReachedError("Request removed from queue because the rate limit was reached")),!1;default:throw new Error("this should never happen")}}),this._nextBatchTimer=setTimeout(function(){d._parameters=void 0,d._runNextBatch()},h)))),this._logger.trace("runRequestBatch end"),[2]}})})},r.prototype._runNextBatch=function(){if(!this._paused){this._logger.trace("runNextBatch start"),this._nextBatchTimer&&(clearTimeout(this._nextBatchTimer),this._nextBatchTimer=void 0);var e=this._parameters?Math.min(this._parameters.remaining,this._parameters.limit/10):1,t=this._queue.splice(0,e);t.length&&this._runRequestBatch(t),this._logger.trace("runNextBatch end")}},r}();La.ResponseBasedRateLimiter=oO});var DS=l(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.PartitionedRateLimiter=void 0;var Ni=(y(),g(m)),sO=Tp(),uO=function(){function r(e){this._children=new Map,this._paused=!1,this._partitionKeyCallback=e.getPartitionKey,this._createChildCallback=e.createChild}return n(r,"PartitionedRateLimiter"),r.prototype.request=function(e,t){return Ni.__awaiter(this,void 0,void 0,function(){var i,a;return Ni.__generator(this,function(o){switch(o.label){case 0:return i=this._partitionKeyCallback(e),a=this._getChild(i),[4,a.request(e,t)];case 1:return[2,o.sent()]}})})},r.prototype.clear=function(){var e,t;try{for(var i=Ni.__values(this._children.values()),a=i.next();!a.done;a=i.next()){var o=a.value;o.clear()}}catch(s){e={error:s}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.pause=function(){var e,t;this._paused=!0;try{for(var i=Ni.__values(this._children.values()),a=i.next();!a.done;a=i.next()){var o=a.value;o.pause()}}catch(s){e={error:s}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.resume=function(){var e,t;this._paused=!1;try{for(var i=Ni.__values(this._children.values()),a=i.next();!a.done;a=i.next()){var o=a.value;o.resume()}}catch(s){e={error:s}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.getChildStats=function(e){if(!this._children.has(e))return null;var t=this._children.get(e);return t instanceof sO.ResponseBasedRateLimiter?t.stats:null},r.prototype._getChild=function(e){if(this._children.has(e))return this._children.get(e);var t=this._createChildCallback(e);return this._paused&&t.pause(),this._children.set(e,t),t},r}();Ma.PartitionedRateLimiter=uO});var OS=l(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.PartitionedTimeBasedRateLimiter=void 0;var kr=(y(),g(m)),lO=Si(),cO=qi(),dO=function(){function r(e){var t=e.logger,i=e.bucketSize,a=e.timeFrame,o=e.doRequest,s=e.getPartitionKey;this._partitionedQueue=new Map,this._usedFromBucket=new Map,this._paused=!1,this._logger=(0,lO.createLogger)(kr.__assign({name:"rate-limiter",emoji:!0},t)),this._bucketSize=i,this._timeFrame=a,this._callback=o,this._partitionKeyCallback=s}return n(r,"PartitionedTimeBasedRateLimiter"),r.prototype.request=function(e,t){return kr.__awaiter(this,void 0,void 0,function(){var i=this;return kr.__generator(this,function(a){switch(a.label){case 0:return[4,new Promise(function(o,s){var u,c,h={req:e,resolve:o,reject:s,limitReachedBehavior:(u=t?.limitReachedBehavior)!==null&&u!==void 0?u:"enqueue"},d=i._partitionKeyCallback(e),_=(c=i._usedFromBucket.get(d))!==null&&c!==void 0?c:0;if(_>=i._bucketSize||i._paused)switch(h.limitReachedBehavior){case"enqueue":{var b=i._getPartitionedQueue(d);b.push(h),_+b.length>=i._bucketSize?i._logger.warn("Rate limit of ".concat(i._bucketSize," for ").concat(d?"partition ".concat(d):"default partition"," was reached, waiting for ").concat(i._paused?"the limiter to be unpaused":"a free bucket entry","; queue size is ").concat(b.length)):i._logger.info("Enqueueing request for ".concat(d?"partition ".concat(d):"default partition"," because the rate limiter is paused; queue size is ").concat(b.length));break}case"null":{h.resolve(null),i._paused?i._logger.info("Returning null for request for ".concat(d?"partition ".concat(d):"default partition"," because the rate limiter is paused")):i._logger.warn("Rate limit of ".concat(i._bucketSize," for ").concat(d?"partition ".concat(d):"default partition"," was reached, dropping request and returning null"));break}case"throw":{h.reject(new cO.RateLimitReachedError("Request dropped because ".concat(i._paused?"the rate limiter is paused":"the rate limit for ".concat(d?"partition ".concat(d):"default partition"," was reached"))));break}default:throw new Error("this should never happen")}else i._runRequest(h,d)})];case 1:return[2,a.sent()]}})})},r.prototype.clear=function(){this._partitionedQueue.clear()},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){var e,t;this._paused=!1;try{for(var i=kr.__values(this._partitionedQueue.keys()),a=i.next();!a.done;a=i.next()){var o=a.value;this._runNextRequest(o)}}catch(s){e={error:s}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype._getPartitionedQueue=function(e){if(this._partitionedQueue.has(e))return this._partitionedQueue.get(e);var t=[];return this._partitionedQueue.set(e,t),t},r.prototype._runRequest=function(e,t){var i;return kr.__awaiter(this,void 0,void 0,function(){var a,o,s,u,c,h,d=this;return kr.__generator(this,function(_){switch(_.label){case 0:a=this._getPartitionedQueue(t),this._logger.debug("doing a request for ".concat(t?"partition ".concat(t):"default partition",", new queue length is ").concat(a.length)),this._usedFromBucket.set(t,((i=this._usedFromBucket.get(t))!==null&&i!==void 0?i:0)+1),o=e.req,s=e.resolve,u=e.reject,_.label=1;case 1:return _.trys.push([1,3,4,5]),c=s,[4,this._callback(o)];case 2:return c.apply(void 0,[_.sent()]),[3,5];case 3:return h=_.sent(),u(h),[3,5];case 4:return setTimeout(function(){var b=d._usedFromBucket.get(t)-1;d._usedFromBucket.set(t,b),a.length&&b<d._bucketSize&&d._runNextRequest(t)},this._timeFrame),[7];case 5:return[2]}})})},r.prototype._runNextRequest=function(e){if(!this._paused){var t=this._getPartitionedQueue(e),i=t.shift();i&&this._runRequest(i,e)}},r}();Fa.PartitionedTimeBasedRateLimiter=dO});var Ip=l(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.TimeBasedRateLimiter=void 0;var Qi=(y(),g(m)),pO=Si(),hO=qi(),fO=function(){function r(e){var t=e.logger,i=e.bucketSize,a=e.timeFrame,o=e.doRequest;this._queue=[],this._usedFromBucket=0,this._paused=!1,this._logger=(0,pO.createLogger)(Qi.__assign({name:"rate-limiter",emoji:!0},t)),this._bucketSize=i,this._timeFrame=a,this._callback=o}return n(r,"TimeBasedRateLimiter"),r.prototype.request=function(e,t){return Qi.__awaiter(this,void 0,void 0,function(){var i=this;return Qi.__generator(this,function(a){switch(a.label){case 0:return[4,new Promise(function(o,s){var u,c={req:e,resolve:o,reject:s,limitReachedBehavior:(u=t?.limitReachedBehavior)!==null&&u!==void 0?u:"enqueue"};if(i._usedFromBucket>=i._bucketSize||i._paused)switch(c.limitReachedBehavior){case"enqueue":{i._queue.push(c),i._usedFromBucket+i._queue.length>=i._bucketSize?i._logger.warn("Rate limit of ".concat(i._bucketSize," was reached, waiting for ").concat(i._paused?"the limiter to be unpaused":"a free bucket entry","; queue size is ").concat(i._queue.length)):i._logger.info("Enqueueing request because the rate limiter is paused; queue size is ".concat(i._queue.length));break}case"null":{c.resolve(null),i._logger.warn("Rate limit of ".concat(i._bucketSize," was reached, dropping request and returning null")),i._paused?i._logger.info("Returning null for request because the rate limiter is paused"):i._logger.warn("Rate limit of ".concat(i._bucketSize," was reached, dropping request and returning null"));break}case"throw":{c.reject(new hO.RateLimitReachedError("Request dropped because ".concat(i._paused?"the rate limiter is paused":"the rate limit was reached")));break}default:throw new Error("this should never happen")}else i._runRequest(c)})];case 1:return[2,a.sent()]}})})},r.prototype.clear=function(){this._queue=[]},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1,this._runNextRequest()},r.prototype._runRequest=function(e){return Qi.__awaiter(this,void 0,void 0,function(){var t,i,a,o,s,u=this;return Qi.__generator(this,function(c){switch(c.label){case 0:this._logger.debug("doing a request, new queue length is ".concat(this._queue.length)),this._usedFromBucket+=1,t=e.req,i=e.resolve,a=e.reject,c.label=1;case 1:return c.trys.push([1,3,4,5]),o=i,[4,this._callback(t)];case 2:return o.apply(void 0,[c.sent()]),[3,5];case 3:return s=c.sent(),a(s),[3,5];case 4:return setTimeout(function(){u._usedFromBucket-=1,u._queue.length&&u._usedFromBucket<u._bucketSize&&u._runNextRequest()},this._timeFrame),[7];case 5:return[2]}})})},r.prototype._runNextRequest=function(){if(!this._paused){var e=this._queue.shift();e&&this._runRequest(e)}},r}();Na.TimeBasedRateLimiter=fO});var BS=l(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.TimedPassthruRateLimiter=void 0;var Gi=(y(),g(m)),mO=Ip(),yO=function(r){Gi.__extends(e,r);function e(t,i){return r.call(this,Gi.__assign(Gi.__assign({},i),{doRequest:function(a,o){return Gi.__awaiter(this,void 0,void 0,function(){return Gi.__generator(this,function(s){switch(s.label){case 0:return[4,t.request(a,o)];case 1:return[2,s.sent()]}})})}}))||this}return n(e,"TimedPassthruRateLimiter"),e}(mO.TimeBasedRateLimiter);Qa.TimedPassthruRateLimiter=yO});var Ga=l(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.TimedPassthruRateLimiter=ie.TimeBasedRateLimiter=ie.ResponseBasedRateLimiter=ie.PartitionedTimeBasedRateLimiter=ie.PartitionedRateLimiter=ie.NullRateLimiter=ie.RateLimitReachedError=ie.RetryAfterError=void 0;var _O=id();Object.defineProperty(ie,"RetryAfterError",{enumerable:!0,get:function(){return _O.RetryAfterError}});var gO=qi();Object.defineProperty(ie,"RateLimitReachedError",{enumerable:!0,get:function(){return gO.RateLimitReachedError}});var bO=wg();Object.defineProperty(ie,"NullRateLimiter",{enumerable:!0,get:function(){return bO.NullRateLimiter}});var vO=DS();Object.defineProperty(ie,"PartitionedRateLimiter",{enumerable:!0,get:function(){return vO.PartitionedRateLimiter}});var wO=OS();Object.defineProperty(ie,"PartitionedTimeBasedRateLimiter",{enumerable:!0,get:function(){return wO.PartitionedTimeBasedRateLimiter}});var xO=Tp();Object.defineProperty(ie,"ResponseBasedRateLimiter",{enumerable:!0,get:function(){return xO.ResponseBasedRateLimiter}});var SO=Ip();Object.defineProperty(ie,"TimeBasedRateLimiter",{enumerable:!0,get:function(){return SO.TimeBasedRateLimiter}});var qO=BS();Object.defineProperty(ie,"TimedPassthruRateLimiter",{enumerable:!0,get:function(){return qO.TimedPassthruRateLimiter}})});var jS=l((Lr,US)=>{"use strict";var PO=n(function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},"getGlobal"),rr=PO();US.exports=Lr=rr.fetch;rr.fetch&&(Lr.default=rr.fetch.bind(rr));Lr.Headers=rr.Headers;Lr.Request=rr.Request;Lr.Response=rr.Response});var LS=l((ir,kS)=>{var Vi=jS(),CO=Vi.default||Vi,Va=n(function(r,e){return/^\/\//.test(r)&&(r="https:"+r),CO.call(this,r,e)},"fetch");Va.ponyfill=!0;kS.exports=ir=Va;ir.fetch=Va;ir.Headers=Vi.Headers;ir.Request=Vi.Request;ir.Response=Vi.Response;ir.default=Va});var $a=l((sz,FS)=>{"use strict";var Rp=Object.prototype.hasOwnProperty,Mr=Array.isArray,et=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),HO=n(function(e){for(;e.length>1;){var t=e.pop(),i=t.obj[t.prop];if(Mr(i)){for(var a=[],o=0;o<i.length;++o)typeof i[o]<"u"&&a.push(i[o]);t.obj[t.prop]=a}}},"compactQueue"),MS=n(function(e,t){for(var i=t&&t.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]<"u"&&(i[a]=e[a]);return i},"arrayToObject"),EO=n(function r(e,t,i){if(!t)return e;if(typeof t!="object"){if(Mr(e))e.push(t);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Rp.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var a=e;return Mr(e)&&!Mr(t)&&(a=MS(e,i)),Mr(e)&&Mr(t)?(t.forEach(function(o,s){if(Rp.call(e,s)){var u=e[s];u&&typeof u=="object"&&o&&typeof o=="object"?e[s]=r(u,o,i):e.push(o)}else e[s]=o}),e):Object.keys(t).reduce(function(o,s){var u=t[s];return Rp.call(o,s)?o[s]=r(o[s],u,i):o[s]=u,o},a)},"merge"),AO=n(function(e,t){return Object.keys(t).reduce(function(i,a){return i[a]=t[a],i},e)},"assignSingleSource"),TO=n(function(r,e,t){var i=r.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},"decode"),IO=n(function(e,t,i){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var o="",s=0;s<a.length;++s){var u=a.charCodeAt(s);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122){o+=a.charAt(s);continue}if(u<128){o=o+et[u];continue}if(u<2048){o=o+(et[192|u>>6]+et[128|u&63]);continue}if(u<55296||u>=57344){o=o+(et[224|u>>12]+et[128|u>>6&63]+et[128|u&63]);continue}s+=1,u=65536+((u&1023)<<10|a.charCodeAt(s)&1023),o+=et[240|u>>18]+et[128|u>>12&63]+et[128|u>>6&63]+et[128|u&63]}return o},"encode"),RO=n(function(e){for(var t=[{obj:{o:e},prop:"o"}],i=[],a=0;a<t.length;++a)for(var o=t[a],s=o.obj[o.prop],u=Object.keys(s),c=0;c<u.length;++c){var h=u[c],d=s[h];typeof d=="object"&&d!==null&&i.indexOf(d)===-1&&(t.push({obj:s,prop:h}),i.push(d))}return HO(t),e},"compact"),DO=n(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),OO=n(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),BO=n(function(e,t){return[].concat(e,t)},"combine");FS.exports={arrayToObject:MS,assign:AO,combine:BO,compact:RO,decode:TO,encode:IO,isBuffer:OO,isRegExp:DO,merge:EO}});var Dp=l((lz,QS)=>{"use strict";var UO=String.prototype.replace,jO=/%20/g,kO=$a(),NS={RFC1738:"RFC1738",RFC3986:"RFC3986"};QS.exports=kO.assign({default:NS.RFC3986,formatters:{RFC1738:function(r){return UO.call(r,jO,"+")},RFC3986:function(r){return String(r)}}},NS)});var zS=l((cz,WS)=>{"use strict";var $S=$a(),$i=Dp(),LO=Object.prototype.hasOwnProperty,GS={brackets:n(function(e){return e+"[]"},"brackets"),comma:"comma",indices:n(function(e,t){return e+"["+t+"]"},"indices"),repeat:n(function(e){return e},"repeat")},Fr=Array.isArray,MO=Array.prototype.push,Op=n(function(r,e){MO.apply(r,Fr(e)?e:[e])},"pushToArray"),FO=Date.prototype.toISOString,VS=$i.default,me={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:$S.encode,encodeValuesOnly:!1,format:VS,formatter:$i.formatters[VS],indices:!1,serializeDate:n(function(e){return FO.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},NO=n(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),QO=n(function r(e,t,i,a,o,s,u,c,h,d,_,b,q){var v=e;if(typeof u=="function"?v=u(t,v):v instanceof Date?v=d(v):i==="comma"&&Fr(v)&&(v=v.join(",")),v===null){if(a)return s&&!b?s(t,me.encoder,q,"key"):t;v=""}if(NO(v)||$S.isBuffer(v)){if(s){var x=b?t:s(t,me.encoder,q,"key");return[_(x)+"="+_(s(v,me.encoder,q,"value"))]}return[_(t)+"="+_(String(v))]}var A=[];if(typeof v>"u")return A;var O;if(Fr(u))O=u;else{var z=Object.keys(v);O=c?z.sort(c):z}for(var le=0;le<O.length;++le){var te=O[le];o&&v[te]===null||(Fr(v)?Op(A,r(v[te],typeof i=="function"?i(t,te):t,i,a,o,s,u,c,h,d,_,b,q)):Op(A,r(v[te],t+(h?"."+te:"["+te+"]"),i,a,o,s,u,c,h,d,_,b,q)))}return A},"stringify"),GO=n(function(e){if(!e)return me;if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||me.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=$i.default;if(typeof e.format<"u"){if(!LO.call($i.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var a=$i.formatters[i],o=me.filter;return(typeof e.filter=="function"||Fr(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:me.addQueryPrefix,allowDots:typeof e.allowDots>"u"?me.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:me.charsetSentinel,delimiter:typeof e.delimiter>"u"?me.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:me.encode,encoder:typeof e.encoder=="function"?e.encoder:me.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:me.encodeValuesOnly,filter:o,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:me.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:me.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:me.strictNullHandling}},"normalizeStringifyOptions");WS.exports=function(r,e){var t=r,i=GO(e),a,o;typeof i.filter=="function"?(o=i.filter,t=o("",t)):Fr(i.filter)&&(o=i.filter,a=o);var s=[];if(typeof t!="object"||t===null)return"";var u;e&&e.arrayFormat in GS?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var c=GS[u];a||(a=Object.keys(t)),i.sort&&a.sort(i.sort);for(var h=0;h<a.length;++h){var d=a[h];i.skipNulls&&t[d]===null||Op(s,QO(t[d],d,c,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.formatter,i.encodeValuesOnly,i.charset))}var _=s.join(i.delimiter),b=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),_.length>0?b+_:""}});var YS=l((pz,ZS)=>{"use strict";var Wi=$a(),Bp=Object.prototype.hasOwnProperty,KS=Array.isArray,de={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Wi.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},VO=n(function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},"interpretNumericEntities"),JS=n(function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},"parseArrayValue"),$O=n(function(e,t){if(KS(e)){for(var i=[],a=0;a<e.length;a+=1)i.push(t(e[a]));return i}return t(e)},"maybeMap"),WO="utf8=%26%2310003%3B",zO="utf8=%E2%9C%93",KO=n(function(e,t){var i={},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=a.split(t.delimiter,o),u=-1,c,h=t.charset;if(t.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===zO?h="utf-8":s[c]===WO&&(h="iso-8859-1"),u=c,c=s.length);for(c=0;c<s.length;++c)if(c!==u){var d=s[c],_=d.indexOf("]="),b=_===-1?d.indexOf("="):_+1,q,v;b===-1?(q=t.decoder(d,de.decoder,h,"key"),v=t.strictNullHandling?null:""):(q=t.decoder(d.slice(0,b),de.decoder,h,"key"),v=$O(JS(d.slice(b+1),t),function(x){return t.decoder(x,de.decoder,h,"value")})),v&&t.interpretNumericEntities&&h==="iso-8859-1"&&(v=VO(v)),d.indexOf("[]=")>-1&&(v=KS(v)?[v]:v),Bp.call(i,q)?i[q]=Wi.combine(i[q],v):i[q]=v}return i},"parseQueryStringValues"),JO=n(function(r,e,t,i){for(var a=i?e:JS(e,t),o=r.length-1;o>=0;--o){var s,u=r[o];if(u==="[]"&&t.parseArrays)s=[].concat(a);else{s=t.plainObjects?Object.create(null):{};var c=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,h=parseInt(c,10);!t.parseArrays&&c===""?s={0:a}:!isNaN(h)&&u!==c&&String(h)===c&&h>=0&&t.parseArrays&&h<=t.arrayLimit?(s=[],s[h]=a):s[c]=a}a=s}return a},"parseObject"),ZO=n(function(e,t,i,a){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,c=i.depth>0&&s.exec(o),h=c?o.slice(0,c.index):o,d=[];if(h){if(!i.plainObjects&&Bp.call(Object.prototype,h)&&!i.allowPrototypes)return;d.push(h)}for(var _=0;i.depth>0&&(c=u.exec(o))!==null&&_<i.depth;){if(_+=1,!i.plainObjects&&Bp.call(Object.prototype,c[1].slice(1,-1))&&!i.allowPrototypes)return;d.push(c[1])}return c&&d.push("["+o.slice(c.index)+"]"),JO(d,t,i,a)}},"parseQueryStringKeys"),YO=n(function(e){if(!e)return de;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?de.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?de.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:de.allowPrototypes,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:de.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:de.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:de.comma,decoder:typeof e.decoder=="function"?e.decoder:de.decoder,delimiter:typeof e.delimiter=="string"||Wi.isRegExp(e.delimiter)?e.delimiter:de.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:de.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:de.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:de.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:de.strictNullHandling}},"normalizeParseOptions");ZS.exports=function(r,e){var t=YO(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var i=typeof r=="string"?KO(r,t):r,a=t.plainObjects?Object.create(null):{},o=Object.keys(i),s=0;s<o.length;++s){var u=o[s],c=ZO(u,i[u],t,typeof r=="string");a=Wi.merge(a,c,t)}return Wi.compact(a)}});var Up=l((fz,XS)=>{"use strict";var XO=zS(),eB=YS(),tB=Dp();XS.exports={formats:tB,parse:eB,stringify:XO}});var t0=l(e0=>{function ft(r){if(typeof r!="object")return r;var e,t,i=Object.prototype.toString.call(r);if(i==="[object Object]"){if(r.constructor!==Object&&typeof r.constructor=="function"){t=new r.constructor;for(e in r)r.hasOwnProperty(e)&&t[e]!==r[e]&&(t[e]=ft(r[e]))}else{t={};for(e in r)e==="__proto__"?Object.defineProperty(t,e,{value:ft(r[e]),configurable:!0,enumerable:!0,writable:!0}):t[e]=ft(r[e])}return t}if(i==="[object Array]"){for(e=r.length,t=Array(e);e--;)t[e]=ft(r[e]);return t}return i==="[object Set]"?(t=new Set,r.forEach(function(a){t.add(ft(a))}),t):i==="[object Map]"?(t=new Map,r.forEach(function(a,o){t.set(ft(o),ft(a))}),t):i==="[object Date]"?new Date(+r):i==="[object RegExp]"?(t=new RegExp(r.source,r.flags),t.lastIndex=r.lastIndex,t):i==="[object DataView]"?new r.constructor(ft(r.buffer)):i==="[object ArrayBuffer]"?r.slice(0):i.slice(-6)==="Array]"?new r.constructor(r):r}n(ft,"klona");e0.klona=ft});var kp=l(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.DataObject=tt.getRawData=tt.rawDataSymbol=void 0;var rB=t0();tt.rawDataSymbol=Symbol("twurpleRawData");function iB(r){return(0,rB.klona)(r[tt.rawDataSymbol])}n(iB,"getRawData");tt.getRawData=iB;var jp=class{static{n(this,"DataObject")}constructor(e){this[tt.rawDataSymbol]=e}};tt.DataObject=jp});var za=l(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.CustomError=void 0;var Lp=class extends Error{static{n(this,"CustomError")}constructor(e,t){var i;super(e,t),Object.setPrototypeOf(this,new.target.prototype),(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,new.target.constructor)}get name(){return this.constructor.name}};Wa.CustomError=Lp});var Fp=l(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.RelationAssertionError=void 0;var nB=za(),Mp=class extends nB.CustomError{static{n(this,"RelationAssertionError")}constructor(){super("Relation returned null - this may be a library bug or a race condition in your own code")}};Ka.RelationAssertionError=Mp});var r0=l(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.checkRelationAssertion=void 0;var aB=Fp();function oB(r){if(r==null)throw new aB.RelationAssertionError;return r}n(oB,"checkRelationAssertion");Ja.checkRelationAssertion=oB});var Np=l(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.rtfm=void 0;function sB(r,e,t){return i=>{let a=t?function(){return`[${e}#${this[t]} - please check https://twurple.js.org/reference/${r}/classes/${e}.html for available properties]`}:function(){return`[${e} - please check https://twurple.js.org/reference/${r}/classes/${e}.html for available properties]`};Object.defineProperty(i.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:a,enumerable:!1})}}n(sB,"rtfm");Za.rtfm=sB});var i0=l(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.HelixExtension=void 0;var uB=(y(),g(m)),H=kp(),lB=Np(),Qp=class extends H.DataObject{static{n(this,"HelixExtension")}get authorName(){return this[H.rawDataSymbol].author_name}get bitsEnabled(){return this[H.rawDataSymbol].bits_enabled}get installable(){return this[H.rawDataSymbol].can_install}get configurationLocation(){return this[H.rawDataSymbol].configuration_location}get description(){return this[H.rawDataSymbol].description}get tosUrl(){return this[H.rawDataSymbol].eula_tos_url}get hasChatSupport(){return this[H.rawDataSymbol].has_chat_support}get iconUrl(){return this[H.rawDataSymbol].icon_url}getIconUrl(e){return this[H.rawDataSymbol].icon_urls[e]}get id(){return this[H.rawDataSymbol].id}get name(){return this[H.rawDataSymbol].name}get privacyPolicyUrl(){return this[H.rawDataSymbol].privacy_policy_url}get requestsIdentityLink(){return this[H.rawDataSymbol].request_identity_link}get screenshotUrls(){return this[H.rawDataSymbol].screenshot_urls}get state(){return this[H.rawDataSymbol].state}get subscriptionsSupportLevel(){return this[H.rawDataSymbol].subscriptions_support_level}get summary(){return this[H.rawDataSymbol].summary}get supportEmail(){return this[H.rawDataSymbol].support_email}get version(){return this[H.rawDataSymbol].version}get viewerSummery(){return this[H.rawDataSymbol].viewer_summary}get allowedConfigUrls(){return this[H.rawDataSymbol].allowlisted_config_urls}get allowedPanelUrls(){return this[H.rawDataSymbol].allowlisted_panel_urls}get mobileViewerUrl(){var e,t;return(t=(e=this[H.rawDataSymbol].views.mobile)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get panelViewerUrl(){var e,t;return(t=(e=this[H.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get panelHeight(){var e,t;return(t=(e=this[H.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:null}get panelCanLinkExternalContent(){var e,t;return(t=(e=this[H.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get overlayViewerUrl(){var e,t;return(t=(e=this[H.rawDataSymbol].views.video_overlay)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get overlayCanLinkExternalContent(){var e,t;return(t=(e=this[H.rawDataSymbol].views.video_overlay)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get componentViewerUrl(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get componentAspectWidth(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_width)!==null&&t!==void 0?t:null}get componentAspectHeight(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_height)!==null&&t!==void 0?t:null}get componentAspectRatioX(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_ratio_x)!==null&&t!==void 0?t:null}get componentAspectRatioY(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_ratio_y)!==null&&t!==void 0?t:null}get componentAutoScales(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.autoscale)!==null&&t!==void 0?t:null}get componentScalePixels(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.scale_pixels)!==null&&t!==void 0?t:null}get componentTargetHeight(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.target_height)!==null&&t!==void 0?t:null}get componentSize(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.size)!==null&&t!==void 0?t:null}get componentZoom(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.zoom)!==null&&t!==void 0?t:null}get componentZoomPixels(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.zoom_pixels)!==null&&t!==void 0?t:null}get componentCanLinkExternalContent(){var e,t;return(t=(e=this[H.rawDataSymbol].views.component)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get configViewerUrl(){var e,t;return(t=(e=this[H.rawDataSymbol].views.config)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get configCanLinkExternalContent(){var e,t;return(t=(e=this[H.rawDataSymbol].views.config)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}};Qp=uB.__decorate([(0,lB.rtfm)("api","HelixExtension","id")],Qp);Ya.HelixExtension=Qp});var n0=l(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.HellFreezesOverError=void 0;var cB=za(),Gp=class extends cB.CustomError{static{n(this,"HellFreezesOverError")}constructor(e){super(`${e} - this should never happen, please file a bug in the GitHub issue tracker`)}};Xa.HellFreezesOverError=Gp});var a0=l(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.extractUserName=Nr.extractUserId=void 0;function dB(r){return typeof r=="string"?r:typeof r=="number"?r.toString(10):r.id}n(dB,"extractUserId");Nr.extractUserId=dB;function pB(r){return typeof r=="string"?r:r.name}n(pB,"extractUserName");Nr.extractUserName=pB});var f=l(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.extractUserName=N.extractUserId=N.RelationAssertionError=N.HellFreezesOverError=N.CustomError=N.HelixExtension=N.rtfm=N.checkRelationAssertion=N.rawDataSymbol=N.getRawData=N.DataObject=void 0;var Vp=kp();Object.defineProperty(N,"DataObject",{enumerable:!0,get:function(){return Vp.DataObject}});Object.defineProperty(N,"getRawData",{enumerable:!0,get:function(){return Vp.getRawData}});Object.defineProperty(N,"rawDataSymbol",{enumerable:!0,get:function(){return Vp.rawDataSymbol}});var hB=r0();Object.defineProperty(N,"checkRelationAssertion",{enumerable:!0,get:function(){return hB.checkRelationAssertion}});var fB=Np();Object.defineProperty(N,"rtfm",{enumerable:!0,get:function(){return fB.rtfm}});var mB=i0();Object.defineProperty(N,"HelixExtension",{enumerable:!0,get:function(){return mB.HelixExtension}});var yB=za();Object.defineProperty(N,"CustomError",{enumerable:!0,get:function(){return yB.CustomError}});var _B=n0();Object.defineProperty(N,"HellFreezesOverError",{enumerable:!0,get:function(){return _B.HellFreezesOverError}});var gB=Fp();Object.defineProperty(N,"RelationAssertionError",{enumerable:!0,get:function(){return gB.RelationAssertionError}});var o0=a0();Object.defineProperty(N,"extractUserId",{enumerable:!0,get:function(){return o0.extractUserId}});Object.defineProperty(N,"extractUserName",{enumerable:!0,get:function(){return o0.extractUserName}})});var Wp=l(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.HttpStatusCodeError=void 0;var bB=f(),$p=class extends bB.CustomError{static{n(this,"HttpStatusCodeError")}constructor(e,t,i,a,o,s){super(`Encountered HTTP status code ${e}: ${t}
|
|
9
|
+
|
|
10
|
+
URL: ${i}
|
|
11
|
+
Method: ${a}
|
|
12
|
+
Body:
|
|
13
|
+
${!s&&o.length>150?`${o.slice(0,147)}...`:o}`),this._statusCode=e,this._url=i,this._method=a,this._body=o}get statusCode(){return this._statusCode}get url(){return this._url}get method(){return this._method}get body(){return this._body}};eo.HttpStatusCodeError=$p});var zp=l(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.transformTwitchApiResponse=Qr.handleTwitchApiResponseError=void 0;var vB=Up(),wB=Wp();async function xB(r,e){var t;if(!r.ok){let i=r.headers.get("Content-Type")==="application/json",a=i?JSON.stringify(await r.json(),null,2):await r.text(),o=(0,vB.stringify)(e.query,{arrayFormat:"repeat",addQueryPrefix:!0}),s=`${e.url}${o}`;throw new wB.HttpStatusCodeError(r.status,r.statusText,s,(t=e.method)!==null&&t!==void 0?t:"GET",a,i)}}n(xB,"handleTwitchApiResponseError");Qr.handleTwitchApiResponseError=xB;async function SB(r){if(r.status===204)return;let e=await r.text();if(e)return JSON.parse(e)}n(SB,"transformTwitchApiResponse");Qr.transformTwitchApiResponse=SB});var s0=l(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.getTwitchApiUrl=void 0;function qB(r,e){switch(e){case"helix":return`https://api.twitch.tv/helix/${r.replace(/^\//,"")}`;case"auth":return`https://id.twitch.tv/oauth2/${r.replace(/^\//,"")}`;case"custom":return r;default:return r}}n(qB,"getTwitchApiUrl");to.getTwitchApiUrl=qB});var d0=l(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.callTwitchApi=Gr.callTwitchApiRaw=void 0;var u0=LS(),PB=Up(),l0=zp(),CB=s0();async function c0(r,e,t,i,a={}){var o,s;let u=(o=r.type)!==null&&o!==void 0?o:"helix",c=(0,CB.getTwitchApiUrl)(r.url,u),h=(0,PB.stringify)(r.query,{arrayFormat:"repeat",addQueryPrefix:!0}),d=new u0.Headers({Accept:"application/json"}),_;r.jsonBody&&(_=JSON.stringify(r.jsonBody),d.append("Content-Type","application/json")),e&&u!=="auth"&&d.append("Client-ID",e),t&&d.append("Authorization",`${u==="helix"?i??"Bearer":"OAuth"} ${t}`);let b={...a,method:(s=r.method)!==null&&s!==void 0?s:"GET",headers:d,body:_};return await(0,u0.default)(`${c}${h}`,b)}n(c0,"callTwitchApiRaw");Gr.callTwitchApiRaw=c0;async function HB(r,e,t,i,a={}){let o=await c0(r,e,t,i,a);return await(0,l0.handleTwitchApiResponseError)(o,r),await(0,l0.transformTwitchApiResponse)(o)}n(HB,"callTwitchApi");Gr.callTwitchApi=HB});var p0=l(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.createBroadcasterQuery=void 0;var EB=f();function AB(r){return{broadcaster_id:(0,EB.extractUserId)(r)}}n(AB,"createBroadcasterQuery");ro.createBroadcasterQuery=AB});var Q=l(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.HttpStatusCodeError=be.transformTwitchApiResponse=be.handleTwitchApiResponseError=be.createBroadcasterQuery=be.callTwitchApiRaw=be.callTwitchApi=void 0;var h0=d0();Object.defineProperty(be,"callTwitchApi",{enumerable:!0,get:function(){return h0.callTwitchApi}});Object.defineProperty(be,"callTwitchApiRaw",{enumerable:!0,get:function(){return h0.callTwitchApiRaw}});var TB=p0();Object.defineProperty(be,"createBroadcasterQuery",{enumerable:!0,get:function(){return TB.createBroadcasterQuery}});var f0=zp();Object.defineProperty(be,"handleTwitchApiResponseError",{enumerable:!0,get:function(){return f0.handleTwitchApiResponseError}});Object.defineProperty(be,"transformTwitchApiResponse",{enumerable:!0,get:function(){return f0.transformTwitchApiResponse}});var IB=Wp();Object.defineProperty(be,"HttpStatusCodeError",{enumerable:!0,get:function(){return IB.HttpStatusCodeError}})});var Jp=l(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.ConfigError=void 0;var RB=f(),Kp=class extends RB.CustomError{static{n(this,"ConfigError")}};io.ConfigError=Kp});var m0=l(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.HelixRateLimiter=void 0;var DB=Ga(),OB=Q(),Zp=class extends DB.ResponseBasedRateLimiter{static{n(this,"HelixRateLimiter")}async doRequest({options:e,clientId:t,accessToken:i,authorizationType:a,fetchOptions:o}){return await(0,OB.callTwitchApiRaw)(e,t,i,a,o)}needsToRetryAfter(e){return e.status===429&&(!e.headers.has("ratelimit-remaining")||Number(e.headers.get("ratelimit-remaining"))===0)?+e.headers.get("ratelimit-reset")*1e3-Date.now():null}getParametersFromResponse(e){let t=e.headers;return{limit:+t.get("ratelimit-limit"),remaining:+t.get("ratelimit-remaining"),resetsAt:+t.get("ratelimit-reset")*1e3}}};no.HelixRateLimiter=Zp});var zi=l(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.createCacheKey=void 0;function BB(r){switch(typeof r){case"undefined":return"";case"object":{if(r===null)return"";if("cacheKey"in r)return r.cacheKey;let e=JSON.stringify(r);if(e!=="{}")return e}default:return r.toString()}}n(BB,"createSingleCacheKey");function UB(r,e,t){return[r,...e.map(BB)].join("/")+(t?"/":"")}n(UB,"createCacheKey");ao.createCacheKey=UB});var y0=l(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.Cacheable=void 0;var jB=zi();function kB(r){return class extends r{constructor(){super(...arguments),this.cache=new Map}getFromCache(e){if(this._cleanCache(),this.cache.has(e)){let t=this.cache.get(e);if(t)return t.value}}setCache(e,t,i){this.cache.set(e,{value:t,expires:Date.now()+i*1e3})}removeFromCache(e,t){let i=this._getInternalCacheKey(e,t);t?this.cache.forEach((a,o)=>{o.startsWith(i)&&this.cache.delete(o)}):this.cache.delete(i)}_cleanCache(){let e=Date.now();this.cache.forEach((t,i)=>{t.expires<e&&this.cache.delete(i)})}_getInternalCacheKey(e,t){if(typeof e=="string"){let i=e;return i.endsWith("/")||(i+="/"),i}else{let i=e.shift();return jB.createCacheKey(i,e,t)}}}}n(kB,"Cacheable");oo.Cacheable=kB});var _0=l(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.Cached=void 0;var LB=zi();function MB(r=1/0,e=!1){return function(t,i,a){let o=a.value;return a.value=async function(...s){let u=LB.createCacheKey(i,s),c=this.getFromCache(u);if(c)return c;let h=await o.apply(this,s);return(h!=null||e)&&this.setCache(u,h,r),h},a}}n(MB,"Cached");so.Cached=MB});var g0=l(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.CachedGetter=void 0;var FB=zi();function NB(r=1/0){return function(e,t,i){if(i.get){let a=i.get;i.get=function(){let o=FB.createCacheKey(t,[]),s=this.getFromCache(o);if(s)return s;let u=a.call(this);return this.setCache(o,u,r),u}}return i}}n(NB,"CachedGetter");uo.CachedGetter=NB});var b0=l(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.ClearsCache=void 0;function QB(r,e){return function(t,i,a){let o=a.value;return a.value=async function(...s){let u=await o.apply(this,s),c=e===void 0?s.slice():s.slice(0,e);return this.removeFromCache([r,...c],!0),u},a}}n(QB,"ClearsCache");lo.ClearsCache=QB});var Ki=l(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.createCacheKey=Ue.ClearsCache=Ue.CachedGetter=Ue.Cached=Ue.Cacheable=void 0;var GB=y0();Object.defineProperty(Ue,"Cacheable",{enumerable:!0,get:function(){return GB.Cacheable}});var VB=_0();Object.defineProperty(Ue,"Cached",{enumerable:!0,get:function(){return VB.Cached}});var $B=g0();Object.defineProperty(Ue,"CachedGetter",{enumerable:!0,get:function(){return $B.CachedGetter}});var WB=b0();Object.defineProperty(Ue,"ClearsCache",{enumerable:!0,get:function(){return WB.ClearsCache}});var zB=zi();Object.defineProperty(Ue,"createCacheKey",{enumerable:!0,get:function(){return zB.createCacheKey}})});var Xp=l(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.Listener=void 0;var Yp=class{static{n(this,"Listener")}constructor(e,t,i,a=!1){this.owner=e,this.event=t,this.listener=i,this._internal=a}unbind(){this.owner.removeListener(this)}};co.Listener=Yp});var v0=l(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.EventEmitter=void 0;var KB=Xp(),eh=class{static{n(this,"EventEmitter")}constructor(){this._eventListeners=new Map,this._internalEventListeners=new Map}on(e,t){return this._addListener(!1,e,t)}addListener(e,t){return this._addListener(!1,e,t)}removeListener(e,t){this._removeListener(!1,e,t)}registerEvent(){let e=n(t=>this.addListener(e,t),"eventBinder");return e}emit(e,...t){if(this._eventListeners.has(e))for(let i of this._eventListeners.get(e))i(...t);if(this._internalEventListeners.has(e))for(let i of this._internalEventListeners.get(e))i(...t)}registerInternalEvent(){let e=n(t=>this.addInternalListener(e,t),"eventBinder");return e}addInternalListener(e,t){return this._addListener(!0,e,t)}removeInternalListener(e,t){this._removeListener(!0,e,t)}_addListener(e,t,i){let a=e?this._eventListeners:this._internalEventListeners;return a.has(t)?a.get(t).push(i):a.set(t,[i]),new KB.Listener(this,t,i,e)}_removeListener(e,t,i){let a=e?this._eventListeners:this._internalEventListeners;if(!t)a.clear();else if(typeof t=="object"){let o=t;this._removeListener(o._internal,o.event,o.listener)}else{let o=t;if(a.has(o))if(i){let s=a.get(o),u=0;for(;(u=s.indexOf(i))!==-1;)s.splice(u,1)}else a.delete(o)}}};po.EventEmitter=eh});var th=l(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.Listener=Vr.EventEmitter=void 0;var JB=v0();Object.defineProperty(Vr,"EventEmitter",{enumerable:!0,get:function(){return JB.EventEmitter}});var ZB=Xp();Object.defineProperty(Vr,"Listener",{enumerable:!0,get:function(){return ZB.Listener}})});var ho=l($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.accessTokenIsExpired=$r.getExpiryDateOfAccessToken=void 0;var rh=S(),YB=6e4;function w0(r){return(0,rh.mapNullable)(r.expiresIn,e=>r.obtainmentTimestamp+e*1e3-YB)}n(w0,"getExpiryMillis");function XB(r){return(0,rh.mapNullable)(w0(r),e=>new Date(e))}n(XB,"getExpiryDateOfAccessToken");$r.getExpiryDateOfAccessToken=XB;function eU(r){var e;return(e=(0,rh.mapNullable)(w0(r),t=>Date.now()>t))!==null&&e!==void 0?e:!1}n(eU,"accessTokenIsExpired");$r.accessTokenIsExpired=eU});var mo=l(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.InvalidTokenError=void 0;var tU=f(),ih=class extends tU.CustomError{static{n(this,"InvalidTokenError")}constructor(e){super("Invalid token supplied",e)}};fo.InvalidTokenError=ih});var _o=l(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.InvalidTokenTypeError=void 0;var rU=f(),nh=class extends rU.CustomError{static{n(this,"InvalidTokenTypeError")}};yo.InvalidTokenTypeError=nh});var x0=l(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.createRevokeTokenQuery=rt.createRefreshTokenQuery=rt.createGetAppTokenQuery=rt.createExchangeCodeQuery=void 0;function iU(r,e,t,i){return{grant_type:"authorization_code",client_id:r,client_secret:e,code:t,redirect_uri:i}}n(iU,"createExchangeCodeQuery");rt.createExchangeCodeQuery=iU;function nU(r,e){return{grant_type:"client_credentials",client_id:r,client_secret:e}}n(nU,"createGetAppTokenQuery");rt.createGetAppTokenQuery=nU;function aU(r,e,t){return{grant_type:"refresh_token",client_id:r,client_secret:e,refresh_token:t}}n(aU,"createRefreshTokenQuery");rt.createRefreshTokenQuery=aU;function oU(r,e){return{client_id:r,token:e}}n(oU,"createRevokeTokenQuery");rt.createRevokeTokenQuery=oU});var oh=l(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.TokenInfo=void 0;var sU=(y(),g(m)),uU=S(),nr=f(),ah=class extends nr.DataObject{static{n(this,"TokenInfo")}constructor(e){super(e),this._obtainmentDate=new Date}get clientId(){return this[nr.rawDataSymbol].client_id}get userId(){var e;return(e=this[nr.rawDataSymbol].user_id)!==null&&e!==void 0?e:null}get userName(){var e;return(e=this[nr.rawDataSymbol].login)!==null&&e!==void 0?e:null}get scopes(){return this[nr.rawDataSymbol].scopes}get expiryDate(){return(0,uU.mapNullable)(this[nr.rawDataSymbol].expires_in,e=>new Date(this._obtainmentDate.getTime()+e*1e3))}};ah=sU.__decorate([(0,nr.rtfm)("auth","TokenInfo","clientId")],ah);go.TokenInfo=ah});var Zi=l(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.loadAndCompareTokenInfo=G.compareScopeSets=G.compareScopes=G.getValidTokenFromProviderForIntent=G.getValidTokenFromProviderForUser=G.getTokenInfo=G.revokeToken=G.refreshUserToken=G.getAppToken=G.exchangeCode=void 0;var Wr=Q(),Ji=mo(),lU=_o(),bo=x0(),cU=oh();function sh(r){var e,t;return{accessToken:r.access_token,refreshToken:r.refresh_token||null,scope:(e=r.scope)!==null&&e!==void 0?e:[],expiresIn:(t=r.expires_in)!==null&&t!==void 0?t:null,obtainmentTimestamp:Date.now()}}n(sh,"createAccessTokenFromData");async function dU(r,e,t,i){return sh(await(0,Wr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,bo.createExchangeCodeQuery)(r,e,t,i)}))}n(dU,"exchangeCode");G.exchangeCode=dU;async function pU(r,e){return sh(await(0,Wr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,bo.createGetAppTokenQuery)(r,e)}))}n(pU,"getAppToken");G.getAppToken=pU;async function hU(r,e,t){return sh(await(0,Wr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,bo.createRefreshTokenQuery)(r,e,t)}))}n(hU,"refreshUserToken");G.refreshUserToken=hU;async function fU(r,e){await(0,Wr.callTwitchApi)({type:"auth",url:"revoke",method:"POST",query:(0,bo.createRevokeTokenQuery)(r,e)})}n(fU,"revokeToken");G.revokeToken=fU;async function zr(r,e){try{let t=await(0,Wr.callTwitchApi)({type:"auth",url:"validate"},e,r);return new cU.TokenInfo(t)}catch(t){throw t instanceof Wr.HttpStatusCodeError&&t.statusCode===401?new Ji.InvalidTokenError({cause:t}):t}}n(zr,"getTokenInfo");G.getTokenInfo=zr;async function mU(r,e,t,i){let a=null,o=!1;try{let s=await r.getAccessTokenForUser(e,t);if(s){o=!0;let u=await zr(s.accessToken);return{accessToken:s,tokenInfo:u}}}catch(s){s instanceof Ji.InvalidTokenError?a=s:i?.error(`Retrieving an access token failed: ${s.message}`)}if(o&&(i?.warn("No valid token available; trying to refresh"),r.refreshAccessTokenForUser))try{let s=await r.refreshAccessTokenForUser(e),u=await zr(s.accessToken);return{accessToken:s,tokenInfo:u}}catch(s){s instanceof Ji.InvalidTokenError?a=s:i?.error(`Refreshing the access token failed: ${s.message}`)}throw a??new Error("Could not retrieve a valid token")}n(mU,"getValidTokenFromProviderForUser");G.getValidTokenFromProviderForUser=mU;async function yU(r,e,t,i){let a=null,o=!1;if(!r.getAccessTokenForIntent)throw new lU.InvalidTokenTypeError("This call requires an AuthProvider that supports intents.\nPlease use an auth provider that does, such as `RefreshingAuthProvider`.");try{let s=await r.getAccessTokenForIntent(e,t);if(s){o=!0;let u=await zr(s.accessToken);return{accessToken:s,tokenInfo:u}}}catch(s){s instanceof Ji.InvalidTokenError?a=s:i?.error(`Retrieving an access token failed: ${s.message}`)}if(o&&(i?.warn("No valid token available; trying to refresh"),r.refreshAccessTokenForIntent))try{let s=await r.refreshAccessTokenForIntent(e),u=await zr(s.accessToken);return{accessToken:s,tokenInfo:u}}catch(s){s instanceof Ji.InvalidTokenError?a=s:i?.error(`Refreshing the access token failed: ${s.message}`)}throw a??new Error("Could not retrieve a valid token")}n(yU,"getValidTokenFromProviderForIntent");G.getValidTokenFromProviderForIntent=yU;var _U=new Map([["channel_commercial",["channel:edit:commercial"]],["channel_editor",["channel:manage:broadcast"]],["channel_read",["channel:read:stream_key"]],["channel_subscriptions",["channel:read:subscriptions"]],["user_blocks_read",["user:read:blocked_users"]],["user_blocks_edit",["user:manage:blocked_users"]],["user_follows_edit",["user:edit:follows"]],["user_read",["user:read:email"]],["user_subscriptions",["user:read:subscriptions"]],["user:edit:broadcast",["channel:manage:broadcast","channel:manage:extensions"]]]);function S0(r,e){if(e?.length){let t=new Set(r.flatMap(i=>{var a;return[i,...(a=_U.get(i))!==null&&a!==void 0?a:[]]}));if(e.every(i=>!t.has(i))){let i=e.join(", ");throw new Error(`This token does not have any of the requested scopes (${i}) and can not be upgraded.
|
|
14
|
+
If you need dynamically upgrading scopes, please implement the AuthProvider interface accordingly:
|
|
15
|
+
|
|
16
|
+
https://twurple.js.org/reference/auth/interfaces/AuthProvider.html`)}}}n(S0,"compareScopes");G.compareScopes=S0;function q0(r,e){for(let t of e)S0(r,t)}n(q0,"compareScopeSets");G.compareScopeSets=q0;async function gU(r,e,t,i,a){if(a?.length||!t){let o=await zr(e,r);if(!o.userId)throw new Error("Trying to use an app access token as a user access token");let s=i??o.scopes;return a&&q0(s,a.filter(u=>!!u)),[s,o.userId]}return[i,t]}n(gU,"loadAndCompareTokenInfo");G.loadAndCompareTokenInfo=gU});var wo=l(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.TokenFetcher=void 0;var P0=S(),uh=class{static{n(this,"TokenFetcher")}constructor(e){this._newTokenScopeSets=[],this._newTokenPromise=null,this._queuedScopeSets=[],this._queueExecutor=null,this._queuePromise=null,this._executor=e}async fetch(...e){var t;let i=e.filter(u=>!!u);if(this._newTokenPromise){if(!i.length)return await this._newTokenPromise;if(this._queueExecutor?this._queuedScopeSets.push(...i):this._queuedScopeSets=[...i],!this._queuePromise){let{promise:u,resolve:c,reject:h}=(0,P0.promiseWithResolvers)();this._queuePromise=u,this._queueExecutor=async()=>{var d;if(this._queuePromise){this._newTokenScopeSets=this._queuedScopeSets,this._queuedScopeSets=[],this._newTokenPromise=this._queuePromise,this._queuePromise=null,this._queueExecutor=null;try{c(await this._executor(this._newTokenScopeSets))}catch(_){h(_)}finally{this._newTokenPromise=null,this._newTokenScopeSets=[],(d=this._queueExecutor)===null||d===void 0||d.call(this)}}}}return await this._queuePromise}this._newTokenScopeSets=[...i];let{promise:a,resolve:o,reject:s}=(0,P0.promiseWithResolvers)();this._newTokenPromise=a;try{o(await this._executor(this._newTokenScopeSets))}catch(u){s(u)}finally{this._newTokenPromise=null,this._newTokenScopeSets=[],(t=this._queueExecutor)===null||t===void 0||t.call(this)}return await a}};vo.TokenFetcher=uh});var C0=l(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.AppTokenAuthProvider=void 0;var xo=(y(),g(m)),lh=S(),bU=f(),vU=ho(),wU=Zi(),xU=wo(),Kr=class{static{n(this,"AppTokenAuthProvider")}constructor(e,t,i=[]){this._clientId=e,this._clientSecret=t,this._impliedScopes=i,this._fetcher=new xU.TokenFetcher(async a=>await this._fetch(a))}get clientId(){return this._clientId}get currentScopes(){return this._impliedScopes}async getAccessTokenForUser(){throw new Error("Can not get user access token for AppTokenAuthProvider")}getCurrentScopesForUser(){throw new Error("Can not get user scopes for AppTokenAuthProvider")}async getAnyAccessToken(){return await this._fetcher.fetch()}async getAppAccessToken(e=!1){return e&&(this._token=void 0),await this._fetcher.fetch()}async _fetch(e){if(e.length>0)for(let t of e)if(this._impliedScopes.length){if(t.every(i=>!this._impliedScopes.includes(i)))throw new Error(`One of the scopes ${t.join(", ")} requested but only the scope ${this._impliedScopes.join(", ")} is implied`)}else throw new Error(`One of the scopes ${t.join(", ")} requested but the client credentials flow does not support scopes`);return!this._token||(0,vU.accessTokenIsExpired)(this._token)?this._token=await(0,wU.getAppToken)(this._clientId,this._clientSecret):this._token}};xo.__decorate([(0,lh.Enumerable)(!1)],Kr.prototype,"_clientSecret",void 0);xo.__decorate([(0,lh.Enumerable)(!1)],Kr.prototype,"_token",void 0);xo.__decorate([(0,lh.Enumerable)(!1)],Kr.prototype,"_fetcher",void 0);Kr=xo.__decorate([(0,bU.rtfm)("auth","AppTokenAuthProvider","clientId")],Kr);So.AppTokenAuthProvider=Kr});var dh=l(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.CachedRefreshFailureError=void 0;var SU=f(),ch=class extends SU.CustomError{static{n(this,"CachedRefreshFailureError")}constructor(e){super(`The user context for the user ${e} has been disabled.
|
|
17
|
+
This happened because the access token became invalid (e.g. by expiry) and refreshing it failed (e.g. because the account's password was changed).
|
|
18
|
+
|
|
19
|
+
Use .addUser(), .addUserForToken() or .addUserForCode() for the same user context to re-enable the user with a new, valid token.`),this.userId=e}};qo.CachedRefreshFailureError=ch});var hh=l(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.IntermediateUserRemovalError=void 0;var qU=f(),ph=class extends qU.CustomError{static{n(this,"IntermediateUserRemovalError")}constructor(e){super(`User ${e} was removed while trying to fetch a token.
|
|
20
|
+
|
|
21
|
+
Make sure you're not executing any actions when you want to remove a user.`),this.userId=e}};Po.IntermediateUserRemovalError=ph});var mh=l(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.UnknownIntentError=void 0;var PU=f(),fh=class extends PU.CustomError{static{n(this,"UnknownIntentError")}constructor(e){super(`Unknown intent: ${e}`),this.intent=e}};Co.UnknownIntentError=fh});var A0=l(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.RefreshingAuthProvider=void 0;var Jr=(y(),g(m)),Yi=S(),CU=th(),je=f(),yh=ho(),H0=dh(),HU=hh(),_h=mo(),EU=_o(),AU=mh(),mt=Zi(),E0=wo(),Bt=class extends CU.EventEmitter{static{n(this,"RefreshingAuthProvider")}constructor(e){var t;super(),this._userAccessTokens=new Map,this._userTokenFetchers=new Map,this._intentToUserId=new Map,this._userIdToIntents=new Map,this._cachedRefreshFailures=new Set,this.onRefresh=this.registerEvent(),this.onRefreshFailure=this.registerEvent(),this._clientId=e.clientId,this._clientSecret=e.clientSecret,this._redirectUri=e.redirectUri,this._appImpliedScopes=(t=e.appImpliedScopes)!==null&&t!==void 0?t:[],this._appTokenFetcher=new E0.TokenFetcher(async i=>await this._fetchAppToken(i))}addUser(e,t,i){let a=(0,je.extractUserId)(e);if(!t.refreshToken)throw new Error(`Trying to add user ${a} without refresh token`);this._cachedRefreshFailures.delete(a),this._userAccessTokens.set(a,{...t,userId:a}),this._userTokenFetchers.has(a)||this._userTokenFetchers.set(a,new E0.TokenFetcher(async o=>await this._fetchUserToken(a,o))),i&&this.addIntentsToUser(e,i)}async addUserForToken(e,t){let i=null;if(e.accessToken&&!(0,yh.accessTokenIsExpired)(e))try{let u=await(0,mt.getTokenInfo)(e.accessToken);i=[e,u]}catch(u){if(!(u instanceof _h.InvalidTokenError))throw u}if(!i){if(!e.refreshToken)throw new _h.InvalidTokenError;let u=await(0,mt.refreshUserToken)(this._clientId,this._clientSecret,e.refreshToken),c=await(0,mt.getTokenInfo)(u.accessToken);this.emit(this.onRefresh,c.userId,u),i=[u,c]}let[a,o]=i;if(!o.userId)throw new EU.InvalidTokenTypeError("Could not determine a user ID for your token; you might be trying to disguise an app token as a user token.");let s=a.scope?a:{...a,scope:o.scopes};return this.addUser(o.userId,s,t),o.userId}async addUserForCode(e,t){if(!this._redirectUri)throw new Error("This method requires you to pass a `redirectUri` as a configuration property");let i=await(0,mt.exchangeCode)(this._clientId,this._clientSecret,e,this._redirectUri);return await this.addUserForToken(i,t)}hasUser(e){return this._userTokenFetchers.has((0,je.extractUserId)(e))}removeUser(e){let t=(0,je.extractUserId)(e);if(this._userIdToIntents.has(t)){let i=this._userIdToIntents.get(t);for(let a of i)this._intentToUserId.delete(a);this._userIdToIntents.delete(t)}this._userAccessTokens.delete(t),this._userTokenFetchers.delete(t),this._cachedRefreshFailures.delete(t)}addIntentsToUser(e,t){let i=(0,je.extractUserId)(e);if(!this._userAccessTokens.has(i))throw new Error("Trying to add intents to a user that was not added to this provider");for(let a of t)this._intentToUserId.has(a)&&this._userIdToIntents.get(this._intentToUserId.get(a)).delete(a),this._intentToUserId.set(a,i),this._userIdToIntents.has(i)?this._userIdToIntents.get(i).add(a):this._userIdToIntents.set(i,new Set([a]))}getIntentsForUser(e){let t=(0,je.extractUserId)(e);return this._userIdToIntents.has(t)?Array.from(this._userIdToIntents.get(t)):[]}removeIntents(e){var t;for(let i of e)if(this._intentToUserId.has(i)){let a=this._intentToUserId.get(i);(t=this._userIdToIntents.get(a))===null||t===void 0||t.delete(i),this._intentToUserId.delete(i)}}async refreshAccessTokenForUser(e){let t=(0,je.extractUserId)(e);if(this._cachedRefreshFailures.has(t))throw new H0.CachedRefreshFailureError(t);let i=this._userAccessTokens.get(t);if(!i)throw new Error("Trying to refresh token for user that was not added to the provider");let a=await this._refreshUserTokenWithCallback(t,i.refreshToken);return this._checkIntermediateUserRemoval(t),this._userAccessTokens.set(t,{...a,userId:t}),this.emit(this.onRefresh,t,a),{...a,userId:t}}async refreshAccessTokenForIntent(e){if(!this._intentToUserId.has(e))throw new AU.UnknownIntentError(e);let t=this._intentToUserId.get(e);return await this.refreshAccessTokenForUser(t)}get clientId(){return this._clientId}getCurrentScopesForUser(e){var t;let i=this._userAccessTokens.get((0,je.extractUserId)(e));if(!i)throw new Error("Trying to get scopes for user that was not added to the provider");return(t=i.scope)!==null&&t!==void 0?t:[]}async getAccessTokenForUser(e,...t){let i=(0,je.extractUserId)(e),a=this._userTokenFetchers.get(i);if(!a)return null;if(this._cachedRefreshFailures.has(i))throw new H0.CachedRefreshFailureError(i);return await a.fetch(...t)}async getAccessTokenForIntent(e,...t){if(!this._intentToUserId.has(e))return null;let i=this._intentToUserId.get(e),a=await this.getAccessTokenForUser(i,...t);if(!a)throw new je.HellFreezesOverError(`Found intent ${e} corresponding to user ID ${i} but no token was found`);return{...a,userId:i}}async getAnyAccessToken(e){if(e){let t=(0,je.extractUserId)(e);if(this._userAccessTokens.has(t)){let i=await this.getAccessTokenForUser(t);if(!i)throw new je.HellFreezesOverError(`Token for user ID ${t} exists but nothing was returned by getAccessTokenForUser`);return{...i,userId:t}}}return await this.getAppAccessToken()}async getAppAccessToken(e=!1){return e&&(this._appAccessToken=void 0),await this._appTokenFetcher.fetch(...this._appImpliedScopes.map(t=>[t]))}_checkIntermediateUserRemoval(e){if(!this._userTokenFetchers.has(e))throw this._cachedRefreshFailures.delete(e),new HU.IntermediateUserRemovalError(e)}async _fetchUserToken(e,t){let i=this._userAccessTokens.get(e);if(!i)throw new Error("Trying to get token for user that was not added to the provider");if(i.accessToken&&!(0,yh.accessTokenIsExpired)(i))try{if(i.scope)return(0,mt.compareScopeSets)(i.scope,t),i;let[o=[]]=await(0,mt.loadAndCompareTokenInfo)(this._clientId,i.accessToken,e,i.scope,t),s={...i,scope:o};return this._checkIntermediateUserRemoval(e),this._userAccessTokens.set(e,s),s}catch(o){if(!(o instanceof _h.InvalidTokenError))throw o}this._checkIntermediateUserRemoval(e);let a=await this.refreshAccessTokenForUser(e);return(0,mt.compareScopeSets)(a.scope,t),a}async _refreshUserTokenWithCallback(e,t){try{return await(0,mt.refreshUserToken)(this.clientId,this._clientSecret,t)}catch(i){throw this._cachedRefreshFailures.add(e),this.emit(this.onRefreshFailure,e),i}}async _fetchAppToken(e){if(e.length>0)for(let t of e)if(this._appImpliedScopes.length){if(t.every(i=>!this._appImpliedScopes.includes(i)))throw new Error(`One of the scopes ${t.join(", ")} requested but only the scope ${this._appImpliedScopes.join(", ")} is implied`)}else throw new Error(`One of the scopes ${t.join(", ")} requested but the client credentials flow does not support scopes`);return!this._appAccessToken||(0,yh.accessTokenIsExpired)(this._appAccessToken)?await this._refreshAppToken():this._appAccessToken}async _refreshAppToken(){return this._appAccessToken=await(0,mt.getAppToken)(this._clientId,this._clientSecret)}};Jr.__decorate([(0,Yi.Enumerable)(!1)],Bt.prototype,"_clientSecret",void 0);Jr.__decorate([(0,Yi.Enumerable)(!1)],Bt.prototype,"_userAccessTokens",void 0);Jr.__decorate([(0,Yi.Enumerable)(!1)],Bt.prototype,"_userTokenFetchers",void 0);Jr.__decorate([(0,Yi.Enumerable)(!1)],Bt.prototype,"_appAccessToken",void 0);Jr.__decorate([(0,Yi.Enumerable)(!1)],Bt.prototype,"_appTokenFetcher",void 0);Bt=Jr.__decorate([(0,je.rtfm)("auth","RefreshingAuthProvider","clientId")],Bt);Ho.RefreshingAuthProvider=Bt});var I0=l(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.StaticAuthProvider=void 0;var gh=(y(),g(m)),T0=S(),TU=f(),IU=Zi(),Xi=class{static{n(this,"StaticAuthProvider")}constructor(e,t,i){this._clientId=e||"",this._accessToken=typeof t=="string"?{accessToken:t,refreshToken:null,scope:i??[],expiresIn:null,obtainmentTimestamp:Date.now()}:t,this._scopes=i}get clientId(){return this._clientId}async getAccessTokenForUser(e,...t){return await this._getAccessToken(t)}async getAccessTokenForIntent(e,...t){return await this._getAccessToken(t)}async getAnyAccessToken(){return await this._getAccessToken()}getCurrentScopesForUser(){var e;return(e=this._scopes)!==null&&e!==void 0?e:[]}async _getAccessToken(e){let[t,i]=await(0,IU.loadAndCompareTokenInfo)(this._clientId,this._accessToken.accessToken,this._userId,this._scopes,e);return this._scopes=t,this._userId=i,{...this._accessToken,userId:i}}};gh.__decorate([(0,T0.Enumerable)(!1)],Xi.prototype,"_clientId",void 0);gh.__decorate([(0,T0.Enumerable)(!1)],Xi.prototype,"_accessToken",void 0);Xi=gh.__decorate([(0,TU.rtfm)("auth","StaticAuthProvider","clientId")],Xi);Eo.StaticAuthProvider=Xi});var bh=l(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.UnknownIntentError=E.InvalidTokenTypeError=E.InvalidTokenError=E.IntermediateUserRemovalError=E.CachedRefreshFailureError=E.StaticAuthProvider=E.RefreshingAuthProvider=E.AppTokenAuthProvider=E.TokenInfo=E.TokenFetcher=E.revokeToken=E.refreshUserToken=E.getValidTokenFromProviderForIntent=E.getValidTokenFromProviderForUser=E.getTokenInfo=E.getAppToken=E.exchangeCode=E.getExpiryDateOfAccessToken=E.accessTokenIsExpired=void 0;var R0=ho();Object.defineProperty(E,"accessTokenIsExpired",{enumerable:!0,get:function(){return R0.accessTokenIsExpired}});Object.defineProperty(E,"getExpiryDateOfAccessToken",{enumerable:!0,get:function(){return R0.getExpiryDateOfAccessToken}});var ar=Zi();Object.defineProperty(E,"exchangeCode",{enumerable:!0,get:function(){return ar.exchangeCode}});Object.defineProperty(E,"getAppToken",{enumerable:!0,get:function(){return ar.getAppToken}});Object.defineProperty(E,"getTokenInfo",{enumerable:!0,get:function(){return ar.getTokenInfo}});Object.defineProperty(E,"getValidTokenFromProviderForUser",{enumerable:!0,get:function(){return ar.getValidTokenFromProviderForUser}});Object.defineProperty(E,"getValidTokenFromProviderForIntent",{enumerable:!0,get:function(){return ar.getValidTokenFromProviderForIntent}});Object.defineProperty(E,"refreshUserToken",{enumerable:!0,get:function(){return ar.refreshUserToken}});Object.defineProperty(E,"revokeToken",{enumerable:!0,get:function(){return ar.revokeToken}});var RU=wo();Object.defineProperty(E,"TokenFetcher",{enumerable:!0,get:function(){return RU.TokenFetcher}});var DU=oh();Object.defineProperty(E,"TokenInfo",{enumerable:!0,get:function(){return DU.TokenInfo}});var OU=C0();Object.defineProperty(E,"AppTokenAuthProvider",{enumerable:!0,get:function(){return OU.AppTokenAuthProvider}});var BU=A0();Object.defineProperty(E,"RefreshingAuthProvider",{enumerable:!0,get:function(){return BU.RefreshingAuthProvider}});var UU=I0();Object.defineProperty(E,"StaticAuthProvider",{enumerable:!0,get:function(){return UU.StaticAuthProvider}});var jU=dh();Object.defineProperty(E,"CachedRefreshFailureError",{enumerable:!0,get:function(){return jU.CachedRefreshFailureError}});var kU=hh();Object.defineProperty(E,"IntermediateUserRemovalError",{enumerable:!0,get:function(){return kU.IntermediateUserRemovalError}});var LU=mo();Object.defineProperty(E,"InvalidTokenError",{enumerable:!0,get:function(){return LU.InvalidTokenError}});var MU=_o();Object.defineProperty(E,"InvalidTokenTypeError",{enumerable:!0,get:function(){return MU.InvalidTokenTypeError}});var FU=mh();Object.defineProperty(E,"UnknownIntentError",{enumerable:!0,get:function(){return FU.UnknownIntentError}})});var O0=l((G8,D0)=>{function ke(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}n(ke,"RetryOperation");D0.exports=ke;ke.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ke.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ke.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},t),this._options.unref&&this._timer.unref(),!0};ke.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};ke.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ke.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ke.prototype.start=ke.prototype.try;ke.prototype.errors=function(){return this._errors};ke.prototype.attempts=function(){return this._attempts};ke.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,i=0;i<this._errors.length;i++){var a=this._errors[i],o=a.message,s=(r[o]||0)+1;r[o]=s,s>=t&&(e=a,t=s)}return e}});var B0=l(or=>{var NU=O0();or.operation=function(r){var e=or.timeouts(r);return new NU(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};or.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],a=0;a<e.retries;a++)i.push(this.createTimeout(a,e));return r&&r.forever&&!i.length&&i.push(this.createTimeout(a,e)),i.sort(function(o,s){return o-s}),i};or.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,i=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return i=Math.min(i,e.maxTimeout),i};or.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var i in r)typeof r[i]=="function"&&t.push(i)}for(var a=0;a<t.length;a++){var o=t[a],s=r[o];r[o]=n(function(c){var h=or.operation(e),d=Array.prototype.slice.call(arguments,1),_=d.pop();d.push(function(b){h.retry(b)||(b&&(arguments[0]=h.mainError()),_.apply(this,arguments))}),h.attempt(function(){c.apply(r,d)})},"retryWrapper").bind(r,s),r[o].options=e}}});var j0=l((z8,U0)=>{U0.exports=B0()});var k0=l(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.createBitsLeaderboardQuery=void 0;function QU(r={}){let{count:e=10,period:t="all",startDate:i,contextUserId:a}=r;return{count:e.toString(),period:t,started_at:i?.toISOString(),user_id:a}}n(QU,"createBitsLeaderboardQuery");Ao.createBitsLeaderboardQuery=QU});var L=l(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.BaseApi=void 0;var GU=(y(),g(m)),VU=S(),To=class{static{n(this,"BaseApi")}constructor(e){this._client=e}_getUserContextIdWithDefault(e){var t;return(t=this._client._getUserIdFromRequestContext(e))!==null&&t!==void 0?t:e}};GU.__decorate([(0,VU.Enumerable)(!1)],To.prototype,"_client",void 0);Io.BaseApi=To});var vh=l(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.HelixBitsLeaderboardEntry=void 0;var L0=(y(),g(m)),$U=S(),yt=f(),Ro=class extends yt.DataObject{static{n(this,"HelixBitsLeaderboardEntry")}constructor(e,t){super(e),this._client=t}get userId(){return this[yt.rawDataSymbol].user_id}get userName(){return this[yt.rawDataSymbol].user_login}get userDisplayName(){return this[yt.rawDataSymbol].user_name}get rank(){return this[yt.rawDataSymbol].rank}get amount(){return this[yt.rawDataSymbol].score}async getUser(){return(0,yt.checkRelationAssertion)(await this._client.users.getUserById(this[yt.rawDataSymbol].user_id))}};L0.__decorate([(0,$U.Enumerable)(!1)],Ro.prototype,"_client",void 0);Ro=L0.__decorate([(0,yt.rtfm)("api","HelixBitsLeaderboardEntry","userId")],Ro);Do.HelixBitsLeaderboardEntry=Ro});var xh=l(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.HelixBitsLeaderboard=void 0;var wh=(y(),g(m)),M0=Ki(),WU=S(),Oo=f(),zU=vh(),en=class extends Oo.DataObject{static{n(this,"HelixBitsLeaderboard")}constructor(e,t){super(e),this._client=t}get entries(){return this[Oo.rawDataSymbol].data.map(e=>new zU.HelixBitsLeaderboardEntry(e,this._client))}get totalCount(){return this[Oo.rawDataSymbol].total}};wh.__decorate([(0,WU.Enumerable)(!1)],en.prototype,"_client",void 0);wh.__decorate([(0,M0.CachedGetter)()],en.prototype,"entries",null);en=wh.__decorate([M0.Cacheable,(0,Oo.rtfm)("api","HelixBitsLeaderboard")],en);Bo.HelixBitsLeaderboard=en});var qh=l(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.HelixCheermoteList=void 0;var KU=(y(),g(m)),JU=S(),tn=f(),Sh=class extends tn.DataObject{static{n(this,"HelixCheermoteList")}constructor(e){super((0,JU.indexBy)(e,t=>t.prefix.toLowerCase()))}getCheermoteDisplayInfo(e,t,i){e=e.toLowerCase();let{background:a,state:o,scale:s}=i,c=this[tn.rawDataSymbol][e].tiers.sort((h,d)=>d.min_bits-h.min_bits).find(h=>h.min_bits<=t);if(!c)throw new tn.HellFreezesOverError(`Cheermote "${e}" does not have an applicable tier for ${t} bits`);return{url:c.images[a][o][s],color:c.color}}getPossibleNames(){return Object.keys(this[tn.rawDataSymbol])}};Sh=KU.__decorate([(0,tn.rtfm)("api","HelixCheermoteList")],Sh);Uo.HelixCheermoteList=Sh});var Hh=l(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.HelixBitsApi=void 0;var ZU=(y(),g(m)),F0=S(),YU=Q(),Ph=f(),XU=k0(),ej=L(),tj=xh(),rj=qh(),Ch=class extends ej.BaseApi{static{n(this,"HelixBitsApi")}async getLeaderboard(e,t={}){let i=await this._client.callApi({type:"helix",url:"bits/leaderboard",userId:(0,Ph.extractUserId)(e),scopes:["bits:read"],query:(0,XU.createBitsLeaderboardQuery)(t)});return new tj.HelixBitsLeaderboard(i,this._client)}async getCheermotes(e){let t=await this._client.callApi({type:"helix",url:"bits/cheermotes",userId:(0,F0.mapOptional)(e,Ph.extractUserId),query:(0,F0.mapOptional)(e,YU.createBroadcasterQuery)});return new rj.HelixCheermoteList(t.data)}};Ch=ZU.__decorate([(0,Ph.rtfm)("api","HelixBitsApi")],Ch);jo.HelixBitsApi=Ch});var Q0=l(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.createFollowedChannelQuery=Le.createChannelFollowerQuery=Le.createChannelVipUpdateQuery=Le.createChannelCommercialBody=Le.createChannelUpdateBody=void 0;var N0=S(),sr=f();function ij(r){var e;return{game_id:r.gameId,broadcaster_language:r.language,title:r.title,delay:(e=r.delay)===null||e===void 0?void 0:e.toString(),tags:r.tags,content_classification_labels:r.contentClassificationLabels,is_branded_content:r.isBrandedContent}}n(ij,"createChannelUpdateBody");Le.createChannelUpdateBody=ij;function nj(r,e){return{broadcaster_id:(0,sr.extractUserId)(r),length:e}}n(nj,"createChannelCommercialBody");Le.createChannelCommercialBody=nj;function aj(r,e){return{broadcaster_id:(0,sr.extractUserId)(r),user_id:(0,sr.extractUserId)(e)}}n(aj,"createChannelVipUpdateQuery");Le.createChannelVipUpdateQuery=aj;function oj(r,e){return{broadcaster_id:(0,sr.extractUserId)(r),user_id:(0,N0.mapOptional)(e,sr.extractUserId)}}n(oj,"createChannelFollowerQuery");Le.createChannelFollowerQuery=oj;function sj(r,e){return{broadcaster_id:(0,N0.mapOptional)(e,sr.extractUserId),user_id:(0,sr.extractUserId)(r)}}n(sj,"createFollowedChannelQuery");Le.createFollowedChannelQuery=sj});var Ee=l(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.createChannelUsersCheckQuery=Me.createGetByIdsQuery=Me.createModeratorActionQuery=Me.createUserQuery=Me.createSingleKeyQuery=void 0;var ko=f();function uj(r,e){return{[r]:e}}n(uj,"createSingleKeyQuery");Me.createSingleKeyQuery=uj;function lj(r){return{user_id:(0,ko.extractUserId)(r)}}n(lj,"createUserQuery");Me.createUserQuery=lj;function cj(r,e){return{broadcaster_id:r,moderator_id:e}}n(cj,"createModeratorActionQuery");Me.createModeratorActionQuery=cj;function dj(r,e){return{broadcaster_id:(0,ko.extractUserId)(r),id:e}}n(dj,"createGetByIdsQuery");Me.createGetByIdsQuery=dj;function pj(r,e){return{broadcaster_id:(0,ko.extractUserId)(r),user_id:e.map(ko.extractUserId)}}n(pj,"createChannelUsersCheckQuery");Me.createChannelUsersCheckQuery=pj});var Fo=l(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.HelixUserRelation=void 0;var G0=(y(),g(m)),hj=S(),ur=f(),Lo=class extends ur.DataObject{static{n(this,"HelixUserRelation")}constructor(e,t){super(e),this._client=t}get id(){return this[ur.rawDataSymbol].user_id}get name(){return this[ur.rawDataSymbol].user_login}get displayName(){return this[ur.rawDataSymbol].user_name}async getUser(){return(0,ur.checkRelationAssertion)(await this._client.users.getUserById(this[ur.rawDataSymbol].user_id))}};G0.__decorate([(0,hj.Enumerable)(!1)],Lo.prototype,"_client",void 0);Lo=G0.__decorate([(0,ur.rtfm)("api","HelixUserRelation","id")],Lo);Mo.HelixUserRelation=Lo});var Ut=l(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.HelixRequestBatcher=void 0;var fj=(y(),g(m)),Eh=S(),No=class{static{n(this,"HelixRequestBatcher")}constructor(e,t,i,a,o,s=100){this._callOptions=e,this._queryParamName=t,this._matchKey=i,this._mapper=o,this._limitPerRequest=s,this._requestedIds=[],this._requestResolversById=new Map,this._waitTimer=null,this._client=a,this._delay=a._batchDelay}async request(e){let{promise:t,resolve:i,reject:a}=(0,Eh.promiseWithResolvers)();return this._requestedIds.includes(e)||this._requestedIds.push(e),this._requestResolversById.has(e)?this._requestResolversById.get(e).push({resolve:i,reject:a}):this._requestResolversById.set(e,[{resolve:i,reject:a}]),this._waitTimer&&(clearTimeout(this._waitTimer),this._waitTimer=null),this._requestedIds.length>=this._limitPerRequest?this._handleBatch(this._requestedIds.splice(0,this._limitPerRequest)):this._waitTimer=setTimeout(()=>{this._handleBatch(this._requestedIds.splice(0,this._limitPerRequest))},this._delay),await t}async _handleBatch(e){var t;try{let{data:i}=await this._doRequest(e),a=(0,Eh.indexBy)(i,this._matchKey);for(let o of e){for(let s of(t=this._requestResolversById.get(o))!==null&&t!==void 0?t:[])Object.prototype.hasOwnProperty.call(a,o)?s.resolve(this._mapper(a[o])):s.resolve(null);this._requestResolversById.delete(o)}}catch{await Promise.all(e.map(async a=>{var o,s;try{let u=await this._doRequest([a]);for(let c of(o=this._requestResolversById.get(a))!==null&&o!==void 0?o:[])c.resolve(u.data.length?this._mapper(u.data[0]):null)}catch(u){for(let c of(s=this._requestResolversById.get(a))!==null&&s!==void 0?s:[])c.reject(u)}this._requestResolversById.delete(a)}))}}async _doRequest(e){return await this._client.callApi({type:"helix",...this._callOptions,query:{...this._callOptions.query,[this._queryParamName]:e}})}};fj.__decorate([(0,Eh.Enumerable)(!1)],No.prototype,"_client",void 0);Qo.HelixRequestBatcher=No});var ne=l(Vo=>{"use strict";var Ah;Object.defineProperty(Vo,"__esModule",{value:!0});Vo.HelixPaginatedRequest=void 0;var V0=(y(),g(m)),mj=S(),yj=f();Object.prototype.hasOwnProperty.call(Symbol,"asyncIterator")||(Symbol.asyncIterator=(Ah=Symbol.asyncIterator)!==null&&Ah!==void 0?Ah:Symbol.for("Symbol.asyncIterator"));var Go=class{static{n(this,"HelixPaginatedRequest")}constructor(e,t,i,a=100){this._callOptions=e,this._mapper=i,this._limitPerPage=a,this._isFinished=!1,this._client=t}get current(){var e;return(e=this._currentData)===null||e===void 0?void 0:e.data}async getNext(){var e;if(this._isFinished)return[];let t=await this._fetchData();return!((e=t.data)===null||e===void 0)&&e.length?this._processResult(t):(this._isFinished=!0,[])}async getAll(){this.reset();let e=[];do{let t=await this.getNext();if(!t.length)break;e.push(...t)}while(this._currentCursor);return this.reset(),e}get currentCursor(){return this._currentCursor}reset(){this._currentCursor=void 0,this._isFinished=!1,this._currentData=void 0}async*[Symbol.asyncIterator](){for(this.reset();;){let e=await this.getNext();if(!e.length)break;yield*e[Symbol.iterator]()}}async _fetchData(e={}){return await this._client.callApi({type:"helix",...this._callOptions,...e,query:{...this._callOptions.query,after:this._currentCursor,first:this._limitPerPage.toString(),...e.query}})}_processResult(e){return this._currentCursor=e.pagination?e.pagination.cursor:void 0,this._currentCursor===void 0&&(this._isFinished=!0),this._currentData=e,e.data.reduce((t,i)=>{let a=this._mapper(i);return Array.isArray(a)?[...t,...a]:[...t,a]},[])}};V0.__decorate([(0,mj.Enumerable)(!1)],Go.prototype,"_client",void 0);Go=V0.__decorate([(0,yj.rtfm)("api","HelixPaginatedRequest")],Go);Vo.HelixPaginatedRequest=Go});var Zr=l($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.HelixPaginatedRequestWithTotal=void 0;var _j=(y(),g(m)),gj=f(),bj=ne(),Th=class extends bj.HelixPaginatedRequest{static{n(this,"HelixPaginatedRequestWithTotal")}async getTotalCount(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).total}};Th=_j.__decorate([(0,gj.rtfm)("api","HelixPaginatedRequestWithTotal")],Th);$o.HelixPaginatedRequestWithTotal=Th});var X=l(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.createPaginatedResultWithTotal=Yr.createPaginatedResult=void 0;function vj(r,e,t){var i;let a;return{get data(){var o,s;return a??(a=(s=(o=r.data)===null||o===void 0?void 0:o.map(u=>new e(u,t)))!==null&&s!==void 0?s:[])},cursor:(i=r.pagination)===null||i===void 0?void 0:i.cursor}}n(vj,"createPaginatedResult");Yr.createPaginatedResult=vj;function wj(r,e,t){let i;return{get data(){var a,o;return i??(i=(o=(a=r.data)===null||a===void 0?void 0:a.map(s=>new e(s,t)))!==null&&o!==void 0?o:[])},cursor:r.pagination.cursor,total:r.total}}n(wj,"createPaginatedResultWithTotal");Yr.createPaginatedResultWithTotal=wj});var Z=l(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.createPaginationQuery=void 0;function xj({after:r,before:e,limit:t}={}){return{after:r,before:e,first:t?.toString()}}n(xj,"createPaginationQuery");Wo.createPaginationQuery=xj});var Ih=l(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.HelixChannel=void 0;var $0=(y(),g(m)),Sj=S(),ae=f(),zo=class extends ae.DataObject{static{n(this,"HelixChannel")}constructor(e,t){super(e),this._client=t}get id(){return this[ae.rawDataSymbol].broadcaster_id}get name(){return this[ae.rawDataSymbol].broadcaster_login}get displayName(){return this[ae.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,ae.checkRelationAssertion)(await this._client.users.getUserById(this[ae.rawDataSymbol].broadcaster_id))}get language(){return this[ae.rawDataSymbol].broadcaster_language}get gameId(){return this[ae.rawDataSymbol].game_id}get gameName(){return this[ae.rawDataSymbol].game_name}async getGame(){return this[ae.rawDataSymbol].game_id?(0,ae.checkRelationAssertion)(await this._client.games.getGameById(this[ae.rawDataSymbol].game_id)):null}get title(){return this[ae.rawDataSymbol].title}get delay(){return this[ae.rawDataSymbol].delay}get tags(){return this[ae.rawDataSymbol].tags}get contentClassificationLabels(){return this[ae.rawDataSymbol].content_classification_labels}get isBrandedContent(){return this[ae.rawDataSymbol].is_branded_content}};$0.__decorate([(0,Sj.Enumerable)(!1)],zo.prototype,"_client",void 0);zo=$0.__decorate([(0,ae.rtfm)("api","HelixChannel","id")],zo);Ko.HelixChannel=zo});var Rh=l(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.HelixChannelEditor=void 0;var W0=(y(),g(m)),qj=S(),lr=f(),Jo=class extends lr.DataObject{static{n(this,"HelixChannelEditor")}constructor(e,t){super(e),this._client=t}get userId(){return this[lr.rawDataSymbol].user_id}get userDisplayName(){return this[lr.rawDataSymbol].user_name}async getUser(){return(0,lr.checkRelationAssertion)(await this._client.users.getUserById(this[lr.rawDataSymbol].user_id))}get creationDate(){return new Date(this[lr.rawDataSymbol].created_at)}};W0.__decorate([(0,qj.Enumerable)(!1)],Jo.prototype,"_client",void 0);Jo=W0.__decorate([(0,lr.rtfm)("api","HelixChannelEditor","userId")],Jo);Zo.HelixChannelEditor=Jo});var Dh=l(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.HelixChannelFollower=void 0;var z0=(y(),g(m)),Pj=S(),jt=f(),Yo=class extends jt.DataObject{static{n(this,"HelixChannelFollower")}constructor(e,t){super(e),this._client=t}get userId(){return this[jt.rawDataSymbol].user_id}get userName(){return this[jt.rawDataSymbol].user_login}get userDisplayName(){return this[jt.rawDataSymbol].user_name}async getUser(){return(0,jt.checkRelationAssertion)(await this._client.users.getUserById(this[jt.rawDataSymbol].user_id))}get followDate(){return new Date(this[jt.rawDataSymbol].followed_at)}};z0.__decorate([(0,Pj.Enumerable)(!1)],Yo.prototype,"_client",void 0);Yo=z0.__decorate([(0,jt.rtfm)("api","HelixChannelFollower","userId")],Yo);Xo.HelixChannelFollower=Yo});var Oh=l(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.HelixFollowedChannel=void 0;var K0=(y(),g(m)),Cj=S(),kt=f(),es=class extends kt.DataObject{static{n(this,"HelixFollowedChannel")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[kt.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[kt.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[kt.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,kt.checkRelationAssertion)(await this._client.users.getUserById(this[kt.rawDataSymbol].broadcaster_id))}get followDate(){return new Date(this[kt.rawDataSymbol].followed_at)}};K0.__decorate([(0,Cj.Enumerable)(!1)],es.prototype,"_client",void 0);es=K0.__decorate([(0,kt.rtfm)("api","HelixFollowedChannel","broadcasterId")],es);ts.HelixFollowedChannel=es});var kh=l(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.HelixChannelApi=void 0;var eq=(y(),g(m)),tq=S(),rn=Q(),oe=f(),_t=Q0(),J0=Ee(),Bh=Fo(),Hj=Ut(),Ej=ne(),Z0=Zr(),Uh=X(),rs=Z(),Aj=L(),jh=Ih(),Tj=Rh(),Y0=Dh(),X0=Oh(),is=class extends Aj.BaseApi{static{n(this,"HelixChannelApi")}constructor(){super(...arguments),this._getChannelByIdBatcher=new Hj.HelixRequestBatcher({url:"channels"},"broadcaster_id","broadcaster_id",this._client,e=>new jh.HelixChannel(e,this._client))}async getChannelInfoById(e){let t=(0,oe.extractUserId)(e),i=await this._client.callApi({type:"helix",url:"channels",userId:t,query:(0,rn.createBroadcasterQuery)(t)});return(0,tq.mapNullable)(i.data[0],a=>new jh.HelixChannel(a,this._client))}async getChannelInfoByIdBatched(e){return await this._getChannelByIdBatcher.request((0,oe.extractUserId)(e))}async getChannelInfoByIds(e){let t=e.map(oe.extractUserId);return(await this._client.callApi({type:"helix",url:"channels",query:(0,J0.createSingleKeyQuery)("broadcaster_id",t)})).data.map(a=>new jh.HelixChannel(a,this._client))}async updateChannelInfo(e,t){await this._client.callApi({type:"helix",url:"channels",method:"PATCH",userId:(0,oe.extractUserId)(e),scopes:["channel:manage:broadcast"],query:(0,rn.createBroadcasterQuery)(e),jsonBody:(0,_t.createChannelUpdateBody)(t)})}async startChannelCommercial(e,t){await this._client.callApi({type:"helix",url:"channels/commercial",method:"POST",userId:(0,oe.extractUserId)(e),scopes:["channel:edit:commercial"],jsonBody:(0,_t.createChannelCommercialBody)(e,t)})}async getChannelEditors(e){return(await this._client.callApi({type:"helix",url:"channels/editors",userId:(0,oe.extractUserId)(e),scopes:["channel:read:editors"],query:(0,rn.createBroadcasterQuery)(e)})).data.map(i=>new Tj.HelixChannelEditor(i,this._client))}async getVips(e,t){let i=await this._client.callApi({type:"helix",url:"channels/vips",userId:(0,oe.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:{...(0,rn.createBroadcasterQuery)(e),...(0,rs.createPaginationQuery)(t)}});return(0,Uh.createPaginatedResult)(i,Bh.HelixUserRelation,this._client)}getVipsPaginated(e){return new Ej.HelixPaginatedRequest({url:"channels/vips",userId:(0,oe.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:(0,rn.createBroadcasterQuery)(e)},this._client,t=>new Bh.HelixUserRelation(t,this._client))}async checkVipForUsers(e,t){return(await this._client.callApi({type:"helix",url:"channels/vips",userId:(0,oe.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:(0,J0.createChannelUsersCheckQuery)(e,t)})).data.map(a=>new Bh.HelixUserRelation(a,this._client))}async checkVipForUser(e,t){let i=(0,oe.extractUserId)(t);return(await this.checkVipForUsers(e,[i])).some(o=>o.id===i)}async addVip(e,t){await this._client.callApi({type:"helix",url:"channels/vips",method:"POST",userId:(0,oe.extractUserId)(e),scopes:["channel:manage:vips"],query:(0,_t.createChannelVipUpdateQuery)(e,t)})}async removeVip(e,t){await this._client.callApi({type:"helix",url:"channels/vips",method:"DELETE",userId:(0,oe.extractUserId)(e),scopes:["channel:manage:vips"],query:(0,_t.createChannelVipUpdateQuery)(e,t)})}async getChannelFollowerCount(e){return(await this._client.callApi({type:"helix",url:"channels/followers",method:"GET",userId:(0,oe.extractUserId)(e),query:{...(0,_t.createChannelFollowerQuery)(e),...(0,rs.createPaginationQuery)({limit:1})}})).total}async getChannelFollowers(e,t,i){let a=await this._client.callApi({type:"helix",url:"channels/followers",method:"GET",userId:(0,oe.extractUserId)(e),canOverrideScopedUserContext:!0,scopes:["moderator:read:followers"],query:{...(0,_t.createChannelFollowerQuery)(e,t),...(0,rs.createPaginationQuery)(i)}});return(0,Uh.createPaginatedResultWithTotal)(a,Y0.HelixChannelFollower,this._client)}getChannelFollowersPaginated(e){return new Z0.HelixPaginatedRequestWithTotal({url:"channels/followers",method:"GET",userId:(0,oe.extractUserId)(e),canOverrideScopedUserContext:!0,scopes:["moderator:read:followers"],query:(0,_t.createChannelFollowerQuery)(e)},this._client,t=>new Y0.HelixChannelFollower(t,this._client))}async getFollowedChannels(e,t,i){let a=await this._client.callApi({type:"helix",url:"channels/followed",method:"GET",userId:(0,oe.extractUserId)(e),scopes:["user:read:follows"],query:{...(0,_t.createFollowedChannelQuery)(e,t),...(0,rs.createPaginationQuery)(i)}});return(0,Uh.createPaginatedResultWithTotal)(a,X0.HelixFollowedChannel,this._client)}getFollowedChannelsPaginated(e,t){return new Z0.HelixPaginatedRequestWithTotal({url:"channels/followed",method:"GET",userId:(0,oe.extractUserId)(e),scopes:["user:read:follows"],query:(0,_t.createFollowedChannelQuery)(e,t)},this._client,i=>new X0.HelixFollowedChannel(i,this._client))}};eq.__decorate([(0,tq.Enumerable)(!1)],is.prototype,"_getChannelByIdBatcher",void 0);is=eq.__decorate([(0,oe.rtfm)("api","HelixChannelApi")],is);ns.HelixChannelApi=is});var rq=l(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.createRedemptionsForBroadcasterQuery=Fe.createRewardRedemptionsByIdsQuery=Fe.createCustomRewardBody=Fe.createCustomRewardChangeQuery=Fe.createCustomRewardsQuery=void 0;var as=f();function Ij(r,e){return{broadcaster_id:(0,as.extractUserId)(r),only_manageable_rewards:e?.toString()}}n(Ij,"createCustomRewardsQuery");Fe.createCustomRewardsQuery=Ij;function Rj(r,e){return{broadcaster_id:(0,as.extractUserId)(r),id:e}}n(Rj,"createCustomRewardChangeQuery");Fe.createCustomRewardChangeQuery=Rj;function Dj(r){var e,t,i;let a={title:r.title,cost:r.cost,prompt:r.prompt,background_color:r.backgroundColor,is_enabled:r.isEnabled,is_user_input_required:r.userInputRequired,should_redemptions_skip_request_queue:r.autoFulfill};return r.maxRedemptionsPerStream!==void 0&&(a.is_max_per_stream_enabled=!!r.maxRedemptionsPerStream,a.max_per_stream=(e=r.maxRedemptionsPerStream)!==null&&e!==void 0?e:0),r.maxRedemptionsPerUserPerStream!==void 0&&(a.is_max_per_user_per_stream_enabled=!!r.maxRedemptionsPerUserPerStream,a.max_per_user_per_stream=(t=r.maxRedemptionsPerUserPerStream)!==null&&t!==void 0?t:0),r.globalCooldown!==void 0&&(a.is_global_cooldown_enabled=!!r.globalCooldown,a.global_cooldown_seconds=(i=r.globalCooldown)!==null&&i!==void 0?i:0),"isPaused"in r&&(a.is_paused=r.isPaused),a}n(Dj,"createCustomRewardBody");Fe.createCustomRewardBody=Dj;function Oj(r,e,t){return{broadcaster_id:(0,as.extractUserId)(r),reward_id:e,id:t}}n(Oj,"createRewardRedemptionsByIdsQuery");Fe.createRewardRedemptionsByIdsQuery=Oj;function Bj(r,e,t,i){return{broadcaster_id:(0,as.extractUserId)(r),reward_id:e,status:t,sort:i.newestFirst?"NEWEST":"OLDEST"}}n(Bj,"createRedemptionsForBroadcasterQuery");Fe.createRedemptionsForBroadcasterQuery=Bj});var Lh=l(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.HelixCustomReward=void 0;var iq=(y(),g(m)),Uj=S(),B=f(),os=class extends B.DataObject{static{n(this,"HelixCustomReward")}constructor(e,t){super(e),this._client=t}get id(){return this[B.rawDataSymbol].id}get broadcasterId(){return this[B.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[B.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[B.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,B.checkRelationAssertion)(await this._client.users.getUserById(this[B.rawDataSymbol].broadcaster_id))}getImageUrl(e){var t,i;let a=`url_${e}x`;return(i=(t=this[B.rawDataSymbol].image)===null||t===void 0?void 0:t[a])!==null&&i!==void 0?i:this[B.rawDataSymbol].default_image[a]}get backgroundColor(){return this[B.rawDataSymbol].background_color}get isEnabled(){return this[B.rawDataSymbol].is_enabled}get cost(){return this[B.rawDataSymbol].cost}get title(){return this[B.rawDataSymbol].title}get prompt(){return this[B.rawDataSymbol].prompt}get userInputRequired(){return this[B.rawDataSymbol].is_user_input_required}get maxRedemptionsPerStream(){return this[B.rawDataSymbol].max_per_stream_setting.is_enabled?this[B.rawDataSymbol].max_per_stream_setting.max_per_stream:null}get maxRedemptionsPerUserPerStream(){return this[B.rawDataSymbol].max_per_user_per_stream_setting.is_enabled?this[B.rawDataSymbol].max_per_user_per_stream_setting.max_per_user_per_stream:null}get globalCooldown(){return this[B.rawDataSymbol].global_cooldown_setting.is_enabled?this[B.rawDataSymbol].global_cooldown_setting.global_cooldown_seconds:null}get isPaused(){return this[B.rawDataSymbol].is_paused}get isInStock(){return this[B.rawDataSymbol].is_in_stock}get redemptionsThisStream(){return this[B.rawDataSymbol].redemptions_redeemed_current_stream}get autoFulfill(){return this[B.rawDataSymbol].should_redemptions_skip_request_queue}get cooldownExpiryDate(){return this[B.rawDataSymbol].cooldown_expires_at?new Date(this[B.rawDataSymbol].cooldown_expires_at):null}};iq.__decorate([(0,Uj.Enumerable)(!1)],os.prototype,"_client",void 0);os=iq.__decorate([(0,B.rtfm)("api","HelixCustomReward","id")],os);ss.HelixCustomReward=os});var Mh=l(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.HelixCustomRewardRedemption=void 0;var nq=(y(),g(m)),jj=S(),k=f(),us=class extends k.DataObject{static{n(this,"HelixCustomRewardRedemption")}constructor(e,t){super(e),this._client=t}get id(){return this[k.rawDataSymbol].id}get broadcasterId(){return this[k.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[k.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[k.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,k.checkRelationAssertion)(await this._client.users.getUserById(this[k.rawDataSymbol].broadcaster_id))}get userId(){return this[k.rawDataSymbol].user_id}get userName(){return this[k.rawDataSymbol].user_login}get userDisplayName(){return this[k.rawDataSymbol].user_name}async getUser(){return(0,k.checkRelationAssertion)(await this._client.users.getUserById(this[k.rawDataSymbol].user_id))}get userInput(){return this[k.rawDataSymbol].user_input}get isFulfilled(){return this[k.rawDataSymbol].status==="FULFILLED"}get isCanceled(){return this[k.rawDataSymbol].status==="CANCELED"}get redemptionDate(){return new Date(this[k.rawDataSymbol].redeemed_at)}get rewardId(){return this[k.rawDataSymbol].reward.id}get rewardTitle(){return this[k.rawDataSymbol].reward.title}get rewardPrompt(){return this[k.rawDataSymbol].reward.prompt}get rewardCost(){return this[k.rawDataSymbol].reward.cost}async getReward(){return(0,k.checkRelationAssertion)(await this._client.channelPoints.getCustomRewardById(this[k.rawDataSymbol].broadcaster_id,this[k.rawDataSymbol].reward.id))}async updateStatus(e){return(await this._client.channelPoints.updateRedemptionStatusByIds(this[k.rawDataSymbol].broadcaster_id,this[k.rawDataSymbol].reward.id,[this[k.rawDataSymbol].id],e))[0]}};nq.__decorate([(0,jj.Enumerable)(!1)],us.prototype,"_client",void 0);us=nq.__decorate([(0,k.rtfm)("api","HelixCustomRewardRedemption","id")],us);ls.HelixCustomRewardRedemption=us});var Nh=l(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.HelixChannelPointsApi=void 0;var kj=(y(),g(m)),Lj=Q(),it=f(),gt=rq(),Mj=Ee(),Fj=ne(),Nj=X(),Qj=Z(),Gj=L(),cs=Lh(),ds=Mh(),Fh=class extends Gj.BaseApi{static{n(this,"HelixChannelPointsApi")}async getCustomRewards(e,t){return(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",userId:(0,it.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,gt.createCustomRewardsQuery)(e,t)})).data.map(a=>new cs.HelixCustomReward(a,this._client))}async getCustomRewardsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",userId:(0,it.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,Mj.createGetByIdsQuery)(e,t)})).data.map(a=>new cs.HelixCustomReward(a,this._client)):[]}async getCustomRewardById(e,t){let i=await this.getCustomRewardsByIds(e,[t]);return i.length?i[0]:null}async createCustomReward(e,t){let i=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"POST",userId:(0,it.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,Lj.createBroadcasterQuery)(e),jsonBody:(0,gt.createCustomRewardBody)(t)});return new cs.HelixCustomReward(i.data[0],this._client)}async updateCustomReward(e,t,i){let a=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"PATCH",userId:(0,it.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,gt.createCustomRewardChangeQuery)(e,t),jsonBody:(0,gt.createCustomRewardBody)(i)});return new cs.HelixCustomReward(a.data[0],this._client)}async deleteCustomReward(e,t){await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"DELETE",userId:(0,it.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,gt.createCustomRewardChangeQuery)(e,t)})}async getRedemptionsByIds(e,t,i){return i.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",userId:(0,it.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,gt.createRewardRedemptionsByIdsQuery)(e,t,i)})).data.map(o=>new ds.HelixCustomRewardRedemption(o,this._client)):[]}async getRedemptionById(e,t,i){let a=await this.getRedemptionsByIds(e,t,[i]);return a.length?a[0]:null}async getRedemptionsForBroadcaster(e,t,i,a){let o=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",userId:(0,it.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:{...(0,gt.createRedemptionsForBroadcasterQuery)(e,t,i,a),...(0,Qj.createPaginationQuery)(a)}});return(0,Nj.createPaginatedResult)(o,ds.HelixCustomRewardRedemption,this._client)}getRedemptionsForBroadcasterPaginated(e,t,i,a){return new Fj.HelixPaginatedRequest({url:"channel_points/custom_rewards/redemptions",userId:(0,it.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,gt.createRedemptionsForBroadcasterQuery)(e,t,i,a)},this._client,o=>new ds.HelixCustomRewardRedemption(o,this._client),50)}async updateRedemptionStatusByIds(e,t,i,a){return i.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",method:"PATCH",userId:(0,it.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,gt.createRewardRedemptionsByIdsQuery)(e,t,i),jsonBody:{status:a}})).data.map(s=>new ds.HelixCustomRewardRedemption(s,this._client)):[]}};Fh=kj.__decorate([(0,it.rtfm)("api","HelixChannelPointsApi")],Fh);ps.HelixChannelPointsApi=Fh});var fs=l(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.HelixCharityCampaignAmount=void 0;var Vj=(y(),g(m)),nn=f(),Qh=class extends nn.DataObject{static{n(this,"HelixCharityCampaignAmount")}get value(){return this[nn.rawDataSymbol].value}get decimalPlaces(){return this[nn.rawDataSymbol].decimal_places}get localizedValue(){return this.value/10**this.decimalPlaces}get currency(){return this[nn.rawDataSymbol].currency}};Qh=Vj.__decorate([(0,nn.rtfm)("api","HelixCharityCampaignAmount")],Qh);hs.HelixCharityCampaignAmount=Qh});var Gh=l(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.HelixCharityCampaign=void 0;var oq=(y(),g(m)),$j=S(),ve=f(),aq=fs(),ms=class extends ve.DataObject{static{n(this,"HelixCharityCampaign")}constructor(e,t){super(e),this._client=t}get id(){return this[ve.rawDataSymbol].id}get broadcasterId(){return this[ve.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[ve.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[ve.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,ve.checkRelationAssertion)(await this._client.users.getUserById(this[ve.rawDataSymbol].broadcaster_id))}get charityName(){return this[ve.rawDataSymbol].charity_name}get charityDescription(){return this[ve.rawDataSymbol].charity_description}get charityLogo(){return this[ve.rawDataSymbol].charity_logo}get charityWebsite(){return this[ve.rawDataSymbol].charity_website}get currentAmount(){return new aq.HelixCharityCampaignAmount(this[ve.rawDataSymbol].current_amount)}get targetAmount(){return new aq.HelixCharityCampaignAmount(this[ve.rawDataSymbol].target_amount)}};oq.__decorate([(0,$j.Enumerable)(!1)],ms.prototype,"_client",void 0);ms=oq.__decorate([(0,ve.rtfm)("api","HelixCharityCampaign","id")],ms);ys.HelixCharityCampaign=ms});var Vh=l(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.HelixCharityCampaignDonation=void 0;var sq=(y(),g(m)),Wj=S(),bt=f(),zj=fs(),_s=class extends bt.DataObject{static{n(this,"HelixCharityCampaignDonation")}constructor(e,t){super(e),this._client=t}get campaignId(){return this[bt.rawDataSymbol].campaign_id}get donorId(){return this[bt.rawDataSymbol].user_id}get donorName(){return this[bt.rawDataSymbol].user_login}get donorDisplayName(){return this[bt.rawDataSymbol].user_name}async getDonor(){return(0,bt.checkRelationAssertion)(await this._client.users.getUserById(this[bt.rawDataSymbol].user_id))}get amount(){return new zj.HelixCharityCampaignAmount(this[bt.rawDataSymbol].amount)}};sq.__decorate([(0,Wj.Enumerable)(!1)],_s.prototype,"_client",void 0);_s=sq.__decorate([(0,bt.rtfm)("api","HelixCharityCampaignDonation")],_s);gs.HelixCharityCampaignDonation=_s});var zh=l(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.HelixCharityApi=void 0;var Kj=(y(),g(m)),uq=Q(),$h=f(),Jj=X(),Zj=Z(),Yj=L(),Xj=Gh(),ek=Vh(),Wh=class extends Yj.BaseApi{static{n(this,"HelixCharityApi")}async getCharityCampaign(e){let t=await this._client.callApi({type:"helix",url:"charity/campaigns",method:"GET",userId:(0,$h.extractUserId)(e),scopes:["channel:read:charity"],query:(0,uq.createBroadcasterQuery)(e)});return new Xj.HelixCharityCampaign(t.data[0],this._client)}async getCharityCampaignDonations(e,t){let i=await this._client.callApi({type:"helix",url:"charity/donations",userId:(0,$h.extractUserId)(e),scopes:["channel:read:charity"],query:{...(0,uq.createBroadcasterQuery)(e),...(0,Zj.createPaginationQuery)(t)}});return(0,Jj.createPaginatedResult)(i,ek.HelixCharityCampaignDonation,this._client)}};Wh=Kj.__decorate([(0,$h.rtfm)("api","HelixCharityApi")],Wh);bs.HelixCharityApi=Wh});var lq=l(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.createShoutoutQuery=Lt.createChatColorUpdateQuery=Lt.createChatSettingsUpdateBody=void 0;var Kh=f();function tk(r){return{slow_mode:r.slowModeEnabled,slow_mode_wait_time:r.slowModeDelay,follower_mode:r.followerOnlyModeEnabled,follower_mode_duration:r.followerOnlyModeDelay,subscriber_mode:r.subscriberOnlyModeEnabled,emote_mode:r.emoteOnlyModeEnabled,unique_chat_mode:r.uniqueChatModeEnabled,non_moderator_chat_delay:r.nonModeratorChatDelayEnabled,non_moderator_chat_delay_duration:r.nonModeratorChatDelay}}n(tk,"createChatSettingsUpdateBody");Lt.createChatSettingsUpdateBody=tk;function rk(r,e){return{user_id:(0,Kh.extractUserId)(r),color:e}}n(rk,"createChatColorUpdateQuery");Lt.createChatColorUpdateQuery=rk;function ik(r,e,t){return{from_broadcaster_id:(0,Kh.extractUserId)(r),to_broadcaster_id:(0,Kh.extractUserId)(e),moderator_id:t}}n(ik,"createShoutoutQuery");Lt.createShoutoutQuery=ik});var an=l(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.HelixEmote=void 0;var nk=(y(),g(m)),Ae=f(),Jh=class extends Ae.DataObject{static{n(this,"HelixEmote")}get id(){return this[Ae.rawDataSymbol].id}get name(){return this[Ae.rawDataSymbol].name}get formats(){return this[Ae.rawDataSymbol].format}get scales(){return this[Ae.rawDataSymbol].scale}get themeModes(){return this[Ae.rawDataSymbol].theme_mode}getImageUrl(e){return this[Ae.rawDataSymbol].images[`url_${e}x`]}getStaticImageUrl(e="1.0",t="light"){return this[Ae.rawDataSymbol].format.includes("static")&&this[Ae.rawDataSymbol].scale.includes(e)?this.getFormattedImageUrl(e,"static",t):null}getAnimatedImageUrl(e="1.0",t="light"){return this[Ae.rawDataSymbol].format.includes("animated")&&this[Ae.rawDataSymbol].scale.includes(e)?this.getFormattedImageUrl(e,"animated",t):null}getFormattedImageUrl(e="1.0",t="static",i="light"){return`https://static-cdn.jtvnw.net/emoticons/v2/${this[Ae.rawDataSymbol].id}/${t}/${i}/${e}`}};Jh=nk.__decorate([(0,Ae.rtfm)("api","HelixEmote","id")],Jh);vs.HelixEmote=Jh});var Zh=l(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.HelixChannelEmote=void 0;var cq=(y(),g(m)),ak=S(),on=f(),ok=an(),ws=class extends ok.HelixEmote{static{n(this,"HelixChannelEmote")}constructor(e,t){super(e),this._client=t}get tier(){return this[on.rawDataSymbol].tier||null}get type(){return this[on.rawDataSymbol].emote_type}get emoteSetId(){return this[on.rawDataSymbol].emote_set_id}async getAllEmotesFromSet(){return await this._client.chat.getEmotesFromSets([this[on.rawDataSymbol].emote_set_id])}};cq.__decorate([(0,ak.Enumerable)(!1)],ws.prototype,"_client",void 0);ws=cq.__decorate([(0,on.rtfm)("api","HelixChannelEmote","id")],ws);xs.HelixChannelEmote=ws});var Xh=l(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.HelixChatBadgeVersion=void 0;var sk=(y(),g(m)),Mt=f(),Yh=class extends Mt.DataObject{static{n(this,"HelixChatBadgeVersion")}get id(){return this[Mt.rawDataSymbol].id}getImageUrl(e){return this[Mt.rawDataSymbol][`image_url_${e}x`]}get title(){return this[Mt.rawDataSymbol].title}get description(){return this[Mt.rawDataSymbol].description}get clickAction(){return this[Mt.rawDataSymbol].click_action}get clickUrl(){return this[Mt.rawDataSymbol].click_url}};Yh=sk.__decorate([(0,Mt.rtfm)("api","HelixChatBadgeVersion","id")],Yh);Ss.HelixChatBadgeVersion=Yh});var ef=l(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.HelixChatBadgeSet=void 0;var dq=(y(),g(m)),pq=Ki(),qs=f(),uk=Xh(),Ps=class extends qs.DataObject{static{n(this,"HelixChatBadgeSet")}get id(){return this[qs.rawDataSymbol].set_id}get versions(){return this[qs.rawDataSymbol].versions.map(e=>new uk.HelixChatBadgeVersion(e))}getVersion(e){var t;return(t=this.versions.find(i=>i.id===e))!==null&&t!==void 0?t:null}};dq.__decorate([(0,pq.CachedGetter)()],Ps.prototype,"versions",null);Ps=dq.__decorate([pq.Cacheable,(0,qs.rtfm)("api","HelixChatBadgeSet","id")],Ps);Cs.HelixChatBadgeSet=Ps});var tf=l(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.HelixChatChatter=void 0;var hq=(y(),g(m)),lk=S(),cr=f(),Hs=class extends cr.DataObject{static{n(this,"HelixChatChatter")}constructor(e,t){super(e),this._client=t}get userId(){return this[cr.rawDataSymbol].user_id}get userName(){return this[cr.rawDataSymbol].user_login}get userDisplayName(){return this[cr.rawDataSymbol].user_name}async getUser(){return(0,cr.checkRelationAssertion)(await this._client.users.getUserById(this[cr.rawDataSymbol].user_id))}};hq.__decorate([(0,lk.Enumerable)(!1)],Hs.prototype,"_client",void 0);Hs=hq.__decorate([(0,cr.rtfm)("api","HelixChatChatter")],Hs);Es.HelixChatChatter=Hs});var Ts=l(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.HelixChatSettings=void 0;var ck=(y(),g(m)),nt=f(),rf=class extends nt.DataObject{static{n(this,"HelixChatSettings")}get broadcasterId(){return this[nt.rawDataSymbol].broadcaster_id}get slowModeEnabled(){return this[nt.rawDataSymbol].slow_mode}get slowModeDelay(){return this[nt.rawDataSymbol].slow_mode_wait_time}get followerOnlyModeEnabled(){return this[nt.rawDataSymbol].follower_mode}get followerOnlyModeDelay(){return this[nt.rawDataSymbol].follower_mode_duration}get subscriberOnlyModeEnabled(){return this[nt.rawDataSymbol].subscriber_mode}get emoteOnlyModeEnabled(){return this[nt.rawDataSymbol].emote_mode}get uniqueChatModeEnabled(){return this[nt.rawDataSymbol].unique_chat_mode}};rf=ck.__decorate([(0,nt.rtfm)("api","HelixChatSettings","broadcasterId")],rf);As.HelixChatSettings=rf});var nf=l(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.HelixEmoteFromSet=void 0;var fq=(y(),g(m)),dk=S(),dr=f(),pk=an(),Is=class extends pk.HelixEmote{static{n(this,"HelixEmoteFromSet")}constructor(e,t){super(e),this._client=t}get type(){return this[dr.rawDataSymbol].emote_type}get emoteSetId(){return this[dr.rawDataSymbol].emote_set_id}get ownerId(){switch(this[dr.rawDataSymbol].owner_id){case"0":case"twitch":return null;default:return this[dr.rawDataSymbol].owner_id}}async getOwner(){switch(this[dr.rawDataSymbol].owner_id){case"0":case"twitch":return null;default:return await this._client.users.getUserById(this[dr.rawDataSymbol].owner_id)}}};fq.__decorate([(0,dk.Enumerable)(!1)],Is.prototype,"_client",void 0);Is=fq.__decorate([(0,dr.rtfm)("api","HelixEmoteFromSet","id")],Is);Rs.HelixEmoteFromSet=Is});var sf=l(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.HelixPrivilegedChatSettings=void 0;var hk=(y(),g(m)),af=f(),fk=Ts(),of=class extends fk.HelixChatSettings{static{n(this,"HelixPrivilegedChatSettings")}get nonModeratorChatDelayEnabled(){return this[af.rawDataSymbol].non_moderator_chat_delay}get nonModeratorChatDelay(){return this[af.rawDataSymbol].non_moderator_chat_delay_duration}};of=hk.__decorate([(0,af.rtfm)("api","HelixPrivilegedChatSettings","broadcasterId")],of);Ds.HelixPrivilegedChatSettings=of});var df=l(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.HelixChatApi=void 0;var mk=(y(),g(m)),uf=Q(),we=f(),lf=lq(),Os=Ee(),yk=Zr(),_k=X(),gk=Z(),bk=L(),vk=Zh(),mq=ef(),yq=tf(),wk=Ts(),xk=an(),Sk=nf(),_q=sf(),cf=class extends bk.BaseApi{static{n(this,"HelixChatApi")}async getChatters(e,t){let i=(0,we.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"chat/chatters",userId:i,canOverrideScopedUserContext:!0,scopes:["moderator:read:chatters"],query:{...this._createModeratorActionQuery(i),...(0,gk.createPaginationQuery)(t)}});return(0,_k.createPaginatedResultWithTotal)(a,yq.HelixChatChatter,this._client)}getChattersPaginated(e){let t=(0,we.extractUserId)(e);return new yk.HelixPaginatedRequestWithTotal({url:"chat/chatters",userId:t,canOverrideScopedUserContext:!0,scopes:["moderator:read:chatters"],query:this._createModeratorActionQuery(t)},this._client,i=>new yq.HelixChatChatter(i,this._client))}async getGlobalBadges(){return(await this._client.callApi({type:"helix",url:"chat/badges/global"})).data.map(t=>new mq.HelixChatBadgeSet(t))}async getChannelBadges(e){return(await this._client.callApi({type:"helix",url:"chat/badges",userId:(0,we.extractUserId)(e),query:(0,uf.createBroadcasterQuery)(e)})).data.map(i=>new mq.HelixChatBadgeSet(i))}async getGlobalEmotes(){return(await this._client.callApi({type:"helix",url:"chat/emotes/global"})).data.map(t=>new xk.HelixEmote(t))}async getChannelEmotes(e){return(await this._client.callApi({type:"helix",url:"chat/emotes",userId:(0,we.extractUserId)(e),query:(0,uf.createBroadcasterQuery)(e)})).data.map(i=>new vk.HelixChannelEmote(i,this._client))}async getEmotesFromSets(e){return(await this._client.callApi({type:"helix",url:"chat/emotes/set",query:(0,Os.createSingleKeyQuery)("emote_set_id",e)})).data.map(i=>new Sk.HelixEmoteFromSet(i,this._client))}async getSettings(e){let t=await this._client.callApi({type:"helix",url:"chat/settings",userId:(0,we.extractUserId)(e),query:(0,uf.createBroadcasterQuery)(e)});return new wk.HelixChatSettings(t.data[0])}async getSettingsPrivileged(e){let t=(0,we.extractUserId)(e),i=await this._client.callApi({type:"helix",url:"chat/settings",userId:t,canOverrideScopedUserContext:!0,scopes:["moderator:read:chat_settings"],query:this._createModeratorActionQuery(t)});return new _q.HelixPrivilegedChatSettings(i.data[0])}async updateSettings(e,t){let i=(0,we.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"chat/settings",method:"PATCH",userId:i,canOverrideScopedUserContext:!0,scopes:["moderator:manage:chat_settings"],query:this._createModeratorActionQuery(i),jsonBody:(0,lf.createChatSettingsUpdateBody)(t)});return new _q.HelixPrivilegedChatSettings(a.data[0])}async sendAnnouncement(e,t){let i=(0,we.extractUserId)(e);await this._client.callApi({type:"helix",url:"chat/announcements",method:"POST",userId:i,canOverrideScopedUserContext:!0,scopes:["moderator:manage:announcements"],query:this._createModeratorActionQuery(i),jsonBody:{message:t.message,color:t.color}})}async getColorsForUsers(e){let t=await this._client.callApi({type:"helix",url:"chat/color",query:(0,Os.createSingleKeyQuery)("user_id",e.map(we.extractUserId))});return new Map(t.data.map(i=>[i.user_id,i.color||null]))}async getColorForUser(e){let t=await this._client.callApi({type:"helix",url:"chat/color",userId:(0,we.extractUserId)(e),query:(0,Os.createSingleKeyQuery)("user_id",(0,we.extractUserId)(e))});if(t.data.length)return t.data[0].color||null}async setColorForUser(e,t){await this._client.callApi({type:"helix",url:"chat/color",method:"PUT",userId:(0,we.extractUserId)(e),scopes:["user:manage:chat_color"],query:(0,lf.createChatColorUpdateQuery)(e,t)})}async shoutoutUser(e,t){let i=(0,we.extractUserId)(e);await this._client.callApi({type:"helix",url:"chat/shoutouts",method:"POST",userId:i,canOverrideScopedUserContext:!0,scopes:["moderator:manage:shoutouts"],query:(0,lf.createShoutoutQuery)(e,t,this._getUserContextIdWithDefault(i))})}_createModeratorActionQuery(e){return(0,Os.createModeratorActionQuery)(e,this._getUserContextIdWithDefault(e))}};cf=mk.__decorate([(0,we.rtfm)("api","HelixChatApi")],cf);Bs.HelixChatApi=cf});var gq=l(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.createClipQuery=Xr.createClipCreateQuery=void 0;var qk=f();function Pk(r,e){return{broadcaster_id:(0,qk.extractUserId)(r),has_delay:e.toString()}}n(Pk,"createClipCreateQuery");Xr.createClipCreateQuery=Pk;function Ck(r){let{filterType:e,ids:t,startDate:i,endDate:a,isFeatured:o}=r;return{[e]:t,started_at:i,ended_at:a,is_featured:o?.toString()}}n(Ck,"createClipQuery");Xr.createClipQuery=Ck});var pf=l(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.HelixClip=void 0;var bq=(y(),g(m)),Hk=S(),U=f(),Us=class extends U.DataObject{static{n(this,"HelixClip")}constructor(e,t){super(e),this._client=t}get id(){return this[U.rawDataSymbol].id}get url(){return this[U.rawDataSymbol].url}get embedUrl(){return this[U.rawDataSymbol].embed_url}get broadcasterId(){return this[U.rawDataSymbol].broadcaster_id}get broadcasterDisplayName(){return this[U.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,U.checkRelationAssertion)(await this._client.users.getUserById(this[U.rawDataSymbol].broadcaster_id))}get creatorId(){return this[U.rawDataSymbol].creator_id}get creatorDisplayName(){return this[U.rawDataSymbol].creator_name}async getCreator(){return(0,U.checkRelationAssertion)(await this._client.users.getUserById(this[U.rawDataSymbol].creator_id))}get videoId(){return this[U.rawDataSymbol].video_id}async getVideo(){return(0,U.checkRelationAssertion)(await this._client.videos.getVideoById(this[U.rawDataSymbol].video_id))}get gameId(){return this[U.rawDataSymbol].game_id}async getGame(){return this[U.rawDataSymbol].game_id?(0,U.checkRelationAssertion)(await this._client.games.getGameById(this[U.rawDataSymbol].game_id)):null}get language(){return this[U.rawDataSymbol].language}get title(){return this[U.rawDataSymbol].title}get views(){return this[U.rawDataSymbol].view_count}get creationDate(){return new Date(this[U.rawDataSymbol].created_at)}get thumbnailUrl(){return this[U.rawDataSymbol].thumbnail_url}get duration(){return this[U.rawDataSymbol].duration}get vodOffset(){return this[U.rawDataSymbol].vod_offset}get isFeatured(){return this[U.rawDataSymbol].is_featured}};bq.__decorate([(0,Hk.Enumerable)(!1)],Us.prototype,"_client",void 0);Us=bq.__decorate([(0,U.rtfm)("api","HelixClip","id")],Us);js.HelixClip=Us});var mf=l(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.HelixClipApi=void 0;var vq=(y(),g(m)),Ek=S(),ei=f(),hf=gq(),Ak=Ut(),Tk=ne(),Ik=X(),Rk=Z(),Dk=L(),ff=pf(),ks=class extends Dk.BaseApi{static{n(this,"HelixClipApi")}constructor(){super(...arguments),this._getClipByIdBatcher=new Ak.HelixRequestBatcher({url:"clips"},"id","id",this._client,e=>new ff.HelixClip(e,this._client))}async getClipsForBroadcaster(e,t={}){return await this._getClips({...t,filterType:"broadcaster_id",ids:(0,ei.extractUserId)(e),userId:(0,ei.extractUserId)(e)})}getClipsForBroadcasterPaginated(e,t={}){return this._getClipsPaginated({...t,filterType:"broadcaster_id",ids:(0,ei.extractUserId)(e),userId:(0,ei.extractUserId)(e)})}async getClipsForGame(e,t={}){return await this._getClips({...t,filterType:"game_id",ids:e})}getClipsForGamePaginated(e,t={}){return this._getClipsPaginated({...t,filterType:"game_id",ids:e})}async getClipsByIds(e){return(await this._getClips({filterType:"id",ids:e})).data}async getClipById(e){let t=await this.getClipsByIds([e]);return t.length?t[0]:null}async getClipByIdBatched(e){return await this._getClipByIdBatcher.request(e)}async createClip(e){let{channel:t,createAfterDelay:i=!1}=e;return(await this._client.callApi({type:"helix",url:"clips",method:"POST",userId:(0,ei.extractUserId)(t),scopes:["clips:edit"],canOverrideScopedUserContext:!0,query:(0,hf.createClipCreateQuery)(t,i)})).data[0].id}async _getClips(e){if(!e.ids.length)return{data:[]};let t=await this._client.callApi({type:"helix",url:"clips",userId:e.userId,query:{...(0,hf.createClipQuery)(e),...(0,Rk.createPaginationQuery)(e)}});return(0,Ik.createPaginatedResult)(t,ff.HelixClip,this._client)}_getClipsPaginated(e){return new Tk.HelixPaginatedRequest({url:"clips",userId:e.userId,query:(0,hf.createClipQuery)(e)},this._client,t=>new ff.HelixClip(t,this._client))}};vq.__decorate([(0,Ek.Enumerable)(!1)],ks.prototype,"_getClipByIdBatcher",void 0);ks=vq.__decorate([(0,ei.rtfm)("api","HelixClipApi")],ks);Ls.HelixClipApi=ks});var _f=l(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.HelixContentClassificationLabel=void 0;var Ms=f(),yf=class extends Ms.DataObject{static{n(this,"HelixContentClassificationLabel")}get id(){return this[Ms.rawDataSymbol].id}get name(){return this[Ms.rawDataSymbol].name}get description(){return this[Ms.rawDataSymbol].description}};Fs.HelixContentClassificationLabel=yf});var bf=l(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.HelixContentClassificationLabelApi=void 0;var Ok=(y(),g(m)),Bk=f(),Uk=L(),jk=_f(),gf=class extends Uk.BaseApi{static{n(this,"HelixContentClassificationLabelApi")}async getAll(e){return(await this._client.callApi({url:"content_classification_labels",query:{locale:e}})).data.map(i=>new jk.HelixContentClassificationLabel(i))}};gf=Ok.__decorate([(0,Bk.rtfm)("api","HelixContentClassificationLabelApi")],gf);Ns.HelixContentClassificationLabelApi=gf});var wq=l(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.createDropsEntitlementUpdateBody=ti.createDropsEntitlementQuery=void 0;var kk=S(),Lk=f();function Mk(r,e){return{user_id:e?(0,kk.mapOptional)(r.user,Lk.extractUserId):void 0,game_id:r.gameId,fulfillment_status:r.fulfillmentStatus}}n(Mk,"createDropsEntitlementQuery");ti.createDropsEntitlementQuery=Mk;function Fk(r,e){return{fulfillment_status:e,entitlement_ids:r}}n(Fk,"createDropsEntitlementUpdateBody");ti.createDropsEntitlementUpdateBody=Fk});var vf=l(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.HelixDropsEntitlement=void 0;var xq=(y(),g(m)),Nk=S(),Te=f(),Qs=class extends Te.DataObject{static{n(this,"HelixDropsEntitlement")}constructor(e,t){super(e),this._client=t}get id(){return this[Te.rawDataSymbol].id}get rewardId(){return this[Te.rawDataSymbol].benefit_id}get grantDate(){return new Date(this[Te.rawDataSymbol].timestamp)}get userId(){return this[Te.rawDataSymbol].user_id}async getUser(){return(0,Te.checkRelationAssertion)(await this._client.users.getUserById(this[Te.rawDataSymbol].user_id))}get gameId(){return this[Te.rawDataSymbol].game_id}async getGame(){return(0,Te.checkRelationAssertion)(await this._client.games.getGameById(this[Te.rawDataSymbol].game_id))}get fulfillmentStatus(){return this[Te.rawDataSymbol].fulfillment_status}get updateDate(){return new Date(this[Te.rawDataSymbol].last_updated)}};xq.__decorate([(0,Nk.Enumerable)(!1)],Qs.prototype,"_client",void 0);Qs=xq.__decorate([(0,Te.rtfm)("api","HelixDropsEntitlement")],Qs);Gs.HelixDropsEntitlement=Qs});var qf=l(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.HelixEntitlementApi=void 0;var Sq=(y(),g(m)),xf=S(),Sf=f(),wf=wq(),Qk=Ut(),Gk=ne(),Vk=X(),$k=Z(),Wk=L(),Vs=vf(),$s=class extends Wk.BaseApi{static{n(this,"HelixEntitlementApi")}constructor(){super(...arguments),this._getDropsEntitlementByIdBatcher=new Qk.HelixRequestBatcher({url:"entitlements/drops"},"id","id",this._client,e=>new Vs.HelixDropsEntitlement(e,this._client))}async getDropsEntitlements(e,t=!1){let i=await this._client.callApi({type:"helix",url:"entitlements/drops",userId:(0,xf.mapOptional)(e.user,Sf.extractUserId),forceType:e.user&&t?"app":void 0,query:{...(0,wf.createDropsEntitlementQuery)(e,t),...(0,$k.createPaginationQuery)(e)}});return(0,Vk.createPaginatedResult)(i,Vs.HelixDropsEntitlement,this._client)}getDropsEntitlementsPaginated(e,t=!1){return new Gk.HelixPaginatedRequest({url:"entitlements/drops",userId:(0,xf.mapOptional)(e.user,Sf.extractUserId),forceType:e.user&&t?"app":void 0,query:(0,wf.createDropsEntitlementQuery)(e,t)},this._client,i=>new Vs.HelixDropsEntitlement(i,this._client))}async getDropsEntitlementsByIds(e){return(await this._client.callApi({type:"helix",url:"entitlements/drops",query:{id:e}})).data.map(i=>new Vs.HelixDropsEntitlement(i,this._client))}async getDropsEntitlementById(e){var t;return(t=(await this.getDropsEntitlementsByIds([e]))[0])!==null&&t!==void 0?t:null}async getDropsEntitlementByIdBatched(e){return await this._getDropsEntitlementByIdBatcher.request(e)}async updateDropsEntitlements(e,t){let i=await this._client.callApi({type:"helix",url:"entitlements/drops",method:"PATCH",jsonBody:(0,wf.createDropsEntitlementUpdateBody)(e,t)});return new Map(i.data.flatMap(a=>a.ids.map(o=>[o,a.status])))}};Sq.__decorate([(0,xf.Enumerable)(!1)],$s.prototype,"_getDropsEntitlementByIdBatcher",void 0);$s=Sq.__decorate([(0,Sf.rtfm)("api","HelixEntitlementApi")],$s);Ws.HelixEntitlementApi=$s});var Pq=l(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.createEventSubDropEntitlementGrantCondition=at.createEventSubModeratorCondition=at.createEventSubRewardCondition=at.createEventSubBroadcasterCondition=void 0;var qq=f();function zk(r){return{broadcaster_user_id:(0,qq.extractUserId)(r)}}n(zk,"createEventSubBroadcasterCondition");at.createEventSubBroadcasterCondition=zk;function Kk(r,e){return{broadcaster_user_id:(0,qq.extractUserId)(r),reward_id:e}}n(Kk,"createEventSubRewardCondition");at.createEventSubRewardCondition=Kk;function Jk(r,e){return{broadcaster_user_id:r,moderator_user_id:e}}n(Jk,"createEventSubModeratorCondition");at.createEventSubModeratorCondition=Jk;function Zk(r){return{organization_id:r.organizationId,category_id:r.categoryId,campaign_id:r.campaignId}}n(Zk,"createEventSubDropEntitlementGrantCondition");at.createEventSubDropEntitlementGrantCondition=Zk});var Js=l(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.HelixEventSubSubscription=void 0;var Cq=(y(),g(m)),Yk=S(),Qe=f(),zs=class extends Qe.DataObject{static{n(this,"HelixEventSubSubscription")}constructor(e,t){super(e),this._client=t}get id(){return this[Qe.rawDataSymbol].id}get status(){return this[Qe.rawDataSymbol].status}get type(){return this[Qe.rawDataSymbol].type}get cost(){return this[Qe.rawDataSymbol].cost}get condition(){return this[Qe.rawDataSymbol].condition}get creationDate(){return new Date(this[Qe.rawDataSymbol].created_at)}async unsubscribe(){await this._client.eventSub.deleteSubscription(this[Qe.rawDataSymbol].id)}get _transport(){return this[Qe.rawDataSymbol].transport}set _status(e){this[Qe.rawDataSymbol].status=e}};Cq.__decorate([(0,Yk.Enumerable)(!1)],zs.prototype,"_client",void 0);zs=Cq.__decorate([(0,Qe.rtfm)("api","HelixEventSubSubscription","id")],zs);Ks.HelixEventSubSubscription=zs});var Cf=l(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.HelixPaginatedEventSubSubscriptionsRequest=void 0;var Xk=(y(),g(m)),eL=f(),tL=Zr(),rL=Js(),Pf=class extends tL.HelixPaginatedRequestWithTotal{static{n(this,"HelixPaginatedEventSubSubscriptionsRequest")}constructor(e,t,i){super({url:"eventsub/subscriptions",userId:t,query:e},i,a=>new rL.HelixEventSubSubscription(a,i))}async getTotalCost(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).total_cost}async getMaxTotalCost(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).max_total_cost}};Pf=Xk.__decorate([(0,eL.rtfm)("api","HelixPaginatedEventSubSubscriptionsRequest")],Pf);Zs.HelixPaginatedEventSubSubscriptionsRequest=Pf});var Ef=l(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.HelixEventSubApi=void 0;var iL=(y(),g(m)),nL=S(),Ie=f(),C=Pq(),Ft=Ee(),Ys=X(),Xs=Z(),aL=L(),sn=Js(),eu=Cf(),Hf=class extends aL.BaseApi{static{n(this,"HelixEventSubApi")}async getSubscriptions(e){let t=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:(0,Xs.createPaginationQuery)(e)});return{...(0,Ys.createPaginatedResultWithTotal)(t,sn.HelixEventSubSubscription,this._client),totalCost:t.total_cost,maxTotalCost:t.max_total_cost}}getSubscriptionsPaginated(){return new eu.HelixPaginatedEventSubSubscriptionsRequest({},void 0,this._client)}async getSubscriptionsForStatus(e,t){let i=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:{...(0,Xs.createPaginationQuery)(t),status:e}});return{...(0,Ys.createPaginatedResultWithTotal)(i,sn.HelixEventSubSubscription,this._client),totalCost:i.total_cost,maxTotalCost:i.max_total_cost}}getSubscriptionsForStatusPaginated(e){return new eu.HelixPaginatedEventSubSubscriptionsRequest({status:e},void 0,this._client)}async getSubscriptionsForType(e,t){let i=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:{...(0,Xs.createPaginationQuery)(t),type:e}});return{...(0,Ys.createPaginatedResultWithTotal)(i,sn.HelixEventSubSubscription,this._client),totalCost:i.total_cost,maxTotalCost:i.max_total_cost}}getSubscriptionsForTypePaginated(e){return new eu.HelixPaginatedEventSubSubscriptionsRequest({type:e},void 0,this._client)}async getSubscriptionsForUser(e,t){let i=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",userId:(0,Ie.extractUserId)(e),query:{...(0,Ft.createSingleKeyQuery)("user_id",(0,Ie.extractUserId)(e)),...(0,Xs.createPaginationQuery)(t)}});return{...(0,Ys.createPaginatedResultWithTotal)(i,sn.HelixEventSubSubscription,this._client),totalCost:i.total_cost,maxTotalCost:i.max_total_cost}}getSubscriptionsForUserPaginated(e){let t=(0,Ie.extractUserId)(e);return new eu.HelixPaginatedEventSubSubscriptionsRequest((0,Ft.createSingleKeyQuery)("user_id",t),t,this._client)}async createSubscription(e,t,i,a,o,s,u,c){let h=a.method==="webhook",d=h?void 0:s;if(!h&&!o)throw new Error(`Transport ${a.method} can only handle subscriptions with user context`);let _={type:e,version:t,condition:i,transport:a};c&&(_.is_batching_enabled=!0);let b=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",method:"POST",scopes:d,userId:(0,nL.mapOptional)(o,Ie.extractUserId),forceType:h?"app":"user",jsonBody:_});return new sn.HelixEventSubSubscription(b.data[0],this._client)}async deleteSubscription(e){await this._client.callApi({type:"helix",url:"eventsub/subscriptions",method:"DELETE",query:{id:e}})}async deleteAllSubscriptions(){await this._deleteSubscriptionsWithCondition()}async deleteBrokenSubscriptions(){await this._deleteSubscriptionsWithCondition(e=>e.status!=="enabled"&&e.status!=="webhook_callback_verification_pending")}async subscribeToStreamOnlineEvents(e,t){return await this.createSubscription("stream.online","1",(0,C.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToStreamOfflineEvents(e,t){return await this.createSubscription("stream.offline","1",(0,C.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToChannelUpdateEvents(e,t){return await this.createSubscription("channel.update","1",(0,C.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToChannelFollowEvents(e,t){let i=(0,Ie.extractUserId)(e);return await this.createSubscription("channel.follow","2",(0,C.createEventSubModeratorCondition)(i,this._getUserContextIdWithDefault(i)),t,i,["moderator:read:followers"],!0)}async subscribeToChannelSubscriptionEvents(e,t){return await this.createSubscription("channel.subscribe","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionGiftEvents(e,t){return await this.createSubscription("channel.subscription.gift","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionMessageEvents(e,t){return await this.createSubscription("channel.subscription.message","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionEndEvents(e,t){return await this.createSubscription("channel.subscription.end","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelCheerEvents(e,t){return await this.createSubscription("channel.cheer","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["bits:read"])}async subscribeToChannelCharityCampaignStartEvents(e,t){return await this.createSubscription("channel.charity_campaign.start","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityCampaignStopEvents(e,t){return await this.createSubscription("channel.charity_campaign.stop","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityDonationEvents(e,t){return await this.createSubscription("channel.charity_campaign.donate","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityCampaignProgressEvents(e,t){return await this.createSubscription("channel.charity_campaign.progress","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelBanEvents(e,t){return await this.createSubscription("channel.ban","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:moderate"])}async subscribeToChannelUnbanEvents(e,t){return await this.createSubscription("channel.unban","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:moderate"])}async subscribeToChannelShieldModeBeginEvents(e,t){let i=(0,Ie.extractUserId)(e);return await this.createSubscription("channel.shield_mode.begin","1",(0,C.createEventSubModeratorCondition)(i,this._getUserContextIdWithDefault(i)),t,i,["moderator:read:shield_mode","moderator:manage:shield_mode"],!0)}async subscribeToChannelShieldModeEndEvents(e,t){let i=(0,Ie.extractUserId)(e);return await this.createSubscription("channel.shield_mode.end","1",(0,C.createEventSubModeratorCondition)(i,this._getUserContextIdWithDefault(i)),t,i,["moderator:read:shield_mode","moderator:manage:shield_mode"],!0)}async subscribeToChannelModeratorAddEvents(e,t){return await this.createSubscription("channel.moderator.add","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["moderation:read"])}async subscribeToChannelModeratorRemoveEvents(e,t){return await this.createSubscription("channel.moderator.remove","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["moderation:read"])}async subscribeToChannelRaidEventsFrom(e,t){return await this.createSubscription("channel.raid","1",(0,Ft.createSingleKeyQuery)("from_broadcaster_user_id",(0,Ie.extractUserId)(e)),t,e)}async subscribeToChannelRaidEventsTo(e,t){return await this.createSubscription("channel.raid","1",(0,Ft.createSingleKeyQuery)("to_broadcaster_user_id",(0,Ie.extractUserId)(e)),t,e)}async subscribeToChannelRewardAddEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.add","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardUpdateEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.update","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardUpdateEventsForReward(e,t,i){return await this.createSubscription("channel.channel_points_custom_reward.update","1",(0,C.createEventSubRewardCondition)(e,t),i,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardRemoveEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.remove","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardRemoveEventsForReward(e,t,i){return await this.createSubscription("channel.channel_points_custom_reward.remove","1",(0,C.createEventSubRewardCondition)(e,t),i,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionAddEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward_redemption.add","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionAddEventsForReward(e,t,i){return await this.createSubscription("channel.channel_points_custom_reward_redemption.add","1",(0,C.createEventSubRewardCondition)(e,t),i,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionUpdateEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward_redemption.update","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionUpdateEventsForReward(e,t,i){return await this.createSubscription("channel.channel_points_custom_reward_redemption.update","1",(0,C.createEventSubRewardCondition)(e,t),i,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelPollBeginEvents(e,t){return await this.createSubscription("channel.poll.begin","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPollProgressEvents(e,t){return await this.createSubscription("channel.poll.progress","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPollEndEvents(e,t){return await this.createSubscription("channel.poll.end","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPredictionBeginEvents(e,t){return await this.createSubscription("channel.prediction.begin","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionProgressEvents(e,t){return await this.createSubscription("channel.prediction.progress","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionLockEvents(e,t){return await this.createSubscription("channel.prediction.lock","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionEndEvents(e,t){return await this.createSubscription("channel.prediction.end","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelGoalBeginEvents(e,t){return await this.createSubscription("channel.goal.begin","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelGoalProgressEvents(e,t){return await this.createSubscription("channel.goal.progress","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelGoalEndEvents(e,t){return await this.createSubscription("channel.goal.end","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelHypeTrainBeginEvents(e,t){return await this.createSubscription("channel.hype_train.begin","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainProgressEvents(e,t){return await this.createSubscription("channel.hype_train.progress","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainEndEvents(e,t){return await this.createSubscription("channel.hype_train.end","1",(0,C.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelShoutoutCreateEvents(e,t){let i=(0,Ie.extractUserId)(e);return await this.createSubscription("channel.shoutout.create","1",(0,C.createEventSubModeratorCondition)(i,this._getUserContextIdWithDefault(i)),t,i,["moderator:read:shoutouts","moderator:manage:shoutouts"],!0)}async subscribeToChannelShoutoutReceiveEvents(e,t){let i=(0,Ie.extractUserId)(e);return await this.createSubscription("channel.shoutout.receive","1",(0,C.createEventSubModeratorCondition)(i,this._getUserContextIdWithDefault(i)),t,i,["moderator:read:shoutouts","moderator:manage:shoutouts"],!0)}async subscribeToExtensionBitsTransactionCreateEvents(e,t){return await this.createSubscription("extension.bits_transaction.create","1",(0,Ft.createSingleKeyQuery)("extension_client_id",e),t)}async subscribeToUserAuthorizationGrantEvents(e,t){return await this.createSubscription("user.authorization.grant","1",(0,Ft.createSingleKeyQuery)("client_id",e),t)}async subscribeToUserAuthorizationRevokeEvents(e,t){return await this.createSubscription("user.authorization.revoke","1",(0,Ft.createSingleKeyQuery)("client_id",e),t)}async subscribeToUserUpdateEvents(e,t,i){return await this.createSubscription("user.update","1",(0,Ft.createSingleKeyQuery)("user_id",(0,Ie.extractUserId)(e)),t,e,i?["user:read:email"]:void 0)}async subscribeToDropEntitlementGrantEvents(e,t){return await this.createSubscription("drop.entitlement.grant","1",(0,C.createEventSubDropEntitlementGrantCondition)(e),t,void 0,void 0,!1,!0)}async _deleteSubscriptionsWithCondition(e){let t=this.getSubscriptionsPaginated();for await(let i of t)(!e||e(i))&&await i.unsubscribe()}};Hf=iL.__decorate([(0,Ie.rtfm)("api","HelixEventSubApi")],Hf);tu.HelixEventSubApi=Hf});var Hq=l(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.createExtensionTransactionQuery=Nt.createExtensionProductBody=Nt.createReleasedExtensionFilter=void 0;function oL(r,e){return{extension_id:r,extension_version:e}}n(oL,"createReleasedExtensionFilter");Nt.createReleasedExtensionFilter=oL;function sL(r){return{sku:r.sku,cost:{amount:r.cost,type:"bits"},display_name:r.displayName,in_development:r.inDevelopment,expiration:r.expirationDate,is_broadcast:r.broadcast}}n(sL,"createExtensionProductBody");Nt.createExtensionProductBody=sL;function uL(r,e){return{extension_id:r,id:e.transactionIds}}n(uL,"createExtensionTransactionQuery");Nt.createExtensionTransactionQuery=uL});var Af=l(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.HelixChannelReference=void 0;var Eq=(y(),g(m)),lL=S(),xe=f(),ru=class extends xe.DataObject{static{n(this,"HelixChannelReference")}constructor(e,t){super(e),this._client=t}get id(){return this[xe.rawDataSymbol].broadcaster_id}get displayName(){return this[xe.rawDataSymbol].broadcaster_name}async getChannel(){return(0,xe.checkRelationAssertion)(await this._client.channels.getChannelInfoById(this[xe.rawDataSymbol].broadcaster_id))}async getBroadcaster(){return(0,xe.checkRelationAssertion)(await this._client.users.getUserById(this[xe.rawDataSymbol].broadcaster_id))}get gameId(){return this[xe.rawDataSymbol].game_id}get gameName(){return this[xe.rawDataSymbol].game_name}async getGame(){return this[xe.rawDataSymbol].game_id?(0,xe.checkRelationAssertion)(await this._client.games.getGameById(this[xe.rawDataSymbol].game_id)):null}get title(){return this[xe.rawDataSymbol].title}};Eq.__decorate([(0,lL.Enumerable)(!1)],ru.prototype,"_client",void 0);ru=Eq.__decorate([(0,xe.rtfm)("api","HelixChannelReference","id")],ru);iu.HelixChannelReference=ru});var If=l(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.HelixExtensionBitsProduct=void 0;var cL=(y(),g(m)),dL=S(),Qt=f(),Tf=class extends Qt.DataObject{static{n(this,"HelixExtensionBitsProduct")}get sku(){return this[Qt.rawDataSymbol].sku}get cost(){return this[Qt.rawDataSymbol].cost.amount}get displayName(){return this[Qt.rawDataSymbol].display_name}get inDevelopment(){return this[Qt.rawDataSymbol].in_development}get isBroadcast(){return this[Qt.rawDataSymbol].is_broadcast}get expirationDate(){return(0,dL.mapNullable)(this[Qt.rawDataSymbol].expiration,e=>new Date(e))}};Tf=cL.__decorate([(0,Qt.rtfm)("api","HelixExtensionBitsProduct","sku")],Tf);nu.HelixExtensionBitsProduct=Tf});var Rf=l(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.HelixExtensionTransaction=void 0;var Aq=(y(),g(m)),pL=S(),ee=f(),au=class extends ee.DataObject{static{n(this,"HelixExtensionTransaction")}constructor(e,t){super(e),this._client=t}get id(){return this[ee.rawDataSymbol].id}get transactionDate(){return new Date(this[ee.rawDataSymbol].timestamp)}get broadcasterId(){return this[ee.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[ee.rawDataSymbol].broadcaster_name}get broadcasterDisplayName(){return this[ee.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,ee.checkRelationAssertion)(await this._client.users.getUserById(this[ee.rawDataSymbol].broadcaster_id))}get userId(){return this[ee.rawDataSymbol].user_id}get userName(){return this[ee.rawDataSymbol].user_login}get userDisplayName(){return this[ee.rawDataSymbol].user_name}async getUser(){return(0,ee.checkRelationAssertion)(await this._client.users.getUserById(this[ee.rawDataSymbol].user_id))}get productType(){return this[ee.rawDataSymbol].product_type}get productSku(){return this[ee.rawDataSymbol].product_data.sku}get productCost(){return this[ee.rawDataSymbol].product_data.cost.amount}get productDisplayName(){return this[ee.rawDataSymbol].product_data.displayName}get productInDevelopment(){return this[ee.rawDataSymbol].product_data.inDevelopment}};Aq.__decorate([(0,pL.Enumerable)(!1)],au.prototype,"_client",void 0);au=Aq.__decorate([(0,ee.rtfm)("api","HelixExtensionTransaction","id")],au);ou.HelixExtensionTransaction=au});var Bf=l(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.HelixExtensionsApi=void 0;var hL=(y(),g(m)),Uq=f(),su=Hq(),Df=Ee(),Tq=ne(),Iq=X(),Rq=Z(),fL=L(),Dq=Af(),Oq=If(),Bq=Rf(),Of=class extends fL.BaseApi{static{n(this,"HelixExtensionsApi")}async getReleasedExtension(e,t){let i=await this._client.callApi({type:"helix",url:"extensions/released",query:(0,su.createReleasedExtensionFilter)(e,t)});return new Uq.HelixExtension(i.data[0])}async getLiveChannelsWithExtension(e,t){let i=await this._client.callApi({type:"helix",url:"extensions/live",query:{...(0,Df.createSingleKeyQuery)("extension_id",e),...(0,Rq.createPaginationQuery)(t)}});return(0,Iq.createPaginatedResult)(i,Dq.HelixChannelReference,this._client)}getLiveChannelsWithExtensionPaginated(e){return new Tq.HelixPaginatedRequest({url:"extensions/live",query:(0,Df.createSingleKeyQuery)("extension_id",e)},this._client,t=>new Dq.HelixChannelReference(t,this._client))}async getExtensionBitsProducts(e){return(await this._client.callApi({type:"helix",url:"bits/extensions",forceType:"app",query:(0,Df.createSingleKeyQuery)("should_include_all",e?.toString())})).data.map(i=>new Oq.HelixExtensionBitsProduct(i))}async putExtensionBitsProduct(e){let t=await this._client.callApi({type:"helix",url:"bits/extensions",method:"PUT",forceType:"app",jsonBody:(0,su.createExtensionProductBody)(e)});return new Oq.HelixExtensionBitsProduct(t.data[0])}async getExtensionTransactions(e,t={}){let i=await this._client.callApi({type:"helix",url:"extensions/transactions",forceType:"app",query:{...(0,su.createExtensionTransactionQuery)(e,t),...(0,Rq.createPaginationQuery)(t)}});return(0,Iq.createPaginatedResult)(i,Bq.HelixExtensionTransaction,this._client)}getExtensionTransactionsPaginated(e,t={}){return new Tq.HelixPaginatedRequest({url:"extensions/transactions",forceType:"app",query:(0,su.createExtensionTransactionQuery)(e,t)},this._client,i=>new Bq.HelixExtensionTransaction(i,this._client))}};Of=hL.__decorate([(0,Uq.rtfm)("api","HelixExtensionsApi")],Of);uu.HelixExtensionsApi=Of});var du=l(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.HelixGame=void 0;var jq=(y(),g(m)),mL=S(),vt=f(),lu=class extends vt.DataObject{static{n(this,"HelixGame")}constructor(e,t){super(e),this._client=t}get id(){return this[vt.rawDataSymbol].id}get name(){return this[vt.rawDataSymbol].name}get boxArtUrl(){return this[vt.rawDataSymbol].box_art_url}get igdbId(){return this[vt.rawDataSymbol].igdb_id||null}getBoxArtUrl(e,t){return this[vt.rawDataSymbol].box_art_url.replace("{width}",e.toString()).replace("{height}",t.toString())}async getStreams(e){return await this._client.streams.getStreams({...e,game:this[vt.rawDataSymbol].id})}getStreamsPaginated(){return this._client.streams.getStreamsPaginated({game:this[vt.rawDataSymbol].id})}};jq.__decorate([(0,mL.Enumerable)(!1)],lu.prototype,"_client",void 0);lu=jq.__decorate([(0,vt.rtfm)("api","HelixGame","id")],lu);cu.HelixGame=lu});var kf=l(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.HelixGameApi=void 0;var pu=(y(),g(m)),jf=S(),yL=f(),Uf=Ut(),_L=ne(),gL=X(),bL=Z(),vL=L(),ri=du(),ii=class extends vL.BaseApi{static{n(this,"HelixGameApi")}constructor(){super(...arguments),this._getGameByIdBatcher=new Uf.HelixRequestBatcher({url:"games"},"id","id",this._client,e=>new ri.HelixGame(e,this._client)),this._getGameByNameBatcher=new Uf.HelixRequestBatcher({url:"games"},"name","name",this._client,e=>new ri.HelixGame(e,this._client)),this._getGameByIgdbIdBatcher=new Uf.HelixRequestBatcher({url:"games"},"igdb_id","igdb_id",this._client,e=>new ri.HelixGame(e,this._client))}async getGamesByIds(e){return await this._getGames("id",e)}async getGamesByNames(e){return await this._getGames("name",e)}async getGamesByIgdbIds(e){return await this._getGames("igdb_id",e)}async getGameById(e){var t;return(t=(await this._getGames("id",[e]))[0])!==null&&t!==void 0?t:null}async getGameByName(e){var t;return(t=(await this._getGames("name",[e]))[0])!==null&&t!==void 0?t:null}async getGameByIgdbId(e){var t;return(t=(await this._getGames("igdb_id",[e]))[0])!==null&&t!==void 0?t:null}async getGameByIdBatched(e){return await this._getGameByIdBatcher.request(e)}async getGameByNameBatched(e){return await this._getGameByNameBatcher.request(e)}async getGameByIgdbIdBatched(e){return await this._getGameByIgdbIdBatcher.request(e)}async getTopGames(e){let t=await this._client.callApi({type:"helix",url:"games/top",query:(0,bL.createPaginationQuery)(e)});return(0,gL.createPaginatedResult)(t,ri.HelixGame,this._client)}getTopGamesPaginated(){return new _L.HelixPaginatedRequest({url:"games/top"},this._client,e=>new ri.HelixGame(e,this._client))}async _getGames(e,t){return t.length?(await this._client.callApi({type:"helix",url:"games",query:{[e]:t}})).data.map(a=>new ri.HelixGame(a,this._client)):[]}};pu.__decorate([(0,jf.Enumerable)(!1)],ii.prototype,"_getGameByIdBatcher",void 0);pu.__decorate([(0,jf.Enumerable)(!1)],ii.prototype,"_getGameByNameBatcher",void 0);pu.__decorate([(0,jf.Enumerable)(!1)],ii.prototype,"_getGameByIgdbIdBatcher",void 0);ii=pu.__decorate([(0,yL.rtfm)("api","HelixGameApi")],ii);hu.HelixGameApi=ii});var Lf=l(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.HelixGoal=void 0;var kq=(y(),g(m)),wL=S(),Re=f(),fu=class extends Re.DataObject{static{n(this,"HelixGoal")}constructor(e,t){super(e),this._client=t}get id(){return this[Re.rawDataSymbol].id}get broadcasterId(){return this[Re.rawDataSymbol].broadcaster_id}get broadcasterDisplayName(){return this[Re.rawDataSymbol].broadcaster_name}get broadcasterName(){return this[Re.rawDataSymbol].broadcaster_login}async getBroadcaster(){return(0,Re.checkRelationAssertion)(await this._client.users.getUserById(this[Re.rawDataSymbol].broadcaster_id))}get type(){return this[Re.rawDataSymbol].type}get description(){return this[Re.rawDataSymbol].description}get currentAmount(){return this[Re.rawDataSymbol].current_amount}get targetAmount(){return this[Re.rawDataSymbol].target_amount}get creationDate(){return this[Re.rawDataSymbol].created_at}};kq.__decorate([(0,wL.Enumerable)(!1)],fu.prototype,"_client",void 0);fu=kq.__decorate([(0,Re.rtfm)("api","HelixGoal","id")],fu);mu.HelixGoal=fu});var Ff=l(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.HelixGoalApi=void 0;var xL=(y(),g(m)),SL=Q(),Lq=f(),qL=L(),PL=Lf(),Mf=class extends qL.BaseApi{static{n(this,"HelixGoalApi")}async getGoals(e){return(await this._client.callApi({type:"helix",url:"goals",userId:(0,Lq.extractUserId)(e),scopes:["channel:read:goals"],query:(0,SL.createBroadcasterQuery)(e)})).data.map(i=>new PL.HelixGoal(i,this._client))}};Mf=xL.__decorate([(0,Lq.rtfm)("api","HelixGoalApi")],Mf);yu.HelixGoalApi=Mf});var Nf=l(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.HelixHypeTrainContribution=void 0;var Mq=(y(),g(m)),CL=S(),pr=f(),_u=class extends pr.DataObject{static{n(this,"HelixHypeTrainContribution")}constructor(e,t){super(e),this._client=t}get userId(){return this[pr.rawDataSymbol].user}async getUser(){return(0,pr.checkRelationAssertion)(await this._client.users.getUserById(this[pr.rawDataSymbol].user))}get type(){return this[pr.rawDataSymbol].type}get total(){return this[pr.rawDataSymbol].total}};Mq.__decorate([(0,CL.Enumerable)(!1)],_u.prototype,"_client",void 0);_u=Mq.__decorate([(0,pr.rtfm)("api","HelixHypeTrainContribution","userId")],_u);gu.HelixHypeTrainContribution=_u});var Qf=l(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.HelixHypeTrainEvent=void 0;var Nq=(y(),g(m)),HL=S(),se=f(),Fq=Nf(),bu=class extends se.DataObject{static{n(this,"HelixHypeTrainEvent")}constructor(e,t){super(e),this._client=t}get eventId(){return this[se.rawDataSymbol].id}get eventType(){return this[se.rawDataSymbol].event_type}get eventDate(){return new Date(this[se.rawDataSymbol].event_timestamp)}get eventVersion(){return this[se.rawDataSymbol].version}get id(){return this[se.rawDataSymbol].event_data.id}get broadcasterId(){return this[se.rawDataSymbol].event_data.broadcaster_id}async getBroadcaster(){return(0,se.checkRelationAssertion)(await this._client.users.getUserById(this[se.rawDataSymbol].event_data.broadcaster_id))}get level(){return this[se.rawDataSymbol].event_data.level}get startDate(){return new Date(this[se.rawDataSymbol].event_data.started_at)}get expiryDate(){return new Date(this[se.rawDataSymbol].event_data.expires_at)}get cooldownDate(){return new Date(this[se.rawDataSymbol].event_data.cooldown_end_time)}get total(){return this[se.rawDataSymbol].event_data.total}get goal(){return this[se.rawDataSymbol].event_data.goal}get lastContribution(){return new Fq.HelixHypeTrainContribution(this[se.rawDataSymbol].event_data.last_contribution,this._client)}get topContributions(){return this[se.rawDataSymbol].event_data.top_contributions.map(e=>new Fq.HelixHypeTrainContribution(e,this._client))}};Nq.__decorate([(0,HL.Enumerable)(!1)],bu.prototype,"_client",void 0);bu=Nq.__decorate([(0,se.rtfm)("api","HelixHypeTrainEvent","id")],bu);vu.HelixHypeTrainEvent=bu});var Vf=l(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.HelixHypeTrainApi=void 0;var Qq=Q(),Gq=f(),EL=ne(),AL=X(),TL=Z(),IL=L(),Vq=Qf(),Gf=class extends IL.BaseApi{static{n(this,"HelixHypeTrainApi")}async getHypeTrainEventsForBroadcaster(e,t){let i=await this._client.callApi({type:"helix",url:"hypetrain/events",userId:(0,Gq.extractUserId)(e),scopes:["channel:read:hype_train"],query:{...(0,Qq.createBroadcasterQuery)(e),...(0,TL.createPaginationQuery)(t)}});return(0,AL.createPaginatedResult)(i,Vq.HelixHypeTrainEvent,this._client)}getHypeTrainEventsForBroadcasterPaginated(e){return new EL.HelixPaginatedRequest({url:"hypetrain/events",userId:(0,Gq.extractUserId)(e),scopes:["channel:read:hype_train"],query:(0,Qq.createBroadcasterQuery)(e)},this._client,t=>new Vq.HelixHypeTrainEvent(t,this._client))}};wu.HelixHypeTrainApi=Gf});var $q=l(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.createUpdateShieldModeStatusBody=Se.createBanUserBody=Se.createAutoModSettingsBody=Se.createAutoModProcessBody=Se.createModeratorModifyQuery=Se.createModerationUserListQuery=void 0;var un=f();function RL(r,e){return{broadcaster_id:(0,un.extractUserId)(r),user_id:e?.userId}}n(RL,"createModerationUserListQuery");Se.createModerationUserListQuery=RL;function DL(r,e){return{broadcaster_id:(0,un.extractUserId)(r),user_id:(0,un.extractUserId)(e)}}n(DL,"createModeratorModifyQuery");Se.createModeratorModifyQuery=DL;function OL(r,e,t){return{user_id:(0,un.extractUserId)(r),msg_id:e,action:t?"ALLOW":"DENY"}}n(OL,"createAutoModProcessBody");Se.createAutoModProcessBody=OL;function BL(r){return{overall_level:r.overallLevel,aggression:r.aggression,bullying:r.bullying,disability:r.disability,misogyny:r.misogyny,race_ethnicity_or_religion:r.raceEthnicityOrReligion,sex_based_terms:r.sexBasedTerms,sexuality_sex_or_gender:r.sexualitySexOrGender,swearing:r.swearing}}n(BL,"createAutoModSettingsBody");Se.createAutoModSettingsBody=BL;function UL(r){return{data:{duration:r.duration,reason:r.reason,user_id:(0,un.extractUserId)(r.user)}}}n(UL,"createBanUserBody");Se.createBanUserBody=UL;function jL(r){return{is_active:r}}n(jL,"createUpdateShieldModeStatusBody");Se.createUpdateShieldModeStatusBody=jL});var Wq=l(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.HelixAutoModSettings=void 0;var kL=(y(),g(m)),qe=f(),$f=class extends qe.DataObject{static{n(this,"HelixAutoModSettings")}get broadcasterId(){return this[qe.rawDataSymbol].broadcaster_id}get moderatorId(){return this[qe.rawDataSymbol].moderator_id}get overallLevel(){return this[qe.rawDataSymbol].overall_level?this[qe.rawDataSymbol].overall_level:null}get disability(){return this[qe.rawDataSymbol].disability}get aggression(){return this[qe.rawDataSymbol].aggression}get sexualitySexOrGender(){return this[qe.rawDataSymbol].sexuality_sex_or_gender}get misogyny(){return this[qe.rawDataSymbol].misogyny}get bullying(){return this[qe.rawDataSymbol].bullying}get swearing(){return this[qe.rawDataSymbol].swearing}get raceEthnicityOrReligion(){return this[qe.rawDataSymbol].race_ethnicity_or_religion}get sexBasedTerms(){return this[qe.rawDataSymbol].sex_based_terms}};$f=kL.__decorate([(0,qe.rtfm)("api","HelixAutoModSettings","broadcasterId")],$f);xu.HelixAutoModSettings=$f});var zq=l(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.HelixAutoModStatus=void 0;var LL=(y(),g(m)),Su=f(),Wf=class extends Su.DataObject{static{n(this,"HelixAutoModStatus")}get messageId(){return this[Su.rawDataSymbol].msg_id}get isPermitted(){return this[Su.rawDataSymbol].is_permitted}};Wf=LL.__decorate([(0,Su.rtfm)("api","HelixAutoModStatus","messageId")],Wf);qu.HelixAutoModStatus=Wf});var Cu=l(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.HelixBanUser=void 0;var zf=(y(),g(m)),Kf=S(),wt=f(),ln=class extends wt.DataObject{static{n(this,"HelixBanUser")}constructor(e,t,i){super(e),this._expiryTimestamp=t,this._client=i}get creationDate(){return new Date(this[wt.rawDataSymbol].created_at)}get expiryDate(){return(0,Kf.mapNullable)(this._expiryTimestamp,e=>new Date(e))}get moderatorId(){return this[wt.rawDataSymbol].moderator_id}async getModerator(){return(0,wt.checkRelationAssertion)(await this._client.users.getUserById(this[wt.rawDataSymbol].moderator_id))}get userId(){return this[wt.rawDataSymbol].user_id}async getUser(){return(0,wt.checkRelationAssertion)(await this._client.users.getUserById(this[wt.rawDataSymbol].user_id))}};zf.__decorate([(0,Kf.Enumerable)(!1)],ln.prototype,"_client",void 0);zf.__decorate([(0,Kf.Enumerable)(!1)],ln.prototype,"_expiryTimestamp",void 0);ln=zf.__decorate([(0,wt.rtfm)("api","HelixBanUser","userId")],ln);Pu.HelixBanUser=ln});var Zf=l(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.HelixBan=void 0;var ML=(y(),g(m)),ni=f(),FL=Cu(),Jf=class extends FL.HelixBanUser{static{n(this,"HelixBan")}constructor(e,t){super(e,e.expires_at||null,t)}get userName(){return this[ni.rawDataSymbol].user_login}get userDisplayName(){return this[ni.rawDataSymbol].user_name}get moderatorName(){return this[ni.rawDataSymbol].moderator_login}get moderatorDisplayName(){return this[ni.rawDataSymbol].moderator_name}get reason(){return this[ni.rawDataSymbol].reason||null}};Jf=ML.__decorate([(0,ni.rtfm)("api","HelixBan","userId")],Jf);Hu.HelixBan=Jf});var Xf=l(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.HelixBlockedTerm=void 0;var NL=(y(),g(m)),ot=f(),Yf=class extends ot.DataObject{static{n(this,"HelixBlockedTerm")}get broadcasterId(){return this[ot.rawDataSymbol].broadcaster_id}get creationDate(){return new Date(this[ot.rawDataSymbol].created_at)}get expirationDate(){return this[ot.rawDataSymbol].expires_at?new Date(this[ot.rawDataSymbol].expires_at):null}get id(){return this[ot.rawDataSymbol].id}get moderatorId(){return this[ot.rawDataSymbol].moderator_id}get text(){return this[ot.rawDataSymbol].text}get updatedDate(){return new Date(this[ot.rawDataSymbol].updated_at)}};Yf=NL.__decorate([(0,ot.rtfm)("api","HelixBlockedTerm","id")],Yf);Eu.HelixBlockedTerm=Yf});var em=l(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.HelixModerator=void 0;var Kq=(y(),g(m)),QL=S(),hr=f(),Au=class extends hr.DataObject{static{n(this,"HelixModerator")}constructor(e,t){super(e),this._client=t}get userId(){return this[hr.rawDataSymbol].user_id}get userName(){return this[hr.rawDataSymbol].user_login}get userDisplayName(){return this[hr.rawDataSymbol].user_name}async getUser(){return(0,hr.checkRelationAssertion)(await this._client.users.getUserById(this[hr.rawDataSymbol].user_id))}};Kq.__decorate([(0,QL.Enumerable)(!1)],Au.prototype,"_client",void 0);Au=Kq.__decorate([(0,hr.rtfm)("api","HelixModerator","userId")],Au);Tu.HelixModerator=Au});var tm=l(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.HelixShieldModeStatus=void 0;var Jq=(y(),g(m)),GL=S(),st=f(),Iu=class extends st.DataObject{static{n(this,"HelixShieldModeStatus")}constructor(e,t){super(e),this._client=t}get isActive(){return this[st.rawDataSymbol].is_active}get moderatorId(){return this[st.rawDataSymbol].moderator_id}get moderatorName(){return this[st.rawDataSymbol].moderator_login}get moderatorDisplayName(){return this[st.rawDataSymbol].moderator_name}async getModerator(){return(0,st.checkRelationAssertion)(await this._client.users.getUserById(this[st.rawDataSymbol].moderator_id))}get lastActivationDate(){return this[st.rawDataSymbol].last_activated_at===""?null:new Date(this[st.rawDataSymbol].last_activated_at)}};Jq.__decorate([(0,GL.Enumerable)(!1)],Iu.prototype,"_client",void 0);Iu=Jq.__decorate([(0,st.rtfm)("api","HelixShieldModeStatus")],Iu);Ru.HelixShieldModeStatus=Iu});var sm=l(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.HelixModerationApi=void 0;var VL=(y(),g(m)),rm=Q(),V=f(),im=Ee(),Gt=$q(),Zq=ne(),nm=X(),am=Z(),$L=L(),Yq=Wq(),WL=zq(),Xq=Zf(),zL=Cu(),eP=Xf(),tP=em(),rP=tm(),om=class extends $L.BaseApi{static{n(this,"HelixModerationApi")}async getBannedUsers(e,t){let i=await this._client.callApi({type:"helix",url:"moderation/banned",userId:(0,V.extractUserId)(e),scopes:["moderation:read"],query:{...(0,Gt.createModerationUserListQuery)(e,t),...(0,am.createPaginationQuery)(t)}});return(0,nm.createPaginatedResult)(i,Xq.HelixBan,this._client)}getBannedUsersPaginated(e){return new Zq.HelixPaginatedRequest({url:"moderation/banned",userId:(0,V.extractUserId)(e),scopes:["moderation:read"],query:(0,rm.createBroadcasterQuery)(e)},this._client,t=>new Xq.HelixBan(t,this._client),50)}async checkUserBan(e,t){let i=(0,V.extractUserId)(t);return(await this.getBannedUsers(e,{userId:i})).data.some(o=>o.userId===i)}async getModerators(e,t){let i=await this._client.callApi({type:"helix",url:"moderation/moderators",userId:(0,V.extractUserId)(e),scopes:["moderation:read","channel:manage:moderators"],query:{...(0,Gt.createModerationUserListQuery)(e,t),...(0,am.createPaginationQuery)(t)}});return(0,nm.createPaginatedResult)(i,tP.HelixModerator,this._client)}getModeratorsPaginated(e){return new Zq.HelixPaginatedRequest({url:"moderation/moderators",userId:(0,V.extractUserId)(e),scopes:["moderation:read","channel:manage:moderators"],query:(0,rm.createBroadcasterQuery)(e)},this._client,t=>new tP.HelixModerator(t,this._client))}async checkUserMod(e,t){let i=(0,V.extractUserId)(t);return(await this.getModerators(e,{userId:i})).data.some(o=>o.userId===i)}async addModerator(e,t){await this._client.callApi({type:"helix",url:"moderation/moderators",method:"POST",userId:(0,V.extractUserId)(e),scopes:["channel:manage:moderators"],query:(0,Gt.createModeratorModifyQuery)(e,t)})}async removeModerator(e,t){await this._client.callApi({type:"helix",url:"moderation/moderators",method:"DELETE",userId:(0,V.extractUserId)(e),scopes:["channel:manage:moderators"],query:(0,Gt.createModeratorModifyQuery)(e,t)})}async checkAutoModStatus(e,t){return(await this._client.callApi({type:"helix",url:"moderation/enforcements/status",method:"POST",userId:(0,V.extractUserId)(e),scopes:["moderation:read"],query:(0,rm.createBroadcasterQuery)(e),jsonBody:{data:t}})).data.map(a=>new WL.HelixAutoModStatus(a))}async processHeldAutoModMessage(e,t,i){await this._client.callApi({type:"helix",url:"moderation/automod/message",method:"POST",userId:(0,V.extractUserId)(e),scopes:["moderator:manage:automod"],jsonBody:(0,Gt.createAutoModProcessBody)(e,t,i)})}async getAutoModSettings(e){let t=(0,V.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/automod/settings",userId:t,scopes:["moderator:read:automod_settings"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(t)})).data.map(a=>new Yq.HelixAutoModSettings(a))}async updateAutoModSettings(e,t){let i=(0,V.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/automod/settings",method:"PUT",userId:i,scopes:["moderator:manage:automod_settings"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(i),jsonBody:(0,Gt.createAutoModSettingsBody)(t)})).data.map(o=>new Yq.HelixAutoModSettings(o))}async banUser(e,t){let i=(0,V.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/bans",method:"POST",userId:i,scopes:["moderator:manage:banned_users"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(i),jsonBody:(0,Gt.createBanUserBody)(t)})).data.map(o=>new zL.HelixBanUser(o,o.end_time,this._client))}async unbanUser(e,t){let i=(0,V.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/bans",method:"DELETE",userId:i,scopes:["moderator:manage:banned_users"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(i),...(0,im.createSingleKeyQuery)("user_id",(0,V.extractUserId)(t))}})}async getBlockedTerms(e,t){let i=(0,V.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"moderation/blocked_terms",userId:i,scopes:["moderator:read:blocked_terms"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(i),...(0,am.createPaginationQuery)(t)}});return(0,nm.createPaginatedResult)(a,eP.HelixBlockedTerm,this._client)}async addBlockedTerm(e,t){let i=(0,V.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/blocked_terms",method:"POST",userId:i,scopes:["moderator:manage:blocked_terms"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(i),jsonBody:{text:t}})).data.map(o=>new eP.HelixBlockedTerm(o))}async removeBlockedTerm(e,t,i){let a=(0,V.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/blocked_terms",method:"DELETE",userId:a,scopes:["moderator:manage:blocked_terms"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(a),id:i}})}async deleteChatMessages(e,t){let i=(0,V.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/chat",method:"DELETE",userId:i,scopes:["moderator:manage:chat_messages"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(i),...(0,im.createSingleKeyQuery)("message_id",t)}})}async getShieldModeStatus(e){let t=(0,V.extractUserId)(e),i=await this._client.callApi({type:"helix",url:"moderation/shield_mode",method:"GET",userId:t,scopes:["moderator:read:shield_mode","moderator:manage:shield_mode"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(t)});return new rP.HelixShieldModeStatus(i.data[0],this._client)}async updateShieldModeStatus(e,t){let i=(0,V.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"moderation/shield_mode",method:"PUT",userId:i,scopes:["moderator:manage:shield_mode"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(i),jsonBody:(0,Gt.createUpdateShieldModeStatusBody)(t)});return new rP.HelixShieldModeStatus(a.data[0],this._client)}_createModeratorActionQuery(e){return(0,im.createModeratorActionQuery)(e,this._getUserContextIdWithDefault(e))}};om=VL.__decorate([(0,V.rtfm)("api","HelixModerationApi")],om);Du.HelixModerationApi=om});var nP=l(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.createPollEndBody=ai.createPollBody=void 0;var iP=f();function KL(r,e){var t;return{broadcaster_id:(0,iP.extractUserId)(r),title:e.title,choices:e.choices.map(i=>({title:i})),duration:e.duration,channel_points_voting_enabled:e.channelPointsPerVote!=null,channel_points_per_vote:(t=e.channelPointsPerVote)!==null&&t!==void 0?t:0}}n(KL,"createPollBody");ai.createPollBody=KL;function JL(r,e,t){return{broadcaster_id:(0,iP.extractUserId)(r),id:e,status:t?"TERMINATED":"ARCHIVED"}}n(JL,"createPollEndBody");ai.createPollEndBody=JL});var lm=l(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.HelixPollChoice=void 0;var ZL=(y(),g(m)),oi=f(),um=class extends oi.DataObject{static{n(this,"HelixPollChoice")}get id(){return this[oi.rawDataSymbol].id}get title(){return this[oi.rawDataSymbol].title}get totalVotes(){return this[oi.rawDataSymbol].votes}get channelPointsVotes(){return this[oi.rawDataSymbol].channel_points_votes}};um=ZL.__decorate([(0,oi.rtfm)("api","HelixPollChoice","id")],um);Ou.HelixPollChoice=um});var cm=l(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.HelixPoll=void 0;var aP=(y(),g(m)),YL=S(),ye=f(),XL=lm(),Bu=class extends ye.DataObject{static{n(this,"HelixPoll")}constructor(e,t){super(e),this._client=t}get id(){return this[ye.rawDataSymbol].id}get broadcasterId(){return this[ye.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[ye.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[ye.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,ye.checkRelationAssertion)(await this._client.users.getUserById(this[ye.rawDataSymbol].broadcaster_id))}get title(){return this[ye.rawDataSymbol].title}get isChannelPointsVotingEnabled(){return this[ye.rawDataSymbol].channel_points_voting_enabled}get channelPointsPerVote(){return this[ye.rawDataSymbol].channel_points_per_vote}get status(){return this[ye.rawDataSymbol].status}get durationInSeconds(){return this[ye.rawDataSymbol].duration}get startDate(){return new Date(this[ye.rawDataSymbol].started_at)}get endDate(){return new Date(this.startDate.getTime()+this[ye.rawDataSymbol].duration*1e3)}get choices(){return this[ye.rawDataSymbol].choices.map(e=>new XL.HelixPollChoice(e))}};aP.__decorate([(0,YL.Enumerable)(!1)],Bu.prototype,"_client",void 0);Bu=aP.__decorate([(0,ye.rtfm)("api","HelixPoll","id")],Bu);Uu.HelixPoll=Bu});var pm=l(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.HelixPollApi=void 0;var eM=(y(),g(m)),oP=Q(),si=f(),tM=Ee(),sP=nP(),rM=ne(),iM=X(),nM=Z(),aM=L(),cn=cm(),dm=class extends aM.BaseApi{static{n(this,"HelixPollApi")}async getPolls(e,t){let i=await this._client.callApi({type:"helix",url:"polls",userId:(0,si.extractUserId)(e),scopes:["channel:read:polls"],query:{...(0,oP.createBroadcasterQuery)(e),...(0,nM.createPaginationQuery)(t)}});return(0,iM.createPaginatedResult)(i,cn.HelixPoll,this._client)}getPollsPaginated(e){return new rM.HelixPaginatedRequest({url:"polls",userId:(0,si.extractUserId)(e),scopes:["channel:read:polls"],query:(0,oP.createBroadcasterQuery)(e)},this._client,t=>new cn.HelixPoll(t,this._client),20)}async getPollsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"polls",userId:(0,si.extractUserId)(e),scopes:["channel:read:polls"],query:(0,tM.createGetByIdsQuery)(e,t)})).data.map(a=>new cn.HelixPoll(a,this._client)):[]}async getPollById(e,t){let i=await this.getPollsByIds(e,[t]);return i.length?i[0]:null}async createPoll(e,t){let i=await this._client.callApi({type:"helix",url:"polls",method:"POST",userId:(0,si.extractUserId)(e),scopes:["channel:manage:polls"],jsonBody:(0,sP.createPollBody)(e,t)});return new cn.HelixPoll(i.data[0],this._client)}async endPoll(e,t,i=!0){let a=await this._client.callApi({type:"helix",url:"polls",method:"PATCH",userId:(0,si.extractUserId)(e),scopes:["channel:manage:polls"],jsonBody:(0,sP.createPollEndBody)(e,t,i)});return new cn.HelixPoll(a.data[0],this._client)}};dm=eM.__decorate([(0,si.rtfm)("api","HelixPollApi")],dm);ju.HelixPollApi=dm});var lP=l(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.createEndPredictionBody=ui.createPredictionBody=void 0;var uP=f();function oM(r,e){return{broadcaster_id:(0,uP.extractUserId)(r),title:e.title,outcomes:e.outcomes.map(t=>({title:t})),prediction_window:e.autoLockAfter}}n(oM,"createPredictionBody");ui.createPredictionBody=oM;function sM(r,e,t,i){return{broadcaster_id:(0,uP.extractUserId)(r),id:e,status:t,winning_outcome_id:i}}n(sM,"createEndPredictionBody");ui.createEndPredictionBody=sM});var hm=l(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.HelixPredictor=void 0;var cP=(y(),g(m)),uM=S(),Vt=f(),ku=class extends Vt.DataObject{static{n(this,"HelixPredictor")}constructor(e,t){super(e),this._client=t}get userId(){return this[Vt.rawDataSymbol].id}get userName(){return this[Vt.rawDataSymbol].login}get userDisplayName(){return this[Vt.rawDataSymbol].name}async getUser(){return await this._client.users.getUserById(this[Vt.rawDataSymbol].id)}get channelPointsUsed(){return this[Vt.rawDataSymbol].channel_points_used}get channelPointsWon(){return this[Vt.rawDataSymbol].channel_points_won}};cP.__decorate([(0,uM.Enumerable)(!1)],ku.prototype,"_client",void 0);ku=cP.__decorate([(0,Vt.rtfm)("api","HelixPredictor","userId")],ku);Lu.HelixPredictor=ku});var fm=l(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.HelixPredictionOutcome=void 0;var dP=(y(),g(m)),lM=S(),$t=f(),cM=hm(),Mu=class extends $t.DataObject{static{n(this,"HelixPredictionOutcome")}constructor(e,t){super(e),this._client=t}get id(){return this[$t.rawDataSymbol].id}get title(){return this[$t.rawDataSymbol].title}get users(){return this[$t.rawDataSymbol].users}get totalChannelPoints(){return this[$t.rawDataSymbol].channel_points}get color(){return this[$t.rawDataSymbol].color}get topPredictors(){var e,t;return(t=(e=this[$t.rawDataSymbol].top_predictors)===null||e===void 0?void 0:e.map(i=>new cM.HelixPredictor(i,this._client)))!==null&&t!==void 0?t:[]}};dP.__decorate([(0,lM.Enumerable)(!1)],Mu.prototype,"_client",void 0);Mu=dP.__decorate([(0,$t.rtfm)("api","HelixPredictionOutcome","id")],Mu);Fu.HelixPredictionOutcome=Mu});var mm=l(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.HelixPrediction=void 0;var hP=(y(),g(m)),dM=S(),$=f(),pP=fm(),Nu=class extends $.DataObject{static{n(this,"HelixPrediction")}constructor(e,t){super(e),this._client=t}get id(){return this[$.rawDataSymbol].id}get broadcasterId(){return this[$.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[$.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[$.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,$.checkRelationAssertion)(await this._client.users.getUserById(this[$.rawDataSymbol].broadcaster_id))}get title(){return this[$.rawDataSymbol].title}get status(){return this[$.rawDataSymbol].status}get autoLockAfter(){return this[$.rawDataSymbol].prediction_window}get creationDate(){return new Date(this[$.rawDataSymbol].created_at)}get endDate(){return this[$.rawDataSymbol].ended_at?new Date(this[$.rawDataSymbol].ended_at):null}get lockDate(){return this[$.rawDataSymbol].locked_at?new Date(this[$.rawDataSymbol].locked_at):null}get outcomes(){return this[$.rawDataSymbol].outcomes.map(e=>new pP.HelixPredictionOutcome(e,this._client))}get winningOutcomeId(){return this[$.rawDataSymbol].winning_outcome_id||null}get winningOutcome(){if(!this[$.rawDataSymbol].winning_outcome_id)return null;let e=this[$.rawDataSymbol].outcomes.find(t=>t.id===this[$.rawDataSymbol].winning_outcome_id);if(!e)throw new $.HellFreezesOverError("Winning outcome not found in outcomes array");return new pP.HelixPredictionOutcome(e,this._client)}};hP.__decorate([(0,dM.Enumerable)(!1)],Nu.prototype,"_client",void 0);Nu=hP.__decorate([(0,$.rtfm)("api","HelixPrediction","id")],Nu);Qu.HelixPrediction=Nu});var _m=l(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.HelixPredictionApi=void 0;var pM=(y(),g(m)),fP=Q(),li=f(),hM=Ee(),mP=lP(),fM=ne(),mM=X(),yM=Z(),_M=L(),dn=mm(),ym=class extends _M.BaseApi{static{n(this,"HelixPredictionApi")}async getPredictions(e,t){let i=await this._client.callApi({type:"helix",url:"predictions",userId:(0,li.extractUserId)(e),scopes:["channel:read:predictions"],query:{...(0,fP.createBroadcasterQuery)(e),...(0,yM.createPaginationQuery)(t)}});return(0,mM.createPaginatedResult)(i,dn.HelixPrediction,this._client)}getPredictionsPaginated(e){return new fM.HelixPaginatedRequest({url:"predictions",userId:(0,li.extractUserId)(e),scopes:["channel:read:predictions"],query:(0,fP.createBroadcasterQuery)(e)},this._client,t=>new dn.HelixPrediction(t,this._client),20)}async getPredictionsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"predictions",userId:(0,li.extractUserId)(e),scopes:["channel:read:predictions"],query:(0,hM.createGetByIdsQuery)(e,t)})).data.map(a=>new dn.HelixPrediction(a,this._client)):[]}async getPredictionById(e,t){let i=await this.getPredictionsByIds(e,[t]);return i.length?i[0]:null}async createPrediction(e,t){let i=await this._client.callApi({type:"helix",url:"predictions",method:"POST",userId:(0,li.extractUserId)(e),scopes:["channel:manage:predictions"],jsonBody:(0,mP.createPredictionBody)(e,t)});return new dn.HelixPrediction(i.data[0],this._client)}async lockPrediction(e,t){return await this._endPrediction(e,t,"LOCKED")}async resolvePrediction(e,t,i){return await this._endPrediction(e,t,"RESOLVED",i)}async cancelPrediction(e,t){return await this._endPrediction(e,t,"CANCELED")}async _endPrediction(e,t,i,a){let o=await this._client.callApi({type:"helix",url:"predictions",method:"PATCH",userId:(0,li.extractUserId)(e),scopes:["channel:manage:predictions"],jsonBody:(0,mP.createEndPredictionBody)(e,t,i,a)});return new dn.HelixPrediction(o.data[0],this._client)}};ym=pM.__decorate([(0,li.rtfm)("api","HelixPredictionApi")],ym);Gu.HelixPredictionApi=ym});var _P=l(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.createRaidStartQuery=void 0;var yP=f();function gM(r,e){return{from_broadcaster_id:(0,yP.extractUserId)(r),to_broadcaster_id:(0,yP.extractUserId)(e)}}n(gM,"createRaidStartQuery");Vu.createRaidStartQuery=gM});var bm=l(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.HelixRaid=void 0;var bM=(y(),g(m)),$u=f(),gm=class extends $u.DataObject{static{n(this,"HelixRaid")}get creationDate(){return new Date(this[$u.rawDataSymbol].created_at)}get targetIsMature(){return this[$u.rawDataSymbol].is_mature}};gm=bM.__decorate([(0,$u.rtfm)("api","HelixRaid")],gm);Wu.HelixRaid=gm});var xm=l(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.HelixRaidApi=void 0;var vM=(y(),g(m)),wM=Q(),vm=f(),xM=_P(),SM=L(),qM=bm(),wm=class extends SM.BaseApi{static{n(this,"HelixRaidApi")}async startRaid(e,t){let i=await this._client.callApi({type:"helix",url:"raids",method:"POST",userId:(0,vm.extractUserId)(e),scopes:["channel:manage:raids"],query:(0,xM.createRaidStartQuery)(e,t)});return new qM.HelixRaid(i.data[0])}async cancelRaid(e){await this._client.callApi({type:"helix",url:"raids",method:"DELETE",userId:(0,vm.extractUserId)(e),scopes:["channel:manage:raids"],query:(0,wM.createBroadcasterQuery)(e)})}};wm=vM.__decorate([(0,vm.rtfm)("api","HelixRaidApi")],wm);zu.HelixRaidApi=wm});var Sm=l(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createScheduleSegmentUpdateBody=Ne.createScheduleSegmentModifyQuery=Ne.createScheduleSegmentBody=Ne.createScheduleSettingsUpdateQuery=Ne.createScheduleQuery=void 0;var Ku=f();function PM(r,e){var t;return{broadcaster_id:(0,Ku.extractUserId)(r),start_time:e?.startDate,utc_offset:(t=e?.utcOffset)===null||t===void 0?void 0:t.toString()}}n(PM,"createScheduleQuery");Ne.createScheduleQuery=PM;function CM(r,e){return e.vacation?{broadcaster_id:(0,Ku.extractUserId)(r),is_vacation_enabled:"true",vacation_start_time:e.vacation.startDate,vacation_end_time:e.vacation.endDate,timezone:e.vacation.timezone}:{broadcaster_id:(0,Ku.extractUserId)(r),is_vacation_enabled:"false"}}n(CM,"createScheduleSettingsUpdateQuery");Ne.createScheduleSettingsUpdateQuery=CM;function HM(r){return{start_time:r.startDate,timezone:r.timezone,is_recurring:r.isRecurring,duration:r.duration,category_id:r.categoryId,title:r.title}}n(HM,"createScheduleSegmentBody");Ne.createScheduleSegmentBody=HM;function EM(r,e){return{broadcaster_id:(0,Ku.extractUserId)(r),id:e}}n(EM,"createScheduleSegmentModifyQuery");Ne.createScheduleSegmentModifyQuery=EM;function AM(r){return{start_time:r.startDate,timezone:r.timezone,is_canceled:r.isCanceled,duration:r.duration,category_id:r.categoryId,title:r.title}}n(AM,"createScheduleSegmentUpdateBody");Ne.createScheduleSegmentUpdateBody=AM});var pn=l(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.HelixScheduleSegment=void 0;var gP=(y(),g(m)),bP=S(),Ge=f(),Ju=class extends Ge.DataObject{static{n(this,"HelixScheduleSegment")}constructor(e,t){super(e),this._client=t}get id(){return this[Ge.rawDataSymbol].id}get startDate(){return new Date(this[Ge.rawDataSymbol].start_time)}get endDate(){return new Date(this[Ge.rawDataSymbol].end_time)}get title(){return this[Ge.rawDataSymbol].title}get cancelEndDate(){return(0,bP.mapNullable)(this[Ge.rawDataSymbol].canceled_until,e=>new Date(e))}get categoryId(){var e,t;return(t=(e=this[Ge.rawDataSymbol].category)===null||e===void 0?void 0:e.id)!==null&&t!==void 0?t:null}get categoryName(){var e,t;return(t=(e=this[Ge.rawDataSymbol].category)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:null}async getCategory(){var e;let t=(e=this[Ge.rawDataSymbol].category)===null||e===void 0?void 0:e.id;return t?await this._client.games.getGameById(t):null}get isRecurring(){return this[Ge.rawDataSymbol].is_recurring}};gP.__decorate([(0,bP.Enumerable)(!1)],Ju.prototype,"_client",void 0);Ju=gP.__decorate([(0,Ge.rtfm)("api","HelixScheduleSegment","id")],Ju);Zu.HelixScheduleSegment=Ju});var Pm=l(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.HelixPaginatedScheduleSegmentRequest=void 0;var TM=(y(),g(m)),IM=f(),RM=Sm(),DM=ne(),OM=pn(),qm=class extends DM.HelixPaginatedRequest{static{n(this,"HelixPaginatedScheduleSegmentRequest")}constructor(e,t,i){super({url:"schedule",query:(0,RM.createScheduleQuery)(e,i)},t,a=>new OM.HelixScheduleSegment(a,t),25)}async _fetchData(e={}){var t;let i=await super._fetchData(e);return{data:(t=i.data.segments)!==null&&t!==void 0?t:[],pagination:i.pagination}}};qm=TM.__decorate([(0,IM.rtfm)("api","HelixPaginatedScheduleSegmentRequest")],qm);Yu.HelixPaginatedScheduleSegmentRequest=qm});var Cm=l(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.HelixSchedule=void 0;var vP=(y(),g(m)),BM=S(),ut=f(),UM=pn(),Xu=class extends ut.DataObject{static{n(this,"HelixSchedule")}constructor(e,t){super(e),this._client=t}get segments(){var e,t;return(t=(e=this[ut.rawDataSymbol].segments)===null||e===void 0?void 0:e.map(i=>new UM.HelixScheduleSegment(i,this._client)))!==null&&t!==void 0?t:[]}get broadcasterId(){return this[ut.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[ut.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[ut.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,ut.checkRelationAssertion)(await this._client.users.getUserById(this[ut.rawDataSymbol].broadcaster_id))}get vacationStartDate(){var e;let t=(e=this[ut.rawDataSymbol].vacation)===null||e===void 0?void 0:e.start_time;return t?new Date(t):null}get vacationEndDate(){var e;let t=(e=this[ut.rawDataSymbol].vacation)===null||e===void 0?void 0:e.end_time;return t?new Date(t):null}};vP.__decorate([(0,BM.Enumerable)(!1)],Xu.prototype,"_client",void 0);Xu=vP.__decorate([(0,ut.rtfm)("api","HelixSchedule","broadcasterId")],Xu);el.HelixSchedule=Xu});var Am=l(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.HelixScheduleApi=void 0;var wP=Q(),ci=f(),jM=Ee(),di=Sm(),kM=Z(),LM=L(),MM=Pm(),FM=Cm(),Hm=pn(),Em=class extends LM.BaseApi{static{n(this,"HelixScheduleApi")}async getSchedule(e,t){let i=await this._client.callApi({type:"helix",url:"schedule",userId:(0,ci.extractUserId)(e),query:{...(0,di.createScheduleQuery)(e,t),...(0,kM.createPaginationQuery)(t)}});return{data:new FM.HelixSchedule(i.data,this._client),cursor:i.pagination.cursor}}getScheduleSegmentsPaginated(e,t){return new MM.HelixPaginatedScheduleSegmentRequest(e,this._client,t)}async getScheduleSegmentsByIds(e,t){var i,a;return(a=(i=(await this._client.callApi({type:"helix",url:"schedule",userId:(0,ci.extractUserId)(e),query:(0,jM.createGetByIdsQuery)(e,t)})).data.segments)===null||i===void 0?void 0:i.map(s=>new Hm.HelixScheduleSegment(s,this._client)))!==null&&a!==void 0?a:[]}async getScheduleSegmentById(e,t){let i=await this.getScheduleSegmentsByIds(e,[t]);return i.length?i[0]:null}async getScheduleAsIcal(e){return await this._client.callApi({type:"helix",url:"schedule/icalendar",query:(0,wP.createBroadcasterQuery)(e)})}async updateScheduleSettings(e,t){await this._client.callApi({type:"helix",url:"schedule/settings",method:"PATCH",userId:(0,ci.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,di.createScheduleSettingsUpdateQuery)(e,t)})}async createScheduleSegment(e,t){let i=await this._client.callApi({type:"helix",url:"schedule/segment",method:"POST",userId:(0,ci.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,wP.createBroadcasterQuery)(e),jsonBody:(0,di.createScheduleSegmentBody)(t)});return new Hm.HelixScheduleSegment(i.data.segments[0],this._client)}async updateScheduleSegment(e,t,i){let a=await this._client.callApi({type:"helix",url:"schedule/segment",method:"PATCH",userId:(0,ci.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,di.createScheduleSegmentModifyQuery)(e,t),jsonBody:(0,di.createScheduleSegmentUpdateBody)(i)});return new Hm.HelixScheduleSegment(a.data.segments[0],this._client)}async deleteScheduleSegment(e,t){await this._client.callApi({type:"helix",url:"schedule/segment",method:"DELETE",userId:(0,ci.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,di.createScheduleSegmentModifyQuery)(e,t)})}};tl.HelixScheduleApi=Em});var xP=l(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.createSearchChannelsQuery=void 0;function NM(r,e){var t;return{query:r,live_only:(t=e.liveOnly)===null||t===void 0?void 0:t.toString()}}n(NM,"createSearchChannelsQuery");rl.createSearchChannelsQuery=NM});var Tm=l(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.HelixChannelSearchResult=void 0;var SP=(y(),g(m)),QM=S(),ue=f(),il=class extends ue.DataObject{static{n(this,"HelixChannelSearchResult")}constructor(e,t){super(e),this._client=t}get language(){return this[ue.rawDataSymbol].broadcaster_language}get id(){return this[ue.rawDataSymbol].id}get name(){return this[ue.rawDataSymbol].broadcaster_login}get displayName(){return this[ue.rawDataSymbol].display_name}async getUser(){return(0,ue.checkRelationAssertion)(await this._client.users.getUserById(this[ue.rawDataSymbol].id))}get gameId(){return this[ue.rawDataSymbol].game_id}get gameName(){return this[ue.rawDataSymbol].game_name}async getGame(){return this[ue.rawDataSymbol].game_id?(0,ue.checkRelationAssertion)(await this._client.games.getGameById(this[ue.rawDataSymbol].game_id)):null}get isLive(){return this[ue.rawDataSymbol].is_live}get tags(){return this[ue.rawDataSymbol].tags}get thumbnailUrl(){return this[ue.rawDataSymbol].thumbnail_url}get startDate(){return this[ue.rawDataSymbol].is_live?new Date(this[ue.rawDataSymbol].started_at):null}};SP.__decorate([(0,QM.Enumerable)(!1)],il.prototype,"_client",void 0);il=SP.__decorate([(0,ue.rtfm)("api","HelixChannelSearchResult","id")],il);nl.HelixChannelSearchResult=il});var Rm=l(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.HelixSearchApi=void 0;var GM=(y(),g(m)),VM=f(),qP=xP(),PP=ne(),CP=X(),HP=Z(),$M=L(),EP=du(),AP=Tm(),Im=class extends $M.BaseApi{static{n(this,"HelixSearchApi")}async searchCategories(e,t){let i=await this._client.callApi({type:"helix",url:"search/categories",query:{query:e,...(0,HP.createPaginationQuery)(t)}});return(0,CP.createPaginatedResult)(i,EP.HelixGame,this._client)}searchCategoriesPaginated(e){return new PP.HelixPaginatedRequest({url:"search/categories",query:{query:e}},this._client,t=>new EP.HelixGame(t,this._client))}async searchChannels(e,t={}){let i=await this._client.callApi({type:"helix",url:"search/channels",query:{...(0,qP.createSearchChannelsQuery)(e,t),...(0,HP.createPaginationQuery)(t)}});return(0,CP.createPaginatedResult)(i,AP.HelixChannelSearchResult,this._client)}searchChannelsPaginated(e,t={}){return new PP.HelixPaginatedRequest({url:"search/channels",query:(0,qP.createSearchChannelsQuery)(e,t)},this._client,i=>new AP.HelixChannelSearchResult(i,this._client))}};Im=GM.__decorate([(0,VM.rtfm)("api","HelixSearchApi")],Im);al.HelixSearchApi=Im});var Om=l(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.StreamNotLiveError=void 0;var WM=f(),Dm=class extends WM.CustomError{static{n(this,"StreamNotLiveError")}constructor(e){super("Your stream needs to be live to do this",e)}};ol.StreamNotLiveError=Dm});var TP=l(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.createVideoQuery=Wt.createStreamMarkerBody=Wt.createStreamQuery=void 0;var zM=f();function KM(r){return{game_id:r.game,language:r.language,type:r.type,user_id:r.userId,user_login:r.userName}}n(KM,"createStreamQuery");Wt.createStreamQuery=KM;function JM(r,e){return{user_id:(0,zM.extractUserId)(r),description:e}}n(JM,"createStreamMarkerBody");Wt.createStreamMarkerBody=JM;function ZM(r){return{video_id:r}}n(ZM,"createVideoQuery");Wt.createVideoQuery=ZM});var Bm=l(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.HelixStream=void 0;var IP=(y(),g(m)),YM=S(),W=f(),sl=class extends W.DataObject{static{n(this,"HelixStream")}constructor(e,t){super(e),this._client=t}get id(){return this[W.rawDataSymbol].id}get userId(){return this[W.rawDataSymbol].user_id}get userName(){return this[W.rawDataSymbol].user_login}get userDisplayName(){return this[W.rawDataSymbol].user_name}async getUser(){return(0,W.checkRelationAssertion)(await this._client.users.getUserById(this[W.rawDataSymbol].user_id))}get gameId(){return this[W.rawDataSymbol].game_id}get gameName(){return this[W.rawDataSymbol].game_name}async getGame(){return this[W.rawDataSymbol].game_id?(0,W.checkRelationAssertion)(await this._client.games.getGameById(this[W.rawDataSymbol].game_id)):null}get type(){return this[W.rawDataSymbol].type}get title(){return this[W.rawDataSymbol].title}get viewers(){return this[W.rawDataSymbol].viewer_count}get startDate(){return new Date(this[W.rawDataSymbol].started_at)}get language(){return this[W.rawDataSymbol].language}get thumbnailUrl(){return this[W.rawDataSymbol].thumbnail_url}getThumbnailUrl(e,t){return this[W.rawDataSymbol].thumbnail_url.replace("{width}",e.toString()).replace("{height}",t.toString())}get tags(){return this[W.rawDataSymbol].tags}get isMature(){return this[W.rawDataSymbol].is_mature}};IP.__decorate([(0,YM.Enumerable)(!1)],sl.prototype,"_client",void 0);sl=IP.__decorate([(0,W.rtfm)("api","HelixStream","id")],sl);ul.HelixStream=sl});var dl=l(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.HelixStreamMarker=void 0;var RP=(y(),g(m)),XM=S(),pi=f(),ll=class extends pi.DataObject{static{n(this,"HelixStreamMarker")}constructor(e,t){super(e),this._client=t}get id(){return this[pi.rawDataSymbol].id}get creationDate(){return new Date(this[pi.rawDataSymbol].created_at)}get description(){return this[pi.rawDataSymbol].description}get positionInSeconds(){return this[pi.rawDataSymbol].position_seconds}};RP.__decorate([(0,XM.Enumerable)(!1)],ll.prototype,"_client",void 0);ll=RP.__decorate([(0,pi.rtfm)("api","HelixStreamMarker","id")],ll);cl.HelixStreamMarker=ll});var km=l(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.HelixStreamMarkerWithVideo=void 0;var eF=(y(),g(m)),Um=f(),tF=dl(),jm=class extends tF.HelixStreamMarker{static{n(this,"HelixStreamMarkerWithVideo")}constructor(e,t,i){super(e,i),this._videoId=t}get url(){return this[Um.rawDataSymbol].URL}get videoId(){return this._videoId}async getVideo(){return(0,Um.checkRelationAssertion)(await this._client.videos.getVideoById(this._videoId))}};jm=eF.__decorate([(0,Um.rtfm)("api","HelixStreamMarkerWithVideo","id")],jm);pl.HelixStreamMarkerWithVideo=jm});var Mm=l(yl=>{"use strict";var fi;Object.defineProperty(yl,"__esModule",{value:!0});yl.HelixStreamApi=void 0;var Lm=(y(),g(m)),hn=S(),DP=Q(),Pe=f(),rF=Om(),hl=Ee(),hi=TP(),OP=Ut(),fl=ne(),BP=X(),ml=Z(),iF=L(),fr=Bm(),nF=dl(),aF=km(),fn=fi=class extends iF.BaseApi{static{n(this,"HelixStreamApi")}constructor(){super(...arguments),this._getStreamByUserIdBatcher=new OP.HelixRequestBatcher({url:"streams"},"user_id","user_id",this._client,e=>new fr.HelixStream(e,this._client)),this._getStreamByUserNameBatcher=new OP.HelixRequestBatcher({url:"streams"},"user_login","user_login",this._client,e=>new fr.HelixStream(e,this._client))}async getStreams(e={}){let t=await this._client.callApi({url:"streams",type:"helix",query:{...(0,hi.createStreamQuery)(e),...(0,ml.createPaginationQuery)(e)}});return(0,BP.createPaginatedResult)(t,fr.HelixStream,this._client)}getStreamsPaginated(e={}){return new fl.HelixPaginatedRequest({url:"streams",query:(0,hi.createStreamQuery)(e)},this._client,t=>new fr.HelixStream(t,this._client))}async getStreamsByUserNames(e){return(await this.getStreams({userName:e.map(Pe.extractUserName)})).data}async getStreamByUserName(e){var t;return(t=(await this.getStreamsByUserNames([e]))[0])!==null&&t!==void 0?t:null}async getStreamByUserNameBatched(e){return await this._getStreamByUserNameBatcher.request((0,Pe.extractUserName)(e))}async getStreamsByUserIds(e){return(await this.getStreams({userId:e.map(Pe.extractUserId)})).data}async getStreamByUserId(e){let t=(0,Pe.extractUserId)(e),i=await this._client.callApi({url:"streams",type:"helix",userId:t,query:(0,hi.createStreamQuery)({userId:t})});return(0,hn.mapNullable)(i.data[0],a=>new fr.HelixStream(a,this._client))}async getStreamByUserIdBatched(e){return await this._getStreamByUserIdBatcher.request((0,Pe.extractUserId)(e))}async getStreamMarkersForUser(e,t){var i;let a=await this._client.callApi({url:"streams/markers",type:"helix",query:{...(0,hl.createUserQuery)(e),...(0,ml.createPaginationQuery)(t)},userId:(0,Pe.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0});return{data:(0,hn.flatten)(a.data.map(o=>fi._mapGetStreamMarkersResult(o,this._client))),cursor:(i=a.pagination)===null||i===void 0?void 0:i.cursor}}getStreamMarkersForUserPaginated(e){return new fl.HelixPaginatedRequest({url:"streams/markers",query:(0,hl.createUserQuery)(e),userId:(0,Pe.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0},this._client,t=>fi._mapGetStreamMarkersResult(t,this._client))}async getStreamMarkersForVideo(e,t,i){var a;let o=await this._client.callApi({url:"streams/markers",type:"helix",query:{...(0,hi.createVideoQuery)(t),...(0,ml.createPaginationQuery)(i)},userId:(0,Pe.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0});return{data:(0,hn.flatten)(o.data.map(s=>fi._mapGetStreamMarkersResult(s,this._client))),cursor:(a=o.pagination)===null||a===void 0?void 0:a.cursor}}getStreamMarkersForVideoPaginated(e,t){return new fl.HelixPaginatedRequest({url:"streams/markers",query:(0,hi.createVideoQuery)(t),userId:(0,Pe.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0},this._client,i=>fi._mapGetStreamMarkersResult(i,this._client))}async createStreamMarker(e,t){try{let i=await this._client.callApi({url:"streams/markers",method:"POST",type:"helix",userId:(0,Pe.extractUserId)(e),scopes:["channel:manage:broadcast"],canOverrideScopedUserContext:!0,jsonBody:(0,hi.createStreamMarkerBody)(e,t)});return new nF.HelixStreamMarker(i.data[0],this._client)}catch(i){throw i instanceof DP.HttpStatusCodeError&&i.statusCode===404?new rF.StreamNotLiveError({cause:i}):i}}async getStreamKey(e){let t=(0,Pe.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"streams/key",userId:t,scopes:["channel:read:stream_key"],query:(0,DP.createBroadcasterQuery)(e)})).data[0].stream_key}async getFollowedStreams(e,t){let i=(0,Pe.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"streams/followed",userId:i,scopes:["user:read:follows"],query:{...(0,hl.createSingleKeyQuery)("user_id",i),...(0,ml.createPaginationQuery)(t)}});return(0,BP.createPaginatedResult)(a,fr.HelixStream,this._client)}getFollowedStreamsPaginated(e){let t=(0,Pe.extractUserId)(e);return new fl.HelixPaginatedRequest({url:"streams/followed",userId:t,scopes:["user:read:follows"],query:(0,hl.createSingleKeyQuery)("user_id",t)},this._client,i=>new fr.HelixStream(i,this._client))}static _mapGetStreamMarkersResult(e,t){return e.videos.reduce((i,a)=>[...i,...a.markers.map(o=>new aF.HelixStreamMarkerWithVideo(o,a.video_id,t))],[])}};Lm.__decorate([(0,hn.Enumerable)(!1)],fn.prototype,"_getStreamByUserIdBatcher",void 0);Lm.__decorate([(0,hn.Enumerable)(!1)],fn.prototype,"_getStreamByUserNameBatcher",void 0);fn=fi=Lm.__decorate([(0,Pe.rtfm)("api","HelixStreamApi")],fn);yl.HelixStreamApi=fn});var jP=l(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.createSubscriptionCheckQuery=void 0;var UP=f();function oF(r,e){return{broadcaster_id:(0,UP.extractUserId)(r),user_id:(0,UP.extractUserId)(e)}}n(oF,"createSubscriptionCheckQuery");_l.createSubscriptionCheckQuery=oF});var vl=l(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.HelixUserSubscription=void 0;var kP=(y(),g(m)),sF=S(),zt=f(),gl=class extends zt.DataObject{static{n(this,"HelixUserSubscription")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[zt.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[zt.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[zt.rawDataSymbol].broadcaster_name}async getBroadcaster(){return await this._client.users.getUserById(this[zt.rawDataSymbol].broadcaster_id)}get isGift(){return this[zt.rawDataSymbol].is_gift}get tier(){return this[zt.rawDataSymbol].tier}};kP.__decorate([(0,sF.Enumerable)(!1)],gl.prototype,"_client",void 0);gl=kP.__decorate([(0,zt.rtfm)("api","HelixUserSubscription","broadcasterId")],gl);bl.HelixUserSubscription=gl});var xl=l(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.HelixSubscription=void 0;var uF=(y(),g(m)),Y=f(),lF=vl(),Fm=class extends lF.HelixUserSubscription{static{n(this,"HelixSubscription")}get broadcasterId(){return this[Y.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Y.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Y.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,Y.checkRelationAssertion)(await this._client.users.getUserById(this[Y.rawDataSymbol].broadcaster_id))}get gifterId(){return this[Y.rawDataSymbol].is_gift?this[Y.rawDataSymbol].gifter_id:null}get gifterName(){return this[Y.rawDataSymbol].is_gift?this[Y.rawDataSymbol].gifter_login:null}get gifterDisplayName(){return this[Y.rawDataSymbol].is_gift?this[Y.rawDataSymbol].gifter_name:null}async getGifter(){return this[Y.rawDataSymbol].is_gift?(0,Y.checkRelationAssertion)(await this._client.users.getUserById(this[Y.rawDataSymbol].gifter_id)):null}get userId(){return this[Y.rawDataSymbol].user_id}get userName(){return this[Y.rawDataSymbol].user_login}get userDisplayName(){return this[Y.rawDataSymbol].user_name}async getUser(){return(0,Y.checkRelationAssertion)(await this._client.users.getUserById(this[Y.rawDataSymbol].user_id))}};Fm=uF.__decorate([(0,Y.rtfm)("api","HelixSubscription","userId")],Fm);wl.HelixSubscription=Fm});var Qm=l(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.HelixPaginatedSubscriptionsRequest=void 0;var cF=(y(),g(m)),dF=Q(),LP=f(),pF=Zr(),hF=xl(),Nm=class extends pF.HelixPaginatedRequestWithTotal{static{n(this,"HelixPaginatedSubscriptionsRequest")}constructor(e,t){super({url:"subscriptions",scopes:["channel:read:subscriptions"],userId:(0,LP.extractUserId)(e),query:(0,dF.createBroadcasterQuery)(e)},t,i=>new hF.HelixSubscription(i,t))}async getPoints(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).points}};Nm=cF.__decorate([(0,LP.rtfm)("api","HelixPaginatedSubscriptionsRequest")],Nm);Sl.HelixPaginatedSubscriptionsRequest=Nm});var Vm=l(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.HelixSubscriptionApi=void 0;var fF=(y(),g(m)),MP=Q(),ql=f(),mF=Ee(),yF=jP(),_F=X(),gF=Z(),bF=L(),vF=Qm(),FP=xl(),wF=vl(),Gm=class extends bF.BaseApi{static{n(this,"HelixSubscriptionApi")}async getSubscriptions(e,t){let i=await this._client.callApi({url:"subscriptions",scopes:["channel:read:subscriptions"],type:"helix",userId:(0,ql.extractUserId)(e),query:{...(0,MP.createBroadcasterQuery)(e),...(0,gF.createPaginationQuery)(t)}});return{...(0,_F.createPaginatedResultWithTotal)(i,FP.HelixSubscription,this._client),points:i.points}}getSubscriptionsPaginated(e){return new vF.HelixPaginatedSubscriptionsRequest(e,this._client)}async getSubscriptionsForUsers(e,t){return(await this._client.callApi({type:"helix",url:"subscriptions",userId:(0,ql.extractUserId)(e),scopes:["channel:read:subscriptions"],query:(0,mF.createChannelUsersCheckQuery)(e,t)})).data.map(a=>new FP.HelixSubscription(a,this._client))}async getSubscriptionForUser(e,t){let i=await this.getSubscriptionsForUsers(e,[t]);return i.length?i[0]:null}async checkUserSubscription(e,t){try{let i=await this._client.callApi({type:"helix",url:"subscriptions/user",userId:(0,ql.extractUserId)(e),scopes:["user:read:subscriptions"],query:(0,yF.createSubscriptionCheckQuery)(t,e)});return new wF.HelixUserSubscription(i.data[0],this._client)}catch(i){if(i instanceof MP.HttpStatusCodeError&&i.statusCode===404)return null;throw i}}};Gm=fF.__decorate([(0,ql.rtfm)("api","HelixSubscriptionApi")],Gm);Pl.HelixSubscriptionApi=Gm});var El=l(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.HelixTeam=void 0;var NP=(y(),g(m)),xF=S(),Ve=f(),Cl=class extends Ve.DataObject{static{n(this,"HelixTeam")}constructor(e,t){super(e),this._client=t}get id(){return this[Ve.rawDataSymbol].id}get name(){return this[Ve.rawDataSymbol].team_name}get displayName(){return this[Ve.rawDataSymbol].team_display_name}get backgroundImageUrl(){return this[Ve.rawDataSymbol].background_image_url}get bannerUrl(){return this[Ve.rawDataSymbol].banner}get creationDate(){return new Date(this[Ve.rawDataSymbol].created_at)}get updateDate(){return new Date(this[Ve.rawDataSymbol].updated_at)}get info(){return this[Ve.rawDataSymbol].info}get logoThumbnailUrl(){return this[Ve.rawDataSymbol].thumbnail_url}async getUserRelations(){return(await this._client.teams.getTeamById(this.id)).userRelations}};NP.__decorate([(0,xF.Enumerable)(!1)],Cl.prototype,"_client",void 0);Cl=NP.__decorate([(0,Ve.rtfm)("api","HelixTeam","id")],Cl);Hl.HelixTeam=Cl});var Wm=l(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.HelixTeamWithUsers=void 0;var SF=(y(),g(m)),QP=f(),qF=Fo(),PF=El(),$m=class extends PF.HelixTeam{static{n(this,"HelixTeamWithUsers")}get userRelations(){return this[QP.rawDataSymbol].users.map(e=>new qF.HelixUserRelation(e,this._client))}};$m=SF.__decorate([(0,QP.rtfm)("api","HelixTeamWithUsers","id")],$m);Al.HelixTeamWithUsers=$m});var Jm=l(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.HelixTeamApi=void 0;var CF=(y(),g(m)),zm=Q(),VP=f(),HF=L(),EF=El(),GP=Wm(),Km=class extends HF.BaseApi{static{n(this,"HelixTeamApi")}async getTeamsForBroadcaster(e){var t,i;return(i=(t=(await this._client.callApi({type:"helix",url:"teams/channel",userId:(0,VP.extractUserId)(e),query:(0,zm.createBroadcasterQuery)(e)})).data)===null||t===void 0?void 0:t.map(o=>new EF.HelixTeam(o,this._client)))!==null&&i!==void 0?i:[]}async getTeamById(e){try{let t=await this._client.callApi({type:"helix",url:"teams",query:{id:e}});return new GP.HelixTeamWithUsers(t.data[0],this._client)}catch(t){if(t instanceof zm.HttpStatusCodeError&&t.statusCode===500)return null;throw t}}async getTeamByName(e){try{let t=await this._client.callApi({type:"helix",url:"teams",query:{name:e}});return new GP.HelixTeamWithUsers(t.data[0],this._client)}catch(t){if(t instanceof zm.HttpStatusCodeError&&t.statusCode===404)return null;throw t}}};Km=CF.__decorate([(0,VP.rtfm)("api","HelixTeamApi")],Km);Tl.HelixTeamApi=Km});var WP=l(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.createUserBlockDeleteQuery=mi.createUserBlockCreateQuery=void 0;var $P=f();function AF(r,e){return{target_user_id:(0,$P.extractUserId)(r),source_context:e.sourceContext,reason:e.reason}}n(AF,"createUserBlockCreateQuery");mi.createUserBlockCreateQuery=AF;function TF(r){return{target_user_id:(0,$P.extractUserId)(r)}}n(TF,"createUserBlockDeleteQuery");mi.createUserBlockDeleteQuery=TF});var Dl=l(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.HelixBaseExtension=void 0;var Il=f(),Zm=class extends Il.DataObject{static{n(this,"HelixBaseExtension")}get id(){return this[Il.rawDataSymbol].id}get version(){return this[Il.rawDataSymbol].version}get name(){return this[Il.rawDataSymbol].name}};Rl.HelixBaseExtension=Zm});var Xm=l(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.HelixInstalledExtension=void 0;var IF=(y(),g(m)),RF=f(),DF=Dl(),Ym=class extends DF.HelixBaseExtension{static{n(this,"HelixInstalledExtension")}constructor(e,t,i){super(i),this._slotType=e,this._slotId=t}get slotType(){return this._slotType}get slotId(){return this._slotId}};Ym=IF.__decorate([(0,RF.rtfm)("api","HelixInstalledExtension","id")],Ym);Ol.HelixInstalledExtension=Ym});var ry=l(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.HelixInstalledExtensionList=void 0;var OF=(y(),g(m)),mn=f(),ey=Xm(),ty=class extends mn.DataObject{static{n(this,"HelixInstalledExtensionList")}getExtensionAtSlot(e,t){let i=this[mn.rawDataSymbol][e][t];return i.active?new ey.HelixInstalledExtension(e,t,i):null}getExtensionsForSlotType(e){return[...Object.entries(this[mn.rawDataSymbol][e])].filter(t=>t[1].active).map(([t,i])=>new ey.HelixInstalledExtension(e,t,i))}getAllExtensions(){return[...Object.entries(this[mn.rawDataSymbol])].flatMap(([e,t])=>[...Object.entries(t)].filter(i=>i[1].active).map(([i,a])=>new ey.HelixInstalledExtension(e,i,a)))}};ty=OF.__decorate([(0,mn.rtfm)("api","HelixInstalledExtensionList")],ty);Bl.HelixInstalledExtensionList=ty});var ay=l(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.HelixUserExtension=void 0;var BF=(y(),g(m)),iy=f(),UF=Dl(),ny=class extends UF.HelixBaseExtension{static{n(this,"HelixUserExtension")}get canActivate(){return this[iy.rawDataSymbol].can_activate}get types(){return this[iy.rawDataSymbol].type}};ny=BF.__decorate([(0,iy.rtfm)("api","HelixUserExtension","id")],ny);Ul.HelixUserExtension=ny});var Ll=l(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.HelixUser=void 0;var zP=(y(),g(m)),jF=S(),$e=f(),jl=class extends $e.DataObject{static{n(this,"HelixUser")}constructor(e,t){super(e),this._client=t}get id(){return this[$e.rawDataSymbol].id}get name(){return this[$e.rawDataSymbol].login}get displayName(){return this[$e.rawDataSymbol].display_name}get description(){return this[$e.rawDataSymbol].description}get type(){return this[$e.rawDataSymbol].type}get broadcasterType(){return this[$e.rawDataSymbol].broadcaster_type}get profilePictureUrl(){return this[$e.rawDataSymbol].profile_image_url}get offlinePlaceholderUrl(){return this[$e.rawDataSymbol].offline_image_url}get creationDate(){return new Date(this[$e.rawDataSymbol].created_at)}async getStream(){return await this._client.streams.getStreamByUserId(this)}async getFollowedChannels(){return await this._client.channels.getFollowedChannels(this)}async getFollowedChannel(e){var t;return(t=(await this._client.channels.getFollowedChannels(this,e)).data[0])!==null&&t!==void 0?t:null}async follows(e){return await this.getFollowedChannel(e)!==null}async getChannelFollowers(){return await this._client.channels.getChannelFollowers(this)}async getChannelFollower(e){var t;return(t=(await this._client.channels.getChannelFollowers(this,e)).data[0])!==null&&t!==void 0?t:null}async isFollowedBy(e){return await this.getChannelFollower(e)!==null}async getSubscriptionTo(e){return await this._client.subscriptions.checkUserSubscription(this,e)}async isSubscribedTo(e){return await this.getSubscriptionTo(e)!==null}async getSubscriber(e){return await this._client.subscriptions.getSubscriptionForUser(this,e)}async hasSubscriber(e){return await this.getSubscriber(e)!==null}};zP.__decorate([(0,jF.Enumerable)(!1)],jl.prototype,"_client",void 0);jl=zP.__decorate([(0,$e.rtfm)("api","HelixUser","id")],jl);kl.HelixUser=jl});var sy=l(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.HelixPrivilegedUser=void 0;var kF=(y(),g(m)),KP=f(),LF=Ll(),oy=class extends LF.HelixUser{static{n(this,"HelixPrivilegedUser")}get email(){return this[KP.rawDataSymbol].email}async setDescription(e){return await this._client.users.updateAuthenticatedUser(this,{description:e})}};oy=kF.__decorate([(0,KP.rtfm)("api","HelixPrivilegedUser","id")],oy);Ml.HelixPrivilegedUser=oy});var uy=l(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.HelixUserBlock=void 0;var JP=(y(),g(m)),MF=S(),mr=f(),Fl=class extends mr.DataObject{static{n(this,"HelixUserBlock")}constructor(e,t){super(e),this._client=t}get userId(){return this[mr.rawDataSymbol].user_id}get userName(){return this[mr.rawDataSymbol].user_login}get userDisplayName(){return this[mr.rawDataSymbol].display_name}async getUser(){return(0,mr.checkRelationAssertion)(await this._client.users.getUserById(this[mr.rawDataSymbol].user_id))}};JP.__decorate([(0,MF.Enumerable)(!1)],Fl.prototype,"_client",void 0);Fl=JP.__decorate([(0,mr.rtfm)("api","HelixUserBlock","userId")],Fl);Nl.HelixUserBlock=Fl});var dy=l(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.HelixUserApi=void 0;var ly=(y(),g(m)),cy=S(),ZP=Q(),pe=f(),FF=Ee(),YP=WP(),XP=Ut(),NF=ne(),QF=X(),GF=Z(),VF=L(),eC=ry(),$F=ay(),tC=sy(),Ql=Ll(),rC=uy(),yn=class extends VF.BaseApi{static{n(this,"HelixUserApi")}constructor(){super(...arguments),this._getUserByIdBatcher=new XP.HelixRequestBatcher({url:"users"},"id","id",this._client,e=>new Ql.HelixUser(e,this._client)),this._getUserByNameBatcher=new XP.HelixRequestBatcher({url:"users"},"login","login",this._client,e=>new Ql.HelixUser(e,this._client))}async getUsersByIds(e){return await this._getUsers("id",e.map(pe.extractUserId))}async getUsersByNames(e){return await this._getUsers("login",e.map(pe.extractUserName))}async getUserById(e){let t=(0,pe.extractUserId)(e),i=await this._client.callApi({type:"helix",url:"users",userId:t,query:{id:t}});return(0,cy.mapNullable)(i.data[0],a=>new Ql.HelixUser(a,this._client))}async getUserByIdBatched(e){return await this._getUserByIdBatcher.request((0,pe.extractUserId)(e))}async getUserByName(e){let t=await this._getUsers("login",[(0,pe.extractUserName)(e)]);return t.length?t[0]:null}async getUserByNameBatched(e){return await this._getUserByNameBatcher.request((0,pe.extractUserName)(e))}async getAuthenticatedUser(e,t=!1){var i;let a=await this._client.callApi({type:"helix",url:"users",forceType:"user",userId:(0,pe.extractUserId)(e),scopes:t?["user:read:email"]:void 0});if(!(!((i=a.data)===null||i===void 0)&&i.length))throw new pe.HellFreezesOverError("Could not get authenticated user");return new tC.HelixPrivilegedUser(a.data[0],this._client)}async updateAuthenticatedUser(e,t){let i=await this._client.callApi({type:"helix",url:"users",method:"PUT",userId:(0,pe.extractUserId)(e),scopes:["user:edit"],query:{description:t.description}});return new tC.HelixPrivilegedUser(i.data[0],this._client)}async getBlocks(e,t){let i=await this._client.callApi({type:"helix",url:"users/blocks",userId:(0,pe.extractUserId)(e),scopes:["user:read:blocked_users"],query:{...(0,ZP.createBroadcasterQuery)(e),...(0,GF.createPaginationQuery)(t)}});return(0,QF.createPaginatedResult)(i,rC.HelixUserBlock,this._client)}getBlocksPaginated(e){return new NF.HelixPaginatedRequest({url:"users/blocks",userId:(0,pe.extractUserId)(e),scopes:["user:read:blocked_users"],query:(0,ZP.createBroadcasterQuery)(e)},this._client,t=>new rC.HelixUserBlock(t,this._client))}async createBlock(e,t,i={}){await this._client.callApi({type:"helix",url:"users/blocks",method:"PUT",userId:(0,pe.extractUserId)(e),scopes:["user:manage:blocked_users"],query:(0,YP.createUserBlockCreateQuery)(t,i)})}async deleteBlock(e,t){await this._client.callApi({type:"helix",url:"users/blocks",method:"DELETE",userId:(0,pe.extractUserId)(e),scopes:["user:manage:blocked_users"],query:(0,YP.createUserBlockDeleteQuery)(t)})}async getExtensionsForAuthenticatedUser(e,t=!1){return(await this._client.callApi({type:"helix",url:"users/extensions/list",userId:(0,pe.extractUserId)(e),scopes:t?["user:edit:broadcast"]:["user:read:broadcast","user:edit:broadcast"]})).data.map(a=>new $F.HelixUserExtension(a))}async getActiveExtensions(e,t=!1){let i=(0,pe.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"users/extensions",userId:i,scopes:t?["user:read:broadcast","user:edit:broadcast"]:void 0,query:(0,FF.createSingleKeyQuery)("user_id",i)});return new eC.HelixInstalledExtensionList(a.data)}async updateActiveExtensionsForAuthenticatedUser(e,t){let i=await this._client.callApi({type:"helix",url:"users/extensions",method:"PUT",userId:(0,pe.extractUserId)(e),scopes:["user:edit:broadcast"],jsonBody:{data:t}});return new eC.HelixInstalledExtensionList(i.data)}async _getUsers(e,t){if(t.length===0)return[];let i={[e]:t};return(await this._client.callApi({type:"helix",url:"users",query:i})).data.map(o=>new Ql.HelixUser(o,this._client))}};ly.__decorate([(0,cy.Enumerable)(!1)],yn.prototype,"_getUserByIdBatcher",void 0);ly.__decorate([(0,cy.Enumerable)(!1)],yn.prototype,"_getUserByNameBatcher",void 0);yn=ly.__decorate([(0,pe.rtfm)("api","HelixUserApi")],yn);Gl.HelixUserApi=yn});var hy=l(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.HelixVideo=void 0;var py=(y(),g(m)),iC=Ki(),WF=S(),D=f(),_n=class extends D.DataObject{static{n(this,"HelixVideo")}constructor(e,t){super(e),this._client=t}get id(){return this[D.rawDataSymbol].id}get userId(){return this[D.rawDataSymbol].user_id}get userName(){return this[D.rawDataSymbol].user_login}get userDisplayName(){return this[D.rawDataSymbol].user_name}async getUser(){return(0,D.checkRelationAssertion)(await this._client.users.getUserById(this[D.rawDataSymbol].user_id))}get title(){return this[D.rawDataSymbol].title}get description(){return this[D.rawDataSymbol].description}get creationDate(){return new Date(this[D.rawDataSymbol].created_at)}get publishDate(){return new Date(this[D.rawDataSymbol].published_at)}get url(){return this[D.rawDataSymbol].url}get thumbnailUrl(){return this[D.rawDataSymbol].thumbnail_url}getThumbnailUrl(e,t){return this[D.rawDataSymbol].thumbnail_url.replace("%{width}",e.toString()).replace("%{height}",t.toString())}get isPublic(){return this[D.rawDataSymbol].viewable==="public"}get views(){return this[D.rawDataSymbol].view_count}get language(){return this[D.rawDataSymbol].language}get type(){return this[D.rawDataSymbol].type}get duration(){return this[D.rawDataSymbol].duration}get durationInSeconds(){let e=this[D.rawDataSymbol].duration.match(/\d+[hms]/g);if(!e)throw new D.HellFreezesOverError(`Could not parse duration string: ${this[D.rawDataSymbol].duration}`);return e.map(t=>{let i=/(\d+)([hms])/.exec(t);if(!i)throw new D.HellFreezesOverError(`Could not parse partial duration string: ${t}`);let[,a,o]=i;return parseInt(a,10)*{h:3600,m:60,s:1}[o]}).reduce((t,i)=>t+i)}get streamId(){return this[D.rawDataSymbol].stream_id}get mutedSegmentData(){var e,t;return(t=(e=this[D.rawDataSymbol].muted_segments)===null||e===void 0?void 0:e.slice())!==null&&t!==void 0?t:[]}isMutedAt(e,t,i=!1){if(this[D.rawDataSymbol].muted_segments===null)return!1;if(t==null)return this[D.rawDataSymbol].muted_segments.some(o=>o.offset<=e&&e<=o.offset+o.duration);let a=e+t;return i?this[D.rawDataSymbol].muted_segments.some(o=>{let s=o.offset+o.duration;return e<s&&o.offset<a}):this[D.rawDataSymbol].muted_segments.some(o=>{let s=o.offset+o.duration;return o.offset<=e&&a<=s})}};py.__decorate([(0,WF.Enumerable)(!1)],_n.prototype,"_client",void 0);py.__decorate([(0,iC.CachedGetter)()],_n.prototype,"durationInSeconds",null);_n=py.__decorate([iC.Cacheable,(0,D.rtfm)("api","HelixVideo","id")],_n);Vl.HelixVideo=_n});var my=l(Kl=>{"use strict";var $l;Object.defineProperty(Kl,"__esModule",{value:!0});Kl.HelixVideoApi=void 0;var nC=(y(),g(m)),zF=S(),Wl=f(),KF=Ut(),JF=ne(),ZF=X(),YF=Z(),XF=L(),fy=hy(),zl=$l=class extends XF.BaseApi{static{n(this,"HelixVideoApi")}constructor(){super(...arguments),this._getVideoByIdBatcher=new KF.HelixRequestBatcher({url:"videos"},"id","id",this._client,e=>new fy.HelixVideo(e,this._client))}async getVideosByIds(e){return(await this._getVideos("id",e)).data}async getVideoById(e){let t=await this.getVideosByIds([e]);return t.length?t[0]:null}async getVideoByIdBatched(e){return await this._getVideoByIdBatcher.request(e)}async getVideosByUser(e,t={}){let i=(0,Wl.extractUserId)(e);return await this._getVideos("user_id",[i],t)}getVideosByUserPaginated(e,t={}){let i=(0,Wl.extractUserId)(e);return this._getVideosPaginated("user_id",[i],t)}async getVideosByGame(e,t={}){return await this._getVideos("game_id",[e],t)}getVideosByGamePaginated(e,t={}){return this._getVideosPaginated("game_id",[e],t)}async deleteVideosByIds(e,t){await this._client.callApi({type:"helix",url:"videos",method:"DELETE",scopes:["channel:manage:videos"],userId:(0,Wl.extractUserId)(e),query:{id:t}})}async _getVideos(e,t,i={}){if(!t.length)return{data:[]};let a=await this._client.callApi({type:"helix",url:"videos",userId:e==="user_id"?t[0]:void 0,query:{...$l._makeVideosQuery(e,t,i),...(0,YF.createPaginationQuery)(i)}});return(0,ZF.createPaginatedResult)(a,fy.HelixVideo,this._client)}_getVideosPaginated(e,t,i={}){return new JF.HelixPaginatedRequest({url:"videos",userId:e==="user_id"?t[0]:void 0,query:$l._makeVideosQuery(e,t,i)},this._client,a=>new fy.HelixVideo(a,this._client))}static _makeVideosQuery(e,t,i={}){let{language:a,period:o,orderBy:s,type:u}=i;return{[e]:t,language:a,period:o,sort:s,type:u}}};nC.__decorate([(0,zF.Enumerable)(!1)],zl.prototype,"_getVideoByIdBatcher",void 0);zl=$l=nC.__decorate([(0,Wl.rtfm)("api","HelixVideoApi")],zl);Kl.HelixVideoApi=zl});var oC=l(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.createWhisperQuery=void 0;var aC=f();function eN(r,e){return{from_user_id:(0,aC.extractUserId)(r),to_user_id:(0,aC.extractUserId)(e)}}n(eN,"createWhisperQuery");Jl.createWhisperQuery=eN});var _y=l(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.HelixWhisperApi=void 0;var tN=(y(),g(m)),sC=f(),rN=oC(),iN=L(),yy=class extends iN.BaseApi{static{n(this,"HelixWhisperApi")}async sendWhisper(e,t,i){await this._client.callApi({type:"helix",url:"whispers",method:"POST",userId:(0,sC.extractUserId)(e),scopes:["user:manage:whispers"],query:(0,rN.createWhisperQuery)(e,t),jsonBody:{message:i}})}};yy=tN.__decorate([(0,sC.rtfm)("api","HelixWhisperApi")],yy);Zl.HelixWhisperApi=yy});var by=l(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.ApiReportedRequest=void 0;var gy=class{static{n(this,"ApiReportedRequest")}constructor(e,t,i){this._options=e,this._httpStatus=t,this._resolvedUserId=i}get options(){return this._options}get httpStatus(){return this._httpStatus}get resolvedUserId(){return this._resolvedUserId}};Yl.ApiReportedRequest=gy});var tc=l(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.BaseApiClient=void 0;var M=(y(),g(m)),F=Ki(),nN=Ga(),aN=S(),oN=th(),yi=Q(),Xl=bh(),uC=f(),sN=j0(),uN=Hh(),lN=kh(),cN=Nh(),dN=zh(),pN=df(),hN=mf(),fN=bf(),mN=qf(),yN=Ef(),_N=Bf(),gN=kf(),bN=Ff(),vN=Vf(),wN=sm(),xN=pm(),SN=_m(),qN=xm(),PN=Am(),CN=Rm(),HN=Mm(),EN=Vm(),AN=Jm(),TN=dy(),IN=my(),RN=_y(),DN=by(),j=class extends oN.EventEmitter{static{n(this,"BaseApiClient")}constructor(e,t,i){super(),this.onRequest=this.registerEvent(),this._config=e,this._logger=t,this._rateLimiter=i}async requestScopesForUser(e,t){await this._config.authProvider.getAccessTokenForUser(e,...t.map(i=>[i]))}async getTokenInfo(){try{let e=await this.callApi({type:"auth",url:"validate"});return new Xl.TokenInfo(e)}catch(e){throw e instanceof yi.HttpStatusCodeError&&e.statusCode===401?new Xl.InvalidTokenError({cause:e}):e}}async callApi(e){var t;let{authProvider:i}=this._config;if(!((t=e.auth)!==null&&t!==void 0?t:!0))return await(0,yi.callTwitchApi)(e,i.clientId,void 0,void 0,this._config.fetchOptions);let o=!1;if(e.forceType)switch(e.forceType){case"app":{if(!i.getAppAccessToken)throw new Error("Tried to make an API call that requires an app access token but your auth provider does not support that");let c=await i.getAppAccessToken();return await this._callApiUsingInitialToken(e,c)}case"user":{o=!0;break}default:throw new uC.HellFreezesOverError(`Unknown forced token type: ${e.forceType}`)}if(e.scopes&&(o=!0),o){let c=e.canOverrideScopedUserContext?this._getUserIdFromRequestContext(e.userId):e.userId;if(!c)throw new Error("Tried to make an API call with a user context but no context user ID");let h=await i.getAccessTokenForUser(c,e.scopes);if(!h)throw new Error(`Tried to make an API call with a user context for user ID ${c} but no token was found`);if((0,Xl.accessTokenIsExpired)(h)&&i.refreshAccessTokenForUser){let d=await i.refreshAccessTokenForUser(c);return await this._callApiUsingInitialToken(e,d,!0)}return await this._callApiUsingInitialToken(e,h)}let s=this._getUserIdFromRequestContext(e.userId),u=s===null?await i.getAnyAccessToken():await i.getAnyAccessToken(s??e.userId);if((0,Xl.accessTokenIsExpired)(u)&&u.userId&&i.refreshAccessTokenForUser){let c=await i.refreshAccessTokenForUser(u.userId);return await this._callApiUsingInitialToken(e,c,!0)}return await this._callApiUsingInitialToken(e,u)}get bits(){return new uN.HelixBitsApi(this)}get channels(){return new lN.HelixChannelApi(this)}get channelPoints(){return new cN.HelixChannelPointsApi(this)}get charity(){return new dN.HelixCharityApi(this)}get chat(){return new pN.HelixChatApi(this)}get clips(){return new hN.HelixClipApi(this)}get contentClassificationLabels(){return new fN.HelixContentClassificationLabelApi(this)}get entitlements(){return new mN.HelixEntitlementApi(this)}get eventSub(){return new yN.HelixEventSubApi(this)}get extensions(){return new _N.HelixExtensionsApi(this)}get games(){return new gN.HelixGameApi(this)}get hypeTrain(){return new vN.HelixHypeTrainApi(this)}get goals(){return new bN.HelixGoalApi(this)}get moderation(){return new wN.HelixModerationApi(this)}get polls(){return new xN.HelixPollApi(this)}get predictions(){return new SN.HelixPredictionApi(this)}get raids(){return new qN.HelixRaidApi(this)}get schedule(){return new PN.HelixScheduleApi(this)}get search(){return new CN.HelixSearchApi(this)}get streams(){return new HN.HelixStreamApi(this)}get subscriptions(){return new EN.HelixSubscriptionApi(this)}get teams(){return new AN.HelixTeamApi(this)}get users(){return new TN.HelixUserApi(this)}get videos(){return new IN.HelixVideoApi(this)}get whispers(){return new RN.HelixWhisperApi(this)}get rateLimiterStats(){return this._rateLimiter instanceof nN.ResponseBasedRateLimiter?this._rateLimiter.stats:null}get _authProvider(){return this._config.authProvider}get _batchDelay(){var e;return(e=this._config.batchDelay)!==null&&e!==void 0?e:0}_getUserIdFromRequestContext(e){return e}async _callApiUsingInitialToken(e,t,i=!1){var a;let{authProvider:o}=this._config,s=o.authorizationType,u=await this._callApiInternal(e,o.clientId,t.accessToken,s);if(u.status===401&&!i){if(t.userId){if(o.refreshAccessTokenForUser){let c=await o.refreshAccessTokenForUser(t.userId);u=await this._callApiInternal(e,o.clientId,c.accessToken,s)}}else if(o.getAppAccessToken){let c=await o.getAppAccessToken(!0);u=await this._callApiInternal(e,o.clientId,c.accessToken,s)}}return this.emit(this.onRequest,new DN.ApiReportedRequest(e,u.status,(a=t.userId)!==null&&a!==void 0?a:null)),await(0,yi.handleTwitchApiResponseError)(u,e),await(0,yi.transformTwitchApiResponse)(u)}async _callApiInternal(e,t,i,a){var o,s,u;let{fetchOptions:c}=this._config,h=(o=e.type)!==null&&o!==void 0?o:"helix";this._logger.debug(`Calling ${h} API: ${(s=e.method)!==null&&s!==void 0?s:"GET"} ${e.url}`),this._logger.trace(`Query: ${JSON.stringify(e.query)}`),e.jsonBody&&this._logger.trace(`Request body: ${JSON.stringify(e.jsonBody)}`);let d=sN.operation({retries:3,minTimeout:500,factor:2}),{promise:_,resolve:b,reject:q}=(0,aN.promiseWithResolvers)();d.attempt(async()=>{try{let x=h==="helix"?await this._rateLimiter.request({options:e,clientId:t,accessToken:i,authorizationType:a,fetchOptions:c}):await(0,yi.callTwitchApiRaw)(e,t,i,a,c);!x.ok&&x.status>=500&&x.status<600&&await(0,yi.handleTwitchApiResponseError)(x,e),b(x)}catch(x){if(d.retry(x))return;q(d.mainError())}});let v=await _;return this._logger.debug(`Called ${h} API: ${(u=e.method)!==null&&u!==void 0?u:"GET"} ${e.url} - result: ${v.status}`),v}};M.__decorate([(0,F.CachedGetter)()],j.prototype,"bits",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"channels",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"channelPoints",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"charity",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"chat",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"clips",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"contentClassificationLabels",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"entitlements",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"eventSub",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"extensions",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"games",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"hypeTrain",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"goals",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"moderation",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"polls",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"predictions",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"raids",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"schedule",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"search",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"streams",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"subscriptions",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"teams",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"users",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"videos",null);M.__decorate([(0,F.CachedGetter)()],j.prototype,"whispers",null);j=M.__decorate([F.Cacheable,(0,uC.rtfm)("api","ApiClient")],j);ec.BaseApiClient=j});var lC=l(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.NoContextApiClient=void 0;var ON=(y(),g(m)),BN=f(),UN=tc(),vy=class extends UN.BaseApiClient{static{n(this,"NoContextApiClient")}_getUserIdFromRequestContext(){return null}};vy=ON.__decorate([(0,BN.rtfm)("api","ApiClient")],vy);rc.NoContextApiClient=vy});var cC=l(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.UserContextApiClient=void 0;var jN=(y(),g(m)),kN=f(),LN=tc(),wy=class extends LN.BaseApiClient{static{n(this,"UserContextApiClient")}constructor(e,t,i,a){super(e,t,i),this._userId=a}_getUserIdFromRequestContext(){return this._userId}};wy=jN.__decorate([(0,kN.rtfm)("api","ApiClient")],wy);ic.UserContextApiClient=wy});var fC=l(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.ApiClient=void 0;var MN=(y(),g(m)),FN=wi(),NN=Si(),dC=Ga(),QN=Q(),hC=f(),GN=Jp(),VN=m0(),$N=tc(),WN=lC(),pC=cC(),xy=class extends $N.BaseApiClient{static{n(this,"ApiClient")}constructor(e){if(!e.authProvider)throw new GN.ConfigError("No auth provider given. Please supply the `authProvider` option.");let t={name:"twurple:api:rate-limiter",...e.logger};super(e,(0,NN.createLogger)({name:"twurple:api:client",...e.logger}),FN.isNode?new dC.PartitionedRateLimiter({getPartitionKey:i=>{var a;return(a=i.userId)!==null&&a!==void 0?a:null},createChild:()=>new VN.HelixRateLimiter({logger:t})}):new dC.PartitionedTimeBasedRateLimiter({logger:t,bucketSize:800,timeFrame:64e3,doRequest:async({options:i,clientId:a,accessToken:o,authorizationType:s,fetchOptions:u})=>await(0,QN.callTwitchApiRaw)(i,a,o,s,u),getPartitionKey:i=>{var a;return(a=i.userId)!==null&&a!==void 0?a:null}}))}async asUser(e,t){let i=new pC.UserContextApiClient(this._config,this._logger,this._rateLimiter,(0,hC.extractUserId)(e));return await t(i)}async asIntent(e,t){if(!this._authProvider.getAccessTokenForIntent)throw new Error("Trying to use intents with an auth provider that does not support them");for(let i of e){let a=await this._authProvider.getAccessTokenForIntent(i);if(a){let o=new pC.UserContextApiClient(this._config,this._logger,this._rateLimiter,a.userId);return await t(o)}}throw new Error(`Intents [${e.join(", ")}] not found in auth provider`)}async withoutUser(e){let t=new WN.NoContextApiClient(this._config,this._logger,this._rateLimiter);return await e(t)}};xy=MN.__decorate([(0,hC.rtfm)("api","ApiClient")],xy);nc.ApiClient=xy});var yC=l(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.HelixFollow=void 0;var mC=(y(),g(m)),zN=S(),De=f(),ac=class extends De.DataObject{static{n(this,"HelixFollow")}constructor(e,t){super(e),this._client=t}get userId(){return this[De.rawDataSymbol].from_id}get userName(){return this[De.rawDataSymbol].from_login}get userDisplayName(){return this[De.rawDataSymbol].from_name}async getUser(){return(0,De.checkRelationAssertion)(await this._client.users.getUserById(this[De.rawDataSymbol].from_id))}get followedUserId(){return this[De.rawDataSymbol].to_id}get followedUserName(){return this[De.rawDataSymbol].to_login}get followedUserDisplayName(){return this[De.rawDataSymbol].to_name}async getFollowedUser(){return(0,De.checkRelationAssertion)(await this._client.users.getUserById(this[De.rawDataSymbol].to_id))}get followDate(){return new Date(this[De.rawDataSymbol].followed_at)}};mC.__decorate([(0,zN.Enumerable)(!1)],ac.prototype,"_client",void 0);ac=mC.__decorate([(0,De.rtfm)("api","HelixFollow")],ac);oc.HelixFollow=ac});var _C=l(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.HelixBanUser=p.HelixModerator=p.HelixBan=p.HelixModerationApi=p.HelixHypeTrainEvent=p.HelixHypeTrainContribution=p.HelixHypeTrainApi=p.HelixGoal=p.HelixGoalApi=p.HelixGame=p.HelixGameApi=p.HelixExtensionTransaction=p.HelixExtensionBitsProduct=p.HelixExtensionsApi=p.HelixPaginatedEventSubSubscriptionsRequest=p.HelixEventSubSubscription=p.HelixEventSubApi=p.HelixDropsEntitlement=p.HelixEntitlementApi=p.HelixContentClassificationLabel=p.HelixContentClassificationLabelApi=p.HelixClip=p.HelixClipApi=p.HelixPrivilegedChatSettings=p.HelixEmoteFromSet=p.HelixChannelEmote=p.HelixEmote=p.HelixChatChatter=p.HelixChatSettings=p.HelixChatBadgeVersion=p.HelixChatBadgeSet=p.HelixChatApi=p.HelixCharityCampaignAmount=p.HelixCharityCampaignDonation=p.HelixCharityCampaign=p.HelixCharityApi=p.HelixCustomRewardRedemption=p.HelixCustomReward=p.HelixChannelPointsApi=p.HelixChannelReference=p.HelixFollowedChannel=p.HelixChannelFollower=p.HelixChannelEditor=p.HelixChannel=p.HelixChannelApi=p.HelixCheermoteList=p.HelixBitsLeaderboardEntry=p.HelixBitsLeaderboard=p.HelixBitsApi=p.ApiClient=void 0;p.HellFreezesOverError=p.HelixExtension=p.extractUserName=p.extractUserId=p.HelixPaginatedRequestWithTotal=p.HelixPaginatedRequest=p.ApiReportedRequest=p.StreamNotLiveError=p.ConfigError=p.HelixWhisperApi=p.HelixVideo=p.HelixVideoApi=p.HelixUserExtension=p.HelixInstalledExtensionList=p.HelixInstalledExtension=p.HelixBaseExtension=p.HelixUser=p.HelixPrivilegedUser=p.HelixFollow=p.HelixUserBlock=p.HelixUserApi=p.HelixTeamWithUsers=p.HelixTeam=p.HelixTeamApi=p.HelixUserSubscription=p.HelixSubscription=p.HelixSubscriptionApi=p.HelixPaginatedSubscriptionsRequest=p.HelixStreamMarkerWithVideo=p.HelixStreamMarker=p.HelixStream=p.HelixStreamApi=p.HelixChannelSearchResult=p.HelixSearchApi=p.HelixPaginatedScheduleSegmentRequest=p.HelixScheduleSegment=p.HelixSchedule=p.HelixScheduleApi=p.HelixUserRelation=p.HelixRaid=p.HelixRaidApi=p.HelixPredictor=p.HelixPredictionOutcome=p.HelixPrediction=p.HelixPredictionApi=p.HelixPollChoice=p.HelixPoll=p.HelixPollApi=p.HelixShieldModeStatus=p.HelixBlockedTerm=void 0;var KN=fC();Object.defineProperty(p,"ApiClient",{enumerable:!0,get:function(){return KN.ApiClient}});var JN=Hh();Object.defineProperty(p,"HelixBitsApi",{enumerable:!0,get:function(){return JN.HelixBitsApi}});var ZN=xh();Object.defineProperty(p,"HelixBitsLeaderboard",{enumerable:!0,get:function(){return ZN.HelixBitsLeaderboard}});var YN=vh();Object.defineProperty(p,"HelixBitsLeaderboardEntry",{enumerable:!0,get:function(){return YN.HelixBitsLeaderboardEntry}});var XN=qh();Object.defineProperty(p,"HelixCheermoteList",{enumerable:!0,get:function(){return XN.HelixCheermoteList}});var eQ=kh();Object.defineProperty(p,"HelixChannelApi",{enumerable:!0,get:function(){return eQ.HelixChannelApi}});var tQ=Ih();Object.defineProperty(p,"HelixChannel",{enumerable:!0,get:function(){return tQ.HelixChannel}});var rQ=Rh();Object.defineProperty(p,"HelixChannelEditor",{enumerable:!0,get:function(){return rQ.HelixChannelEditor}});var iQ=Dh();Object.defineProperty(p,"HelixChannelFollower",{enumerable:!0,get:function(){return iQ.HelixChannelFollower}});var nQ=Oh();Object.defineProperty(p,"HelixFollowedChannel",{enumerable:!0,get:function(){return nQ.HelixFollowedChannel}});var aQ=Af();Object.defineProperty(p,"HelixChannelReference",{enumerable:!0,get:function(){return aQ.HelixChannelReference}});var oQ=Nh();Object.defineProperty(p,"HelixChannelPointsApi",{enumerable:!0,get:function(){return oQ.HelixChannelPointsApi}});var sQ=Lh();Object.defineProperty(p,"HelixCustomReward",{enumerable:!0,get:function(){return sQ.HelixCustomReward}});var uQ=Mh();Object.defineProperty(p,"HelixCustomRewardRedemption",{enumerable:!0,get:function(){return uQ.HelixCustomRewardRedemption}});var lQ=zh();Object.defineProperty(p,"HelixCharityApi",{enumerable:!0,get:function(){return lQ.HelixCharityApi}});var cQ=Gh();Object.defineProperty(p,"HelixCharityCampaign",{enumerable:!0,get:function(){return cQ.HelixCharityCampaign}});var dQ=Vh();Object.defineProperty(p,"HelixCharityCampaignDonation",{enumerable:!0,get:function(){return dQ.HelixCharityCampaignDonation}});var pQ=fs();Object.defineProperty(p,"HelixCharityCampaignAmount",{enumerable:!0,get:function(){return pQ.HelixCharityCampaignAmount}});var hQ=df();Object.defineProperty(p,"HelixChatApi",{enumerable:!0,get:function(){return hQ.HelixChatApi}});var fQ=ef();Object.defineProperty(p,"HelixChatBadgeSet",{enumerable:!0,get:function(){return fQ.HelixChatBadgeSet}});var mQ=Xh();Object.defineProperty(p,"HelixChatBadgeVersion",{enumerable:!0,get:function(){return mQ.HelixChatBadgeVersion}});var yQ=Ts();Object.defineProperty(p,"HelixChatSettings",{enumerable:!0,get:function(){return yQ.HelixChatSettings}});var _Q=tf();Object.defineProperty(p,"HelixChatChatter",{enumerable:!0,get:function(){return _Q.HelixChatChatter}});var gQ=an();Object.defineProperty(p,"HelixEmote",{enumerable:!0,get:function(){return gQ.HelixEmote}});var bQ=Zh();Object.defineProperty(p,"HelixChannelEmote",{enumerable:!0,get:function(){return bQ.HelixChannelEmote}});var vQ=nf();Object.defineProperty(p,"HelixEmoteFromSet",{enumerable:!0,get:function(){return vQ.HelixEmoteFromSet}});var wQ=sf();Object.defineProperty(p,"HelixPrivilegedChatSettings",{enumerable:!0,get:function(){return wQ.HelixPrivilegedChatSettings}});var xQ=mf();Object.defineProperty(p,"HelixClipApi",{enumerable:!0,get:function(){return xQ.HelixClipApi}});var SQ=pf();Object.defineProperty(p,"HelixClip",{enumerable:!0,get:function(){return SQ.HelixClip}});var qQ=bf();Object.defineProperty(p,"HelixContentClassificationLabelApi",{enumerable:!0,get:function(){return qQ.HelixContentClassificationLabelApi}});var PQ=_f();Object.defineProperty(p,"HelixContentClassificationLabel",{enumerable:!0,get:function(){return PQ.HelixContentClassificationLabel}});var CQ=qf();Object.defineProperty(p,"HelixEntitlementApi",{enumerable:!0,get:function(){return CQ.HelixEntitlementApi}});var HQ=vf();Object.defineProperty(p,"HelixDropsEntitlement",{enumerable:!0,get:function(){return HQ.HelixDropsEntitlement}});var EQ=Ef();Object.defineProperty(p,"HelixEventSubApi",{enumerable:!0,get:function(){return EQ.HelixEventSubApi}});var AQ=Js();Object.defineProperty(p,"HelixEventSubSubscription",{enumerable:!0,get:function(){return AQ.HelixEventSubSubscription}});var TQ=Cf();Object.defineProperty(p,"HelixPaginatedEventSubSubscriptionsRequest",{enumerable:!0,get:function(){return TQ.HelixPaginatedEventSubSubscriptionsRequest}});var IQ=Bf();Object.defineProperty(p,"HelixExtensionsApi",{enumerable:!0,get:function(){return IQ.HelixExtensionsApi}});var RQ=If();Object.defineProperty(p,"HelixExtensionBitsProduct",{enumerable:!0,get:function(){return RQ.HelixExtensionBitsProduct}});var DQ=Rf();Object.defineProperty(p,"HelixExtensionTransaction",{enumerable:!0,get:function(){return DQ.HelixExtensionTransaction}});var OQ=kf();Object.defineProperty(p,"HelixGameApi",{enumerable:!0,get:function(){return OQ.HelixGameApi}});var BQ=du();Object.defineProperty(p,"HelixGame",{enumerable:!0,get:function(){return BQ.HelixGame}});var UQ=Ff();Object.defineProperty(p,"HelixGoalApi",{enumerable:!0,get:function(){return UQ.HelixGoalApi}});var jQ=Lf();Object.defineProperty(p,"HelixGoal",{enumerable:!0,get:function(){return jQ.HelixGoal}});var kQ=Vf();Object.defineProperty(p,"HelixHypeTrainApi",{enumerable:!0,get:function(){return kQ.HelixHypeTrainApi}});var LQ=Nf();Object.defineProperty(p,"HelixHypeTrainContribution",{enumerable:!0,get:function(){return LQ.HelixHypeTrainContribution}});var MQ=Qf();Object.defineProperty(p,"HelixHypeTrainEvent",{enumerable:!0,get:function(){return MQ.HelixHypeTrainEvent}});var FQ=sm();Object.defineProperty(p,"HelixModerationApi",{enumerable:!0,get:function(){return FQ.HelixModerationApi}});var NQ=Zf();Object.defineProperty(p,"HelixBan",{enumerable:!0,get:function(){return NQ.HelixBan}});var QQ=em();Object.defineProperty(p,"HelixModerator",{enumerable:!0,get:function(){return QQ.HelixModerator}});var GQ=Cu();Object.defineProperty(p,"HelixBanUser",{enumerable:!0,get:function(){return GQ.HelixBanUser}});var VQ=Xf();Object.defineProperty(p,"HelixBlockedTerm",{enumerable:!0,get:function(){return VQ.HelixBlockedTerm}});var $Q=tm();Object.defineProperty(p,"HelixShieldModeStatus",{enumerable:!0,get:function(){return $Q.HelixShieldModeStatus}});var WQ=pm();Object.defineProperty(p,"HelixPollApi",{enumerable:!0,get:function(){return WQ.HelixPollApi}});var zQ=cm();Object.defineProperty(p,"HelixPoll",{enumerable:!0,get:function(){return zQ.HelixPoll}});var KQ=lm();Object.defineProperty(p,"HelixPollChoice",{enumerable:!0,get:function(){return KQ.HelixPollChoice}});var JQ=_m();Object.defineProperty(p,"HelixPredictionApi",{enumerable:!0,get:function(){return JQ.HelixPredictionApi}});var ZQ=mm();Object.defineProperty(p,"HelixPrediction",{enumerable:!0,get:function(){return ZQ.HelixPrediction}});var YQ=fm();Object.defineProperty(p,"HelixPredictionOutcome",{enumerable:!0,get:function(){return YQ.HelixPredictionOutcome}});var XQ=hm();Object.defineProperty(p,"HelixPredictor",{enumerable:!0,get:function(){return XQ.HelixPredictor}});var eG=xm();Object.defineProperty(p,"HelixRaidApi",{enumerable:!0,get:function(){return eG.HelixRaidApi}});var tG=bm();Object.defineProperty(p,"HelixRaid",{enumerable:!0,get:function(){return tG.HelixRaid}});var rG=Fo();Object.defineProperty(p,"HelixUserRelation",{enumerable:!0,get:function(){return rG.HelixUserRelation}});var iG=Am();Object.defineProperty(p,"HelixScheduleApi",{enumerable:!0,get:function(){return iG.HelixScheduleApi}});var nG=Cm();Object.defineProperty(p,"HelixSchedule",{enumerable:!0,get:function(){return nG.HelixSchedule}});var aG=pn();Object.defineProperty(p,"HelixScheduleSegment",{enumerable:!0,get:function(){return aG.HelixScheduleSegment}});var oG=Pm();Object.defineProperty(p,"HelixPaginatedScheduleSegmentRequest",{enumerable:!0,get:function(){return oG.HelixPaginatedScheduleSegmentRequest}});var sG=Rm();Object.defineProperty(p,"HelixSearchApi",{enumerable:!0,get:function(){return sG.HelixSearchApi}});var uG=Tm();Object.defineProperty(p,"HelixChannelSearchResult",{enumerable:!0,get:function(){return uG.HelixChannelSearchResult}});var lG=Mm();Object.defineProperty(p,"HelixStreamApi",{enumerable:!0,get:function(){return lG.HelixStreamApi}});var cG=Bm();Object.defineProperty(p,"HelixStream",{enumerable:!0,get:function(){return cG.HelixStream}});var dG=dl();Object.defineProperty(p,"HelixStreamMarker",{enumerable:!0,get:function(){return dG.HelixStreamMarker}});var pG=km();Object.defineProperty(p,"HelixStreamMarkerWithVideo",{enumerable:!0,get:function(){return pG.HelixStreamMarkerWithVideo}});var hG=Qm();Object.defineProperty(p,"HelixPaginatedSubscriptionsRequest",{enumerable:!0,get:function(){return hG.HelixPaginatedSubscriptionsRequest}});var fG=Vm();Object.defineProperty(p,"HelixSubscriptionApi",{enumerable:!0,get:function(){return fG.HelixSubscriptionApi}});var mG=xl();Object.defineProperty(p,"HelixSubscription",{enumerable:!0,get:function(){return mG.HelixSubscription}});var yG=vl();Object.defineProperty(p,"HelixUserSubscription",{enumerable:!0,get:function(){return yG.HelixUserSubscription}});var _G=Jm();Object.defineProperty(p,"HelixTeamApi",{enumerable:!0,get:function(){return _G.HelixTeamApi}});var gG=El();Object.defineProperty(p,"HelixTeam",{enumerable:!0,get:function(){return gG.HelixTeam}});var bG=Wm();Object.defineProperty(p,"HelixTeamWithUsers",{enumerable:!0,get:function(){return bG.HelixTeamWithUsers}});var vG=dy();Object.defineProperty(p,"HelixUserApi",{enumerable:!0,get:function(){return vG.HelixUserApi}});var wG=uy();Object.defineProperty(p,"HelixUserBlock",{enumerable:!0,get:function(){return wG.HelixUserBlock}});var xG=yC();Object.defineProperty(p,"HelixFollow",{enumerable:!0,get:function(){return xG.HelixFollow}});var SG=sy();Object.defineProperty(p,"HelixPrivilegedUser",{enumerable:!0,get:function(){return SG.HelixPrivilegedUser}});var qG=Ll();Object.defineProperty(p,"HelixUser",{enumerable:!0,get:function(){return qG.HelixUser}});var PG=Dl();Object.defineProperty(p,"HelixBaseExtension",{enumerable:!0,get:function(){return PG.HelixBaseExtension}});var CG=Xm();Object.defineProperty(p,"HelixInstalledExtension",{enumerable:!0,get:function(){return CG.HelixInstalledExtension}});var HG=ry();Object.defineProperty(p,"HelixInstalledExtensionList",{enumerable:!0,get:function(){return HG.HelixInstalledExtensionList}});var EG=ay();Object.defineProperty(p,"HelixUserExtension",{enumerable:!0,get:function(){return EG.HelixUserExtension}});var AG=my();Object.defineProperty(p,"HelixVideoApi",{enumerable:!0,get:function(){return AG.HelixVideoApi}});var TG=hy();Object.defineProperty(p,"HelixVideo",{enumerable:!0,get:function(){return TG.HelixVideo}});var IG=_y();Object.defineProperty(p,"HelixWhisperApi",{enumerable:!0,get:function(){return IG.HelixWhisperApi}});var RG=Jp();Object.defineProperty(p,"ConfigError",{enumerable:!0,get:function(){return RG.ConfigError}});var DG=Om();Object.defineProperty(p,"StreamNotLiveError",{enumerable:!0,get:function(){return DG.StreamNotLiveError}});var OG=by();Object.defineProperty(p,"ApiReportedRequest",{enumerable:!0,get:function(){return OG.ApiReportedRequest}});var BG=ne();Object.defineProperty(p,"HelixPaginatedRequest",{enumerable:!0,get:function(){return BG.HelixPaginatedRequest}});var UG=Zr();Object.defineProperty(p,"HelixPaginatedRequestWithTotal",{enumerable:!0,get:function(){return UG.HelixPaginatedRequestWithTotal}});var sc=f();Object.defineProperty(p,"extractUserId",{enumerable:!0,get:function(){return sc.extractUserId}});Object.defineProperty(p,"extractUserName",{enumerable:!0,get:function(){return sc.extractUserName}});Object.defineProperty(p,"HelixExtension",{enumerable:!0,get:function(){return sc.HelixExtension}});Object.defineProperty(p,"HellFreezesOverError",{enumerable:!0,get:function(){return sc.HellFreezesOverError}})});var qC=l((p7,SC)=>{var gC=fc(),jG=_c(),bC=vn(),Kt=xt(),vC=bc(),wC=wc(),xC=Sc(),uc=__(),{ApiClient:kG}=_C(),{AppTokenAuthProvider:LG}=bh(),Sy=class{static{n(this,"EmoteFetcher")}constructor(e,t,i){if(i&&i.apiClient)this.apiClient=i.apiClient;else if(e!==void 0&&t!==void 0){let a=new LG(e,t);this.apiClient=new kG({authProvider:a})}this.emotes=new bC,this.channels=new bC,this.ffzModifiersFetched=!1}get globalChannel(){return this.channels.get(null)}_setupChannel(e,t=null){let i=this.channels.get(e);return i||(i=new jG(this,e),this.channels.set(e,i)),t&&(i.format=t),i}_getRawTwitchEmotes(e){if(!this.apiClient)throw new Error("Client id or client secret not provided.");return e?this.apiClient.chat.getChannelEmotes(e):this.apiClient.chat.getGlobalEmotes()}_cacheTwitchEmote(e,t,i=null){let a=this._setupChannel(e),o=i||new xC(a,t.id,t);return this.emotes.set(o.code,o),a.emotes.set(o.code,o),o}_getRawBTTVEmotes(e){let t=e?Kt.BTTV.Channel(e):Kt.BTTV.Global;return uc.get(t).then(i=>i.data instanceof Array?i.data:[...i.data.channelEmotes,...i.data.sharedEmotes])}_cacheBTTVEmote(e,t,i=null){let a=this._setupChannel(e),o=i||new gC(a,t.id,t);return this.emotes.set(o.code,o),a.emotes.set(o.code,o),o}_getRawFFZEmoteSet(e){let t=Kt.FFZ.Set(e);return uc.get(t).then(i=>i.data.set.emoticons)}_getRawFFZEmotes(e){let t=Kt.FFZ.Channel(e);return uc.get(t).then(i=>{let a=[];for(let o of Object.keys(i.data.sets)){let s=i.data.sets[o];a.push(...s.emoticons)}return a})}_cacheFFZEmote(e,t,i=null){let a=this._setupChannel(e),o=i||new vC(a,t.id,t);return this.emotes.set(o.code,o),a.emotes.set(o.code,o),o}_getRawSevenTVEmotes(e){let t=e?Kt.SevenTV.Channel(e):Kt.SevenTV.Global;return uc.get(t).then(i=>i.data)}_cacheSevenTVEmote(e,t,i,a=null){let o=this._setupChannel(e,i),s=a||new wC(o,t.id,t);return this.emotes.set(s.code,s),o.emotes.set(s.code,s),s}fetchTwitchEmotes(e=null){return this._getRawTwitchEmotes(e).then(t=>{for(let i of t)this._cacheTwitchEmote(e,{code:i.name,id:i.id,formats:i.formats});return this.channels.get(e).emotes.filter(i=>i.type==="twitch")})}fetchBTTVEmotes(e=null){return this._getRawBTTVEmotes(e).then(t=>{for(let i of t)this._cacheBTTVEmote(e,i);return this.channels.get(e).emotes.filter(i=>i.type==="bttv")})}async fetchFFZEmotes(e=null){return this.ffzModifiersFetched||(this.ffzModifiersFetched=!0,await this._getRawFFZEmoteSet(Kt.FFZ.sets.Modifiers).then(t=>{for(let i of t)this._cacheFFZEmote(null,i)})),e?this._getRawFFZEmotes(e).then(t=>{for(let i of t)this._cacheFFZEmote(e,i);return this.channels.get(e).emotes.filter(i=>i.type==="ffz")}):this._getRawFFZEmoteSet(Kt.FFZ.sets.Global).then(t=>{for(let i of t)this._cacheFFZEmote(e,i);return this.channels.get(e).emotes.filter(i=>i.type==="ffz")})}fetchSevenTVEmotes(e=null,t="webp"){return this._getRawSevenTVEmotes(e).then(i=>{if("emotes"in i)for(let a of i.emotes)this._cacheSevenTVEmote(e,a.data,t);else for(let a of i.emote_set.emotes)this._cacheSevenTVEmote(e,a.data,t);return this.channels.get(e).emotes.filter(a=>a.type==="7tv")})}fromObject(e){let t=[],i={bttv:{class:gC,cache:(a,o,s)=>this._cacheBTTVEmote(o,null,s)},ffz:{class:vC,cache:(a,o,s)=>this._cacheFFZEmote(o,null,s)},"7tv":{class:wC,cache:(a,o,s)=>this._cacheSevenTVEmote(o,null,a.imageType,s)},twitch:{class:xC,cache:(a,o,s)=>this._cacheTwitchEmote(o,null,s)}};for(let a of e){let{type:o}=a;if(!Object.keys(i).includes(o))throw new TypeError(`Unknown type: ${o}`);let s=i[o].class;this._setupChannel(a.channel_id,o==="7tv"?a.imageType:null);let u=s.fromObject(a,this.channels.get(a.channel_id));i[o].cache(a,a.channel_id,u),t.push(u)}return t}};SC.exports=Sy});var CC=l((f7,PC)=>{var MG=xt(),qy=class{static{n(this,"EmoteParser")}constructor(e,t={}){this.fetcher=e,this.options=Object.assign({template:"",type:"markdown",match:/:(.+?):/g},t),this._validateOptions(this.options)}_validateOptions(e){if(e.template&&typeof e.template!="string")throw new TypeError("Template must be a string");if(!["markdown","html","bbcode","plain"].includes(e.type))throw new TypeError("Parse type must be one of `markdown`, `html`, `bbcode`, or `plain`");if(!(e.match instanceof RegExp)||!e.match.global)throw new TypeError("Match must be a global RegExp.")}parse(e,t=0){return e.replace(this.options.match,(a,o)=>{let s=this.fetcher.emotes.get(o);if(!s)return a;if(s.modifier)return"";let u=this.options.template||MG.Templates[this.options.type],c=s.toLink(t);return u.replace(/{link}/g,c).replace(/{name}/g,s.code).replace(/{size}/g,t).replace(/{creator}/g,s.ownerName||"global")})}};PC.exports=qy});var FG=l((y7,HC)=>{HC.exports={BTTVEmote:fc(),Channel:_c(),Collection:vn(),Constants:xt(),Emote:_r(),EmoteFetcher:qC(),EmoteParser:CC(),FFZEmote:bc(),SevenTVEmote:wc(),TwitchEmote:Sc()}});export default FG();
|
|
22
|
+
//# sourceMappingURL=TwitchEmoticons.min.js.map
|