UNPKG

@unielon/wallet-tg-sdk

Version:

unielon wallet sdk for telegram

7 lines 60.2 kB
"use strict";var _t=Object.defineProperty;var Ot=(e,t,n)=>t in e?_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var S=(e,t,n)=>Ot(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fe={exports:{}},ae,Ae;function At(){if(Ae)return ae;Ae=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*7,o=r*365.25;ae=function(a,c){c=c||{};var m=typeof a;if(m==="string"&&a.length>0)return i(a);if(m==="number"&&isFinite(a))return c.long?f(a):u(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))};function i(a){if(a=String(a),!(a.length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(c){var m=parseFloat(c[1]),y=(c[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return m*o;case"weeks":case"week":case"w":return m*s;case"days":case"day":case"d":return m*r;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function u(a){var c=Math.abs(a);return c>=r?Math.round(a/r)+"d":c>=n?Math.round(a/n)+"h":c>=t?Math.round(a/t)+"m":c>=e?Math.round(a/e)+"s":a+"ms"}function f(a){var c=Math.abs(a);return c>=r?l(a,c,r,"day"):c>=n?l(a,c,n,"hour"):c>=t?l(a,c,t,"minute"):c>=e?l(a,c,e,"second"):a+" ms"}function l(a,c,m,y){var p=c>=m*1.5;return Math.round(a/m)+" "+y+(p?"s":"")}return ae}function Ft(e){n.debug=n,n.default=n,n.coerce=f,n.disable=o,n.enable=s,n.enabled=i,n.humanize=At(),n.destroy=l,Object.keys(e).forEach(a=>{n[a]=e[a]}),n.names=[],n.skips=[],n.formatters={};function t(a){let c=0;for(let m=0;m<a.length;m++)c=(c<<5)-c+a.charCodeAt(m),c|=0;return n.colors[Math.abs(c)%n.colors.length]}n.selectColor=t;function n(a){let c,m=null,y,p;function g(...h){if(!g.enabled)return;const C=g,E=Number(new Date),b=E-(c||E);C.diff=b,C.prev=c,C.curr=E,c=E,h[0]=n.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let O=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(v,x)=>{if(v==="%%")return"%";O++;const k=n.formatters[x];if(typeof k=="function"){const H=h[O];v=k.call(C,H),h.splice(O,1),O--}return v}),n.formatArgs.call(C,h),(C.log||n.log).apply(C,h)}return g.namespace=a,g.useColors=n.useColors(),g.color=n.selectColor(a),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(y!==n.namespaces&&(y=n.namespaces,p=n.enabled(a)),p),set:h=>{m=h}}),typeof n.init=="function"&&n.init(g),g}function r(a,c){const m=n(this.namespace+(typeof c>"u"?":":c)+a);return m.log=this.log,m}function s(a){n.save(a),n.namespaces=a,n.names=[],n.skips=[];let c;const m=(typeof a=="string"?a:"").split(/[\s,]+/),y=m.length;for(c=0;c<y;c++)m[c]&&(a=m[c].replace(/\*/g,".*?"),a[0]==="-"?n.skips.push(new RegExp("^"+a.slice(1)+"$")):n.names.push(new RegExp("^"+a+"$")))}function o(){const a=[...n.names.map(u),...n.skips.map(u).map(c=>"-"+c)].join(",");return n.enable(""),a}function i(a){if(a[a.length-1]==="*")return!0;let c,m;for(c=0,m=n.skips.length;c<m;c++)if(n.skips[c].test(a))return!1;for(c=0,m=n.names.length;c<m;c++)if(n.names[c].test(a))return!0;return!1}function u(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function f(a){return a instanceof Error?a.stack||a.message:a}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var vt=Ft;(function(e,t){t.formatArgs=r,t.save=s,t.load=o,t.useColors=n,t.storage=i(),t.destroy=(()=>{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let f;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(f=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(f[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;f.splice(1,0,l,"color: inherit");let a=0,c=0;f[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(a++,m==="%c"&&(c=a))}),f.splice(c,0,l)}t.log=console.debug||console.log||(()=>{});function s(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function o(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=process.env.DEBUG),f}function i(){try{return localStorage}catch{}}e.exports=vt(t);const{formatters:u}=e.exports;u.j=function(f){try{return JSON.stringify(f)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(fe,fe.exports);var Ke=fe.exports;const V=Ke.debug("unielon:tmapi:debug"),Pt=Ke.debug("unielon:tmapi:error");function xt(e,t="_self"){V("openLink",e,t),window.open(e,t,"noopener noreferrer")}function Ut(e){xt(e,"_blank")}function te(){if(typeof window<"u")return window}class X extends Error{constructor(t){super(t),this.name="UnielonConnectUIError"}}let U={};try{let e=location.hash.toString();U=Lt(e)}catch{}let he="unknown";U!=null&&U.tgWebAppPlatform&&(he=U.tgWebAppPlatform??"unknown");var Je,$e;if(he==="unknown"){const e=te();he=(($e=(Je=e==null?void 0:e.Telegram)==null?void 0:Je.WebApp)==null?void 0:$e.platform)??"unknown"}let Z="6.0";U!=null&&U.tgWebAppVersion&&(Z=U.tgWebAppVersion);var He,Ve;if(!Z){const e=te();Z=((Ve=(He=e==null?void 0:e.Telegram)==null?void 0:He.WebApp)==null?void 0:Ve.version)??"6.0"}function Nt(e,t){const n=new URL(e);if(n.protocol!=="http:"&&n.protocol!=="https:")throw new X(`Url protocol is not supported: ${n}`);if(n.hostname!=="t.me")throw new X(`Url host is not supported: ${n}`);const r=n.pathname+n.search;Ge()||Bt("6.1")?kt("web_app_open_tg_link",{path_full:r}):Ut("https://t.me"+r)}function Ge(){try{const e=te();return e?e.parent!=null&&e!==e.parent:!1}catch{return!1}}function kt(e,t){try{const n=te();if(!n)throw new X("Can't post event to parent window: window is not defined");if(n.TelegramWebviewProxy!==void 0)V("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)V("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(Ge()){const r="*",s=JSON.stringify({eventType:e,eventData:t});V("postEvent",e,t),n.parent.postMessage(s,r)}else throw new X("Can't post event to TMA")}catch(n){Pt(`Can't post event to parent window: ${n}`)}}function Lt(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Q(e),t;let n=e.indexOf("?");if(n>=0){let s=e.substr(0,n);t._path=Q(s),e=e.substr(n+1)}let r=qt(e);for(let s in r)t[s]=r[s];return t}function Q(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch{return e}}function qt(e){let t={};if(!e.length)return t;let n=e.split("&"),r,s,o,i;for(r=0;r<n.length;r++)s=n[r].split("="),o=Q(s[0]),i=s[1]==null?null:Q(s[1]),t[o]=i;return t}function It(e,t){typeof e!="string"&&(e="");let n=e.replace(/^\s+|\s+$/g,"").split("."),r=t.replace(/^\s+|\s+$/g,"").split("."),s,o,i,u;for(s=Math.max(n.length,r.length),o=0;o<s;o++)if(i=parseInt(n[o])||0,u=parseInt(r[o])||0,i!==u)return i>u?1:-1;return 0}function Bt(e){return It(Z,e)>=0}var Xe={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(f,l,a){this.fn=f,this.context=l,this.once=a||!1}function o(f,l,a,c,m){if(typeof a!="function")throw new TypeError("The listener must be a function");var y=new s(a,c||f,m),p=n?n+l:l;return f._events[p]?f._events[p].fn?f._events[p]=[f._events[p],y]:f._events[p].push(y):(f._events[p]=y,f._eventsCount++),f}function i(f,l){--f._eventsCount===0?f._events=new r:delete f._events[l]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var l=[],a,c;if(this._eventsCount===0)return l;for(c in a=this._events)t.call(a,c)&&l.push(n?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},u.prototype.listeners=function(l){var a=n?n+l:l,c=this._events[a];if(!c)return[];if(c.fn)return[c.fn];for(var m=0,y=c.length,p=new Array(y);m<y;m++)p[m]=c[m].fn;return p},u.prototype.listenerCount=function(l){var a=n?n+l:l,c=this._events[a];return c?c.fn?1:c.length:0},u.prototype.emit=function(l,a,c,m,y,p){var g=n?n+l:l;if(!this._events[g])return!1;var h=this._events[g],C=arguments.length,E,b;if(h.fn){switch(h.once&&this.removeListener(l,h.fn,void 0,!0),C){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,a),!0;case 3:return h.fn.call(h.context,a,c),!0;case 4:return h.fn.call(h.context,a,c,m),!0;case 5:return h.fn.call(h.context,a,c,m,y),!0;case 6:return h.fn.call(h.context,a,c,m,y,p),!0}for(b=1,E=new Array(C-1);b<C;b++)E[b-1]=arguments[b];h.fn.apply(h.context,E)}else{var O=h.length,R;for(b=0;b<O;b++)switch(h[b].once&&this.removeListener(l,h[b].fn,void 0,!0),C){case 1:h[b].fn.call(h[b].context);break;case 2:h[b].fn.call(h[b].context,a);break;case 3:h[b].fn.call(h[b].context,a,c);break;case 4:h[b].fn.call(h[b].context,a,c,m);break;default:if(!E)for(R=1,E=new Array(C-1);R<C;R++)E[R-1]=arguments[R];h[b].fn.apply(h[b].context,E)}}return!0},u.prototype.on=function(l,a,c){return o(this,l,a,c,!1)},u.prototype.once=function(l,a,c){return o(this,l,a,c,!0)},u.prototype.removeListener=function(l,a,c,m){var y=n?n+l:l;if(!this._events[y])return this;if(!a)return i(this,y),this;var p=this._events[y];if(p.fn)p.fn===a&&(!m||p.once)&&(!c||p.context===c)&&i(this,y);else{for(var g=0,h=[],C=p.length;g<C;g++)(p[g].fn!==a||m&&!p[g].once||c&&p[g].context!==c)&&h.push(p[g]);h.length?this._events[y]=h.length===1?h[0]:h:i(this,y)}return this},u.prototype.removeAllListeners=function(l){var a;return l?(a=n?n+l:l,this._events[a]&&i(this,a)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(Xe);var Mt=Xe.exports;const Ze=Tt(Mt),jt="0.0.4",Fe={id:"Unielon",version:jt,name:"Unielon Wallet based on Telegram",homepage:"https://unielon.com",description:"Unielon Wallet based on Telegram",downloadLinks:{telegram:"https://t.me/unielonbot/app",browserExtension:{chrome:""}},deepLinks:{direct_link:"https://t.me/unielonbot/wallet"}},W={connect_url:"https://bridge.unielon.com",connect_direct_link:"https://t.me/unielonbot/wallet"};function Qe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Dt}=Object.prototype,{getPrototypeOf:Ee}=Object,ne=(e=>t=>{const n=Dt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>ne(t)===e),re=e=>t=>typeof t===e,{isArray:B}=Array,z=re("undefined");function Wt(e){return e!==null&&!z(e)&&e.constructor!==null&&!z(e.constructor)&&F(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ye=P("ArrayBuffer");function zt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ye(e.buffer),t}const Jt=re("string"),F=re("function"),et=re("number"),se=e=>e!==null&&typeof e=="object",$t=e=>e===!0||e===!1,K=e=>{if(ne(e)!=="object")return!1;const t=Ee(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ht=P("Date"),Vt=P("File"),Kt=P("Blob"),Gt=P("FileList"),Xt=e=>se(e)&&F(e.pipe),Zt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||F(e.append)&&((t=ne(e))==="formdata"||t==="object"&&F(e.toString)&&e.toString()==="[object FormData]"))},Qt=P("URLSearchParams"),[Yt,en,tn,nn]=["ReadableStream","Request","Response","Headers"].map(P),rn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function J(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),B(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let u;for(r=0;r<i;r++)u=o[r],t.call(null,e[u],u,e)}}function tt(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const L=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nt=e=>!z(e)&&e!==L;function pe(){const{caseless:e}=nt(this)&&this||{},t={},n=(r,s)=>{const o=e&&tt(t,s)||s;K(t[o])&&K(r)?t[o]=pe(t[o],r):K(r)?t[o]=pe({},r):B(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&J(arguments[r],n);return t}const sn=(e,t,n,{allOwnKeys:r}={})=>(J(t,(s,o)=>{n&&F(s)?e[o]=Qe(s,n):e[o]=s},{allOwnKeys:r}),e),on=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),an=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},cn=(e,t,n,r)=>{let s,o,i;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=n!==!1&&Ee(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ln=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},un=e=>{if(!e)return null;if(B(e))return e;let t=e.length;if(!et(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},dn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ee(Uint8Array)),fn=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},hn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},pn=P("HTMLFormElement"),mn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),gn=P("RegExp"),rt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};J(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},yn=e=>{rt(e,(t,n)=>{if(F(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(F(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return B(e)?r(e):r(String(e).split(t)),n},bn=()=>{},Cn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,ce="abcdefghijklmnopqrstuvwxyz",Pe="0123456789",st={DIGIT:Pe,ALPHA:ce,ALPHA_DIGIT:ce+ce.toUpperCase()+Pe},En=(e=16,t=st.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Sn(e){return!!(e&&F(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Rn=e=>{const t=new Array(10),n=(r,s)=>{if(se(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=B(r)?[]:{};return J(r,(i,u)=>{const f=n(i,s+1);!z(f)&&(o[u]=f)}),t[s]=void 0,o}}return r};return n(e,0)},_n=P("AsyncFunction"),On=e=>e&&(se(e)||F(e))&&F(e.then)&&F(e.catch),ot=((e,t)=>e?setImmediate:t?((n,r)=>(L.addEventListener("message",({source:s,data:o})=>{s===L&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),L.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",F(L.postMessage)),Tn=typeof queueMicrotask<"u"?queueMicrotask.bind(L):typeof process<"u"&&process.nextTick||ot,d={isArray:B,isArrayBuffer:Ye,isBuffer:Wt,isFormData:Zt,isArrayBufferView:zt,isString:Jt,isNumber:et,isBoolean:$t,isObject:se,isPlainObject:K,isReadableStream:Yt,isRequest:en,isResponse:tn,isHeaders:nn,isUndefined:z,isDate:Ht,isFile:Vt,isBlob:Kt,isRegExp:gn,isFunction:F,isStream:Xt,isURLSearchParams:Qt,isTypedArray:dn,isFileList:Gt,forEach:J,merge:pe,extend:sn,trim:rn,stripBOM:on,inherits:an,toFlatObject:cn,kindOf:ne,kindOfTest:P,endsWith:ln,toArray:un,forEachEntry:fn,matchAll:hn,isHTMLForm:pn,hasOwnProperty:ve,hasOwnProp:ve,reduceDescriptors:rt,freezeMethods:yn,toObjectSet:wn,toCamelCase:mn,noop:bn,toFiniteNumber:Cn,findKey:tt,global:L,isContextDefined:nt,ALPHABET:st,generateString:En,isSpecCompliantForm:Sn,toJSONObject:Rn,isAsyncFn:_n,isThenable:On,setImmediate:ot,asap:Tn};function w(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}d.inherits(w,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:d.toJSONObject(this.config),code:this.code,status:this.status}}});const it=w.prototype,at={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{at[e]={value:e}});Object.defineProperties(w,at);Object.defineProperty(it,"isAxiosError",{value:!0});w.from=(e,t,n,r,s,o)=>{const i=Object.create(it);return d.toFlatObject(e,i,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),w.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const An=null;function me(e){return d.isPlainObject(e)||d.isArray(e)}function ct(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function xe(e,t,n){return e?e.concat(t).map(function(s,o){return s=ct(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Fn(e){return d.isArray(e)&&!e.some(me)}const vn=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function oe(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!d.isUndefined(h[g])});const r=n.metaTokens,s=n.visitor||a,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(d.isDate(p))return p.toISOString();if(!f&&d.isBlob(p))throw new w("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(p)||d.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,g,h){let C=p;if(p&&!h&&typeof p=="object"){if(d.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(d.isArray(p)&&Fn(p)||(d.isFileList(p)||d.endsWith(g,"[]"))&&(C=d.toArray(p)))return g=ct(g),C.forEach(function(b,O){!(d.isUndefined(b)||b===null)&&t.append(i===!0?xe([g],O,o):i===null?g:g+"[]",l(b))}),!1}return me(p)?!0:(t.append(xe(h,g,o),l(p)),!1)}const c=[],m=Object.assign(vn,{defaultVisitor:a,convertValue:l,isVisitable:me});function y(p,g){if(!d.isUndefined(p)){if(c.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));c.push(p),d.forEach(p,function(C,E){(!(d.isUndefined(C)||C===null)&&s.call(t,C,d.isString(E)?E.trim():E,g,m))===!0&&y(C,g?g.concat(E):[E])}),c.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Ue(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Se(e,t){this._pairs=[],e&&oe(e,this,t)}const lt=Se.prototype;lt.append=function(t,n){this._pairs.push([t,n])};lt.toString=function(t){const n=t?function(r){return t.call(this,r,Ue)}:Ue;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Pn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ut(e,t,n){if(!t)return e;const r=n&&n.encode||Pn,s=n&&n.serialize;let o;if(s?o=s(t,n):o=d.isURLSearchParams(t)?t.toString():new Se(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ne{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(r){r!==null&&t(r)})}}const dt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xn=typeof URLSearchParams<"u"?URLSearchParams:Se,Un=typeof FormData<"u"?FormData:null,Nn=typeof Blob<"u"?Blob:null,kn={isBrowser:!0,classes:{URLSearchParams:xn,FormData:Un,Blob:Nn},protocols:["http","https","file","blob","url","data"]},Re=typeof window<"u"&&typeof document<"u",ge=typeof navigator=="object"&&navigator||void 0,Ln=Re&&(!ge||["ReactNative","NativeScript","NS"].indexOf(ge.product)<0),qn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",In=Re&&window.location.href||"http://localhost",Bn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Re,hasStandardBrowserEnv:Ln,hasStandardBrowserWebWorkerEnv:qn,navigator:ge,origin:In},Symbol.toStringTag,{value:"Module"})),T={...Bn,...kn};function Mn(e,t){return oe(e,new T.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return T.isNode&&d.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function jn(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Dn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function ft(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const u=Number.isFinite(+i),f=o>=n.length;return i=!i&&d.isArray(s)?s.length:i,f?(d.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!u):((!s[i]||!d.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&d.isArray(s[i])&&(s[i]=Dn(s[i])),!u)}if(d.isFormData(e)&&d.isFunction(e.entries)){const n={};return d.forEachEntry(e,(r,s)=>{t(jn(r),s,n,0)}),n}return null}function Wn(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const $={transitional:dt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=d.isObject(t);if(o&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return s?JSON.stringify(ft(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Mn(t,this.formSerializer).toString();if((u=d.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return oe(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Wn(t)):t}],transformResponse:[function(t){const n=this.transitional||$.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?w.from(u,w.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{$.headers[e]={}});const zn=d.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Jn=e=>{const t={};let n,r,s;return e&&e.split(` `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&zn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ke=Symbol("internals");function j(e){return e&&String(e).trim().toLowerCase()}function G(e){return e===!1||e==null?e:d.isArray(e)?e.map(G):String(e)}function $n(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Hn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function le(e,t,n,r,s){if(d.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!d.isString(t)){if(d.isString(r))return t.indexOf(r)!==-1;if(d.isRegExp(r))return r.test(t)}}function Vn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Kn(e,t){const n=d.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class A{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(u,f,l){const a=j(f);if(!a)throw new Error("header name must be a non-empty string");const c=d.findKey(s,a);(!c||s[c]===void 0||l===!0||l===void 0&&s[c]!==!1)&&(s[c||f]=G(u))}const i=(u,f)=>d.forEach(u,(l,a)=>o(l,a,f));if(d.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(d.isString(t)&&(t=t.trim())&&!Hn(t))i(Jn(t),n);else if(d.isHeaders(t))for(const[u,f]of t.entries())o(f,u,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=j(t),t){const r=d.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return $n(s);if(d.isFunction(n))return n.call(this,s,r);if(d.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=j(t),t){const r=d.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||le(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=j(i),i){const u=d.findKey(r,i);u&&(!n||le(r,r[u],u,n))&&(delete r[u],s=!0)}}return d.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||le(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return d.forEach(this,(s,o)=>{const i=d.findKey(r,o);if(i){n[i]=G(s),delete n[o];return}const u=t?Vn(o):String(o).trim();u!==o&&delete n[o],n[u]=G(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return d.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&d.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[ke]=this[ke]={accessors:{}}).accessors,s=this.prototype;function o(i){const u=j(i);r[u]||(Kn(s,i),r[u]=!0)}return d.isArray(t)?t.forEach(o):o(t),this}}A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(A.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});d.freezeMethods(A);function ue(e,t){const n=this||$,r=t||n,s=A.from(r.headers);let o=r.data;return d.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ht(e){return!!(e&&e.__CANCEL__)}function M(e,t,n){w.call(this,e??"canceled",w.ERR_CANCELED,t,n),this.name="CanceledError"}d.inherits(M,w,{__CANCEL__:!0});function pt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new w("Request failed with status code "+n.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Gn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),a=r[o];i||(i=l),n[s]=f,r[s]=l;let c=o,m=0;for(;c!==s;)m+=n[c++],c=c%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const y=a&&l-a;return y?Math.round(m*1e3/y):void 0}}function Zn(e,t){let n=0,r=1e3/t,s,o;const i=(l,a=Date.now())=>{n=a,s=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{const a=Date.now(),c=a-n;c>=r?i(l,a):(s=l,o||(o=setTimeout(()=>{o=null,i(s)},r-c)))},()=>s&&i(s)]}const Y=(e,t,n=3)=>{let r=0;const s=Xn(50,250);return Zn(o=>{const i=o.loaded,u=o.lengthComputable?o.total:void 0,f=i-r,l=s(f),a=i<=u;r=i;const c={loaded:i,total:u,progress:u?i/u:void 0,bytes:f,rate:l||void 0,estimated:l&&u&&a?(u-i)/l:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(c)},n)},Le=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},qe=e=>(...t)=>d.asap(()=>e(...t)),Qn=T.hasStandardBrowserEnv?function(){const t=T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const u=d.isString(i)?s(i):i;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}(),Yn=T.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];d.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),d.isString(r)&&i.push("path="+r),d.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function er(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mt(e,t){return e&&!er(t)?tr(e,t):t}const Ie=e=>e instanceof A?{...e}:e;function I(e,t){t=t||{};const n={};function r(l,a,c){return d.isPlainObject(l)&&d.isPlainObject(a)?d.merge.call({caseless:c},l,a):d.isPlainObject(a)?d.merge({},a):d.isArray(a)?a.slice():a}function s(l,a,c){if(d.isUndefined(a)){if(!d.isUndefined(l))return r(void 0,l,c)}else return r(l,a,c)}function o(l,a){if(!d.isUndefined(a))return r(void 0,a)}function i(l,a){if(d.isUndefined(a)){if(!d.isUndefined(l))return r(void 0,l)}else return r(void 0,a)}function u(l,a,c){if(c in t)return r(l,a);if(c in e)return r(void 0,l)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(l,a)=>s(Ie(l),Ie(a),!0)};return d.forEach(Object.keys(Object.assign({},e,t)),function(a){const c=f[a]||s,m=c(e[a],t[a],a);d.isUndefined(m)&&c!==u||(n[a]=m)}),n}const gt=e=>{const t=I({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:u}=t;t.headers=i=A.from(i),t.url=ut(mt(t.baseURL,t.url),e.params,e.paramsSerializer),u&&i.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(d.isFormData(n)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[l,...a]=f?f.split(";").map(c=>c.trim()).filter(Boolean):[];i.setContentType([l||"multipart/form-data",...a].join("; "))}}if(T.hasStandardBrowserEnv&&(r&&d.isFunction(r)&&(r=r(t)),r||r!==!1&&Qn(t.url))){const l=s&&o&&Yn.read(o);l&&i.set(s,l)}return t},nr=typeof XMLHttpRequest<"u",rr=nr&&function(e){return new Promise(function(n,r){const s=gt(e);let o=s.data;const i=A.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:l}=s,a,c,m,y,p;function g(){y&&y(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(a),s.signal&&s.signal.removeEventListener("abort",a)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function C(){if(!h)return;const b=A.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),R={data:!u||u==="text"||u==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};pt(function(x){n(x),g()},function(x){r(x),g()},R),h=null}"onloadend"in h?h.onloadend=C:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(C)},h.onabort=function(){h&&(r(new w("Request aborted",w.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new w("Network Error",w.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const R=s.transitional||dt;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new w(O,R.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&d.forEach(i.toJSON(),function(O,R){h.setRequestHeader(R,O)}),d.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),u&&u!=="json"&&(h.responseType=s.responseType),l&&([m,p]=Y(l,!0),h.addEventListener("progress",m)),f&&h.upload&&([c,y]=Y(f),h.upload.addEventListener("progress",c),h.upload.addEventListener("loadend",y)),(s.cancelToken||s.signal)&&(a=b=>{h&&(r(!b||b.type?new M(null,e,h):b),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(a),s.signal&&(s.signal.aborted?a():s.signal.addEventListener("abort",a)));const E=Gn(s.url);if(E&&T.protocols.indexOf(E)===-1){r(new w("Unsupported protocol "+E+":",w.ERR_BAD_REQUEST,e));return}h.send(o||null)})},sr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(l){if(!s){s=!0,u();const a=l instanceof Error?l:this.reason;r.abort(a instanceof w?a:new M(a instanceof Error?a.message:a))}};let i=t&&setTimeout(()=>{i=null,o(new w(`timeout ${t} of ms exceeded`,w.ETIMEDOUT))},t);const u=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>d.asap(u),f}},or=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},ir=async function*(e,t){for await(const n of ar(e))yield*or(n,t)},ar=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Be=(e,t,n,r)=>{const s=ir(e,t);let o=0,i,u=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:l,value:a}=await s.next();if(l){u(),f.close();return}let c=a.byteLength;if(n){let m=o+=c;n(m)}f.enqueue(new Uint8Array(a))}catch(l){throw u(l),l}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},ie=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",yt=ie&&typeof ReadableStream=="function",cr=ie&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),wt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},lr=yt&&wt(()=>{let e=!1;const t=new Request(T.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Me=64*1024,ye=yt&&wt(()=>d.isReadableStream(new Response("").body)),ee={stream:ye&&(e=>e.body)};ie&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ee[t]&&(ee[t]=d.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new w(`Response type '${t}' is not supported`,w.ERR_NOT_SUPPORT,r)})})})(new Response);const ur=async e=>{if(e==null)return 0;if(d.isBlob(e))return e.size;if(d.isSpecCompliantForm(e))return(await new Request(T.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(d.isArrayBufferView(e)||d.isArrayBuffer(e))return e.byteLength;if(d.isURLSearchParams(e)&&(e=e+""),d.isString(e))return(await cr(e)).byteLength},dr=async(e,t)=>{const n=d.toFiniteNumber(e.getContentLength());return n??ur(t)},fr=ie&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:u,onUploadProgress:f,responseType:l,headers:a,withCredentials:c="same-origin",fetchOptions:m}=gt(e);l=l?(l+"").toLowerCase():"text";let y=sr([s,o&&o.toAbortSignal()],i),p;const g=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let h;try{if(f&&lr&&n!=="get"&&n!=="head"&&(h=await dr(a,r))!==0){let R=new Request(t,{method:"POST",body:r,duplex:"half"}),v;if(d.isFormData(r)&&(v=R.headers.get("content-type"))&&a.setContentType(v),R.body){const[x,k]=Le(h,Y(qe(f)));r=Be(R.body,Me,x,k)}}d.isString(c)||(c=c?"include":"omit");const C="credentials"in Request.prototype;p=new Request(t,{...m,signal:y,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",credentials:C?c:void 0});let E=await fetch(p);const b=ye&&(l==="stream"||l==="response");if(ye&&(u||b&&g)){const R={};["status","statusText","headers"].forEach(H=>{R[H]=E[H]});const v=d.toFiniteNumber(E.headers.get("content-length")),[x,k]=u&&Le(v,Y(qe(u),!0))||[];E=new Response(Be(E.body,Me,x,()=>{k&&k(),g&&g()}),R)}l=l||"text";let O=await ee[d.findKey(ee,l)||"text"](E,e);return!b&&g&&g(),await new Promise((R,v)=>{pt(R,v,{data:O,headers:A.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:p})})}catch(C){throw g&&g(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,e,p),{cause:C.cause||C}):w.from(C,C&&C.code,e,p)}}),we={http:An,xhr:rr,fetch:fr};d.forEach(we,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const je=e=>`- ${e}`,hr=e=>d.isFunction(e)||e===null||e===!1,bt={getAdapter:e=>{e=d.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!hr(n)&&(r=we[(i=String(n)).toLowerCase()],r===void 0))throw new w(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since : `+o.map(je).join(` `):" "+je(o[0]):"as no adapter specified";throw new w("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:we};function de(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new M(null,e)}function De(e){return de(e),e.headers=A.from(e.headers),e.data=ue.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),bt.getAdapter(e.adapter||$.adapter)(e).then(function(r){return de(e),r.data=ue.call(e,e.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return ht(r)||(de(e),r&&r.response&&(r.response.data=ue.call(e,e.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const Ct="1.7.7",_e={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_e[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const We={};_e.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Ct+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,u)=>{if(t===!1)throw new w(s(i," has been removed"+(n?" in "+n:"")),w.ERR_DEPRECATED);return n&&!We[i]&&(We[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,u):!0}};function pr(e,t,n){if(typeof e!="object")throw new w("options must be an object",w.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const u=e[o],f=u===void 0||i(u,o,e);if(f!==!0)throw new w("option "+o+" must be "+f,w.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new w("Unknown option "+o,w.ERR_BAD_OPTION)}}const be={assertOptions:pr,validators:_e},N=be.validators;class q{constructor(t){this.defaults=t,this.interceptors={request:new Ne,response:new Ne}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=I(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&be.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(d.isFunction(s)?n.paramsSerializer={serialize:s}:be.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&d.merge(o.common,o[n.method]);o&&d.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=A.concat(i,o);const u=[];let f=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(f=f&&g.synchronous,u.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let a,c=0,m;if(!f){const p=[De.bind(this),void 0];for(p.unshift.apply(p,u),p.push.apply(p,l),m=p.length,a=Promise.resolve(n);c<m;)a=a.then(p[c++],p[c++]);return a}m=u.length;let y=n;for(c=0;c<m;){const p=u[c++],g=u[c++];try{y=p(y)}catch(h){g.call(this,h);break}}try{a=De.call(this,y)}catch(p){return Promise.reject(p)}for(c=0,m=l.length;c<m;)a=a.then(l[c++],l[c++]);return a}getUri(t){t=I(this.defaults,t);const n=mt(t.baseURL,t.url);return ut(n,t.params,t.paramsSerializer)}}d.forEach(["delete","get","head","options"],function(t){q.prototype[t]=function(n,r){return this.request(I(r||{},{method:t,url:n,data:(r||{}).data}))}});d.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,u){return this.request(I(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}q.prototype[t]=n(),q.prototype[t+"Form"]=n(!0)});class Oe{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(u=>{r.subscribe(u),o=u}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,u){r.reason||(r.reason=new M(o,i,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Oe(function(s){t=s}),cancel:t}}}function mr(e){return function(n){return e.apply(null,n)}}function gr(e){return d.isObject(e)&&e.isAxiosError===!0}const Ce={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ce).forEach(([e,t])=>{Ce[t]=e});function Et(e){const t=new q(e),n=Qe(q.prototype.request,t);return d.extend(n,q.prototype,t,{allOwnKeys:!0}),d.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Et(I(e,s))},n}const _=Et($);_.Axios=q;_.CanceledError=M;_.CancelToken=Oe;_.isCancel=ht;_.VERSION=Ct;_.toFormData=oe;_.AxiosError=w;_.Cancel=_.CanceledError;_.all=function(t){return Promise.all(t)};_.spread=mr;_.isAxiosError=gr;_.mergeConfig=I;_.AxiosHeaders=A;_.formToJSON=e=>ft(d.isHTMLForm(e)?new FormData(e):e);_.getAdapter=bt.getAdapter;_.HttpStatusCode=Ce;_.default=_;const St=async e=>{const t=await _.post(`${W.connect_url}/message`,e);return t==null?void 0:t.data},Te=async e=>{const t=await _.post(`${W.connect_url}/getMessage`,{token:e});return t==null?void 0:t.data},Rt=e=>new EventSource(`${W.connect_url}/connect?token=${e}`),yr=async e=>{if(e)try{const t=await Te(e);return(t==null?void 0:t.data)||{}}catch{return null}};function wr(e){var n;let t=window.location.hostname;try{t=((n=new URL((e==null?void 0:e.url)||""))==null?void 0:n.hostname)||t}catch{console.warn(`new URL(${e==null?void 0:e.url}) error`)}return{url:(e==null?void 0:e.url)||"",hostname:t,name:(e==null?void 0:e.name)||br(window),icon:(e==null?void 0:e.icon)||Cr(window),direct_link:e==null?void 0:e.direct_link,description:e==null?void 0:e.description}}function br(e){const{document:t}=e,n=t.querySelector('head > meta[property="og:site_name"]');if(n)return n.content;const r=t.querySelector('head > meta[name="title"]');return r?r.content:t.title&&t.title.length>0?t.title:window.location.hostname}function Cr(e){const{document:t}=e,n=t.querySelectorAll('head > link[rel~="icon"]');for(const r of Array.from(n))if(r)return r.href;return null}const Er={errors:{disconnected:()=>"UnielonWallet: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"UnielonWallet: Disconnected from UnielonWallet background. Page reload required.",sendSiteMetadata:()=>"UnielonWallet: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`UnielonWallet: The UnielonWallet Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidNetworkParams:()=>"UnielonWallet: Received invalid network parameters. Please report this bug.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`,invalidChains:e=>`'UnielonWallet: not supported chain with ID '${e}'. try connect wallet to supported chain.`,timeOut:e=>`'UnielonWallet: Timed out while waiting for response from '${e}'.`},info:{connected:e=>`UnielonWallet: Connected to dogecoin chain "${e}".`},warnings:{chainIdDeprecation:`UnielonWallet: 'ethereum.chainId' is deprecated and may be removed in the future. Please use the 'eth_chainId' RPC method instead. For more information, see: https://github.com/UnielonWallet/UnielonWallet-improvement-proposals/discussions/23`,networkVersionDeprecation:`UnielonWallet: 'ethereum.networkVersion' is deprecated and may be removed in the future. Please use the 'net_version' RPC method ins