UNPKG

openapi-resolver

Version:

Open API Resolver - Javascript library to connect to parse and resolve openapi-enabled APIs via browser or nodejs

2 lines 260 kB
/*! For license information please see openapi-resolver.browser.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OpenApiResolver=t():e.OpenApiResolver=t()}(this,(()=>(()=>{var e={8575:(e,t,r)=>{"use strict";const n=r(8316);e.exports=function(e){let t,r,o,i;"function"==typeof(e=Array.prototype.slice.call(e))[e.length-1]&&(i=e.pop());"string"==typeof e[0]?(t=e[0],"object"==typeof e[2]?(r=e[1],o=e[2]):(r=void 0,o=e[1])):(t="",r=e[0],o=e[1]);o instanceof n||(o=new n(o));return{path:t,schema:r,options:o,callback:i}}},8316:(e,t,r)=>{"use strict";const n=r(9324),o=r(8015),i=r(4844),a=r(4486),s=r(9571),u=r(6796);function l(e){c(this,l.defaults),c(this,e)}function c(e,t){if(f(t)){let r=Object.keys(t);for(let n=0;n<r.length;n++){let o=r[n],i=t[o],a=e[o];f(i)?e[o]=c(a||{},i):void 0!==i&&(e[o]=i)}}return e}function f(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}e.exports=l,l.defaults={parse:{json:n,yaml:o,text:i,binary:a},resolve:{file:s,http:u,external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1}}},3265:(e,t,r)=>{"use strict";var n=r(5851).Buffer;const{ono:o}=r(1349),i=r(6930),a=r(6250),{ResolverError:s,ParserError:u,UnmatchedParserError:l,UnmatchedResolverError:c,isHandledError:f}=r(5554);e.exports=async function(e,t,r){e=i.stripHash(e);let p=t._add(e),h={url:e,extension:i.getExtension(e)};try{const e=await function(e,t,r){return new Promise(((n,i)=>{let u=a.all(t.resolve);function l(r){!r&&t.continueOnError?i(new c(e.url)):r&&"error"in r?r.error instanceof s?i(r.error):i(new s(r,e.url)):i(o.syntax(`Unable to resolve $ref pointer "${e.url}"`))}u=a.filter(u,"canRead",e),a.sort(u),a.run(u,"read",e,r).then(n,l)}))}(h,r,t);p.pathType=e.plugin.name,h.data=e.result;const i=await function(e,t,r){return new Promise(((i,s)=>{let c=a.all(t.parse),f=a.filter(c,"canParse",e),p=f.length>0?f:c;function h(t){var r;!t.plugin.allowEmpty&&(void 0===(r=t.result)||"object"==typeof r&&0===Object.keys(r).length||"string"==typeof r&&0===r.trim().length||n.isBuffer(r)&&0===r.length)?s(o.syntax(`Error parsing "${e.url}" as ${t.plugin.name}. \nParsed value is empty`)):i(t)}function d(r){!r&&t.continueOnError?s(new l(e.url)):r&&"error"in r?r.error instanceof u?s(r.error):s(new u(r.error.message,e.url)):s(o.syntax(`Unable to parse ${e.url}`))}a.sort(p),a.run(p,"parse",e,r).then(h,d)}))}(h,r,t);return p.value=i.result,i.result}catch(e){throw f(e)&&(p.value=e),e}}},4486:(e,t,r)=>{"use strict";var n=r(5851).Buffer;let o=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;e.exports={order:400,allowEmpty:!0,canParse:e=>n.isBuffer(e.data)&&o.test(e.url),parse:e=>n.isBuffer(e.data)?e.data:n.from(e.data)}},9324:(e,t,r)=>{"use strict";var n=r(5851).Buffer;const{ParserError:o}=r(5554);e.exports={order:100,allowEmpty:!0,canParse:".json",async parse(e){let t=e.data;if(n.isBuffer(t)&&(t=t.toString()),"string"!=typeof t)return t;if(0!==t.trim().length)try{return JSON.parse(t)}catch(t){throw new o(t.message,e.url)}}}},4844:(e,t,r)=>{"use strict";var n=r(5851).Buffer;const{ParserError:o}=r(5554);let i=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;e.exports={order:300,allowEmpty:!0,encoding:"utf8",canParse:e=>("string"==typeof e.data||n.isBuffer(e.data))&&i.test(e.url),parse(e){if("string"==typeof e.data)return e.data;if(n.isBuffer(e.data))return e.data.toString(this.encoding);throw new o("data is not text",e.url)}}},8015:(e,t,r)=>{"use strict";var n=r(5851).Buffer;const{ParserError:o}=r(5554),i=r(7949),{JSON_SCHEMA:a}=r(7949);e.exports={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(e){let t=e.data;if(n.isBuffer(t)&&(t=t.toString()),"string"!=typeof t)return t;try{return i.load(t,{schema:a})}catch(t){throw new o(t.message,e.url)}}}},5860:(e,t,r)=>{"use strict";e.exports=h;const n=r(6654),o=r(6930),{JSONParserError:i,InvalidPointerError:a,MissingPointerError:s,isHandledError:u}=r(5554),l=/\//g,c=/~/g,f=/~1/g,p=/~0/g;function h(e,t,r){this.$ref=e,this.path=t,this.originalPath=r||t,this.value=void 0,this.circular=!1,this.indirections=0}function d(e,t){if(n.isAllowed$Ref(e.value,t)){let r=o.resolve(e.path,e.value.$ref);if(r!==e.path){let o=e.$ref.$refs._resolve(r,e.path,t);return null!==o&&(e.indirections+=o.indirections+1,n.isExtended$Ref(e.value)?(e.value=n.dereference(e.value,o.value),!1):(e.$ref=o.$ref,e.path=o.path,e.value=o.value,!0))}e.circular=!0}}function y(e,t,r){if(!e.value||"object"!=typeof e.value)throw new i(`Error assigning $ref pointer "${e.path}". \nCannot set "${t}" of a non-object.`);return"-"===t&&Array.isArray(e.value)?e.value.push(r):e.value[t]=r,r}function g(e){if(u(e))throw e;return e}h.prototype.resolve=function(e,t,r){let n=h.parse(this.path,this.originalPath);this.value=g(e);for(let e=0;e<n.length;e++){if(d(this,t)&&(this.path=h.join(this.path,n.slice(e))),"object"==typeof this.value&&null!==this.value&&"$ref"in this.value)return this;let r=n[e];if(void 0===this.value[r]||null===this.value[r])throw this.value=null,new s(r,decodeURI(this.originalPath));this.value=this.value[r]}return(!this.value||this.value.$ref&&o.resolve(this.path,this.value.$ref)!==r)&&d(this,t),this},h.prototype.set=function(e,t,r){let n,o=h.parse(this.path);if(0===o.length)return this.value=t,t;this.value=g(e);for(let e=0;e<o.length-1;e++)d(this,r),n=o[e],this.value&&void 0!==this.value[n]?this.value=this.value[n]:this.value=y(this,n,{});return d(this,r),n=o[o.length-1],y(this,n,t),e},h.parse=function(e,t){let r=o.getHash(e).substr(1);if(!r)return[];r=r.split("/");for(let e=0;e<r.length;e++)r[e]=decodeURIComponent(r[e].replace(f,"/").replace(p,"~"));if(""!==r[0])throw new a(r,void 0===t?e:t);return r.slice(1)},h.join=function(e,t){-1===e.indexOf("#")&&(e+="#"),t=Array.isArray(t)?t:[t];for(let r=0;r<t.length;r++){let n=t[r];e+="/"+encodeURIComponent(n.replace(c,"~0").replace(l,"~1"))}return e}},6654:(e,t,r)=>{"use strict";e.exports=c;const n=r(5860),{InvalidPointerError:o,isHandledError:i,normalizeError:a}=r(5554),{safePointerToPath:s,stripHash:u,getHash:l}=r(6930);function c(){this.path=void 0,this.value=void 0,this.$refs=void 0,this.pathType=void 0,this.errors=void 0}c.prototype.addError=function(e){void 0===this.errors&&(this.errors=[]);const t=this.errors.map((({footprint:e})=>e));Array.isArray(e.errors)?this.errors.push(...e.errors.map(a).filter((({footprint:e})=>!t.includes(e)))):t.includes(e.footprint)||this.errors.push(a(e))},c.prototype.exists=function(e,t){try{return this.resolve(e,t),!0}catch(e){return!1}},c.prototype.get=function(e,t){return this.resolve(e,t).value},c.prototype.resolve=function(e,t,r,a){let c=new n(this,e,r);try{return c.resolve(this.value,t,a)}catch(e){if(!t||!t.continueOnError||!i(e))throw e;return null===e.path&&(e.path=s(l(a))),e instanceof o&&(e.source=decodeURI(u(a))),this.addError(e),null}},c.prototype.set=function(e,t){let r=new n(this,e);this.value=r.set(this.value,t)},c.is$Ref=function(e){return e&&"object"==typeof e&&"string"==typeof e.$ref&&e.$ref.length>0},c.isExternal$Ref=function(e){return c.is$Ref(e)&&"#"!==e.$ref[0]},c.isAllowed$Ref=function(e,t){if(c.is$Ref(e)){if("#/"===e.$ref.substr(0,2)||"#"===e.$ref)return!0;if("#"!==e.$ref[0]&&(!t||t.resolve.external))return!0}},c.isExtended$Ref=function(e){return c.is$Ref(e)&&Object.keys(e).length>1},c.dereference=function(e,t){if(t&&"object"==typeof t&&c.isExtended$Ref(e)){let r={};for(let t of Object.keys(e))"$ref"!==t&&(r[t]=e[t]);for(let e of Object.keys(t))e in r||(r[e]=t[e]);return r}return t}},8031:(e,t,r)=>{"use strict";const{ono:n}=r(1349),o=r(6654),i=r(6930);function a(){this.circular=!1,this._$refs={},this._root$Ref=null}function s(e,t){let r=Object.keys(e);return(t=Array.isArray(t[0])?t[0]:Array.prototype.slice.call(t)).length>0&&t[0]&&(r=r.filter((r=>-1!==t.indexOf(e[r].pathType)))),r.map((t=>({encoded:t,decoded:"file"===e[t].pathType?i.toFileSystemPath(t,!0):t})))}e.exports=a,a.prototype.paths=function(e){return s(this._$refs,arguments).map((e=>e.decoded))},a.prototype.values=function(e){let t=this._$refs;return s(t,arguments).reduce(((e,r)=>(e[r.decoded]=t[r.encoded].value,e)),{})},a.prototype.toJSON=a.prototype.values,a.prototype.exists=function(e,t){try{return this._resolve(e,"",t),!0}catch(e){return!1}},a.prototype.get=function(e,t){return this._resolve(e,"",t).value},a.prototype.set=function(e,t){let r=i.resolve(this._root$Ref.path,e),o=i.stripHash(r),a=this._$refs[o];if(!a)throw n(`Error resolving $ref pointer "${e}". \n"${o}" not found.`);a.set(r,t)},a.prototype._add=function(e){let t=i.stripHash(e),r=new o;return r.path=t,r.$refs=this,this._$refs[t]=r,this._root$Ref=this._root$Ref||r,r},a.prototype._resolve=function(e,t,r){let o=i.resolve(this._root$Ref.path,e),a=i.stripHash(o),s=this._$refs[a];if(!s)throw n(`Error resolving $ref pointer "${e}". \n"${a}" not found.`);return s.resolve(o,r,e,t)},a.prototype._get$Ref=function(e){e=i.resolve(this._root$Ref.path,e);let t=i.stripHash(e);return this._$refs[t]}},3747:(e,t,r)=>{"use strict";const n=r(6654),o=r(5860),i=r(3265),a=r(6930),{isHandledError:s}=r(5554);function u(e,t,r,i,a){a=a||new Set;let s=[];if(e&&"object"==typeof e&&!ArrayBuffer.isView(e)&&!a.has(e))if(a.add(e),n.isExternal$Ref(e))s.push(l(e,t,r,i));else for(let c of Object.keys(e)){let f=o.join(t,c),p=e[c];n.isExternal$Ref(p)?s.push(l(p,f,r,i)):s=s.concat(u(p,f,r,i,a))}return s}async function l(e,t,r,n){let o=a.resolve(t,e.$ref),l=a.stripHash(o);if(e=r._$refs[l])return Promise.resolve(e.value);try{let e=u(await i(o,r,n),l+"#",r,n);return Promise.all(e)}catch(e){if(!n.continueOnError||!s(e))throw e;return r._$refs[l]&&(e.source=decodeURI(a.stripHash(t)),e.path=a.safePointerToPath(a.getHash(t))),[]}}e.exports=function(e,t){if(!t.resolve.external)return Promise.resolve();try{let r=u(e.schema,e.$refs._root$Ref.path+"#",e.$refs,t);return Promise.all(r)}catch(e){return Promise.reject(e)}}},9571:(e,t,r)=>{"use strict";const n=r(3471),{ono:o}=r(1349),i=r(6930),{ResolverError:a}=r(5554);e.exports={order:100,canRead:e=>i.isFileSystemPath(e.url),read:e=>new Promise(((t,r)=>{let s;try{s=i.toFileSystemPath(e.url)}catch(t){r(new a(o.uri(t,`Malformed URI: ${e.url}`),e.url))}try{n.readFile(s,((e,n)=>{e?r(new a(o(e,`Error opening file "${s}"`),s)):t(n)}))}catch(e){r(new a(o(e,`Error opening file "${s}"`),s))}}))}},6796:(e,t,r)=>{"use strict";var n=r(2790),o=r(5851).Buffer;const i=r(5262),a=r(9804),{ono:s}=r(1349),u=r(6930),{ResolverError:l}=r(5554);function c(e,t,r){return new Promise(((n,f)=>{e=u.parse(e),(r=r||[]).push(e.href),function(e,t){return new Promise(((r,n)=>{let s=("https:"===e.protocol?a:i).get({hostname:e.hostname,port:e.port,path:e.path,auth:e.auth,protocol:e.protocol,headers:t.headers||{},withCredentials:t.withCredentials});"function"==typeof s.setTimeout&&s.setTimeout(t.timeout),s.on("timeout",(()=>{s.abort()})),s.on("error",n),s.once("response",(e=>{e.body=o.alloc(0),e.on("data",(t=>{e.body=o.concat([e.body,o.from(t)])})),e.on("error",n),e.on("end",(()=>{r(e)}))}))}))}(e,t).then((i=>{if(i.statusCode>=400)throw s({status:i.statusCode},`HTTP ERROR ${i.statusCode}`);if(i.statusCode>=300)if(r.length>t.redirects)f(new l(s({status:i.statusCode},`Error downloading ${r[0]}. \nToo many redirects: \n ${r.join(" \n ")}`)));else{if(!i.headers.location)throw s({status:i.statusCode},`HTTP ${i.statusCode} redirect with no location header`);c(u.resolve(e,i.headers.location),t,r).then(n,f)}else n(i.body||o.alloc(0))})).catch((t=>{f(new l(s(t,`Error downloading ${e.href}`),e.href))}))}))}e.exports={order:200,headers:null,timeout:5e3,redirects:5,withCredentials:!1,canRead:e=>u.isHttp(e.url),read(e){let t=u.parse(e.url);return n.browser&&!t.protocol&&(t.protocol=u.parse(location.href).protocol),c(t,this)}}},5554:(e,t,r)=>{"use strict";const{Ono:n}=r(1349),{stripHash:o,toFileSystemPath:i}=r(6930),a=t.JSONParserError=class extends Error{constructor(e,t){super(),this.code="EUNKNOWN",this.message=e,this.source=t,this.path=null,n.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};u(a);const s=t.JSONParserErrorGroup=class e extends Error{constructor(e){super(),this.files=e,this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${i(e.$refs._root$Ref.path)}'`,n.extend(this)}static getParserErrors(e){const t=[];for(const r of Object.values(e.$refs._$refs))r.errors&&t.push(...r.errors);return t}get errors(){return e.getParserErrors(this.files)}};u(s);u(t.ParserError=class extends a{constructor(e,t){super(`Error parsing ${t}: ${e}`,t),this.code="EPARSER"}});u(t.UnmatchedParserError=class extends a{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER"}});u(t.ResolverError=class extends a{constructor(e,t){super(e.message||`Error reading file "${t}"`,t),this.code="ERESOLVER","code"in e&&(this.ioErrorCode=String(e.code))}});u(t.UnmatchedResolverError=class extends a{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER"}});u(t.MissingPointerError=class extends a{constructor(e,t){super(`Token "${e}" does not exist.`,o(t)),this.code="EMISSINGPOINTER"}});function u(e){Object.defineProperty(e.prototype,"name",{value:e.name,enumerable:!0})}u(t.InvalidPointerError=class extends a{constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,o(t)),this.code="EINVALIDPOINTER"}}),t.isHandledError=function(e){return e instanceof a||e instanceof s},t.normalizeError=function(e){return null===e.path&&(e.path=[]),e}},6250:(e,t)=>{"use strict";function r(e,t,r,n,o){let i=e[t];if("function"==typeof i)return i.apply(e,[r,n,o]);if(!n){if(i instanceof RegExp)return i.test(r.url);if("string"==typeof i)return i===r.extension;if(Array.isArray(i))return-1!==i.indexOf(r.extension)}return i}t.all=function(e){return Object.keys(e).filter((t=>"object"==typeof e[t])).map((t=>(e[t].name=t,e[t])))},t.filter=function(e,t,n){return e.filter((e=>!!r(e,t,n)))},t.sort=function(e){for(let t of e)t.order=t.order||Number.MAX_SAFE_INTEGER;return e.sort(((e,t)=>e.order-t.order))},t.run=function(e,t,n,o){let i,a,s=0;return new Promise(((u,l)=>{function c(){if(i=e[s++],!i)return l(a);try{let a=r(i,t,n,f,o);if(a&&"function"==typeof a.then)a.then(p,h);else if(void 0!==a)p(a);else if(s===e.length)throw new Error("No promise has been returned or callback has been called.")}catch(e){h(e)}}function f(e,t){e?h(e):p(t)}function p(e){u({plugin:i,result:e})}function h(e){a={plugin:i,error:e},c()}c()}))}},6930:(e,t,r)=>{"use strict";var n=r(2790);let o=/^win/.test(n.platform),i=/\//g,a=/^(\w{2,}):\/\//i,s=e.exports,u=/~1/g,l=/~0/g,c=[/\?/g,"%3F",/\#/g,"%23"],f=[/\%23/g,"#",/\%24/g,"$",/\%26/g,"&",/\%2C/g,",",/\%40/g,"@"];t.parse=r(3149).parse,t.resolve=r(3149).resolve,t.cwd=function(){if(n.browser)return location.href;let e=n.cwd(),t=e.slice(-1);return"/"===t||"\\"===t?e:e+"/"},t.getProtocol=function(e){let t=a.exec(e);if(t)return t[1].toLowerCase()},t.getExtension=function(e){let t=e.lastIndexOf(".");return t>=0?s.stripQuery(e.substr(t).toLowerCase()):""},t.stripQuery=function(e){let t=e.indexOf("?");return t>=0&&(e=e.substr(0,t)),e},t.getHash=function(e){let t=e.indexOf("#");return t>=0?e.substr(t):"#"},t.stripHash=function(e){let t=e.indexOf("#");return t>=0&&(e=e.substr(0,t)),e},t.isHttp=function(e){let t=s.getProtocol(e);return"http"===t||"https"===t||void 0===t&&n.browser},t.isFileSystemPath=function(e){if(n.browser)return!1;let t=s.getProtocol(e);return void 0===t||"file"===t},t.fromFileSystemPath=function(e){o&&(e=e.replace(/\\/g,"/")),e=encodeURI(e);for(let t=0;t<c.length;t+=2)e=e.replace(c[t],c[t+1]);return e},t.toFileSystemPath=function(e,t){e=decodeURI(e);for(let t=0;t<f.length;t+=2)e=e.replace(f[t],f[t+1]);let r="file://"===e.substr(0,7).toLowerCase();return r&&(e="/"===e[7]?e.substr(8):e.substr(7),o&&"/"===e[1]&&(e=e[0]+":"+e.substr(1)),t?e="file:///"+e:(r=!1,e=o?e:"/"+e)),o&&!r&&":\\"===(e=e.replace(i,"\\")).substr(1,2)&&(e=e[0].toUpperCase()+e.substr(1)),e},t.safePointerToPath=function(e){return e.length<=1||"#"!==e[0]||"/"!==e[1]?[]:e.slice(2).split("/").map((e=>decodeURIComponent(e).replace(u,"/").replace(l,"~")))}},1349:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Ono:()=>m,default:()=>S,ono:()=>v});const n=!1,o=!1,i=/\r?\n/,a=/\bono[ @]/;function s(e,t){let r=l(e.stack),n=t?t.stack:void 0;return r&&n?r+"\n\n"+n:r||n}function u(e,t,r){r?Object.defineProperty(t,"stack",{get:()=>s({stack:e.get.apply(t)},r),enumerable:!1,configurable:!0}):function(e,t){Object.defineProperty(e,"stack",{get:()=>l(t.get.apply(e)),enumerable:!1,configurable:!0})}(t,e)}function l(e){if(e){let t,r=e.split(i);for(let e=0;e<r.length;e++){let n=r[e];if(a.test(n))void 0===t&&(t=e);else if(void 0!==t){r.splice(t,e-t);break}}if(r.length>0)return r.join("\n")}return e}const c=["function","symbol","undefined"],f=["constructor","prototype","__proto__"],p=Object.getPrototypeOf({});function h(){let e={},t=this;for(let r of d(t))if("string"==typeof r){let n=t[r],o=typeof n;c.includes(o)||(e[r]=n)}return e}function d(e,t=[]){let r=[];for(;e&&e!==p;)r=r.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let n=new Set(r);for(let e of t.concat(f))n.delete(e);return n}const y=["name","message","stack"];function g(e,t,r){let n=e;return function(e,t){let r=Object.getOwnPropertyDescriptor(e,"stack");!function(e){return Boolean(e&&e.configurable&&"function"==typeof e.get)}(r)?function(e){return Boolean(!e||e.writable||"function"==typeof e.set)}(r)&&(e.stack=s(e,t)):u(r,e,t)}(n,t),t&&"object"==typeof t&&function(e,t){let r=d(t,y),n=e,o=t;for(let e of r)if(void 0===n[e])try{n[e]=o[e]}catch(e){}}(n,t),n.toJSON=h,o&&o(n),r&&"object"==typeof r&&Object.assign(n,r),n}const m=b;function b(e,t){function r(...r){let{originalError:n,props:o,message:i}=function(e,t){let r,n,o,i="";return"string"==typeof e[0]?o=e:"string"==typeof e[1]?(e[0]instanceof Error?r=e[0]:n=e[0],o=e.slice(1)):(r=e[0],n=e[1],o=e.slice(2)),o.length>0&&(i=t.format?t.format.apply(void 0,o):o.join(" ")),t.concatMessages&&r&&r.message&&(i+=(i?" \n":"")+r.message),{originalError:r,props:n,message:i}}(r,t);return g(new e(i),n,o)}return t=function(e){return{concatMessages:void 0===(e=e||{}).concatMessages||Boolean(e.concatMessages),format:void 0===e.format?n:"function"==typeof e.format&&e.format}}(t),r[Symbol.species]=e,r}b.toJSON=function(e){return h.call(e)},b.extend=function(e,t,r){return r||t instanceof Error?g(e,t,r):t?g(e,void 0,t):g(e)};const v=A;A.error=new m(Error),A.eval=new m(EvalError),A.range=new m(RangeError),A.reference=new m(ReferenceError),A.syntax=new m(SyntaxError),A.type=new m(TypeError),A.uri=new m(URIError);const w=A;function A(...e){let t=e[0];if("object"==typeof t&&"string"==typeof t.name)for(let r of Object.values(w))if("function"==typeof r&&"ono"===r.name){let n=r[Symbol.species];if(n&&n!==Error&&(t instanceof n||t.name===n.name))return r.apply(void 0,e)}return A.error.apply(void 0,e)}r(3254);e=r.hmd(e);const S=v;"object"==typeof e.exports&&(e.exports=Object.assign(e.exports.default,e.exports))},6717:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),c=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,l=n-o;s<l;s+=a)i.push(u(e,s,s+a>l?l:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5851:(e,t,r)=>{"use strict";const n=r(6717),o=r(9350),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||J(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return c(e),s(e<0?0:0|d(e))}function p(e){const t=e.length<0?0:0|d(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(o)return n?-1:V(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(l(e,i)===l(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(l(e,i+n)!==l(t,n)){r=!1;break}if(r)return i}return-1}function w(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(J(n))return a;e[r+a]=n}return a}function A(e,t,r,n){return Y(V(t,e.length-r),e,r,n)}function S(e,t,r,n){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return Y(z(t),e,r,n)}function E(e,t,r,n){return Y(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=j));return r}(n)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))o+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),l=this.slice(n,o),c=e.slice(t,r);for(let e=0;e<s;++e)if(l[e]!==c[e]){i=l[e],a=c[e];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const j=4096;function k(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function C(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Q[e[n]];return o}function R(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Z((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||I(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){P(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){P(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=u.isBuffer(e)?e:u.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const F={};function D(e,t,r){F[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function $(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function q(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=$(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=$(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Z(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},1403:e=>{e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},2648:(e,t,r)=>{"use strict";var n=r(3584),o=r(7257),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},7257:(e,t,r)=>{"use strict";var n=r(4597),o=r(3584),i=r(7012),a=o("%TypeError%"),s=o("%Function.prototype.apply%"),u=o("%Function.prototype.call%"),l=o("%Reflect.apply%",!0)||n.call(u,s),c=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=l(n,u,arguments);return i(t,1+f(0,e.length-(arguments.length-1)),!0)};var p=function(){return l(n,s,arguments)};c?c(e.exports,"apply",{value:p}):e.exports.apply=p},1314:(e,t,r)=>{"use strict";var n=r(4607)(),o=r(3584),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(e){i=!1}var a=o("%SyntaxError%"),s=o("%TypeError%"),u=r(1700);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new s("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!u&&u(e,t);if(i)i(e,t,{configurable:null===l&&f?f.configurable:!l,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!c&&(n||o||l))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},1590:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i