@ultrade/shared 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/helpers/algo.helper.js +1 -1
- package/dist/browser/helpers/assert.helper.js +1 -1
- package/dist/browser/helpers/atomic.helper.js +1 -1
- package/dist/browser/helpers/balance.helper.js +1 -1
- package/dist/browser/helpers/pointSystem.helper.js +1 -1
- package/dist/browser/types/index.js +1 -1
- package/dist/helpers/balance.helper.d.ts +2 -13
- package/dist/node/constants/index.js +1 -1
- package/dist/node/helpers/algo.helper.js +1 -1
- package/dist/node/helpers/atomic.helper.js +1 -1
- package/dist/node/helpers/balance.helper.js +1 -1
- package/dist/node/helpers/index.js +1 -1
- package/dist/node/helpers/pointSystem.helper.js +1 -1
- package/dist/node/types/index.js +1 -1
- package/dist/types/settings.type.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function fr(){throw new Error("setTimeout has not been defined")}function lr(){throw new Error("clearTimeout has not been defined")}var N=fr,v=lr;typeof globalThis.setTimeout=="function"&&(N=setTimeout);typeof globalThis.clearTimeout=="function"&&(v=clearTimeout);function pr(t){if(N===setTimeout)return setTimeout(t,0);if((N===fr||!N)&&setTimeout)return N=setTimeout,setTimeout(t,0);try{return N(t,0)}catch{try{return N.call(null,t,0)}catch{return N.call(this,t,0)}}}function jr(t){if(v===clearTimeout)return clearTimeout(t);if((v===lr||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(t);try{return v(t)}catch{try{return v.call(null,t)}catch{return v.call(this,t)}}}var k=[],O=!1,P,L=-1;function re(){!O||!P||(O=!1,P.length?k=P.concat(k):L=-1,k.length&&hr())}function hr(){if(!O){var t=pr(re);O=!0;for(var r=k.length;r;){for(P=k,k=[];++L<r;)P&&P[L].run();L=-1,r=k.length}P=null,O=!1,jr(t)}}function ee(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];k.push(new gr(t,r)),k.length===1&&!O&&pr(hr)}function gr(t,r){this.fun=t,this.array=r}gr.prototype.run=function(){this.fun.apply(null,this.array)};var te="browser",ne="browser",ie=!0,oe={},ae=[],ue="",se={},ce={},fe={};function D(){}var le=D,pe=D,he=D,ge=D,me=D,xe=D,de=D;function be(t){throw new Error("process.binding is not supported")}function Ee(){return"/"}function we(t){throw new Error("process.chdir is not supported")}function ye(){return 0}var F=globalThis.performance||{},Te=F.now||F.mozNow||F.msNow||F.oNow||F.webkitNow||function(){return new Date().getTime()};function _e(t){var r=Te.call(F)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Ae=new Date;function Ie(){var t=new Date,r=t-Ae;return r/1e3}var x={nextTick:ee,title:te,browser:ie,env:oe,argv:ae,version:ue,versions:se,on:le,addListener:pe,once:he,off:ge,removeListener:me,removeAllListeners:xe,emit:de,binding:be,cwd:Ee,chdir:we,umask:ye,hrtime:_e,platform:ne,release:ce,config:fe,uptime:Ie},cr={};Object.keys(cr).forEach(t=>{let r=t.split("."),e=x;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=cr[t]:e=e[i]||(e[i]={})}});var A=[],T=[],Re=typeof Uint8Array<"u"?Uint8Array:Array,er=!1;function br(){er=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],T[t.charCodeAt(r)]=r;T[45]=62,T[95]=63}function Se(t){er||br();var r,e,n,i,o,a,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,a=new Re(s*3/4-o),n=o>0?s-4:s;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=T[t.charCodeAt(r)]<<18|T[t.charCodeAt(r+1)]<<12|T[t.charCodeAt(r+2)]<<6|T[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=T[t.charCodeAt(r)]<<2|T[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=T[t.charCodeAt(r)]<<10|T[t.charCodeAt(r+1)]<<4|T[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function ke(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Be(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(ke(n));return i.join("")}function mr(t){er||br();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(Be(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=A[r>>2],i+=A[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=A[r>>10],i+=A[r>>4&63],i+=A[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Y(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if(Y()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return tr(this,t)}return Er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Er(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?ve(t,r,e,n):typeof r=="string"?Ne(t,r,e):Pe(t,r)}u.from=function(t,r,e){return Er(null,t,r,e)};u.kMaxLength=Y();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function wr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ue(t,r,e,n){return wr(r),r<=0?B(t,r):e!==void 0?typeof n=="string"?B(t,r).fill(e,n):B(t,r).fill(e):B(t,r)}u.alloc=function(t,r,e){return Ue(null,t,r,e)};function tr(t,r){if(wr(r),t=B(t,r<0?0:nr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return tr(null,t)};u.allocUnsafeSlow=function(t){return tr(null,t)};function Ne(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=yr(r,e)|0;t=B(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function rr(t,r){var e=r.length<0?0:nr(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ve(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=rr(t,r),t}function Pe(t,r){if(I(r)){var e=nr(r.length)|0;return t=B(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ze(r.length)?B(t,0):rr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return rr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function nr(t){if(t>=Y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y().toString(16)+" bytes");return t|0}u.isBuffer=je;function I(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!I(r)||!I(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!I(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function yr(t,r){if(I(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return kr(t).length;default:if(n)return W(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=yr;function De(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ve(this,r,e);case"utf8":case"utf-8":return Ar(this,r,e);case"ascii":return Ge(this,r,e);case"latin1":case"binary":return He(this,r,e);case"base64":return Ye(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function C(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)C(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)C(this,e,e+3),C(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Ar(this,0,r):De.apply(this,arguments)};u.prototype.equals=function(r){if(!I(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!I(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<a?1:0};function Tr(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),I(r))return r.length===0?-1:xr(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):xr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function xr(t,r,e,n,i){var o=1,a=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,s/=2,e/=2}function f(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,m=0;m<s;m++)if(f(t,p+m)!==f(r,m)){l=!1;break}if(l)return p}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Tr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Tr(this,r,e,n,!1)};function Ce(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function Me(t,r,e,n){return V(W(r,t.length-e),t,e,n)}function _r(t,r,e,n){return V(Xe(r),t,e,n)}function Fe(t,r,e,n){return _r(t,r,e,n)}function Oe(t,r,e,n){return V(kr(r),t,e,n)}function Le(t,r,e,n){return V(Qe(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Ce(this,r,e,n);case"utf8":case"utf-8":return Me(this,r,e,n);case"ascii":return _r(this,r,e,n);case"latin1":case"binary":return Fe(this,r,e,n);case"base64":return Oe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ye(t,r,e){return r===0&&e===t.length?mr(t):mr(t.slice(r,e))}function Ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return We(n)}var dr=4096;function We(t){var r=t.length;if(r<=dr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=dr));return e}function Ge(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function He(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function Ve(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Je(t[o]);return i}function Ke(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function d(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||d(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||d(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||d(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||d(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||d(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||d(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||d(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||d(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||d(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||d(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||d(r,4,this.length),K(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||d(r,4,this.length),K(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||d(r,8,this.length),K(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||d(r,8,this.length),K(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!I(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function G(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};function H(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):H(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):H(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var a=0,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var a=n-1,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):H(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):H(this,r,e,!1),e+4};function Ir(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Rr(t,r,e,n,i){return i||Ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),Ur(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Rr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Rr(this,r,e,!1,n)};function Sr(t,r,e,n,i){return i||Ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),Ur(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return Sr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return Sr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var s=I(r)?r:W(new u(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var $e=/[^+\/0-9A-Za-z-_]/g;function ze(t){if(t=qe(t).replace($e,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function qe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Je(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Xe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Qe(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function kr(t){return Se(ze(t))}function V(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Ze(t){return t!==t}function je(t){return t!=null&&(!!t._isBuffer||Br(t)||rt(t))}function Br(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function rt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Br(t.slice(0,0))}function K(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)}function Ur(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=m/f:r+=m*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+g]=a&255,g+=y,a/=256,p-=8);t[e+g-y]|=j*128}import sr from"algosdk";import zt,{decodeAddress as qt,encodeAddress as Jt}from"algosdk";var R=[],_=[],et=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function Dr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function tt(t){or||Dr();var r,e,n,i,o,a,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,a=new et(s*3/4-o),n=o>0?s-4:s;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function nt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function it(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(nt(n));return i.join("")}function Nr(t){or||Dr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(it(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=R[r>>2],i+=R[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=R[r>>10],i+=R[r>>4&63],i+=R[r<<2&63],i+="="),o.push(i),o.join("")}function q(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)}function Cr(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=m/f:r+=m*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+g]=a&255,g+=y,a/=256,p-=8);t[e+g-y]|=j*128}var ot={}.toString,Mr=Array.isArray||function(t){return ot.call(t)=="[object Array]"};var at=50;c.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Gt=$();function $(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(t,r){if($()<r)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=c.prototype):(t===null&&(t=new c(r)),t.length=r),t}function c(t,r,e){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c))return new c(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ar(this,t)}return Fr(this,t,r,e)}c.poolSize=8192;c._augment=function(t){return t.__proto__=c.prototype,t};function Fr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?ct(t,r,e,n):typeof r=="string"?st(t,r,e):ft(t,r)}c.from=function(t,r,e){return Fr(null,t,r,e)};c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array);function Or(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ut(t,r,e,n){return Or(r),r<=0?U(t,r):e!==void 0?typeof n=="string"?U(t,r).fill(e,n):U(t,r).fill(e):U(t,r)}c.alloc=function(t,r,e){return ut(null,t,r,e)};function ar(t,r){if(Or(r),t=U(t,r<0?0:ur(r)|0),!c.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}c.allocUnsafe=function(t){return ar(null,t)};c.allocUnsafeSlow=function(t){return ar(null,t)};function st(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!c.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Lr(r,e)|0;t=U(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function ir(t,r){var e=r.length<0?0:ur(r.length)|0;t=U(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ct(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),c.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=c.prototype):t=ir(t,r),t}function ft(t,r){if(S(r)){var e=ur(r.length)|0;return t=U(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Bt(r.length)?U(t,0):ir(t,r);if(r.type==="Buffer"&&Mr(r.data))return ir(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ur(t){if(t>=$())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$().toString(16)+" bytes");return t|0}c.isBuffer=Ut;function S(t){return!!(t!=null&&t._isBuffer)}c.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};c.isEncoding=function(r){switch(String(r).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}};c.concat=function(r,e){if(!Mr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return c.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=c.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Lr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return $r(t).length;default:if(n)return z(t).length;r=(""+r).toLowerCase(),n=!0}}c.byteLength=Lr;function lt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return yt(this,r,e);case"utf8":case"utf-8":return Gr(this,r,e);case"ascii":return Et(this,r,e);case"latin1":case"binary":return wt(this,r,e);case"base64":return dt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}c.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};c.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};c.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};c.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Gr(this,0,r):lt.apply(this,arguments)};c.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:c.compare(this,r)===0};c.prototype.inspect=function(){var r="",e=at;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};c.prototype.compare=function(r,e,n,i,o){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<a?1:0};function Yr(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=c.from(r,n)),S(r))return r.length===0?-1:vr(t,r,e,n,i);if(typeof r=="number")return r=r&255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):vr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function vr(t,r,e,n,i){var o=1,a=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,s/=2,e/=2}function f(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,m=0;m<s;m++)if(f(t,p+m)!==f(r,m)){l=!1;break}if(l)return p}return-1}c.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};c.prototype.indexOf=function(r,e,n){return Yr(this,r,e,n,!0)};c.prototype.lastIndexOf=function(r,e,n){return Yr(this,r,e,n,!1)};function pt(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function ht(t,r,e,n){return Q(z(r,t.length-e),t,e,n)}function Wr(t,r,e,n){return Q(St(r),t,e,n)}function gt(t,r,e,n){return Wr(t,r,e,n)}function mt(t,r,e,n){return Q($r(r),t,e,n)}function xt(t,r,e,n){return Q(kt(r,t.length-e),t,e,n)}c.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return pt(this,r,e,n);case"utf8":case"utf-8":return ht(this,r,e,n);case"ascii":return Wr(this,r,e,n);case"latin1":case"binary":return gt(this,r,e,n);case"base64":return mt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dt(t,r,e){return r===0&&e===t.length?Nr(t):Nr(t.slice(r,e))}function Gr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return bt(n)}var Pr=4096;function bt(t){var r=t.length;if(r<=Pr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Pr));return e}function Et(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function wt(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function yt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Rt(t[o]);return i}function Tt(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}c.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(c.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=c.prototype;else{var o=e-r;i=new c(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};c.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};c.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};c.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};c.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};c.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};c.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};c.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};c.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};c.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};c.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};c.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};c.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),q(this,r,!0,23,4)};c.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),q(this,r,!1,23,4)};c.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),q(this,r,!0,52,8)};c.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),q(this,r,!1,52,8)};function w(t,r,e,n,i,o){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}c.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;w(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=r/a&255;return e+n};c.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;w(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};c.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function J(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}c.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};function X(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}c.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):X(this,r,e,!0),e+4};c.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};c.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);w(this,r,e,n,o-1,-o)}var a=0,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);w(this,r,e,n,o-1,-o)}var a=n-1,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};c.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};c.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):X(this,r,e,!0),e+4};c.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};function Hr(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Vr(t,r,e,n,i){return i||Hr(t,r,e,4),Cr(t,r,e,n,23,4),e+4}c.prototype.writeFloatLE=function(r,e,n){return Vr(this,r,e,!0,n)};c.prototype.writeFloatBE=function(r,e,n){return Vr(this,r,e,!1,n)};function Kr(t,r,e,n,i){return i||Hr(t,r,e,8),Cr(t,r,e,n,52,8),e+8}c.prototype.writeDoubleLE=function(r,e,n){return Kr(this,r,e,!0,n)};c.prototype.writeDoubleBE=function(r,e,n){return Kr(this,r,e,!1,n)};c.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};c.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var s=S(r)?r:z(new c(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function At(t){if(t=It(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function It(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Rt(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function St(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function kt(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function $r(t){return tt(At(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Bt(t){return t!==t}function Ut(t){return t!=null&&(!!t._isBuffer||zr(t)||Nt(t))}function zr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Nt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&zr(t.slice(0,0))}import{encodeAddress as Xr,decodeAddress as en}from"algosdk";function qr(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}function Jr(t){return t.map(r=>r instanceof Uint8Array?new Uint8Array(r):typeof r=="string"?vt(r):(typeof r=="boolean"&&(r=BigInt(r?1:0)),typeof r=="number"&&(r=BigInt(r)),Pt(r)))}function vt(t){return new Uint8Array(c.from(t))}function Pt(t){let r=c.alloc(8);for(let e=0;e<8;e++)r[7-e]=Number(BigInt(t)>>BigInt(e*8)&BigInt(255));return new Uint8Array(r)}function Z(t){return c.from(t,"base64")}import Dt from"bignumber.js";Dt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var An=`{"theme1":{"value":"${x.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},kn={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};function Zr(t){return Object.keys(t).sort().reduce((r,e)=>({...r,[e]:t[e]}),{})}var gi=(t,r)=>r.map(n=>({appIndex:t,name:qr(Jr(["WLP_",n]))}));function Ct(t){let r={};return t.forEach(e=>{let n=Z(e.key).toString(),i=e.value,o=i.type;o==2&&(i=i.uint),o==1&&(i=Z(i.bytes)),n=="gov"?r.gov=Xr(i):r[n]=i}),Zr(r)}var mi=t=>{let r={0:t.amount},e=t.assets;for(let n=0;n<e.length;n++){let i=e[n]["asset-id"],o=e[n].amount;r[i]=o}return console.log(`Account ${t.address} balances`,JSON.stringify(r)),r},xi=async(t,r)=>{let e=await t.getApplicationByID(r).do();return Ct(e.params["global-state"])},di=async(t,r)=>{let{boxes:e}=await t.getApplicationBoxes(r).do();console.log("boxes",r,e.map(n=>n.name).filter(n=>n.length===32).map(n=>u.from(n).toString("base64")))},bi=async(t,r,e)=>{try{let{value:n}=await t.getApplicationBoxByName(r,e).do();return n}catch(n){if(n.message.includes("box not found"))return console.log(`Box not found '${u.from(e).toString("hex")}'`),null;throw n}},Ei=async(t,r=1)=>{let e=await t.getTransactionParams().do();return r>1&&(e.fee=sr.ALGORAND_MIN_TX_FEE*r,e.flatFee=!0),{...e}},wi=(t,r)=>Object.keys(t).includes(r.toString()),yi=t=>sr.decodeAddress(t.toUpperCase()).publicKey,Ti=(t,r,e,n)=>sr.verifyBytes(new Uint8Array(u.from(e,n)),Z(t),r);export{gi as createBoxes,yi as decodeAndNormalizeAddress,Ct as decodeStateArray,mi as getAccountAssetBalances,di as getAppBoxes,xi as getAppGlobalState,bi as getBoxByName,Ei as getTxnParams,wi as isAssetOptedIn,Ti as verifySignature};
|
|
1
|
+
function fr(){throw new Error("setTimeout has not been defined")}function lr(){throw new Error("clearTimeout has not been defined")}var v=fr,N=lr;typeof globalThis.setTimeout=="function"&&(v=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function pr(t){if(v===setTimeout)return setTimeout(t,0);if((v===fr||!v)&&setTimeout)return v=setTimeout,setTimeout(t,0);try{return v(t,0)}catch{try{return v.call(null,t,0)}catch{return v.call(this,t,0)}}}function jr(t){if(N===clearTimeout)return clearTimeout(t);if((N===lr||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var k=[],O=!1,P,L=-1;function re(){!O||!P||(O=!1,P.length?k=P.concat(k):L=-1,k.length&&hr())}function hr(){if(!O){var t=pr(re);O=!0;for(var r=k.length;r;){for(P=k,k=[];++L<r;)P&&P[L].run();L=-1,r=k.length}P=null,O=!1,jr(t)}}function ee(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];k.push(new gr(t,r)),k.length===1&&!O&&pr(hr)}function gr(t,r){this.fun=t,this.array=r}gr.prototype.run=function(){this.fun.apply(null,this.array)};var te="browser",ne="browser",ie=!0,oe={},ae=[],ue="",se={},ce={},fe={};function D(){}var le=D,pe=D,he=D,ge=D,me=D,xe=D,de=D;function be(t){throw new Error("process.binding is not supported")}function Ee(){return"/"}function we(t){throw new Error("process.chdir is not supported")}function ye(){return 0}var F=globalThis.performance||{},Te=F.now||F.mozNow||F.msNow||F.oNow||F.webkitNow||function(){return new Date().getTime()};function _e(t){var r=Te.call(F)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Ae=new Date;function Ie(){var t=new Date,r=t-Ae;return r/1e3}var x={nextTick:ee,title:te,browser:ie,env:oe,argv:ae,version:ue,versions:se,on:le,addListener:pe,once:he,off:ge,removeListener:me,removeAllListeners:xe,emit:de,binding:be,cwd:Ee,chdir:we,umask:ye,hrtime:_e,platform:ne,release:ce,config:fe,uptime:Ie},cr={};Object.keys(cr).forEach(t=>{let r=t.split("."),e=x;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=cr[t]:e=e[i]||(e[i]={})}});var A=[],T=[],Re=typeof Uint8Array<"u"?Uint8Array:Array,er=!1;function br(){er=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],T[t.charCodeAt(r)]=r;T[45]=62,T[95]=63}function Se(t){er||br();var r,e,n,i,o,a,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,a=new Re(s*3/4-o),n=o>0?s-4:s;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=T[t.charCodeAt(r)]<<18|T[t.charCodeAt(r+1)]<<12|T[t.charCodeAt(r+2)]<<6|T[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=T[t.charCodeAt(r)]<<2|T[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=T[t.charCodeAt(r)]<<10|T[t.charCodeAt(r+1)]<<4|T[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function ke(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Be(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(ke(n));return i.join("")}function mr(t){er||br();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(Be(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=A[r>>2],i+=A[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=A[r>>10],i+=A[r>>4&63],i+=A[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Y(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if(Y()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return tr(this,t)}return Er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Er(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Ne(t,r,e,n):typeof r=="string"?ve(t,r,e):Pe(t,r)}u.from=function(t,r,e){return Er(null,t,r,e)};u.kMaxLength=Y();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function wr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ue(t,r,e,n){return wr(r),r<=0?B(t,r):e!==void 0?typeof n=="string"?B(t,r).fill(e,n):B(t,r).fill(e):B(t,r)}u.alloc=function(t,r,e){return Ue(null,t,r,e)};function tr(t,r){if(wr(r),t=B(t,r<0?0:nr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return tr(null,t)};u.allocUnsafeSlow=function(t){return tr(null,t)};function ve(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=yr(r,e)|0;t=B(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function rr(t,r){var e=r.length<0?0:nr(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ne(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=rr(t,r),t}function Pe(t,r){if(I(r)){var e=nr(r.length)|0;return t=B(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ze(r.length)?B(t,0):rr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return rr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function nr(t){if(t>=Y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y().toString(16)+" bytes");return t|0}u.isBuffer=je;function I(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!I(r)||!I(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!I(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function yr(t,r){if(I(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return kr(t).length;default:if(n)return W(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=yr;function De(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ve(this,r,e);case"utf8":case"utf-8":return Ar(this,r,e);case"ascii":return Ge(this,r,e);case"latin1":case"binary":return He(this,r,e);case"base64":return Ye(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function C(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)C(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)C(this,e,e+3),C(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Ar(this,0,r):De.apply(this,arguments)};u.prototype.equals=function(r){if(!I(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!I(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<a?1:0};function Tr(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),I(r))return r.length===0?-1:xr(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):xr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function xr(t,r,e,n,i){var o=1,a=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,s/=2,e/=2}function f(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,m=0;m<s;m++)if(f(t,p+m)!==f(r,m)){l=!1;break}if(l)return p}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Tr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Tr(this,r,e,n,!1)};function Ce(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function Me(t,r,e,n){return V(W(r,t.length-e),t,e,n)}function _r(t,r,e,n){return V(Xe(r),t,e,n)}function Fe(t,r,e,n){return _r(t,r,e,n)}function Oe(t,r,e,n){return V(kr(r),t,e,n)}function Le(t,r,e,n){return V(Qe(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Ce(this,r,e,n);case"utf8":case"utf-8":return Me(this,r,e,n);case"ascii":return _r(this,r,e,n);case"latin1":case"binary":return Fe(this,r,e,n);case"base64":return Oe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ye(t,r,e){return r===0&&e===t.length?mr(t):mr(t.slice(r,e))}function Ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return We(n)}var dr=4096;function We(t){var r=t.length;if(r<=dr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=dr));return e}function Ge(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function He(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function Ve(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Je(t[o]);return i}function Ke(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function d(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||d(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||d(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||d(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||d(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||d(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||d(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||d(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||d(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||d(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||d(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||d(r,4,this.length),K(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||d(r,4,this.length),K(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||d(r,8,this.length),K(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||d(r,8,this.length),K(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!I(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function G(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};function H(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):H(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):H(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var a=0,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var a=n-1,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):H(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):H(this,r,e,!1),e+4};function Ir(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Rr(t,r,e,n,i){return i||Ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),Ur(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Rr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Rr(this,r,e,!1,n)};function Sr(t,r,e,n,i){return i||Ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),Ur(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return Sr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return Sr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var s=I(r)?r:W(new u(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var $e=/[^+\/0-9A-Za-z-_]/g;function ze(t){if(t=qe(t).replace($e,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function qe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Je(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Xe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Qe(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function kr(t){return Se(ze(t))}function V(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Ze(t){return t!==t}function je(t){return t!=null&&(!!t._isBuffer||Br(t)||rt(t))}function Br(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function rt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Br(t.slice(0,0))}function K(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)}function Ur(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=m/f:r+=m*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+g]=a&255,g+=y,a/=256,p-=8);t[e+g-y]|=j*128}import sr from"algosdk";import zt,{decodeAddress as qt,encodeAddress as Jt}from"algosdk";var R=[],_=[],et=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function Dr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function tt(t){or||Dr();var r,e,n,i,o,a,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,a=new et(s*3/4-o),n=o>0?s-4:s;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function nt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function it(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(nt(n));return i.join("")}function vr(t){or||Dr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(it(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=R[r>>2],i+=R[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=R[r>>10],i+=R[r>>4&63],i+=R[r<<2&63],i+="="),o.push(i),o.join("")}function q(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)}function Cr(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=m/f:r+=m*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+g]=a&255,g+=y,a/=256,p-=8);t[e+g-y]|=j*128}var ot={}.toString,Mr=Array.isArray||function(t){return ot.call(t)=="[object Array]"};var at=50;c.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Gt=$();function $(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(t,r){if($()<r)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=c.prototype):(t===null&&(t=new c(r)),t.length=r),t}function c(t,r,e){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c))return new c(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ar(this,t)}return Fr(this,t,r,e)}c.poolSize=8192;c._augment=function(t){return t.__proto__=c.prototype,t};function Fr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?ct(t,r,e,n):typeof r=="string"?st(t,r,e):ft(t,r)}c.from=function(t,r,e){return Fr(null,t,r,e)};c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array);function Or(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ut(t,r,e,n){return Or(r),r<=0?U(t,r):e!==void 0?typeof n=="string"?U(t,r).fill(e,n):U(t,r).fill(e):U(t,r)}c.alloc=function(t,r,e){return ut(null,t,r,e)};function ar(t,r){if(Or(r),t=U(t,r<0?0:ur(r)|0),!c.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}c.allocUnsafe=function(t){return ar(null,t)};c.allocUnsafeSlow=function(t){return ar(null,t)};function st(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!c.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Lr(r,e)|0;t=U(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function ir(t,r){var e=r.length<0?0:ur(r.length)|0;t=U(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ct(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),c.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=c.prototype):t=ir(t,r),t}function ft(t,r){if(S(r)){var e=ur(r.length)|0;return t=U(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Bt(r.length)?U(t,0):ir(t,r);if(r.type==="Buffer"&&Mr(r.data))return ir(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ur(t){if(t>=$())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$().toString(16)+" bytes");return t|0}c.isBuffer=Ut;function S(t){return!!(t!=null&&t._isBuffer)}c.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};c.isEncoding=function(r){switch(String(r).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}};c.concat=function(r,e){if(!Mr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return c.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=c.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Lr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return $r(t).length;default:if(n)return z(t).length;r=(""+r).toLowerCase(),n=!0}}c.byteLength=Lr;function lt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return yt(this,r,e);case"utf8":case"utf-8":return Gr(this,r,e);case"ascii":return Et(this,r,e);case"latin1":case"binary":return wt(this,r,e);case"base64":return dt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}c.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};c.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};c.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};c.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Gr(this,0,r):lt.apply(this,arguments)};c.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:c.compare(this,r)===0};c.prototype.inspect=function(){var r="",e=at;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};c.prototype.compare=function(r,e,n,i,o){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<a?1:0};function Yr(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=c.from(r,n)),S(r))return r.length===0?-1:Nr(t,r,e,n,i);if(typeof r=="number")return r=r&255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Nr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Nr(t,r,e,n,i){var o=1,a=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,s/=2,e/=2}function f(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,m=0;m<s;m++)if(f(t,p+m)!==f(r,m)){l=!1;break}if(l)return p}return-1}c.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};c.prototype.indexOf=function(r,e,n){return Yr(this,r,e,n,!0)};c.prototype.lastIndexOf=function(r,e,n){return Yr(this,r,e,n,!1)};function pt(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function ht(t,r,e,n){return Q(z(r,t.length-e),t,e,n)}function Wr(t,r,e,n){return Q(St(r),t,e,n)}function gt(t,r,e,n){return Wr(t,r,e,n)}function mt(t,r,e,n){return Q($r(r),t,e,n)}function xt(t,r,e,n){return Q(kt(r,t.length-e),t,e,n)}c.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return pt(this,r,e,n);case"utf8":case"utf-8":return ht(this,r,e,n);case"ascii":return Wr(this,r,e,n);case"latin1":case"binary":return gt(this,r,e,n);case"base64":return mt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dt(t,r,e){return r===0&&e===t.length?vr(t):vr(t.slice(r,e))}function Gr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return bt(n)}var Pr=4096;function bt(t){var r=t.length;if(r<=Pr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Pr));return e}function Et(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function wt(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function yt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Rt(t[o]);return i}function Tt(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}c.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(c.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=c.prototype;else{var o=e-r;i=new c(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};c.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};c.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};c.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};c.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};c.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};c.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};c.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};c.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};c.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};c.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};c.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};c.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),q(this,r,!0,23,4)};c.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),q(this,r,!1,23,4)};c.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),q(this,r,!0,52,8)};c.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),q(this,r,!1,52,8)};function w(t,r,e,n,i,o){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}c.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;w(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=r/a&255;return e+n};c.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;w(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};c.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function J(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}c.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};function X(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}c.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):X(this,r,e,!0),e+4};c.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};c.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);w(this,r,e,n,o-1,-o)}var a=0,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);w(this,r,e,n,o-1,-o)}var a=n-1,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};c.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};c.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):X(this,r,e,!0),e+4};c.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};function Hr(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Vr(t,r,e,n,i){return i||Hr(t,r,e,4),Cr(t,r,e,n,23,4),e+4}c.prototype.writeFloatLE=function(r,e,n){return Vr(this,r,e,!0,n)};c.prototype.writeFloatBE=function(r,e,n){return Vr(this,r,e,!1,n)};function Kr(t,r,e,n,i){return i||Hr(t,r,e,8),Cr(t,r,e,n,52,8),e+8}c.prototype.writeDoubleLE=function(r,e,n){return Kr(this,r,e,!0,n)};c.prototype.writeDoubleBE=function(r,e,n){return Kr(this,r,e,!1,n)};c.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};c.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var s=S(r)?r:z(new c(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function At(t){if(t=It(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function It(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Rt(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function St(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function kt(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function $r(t){return tt(At(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Bt(t){return t!==t}function Ut(t){return t!=null&&(!!t._isBuffer||zr(t)||vt(t))}function zr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function vt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&zr(t.slice(0,0))}import{encodeAddress as Xr,decodeAddress as en}from"algosdk";function qr(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}function Jr(t){return t.map(r=>r instanceof Uint8Array?new Uint8Array(r):typeof r=="string"?Nt(r):(typeof r=="boolean"&&(r=BigInt(r?1:0)),typeof r=="number"&&(r=BigInt(r)),Pt(r)))}function Nt(t){return new Uint8Array(c.from(t))}function Pt(t){let r=c.alloc(8);for(let e=0;e<8;e++)r[7-e]=Number(BigInt(t)>>BigInt(e*8)&BigInt(255));return new Uint8Array(r)}function Z(t){return c.from(t,"base64")}import Dt from"bignumber.js";Dt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var An=`{"theme1":{"value":"${x.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},kn={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};function Zr(t){return Object.keys(t).sort().reduce((r,e)=>({...r,[e]:t[e]}),{})}var gi=(t,r)=>r.map(n=>({appIndex:t,name:qr(Jr(["WLP_",n]))}));function Ct(t){let r={};return t.forEach(e=>{let n=Z(e.key).toString(),i=e.value,o=i.type;o==2&&(i=i.uint),o==1&&(i=Z(i.bytes)),n=="gov"?r.gov=Xr(i):r[n]=i}),Zr(r)}var mi=t=>{let r={0:t.amount},e=t.assets;for(let n=0;n<e.length;n++){let i=e[n]["asset-id"],o=e[n].amount;r[i]=o}return console.log(`Account ${t.address} balances`,JSON.stringify(r)),r},xi=async(t,r)=>{let e=await t.getApplicationByID(r).do();return Ct(e.params["global-state"])},di=async(t,r)=>{let{boxes:e}=await t.getApplicationBoxes(r).do();console.log("boxes",r,e.map(n=>n.name).filter(n=>n.length===32).map(n=>u.from(n).toString("base64")))},bi=async(t,r,e)=>{try{let{value:n}=await t.getApplicationBoxByName(r,e).do();return n}catch(n){if(n.message.includes("box not found"))return console.log(`Box not found '${u.from(e).toString("hex")}'`),null;throw n}},Ei=async(t,r=1)=>{let e=await t.getTransactionParams().do();return r>1&&(e.fee=sr.ALGORAND_MIN_TX_FEE*r,e.flatFee=!0),{...e}},wi=(t,r)=>Object.keys(t).includes(r.toString()),yi=t=>sr.decodeAddress(t.toUpperCase()).publicKey,Ti=(t,r,e,n)=>sr.verifyBytes(new Uint8Array(u.from(e,n)),Z(t),r);export{gi as createBoxes,yi as decodeAndNormalizeAddress,Ct as decodeStateArray,mi as getAccountAssetBalances,di as getAppBoxes,xi as getAppGlobalState,bi as getBoxByName,Ei as getTxnParams,wi as isAssetOptedIn,Ti as verifySignature};
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function $(){throw new Error("setTimeout has not been defined")}function Z(){throw new Error("clearTimeout has not been defined")}var x=$,N=Z;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function j(t){if(x===setTimeout)return setTimeout(t,0);if((x===$||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function xr(t){if(N===clearTimeout)return clearTimeout(t);if((N===Z||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var g=[],S=!1,O,M=-1;function Nr(){!S||!O||(S=!1,O.length?g=O.concat(g):M=-1,g.length&&rr())}function rr(){if(!S){var t=j(Nr);S=!0;for(var r=g.length;r;){for(O=g,g=[];++M<r;)O&&O[M].run();M=-1,r=g.length}O=null,S=!1,xr(t)}}function Or(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];g.push(new er(t,r)),g.length===1&&!S&&j(rr)}function er(t,r){this.fun=t,this.array=r}er.prototype.run=function(){this.fun.apply(null,this.array)};var Cr="browser",Dr="browser",Lr=!0,wr={},yr=[],Pr="",Sr={},vr={},Ur={};function C(){}var Mr=C,kr=C,Br=C,Fr=C,Yr=C,Gr=C,Hr=C;function Kr(t){throw new Error("process.binding is not supported")}function Wr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Xr(){return 0}var P=globalThis.performance||{},qr=P.now||P.mozNow||P.msNow||P.oNow||P.webkitNow||function(){return new Date().getTime()};function zr(t){var r=qr.call(P)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Qr=new Date;function Jr(){var t=new Date,r=t-Qr;return r/1e3}var s={nextTick:Or,title:Cr,browser:Lr,env:wr,argv:yr,version:Pr,versions:Sr,on:Mr,addListener:kr,once:Br,off:Fr,removeListener:Yr,removeAllListeners:Gr,emit:Hr,binding:Kr,cwd:Wr,chdir:Vr,umask:Xr,hrtime:zr,platform:Dr,release:vr,config:Ur,uptime:Jr},J={};Object.keys(J).forEach(t=>{let r=t.split("."),e=s;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=J[t]:e=e[o]||(e[o]={})}});var A=[],b=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,V=!1;function ir(){V=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],b[t.charCodeAt(r)]=r;b[45]=62,b[95]=63}function Zr(t){V||ir();var r,e,n,o,a,p,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,p=new $r(c*3/4-a),n=a>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=b[t.charCodeAt(r)]<<18|b[t.charCodeAt(r+1)]<<12|b[t.charCodeAt(r+2)]<<6|b[t.charCodeAt(r+3)],p[u++]=o>>16&255,p[u++]=o>>8&255,p[u++]=o&255;return a===2?(o=b[t.charCodeAt(r)]<<2|b[t.charCodeAt(r+1)]>>4,p[u++]=o&255):a===1&&(o=b[t.charCodeAt(r)]<<10|b[t.charCodeAt(r+1)]<<4|b[t.charCodeAt(r+2)]>>2,p[u++]=o>>8&255,p[u++]=o&255),p}function jr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function re(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(jr(n));return o.join("")}function tr(t){V||ir();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,c=0,u=e-n;c<u;c+=p)a.push(re(t,c,c+p>u?u:c+p));return n===1?(r=t[e-1],o+=A[r>>2],o+=A[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=A[r>>10],o+=A[r>>4&63],o+=A[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function I(t,r){if(k()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return X(this,t)}return ar(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function ar(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?ne(t,r,e,n):typeof r=="string"?te(t,r,e):oe(t,r)}i.from=function(t,r,e){return ar(null,t,r,e)};i.kMaxLength=k();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function pr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ee(t,r,e,n){return pr(r),r<=0?I(t,r):e!==void 0?typeof n=="string"?I(t,r).fill(e,n):I(t,r).fill(e):I(t,r)}i.alloc=function(t,r,e){return ee(null,t,r,e)};function X(t,r){if(pr(r),t=I(t,r<0?0:q(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return X(null,t)};i.allocUnsafeSlow=function(t){return X(null,t)};function te(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=sr(r,e)|0;t=I(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function W(t,r){var e=r.length<0?0:q(r.length)|0;t=I(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ne(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=W(t,r),t}function oe(t,r){if(R(r)){var e=q(r.length)|0;return t=I(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ie(r.length)?I(t,0):W(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return W(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function q(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return t|0}i.isBuffer=xe;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.isEncoding=function(r){switch(String(r).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}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function sr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return mr(t).length;default:if(n)return B(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=sr;function ie(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return me(this,r,e);case"utf8":case"utf-8":return Er(this,r,e);case"ascii":return _e(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return Ee(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)D(this,e,e+1);return this};i.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};i.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Er(this,0,r):ie.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,c=n-e,u=Math.min(p,c),l=this.slice(o,a),_=r.slice(e,n),E=0;E<u;++E)if(l[E]!==_[E]){p=l[E],c=_[E];break}return p<c?-1:c<p?1:0};function cr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=i.from(r,n)),R(r))return r.length===0?-1:nr(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):nr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function nr(t,r,e,n,o){var a=1,p=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,p/=2,c/=2,e/=2}function u(f,y){return a===1?f[y]:f.readUInt16BE(y*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===c)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+c>p&&(e=p-c),l=e;l>=0;l--){for(var E=!0,d=0;d<c;d++)if(u(t,l+d)!==u(r,d)){E=!1;break}if(E)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return cr(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return cr(this,r,e,n,!1)};function ae(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function pe(t,r,e,n){return G(B(r,t.length-e),t,e,n)}function ur(t,r,e,n){return G(Re(r),t,e,n)}function se(t,r,e,n){return ur(t,r,e,n)}function ce(t,r,e,n){return G(mr(r),t,e,n)}function ue(t,r,e,n){return G(ge(r,t.length-e),t,e,n)}i.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return ae(this,r,e,n);case"utf8":case"utf-8":return pe(this,r,e,n);case"ascii":return ur(this,r,e,n);case"latin1":case"binary":return se(this,r,e,n);case"base64":return ce(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ee(t,r,e){return r===0&&e===t.length?tr(t):tr(t.slice(r,e))}function Er(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var u,l,_,E;switch(c){case 1:a<128&&(p=a);break;case 2:u=t[o+1],(u&192)===128&&(E=(a&31)<<6|u&63,E>127&&(p=E));break;case 3:u=t[o+1],l=t[o+2],(u&192)===128&&(l&192)===128&&(E=(a&15)<<12|(u&63)<<6|l&63,E>2047&&(E<55296||E>57343)&&(p=E));break;case 4:u=t[o+1],l=t[o+2],_=t[o+3],(u&192)===128&&(l&192)===128&&(_&192)===128&&(E=(a&15)<<18|(u&63)<<12|(l&63)<<6|_&63,E>65535&&E<1114112&&(p=E))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=c}return le(n)}var or=4096;function le(t){var r=t.length;if(r<=or)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=or));return e}function _e(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function he(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function me(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=Ae(t[a]);return o}function Te(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),H(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),H(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),H(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),H(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,c=0;for(this[e]=r&255;++c<n&&(p*=256);)this[e+c]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function Y(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Y(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,c=1,u=0;for(this[e]=r&255;++p<n&&(c*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,c=1,u=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Y(this,r,e,!0),e+4};i.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};function lr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function _r(t,r,e,n,o){return o||lr(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return _r(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return _r(this,r,e,!1,n)};function hr(t,r,e,n,o){return o||lr(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return hr(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return hr(this,r,e,!1,n)};i.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var c=R(r)?r:B(new i(r,o).toString()),u=c.length;for(p=0;p<n-e;++p)this[p+e]=c[p%u]}return this};var fe=/[^+\/0-9A-Za-z-_]/g;function be(t){if(t=de(t).replace(fe,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ae(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Re(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ge(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function mr(t){return Zr(be(t))}function G(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ie(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||Tr(t)||Ne(t))}function Tr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Tr(t.slice(0,0))}function H(t,r,e,n,o){var a,p,c=o*8-n-1,u=(1<<c)-1,l=u>>1,_=-7,E=e?o-1:0,d=e?-1:1,f=t[r+E];for(E+=d,a=f&(1<<-_)-1,f>>=-_,_+=c;_>0;a=a*256+t[r+E],E+=d,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+E],E+=d,_-=8);if(a===0)a=1-l;else{if(a===u)return p?NaN:(f?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(f?-1:1)*p*Math.pow(2,a-n)}function fr(t,r,e,n,o,a){var p,c,u,l=a*8-o-1,_=(1<<l)-1,E=_>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,y=n?1:-1,Ir=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+E>=1?r+=d/u:r+=d*Math.pow(2,1-E),r*u>=2&&(p++,u/=2),p+E>=_?(c=0,p=_):p+E>=1?(c=(r*u-1)*Math.pow(2,o),p=p+E):(c=r*Math.pow(2,E-1)*Math.pow(2,o),p=0));o>=8;t[e+f]=c&255,f+=y,c/=256,o-=8);for(p=p<<o|c,l+=o;l>0;t[e+f]=p&255,f+=y,p/=256,l-=8);t[e+f-y]|=Ir*128}import z from"bignumber.js";z.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function Q(t,r){return U(t,r,"*")}function K(t,r){return!!U(t,r,">=")}function L(t,r){return!!U(t,r,">")}function w(t,r){return!!U(t,r,"==")}function Oe(t,r){return U(t,r,"mod")}function v(t,r){return w(Oe(t,r),0)}function U(t,r,e){switch(t=new z(String(t)),r=new z(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var br=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();var ht={SMALLESTUNIT:s.env.SMALLEST_UNIT},mt={SMALLEST_UNITS:s.env.SMALLEST_UNIT};var dt=`{"theme1":{"value":"${s.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Nt=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Pt=s.env.REACT_APP_API_URL,St=s.env.REACT_APP_SOCKET_URL,vt=s.env.REACT_APP_ALGO_SERVER,Ut=s.env.REACT_APP_ALGO_SERVER_PORT||"",Mt=s.env.REACT_APP_ALGOD_TOKEN||"",kt=s.env.REACT_APP_DISPENSER_LINK,Bt=s.env.REACT_APP_FRONTEND_LINK||"",Ft=s.env.REACT_APP_ALGO_EXPLORER_LINK,Yt=s.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Gt=(s.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Ht=s.env.REACT_APP_USERBACK_ACCESS_TOKEN,Kt=(s.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Wt=.001*10**6,Vt=.002*10**6;var Xt=s.env.REACT_APP_MASTER_APP_ID||"406",qt=s.env.REACT_APP_AGG_APP_ID||"408",zt=Number(s.env.REACT_APP_CODEX_APP_ID||"467960617");var Ce=s.env.REACT_APP_ALGO_NETWORK||"";var Qt=Ce.toLowerCase()==="mainnet"?"mainnet":"testnet";var dr=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(dr||{}),Ar=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(Ar||{}),no={...dr,...Ar};var Ni={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};var Vi=(t,r)=>{gr("base",{address:String(t.baseTokenAddress),chainId:t.baseTokenChainId},r.baseAsset),gr("price",{address:String(t.priceTokenAddress),chainId:t.priceTokenChainId},r.priceAsset),we(t,r)},gr=(t,r,e)=>{m(Number(r.chainId)===Number(e.chainId),`Invalid ${t}TokenChainId, must be ${e.chainId}`),m(e.chainId===1&&String(r.address)===String(e.address)||e.chainId===8&&Number(r.address)===Number(e.address)||br(r.address,e.address),`Invalid ${t}TokenAddress, must be ${e.address}`)},Xi=t=>{m(t.expiredTime>=Math.floor(Date.now()/1e3)+3600,"Expiration time shorter than 1 hour")},we=(t,r)=>{if(m(w(1,t.version),`Invalid order message version. Current is ${1}`),m(w(t.decimalPrice,0)||w(Q(t.decimalPrice,10**18),t.price),"Invalid price or decimalPrice"),m(!isNaN(t.random),"Invalid random, must be a number"),m(t.random>0,"Invalid random, must be greater than 0"),m(t.random<=Number.MAX_SAFE_INTEGER,"Invalid random, must no more than 2^53-1"),m(t.expiredTime>=Math.floor(Date.now()/1e3),"Invalid expiration time"),m(["B","S"].includes(t.orderSide),"Invalid order side"),m(["L","P","I","M"].includes(t.orderType),"Invalid order type"),t.orderType==="M"&&t.orderSide==="S")m(w(t.price,0)&&L(t.amount,0),"Invalid market order amount or price"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid market order amount");else{if(t.orderType==="M"&&t.orderSide==="B"&&w(t.amount,0))throw new Error("Buy murket order by total is not implemented yet");t.orderType==="M"&&t.orderSide==="B"&&L(t.amount,0)?m(L(t.price,0)&&v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid buy market order by amount"):(m(L(t.price,0)&&L(t.amount,0),"Invalid order amount or price is zero"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size)&&v(t.price,r.min_price_increment),"Invalid order amount or price"))}},m=(t,r)=>{if(!t)throw new Error(r)};export{we as assertOrder,Vi as assertOrderData,Xi as assertOrderExpirationAtCreationMoment};
|
|
1
|
+
function $(){throw new Error("setTimeout has not been defined")}function Z(){throw new Error("clearTimeout has not been defined")}var x=$,N=Z;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function j(t){if(x===setTimeout)return setTimeout(t,0);if((x===$||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function xr(t){if(N===clearTimeout)return clearTimeout(t);if((N===Z||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var g=[],P=!1,O,M=-1;function Nr(){!P||!O||(P=!1,O.length?g=O.concat(g):M=-1,g.length&&rr())}function rr(){if(!P){var t=j(Nr);P=!0;for(var r=g.length;r;){for(O=g,g=[];++M<r;)O&&O[M].run();M=-1,r=g.length}O=null,P=!1,xr(t)}}function Or(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];g.push(new er(t,r)),g.length===1&&!P&&j(rr)}function er(t,r){this.fun=t,this.array=r}er.prototype.run=function(){this.fun.apply(null,this.array)};var Cr="browser",Dr="browser",Lr=!0,wr={},yr=[],Sr="",Pr={},vr={},Ur={};function C(){}var Mr=C,kr=C,Br=C,Fr=C,Yr=C,Gr=C,Hr=C;function Kr(t){throw new Error("process.binding is not supported")}function Wr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Xr(){return 0}var S=globalThis.performance||{},qr=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return new Date().getTime()};function zr(t){var r=qr.call(S)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Qr=new Date;function Jr(){var t=new Date,r=t-Qr;return r/1e3}var s={nextTick:Or,title:Cr,browser:Lr,env:wr,argv:yr,version:Sr,versions:Pr,on:Mr,addListener:kr,once:Br,off:Fr,removeListener:Yr,removeAllListeners:Gr,emit:Hr,binding:Kr,cwd:Wr,chdir:Vr,umask:Xr,hrtime:zr,platform:Dr,release:vr,config:Ur,uptime:Jr},J={};Object.keys(J).forEach(t=>{let r=t.split("."),e=s;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=J[t]:e=e[o]||(e[o]={})}});var A=[],b=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,V=!1;function ir(){V=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],b[t.charCodeAt(r)]=r;b[45]=62,b[95]=63}function Zr(t){V||ir();var r,e,n,o,a,p,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,p=new $r(c*3/4-a),n=a>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=b[t.charCodeAt(r)]<<18|b[t.charCodeAt(r+1)]<<12|b[t.charCodeAt(r+2)]<<6|b[t.charCodeAt(r+3)],p[u++]=o>>16&255,p[u++]=o>>8&255,p[u++]=o&255;return a===2?(o=b[t.charCodeAt(r)]<<2|b[t.charCodeAt(r+1)]>>4,p[u++]=o&255):a===1&&(o=b[t.charCodeAt(r)]<<10|b[t.charCodeAt(r+1)]<<4|b[t.charCodeAt(r+2)]>>2,p[u++]=o>>8&255,p[u++]=o&255),p}function jr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function re(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(jr(n));return o.join("")}function tr(t){V||ir();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,c=0,u=e-n;c<u;c+=p)a.push(re(t,c,c+p>u?u:c+p));return n===1?(r=t[e-1],o+=A[r>>2],o+=A[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=A[r>>10],o+=A[r>>4&63],o+=A[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function I(t,r){if(k()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return X(this,t)}return ar(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function ar(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?ne(t,r,e,n):typeof r=="string"?te(t,r,e):oe(t,r)}i.from=function(t,r,e){return ar(null,t,r,e)};i.kMaxLength=k();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function pr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ee(t,r,e,n){return pr(r),r<=0?I(t,r):e!==void 0?typeof n=="string"?I(t,r).fill(e,n):I(t,r).fill(e):I(t,r)}i.alloc=function(t,r,e){return ee(null,t,r,e)};function X(t,r){if(pr(r),t=I(t,r<0?0:q(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return X(null,t)};i.allocUnsafeSlow=function(t){return X(null,t)};function te(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=sr(r,e)|0;t=I(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function W(t,r){var e=r.length<0?0:q(r.length)|0;t=I(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ne(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=W(t,r),t}function oe(t,r){if(R(r)){var e=q(r.length)|0;return t=I(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ie(r.length)?I(t,0):W(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return W(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function q(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return t|0}i.isBuffer=xe;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.isEncoding=function(r){switch(String(r).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}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function sr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return mr(t).length;default:if(n)return B(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=sr;function ie(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return me(this,r,e);case"utf8":case"utf-8":return Er(this,r,e);case"ascii":return _e(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return Ee(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)D(this,e,e+1);return this};i.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};i.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Er(this,0,r):ie.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,c=n-e,u=Math.min(p,c),l=this.slice(o,a),_=r.slice(e,n),E=0;E<u;++E)if(l[E]!==_[E]){p=l[E],c=_[E];break}return p<c?-1:c<p?1:0};function cr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=i.from(r,n)),R(r))return r.length===0?-1:nr(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):nr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function nr(t,r,e,n,o){var a=1,p=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,p/=2,c/=2,e/=2}function u(f,y){return a===1?f[y]:f.readUInt16BE(y*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===c)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+c>p&&(e=p-c),l=e;l>=0;l--){for(var E=!0,d=0;d<c;d++)if(u(t,l+d)!==u(r,d)){E=!1;break}if(E)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return cr(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return cr(this,r,e,n,!1)};function ae(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function pe(t,r,e,n){return G(B(r,t.length-e),t,e,n)}function ur(t,r,e,n){return G(Re(r),t,e,n)}function se(t,r,e,n){return ur(t,r,e,n)}function ce(t,r,e,n){return G(mr(r),t,e,n)}function ue(t,r,e,n){return G(ge(r,t.length-e),t,e,n)}i.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return ae(this,r,e,n);case"utf8":case"utf-8":return pe(this,r,e,n);case"ascii":return ur(this,r,e,n);case"latin1":case"binary":return se(this,r,e,n);case"base64":return ce(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ee(t,r,e){return r===0&&e===t.length?tr(t):tr(t.slice(r,e))}function Er(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var u,l,_,E;switch(c){case 1:a<128&&(p=a);break;case 2:u=t[o+1],(u&192)===128&&(E=(a&31)<<6|u&63,E>127&&(p=E));break;case 3:u=t[o+1],l=t[o+2],(u&192)===128&&(l&192)===128&&(E=(a&15)<<12|(u&63)<<6|l&63,E>2047&&(E<55296||E>57343)&&(p=E));break;case 4:u=t[o+1],l=t[o+2],_=t[o+3],(u&192)===128&&(l&192)===128&&(_&192)===128&&(E=(a&15)<<18|(u&63)<<12|(l&63)<<6|_&63,E>65535&&E<1114112&&(p=E))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=c}return le(n)}var or=4096;function le(t){var r=t.length;if(r<=or)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=or));return e}function _e(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function he(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function me(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=Ae(t[a]);return o}function Te(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),H(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),H(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),H(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),H(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,c=0;for(this[e]=r&255;++c<n&&(p*=256);)this[e+c]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function Y(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Y(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,c=1,u=0;for(this[e]=r&255;++p<n&&(c*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,c=1,u=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Y(this,r,e,!0),e+4};i.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};function lr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function _r(t,r,e,n,o){return o||lr(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return _r(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return _r(this,r,e,!1,n)};function hr(t,r,e,n,o){return o||lr(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return hr(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return hr(this,r,e,!1,n)};i.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var c=R(r)?r:B(new i(r,o).toString()),u=c.length;for(p=0;p<n-e;++p)this[p+e]=c[p%u]}return this};var fe=/[^+\/0-9A-Za-z-_]/g;function be(t){if(t=de(t).replace(fe,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ae(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Re(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ge(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function mr(t){return Zr(be(t))}function G(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ie(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||Tr(t)||Ne(t))}function Tr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Tr(t.slice(0,0))}function H(t,r,e,n,o){var a,p,c=o*8-n-1,u=(1<<c)-1,l=u>>1,_=-7,E=e?o-1:0,d=e?-1:1,f=t[r+E];for(E+=d,a=f&(1<<-_)-1,f>>=-_,_+=c;_>0;a=a*256+t[r+E],E+=d,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+E],E+=d,_-=8);if(a===0)a=1-l;else{if(a===u)return p?NaN:(f?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(f?-1:1)*p*Math.pow(2,a-n)}function fr(t,r,e,n,o,a){var p,c,u,l=a*8-o-1,_=(1<<l)-1,E=_>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,y=n?1:-1,Ir=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+E>=1?r+=d/u:r+=d*Math.pow(2,1-E),r*u>=2&&(p++,u/=2),p+E>=_?(c=0,p=_):p+E>=1?(c=(r*u-1)*Math.pow(2,o),p=p+E):(c=r*Math.pow(2,E-1)*Math.pow(2,o),p=0));o>=8;t[e+f]=c&255,f+=y,c/=256,o-=8);for(p=p<<o|c,l+=o;l>0;t[e+f]=p&255,f+=y,p/=256,l-=8);t[e+f-y]|=Ir*128}import z from"bignumber.js";z.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function Q(t,r){return U(t,r,"*")}function K(t,r){return!!U(t,r,">=")}function L(t,r){return!!U(t,r,">")}function w(t,r){return!!U(t,r,"==")}function Oe(t,r){return U(t,r,"mod")}function v(t,r){return w(Oe(t,r),0)}function U(t,r,e){switch(t=new z(String(t)),r=new z(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var br=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();var ht={SMALLESTUNIT:s.env.SMALLEST_UNIT},mt={SMALLEST_UNITS:s.env.SMALLEST_UNIT};var dt=`{"theme1":{"value":"${s.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Nt=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var St=s.env.REACT_APP_API_URL,Pt=s.env.REACT_APP_SOCKET_URL,vt=s.env.REACT_APP_ALGO_SERVER,Ut=s.env.REACT_APP_ALGO_SERVER_PORT||"",Mt=s.env.REACT_APP_ALGOD_TOKEN||"",kt=s.env.REACT_APP_DISPENSER_LINK,Bt=s.env.REACT_APP_FRONTEND_LINK||"",Ft=s.env.REACT_APP_ALGO_EXPLORER_LINK,Yt=s.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Gt=(s.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Ht=s.env.REACT_APP_USERBACK_ACCESS_TOKEN,Kt=(s.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Wt=.001*10**6,Vt=.002*10**6;var Xt=s.env.REACT_APP_MASTER_APP_ID||"406",qt=s.env.REACT_APP_AGG_APP_ID||"408",zt=Number(s.env.REACT_APP_CODEX_APP_ID||"467960617");var Ce=s.env.REACT_APP_ALGO_NETWORK||"";var Qt=Ce.toLowerCase()==="mainnet"?"mainnet":"testnet";var dr=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(dr||{}),Ar=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(Ar||{}),no={...dr,...Ar};var Ni={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};var Vi=(t,r)=>{gr("base",{address:String(t.baseTokenAddress),chainId:t.baseTokenChainId},r.baseAsset),gr("price",{address:String(t.priceTokenAddress),chainId:t.priceTokenChainId},r.priceAsset),we(t,r)},gr=(t,r,e)=>{m(Number(r.chainId)===Number(e.chainId),`Invalid ${t}TokenChainId, must be ${e.chainId}`),m(e.chainId===1&&String(r.address)===String(e.address)||e.chainId===8&&Number(r.address)===Number(e.address)||br(r.address,e.address),`Invalid ${t}TokenAddress, must be ${e.address}`)},Xi=t=>{m(t.expiredTime>=Math.floor(Date.now()/1e3)+3600,"Expiration time shorter than 1 hour")},we=(t,r)=>{if(m(w(1,t.version),`Invalid order message version. Current is ${1}`),m(w(t.decimalPrice,0)||w(Q(t.decimalPrice,10**18),t.price),"Invalid price or decimalPrice"),m(!isNaN(t.random),"Invalid random, must be a number"),m(t.random>0,"Invalid random, must be greater than 0"),m(t.random<=Number.MAX_SAFE_INTEGER,"Invalid random, must no more than 2^53-1"),m(t.expiredTime>=Math.floor(Date.now()/1e3),"Invalid expiration time"),m(["B","S"].includes(t.orderSide),"Invalid order side"),m(["L","P","I","M"].includes(t.orderType),"Invalid order type"),t.orderType==="M"&&t.orderSide==="S")m(w(t.price,0)&&L(t.amount,0),"Invalid market order amount or price"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid market order amount");else{if(t.orderType==="M"&&t.orderSide==="B"&&w(t.amount,0))throw new Error("Buy murket order by total is not implemented yet");t.orderType==="M"&&t.orderSide==="B"&&L(t.amount,0)?m(L(t.price,0)&&v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid buy market order by amount"):(m(L(t.price,0)&&L(t.amount,0),"Invalid order amount or price is zero"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size)&&v(t.price,r.min_price_increment),"Invalid order amount or price"))}},m=(t,r)=>{if(!t)throw new Error(r)};export{we as assertOrder,Vi as assertOrderData,Xi as assertOrderExpirationAtCreationMoment};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function X(){throw new Error("setTimeout has not been defined")}function q(){throw new Error("clearTimeout has not been defined")}var I=X,x=q;typeof globalThis.setTimeout=="function"&&(I=setTimeout);typeof globalThis.clearTimeout=="function"&&(x=clearTimeout);function Q(t){if(I===setTimeout)return setTimeout(t,0);if((I===X||!I)&&setTimeout)return I=setTimeout,setTimeout(t,0);try{return I(t,0)}catch{try{return I.call(null,t,0)}catch{return I.call(this,t,0)}}}function br(t){if(x===clearTimeout)return clearTimeout(t);if((x===q||!x)&&clearTimeout)return x=clearTimeout,clearTimeout(t);try{return x(t)}catch{try{return x.call(null,t)}catch{return x.call(this,t)}}}var d=[],w=!1,N,P=-1;function Ar(){!w||!N||(w=!1,N.length?d=N.concat(d):P=-1,d.length&&z())}function z(){if(!w){var t=Q(Ar);w=!0;for(var r=d.length;r;){for(N=d,d=[];++P<r;)N&&N[P].run();P=-1,r=d.length}N=null,w=!1,br(t)}}function Rr(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];d.push(new J(t,r)),d.length===1&&!w&&Q(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var dr="browser",gr="browser",Ir=!0,xr={},Nr=[],Or="",Dr={},Cr={},Lr={};function O(){}var wr=O,Pr=O,yr=O,Sr=O,vr=O,Ur=O,Mr=O;function kr(t){throw new Error("process.binding is not supported")}function Br(){return"/"}function Fr(t){throw new Error("process.chdir is not supported")}function Yr(){return 0}var L=globalThis.performance||{},Gr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function Hr(t){var r=Gr.call(L)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Kr=new Date;function Wr(){var t=new Date,r=t-Kr;return r/1e3}var c={nextTick:Rr,title:dr,browser:Ir,env:xr,argv:Nr,version:Or,versions:Dr,on:wr,addListener:Pr,once:yr,off:Sr,removeListener:vr,removeAllListeners:Ur,emit:Mr,binding:kr,cwd:Br,chdir:Fr,umask:Yr,hrtime:Hr,platform:gr,release:Cr,config:Lr,uptime:Wr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=c;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=V[t]:e=e[o]||(e[o]={})}});var A=[],f=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,F=!1;function rr(){F=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],f[t.charCodeAt(r)]=r;f[45]=62,f[95]=63}function Xr(t){F||rr();var r,e,n,o,a,p,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,p=new Vr(s*3/4-a),n=a>0?s-4:s;var E=0;for(r=0,e=0;r<n;r+=4,e+=3)o=f[t.charCodeAt(r)]<<18|f[t.charCodeAt(r+1)]<<12|f[t.charCodeAt(r+2)]<<6|f[t.charCodeAt(r+3)],p[E++]=o>>16&255,p[E++]=o>>8&255,p[E++]=o&255;return a===2?(o=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,p[E++]=o&255):a===1&&(o=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,p[E++]=o>>8&255,p[E++]=o&255),p}function qr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Qr(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(qr(n));return o.join("")}function $(t){F||rr();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,s=0,E=e-n;s<E;s+=p)a.push(Qr(t,s,s+p>E?E:s+p));return n===1?(r=t[e-1],o+=A[r>>2],o+=A[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=A[r>>10],o+=A[r>>4&63],o+=A[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function y(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(y()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Y(this,t)}return er(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function er(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?$r(t,r,e,n):typeof r=="string"?Jr(t,r,e):Zr(t,r)}i.from=function(t,r,e){return er(null,t,r,e)};i.kMaxLength=y();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function tr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function zr(t,r,e,n){return tr(r),r<=0?g(t,r):e!==void 0?typeof n=="string"?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}i.alloc=function(t,r,e){return zr(null,t,r,e)};function Y(t,r){if(tr(r),t=g(t,r<0?0:G(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return Y(null,t)};i.allocUnsafeSlow=function(t){return Y(null,t)};function Jr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=nr(r,e)|0;t=g(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function B(t,r){var e=r.length<0?0:G(r.length)|0;t=g(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $r(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=B(t,r),t}function Zr(t,r){if(R(r)){var e=G(r.length)|0;return t=g(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||fe(r.length)?g(t,0):B(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return B(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return t|0}i.isBuffer=be;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.isEncoding=function(r){switch(String(r).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}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function nr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Er(t).length;default:if(n)return S(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=nr;function jr(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return se(this,r,e);case"utf8":case"utf-8":return ar(this,r,e);case"ascii":return pe(this,r,e);case"latin1":case"binary":return ce(this,r,e);case"base64":return ie(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)D(this,e,e+1);return this};i.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};i.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ar(this,0,r):jr.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,s=n-e,E=Math.min(p,s),l=this.slice(o,a),_=r.slice(e,n),u=0;u<E;++u)if(l[u]!==_[u]){p=l[u],s=_[u];break}return p<s?-1:s<p?1:0};function or(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=i.from(r,n)),R(r))return r.length===0?-1:Z(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,n,o){var a=1,p=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,p/=2,s/=2,e/=2}function E(m,C){return a===1?m[C]:m.readUInt16BE(C*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(E(t,l)===E(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===s)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+s>p&&(e=p-s),l=e;l>=0;l--){for(var u=!0,b=0;b<s;b++)if(E(t,l+b)!==E(r,b)){u=!1;break}if(u)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return or(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return or(this,r,e,n,!1)};function re(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var s=parseInt(r.substr(p*2,2),16);if(isNaN(s))return p;t[e+p]=s}return p}function ee(t,r,e,n){return M(S(r,t.length-e),t,e,n)}function ir(t,r,e,n){return M(Te(r),t,e,n)}function te(t,r,e,n){return ir(t,r,e,n)}function ne(t,r,e,n){return M(Er(r),t,e,n)}function oe(t,r,e,n){return M(me(r,t.length-e),t,e,n)}i.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return re(this,r,e,n);case"utf8":case"utf-8":return ee(this,r,e,n);case"ascii":return ir(this,r,e,n);case"latin1":case"binary":return te(this,r,e,n);case"base64":return ne(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(t,r,e){return r===0&&e===t.length?$(t):$(t.slice(r,e))}function ar(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,s=a>239?4:a>223?3:a>191?2:1;if(o+s<=e){var E,l,_,u;switch(s){case 1:a<128&&(p=a);break;case 2:E=t[o+1],(E&192)===128&&(u=(a&31)<<6|E&63,u>127&&(p=u));break;case 3:E=t[o+1],l=t[o+2],(E&192)===128&&(l&192)===128&&(u=(a&15)<<12|(E&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(p=u));break;case 4:E=t[o+1],l=t[o+2],_=t[o+3],(E&192)===128&&(l&192)===128&&(_&192)===128&&(u=(a&15)<<18|(E&63)<<12|(l&63)<<6|_&63,u>65535&&u<1114112&&(p=u))}}p===null?(p=65533,s=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=s}return ae(n)}var j=4096;function ae(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}function pe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function ce(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function se(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=he(t[a]);return o}function Ee(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),k(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),k(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),k(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),k(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,s=0;for(this[e]=r&255;++s<n&&(p*=256);)this[e+s]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,s=1;for(this[e+p]=r&255;--p>=0&&(s*=256);)this[e+p]=r/s&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):U(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,s=1,E=0;for(this[e]=r&255;++p<n&&(s*=256);)r<0&&E===0&&this[e+p-1]!==0&&(E=1),this[e+p]=(r/s>>0)-E&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,s=1,E=0;for(this[e+p]=r&255;--p>=0&&(s*=256);)r<0&&E===0&&this[e+p+1]!==0&&(E=1),this[e+p]=(r/s>>0)-E&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):U(this,r,e,!0),e+4};i.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};function pr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function cr(t,r,e,n,o){return o||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),lr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return cr(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return cr(this,r,e,!1,n)};function sr(t,r,e,n,o){return o||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),lr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};i.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var s=R(r)?r:S(new i(r,o).toString()),E=s.length;for(p=0;p<n-e;++p)this[p+e]=s[p%E]}return this};var ue=/[^+\/0-9A-Za-z-_]/g;function le(t){if(t=_e(t).replace(ue,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function _e(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function he(t){return t<16?"0"+t.toString(16):t.toString(16)}function S(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Te(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function me(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function Er(t){return Xr(le(t))}function M(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function fe(t){return t!==t}function be(t){return t!=null&&(!!t._isBuffer||ur(t)||Ae(t))}function ur(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ae(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ur(t.slice(0,0))}function k(t,r,e,n,o){var a,p,s=o*8-n-1,E=(1<<s)-1,l=E>>1,_=-7,u=e?o-1:0,b=e?-1:1,m=t[r+u];for(u+=b,a=m&(1<<-_)-1,m>>=-_,_+=s;_>0;a=a*256+t[r+u],u+=b,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+u],u+=b,_-=8);if(a===0)a=1-l;else{if(a===E)return p?NaN:(m?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(m?-1:1)*p*Math.pow(2,a-n)}function lr(t,r,e,n,o,a){var p,s,E,l=a*8-o-1,_=(1<<l)-1,u=_>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:a-1,C=n?1:-1,fr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,p=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(E=Math.pow(2,-p))<1&&(p--,E*=2),p+u>=1?r+=b/E:r+=b*Math.pow(2,1-u),r*E>=2&&(p++,E/=2),p+u>=_?(s=0,p=_):p+u>=1?(s=(r*E-1)*Math.pow(2,o),p=p+u):(s=r*Math.pow(2,u-1)*Math.pow(2,o),p=0));o>=8;t[e+m]=s&255,m+=C,s/=256,o-=8);for(p=p<<o|s,l+=o;l>0;t[e+m]=p&255,m+=C,p/=256,l-=8);t[e+m-C]|=fr*128}import H from"bignumber.js";H.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function _r(t,r){return hr(t,r,"*")}function K(t,r){return hr(t,r,"/")}function hr(t,r,e){switch(t=new H(String(t)),r=new H(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Ge={SMALLESTUNIT:c.env.SMALLEST_UNIT},He={SMALLEST_UNITS:c.env.SMALLEST_UNIT};var Xe=`{"theme1":{"value":"${c.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Ze=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var it=c.env.REACT_APP_API_URL,at=c.env.REACT_APP_SOCKET_URL,pt=c.env.REACT_APP_ALGO_SERVER,ct=c.env.REACT_APP_ALGO_SERVER_PORT||"",st=c.env.REACT_APP_ALGOD_TOKEN||"",Et=c.env.REACT_APP_DISPENSER_LINK,ut=c.env.REACT_APP_FRONTEND_LINK||"",lt=c.env.REACT_APP_ALGO_EXPLORER_LINK,_t=c.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,ht=(c.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Tt=c.env.REACT_APP_USERBACK_ACCESS_TOKEN,mt=(c.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var ft=.001*10**6,bt=.002*10**6;var At=c.env.REACT_APP_MASTER_APP_ID||"406",Rt=c.env.REACT_APP_AGG_APP_ID||"408",dt=Number(c.env.REACT_APP_CODEX_APP_ID||"467960617");var Re=c.env.REACT_APP_ALGO_NETWORK||"";var gt=Re.toLowerCase()==="mainnet"?"mainnet":"testnet";var Tr=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(Tr||{}),mr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(mr||{}),wn={...Tr,...mr};var Zo={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};var Ti=t=>_r(t,10**18),mi=(t,r)=>K(t,10**(18-r)),de=(t,r)=>K(t,10**r),fi=t=>de(t,18);export{mi as defactorPrice,Ti as factorPrice,de as toDecimal,fi as toDecimalPrice};
|
|
1
|
+
function X(){throw new Error("setTimeout has not been defined")}function q(){throw new Error("clearTimeout has not been defined")}var I=X,x=q;typeof globalThis.setTimeout=="function"&&(I=setTimeout);typeof globalThis.clearTimeout=="function"&&(x=clearTimeout);function Q(t){if(I===setTimeout)return setTimeout(t,0);if((I===X||!I)&&setTimeout)return I=setTimeout,setTimeout(t,0);try{return I(t,0)}catch{try{return I.call(null,t,0)}catch{return I.call(this,t,0)}}}function br(t){if(x===clearTimeout)return clearTimeout(t);if((x===q||!x)&&clearTimeout)return x=clearTimeout,clearTimeout(t);try{return x(t)}catch{try{return x.call(null,t)}catch{return x.call(this,t)}}}var d=[],w=!1,N,P=-1;function Ar(){!w||!N||(w=!1,N.length?d=N.concat(d):P=-1,d.length&&z())}function z(){if(!w){var t=Q(Ar);w=!0;for(var r=d.length;r;){for(N=d,d=[];++P<r;)N&&N[P].run();P=-1,r=d.length}N=null,w=!1,br(t)}}function Rr(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];d.push(new J(t,r)),d.length===1&&!w&&Q(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var dr="browser",gr="browser",Ir=!0,xr={},Nr=[],Or="",Dr={},Cr={},Lr={};function O(){}var wr=O,Pr=O,yr=O,Sr=O,vr=O,Ur=O,Mr=O;function kr(t){throw new Error("process.binding is not supported")}function Br(){return"/"}function Fr(t){throw new Error("process.chdir is not supported")}function Yr(){return 0}var L=globalThis.performance||{},Gr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function Hr(t){var r=Gr.call(L)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Kr=new Date;function Wr(){var t=new Date,r=t-Kr;return r/1e3}var c={nextTick:Rr,title:dr,browser:Ir,env:xr,argv:Nr,version:Or,versions:Dr,on:wr,addListener:Pr,once:yr,off:Sr,removeListener:vr,removeAllListeners:Ur,emit:Mr,binding:kr,cwd:Br,chdir:Fr,umask:Yr,hrtime:Hr,platform:gr,release:Cr,config:Lr,uptime:Wr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=c;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=V[t]:e=e[o]||(e[o]={})}});var A=[],f=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,F=!1;function rr(){F=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],f[t.charCodeAt(r)]=r;f[45]=62,f[95]=63}function Xr(t){F||rr();var r,e,n,o,a,p,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,p=new Vr(s*3/4-a),n=a>0?s-4:s;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=f[t.charCodeAt(r)]<<18|f[t.charCodeAt(r+1)]<<12|f[t.charCodeAt(r+2)]<<6|f[t.charCodeAt(r+3)],p[u++]=o>>16&255,p[u++]=o>>8&255,p[u++]=o&255;return a===2?(o=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,p[u++]=o&255):a===1&&(o=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,p[u++]=o>>8&255,p[u++]=o&255),p}function qr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Qr(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(qr(n));return o.join("")}function $(t){F||rr();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,s=0,u=e-n;s<u;s+=p)a.push(Qr(t,s,s+p>u?u:s+p));return n===1?(r=t[e-1],o+=A[r>>2],o+=A[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=A[r>>10],o+=A[r>>4&63],o+=A[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function y(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(y()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Y(this,t)}return er(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function er(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?$r(t,r,e,n):typeof r=="string"?Jr(t,r,e):Zr(t,r)}i.from=function(t,r,e){return er(null,t,r,e)};i.kMaxLength=y();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function tr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function zr(t,r,e,n){return tr(r),r<=0?g(t,r):e!==void 0?typeof n=="string"?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}i.alloc=function(t,r,e){return zr(null,t,r,e)};function Y(t,r){if(tr(r),t=g(t,r<0?0:G(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return Y(null,t)};i.allocUnsafeSlow=function(t){return Y(null,t)};function Jr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=nr(r,e)|0;t=g(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function B(t,r){var e=r.length<0?0:G(r.length)|0;t=g(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $r(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=B(t,r),t}function Zr(t,r){if(R(r)){var e=G(r.length)|0;return t=g(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||fe(r.length)?g(t,0):B(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return B(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return t|0}i.isBuffer=be;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.isEncoding=function(r){switch(String(r).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}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function nr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return S(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=nr;function jr(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return se(this,r,e);case"utf8":case"utf-8":return ar(this,r,e);case"ascii":return pe(this,r,e);case"latin1":case"binary":return ce(this,r,e);case"base64":return ie(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)D(this,e,e+1);return this};i.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};i.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ar(this,0,r):jr.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,s=n-e,u=Math.min(p,s),l=this.slice(o,a),_=r.slice(e,n),E=0;E<u;++E)if(l[E]!==_[E]){p=l[E],s=_[E];break}return p<s?-1:s<p?1:0};function or(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=i.from(r,n)),R(r))return r.length===0?-1:Z(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,n,o){var a=1,p=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,p/=2,s/=2,e/=2}function u(m,C){return a===1?m[C]:m.readUInt16BE(C*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===s)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+s>p&&(e=p-s),l=e;l>=0;l--){for(var E=!0,b=0;b<s;b++)if(u(t,l+b)!==u(r,b)){E=!1;break}if(E)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return or(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return or(this,r,e,n,!1)};function re(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var s=parseInt(r.substr(p*2,2),16);if(isNaN(s))return p;t[e+p]=s}return p}function ee(t,r,e,n){return M(S(r,t.length-e),t,e,n)}function ir(t,r,e,n){return M(Te(r),t,e,n)}function te(t,r,e,n){return ir(t,r,e,n)}function ne(t,r,e,n){return M(ur(r),t,e,n)}function oe(t,r,e,n){return M(me(r,t.length-e),t,e,n)}i.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return re(this,r,e,n);case"utf8":case"utf-8":return ee(this,r,e,n);case"ascii":return ir(this,r,e,n);case"latin1":case"binary":return te(this,r,e,n);case"base64":return ne(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(t,r,e){return r===0&&e===t.length?$(t):$(t.slice(r,e))}function ar(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,s=a>239?4:a>223?3:a>191?2:1;if(o+s<=e){var u,l,_,E;switch(s){case 1:a<128&&(p=a);break;case 2:u=t[o+1],(u&192)===128&&(E=(a&31)<<6|u&63,E>127&&(p=E));break;case 3:u=t[o+1],l=t[o+2],(u&192)===128&&(l&192)===128&&(E=(a&15)<<12|(u&63)<<6|l&63,E>2047&&(E<55296||E>57343)&&(p=E));break;case 4:u=t[o+1],l=t[o+2],_=t[o+3],(u&192)===128&&(l&192)===128&&(_&192)===128&&(E=(a&15)<<18|(u&63)<<12|(l&63)<<6|_&63,E>65535&&E<1114112&&(p=E))}}p===null?(p=65533,s=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=s}return ae(n)}var j=4096;function ae(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}function pe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function ce(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function se(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=he(t[a]);return o}function ue(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),k(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),k(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),k(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),k(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,s=0;for(this[e]=r&255;++s<n&&(p*=256);)this[e+s]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,s=1;for(this[e+p]=r&255;--p>=0&&(s*=256);)this[e+p]=r/s&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):U(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,s=1,u=0;for(this[e]=r&255;++p<n&&(s*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,s=1,u=0;for(this[e+p]=r&255;--p>=0&&(s*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):U(this,r,e,!0),e+4};i.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};function pr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function cr(t,r,e,n,o){return o||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),lr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return cr(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return cr(this,r,e,!1,n)};function sr(t,r,e,n,o){return o||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),lr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};i.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var s=R(r)?r:S(new i(r,o).toString()),u=s.length;for(p=0;p<n-e;++p)this[p+e]=s[p%u]}return this};var Ee=/[^+\/0-9A-Za-z-_]/g;function le(t){if(t=_e(t).replace(Ee,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function _e(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function he(t){return t<16?"0"+t.toString(16):t.toString(16)}function S(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Te(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function me(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function ur(t){return Xr(le(t))}function M(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function fe(t){return t!==t}function be(t){return t!=null&&(!!t._isBuffer||Er(t)||Ae(t))}function Er(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ae(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Er(t.slice(0,0))}function k(t,r,e,n,o){var a,p,s=o*8-n-1,u=(1<<s)-1,l=u>>1,_=-7,E=e?o-1:0,b=e?-1:1,m=t[r+E];for(E+=b,a=m&(1<<-_)-1,m>>=-_,_+=s;_>0;a=a*256+t[r+E],E+=b,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+E],E+=b,_-=8);if(a===0)a=1-l;else{if(a===u)return p?NaN:(m?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(m?-1:1)*p*Math.pow(2,a-n)}function lr(t,r,e,n,o,a){var p,s,u,l=a*8-o-1,_=(1<<l)-1,E=_>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:a-1,C=n?1:-1,fr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,p=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+E>=1?r+=b/u:r+=b*Math.pow(2,1-E),r*u>=2&&(p++,u/=2),p+E>=_?(s=0,p=_):p+E>=1?(s=(r*u-1)*Math.pow(2,o),p=p+E):(s=r*Math.pow(2,E-1)*Math.pow(2,o),p=0));o>=8;t[e+m]=s&255,m+=C,s/=256,o-=8);for(p=p<<o|s,l+=o;l>0;t[e+m]=p&255,m+=C,p/=256,l-=8);t[e+m-C]|=fr*128}import H from"bignumber.js";H.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function _r(t,r){return hr(t,r,"*")}function K(t,r){return hr(t,r,"/")}function hr(t,r,e){switch(t=new H(String(t)),r=new H(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Ge={SMALLESTUNIT:c.env.SMALLEST_UNIT},He={SMALLEST_UNITS:c.env.SMALLEST_UNIT};var Xe=`{"theme1":{"value":"${c.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Ze=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var it=c.env.REACT_APP_API_URL,at=c.env.REACT_APP_SOCKET_URL,pt=c.env.REACT_APP_ALGO_SERVER,ct=c.env.REACT_APP_ALGO_SERVER_PORT||"",st=c.env.REACT_APP_ALGOD_TOKEN||"",ut=c.env.REACT_APP_DISPENSER_LINK,Et=c.env.REACT_APP_FRONTEND_LINK||"",lt=c.env.REACT_APP_ALGO_EXPLORER_LINK,_t=c.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,ht=(c.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Tt=c.env.REACT_APP_USERBACK_ACCESS_TOKEN,mt=(c.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var ft=.001*10**6,bt=.002*10**6;var At=c.env.REACT_APP_MASTER_APP_ID||"406",Rt=c.env.REACT_APP_AGG_APP_ID||"408",dt=Number(c.env.REACT_APP_CODEX_APP_ID||"467960617");var Re=c.env.REACT_APP_ALGO_NETWORK||"";var gt=Re.toLowerCase()==="mainnet"?"mainnet":"testnet";var Tr=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(Tr||{}),mr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(mr||{}),wn={...Tr,...mr};var Zo={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};var Ti=t=>_r(t,10**18),mi=(t,r)=>K(t,10**(18-r)),de=(t,r)=>K(t,10**r),fi=t=>de(t,18);export{mi as defactorPrice,Ti as factorPrice,de as toDecimal,fi as toDecimalPrice};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|