@remitano-anhdt/metaplex-js
Version:
Metaplex JavaScript API
25 lines (23 loc) • 269 kB
JavaScript
var metaplex=function(t,e,i){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function n(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(i){if("default"!==i&&!(i in t)){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}}))})),Object.freeze(t)}var a,o=r(e),s=r(i);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function u(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{u(r.next(t))}catch(t){a(t)}}function s(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}u((r=r.apply(t,e||[])).next())}))}t.Currency=void 0,(a=t.Currency||(t.Currency={})).USD="usd",a.EUR="eur",a.AR="ar",a.SOL="sol";var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function d(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})})),e}var f,p={exports:{}},h=function(t,e){return function(){for(var i=new Array(arguments.length),r=0;r<i.length;r++)i[r]=arguments[r];return t.apply(e,i)}},y=h,g=Object.prototype.toString,m=(f=Object.create(null),function(t){var e=g.call(t);return f[e]||(f[e]=e.slice(8,-1).toLowerCase())});function b(t){return t=t.toLowerCase(),function(e){return m(e)===t}}function A(t){return Array.isArray(t)}function v(t){return void 0===t}var M=b("ArrayBuffer");function w(t){return null!==t&&"object"==typeof t}function P(t){if("object"!==m(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var _=b("Date"),S=b("File"),E=b("Blob"),k=b("FileList");function T(t){return"[object Function]"===g.call(t)}var R=b("URLSearchParams");function B(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),A(t))for(var i=0,r=t.length;i<r;i++)e.call(null,t[i],i,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}var O,x=(O="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return O&&t instanceof O}),D={isArray:A,isArrayBuffer:M,isBuffer:function(t){return null!==t&&!v(t)&&null!==t.constructor&&!v(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||g.call(t)===e||T(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&M(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:w,isPlainObject:P,isUndefined:v,isDate:_,isFile:S,isBlob:E,isFunction:T,isStream:function(t){return w(t)&&T(t.pipe)},isURLSearchParams:R,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:B,merge:function t(){var e={};function i(i,r){P(e[r])&&P(i)?e[r]=t(e[r],i):P(i)?e[r]=t({},i):A(i)?e[r]=i.slice():e[r]=i}for(var r=0,n=arguments.length;r<n;r++)B(arguments[r],i);return e},extend:function(t,e,i){return B(e,(function(e,r){t[r]=i&&"function"==typeof e?y(e,i):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,i,r){t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,i&&Object.assign(t.prototype,i)},toFlatObject:function(t,e,i){var r,n,a,o={};e=e||{};do{for(n=(r=Object.getOwnPropertyNames(t)).length;n-- >0;)o[a=r[n]]||(e[a]=t[a],o[a]=!0);t=Object.getPrototypeOf(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},kindOf:m,kindOfTest:b,endsWith:function(t,e,i){t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;var r=t.indexOf(e,i);return-1!==r&&r===i},toArray:function(t){if(!t)return null;var e=t.length;if(v(e))return null;for(var i=new Array(e);e-- >0;)i[e]=t[e];return i},isTypedArray:x,isFileList:k},I=D;function C(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var U=function(t,e,i){if(!e)return t;var r;if(i)r=i(e);else if(I.isURLSearchParams(e))r=e.toString();else{var n=[];I.forEach(e,(function(t,e){null!=t&&(I.isArray(t)?e+="[]":t=[t],I.forEach(t,(function(t){I.isDate(t)?t=t.toISOString():I.isObject(t)&&(t=JSON.stringify(t)),n.push(C(e)+"="+C(t))})))})),r=n.join("&")}if(r){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t},W=D;function K(){this.handlers=[]}K.prototype.use=function(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},K.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},K.prototype.forEach=function(t){W.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var N=K,V=D,j=D;function L(t,e,i,r,n){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),r&&(this.request=r),n&&(this.response=n)}j.inherits(L,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var z=L.prototype,F={};["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"].forEach((function(t){F[t]={value:t}})),Object.defineProperties(L,F),Object.defineProperty(z,"isAxiosError",{value:!0}),L.from=function(t,e,i,r,n,a){var o=Object.create(z);return j.toFlatObject(t,o,(function(t){return t!==Error.prototype})),L.call(o,t.message,e,i,r,n),o.name=t.name,a&&Object.assign(o,a),o};var Y=L,H={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},X=D;var G=function(t,e){e=e||new FormData;var i=[];function r(t){return null===t?"":X.isDate(t)?t.toISOString():X.isArrayBuffer(t)||X.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(n,a){if(X.isPlainObject(n)||X.isArray(n)){if(-1!==i.indexOf(n))throw Error("Circular reference detected in "+a);i.push(n),X.forEach(n,(function(i,n){if(!X.isUndefined(i)){var o,s=a?a+"."+n:n;if(i&&!a&&"object"==typeof i)if(X.endsWith(n,"{}"))i=JSON.stringify(i);else if(X.endsWith(n,"[]")&&(o=X.toArray(i)))return void o.forEach((function(t){!X.isUndefined(t)&&e.append(s,r(t))}));t(i,s)}})),i.pop()}else e.append(a,r(n))}(t),e},q=Y,$=D,Z=$.isStandardBrowserEnv()?{write:function(t,e,i,r,n,a){var o=[];o.push(t+"="+encodeURIComponent(e)),$.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),$.isString(r)&&o.push("path="+r),$.isString(n)&&o.push("domain="+n),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},J=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)},Q=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},tt=function(t,e){return t&&!J(e)?Q(t,e):e},et=D,it=["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"],rt=D,nt=rt.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function r(t){var r=t;return e&&(i.setAttribute("href",r),r=i.href),i.setAttribute("href",r),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return t=r(window.location.href),function(e){var i=rt.isString(e)?r(e):e;return i.protocol===t.protocol&&i.host===t.host}}():function(){return!0},at=Y;function ot(t){at.call(this,null==t?"canceled":t,at.ERR_CANCELED),this.name="CanceledError"}D.inherits(ot,at,{__CANCEL__:!0});var st=ot,ut=D,ct=function(t,e,i){var r=i.config.validateStatus;i.status&&r&&!r(i.status)?e(new q("Request failed with status code "+i.status,[q.ERR_BAD_REQUEST,q.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)},lt=Z,dt=U,ft=tt,pt=function(t){var e,i,r,n={};return t?(et.forEach(t.split("\n"),(function(t){if(r=t.indexOf(":"),e=et.trim(t.substr(0,r)).toLowerCase(),i=et.trim(t.substr(r+1)),e){if(n[e]&&it.indexOf(e)>=0)return;n[e]="set-cookie"===e?(n[e]?n[e]:[]).concat([i]):n[e]?n[e]+", "+i:i}})),n):n},ht=nt,yt=H,gt=Y,mt=st,bt=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""},At=function(t){return new Promise((function(e,i){var r,n=t.data,a=t.headers,o=t.responseType;function s(){t.cancelToken&&t.cancelToken.unsubscribe(r),t.signal&&t.signal.removeEventListener("abort",r)}ut.isFormData(n)&&ut.isStandardBrowserEnv()&&delete a["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var c=t.auth.username||"",l=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(c+":"+l)}var d=ft(t.baseURL,t.url);function f(){if(u){var r="getAllResponseHeaders"in u?pt(u.getAllResponseHeaders()):null,n={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:t,request:u};ct((function(t){e(t),s()}),(function(t){i(t),s()}),n),u=null}}if(u.open(t.method.toUpperCase(),dt(d,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=f:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(f)},u.onabort=function(){u&&(i(new gt("Request aborted",gt.ECONNABORTED,t,u)),u=null)},u.onerror=function(){i(new gt("Network Error",gt.ERR_NETWORK,t,u,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||yt;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(new gt(e,r.clarifyTimeoutError?gt.ETIMEDOUT:gt.ECONNABORTED,t,u)),u=null},ut.isStandardBrowserEnv()){var p=(t.withCredentials||ht(d))&&t.xsrfCookieName?lt.read(t.xsrfCookieName):void 0;p&&(a[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&ut.forEach(a,(function(t,e){void 0===n&&"content-type"===e.toLowerCase()?delete a[e]:u.setRequestHeader(e,t)})),ut.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(r=function(t){u&&(i(!t||t&&t.type?new mt:t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(r),t.signal&&(t.signal.aborted?r():t.signal.addEventListener("abort",r))),n||(n=null);var h=bt(d);h&&-1===["http","https","file"].indexOf(h)?i(new gt("Unsupported protocol "+h+":",gt.ERR_BAD_REQUEST,t)):u.send(n)}))},vt=D,Mt=function(t,e){V.forEach(t,(function(i,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=i,delete t[r])}))},wt=Y,Pt=G,_t={"Content-Type":"application/x-www-form-urlencoded"};function St(t,e){!vt.isUndefined(t)&&vt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var Et,kt={transitional:H,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Et=At),Et),transformRequest:[function(t,e){if(Mt(e,"Accept"),Mt(e,"Content-Type"),vt.isFormData(t)||vt.isArrayBuffer(t)||vt.isBuffer(t)||vt.isStream(t)||vt.isFile(t)||vt.isBlob(t))return t;if(vt.isArrayBufferView(t))return t.buffer;if(vt.isURLSearchParams(t))return St(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var i,r=vt.isObject(t),n=e&&e["Content-Type"];if((i=vt.isFileList(t))||r&&"multipart/form-data"===n){var a=this.env&&this.env.FormData;return Pt(i?{"files[]":t}:t,a&&new a)}return r||"application/json"===n?(St(e,"application/json"),function(t,e,i){if(vt.isString(t))try{return(e||JSON.parse)(t),vt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(i||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||kt.transitional,i=e&&e.silentJSONParsing,r=e&&e.forcedJSONParsing,n=!i&&"json"===this.responseType;if(n||r&&vt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw wt.from(t,wt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};vt.forEach(["delete","get","head"],(function(t){kt.headers[t]={}})),vt.forEach(["post","put","patch"],(function(t){kt.headers[t]=vt.merge(_t)}));var Tt=kt,Rt=D,Bt=Tt,Ot=function(t){return!(!t||!t.__CANCEL__)},xt=D,Dt=function(t,e,i){var r=this||Bt;return Rt.forEach(i,(function(i){t=i.call(r,t,e)})),t},It=Ot,Ct=Tt,Ut=st;function Wt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut}var Kt=D,Nt=function(t,e){e=e||{};var i={};function r(t,e){return Kt.isPlainObject(t)&&Kt.isPlainObject(e)?Kt.merge(t,e):Kt.isPlainObject(e)?Kt.merge({},e):Kt.isArray(e)?e.slice():e}function n(i){return Kt.isUndefined(e[i])?Kt.isUndefined(t[i])?void 0:r(void 0,t[i]):r(t[i],e[i])}function a(t){if(!Kt.isUndefined(e[t]))return r(void 0,e[t])}function o(i){return Kt.isUndefined(e[i])?Kt.isUndefined(t[i])?void 0:r(void 0,t[i]):r(void 0,e[i])}function s(i){return i in e?r(t[i],e[i]):i in t?r(void 0,t[i]):void 0}var u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s};return Kt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||n,r=e(t);Kt.isUndefined(r)&&e!==s||(i[t]=r)})),i},Vt="0.27.2",jt=Vt,Lt=Y,zt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){zt[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));var Ft={};zt.transitional=function(t,e,i){function r(t,e){return"[Axios v"+jt+"] Transitional option '"+t+"'"+e+(i?". "+i:"")}return function(i,n,a){if(!1===t)throw new Lt(r(n," has been removed"+(e?" in "+e:"")),Lt.ERR_DEPRECATED);return e&&!Ft[n]&&(Ft[n]=!0,console.warn(r(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,n,a)}};var Yt={assertOptions:function(t,e,i){if("object"!=typeof t)throw new Lt("options must be an object",Lt.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),n=r.length;n-- >0;){var a=r[n],o=e[a];if(o){var s=t[a],u=void 0===s||o(s,a,t);if(!0!==u)throw new Lt("option "+a+" must be "+u,Lt.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new Lt("Unknown option "+a,Lt.ERR_BAD_OPTION)}},validators:zt},Ht=D,Xt=U,Gt=N,qt=function(t){return Wt(t),t.headers=t.headers||{},t.data=Dt.call(t,t.data,t.headers,t.transformRequest),t.headers=xt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),xt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||Ct.adapter)(t).then((function(e){return Wt(t),e.data=Dt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return It(e)||(Wt(t),e&&e.response&&(e.response.data=Dt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},$t=Nt,Zt=tt,Jt=Yt,Qt=Jt.validators;function te(t){this.defaults=t,this.interceptors={request:new Gt,response:new Gt}}te.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=$t(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var i=e.transitional;void 0!==i&&Jt.assertOptions(i,{silentJSONParsing:Qt.transitional(Qt.boolean),forcedJSONParsing:Qt.transitional(Qt.boolean),clarifyTimeoutError:Qt.transitional(Qt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var a,o=[];if(this.interceptors.response.forEach((function(t){o.push(t.fulfilled,t.rejected)})),!n){var s=[qt,void 0];for(Array.prototype.unshift.apply(s,r),s=s.concat(o),a=Promise.resolve(e);s.length;)a=a.then(s.shift(),s.shift());return a}for(var u=e;r.length;){var c=r.shift(),l=r.shift();try{u=c(u)}catch(t){l(t);break}}try{a=qt(u)}catch(t){return Promise.reject(t)}for(;o.length;)a=a.then(o.shift(),o.shift());return a},te.prototype.getUri=function(t){t=$t(this.defaults,t);var e=Zt(t.baseURL,t.url);return Xt(e,t.params,t.paramsSerializer)},Ht.forEach(["delete","get","head","options"],(function(t){te.prototype[t]=function(e,i){return this.request($t(i||{},{method:t,url:e,data:(i||{}).data}))}})),Ht.forEach(["post","put","patch"],(function(t){function e(e){return function(i,r,n){return this.request($t(n||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}te.prototype[t]=e(),te.prototype[t+"Form"]=e(!0)}));var ee=te,ie=st;function re(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var i=this;this.promise.then((function(t){if(i._listeners){var e,r=i._listeners.length;for(e=0;e<r;e++)i._listeners[e](t);i._listeners=null}})),this.promise.then=function(t){var e,r=new Promise((function(t){i.subscribe(t),e=t})).then(t);return r.cancel=function(){i.unsubscribe(e)},r},t((function(t){i.reason||(i.reason=new ie(t),e(i.reason))}))}re.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},re.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},re.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},re.source=function(){var t;return{token:new re((function(e){t=e})),cancel:t}};var ne=re,ae=D,oe=D,se=h,ue=ee,ce=Nt;var le=function t(e){var i=new ue(e),r=se(ue.prototype.request,i);return oe.extend(r,ue.prototype,i),oe.extend(r,i),r.create=function(i){return t(ce(e,i))},r}(Tt);le.Axios=ue,le.CanceledError=st,le.CancelToken=ne,le.isCancel=Ot,le.VERSION=Vt,le.toFormData=G,le.AxiosError=Y,le.Cancel=le.CanceledError,le.all=function(t){return Promise.all(t)},le.spread=function(t){return function(e){return t.apply(null,e)}},le.isAxiosError=function(t){return ae.isObject(t)&&!0===t.isAxiosError},p.exports=le,p.exports.default=le;var de=p.exports;class fe{static translateCurrency(e){switch(e){case t.Currency.AR:return"arweave";case t.Currency.SOL:return"solana";case t.Currency.USD:return"usd";case t.Currency.EUR:return"eur";default:throw new Error("Invalid currency supplied to Coingecko conversion rate provider")}}getRate(t,e){return u(this,void 0,void 0,(function*(){const i="string"==typeof t?[t]:t,r="string"==typeof e?[e]:e,n=`https://api.coingecko.com/api/v3/simple/price?ids=${i.map((t=>fe.translateCurrency(t))).join(",")}&vs_currencies=${r.map((t=>fe.translateCurrency(t))).join(",")}`,a=yield de(n),o=yield a.data;return i.reduce(((t,e)=>[...t,...r.map((t=>({from:e,to:t,rate:o[fe.translateCurrency(e)][fe.translateCurrency(t)]})))]),[])}))}}var pe="object"==typeof self?self.FormData:window.FormData;const he="https://arweave.net",ye=Math.pow(10,9),ge=Math.pow(10,12);var me,be=Object.freeze({__proto__:null,Storage:class{}});t.ChainId=void 0,(me=t.ChainId||(t.ChainId={}))[me.MainnetBeta=101]="MainnetBeta",me[me.Testnet=102]="Testnet",me[me.Devnet=103]="Devnet";const Ae={devnet:{endpoint:e.clusterApiUrl("devnet"),ChainId:t.ChainId.Devnet},"mainnet-beta":{endpoint:"https://api.metaplex.solana.com/",ChainId:t.ChainId.MainnetBeta},"mainnet-beta (Solana)":{endpoint:"https://api.mainnet-beta.solana.com",ChainId:t.ChainId.MainnetBeta},"mainnet-beta (Serum)":{endpoint:"https://solana-api.projectserum.com/",ChainId:t.ChainId.MainnetBeta},testnet:{endpoint:e.clusterApiUrl("testnet"),ChainId:t.ChainId.Testnet}};class ve extends e.Connection{constructor(t="mainnet-beta",e){t in Ae&&(t=Ae[t].endpoint),super(t,e)}}const Me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==c?c:void 0;for(var we,Pe=(we="SHA-256",async(t,e)=>{"string"==typeof t&&(t=(new Me.TextEncoder).encode(t)),e={outputFormat:"hex",...e};const i=await Me.crypto.subtle.digest(we,t);return"hex"===e.outputFormat?(t=>{const e=new DataView(t);let i="";for(let t=0;t<e.byteLength;t+=4)i+=e.getUint32(t).toString(16).padStart(8,"0");return i})(i):i}),_e={},Se={byteLength:function(t){var e=Oe(t),i=e[0],r=e[1];return 3*(i+r)/4-r},toByteArray:function(t){var e,i,r=Oe(t),n=r[0],a=r[1],o=new Te(function(t,e,i){return 3*(e+i)/4-i}(0,n,a)),s=0,u=a>0?n-4:n;for(i=0;i<u;i+=4)e=ke[t.charCodeAt(i)]<<18|ke[t.charCodeAt(i+1)]<<12|ke[t.charCodeAt(i+2)]<<6|ke[t.charCodeAt(i+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=255&e;2===a&&(e=ke[t.charCodeAt(i)]<<2|ke[t.charCodeAt(i+1)]>>4,o[s++]=255&e);1===a&&(e=ke[t.charCodeAt(i)]<<10|ke[t.charCodeAt(i+1)]<<4|ke[t.charCodeAt(i+2)]>>2,o[s++]=e>>8&255,o[s++]=255&e);return o},fromByteArray:function(t){for(var e,i=t.length,r=i%3,n=[],a=16383,o=0,s=i-r;o<s;o+=a)n.push(xe(t,o,o+a>s?s:o+a));1===r?(e=t[i-1],n.push(Ee[e>>2]+Ee[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],n.push(Ee[e>>10]+Ee[e>>4&63]+Ee[e<<2&63]+"="));return n.join("")}},Ee=[],ke=[],Te="undefined"!=typeof Uint8Array?Uint8Array:Array,Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Be=0;Be<64;++Be)Ee[Be]=Re[Be],ke[Re.charCodeAt(Be)]=Be;function Oe(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function xe(t,e,i){for(var r,n,a=[],o=e;o<i;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),a.push(Ee[(n=r)>>18&63]+Ee[n>>12&63]+Ee[n>>6&63]+Ee[63&n]);return a.join("")}ke["-".charCodeAt(0)]=62,ke["_".charCodeAt(0)]=63;var De={
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
read:function(t,e,i,r,n){var a,o,s=8*n-r-1,u=(1<<s)-1,c=u>>1,l=-7,d=i?n-1:0,f=i?-1:1,p=t[e+d];for(d+=f,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+t[e+d],d+=f,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+t[e+d],d+=f,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=c}return(p?-1:1)*o*Math.pow(2,a-r)},write:function(t,e,i,r,n,a){var o,s,u,c=8*a-n-1,l=(1<<c)-1,d=l>>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,h=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=l?(s=0,o=l):o+d>=1?(s=(e*u-1)*Math.pow(2,n),o+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;t[i+p]=255&s,p+=h,s/=256,n-=8);for(o=o<<n|s,c+=n;c>0;t[i+p]=255&o,p+=h,o/=256,c-=8);t[i+p-h]|=128*y}};
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
!function(t){const e=Se,i=De,r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(t){+t!=t&&(t=0);return o.alloc(+t)},t.INSPECT_MAX_BYTES=50;const n=2147483647;function a(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return s(t,e,i)}function s(t,e,i){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const i=0|p(t,e);let r=a(i);const n=r.write(t,e);n!==i&&(r=r.slice(0,n));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return d(t,e,i);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return d(t,e,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return o.from(r,e,i);const n=function(t){if(o.isBuffer(t)){const e=0|f(t.length),i=a(e);return 0===i.length||t.copy(i,0,0,e),i}if(void 0!==t.length)return"number"!=typeof t.length||G(t.length)?a(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return u(t),a(t<0?0:0|f(t))}function l(t){const e=t.length<0?0:0|f(t.length),i=a(e);for(let r=0;r<e;r+=1)i[r]=255&t[r];return i}function d(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,e):new Uint8Array(t,e,i),Object.setPrototypeOf(r,o.prototype),r}function f(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function p(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const i=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Y(t).length;default:if(n)return r?-1:F(t).length;e=(""+e).toLowerCase(),n=!0}}function h(t,e,i){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,i);case"utf8":case"utf-8":return _(this,e,i);case"ascii":return E(this,e,i);case"latin1":case"binary":return k(this,e,i);case"base64":return P(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function y(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function g(t,e,i,r,n){if(0===t.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),G(i=+i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:m(t,e,i,r,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):m(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}function m(t,e,i,r,n){let a,o=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,s/=2,u/=2,i/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let r=-1;for(a=i;a<s;a++)if(c(t,a)===c(e,-1===r?0:a-r)){if(-1===r&&(r=a),a-r+1===u)return r*o}else-1!==r&&(a-=a-r),r=-1}else for(i+u>s&&(i=s-u),a=i;a>=0;a--){let i=!0;for(let r=0;r<u;r++)if(c(t,a+r)!==c(e,r)){i=!1;break}if(i)return a}return-1}function b(t,e,i,r){i=Number(i)||0;const n=t.length-i;r?(r=Number(r))>n&&(r=n):r=n;const a=e.length;let o;for(r>a/2&&(r=a/2),o=0;o<r;++o){const r=parseInt(e.substr(2*o,2),16);if(G(r))return o;t[i+o]=r}return o}function A(t,e,i,r){return H(F(e,t.length-i),t,i,r)}function v(t,e,i,r){return H(function(t){const e=[];for(let i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,r)}function M(t,e,i,r){return H(Y(e),t,i,r)}function w(t,e,i,r){return H(function(t,e){let i,r,n;const a=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)i=t.charCodeAt(o),r=i>>8,n=i%256,a.push(n),a.push(r);return a}(e,t.length-i),t,i,r)}function P(t,i,r){return 0===i&&r===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(i,r))}function _(t,e,i){i=Math.min(t.length,i);const r=[];let n=e;for(;n<i;){const e=t[n];let a=null,o=e>239?4:e>223?3:e>191?2:1;if(n+o<=i){let i,r,s,u;switch(o){case 1:e<128&&(a=e);break;case 2:i=t[n+1],128==(192&i)&&(u=(31&e)<<6|63&i,u>127&&(a=u));break;case 3:i=t[n+1],r=t[n+2],128==(192&i)&&128==(192&r)&&(u=(15&e)<<12|(63&i)<<6|63&r,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:i=t[n+1],r=t[n+2],s=t[n+3],128==(192&i)&&128==(192&r)&&128==(192&s)&&(u=(15&e)<<18|(63&i)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(a=u))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),n+=o}return function(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=S));return i}(r)}t.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),o.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(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,i){return s(t,e,i)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,i){return function(t,e,i){return u(t),t<=0?a(t):void 0!==e?"string"==typeof i?a(t).fill(e,i):a(t).fill(e):a(t)}(t,e,i)},o.allocUnsafe=function(t){return c(t)},o.allocUnsafeSlow=function(t){return c(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(X(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),X(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let i=t.length,r=e.length;for(let n=0,a=Math.min(i,r);n<a;++n)if(t[n]!==e[n]){i=t[n],r=e[n];break}return i<r?-1:r<i?1:0},o.isEncoding=function(t){switch(String(t).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}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);let i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;const r=o.allocUnsafe(e);let n=0;for(i=0;i<t.length;++i){let e=t[i];if(X(e,Uint8Array))n+e.length>r.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(r,n)):Uint8Array.prototype.set.call(r,e,n);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,n)}n+=e.length}return r},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},o.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},o.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},o.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?_(this,0,t):h.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){let e="";const i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(t,e,i,r,n){if(X(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),e<0||i>t.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&e>=i)return 0;if(r>=n)return-1;if(e>=i)return 1;if(this===t)return 0;let a=(n>>>=0)-(r>>>=0),s=(i>>>=0)-(e>>>=0);const u=Math.min(a,s),c=this.slice(r,n),l=t.slice(e,i);for(let t=0;t<u;++t)if(c[t]!==l[t]){a=c[t],s=l[t];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},o.prototype.indexOf=function(t,e,i){return g(this,t,e,i,!0)},o.prototype.lastIndexOf=function(t,e,i){return g(this,t,e,i,!1)},o.prototype.write=function(t,e,i,r){if(void 0===e)r="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)r=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}const n=this.length-e;if((void 0===i||i>n)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return b(this,t,e,i);case"utf8":case"utf-8":return A(this,t,e,i);case"ascii":case"latin1":case"binary":return v(this,t,e,i);case"base64":return M(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,i);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function E(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(127&t[n]);return r}function k(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}function T(t,e,i){const r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let r=e;r<i;++r)n+=q[t[r]];return n}function R(t,e,i){const r=t.slice(e,i);let n="";for(let t=0;t<r.length-1;t+=2)n+=String.fromCharCode(r[t]+256*r[t+1]);return n}function B(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,i,r,n,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<a)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}function x(t,e,i,r,n){V(e,r,n,t,i,7);let a=Number(e&BigInt(4294967295));t[i++]=a,a>>=8,t[i++]=a,a>>=8,t[i++]=a,a>>=8,t[i++]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=o,o>>=8,t[i++]=o,o>>=8,t[i++]=o,o>>=8,t[i++]=o,i}function D(t,e,i,r,n){V(e,r,n,t,i,7);let a=Number(e&BigInt(4294967295));t[i+7]=a,a>>=8,t[i+6]=a,a>>=8,t[i+5]=a,a>>=8,t[i+4]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=o,o>>=8,t[i+2]=o,o>>=8,t[i+1]=o,o>>=8,t[i]=o,i+8}function I(t,e,i,r,n,a){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function C(t,e,r,n,a){return e=+e,r>>>=0,a||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,a){return e=+e,r>>>=0,a||I(t,0,r,8),i.write(t,e,r,n,52,8),r+8}o.prototype.slice=function(t,e){const i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||B(t,e,this.length);let r=this[t],n=1,a=0;for(;++a<e&&(n*=256);)r+=this[t+a]*n;return r},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||B(t,e,this.length);let r=this[t+--e],n=1;for(;e>0&&(n*=256);)r+=this[t+--e]*n;return r},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=$((function(t){j(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||L(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+i*2**24;return BigInt(r)+(BigInt(n)<<BigInt(32))})),o.prototype.readBigUInt64BE=$((function(t){j(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||L(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+i;return(BigInt(r)<<BigInt(32))+BigInt(n)})),o.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||B(t,e,this.length);let r=this[t],n=1,a=0;for(;++a<e&&(n*=256);)r+=this[t+a]*n;return n*=128,r>=n&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||B(t,e,this.length);let r=e,n=1,a=this[t+--r];for(;r>0&&(n*=256);)a+=this[t+--r]*n;return n*=128,a>=n&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);const i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);const i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=$((function(t){j(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||L(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(i<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),o.prototype.readBigInt64BE=$((function(t){j(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||L(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+i)})),o.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,i,r){if(t=+t,e>>>=0,i>>>=0,!r){O(this,t,e,i,Math.pow(2,8*i)-1,0)}let n=1,a=0;for(this[e]=255&t;++a<i&&(n*=256);)this[e+a]=t/n&255;return e+i},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,i,r){if(t=+t,e>>>=0,i>>>=0,!r){O(this,t,e,i,Math.pow(2,8*i)-1,0)}let n=i-1,a=1;for(this[e+n]=255&t;--n>=0&&(a*=256);)this[e+n]=t/a&255;return e+i},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=$((function(t,e=0){return x(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=$((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}let n=0,a=1,o=0;for(this[e]=255&t;++n<i&&(a*=256);)t<0&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/a>>0)-o&255;return e+i},o.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}let n=i-1,a=1,o=0;for(this[e+n]=255&t;--n>=0&&(a*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/a>>0)-o&255;return e+i},o.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=$((function(t,e=0){return x(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=$((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(t,e,i){return C(this,t,e,!0,i)},o.prototype.writeFloatBE=function(t,e,i){return C(this,t,e,!1,i)},o.prototype.writeDoubleLE=function(t,e,i){return U(this,t,e,!0,i)},o.prototype.writeDoubleBE=function(t,e,i){return U(this,t,e,!1,i)},o.prototype.copy=function(t,e,i,r){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-i&&(r=t.length-e+i);const n=r-i;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,i,r):Uint8Array.prototype.set.call(t,this.subarray(i,r),e),n},o.prototype.fill=function(t,e,i,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;let n;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(n=e;n<i;++n)this[n]=t;else{const a=o.isBuffer(t)?t:o.from(t,r),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<i-e;++n)this[n+e]=a[n%s]}return this};const W={};function K(t,e,i){W[t]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function N(t){let e="",i=t.length;const r="-"===t[0]?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}function V(t,e,i,r,n,a){if(t>i||t<e){const r="bigint"==typeof e?"n":"";let n;throw n=a>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(a+1)}${r}`:`>= -(2${r} ** ${8*(a+1)-1}${r}) and < 2 ** ${8*(a+1)-1}${r}`:`>= ${e}${r} and <= ${i}${r}`,new W.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,i){j(e,"offset"),void 0!==t[e]&&void 0!==t[e+i]||L(e,t.length-(i+1))}(r,n,a)}function j(t,e){if("number"!=typeof t)throw new W.ERR_INVALID_ARG_TYPE(e,"number",t)}function L(t,e,i){if(Math.floor(t)!==t)throw j(t,i),new W.ERR_OUT_OF_RANGE(i||"offset","an integer",t);if(e<0)throw new W.ERR_BUFFER_OUT_OF_BOUNDS;throw new W.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),K("ERR_OUT_OF_RANGE",(function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=N(String(i)):"bigint"==typeof i&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=N(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function F(t,e){let i;e=e||1/0;const r=t.length;let n=null;const a=[];for(let o=0;o<r;++o){if(i=t.charCodeAt(o),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&a.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&a.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&a.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;a.push(i)}else if(i<2048){if((e-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function Y(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,i,r){let n;for(n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function G(t){return t!=t}const q=function(){const t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){const r=16*i;for(let n=0;n<16;++n)e[r+n]=t[i]+t[n]}return e}();function $(t){return"undefined"==