From a107ef71ce6d5269c6dcebb439dafd8a4a79f633 Mon Sep 17 00:00:00 2001 From: Sebastian Pape Date: Mon, 12 Sep 2022 10:46:56 +0200 Subject: [PATCH] v1.3.0 upgrade depay widgets --- dist/widgets.bundle.js | 2 +- package.json | 2 +- readme.txt | 2 +- rollup.build.config.js | 2 +- yarn.lock | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/widgets.bundle.js b/dist/widgets.bundle.js index 44e24a2..14a30c1 100644 --- a/dist/widgets.bundle.js +++ b/dist/widgets.bundle.js @@ -105,7 +105,7 @@ e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<>1,c=-7,h=n?i-1:0,f= * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */var Gx=sk((function(t){!function(){var e="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof Fh&&Fh.versions&&Fh.versions.node?r=ok:i&&(r=self);var o=!r.JS_SHA3_NO_COMMON_JS&&t.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),u=[4,1024,262144,67108864],l=[0,8,16,24],c=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],h=[224,256,384,512],f=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!s||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var m=function(t,e,n){return function(r){return new I(t,e,t).update(r)[n]()}},g=function(t,e,n){return function(r,i){return new I(t,e,i).update(r)[n]()}},y=function(t,e,n){return function(e,r,i,o){return _["cshake"+t].update(e,r,i,o)[n]()}},v=function(t,e,n){return function(e,r,i,o){return _["kmac"+t].update(e,r,i,o)[n]()}},b=function(t,e,n,r){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function N(t,e,n){I.call(this,t,e,n)}I.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,a=this.blocks,u=this.byteCount,c=t.length,h=this.blockCount,f=0,d=this.s;f>2]|=t[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(this.start=i-u,this.block=a[h],i=0;i>=8);n>0;)i.unshift(n),n=255&(t>>=8),++r;return e?i.push(r):i.unshift(r),this.update(i),i.length},I.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var a=0;a=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++a)),i+=4)}return i+=this.encode(8*i),this.update(t),i},I.prototype.bytepad=function(t,e){for(var n=this.encode(e),r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e>4&15]+a[15&t]+a[t>>12&15]+a[t>>8&15]+a[t>>20&15]+a[t>>16&15]+a[t>>28&15]+a[t>>24&15];s%e==0&&(P(n),o=0)}return i&&(t=n[o],u+=a[t>>4&15]+a[15&t],i>1&&(u+=a[t>>12&15]+a[t>>8&15]),i>2&&(u+=a[t>>20&15]+a[t>>16&15])),u},I.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%n==0&&P(r)}return o&&(t=a<<2,e=r[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},N.prototype=new I,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var P=function(t){var e,n,r,i,o,s,a,u,l,h,f,d,p,m,g,y,v,b,w,A,_,E,M,k,x,S,C,T,I,N,P,R,B,O,L,D,j,F,U,z,H,W,q,G,Q,V,Y,J,Z,K,X,$,tt,et,nt,rt,it,ot,st,at,ut,lt,ct;for(r=0;r<48;r+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),n=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=i^(u<<1|l>>>31),n=o^(l<<1|u>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=s^(h<<1|f>>>31),n=a^(f<<1|h>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=u^(d<<1|p>>>31),n=l^(p<<1|d>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=h^(i<<1|o>>>31),n=f^(o<<1|i>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,m=t[0],g=t[1],V=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,W=t[40]<<18|t[41]>>>14,q=t[41]<<18|t[40]>>>14,O=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,N=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,lt=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,D=t[14]<<6|t[15]>>>26,j=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,K=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,Q=t[9]<<27|t[8]>>>5,S=t[18]<<20|t[19]>>>12,C=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=m^~y&b,t[1]=g^~v&w,t[10]=k^~S&T,t[11]=x^~C&I,t[20]=O^~D&F,t[21]=L^~j&U,t[30]=G^~V&J,t[31]=Q^~Y&Z,t[40]=et^~rt&ot,t[41]=nt^~it&st,t[2]=y^~b&A,t[3]=v^~w&_,t[12]=S^~T&N,t[13]=C^~I&P,t[22]=D^~F&z,t[23]=j^~U&H,t[32]=V^~J&K,t[33]=Y^~Z&X,t[42]=rt^~ot&at,t[43]=it^~st&ut,t[4]=b^~A&E,t[5]=w^~_&M,t[14]=T^~N&R,t[15]=I^~P&B,t[24]=F^~z&W,t[25]=U^~H&q,t[34]=J^~K&$,t[35]=Z^~X&tt,t[44]=ot^~at<,t[45]=st^~ut&ct,t[6]=A^~E&m,t[7]=_^~M&g,t[16]=N^~R&k,t[17]=P^~B&x,t[26]=z^~W&O,t[27]=H^~q&L,t[36]=K^~$&G,t[37]=X^~tt&Q,t[46]=at^~lt&et,t[47]=ut^~ct&nt,t[8]=E^~m&y,t[9]=M^~g&v,t[18]=R^~k&S,t[19]=B^~x&C,t[28]=W^~O&D,t[29]=q^~L&j,t[38]=$^~G&V,t[39]=tt^~Q&Y,t[48]=lt^~et&rt,t[49]=ct^~nt&it,t[0]^=c[r],t[1]^=c[r+1]};if(o)t.exports=_;else for(M=0;M>=8;return e}function Zx(t,e,n){let r=0;for(let i=0;ie+1+r&&Yx.throwError("child data too short",yk.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function tS(t,e){if(0===t.length&&Yx.throwError("data too short",yk.errors.BUFFER_OVERRUN,{}),t[e]>=248){const n=t[e]-247;e+1+n>t.length&&Yx.throwError("data short segment too short",yk.errors.BUFFER_OVERRUN,{});const r=Zx(t,e+1,n);return e+1+n+r>t.length&&Yx.throwError("data long segment too short",yk.errors.BUFFER_OVERRUN,{}),$x(t,e,e+1+n,n+r)}if(t[e]>=192){const n=t[e]-192;return e+1+n>t.length&&Yx.throwError("data array too short",yk.errors.BUFFER_OVERRUN,{}),$x(t,e,e+1,n)}if(t[e]>=184){const n=t[e]-183;e+1+n>t.length&&Yx.throwError("data array too short",yk.errors.BUFFER_OVERRUN,{});const r=Zx(t,e+1,n);return e+1+n+r>t.length&&Yx.throwError("data array too short",yk.errors.BUFFER_OVERRUN,{}),{consumed:1+n+r,result:Tk(t.slice(e+1+n,e+1+n+r))}}if(t[e]>=128){const n=t[e]-128;return e+1+n>t.length&&Yx.throwError("data too short",yk.errors.BUFFER_OVERRUN,{}),{consumed:1+n,result:Tk(t.slice(e+1,e+1+n))}}return{consumed:1,result:Tk(t[e])}}function eS(t){const e=Mk(t),n=tS(e,0);return n.consumed!==e.length&&Yx.throwArgumentError("invalid rlp data","data",t),n.result}const nS=new yk("address/5.6.1");function rS(t){Sk(t,20)||nS.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const r=Mk(Vx(n));for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&r[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const iS={};for(let t=0;t<10;t++)iS[String(t)]=String(t);for(let t=0;t<26;t++)iS[String.fromCharCode(65+t)]=String(10+t);const oS=Math.floor(function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}(9007199254740991));function sS(t){let e=null;if("string"!=typeof t&&nS.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=rS(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&nS.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>iS[t])).join("");for(;e.length>=oS;){let t=e.substring(0,oS);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}(t)&&nS.throwArgumentError("bad icap checksum","address",t),n=t.substring(4),e=new Dk(n,36).toString(16);e.length<40;)e="0"+e;e=rS("0x"+e)}else nS.throwArgumentError("invalid address","address",t);var n;return e}function aS(t){let e=null;try{e=sS(t.from)}catch(e){nS.throwArgumentError("missing from address","transaction",t)}return sS(Nk(Vx(Xx([e,xk(Mk(Hk.from(t.nonce).toHexString()))])),12))}class uS extends Hx{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=sS(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return sS(Bk(t.readValue().toHexString(),20))}}class lS extends Hx{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const cS=new yk(yx);function hS(t,e,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let t={};r=e.map((e=>{const r=e.localName;return r||cS.throwError("cannot encode object for signature with missing names",yk.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]&&cS.throwError("cannot encode object for signature with duplicate names",yk.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]=!0,n[r]}))}else cS.throwArgumentError("invalid tuple value","tuple",n);e.length!==r.length&&cS.throwArgumentError("types/value length mismatch","tuple",n);let i=new Wx(t.wordSize),o=new Wx(t.wordSize),s=[];e.forEach(((t,e)=>{let n=r[e];if(t.dynamic){let e=o.length;t.encode(o,n);let r=i.writeUpdatableValue();s.push((t=>{r(t+e)}))}else t.encode(i,n)})),s.forEach((t=>{t(i.length)}));let a=t.appendWriter(i);return a+=t.appendWriter(o),a}function fS(t,e){let n=[],r=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let n=t.readValue(),o=r.subReader(n.toNumber());try{i=e.decode(o)}catch(t){if(t.code===yk.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===yk.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&n.push(i)}));const i=e.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});e.forEach(((t,e)=>{let r=t.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[e];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let t=0;t{throw e}})}return Object.freeze(n)}class dS extends Hx{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;nt._data.length&&cS.throwError("insufficient data length",yk.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let n=[];for(let t=0;t>6==2;r++)t++;return t}return t===xS.OVERRUN?n.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(kS||(kS={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(xS||(xS={}));const CS=Object.freeze({error:function(t,e,n,r,i){return MS.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",n)},ignore:SS,replace:function(t,e,n,r,i){return t===xS.OVERLONG?(r.push(i),0):(r.push(65533),SS(t,e,n))}});function TS(t,e){null==e&&(e=CS.error),t=Mk(t);const n=[];let r=0;for(;r>7==0){n.push(i);continue}let o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){r+=e(128==(192&i)?xS.UNEXPECTED_CONTINUE:xS.BAD_PREFIX,r-1,t,n);continue}o=3,s=65535}if(r-1+o>=t.length){r+=e(xS.OVERRUN,r-1,t,n);continue}let a=i&(1<<8-o-1)-1;for(let i=0;i1114111?r+=e(xS.OUT_OF_RANGE,r-1-o,t,n,a):a>=55296&&a<=57343?r+=e(xS.UTF16_SURROGATE,r-1-o,t,n,a):a<=s?r+=e(xS.OVERLONG,r-1-o,t,n,a):n.push(a))}return n}function IS(t,e=kS.current){e!=kS.current&&(MS.checkNormalize(),t=t.normalize(e));let n=[];for(let e=0;e>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return Mk(n)}function NS(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function PS(t,e){return NS(TS(t,e))}function RS(t,e=kS.current){return TS(IS(t,e))}function BS(t,e){e||(e=function(t){return[parseInt(t,16)]});let n=0,r={};return t.split(",").forEach((t=>{let i=t.split(":");n+=parseInt(i[0],16),r[n]=e(i[1])})),r}function OS(t){let e=0;return t.split(",").map((t=>{let n=t.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:r,h:e}}))}function LS(t,e){let n=0;for(let r=0;r=n&&t<=n+i.h&&(t-n)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-n))continue;return i}}return null}const DS=OS("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),jS="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),FS=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],US=BS("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),zS=BS("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),HS=BS("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let n=0;n{if(jS.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){let e=LS(t,FS);if(e)return[t+e.s];let n=US[t];if(n)return n;let r=zS[t];return r?[t+r[0]]:HS[t]||null}(t);return e||[t]})),e=n.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),e=RS(NS(e),kS.NFKC),e.forEach((t=>{if(LS(t,WS))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(LS(t,DS))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let r=NS(e);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw new Error("invalid hyphen");if(r.length>63)throw new Error("too long");return r}class GS extends mS{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,IS(e))}decode(t){return PS(super.decode(t))}}class QS extends Hx{constructor(t,e){let n=!1;const r=[];t.forEach((t=>{t.dynamic&&(n=!0),r.push(t.type)})),super("tuple","tuple("+r.join(",")+")",e,n),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[r]))})),Object.freeze(t)}encode(t,e){return hS(t,this.coders,e)}decode(t){return t.coerce(this.name,fS(t,this.coders))}}const VS=new yk(yx),YS=new RegExp(/^bytes([0-9]*)$/),JS=new RegExp(/^(u?int)([0-9]*)$/),ZS=new class{constructor(t){ux(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new uS(t.name);case"bool":return new pS(t.name);case"string":return new GS(t.name);case"bytes":return new gS(t.name);case"array":return new dS(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new QS((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new vS(t.name)}let e=t.type.match(JS);if(e){let n=parseInt(e[2]||"256");return(0===n||n>256||n%8!=0)&&VS.throwArgumentError("invalid "+e[1]+" bit length","param",t),new ES(n/8,"int"===e[1],t.name)}if(e=t.type.match(YS),e){let n=parseInt(e[1]);return(0===n||n>32)&&VS.throwArgumentError("invalid bytes length","param",t),new yS(n,t.name)}return VS.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new qx(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new Wx(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(xx.from(t))));return new QS(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&VS.throwError("types/values length mismatch",yk.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const n=t.map((t=>this._getCoder(xx.from(t)))),r=new QS(n,"_"),i=this._getWriter();return r.encode(i,e),i.data}decode(t,e,n){const r=t.map((t=>this._getCoder(xx.from(t))));return new QS(r,"_").decode(this._getReader(Mk(e),n))}};function KS(t){return Vx(IS(t))}const XS="hash/5.6.1",$S=new yk(XS),tC=new Uint8Array(32);tC.fill(0);const eC=new RegExp("^((.*)\\.)?([^.]+)$");function nC(t){"string"!=typeof t&&$S.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,n=tC;for(;e.length;){const r=e.match(eC);null!=r&&""!==r[2]||$S.throwArgumentError("invalid ENS address; missing component","name",t),n=Vx(kk([n,Vx(IS(qS(r[3])))])),e=r[2]||""}return Tk(n)}var rC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const iC=new yk(XS),oC=new Uint8Array(32);oC.fill(0);const sC=Hk.from(-1),aC=Hk.from(0),uC=Hk.from(1),lC=Hk.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),cC=Bk(uC.toHexString(),32),hC=Bk(aC.toHexString(),32),fC={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},dC=["name","version","chainId","verifyingContract","salt"];function pC(t){return function(e){return"string"!=typeof e&&iC.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const mC={name:pC("name"),version:pC("version"),chainId:function(t){try{return Hk.from(t).toString()}catch(t){}return iC.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return sS(t).toLowerCase()}catch(t){}return iC.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=Mk(t);if(32!==e.length)throw new Error("bad length");return Tk(e)}catch(t){}return iC.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function gC(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=""===e[1],r=parseInt(e[2]||"256");(r%8!=0||r>256||e[2]&&e[2]!==String(r))&&iC.throwArgumentError("invalid numeric width","type",t);const i=lC.mask(n?r-1:r),o=n?i.add(uC).mul(sC):aC;return function(e){const n=Hk.from(e);return(n.lt(o)||n.gt(i))&&iC.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),Bk(n.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return(0===n||n>32||e[1]!==String(n))&&iC.throwArgumentError("invalid bytes width","type",t),function(e){return Mk(e).length!==n&&iC.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=Mk(t),n=e.length%32;return n?Pk([e,oC.slice(n)]):Tk(e)}(e)}}}switch(t){case"address":return function(t){return Bk(sS(t),32)};case"bool":return function(t){return t?cC:hC};case"bytes":return function(t){return Vx(t)};case"string":return function(t){return KS(t)}}return null}function yC(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class vC{constructor(t){ux(this,"types",Object.freeze(mx(t))),ux(this,"_encoderCache",{}),ux(this,"_types",{});const e={},n={},r={};Object.keys(t).forEach((t=>{e[t]={},n[t]=[],r[t]={}}));for(const r in t){const i={};t[r].forEach((o=>{i[o.name]&&iC.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===r&&iC.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t),gC(s)||(n[s]||iC.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),n[s].push(r),e[r][s]=!0)}))}const i=Object.keys(n).filter((t=>0===n[t].length));0===i.length?iC.throwArgumentError("missing primary type","types",t):i.length>1&&iC.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),ux(this,"primaryType",i[0]),function i(o,s){s[o]&&iC.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{n[t]&&(i(t,s),Object.keys(s).forEach((e=>{r[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in r){const n=Object.keys(r[e]);n.sort(),this._types[e]=yC(e,t[e])+n.map((e=>yC(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=gC(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],n=this.getEncoder(t),r=parseInt(e[3]);return e=>{r>=0&&e.length!==r&&iC.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(n);return this._types[t]&&(i=i.map(Vx)),Vx(Pk(i))}}const n=this.types[t];if(n){const e=KS(this._types[t]);return t=>{const r=n.map((({name:e,type:n})=>{const r=this.getEncoder(n)(t[e]);return this._types[n]?Vx(r):r}));return r.unshift(e),Pk(r)}}return iC.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||iC.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Vx(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(gC(t))return n(t,e);const r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const t=r[1],i=parseInt(r[3]);return i>=0&&e.length!==i&&iC.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,n)))}const i=this.types[t];return i?i.reduce(((t,{name:r,type:i})=>(t[r]=this._visit(i,e[r],n),t)),{}):iC.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new vC(t)}static getPrimaryType(t){return vC.from(t).primaryType}static hashStruct(t,e,n){return vC.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){const r=fC[n];r||iC.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:r})}return e.sort(((t,e)=>dC.indexOf(t.name)-dC.indexOf(e.name))),vC.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return Pk(["0x1901",vC.hashDomain(t),vC.from(e).hash(n)])}static hash(t,e,n){return Vx(vC.encode(t,e,n))}static resolveNames(t,e,n,r){return rC(this,void 0,void 0,(function*(){t=hx(t);const i={};t.verifyingContract&&!Sk(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=vC.from(e);o.visit(n,((t,e)=>("address"!==t||Sk(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield r(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),n=o.visit(n,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:n}}))}static getPayload(t,e,n){vC.hashDomain(t);const r={},i=[];dC.forEach((e=>{const n=t[e];null!=n&&(r[e]=mC[e](n),i.push({name:e,type:fC[e]}))}));const o=vC.from(e),s=hx(e);return s.EIP712Domain?iC.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(n),{types:s,domain:r,primaryType:o.primaryType,message:o.visit(n,((t,e)=>{if(t.match(/^bytes(\d*)/))return Tk(Mk(e));if(t.match(/^u?int/))return Hk.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&iC.throwArgumentError("invalid string","value",e),e}return iC.throwArgumentError("unsupported type","type",t)}))}}}const bC=new yk(yx);class wC extends gx{}class AC extends gx{}class _C extends gx{}class EC extends gx{static isIndexed(t){return!(!t||!t._isIndexed)}}const MC={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function kC(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return n.error=e,n}class xC{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,ux(this,"fragments",e.map((t=>Cx.from(t))).filter((t=>null!=t))),ux(this,"_abiCoder",lx(new.target,"getAbiCoder")()),ux(this,"functions",{}),ux(this,"errors",{}),ux(this,"events",{}),ux(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void bC.warn("duplicate definition - constructor"):void ux(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let n=t.format();e[n]?bC.warn("duplicate definition - "+n):e[n]=t})),this.deploy||ux(this,"deploy",Rx.from({payable:!1,type:"constructor"})),ux(this,"_isInterface",!0)}format(t){t||(t=Mx.full),t===Mx.sighash&&bC.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===Mx.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return ZS}static getAddress(t){return sS(t)}static getSighash(t){return Nk(KS(t.format()),0,4)}static getEventTopic(t){return KS(t.format())}getFunction(t){if(Sk(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];bC.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===n.length?bC.throwArgumentError("no matching function","name",e):n.length>1&&bC.throwArgumentError("multiple matching functions","name",e),this.functions[n[0]]}const e=this.functions[Bx.fromString(t).format()];return e||bC.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(Sk(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];bC.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===n.length?bC.throwArgumentError("no matching event","name",e):n.length>1&&bC.throwArgumentError("multiple matching events","name",e),this.events[n[0]]}const e=this.events[Tx.fromString(t).format()];return e||bC.throwArgumentError("no matching event","signature",t),e}getError(t){if(Sk(t)){const e=lx(this.constructor,"getSighash");for(const n in this.errors)if(t===e(this.errors[n]))return this.errors[n];bC.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===n.length?bC.throwArgumentError("no matching error","name",e):n.length>1&&bC.throwArgumentError("multiple matching errors","name",e),this.errors[n[0]]}const e=this.errors[Bx.fromString(t).format()];return e||bC.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return lx(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),lx(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const n=Mk(e);return Tk(n.slice(0,4))!==this.getSighash(t)&&bC.throwArgumentError(`data signature does not match error ${t.name}.`,"data",Tk(n)),this._decodeParams(t.inputs,n.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),Tk(kk([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const n=Mk(e);return Tk(n.slice(0,4))!==this.getSighash(t)&&bC.throwArgumentError(`data signature does not match function ${t.name}.`,"data",Tk(n)),this._decodeParams(t.inputs,n.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Tk(kk([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let n=Mk(e),r=null,i="",o=null,s=null,a=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,n)}catch(t){}break;case 4:{const e=Tk(n.slice(0,4)),u=MC[e];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),s=u.name,a=u.signature,u.reason&&(r=o[0]),"Error"===s?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===s&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,n.slice(4)),s=t.name,a=t.format()}catch(t){}break}}return bC.throwError("call revert exception"+i,yk.errors.CALL_EXCEPTION,{method:t.format(),data:Tk(e),errorArgs:o,errorName:s,errorSignature:a,reason:r})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Tk(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&bC.throwError("too many arguments for "+t.format(),yk.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let n=[];t.anonymous||n.push(this.getEventTopic(t));const r=(t,e)=>"string"===t.type?KS(e):"bytes"===t.type?Vx(Tk(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),Bk(Tk(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?n.push(null):"array"===o.baseType||"tuple"===o.baseType?bC.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?n.push(e.map((t=>r(o,t)))):n.push(r(o,e)):null!=e&&bC.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const n=[],r=[],i=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&bC.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const s=e[o];if(t.indexed)if("string"===t.type)n.push(KS(s));else if("bytes"===t.type)n.push(Vx(s));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([t.type],[s]))}else r.push(t),i.push(s)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(t,e,n){if("string"==typeof t&&(t=this.getEvent(t)),null!=n&&!t.anonymous){let e=this.getEventTopic(t);Sk(n[0],32)&&n[0].toLowerCase()===e||bC.throwError("fragment/topic mismatch",yk.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(r.push(xx.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(r.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let s=null!=n?this._abiCoder.decode(r,kk(n)):null,a=this._abiCoder.decode(i,e,!0),u=[],l=0,c=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==s)u[e]=new EC({_isIndexed:!0,hash:null});else if(o[e])u[e]=new EC({_isIndexed:!0,hash:s[c++]});else try{u[e]=s[c++]}catch(t){u[e]=t}else try{u[e]=a[l++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const n=u[e];n instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw kC(`property ${JSON.stringify(t.name)}`,n)}}):u[t.name]=n}}));for(let t=0;t{throw kC(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new AC({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:Hk.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new wC({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=Tk(t);let n=this.getError(e.substring(0,10).toLowerCase());return n?new _C({args:this._abiCoder.decode(n.inputs,"0x"+e.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(t){return!(!t||!t._isInterface)}}var SC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const CC=new yk("abstract-provider/5.6.1");class TC extends gx{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class IC{constructor(){CC.checkAbstract(new.target,IC),ux(this,"_isProvider",!0)}getFeeData(){return SC(this,void 0,void 0,(function*(){const{block:t,gasPrice:e}=yield cx({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let n=null,r=null;return t&&t.baseFeePerGas&&(r=Hk.from("1500000000"),n=t.baseFeePerGas.mul(2).add(r)),{maxFeePerGas:n,maxPriorityFeePerGas:r,gasPrice:e}}))}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}var NC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const PC=new yk("abstract-signer/5.6.2"),RC=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],BC=[yk.errors.INSUFFICIENT_FUNDS,yk.errors.NONCE_EXPIRED,yk.errors.REPLACEMENT_UNDERPRICED];class OC{constructor(){PC.checkAbstract(new.target,OC),ux(this,"_isSigner",!0)}getBalance(t){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return NC(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield cx(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return NC(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield cx(this.checkTransaction(t));return yield this.provider.call(n,e)}))}sendTransaction(t){return NC(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),n=yield this.signTransaction(e);return yield this.provider.sendTransaction(n)}))}getChainId(){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return NC(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===RC.indexOf(e)&&PC.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=hx(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&PC.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return NC(this,void 0,void 0,(function*(){const e=yield cx(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>NC(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&PC.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))),e.to.catch((t=>{})));const n=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!n?0!==e.type&&1!==e.type||!n||PC.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):PC.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(n&&PC.throwError("network does not support EIP-1559",yk.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):PC.throwError("failed to get consistent fee data",yk.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(BC.indexOf(t.code)>=0)throw t;return PC.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yk.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&PC.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield cx(e)}))}_checkProvider(t){this.provider||PC.throwError("missing provider",yk.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class LC extends OC{constructor(t,e){super(),ux(this,"address",t),ux(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{PC.throwError(t,yk.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new LC(this.address,t)}}var DC=sk((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:af.Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function a(t,e,n){var r=s(t,n);return n-1>=e&&(r|=s(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)i=a(t,e,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,l=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;n.words[0]=a;for(var l=1;l>>26,h=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}n.words[l]=0|h,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?m+r:h[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===o?(n>=0&&(t[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,_=0|s[4],E=8191&_,M=_>>>13,k=0|s[5],x=8191&k,S=k>>>13,C=0|s[6],T=8191&C,I=C>>>13,N=0|s[7],P=8191&N,R=N>>>13,B=0|s[8],O=8191&B,L=B>>>13,D=0|s[9],j=8191&D,F=D>>>13,U=0|a[0],z=8191&U,H=U>>>13,W=0|a[1],q=8191&W,G=W>>>13,Q=0|a[2],V=8191&Q,Y=Q>>>13,J=0|a[3],Z=8191&J,K=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,lt=at>>>13,ct=0|a[8],ht=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(l+(r=Math.imul(h,z))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,z)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,H))+Math.imul(m,z)|0,o=Math.imul(m,H);var yt=(l+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,z),i=(i=Math.imul(y,H))+Math.imul(v,z)|0,o=Math.imul(v,H),r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,G)|0;var vt=(l+(r=r+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,V)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,H))+Math.imul(A,z)|0,o=Math.imul(A,H),r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,G)|0,r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Y)|0;var bt=(l+(r=r+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,H))+Math.imul(M,z)|0,o=Math.imul(M,H),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,G)|0,r=r+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,K)|0;var wt=(l+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(x,z),i=(i=Math.imul(x,H))+Math.imul(S,z)|0,o=Math.imul(S,H),r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,G)|0,r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var At=(l+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;l=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(T,z),i=(i=Math.imul(T,H))+Math.imul(I,z)|0,o=Math.imul(I,H),r=r+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,G)|0,r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var _t=(l+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;l=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,H))+Math.imul(R,z)|0,o=Math.imul(R,H),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,G)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,K)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(l+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((o=o+Math.imul(f,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(O,z),i=(i=Math.imul(O,H))+Math.imul(L,z)|0,o=Math.imul(L,H),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,G)|0,r=r+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,Y)|0,r=r+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,K)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,lt)|0;var Mt=(l+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;l=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(j,z),i=(i=Math.imul(j,H))+Math.imul(F,z)|0,o=Math.imul(F,H),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,G)|0,r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,r=r+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,lt)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var kt=(l+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(j,q),i=(i=Math.imul(j,G))+Math.imul(F,q)|0,o=Math.imul(F,G),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,K)|0,r=r+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,lt)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ft)|0;var xt=(l+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;l=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,V),i=(i=Math.imul(j,Y))+Math.imul(F,V)|0,o=Math.imul(F,Y),r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(I,nt)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,lt)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var St=(l+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,Z),i=(i=Math.imul(j,K))+Math.imul(F,Z)|0,o=Math.imul(F,K),r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(P,nt)|0,i=(i=i+Math.imul(P,rt)|0)+Math.imul(R,nt)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,lt)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(l+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,$),i=(i=Math.imul(j,tt))+Math.imul(F,$)|0,o=Math.imul(F,tt),r=r+Math.imul(O,nt)|0,i=(i=i+Math.imul(O,rt)|0)+Math.imul(L,nt)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,lt)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,ft)|0;var Tt=(l+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(M,pt)|0))<<13)|0;l=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,nt),i=(i=Math.imul(j,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,lt)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var It=(l+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(S,pt)|0))<<13)|0;l=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,ot),i=(i=Math.imul(j,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),r=r+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,lt)|0,r=r+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var Nt=(l+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;l=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(j,ut),i=(i=Math.imul(j,lt))+Math.imul(F,ut)|0,o=Math.imul(F,lt),r=r+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ft)|0;var Pt=(l+(r=r+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(R,pt)|0))<<13)|0;l=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(j,ht),i=(i=Math.imul(j,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(l+(r=r+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(L,pt)|0))<<13)|0;l=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Bt=(l+(r=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(F,pt)|0))<<13)|0;return l=((o=Math.imul(F,mt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=At,u[6]=_t,u[7]=Et,u[8]=Mt,u[9]=kt,u[10]=xt,u[11]=St,u[12]=Ct,u[13]=Tt,u[14]=It,u[15]=Nt,u[16]=Pt,u[17]=Rt,u[18]=Bt,0!==l&&(u[19]=l,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return g(t,e,n)}Math.imul||(m=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?p(this,t,e):n<1024?g(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,s=0|o.words[o.length-1];0!=(n=26-this._countBits(s))&&(o=o.ushln(n),r.iushln(n),s=0|o.words[o.length-1]);var a,u=r.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var l=0;l=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=f)}return a&&a._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a),s.isub(u)):(r.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);n(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;r--){for(var l=e.words[r],c=u-1;c>=0;c--){var h=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===r&&0===c)&&(o=this.mul(o,n[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},r(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,ok)})),jC=FC;function FC(t,e){if(!t)throw new Error(e||"Assertion failed")}FC.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var UC=sk((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}}));function zC(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}var HC=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,n[r++]=63&o|128):zC(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}var GC=function(t,e){for(var n="",r=0;r>>0}return o},JC=function(t,e){for(var n=new Array(4*t.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},ZC=function(t,e){return t>>>e|t<<32-e},KC=function(t,e){return t<>>32-e},XC=function(t,e){return t+e>>>0},$C=function(t,e,n){return t+e+n>>>0},tT=function(t,e,n,r){return t+e+n+r>>>0},eT=function(t,e,n,r,i){return t+e+n+r+i>>>0},nT=function(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,s=(o>>0,t[e+1]=o},rT=function(t,e,n,r){return(e+r>>>0>>0},iT=function(t,e,n,r){return e+r>>>0},oT=function(t,e,n,r,i,o,s,a){var u=0,l=e;return u+=(l=l+r>>>0)>>0)>>0)>>0},sT=function(t,e,n,r,i,o,s,a){return e+r+o+a>>>0},aT=function(t,e,n,r,i,o,s,a,u,l){var c=0,h=e;return c+=(h=h+r>>>0)>>0)>>0)>>0)>>0},uT=function(t,e,n,r,i,o,s,a,u,l){return e+r+o+a+l>>>0},lT=function(t,e,n){return(e<<32-n|t>>>n)>>>0},cT=function(t,e,n){return(t<<32-n|e>>>n)>>>0},hT=function(t,e,n){return t>>>n},fT=function(t,e,n){return(t<<32-n|e>>>n)>>>0},dT={inherits:sk((function(t){try{var e=Wp;if("function"!=typeof e.inherits)throw"";t.exports=e.inherits}catch(e){t.exports=UC}})),toArray:HC,toHex:WC,htonl:qC,toHex32:GC,zero2:QC,zero8:VC,join32:YC,split32:JC,rotr32:ZC,rotl32:KC,sum32:XC,sum32_3:$C,sum32_4:tT,sum32_5:eT,sum64:nT,sum64_hi:rT,sum64_lo:iT,sum64_4_hi:oT,sum64_4_lo:sT,sum64_5_hi:aT,sum64_5_lo:uT,rotr64_hi:lT,rotr64_lo:cT,shr64_hi:hT,shr64_lo:fT};function pT(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var mT=pT;pT.prototype.update=function(t,e){if(t=dT.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=dT.join32(t,0,t.length-n,this.endian);for(var r=0;r>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o>>3},kT=function(t){return yT(t,17)^yT(t,19)^t>>>10},xT={ft_1:vT,ch32:bT,maj32:wT,p32:AT,s0_256:_T,s1_256:ET,g0_256:MT,g1_256:kT},ST=dT.rotl32,CT=dT.sum32,TT=dT.sum32_5,IT=xT.ft_1,NT=gT.BlockHash,PT=[1518500249,1859775393,2400959708,3395469782];function RT(){if(!(this instanceof RT))return new RT;NT.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}dT.inherits(RT,NT);var BT=RT;RT.blockSize=512,RT.outSize=160,RT.hmacStrength=80,RT.padLength=64,RT.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;rthis.blockSize&&(t=(new this.Hash).update(t).digest()),jC(t.length<=this.blockSize);for(var e=t.length;e>8,s=255&i;o?n.push(o,s):n.push(s)}return n},n.zero2=r,n.toHex=i,n.encode=function(t,e){return"hex"===e?i(t):t}})),JI=GI((function(t,e){var n=e;n.assert=QI,n.toArray=YI.toArray,n.zero2=YI.zero2,n.toHex=YI.toHex,n.encode=YI.encode,n.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,r[s]=a,o.iushrn(1)}return r},n.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,l=e.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),s=0==(1&u)?0:3!=(r=t.andln(7)+i&7)&&5!==r||2!==l?u:-u,n[0].push(s),a=0==(1&l)?0:3!=(r=e.andln(7)+o&7)&&5!==r||2!==u?l:-l,n[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},n.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new DC(t,"hex","le")}})),ZI=JI.getNAF,KI=JI.getJSF,XI=JI.assert;function $I(t,e){this.type=t,this.p=new DC(e.p,16),this.red=e.prime?DC.red(e.prime):DC.mont(this.p),this.zero=new DC(0).toRed(this.red),this.one=new DC(1).toRed(this.red),this.two=new DC(2).toRed(this.red),this.n=e.n&&new DC(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var tN=$I;function eN(t,e){this.curve=t,this.type=e,this.precomputed=null}$I.prototype.point=function(){throw new Error("Not implemented")},$I.prototype.validate=function(){throw new Error("Not implemented")},$I.prototype._fixedNafMul=function(t,e){XI(t.precomputed);var n=t._getDoubles(),r=ZI(e,1,this._bitLength),i=(1<=o;u--)s=(s<<1)+r[u];a.push(s)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var l=o[a];XI(0!==l),s="affine"===t.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},$I.prototype._wnafMulAdd=function(t,e,n,r,i){var o,s,a,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,h=0;for(o=0;o=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=KI(n[d],n[p]);for(h=Math.max(y[0].length,h),c[d]=new Array(h),c[p]=new Array(h),s=0;s=0;o--){for(var _=0;o>=0;){var E=!0;for(s=0;s=0&&_++,w=w.dblp(_),o<0)break;for(s=0;s0?a=l[s][M-1>>1]:M<0&&(a=l[s][-M-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},eN.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(o=e,s=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:r,b:i},{a:o,b:s}]},iN.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],i=r.b.mul(t).divRound(this.n),o=n.b.neg().mul(t).divRound(this.n),s=i.mul(n.a),a=o.mul(r.a),u=i.mul(n.b),l=o.mul(r.b);return{k1:t.sub(s).sub(a),k2:u.add(l).neg()}},iN.prototype.pointFromX=function(t,e){(t=new DC(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},iN.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},iN.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},sN.prototype.isInfinity=function(){return this.inf},sN.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},sN.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),r=t.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},sN.prototype.getX=function(){return this.x.fromRed()},sN.prototype.getY=function(){return this.y.fromRed()},sN.prototype.mul=function(t){return t=new DC(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},sN.prototype.mulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},sN.prototype.jmulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},sN.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},sN.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return e},sN.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},nN(aN,tN.BasePoint),iN.prototype.jpoint=function(t,e,n){return new aN(this,t,e,n)},aN.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},aN.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},aN.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),i=t.x.redMul(n),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(n.redMul(this.z)),a=r.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),c=l.redMul(a),h=r.redMul(l),f=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},aN.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=n.redSub(r),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),c=n.redMul(u),h=a.redSqr().redIAdd(l).redISub(c).redISub(c),f=a.redMul(c.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(s);return this.curve.jpoint(h,f,d)},aN.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},aN.prototype.inspect=function(){return this.isInfinity()?"":""},aN.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var uN=GI((function(t,e){var n=e;n.base=tN,n.short=oN,n.mont=null,n.edwards=null})),lN=GI((function(t,e){var n,r=e,i=JI.assert;function o(t){"short"===t.type?this.curve=new uN.short(t):"edwards"===t.type?this.curve=new uN.edwards(t):this.curve=new uN.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var n=new o(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:qI.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:qI.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:qI.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:qI.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:qI.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:qI.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:qI.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(t){n=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:qI.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function cN(t){if(!(this instanceof cN))return new cN(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=YI.toArray(t.entropy,t.entropyEnc||"hex"),n=YI.toArray(t.nonce,t.nonceEnc||"hex"),r=YI.toArray(t.pers,t.persEnc||"hex");QI(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}var hN=cN;cN.prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},cN.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=YI.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var mN=JI.assert;function gN(t,e){if(t instanceof gN)return t;this._importDER(t,e)||(mN(t.r&&t.s,"Signature without r or s"),this.r=new DC(t.r,16),this.s=new DC(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var yN=gN;function vN(){this.place=0}function bN(t,e){var n=t[e.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function wN(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}gN.prototype._importDER=function(t,e){t=JI.toArray(t,e);var n=new vN;if(48!==t[n.place++])return!1;var r=bN(t,n);if(!1===r)return!1;if(r+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var i=bN(t,n);if(!1===i)return!1;var o=t.slice(n.place,i+n.place);if(n.place+=i,2!==t[n.place++])return!1;var s=bN(t,n);if(!1===s)return!1;if(t.length!==s+n.place)return!1;var a=t.slice(n.place,s+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new DC(o),this.s=new DC(a),this.recoveryParam=null,!0},gN.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=wN(e),n=wN(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];AN(r,e.length),(r=r.concat(e)).push(2),AN(r,n.length);var i=r.concat(n),o=[48];return AN(o,i.length),o=o.concat(i),JI.encode(o,t)};var _N=function(){throw new Error("unsupported")},EN=JI.assert;function MN(t){if(!(this instanceof MN))return new MN(t);"string"==typeof t&&(EN(Object.prototype.hasOwnProperty.call(lN,t),"Unknown curve "+t),t=lN[t]),t instanceof lN.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var kN=MN;MN.prototype.keyPair=function(t){return new pN(this,t)},MN.prototype.keyFromPrivate=function(t,e){return pN.fromPrivate(this,t,e)},MN.prototype.keyFromPublic=function(t,e){return pN.fromPublic(this,t,e)},MN.prototype.genKeyPair=function(t){t||(t={});for(var e=new hN({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||_N(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new DC(2));;){var i=new DC(e.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},MN.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},MN.prototype.sign=function(t,e,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new DC(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),s=t.toArray("be",i),a=new hN({hash:this.hash,entropy:o,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new DC(1)),l=0;;l++){var c=r.k?r.k(l):new DC(a.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(u)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var f=h.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return r.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new yN({r:d,s:p,recoveryParam:m})}}}}}},MN.prototype.verify=function(t,e,n,r){t=this._truncateToN(new DC(t,16)),n=this.keyFromPublic(n,r);var i=(e=new yN(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),u=a.mul(t).umod(this.n),l=a.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,n.getPublic(),l)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,n.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},MN.prototype.recoverPubKey=function(t,e,n,r){EN((3&n)===n,"The recovery param is more than two bits"),e=new yN(e,r);var i=this.n,o=new DC(t),s=e.r,a=e.s,u=1&n,l=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var c=e.r.invm(i),h=i.sub(o).mul(c).umod(i),f=a.mul(c).umod(i);return this.g.mulAdd(h,s,f)},MN.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new yN(e,r)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var xN=GI((function(t,e){var n=e;n.version="6.5.4",n.utils=JI,n.rand=function(){throw new Error("unsupported")},n.curve=uN,n.curves=lN,n.ec=kN,n.eddsa=null})).ec;const SN=new yk("signing-key/5.6.2");let CN=null;function TN(){return CN||(CN=new xN("secp256k1")),CN}class IN{constructor(t){ux(this,"curve","secp256k1"),ux(this,"privateKey",Tk(t)),32!==Ik(this.privateKey)&&SN.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=TN().keyFromPrivate(Mk(this.privateKey));ux(this,"publicKey","0x"+e.getPublic(!1,"hex")),ux(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),ux(this,"_isSigningKey",!0)}_addPoint(t){const e=TN().keyFromPublic(Mk(this.publicKey)),n=TN().keyFromPublic(Mk(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}signDigest(t){const e=TN().keyFromPrivate(Mk(this.privateKey)),n=Mk(t);32!==n.length&&SN.throwArgumentError("bad digest length","digest",t);const r=e.sign(n,{canonical:!0});return Ok({recoveryParam:r.recoveryParam,r:Bk("0x"+r.r.toString(16),32),s:Bk("0x"+r.s.toString(16),32)})}computeSharedSecret(t){const e=TN().keyFromPrivate(Mk(this.privateKey)),n=TN().keyFromPublic(Mk(NN(t)));return Bk("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function NN(t,e){const n=Mk(t);if(32===n.length){const t=new IN(n);return e?"0x"+TN().keyFromPrivate(n).getPublic(!0,"hex"):t.publicKey}return 33===n.length?e?Tk(n):"0x"+TN().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?e?"0x"+TN().keyFromPublic(n).getPublic(!0,"hex"):Tk(n):SN.throwArgumentError("invalid public or private key","key","[REDACTED]")}const PN=new yk("transactions/5.6.2");var RN;function BN(t){return"0x"===t?null:sS(t)}function ON(t){return"0x"===t?wS:Hk.from(t)}function LN(t,e){return function(t){return sS(Nk(Vx(Nk(NN(t),1)),12))}(function(t,e){const n=Ok(e),r={r:Mk(n.r),s:Mk(n.s)};return"0x"+TN().recoverPubKey(Mk(t),r,n.recoveryParam).encode("hex",!1)}(Mk(t),e))}function DN(t,e){const n=xk(Hk.from(t).toHexString());return n.length>32&&PN.throwArgumentError("invalid length for "+e,"transaction:"+e,t),n}function jN(t,e){return{address:sS(t),storageKeys:(e||[]).map(((e,n)=>(32!==Ik(e)&&PN.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,e),e.toLowerCase())))}}function FN(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&PN.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),jN(t[0],t[1])):jN(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const n=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return jN(e,Object.keys(n).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function UN(t){return FN(t).map((t=>[t.address,t.storageKeys]))}function zN(t,e){if(null!=t.gasPrice){const e=Hk.from(t.gasPrice),n=Hk.from(t.maxFeePerGas||0);e.eq(n)||PN.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:n})}const n=[DN(t.chainId||0,"chainId"),DN(t.nonce||0,"nonce"),DN(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),DN(t.maxFeePerGas||0,"maxFeePerGas"),DN(t.gasLimit||0,"gasLimit"),null!=t.to?sS(t.to):"0x",DN(t.value||0,"value"),t.data||"0x",UN(t.accessList||[])];if(e){const t=Ok(e);n.push(DN(t.recoveryParam,"recoveryParam")),n.push(xk(t.r)),n.push(xk(t.s))}return Pk(["0x02",Xx(n)])}function HN(t,e){const n=[DN(t.chainId||0,"chainId"),DN(t.nonce||0,"nonce"),DN(t.gasPrice||0,"gasPrice"),DN(t.gasLimit||0,"gasLimit"),null!=t.to?sS(t.to):"0x",DN(t.value||0,"value"),t.data||"0x",UN(t.accessList||[])];if(e){const t=Ok(e);n.push(DN(t.recoveryParam,"recoveryParam")),n.push(xk(t.r)),n.push(xk(t.s))}return Pk(["0x01",Xx(n)])}function WN(t,e,n){try{const n=ON(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){PN.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Bk(e[1],32),t.s=Bk(e[2],32);try{const e=Vx(n(t));t.from=LN(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function qN(t){const e=Mk(t);if(e[0]>127)return function(t){const e=eS(t);9!==e.length&&6!==e.length&&PN.throwArgumentError("invalid raw transaction","rawTransaction",t);const n={nonce:ON(e[0]).toNumber(),gasPrice:ON(e[1]),gasLimit:ON(e[2]),to:BN(e[3]),value:ON(e[4]),data:e[5],chainId:0};if(6===e.length)return n;try{n.v=Hk.from(e[6]).toNumber()}catch(t){return n}if(n.r=Bk(e[7],32),n.s=Bk(e[8],32),Hk.from(n.r).isZero()&&Hk.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const i=e.slice(0,6);0!==n.chainId&&(i.push(Tk(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);const o=Vx(Xx(i));try{n.from=LN(o,{r:Tk(n.r),s:Tk(n.s),recoveryParam:r})}catch(t){}n.hash=Vx(t)}return n.type=null,n}(e);switch(e[0]){case 1:return function(t){const e=eS(t.slice(1));8!==e.length&&11!==e.length&&PN.throwArgumentError("invalid component count for transaction type: 1","payload",Tk(t));const n={type:1,chainId:ON(e[0]).toNumber(),nonce:ON(e[1]).toNumber(),gasPrice:ON(e[2]),gasLimit:ON(e[3]),to:BN(e[4]),value:ON(e[5]),data:e[6],accessList:FN(e[7])};return 8===e.length||(n.hash=Vx(t),WN(n,e.slice(8),HN)),n}(e);case 2:return function(t){const e=eS(t.slice(1));9!==e.length&&12!==e.length&&PN.throwArgumentError("invalid component count for transaction type: 2","payload",Tk(t));const n=ON(e[2]),r=ON(e[3]),i={type:2,chainId:ON(e[0]).toNumber(),nonce:ON(e[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:ON(e[4]),to:BN(e[5]),value:ON(e[6]),data:e[7],accessList:FN(e[8])};return 9===e.length||(i.hash=Vx(t),WN(i,e.slice(9),zN)),i}(e)}return PN.throwError(`unsupported transaction type: ${e[0]}`,yk.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(RN||(RN={}));var GN=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const QN=new yk("contracts/5.6.2");function VN(t,e){return GN(this,void 0,void 0,(function*(){const n=yield e;"string"!=typeof n&&QN.throwArgumentError("invalid address or ENS name","name",n);try{return sS(n)}catch(t){}t||QN.throwError("a provider or signer is needed to resolve ENS names",yk.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield t.resolveName(n);return null==r&&QN.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function YN(t,e,n){return GN(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>YN(t,Array.isArray(e)?e[r]:e[n.name],n)))):"address"===n.type?yield VN(t,e):"tuple"===n.type?yield YN(t,e,n.components):"array"===n.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>YN(t,e,n.arrayChildren)))):Promise.reject(QN.makeError("invalid value for array",yk.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e}))}function JN(t,e,n){return GN(this,void 0,void 0,(function*(){let r={};n.length===e.inputs.length+1&&"object"==typeof n[n.length-1]&&(r=hx(n.pop())),QN.checkArgumentCount(n.length,e.inputs.length,"passed to contract"),t.signer?r.from?r.from=cx({override:VN(t.signer,r.from),signer:t.signer.getAddress()}).then((t=>GN(this,void 0,void 0,(function*(){return sS(t.signer)!==t.override&&QN.throwError("Contract with a Signer cannot override from",yk.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):r.from=t.signer.getAddress():r.from&&(r.from=VN(t.provider,r.from));const i=yield cx({args:YN(t.signer||t.provider,n,e.inputs),address:t.resolvedAddress,overrides:cx(r)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},a=i.overrides;if(null!=a.nonce&&(s.nonce=Hk.from(a.nonce).toNumber()),null!=a.gasLimit&&(s.gasLimit=Hk.from(a.gasLimit)),null!=a.gasPrice&&(s.gasPrice=Hk.from(a.gasPrice)),null!=a.maxFeePerGas&&(s.maxFeePerGas=Hk.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=Hk.from(a.maxPriorityFeePerGas)),null!=a.from&&(s.from=a.from),null!=a.type&&(s.type=a.type),null!=a.accessList&&(s.accessList=FN(a.accessList)),null==s.gasLimit&&null!=e.gas){let t=21e3;const n=Mk(o);for(let e=0;enull!=r[t]));return u.length&&QN.throwError(`cannot override ${u.map((t=>JSON.stringify(t))).join(",")}`,yk.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),s}))}function ZN(t,e,n){const r=t.signer||t.provider;return function(...i){return GN(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=hx(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const s=yield JN(t,e,i),a=yield r.call(s,o);try{let r=t.interface.decodeFunctionResult(e,a);return n&&1===e.outputs.length&&(r=r[0]),r}catch(e){throw e.code===yk.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=s),e}}))}}function KN(t,e){return function(...n){return GN(this,void 0,void 0,(function*(){t.signer||QN.throwError("sending a transaction requires a signer",yk.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const r=yield JN(t,e,n),i=yield t.signer.sendTransaction(r);return function(t,e){const n=e.wait.bind(e);e.wait=e=>n(e).then((e=>(e.events=e.logs.map((n=>{let r=mx(n),i=null;try{i=t.interface.parseLog(n)}catch(t){}return i&&(r.args=i.args,r.decode=(e,n)=>t.interface.decodeEventLog(i.eventFragment,e,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>t.provider,r.getBlock=()=>t.provider.getBlock(e.blockHash),r.getTransaction=()=>t.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(e),r})),e)))}(t,i),i}))}}function XN(t,e,n){return e.constant?ZN(t,e,n):KN(t,e)}function $N(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class tP{constructor(t,e){ux(this,"tag",t),ux(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((n=>!(!e&&n.listener===t&&(e=!0,1))))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const n=t.slice();return setTimeout((()=>{e.listener.apply(this,n)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class eP extends tP{constructor(){super("error",null)}}class nP extends tP{constructor(t,e,n,r){const i={address:t};let o=e.getEventTopic(n);r?(o!==r[0]&&QN.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super($N(i),i),ux(this,"address",t),ux(this,"interface",e),ux(this,"fragment",n)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=function(t){const e=[],n=function(t,r){if(Array.isArray(r))for(let i in r){const o=t.slice();o.push(i);try{n(o,r[i])}catch(t){e.push({path:o,error:t})}}};return n([],t),e}(t.args);if(e.length)throw e[0].error;const n=(t.args||[]).slice();return n.push(t),n}}class rP extends tP{constructor(t,e){super("*",{address:t}),ux(this,"address",t),ux(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,n)=>this.interface.decodeEventLog(e.eventFragment,t,n),t.args=e.args}catch(t){}}}class iP extends class{constructor(t,e,n){ux(this,"interface",lx(new.target,"getInterface")(e)),null==n?(ux(this,"provider",null),ux(this,"signer",null)):OC.isSigner(n)?(ux(this,"provider",n.provider||null),ux(this,"signer",n)):IC.isProvider(n)?(ux(this,"provider",n),ux(this,"signer",null)):QN.throwArgumentError("invalid signer or provider","signerOrProvider",n),ux(this,"callStatic",{}),ux(this,"estimateGas",{}),ux(this,"functions",{}),ux(this,"populateTransaction",{}),ux(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const n=this.interface.events[e];ux(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,t)}))),t[n.name]||(t[n.name]=[]),t[n.name].push(e)})),Object.keys(t).forEach((e=>{const n=t[e];1===n.length?ux(this.filters,e,this.filters[n[0]]):QN.warn(`Duplicate definition of ${e} (${n.join(", ")})`)}))}if(ux(this,"_runningEvents",{}),ux(this,"_wrappedEmits",{}),null==t&&QN.throwArgumentError("invalid contract address or ENS name","addressOrName",t),ux(this,"address",t),this.provider)ux(this,"resolvedAddress",VN(this.provider,t));else try{ux(this,"resolvedAddress",Promise.resolve(sS(t)))}catch(t){QN.throwError("provider is required to use ENS name as contract address",yk.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((t=>{}));const r={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])QN.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const n=e.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(t)}null==this[t]&&ux(this,t,XN(this,e,!0)),null==this.functions[t]&&ux(this.functions,t,XN(this,e,!1)),null==this.callStatic[t]&&ux(this.callStatic,t,ZN(this,e,!0)),null==this.populateTransaction[t]&&ux(this.populateTransaction,t,function(t,e){return function(...n){return JN(t,e,n)}}(this,e)),null==this.estimateGas[t]&&ux(this.estimateGas,t,function(t,e){const n=t.signer||t.provider;return function(...r){return GN(this,void 0,void 0,(function*(){n||QN.throwError("estimate require a provider or signer",yk.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield JN(t,e,r);return yield n.estimateGas(i)}))}}(this,e))}})),Object.keys(r).forEach((t=>{const e=r[t];if(e.length>1)return;t=t.substring(1);const n=e[0];try{null==this[t]&&ux(this,t,this[n])}catch(t){}null==this.functions[t]&&ux(this.functions,t,this.functions[n]),null==this.callStatic[t]&&ux(this.callStatic,t,this.callStatic[n]),null==this.populateTransaction[t]&&ux(this.populateTransaction,t,this.populateTransaction[n]),null==this.estimateGas[t]&&ux(this.estimateGas,t,this.estimateGas[n])}))}static getContractAddress(t){return aS(t)}static getInterface(t){return xC.isInterface(t)?t:new xC(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&QN.throwError("contract not deployed",yk.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||QN.throwError("sending a transactions require a signer",yk.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=hx(t||{});return["from","to"].forEach((function(t){null!=e[t]&&QN.throwError("cannot override "+t,yk.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new LC(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&ux(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return EC.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new eP);if("event"===t)return this._normalizeRunningEvent(new tP("event",null));if("*"===t)return this._normalizeRunningEvent(new rP(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new nP(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const n=this.interface.getEvent(e);return this._normalizeRunningEvent(new nP(this.address,this.interface,n,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new tP($N(e),e))}return this._normalizeRunningEvent(new rP(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,n){const r=mx(e);return r.removeListener=()=>{n&&(t.removeListener(n),this._checkRunningEvents(t))},r.getBlock=()=>this.provider.getBlock(e.blockHash),r.getTransaction=()=>this.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(r),r}_addEventListener(t,e,n){if(this.provider||QN.throwError("events require a provider or a signer with a provider",yk.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,n),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const n=n=>{let r=this._wrapEvent(t,n,e);if(null==r.decodeError)try{const e=t.getEmit(r);this.emit(t.filter,...e)}catch(t){r.decodeError=t.error}null!=t.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[t.tag]=n,null!=t.filter&&this.provider.on(t.filter,n)}}queryFilter(t,e,n){const r=this._getRunningEvent(t),i=hx(r.filter);return"string"==typeof e&&Sk(e,32)?(null!=n&&QN.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((t=>t.map((t=>this._wrapEvent(r,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const n=this._getRunningEvent(t),r=n.run(e)>0;return this._checkRunningEvents(n),r}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const n=this._getRunningEvent(t);return n.removeListener(e),this._checkRunningEvents(n),this}removeListener(t,e){return this.off(t,e)}}{}class oP{constructor(t){ux(this,"alphabet",t),ux(this,"base",t.length),ux(this,"_alphabetMap",{}),ux(this,"_leader",t.charAt(0));for(let e=0;e0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let t=0;0===e[t]&&t=0;--t)r+=this.alphabet[n[t]];return r}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let n=0;n>=8;for(;i>0;)e.push(255&i),i>>=8}for(let n=0;t[n]===this._leader&&n{o[e.toLowerCase()]=t})):r.headers.keys().forEach((t=>{o[t.toLowerCase()]=r.headers.get(t)})),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:Mk(new Uint8Array(i))}}))}var bP=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const wP=new yk("web/5.6.1");function AP(t){return new Promise((e=>{setTimeout(e,t)}))}function _P(t,e){if(null==t)return null;if("string"==typeof t)return t;if(Ak(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return PS(t)}catch(t){}return Tk(t)}return t}function EP(t,e,n){let r=null;if(null!=e){r=IS(e);const n="string"==typeof t?{url:t}:hx(t);n.headers?0!==Object.keys(n.headers).filter((t=>"content-type"===t.toLowerCase())).length||(n.headers=hx(n.headers),n.headers["content-type"]="application/json"):n.headers={"content-type":"application/json"},t=n}return function(t,e,n){const r="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;wP.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;wP.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let u=null;const l={method:"GET"};let c=!1,h=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||wP.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(h=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(c=!0);if(l.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&wP.throwError("basic authentication requires a secure https url",yk.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+gP(IS(e))}}null!=t.skipFetchSetup&&(l.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:mP(d[2])};let e=t.body;return n&&(e=n(t.body,t)),Promise.resolve(e)}catch(t){wP.throwError("processing response error",yk.errors.SERVER_ERROR,{body:_P(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}e&&(l.method="POST",l.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach((t=>{const e=a[t];p[e.key]=e.value})),l.headers=p;const m=function(){let t=null;return{promise:new Promise((function(e,n){h&&(t=setTimeout((()=>{null!=t&&(t=null,n(wP.makeError("timeout",yk.errors.TIMEOUT,{requestBody:_P(l.body,p["content-type"]),requestMethod:l.method,timeout:h,url:u})))}),h))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return bP(this,void 0,void 0,(function*(){for(let t=0;t=300)&&(m.cancel(),wP.throwError("bad response",yk.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:_P(a,e.headers?e.headers["content-type"]:null),requestBody:_P(l.body,p["content-type"]),requestMethod:l.method,url:u})),n)try{const t=yield n(a,e);return m.cancel(),t}catch(n){if(n.throttleRetry&&t{let r=null;if(null!=t)try{r=JSON.parse(PS(t))}catch(e){wP.throwError("invalid JSON",yk.errors.SERVER_ERROR,{body:t,error:e})}return n&&(r=n(r,e)),r}))}function MP(t,e){return e||(e={}),null==(e=hx(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(n,r){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&r(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let u=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&n(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(u++,u>a)return void(s()&&r(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));te.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&r(t)}))}()}))}for(var kP="qpzry9x8gf2tvdw0s3jn54khce6mua7l",xP={},SP=0;SP>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function IP(t){for(var e=1,n=0;n126)return"Invalid prefix ("+t+")";e=TP(e)^r>>5}for(e=TP(e),n=0;ne)return"Exceeds length limit";var n=t.toLowerCase(),r=t.toUpperCase();if(t!==n&&t!==r)return"Mixed-case string "+t;var i=(t=n).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var a=IP(o);if("string"==typeof a)return a;for(var u=[],l=0;l=s.length||u.push(h)}return 1!==a?"Invalid checksum for "+t:{prefix:o,words:u}}function PP(t,e,n,r){for(var i=0,o=0,s=(1<=n;)o-=n,a.push(i>>o&s);if(r)o>0&&a.push(i<=e)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var r=IP(t=t.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=t+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");r=TP(r)^s,i+=kP.charAt(s)}for(o=0;o<6;++o)r=TP(r);for(r^=1,o=0;o<6;++o)i+=kP.charAt(r>>5*(5-o)&31);return i},toWordsUnsafe:function(t){var e=PP(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=PP(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=PP(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=PP(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const BP="providers/5.6.8",OP=new yk(BP);class LP{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:LP.allowNull(this.accessList.bind(this),null),blockHash:LP.allowNull(o,null),blockNumber:LP.allowNull(a,null),transactionIndex:LP.allowNull(a,null),confirmations:LP.allowNull(a,null),from:e,gasPrice:LP.allowNull(n),maxPriorityFeePerGas:LP.allowNull(n),maxFeePerGas:LP.allowNull(n),gasLimit:n,to:LP.allowNull(e,null),value:n,nonce:a,data:i,r:LP.allowNull(this.uint256),s:LP.allowNull(this.uint256),v:LP.allowNull(a),creates:LP.allowNull(e,null),raw:LP.allowNull(i)},t.transactionRequest={from:LP.allowNull(e),nonce:LP.allowNull(a),gasLimit:LP.allowNull(n),gasPrice:LP.allowNull(n),maxPriorityFeePerGas:LP.allowNull(n),maxFeePerGas:LP.allowNull(n),to:LP.allowNull(e),value:LP.allowNull(n),data:LP.allowNull((t=>this.data(t,!0))),type:LP.allowNull(a),accessList:LP.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:LP.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:LP.allowNull(this.address,null),from:LP.allowNull(this.address,null),contractAddress:LP.allowNull(e,null),transactionIndex:a,root:LP.allowNull(s),gasUsed:n,logsBloom:LP.allowNull(i),blockHash:o,transactionHash:o,logs:LP.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:LP.allowNull(a,null),cumulativeGasUsed:n,effectiveGasPrice:LP.allowNull(n),status:LP.allowNull(a),type:u},t.block={hash:LP.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:LP.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:LP.allowNull(e),extraData:i,transactions:LP.allowNull(LP.arrayOf(o)),baseFeePerGas:LP.allowNull(n)},t.blockWithTransactions=hx(t.block),t.blockWithTransactions.transactions=LP.allowNull(LP.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:LP.allowNull(r,void 0),toBlock:LP.allowNull(r,void 0),blockHash:LP.allowNull(o,void 0),address:LP.allowNull(e,void 0),topics:LP.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:LP.allowNull(a),blockHash:LP.allowNull(o),transactionIndex:a,removed:LP.allowNull(this.boolean.bind(this)),address:e,data:LP.allowFalsish(i,"0x"),topics:LP.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return FN(t||[])}number(t){return"0x"===t?0:Hk.from(t).toNumber()}type(t){return"0x"===t||null==t?0:Hk.from(t).toNumber()}bigNumber(t){return Hk.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),Sk(t))?t.toLowerCase():OP.throwArgumentError("invalid hash","value",t)}data(t,e){const n=this.hex(t,e);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+t);return n}address(t){return sS(t)}callAddress(t){if(!Sk(t,32))return null;const e=sS(Nk(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return aS(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||Sk(t))return Rk(t);throw new Error("invalid blockTag")}hash(t,e){const n=this.hex(t,e);return 32!==Ik(n)?OP.throwArgumentError("invalid hash","value",t):n}difficulty(t){if(null==t)return null;const e=Hk.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!Sk(t))throw new Error("invalid uint256");return Bk(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const n=null!=t._difficulty?t._difficulty:t.difficulty,r=LP.check(e,t);return r._difficulty=null==n?null:Hk.from(n),r}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return LP.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&Hk.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=LP.check(this.formats.transaction,t);if(null!=t.chainId){let n=t.chainId;Sk(n)&&(n=Hk.from(n).toNumber()),e.chainId=n}else{let n=t.networkId;null==n&&null==e.v&&(n=t.chainId),Sk(n)&&(n=Hk.from(n).toNumber()),"number"!=typeof n&&null!=e.v&&(n=(e.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),e.chainId=n}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return qN(t)}receiptLog(t){return LP.check(this.formats.receiptLog,t)}receipt(t){const e=LP.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=Hk.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&OP.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):OP.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&OP.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return LP.check(this.formats.filter,t)}filterLog(t){return LP.check(this.formats.filterLog,t)}static check(t,e){const n={};for(const r in t)try{const i=t[r](e[r]);void 0!==i&&(n[r]=i)}catch(t){throw t.checkKey=r,t.checkValue=e[r],t}return n}static allowNull(t,e){return function(n){return null==n?e:t(n)}}static allowFalsish(t,e){return function(n){return n?t(n):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const n=[];return e.forEach((function(e){n.push(t(e))})),n}}}var DP=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const jP=new yk(BP);function FP(t){return null==t?"null":(32!==Ik(t)&&jP.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function UP(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[FP(t)]=!0}));const n=Object.keys(e);return n.sort(),n.join("|")}return FP(t)})).join("&")}function zP(t){if("string"==typeof t){if(32===Ik(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+UP(t);if(TC.isForkEvent(t))throw jP.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+UP(t.topics||[])}throw new Error("invalid event - "+t)}function HP(){return(new Date).getTime()}function WP(t){return new Promise((e=>{setTimeout(e,t)}))}const qP=["block","network","pending","poll"];class GP{constructor(t,e,n){ux(this,"tag",t),ux(this,"listener",e),ux(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],n=""===(r=t[2])?[]:r.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var r;const i={};return n.length>0&&(i.topics=n),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||qP.indexOf(this.tag)>=0}}const QP={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function VP(t){return Bk(Hk.from(t).toHexString(),32)}function YP(t){return sP.encode(kk([t,Nk(aP(aP(t)),0,4)]))}const JP=new RegExp("^(ipfs)://(.*)$","i"),ZP=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),JP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function KP(t,e){try{return PS(XP(t,e))}catch(t){}return null}function XP(t,e){if("0x"===t)return null;const n=Hk.from(Nk(t,e,e+32)).toNumber(),r=Hk.from(Nk(t,n,n+32)).toNumber();return Nk(t,n+32,n+32+r)}function $P(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):jP.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function tR(t){const e=Mk(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function eR(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function nR(t){const e=[];let n=0;for(let r=0;rHk.from(t).eq(1))).catch((t=>{if(t.code===yk.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return DP(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:Pk([t,nC(this.name),e||"0x"])};let r=!1;var i;(yield this.supportsWildcard())&&(r=!0,n.data=Pk(["0x9061b923",nR([(i=this.name,Tk(kk(i.split(".").map((t=>{const e=IS("_"+qS(t));return e[0]=e.length-1,e}))))+"00"),n.data])]));try{let t=yield this.provider.call(n);return Mk(t).length%32==4&&jP.throwError("resolver threw error",yk.errors.CALL_EXCEPTION,{transaction:n,data:t}),r&&(t=XP(t,0)),t}catch(t){if(t.code===yk.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return DP(this,void 0,void 0,(function*(){const n=yield this._fetch(t,e);return null!=n?XP(n,0):null}))}_getAddress(t,e){const n=QP[String(t)];if(null==n&&jP.throwError(`unsupported coin type: ${t}`,yk.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===n.ilk)return this.provider.formatter.address(e);const r=Mk(e);if(null!=n.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return YP(kk([[n.p2pkh],"0x"+t[2]]))}}if(null!=n.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return YP(kk([[n.p2sh],"0x"+t[2]]))}}if(null!=n.prefix){const t=r[1];let e=r[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&r.length===2+t&&t>=1&&t<=75){const t=RP.toWords(r.slice(2));return t.unshift(e),RP.encode(n.prefix,t)}}return null}getAddress(t){return DP(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||"0x0000000000000000000000000000000000000000000000000000000000000000"===t?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===yk.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",VP(t));if(null==e||"0x"===e)return null;const n=this._getAddress(t,e);return null==n&&jP.throwError("invalid or unsupported coin data",yk.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),n}))}getAvatar(){return DP(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let n=0;nt[e]))}return jP.throwError("invalid or unsupported content hash data",yk.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return DP(this,void 0,void 0,(function*(){let e=IS(t);e=kk([VP(64),VP(e.length),e]),e.length%32!=0&&(e=kk([e,Bk("0x",32-t.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Tk(e));return null==n||"0x"===n?null:PS(n)}))}}let iR=null,oR=1;class sR extends IC{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ux(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=lx(new.target,"getNetwork")(t);e?(ux(this,"_network",e),this.emit("network",e,null)):jP.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return DP(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||jP.throwError("no network detected",yk.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:ux(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return MP((()=>this._ready().then((t=>t),(t=>{if(t.code!==yk.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==iR&&(iR=new LP),iR}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in pP){const n=pP[e];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=pP[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=pP[t.name];if(!e)return"number"!=typeof t.chainId&&uP.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&uP.throwArgumentError("network chainId mismatch","network",t);let n=t._defaultProvider||null;var r;return null==n&&e._defaultProvider&&(n=(r=e._defaultProvider)&&"function"==typeof r.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:n}}(null==t?"homestead":t)}ccipReadFetch(t,e,n){return DP(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t=0?null:JSON.stringify({data:i,sender:r}),u=yield EP({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const l=u.message||"unknown error";if(u.status>=400&&u.status<500)return jP.throwError(`response not found during CCIP fetch: ${l}`,yk.errors.SERVER_ERROR,{url:e,errorMessage:l});o.push(l)}return jP.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,yk.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(t){return DP(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const n=yield e;if(HP()-n.respTime<=t)return n.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=HP(),n=cx({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=HP();return(t=Hk.from(t).toNumber()){this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return DP(this,void 0,void 0,(function*(){const t=oR++,e=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)jP.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",jP.makeError("network block skew detected",yk.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let t=this._emitted.block+1;t<=n;t++)this.emit("block",t);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&n-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((t=>{switch(t.type){case"tx":{const n=t.hash;let r=this.getTransactionReceipt(n).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+n]=t.blockNumber,this.emit(n,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(r);break}case"filter":if(!t._inflight){t._inflight=!0;const r=t.filter;r.fromBlock=t._lastBlockNumber+1,r.toBlock=n,r.toBlock-this._maxFilterBlockRange>r.fromBlock&&(r.fromBlock=r.toBlock-this._maxFilterBlockRange);const i=this.getLogs(r).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(r,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=n,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return DP(this,void 0,void 0,(function*(){return jP.throwError("provider does not support network detection",yk.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return DP(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield WP(0),this._network;const n=jP.makeError("underlying network changed",yk.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",n),n}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=HP();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,n){return DP(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,n||0,null)}))}_waitForTransaction(t,e,n,r){return DP(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const u=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},l=t=>{t.confirmations{this.removeListener(t,l)})),r){let n=r.startBlock,i=null;const l=s=>DP(this,void 0,void 0,(function*(){a||(yield WP(1e3),this.getTransactionCount(r.from).then((c=>DP(this,void 0,void 0,(function*(){if(!a){if(c<=r.nonce)n=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=n-3,i{a||this.once("block",l)})))}));if(a)return;this.once("block",l),s.push((()=>{this.removeListener("block",l)}))}if("number"==typeof n&&n>0){const t=setTimeout((()=>{u()||o(jP.makeError("timeout exceeded",yk.errors.TIMEOUT,{timeout:n}))}),n);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return DP(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return Hk.from(t)}catch(e){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield cx({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getBalance",n);try{return Hk.from(r)}catch(t){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:t})}}))}getTransactionCount(t,e){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield cx({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getTransactionCount",n);try{return Hk.from(r).toNumber()}catch(t){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:t})}}))}getCode(t,e){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield cx({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getCode",n);try{return Tk(r)}catch(t){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:t})}}))}getStorageAt(t,e,n){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield cx({address:this._getAddress(t),blockTag:this._getBlockTag(n),position:Promise.resolve(e).then((t=>Rk(t)))}),i=yield this.perform("getStorageAt",r);try{return Tk(i)}catch(t){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:t})}}))}_wrapTransaction(t,e,n){if(null!=e&&32!==Ik(e))throw new Error("invalid response - sendTransaction");const r=t;return null!=e&&t.hash!==e&&jP.throwError("Transaction hash mismatch from Provider.sendTransaction.",yk.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),r.wait=(e,r)=>DP(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==r&&(r=0),0!==e&&null!=n&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:n});const o=yield this._waitForTransaction(t.hash,e,r,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&jP.throwError("transaction failed",yk.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),r}sendTransaction(t){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>Tk(t))),n=this.formatter.transaction(t);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(n,t,r)}catch(t){throw t.transaction=n,t.transactionHash=n.hash,t}}))}_getTransactionRequest(t){return DP(this,void 0,void 0,(function*(){const e=yield t,n={};return["from","to"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?Hk.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(n.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?Tk(t):null)))})),this.formatter.transactionRequest(yield cx(n))}))}_getFilter(t){return DP(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((n=>{null!=t[n]&&(e[n]=t[n])})),["fromBlock","toBlock"].forEach((n=>{null!=t[n]&&(e[n]=this._getBlockTag(t[n]))})),this.formatter.filter(yield cx(e))}))}_call(t,e,n){return DP(this,void 0,void 0,(function*(){n>=10&&jP.throwError("CCIP read exceeded maximum redirections",yk.errors.SERVER_ERROR,{redirects:n,transaction:t});const r=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(n>=0&&"latest"===e&&null!=r&&"0x556f1830"===i.substring(0,10)&&Ik(i)%32==4)try{const o=Nk(i,4),s=Nk(o,0,32);Hk.from(s).eq(r)||jP.throwError("CCIP Read sender did not match",yk.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],u=Hk.from(Nk(o,32,64)).toNumber(),l=Hk.from(Nk(o,u,u+32)).toNumber(),c=Nk(o,u+32);for(let e=0;eDP(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",r);if(null==t)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(e){let e=null;for(let n=0;nthis._wrapTransaction(t))),n}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return DP(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return MP((()=>DP(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(t){return DP(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return MP((()=>DP(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return r}))),{oncePoll:this})}))}getLogs(t){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield cx({filter:this._getFilter(t)}),n=yield this.perform("getLogs",e);return n.forEach((t=>{null==t.removed&&(t.removed=!1)})),LP.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return DP(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return DP(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&jP.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return DP(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const n=yield this._getResolver(e,"getResolver");if(null!=n){const r=new rR(this,n,t);return e===t||(yield r.supportsWildcard())?r:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return DP(this,void 0,void 0,(function*(){null==e&&(e="ENS");const n=yield this.getNetwork();n.ensAddress||jP.throwError("network does not support ENS",yk.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name});try{const e=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+nC(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return DP(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(Sk(t))throw e}"string"!=typeof t&&jP.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return DP(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(e,"lookupAddress");if(null==n)return null;const r=KP(yield this.call({to:n,data:"0x691f3431"+nC(e).substring(2)}),0);return(yield this.resolveName(r))!=t?null:r}))}getAvatar(t){return DP(this,void 0,void 0,(function*(){let e=null;if(Sk(t)){const n=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;e=new rR(this,r,n);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==yk.errors.CALL_EXCEPTION)throw t}try{const t=KP(yield this.call({to:r,data:"0x691f3431"+nC(n).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==yk.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const n=yield e.getAvatar();return null==n?null:n.url}))}perform(t,e){return jP.throwError(t+" not implemented",yk.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,n){const r=new GP(zP(t),e,n);return this._events.push(r),this._startEvent(r),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let n=!1,r=[],i=zP(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),n=!0,!t.once||(r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),n}listenerCount(t){if(!t)return this._events.length;let e=zP(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=zP(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const n=[];let r=!1,i=zP(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||!!r||(r=!0,n.push(t),!1))),n.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const n=zP(t);this._events=this._events.filter((t=>t.tag!==n||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var aR=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const uR=new yk(BP),lR=["call","estimateGas"];function cR(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const n=Sk(t.data)?t.data:null;if(!e||n)return{message:t.message,data:n}}if("object"==typeof t){for(const n in t){const r=cR(t[n],e);if(r)return r}return null}if("string"==typeof t)try{return cR(JSON.parse(t),e)}catch(t){}return null}function hR(t,e,n){const r=n.transaction||n.signedTransaction;if("call"===t){const t=cR(e,!0);if(t)return t.data;uR.throwError("missing revert data in call exception; Transaction reverted without a reason string",yk.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:e})}if("estimateGas"===t){let n=cR(e.body,!1);null==n&&(n=cR(e,!1)),n&&uR.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yk.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:t,transaction:r,error:e})}let i=e.message;throw e.code===yk.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&uR.throwError("insufficient funds for intrinsic transaction cost",yk.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/nonce (is )?too low/i)&&uR.throwError("nonce has already been used",yk.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&uR.throwError("replacement fee too low",yk.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/only replay-protected/i)&&uR.throwError("legacy pre-eip-155 transactions not supported",yk.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:r}),lR.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&uR.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yk.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}function fR(t){return new Promise((function(e){setTimeout(e,t)}))}function dR(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function pR(t){return t?t.toLowerCase():t}const mR={};class gR extends OC{constructor(t,e,n){if(super(),t!==mR)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ux(this,"provider",e),null==n&&(n=0),"string"==typeof n?(ux(this,"_address",this.provider.formatter.address(n)),ux(this,"_index",null)):"number"==typeof n?(ux(this,"_index",n),ux(this,"_address",null)):uR.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(t){return uR.throwError("cannot alter JSON-RPC Signer connection",yk.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new yR(mR,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&uR.throwError("unknown account #"+this._index,yk.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=hx(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const n=hx(t);n.from=e,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>aR(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&uR.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),cx({tx:cx(t),sender:e}).then((({tx:e,sender:n})=>{null!=e.from?e.from.toLowerCase()!==n&&uR.throwArgumentError("from address mismatch","transaction",t):e.from=n;const r=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((t=>t),(t=>hR("sendTransaction",t,r)))}))}signTransaction(t){return uR.throwError("signing transactions is unsupported",yk.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return aR(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(t);try{return yield MP((()=>aR(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(n);if(null!==t)return this.provider._wrapTransaction(t,n,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=n,t}}))}signMessage(t){return aR(this,void 0,void 0,(function*(){const e="string"==typeof t?IS(t):t,n=yield this.getAddress();return yield this.provider.send("personal_sign",[Tk(e),n.toLowerCase()])}))}_legacySignMessage(t){return aR(this,void 0,void 0,(function*(){const e="string"==typeof t?IS(t):t,n=yield this.getAddress();return yield this.provider.send("eth_sign",[n.toLowerCase(),Tk(e)])}))}_signTypedData(t,e,n){return aR(this,void 0,void 0,(function*(){const r=yield vC.resolveNames(t,e,n,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(vC.getPayload(r.domain,e,r.value))])}))}unlock(t){return aR(this,void 0,void 0,(function*(){const e=this.provider,n=yield this.getAddress();return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])}))}}class yR extends gR{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const vR={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class bR extends sR{constructor(t,e){let n=e;null==n&&(n=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(n),t||(t=lx(this.constructor,"defaultUrl")()),ux(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(hx(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return aR(this,void 0,void 0,(function*(){yield fR(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=lx(this.constructor,"getNetwork");try{return e(Hk.from(t).toNumber())}catch(e){return uR.throwError("could not detect network",yk.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return uR.throwError("could not detect network",yk.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new gR(mR,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:mx(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(r&&this._cache[t])return this._cache[t];const i=EP(this.connection,JSON.stringify(n),dR).then((t=>(this.emit("debug",{action:"response",request:n,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:n,provider:this}),t}));return r&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[pR(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[pR(e.address),e.blockTag]];case"getCode":return["eth_getCode",[pR(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[pR(e.address),Bk(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[lx(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[lx(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=pR(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return aR(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&Hk.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((e=hx(e)).transaction=hx(t),delete e.transaction.type)}}const n=this.prepareRequest(t,e);null==n&&uR.throwError(t+" not implemented",yk.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(n[0],n[1])}catch(n){return hR(t,n,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(n){return function r(){t.send("eth_getFilterChanges",[n]).then((function(n){if(t._pendingFilter!=e)return null;let r=Promise.resolve();return n.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",r=r.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),r.then((function(){return fR(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){r()}),0),null;t.send("eth_uninstallFilter",[n])})).catch((t=>{}))}(),n})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const n=hx(vR);if(e)for(const t in e)e[t]&&(n[t]=!0);var r,i;i=n,(r=t)&&"object"==typeof r||ax.throwArgumentError("invalid object","object",r),Object.keys(r).forEach((t=>{i[t]||ax.throwArgumentError("invalid object key - "+t,"transaction:"+t,r)}));const o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const n=Rk(Hk.from(t[e]));"gasLimit"===e&&(e="gas"),o[e]=n})),["from","to","data"].forEach((function(e){null!=t[e]&&(o[e]=Tk(t[e]))})),t.accessList&&(o.accessList=FN(t.accessList)),o}}const wR=new yk(BP);let AR=1;function _R(t,e){const n="Web3LegacyFetcher";return function(t,r){const i={method:t,params:r,id:AR++,jsonrpc:"2.0"};return new Promise(((t,r)=>{this.emit("debug",{action:"request",fetcher:n,request:mx(i),provider:this}),e(i,((e,o)=>{if(e)return this.emit("debug",{action:"response",fetcher:n,error:e,request:i,provider:this}),r(e);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const t=new Error(o.error.message);return t.code=o.error.code,t.data=o.error.data,r(t)}t(o.result)}))}))}}class ER extends bR{constructor(t,e){null==t&&wR.throwArgumentError("missing provider","provider",t);let n=null,r=null,i=null;"function"==typeof t?(n="unknown:",r=t):(n=t.host||t.path||"",!n&&t.isMetaMask&&(n="metamask"),i=t,t.request?(""===n&&(n="eip-1193:"),r=function(t){return function(e,n){null==n&&(n=[]);const r={method:e,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:mx(r),provider:this}),t.request(r).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:t,provider:this}),t}))}}(t)):t.sendAsync?r=_R(0,t.sendAsync.bind(t)):t.send?r=_R(0,t.send.bind(t)):wR.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),super(n,e),ux(this,"jsonRpcFetchFunc",r),ux(this,"provider",i)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}const MR=new yk("units/5.6.1"),kR=["wei","kwei","mwei","gwei","szabo","finney","ether"];class xR{constructor({blockchain:t,from:e,to:n,value:r,api:i,method:o,params:s,sent:a,confirmed:u,failed:l}){this.blockchain=t,this.from=e,this.to=n,this.value=function(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}([xR,"access",t=>t.bigNumberify,"call",e=>e(r,t),"optionalAccess",t=>t.toString,"call",t=>t()]),this.api=i,this.method=o,this.params=s,this.sent=a,this.confirmed=u,this.failed=l,this._confirmed=!1,this._failed=!1}async prepare({wallet:t}){this.from=await t.account()}static bigNumberify(t,e){return"number"==typeof t?function(t,e){if("string"!=typeof t&&MR.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=kR.indexOf(e);-1!==t&&(e=3*t)}return ex(t,null!=e?e:18)}(t.toString(),qh[e].DECIMALS):t&&t.toString?Hk.from(t.toString()):t}getContractArguments(){let t=this.getContract().interface.fragments.find((t=>t.name==this.method));if(this.params instanceof Array)return this.params;if(this.params instanceof Object)return t.inputs.map((t=>this.params[t.name]));throw"Contract params have wrong type!"}getContract(){return new iP(this.to,this.api)}async getData(){return(await this.getContract().populateTransaction[this.method].apply(null,this.getContractArguments())).data}confirmation(){return this._confirmed?Promise.resolve(this):new Promise(((t,e)=>{let n=this.confirmed;this.confirmed=()=>{n&&n(this),t(this)}}))}failure(){return this._failed?Promise.resolve(this):new Promise(((t,e)=>{let n=this.failed;this.failed=()=>{n&&n(this),t(this)}}))}}const SR=({transaction:t,provider:e,signer:n})=>t.method?CR({transaction:t,signer:n,provider:e}):TR({transaction:t,signer:n}),CR=({transaction:t,signer:e,provider:n})=>{let r=new iP(t.to,t.api,n);return r.connect(e)[t.method](...t.getContractArguments({contract:r}),{value:xR.bigNumberify(t.value,t.blockchain)})},TR=({transaction:t,signer:e})=>e.sendTransaction({to:t.to,value:xR.bigNumberify(t.value,t.blockchain)});function IR(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}class NR{static __initStatic(){this.info={name:"Web3 Wallet",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 446.42 376.77'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23828487;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M408.69,171.4H473.4V107.77a46.55,46.55,0,0,0-46.55-46.55H73.53A46.55,46.55,0,0,0,27,107.77v65.09H62.7L89.56,146a9.46,9.46,0,0,1,5.73-2.73h0l.41,0h78.59a47.2,47.2,0,1,1,82.63,39.56q-1.41,1.71-3,3.31t-3.31,3a47.21,47.21,0,0,1-76.31-26.9H100.21L73.34,189.07a9.43,9.43,0,0,1-5.73,2.73h0l-.41,0h-.07l-.48,0H27v74H55.83l18.25-18.24a9.39,9.39,0,0,1,5.73-2.74h0l.41,0h29.9a47.16,47.16,0,1,1,0,19H84.72L66.48,282.11a9.42,9.42,0,0,1-5.72,2.74h0l-.39,0H27V319H83.29a4,4,0,0,1,.49,0h.06l.41,0h0A9.41,9.41,0,0,1,90,321.78l28,28h57.66a47.2,47.2,0,1,1,81.48,40.9c-.6.67-1.22,1.32-1.86,2s-1.3,1.26-2,1.86a47.22,47.22,0,0,1-77.65-25.73H114.09a9.5,9.5,0,0,1-3.09-.52l-.08,0-.29-.11-.17-.07-.19-.08-.27-.12-.08,0a9.38,9.38,0,0,1-2.55-1.81l-28-28H27v53.46A46.55,46.55,0,0,0,73.53,438H426.86a46.55,46.55,0,0,0,46.54-46.55V327.82H408.69a78.22,78.22,0,0,1-78.21-78.21h0A78.22,78.22,0,0,1,408.69,171.4Z' transform='translate(-26.98 -61.22)'/%3E%3Cpath class='cls-1' d='M247.91,359.29a26,26,0,1,0-26,26A26,26,0,0,0,247.91,359.29Z' transform='translate(-26.98 -61.22)'/%3E%3Cpath class='cls-1' d='M246.55,152.71a26,26,0,1,0-26,26A26,26,0,0,0,246.55,152.71Z' transform='translate(-26.98 -61.22)'/%3E%3Ccircle class='cls-1' cx='129.39' cy='193.15' r='25.99'/%3E%3Cpath class='cls-1' d='M409.17,190h-.48a59.57,59.57,0,0,0-59.57,59.57h0a59.57,59.57,0,0,0,59.57,59.57h.48a59.58,59.58,0,0,0,59.58-59.57h0A59.58,59.58,0,0,0,409.17,190Zm14.45,90.61h-31l8.88-32.53a15.5,15.5,0,1,1,13.29,0Z' transform='translate(-26.98 -61.22)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"]}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.install=this.constructor.info.install,this.sendTransaction=t=>(async({transaction:t,wallet:e})=>{t=new xR(t),0==await e.connectedTo(t.blockchain)&&await e.switchTo(t.blockchain),await t.prepare({wallet:e});let n=new ER(window.ethereum,"any"),r=n.getSigner(0);return await SR({transaction:t,provider:n,signer:r}).then((e=>{if(!e)throw"Submitting transaction failed!";t.id=e.hash,t.nonce=e.nonce,t.url=Wh(t.blockchain).explorerUrlFor({transaction:t}),t.sent&&t.sent(t),e.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?(e.replacement&&e.replacement.hash&&(t.id=e.replacement.hash,t.url=Wh(t.blockchain).explorerUrlFor({transaction:t})),e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t._failed=!0,t.failed&&t.failed(t,e))):(t._failed=!0,t.failed&&t.failed(t,e))}))})),t})({wallet:this,transaction:t})}async account(){return(await this.accounts())[0]}async accounts(){return IR([window,"optionalAccess",t=>t.ethereum])?await window.ethereum.request({method:"eth_accounts"}):[]}async connect(){return IR([window,"optionalAccess",t=>t.ethereum])?await window.ethereum.request({method:"eth_requestAccounts"}):[]}on(t,e){let n;switch(t){case"account":n=t=>e(t[0]),window.ethereum.on("accountsChanged",n);break;case"accounts":n=t=>e(t),window.ethereum.on("accountsChanged",n);break;case"network":n=t=>e(zh(t).name),window.ethereum.on("chainChanged",n);break;case"disconnect":n=e,window.ethereum.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":window.ethereum.removeListener("accountsChanged",e);break;case"network":window.ethereum.removeListener("chainChanged",e);break;case"disconnect":window.ethereum.removeListener("disconnect",e)}return e}async connectedTo(t){const e=zh(await window.ethereum.request({method:"eth_chainId"}));return t?t===e.name:e.name}addNetwork(t){return new Promise(((e,n)=>{const r=Wh(t);window.ethereum.request({method:"wallet_addEthereumChain",params:[{chainId:r.id,chainName:r.fullName,nativeCurrency:{name:r.currency.name,symbol:r.currency.symbol,decimals:r.currency.decimals},rpcUrls:[r.rpc],blockExplorerUrls:[r.explorer],iconUrls:[r.logo]}]}).then(e).catch(n)}))}switchTo(t){return new Promise(((e,n)=>{const r=Wh(t);window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:r.id}]}).then(e).catch((r=>{4902===r.code?this.addNetwork(t).then((()=>this.switchTo(t).then(e))).catch(n):n(r)}))}))}async sign(t){await this.account();let e=new ER(window.ethereum,"any").getSigner(0);return await e.signMessage(t)}}NR.__initStatic();class PR extends NR{static __initStatic(){this.info={name:"Coinbase",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 488.96 488.96'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:url(%23linear-gradient);%7D.cls-2%7Bfill:%234361ad;%7D%3C/style%3E%3ClinearGradient id='linear-gradient' x1='250' y1='7.35' x2='250' y2='496.32' gradientTransform='matrix(1, 0, 0, -1, 0, 502)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233d5ba9'/%3E%3Cstop offset='1' stop-color='%234868b1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath class='cls-1' d='M250,5.68C114.87,5.68,5.52,115,5.52,250.17S114.87,494.65,250,494.65,494.48,385.29,494.48,250.17,385.13,5.68,250,5.68Zm0,387.54A143.06,143.06,0,1,1,393.05,250.17,143.11,143.11,0,0,1,250,393.22Z' transform='translate(-5.52 -5.68)'/%3E%3Cpath class='cls-2' d='M284.69,296.09H215.31a11,11,0,0,1-10.9-10.9V215.48a11,11,0,0,1,10.9-10.91H285a11,11,0,0,1,10.9,10.91v69.71A11.07,11.07,0,0,1,284.69,296.09Z' transform='translate(-5.52 -5.68)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://wallet.coinbase.com"}}}PR.__initStatic();class RR extends NR{static __initStatic(){this.info={name:"MetaMask",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 485.93 450.56'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23828487;%7D.cls-2%7Bfill:%23e27726;stroke:%23e27726;%7D.cls-10,.cls-11,.cls-2,.cls-3,.cls-4,.cls-5,.cls-6,.cls-7,.cls-8,.cls-9%7Bstroke-linecap:round;stroke-linejoin:round;%7D.cls-3%7Bfill:%23e37725;stroke:%23e37725;%7D.cls-4%7Bfill:%23d6c0b3;stroke:%23d6c0b3;%7D.cls-5%7Bfill:%23243447;stroke:%23243447;%7D.cls-6%7Bfill:%23cd6328;stroke:%23cd6328;%7D.cls-7%7Bfill:%23e37525;stroke:%23e37525;%7D.cls-8%7Bfill:%23f6851f;stroke:%23f6851f;%7D.cls-9%7Bfill:%23c1ae9e;stroke:%23c1ae9e;%7D.cls-10%7Bfill:%23171717;stroke:%23171717;%7D.cls-11%7Bfill:%23763e1a;stroke:%23763e1a;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M247.91,356.29a26,26,0,1,0-26,26A26,26,0,0,0,247.91,356.29Z' transform='translate(-7.97 -21.33)'/%3E%3Cpath class='cls-1' d='M246.55,149.71a26,26,0,1,0-26,26A26,26,0,0,0,246.55,149.71Z' transform='translate(-7.97 -21.33)'/%3E%3Ccircle class='cls-1' cx='148.4' cy='230.05' r='25.99'/%3E%3Cpolygon class='cls-2' points='461.28 0.5 272.06 141.03 307.05 58.12 461.28 0.5'/%3E%3Cpolygon class='cls-3' points='24.46 0.5 212.16 142.37 178.88 58.12 24.46 0.5'/%3E%3Cpolygon class='cls-3' points='393.2 326.26 342.81 403.47 450.63 433.14 481.63 327.97 393.2 326.26'/%3E%3Cpolygon class='cls-3' points='4.49 327.97 35.3 433.14 143.13 403.47 92.73 326.26 4.49 327.97'/%3E%3Cpolygon class='cls-3' points='137.04 195.8 107 241.25 214.06 246.01 210.26 130.96 137.04 195.8'/%3E%3Cpolygon class='cls-3' points='348.7 195.8 274.53 129.63 272.06 246.01 378.94 241.25 348.7 195.8'/%3E%3Cpolygon class='cls-3' points='143.13 403.47 207.41 372.09 151.88 328.73 143.13 403.47'/%3E%3Cpolygon class='cls-3' points='278.34 372.09 342.81 403.47 333.87 328.73 278.34 372.09'/%3E%3Cpolygon class='cls-4' points='342.81 403.47 278.34 372.09 283.47 414.12 282.9 431.81 342.81 403.47'/%3E%3Cpolygon class='cls-4' points='143.13 403.47 203.03 431.81 202.65 414.12 207.41 372.09 143.13 403.47'/%3E%3Cpolygon class='cls-5' points='203.98 300.97 150.35 285.18 188.2 267.88 203.98 300.97'/%3E%3Cpolygon class='cls-5' points='281.76 300.97 297.55 267.88 335.58 285.18 281.76 300.97'/%3E%3Cpolygon class='cls-6' points='143.13 403.47 152.25 326.26 92.73 327.97 143.13 403.47'/%3E%3Cpolygon class='cls-6' points='333.68 326.26 342.81 403.47 393.2 327.97 333.68 326.26'/%3E%3Cpolygon class='cls-6' points='378.94 241.25 272.06 246.01 281.95 300.97 297.74 267.88 335.77 285.18 378.94 241.25'/%3E%3Cpolygon class='cls-6' points='150.35 285.18 188.39 267.88 203.98 300.97 214.06 246.01 107 241.25 150.35 285.18'/%3E%3Cpolygon class='cls-7' points='107 241.25 151.88 328.73 150.35 285.18 107 241.25'/%3E%3Cpolygon class='cls-7' points='335.77 285.18 333.87 328.73 378.94 241.25 335.77 285.18'/%3E%3Cpolygon class='cls-7' points='214.06 246.01 203.98 300.97 216.53 365.82 219.38 280.43 214.06 246.01'/%3E%3Cpolygon class='cls-7' points='272.06 246.01 266.93 280.24 269.21 365.82 281.95 300.97 272.06 246.01'/%3E%3Cpolygon class='cls-8' points='281.95 300.97 269.21 365.82 278.34 372.09 333.87 328.73 335.77 285.18 281.95 300.97'/%3E%3Cpolygon class='cls-8' points='150.35 285.18 151.88 328.73 207.41 372.09 216.53 365.82 203.98 300.97 150.35 285.18'/%3E%3Cpolygon class='cls-9' points='282.9 431.81 283.47 414.12 278.72 409.94 207.02 409.94 202.65 414.12 203.03 431.81 143.13 403.47 164.05 420.58 206.45 450.06 279.29 450.06 321.89 420.58 342.81 403.47 282.9 431.81'/%3E%3Cpolygon class='cls-10' points='278.34 372.09 269.21 365.82 216.53 365.82 207.41 372.09 202.65 414.12 207.02 409.94 278.72 409.94 283.47 414.12 278.34 372.09'/%3E%3Cpolygon class='cls-11' points='469.27 150.16 485.43 72.57 461.28 0.5 278.34 136.28 348.7 195.8 448.16 224.9 470.22 199.23 460.71 192.38 475.92 178.5 464.13 169.37 479.35 157.77 469.27 150.16'/%3E%3Cpolygon class='cls-11' points='0.5 72.57 16.66 150.16 6.39 157.77 21.61 169.37 10.01 178.5 25.22 192.38 15.71 199.23 37.58 224.9 137.04 195.8 207.41 136.28 24.46 0.5 0.5 72.57'/%3E%3Cpolygon class='cls-8' points='448.16 224.9 348.7 195.8 378.94 241.25 333.87 328.73 393.2 327.97 481.63 327.97 448.16 224.9'/%3E%3Cpolygon class='cls-8' points='137.04 195.8 37.58 224.9 4.49 327.97 92.73 327.97 151.88 328.73 107 241.25 137.04 195.8'/%3E%3Cpolygon class='cls-8' points='272.06 246.01 278.34 136.28 307.24 58.12 178.88 58.12 207.41 136.28 214.06 246.01 216.34 280.62 216.53 365.82 269.21 365.82 269.59 280.62 272.06 246.01'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://metamask.io/download.html"}}}function BR(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}RR.__initStatic();const OR=async(t,e)=>{let n,r=1;for(n=await HM(e).getTransaction(t);r<=120&&!n;)n=await HM(e).getTransaction(t),await new Promise((t=>setTimeout(t,5e3))),r++;return n},LR=({transaction:t,wallet:e})=>t.method?DR({transaction:t,wallet:e}):jR({transaction:t,wallet:e}),DR=async({transaction:t,wallet:e})=>e.connector.sendTransaction({from:t.from,to:t.to,value:BR([t,"access",t=>t.value,"optionalAccess",t=>t.toString,"call",t=>t()]),data:await t.getData(),gas:(await ZM(t)).toString(),gasPrice:(await HM(t.blockchain).getGasPrice()).toString()}),jR=async({transaction:t,wallet:e})=>e.connector.sendTransaction({from:t.from,to:t.to,value:BR([t,"access",t=>t.value,"optionalAccess",t=>t.toString,"call",t=>t()]),gas:(await ZM(t)).toString(),gasPrice:(await HM(t.blockchain).getGasPrice()).toString()});function FR(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}const UR=t=>{window._connectedWalletConnectInstance=t},zR=()=>window._connectedWalletConnectInstance;class HR{static __initStatic(){this.info={name:"WalletConnect",logo:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 500 500' style='enable-background:new 0 0 500 500;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%235991CD;%7D%0A%3C/style%3E%3Cg id='Page-1'%3E%3Cg id='walletconnect-logo-alt'%3E%3Cpath id='WalletConnect' class='st0' d='M102.7,162c81.5-79.8,213.6-79.8,295.1,0l9.8,9.6c4.1,4,4.1,10.5,0,14.4L374,218.9 c-2,2-5.3,2-7.4,0l-13.5-13.2c-56.8-55.7-149-55.7-205.8,0l-14.5,14.1c-2,2-5.3,2-7.4,0L91.9,187c-4.1-4-4.1-10.5,0-14.4 L102.7,162z M467.1,229.9l29.9,29.2c4.1,4,4.1,10.5,0,14.4L362.3,405.4c-4.1,4-10.7,4-14.8,0c0,0,0,0,0,0L252,311.9 c-1-1-2.7-1-3.7,0h0l-95.5,93.5c-4.1,4-10.7,4-14.8,0c0,0,0,0,0,0L3.4,273.6c-4.1-4-4.1-10.5,0-14.4l29.9-29.2 c4.1-4,10.7-4,14.8,0l95.5,93.5c1,1,2.7,1,3.7,0c0,0,0,0,0,0l95.5-93.5c4.1-4,10.7-4,14.8,0c0,0,0,0,0,0l95.5,93.5 c1,1,2.7,1,3.7,0l95.5-93.5C456.4,225.9,463,225.9,467.1,229.9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A",blockchains:["ethereum","bsc","polygon"]}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.connector=HR.instance||this.newWalletConnectInstance(),this.sendTransaction=t=>(async({transaction:t,wallet:e})=>{if(t=new xR(t),await t.prepare({wallet:e}),0==await e.connectedTo(t.blockchain))throw{code:"WRONG_NETWORK"};return await LR({transaction:t,wallet:e}).then((async e=>{if(!e)throw"Submitting transaction failed!";{let n=Wh(t.blockchain);t.id=e,t.url=n.explorerUrlFor({transaction:t}),t.sent&&t.sent(t);let r=await OR(e,t.blockchain);t.nonce=r.nonce,r?r.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t.id=e.replacement.hash,t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t.id=e.replacement.hash,t._failed=!0,t.failed&&t.failed(t,e)):(t._failed=!0,t.failed&&t.failed(t,e))})):(t._failed=!0,console.log("Error retrieving transaction"),t.failed&&t.failed(t,"Error retrieving transaction"))}})),t})({wallet:this,transaction:t})}newWalletConnectInstance(){let t=new ek({bridge:"https://bridge.walletconnect.org",qrcodeModal:nk});return t.on("connect",((t,e)=>{if(t)throw t;const{accounts:n,chainId:r}=e.params[0];this.connectedAccounts=n,this.connectedChainId=r})),t.on("session_update",((t,e)=>{if(t)throw t;const{accounts:n,chainId:r}=e.params[0];this.connectedAccounts=n,this.connectedChainId=r})),t.on("disconnect",((t,e)=>{if(UR(void 0),t)throw t})),t.on("modal_closed",(()=>{UR(void 0),this.connector=void 0})),t}async account(){if(null!=this.connectedAccounts)return this.connectedAccounts[0]}async accounts(){return null==this.connectedAccounts?[]:this.connectedAccounts}async connect(t){try{window.localStorage.removeItem("walletconnect"),null==this.connector&&(this.connector=this.newWalletConnectInstance()),this.connector.connected&&(await this.connector.killSession(),UR(void 0),this.connector=this.newWalletConnectInstance());const{accounts:e,chainId:n}=await this.connector.connect({chainId:FR([t,"optionalAccess",t=>t.chainId])});return e instanceof Array&&e.length&&UR(this),this.connectedAccounts=e,this.connectedChainId=n,e}catch(t){return console.log("WALLETCONNECT ERROR",t),[]}}async connectedTo(t){let e=await this.connector.sendCustomRequest({method:"eth_chainId"});const n=zh(e);return t?t===n.name:n.name}switchTo(t){return new Promise(((t,e)=>{e({code:"NOT_SUPPORTED"})}))}addNetwork(t){return new Promise(((t,e)=>{e({code:"NOT_SUPPORTED"})}))}on(t,e){let n;switch(t){case"account":n=(t,n)=>{const{accounts:r}=n.params[0];r instanceof Array&&e(r[0])},this.connector.on("session_update",n);break;case"accounts":n=(t,n)=>{const{accounts:r}=n.params[0];e(r)},this.connector.on("session_update",n);break;case"network":n=(t,n)=>{const{chainId:r}=n.params[0];r&&e(Hh(r).name)},this.connector.on("session_update",n);break;case"disconnect":n=e,this.connector.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":case"network":this.connector.off("session_update");break;case"disconnect":this.connector.off("disconnect")}}async sign(t){let e=await this.account();var n=[IS(t),e];return await this.connector.signPersonalMessage(n)}}HR.__initStatic();const WR=({transaction:t,provider:e,signer:n})=>t.method?qR({transaction:t,signer:n,provider:e}):GR({transaction:t,signer:n}),qR=({transaction:t,signer:e,provider:n})=>{let r=new iP(t.to,t.api,n);return r.connect(e)[t.method](...t.getContractArguments({contract:r}),{value:xR.bigNumberify(t.value,t.blockchain)})},GR=({transaction:t,signer:e})=>e.sendTransaction({to:t.to,value:xR.bigNumberify(t.value,t.blockchain)}),QR=()=>window._connectedWalletLinkInstance;class VR{static __initStatic(){this.info={name:"Coinbase",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 488.96 488.96'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:url(%23linear-gradient);%7D.cls-2%7Bfill:%234361ad;%7D%3C/style%3E%3ClinearGradient id='linear-gradient' x1='250' y1='7.35' x2='250' y2='496.32' gradientTransform='matrix(1, 0, 0, -1, 0, 502)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233d5ba9'/%3E%3Cstop offset='1' stop-color='%234868b1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath class='cls-1' d='M250,5.68C114.87,5.68,5.52,115,5.52,250.17S114.87,494.65,250,494.65,494.48,385.29,494.48,250.17,385.13,5.68,250,5.68Zm0,387.54A143.06,143.06,0,1,1,393.05,250.17,143.11,143.11,0,0,1,250,393.22Z' transform='translate(-5.52 -5.68)'/%3E%3Cpath class='cls-2' d='M284.69,296.09H215.31a11,11,0,0,1-10.9-10.9V215.48a11,11,0,0,1,10.9-10.91H285a11,11,0,0,1,10.9,10.91v69.71A11.07,11.07,0,0,1,284.69,296.09Z' transform='translate(-5.52 -5.68)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://www.coinbase.com/wallet"}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.connector=VR.instance||this.newWalletLinkInstance(),this.sendTransaction=t=>(async({transaction:t,wallet:e})=>{t=new xR(t),0==await e.connectedTo(t.blockchain)&&await e.switchTo(t.blockchain),await t.prepare({wallet:e});let n=new ER(e.connector,"any"),r=n.getSigner(0);return await WR({transaction:t,provider:n,signer:r}).then((e=>{if(!e)throw"Submitting transaction failed!";t.id=e.hash,t.nonce=e.nonce,t.url=Wh(t.blockchain).explorerUrlFor({transaction:t}),t.sent&&t.sent(t),e.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?(e.replacement&&e.replacement.hash&&(t.id=e.replacement.hash,t.url=Wh(t.blockchain).explorerUrlFor({transaction:t})),e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t._failed=!0,t.failed&&t.failed(t,e))):(t._failed=!0,t.failed&&t.failed(t,e))}))})),t})({wallet:this,transaction:t})}newWalletLinkInstance(){return new ik({}).makeWeb3Provider()}async account(){if(null!=this.connectedAccounts)return this.connectedAccounts[0]}async accounts(){return null==this.connectedAccounts?[]:this.connectedAccounts}async connect(t){(await this.connector._relayProvider()).setConnectDisabled(!1);let e=await this.connector.enable();var n;return e instanceof Array&&e.length&&(n=this,window._connectedWalletLinkInstance=n),this.connectedAccounts=e,this.connectedChainId=await this.connector.getChainId(),e}async connectedTo(t){let e=await this.connector.getChainId();const n=Hh(e);return t?t===n.name:n.name}switchTo(t){return new Promise(((e,n)=>{const r=Wh(t);this.connector.request({method:"wallet_switchEthereumChain",params:[{chainId:r.id}]}).then(e).catch((r=>{4902===r.code?this.addNetwork(t).then((()=>this.switchTo(t).then(e))).catch(n):n(r)}))}))}addNetwork(t){return new Promise(((e,n)=>{const r=Wh(t);this.connector.request({method:"wallet_addEthereumChain",params:[{chainId:r.id,chainName:r.fullName,nativeCurrency:{name:r.currency.name,symbol:r.currency.symbol,decimals:r.currency.decimals},rpcUrls:[r.rpc],blockExplorerUrls:[r.explorer],iconUrls:[r.logo]}]}).then(e).catch(n)}))}on(t,e){let n;switch(t){case"account":n=t=>e(t[0]),this.connector.on("accountsChanged",n);break;case"accounts":n=t=>e(t),this.connector.on("accountsChanged",n);break;case"network":n=t=>e(zh(t).name),this.connector.on("chainChanged",n);break;case"disconnect":n=e,this.connector.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":this.connector.removeListener("accountsChanged",e);break;case"network":this.connector.removeListener("chainChanged",e);break;case"disconnect":this.connector.removeListener("disconnect",e)}return e}async sign(t){await this.account();let e=new ER(this.connector,"any").getSigner(0);return await e.signMessage(t)}}VR.__initStatic();const YR={MetaMask:RR,Coinbase:PR,Web3Wallet:NR,WalletConnect:HR,WalletLink:VR},JR={},ZR=function(){const t=zR()?YR.WalletConnect:QR()?YR.WalletLink:"object"==typeof window.ethereum&&window.ethereum.isMetaMask?YR.MetaMask:"object"==typeof window.ethereum&&(window.ethereum.isCoinbaseWallet||window.ethereum.isWalletLink)?YR.Coinbase:void 0!==window.ethereum?YR.Web3Wallet:void 0,e=JR[t];return zR()?zR():QR()?QR():e||(t?(JR[t]=new t,JR[t]):void 0)};var KR=function(t){var e=f(V.useState(!1),2),r=e[0],i=e[1],o=V.useContext(ah).navigate,s=ZR();V.useEffect((function(){n(l.mark((function e(){var n;return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s){e.next=5;break}return e.next=3,s.accounts();case 3:null!=(n=e.sent)&&0!=n.length||(o("ConnectingWallet"),t.connect(s));case 5:case"end":return e.stop()}}),e)})))()}),[s]);var a=[YR.WalletConnect,YR.WalletLink];s&&a.unshift(s.constructor);var u=a.map((function(e,n){var r=e.info.name;return"WalletConnect"==r&&(r="via WalletConnect"),V.createElement("div",{key:n,className:"PaddingBottomXS"},V.createElement("button",{className:"Card small",title:"Connect ".concat(r),onClick:function(){return function(e){var n=new e;t.setWallet(n),o("ConnectingWallet"),t.connect(n)}(e)}},V.createElement("div",{className:"CardImage square"},V.createElement("img",{className:"transparent",src:e.info.logo})),V.createElement("div",{className:"CardBody"},V.createElement("div",{className:"CardBodyWrapper PaddingLeftXS"},V.createElement("h2",{className:"CardText FontWeightBold"},r)))))}));return V.createElement(hh,{header:V.createElement("div",{className:"PaddingTopS PaddingLeftM PaddingRightM TextLeft"},V.createElement("h1",{className:"LineHeightL FontSizeL"},"Select a wallet")),body:V.createElement("div",{className:"PaddingBottomS PaddingLeftS PaddingRightS"},u),footer:V.createElement("div",{className:"PaddingBottomS"},V.createElement("button",{className:"FontSizeS FontWeightBold TextButton",onClick:function(){return i(!r)}},V.createElement("strong",{className:"Opacity05"},"What is a wallet?")),r&&V.createElement("p",{className:"PaddingLeftM PaddingRightM"},"Wallets are used to send, receive, and store digital assets. Wallets come in many forms. They are either built into your browser, an extension added to your browser, a piece of hardware plugged into your computer or even an app on your phone."))})},XR=function(t){var e=V.useContext(Y),r=e.open,i=e.close,o=f(V.useState(),2),s=o[0],a=o[1],u=f(V.useState(),2),c=u[0],h=u[1],d=function(e){e.connect().then(n(l.mark((function n(){var r;return l.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.accounts();case 2:(r=n.sent)instanceof Array&&r.length>0&&(t.autoClose&&i(),t.resolve&&t.resolve({wallet:e,account:r[0],accounts:r}));case 4:case"end":return n.stop()}}),n)})))).catch((function(e){a(!1),4001!=(null==e?void 0:e.code)&&(-32002!=(null==e?void 0:e.code)?t.reject&&t.reject(e):a(!0))}))};return V.useEffect((function(){var t=ZR();t&&h(t)}),[]),V.useEffect((function(){n(l.mark((function e(){var n;return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c){e.next=5;break}return e.next=3,c.accounts();case 3:(n=e.sent)instanceof Array&&n.length>0&&t.resolve&&t.resolve({wallet:c,account:n[0],accounts:n});case 5:case"end":return e.stop()}}),e)})))()}),[c]),V.createElement(ch,{open:r,close:i,start:"SelectWallet",container:t.container,document:t.document,dialogs:{SelectWallet:V.createElement(KR,{setWallet:h,connect:d}),ConnectingWallet:V.createElement(fh,{wallet:c,pending:s,connect:d})}})},$R=function(t){return void 0===t?window.document:t};function tB(t,e){for(var n=0;nfunction({insideRoot:t,outsideContainer:e}){t.unmount(),e.remove()}({insideRoot:u,outsideContainer:s})}}var MB=function(t,e){var n,r=t.style,i=t.container,o=t.document,s=t.closed,a=function(t){var e,n;return t={colors:Object.assign({primary:"#ea357a",buttonText:"#ffffff",icons:"#000000",text:"#212529"},(null===(e=t)||void 0===e?void 0:e.colors)||{}),fontFamily:(null===(n=t)||void 0===n?void 0:n.fontFamily)||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},["\n\n html, body, div, span, applet, object, iframe,\n h1, h2, h3, h4, h5, h6, p, blockquote, pre,\n a, abbr, acronym, address, big, cite, code,\n del, dfn, em, img, ins, kbd, q, s, samp,\n small, strike, strong, sub, sup, tt, var,\n b, u, i, center,\n dl, dt, dd, ol, ul, li,\n fieldset, form, label, legend,\n table, caption, tbody, tfoot, thead, tr, th, td,\n article, aside, canvas, details, embed, \n figure, figcaption, footer, header, hgroup, \n menu, nav, output, ruby, section, summary,\n time, mark, audio, video {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n text-align: inherit;\n vertical-align: baseline;\n }\n\n article, aside, details, figcaption, figure, \n footer, header, hgroup, menu, nav, section {\n display: block;\n }\n\n body {\n line-height: 1;\n }\n\n ol, ul {\n list-style: none;\n }\n\n blockquote, q {\n quotes: none;\n }\n\n blockquote:before, blockquote:after,\n q:before, q:after {\n content: '';\n content: none;\n }\n \n table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n * {\n box-sizing: border-box;\n }\n\n button {\n border: 0;\n background: none;\n outline: none;\n }\n\n ","\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .contained .ReactDialog {\n position: absolute;\n height: 100%;\n min-height: 100%;\n width: 100%;\n min-width: 100%;\n }\n\n .contained .ReactDialogBackground {\n position: absolute;\n }\n\n .contained .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n top: 0;\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.2);\n border-radius: 13px;\n background: rgb(248,248,248);\n }\n\n @media (max-width: 450px) {\n\n .Dialog {\n border-radius: 0;\n width: 100%;\n }\n }\n\n @media (orientation: portrait) and (max-width: 800px) {\n\n .ReactDialogAnimation {\n width: 100%;\n }\n\n .ReactDialog {\n height: 100%;\n min-height: 100%;\n }\n\n .ReactDialogStack {\n align-items: flex-end;\n }\n\n .Dialog {\n align-content: stretch;\n border-radius: 13px;\n border-top-radius: 13px;\n display: flex;\n flex-direction: column;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n }\n\n .DialogFooter {\n padding-bottom: 20px;\n }\n\n .ReactDialogAnimation {\n margin-bottom: -100px !important;\n top: inherit !important;\n position: relative;\n transition: opacity 0.4s ease, margin-bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n margin-bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n align-items: flex-end;\n }\n }\n\n .DialogBody {\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.ScrollHeight {\n height: 30vh !important;\n max-height: 30vh !important;\n }\n\n .DialogHeader {\n border-top-left-radius: 13px;\n border-top-right-radius: 13px;\n min-height: 54px;\n position: relative;\n width: 100%;\n }\n\n .DialogHeaderActionRight {\n position: absolute;\n top: 0;\n right: 0;\n height: 48px;\n }\n\n .DialogHeaderActionLeft {\n position: absolute;\n top: 0;\n left: 0;\n height: 48px;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 13px;\n border-bottom-right-radius: 13px;\n line-height: 24px;\n min-height: 32px;\n position: relative;\n text-align: center;\n }\n\n ","\n\n .ButtonCircular {\n border-radius: 9999px;\n cursor: pointer;\n height: 34px;\n opacity: 0.5;\n padding: 5px 4px 4px 4px;\n width: 34px;\n }\n\n .ButtonCircular:hover {\n background: rgba(0,0,0,0.1);\n opacity: 1;\n }\n\n .ButtonCircular:active {\n background: rgba(0,0,0,0.25);\n opacity: 1;\n }\n ",cB(t),hB(t),'\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 3px;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .contained .PoweredByWrapper {\n position: absolute;\n }\n\n .PoweredByLink {\n color: white;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;\n font-size: 14px;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 8px;\n opacity: 0.5;\n text-decoration: none;\n text-shadow: black 0 0 2px;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n }\n ',"\n\n .GraphicWrapper {\n display: block;\n }\n\n .Graphic {\n width: 50%;\n position: relative;\n }\n ","\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n border: 0px solid transparent !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ","\n \n .TokenAmountRow {\n min-width: 0;\n width: 100%;\n display: flex;\n flex-direction: row;\n }\n\n .TokenAmountCell {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .TokenSymbolCell {\n }\n ",bB(t),fB(t),dB(t),"\n\n .Opacity05 {\n opacity: 0.5;\n }\n ","\n\n .PaddingTopXS {\n padding-top: 3px;\n }\n\n .PaddingRightXS {\n padding-right: 3px;\n }\n\n .PaddingBottomXS {\n padding-bottom: 3px;\n }\n\n .PaddingLeftXS {\n padding-left: 3px; \n }\n\n .PaddingTopS {\n padding-top: 13px;\n }\n\n .PaddingRightS {\n padding-right: 13px;\n }\n\n .PaddingBottomS {\n padding-bottom: 13px;\n }\n\n .PaddingLeftS {\n padding-left: 13px; \n }\n\n .PaddingTopM {\n padding-top: 19px;\n }\n\n .PaddingRightM {\n padding-right: 19px;\n }\n\n .PaddingBottomM {\n padding-bottom: 19px;\n }\n\n .PaddingLeftM {\n padding-left: 19px; \n }\n\n .PaddingTopL {\n padding-top: 29px;\n }\n\n .PaddingRightL {\n padding-right: 29px;\n }\n\n .PaddingBottomL {\n padding-bottom: 29px;\n }\n\n .PaddingLeftL {\n padding-left: 29px; \n }\n ","\n\n .MaxHeight {\n max-height: 320px;\n overflow-y: auto;\n }\n ",mB(t),gB(t),"\n\n .Input {\n background: none;\n border: 1px solid transparent;\n margin: 0;\n outline: none !important;\n padding: 0 0 0 14px;\n width: 100%;\n }\n\n .Input::placeholder {\n color: rgb(210,210,210);\n }\n \n ",vB(t),"\n\n .MaxAmountImage {\n display: inline-block;\n padding-right: 6px;\n }\n \n .MaxAmountImage img {\n height: 16px;\n width: 16px;\n position: relative;\n top: 3px;\n }\n ","\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ",yB(t),"\n\n .TokenImage img {\n border-radius: 9999px;\n border: 1px solid white;\n background: white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 45px;\n position: relative;\n vertical-align: middle;\n width: 45px;\n }\n\n .TokenImage.medium img {\n height: 93px;\n width: 93px;\n }\n ","\n\n .Alert {\n background: rgba(0,0,0,0.08);\n border-radius: 7px;\n font-weight: 500;\n padding: 8px;\n }\n ","\n\n .Table {\n border-collapse: separate;\n border-radius: 7px;\n border-style: hidden;\n border: 1px solid rgba(0,0,0,0.1);\n width: 100%;\n }\n\n .Table tr.small td {\n font-size: 14px;\n }\n\n .Table tr td {\n border-bottom: 1px solid rgba(0,0,0,0.1);\n word-break: break-all;\n }\n \n .Table tr:last-child td {\n border-bottom: none;\n }\n \n .Table tr td {\n padding: 8px 15px;\n text-align: left;\n }\n \n .Table tr td:first-child {\n width: 30%\n }\n\n .Table tr td:last-child {\n width: 70%\n }\n \n .Table .TableSubTitle {\n font-weight: 300;\n opacity: 0.7;\n }\n\n .Table tr td:last-child {\n font-weight: 500;\n }\n ",pB(t),wB(t)].join("")}(r);r&&r.css&&(a=[a,r.css].join(" ")),n=i?"\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 99999;\n ":"\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 99999;\n ";var u=EB({document:o,element:i||o.body,content:e((function(){setTimeout((function(){u(),"function"==typeof s&&s()}),300)})),outsideStyle:n,insideStyle:a,insideClasses:i?["contained"]:[]}).unmount;return u},kB=function(){return V.createElement("div",{className:"PoweredByWrapper"},V.createElement("a",{href:"https://depay.com",rel:"noopener noreferrer",target:"_blank",className:"PoweredByLink"},"by DePay"))},xB=function(){if(parseInt(V.version.split(".")[0])<17)throw"depay/widgets require at least React v17"},SB=function(t){var e=f(V.useState(!0),2),n=e[0],r=e[1];return V.createElement(J.Provider,{value:{updatable:n,setUpdatable:r}},t.children)},CB=function(t){var e,i,o;return xB(),"object"==r(t)&&(e=t.style,i=t.error,o=t.document),new Promise(function(){var t=n(l.mark((function t(n,r){var s,a;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(s=ZR())){t.next=7;break}return t.next=4,s.accounts();case 4:if(!((a=t.sent)instanceof Array&&a.length>0)){t.next=7;break}return t.abrupt("return",n({wallet:s,accounts:a,account:a[0]}));case 7:MB({style:e,document:$R(o)},(function(t){var e=function(){r("USER_CLOSED_DIALOG"),t()};return function(s){return V.createElement(lB,{errorCallback:i,container:s,unmount:t},V.createElement(SB,null,V.createElement(Z,{unmount:e},V.createElement(XR,{document:o,container:s,resolve:n,reject:r,autoClose:!0}),V.createElement(kB,null))))}}));case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},TB=V.createContext(),IB=V.createContext(),NB=V.createContext();function PB(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var RB,BB,OB=function(t){var e=PB(t).sort((function(t,e){var n=bm.from(t.fromBalance).div(bm.from(t.fromAmount)),r=bm.from(e.fromBalance).div(bm.from(e.fromAmount));return n.lt(r)?-1:r.lt(n)?1:0}));return e[e.length-1]},LB=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",r=parseFloat(t),i=r.toString().match(/\d+\.0*(\d{3})/);if(null!==(e=i)&&void 0!==e&&e.length){var o,s,a=(i=i[0]).match(/\d{3}$/)[0];return a.match(/^00/)?r:(a.match(/^0/)?(o=parseFloat("".concat(a[1],".").concat(a[2])),s=parseFloat(o).toFixed(1),s="0".concat(s).replace(".","")):(o="up"==n?parseFloat("".concat(a[0],".").concat(a[1],"9")):parseFloat("".concat(a[0],".").concat(a[1],"1")),s=parseFloat(o).toFixed(1).replace(".","")),"099"==s&&0==parseInt(r.toFixed(0))?(s="up"==n?"100":"990",parseFloat(i.replace(/\d{3}$/,s))):"100"==s&&0==parseInt(r.toFixed(0))?parseFloat(i.replace(/\d{4}$/,s)):"0"!=s.toString()[0]&&s.toString().length>2?parseInt(r.toFixed(0)):parseFloat(i.replace(/\d{3}$/,s)))}return parseFloat(r.toFixed(2))},DB=V.createContext(),jB=o((function(t,e){(function(){var n,r="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",a=16,u=32,l=64,c=128,h=256,f=1/0,d=9007199254740991,p=NaN,m=4294967295,g=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",u],["partialRight",l],["rearg",h]],y="[object Arguments]",v="[object Array]",b="[object Boolean]",w="[object Date]",A="[object Error]",_="[object Function]",E="[object GeneratorFunction]",M="[object Map]",k="[object Number]",x="[object Object]",S="[object Promise]",C="[object RegExp]",T="[object Set]",I="[object String]",N="[object Symbol]",P="[object WeakMap]",R="[object ArrayBuffer]",B="[object DataView]",O="[object Float32Array]",L="[object Float64Array]",D="[object Int8Array]",j="[object Int16Array]",F="[object Int32Array]",U="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",W="[object Uint32Array]",q=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,J=RegExp(V.source),Z=RegExp(Y.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,it=RegExp(rt.source),ot=/^\s+/,st=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,mt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,bt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,At=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,Et="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Mt="a-z\\xdf-\\xf6\\xf8-\\xff",kt="A-Z\\xc0-\\xd6\\xd8-\\xde",xt="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="['’]",Tt="[\\ud800-\\udfff]",It="["+St+"]",Nt="["+Et+"]",Pt="\\d+",Rt="[\\u2700-\\u27bf]",Bt="["+Mt+"]",Ot="[^\\ud800-\\udfff"+St+Pt+"\\u2700-\\u27bf"+Mt+kt+"]",Lt="\\ud83c[\\udffb-\\udfff]",Dt="[^\\ud800-\\udfff]",jt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Ut="["+kt+"]",zt="(?:"+Bt+"|"+Ot+")",Ht="(?:"+Ut+"|"+Ot+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gt="(?:"+Nt+"|"+Lt+")?",Qt="[\\ufe0e\\ufe0f]?",Vt=Qt+Gt+"(?:\\u200d(?:"+[Dt,jt,Ft].join("|")+")"+Qt+Gt+")*",Yt="(?:"+[Rt,jt,Ft].join("|")+")"+Vt,Jt="(?:"+[Dt+Nt+"?",Nt,jt,Ft,Tt].join("|")+")",Zt=RegExp(Ct,"g"),Kt=RegExp(Nt,"g"),Xt=RegExp(Lt+"(?="+Lt+")|"+Jt+Vt,"g"),$t=RegExp([Ut+"?"+Bt+"+"+Wt+"(?="+[It,Ut,"$"].join("|")+")",Ht+"+"+qt+"(?="+[It,Ut+zt,"$"].join("|")+")",Ut+"?"+zt+"+"+Wt,Ut+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Yt].join("|"),"g"),te=RegExp("[\\u200d\\ud800-\\udfff"+Et+xt+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[O]=ie[L]=ie[D]=ie[j]=ie[F]=ie[U]=ie[z]=ie[H]=ie[W]=!0,ie[y]=ie[v]=ie[R]=ie[b]=ie[B]=ie[w]=ie[A]=ie[_]=ie[M]=ie[k]=ie[x]=ie[C]=ie[T]=ie[I]=ie[P]=!1;var oe={};oe[y]=oe[v]=oe[R]=oe[B]=oe[b]=oe[w]=oe[O]=oe[L]=oe[D]=oe[j]=oe[F]=oe[M]=oe[k]=oe[x]=oe[C]=oe[T]=oe[I]=oe[N]=oe[U]=oe[z]=oe[H]=oe[W]=!0,oe[A]=oe[_]=oe[P]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,ue=parseInt,le="object"==typeof i&&i&&i.Object===Object&&i,ce="object"==typeof self&&self&&self.Object===Object&&self,he=le||ce||Function("return this")(),fe=e&&!e.nodeType&&e,de=fe&&t&&!t.nodeType&&t,pe=de&&de.exports===fe,me=pe&&le.process,ge=function(){try{return de&&de.require&&de.require("util").types||me&&me.binding&&me.binding("util")}catch(t){}}(),ye=ge&&ge.isArrayBuffer,ve=ge&&ge.isDate,be=ge&&ge.isMap,we=ge&&ge.isRegExp,Ae=ge&&ge.isSet,_e=ge&&ge.isTypedArray;function Ee(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Me(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function Ie(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function $e(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var en=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=qe({"&":"&","<":"<",">":">",'"':""","'":"'"});function rn(t){return"\\"+se[t]}function on(t){return te.test(t)}function sn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t,e){return function(n){return t(e(n))}}function un(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"}),mn=function t(e){var i,st=(e=null==e?he:mn.defaults(he.Object(),e,mn.pick(he,ne))).Array,Et=e.Date,Mt=e.Error,kt=e.Function,xt=e.Math,St=e.Object,Ct=e.RegExp,Tt=e.String,It=e.TypeError,Nt=st.prototype,Pt=kt.prototype,Rt=St.prototype,Bt=e["__core-js_shared__"],Ot=Pt.toString,Lt=Rt.hasOwnProperty,Dt=0,jt=(i=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",Ft=Rt.toString,Ut=Ot.call(St),zt=he._,Ht=Ct("^"+Ot.call(Lt).replace(rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wt=pe?e.Buffer:n,qt=e.Symbol,Gt=e.Uint8Array,Qt=Wt?Wt.allocUnsafe:n,Vt=an(St.getPrototypeOf,St),Yt=St.create,Jt=Rt.propertyIsEnumerable,Xt=Nt.splice,te=qt?qt.isConcatSpreadable:n,se=qt?qt.iterator:n,le=qt?qt.toStringTag:n,ce=function(){try{var t=po(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),fe=e.clearTimeout!==he.clearTimeout&&e.clearTimeout,de=Et&&Et.now!==he.Date.now&&Et.now,me=e.setTimeout!==he.setTimeout&&e.setTimeout,ge=xt.ceil,Le=xt.floor,qe=St.getOwnPropertySymbols,gn=Wt?Wt.isBuffer:n,yn=e.isFinite,vn=Nt.join,bn=an(St.keys,St),wn=xt.max,An=xt.min,_n=Et.now,En=e.parseInt,Mn=xt.random,kn=Nt.reverse,xn=po(e,"DataView"),Sn=po(e,"Map"),Cn=po(e,"Promise"),Tn=po(e,"Set"),In=po(e,"WeakMap"),Nn=po(St,"create"),Pn=In&&new In,Rn={},Bn=zo(xn),On=zo(Sn),Ln=zo(Cn),Dn=zo(Tn),jn=zo(In),Fn=qt?qt.prototype:n,Un=Fn?Fn.valueOf:n,zn=Fn?Fn.toString:n;function Hn(t){if(ia(t)&&!Vs(t)&&!(t instanceof Qn)){if(t instanceof Gn)return t;if(Lt.call(t,"__wrapped__"))return Ho(t)}return new Gn(t)}var Wn=function(){function t(){}return function(e){if(!ra(e))return{};if(Yt)return Yt(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function qn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Qn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function cr(t,e,r,i,o,s){var a,u=1&e,l=2&e,c=4&e;if(r&&(a=o?r(t,i,o,s):r(t)),a!==n)return a;if(!ra(t))return t;var h=Vs(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Ni(t,a)}else{var f=yo(t),d=f==_||f==E;if(Ks(t))return ki(t,u);if(f==x||f==y||d&&!o){if(a=l||d?{}:bo(t),!u)return l?function(t,e){return Pi(t,go(t),e)}(t,function(t,e){return t&&Pi(e,Oa(e),t)}(a,t)):function(t,e){return Pi(t,mo(t),e)}(t,sr(a,t))}else{if(!oe[f])return o?t:{};a=function(t,e,n){var r,i=t.constructor;switch(e){case R:return xi(t);case b:case w:return new i(+t);case B:return function(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case O:case L:case D:case j:case F:case U:case z:case H:case W:return Si(t,n);case M:return new i;case k:case I:return new i(t);case C:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case T:return new i;case N:return r=t,Un?St(Un.call(r)):{}}}(t,f,u)}}s||(s=new Kn);var p=s.get(t);if(p)return p;s.set(t,a),la(t)?t.forEach((function(n){a.add(cr(n,e,r,n,t,s))})):oa(t)&&t.forEach((function(n,i){a.set(i,cr(n,e,r,i,t,s))}));var m=h?n:(c?l?so:oo:l?Oa:Ba)(t);return ke(m||t,(function(n,i){m&&(n=t[i=n]),rr(a,i,cr(n,e,r,i,t,s))})),a}function hr(t,e,r){var i=r.length;if(null==t)return!i;for(t=St(t);i--;){var o=r[i],s=e[o],a=t[o];if(a===n&&!(o in t)||!s(a))return!1}return!0}function fr(t,e,i){if("function"!=typeof t)throw new It(r);return Bo((function(){t.apply(n,i)}),e)}function dr(t,e,n,r){var i=-1,o=Te,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;n&&(e=Ne(e,Je(n))),r?(o=Ie,s=!1):e.length>=200&&(o=Ke,s=!1,e=new Zn(e));t:for(;++i-1},Yn.prototype.set=function(t,e){var n=this.__data__,r=ir(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Sn||Yn),string:new Vn}},Jn.prototype.delete=function(t){var e=ho(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return ho(this,t).get(t)},Jn.prototype.has=function(t){return ho(this,t).has(t)},Jn.prototype.set=function(t,e){var n=ho(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Zn.prototype.add=Zn.prototype.push=function(t){return this.__data__.set(t,o),this},Zn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Kn.prototype.get=function(t){return this.__data__.get(t)},Kn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var pr=Oi(_r),mr=Oi(Er,!0);function gr(t,e){var n=!0;return pr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function yr(t,e,r){for(var i=-1,o=t.length;++i0&&n(a)?e>1?br(a,e-1,n,r,i):Pe(i,a):r||(i[i.length]=a)}return i}var wr=Li(),Ar=Li(!0);function _r(t,e){return t&&wr(t,e,Ba)}function Er(t,e){return t&&Ar(t,e,Ba)}function Mr(t,e){return Ce(e,(function(e){return ta(t[e])}))}function kr(t,e){for(var r=0,i=(e=Ai(e,t)).length;null!=t&&re}function Tr(t,e){return null!=t&&Lt.call(t,e)}function Ir(t,e){return null!=t&&e in St(t)}function Nr(t,e,r){for(var i=r?Ie:Te,o=t[0].length,s=t.length,a=s,u=st(s),l=1/0,c=[];a--;){var h=t[a];a&&e&&(h=Ne(h,Je(e))),l=An(h.length,l),u[a]=!r&&(e||o>=120&&h.length>=120)?new Zn(a&&h):n}h=t[0];var f=-1,d=u[0];t:for(;++f=a?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Vr(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)a!==t&&Xt.call(a,u,1),Xt.call(t,u,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Ao(i)?Xt.call(t,i,1):di(t,i)}}return t}function Zr(t,e){return t+Le(Mn()*(e-t+1))}function Kr(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=Le(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Oo(To(t,e,su),t+"")}function $r(t){return $n(Wa(t))}function ti(t,e){var n=Wa(t);return jo(n,lr(e,0,n.length))}function ei(t,e,r,i){if(!ra(t))return t;for(var o=-1,s=(e=Ai(e,t)).length,a=s-1,u=t;null!=u&&++oi?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=st(i);++r>>1,s=t[o];null!==s&&!ha(s)&&(n?s<=e:s=200){var l=e?null:Ki(t);if(l)return ln(l);s=!1,i=Ke,u=new Zn}else u=e?[]:a;t:for(;++r=i?t:oi(t,e,r)}var Mi=fe||function(t){return he.clearTimeout(t)};function ki(t,e){if(e)return t.slice();var n=t.length,r=Qt?Qt(n):new t.constructor(n);return t.copy(r),r}function xi(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function Si(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ci(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,s=ha(t),a=e!==n,u=null===e,l=e==e,c=ha(e);if(!u&&!c&&!s&&t>e||s&&a&&l&&!u&&!c||i&&a&&l||!r&&l||!o)return 1;if(!i&&!s&&!c&&t1?r[o-1]:n,a=o>2?r[2]:n;for(s=t.length>3&&"function"==typeof s?(o--,s):n,a&&_o(r[0],r[1],a)&&(s=o<3?n:s,o=1),e=St(e);++i-1?o[s?e[a]:a]:n}}function zi(t){return io((function(e){var i=e.length,o=i,s=Gn.prototype.thru;for(t&&e.reverse();o--;){var a=e[o];if("function"!=typeof a)throw new It(r);if(s&&!u&&"wrapper"==uo(a))var u=new Gn([],!0)}for(o=u?o:i;++o1&&v.reverse(),f&&lu))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var f=-1,d=!0,p=2&r?new Zn:n;for(s.set(t,e),s.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return ke(g,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ut);return e?e[1].split(lt):[]}(r),n)))}function Do(t){var e=0,r=0;return function(){var i=_n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function jo(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r1?t[e-1]:n;return r="function"==typeof r?(t.pop(),r):n,us(t,r)}));function ms(t){var e=Hn(t);return e.__chain__=!0,e}function gs(t,e){return e(t)}var ys=io((function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return ur(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Qn&&Ao(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:gs,args:[o],thisArg:n}),new Gn(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(o)})),vs=Ri((function(t,e,n){Lt.call(t,n)?++t[n]:ar(t,n,1)})),bs=Ui(Qo),ws=Ui(Vo);function As(t,e){return(Vs(t)?ke:pr)(t,co(e,3))}function _s(t,e){return(Vs(t)?xe:mr)(t,co(e,3))}var Es=Ri((function(t,e,n){Lt.call(t,n)?t[n].push(e):ar(t,n,[e])})),Ms=Xr((function(t,e,n){var r=-1,i="function"==typeof e,o=Js(t)?st(t.length):[];return pr(t,(function(t){o[++r]=i?Ee(e,t,n):Pr(t,e,n)})),o})),ks=Ri((function(t,e,n){ar(t,n,e)}));function xs(t,e){return(Vs(t)?Ne:zr)(t,co(e,3))}var Ss=Ri((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Cs=Xr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&_o(t,e[0],e[1])?e=[]:n>2&&_o(e[0],e[1],e[2])&&(e=[e[0]]),Qr(t,br(e,1),[])})),Ts=de||function(){return he.Date.now()};function Is(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,$i(t,c,n,n,n,n,e)}function Ns(t,e){var i;if("function"!=typeof e)throw new It(r);return t=ya(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var Ps=Xr((function(t,e,n){var r=1;if(n.length){var i=un(n,lo(Ps));r|=u}return $i(t,r,e,n,i)})),Rs=Xr((function(t,e,n){var r=3;if(n.length){var i=un(n,lo(Rs));r|=u}return $i(e,r,t,n,i)}));function Bs(t,e,i){var o,s,a,u,l,c,h=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new It(r);function m(e){var r=o,i=s;return o=s=n,h=e,u=t.apply(i,r)}function g(t){return h=t,l=Bo(v,e),f?m(t):u}function y(t){var r=t-c;return c===n||r>=e||r<0||d&&t-h>=a}function v(){var t=Ts();if(y(t))return b(t);l=Bo(v,function(t){var n=e-(t-c);return d?An(n,a-(t-h)):n}(t))}function b(t){return l=n,p&&o?m(t):(o=s=n,u)}function w(){var t=Ts(),r=y(t);if(o=arguments,s=this,c=t,r){if(l===n)return g(c);if(d)return Mi(l),l=Bo(v,e),m(c)}return l===n&&(l=Bo(v,e)),u}return e=ba(e)||0,ra(i)&&(f=!!i.leading,a=(d="maxWait"in i)?wn(ba(i.maxWait)||0,e):a,p="trailing"in i?!!i.trailing:p),w.cancel=function(){l!==n&&Mi(l),h=0,o=c=s=l=n},w.flush=function(){return l===n?u:b(Ts())},w}var Os=Xr((function(t,e){return fr(t,1,e)})),Ls=Xr((function(t,e,n){return fr(t,ba(e)||0,n)}));function Ds(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ds.Cache||Jn),n}function js(t){if("function"!=typeof t)throw new It(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ds.Cache=Jn;var Fs=_i((function(t,e){var n=(e=1==e.length&&Vs(e[0])?Ne(e[0],Je(co())):Ne(br(e,1),Je(co()))).length;return Xr((function(r){for(var i=-1,o=An(r.length,n);++i=e})),Qs=Rr(function(){return arguments}())?Rr:function(t){return ia(t)&&Lt.call(t,"callee")&&!Jt.call(t,"callee")},Vs=st.isArray,Ys=ye?Je(ye):function(t){return ia(t)&&Sr(t)==R};function Js(t){return null!=t&&na(t.length)&&!ta(t)}function Zs(t){return ia(t)&&Js(t)}var Ks=gn||bu,Xs=ve?Je(ve):function(t){return ia(t)&&Sr(t)==w};function $s(t){if(!ia(t))return!1;var e=Sr(t);return e==A||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!aa(t)}function ta(t){if(!ra(t))return!1;var e=Sr(t);return e==_||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ea(t){return"number"==typeof t&&t==ya(t)}function na(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ra(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ia(t){return null!=t&&"object"==typeof t}var oa=be?Je(be):function(t){return ia(t)&&yo(t)==M};function sa(t){return"number"==typeof t||ia(t)&&Sr(t)==k}function aa(t){if(!ia(t)||Sr(t)!=x)return!1;var e=Vt(t);if(null===e)return!0;var n=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ot.call(n)==Ut}var ua=we?Je(we):function(t){return ia(t)&&Sr(t)==C},la=Ae?Je(Ae):function(t){return ia(t)&&yo(t)==T};function ca(t){return"string"==typeof t||!Vs(t)&&ia(t)&&Sr(t)==I}function ha(t){return"symbol"==typeof t||ia(t)&&Sr(t)==N}var fa=_e?Je(_e):function(t){return ia(t)&&na(t.length)&&!!ie[Sr(t)]},da=Yi(Ur),pa=Yi((function(t,e){return t<=e}));function ma(t){if(!t)return[];if(Js(t))return ca(t)?fn(t):Ni(t);if(se&&t[se])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[se]());var e=yo(t);return(e==M?sn:e==T?ln:Wa)(t)}function ga(t){return t?(t=ba(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ya(t){var e=ga(t),n=e%1;return e==e?n?e-n:e:0}function va(t){return t?lr(ya(t),0,m):0}function ba(t){if("number"==typeof t)return t;if(ha(t))return p;if(ra(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ra(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var n=gt.test(t);return n||vt.test(t)?ue(t.slice(2),n?2:8):mt.test(t)?p:+t}function wa(t){return Pi(t,Oa(t))}function Aa(t){return null==t?"":hi(t)}var _a=Bi((function(t,e){if(xo(e)||Js(e))Pi(e,Ba(e),t);else for(var n in e)Lt.call(e,n)&&rr(t,n,e[n])})),Ea=Bi((function(t,e){Pi(e,Oa(e),t)})),Ma=Bi((function(t,e,n,r){Pi(e,Oa(e),t,r)})),ka=Bi((function(t,e,n,r){Pi(e,Ba(e),t,r)})),xa=io(ur),Sa=Xr((function(t,e){t=St(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&_o(e[0],e[1],o)&&(i=1);++r1),e})),Pi(t,so(t),n),r&&(n=cr(n,7,no));for(var i=e.length;i--;)di(n,e[i]);return n})),Fa=io((function(t,e){return null==t?{}:function(t,e){return Vr(t,e,(function(e,n){return Ia(t,n)}))}(t,e)}));function Ua(t,e){if(null==t)return{};var n=Ne(so(t),(function(t){return[t]}));return e=co(e),Vr(t,n,(function(t,n){return e(t,n[0])}))}var za=Xi(Ba),Ha=Xi(Oa);function Wa(t){return null==t?[]:Ze(t,Ba(t))}var qa=ji((function(t,e,n){return e=e.toLowerCase(),t+(n?Ga(e):e)}));function Ga(t){return $a(Aa(t).toLowerCase())}function Qa(t){return(t=Aa(t))&&t.replace(wt,en).replace(Kt,"")}var Va=ji((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ya=ji((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ja=Di("toLowerCase"),Za=ji((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ka=ji((function(t,e,n){return t+(n?" ":"")+$a(e)})),Xa=ji((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),$a=Di("toUpperCase");function tu(t,e,r){return t=Aa(t),(e=r?n:e)===n?function(t){return ee.test(t)}(t)?function(t){return t.match($t)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(e)||[]}var eu=Xr((function(t,e){try{return Ee(t,n,e)}catch(t){return $s(t)?t:new Mt(t)}})),nu=io((function(t,e){return ke(e,(function(e){e=Uo(e),ar(t,e,Ps(t[e],t))})),t}));function ru(t){return function(){return t}}var iu=zi(),ou=zi(!0);function su(t){return t}function au(t){return Dr("function"==typeof t?t:cr(t,1))}var uu=Xr((function(t,e){return function(n){return Pr(n,t,e)}})),lu=Xr((function(t,e){return function(n){return Pr(t,n,e)}}));function cu(t,e,n){var r=Ba(e),i=Mr(e,r);null!=n||ra(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Mr(e,Ba(e)));var o=!(ra(n)&&"chain"in n&&!n.chain),s=ta(t);return ke(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Ni(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Pe([this.value()],arguments))})})),t}function hu(){}var fu=Gi(Ne),du=Gi(Se),pu=Gi(Oe);function mu(t){return Eo(t)?We(Uo(t)):function(t){return function(e){return kr(e,t)}}(t)}var gu=Vi(),yu=Vi(!0);function vu(){return[]}function bu(){return!1}var wu,Au=qi((function(t,e){return t+e}),0),_u=Zi("ceil"),Eu=qi((function(t,e){return t/e}),1),Mu=Zi("floor"),ku=qi((function(t,e){return t*e}),1),xu=Zi("round"),Su=qi((function(t,e){return t-e}),0);return Hn.after=function(t,e){if("function"!=typeof e)throw new It(r);return t=ya(t),function(){if(--t<1)return e.apply(this,arguments)}},Hn.ary=Is,Hn.assign=_a,Hn.assignIn=Ea,Hn.assignInWith=Ma,Hn.assignWith=ka,Hn.at=xa,Hn.before=Ns,Hn.bind=Ps,Hn.bindAll=nu,Hn.bindKey=Rs,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Vs(t)?t:[t]},Hn.chain=ms,Hn.chunk=function(t,e,r){e=(r?_o(t,e,r):e===n)?1:wn(ya(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,a=st(ge(i/e));oo?0:o+r),(i=i===n||i>o?o:ya(i))<0&&(i+=o),i=r>i?0:va(i);r>>0)?(t=Aa(t))&&("string"==typeof e||null!=e&&!ua(e))&&!(e=hi(e))&&on(t)?Ei(fn(t),0,r):t.split(e,r):[]},Hn.spread=function(t,e){if("function"!=typeof t)throw new It(r);return e=null==e?0:wn(ya(e),0),Xr((function(n){var r=n[e],i=Ei(n,0,e);return r&&Pe(i,r),Ee(t,this,i)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oi(t,1,e):[]},Hn.take=function(t,e,r){return t&&t.length?oi(t,0,(e=r||e===n?1:ya(e))<0?0:e):[]},Hn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?oi(t,(e=i-(e=r||e===n?1:ya(e)))<0?0:e,i):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?mi(t,co(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?mi(t,co(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new It(r);return ra(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Bs(t,e,{leading:i,maxWait:e,trailing:o})},Hn.thru=gs,Hn.toArray=ma,Hn.toPairs=za,Hn.toPairsIn=Ha,Hn.toPath=function(t){return Vs(t)?Ne(t,Uo):ha(t)?[t]:Ni(Fo(Aa(t)))},Hn.toPlainObject=wa,Hn.transform=function(t,e,n){var r=Vs(t),i=r||Ks(t)||fa(t);if(e=co(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:ra(t)&&ta(o)?Wn(Vt(t)):{}}return(i?ke:_r)(t,(function(t,r,i){return e(n,t,r,i)})),n},Hn.unary=function(t){return Is(t,1)},Hn.union=is,Hn.unionBy=os,Hn.unionWith=ss,Hn.uniq=function(t){return t&&t.length?fi(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?fi(t,co(e,2)):[]},Hn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?fi(t,n,e):[]},Hn.unset=function(t,e){return null==t||di(t,e)},Hn.unzip=as,Hn.unzipWith=us,Hn.update=function(t,e,n){return null==t?t:pi(t,e,wi(n))},Hn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:pi(t,e,wi(r),i)},Hn.values=Wa,Hn.valuesIn=function(t){return null==t?[]:Ze(t,Oa(t))},Hn.without=ls,Hn.words=tu,Hn.wrap=function(t,e){return Us(wi(e),t)},Hn.xor=cs,Hn.xorBy=hs,Hn.xorWith=fs,Hn.zip=ds,Hn.zipObject=function(t,e){return vi(t||[],e||[],rr)},Hn.zipObjectDeep=function(t,e){return vi(t||[],e||[],ei)},Hn.zipWith=ps,Hn.entries=za,Hn.entriesIn=Ha,Hn.extend=Ea,Hn.extendWith=Ma,cu(Hn,Hn),Hn.add=Au,Hn.attempt=eu,Hn.camelCase=qa,Hn.capitalize=Ga,Hn.ceil=_u,Hn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=ba(r))==r?r:0),e!==n&&(e=(e=ba(e))==e?e:0),lr(ba(t),e,r)},Hn.clone=function(t){return cr(t,4)},Hn.cloneDeep=function(t){return cr(t,5)},Hn.cloneDeepWith=function(t,e){return cr(t,5,e="function"==typeof e?e:n)},Hn.cloneWith=function(t,e){return cr(t,4,e="function"==typeof e?e:n)},Hn.conformsTo=function(t,e){return null==e||hr(t,e,Ba(e))},Hn.deburr=Qa,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=Eu,Hn.endsWith=function(t,e,r){t=Aa(t),e=hi(e);var i=t.length,o=r=r===n?i:lr(ya(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},Hn.eq=Ws,Hn.escape=function(t){return(t=Aa(t))&&Z.test(t)?t.replace(Y,nn):t},Hn.escapeRegExp=function(t){return(t=Aa(t))&&it.test(t)?t.replace(rt,"\\$&"):t},Hn.every=function(t,e,r){var i=Vs(t)?Se:gr;return r&&_o(t,e,r)&&(e=n),i(t,co(e,3))},Hn.find=bs,Hn.findIndex=Qo,Hn.findKey=function(t,e){return De(t,co(e,3),_r)},Hn.findLast=ws,Hn.findLastIndex=Vo,Hn.findLastKey=function(t,e){return De(t,co(e,3),Er)},Hn.floor=Mu,Hn.forEach=As,Hn.forEachRight=_s,Hn.forIn=function(t,e){return null==t?t:wr(t,co(e,3),Oa)},Hn.forInRight=function(t,e){return null==t?t:Ar(t,co(e,3),Oa)},Hn.forOwn=function(t,e){return t&&_r(t,co(e,3))},Hn.forOwnRight=function(t,e){return t&&Er(t,co(e,3))},Hn.get=Ta,Hn.gt=qs,Hn.gte=Gs,Hn.has=function(t,e){return null!=t&&vo(t,e,Tr)},Hn.hasIn=Ia,Hn.head=Jo,Hn.identity=su,Hn.includes=function(t,e,n,r){t=Js(t)?t:Wa(t),n=n&&!r?ya(n):0;var i=t.length;return n<0&&(n=wn(i+n,0)),ca(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ya(n);return i<0&&(i=wn(r+i,0)),Fe(t,e,i)},Hn.inRange=function(t,e,r){return e=ga(e),r===n?(r=e,e=0):r=ga(r),function(t,e,n){return t>=An(e,n)&&t=-9007199254740991&&t<=d},Hn.isSet=la,Hn.isString=ca,Hn.isSymbol=ha,Hn.isTypedArray=fa,Hn.isUndefined=function(t){return t===n},Hn.isWeakMap=function(t){return ia(t)&&yo(t)==P},Hn.isWeakSet=function(t){return ia(t)&&"[object WeakSet]"==Sr(t)},Hn.join=function(t,e){return null==t?"":vn.call(t,e)},Hn.kebabCase=Va,Hn.last=$o,Hn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ya(r))<0?wn(i+o,0):An(o,i-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):je(t,ze,o,!0)},Hn.lowerCase=Ya,Hn.lowerFirst=Ja,Hn.lt=da,Hn.lte=pa,Hn.max=function(t){return t&&t.length?yr(t,su,Cr):n},Hn.maxBy=function(t,e){return t&&t.length?yr(t,co(e,2),Cr):n},Hn.mean=function(t){return He(t,su)},Hn.meanBy=function(t,e){return He(t,co(e,2))},Hn.min=function(t){return t&&t.length?yr(t,su,Ur):n},Hn.minBy=function(t,e){return t&&t.length?yr(t,co(e,2),Ur):n},Hn.stubArray=vu,Hn.stubFalse=bu,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=ku,Hn.nth=function(t,e){return t&&t.length?Gr(t,ya(e)):n},Hn.noConflict=function(){return he._===this&&(he._=zt),this},Hn.noop=hu,Hn.now=Ts,Hn.pad=function(t,e,n){t=Aa(t);var r=(e=ya(e))?hn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Qi(Le(i),n)+t+Qi(ge(i),n)},Hn.padEnd=function(t,e,n){t=Aa(t);var r=(e=ya(e))?hn(t):0;return e&&re){var i=t;t=e,e=i}if(r||t%1||e%1){var o=Mn();return An(t+o*(e-t+ae("1e-"+((o+"").length-1))),e)}return Zr(t,e)},Hn.reduce=function(t,e,n){var r=Vs(t)?Re:Ge,i=arguments.length<3;return r(t,co(e,4),n,i,pr)},Hn.reduceRight=function(t,e,n){var r=Vs(t)?Be:Ge,i=arguments.length<3;return r(t,co(e,4),n,i,mr)},Hn.repeat=function(t,e,r){return e=(r?_o(t,e,r):e===n)?1:ya(e),Kr(Aa(t),e)},Hn.replace=function(){var t=arguments,e=Aa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(t,e,r){var i=-1,o=(e=Ai(e,t)).length;for(o||(o=1,t=n);++id)return[];var n=m,r=An(t,m);e=co(e),t-=m;for(var i=Ve(r,e);++n=s)return t;var u=r-hn(i);if(u<1)return i;var l=a?Ei(a,0,u).join(""):t.slice(0,u);if(o===n)return l+i;if(a&&(u+=l.length-u),ua(o)){if(t.slice(u).search(o)){var c,h=l;for(o.global||(o=Ct(o.source,Aa(pt.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var f=c.index;l=l.slice(0,f===n?u:f)}}else if(t.indexOf(hi(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+i},Hn.unescape=function(t){return(t=Aa(t))&&J.test(t)?t.replace(V,pn):t},Hn.uniqueId=function(t){var e=++Dt;return Aa(t)+e},Hn.upperCase=Xa,Hn.upperFirst=$a,Hn.each=As,Hn.eachRight=_s,Hn.first=Jo,cu(Hn,(wu={},_r(Hn,(function(t,e){Lt.call(Hn.prototype,e)||(wu[e]=t)})),wu),{chain:!1}),Hn.VERSION="4.17.21",ke(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),ke(["drop","take"],(function(t,e){Qn.prototype[t]=function(r){r=r===n?1:wn(ya(r),0);var i=this.__filtered__&&!e?new Qn(this):this.clone();return i.__filtered__?i.__takeCount__=An(r,i.__takeCount__):i.__views__.push({size:An(r,m),type:t+(i.__dir__<0?"Right":"")}),i},Qn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ke(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Qn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:co(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),ke(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Qn.prototype[t]=function(){return this[n](1).value()[0]}})),ke(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Qn.prototype[t]=function(){return this.__filtered__?new Qn(this):this[n](1)}})),Qn.prototype.compact=function(){return this.filter(su)},Qn.prototype.find=function(t){return this.filter(t).head()},Qn.prototype.findLast=function(t){return this.reverse().find(t)},Qn.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new Qn(this):this.map((function(n){return Pr(n,t,e)}))})),Qn.prototype.reject=function(t){return this.filter(js(co(t)))},Qn.prototype.slice=function(t,e){t=ya(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Qn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=ya(e))<0?r.dropRight(-e):r.take(e-t)),r)},Qn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Qn.prototype.toArray=function(){return this.take(m)},_r(Qn.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Hn[i?"take"+("last"==e?"Right":""):e],s=i||/^find/.test(e);o&&(Hn.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,u=e instanceof Qn,l=a[0],c=u||Vs(e),h=function(t){var e=o.apply(Hn,Pe([t],a));return i&&f?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=s&&!f,m=u&&!d;if(!s&&c){e=m?e:new Qn(this);var g=t.apply(e,a);return g.__actions__.push({func:gs,args:[h],thisArg:n}),new Gn(g,f)}return p&&m?t.apply(this,a):(g=this.thru(h),p?i?g.value()[0]:g.value():g)})})),ke(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Nt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Vs(i)?i:[],t)}return this[n]((function(n){return e.apply(Vs(n)?n:[],t)}))}})),_r(Qn.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";Lt.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:e,func:n})}})),Rn[Hi(n,2).name]=[{name:"wrapper",func:n}],Qn.prototype.clone=function(){var t=new Qn(this.__wrapped__);return t.__actions__=Ni(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ni(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ni(this.__views__),t},Qn.prototype.reverse=function(){if(this.__filtered__){var t=new Qn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Qn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Vs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Hn.prototype.plant=function(t){for(var e,r=this;r instanceof qn;){var i=Ho(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},Hn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Qn){var e=t;return this.__actions__.length&&(e=new Qn(this)),(e=e.reverse()).__actions__.push({func:gs,args:[rs],thisArg:n}),new Gn(e,this.__chain__)}return this.thru(rs)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,se&&(Hn.prototype[se]=function(){return this}),Hn}();de?((de.exports=mn)._=mn,fe._=mn):he._=mn}).call(i)})),FB=9e15,UB=1e9,zB="0123456789abcdef",HB="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",WB="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",qB={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-FB,maxE:FB,crypto:!1},GB=!0,QB="[DecimalError] ",VB=QB+"Invalid argument: ",YB=QB+"Precision limit exceeded",JB=QB+"crypto unavailable",ZB="[object Decimal]",KB=Math.floor,XB=Math.pow,$B=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,tO=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,eO=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,nO=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,rO=1e7,iO=HB.length-1,oO=WB.length-1,sO={toStringTag:ZB};function aO(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;en)throw Error(VB+t)}function lO(t,e,n,r){var i,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=XB(10,7-e),a=t[i]%o|0,null==r?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(t[i+1]/o/100|0)==XB(10,e-2)-1||(a==o/2||0==a)&&0==(t[i+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),s=(r||n<4)&&9999==a||!r&&n>3&&4999==a):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(t[i+1]/o/1e3|0)==XB(10,e-3)-1,s}function cO(t,e,n){for(var r,i,o=[0],s=0,a=t.length;sn-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}sO.absoluteValue=sO.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),fO(t)},sO.ceil=function(){return fO(new this.constructor(this),this.e+1,2)},sO.clampedTo=sO.clamp=function(t,e){var n=this,r=n.constructor;if(t=new r(t),e=new r(e),!t.s||!e.s)return new r(NaN);if(t.gt(e))throw Error(VB+e);return n.cmp(t)<0?t:n.cmp(e)>0?e:new r(n)},sO.comparedTo=sO.cmp=function(t){var e,n,r,i,o=this,s=o.d,a=(t=new o.constructor(t)).d,u=o.s,l=t.s;if(!s||!a)return u&&l?u!==l?u:s===a?0:!s^u<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==t.e)return o.e>t.e^u<0?1:-1;for(e=0,n=(r=s.length)<(i=a.length)?r:i;ea[e]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},sO.cosine=sO.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r,i;if(e.isZero())return e;(r=e.d.length)<32?i=(1/CO(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),t.precision+=n,e=SO(t,1,e.times(i),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}(r,TO(r,n)),r.precision=t,r.rounding=e,fO(2==BB||3==BB?n.neg():n,t,e,!0)):new r(1):new r(NaN)},sO.cubeRoot=sO.cbrt=function(){var t,e,n,r,i,o,s,a,u,l,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(GB=!1,(o=c.s*XB(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=aO(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=XB(n,1/3),t=KB((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=c.s),s=(t=h.precision)+3;;)if(l=(u=(a=r).times(a).times(a)).plus(c),r=hO(l.plus(c).times(a),l.plus(u),s+2,1),aO(a.d).slice(0,s)===(n=aO(r.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(fO(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(fO(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}return GB=!0,fO(r,t,h.rounding,e)},sO.decimalPlaces=sO.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=7*((t=e.length-1)-KB(this.e/7)),t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},sO.dividedBy=sO.div=function(t){return hO(this,new this.constructor(t))},sO.dividedToIntegerBy=sO.divToInt=function(t){var e=this.constructor;return fO(hO(this,new e(t),0,1,1),e.precision,e.rounding)},sO.equals=sO.eq=function(t){return 0===this.cmp(t)},sO.floor=function(){return fO(new this.constructor(this),this.e+1,3)},sO.greaterThan=sO.gt=function(t){return this.cmp(t)>0},sO.greaterThanOrEqualTo=sO.gte=function(t){var e=this.cmp(t);return 1==e||0===e},sO.hyperbolicCosine=sO.cosh=function(){var t,e,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?e=(1/CO(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=SO(s,1,o.times(e),new s(1),!0);for(var u,l=t,c=new s(8);l--;)u=o.times(o),o=a.minus(u.times(c.minus(u.times(c))));return fO(o,s.precision=n,s.rounding=r,!0)},sO.hyperbolicSine=sO.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=SO(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=SO(o,2,i=i.times(1/CO(5,t)),i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);t--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=e,o.rounding=n,fO(i,e,n,!0)},sO.hyperbolicTangent=sO.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,hO(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},sO.inverseCosine=sO.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?gO(n,i,o):new n(0):new n(NaN):e.isZero()?gO(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=gO(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},sO.inverseHyperbolicCosine=sO.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,GB=!1,n=n.times(n).minus(1).sqrt().plus(n),GB=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},sO.inverseHyperbolicSine=sO.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,GB=!1,n=n.times(n).plus(1).sqrt().plus(n),GB=!0,r.precision=t,r.rounding=e,n.ln())},sO.inverseHyperbolicTangent=sO.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?fO(new o(i),t,e,!0):(o.precision=n=r-i.e,i=hO(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},sO.inverseSine=sO.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=gO(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},sO.inverseTangent=sO.atan=function(){var t,e,n,r,i,o,s,a,u,l=this,c=l.constructor,h=c.precision,f=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&h+4<=oO)return(s=gO(c,h+4,f).times(.25)).s=l.s,s}else{if(!l.s)return new c(NaN);if(h+4<=oO)return(s=gO(c,h+4,f).times(.5)).s=l.s,s}for(c.precision=a=h+10,c.rounding=1,t=n=Math.min(28,a/7+2|0);t;--t)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(GB=!1,e=Math.ceil(a/7),r=1,u=l.times(l),s=new c(l),i=l;-1!==t;)if(i=i.times(u),o=s.minus(i.div(r+=2)),i=i.times(u),void 0!==(s=o.plus(i.div(r+=2))).d[e])for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<this.d.length-2},sO.isNaN=function(){return!this.s},sO.isNegative=sO.isNeg=function(){return this.s<0},sO.isPositive=sO.isPos=function(){return this.s>0},sO.isZero=function(){return!!this.d&&0===this.d[0]},sO.lessThan=sO.lt=function(t){return this.cmp(t)<0},sO.lessThanOrEqualTo=sO.lte=function(t){return this.cmp(t)<1},sO.logarithm=sO.log=function(t){var e,n,r,i,o,s,a,u,l=this,c=l.constructor,h=c.precision,f=c.rounding;if(null==t)t=new c(10),e=!0;else{if(n=(t=new c(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new c(n&&!n[0]?-1/0:1!=l.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(GB=!1,s=EO(l,a=h+5),r=e?mO(c,a+10):EO(t,a),lO((u=hO(s,r,a,1)).d,i=h,f))do{if(s=EO(l,a+=10),r=e?mO(c,a+10):EO(t,a),u=hO(s,r,a,1),!o){+aO(u.d).slice(i+1,i+15)+1==1e14&&(u=fO(u,h+1,0));break}}while(lO(u.d,i+=10,f));return GB=!0,fO(u,h,f)},sO.minus=sO.sub=function(t){var e,n,r,i,o,s,a,u,l,c,h,f,d=this,p=d.constructor;if(t=new p(t),!d.d||!t.d)return d.s&&t.s?d.d?t.s=-t.s:t=new p(t.d||d.s!==t.s?d:NaN):t=new p(NaN),t;if(d.s!=t.s)return t.s=-t.s,d.plus(t);if(l=d.d,f=t.d,a=p.precision,u=p.rounding,!l[0]||!f[0]){if(f[0])t.s=-t.s;else{if(!l[0])return new p(3===u?-0:0);t=new p(d)}return GB?fO(t,a,u):t}if(n=KB(t.e/7),c=KB(d.e/7),l=l.slice(),o=c-n){for((h=o<0)?(e=l,o=-o,s=f.length):(e=f,n=c,s=l.length),o>(r=Math.max(Math.ceil(a/7),s)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((h=(r=l.length)<(s=f.length))&&(s=r),r=0;r0;--r)l[s++]=0;for(r=f.length;r>o;){if(l[--r](s=(o=Math.ceil(a/7))>s?o+1:s+1)&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((s=l.length)-(i=c.length)<0&&(i=s,n=c,c=l,l=n),e=0;i;)e=(l[--i]=l[i]+c[i]+e)/rO|0,l[i]%=rO;for(e&&(l.unshift(e),++r),s=l.length;0==l[--s];)l.pop();return t.d=l,t.e=pO(l,r),GB?fO(t,a,u):t},sO.precision=sO.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(VB+t);return n.d?(e=yO(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},sO.round=function(){var t=this,e=t.constructor;return fO(new e(t),t.e+1,e.rounding)},sO.sine=sO.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:SO(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=SO(t,2,e=e.times(1/CO(5,n)),e);for(var i,o=new t(5),s=new t(16),a=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}(r,TO(r,n)),r.precision=t,r.rounding=e,fO(BB>2?n.neg():n,t,e,!0)):new r(NaN)},sO.squareRoot=sO.sqrt=function(){var t,e,n,r,i,o,s=this,a=s.d,u=s.e,l=s.s,c=s.constructor;if(1!==l||!a||!a[0])return new c(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(GB=!1,0==(l=Math.sqrt(+s))||l==1/0?(((e=aO(a)).length+u)%2==0&&(e+="0"),l=Math.sqrt(e),u=KB((u+1)/2)-(u<0||u%2),r=new c(e=l==1/0?"5e"+u:(e=l.toExponential()).slice(0,e.indexOf("e")+1)+u)):r=new c(l.toString()),n=(u=c.precision)+3;;)if(r=(o=r).plus(hO(s,o,n+2,1)).times(.5),aO(o.d).slice(0,n)===(e=aO(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(fO(r,u+1,1),t=!r.times(r).eq(s));break}if(!i&&(fO(o,u+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}return GB=!0,fO(r,u,c.rounding,t)},sO.tangent=sO.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=hO(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,fO(2==BB||4==BB?n.neg():n,t,e,!0)):new r(NaN)},sO.times=sO.mul=function(t){var e,n,r,i,o,s,a,u,l,c=this,h=c.constructor,f=c.d,d=(t=new h(t)).d;if(t.s*=c.s,!(f&&f[0]&&d&&d[0]))return new h(!t.s||f&&!f[0]&&!d||d&&!d[0]&&!f?NaN:f&&d?0*t.s:t.s/0);for(n=KB(c.e/7)+KB(t.e/7),(u=f.length)<(l=d.length)&&(o=f,f=d,d=o,s=u,u=l,l=s),o=[],r=s=u+l;r--;)o.push(0);for(r=l;--r>=0;){for(e=0,i=u+r;i>r;)a=o[i]+d[r]*f[i-r-1]+e,o[i--]=a%rO|0,e=a/rO|0;o[i]=(o[i]+e)%rO|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=pO(o,n),GB?fO(t,h.precision,h.rounding):t},sO.toBinary=function(t,e){return IO(this,2,t,e)},sO.toDecimalPlaces=sO.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(uO(t,0,UB),void 0===e?e=r.rounding:uO(e,0,8),fO(n,t+n.e+1,e))},sO.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=dO(r,!0):(uO(t,0,UB),void 0===e?e=i.rounding:uO(e,0,8),n=dO(r=fO(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},sO.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=dO(i):(uO(t,0,UB),void 0===e?e=o.rounding:uO(e,0,8),n=dO(r=fO(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},sO.toFraction=function(t){var e,n,r,i,o,s,a,u,l,c,h,f,d=this,p=d.d,m=d.constructor;if(!p)return new m(d);if(l=n=new m(1),r=u=new m(0),s=(o=(e=new m(r)).e=yO(p)-d.e-1)%7,e.d[0]=XB(10,s<0?7+s:s),null==t)t=o>0?e:l;else{if(!(a=new m(t)).isInt()||a.lt(l))throw Error(VB+a);t=a.gt(e)?o>0?e:l:a}for(GB=!1,a=new m(aO(p)),c=m.precision,m.precision=o=7*p.length*2;h=hO(a,e,0,1,1),1!=(i=n.plus(h.times(r))).cmp(t);)n=r,r=i,i=l,l=u.plus(h.times(i)),u=i,i=e,e=a.minus(h.times(i)),a=i;return i=hO(t.minus(n),r,0,1,1),u=u.plus(i.times(l)),n=n.plus(i.times(r)),u.s=l.s=d.s,f=hO(l,r,o,1).minus(d).abs().cmp(hO(u,n,o,1).minus(d).abs())<1?[l,r]:[u,n],m.precision=c,GB=!0,f},sO.toHexadecimal=sO.toHex=function(t,e){return IO(this,16,t,e)},sO.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:uO(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(GB=!1,n=hO(n,t,0,e,1).times(t),GB=!0,fO(n)):(t.s=n.s,n=t),n},sO.toNumber=function(){return+this},sO.toOctal=function(t,e){return IO(this,8,t,e)},sO.toPower=sO.pow=function(t){var e,n,r,i,o,s,a=this,u=a.constructor,l=+(t=new u(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new u(XB(+a,l));if((a=new u(a)).eq(1))return a;if(r=u.precision,o=u.rounding,t.eq(1))return fO(a,r,o);if((e=KB(t.e/7))>=t.d.length-1&&(n=l<0?-l:l)<=9007199254740991)return i=bO(u,a,n,r),t.s<0?new u(1).div(i):fO(i,r,o);if((s=a.s)<0){if(eu.maxE+1||e0?s/0:0):(GB=!1,u.rounding=a.s=1,n=Math.min(12,(e+"").length),(i=_O(t.times(EO(a,r+n)),r)).d&&lO((i=fO(i,r+5,1)).d,r,o)&&(e=r+10,+aO((i=fO(_O(t.times(EO(a,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=fO(i,r+1,0))),i.s=s,GB=!0,u.rounding=o,fO(i,r,o))},sO.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=dO(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(uO(t,1,UB),void 0===e?e=i.rounding:uO(e,0,8),n=dO(r=fO(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},sO.toSignificantDigits=sO.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(uO(t,1,UB),void 0===e?e=n.rounding:uO(e,0,8)),fO(new n(this),t,e)},sO.toString=function(){var t=this,e=t.constructor,n=dO(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},sO.truncated=sO.trunc=function(){return fO(new this.constructor(this),this.e+1,1)},sO.valueOf=sO.toJSON=function(){var t=this,e=t.constructor,n=dO(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var hO=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;)t.shift()}return function(r,i,o,s,a,u){var l,c,h,f,d,p,m,g,y,v,b,w,A,_,E,M,k,x,S,C,T=r.constructor,I=r.s==i.s?1:-1,N=r.d,P=i.d;if(!(N&&N[0]&&P&&P[0]))return new T(r.s&&i.s&&(N?!P||N[0]!=P[0]:P)?N&&0==N[0]||!P?0*I:I/0:NaN);for(u?(d=1,c=r.e-i.e):(u=rO,d=7,c=KB(r.e/d)-KB(i.e/d)),S=P.length,k=N.length,v=(y=new T(I)).d=[],h=0;P[h]==(N[h]||0);h++);if(P[h]>(N[h]||0)&&c--,null==o?(_=o=T.precision,s=T.rounding):_=a?o+(r.e-i.e)+1:o,_<0)v.push(1),p=!0;else{if(_=_/d+2|0,h=0,1==S){for(f=0,P=P[0],_++;(h1&&(P=t(P,f,u),N=t(N,f,u),S=P.length,k=N.length),M=S,w=(b=N.slice(0,S)).length;w=u/2&&++x;do{f=0,(l=e(P,b,S,w))<0?(A=b[0],S!=w&&(A=A*u+(b[1]||0)),(f=A/x|0)>1?(f>=u&&(f=u-1),1==(l=e(m=t(P,f,u),b,g=m.length,w=b.length))&&(f--,n(m,S=10;f/=10)h++;y.e=h+c*d-1,fO(y,a?o+y.e+1:o,s,p)}return y}}();function fO(t,e,n,r){var i,o,s,a,u,l,c,h,f,d=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,a=h[0];a>=10;a/=10)i++;if((o=e-i)<0)o+=7,s=e,u=(c=h[f=0])/XB(10,i-s-1)%10|0;else if((f=Math.ceil((o+1)/7))>=(a=h.length)){if(!r)break t;for(;a++<=f;)h.push(0);c=u=0,i=1,s=(o%=7)-7+1}else{for(c=a=h[f],i=1;a>=10;a/=10)i++;u=(s=(o%=7)-7+i)<0?0:c/XB(10,i-s-1)%10|0}if(r=r||e<0||void 0!==h[f+1]||(s<0?c:c%XB(10,i-s-1)),l=n<4?(u||r)&&(0==n||n==(t.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?s>0?c/XB(10,i-s):0:h[f-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,l?(e-=t.e+1,h[0]=XB(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=f,a=1,f--):(h.length=f+1,a=XB(10,7-o),h[f]=s>0?(c/XB(10,i-s)%XB(10,s)|0)*a:0),l)for(;;){if(0==f){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,h[0]==rO&&(h[0]=1));break}if(h[f]+=a,h[f]!=rO)break;h[f--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return GB&&(t.e>d.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+vO(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+vO(-i-1)+o,n&&(r=n-s)>0&&(o+=vO(r))):i>=s?(o+=vO(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+vO(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=vO(r))),o}function pO(t,e){var n=t[0];for(e*=7;n>=10;n/=10)e++;return e}function mO(t,e,n){if(e>iO)throw GB=!0,n&&(t.precision=n),Error(YB);return fO(new t(HB),e,1,!0)}function gO(t,e,n){if(e>oO)throw Error(YB);return fO(new t(WB),e,n,!0)}function yO(t){var e=t.length-1,n=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function vO(t){for(var e="";t--;)e+="0";return e}function bO(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/7+4);for(GB=!1;;){if(n%2&&NO((o=o.times(e)).d,s)&&(i=!0),0===(n=KB(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}NO((e=e.times(e)).d,s)}return GB=!0,o}function wO(t){return 1&t.d[t.d.length-1]}function AO(t,e,n){for(var r,i=new t(e[0]),o=0;++o17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(GB=!1,u=p):u=e,a=new f(.03125);t.e>-2;)t=t.times(a),h+=5;for(u+=r=Math.log(XB(2,h))/Math.LN10*2+5|0,n=o=s=new f(1),f.precision=u;;){if(o=fO(o.times(t),u,1),n=n.times(++c),aO((a=s.plus(hO(o,n,u,1))).d).slice(0,u)===aO(s.d).slice(0,u)){for(i=h;i--;)s=fO(s.times(s),u,1);if(null!=e)return f.precision=p,s;if(!(l<3&&lO(s.d,u-r,d,l)))return fO(s,f.precision=p,d,GB=!0);f.precision=u+=10,n=o=a=new f(1),c=0,l++}s=a}}function EO(t,e){var n,r,i,o,s,a,u,l,c,h,f,d=1,p=t,m=p.d,g=p.constructor,y=g.rounding,v=g.precision;if(p.s<0||!m||!m[0]||!p.e&&1==m[0]&&1==m.length)return new g(m&&!m[0]?-1/0:1!=p.s?NaN:m?0:p);if(null==e?(GB=!1,c=v):c=e,g.precision=c+=10,r=(n=aO(m)).charAt(0),!(Math.abs(o=p.e)<15e14))return l=mO(g,c+2,v).times(o+""),p=EO(new g(r+"."+n.slice(1)),c-10).plus(l),g.precision=v,null==e?fO(p,v,y,GB=!0):p;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=aO((p=p.times(t)).d)).charAt(0),d++;for(o=p.e,r>1?(p=new g("0."+n),o++):p=new g(r+"."+n.slice(1)),h=p,u=s=p=hO(p.minus(1),p.plus(1),c,1),f=fO(p.times(p),c,1),i=3;;){if(s=fO(s.times(f),c,1),aO((l=u.plus(hO(s,new g(i),c,1))).d).slice(0,c)===aO(u.d).slice(0,c)){if(u=u.times(2),0!==o&&(u=u.plus(mO(g,c+2,v).times(o+""))),u=hO(u,new g(d),c,1),null!=e)return g.precision=v,u;if(!lO(u.d,c-10,y,a))return fO(u,g.precision=v,y,GB=!0);g.precision=c+=10,l=s=p=hO(h.minus(1),h.plus(1),c,1),f=fO(p.times(p),c,1),i=a=1}u=l,i+=2}}function MO(t){return String(t.s*t.s/0)}function kO(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%7,n<0&&(r+=7),rt.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),nO.test(e))return kO(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(tO.test(e))n=16,e=e.toLowerCase();else if($B.test(e))n=2;else{if(!eO.test(e))throw Error(VB+e);n=8}for((o=e.search(/p/i))>0?(u=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),s=(o=e.indexOf("."))>=0,r=t.constructor,s&&(o=(a=(e=e.replace(".","")).length)-o,i=bO(r,new r(n),o,2*o)),o=c=(l=cO(e,n,rO)).length-1;0===l[o];--o)l.pop();return o<0?new r(0*t.s):(t.e=pO(l,c),t.d=l,GB=!1,s&&(t=hO(t,i,4*a)),u&&(t=t.times(Math.abs(u)<54?XB(2,u):vL.pow(2,u))),GB=!0,t)}function SO(t,e,n,r,i){var o,s,a,u,l=t.precision,c=Math.ceil(l/7);for(GB=!1,u=n.times(n),a=new t(r);;){if(s=hO(a.times(u),new t(e++*e++),l,1),a=i?r.plus(s):r.minus(s),r=hO(s.times(u),new t(e++*e++),l,1),void 0!==(s=a.plus(r)).d[c]){for(o=c;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o}return GB=!0,s.d.length=c+1,s}function CO(t,e){for(var n=t;--e;)n*=t;return n}function TO(t,e){var n,r=e.s<0,i=gO(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return BB=r?4:1,e;if((n=e.divToInt(i)).isZero())BB=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return BB=wO(n)?r?2:3:r?4:1,e;BB=wO(n)?r?1:4:r?3:2}return e.minus(i).abs()}function IO(t,e,n,r){var i,o,s,a,u,l,c,h,f,d=t.constructor,p=void 0!==n;if(p?(uO(n,1,UB),void 0===r?r=d.rounding:uO(r,0,8)):(n=d.precision,r=d.rounding),t.isFinite()){for(p?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(s=(c=dO(t)).indexOf("."))>=0&&(c=c.replace(".",""),(f=new d(1)).e=c.length-s,f.d=cO(dO(f),10,i),f.e=f.d.length),o=u=(h=cO(c,10,i)).length;0==h[--u];)h.pop();if(h[0]){if(s<0?o--:((t=new d(t)).d=h,t.e=o,h=(t=hO(t,f,n,r,0,i)).d,o=t.e,l=RB),s=h[n],a=i/2,l=l||void 0!==h[n+1],l=r<4?(void 0!==s||l)&&(0===r||r===(t.s<0?3:2)):s>a||s===a&&(4===r||l||6===r&&1&h[n-1]||r===(t.s<0?8:7)),h.length=n,l)for(;++h[--n]>i-1;)h[n]=0,n||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(s=0,c="";s1)if(16==e||8==e){for(s=16==e?4:3,--u;u%s;u++)c+="0";for(u=(h=cO(c,i,e)).length;!h[u-1];--u);for(s=1,c="1.";su)for(o-=u;o--;)c+="0";else oe)return t.length=e,!0}function PO(t){return new this(t).abs()}function RO(t){return new this(t).acos()}function BO(t){return new this(t).acosh()}function OO(t,e){return new this(t).plus(e)}function LO(t){return new this(t).asin()}function DO(t){return new this(t).asinh()}function jO(t){return new this(t).atan()}function FO(t){return new this(t).atanh()}function UO(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?gO(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=gO(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(hO(t,e,o,1)),e=gO(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(hO(t,e,o,1)):(n=gO(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function zO(t){return new this(t).cbrt()}function HO(t){return fO(t=new this(t),t.e+1,2)}function WO(t,e,n){return new this(t).clamp(e,n)}function qO(t){if(!t||"object"!=typeof t)throw Error(QB+"Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,UB,"rounding",0,8,"toExpNeg",-FB,0,"toExpPos",0,FB,"maxE",0,FB,"minE",-FB,0,"modulo",0,9];for(e=0;e=o[e+1]&&r<=o[e+2]))throw Error(VB+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=qB[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(VB+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(JB);this[n]=!0}else this[n]=!1}return this}function GO(t){return new this(t).cos()}function QO(t){return new this(t).cosh()}function VO(t,e){return new this(t).div(e)}function YO(t){return new this(t).exp()}function JO(t){return fO(t=new this(t),t.e+1,3)}function ZO(){var t,e,n=new this(0);for(GB=!1,t=0;t=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(JB);for(e=crypto.randomBytes(r*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(i%1e7),o+=4);o=r/4}else for(;o=10;i/=10)r++;r<7&&(n-=7-r)}return s.e=n,s.d=a,s}function uL(t){return fO(t=new this(t),t.e+1,this.rounding)}function lL(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function cL(t){return new this(t).sin()}function hL(t){return new this(t).sinh()}function fL(t){return new this(t).sqrt()}function dL(t,e){return new this(t).sub(e)}function pL(){var t=0,e=arguments,n=new this(e[t]);for(GB=!1;n.s&&++to.maxE?(i.e=NaN,i.d=null):t.e=10;n/=10)e++;return void(GB?e>o.maxE?(i.e=NaN,i.d=null):enew _L({blockchain:e,address:n}).BigNumber(t),_L.readable=async({amount:t,blockchain:e,address:n})=>new _L({blockchain:e,address:n}).readable(t),_L.safeAmount=({amount:t,decimals:e})=>parseFloat(t.toFixed(e)),_L.ethereum={DEFAULT:wL,ERC20:wL},_L.bsc={DEFAULT:bL,BEP20:bL},_L.polygon={DEFAULT:AL,ERC20:AL};var EL={blockchain:"ethereum",name:"uniswap_v2",alternativeNames:[],label:"Uniswap v2",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIABAMAAAAGVsnJAAAALVBMVEVHcEz/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHoZcglmAAAADnRSTlMACBMiNEtieI+kuc7j9HuCgRkAABrlSURBVHja7F37b1vVHT+2rx9xQIqoxKMpkyUGY22KLCp+GE0rbxLV2i2RKagIBlbUVUITkpWNINptRN1Yi7pqVjeNdUPDSkFj3UMWXSugW7FKCusAYbG1EhA0a92axEns8zfs3uvHPa97fa+vJX+V7/38FD9y7fO938fn+zjHJECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIIAJjSBHeIogxy6CHDH0KnCEIEcyS3AjfI4gx3ia4Eb0EkGOH6YIbgz9heBG6K8jBDfGTxDc0FYIcuQPE9xILBPkKGFPicYWCW5E/p0huJG7SnAjXseeEhXnCW6MriFPicKVUwQ3JlYJbsQo9pSoUCO4kaTTBDVC5SWCGzso8hZBlGLnw/kG8pQoQZG3CEKlOnI+PEaRtwi06iryFkEOOx+OU+x8uIidD49S5Hw4UsHOhyco8hZBjGLnwwXsfDhJkbcIwhXsfHgHXcPNh6OUzhHUmKXIR2aGKMU9MhMqU+QjM2OU4h6Z0arY+XAeOx9OUOwtghJ2PjxKKe6RmUiVIh+ZyVGKe2QmRrHz4QJ2PryRIufD4Qp2PjxBkfNhvS6CvEUwi50PD1HkfFiviyBvEYxT5HxY093gGYIZeUpxj5DrdR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488D",api:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},factory:{address:"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",api:[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},pair:{api:[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]}}};let ML=async({amount:t,blockchain:e,address:n})=>await _L.BigNumber({amount:t,blockchain:e,address:n});class kL{constructor({name:t,blockchain:e,alternativeNames:n,label:r,logo:i,contracts:o,route:s,getAmountIn:a}){this.name=t,this.blockchain=e,this.alternativeNames=n,this.label=r,this.logo=i,this.contracts=o,this._route=s,this.getAmountIn=a}async route({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:s,amountOutMin:a,amountOutMax:u,amountInMin:l}){return n===r?Promise.resolve():((({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:s,amountOutMin:a,amountOutMax:u,amountInMin:l})=>{if(void 0!==u)throw"You cannot not set amountOutMax! Only amountInMax or amountOutMin!";if(void 0!==l)throw"You cannot not set amountInMin! Only amountInMax or amountOutMin!";if(void 0!==o&&void 0!==i)throw"You cannot set amountIn and amountOut at the same time, use amountInMax or amountOutMin to describe the non exact part of the swap!";if(void 0!==s&&void 0!==a)throw"You cannot set amountInMax and amountOutMin at the same time, use amountIn or amountOut to describe the part of the swap that needs to be exact!";if(void 0!==i&&void 0!==s)throw"Setting amountIn and amountInMax at the same time makes no sense. Decide if amountIn needs to be exact or not!";if(void 0!==o&&void 0!==a)throw"Setting amountOut and amountOutMin at the same time makes no sense. Decide if amountOut needs to be exact or not!"})({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:s,amountOutMin:a,amountOutMax:u,amountInMin:l}),await this._route(await(async({blockchain:t,exchange:e,fromAddress:n,toAddress:r,tokenIn:i,tokenOut:o,amountIn:s,amountOut:a,amountInMax:u,amountOutMin:l})=>{let c={exchange:e,fromAddress:n,toAddress:r,tokenIn:i,tokenOut:o,amountIn:s,amountOut:a,amountInMax:u,amountOutMin:l};return a&&"number"==typeof a&&(c.amountOut=await ML({amount:a,blockchain:t,address:o})),l&&"number"==typeof l&&(c.amountOutMin=await ML({amount:l,blockchain:t,address:o})),s&&"number"==typeof s&&(c.amountIn=await ML({amount:s,blockchain:t,address:i})),u&&"number"==typeof u&&(c.amountInMax=await ML({amount:u,blockchain:t,address:i})),c})({blockchain:this.blockchain,exchange:this,fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:s,amountOutMin:a})))}}function xL(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}class SL{constructor({tokenIn:t,tokenOut:e,path:n,amountIn:r,amountInMax:i,amountOut:o,amountOutMin:s,fromAddress:a,toAddress:u,transaction:l,exchange:c}){this.tokenIn=t,this.tokenOut=e,this.path=n,this.amountIn=xL([r,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountOutMin=xL([s,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountOut=xL([o,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountInMax=xL([i,"optionalAccess",t=>t.toString,"call",t=>t()]),this.fromAddress=a,this.toAddress=u,this.transaction=l,this.exchange=c}}function CL(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}let TL=t=>{let e=t.map(((e,n)=>e===qh.ethereum.NATIVE&&t[n+1]!=qh.ethereum.WRAPPED&&t[n-1]!=qh.ethereum.WRAPPED?qh.ethereum.WRAPPED:e));return e[0]==qh.ethereum.NATIVE&&e[1]==qh.ethereum.WRAPPED?e.splice(0,1):e[e.length-1]==qh.ethereum.NATIVE&&e[e.length-2]==qh.ethereum.WRAPPED&&e.splice(e.length-1,1),e},IL=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(Vy(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(Vy(e.toString(),o)),NL=async t=>{if(1==TL(t).length)return!1;let e=await $M({blockchain:"ethereum",address:EL.contracts.factory.address,method:"getPair"},{api:EL.contracts.factory.api,cache:36e5,params:TL(t)});if(e==qh.ethereum.ZERO)return!1;let[n,r,i]=await Promise.all([$M({blockchain:"ethereum",address:e,method:"getReserves"},{api:EL.contracts.pair.api,cache:36e5}),$M({blockchain:"ethereum",address:e,method:"token0"},{api:EL.contracts.pair.api,cache:36e5}),$M({blockchain:"ethereum",address:e,method:"token1"},{api:EL.contracts.pair.api,cache:36e5})]);if(t.includes(qh.ethereum.WRAPPED))return IL({min:1,token:qh.ethereum.WRAPPED,decimals:qh.ethereum.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(qh.ethereum.USD)){let t=new _L({blockchain:"ethereum",address:qh.ethereum.USD}),e=await t.decimals();return IL({min:1e3,token:qh.ethereum.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},PL=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{$M({blockchain:"ethereum",address:EL.contracts.router.address,method:"getAmountsOut"},{api:EL.contracts.router.api,params:{amountIn:e,path:TL(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),RL=({path:t,amountOut:e,block:n})=>new Promise((r=>{$M({blockchain:"ethereum",address:EL.contracts.router.address,method:"getAmountsIn"},{api:EL.contracts.router.api,params:{amountOut:e,path:TL(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))}));const BL=t=>Pg(t);var OL=new kL(Object.assign(EL,{route:({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u})=>(e=BL(e),n=BL(n),new Promise((async l=>{let c=await(async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(qh.ethereum.NATIVE)&&[t,e].includes(qh.ethereum.WRAPPED))return;let n;return await NL([t,e])?n=[t,e]:t!=qh.ethereum.WRAPPED&&await NL([t,qh.ethereum.WRAPPED])&&e!=qh.ethereum.WRAPPED&&await NL([e,qh.ethereum.WRAPPED])?n=[t,qh.ethereum.WRAPPED,e]:t!=qh.ethereum.USD&&await NL([t,qh.ethereum.USD])&&e!=qh.ethereum.WRAPPED&&await NL([qh.ethereum.WRAPPED,e])?n=[t,qh.ethereum.USD,qh.ethereum.WRAPPED,e]:t!=qh.ethereum.WRAPPED&&await NL([t,qh.ethereum.WRAPPED])&&e!=qh.ethereum.USD&&await NL([qh.ethereum.USD,e])&&(n=[t,qh.ethereum.WRAPPED,qh.ethereum.USD,e]),CL([n,"optionalAccess",t=>t.length])&&n[0]==qh.ethereum.NATIVE?n.splice(1,0,qh.ethereum.WRAPPED):CL([n,"optionalAccess",t=>t.length])&&n[n.length-1]==qh.ethereum.NATIVE&&n.splice(n.length-1,0,qh.ethereum.WRAPPED),n})({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,s,a,u];if(({amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u}=await(async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s})=>{if(r){if(null==(i=await RL({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await PL({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}else if(s){if(null==(i=await RL({path:t,amountOut:s,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await PL({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s}})({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u})),[o,a,s,u].every((t=>null==t)))return l();let m=(({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:s,amountInMaxInput:a,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"ethereum",from:c,to:EL.contracts.router.address,api:EL.contracts.router.api};return t[0]===qh.ethereum.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(s||a)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===qh.ethereum.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:TL(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h})({path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new SL({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:m}))}))),getAmountIn:RL})),LL={blockchain:"bsc",name:"pancakeswap",alternativeNames:["pancake"],label:"PancakeSwap",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAOVBMVEVHcExjMAH+3JBcJwCSb05+VC7RiE9qOg/EsZ+jhWpfLADXjlT/45Z5QxGVWiaubzi9fkXuxH3dqmiL4XhdAAAACnRSTlMA////msX/6i5cADBNDwAAGz9JREFUeNrsnOGSmzoMhcMYg60MhPd/2itjNrSNSQKWWPtyvj/d2bZbVT46lozJDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4CjO+9ba/om1tvXuVg7u7/j60uKrmZDbngwFmpnwFX+jKSPJc3xNDLCJLPH11pcQYNW4Nua2ScC/YahvfzXFztv38TUWGshafbPmdiPJze9pwLM1rYu/JQI2ghs4kN32ufofNfAbKWZ5Pkv/kwbsr2m0Wrw1Zs3h5xz3Jzute8rzS41CAruWv/86u8++qz/RBZzlJd0HJLArvevy76iyszaCUP3Nfkzf3sAXxPQeyTCdUmS+PxgfmTNdqlZm9z/KCRl2NiM+MjCBj+V/KL1rK2B1TWAp/5IlWjOxvDIzrKmANjs+IihArby0M+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J9iXybQaygzviMfwAEdRdZH9z5I+eBErtygL65VR8ift7IX88zMLQ297OveufcU8af3cQC9IhGATnAfYApK5PHyL6h0JOnnC73xX62+P/d55AKf9+k7Y/NIgHqeEBAsKP3oCm7s/KpxL04kHPA2MMt7vhgrEHwL93CEgAM9WN/W7EXno+YuQmI6S3Hncn0Ff23yBVFwgEAoFAIBAIBAKBQCAQCAQCwb/24JAAAAAAQND/166wAQAAAAAAAAAAAAAAAAAAAAAAswCsVemaah0CHgAAAABJRU5ErkJggg==",contracts:{router:{address:"0x10ED43C718714eb63d5aA57B78B54704E256024E",api:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},factory:{address:"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73",api:[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[],name:"INIT_CODE_PAIR_HASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},pair:{api:[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]}}};function DL(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}let jL=t=>{let e=t.map(((e,n)=>e===qh.bsc.NATIVE&&t[n+1]!=qh.bsc.WRAPPED&&t[n-1]!=qh.bsc.WRAPPED?qh.bsc.WRAPPED:e));return e[0]==qh.bsc.NATIVE&&e[1]==qh.bsc.WRAPPED?e.splice(0,1):e[e.length-1]==qh.bsc.NATIVE&&e[e.length-2]==qh.bsc.WRAPPED&&e.splice(e.length-1,1),e},FL=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(Vy(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(Vy(e.toString(),o)),UL=async t=>{if(1==jL(t).length)return!1;let e=await $M({blockchain:"bsc",address:LL.contracts.factory.address,method:"getPair"},{api:LL.contracts.factory.api,cache:36e5,params:jL(t)});if(e==qh.bsc.ZERO)return!1;let[n,r,i]=await Promise.all([$M({blockchain:"bsc",address:e,method:"getReserves"},{api:LL.contracts.pair.api,cache:36e5}),$M({blockchain:"bsc",address:e,method:"token0"},{api:LL.contracts.pair.api,cache:36e5}),$M({blockchain:"bsc",address:e,method:"token1"},{api:LL.contracts.pair.api,cache:36e5})]);if(t.includes(qh.bsc.WRAPPED))return FL({min:1,token:qh.bsc.WRAPPED,decimals:qh.bsc.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(qh.bsc.USD)){let t=new _L({blockchain:"bsc",address:qh.bsc.USD}),e=await t.decimals();return FL({min:1e3,token:qh.bsc.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},zL=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{$M({blockchain:"bsc",address:LL.contracts.router.address,method:"getAmountsOut"},{api:LL.contracts.router.api,params:{amountIn:e,path:jL(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),HL=({path:t,amountOut:e,block:n})=>new Promise((r=>{$M({blockchain:"bsc",address:LL.contracts.router.address,method:"getAmountsIn"},{api:LL.contracts.router.api,params:{amountOut:e,path:jL(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))}));var WL=new kL(Object.assign(LL,{route:({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u})=>(e=BL(e),n=BL(n),new Promise((async l=>{let c=await(async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(qh.bsc.NATIVE)&&[t,e].includes(qh.bsc.WRAPPED))return;let n;return await UL([t,e])?n=[t,e]:t!=qh.bsc.WRAPPED&&await UL([t,qh.bsc.WRAPPED])&&e!=qh.bsc.WRAPPED&&await UL([e,qh.bsc.WRAPPED])?n=[t,qh.bsc.WRAPPED,e]:t!=qh.bsc.USD&&await UL([t,qh.bsc.USD])&&e!=qh.bsc.WRAPPED&&await UL([qh.bsc.WRAPPED,e])?n=[t,qh.bsc.USD,qh.bsc.WRAPPED,e]:t!=qh.bsc.WRAPPED&&await UL([t,qh.bsc.WRAPPED])&&e!=qh.bsc.USD&&await UL([qh.bsc.USD,e])&&(n=[t,qh.bsc.WRAPPED,qh.bsc.USD,e]),DL([n,"optionalAccess",t=>t.length])&&n[0]==qh.bsc.NATIVE?n.splice(1,0,qh.bsc.WRAPPED):DL([n,"optionalAccess",t=>t.length])&&n[n.length-1]==qh.bsc.NATIVE&&n.splice(n.length-1,0,qh.bsc.WRAPPED),n})({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,s,a,u];if(({amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u}=await(async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s})=>{if(r){if(null==(i=await HL({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await zL({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}else if(s){if(null==(i=await HL({path:t,amountOut:s,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await zL({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s}})({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u})),[o,a,s,u].every((t=>null==t)))return l();let m=(({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:s,amountInMaxInput:a,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"bsc",from:c,to:LL.contracts.router.address,api:LL.contracts.router.api};return t[0]===qh.bsc.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(s||a)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===qh.bsc.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:jL(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h})({path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new SL({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:m}))}))),getAmountIn:HL})),qL={blockchain:"polygon",name:"quickswap",alternativeNames:[],label:"QuickSwap",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAXVBMVEVHcEz////////////////////5+vwVHkEOH2UgKlMfKWkmL3E8RmwvXJZUWXxtcY45gsRBispRkc2Chp1fltBrnNN3otaanLCDqtqwscClxubFxdHL2uvl6vL////QD9cpAAAAB3RSTlMAHD9rl8L0VWZaUQAALS5JREFUeNrsnYt2mzgQhoMv+PisG9sYCMGI93/MlcRlkAQSBAkLmN9pNk3aHHe/ufwzktsvFAqFQqFQKBQKhUKhUCgUCoVCoVAoFAqFQqFWrSA4HI7H4+l0OjOFgvinTlT0VxwOwRdqM2LYTycGvBwtHhAnGgoBhsJ6FRxoujPucxTSQMCSsDZR9CzlS3sKeT34Qnkvxt4qejkMsBh4K6fsxSjAIPBNFP4C7Dsm8YQNwRsFhyUSXxUGgQ9aNvPVIMB28EEFx9Mn4beeAAvBJ/Th1MdC8FFR+qVnCs8YAwvJQ/oYA4sp8JU+xsACCnzq+8N+AD2hGx188PwYAx9SsBr6lbAVWNXB68aPZcCtguO6kh/LgFWtp/P3KcQQmCe/hz7jmSF2gp3W/krFu+4EGAJ78P2qft5gBr5Qe8Nflq8C/eCO8ZfkRtAP7hd/Wf5eCY4E+8VPO8BV+YOE6AV2g78Mb90AQDu4i8Gvq/flSt9jCEzRhvDTDnC5KZ/DvcBmt349HeDyPfjFE7rBTRz46TvA5VsTHhgCsvcrN6bX5XLv/hwHgt00/6YDXF71x2gFdlb96w5w+ak/Riuws+rPdG8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a8PSDLn5Mv/9V/LzA7xj7q10JoOnPgX+4Aubp1rJJCcDpT7L+kSwEjjBgbxKQj37I2Z96/BdbBmzaAFGLpn++5MM/OAo+AqGRNEDe+wfg4pdJ/P9NAeAgsOBuYRQQ4w9/LvHvKQqig8BjFMTUANG1H/Hulk/8kw0CkTXg2Rew/szin3AQ2DAN3VX37ofk2M9u/Ms1As95oG9ZRwREYe5LsZ/h+BdsBJ7QBCMQFsFCfnebxMws1ccf/4sfcv9z23J466ScIPyr1+4mEvry3P7V9sEXJ+hbrBWQx7XtJU9+/vavMgYeuI+3TQVndLB9f+B+vEuTn23619sGXlQwDbdukcFXhbB/Q+upHyaxvFdI+tfcBv6A5j4Ot94LYSf2VQ90YDvyXeeZ1zj1eZc/sbLgX4QwjUOQgkfbttePaD26QPptGMbprkp8IelPPQv+G03T3D+g0We8vPRnwASsorDjb8QE7OBnKemvmkA9/tUE6vSvJlCPv/hDkUSQ+c1PnQM1/NU5UN2/zoHq/nUOVPevc6C6/6dzoBQJXKr7lxwF6vD/VxTIXgLNjzr8C06DTc1+JUug0l+0BCr9RUug0l90HKz0f0cC2fQCNfkXXQ1dKv2/2rF3LYRiEIiikgT+/5MFtbB0aR5wPbvUcgaC/lCBXv0Y4E/f2+1/70EbxD9B1WOA3T9NwZeA4Z+s1hpg+Feo0gGGf5kCTwHpL5a6AzZY/Ru0nB0g/Y18D+S6B0h/O+lpbkIdjfRPkDaOPwamnavvpKOLgNHPofX9m8CUVz8V2VgCY/JzkvWrIAaf8FOLFiz5jUj2hUQL5tXgGT3ZlyOvHtjXwesg+vq8B61HE/STLpjpI3eCvx7xKngXvAxB38UH/oV/Te4AAAAAAAAAAAAALuEOW2gZr0akk1cAAAAASUVORK5CYII=",contracts:{router:{address:"0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff",api:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},factory:{address:"0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",api:[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},pair:{api:[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]}}};function GL(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}let QL=t=>{let e=t.map(((e,n)=>e===qh.polygon.NATIVE&&t[n+1]!=qh.polygon.WRAPPED&&t[n-1]!=qh.polygon.WRAPPED?qh.polygon.WRAPPED:e));return e[0]==qh.polygon.NATIVE&&e[1]==qh.polygon.WRAPPED?e.splice(0,1):e[e.length-1]==qh.polygon.NATIVE&&e[e.length-2]==qh.polygon.WRAPPED&&e.splice(e.length-1,1),e},VL=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(Vy(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(Vy(e.toString(),o)),YL=async t=>{if(1==QL(t).length)return!1;let e=await $M({blockchain:"polygon",address:qL.contracts.factory.address,method:"getPair"},{api:qL.contracts.factory.api,cache:36e5,params:QL(t)});if(e==qh.polygon.ZERO)return!1;let[n,r,i]=await Promise.all([$M({blockchain:"polygon",address:e,method:"getReserves"},{api:qL.contracts.pair.api,cache:36e5}),$M({blockchain:"polygon",address:e,method:"token0"},{api:qL.contracts.pair.api,cache:36e5}),$M({blockchain:"polygon",address:e,method:"token1"},{api:qL.contracts.pair.api,cache:36e5})]);if(t.includes(qh.polygon.WRAPPED))return VL({min:1,token:qh.polygon.WRAPPED,decimals:qh.polygon.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(qh.polygon.USD)){let t=new _L({blockchain:"polygon",address:qh.polygon.USD}),e=await t.decimals();return VL({min:1e3,token:qh.polygon.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},JL=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{$M({blockchain:"polygon",address:qL.contracts.router.address,method:"getAmountsOut"},{api:qL.contracts.router.api,params:{amountIn:e,path:QL(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),ZL=({path:t,amountOut:e,block:n})=>new Promise((r=>{$M({blockchain:"polygon",address:qL.contracts.router.address,method:"getAmountsIn"},{api:qL.contracts.router.api,params:{amountOut:e,path:QL(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))})),KL=[OL,WL,new kL(Object.assign(qL,{route:({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u})=>(e=BL(e),n=BL(n),new Promise((async l=>{let c=await(async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(qh.polygon.NATIVE)&&[t,e].includes(qh.polygon.WRAPPED))return;let n;return await YL([t,e])?n=[t,e]:t!=qh.polygon.WRAPPED&&await YL([t,qh.polygon.WRAPPED])&&e!=qh.polygon.WRAPPED&&await YL([e,qh.polygon.WRAPPED])?n=[t,qh.polygon.WRAPPED,e]:t!=qh.polygon.USD&&await YL([t,qh.polygon.USD])&&e!=qh.polygon.WRAPPED&&await YL([qh.polygon.WRAPPED,e])?n=[t,qh.polygon.USD,qh.polygon.WRAPPED,e]:t!=qh.polygon.WRAPPED&&await YL([t,qh.polygon.WRAPPED])&&e!=qh.polygon.USD&&await YL([qh.polygon.USD,e])&&(n=[t,qh.polygon.WRAPPED,qh.polygon.USD,e]),GL([n,"optionalAccess",t=>t.length])&&n[0]==qh.polygon.NATIVE?n.splice(1,0,qh.polygon.WRAPPED):GL([n,"optionalAccess",t=>t.length])&&n[n.length-1]==qh.polygon.NATIVE&&n.splice(n.length-1,0,qh.polygon.WRAPPED),n})({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,s,a,u];if(({amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u}=await(async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s})=>{if(r){if(null==(i=await ZL({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await JL({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}else if(s){if(null==(i=await ZL({path:t,amountOut:s,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await JL({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s}})({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u})),[o,a,s,u].every((t=>null==t)))return l();let m=(({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:s,amountInMaxInput:a,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"polygon",from:c,to:qL.contracts.router.address,api:qL.contracts.router.api};return t[0]===qh.polygon.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(s||a)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===qh.polygon.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:QL(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h})({path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new SL({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:m}))}))),getAmountIn:ZL}))],XL=({blockchain:t,fromAddress:e,toAddress:n,tokenIn:r,tokenOut:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u,amountOutMax:l,amountInMin:c})=>Promise.all(KL.map((h=>h.blockchain!==t?null:h.route({fromAddress:e,toAddress:n,tokenIn:r,tokenOut:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u,amountOutMax:l,amountInMin:c})))).then((t=>t.filter(Boolean)));var $L=function(t){var e=function(t){return!t.every((function(t){return void 0!==t.amount||void 0!==t.fromAmount}))},n=V.useContext(IB),i=n.amount;n.toAmount;var o,s=n.recover,a=f(V.useState(null==s&&e(t.accept)),2),u=a[0],l=a[1],c=V.useContext(DB).account,h=V.useContext(NB),d=h.conversionRate,p=h.fixedCurrencyConversionRate,m=V.useContext(iB).setError,g=f(V.useState(),2),y=g[0],v=g[1],b=f(V.useState("object"==r(i)&&i.fix&&i.currency?i.fix:null),1)[0],w=f(V.useState("object"==r(i)&&i.fix&&i.currency?i.currency:null),1)[0];u&&(o="object"==r(i)&&i.start&&i.start?i.start:"object"==r(i)&&i.fix?i.fix:1);var A=f(V.useState(o),2),_=A[0],E=A[1],M=f(V.useState(),2),k=M[0],x=M[1],S=f(V.useState(),2),C=S[0],T=S[1];V.useEffect((function(){s||l(e(t.accept))}),[t.accept,s]);var I=function(e){var n=e.amount,r=e.conversionRate,o=e.fixedCurrencyConversionRate;return new Promise((function(e,s){i&&i.token?e(t.accept.map((function(){return n}))):Promise.all(t.accept.map((function(t){return b?qh[t.blockchain].USD.toLowerCase()==t.token.toLowerCase()?1/o*b:XL({blockchain:t.blockchain,tokenIn:qh[t.blockchain].USD,amountIn:1/o*b,tokenOut:t.token,fromAddress:c,toAddress:c}):qh[t.blockchain].USD.toLowerCase()==t.token.toLowerCase()?1/r*n:XL({blockchain:t.blockchain,tokenIn:qh[t.blockchain].USD,amountIn:1/r*n,tokenOut:t.token,fromAddress:c,toAddress:c})}))).then((function(n){Promise.all(n.map((function(e,n){return"number"==typeof e?e:null==e[0]?void 0:_L.readable({blockchain:t.accept[n].blockchain,amount:e[0].amountOut,address:e[0].tokenOut})}))).then(e).catch(m)})).catch(m)}))},N=V.useCallback(jB.debounce((function(e){var n=e.account,r=e.amount,i=e.conversionRate,o=e.fixedCurrencyConversionRate;I({amount:r,conversionRate:i,fixedCurrencyConversionRate:o}).then((function(e){v(t.accept.map((function(t,r){if(null!=e[r])return{blockchain:t.blockchain,amount:LB(e[r]),token:t.token,receiver:t.receiver||n}})).filter((function(t){return!!t})))})).catch(m)}),500),[]);return V.useEffect((function(){s||u&&c&&d&&(!b||p)&&N({account:c,amount:_,conversionRate:d,fixedCurrencyConversionRate:p})}),[u,c,d,b,p,_,s]),V.useEffect((function(){u&&k?k.fromToken.readable(k.fromBalance).then((function(t){if(i&&i.token)XL({blockchain:k.blockchain,tokenIn:k.fromToken.address,tokenOut:k.toToken.address,amountIn:parseFloat(t),fromAddress:c,toAddress:c}).then((function(t){null!=t[0]?_L.readable({amount:t[0].amountOut,blockchain:k.blockchain,address:k.toToken.address}).then((function(t){var e=parseFloat(new vL(t).div(1.01).mul(d).toString());T(e>10?Math.round(e-1):LB(e-1))})).catch(m):_L.readable({amount:k.fromBalance,blockchain:k.blockchain,address:k.toToken.address}).then(T)})).catch(m);else if(k.fromToken.address==qh[k.blockchain].USD){var e=parseFloat(new vL(t).mul(d).toString());T(e>10?Math.round(e-1):e-1)}else XL({blockchain:k.blockchain,tokenIn:k.fromToken.address,tokenOut:qh[k.blockchain].USD,amountIn:parseFloat(t),fromAddress:c,toAddress:c}).then((function(t){null!=t[0]&&_L.readable({amount:t[0].amountOut,blockchain:k.blockchain,address:qh[k.blockchain].USD}).then((function(t){var e=parseFloat(new vL(t).div(1.01).mul(d).toString());T(e>10?Math.round(e):LB(e))})).catch(m)})).catch(m)})).catch(m):T(100)}),[c,k]),V.createElement(TB.Provider,{value:{amountsMissing:u,fixedAmount:b,fixedCurrency:w,acceptWithAmount:y,amount:_,setAmount:E,setMaxRoute:x,maxAmount:C}},t.children)},tD={"Pacific/Midway":"USD","Pacific/Niue":"NZD","Pacific/Pago_Pago":"USD","America/Adak":"USD","Pacific/Honolulu":"USD","Pacific/Rarotonga":"NZD","Pacific/Tahiti":"XPF","Pacific/Marquesas":"XPF","America/Anchorage":"USD","America/Juneau":"USD","America/Metlakatla":"USD","America/Nome":"USD","America/Sitka":"USD","America/Yakutat":"USD","Pacific/Gambier":"XPF","America/Los_Angeles":"USD","America/Tijuana":"MXN","America/Vancouver":"CAD","Pacific/Pitcairn":"NZD","America/Boise":"USD","America/Cambridge_Bay":"CAD","America/Chihuahua":"MXN","America/Creston":"CAD","America/Dawson":"CAD","America/Dawson_Creek":"CAD","America/Denver":"USD","America/Edmonton":"CAD","America/Fort_Nelson":"CAD","America/Hermosillo":"MXN","America/Inuvik":"CAD","America/Mazatlan":"MXN","America/Ojinaga":"MXN","America/Phoenix":"USD","America/Whitehorse":"CAD","America/Yellowknife":"CAD","America/Bahia_Banderas":"MXN","America/Belize":"BZD","America/Chicago":"USD","America/Costa_Rica":"CRC","America/El_Salvador":"USD","America/Guatemala":"GTQ","America/Indiana/Knox":"USD","America/Indiana/Tell_City":"USD","America/Managua":"NIO","America/Matamoros":"MXN","America/Menominee":"USD","America/Merida":"MXN","America/Mexico_City":"MXN","America/Monterrey":"MXN","America/North_Dakota/Beulah":"USD","America/North_Dakota/Center":"USD","America/North_Dakota/New_Salem":"USD","America/Rainy_River":"CAD","America/Rankin_Inlet":"CAD","America/Regina":"CAD","America/Resolute":"CAD","America/Swift_Current":"CAD","America/Tegucigalpa":"HNL","America/Winnipeg":"CAD","Pacific/Easter":"CLP","Pacific/Galapagos":"USD","America/Atikokan":"CAD","America/Bogota":"COP","America/Cancun":"MXN","America/Cayman":"KYD","America/Detroit":"USD","America/Eirunepe":"BRL","America/Grand_Turk":"USD","America/Guayaquil":"USD","America/Havana":"CUP","America/Indiana/Indianapolis":"USD","America/Indiana/Marengo":"USD","America/Indiana/Petersburg":"USD","America/Indiana/Vevay":"USD","America/Indiana/Vincennes":"USD","America/Indiana/Winamac":"USD","America/Iqaluit":"CAD","America/Jamaica":"JMD","America/Kentucky/Louisville":"USD","America/Kentucky/Monticello":"USD","America/Lima":"PEN","America/Nassau":"BSD","America/New_York":"USD","America/Nipigon":"CAD","America/Panama":"PAB","America/Pangnirtung":"CAD","America/Port-au-Prince":"HTG","America/Rio_Branco":"BRL","America/Thunder_Bay":"CAD","America/Toronto":"CAD","America/AnguillaSandy Hill":"XCD","America/Antigua":"XCD","America/Aruba":"AWG","America/Asuncion":"PYG","America/Barbados":"BBD","America/Blanc-Sablon":"CAD","America/Boa_Vista":"BRL","America/Campo_Grande":"BRL","America/Caracas":"VEB","America/Cuiaba":"BRL","America/Curacao":"ANG","America/Dominica":"DOP","America/Glace_Bay":"CAD","America/Goose_Bay":"CAD","America/Grenada":"XCD","America/Guadeloupe":"EUR","America/Guyana":"GYD","America/Halifax":"CAD","America/Kralendijk":"USD","America/La_Paz":"BOB","America/Lower_Princes":"USD","America/Manaus":"BRL","America/Marigot":"EUR","America/Martinique":"EUR","America/Moncton":"CAD","America/Montserrat":"XCD","America/Porto_Velho":"BRL","America/Port_of_Spain":"BZD","America/Puerto_Rico":"USD","America/Santiago":"CLP","America/Santo_Domingo":"DOP","America/St_Barthelemy":"EUR","America/St_Kitts":"XCD","America/St_Lucia":"XCD","America/St_Thomas":"USD","America/St_Vincent":"XCD","America/Thule":"DKK","America/Tortola":"USD","Atlantic/Bermuda":"BMD","America/St_Johns":"CAD","America/Araguaina":"BRL","America/Argentina/Buenos_Aires":"ARS","America/Argentina/Catamarca":"ARS","America/Argentina/Cordoba":"ARS","America/Argentina/Jujuy":"ARS","America/Argentina/La_Rioja":"ARS","America/Argentina/Mendoza":"ARS","America/Argentina/Rio_Gallegos":"ARS","America/Argentina/Salta":"ARS","America/Argentina/San_Juan":"ARS","America/Argentina/San_Luis":"ARS","America/Argentina/Tucuman":"ARS","America/Argentina/Ushuaia":"ARS","America/Bahia":"BRL","America/Belem":"BRL","America/Cayenne":"EUR","America/Fortaleza":"BRL","America/Godthab":"DKK","America/Maceio":"BRL","America/Miquelon":"EUR","America/Montevideo":"UYU","America/Paramaribo":"SRD","America/Punta_Arenas":"CLP","America/Recife":"BRL","America/Santarem":"BRL","America/Sao_Paulo":"BRL","Antarctica/Palmer":"USD","Antarctica/Rothera":"USD","Atlantic/Stanley":"FKP","America/Noronha":"BRL","Atlantic/South_Georgia":"GBP","America/Scoresbysund":"DKK","Atlantic/Azores":"EUR","Atlantic/Cape_Verde":"CVE","Africa/Abidjan":"XOF","Africa/Accra":"GHC","Africa/Bamako":"XOF","Africa/Banjul":"GMD","Africa/Bissau":"XOF","Africa/Casablanca":"MAD","Africa/Conakry":"GNF","Africa/Dakar":"XOF","Africa/El_Aaiun":"MAD","Africa/Freetown":"SLL","Africa/Lome":"XOF","Africa/Monrovia":"LRD","Africa/Nouakchott":"MRU","Africa/Ouagadougou":"XOF","Africa/Sao_Tome":"STD","America/Danmarkshavn":"DKK","Antarctica/Troll":"NOK","Atlantic/Canary":"EUR","Atlantic/Faroe":"DKK","Atlantic/Madeira":"EUR","Atlantic/Reykjavik":"ISK","Atlantic/St_Helena":"SHP","Europe/Dublin":"EUR","Europe/Guernsey":"GBP","Europe/Isle_of_Man":"IMP","Europe/Jersey":"GBP","Europe/Lisbon":"EUR","Europe/London":"GBP","Africa/Algiers":"DZD","Africa/Bangui":"XAF","Africa/Brazzaville":"XAF","Africa/Ceuta":"EUR","Africa/Douala":"XAF","Africa/Kinshasa":"CDF","Africa/Lagos":"NGN","Africa/Libreville":"XAF","Africa/Luanda":"AOA","Africa/Malabo":"XAF","Africa/Ndjamena":"XAF","Africa/Niamey":"XOF","Africa/Porto-Novo":"XOF","Africa/Tunis":"TND","Africa/Windhoek":"NAD","Arctic/Longyearbyen":"NOK","Europe/Amsterdam":"EUR","Europe/Andorra":"EUR","Europe/Belgrade":"RSD","Europe/Berlin":"EUR","Europe/Bratislava":"EUR","Europe/Brussels":"EUR","Europe/Budapest":"HUF","Europe/Copenhagen":"DKK","Europe/Gibraltar":"GIP","Europe/Ljubljana":"EUR","Europe/Luxembourg":"EUR","Europe/Madrid":"EUR","Europe/Malta":"EUR","Europe/Monaco":"EUR","Europe/Oslo":"NOK","Europe/Paris":"EUR","Europe/Podgorica":"EUR","Europe/Prague":"CZK","Europe/Rome":"EUR","Europe/San_Marino":"EUR","Europe/Sarajevo":"BAM","Europe/Skopje":"MKD","Europe/Stockholm":"SEK","Europe/Tirane":"ALL","Europe/Vaduz":"CHF","Europe/Vatican":"EUR","Europe/Vienna":"EUR","Europe/Warsaw":"PLN","Europe/Zagreb":"HRK","Europe/Zurich":"CHF","Africa/Blantyre":"MWK","Africa/Bujumbura":"BIF","Africa/Cairo":"EGP","Africa/Gaborone":"BWP","Africa/Harare":"ZWL","Africa/Johannesburg":"ZAR","Africa/Juba":"SSP","Africa/Khartoum":"SDG","Africa/Kigali":"RWF","Africa/Lubumbashi":"CDF","Africa/Lusaka":"ZMW","Africa/Maputo":"MZM","Africa/Maseru":"LSL","Africa/Mbabane":"SZL","Africa/Tripoli":"LYD","Asia/Amman":"JOD","Asia/Beirut":"LBP","Asia/Damascus":"SYP","Asia/Famagusta":"TRY","Asia/Gaza":"ILS","Asia/Hebron":"ILS","Asia/Jerusalem":"ILS","Asia/Nicosia":"EUR","Europe/Athens":"EUR","Europe/Bucharest":"RON","Europe/Chisinau":"MDL","Europe/Helsinki":"EUR","Europe/Kaliningrad":"RUB","Europe/Kiev":"UAH","Europe/Mariehamn":"EUR","Europe/Riga":"EUR","Europe/Sofia":"BGN","Europe/Tallinn":"EUR","Europe/Uzhgorod":"UAH","Europe/Vilnius":"EUR","Europe/Zaporozhye":"UAH","Africa/Addis_Ababa":"ETB","Africa/Asmara":"ERN","Africa/Dar_es_Salaam":"TZS","Africa/Djibouti":"DJF","Africa/Kampala":"UGX","Africa/Mogadishu":"SOS","Africa/Nairobi":"KES","Antarctica/Syowa":"EUR","Asia/Aden":"YER","Asia/Baghdad":"IQD","Asia/Bahrain":"BHD","Asia/Kuwait":"KWD","Asia/Qatar":"QAR","Asia/Riyadh":"SAR","Europe/Istanbul":"TRY","Europe/Kirov":"RUB","Europe/Minsk":"BYN","Europe/Moscow":"RUB","Europe/Simferopol":"RUB","Europe/Volgograd":"RUB","Indian/Antananarivo":"MGA","Indian/Comoro":"USD","Indian/Mayotte":"EUR","Asia/Tehran":"IRR","Asia/Baku":"AZN","Asia/Dubai":"AED","Asia/Muscat":"OMR","Asia/Tbilisi":"GEL","Asia/Yerevan":"AMD","Europe/Astrakhan":"RUB","Europe/Samara":"RUB","Europe/Saratov":"RUB","Europe/Ulyanovsk":"RUB","Indian/Mahe":"SCR","Indian/Mauritius":"MUR","Indian/Reunion":"EUR","Asia/Kabul":"AFN","Antarctica/Mawson":"USD","Asia/Aqtau":"KZT","Asia/Aqtobe":"KZT","Asia/Ashgabat":"TMM","Asia/Atyrau":"KZT","Asia/Dushanbe":"TJS","Asia/Karachi":"PKR","Asia/Oral":"KZT","Asia/Qyzylorda":"KZT","Asia/Samarkand":"UZS","Asia/Tashkent":"UZS","Asia/Yekaterinburg":"RUB","Indian/Kerguelen":"EUR","Indian/Maldives":"MVR","Asia/Colombo":"LKR","Asia/Kolkata":"INR","Asia/Kathmandu":"NPR","Antarctica/Vostok":"USD","Asia/Almaty":"KZT","Asia/Bishkek":"KGS","Asia/Dhaka":"BDT","Asia/Omsk":"RUB","Asia/Qostanay":"KZT","Asia/Thimphu":"BTN","Asia/Urumqi":"CNY","Indian/Chagos":"USD","Asia/Yangon":"MMK","Indian/Cocos":"AUD","Antarctica/Davis":"USD","Asia/Bangkok":"THB","Asia/Barnaul":"RUB","Asia/Hovd":"MNT","Asia/Ho_Chi_Minh":"VND","Asia/Jakarta":"IDR","Asia/Krasnoyarsk":"RUB","Asia/Novokuznetsk":"RUB","Asia/Novosibirsk":"RUB","Asia/Phnom_Penh":"KHR","Asia/Pontianak":"IDR","Asia/Tomsk":"RUB","Asia/Vientiane":"LAK","Indian/Christmas":"AUD","Asia/Brunei":"BND","Asia/Choibalsan":"MNT","Asia/Hong_Kong":"HKD","Asia/Irkutsk":"RUB","Asia/Kuala_Lumpur":"MYR","Asia/Kuching":"MYR","Asia/Macau":"MOP","Asia/Makassar":"IDR","Asia/Manila":"PHP","Asia/Shanghai":"CNY","Asia/Singapore":"SGD","Asia/Taipei":"TWD","Asia/Ulaanbaatar":"MNT","Australia/Perth":"AUD","Australia/Eucla":"AUD","Asia/Chita":"RUB","Asia/Dili":"USD","Asia/Jayapura":"IDR","Asia/Khandyga":"RUB","Asia/Pyongyang":"KPW","Asia/Seoul":"KRW","Asia/Tokyo":"JPY","Asia/Yakutsk":"RUB","Pacific/Palau":"USD","Australia/Adelaide":"AUD","Australia/Broken_Hill":"AUD","Australia/Darwin":"AUD","Antarctica/DumontDUrville":"USD","Antarctica/Macquarie":"USD","Asia/Ust-Nera":"RUB","Asia/Vladivostok":"RUB","Australia/Brisbane":"AUD","Australia/Currie":"AUD","Australia/Hobart":"AUD","Australia/Lindeman":"AUD","Australia/Melbourne":"AUD","Australia/Sydney":"AUD","Pacific/Chuuk":"USD","Pacific/GuamVillage":"USD","Pacific/Port_Moresby":"PGK","Pacific/Saipan":"USD","Australia/Lord_Howe":"AUD","Antarctica/Casey":"USD","Asia/Magadan":"RUB","Asia/Sakhalin":"RUB","Asia/Srednekolymsk":"RUB","Pacific/Bougainville":"PGK","Pacific/Efate":"VUV","Pacific/Guadalcanal":"SBD","Pacific/Kosrae":"USD","Pacific/Norfolk":"USD","Pacific/Noumea":"XPF","Pacific/Pohnpei":"USD","Antarctica/McMurdo":"USD","Asia/Anadyr":"RUB","Asia/Kamchatka":"RUB","Pacific/Auckland":"NZD","Pacific/Fiji":"FJD","Pacific/Funafuti":"AUD","Pacific/Kwajalein":"USD","Pacific/Majuro":"USD","Pacific/Nauru":"AUD","Pacific/Tarawa":"AUD","Pacific/Wake":"USD","Pacific/Wallis":"XPF","Pacific/Chatham":"CAD","Pacific/Apia":"NGN","Pacific/Enderbury":"USD","Pacific/Fakaofo":"NZD","Pacific/Tongatapu":"TOP","Pacific/Kiritimati":"AUD"};class eD{constructor({amount:t,code:e,timeZone:n=eD.timeZone()}){this.amount=t,this.code=e||window._LocalCurrencyCode||eD.getCode(n),this.timeZone=n}static getCode(t){return window._LocalCurrencyCode||tD[t||eD.timeZone()]||"USD"}static async rate({from:t,to:e}){null==e&&(e=eD.getCode());let n=await eD.fromUSD({amount:1,code:t}),r=await eD.fromUSD({amount:1,code:e});return n.amount/r.amount}static async fromUSD({amount:t,code:e,timeZone:n}){let r=new eD({amount:t,code:e,timeZone:n}),i=await fetch("https://public.depay.com/currencies/"+r.code).then((t=>t.json())).then((t=>parseFloat(t))).catch((()=>(r.code="USD",1)));return r.amount=r.amount*i,r}static timeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}toString(t={}){return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:this.code}).format(this.amount)}}var nD=function(t){var e=new eD({code:t.configuration.currency}).code;return V.useEffect((function(){null!=t.configuration.providers&&Object.entries(t.configuration.providers).forEach((function(t){((t,e)=>{switch(t){case"ethereum":return LM(e);case"bsc":return NM(e);case"polygon":return UM(e);default:throw"Unknown blockchain: "+t}})(t[0],t[1])}))}),[t.configuration]),V.createElement(IB.Provider,{value:Object.assign({},t.configuration,{currencyCode:e})},t.children)},rD=function(t){V.useContext(iB).setError;var e=V.useContext(IB),n=e.amount,i=e.currency,o=f(V.useState(),2),s=o[0],a=o[1],u=f(V.useState(),2),l=u[0],c=u[1];return V.useEffect((function(){"object"==r(n)&&n.currency&&eD.fromUSD({amount:1,code:n.currency}).then((function(t){return c(t.amount)})),eD.fromUSD({amount:1,code:i}).then((function(t){return a(t.amount)})).catch(a(1))}),[]),V.createElement(NB.Provider,{value:{conversionRate:s,fixedCurrencyConversionRate:l}},t.children)},iD=V.createContext(),oD=V.createContext(),sD=function(){var t=V.useContext(Y).close;return V.createElement(hh,{header:V.createElement("div",{className:"PaddingTopS PaddingLeftM PaddingRightM"}),body:V.createElement("div",{className:"TextCenter"},V.createElement("div",{className:"GraphicWrapper"},V.createElement("img",{className:"Graphic",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAHQCAMAAADgcCJ6AAAAXVBMVEVHcEwiGxq6jYEwExPTf2RKx+4uEhLSf2PSfmMvEhJKx+7UgWYvEhIvEhJOJyJrOzGHTkCdX023Y07Ab1bOd1/SgGPXhWhKx+7gm3roq5j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ijBfZTOtQAAAABJRU5ErkJggg=="})),V.createElement("h1",{className:"LineHeightL Text FontSizeL PaddingTopS FontWeightBold"},"Insufficient Balance"),V.createElement("div",{className:"Text PaddingTopS PaddingBottomM PaddingLeftM PaddingRightM"},V.createElement("strong",{className:"FontSizeM"},"We were not able to find any asset with enough value in your wallet. Please top up your account in order to proceed with this payment."))),footer:V.createElement("div",{className:"PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"},V.createElement("button",{className:"ButtonPrimary",onClick:t},"Ok"))})},aD=V.createContext(),uD=V.createContext(),lD=V.createContext(),cD=V.createContext(),hD=function(t){var e=V.useContext(iB).setError,r=V.useContext(IB),i=r.sent,o=r.confirmed,s=r.failed,a=r.recover,u=r.before,c=V.useContext(uD),h=c.selectedRoute;c.getPaymentRoutes;var d=V.useContext(Y),p=d.open,m=d.close,g=d.setClosable,y=V.useContext(uD).allRoutes,v=V.useContext(J).setUpdatable,b=V.useContext(oD),w=b.navigate,A=b.set,_=V.useContext(DB).wallet,E=V.useContext(lD),M=E.release,k=E.tracking,x=E.initializeTracking,S=V.useContext(cD),C=S.foundTransaction,T=S.initializeTracking,I=f(V.useState(),2),N=I[0],P=I[1],R=f(V.useState(),2),B=R[0],O=R[1],L=f(V.useState(),2),D=L[0],j=L[1],F=f(V.useState("initialized"),2),U=F[0],z=F[1],H=function(t){1!=k&&g(!0),z("confirmed"),o&&o(t)},W=function(t,e){s&&s(t,e),g(!0),A(["PaymentError"])},q=function(){var t=n(l.mark((function t(){var e;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u){t.next=6;break}return t.next=3,u(N.route.transaction);case 3:if(!1!==t.sent){t.next=6;break}return t.abrupt("return");case 6:return g(!1),z("paying"),v(!1),t.next=11,$M({blockchain:N.route.transaction.blockchain,method:"latestBlockNumber"});case 11:e=t.sent,_.sendTransaction(Object.assign({},N.route.transaction,{sent:function(t){T(t,e),i&&i(t)},confirmed:H,failed:W})).then((function(t){x(t,e,N.route),O(t)})).catch((function(t){console.log("error",t),z("initialized"),g(!0),v(!0),"WRONG_NETWORK"==(null==t?void 0:t.code)&&w("WrongNetwork")}));case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return V.useEffect((function(){M&&z("confirmed")}),[M]),V.useEffect((function(){if(a){g(!1),v(!1),z("paying"),O({blockchain:a.blockchain,id:a.transaction,url:Wh(a.blockchain).explorerUrlFor({transaction:{id:a.transaction}})});var t=new _L({blockchain:a.blockchain,address:a.token});Promise.all([t.name(),t.symbol()]).then((function(t){var e=f(t,2),n=e[0],r=e[1];P({blockchain:a.blockchain,token:a.token,name:n,symbol:r.toUpperCase(),amount:a.amount})})).catch(e)}}),[a]),V.useEffect((function(){var t;C&&C.id&&C.status&&(C.id.toLowerCase()!=B.id.toLowerCase()&&(t=Object.assign({},B,{id:C.id,url:Wh(B.blockchain).explorerUrlFor({transaction:C})}),O(t)),"success"==C.status?H(t||B):"failed"==C.status&&W(t||B))}),[C,B]),V.useEffect((function(){if(h){var t=h.fromToken;Promise.all([t.name(),t.symbol(),t.readable(h.fromAmount)]).then((function(e){var n=f(e,3),r=n[0],i=n[1],o=n[2];P({blockchain:h.blockchain,route:h,token:t.address,name:r,symbol:i.toUpperCase(),amount:o})})).catch(e)}else P(void 0)}),[h]),V.useEffect((function(){y&&0==y.length?v(!1):y&&y.length>0&&v(!0)}),[y]),y instanceof Array&&0==y.length?V.createElement(ch,{open:p,close:m,start:"NoPaymentMethodFound",container:t.container,document:t.document,dialogs:{NoPaymentMethodFound:V.createElement(sD,null)}}):V.createElement(aD.Provider,{value:{payment:N,paymentState:U,pay:q,transaction:B,approve:function(){g(!1),z("approving"),_.sendTransaction(Object.assign({},N.route.approvalTransaction,{confirmed:function(){N.route.approvalRequired=!1,P(N),g(!0),z("initialized")}})).then((function(t){j(t)})).catch((function(t){console.log("error",t),z("initialized"),g(!0)}))},approvalTransaction:D}},t.children)};function fD(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const dD=({assets:t,blockchain:e,options:n})=>n.only?t.filter((t=>(n.only[e]||[]).find((e=>e.toLowerCase()==t.address.toLowerCase())))):n.exclude?t.filter((t=>(n.exclude[e]||[]).find((e=>e.toLowerCase()!=t.address.toLowerCase())))):t;var pD=async t=>{void 0===t&&(t={accounts:{}});let e=Promise.all(Object.keys(t.accounts).map((e=>new Promise(((n,r)=>{const i=t.accounts[e],o=new AbortController;setTimeout((()=>o.abort()),1e4),fetch(`https://public.depay.com/accounts/${e}/${i}/assets`,{signal:o.signal}).catch((t=>{console.log(t),n([])})).then((t=>{if(t&&t.ok)return t.json();n([])})).then((async r=>{if(r&&r.length)return await(async({address:t,options:e,assets:n,blockchain:r})=>{if(e.only&&e.only[r]&&!e.only[r].find((t=>t.toLowerCase()==qh[r].NATIVE.toLowerCase())))return n;if(e.exclude&&e.exclude[r]&&e.exclude[r].find((t=>t.toLowerCase()==qh[r].NATIVE.toLowerCase())))return n;if(!n.find((t=>t.address.toLowerCase()==qh[r].NATIVE.toLowerCase()))){let e=await $M({blockchain:r,address:t,method:"balance"},{cache:3e4});n=[{name:qh[r].CURRENCY,symbol:qh[r].SYMBOL,address:qh[r].NATIVE,type:"NATIVE",blockchain:r,balance:e.toString()},...n]}return n})({address:i,options:t,assets:dD({assets:r,blockchain:e,options:t}).map((t=>Object.assign(t,{blockchain:e}))),blockchain:e});n([])})).then(n).catch((t=>{console.log(t),n([])}))}))))).then((t=>t.flat()));return e};const mD=(t,e)=>Object.assign({},{address:t.address,symbol:t.symbol,name:t.name,decimals:t.decimals,type:t.type,blockchain:t.blockchain},{balance:e.toString()}),gD=({assets:t,asset:e})=>!!t.find((t=>t.blockchain==e.blockchain&&t.address.toLowerCase()==e.address.toLowerCase())),yD=({options:t,address:e,blockchain:n})=>!(!(t&&t.only&&t.only[n])||t.only[n].find((t=>t.toLowerCase()==e.toLowerCase())))||!!(t&&t.exclude&&t.exclude[n]&&t.exclude[n].find((t=>t.toLowerCase()==e.toLowerCase()))),vD=t=>(t.params.path=t.params.path.filter(((e,n,r)=>!(1==n&&e==qh[t.blockchain].WRAPPED&&r[0]==qh[t.blockchain].NATIVE||n==r.length-2&&e==qh[t.blockchain].WRAPPED&&r[r.length-1]==qh[t.blockchain].NATIVE))),t),bD=(t,e)=>(t.params.data=[e.signature,e.params[0]],t),wD=(t,e)=>(t.params.data=[e.signature,e.params[1]],t.params.amounts[1]||(t.params.amounts[1]="0"),t.params.amounts[2]||(t.params.amounts[2]="0"),t.params.amounts[3]||(t.params.amounts[3]="0"),t.params.amounts[4]||(t.params.amounts[4]="0"),t.params.amounts[5]=e.params[0],t),AD=t=>{};var _D={ethereum:{payment:{address:"0x99F3F4685a7178F26EB4F4Ca8B75a1724F1577B9"},uniswap_v2:{address:"0xe04b08Dfc6CaA0F4Ec523a3Ae283Ece7efE00019",prepareTransaction:vD},paymentWithEvent:{address:"0xD8fBC10787b019fE4059Eb5AA5fB11a5862229EF"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0xF984eb8b466AD6c728E0aCc7b69Af6f69B32437F",prepareTransaction:bD},approveAndCallContractAddressPassedAmountBoolean:{address:"0x2D18c5A46cc1780d2460DD51B5d0996e55Fd2446",prepareTransaction:wD}},paymentFee:{address:"0x874Cb669D7BFff79d4A6A30F4ea52c5e413BD6A7",prepareTransaction:AD}},bsc:{payment:{address:"0x8B127D169D232D5F3ebE1C3D06CE343FD7C1AA11"},pancakeswap:{address:"0xAC3Ec4e420DD78bA86d932501E1f3867dbbfb77B",prepareTransaction:vD},paymentWithEvent:{address:"0x1869E236c03eE67B9FfEd3aCA139f4AeBA79Dc21"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0xd73dFeF8F9c213b449fB39B84c2b33FBBc2C8eD3",prepareTransaction:bD},approveAndCallContractAddressPassedAmountBoolean:{address:"0x7E655088214d0657251A51aDccE9109CFd23B5B5",prepareTransaction:wD}},paymentFee:{address:"0xae33f10AD57A38113f74FCdc1ffA6B1eC47B94E3",prepareTransaction:AD}},polygon:{payment:{address:"0x78C0F1c712A9AA2004C1F401A7307d8bCB62abBd"},quickswap:{address:"0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220",prepareTransaction:vD},paymentWithEvent:{address:" 0xfAD2F276D464EAdB71435127BA2c2e9dDefb93a4"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0x8698E529E9867eEbcC68b4792daC627cd8870736",prepareTransaction:bD},approveAndCallContractAddressPassedAmountBoolean:{address:"0xAB305eaDf5FB15AF6370106B231C67d103bBbbbC",prepareTransaction:wD}},paymentFee:{address:"0xd625c7087E940b2A91ed8bD8db45cB24D3526B56",prepareTransaction:AD}}},ED={ethereum:{address:"0xae60aC8e69414C2Dc362D0e6a03af643d1D85b92",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},bsc:{address:"0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},polygon:{address:"0x2CA727BC33915823e3D05fe043d310B8c5b2dC5b",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]}},MD="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==ph?ph:"undefined"!=typeof self?self:{};function kD(t){var e={exports:{}};return t(e,e.exports),e.exports}var xD=kD((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:af.Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function a(t,e,n){var r=s(t,n);return n-1>=e&&(r|=s(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)i=a(t,e,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,l=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;n.words[0]=a;for(var l=1;l>>26,h=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}n.words[l]=0|h,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?m+r:h[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===o?(n>=0&&(t[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,_=0|s[4],E=8191&_,M=_>>>13,k=0|s[5],x=8191&k,S=k>>>13,C=0|s[6],T=8191&C,I=C>>>13,N=0|s[7],P=8191&N,R=N>>>13,B=0|s[8],O=8191&B,L=B>>>13,D=0|s[9],j=8191&D,F=D>>>13,U=0|a[0],z=8191&U,H=U>>>13,W=0|a[1],q=8191&W,G=W>>>13,Q=0|a[2],V=8191&Q,Y=Q>>>13,J=0|a[3],Z=8191&J,K=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,lt=at>>>13,ct=0|a[8],ht=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(l+(r=Math.imul(h,z))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,z)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,H))+Math.imul(m,z)|0,o=Math.imul(m,H);var yt=(l+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,z),i=(i=Math.imul(y,H))+Math.imul(v,z)|0,o=Math.imul(v,H),r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,G)|0;var vt=(l+(r=r+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,V)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,H))+Math.imul(A,z)|0,o=Math.imul(A,H),r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,G)|0,r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Y)|0;var bt=(l+(r=r+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,H))+Math.imul(M,z)|0,o=Math.imul(M,H),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,G)|0,r=r+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,K)|0;var wt=(l+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(x,z),i=(i=Math.imul(x,H))+Math.imul(S,z)|0,o=Math.imul(S,H),r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,G)|0,r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var At=(l+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;l=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(T,z),i=(i=Math.imul(T,H))+Math.imul(I,z)|0,o=Math.imul(I,H),r=r+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,G)|0,r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var _t=(l+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;l=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,H))+Math.imul(R,z)|0,o=Math.imul(R,H),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,G)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,K)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(l+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((o=o+Math.imul(f,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(O,z),i=(i=Math.imul(O,H))+Math.imul(L,z)|0,o=Math.imul(L,H),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,G)|0,r=r+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,Y)|0,r=r+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,K)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,lt)|0;var Mt=(l+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;l=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(j,z),i=(i=Math.imul(j,H))+Math.imul(F,z)|0,o=Math.imul(F,H),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,G)|0,r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,r=r+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,lt)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var kt=(l+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(j,q),i=(i=Math.imul(j,G))+Math.imul(F,q)|0,o=Math.imul(F,G),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,K)|0,r=r+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,lt)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ft)|0;var xt=(l+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;l=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,V),i=(i=Math.imul(j,Y))+Math.imul(F,V)|0,o=Math.imul(F,Y),r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(I,nt)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,lt)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var St=(l+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,Z),i=(i=Math.imul(j,K))+Math.imul(F,Z)|0,o=Math.imul(F,K),r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(P,nt)|0,i=(i=i+Math.imul(P,rt)|0)+Math.imul(R,nt)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,lt)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(l+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,$),i=(i=Math.imul(j,tt))+Math.imul(F,$)|0,o=Math.imul(F,tt),r=r+Math.imul(O,nt)|0,i=(i=i+Math.imul(O,rt)|0)+Math.imul(L,nt)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,lt)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,ft)|0;var Tt=(l+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(M,pt)|0))<<13)|0;l=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,nt),i=(i=Math.imul(j,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,lt)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var It=(l+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(S,pt)|0))<<13)|0;l=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,ot),i=(i=Math.imul(j,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),r=r+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,lt)|0,r=r+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var Nt=(l+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;l=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(j,ut),i=(i=Math.imul(j,lt))+Math.imul(F,ut)|0,o=Math.imul(F,lt),r=r+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ft)|0;var Pt=(l+(r=r+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(R,pt)|0))<<13)|0;l=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(j,ht),i=(i=Math.imul(j,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(l+(r=r+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(L,pt)|0))<<13)|0;l=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Bt=(l+(r=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(F,pt)|0))<<13)|0;return l=((o=Math.imul(F,mt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=At,u[6]=_t,u[7]=Et,u[8]=Mt,u[9]=kt,u[10]=xt,u[11]=St,u[12]=Ct,u[13]=Tt,u[14]=It,u[15]=Nt,u[16]=Pt,u[17]=Rt,u[18]=Bt,0!==l&&(u[19]=l,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return g(t,e,n)}Math.imul||(m=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?p(this,t,e):n<1024?g(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,s=0|o.words[o.length-1];0!=(n=26-this._countBits(s))&&(o=o.ushln(n),r.iushln(n),s=0|o.words[o.length-1]);var a,u=r.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var l=0;l=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=f)}return a&&a._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a),s.isub(u)):(r.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);n(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;r--){for(var l=e.words[r],c=u-1;c>=0;c--){var h=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===r&&0===c)&&(o=this.mul(o,n[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},r(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,MD)}));let SD=!1,CD=!1;const TD={debug:1,default:2,info:2,warning:3,error:4,off:5};let ID=TD.default,ND=null;const PD=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(n){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var RD,BD;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(RD||(RD={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(BD||(BD={}));const OD="0123456789abcdef";class LD{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();null==TD[n]&&this.throwArgumentError("invalid log level name","logLevel",t),ID>TD[n]||console.log.apply(console,e)}debug(...t){this._log(LD.levels.DEBUG,t)}info(...t){this._log(LD.levels.INFO,t)}warn(...t){this._log(LD.levels.WARNING,t)}makeError(t,e,n){if(CD)return this.makeError("censored error",e,{});e||(e=LD.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((t=>{const e=n[t];try{if(e instanceof Uint8Array){let n="";for(let t=0;t>4],n+=OD[15&e[t]];r.push(t+"=Uint8Array(0x"+n+")")}else r.push(t+"="+JSON.stringify(e))}catch(e){r.push(t+"="+JSON.stringify(n[t].toString()))}})),r.push(`code=${e}`),r.push(`version=${this.version}`);const i=t;let o="";switch(e){case BD.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case BD.CALL_EXCEPTION:case BD.INSUFFICIENT_FUNDS:case BD.MISSING_NEW:case BD.NONCE_EXPIRED:case BD.REPLACEMENT_UNDERPRICED:case BD.TRANSACTION_REPLACED:case BD.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),r.length&&(t+=" ("+r.join(", ")+")");const s=new Error(t);return s.reason=i,s.code=e,Object.keys(n).forEach((function(t){s[t]=n[t]})),s}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,LD.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,r){t||this.throwError(e,n,r)}assertArgument(t,e,n,r){t||this.throwArgumentError(e,n,r)}checkNormalize(t){PD&&this.throwError("platform missing String.prototype.normalize",LD.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:PD})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,LD.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,LD.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n=n?": "+n:"",te&&this.throwError("too many arguments"+n,LD.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",LD.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",LD.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",LD.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return ND||(ND=new LD("logger/5.6.0")),ND}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",LD.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),SD){if(!t)return;this.globalLogger().throwError("error censorship permanent",LD.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}CD=!!t,SD=!!e}static setLogLevel(t){const e=TD[t.toLowerCase()];null!=e?ID=e:LD.globalLogger().warn("invalid log level - "+t)}static from(t){return new LD(t)}}LD.errors=BD,LD.levels=RD;const DD=new LD("bytes/5.6.1");function jD(t){return!!t.toHexString}function FD(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return FD(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function UD(t){return"number"==typeof t&&t==t&&t%1==0}function zD(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!UD(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function HD(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const WD="0123456789abcdef";function qD(t,e){if(e||(e={}),"number"==typeof t){DD.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=WD[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),jD(t))return t.toHexString();if(HD(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":DD.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(zD(t)){let e="0x";for(let n=0;n>4]+WD[15&r]}return e}return DD.throwArgumentError("invalid hexlify value","value",t)}function GD(t,e){for("string"!=typeof t?t=qD(t):HD(t)||DD.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&DD.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}const QD="bignumber/5.6.2";var VD=xD.BN;const YD=new LD(QD),JD={},ZD=9007199254740991;let KD=!1;class XD{constructor(t,e){t!==JD&&YD.throwError("cannot call constructor directly; use BigNumber.from",LD.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return tj(ej(this).fromTwos(t))}toTwos(t){return tj(ej(this).toTwos(t))}abs(){return"-"===this._hex[0]?XD.from(this._hex.substring(1)):this}add(t){return tj(ej(this).add(ej(t)))}sub(t){return tj(ej(this).sub(ej(t)))}div(t){return XD.from(t).isZero()&&nj("division-by-zero","div"),tj(ej(this).div(ej(t)))}mul(t){return tj(ej(this).mul(ej(t)))}mod(t){const e=ej(t);return e.isNeg()&&nj("division-by-zero","mod"),tj(ej(this).umod(e))}pow(t){const e=ej(t);return e.isNeg()&&nj("negative-power","pow"),tj(ej(this).pow(e))}and(t){const e=ej(t);return(this.isNegative()||e.isNeg())&&nj("unbound-bitwise-result","and"),tj(ej(this).and(e))}or(t){const e=ej(t);return(this.isNegative()||e.isNeg())&&nj("unbound-bitwise-result","or"),tj(ej(this).or(e))}xor(t){const e=ej(t);return(this.isNegative()||e.isNeg())&&nj("unbound-bitwise-result","xor"),tj(ej(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&nj("negative-width","mask"),tj(ej(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&nj("negative-width","shl"),tj(ej(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&nj("negative-width","shr"),tj(ej(this).shrn(t))}eq(t){return ej(this).eq(ej(t))}lt(t){return ej(this).lt(ej(t))}lte(t){return ej(this).lte(ej(t))}gt(t){return ej(this).gt(ej(t))}gte(t){return ej(this).gte(ej(t))}isNegative(){return"-"===this._hex[0]}isZero(){return ej(this).isZero()}toNumber(){try{return ej(this).toNumber()}catch(t){nj("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return YD.throwError("this platform does not support BigInt",LD.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?KD||(KD=!0,YD.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?YD.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",LD.errors.UNEXPECTED_ARGUMENT,{}):YD.throwError("BigNumber.toString does not accept parameters",LD.errors.UNEXPECTED_ARGUMENT,{})),ej(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof XD)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new XD(JD,$D(t)):t.match(/^-?[0-9]+$/)?new XD(JD,$D(new VD(t))):YD.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&nj("underflow","BigNumber.from",t),(t>=ZD||t<=-ZD)&&nj("overflow","BigNumber.from",t),XD.from(String(t));const e=t;if("bigint"==typeof e)return XD.from(e.toString());if(zD(e))return XD.from(qD(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return XD.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(HD(t)||"-"===t[0]&&HD(t.substring(1))))return XD.from(t)}return YD.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function $D(t){if("string"!=typeof t)return $D(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&YD.throwArgumentError("invalid hex","value",t),"0x00"===(t=$D(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function tj(t){return XD.from($D(t))}function ej(t){const e=XD.from(t).toHexString();return"-"===e[0]?new VD("-"+e.substring(3),16):new VD(e.substring(2),16)}function nj(t,e,n){const r={fault:t,operation:e};return null!=n&&(r.value=n),YD.throwError(t,LD.errors.NUMERIC_FAULT,r)}const rj=new LD(QD),ij={},oj=XD.from(0),sj=XD.from(-1);function aj(t,e,n,r){const i={fault:e,operation:n};return void 0!==r&&(i.value=r),rj.throwError(t,LD.errors.NUMERIC_FAULT,i)}let uj="0";for(;uj.length<256;)uj+=uj;function lj(t){if("number"!=typeof t)try{t=XD.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+uj.substring(0,t):rj.throwArgumentError("invalid decimal size","decimals",t)}function cj(t,e){null==e&&(e=0);const n=lj(e),r=(t=XD.from(t)).lt(oj);r&&(t=t.mul(sj));let i=t.mod(n).toString();for(;i.length2&&rj.throwArgumentError("too many decimal points","value",t);let o=i[0],s=i[1];for(o||(o="0"),s||(s="0");"0"===s[s.length-1];)s=s.substring(0,s.length-1);for(s.length>n.length-1&&aj("fractional component exceeds decimals","underflow","parseFixed"),""===s&&(s="0");s.lengthnull==t[e]?r:(typeof t[e]!==n&&rj.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&rj.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&rj.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new fj(ij,e,n,r)}}class dj{constructor(t,e,n,r){t!==ij&&rj.throwError("cannot use FixedNumber constructor; use FixedNumber.from",LD.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=e,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&rj.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=hj(this._value,this.format.decimals),n=hj(t._value,t.format.decimals);return dj.fromValue(e.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=hj(this._value,this.format.decimals),n=hj(t._value,t.format.decimals);return dj.fromValue(e.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=hj(this._value,this.format.decimals),n=hj(t._value,t.format.decimals);return dj.fromValue(e.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=hj(this._value,this.format.decimals),n=hj(t._value,t.format.decimals);return dj.fromValue(e.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=dj.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(e=e.subUnsafe(pj.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=dj.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(e=e.addUnsafe(pj.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&rj.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const n=dj.from("1"+uj.substring(0,t),this.format),r=mj.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&rj.throwArgumentError("invalid byte width","width",t),GD(XD.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return dj.fromString(this._value,t)}static fromValue(t,e,n){return null!=n||null==e||function(t){return null!=t&&(XD.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||HD(t)||"bigint"==typeof t||zD(t))}(e)||(n=e,e=null),null==e&&(e=0),null==n&&(n="fixed"),dj.fromString(cj(t,e),fj.from(n))}static fromString(t,e){null==e&&(e="fixed");const n=fj.from(e),r=hj(t,n.decimals);!n.signed&&r.lt(oj)&&aj("unsigned value cannot be negative","overflow","value",t);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=GD(i,n.width/8));const o=cj(r,n.decimals);return new dj(ij,i,o,n)}static fromBytes(t,e){null==e&&(e="fixed");const n=fj.from(e);if(function(t,e){if(e||(e={}),"number"==typeof t){DD.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),FD(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),jD(t)&&(t=t.toHexString()),HD(t)){let n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":DD.throwArgumentError("hex data is odd-length","value",t));const r=[];for(let t=0;tn.width/8)throw new Error("overflow");let r=XD.from(t);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),o=cj(r,n.decimals);return new dj(ij,i,o,n)}static from(t,e){if("string"==typeof t)return dj.fromString(t,e);if(zD(t))return dj.fromBytes(t,e);try{return dj.fromValue(t,0,e)}catch(t){if(t.code!==LD.errors.INVALID_ARGUMENT)throw t}return rj.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const pj=dj.from(1),mj=dj.from("0.5"),gj=new LD("units/5.6.1"),yj=["wei","kwei","mwei","gwei","szabo","finney","ether"];let vj=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==qh[t.blockchain].NATIVE?t.toAddress:t.toToken.address:ED[t.blockchain].address,bj=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==qh[t.blockchain].NATIVE?void 0:_L[t.blockchain].DEFAULT:ED[t.blockchain].api,wj=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==qh[t.blockchain].NATIVE?void 0:"transfer":"route",Aj=({paymentRoute:t,exchangeRoute:e,event:n,fee:r})=>t.directTransfer&&!r?t.toToken.address==qh[t.blockchain].NATIVE?void 0:[t.toAddress,t.toAmount]:{path:_j({paymentRoute:t,exchangeRoute:e}),amounts:Ej({paymentRoute:t,exchangeRoute:e,fee:r}),addresses:xj({paymentRoute:t,fee:r}),plugins:Sj({paymentRoute:t,exchangeRoute:e,event:n,fee:r}),data:[]},_j=({paymentRoute:t,exchangeRoute:e})=>e?e.path:[t.toToken.address],Ej=({paymentRoute:t,exchangeRoute:e,fee:n})=>{let r;r=e?[e.amountIn.toString(),Mj({amount:e.amountOutMin.toString(),paymentRoute:t,fee:n}),e.transaction.params.deadline]:[t.toAmount,Mj({amount:t.toAmount,paymentRoute:t,fee:n})],n&&(r[4]=kj({paymentRoute:t,fee:n}));for(var i=0;i{if(n){let r=kj({paymentRoute:e,fee:n});return XD.from(t).sub(r).toString()}return t},kj=({paymentRoute:t,fee:e})=>{if("string"==typeof e.amount&&e.amount.match("%"))return XD.from(t.toAmount).mul(10*parseFloat(e.amount)).div(1e3).toString();if("string"==typeof e.amount)return e.amount;if("number"==typeof e.amount)return function(t,e){if("string"!=typeof t&&gj.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=yj.indexOf(e);-1!==t&&(e=3*t)}return hj(t,null!=e?e:18)}(e.amount.toString(),t.toDecimals).toString();throw"Unknown fee amount type!"},xj=({paymentRoute:t,fee:e})=>e?[t.fromAddress,e.receiver,t.toAddress]:[t.fromAddress,t.toAddress],Sj=({paymentRoute:t,exchangeRoute:e,event:n,fee:r})=>{let i=[];if(e&&(t.exchangePlugin=_D[t.blockchain][e.exchange.name],i.push(t.exchangePlugin.address)),t.toContract){let e=t.toContract.signature.match(/\(.*\)/);if(e&&function(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}([e,"optionalAccess",t=>t.length])){e=e[0].replace(/[\(\)]/g,"");let n=e.split(",");if("address"==n[0]&&n[1].match("uint")&&"bool"==n[2]&&Number.isNaN(parseInt(t.toContract.params[0])))t.contractCallPlugin=_D[t.blockchain].contractCall.approveAndCallContractAddressAmountBoolean;else{if("address"!=n[0]||!n[1].match("uint")||"bool"!=n[2]||Number.isNaN(parseInt(t.toContract.params[0])))throw e;t.contractCallPlugin=_D[t.blockchain].contractCall.approveAndCallContractAddressPassedAmountBoolean}i.push(t.contractCallPlugin.address)}}else"ifSwapped"!=n||t.directTransfer?i.push(_D[t.blockchain].payment.address):i.push(_D[t.blockchain].paymentWithEvent.address);return r&&i.push(_D[t.blockchain].paymentFee.address),i},Cj=({paymentRoute:t,exchangeRoute:e})=>t.fromToken.address==qh[t.blockchain].NATIVE?e?e.amountIn.toString():t.toAmount.toString():XD.from("0").toString() + */var Gx=sk((function(t){!function(){var e="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof Fh&&Fh.versions&&Fh.versions.node?r=ok:i&&(r=self);var o=!r.JS_SHA3_NO_COMMON_JS&&t.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),u=[4,1024,262144,67108864],l=[0,8,16,24],c=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],h=[224,256,384,512],f=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!s||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var m=function(t,e,n){return function(r){return new I(t,e,t).update(r)[n]()}},g=function(t,e,n){return function(r,i){return new I(t,e,i).update(r)[n]()}},y=function(t,e,n){return function(e,r,i,o){return _["cshake"+t].update(e,r,i,o)[n]()}},v=function(t,e,n){return function(e,r,i,o){return _["kmac"+t].update(e,r,i,o)[n]()}},b=function(t,e,n,r){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function N(t,e,n){I.call(this,t,e,n)}I.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,a=this.blocks,u=this.byteCount,c=t.length,h=this.blockCount,f=0,d=this.s;f>2]|=t[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(this.start=i-u,this.block=a[h],i=0;i>=8);n>0;)i.unshift(n),n=255&(t>>=8),++r;return e?i.push(r):i.unshift(r),this.update(i),i.length},I.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var a=0;a=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++a)),i+=4)}return i+=this.encode(8*i),this.update(t),i},I.prototype.bytepad=function(t,e){for(var n=this.encode(e),r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e>4&15]+a[15&t]+a[t>>12&15]+a[t>>8&15]+a[t>>20&15]+a[t>>16&15]+a[t>>28&15]+a[t>>24&15];s%e==0&&(P(n),o=0)}return i&&(t=n[o],u+=a[t>>4&15]+a[15&t],i>1&&(u+=a[t>>12&15]+a[t>>8&15]),i>2&&(u+=a[t>>20&15]+a[t>>16&15])),u},I.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%n==0&&P(r)}return o&&(t=a<<2,e=r[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},N.prototype=new I,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var P=function(t){var e,n,r,i,o,s,a,u,l,h,f,d,p,m,g,y,v,b,w,A,_,E,M,k,x,S,C,T,I,N,P,R,B,O,L,D,j,F,U,z,H,W,q,G,Q,V,Y,J,Z,K,X,$,tt,et,nt,rt,it,ot,st,at,ut,lt,ct;for(r=0;r<48;r+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),n=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=i^(u<<1|l>>>31),n=o^(l<<1|u>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=s^(h<<1|f>>>31),n=a^(f<<1|h>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=u^(d<<1|p>>>31),n=l^(p<<1|d>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=h^(i<<1|o>>>31),n=f^(o<<1|i>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,m=t[0],g=t[1],V=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,W=t[40]<<18|t[41]>>>14,q=t[41]<<18|t[40]>>>14,O=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,N=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,lt=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,D=t[14]<<6|t[15]>>>26,j=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,K=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,B=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,Q=t[9]<<27|t[8]>>>5,S=t[18]<<20|t[19]>>>12,C=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=m^~y&b,t[1]=g^~v&w,t[10]=k^~S&T,t[11]=x^~C&I,t[20]=O^~D&F,t[21]=L^~j&U,t[30]=G^~V&J,t[31]=Q^~Y&Z,t[40]=et^~rt&ot,t[41]=nt^~it&st,t[2]=y^~b&A,t[3]=v^~w&_,t[12]=S^~T&N,t[13]=C^~I&P,t[22]=D^~F&z,t[23]=j^~U&H,t[32]=V^~J&K,t[33]=Y^~Z&X,t[42]=rt^~ot&at,t[43]=it^~st&ut,t[4]=b^~A&E,t[5]=w^~_&M,t[14]=T^~N&R,t[15]=I^~P&B,t[24]=F^~z&W,t[25]=U^~H&q,t[34]=J^~K&$,t[35]=Z^~X&tt,t[44]=ot^~at<,t[45]=st^~ut&ct,t[6]=A^~E&m,t[7]=_^~M&g,t[16]=N^~R&k,t[17]=P^~B&x,t[26]=z^~W&O,t[27]=H^~q&L,t[36]=K^~$&G,t[37]=X^~tt&Q,t[46]=at^~lt&et,t[47]=ut^~ct&nt,t[8]=E^~m&y,t[9]=M^~g&v,t[18]=R^~k&S,t[19]=B^~x&C,t[28]=W^~O&D,t[29]=q^~L&j,t[38]=$^~G&V,t[39]=tt^~Q&Y,t[48]=lt^~et&rt,t[49]=ct^~nt&it,t[0]^=c[r],t[1]^=c[r+1]};if(o)t.exports=_;else for(M=0;M>=8;return e}function Zx(t,e,n){let r=0;for(let i=0;ie+1+r&&Yx.throwError("child data too short",yk.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function tS(t,e){if(0===t.length&&Yx.throwError("data too short",yk.errors.BUFFER_OVERRUN,{}),t[e]>=248){const n=t[e]-247;e+1+n>t.length&&Yx.throwError("data short segment too short",yk.errors.BUFFER_OVERRUN,{});const r=Zx(t,e+1,n);return e+1+n+r>t.length&&Yx.throwError("data long segment too short",yk.errors.BUFFER_OVERRUN,{}),$x(t,e,e+1+n,n+r)}if(t[e]>=192){const n=t[e]-192;return e+1+n>t.length&&Yx.throwError("data array too short",yk.errors.BUFFER_OVERRUN,{}),$x(t,e,e+1,n)}if(t[e]>=184){const n=t[e]-183;e+1+n>t.length&&Yx.throwError("data array too short",yk.errors.BUFFER_OVERRUN,{});const r=Zx(t,e+1,n);return e+1+n+r>t.length&&Yx.throwError("data array too short",yk.errors.BUFFER_OVERRUN,{}),{consumed:1+n+r,result:Tk(t.slice(e+1+n,e+1+n+r))}}if(t[e]>=128){const n=t[e]-128;return e+1+n>t.length&&Yx.throwError("data too short",yk.errors.BUFFER_OVERRUN,{}),{consumed:1+n,result:Tk(t.slice(e+1,e+1+n))}}return{consumed:1,result:Tk(t[e])}}function eS(t){const e=Mk(t),n=tS(e,0);return n.consumed!==e.length&&Yx.throwArgumentError("invalid rlp data","data",t),n.result}const nS=new yk("address/5.6.1");function rS(t){Sk(t,20)||nS.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const r=Mk(Vx(n));for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&r[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const iS={};for(let t=0;t<10;t++)iS[String(t)]=String(t);for(let t=0;t<26;t++)iS[String.fromCharCode(65+t)]=String(10+t);const oS=Math.floor(function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}(9007199254740991));function sS(t){let e=null;if("string"!=typeof t&&nS.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=rS(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&nS.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>iS[t])).join("");for(;e.length>=oS;){let t=e.substring(0,oS);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}(t)&&nS.throwArgumentError("bad icap checksum","address",t),n=t.substring(4),e=new Dk(n,36).toString(16);e.length<40;)e="0"+e;e=rS("0x"+e)}else nS.throwArgumentError("invalid address","address",t);var n;return e}function aS(t){let e=null;try{e=sS(t.from)}catch(e){nS.throwArgumentError("missing from address","transaction",t)}return sS(Nk(Vx(Xx([e,xk(Mk(Hk.from(t.nonce).toHexString()))])),12))}class uS extends Hx{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=sS(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return sS(Bk(t.readValue().toHexString(),20))}}class lS extends Hx{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const cS=new yk(yx);function hS(t,e,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let t={};r=e.map((e=>{const r=e.localName;return r||cS.throwError("cannot encode object for signature with missing names",yk.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]&&cS.throwError("cannot encode object for signature with duplicate names",yk.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]=!0,n[r]}))}else cS.throwArgumentError("invalid tuple value","tuple",n);e.length!==r.length&&cS.throwArgumentError("types/value length mismatch","tuple",n);let i=new Wx(t.wordSize),o=new Wx(t.wordSize),s=[];e.forEach(((t,e)=>{let n=r[e];if(t.dynamic){let e=o.length;t.encode(o,n);let r=i.writeUpdatableValue();s.push((t=>{r(t+e)}))}else t.encode(i,n)})),s.forEach((t=>{t(i.length)}));let a=t.appendWriter(i);return a+=t.appendWriter(o),a}function fS(t,e){let n=[],r=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let n=t.readValue(),o=r.subReader(n.toNumber());try{i=e.decode(o)}catch(t){if(t.code===yk.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===yk.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&n.push(i)}));const i=e.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});e.forEach(((t,e)=>{let r=t.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[e];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let t=0;t{throw e}})}return Object.freeze(n)}class dS extends Hx{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;nt._data.length&&cS.throwError("insufficient data length",yk.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let n=[];for(let t=0;t>6==2;r++)t++;return t}return t===xS.OVERRUN?n.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(kS||(kS={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(xS||(xS={}));const CS=Object.freeze({error:function(t,e,n,r,i){return MS.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",n)},ignore:SS,replace:function(t,e,n,r,i){return t===xS.OVERLONG?(r.push(i),0):(r.push(65533),SS(t,e,n))}});function TS(t,e){null==e&&(e=CS.error),t=Mk(t);const n=[];let r=0;for(;r>7==0){n.push(i);continue}let o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){r+=e(128==(192&i)?xS.UNEXPECTED_CONTINUE:xS.BAD_PREFIX,r-1,t,n);continue}o=3,s=65535}if(r-1+o>=t.length){r+=e(xS.OVERRUN,r-1,t,n);continue}let a=i&(1<<8-o-1)-1;for(let i=0;i1114111?r+=e(xS.OUT_OF_RANGE,r-1-o,t,n,a):a>=55296&&a<=57343?r+=e(xS.UTF16_SURROGATE,r-1-o,t,n,a):a<=s?r+=e(xS.OVERLONG,r-1-o,t,n,a):n.push(a))}return n}function IS(t,e=kS.current){e!=kS.current&&(MS.checkNormalize(),t=t.normalize(e));let n=[];for(let e=0;e>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return Mk(n)}function NS(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function PS(t,e){return NS(TS(t,e))}function RS(t,e=kS.current){return TS(IS(t,e))}function BS(t,e){e||(e=function(t){return[parseInt(t,16)]});let n=0,r={};return t.split(",").forEach((t=>{let i=t.split(":");n+=parseInt(i[0],16),r[n]=e(i[1])})),r}function OS(t){let e=0;return t.split(",").map((t=>{let n=t.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:r,h:e}}))}function LS(t,e){let n=0;for(let r=0;r=n&&t<=n+i.h&&(t-n)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-n))continue;return i}}return null}const DS=OS("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),jS="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),FS=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],US=BS("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),zS=BS("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),HS=BS("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let n=0;n{if(jS.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){let e=LS(t,FS);if(e)return[t+e.s];let n=US[t];if(n)return n;let r=zS[t];return r?[t+r[0]]:HS[t]||null}(t);return e||[t]})),e=n.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),e=RS(NS(e),kS.NFKC),e.forEach((t=>{if(LS(t,WS))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(LS(t,DS))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let r=NS(e);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw new Error("invalid hyphen");if(r.length>63)throw new Error("too long");return r}class GS extends mS{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,IS(e))}decode(t){return PS(super.decode(t))}}class QS extends Hx{constructor(t,e){let n=!1;const r=[];t.forEach((t=>{t.dynamic&&(n=!0),r.push(t.type)})),super("tuple","tuple("+r.join(",")+")",e,n),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[r]))})),Object.freeze(t)}encode(t,e){return hS(t,this.coders,e)}decode(t){return t.coerce(this.name,fS(t,this.coders))}}const VS=new yk(yx),YS=new RegExp(/^bytes([0-9]*)$/),JS=new RegExp(/^(u?int)([0-9]*)$/),ZS=new class{constructor(t){ux(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new uS(t.name);case"bool":return new pS(t.name);case"string":return new GS(t.name);case"bytes":return new gS(t.name);case"array":return new dS(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new QS((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new vS(t.name)}let e=t.type.match(JS);if(e){let n=parseInt(e[2]||"256");return(0===n||n>256||n%8!=0)&&VS.throwArgumentError("invalid "+e[1]+" bit length","param",t),new ES(n/8,"int"===e[1],t.name)}if(e=t.type.match(YS),e){let n=parseInt(e[1]);return(0===n||n>32)&&VS.throwArgumentError("invalid bytes length","param",t),new yS(n,t.name)}return VS.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new qx(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new Wx(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(xx.from(t))));return new QS(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&VS.throwError("types/values length mismatch",yk.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const n=t.map((t=>this._getCoder(xx.from(t)))),r=new QS(n,"_"),i=this._getWriter();return r.encode(i,e),i.data}decode(t,e,n){const r=t.map((t=>this._getCoder(xx.from(t))));return new QS(r,"_").decode(this._getReader(Mk(e),n))}};function KS(t){return Vx(IS(t))}const XS="hash/5.6.1",$S=new yk(XS),tC=new Uint8Array(32);tC.fill(0);const eC=new RegExp("^((.*)\\.)?([^.]+)$");function nC(t){"string"!=typeof t&&$S.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,n=tC;for(;e.length;){const r=e.match(eC);null!=r&&""!==r[2]||$S.throwArgumentError("invalid ENS address; missing component","name",t),n=Vx(kk([n,Vx(IS(qS(r[3])))])),e=r[2]||""}return Tk(n)}var rC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const iC=new yk(XS),oC=new Uint8Array(32);oC.fill(0);const sC=Hk.from(-1),aC=Hk.from(0),uC=Hk.from(1),lC=Hk.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),cC=Bk(uC.toHexString(),32),hC=Bk(aC.toHexString(),32),fC={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},dC=["name","version","chainId","verifyingContract","salt"];function pC(t){return function(e){return"string"!=typeof e&&iC.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const mC={name:pC("name"),version:pC("version"),chainId:function(t){try{return Hk.from(t).toString()}catch(t){}return iC.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return sS(t).toLowerCase()}catch(t){}return iC.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=Mk(t);if(32!==e.length)throw new Error("bad length");return Tk(e)}catch(t){}return iC.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function gC(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=""===e[1],r=parseInt(e[2]||"256");(r%8!=0||r>256||e[2]&&e[2]!==String(r))&&iC.throwArgumentError("invalid numeric width","type",t);const i=lC.mask(n?r-1:r),o=n?i.add(uC).mul(sC):aC;return function(e){const n=Hk.from(e);return(n.lt(o)||n.gt(i))&&iC.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),Bk(n.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return(0===n||n>32||e[1]!==String(n))&&iC.throwArgumentError("invalid bytes width","type",t),function(e){return Mk(e).length!==n&&iC.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=Mk(t),n=e.length%32;return n?Pk([e,oC.slice(n)]):Tk(e)}(e)}}}switch(t){case"address":return function(t){return Bk(sS(t),32)};case"bool":return function(t){return t?cC:hC};case"bytes":return function(t){return Vx(t)};case"string":return function(t){return KS(t)}}return null}function yC(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class vC{constructor(t){ux(this,"types",Object.freeze(mx(t))),ux(this,"_encoderCache",{}),ux(this,"_types",{});const e={},n={},r={};Object.keys(t).forEach((t=>{e[t]={},n[t]=[],r[t]={}}));for(const r in t){const i={};t[r].forEach((o=>{i[o.name]&&iC.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===r&&iC.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t),gC(s)||(n[s]||iC.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),n[s].push(r),e[r][s]=!0)}))}const i=Object.keys(n).filter((t=>0===n[t].length));0===i.length?iC.throwArgumentError("missing primary type","types",t):i.length>1&&iC.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),ux(this,"primaryType",i[0]),function i(o,s){s[o]&&iC.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{n[t]&&(i(t,s),Object.keys(s).forEach((e=>{r[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in r){const n=Object.keys(r[e]);n.sort(),this._types[e]=yC(e,t[e])+n.map((e=>yC(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=gC(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],n=this.getEncoder(t),r=parseInt(e[3]);return e=>{r>=0&&e.length!==r&&iC.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(n);return this._types[t]&&(i=i.map(Vx)),Vx(Pk(i))}}const n=this.types[t];if(n){const e=KS(this._types[t]);return t=>{const r=n.map((({name:e,type:n})=>{const r=this.getEncoder(n)(t[e]);return this._types[n]?Vx(r):r}));return r.unshift(e),Pk(r)}}return iC.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||iC.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Vx(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(gC(t))return n(t,e);const r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const t=r[1],i=parseInt(r[3]);return i>=0&&e.length!==i&&iC.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,n)))}const i=this.types[t];return i?i.reduce(((t,{name:r,type:i})=>(t[r]=this._visit(i,e[r],n),t)),{}):iC.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new vC(t)}static getPrimaryType(t){return vC.from(t).primaryType}static hashStruct(t,e,n){return vC.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){const r=fC[n];r||iC.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:r})}return e.sort(((t,e)=>dC.indexOf(t.name)-dC.indexOf(e.name))),vC.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return Pk(["0x1901",vC.hashDomain(t),vC.from(e).hash(n)])}static hash(t,e,n){return Vx(vC.encode(t,e,n))}static resolveNames(t,e,n,r){return rC(this,void 0,void 0,(function*(){t=hx(t);const i={};t.verifyingContract&&!Sk(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=vC.from(e);o.visit(n,((t,e)=>("address"!==t||Sk(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield r(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),n=o.visit(n,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:n}}))}static getPayload(t,e,n){vC.hashDomain(t);const r={},i=[];dC.forEach((e=>{const n=t[e];null!=n&&(r[e]=mC[e](n),i.push({name:e,type:fC[e]}))}));const o=vC.from(e),s=hx(e);return s.EIP712Domain?iC.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(n),{types:s,domain:r,primaryType:o.primaryType,message:o.visit(n,((t,e)=>{if(t.match(/^bytes(\d*)/))return Tk(Mk(e));if(t.match(/^u?int/))return Hk.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&iC.throwArgumentError("invalid string","value",e),e}return iC.throwArgumentError("unsupported type","type",t)}))}}}const bC=new yk(yx);class wC extends gx{}class AC extends gx{}class _C extends gx{}class EC extends gx{static isIndexed(t){return!(!t||!t._isIndexed)}}const MC={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function kC(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return n.error=e,n}class xC{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,ux(this,"fragments",e.map((t=>Cx.from(t))).filter((t=>null!=t))),ux(this,"_abiCoder",lx(new.target,"getAbiCoder")()),ux(this,"functions",{}),ux(this,"errors",{}),ux(this,"events",{}),ux(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void bC.warn("duplicate definition - constructor"):void ux(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let n=t.format();e[n]?bC.warn("duplicate definition - "+n):e[n]=t})),this.deploy||ux(this,"deploy",Rx.from({payable:!1,type:"constructor"})),ux(this,"_isInterface",!0)}format(t){t||(t=Mx.full),t===Mx.sighash&&bC.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===Mx.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return ZS}static getAddress(t){return sS(t)}static getSighash(t){return Nk(KS(t.format()),0,4)}static getEventTopic(t){return KS(t.format())}getFunction(t){if(Sk(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];bC.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===n.length?bC.throwArgumentError("no matching function","name",e):n.length>1&&bC.throwArgumentError("multiple matching functions","name",e),this.functions[n[0]]}const e=this.functions[Bx.fromString(t).format()];return e||bC.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(Sk(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];bC.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===n.length?bC.throwArgumentError("no matching event","name",e):n.length>1&&bC.throwArgumentError("multiple matching events","name",e),this.events[n[0]]}const e=this.events[Tx.fromString(t).format()];return e||bC.throwArgumentError("no matching event","signature",t),e}getError(t){if(Sk(t)){const e=lx(this.constructor,"getSighash");for(const n in this.errors)if(t===e(this.errors[n]))return this.errors[n];bC.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===n.length?bC.throwArgumentError("no matching error","name",e):n.length>1&&bC.throwArgumentError("multiple matching errors","name",e),this.errors[n[0]]}const e=this.errors[Bx.fromString(t).format()];return e||bC.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return lx(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),lx(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const n=Mk(e);return Tk(n.slice(0,4))!==this.getSighash(t)&&bC.throwArgumentError(`data signature does not match error ${t.name}.`,"data",Tk(n)),this._decodeParams(t.inputs,n.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),Tk(kk([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const n=Mk(e);return Tk(n.slice(0,4))!==this.getSighash(t)&&bC.throwArgumentError(`data signature does not match function ${t.name}.`,"data",Tk(n)),this._decodeParams(t.inputs,n.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Tk(kk([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let n=Mk(e),r=null,i="",o=null,s=null,a=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,n)}catch(t){}break;case 4:{const e=Tk(n.slice(0,4)),u=MC[e];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),s=u.name,a=u.signature,u.reason&&(r=o[0]),"Error"===s?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===s&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,n.slice(4)),s=t.name,a=t.format()}catch(t){}break}}return bC.throwError("call revert exception"+i,yk.errors.CALL_EXCEPTION,{method:t.format(),data:Tk(e),errorArgs:o,errorName:s,errorSignature:a,reason:r})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Tk(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&bC.throwError("too many arguments for "+t.format(),yk.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let n=[];t.anonymous||n.push(this.getEventTopic(t));const r=(t,e)=>"string"===t.type?KS(e):"bytes"===t.type?Vx(Tk(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),Bk(Tk(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?n.push(null):"array"===o.baseType||"tuple"===o.baseType?bC.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?n.push(e.map((t=>r(o,t)))):n.push(r(o,e)):null!=e&&bC.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const n=[],r=[],i=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&bC.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const s=e[o];if(t.indexed)if("string"===t.type)n.push(KS(s));else if("bytes"===t.type)n.push(Vx(s));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([t.type],[s]))}else r.push(t),i.push(s)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(t,e,n){if("string"==typeof t&&(t=this.getEvent(t)),null!=n&&!t.anonymous){let e=this.getEventTopic(t);Sk(n[0],32)&&n[0].toLowerCase()===e||bC.throwError("fragment/topic mismatch",yk.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(r.push(xx.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(r.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let s=null!=n?this._abiCoder.decode(r,kk(n)):null,a=this._abiCoder.decode(i,e,!0),u=[],l=0,c=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==s)u[e]=new EC({_isIndexed:!0,hash:null});else if(o[e])u[e]=new EC({_isIndexed:!0,hash:s[c++]});else try{u[e]=s[c++]}catch(t){u[e]=t}else try{u[e]=a[l++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const n=u[e];n instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw kC(`property ${JSON.stringify(t.name)}`,n)}}):u[t.name]=n}}));for(let t=0;t{throw kC(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new AC({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:Hk.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new wC({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=Tk(t);let n=this.getError(e.substring(0,10).toLowerCase());return n?new _C({args:this._abiCoder.decode(n.inputs,"0x"+e.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(t){return!(!t||!t._isInterface)}}var SC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const CC=new yk("abstract-provider/5.6.1");class TC extends gx{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class IC{constructor(){CC.checkAbstract(new.target,IC),ux(this,"_isProvider",!0)}getFeeData(){return SC(this,void 0,void 0,(function*(){const{block:t,gasPrice:e}=yield cx({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let n=null,r=null;return t&&t.baseFeePerGas&&(r=Hk.from("1500000000"),n=t.baseFeePerGas.mul(2).add(r)),{maxFeePerGas:n,maxPriorityFeePerGas:r,gasPrice:e}}))}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}var NC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const PC=new yk("abstract-signer/5.6.2"),RC=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],BC=[yk.errors.INSUFFICIENT_FUNDS,yk.errors.NONCE_EXPIRED,yk.errors.REPLACEMENT_UNDERPRICED];class OC{constructor(){PC.checkAbstract(new.target,OC),ux(this,"_isSigner",!0)}getBalance(t){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return NC(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield cx(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return NC(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield cx(this.checkTransaction(t));return yield this.provider.call(n,e)}))}sendTransaction(t){return NC(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),n=yield this.signTransaction(e);return yield this.provider.sendTransaction(n)}))}getChainId(){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return NC(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return NC(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===RC.indexOf(e)&&PC.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=hx(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&PC.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return NC(this,void 0,void 0,(function*(){const e=yield cx(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>NC(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&PC.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))),e.to.catch((t=>{})));const n=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!n?0!==e.type&&1!==e.type||!n||PC.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):PC.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(n&&PC.throwError("network does not support EIP-1559",yk.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):PC.throwError("failed to get consistent fee data",yk.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(BC.indexOf(t.code)>=0)throw t;return PC.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yk.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&PC.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield cx(e)}))}_checkProvider(t){this.provider||PC.throwError("missing provider",yk.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class LC extends OC{constructor(t,e){super(),ux(this,"address",t),ux(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{PC.throwError(t,yk.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new LC(this.address,t)}}var DC=sk((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:af.Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function a(t,e,n){var r=s(t,n);return n-1>=e&&(r|=s(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)i=a(t,e,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,l=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;n.words[0]=a;for(var l=1;l>>26,h=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}n.words[l]=0|h,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?m+r:h[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===o?(n>=0&&(t[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,_=0|s[4],E=8191&_,M=_>>>13,k=0|s[5],x=8191&k,S=k>>>13,C=0|s[6],T=8191&C,I=C>>>13,N=0|s[7],P=8191&N,R=N>>>13,B=0|s[8],O=8191&B,L=B>>>13,D=0|s[9],j=8191&D,F=D>>>13,U=0|a[0],z=8191&U,H=U>>>13,W=0|a[1],q=8191&W,G=W>>>13,Q=0|a[2],V=8191&Q,Y=Q>>>13,J=0|a[3],Z=8191&J,K=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,lt=at>>>13,ct=0|a[8],ht=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(l+(r=Math.imul(h,z))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,z)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,H))+Math.imul(m,z)|0,o=Math.imul(m,H);var yt=(l+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,z),i=(i=Math.imul(y,H))+Math.imul(v,z)|0,o=Math.imul(v,H),r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,G)|0;var vt=(l+(r=r+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,V)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,H))+Math.imul(A,z)|0,o=Math.imul(A,H),r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,G)|0,r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Y)|0;var bt=(l+(r=r+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,H))+Math.imul(M,z)|0,o=Math.imul(M,H),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,G)|0,r=r+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,K)|0;var wt=(l+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(x,z),i=(i=Math.imul(x,H))+Math.imul(S,z)|0,o=Math.imul(S,H),r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,G)|0,r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var At=(l+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;l=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(T,z),i=(i=Math.imul(T,H))+Math.imul(I,z)|0,o=Math.imul(I,H),r=r+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,G)|0,r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var _t=(l+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;l=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,H))+Math.imul(R,z)|0,o=Math.imul(R,H),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,G)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,K)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(l+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((o=o+Math.imul(f,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(O,z),i=(i=Math.imul(O,H))+Math.imul(L,z)|0,o=Math.imul(L,H),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,G)|0,r=r+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,Y)|0,r=r+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,K)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,lt)|0;var Mt=(l+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;l=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(j,z),i=(i=Math.imul(j,H))+Math.imul(F,z)|0,o=Math.imul(F,H),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,G)|0,r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,r=r+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,lt)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var kt=(l+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(j,q),i=(i=Math.imul(j,G))+Math.imul(F,q)|0,o=Math.imul(F,G),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,K)|0,r=r+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,lt)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ft)|0;var xt=(l+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;l=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,V),i=(i=Math.imul(j,Y))+Math.imul(F,V)|0,o=Math.imul(F,Y),r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(I,nt)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,lt)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var St=(l+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,Z),i=(i=Math.imul(j,K))+Math.imul(F,Z)|0,o=Math.imul(F,K),r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(P,nt)|0,i=(i=i+Math.imul(P,rt)|0)+Math.imul(R,nt)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,lt)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(l+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,$),i=(i=Math.imul(j,tt))+Math.imul(F,$)|0,o=Math.imul(F,tt),r=r+Math.imul(O,nt)|0,i=(i=i+Math.imul(O,rt)|0)+Math.imul(L,nt)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,lt)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,ft)|0;var Tt=(l+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(M,pt)|0))<<13)|0;l=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,nt),i=(i=Math.imul(j,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,lt)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var It=(l+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(S,pt)|0))<<13)|0;l=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,ot),i=(i=Math.imul(j,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),r=r+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,lt)|0,r=r+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var Nt=(l+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;l=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(j,ut),i=(i=Math.imul(j,lt))+Math.imul(F,ut)|0,o=Math.imul(F,lt),r=r+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ft)|0;var Pt=(l+(r=r+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(R,pt)|0))<<13)|0;l=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(j,ht),i=(i=Math.imul(j,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(l+(r=r+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(L,pt)|0))<<13)|0;l=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Bt=(l+(r=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(F,pt)|0))<<13)|0;return l=((o=Math.imul(F,mt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=At,u[6]=_t,u[7]=Et,u[8]=Mt,u[9]=kt,u[10]=xt,u[11]=St,u[12]=Ct,u[13]=Tt,u[14]=It,u[15]=Nt,u[16]=Pt,u[17]=Rt,u[18]=Bt,0!==l&&(u[19]=l,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return g(t,e,n)}Math.imul||(m=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?p(this,t,e):n<1024?g(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,s=0|o.words[o.length-1];0!=(n=26-this._countBits(s))&&(o=o.ushln(n),r.iushln(n),s=0|o.words[o.length-1]);var a,u=r.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var l=0;l=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=f)}return a&&a._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a),s.isub(u)):(r.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);n(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;r--){for(var l=e.words[r],c=u-1;c>=0;c--){var h=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===r&&0===c)&&(o=this.mul(o,n[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},r(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,ok)})),jC=FC;function FC(t,e){if(!t)throw new Error(e||"Assertion failed")}FC.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var UC=sk((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}}));function zC(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}var HC=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,n[r++]=63&o|128):zC(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}var GC=function(t,e){for(var n="",r=0;r>>0}return o},JC=function(t,e){for(var n=new Array(4*t.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},ZC=function(t,e){return t>>>e|t<<32-e},KC=function(t,e){return t<>>32-e},XC=function(t,e){return t+e>>>0},$C=function(t,e,n){return t+e+n>>>0},tT=function(t,e,n,r){return t+e+n+r>>>0},eT=function(t,e,n,r,i){return t+e+n+r+i>>>0},nT=function(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,s=(o>>0,t[e+1]=o},rT=function(t,e,n,r){return(e+r>>>0>>0},iT=function(t,e,n,r){return e+r>>>0},oT=function(t,e,n,r,i,o,s,a){var u=0,l=e;return u+=(l=l+r>>>0)>>0)>>0)>>0},sT=function(t,e,n,r,i,o,s,a){return e+r+o+a>>>0},aT=function(t,e,n,r,i,o,s,a,u,l){var c=0,h=e;return c+=(h=h+r>>>0)>>0)>>0)>>0)>>0},uT=function(t,e,n,r,i,o,s,a,u,l){return e+r+o+a+l>>>0},lT=function(t,e,n){return(e<<32-n|t>>>n)>>>0},cT=function(t,e,n){return(t<<32-n|e>>>n)>>>0},hT=function(t,e,n){return t>>>n},fT=function(t,e,n){return(t<<32-n|e>>>n)>>>0},dT={inherits:sk((function(t){try{var e=Wp;if("function"!=typeof e.inherits)throw"";t.exports=e.inherits}catch(e){t.exports=UC}})),toArray:HC,toHex:WC,htonl:qC,toHex32:GC,zero2:QC,zero8:VC,join32:YC,split32:JC,rotr32:ZC,rotl32:KC,sum32:XC,sum32_3:$C,sum32_4:tT,sum32_5:eT,sum64:nT,sum64_hi:rT,sum64_lo:iT,sum64_4_hi:oT,sum64_4_lo:sT,sum64_5_hi:aT,sum64_5_lo:uT,rotr64_hi:lT,rotr64_lo:cT,shr64_hi:hT,shr64_lo:fT};function pT(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var mT=pT;pT.prototype.update=function(t,e){if(t=dT.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=dT.join32(t,0,t.length-n,this.endian);for(var r=0;r>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o>>3},kT=function(t){return yT(t,17)^yT(t,19)^t>>>10},xT={ft_1:vT,ch32:bT,maj32:wT,p32:AT,s0_256:_T,s1_256:ET,g0_256:MT,g1_256:kT},ST=dT.rotl32,CT=dT.sum32,TT=dT.sum32_5,IT=xT.ft_1,NT=gT.BlockHash,PT=[1518500249,1859775393,2400959708,3395469782];function RT(){if(!(this instanceof RT))return new RT;NT.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}dT.inherits(RT,NT);var BT=RT;RT.blockSize=512,RT.outSize=160,RT.hmacStrength=80,RT.padLength=64,RT.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;rthis.blockSize&&(t=(new this.Hash).update(t).digest()),jC(t.length<=this.blockSize);for(var e=t.length;e>8,s=255&i;o?n.push(o,s):n.push(s)}return n},n.zero2=r,n.toHex=i,n.encode=function(t,e){return"hex"===e?i(t):t}})),JI=GI((function(t,e){var n=e;n.assert=QI,n.toArray=YI.toArray,n.zero2=YI.zero2,n.toHex=YI.toHex,n.encode=YI.encode,n.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,r[s]=a,o.iushrn(1)}return r},n.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,l=e.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),s=0==(1&u)?0:3!=(r=t.andln(7)+i&7)&&5!==r||2!==l?u:-u,n[0].push(s),a=0==(1&l)?0:3!=(r=e.andln(7)+o&7)&&5!==r||2!==u?l:-l,n[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},n.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new DC(t,"hex","le")}})),ZI=JI.getNAF,KI=JI.getJSF,XI=JI.assert;function $I(t,e){this.type=t,this.p=new DC(e.p,16),this.red=e.prime?DC.red(e.prime):DC.mont(this.p),this.zero=new DC(0).toRed(this.red),this.one=new DC(1).toRed(this.red),this.two=new DC(2).toRed(this.red),this.n=e.n&&new DC(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var tN=$I;function eN(t,e){this.curve=t,this.type=e,this.precomputed=null}$I.prototype.point=function(){throw new Error("Not implemented")},$I.prototype.validate=function(){throw new Error("Not implemented")},$I.prototype._fixedNafMul=function(t,e){XI(t.precomputed);var n=t._getDoubles(),r=ZI(e,1,this._bitLength),i=(1<=o;u--)s=(s<<1)+r[u];a.push(s)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var l=o[a];XI(0!==l),s="affine"===t.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},$I.prototype._wnafMulAdd=function(t,e,n,r,i){var o,s,a,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,h=0;for(o=0;o=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=KI(n[d],n[p]);for(h=Math.max(y[0].length,h),c[d]=new Array(h),c[p]=new Array(h),s=0;s=0;o--){for(var _=0;o>=0;){var E=!0;for(s=0;s=0&&_++,w=w.dblp(_),o<0)break;for(s=0;s0?a=l[s][M-1>>1]:M<0&&(a=l[s][-M-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},eN.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(o=e,s=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:r,b:i},{a:o,b:s}]},iN.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],i=r.b.mul(t).divRound(this.n),o=n.b.neg().mul(t).divRound(this.n),s=i.mul(n.a),a=o.mul(r.a),u=i.mul(n.b),l=o.mul(r.b);return{k1:t.sub(s).sub(a),k2:u.add(l).neg()}},iN.prototype.pointFromX=function(t,e){(t=new DC(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},iN.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},iN.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},sN.prototype.isInfinity=function(){return this.inf},sN.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},sN.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),r=t.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},sN.prototype.getX=function(){return this.x.fromRed()},sN.prototype.getY=function(){return this.y.fromRed()},sN.prototype.mul=function(t){return t=new DC(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},sN.prototype.mulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},sN.prototype.jmulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},sN.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},sN.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return e},sN.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},nN(aN,tN.BasePoint),iN.prototype.jpoint=function(t,e,n){return new aN(this,t,e,n)},aN.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},aN.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},aN.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),i=t.x.redMul(n),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(n.redMul(this.z)),a=r.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),c=l.redMul(a),h=r.redMul(l),f=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},aN.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=n.redSub(r),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),c=n.redMul(u),h=a.redSqr().redIAdd(l).redISub(c).redISub(c),f=a.redMul(c.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(s);return this.curve.jpoint(h,f,d)},aN.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},aN.prototype.inspect=function(){return this.isInfinity()?"":""},aN.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var uN=GI((function(t,e){var n=e;n.base=tN,n.short=oN,n.mont=null,n.edwards=null})),lN=GI((function(t,e){var n,r=e,i=JI.assert;function o(t){"short"===t.type?this.curve=new uN.short(t):"edwards"===t.type?this.curve=new uN.edwards(t):this.curve=new uN.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var n=new o(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:qI.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:qI.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:qI.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:qI.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:qI.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:qI.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:qI.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(t){n=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:qI.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function cN(t){if(!(this instanceof cN))return new cN(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=YI.toArray(t.entropy,t.entropyEnc||"hex"),n=YI.toArray(t.nonce,t.nonceEnc||"hex"),r=YI.toArray(t.pers,t.persEnc||"hex");QI(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}var hN=cN;cN.prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},cN.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=YI.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var mN=JI.assert;function gN(t,e){if(t instanceof gN)return t;this._importDER(t,e)||(mN(t.r&&t.s,"Signature without r or s"),this.r=new DC(t.r,16),this.s=new DC(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var yN=gN;function vN(){this.place=0}function bN(t,e){var n=t[e.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function wN(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}gN.prototype._importDER=function(t,e){t=JI.toArray(t,e);var n=new vN;if(48!==t[n.place++])return!1;var r=bN(t,n);if(!1===r)return!1;if(r+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var i=bN(t,n);if(!1===i)return!1;var o=t.slice(n.place,i+n.place);if(n.place+=i,2!==t[n.place++])return!1;var s=bN(t,n);if(!1===s)return!1;if(t.length!==s+n.place)return!1;var a=t.slice(n.place,s+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new DC(o),this.s=new DC(a),this.recoveryParam=null,!0},gN.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=wN(e),n=wN(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];AN(r,e.length),(r=r.concat(e)).push(2),AN(r,n.length);var i=r.concat(n),o=[48];return AN(o,i.length),o=o.concat(i),JI.encode(o,t)};var _N=function(){throw new Error("unsupported")},EN=JI.assert;function MN(t){if(!(this instanceof MN))return new MN(t);"string"==typeof t&&(EN(Object.prototype.hasOwnProperty.call(lN,t),"Unknown curve "+t),t=lN[t]),t instanceof lN.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var kN=MN;MN.prototype.keyPair=function(t){return new pN(this,t)},MN.prototype.keyFromPrivate=function(t,e){return pN.fromPrivate(this,t,e)},MN.prototype.keyFromPublic=function(t,e){return pN.fromPublic(this,t,e)},MN.prototype.genKeyPair=function(t){t||(t={});for(var e=new hN({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||_N(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new DC(2));;){var i=new DC(e.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},MN.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},MN.prototype.sign=function(t,e,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new DC(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),s=t.toArray("be",i),a=new hN({hash:this.hash,entropy:o,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new DC(1)),l=0;;l++){var c=r.k?r.k(l):new DC(a.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(u)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var f=h.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return r.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new yN({r:d,s:p,recoveryParam:m})}}}}}},MN.prototype.verify=function(t,e,n,r){t=this._truncateToN(new DC(t,16)),n=this.keyFromPublic(n,r);var i=(e=new yN(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),u=a.mul(t).umod(this.n),l=a.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,n.getPublic(),l)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,n.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},MN.prototype.recoverPubKey=function(t,e,n,r){EN((3&n)===n,"The recovery param is more than two bits"),e=new yN(e,r);var i=this.n,o=new DC(t),s=e.r,a=e.s,u=1&n,l=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var c=e.r.invm(i),h=i.sub(o).mul(c).umod(i),f=a.mul(c).umod(i);return this.g.mulAdd(h,s,f)},MN.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new yN(e,r)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var xN=GI((function(t,e){var n=e;n.version="6.5.4",n.utils=JI,n.rand=function(){throw new Error("unsupported")},n.curve=uN,n.curves=lN,n.ec=kN,n.eddsa=null})).ec;const SN=new yk("signing-key/5.6.2");let CN=null;function TN(){return CN||(CN=new xN("secp256k1")),CN}class IN{constructor(t){ux(this,"curve","secp256k1"),ux(this,"privateKey",Tk(t)),32!==Ik(this.privateKey)&&SN.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=TN().keyFromPrivate(Mk(this.privateKey));ux(this,"publicKey","0x"+e.getPublic(!1,"hex")),ux(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),ux(this,"_isSigningKey",!0)}_addPoint(t){const e=TN().keyFromPublic(Mk(this.publicKey)),n=TN().keyFromPublic(Mk(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}signDigest(t){const e=TN().keyFromPrivate(Mk(this.privateKey)),n=Mk(t);32!==n.length&&SN.throwArgumentError("bad digest length","digest",t);const r=e.sign(n,{canonical:!0});return Ok({recoveryParam:r.recoveryParam,r:Bk("0x"+r.r.toString(16),32),s:Bk("0x"+r.s.toString(16),32)})}computeSharedSecret(t){const e=TN().keyFromPrivate(Mk(this.privateKey)),n=TN().keyFromPublic(Mk(NN(t)));return Bk("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function NN(t,e){const n=Mk(t);if(32===n.length){const t=new IN(n);return e?"0x"+TN().keyFromPrivate(n).getPublic(!0,"hex"):t.publicKey}return 33===n.length?e?Tk(n):"0x"+TN().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?e?"0x"+TN().keyFromPublic(n).getPublic(!0,"hex"):Tk(n):SN.throwArgumentError("invalid public or private key","key","[REDACTED]")}const PN=new yk("transactions/5.6.2");var RN;function BN(t){return"0x"===t?null:sS(t)}function ON(t){return"0x"===t?wS:Hk.from(t)}function LN(t,e){return function(t){return sS(Nk(Vx(Nk(NN(t),1)),12))}(function(t,e){const n=Ok(e),r={r:Mk(n.r),s:Mk(n.s)};return"0x"+TN().recoverPubKey(Mk(t),r,n.recoveryParam).encode("hex",!1)}(Mk(t),e))}function DN(t,e){const n=xk(Hk.from(t).toHexString());return n.length>32&&PN.throwArgumentError("invalid length for "+e,"transaction:"+e,t),n}function jN(t,e){return{address:sS(t),storageKeys:(e||[]).map(((e,n)=>(32!==Ik(e)&&PN.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,e),e.toLowerCase())))}}function FN(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&PN.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),jN(t[0],t[1])):jN(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const n=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return jN(e,Object.keys(n).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function UN(t){return FN(t).map((t=>[t.address,t.storageKeys]))}function zN(t,e){if(null!=t.gasPrice){const e=Hk.from(t.gasPrice),n=Hk.from(t.maxFeePerGas||0);e.eq(n)||PN.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:n})}const n=[DN(t.chainId||0,"chainId"),DN(t.nonce||0,"nonce"),DN(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),DN(t.maxFeePerGas||0,"maxFeePerGas"),DN(t.gasLimit||0,"gasLimit"),null!=t.to?sS(t.to):"0x",DN(t.value||0,"value"),t.data||"0x",UN(t.accessList||[])];if(e){const t=Ok(e);n.push(DN(t.recoveryParam,"recoveryParam")),n.push(xk(t.r)),n.push(xk(t.s))}return Pk(["0x02",Xx(n)])}function HN(t,e){const n=[DN(t.chainId||0,"chainId"),DN(t.nonce||0,"nonce"),DN(t.gasPrice||0,"gasPrice"),DN(t.gasLimit||0,"gasLimit"),null!=t.to?sS(t.to):"0x",DN(t.value||0,"value"),t.data||"0x",UN(t.accessList||[])];if(e){const t=Ok(e);n.push(DN(t.recoveryParam,"recoveryParam")),n.push(xk(t.r)),n.push(xk(t.s))}return Pk(["0x01",Xx(n)])}function WN(t,e,n){try{const n=ON(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){PN.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Bk(e[1],32),t.s=Bk(e[2],32);try{const e=Vx(n(t));t.from=LN(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function qN(t){const e=Mk(t);if(e[0]>127)return function(t){const e=eS(t);9!==e.length&&6!==e.length&&PN.throwArgumentError("invalid raw transaction","rawTransaction",t);const n={nonce:ON(e[0]).toNumber(),gasPrice:ON(e[1]),gasLimit:ON(e[2]),to:BN(e[3]),value:ON(e[4]),data:e[5],chainId:0};if(6===e.length)return n;try{n.v=Hk.from(e[6]).toNumber()}catch(t){return n}if(n.r=Bk(e[7],32),n.s=Bk(e[8],32),Hk.from(n.r).isZero()&&Hk.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const i=e.slice(0,6);0!==n.chainId&&(i.push(Tk(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);const o=Vx(Xx(i));try{n.from=LN(o,{r:Tk(n.r),s:Tk(n.s),recoveryParam:r})}catch(t){}n.hash=Vx(t)}return n.type=null,n}(e);switch(e[0]){case 1:return function(t){const e=eS(t.slice(1));8!==e.length&&11!==e.length&&PN.throwArgumentError("invalid component count for transaction type: 1","payload",Tk(t));const n={type:1,chainId:ON(e[0]).toNumber(),nonce:ON(e[1]).toNumber(),gasPrice:ON(e[2]),gasLimit:ON(e[3]),to:BN(e[4]),value:ON(e[5]),data:e[6],accessList:FN(e[7])};return 8===e.length||(n.hash=Vx(t),WN(n,e.slice(8),HN)),n}(e);case 2:return function(t){const e=eS(t.slice(1));9!==e.length&&12!==e.length&&PN.throwArgumentError("invalid component count for transaction type: 2","payload",Tk(t));const n=ON(e[2]),r=ON(e[3]),i={type:2,chainId:ON(e[0]).toNumber(),nonce:ON(e[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:ON(e[4]),to:BN(e[5]),value:ON(e[6]),data:e[7],accessList:FN(e[8])};return 9===e.length||(i.hash=Vx(t),WN(i,e.slice(9),zN)),i}(e)}return PN.throwError(`unsupported transaction type: ${e[0]}`,yk.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(RN||(RN={}));var GN=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const QN=new yk("contracts/5.6.2");function VN(t,e){return GN(this,void 0,void 0,(function*(){const n=yield e;"string"!=typeof n&&QN.throwArgumentError("invalid address or ENS name","name",n);try{return sS(n)}catch(t){}t||QN.throwError("a provider or signer is needed to resolve ENS names",yk.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield t.resolveName(n);return null==r&&QN.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function YN(t,e,n){return GN(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>YN(t,Array.isArray(e)?e[r]:e[n.name],n)))):"address"===n.type?yield VN(t,e):"tuple"===n.type?yield YN(t,e,n.components):"array"===n.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>YN(t,e,n.arrayChildren)))):Promise.reject(QN.makeError("invalid value for array",yk.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e}))}function JN(t,e,n){return GN(this,void 0,void 0,(function*(){let r={};n.length===e.inputs.length+1&&"object"==typeof n[n.length-1]&&(r=hx(n.pop())),QN.checkArgumentCount(n.length,e.inputs.length,"passed to contract"),t.signer?r.from?r.from=cx({override:VN(t.signer,r.from),signer:t.signer.getAddress()}).then((t=>GN(this,void 0,void 0,(function*(){return sS(t.signer)!==t.override&&QN.throwError("Contract with a Signer cannot override from",yk.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):r.from=t.signer.getAddress():r.from&&(r.from=VN(t.provider,r.from));const i=yield cx({args:YN(t.signer||t.provider,n,e.inputs),address:t.resolvedAddress,overrides:cx(r)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},a=i.overrides;if(null!=a.nonce&&(s.nonce=Hk.from(a.nonce).toNumber()),null!=a.gasLimit&&(s.gasLimit=Hk.from(a.gasLimit)),null!=a.gasPrice&&(s.gasPrice=Hk.from(a.gasPrice)),null!=a.maxFeePerGas&&(s.maxFeePerGas=Hk.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=Hk.from(a.maxPriorityFeePerGas)),null!=a.from&&(s.from=a.from),null!=a.type&&(s.type=a.type),null!=a.accessList&&(s.accessList=FN(a.accessList)),null==s.gasLimit&&null!=e.gas){let t=21e3;const n=Mk(o);for(let e=0;enull!=r[t]));return u.length&&QN.throwError(`cannot override ${u.map((t=>JSON.stringify(t))).join(",")}`,yk.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),s}))}function ZN(t,e,n){const r=t.signer||t.provider;return function(...i){return GN(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=hx(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const s=yield JN(t,e,i),a=yield r.call(s,o);try{let r=t.interface.decodeFunctionResult(e,a);return n&&1===e.outputs.length&&(r=r[0]),r}catch(e){throw e.code===yk.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=s),e}}))}}function KN(t,e){return function(...n){return GN(this,void 0,void 0,(function*(){t.signer||QN.throwError("sending a transaction requires a signer",yk.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const r=yield JN(t,e,n),i=yield t.signer.sendTransaction(r);return function(t,e){const n=e.wait.bind(e);e.wait=e=>n(e).then((e=>(e.events=e.logs.map((n=>{let r=mx(n),i=null;try{i=t.interface.parseLog(n)}catch(t){}return i&&(r.args=i.args,r.decode=(e,n)=>t.interface.decodeEventLog(i.eventFragment,e,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>t.provider,r.getBlock=()=>t.provider.getBlock(e.blockHash),r.getTransaction=()=>t.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(e),r})),e)))}(t,i),i}))}}function XN(t,e,n){return e.constant?ZN(t,e,n):KN(t,e)}function $N(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class tP{constructor(t,e){ux(this,"tag",t),ux(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((n=>!(!e&&n.listener===t&&(e=!0,1))))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const n=t.slice();return setTimeout((()=>{e.listener.apply(this,n)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class eP extends tP{constructor(){super("error",null)}}class nP extends tP{constructor(t,e,n,r){const i={address:t};let o=e.getEventTopic(n);r?(o!==r[0]&&QN.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super($N(i),i),ux(this,"address",t),ux(this,"interface",e),ux(this,"fragment",n)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=function(t){const e=[],n=function(t,r){if(Array.isArray(r))for(let i in r){const o=t.slice();o.push(i);try{n(o,r[i])}catch(t){e.push({path:o,error:t})}}};return n([],t),e}(t.args);if(e.length)throw e[0].error;const n=(t.args||[]).slice();return n.push(t),n}}class rP extends tP{constructor(t,e){super("*",{address:t}),ux(this,"address",t),ux(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,n)=>this.interface.decodeEventLog(e.eventFragment,t,n),t.args=e.args}catch(t){}}}class iP extends class{constructor(t,e,n){ux(this,"interface",lx(new.target,"getInterface")(e)),null==n?(ux(this,"provider",null),ux(this,"signer",null)):OC.isSigner(n)?(ux(this,"provider",n.provider||null),ux(this,"signer",n)):IC.isProvider(n)?(ux(this,"provider",n),ux(this,"signer",null)):QN.throwArgumentError("invalid signer or provider","signerOrProvider",n),ux(this,"callStatic",{}),ux(this,"estimateGas",{}),ux(this,"functions",{}),ux(this,"populateTransaction",{}),ux(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const n=this.interface.events[e];ux(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,t)}))),t[n.name]||(t[n.name]=[]),t[n.name].push(e)})),Object.keys(t).forEach((e=>{const n=t[e];1===n.length?ux(this.filters,e,this.filters[n[0]]):QN.warn(`Duplicate definition of ${e} (${n.join(", ")})`)}))}if(ux(this,"_runningEvents",{}),ux(this,"_wrappedEmits",{}),null==t&&QN.throwArgumentError("invalid contract address or ENS name","addressOrName",t),ux(this,"address",t),this.provider)ux(this,"resolvedAddress",VN(this.provider,t));else try{ux(this,"resolvedAddress",Promise.resolve(sS(t)))}catch(t){QN.throwError("provider is required to use ENS name as contract address",yk.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((t=>{}));const r={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])QN.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const n=e.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(t)}null==this[t]&&ux(this,t,XN(this,e,!0)),null==this.functions[t]&&ux(this.functions,t,XN(this,e,!1)),null==this.callStatic[t]&&ux(this.callStatic,t,ZN(this,e,!0)),null==this.populateTransaction[t]&&ux(this.populateTransaction,t,function(t,e){return function(...n){return JN(t,e,n)}}(this,e)),null==this.estimateGas[t]&&ux(this.estimateGas,t,function(t,e){const n=t.signer||t.provider;return function(...r){return GN(this,void 0,void 0,(function*(){n||QN.throwError("estimate require a provider or signer",yk.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield JN(t,e,r);return yield n.estimateGas(i)}))}}(this,e))}})),Object.keys(r).forEach((t=>{const e=r[t];if(e.length>1)return;t=t.substring(1);const n=e[0];try{null==this[t]&&ux(this,t,this[n])}catch(t){}null==this.functions[t]&&ux(this.functions,t,this.functions[n]),null==this.callStatic[t]&&ux(this.callStatic,t,this.callStatic[n]),null==this.populateTransaction[t]&&ux(this.populateTransaction,t,this.populateTransaction[n]),null==this.estimateGas[t]&&ux(this.estimateGas,t,this.estimateGas[n])}))}static getContractAddress(t){return aS(t)}static getInterface(t){return xC.isInterface(t)?t:new xC(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&QN.throwError("contract not deployed",yk.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||QN.throwError("sending a transactions require a signer",yk.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=hx(t||{});return["from","to"].forEach((function(t){null!=e[t]&&QN.throwError("cannot override "+t,yk.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new LC(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&ux(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return EC.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new eP);if("event"===t)return this._normalizeRunningEvent(new tP("event",null));if("*"===t)return this._normalizeRunningEvent(new rP(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new nP(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const n=this.interface.getEvent(e);return this._normalizeRunningEvent(new nP(this.address,this.interface,n,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new tP($N(e),e))}return this._normalizeRunningEvent(new rP(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,n){const r=mx(e);return r.removeListener=()=>{n&&(t.removeListener(n),this._checkRunningEvents(t))},r.getBlock=()=>this.provider.getBlock(e.blockHash),r.getTransaction=()=>this.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(r),r}_addEventListener(t,e,n){if(this.provider||QN.throwError("events require a provider or a signer with a provider",yk.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,n),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const n=n=>{let r=this._wrapEvent(t,n,e);if(null==r.decodeError)try{const e=t.getEmit(r);this.emit(t.filter,...e)}catch(t){r.decodeError=t.error}null!=t.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[t.tag]=n,null!=t.filter&&this.provider.on(t.filter,n)}}queryFilter(t,e,n){const r=this._getRunningEvent(t),i=hx(r.filter);return"string"==typeof e&&Sk(e,32)?(null!=n&&QN.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((t=>t.map((t=>this._wrapEvent(r,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const n=this._getRunningEvent(t),r=n.run(e)>0;return this._checkRunningEvents(n),r}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const n=this._getRunningEvent(t);return n.removeListener(e),this._checkRunningEvents(n),this}removeListener(t,e){return this.off(t,e)}}{}class oP{constructor(t){ux(this,"alphabet",t),ux(this,"base",t.length),ux(this,"_alphabetMap",{}),ux(this,"_leader",t.charAt(0));for(let e=0;e0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let t=0;0===e[t]&&t=0;--t)r+=this.alphabet[n[t]];return r}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let n=0;n>=8;for(;i>0;)e.push(255&i),i>>=8}for(let n=0;t[n]===this._leader&&n{o[e.toLowerCase()]=t})):r.headers.keys().forEach((t=>{o[t.toLowerCase()]=r.headers.get(t)})),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:Mk(new Uint8Array(i))}}))}var bP=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const wP=new yk("web/5.6.1");function AP(t){return new Promise((e=>{setTimeout(e,t)}))}function _P(t,e){if(null==t)return null;if("string"==typeof t)return t;if(Ak(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return PS(t)}catch(t){}return Tk(t)}return t}function EP(t,e,n){let r=null;if(null!=e){r=IS(e);const n="string"==typeof t?{url:t}:hx(t);n.headers?0!==Object.keys(n.headers).filter((t=>"content-type"===t.toLowerCase())).length||(n.headers=hx(n.headers),n.headers["content-type"]="application/json"):n.headers={"content-type":"application/json"},t=n}return function(t,e,n){const r="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;wP.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;wP.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let u=null;const l={method:"GET"};let c=!1,h=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||wP.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(h=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(c=!0);if(l.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&wP.throwError("basic authentication requires a secure https url",yk.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+gP(IS(e))}}null!=t.skipFetchSetup&&(l.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:mP(d[2])};let e=t.body;return n&&(e=n(t.body,t)),Promise.resolve(e)}catch(t){wP.throwError("processing response error",yk.errors.SERVER_ERROR,{body:_P(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}e&&(l.method="POST",l.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach((t=>{const e=a[t];p[e.key]=e.value})),l.headers=p;const m=function(){let t=null;return{promise:new Promise((function(e,n){h&&(t=setTimeout((()=>{null!=t&&(t=null,n(wP.makeError("timeout",yk.errors.TIMEOUT,{requestBody:_P(l.body,p["content-type"]),requestMethod:l.method,timeout:h,url:u})))}),h))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return bP(this,void 0,void 0,(function*(){for(let t=0;t=300)&&(m.cancel(),wP.throwError("bad response",yk.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:_P(a,e.headers?e.headers["content-type"]:null),requestBody:_P(l.body,p["content-type"]),requestMethod:l.method,url:u})),n)try{const t=yield n(a,e);return m.cancel(),t}catch(n){if(n.throttleRetry&&t{let r=null;if(null!=t)try{r=JSON.parse(PS(t))}catch(e){wP.throwError("invalid JSON",yk.errors.SERVER_ERROR,{body:t,error:e})}return n&&(r=n(r,e)),r}))}function MP(t,e){return e||(e={}),null==(e=hx(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(n,r){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&r(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let u=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&n(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(u++,u>a)return void(s()&&r(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));te.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&r(t)}))}()}))}for(var kP="qpzry9x8gf2tvdw0s3jn54khce6mua7l",xP={},SP=0;SP>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function IP(t){for(var e=1,n=0;n126)return"Invalid prefix ("+t+")";e=TP(e)^r>>5}for(e=TP(e),n=0;ne)return"Exceeds length limit";var n=t.toLowerCase(),r=t.toUpperCase();if(t!==n&&t!==r)return"Mixed-case string "+t;var i=(t=n).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var a=IP(o);if("string"==typeof a)return a;for(var u=[],l=0;l=s.length||u.push(h)}return 1!==a?"Invalid checksum for "+t:{prefix:o,words:u}}function PP(t,e,n,r){for(var i=0,o=0,s=(1<=n;)o-=n,a.push(i>>o&s);if(r)o>0&&a.push(i<=e)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var r=IP(t=t.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=t+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");r=TP(r)^s,i+=kP.charAt(s)}for(o=0;o<6;++o)r=TP(r);for(r^=1,o=0;o<6;++o)i+=kP.charAt(r>>5*(5-o)&31);return i},toWordsUnsafe:function(t){var e=PP(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=PP(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=PP(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=PP(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const BP="providers/5.6.8",OP=new yk(BP);class LP{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:LP.allowNull(this.accessList.bind(this),null),blockHash:LP.allowNull(o,null),blockNumber:LP.allowNull(a,null),transactionIndex:LP.allowNull(a,null),confirmations:LP.allowNull(a,null),from:e,gasPrice:LP.allowNull(n),maxPriorityFeePerGas:LP.allowNull(n),maxFeePerGas:LP.allowNull(n),gasLimit:n,to:LP.allowNull(e,null),value:n,nonce:a,data:i,r:LP.allowNull(this.uint256),s:LP.allowNull(this.uint256),v:LP.allowNull(a),creates:LP.allowNull(e,null),raw:LP.allowNull(i)},t.transactionRequest={from:LP.allowNull(e),nonce:LP.allowNull(a),gasLimit:LP.allowNull(n),gasPrice:LP.allowNull(n),maxPriorityFeePerGas:LP.allowNull(n),maxFeePerGas:LP.allowNull(n),to:LP.allowNull(e),value:LP.allowNull(n),data:LP.allowNull((t=>this.data(t,!0))),type:LP.allowNull(a),accessList:LP.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:LP.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:LP.allowNull(this.address,null),from:LP.allowNull(this.address,null),contractAddress:LP.allowNull(e,null),transactionIndex:a,root:LP.allowNull(s),gasUsed:n,logsBloom:LP.allowNull(i),blockHash:o,transactionHash:o,logs:LP.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:LP.allowNull(a,null),cumulativeGasUsed:n,effectiveGasPrice:LP.allowNull(n),status:LP.allowNull(a),type:u},t.block={hash:LP.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:LP.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:LP.allowNull(e),extraData:i,transactions:LP.allowNull(LP.arrayOf(o)),baseFeePerGas:LP.allowNull(n)},t.blockWithTransactions=hx(t.block),t.blockWithTransactions.transactions=LP.allowNull(LP.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:LP.allowNull(r,void 0),toBlock:LP.allowNull(r,void 0),blockHash:LP.allowNull(o,void 0),address:LP.allowNull(e,void 0),topics:LP.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:LP.allowNull(a),blockHash:LP.allowNull(o),transactionIndex:a,removed:LP.allowNull(this.boolean.bind(this)),address:e,data:LP.allowFalsish(i,"0x"),topics:LP.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return FN(t||[])}number(t){return"0x"===t?0:Hk.from(t).toNumber()}type(t){return"0x"===t||null==t?0:Hk.from(t).toNumber()}bigNumber(t){return Hk.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),Sk(t))?t.toLowerCase():OP.throwArgumentError("invalid hash","value",t)}data(t,e){const n=this.hex(t,e);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+t);return n}address(t){return sS(t)}callAddress(t){if(!Sk(t,32))return null;const e=sS(Nk(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return aS(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||Sk(t))return Rk(t);throw new Error("invalid blockTag")}hash(t,e){const n=this.hex(t,e);return 32!==Ik(n)?OP.throwArgumentError("invalid hash","value",t):n}difficulty(t){if(null==t)return null;const e=Hk.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!Sk(t))throw new Error("invalid uint256");return Bk(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const n=null!=t._difficulty?t._difficulty:t.difficulty,r=LP.check(e,t);return r._difficulty=null==n?null:Hk.from(n),r}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return LP.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&Hk.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=LP.check(this.formats.transaction,t);if(null!=t.chainId){let n=t.chainId;Sk(n)&&(n=Hk.from(n).toNumber()),e.chainId=n}else{let n=t.networkId;null==n&&null==e.v&&(n=t.chainId),Sk(n)&&(n=Hk.from(n).toNumber()),"number"!=typeof n&&null!=e.v&&(n=(e.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),e.chainId=n}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return qN(t)}receiptLog(t){return LP.check(this.formats.receiptLog,t)}receipt(t){const e=LP.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=Hk.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&OP.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):OP.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&OP.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return LP.check(this.formats.filter,t)}filterLog(t){return LP.check(this.formats.filterLog,t)}static check(t,e){const n={};for(const r in t)try{const i=t[r](e[r]);void 0!==i&&(n[r]=i)}catch(t){throw t.checkKey=r,t.checkValue=e[r],t}return n}static allowNull(t,e){return function(n){return null==n?e:t(n)}}static allowFalsish(t,e){return function(n){return n?t(n):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const n=[];return e.forEach((function(e){n.push(t(e))})),n}}}var DP=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const jP=new yk(BP);function FP(t){return null==t?"null":(32!==Ik(t)&&jP.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function UP(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[FP(t)]=!0}));const n=Object.keys(e);return n.sort(),n.join("|")}return FP(t)})).join("&")}function zP(t){if("string"==typeof t){if(32===Ik(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+UP(t);if(TC.isForkEvent(t))throw jP.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+UP(t.topics||[])}throw new Error("invalid event - "+t)}function HP(){return(new Date).getTime()}function WP(t){return new Promise((e=>{setTimeout(e,t)}))}const qP=["block","network","pending","poll"];class GP{constructor(t,e,n){ux(this,"tag",t),ux(this,"listener",e),ux(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],n=""===(r=t[2])?[]:r.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var r;const i={};return n.length>0&&(i.topics=n),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||qP.indexOf(this.tag)>=0}}const QP={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function VP(t){return Bk(Hk.from(t).toHexString(),32)}function YP(t){return sP.encode(kk([t,Nk(aP(aP(t)),0,4)]))}const JP=new RegExp("^(ipfs)://(.*)$","i"),ZP=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),JP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function KP(t,e){try{return PS(XP(t,e))}catch(t){}return null}function XP(t,e){if("0x"===t)return null;const n=Hk.from(Nk(t,e,e+32)).toNumber(),r=Hk.from(Nk(t,n,n+32)).toNumber();return Nk(t,n+32,n+32+r)}function $P(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):jP.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function tR(t){const e=Mk(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function eR(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function nR(t){const e=[];let n=0;for(let r=0;rHk.from(t).eq(1))).catch((t=>{if(t.code===yk.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return DP(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:Pk([t,nC(this.name),e||"0x"])};let r=!1;var i;(yield this.supportsWildcard())&&(r=!0,n.data=Pk(["0x9061b923",nR([(i=this.name,Tk(kk(i.split(".").map((t=>{const e=IS("_"+qS(t));return e[0]=e.length-1,e}))))+"00"),n.data])]));try{let t=yield this.provider.call(n);return Mk(t).length%32==4&&jP.throwError("resolver threw error",yk.errors.CALL_EXCEPTION,{transaction:n,data:t}),r&&(t=XP(t,0)),t}catch(t){if(t.code===yk.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return DP(this,void 0,void 0,(function*(){const n=yield this._fetch(t,e);return null!=n?XP(n,0):null}))}_getAddress(t,e){const n=QP[String(t)];if(null==n&&jP.throwError(`unsupported coin type: ${t}`,yk.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===n.ilk)return this.provider.formatter.address(e);const r=Mk(e);if(null!=n.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return YP(kk([[n.p2pkh],"0x"+t[2]]))}}if(null!=n.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return YP(kk([[n.p2sh],"0x"+t[2]]))}}if(null!=n.prefix){const t=r[1];let e=r[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&r.length===2+t&&t>=1&&t<=75){const t=RP.toWords(r.slice(2));return t.unshift(e),RP.encode(n.prefix,t)}}return null}getAddress(t){return DP(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||"0x0000000000000000000000000000000000000000000000000000000000000000"===t?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===yk.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",VP(t));if(null==e||"0x"===e)return null;const n=this._getAddress(t,e);return null==n&&jP.throwError("invalid or unsupported coin data",yk.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),n}))}getAvatar(){return DP(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let n=0;nt[e]))}return jP.throwError("invalid or unsupported content hash data",yk.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return DP(this,void 0,void 0,(function*(){let e=IS(t);e=kk([VP(64),VP(e.length),e]),e.length%32!=0&&(e=kk([e,Bk("0x",32-t.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Tk(e));return null==n||"0x"===n?null:PS(n)}))}}let iR=null,oR=1;class sR extends IC{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ux(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=lx(new.target,"getNetwork")(t);e?(ux(this,"_network",e),this.emit("network",e,null)):jP.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return DP(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||jP.throwError("no network detected",yk.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:ux(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return MP((()=>this._ready().then((t=>t),(t=>{if(t.code!==yk.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==iR&&(iR=new LP),iR}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in pP){const n=pP[e];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=pP[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=pP[t.name];if(!e)return"number"!=typeof t.chainId&&uP.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&uP.throwArgumentError("network chainId mismatch","network",t);let n=t._defaultProvider||null;var r;return null==n&&e._defaultProvider&&(n=(r=e._defaultProvider)&&"function"==typeof r.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:n}}(null==t?"homestead":t)}ccipReadFetch(t,e,n){return DP(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t=0?null:JSON.stringify({data:i,sender:r}),u=yield EP({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const l=u.message||"unknown error";if(u.status>=400&&u.status<500)return jP.throwError(`response not found during CCIP fetch: ${l}`,yk.errors.SERVER_ERROR,{url:e,errorMessage:l});o.push(l)}return jP.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,yk.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(t){return DP(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const n=yield e;if(HP()-n.respTime<=t)return n.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=HP(),n=cx({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=HP();return(t=Hk.from(t).toNumber()){this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return DP(this,void 0,void 0,(function*(){const t=oR++,e=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)jP.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",jP.makeError("network block skew detected",yk.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let t=this._emitted.block+1;t<=n;t++)this.emit("block",t);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&n-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((t=>{switch(t.type){case"tx":{const n=t.hash;let r=this.getTransactionReceipt(n).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+n]=t.blockNumber,this.emit(n,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(r);break}case"filter":if(!t._inflight){t._inflight=!0;const r=t.filter;r.fromBlock=t._lastBlockNumber+1,r.toBlock=n,r.toBlock-this._maxFilterBlockRange>r.fromBlock&&(r.fromBlock=r.toBlock-this._maxFilterBlockRange);const i=this.getLogs(r).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(r,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=n,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return DP(this,void 0,void 0,(function*(){return jP.throwError("provider does not support network detection",yk.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return DP(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield WP(0),this._network;const n=jP.makeError("underlying network changed",yk.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",n),n}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=HP();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,n){return DP(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,n||0,null)}))}_waitForTransaction(t,e,n,r){return DP(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const u=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},l=t=>{t.confirmations{this.removeListener(t,l)})),r){let n=r.startBlock,i=null;const l=s=>DP(this,void 0,void 0,(function*(){a||(yield WP(1e3),this.getTransactionCount(r.from).then((c=>DP(this,void 0,void 0,(function*(){if(!a){if(c<=r.nonce)n=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=n-3,i{a||this.once("block",l)})))}));if(a)return;this.once("block",l),s.push((()=>{this.removeListener("block",l)}))}if("number"==typeof n&&n>0){const t=setTimeout((()=>{u()||o(jP.makeError("timeout exceeded",yk.errors.TIMEOUT,{timeout:n}))}),n);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return DP(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return Hk.from(t)}catch(e){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield cx({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getBalance",n);try{return Hk.from(r)}catch(t){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:t})}}))}getTransactionCount(t,e){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield cx({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getTransactionCount",n);try{return Hk.from(r).toNumber()}catch(t){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:t})}}))}getCode(t,e){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield cx({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getCode",n);try{return Tk(r)}catch(t){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:t})}}))}getStorageAt(t,e,n){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield cx({address:this._getAddress(t),blockTag:this._getBlockTag(n),position:Promise.resolve(e).then((t=>Rk(t)))}),i=yield this.perform("getStorageAt",r);try{return Tk(i)}catch(t){return jP.throwError("bad result from backend",yk.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:t})}}))}_wrapTransaction(t,e,n){if(null!=e&&32!==Ik(e))throw new Error("invalid response - sendTransaction");const r=t;return null!=e&&t.hash!==e&&jP.throwError("Transaction hash mismatch from Provider.sendTransaction.",yk.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),r.wait=(e,r)=>DP(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==r&&(r=0),0!==e&&null!=n&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:n});const o=yield this._waitForTransaction(t.hash,e,r,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&jP.throwError("transaction failed",yk.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),r}sendTransaction(t){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>Tk(t))),n=this.formatter.transaction(t);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(n,t,r)}catch(t){throw t.transaction=n,t.transactionHash=n.hash,t}}))}_getTransactionRequest(t){return DP(this,void 0,void 0,(function*(){const e=yield t,n={};return["from","to"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?Hk.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(n.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?Tk(t):null)))})),this.formatter.transactionRequest(yield cx(n))}))}_getFilter(t){return DP(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((n=>{null!=t[n]&&(e[n]=t[n])})),["fromBlock","toBlock"].forEach((n=>{null!=t[n]&&(e[n]=this._getBlockTag(t[n]))})),this.formatter.filter(yield cx(e))}))}_call(t,e,n){return DP(this,void 0,void 0,(function*(){n>=10&&jP.throwError("CCIP read exceeded maximum redirections",yk.errors.SERVER_ERROR,{redirects:n,transaction:t});const r=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(n>=0&&"latest"===e&&null!=r&&"0x556f1830"===i.substring(0,10)&&Ik(i)%32==4)try{const o=Nk(i,4),s=Nk(o,0,32);Hk.from(s).eq(r)||jP.throwError("CCIP Read sender did not match",yk.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],u=Hk.from(Nk(o,32,64)).toNumber(),l=Hk.from(Nk(o,u,u+32)).toNumber(),c=Nk(o,u+32);for(let e=0;eDP(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",r);if(null==t)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(e){let e=null;for(let n=0;nthis._wrapTransaction(t))),n}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return DP(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return MP((()=>DP(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(t){return DP(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return MP((()=>DP(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return r}))),{oncePoll:this})}))}getLogs(t){return DP(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield cx({filter:this._getFilter(t)}),n=yield this.perform("getLogs",e);return n.forEach((t=>{null==t.removed&&(t.removed=!1)})),LP.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return DP(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return DP(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&jP.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return DP(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const n=yield this._getResolver(e,"getResolver");if(null!=n){const r=new rR(this,n,t);return e===t||(yield r.supportsWildcard())?r:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return DP(this,void 0,void 0,(function*(){null==e&&(e="ENS");const n=yield this.getNetwork();n.ensAddress||jP.throwError("network does not support ENS",yk.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name});try{const e=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+nC(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return DP(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(Sk(t))throw e}"string"!=typeof t&&jP.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return DP(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(e,"lookupAddress");if(null==n)return null;const r=KP(yield this.call({to:n,data:"0x691f3431"+nC(e).substring(2)}),0);return(yield this.resolveName(r))!=t?null:r}))}getAvatar(t){return DP(this,void 0,void 0,(function*(){let e=null;if(Sk(t)){const n=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;e=new rR(this,r,n);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==yk.errors.CALL_EXCEPTION)throw t}try{const t=KP(yield this.call({to:r,data:"0x691f3431"+nC(n).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==yk.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const n=yield e.getAvatar();return null==n?null:n.url}))}perform(t,e){return jP.throwError(t+" not implemented",yk.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,n){const r=new GP(zP(t),e,n);return this._events.push(r),this._startEvent(r),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let n=!1,r=[],i=zP(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),n=!0,!t.once||(r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),n}listenerCount(t){if(!t)return this._events.length;let e=zP(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=zP(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const n=[];let r=!1,i=zP(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||!!r||(r=!0,n.push(t),!1))),n.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const n=zP(t);this._events=this._events.filter((t=>t.tag!==n||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var aR=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))};const uR=new yk(BP),lR=["call","estimateGas"];function cR(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const n=Sk(t.data)?t.data:null;if(!e||n)return{message:t.message,data:n}}if("object"==typeof t){for(const n in t){const r=cR(t[n],e);if(r)return r}return null}if("string"==typeof t)try{return cR(JSON.parse(t),e)}catch(t){}return null}function hR(t,e,n){const r=n.transaction||n.signedTransaction;if("call"===t){const t=cR(e,!0);if(t)return t.data;uR.throwError("missing revert data in call exception; Transaction reverted without a reason string",yk.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:e})}if("estimateGas"===t){let n=cR(e.body,!1);null==n&&(n=cR(e,!1)),n&&uR.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yk.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:t,transaction:r,error:e})}let i=e.message;throw e.code===yk.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&uR.throwError("insufficient funds for intrinsic transaction cost",yk.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/nonce (is )?too low/i)&&uR.throwError("nonce has already been used",yk.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&uR.throwError("replacement fee too low",yk.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/only replay-protected/i)&&uR.throwError("legacy pre-eip-155 transactions not supported",yk.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:r}),lR.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&uR.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yk.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}function fR(t){return new Promise((function(e){setTimeout(e,t)}))}function dR(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function pR(t){return t?t.toLowerCase():t}const mR={};class gR extends OC{constructor(t,e,n){if(super(),t!==mR)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ux(this,"provider",e),null==n&&(n=0),"string"==typeof n?(ux(this,"_address",this.provider.formatter.address(n)),ux(this,"_index",null)):"number"==typeof n?(ux(this,"_index",n),ux(this,"_address",null)):uR.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(t){return uR.throwError("cannot alter JSON-RPC Signer connection",yk.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new yR(mR,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&uR.throwError("unknown account #"+this._index,yk.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=hx(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const n=hx(t);n.from=e,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>aR(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&uR.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),cx({tx:cx(t),sender:e}).then((({tx:e,sender:n})=>{null!=e.from?e.from.toLowerCase()!==n&&uR.throwArgumentError("from address mismatch","transaction",t):e.from=n;const r=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((t=>t),(t=>hR("sendTransaction",t,r)))}))}signTransaction(t){return uR.throwError("signing transactions is unsupported",yk.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return aR(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(t);try{return yield MP((()=>aR(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(n);if(null!==t)return this.provider._wrapTransaction(t,n,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=n,t}}))}signMessage(t){return aR(this,void 0,void 0,(function*(){const e="string"==typeof t?IS(t):t,n=yield this.getAddress();return yield this.provider.send("personal_sign",[Tk(e),n.toLowerCase()])}))}_legacySignMessage(t){return aR(this,void 0,void 0,(function*(){const e="string"==typeof t?IS(t):t,n=yield this.getAddress();return yield this.provider.send("eth_sign",[n.toLowerCase(),Tk(e)])}))}_signTypedData(t,e,n){return aR(this,void 0,void 0,(function*(){const r=yield vC.resolveNames(t,e,n,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(vC.getPayload(r.domain,e,r.value))])}))}unlock(t){return aR(this,void 0,void 0,(function*(){const e=this.provider,n=yield this.getAddress();return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])}))}}class yR extends gR{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const vR={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class bR extends sR{constructor(t,e){let n=e;null==n&&(n=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(n),t||(t=lx(this.constructor,"defaultUrl")()),ux(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(hx(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return aR(this,void 0,void 0,(function*(){yield fR(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=lx(this.constructor,"getNetwork");try{return e(Hk.from(t).toNumber())}catch(e){return uR.throwError("could not detect network",yk.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return uR.throwError("could not detect network",yk.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new gR(mR,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:mx(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(r&&this._cache[t])return this._cache[t];const i=EP(this.connection,JSON.stringify(n),dR).then((t=>(this.emit("debug",{action:"response",request:n,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:n,provider:this}),t}));return r&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[pR(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[pR(e.address),e.blockTag]];case"getCode":return["eth_getCode",[pR(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[pR(e.address),Bk(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[lx(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[lx(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=pR(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return aR(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&Hk.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((e=hx(e)).transaction=hx(t),delete e.transaction.type)}}const n=this.prepareRequest(t,e);null==n&&uR.throwError(t+" not implemented",yk.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(n[0],n[1])}catch(n){return hR(t,n,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(n){return function r(){t.send("eth_getFilterChanges",[n]).then((function(n){if(t._pendingFilter!=e)return null;let r=Promise.resolve();return n.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",r=r.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),r.then((function(){return fR(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){r()}),0),null;t.send("eth_uninstallFilter",[n])})).catch((t=>{}))}(),n})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const n=hx(vR);if(e)for(const t in e)e[t]&&(n[t]=!0);var r,i;i=n,(r=t)&&"object"==typeof r||ax.throwArgumentError("invalid object","object",r),Object.keys(r).forEach((t=>{i[t]||ax.throwArgumentError("invalid object key - "+t,"transaction:"+t,r)}));const o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const n=Rk(Hk.from(t[e]));"gasLimit"===e&&(e="gas"),o[e]=n})),["from","to","data"].forEach((function(e){null!=t[e]&&(o[e]=Tk(t[e]))})),t.accessList&&(o.accessList=FN(t.accessList)),o}}const wR=new yk(BP);let AR=1;function _R(t,e){const n="Web3LegacyFetcher";return function(t,r){const i={method:t,params:r,id:AR++,jsonrpc:"2.0"};return new Promise(((t,r)=>{this.emit("debug",{action:"request",fetcher:n,request:mx(i),provider:this}),e(i,((e,o)=>{if(e)return this.emit("debug",{action:"response",fetcher:n,error:e,request:i,provider:this}),r(e);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const t=new Error(o.error.message);return t.code=o.error.code,t.data=o.error.data,r(t)}t(o.result)}))}))}}class ER extends bR{constructor(t,e){null==t&&wR.throwArgumentError("missing provider","provider",t);let n=null,r=null,i=null;"function"==typeof t?(n="unknown:",r=t):(n=t.host||t.path||"",!n&&t.isMetaMask&&(n="metamask"),i=t,t.request?(""===n&&(n="eip-1193:"),r=function(t){return function(e,n){null==n&&(n=[]);const r={method:e,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:mx(r),provider:this}),t.request(r).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:t,provider:this}),t}))}}(t)):t.sendAsync?r=_R(0,t.sendAsync.bind(t)):t.send?r=_R(0,t.send.bind(t)):wR.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),super(n,e),ux(this,"jsonRpcFetchFunc",r),ux(this,"provider",i)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}const MR=new yk("units/5.6.1"),kR=["wei","kwei","mwei","gwei","szabo","finney","ether"];class xR{constructor({blockchain:t,from:e,to:n,value:r,api:i,method:o,params:s,sent:a,confirmed:u,failed:l}){this.blockchain=t,this.from=e,this.to=n,this.value=function(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}([xR,"access",t=>t.bigNumberify,"call",e=>e(r,t),"optionalAccess",t=>t.toString,"call",t=>t()]),this.api=i,this.method=o,this.params=s,this.sent=a,this.confirmed=u,this.failed=l,this._confirmed=!1,this._failed=!1}async prepare({wallet:t}){this.from=await t.account()}static bigNumberify(t,e){return"number"==typeof t?function(t,e){if("string"!=typeof t&&MR.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=kR.indexOf(e);-1!==t&&(e=3*t)}return ex(t,null!=e?e:18)}(t.toString(),qh[e].DECIMALS):t&&t.toString?Hk.from(t.toString()):t}getContractArguments(){let t=this.getContract().interface.fragments.find((t=>t.name==this.method));if(this.params instanceof Array)return this.params;if(this.params instanceof Object)return t.inputs.map((t=>this.params[t.name]));throw"Contract params have wrong type!"}getContract(){return new iP(this.to,this.api)}async getData(){return(await this.getContract().populateTransaction[this.method].apply(null,this.getContractArguments())).data}confirmation(){return this._confirmed?Promise.resolve(this):new Promise(((t,e)=>{let n=this.confirmed;this.confirmed=()=>{n&&n(this),t(this)}}))}failure(){return this._failed?Promise.resolve(this):new Promise(((t,e)=>{let n=this.failed;this.failed=()=>{n&&n(this),t(this)}}))}}const SR=({transaction:t,provider:e,signer:n})=>t.method?CR({transaction:t,signer:n,provider:e}):TR({transaction:t,signer:n}),CR=({transaction:t,signer:e,provider:n})=>{let r=new iP(t.to,t.api,n);return r.connect(e)[t.method](...t.getContractArguments({contract:r}),{value:xR.bigNumberify(t.value,t.blockchain)})},TR=({transaction:t,signer:e})=>e.sendTransaction({to:t.to,value:xR.bigNumberify(t.value,t.blockchain)});function IR(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}class NR{static __initStatic(){this.info={name:"Web3 Wallet",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 446.42 376.77'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23828487;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M408.69,171.4H473.4V107.77a46.55,46.55,0,0,0-46.55-46.55H73.53A46.55,46.55,0,0,0,27,107.77v65.09H62.7L89.56,146a9.46,9.46,0,0,1,5.73-2.73h0l.41,0h78.59a47.2,47.2,0,1,1,82.63,39.56q-1.41,1.71-3,3.31t-3.31,3a47.21,47.21,0,0,1-76.31-26.9H100.21L73.34,189.07a9.43,9.43,0,0,1-5.73,2.73h0l-.41,0h-.07l-.48,0H27v74H55.83l18.25-18.24a9.39,9.39,0,0,1,5.73-2.74h0l.41,0h29.9a47.16,47.16,0,1,1,0,19H84.72L66.48,282.11a9.42,9.42,0,0,1-5.72,2.74h0l-.39,0H27V319H83.29a4,4,0,0,1,.49,0h.06l.41,0h0A9.41,9.41,0,0,1,90,321.78l28,28h57.66a47.2,47.2,0,1,1,81.48,40.9c-.6.67-1.22,1.32-1.86,2s-1.3,1.26-2,1.86a47.22,47.22,0,0,1-77.65-25.73H114.09a9.5,9.5,0,0,1-3.09-.52l-.08,0-.29-.11-.17-.07-.19-.08-.27-.12-.08,0a9.38,9.38,0,0,1-2.55-1.81l-28-28H27v53.46A46.55,46.55,0,0,0,73.53,438H426.86a46.55,46.55,0,0,0,46.54-46.55V327.82H408.69a78.22,78.22,0,0,1-78.21-78.21h0A78.22,78.22,0,0,1,408.69,171.4Z' transform='translate(-26.98 -61.22)'/%3E%3Cpath class='cls-1' d='M247.91,359.29a26,26,0,1,0-26,26A26,26,0,0,0,247.91,359.29Z' transform='translate(-26.98 -61.22)'/%3E%3Cpath class='cls-1' d='M246.55,152.71a26,26,0,1,0-26,26A26,26,0,0,0,246.55,152.71Z' transform='translate(-26.98 -61.22)'/%3E%3Ccircle class='cls-1' cx='129.39' cy='193.15' r='25.99'/%3E%3Cpath class='cls-1' d='M409.17,190h-.48a59.57,59.57,0,0,0-59.57,59.57h0a59.57,59.57,0,0,0,59.57,59.57h.48a59.58,59.58,0,0,0,59.58-59.57h0A59.58,59.58,0,0,0,409.17,190Zm14.45,90.61h-31l8.88-32.53a15.5,15.5,0,1,1,13.29,0Z' transform='translate(-26.98 -61.22)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"]}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.install=this.constructor.info.install,this.sendTransaction=t=>(async({transaction:t,wallet:e})=>{t=new xR(t),0==await e.connectedTo(t.blockchain)&&await e.switchTo(t.blockchain),await t.prepare({wallet:e});let n=new ER(window.ethereum,"any"),r=n.getSigner(0);return await SR({transaction:t,provider:n,signer:r}).then((e=>{if(!e)throw"Submitting transaction failed!";t.id=e.hash,t.nonce=e.nonce,t.url=Wh(t.blockchain).explorerUrlFor({transaction:t}),t.sent&&t.sent(t),e.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?(e.replacement&&e.replacement.hash&&(t.id=e.replacement.hash,t.url=Wh(t.blockchain).explorerUrlFor({transaction:t})),e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t._failed=!0,t.failed&&t.failed(t,e))):(t._failed=!0,t.failed&&t.failed(t,e))}))})),t})({wallet:this,transaction:t})}async account(){return(await this.accounts())[0]}async accounts(){return IR([window,"optionalAccess",t=>t.ethereum])?await window.ethereum.request({method:"eth_accounts"}):[]}async connect(){return IR([window,"optionalAccess",t=>t.ethereum])?await window.ethereum.request({method:"eth_requestAccounts"}):[]}on(t,e){let n;switch(t){case"account":n=t=>e(t[0]),window.ethereum.on("accountsChanged",n);break;case"accounts":n=t=>e(t),window.ethereum.on("accountsChanged",n);break;case"network":n=t=>e(zh(t).name),window.ethereum.on("chainChanged",n);break;case"disconnect":n=e,window.ethereum.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":window.ethereum.removeListener("accountsChanged",e);break;case"network":window.ethereum.removeListener("chainChanged",e);break;case"disconnect":window.ethereum.removeListener("disconnect",e)}return e}async connectedTo(t){const e=zh(await window.ethereum.request({method:"eth_chainId"}));return t?t===e.name:e.name}addNetwork(t){return new Promise(((e,n)=>{const r=Wh(t);window.ethereum.request({method:"wallet_addEthereumChain",params:[{chainId:r.id,chainName:r.fullName,nativeCurrency:{name:r.currency.name,symbol:r.currency.symbol,decimals:r.currency.decimals},rpcUrls:[r.rpc],blockExplorerUrls:[r.explorer],iconUrls:[r.logo]}]}).then(e).catch(n)}))}switchTo(t){return new Promise(((e,n)=>{const r=Wh(t);window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:r.id}]}).then(e).catch((r=>{4902===r.code?this.addNetwork(t).then((()=>this.switchTo(t).then(e))).catch(n):n(r)}))}))}async sign(t){await this.account();let e=new ER(window.ethereum,"any").getSigner(0);return await e.signMessage(t)}}NR.__initStatic();class PR extends NR{static __initStatic(){this.info={name:"Coinbase",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 488.96 488.96'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:url(%23linear-gradient);%7D.cls-2%7Bfill:%234361ad;%7D%3C/style%3E%3ClinearGradient id='linear-gradient' x1='250' y1='7.35' x2='250' y2='496.32' gradientTransform='matrix(1, 0, 0, -1, 0, 502)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233d5ba9'/%3E%3Cstop offset='1' stop-color='%234868b1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath class='cls-1' d='M250,5.68C114.87,5.68,5.52,115,5.52,250.17S114.87,494.65,250,494.65,494.48,385.29,494.48,250.17,385.13,5.68,250,5.68Zm0,387.54A143.06,143.06,0,1,1,393.05,250.17,143.11,143.11,0,0,1,250,393.22Z' transform='translate(-5.52 -5.68)'/%3E%3Cpath class='cls-2' d='M284.69,296.09H215.31a11,11,0,0,1-10.9-10.9V215.48a11,11,0,0,1,10.9-10.91H285a11,11,0,0,1,10.9,10.91v69.71A11.07,11.07,0,0,1,284.69,296.09Z' transform='translate(-5.52 -5.68)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://wallet.coinbase.com"}}}PR.__initStatic();class RR extends NR{static __initStatic(){this.info={name:"MetaMask",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 485.93 450.56'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23828487;%7D.cls-2%7Bfill:%23e27726;stroke:%23e27726;%7D.cls-10,.cls-11,.cls-2,.cls-3,.cls-4,.cls-5,.cls-6,.cls-7,.cls-8,.cls-9%7Bstroke-linecap:round;stroke-linejoin:round;%7D.cls-3%7Bfill:%23e37725;stroke:%23e37725;%7D.cls-4%7Bfill:%23d6c0b3;stroke:%23d6c0b3;%7D.cls-5%7Bfill:%23243447;stroke:%23243447;%7D.cls-6%7Bfill:%23cd6328;stroke:%23cd6328;%7D.cls-7%7Bfill:%23e37525;stroke:%23e37525;%7D.cls-8%7Bfill:%23f6851f;stroke:%23f6851f;%7D.cls-9%7Bfill:%23c1ae9e;stroke:%23c1ae9e;%7D.cls-10%7Bfill:%23171717;stroke:%23171717;%7D.cls-11%7Bfill:%23763e1a;stroke:%23763e1a;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M247.91,356.29a26,26,0,1,0-26,26A26,26,0,0,0,247.91,356.29Z' transform='translate(-7.97 -21.33)'/%3E%3Cpath class='cls-1' d='M246.55,149.71a26,26,0,1,0-26,26A26,26,0,0,0,246.55,149.71Z' transform='translate(-7.97 -21.33)'/%3E%3Ccircle class='cls-1' cx='148.4' cy='230.05' r='25.99'/%3E%3Cpolygon class='cls-2' points='461.28 0.5 272.06 141.03 307.05 58.12 461.28 0.5'/%3E%3Cpolygon class='cls-3' points='24.46 0.5 212.16 142.37 178.88 58.12 24.46 0.5'/%3E%3Cpolygon class='cls-3' points='393.2 326.26 342.81 403.47 450.63 433.14 481.63 327.97 393.2 326.26'/%3E%3Cpolygon class='cls-3' points='4.49 327.97 35.3 433.14 143.13 403.47 92.73 326.26 4.49 327.97'/%3E%3Cpolygon class='cls-3' points='137.04 195.8 107 241.25 214.06 246.01 210.26 130.96 137.04 195.8'/%3E%3Cpolygon class='cls-3' points='348.7 195.8 274.53 129.63 272.06 246.01 378.94 241.25 348.7 195.8'/%3E%3Cpolygon class='cls-3' points='143.13 403.47 207.41 372.09 151.88 328.73 143.13 403.47'/%3E%3Cpolygon class='cls-3' points='278.34 372.09 342.81 403.47 333.87 328.73 278.34 372.09'/%3E%3Cpolygon class='cls-4' points='342.81 403.47 278.34 372.09 283.47 414.12 282.9 431.81 342.81 403.47'/%3E%3Cpolygon class='cls-4' points='143.13 403.47 203.03 431.81 202.65 414.12 207.41 372.09 143.13 403.47'/%3E%3Cpolygon class='cls-5' points='203.98 300.97 150.35 285.18 188.2 267.88 203.98 300.97'/%3E%3Cpolygon class='cls-5' points='281.76 300.97 297.55 267.88 335.58 285.18 281.76 300.97'/%3E%3Cpolygon class='cls-6' points='143.13 403.47 152.25 326.26 92.73 327.97 143.13 403.47'/%3E%3Cpolygon class='cls-6' points='333.68 326.26 342.81 403.47 393.2 327.97 333.68 326.26'/%3E%3Cpolygon class='cls-6' points='378.94 241.25 272.06 246.01 281.95 300.97 297.74 267.88 335.77 285.18 378.94 241.25'/%3E%3Cpolygon class='cls-6' points='150.35 285.18 188.39 267.88 203.98 300.97 214.06 246.01 107 241.25 150.35 285.18'/%3E%3Cpolygon class='cls-7' points='107 241.25 151.88 328.73 150.35 285.18 107 241.25'/%3E%3Cpolygon class='cls-7' points='335.77 285.18 333.87 328.73 378.94 241.25 335.77 285.18'/%3E%3Cpolygon class='cls-7' points='214.06 246.01 203.98 300.97 216.53 365.82 219.38 280.43 214.06 246.01'/%3E%3Cpolygon class='cls-7' points='272.06 246.01 266.93 280.24 269.21 365.82 281.95 300.97 272.06 246.01'/%3E%3Cpolygon class='cls-8' points='281.95 300.97 269.21 365.82 278.34 372.09 333.87 328.73 335.77 285.18 281.95 300.97'/%3E%3Cpolygon class='cls-8' points='150.35 285.18 151.88 328.73 207.41 372.09 216.53 365.82 203.98 300.97 150.35 285.18'/%3E%3Cpolygon class='cls-9' points='282.9 431.81 283.47 414.12 278.72 409.94 207.02 409.94 202.65 414.12 203.03 431.81 143.13 403.47 164.05 420.58 206.45 450.06 279.29 450.06 321.89 420.58 342.81 403.47 282.9 431.81'/%3E%3Cpolygon class='cls-10' points='278.34 372.09 269.21 365.82 216.53 365.82 207.41 372.09 202.65 414.12 207.02 409.94 278.72 409.94 283.47 414.12 278.34 372.09'/%3E%3Cpolygon class='cls-11' points='469.27 150.16 485.43 72.57 461.28 0.5 278.34 136.28 348.7 195.8 448.16 224.9 470.22 199.23 460.71 192.38 475.92 178.5 464.13 169.37 479.35 157.77 469.27 150.16'/%3E%3Cpolygon class='cls-11' points='0.5 72.57 16.66 150.16 6.39 157.77 21.61 169.37 10.01 178.5 25.22 192.38 15.71 199.23 37.58 224.9 137.04 195.8 207.41 136.28 24.46 0.5 0.5 72.57'/%3E%3Cpolygon class='cls-8' points='448.16 224.9 348.7 195.8 378.94 241.25 333.87 328.73 393.2 327.97 481.63 327.97 448.16 224.9'/%3E%3Cpolygon class='cls-8' points='137.04 195.8 37.58 224.9 4.49 327.97 92.73 327.97 151.88 328.73 107 241.25 137.04 195.8'/%3E%3Cpolygon class='cls-8' points='272.06 246.01 278.34 136.28 307.24 58.12 178.88 58.12 207.41 136.28 214.06 246.01 216.34 280.62 216.53 365.82 269.21 365.82 269.59 280.62 272.06 246.01'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://metamask.io/download.html"}}}function BR(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}RR.__initStatic();const OR=async(t,e)=>{let n,r=1;for(n=await HM(e).getTransaction(t);r<=120&&!n;)n=await HM(e).getTransaction(t),await new Promise((t=>setTimeout(t,5e3))),r++;return n},LR=({transaction:t,wallet:e})=>t.method?DR({transaction:t,wallet:e}):jR({transaction:t,wallet:e}),DR=async({transaction:t,wallet:e})=>e.connector.sendTransaction({from:t.from,to:t.to,value:BR([t,"access",t=>t.value,"optionalAccess",t=>t.toString,"call",t=>t()]),data:await t.getData(),gas:(await ZM(t)).toString(),gasPrice:(await HM(t.blockchain).getGasPrice()).toString()}),jR=async({transaction:t,wallet:e})=>e.connector.sendTransaction({from:t.from,to:t.to,value:BR([t,"access",t=>t.value,"optionalAccess",t=>t.toString,"call",t=>t()]),gas:(await ZM(t)).toString(),gasPrice:(await HM(t.blockchain).getGasPrice()).toString()});function FR(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}const UR=t=>{window._connectedWalletConnectInstance=t},zR=()=>window._connectedWalletConnectInstance;class HR{static __initStatic(){this.info={name:"WalletConnect",logo:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 500 500' style='enable-background:new 0 0 500 500;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%235991CD;%7D%0A%3C/style%3E%3Cg id='Page-1'%3E%3Cg id='walletconnect-logo-alt'%3E%3Cpath id='WalletConnect' class='st0' d='M102.7,162c81.5-79.8,213.6-79.8,295.1,0l9.8,9.6c4.1,4,4.1,10.5,0,14.4L374,218.9 c-2,2-5.3,2-7.4,0l-13.5-13.2c-56.8-55.7-149-55.7-205.8,0l-14.5,14.1c-2,2-5.3,2-7.4,0L91.9,187c-4.1-4-4.1-10.5,0-14.4 L102.7,162z M467.1,229.9l29.9,29.2c4.1,4,4.1,10.5,0,14.4L362.3,405.4c-4.1,4-10.7,4-14.8,0c0,0,0,0,0,0L252,311.9 c-1-1-2.7-1-3.7,0h0l-95.5,93.5c-4.1,4-10.7,4-14.8,0c0,0,0,0,0,0L3.4,273.6c-4.1-4-4.1-10.5,0-14.4l29.9-29.2 c4.1-4,10.7-4,14.8,0l95.5,93.5c1,1,2.7,1,3.7,0c0,0,0,0,0,0l95.5-93.5c4.1-4,10.7-4,14.8,0c0,0,0,0,0,0l95.5,93.5 c1,1,2.7,1,3.7,0l95.5-93.5C456.4,225.9,463,225.9,467.1,229.9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A",blockchains:["ethereum","bsc","polygon"]}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.connector=HR.instance||this.newWalletConnectInstance(),this.sendTransaction=t=>(async({transaction:t,wallet:e})=>{if(t=new xR(t),await t.prepare({wallet:e}),0==await e.connectedTo(t.blockchain))throw{code:"WRONG_NETWORK"};return await LR({transaction:t,wallet:e}).then((async e=>{if(!e)throw"Submitting transaction failed!";{let n=Wh(t.blockchain);t.id=e,t.url=n.explorerUrlFor({transaction:t}),t.sent&&t.sent(t);let r=await OR(e,t.blockchain);t.nonce=r.nonce,r?r.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t.id=e.replacement.hash,t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t.id=e.replacement.hash,t._failed=!0,t.failed&&t.failed(t,e)):(t._failed=!0,t.failed&&t.failed(t,e))})):(t._failed=!0,console.log("Error retrieving transaction"),t.failed&&t.failed(t,"Error retrieving transaction"))}})),t})({wallet:this,transaction:t})}newWalletConnectInstance(){let t=new ek({bridge:"https://bridge.walletconnect.org",qrcodeModal:nk});return t.on("connect",((t,e)=>{if(t)throw t;const{accounts:n,chainId:r}=e.params[0];this.connectedAccounts=n,this.connectedChainId=r})),t.on("session_update",((t,e)=>{if(t)throw t;const{accounts:n,chainId:r}=e.params[0];this.connectedAccounts=n,this.connectedChainId=r})),t.on("disconnect",((t,e)=>{if(UR(void 0),t)throw t})),t.on("modal_closed",(()=>{UR(void 0),this.connector=void 0})),t}async account(){if(null!=this.connectedAccounts)return this.connectedAccounts[0]}async accounts(){return null==this.connectedAccounts?[]:this.connectedAccounts}async connect(t){try{window.localStorage.removeItem("walletconnect"),null==this.connector&&(this.connector=this.newWalletConnectInstance()),this.connector.connected&&(await this.connector.killSession(),UR(void 0),this.connector=this.newWalletConnectInstance());const{accounts:e,chainId:n}=await this.connector.connect({chainId:FR([t,"optionalAccess",t=>t.chainId])});return e instanceof Array&&e.length&&UR(this),this.connectedAccounts=e,this.connectedChainId=n,e}catch(t){return console.log("WALLETCONNECT ERROR",t),[]}}async connectedTo(t){let e=await this.connector.sendCustomRequest({method:"eth_chainId"});const n=zh(e);return t?t===n.name:n.name}switchTo(t){return new Promise(((t,e)=>{e({code:"NOT_SUPPORTED"})}))}addNetwork(t){return new Promise(((t,e)=>{e({code:"NOT_SUPPORTED"})}))}on(t,e){let n;switch(t){case"account":n=(t,n)=>{const{accounts:r}=n.params[0];r instanceof Array&&e(r[0])},this.connector.on("session_update",n);break;case"accounts":n=(t,n)=>{const{accounts:r}=n.params[0];e(r)},this.connector.on("session_update",n);break;case"network":n=(t,n)=>{const{chainId:r}=n.params[0];r&&e(Hh(r).name)},this.connector.on("session_update",n);break;case"disconnect":n=e,this.connector.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":case"network":this.connector.off("session_update");break;case"disconnect":this.connector.off("disconnect")}}async sign(t){let e=await this.account();var n=[IS(t),e];return await this.connector.signPersonalMessage(n)}}HR.__initStatic();const WR=({transaction:t,provider:e,signer:n})=>t.method?qR({transaction:t,signer:n,provider:e}):GR({transaction:t,signer:n}),qR=({transaction:t,signer:e,provider:n})=>{let r=new iP(t.to,t.api,n);return r.connect(e)[t.method](...t.getContractArguments({contract:r}),{value:xR.bigNumberify(t.value,t.blockchain)})},GR=({transaction:t,signer:e})=>e.sendTransaction({to:t.to,value:xR.bigNumberify(t.value,t.blockchain)}),QR=()=>window._connectedWalletLinkInstance;class VR{static __initStatic(){this.info={name:"Coinbase",logo:"data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 488.96 488.96'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:url(%23linear-gradient);%7D.cls-2%7Bfill:%234361ad;%7D%3C/style%3E%3ClinearGradient id='linear-gradient' x1='250' y1='7.35' x2='250' y2='496.32' gradientTransform='matrix(1, 0, 0, -1, 0, 502)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233d5ba9'/%3E%3Cstop offset='1' stop-color='%234868b1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath class='cls-1' d='M250,5.68C114.87,5.68,5.52,115,5.52,250.17S114.87,494.65,250,494.65,494.48,385.29,494.48,250.17,385.13,5.68,250,5.68Zm0,387.54A143.06,143.06,0,1,1,393.05,250.17,143.11,143.11,0,0,1,250,393.22Z' transform='translate(-5.52 -5.68)'/%3E%3Cpath class='cls-2' d='M284.69,296.09H215.31a11,11,0,0,1-10.9-10.9V215.48a11,11,0,0,1,10.9-10.91H285a11,11,0,0,1,10.9,10.91v69.71A11.07,11.07,0,0,1,284.69,296.09Z' transform='translate(-5.52 -5.68)'/%3E%3C/svg%3E",blockchains:["ethereum","bsc","polygon"],install:"https://www.coinbase.com/wallet"}}constructor(){this.name=this.constructor.info.name,this.logo=this.constructor.info.logo,this.blockchains=this.constructor.info.blockchains,this.connector=VR.instance||this.newWalletLinkInstance(),this.sendTransaction=t=>(async({transaction:t,wallet:e})=>{t=new xR(t),0==await e.connectedTo(t.blockchain)&&await e.switchTo(t.blockchain),await t.prepare({wallet:e});let n=new ER(e.connector,"any"),r=n.getSigner(0);return await WR({transaction:t,provider:n,signer:r}).then((e=>{if(!e)throw"Submitting transaction failed!";t.id=e.hash,t.nonce=e.nonce,t.url=Wh(t.blockchain).explorerUrlFor({transaction:t}),t.sent&&t.sent(t),e.wait(1).then((()=>{t._confirmed=!0,t.confirmed&&t.confirmed(t)})).catch((e=>{e&&e.code&&"TRANSACTION_REPLACED"==e.code?(e.replacement&&e.replacement.hash&&(t.id=e.replacement.hash,t.url=Wh(t.blockchain).explorerUrlFor({transaction:t})),e.replacement&&e.replacement.hash&&e.receipt&&1==e.receipt.status?(t._confirmed=!0,t.confirmed&&t.confirmed(t)):e.replacement&&e.replacement.hash&&e.receipt&&0==e.receipt.status&&(t._failed=!0,t.failed&&t.failed(t,e))):(t._failed=!0,t.failed&&t.failed(t,e))}))})),t})({wallet:this,transaction:t})}newWalletLinkInstance(){return new ik({}).makeWeb3Provider()}async account(){if(null!=this.connectedAccounts)return this.connectedAccounts[0]}async accounts(){return null==this.connectedAccounts?[]:this.connectedAccounts}async connect(t){(await this.connector._relayProvider()).setConnectDisabled(!1);let e=await this.connector.enable();var n;return e instanceof Array&&e.length&&(n=this,window._connectedWalletLinkInstance=n),this.connectedAccounts=e,this.connectedChainId=await this.connector.getChainId(),e}async connectedTo(t){let e=await this.connector.getChainId();const n=Hh(e);return t?t===n.name:n.name}switchTo(t){return new Promise(((e,n)=>{const r=Wh(t);this.connector.request({method:"wallet_switchEthereumChain",params:[{chainId:r.id}]}).then(e).catch((r=>{4902===r.code?this.addNetwork(t).then((()=>this.switchTo(t).then(e))).catch(n):n(r)}))}))}addNetwork(t){return new Promise(((e,n)=>{const r=Wh(t);this.connector.request({method:"wallet_addEthereumChain",params:[{chainId:r.id,chainName:r.fullName,nativeCurrency:{name:r.currency.name,symbol:r.currency.symbol,decimals:r.currency.decimals},rpcUrls:[r.rpc],blockExplorerUrls:[r.explorer],iconUrls:[r.logo]}]}).then(e).catch(n)}))}on(t,e){let n;switch(t){case"account":n=t=>e(t[0]),this.connector.on("accountsChanged",n);break;case"accounts":n=t=>e(t),this.connector.on("accountsChanged",n);break;case"network":n=t=>e(zh(t).name),this.connector.on("chainChanged",n);break;case"disconnect":n=e,this.connector.on("disconnect",n)}return n}off(t,e){switch(t){case"account":case"accounts":this.connector.removeListener("accountsChanged",e);break;case"network":this.connector.removeListener("chainChanged",e);break;case"disconnect":this.connector.removeListener("disconnect",e)}return e}async sign(t){await this.account();let e=new ER(this.connector,"any").getSigner(0);return await e.signMessage(t)}}VR.__initStatic();const YR={MetaMask:RR,Coinbase:PR,Web3Wallet:NR,WalletConnect:HR,WalletLink:VR},JR={},ZR=function(){const t=zR()?YR.WalletConnect:QR()?YR.WalletLink:"object"==typeof window.ethereum&&window.ethereum.isMetaMask?YR.MetaMask:"object"==typeof window.ethereum&&(window.ethereum.isCoinbaseWallet||window.ethereum.isWalletLink)?YR.Coinbase:void 0!==window.ethereum?YR.Web3Wallet:void 0,e=JR[t];return zR()?zR():QR()?QR():e||(t?(JR[t]=new t,JR[t]):void 0)};var KR=function(t){var e=f(V.useState(!1),2),r=e[0],i=e[1],o=V.useContext(ah).navigate,s=ZR();V.useEffect((function(){n(l.mark((function e(){var n;return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s){e.next=5;break}return e.next=3,s.accounts();case 3:null!=(n=e.sent)&&0!=n.length||(o("ConnectingWallet"),t.connect(s));case 5:case"end":return e.stop()}}),e)})))()}),[s]);var a=[YR.WalletConnect,YR.WalletLink];s&&a.unshift(s.constructor);var u=a.map((function(e,n){var r=e.info.name;return"WalletConnect"==r&&(r="via WalletConnect"),V.createElement("div",{key:n,className:"PaddingBottomXS"},V.createElement("button",{className:"Card small",title:"Connect ".concat(r),onClick:function(){return function(e){var n=new e;t.setWallet(n),o("ConnectingWallet"),t.connect(n)}(e)}},V.createElement("div",{className:"CardImage square"},V.createElement("img",{className:"transparent",src:e.info.logo})),V.createElement("div",{className:"CardBody"},V.createElement("div",{className:"CardBodyWrapper PaddingLeftXS"},V.createElement("h2",{className:"CardText FontWeightBold"},r)))))}));return V.createElement(hh,{header:V.createElement("div",{className:"PaddingTopS PaddingLeftM PaddingRightM TextLeft"},V.createElement("h1",{className:"LineHeightL FontSizeL"},"Select a wallet")),body:V.createElement("div",{className:"PaddingBottomS PaddingLeftS PaddingRightS"},u),footer:V.createElement("div",{className:"PaddingBottomS"},V.createElement("button",{className:"FontSizeS FontWeightBold TextButton",onClick:function(){return i(!r)}},V.createElement("strong",{className:"Opacity05"},"What is a wallet?")),r&&V.createElement("p",{className:"PaddingLeftM PaddingRightM"},"Wallets are used to send, receive, and store digital assets. Wallets come in many forms. They are either built into your browser, an extension added to your browser, a piece of hardware plugged into your computer or even an app on your phone."))})},XR=function(t){var e=V.useContext(Y),r=e.open,i=e.close,o=f(V.useState(),2),s=o[0],a=o[1],u=f(V.useState(),2),c=u[0],h=u[1],d=function(e){e.connect().then(n(l.mark((function n(){var r;return l.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.accounts();case 2:(r=n.sent)instanceof Array&&r.length>0&&(t.autoClose&&i(),t.resolve&&t.resolve({wallet:e,account:r[0],accounts:r}));case 4:case"end":return n.stop()}}),n)})))).catch((function(e){a(!1),4001!=(null==e?void 0:e.code)&&(-32002!=(null==e?void 0:e.code)?t.reject&&t.reject(e):a(!0))}))};return V.useEffect((function(){var t=ZR();t&&h(t)}),[]),V.useEffect((function(){n(l.mark((function e(){var n;return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c){e.next=5;break}return e.next=3,c.accounts();case 3:(n=e.sent)instanceof Array&&n.length>0&&t.resolve&&t.resolve({wallet:c,account:n[0],accounts:n});case 5:case"end":return e.stop()}}),e)})))()}),[c]),V.createElement(ch,{open:r,close:i,start:"SelectWallet",container:t.container,document:t.document,dialogs:{SelectWallet:V.createElement(KR,{setWallet:h,connect:d}),ConnectingWallet:V.createElement(fh,{wallet:c,pending:s,connect:d})}})},$R=function(t){return void 0===t?window.document:t};function tB(t,e){for(var n=0;nfunction({insideRoot:t,outsideContainer:e}){t.unmount(),e.remove()}({insideRoot:u,outsideContainer:s})}}var MB=function(t,e){var n,r=t.style,i=t.container,o=t.document,s=t.closed,a=function(t){var e,n;return t={colors:Object.assign({primary:"#ea357a",buttonText:"#ffffff",icons:"#000000",text:"#212529"},(null===(e=t)||void 0===e?void 0:e.colors)||{}),fontFamily:(null===(n=t)||void 0===n?void 0:n.fontFamily)||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},["\n\n html, body, div, span, applet, object, iframe,\n h1, h2, h3, h4, h5, h6, p, blockquote, pre,\n a, abbr, acronym, address, big, cite, code,\n del, dfn, em, img, ins, kbd, q, s, samp,\n small, strike, strong, sub, sup, tt, var,\n b, u, i, center,\n dl, dt, dd, ol, ul, li,\n fieldset, form, label, legend,\n table, caption, tbody, tfoot, thead, tr, th, td,\n article, aside, canvas, details, embed, \n figure, figcaption, footer, header, hgroup, \n menu, nav, output, ruby, section, summary,\n time, mark, audio, video {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n text-align: inherit;\n vertical-align: baseline;\n }\n\n article, aside, details, figcaption, figure, \n footer, header, hgroup, menu, nav, section {\n display: block;\n }\n\n body {\n line-height: 1;\n }\n\n ol, ul {\n list-style: none;\n }\n\n blockquote, q {\n quotes: none;\n }\n\n blockquote:before, blockquote:after,\n q:before, q:after {\n content: '';\n content: none;\n }\n \n table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n * {\n box-sizing: border-box;\n }\n\n button {\n border: 0;\n background: none;\n outline: none;\n }\n\n ","\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .contained .ReactDialog {\n position: absolute;\n height: 100%;\n min-height: 100%;\n width: 100%;\n min-width: 100%;\n }\n\n .contained .ReactDialogBackground {\n position: absolute;\n }\n\n .contained .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n top: 0;\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.2);\n border-radius: 13px;\n background: rgb(248,248,248);\n }\n\n @media (max-width: 450px) {\n\n .Dialog {\n border-radius: 0;\n width: 100%;\n }\n }\n\n @media (orientation: portrait) and (max-width: 800px) {\n\n .ReactDialogAnimation {\n width: 100%;\n }\n\n .ReactDialog {\n height: 100%;\n min-height: 100%;\n }\n\n .ReactDialogStack {\n align-items: flex-end;\n }\n\n .Dialog {\n align-content: stretch;\n border-radius: 13px;\n border-top-radius: 13px;\n display: flex;\n flex-direction: column;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n }\n\n .DialogFooter {\n padding-bottom: 20px;\n }\n\n .ReactDialogAnimation {\n margin-bottom: -100px !important;\n top: inherit !important;\n position: relative;\n transition: opacity 0.4s ease, margin-bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n margin-bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n align-items: flex-end;\n }\n }\n\n .DialogBody {\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.ScrollHeight {\n height: 30vh !important;\n max-height: 30vh !important;\n }\n\n .DialogHeader {\n border-top-left-radius: 13px;\n border-top-right-radius: 13px;\n min-height: 54px;\n position: relative;\n width: 100%;\n }\n\n .DialogHeaderActionRight {\n position: absolute;\n top: 0;\n right: 0;\n height: 48px;\n }\n\n .DialogHeaderActionLeft {\n position: absolute;\n top: 0;\n left: 0;\n height: 48px;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 13px;\n border-bottom-right-radius: 13px;\n line-height: 24px;\n min-height: 32px;\n position: relative;\n text-align: center;\n }\n\n ","\n\n .ButtonCircular {\n border-radius: 9999px;\n cursor: pointer;\n height: 34px;\n opacity: 0.5;\n padding: 5px 4px 4px 4px;\n width: 34px;\n }\n\n .ButtonCircular:hover {\n background: rgba(0,0,0,0.1);\n opacity: 1;\n }\n\n .ButtonCircular:active {\n background: rgba(0,0,0,0.25);\n opacity: 1;\n }\n ",cB(t),hB(t),'\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 3px;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .contained .PoweredByWrapper {\n position: absolute;\n }\n\n .PoweredByLink {\n color: white;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;\n font-size: 14px;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 8px;\n opacity: 0.5;\n text-decoration: none;\n text-shadow: black 0 0 2px;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n }\n ',"\n\n .GraphicWrapper {\n display: block;\n }\n\n .Graphic {\n width: 50%;\n position: relative;\n }\n ","\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n border: 0px solid transparent !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ","\n \n .TokenAmountRow {\n min-width: 0;\n width: 100%;\n display: flex;\n flex-direction: row;\n }\n\n .TokenAmountCell {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .TokenSymbolCell {\n }\n ",bB(t),fB(t),dB(t),"\n\n .Opacity05 {\n opacity: 0.5;\n }\n ","\n\n .PaddingTopXS {\n padding-top: 3px;\n }\n\n .PaddingRightXS {\n padding-right: 3px;\n }\n\n .PaddingBottomXS {\n padding-bottom: 3px;\n }\n\n .PaddingLeftXS {\n padding-left: 3px; \n }\n\n .PaddingTopS {\n padding-top: 13px;\n }\n\n .PaddingRightS {\n padding-right: 13px;\n }\n\n .PaddingBottomS {\n padding-bottom: 13px;\n }\n\n .PaddingLeftS {\n padding-left: 13px; \n }\n\n .PaddingTopM {\n padding-top: 19px;\n }\n\n .PaddingRightM {\n padding-right: 19px;\n }\n\n .PaddingBottomM {\n padding-bottom: 19px;\n }\n\n .PaddingLeftM {\n padding-left: 19px; \n }\n\n .PaddingTopL {\n padding-top: 29px;\n }\n\n .PaddingRightL {\n padding-right: 29px;\n }\n\n .PaddingBottomL {\n padding-bottom: 29px;\n }\n\n .PaddingLeftL {\n padding-left: 29px; \n }\n ","\n\n .MaxHeight {\n max-height: 320px;\n overflow-y: auto;\n }\n ",mB(t),gB(t),"\n\n .Input {\n background: none;\n border: 1px solid transparent;\n margin: 0;\n outline: none !important;\n padding: 0 0 0 14px;\n width: 100%;\n }\n\n .Input::placeholder {\n color: rgb(210,210,210);\n }\n \n ",vB(t),"\n\n .MaxAmountImage {\n display: inline-block;\n padding-right: 6px;\n }\n \n .MaxAmountImage img {\n height: 16px;\n width: 16px;\n position: relative;\n top: 3px;\n }\n ","\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ",yB(t),"\n\n .TokenImage img {\n border-radius: 9999px;\n border: 1px solid white;\n background: white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 45px;\n position: relative;\n vertical-align: middle;\n width: 45px;\n }\n\n .TokenImage.medium img {\n height: 93px;\n width: 93px;\n }\n ","\n\n .Alert {\n background: rgba(0,0,0,0.08);\n border-radius: 7px;\n font-weight: 500;\n padding: 8px;\n }\n ","\n\n .Table {\n border-collapse: separate;\n border-radius: 7px;\n border-style: hidden;\n border: 1px solid rgba(0,0,0,0.1);\n width: 100%;\n }\n\n .Table tr.small td {\n font-size: 14px;\n }\n\n .Table tr td {\n border-bottom: 1px solid rgba(0,0,0,0.1);\n word-break: break-all;\n }\n \n .Table tr:last-child td {\n border-bottom: none;\n }\n \n .Table tr td {\n padding: 8px 15px;\n text-align: left;\n }\n \n .Table tr td:first-child {\n width: 30%\n }\n\n .Table tr td:last-child {\n width: 70%\n }\n \n .Table .TableSubTitle {\n font-weight: 300;\n opacity: 0.7;\n }\n\n .Table tr td:last-child {\n font-weight: 500;\n }\n ",pB(t),wB(t)].join("")}(r);r&&r.css&&(a=[a,r.css].join(" ")),n=i?"\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 99999;\n ":"\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 99999;\n ";var u=EB({document:o,element:i||o.body,content:e((function(){setTimeout((function(){u(),"function"==typeof s&&s()}),300)})),outsideStyle:n,insideStyle:a,insideClasses:i?["contained"]:[]}).unmount;return u},kB=function(){return V.createElement("div",{className:"PoweredByWrapper"},V.createElement("a",{href:"https://depay.com",rel:"noopener noreferrer",target:"_blank",className:"PoweredByLink"},"by DePay"))},xB=function(){if(parseInt(V.version.split(".")[0])<17)throw"depay/widgets require at least React v17"},SB=function(t){var e=f(V.useState(!0),2),n=e[0],r=e[1];return V.createElement(J.Provider,{value:{updatable:n,setUpdatable:r}},t.children)},CB=function(t){var e,i,o;return xB(),"object"==r(t)&&(e=t.style,i=t.error,o=t.document),new Promise(function(){var t=n(l.mark((function t(n,r){var s,a;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(s=ZR())){t.next=7;break}return t.next=4,s.accounts();case 4:if(!((a=t.sent)instanceof Array&&a.length>0)){t.next=7;break}return t.abrupt("return",n({wallet:s,accounts:a,account:a[0]}));case 7:MB({style:e,document:$R(o)},(function(t){var e=function(){r("USER_CLOSED_DIALOG"),t()};return function(s){return V.createElement(lB,{errorCallback:i,container:s,unmount:t},V.createElement(SB,null,V.createElement(Z,{unmount:e},V.createElement(XR,{document:o,container:s,resolve:n,reject:r,autoClose:!0}),V.createElement(kB,null))))}}));case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},TB=V.createContext(),IB=V.createContext(),NB=V.createContext();function PB(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var RB,BB,OB=function(t){var e=PB(t).sort((function(t,e){var n=bm.from(t.fromBalance).div(bm.from(t.fromAmount)),r=bm.from(e.fromBalance).div(bm.from(e.fromAmount));return n.lt(r)?-1:r.lt(n)?1:0}));return e[e.length-1]},LB=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",r=parseFloat(t),i=r.toString().match(/\d+\.0*(\d{5})/);if(null!==(e=i)&&void 0!==e&&e.length){var o,s,a=(i=i[0]).match(/\d{5}$/)[0];return a.match(/^0/)?(o=parseFloat("".concat(a[1],".").concat(a[2]).concat(a[3]).concat(a[4])),s=parseFloat(o).toFixed(3),s="0".concat(s).replace(".","")):(o="up"==n?parseFloat("".concat(a[0],".").concat(a[1]).concat(a[2]).concat(a[3],"9")):parseFloat("".concat(a[0],".").concat(a[1]).concat(a[2]).concat(a[3],"1")),s=parseFloat(o).toFixed(3).replace(".","")),"09999"==s&&0==parseInt(r.toFixed(0))?(s="up"==n?"10000":"09999",parseFloat(i.replace(/\d{5}$/,s))):"10000"==s&&0==parseInt(r.toFixed(0))?parseFloat(i.replace(/\d{6}$/,s)):"0"!=s.toString()[0]&&s.toString().length>4?parseInt(r.toFixed(0)):parseFloat(i.replace(/\d{5}$/,s))}return parseFloat(r.toFixed(4))},DB=V.createContext(),jB=o((function(t,e){(function(){var n,r="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",a=16,u=32,l=64,c=128,h=256,f=1/0,d=9007199254740991,p=NaN,m=4294967295,g=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",u],["partialRight",l],["rearg",h]],y="[object Arguments]",v="[object Array]",b="[object Boolean]",w="[object Date]",A="[object Error]",_="[object Function]",E="[object GeneratorFunction]",M="[object Map]",k="[object Number]",x="[object Object]",S="[object Promise]",C="[object RegExp]",T="[object Set]",I="[object String]",N="[object Symbol]",P="[object WeakMap]",R="[object ArrayBuffer]",B="[object DataView]",O="[object Float32Array]",L="[object Float64Array]",D="[object Int8Array]",j="[object Int16Array]",F="[object Int32Array]",U="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",W="[object Uint32Array]",q=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,J=RegExp(V.source),Z=RegExp(Y.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,it=RegExp(rt.source),ot=/^\s+/,st=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,mt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,bt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,At=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,Et="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Mt="a-z\\xdf-\\xf6\\xf8-\\xff",kt="A-Z\\xc0-\\xd6\\xd8-\\xde",xt="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="['’]",Tt="[\\ud800-\\udfff]",It="["+St+"]",Nt="["+Et+"]",Pt="\\d+",Rt="[\\u2700-\\u27bf]",Bt="["+Mt+"]",Ot="[^\\ud800-\\udfff"+St+Pt+"\\u2700-\\u27bf"+Mt+kt+"]",Lt="\\ud83c[\\udffb-\\udfff]",Dt="[^\\ud800-\\udfff]",jt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Ut="["+kt+"]",zt="(?:"+Bt+"|"+Ot+")",Ht="(?:"+Ut+"|"+Ot+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gt="(?:"+Nt+"|"+Lt+")?",Qt="[\\ufe0e\\ufe0f]?",Vt=Qt+Gt+"(?:\\u200d(?:"+[Dt,jt,Ft].join("|")+")"+Qt+Gt+")*",Yt="(?:"+[Rt,jt,Ft].join("|")+")"+Vt,Jt="(?:"+[Dt+Nt+"?",Nt,jt,Ft,Tt].join("|")+")",Zt=RegExp(Ct,"g"),Kt=RegExp(Nt,"g"),Xt=RegExp(Lt+"(?="+Lt+")|"+Jt+Vt,"g"),$t=RegExp([Ut+"?"+Bt+"+"+Wt+"(?="+[It,Ut,"$"].join("|")+")",Ht+"+"+qt+"(?="+[It,Ut+zt,"$"].join("|")+")",Ut+"?"+zt+"+"+Wt,Ut+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Yt].join("|"),"g"),te=RegExp("[\\u200d\\ud800-\\udfff"+Et+xt+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[O]=ie[L]=ie[D]=ie[j]=ie[F]=ie[U]=ie[z]=ie[H]=ie[W]=!0,ie[y]=ie[v]=ie[R]=ie[b]=ie[B]=ie[w]=ie[A]=ie[_]=ie[M]=ie[k]=ie[x]=ie[C]=ie[T]=ie[I]=ie[P]=!1;var oe={};oe[y]=oe[v]=oe[R]=oe[B]=oe[b]=oe[w]=oe[O]=oe[L]=oe[D]=oe[j]=oe[F]=oe[M]=oe[k]=oe[x]=oe[C]=oe[T]=oe[I]=oe[N]=oe[U]=oe[z]=oe[H]=oe[W]=!0,oe[A]=oe[_]=oe[P]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,ue=parseInt,le="object"==typeof i&&i&&i.Object===Object&&i,ce="object"==typeof self&&self&&self.Object===Object&&self,he=le||ce||Function("return this")(),fe=e&&!e.nodeType&&e,de=fe&&t&&!t.nodeType&&t,pe=de&&de.exports===fe,me=pe&&le.process,ge=function(){try{return de&&de.require&&de.require("util").types||me&&me.binding&&me.binding("util")}catch(t){}}(),ye=ge&&ge.isArrayBuffer,ve=ge&&ge.isDate,be=ge&&ge.isMap,we=ge&&ge.isRegExp,Ae=ge&&ge.isSet,_e=ge&&ge.isTypedArray;function Ee(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Me(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function Ie(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function $e(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var en=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=qe({"&":"&","<":"<",">":">",'"':""","'":"'"});function rn(t){return"\\"+se[t]}function on(t){return te.test(t)}function sn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t,e){return function(n){return t(e(n))}}function un(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"}),mn=function t(e){var i,st=(e=null==e?he:mn.defaults(he.Object(),e,mn.pick(he,ne))).Array,Et=e.Date,Mt=e.Error,kt=e.Function,xt=e.Math,St=e.Object,Ct=e.RegExp,Tt=e.String,It=e.TypeError,Nt=st.prototype,Pt=kt.prototype,Rt=St.prototype,Bt=e["__core-js_shared__"],Ot=Pt.toString,Lt=Rt.hasOwnProperty,Dt=0,jt=(i=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",Ft=Rt.toString,Ut=Ot.call(St),zt=he._,Ht=Ct("^"+Ot.call(Lt).replace(rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wt=pe?e.Buffer:n,qt=e.Symbol,Gt=e.Uint8Array,Qt=Wt?Wt.allocUnsafe:n,Vt=an(St.getPrototypeOf,St),Yt=St.create,Jt=Rt.propertyIsEnumerable,Xt=Nt.splice,te=qt?qt.isConcatSpreadable:n,se=qt?qt.iterator:n,le=qt?qt.toStringTag:n,ce=function(){try{var t=po(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),fe=e.clearTimeout!==he.clearTimeout&&e.clearTimeout,de=Et&&Et.now!==he.Date.now&&Et.now,me=e.setTimeout!==he.setTimeout&&e.setTimeout,ge=xt.ceil,Le=xt.floor,qe=St.getOwnPropertySymbols,gn=Wt?Wt.isBuffer:n,yn=e.isFinite,vn=Nt.join,bn=an(St.keys,St),wn=xt.max,An=xt.min,_n=Et.now,En=e.parseInt,Mn=xt.random,kn=Nt.reverse,xn=po(e,"DataView"),Sn=po(e,"Map"),Cn=po(e,"Promise"),Tn=po(e,"Set"),In=po(e,"WeakMap"),Nn=po(St,"create"),Pn=In&&new In,Rn={},Bn=zo(xn),On=zo(Sn),Ln=zo(Cn),Dn=zo(Tn),jn=zo(In),Fn=qt?qt.prototype:n,Un=Fn?Fn.valueOf:n,zn=Fn?Fn.toString:n;function Hn(t){if(ia(t)&&!Vs(t)&&!(t instanceof Qn)){if(t instanceof Gn)return t;if(Lt.call(t,"__wrapped__"))return Ho(t)}return new Gn(t)}var Wn=function(){function t(){}return function(e){if(!ra(e))return{};if(Yt)return Yt(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function qn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Qn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function cr(t,e,r,i,o,s){var a,u=1&e,l=2&e,c=4&e;if(r&&(a=o?r(t,i,o,s):r(t)),a!==n)return a;if(!ra(t))return t;var h=Vs(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Ni(t,a)}else{var f=yo(t),d=f==_||f==E;if(Ks(t))return ki(t,u);if(f==x||f==y||d&&!o){if(a=l||d?{}:bo(t),!u)return l?function(t,e){return Pi(t,go(t),e)}(t,function(t,e){return t&&Pi(e,Oa(e),t)}(a,t)):function(t,e){return Pi(t,mo(t),e)}(t,sr(a,t))}else{if(!oe[f])return o?t:{};a=function(t,e,n){var r,i=t.constructor;switch(e){case R:return xi(t);case b:case w:return new i(+t);case B:return function(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case O:case L:case D:case j:case F:case U:case z:case H:case W:return Si(t,n);case M:return new i;case k:case I:return new i(t);case C:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case T:return new i;case N:return r=t,Un?St(Un.call(r)):{}}}(t,f,u)}}s||(s=new Kn);var p=s.get(t);if(p)return p;s.set(t,a),la(t)?t.forEach((function(n){a.add(cr(n,e,r,n,t,s))})):oa(t)&&t.forEach((function(n,i){a.set(i,cr(n,e,r,i,t,s))}));var m=h?n:(c?l?so:oo:l?Oa:Ba)(t);return ke(m||t,(function(n,i){m&&(n=t[i=n]),rr(a,i,cr(n,e,r,i,t,s))})),a}function hr(t,e,r){var i=r.length;if(null==t)return!i;for(t=St(t);i--;){var o=r[i],s=e[o],a=t[o];if(a===n&&!(o in t)||!s(a))return!1}return!0}function fr(t,e,i){if("function"!=typeof t)throw new It(r);return Bo((function(){t.apply(n,i)}),e)}function dr(t,e,n,r){var i=-1,o=Te,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;n&&(e=Ne(e,Je(n))),r?(o=Ie,s=!1):e.length>=200&&(o=Ke,s=!1,e=new Zn(e));t:for(;++i-1},Yn.prototype.set=function(t,e){var n=this.__data__,r=ir(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Sn||Yn),string:new Vn}},Jn.prototype.delete=function(t){var e=ho(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return ho(this,t).get(t)},Jn.prototype.has=function(t){return ho(this,t).has(t)},Jn.prototype.set=function(t,e){var n=ho(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Zn.prototype.add=Zn.prototype.push=function(t){return this.__data__.set(t,o),this},Zn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Kn.prototype.get=function(t){return this.__data__.get(t)},Kn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var pr=Oi(_r),mr=Oi(Er,!0);function gr(t,e){var n=!0;return pr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function yr(t,e,r){for(var i=-1,o=t.length;++i0&&n(a)?e>1?br(a,e-1,n,r,i):Pe(i,a):r||(i[i.length]=a)}return i}var wr=Li(),Ar=Li(!0);function _r(t,e){return t&&wr(t,e,Ba)}function Er(t,e){return t&&Ar(t,e,Ba)}function Mr(t,e){return Ce(e,(function(e){return ta(t[e])}))}function kr(t,e){for(var r=0,i=(e=Ai(e,t)).length;null!=t&&re}function Tr(t,e){return null!=t&&Lt.call(t,e)}function Ir(t,e){return null!=t&&e in St(t)}function Nr(t,e,r){for(var i=r?Ie:Te,o=t[0].length,s=t.length,a=s,u=st(s),l=1/0,c=[];a--;){var h=t[a];a&&e&&(h=Ne(h,Je(e))),l=An(h.length,l),u[a]=!r&&(e||o>=120&&h.length>=120)?new Zn(a&&h):n}h=t[0];var f=-1,d=u[0];t:for(;++f=a?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Vr(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)a!==t&&Xt.call(a,u,1),Xt.call(t,u,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Ao(i)?Xt.call(t,i,1):di(t,i)}}return t}function Zr(t,e){return t+Le(Mn()*(e-t+1))}function Kr(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=Le(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Oo(To(t,e,su),t+"")}function $r(t){return $n(Wa(t))}function ti(t,e){var n=Wa(t);return jo(n,lr(e,0,n.length))}function ei(t,e,r,i){if(!ra(t))return t;for(var o=-1,s=(e=Ai(e,t)).length,a=s-1,u=t;null!=u&&++oi?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=st(i);++r>>1,s=t[o];null!==s&&!ha(s)&&(n?s<=e:s=200){var l=e?null:Ki(t);if(l)return ln(l);s=!1,i=Ke,u=new Zn}else u=e?[]:a;t:for(;++r=i?t:oi(t,e,r)}var Mi=fe||function(t){return he.clearTimeout(t)};function ki(t,e){if(e)return t.slice();var n=t.length,r=Qt?Qt(n):new t.constructor(n);return t.copy(r),r}function xi(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function Si(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ci(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,s=ha(t),a=e!==n,u=null===e,l=e==e,c=ha(e);if(!u&&!c&&!s&&t>e||s&&a&&l&&!u&&!c||i&&a&&l||!r&&l||!o)return 1;if(!i&&!s&&!c&&t1?r[o-1]:n,a=o>2?r[2]:n;for(s=t.length>3&&"function"==typeof s?(o--,s):n,a&&_o(r[0],r[1],a)&&(s=o<3?n:s,o=1),e=St(e);++i-1?o[s?e[a]:a]:n}}function zi(t){return io((function(e){var i=e.length,o=i,s=Gn.prototype.thru;for(t&&e.reverse();o--;){var a=e[o];if("function"!=typeof a)throw new It(r);if(s&&!u&&"wrapper"==uo(a))var u=new Gn([],!0)}for(o=u?o:i;++o1&&v.reverse(),f&&lu))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var f=-1,d=!0,p=2&r?new Zn:n;for(s.set(t,e),s.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return ke(g,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ut);return e?e[1].split(lt):[]}(r),n)))}function Do(t){var e=0,r=0;return function(){var i=_n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function jo(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r1?t[e-1]:n;return r="function"==typeof r?(t.pop(),r):n,us(t,r)}));function ms(t){var e=Hn(t);return e.__chain__=!0,e}function gs(t,e){return e(t)}var ys=io((function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return ur(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Qn&&Ao(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:gs,args:[o],thisArg:n}),new Gn(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(o)})),vs=Ri((function(t,e,n){Lt.call(t,n)?++t[n]:ar(t,n,1)})),bs=Ui(Qo),ws=Ui(Vo);function As(t,e){return(Vs(t)?ke:pr)(t,co(e,3))}function _s(t,e){return(Vs(t)?xe:mr)(t,co(e,3))}var Es=Ri((function(t,e,n){Lt.call(t,n)?t[n].push(e):ar(t,n,[e])})),Ms=Xr((function(t,e,n){var r=-1,i="function"==typeof e,o=Js(t)?st(t.length):[];return pr(t,(function(t){o[++r]=i?Ee(e,t,n):Pr(t,e,n)})),o})),ks=Ri((function(t,e,n){ar(t,n,e)}));function xs(t,e){return(Vs(t)?Ne:zr)(t,co(e,3))}var Ss=Ri((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Cs=Xr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&_o(t,e[0],e[1])?e=[]:n>2&&_o(e[0],e[1],e[2])&&(e=[e[0]]),Qr(t,br(e,1),[])})),Ts=de||function(){return he.Date.now()};function Is(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,$i(t,c,n,n,n,n,e)}function Ns(t,e){var i;if("function"!=typeof e)throw new It(r);return t=ya(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var Ps=Xr((function(t,e,n){var r=1;if(n.length){var i=un(n,lo(Ps));r|=u}return $i(t,r,e,n,i)})),Rs=Xr((function(t,e,n){var r=3;if(n.length){var i=un(n,lo(Rs));r|=u}return $i(e,r,t,n,i)}));function Bs(t,e,i){var o,s,a,u,l,c,h=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new It(r);function m(e){var r=o,i=s;return o=s=n,h=e,u=t.apply(i,r)}function g(t){return h=t,l=Bo(v,e),f?m(t):u}function y(t){var r=t-c;return c===n||r>=e||r<0||d&&t-h>=a}function v(){var t=Ts();if(y(t))return b(t);l=Bo(v,function(t){var n=e-(t-c);return d?An(n,a-(t-h)):n}(t))}function b(t){return l=n,p&&o?m(t):(o=s=n,u)}function w(){var t=Ts(),r=y(t);if(o=arguments,s=this,c=t,r){if(l===n)return g(c);if(d)return Mi(l),l=Bo(v,e),m(c)}return l===n&&(l=Bo(v,e)),u}return e=ba(e)||0,ra(i)&&(f=!!i.leading,a=(d="maxWait"in i)?wn(ba(i.maxWait)||0,e):a,p="trailing"in i?!!i.trailing:p),w.cancel=function(){l!==n&&Mi(l),h=0,o=c=s=l=n},w.flush=function(){return l===n?u:b(Ts())},w}var Os=Xr((function(t,e){return fr(t,1,e)})),Ls=Xr((function(t,e,n){return fr(t,ba(e)||0,n)}));function Ds(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ds.Cache||Jn),n}function js(t){if("function"!=typeof t)throw new It(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ds.Cache=Jn;var Fs=_i((function(t,e){var n=(e=1==e.length&&Vs(e[0])?Ne(e[0],Je(co())):Ne(br(e,1),Je(co()))).length;return Xr((function(r){for(var i=-1,o=An(r.length,n);++i=e})),Qs=Rr(function(){return arguments}())?Rr:function(t){return ia(t)&&Lt.call(t,"callee")&&!Jt.call(t,"callee")},Vs=st.isArray,Ys=ye?Je(ye):function(t){return ia(t)&&Sr(t)==R};function Js(t){return null!=t&&na(t.length)&&!ta(t)}function Zs(t){return ia(t)&&Js(t)}var Ks=gn||bu,Xs=ve?Je(ve):function(t){return ia(t)&&Sr(t)==w};function $s(t){if(!ia(t))return!1;var e=Sr(t);return e==A||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!aa(t)}function ta(t){if(!ra(t))return!1;var e=Sr(t);return e==_||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ea(t){return"number"==typeof t&&t==ya(t)}function na(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ra(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ia(t){return null!=t&&"object"==typeof t}var oa=be?Je(be):function(t){return ia(t)&&yo(t)==M};function sa(t){return"number"==typeof t||ia(t)&&Sr(t)==k}function aa(t){if(!ia(t)||Sr(t)!=x)return!1;var e=Vt(t);if(null===e)return!0;var n=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ot.call(n)==Ut}var ua=we?Je(we):function(t){return ia(t)&&Sr(t)==C},la=Ae?Je(Ae):function(t){return ia(t)&&yo(t)==T};function ca(t){return"string"==typeof t||!Vs(t)&&ia(t)&&Sr(t)==I}function ha(t){return"symbol"==typeof t||ia(t)&&Sr(t)==N}var fa=_e?Je(_e):function(t){return ia(t)&&na(t.length)&&!!ie[Sr(t)]},da=Yi(Ur),pa=Yi((function(t,e){return t<=e}));function ma(t){if(!t)return[];if(Js(t))return ca(t)?fn(t):Ni(t);if(se&&t[se])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[se]());var e=yo(t);return(e==M?sn:e==T?ln:Wa)(t)}function ga(t){return t?(t=ba(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ya(t){var e=ga(t),n=e%1;return e==e?n?e-n:e:0}function va(t){return t?lr(ya(t),0,m):0}function ba(t){if("number"==typeof t)return t;if(ha(t))return p;if(ra(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ra(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var n=gt.test(t);return n||vt.test(t)?ue(t.slice(2),n?2:8):mt.test(t)?p:+t}function wa(t){return Pi(t,Oa(t))}function Aa(t){return null==t?"":hi(t)}var _a=Bi((function(t,e){if(xo(e)||Js(e))Pi(e,Ba(e),t);else for(var n in e)Lt.call(e,n)&&rr(t,n,e[n])})),Ea=Bi((function(t,e){Pi(e,Oa(e),t)})),Ma=Bi((function(t,e,n,r){Pi(e,Oa(e),t,r)})),ka=Bi((function(t,e,n,r){Pi(e,Ba(e),t,r)})),xa=io(ur),Sa=Xr((function(t,e){t=St(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&_o(e[0],e[1],o)&&(i=1);++r1),e})),Pi(t,so(t),n),r&&(n=cr(n,7,no));for(var i=e.length;i--;)di(n,e[i]);return n})),Fa=io((function(t,e){return null==t?{}:function(t,e){return Vr(t,e,(function(e,n){return Ia(t,n)}))}(t,e)}));function Ua(t,e){if(null==t)return{};var n=Ne(so(t),(function(t){return[t]}));return e=co(e),Vr(t,n,(function(t,n){return e(t,n[0])}))}var za=Xi(Ba),Ha=Xi(Oa);function Wa(t){return null==t?[]:Ze(t,Ba(t))}var qa=ji((function(t,e,n){return e=e.toLowerCase(),t+(n?Ga(e):e)}));function Ga(t){return $a(Aa(t).toLowerCase())}function Qa(t){return(t=Aa(t))&&t.replace(wt,en).replace(Kt,"")}var Va=ji((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ya=ji((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ja=Di("toLowerCase"),Za=ji((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ka=ji((function(t,e,n){return t+(n?" ":"")+$a(e)})),Xa=ji((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),$a=Di("toUpperCase");function tu(t,e,r){return t=Aa(t),(e=r?n:e)===n?function(t){return ee.test(t)}(t)?function(t){return t.match($t)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(e)||[]}var eu=Xr((function(t,e){try{return Ee(t,n,e)}catch(t){return $s(t)?t:new Mt(t)}})),nu=io((function(t,e){return ke(e,(function(e){e=Uo(e),ar(t,e,Ps(t[e],t))})),t}));function ru(t){return function(){return t}}var iu=zi(),ou=zi(!0);function su(t){return t}function au(t){return Dr("function"==typeof t?t:cr(t,1))}var uu=Xr((function(t,e){return function(n){return Pr(n,t,e)}})),lu=Xr((function(t,e){return function(n){return Pr(t,n,e)}}));function cu(t,e,n){var r=Ba(e),i=Mr(e,r);null!=n||ra(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Mr(e,Ba(e)));var o=!(ra(n)&&"chain"in n&&!n.chain),s=ta(t);return ke(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Ni(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Pe([this.value()],arguments))})})),t}function hu(){}var fu=Gi(Ne),du=Gi(Se),pu=Gi(Oe);function mu(t){return Eo(t)?We(Uo(t)):function(t){return function(e){return kr(e,t)}}(t)}var gu=Vi(),yu=Vi(!0);function vu(){return[]}function bu(){return!1}var wu,Au=qi((function(t,e){return t+e}),0),_u=Zi("ceil"),Eu=qi((function(t,e){return t/e}),1),Mu=Zi("floor"),ku=qi((function(t,e){return t*e}),1),xu=Zi("round"),Su=qi((function(t,e){return t-e}),0);return Hn.after=function(t,e){if("function"!=typeof e)throw new It(r);return t=ya(t),function(){if(--t<1)return e.apply(this,arguments)}},Hn.ary=Is,Hn.assign=_a,Hn.assignIn=Ea,Hn.assignInWith=Ma,Hn.assignWith=ka,Hn.at=xa,Hn.before=Ns,Hn.bind=Ps,Hn.bindAll=nu,Hn.bindKey=Rs,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Vs(t)?t:[t]},Hn.chain=ms,Hn.chunk=function(t,e,r){e=(r?_o(t,e,r):e===n)?1:wn(ya(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,a=st(ge(i/e));oo?0:o+r),(i=i===n||i>o?o:ya(i))<0&&(i+=o),i=r>i?0:va(i);r>>0)?(t=Aa(t))&&("string"==typeof e||null!=e&&!ua(e))&&!(e=hi(e))&&on(t)?Ei(fn(t),0,r):t.split(e,r):[]},Hn.spread=function(t,e){if("function"!=typeof t)throw new It(r);return e=null==e?0:wn(ya(e),0),Xr((function(n){var r=n[e],i=Ei(n,0,e);return r&&Pe(i,r),Ee(t,this,i)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oi(t,1,e):[]},Hn.take=function(t,e,r){return t&&t.length?oi(t,0,(e=r||e===n?1:ya(e))<0?0:e):[]},Hn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?oi(t,(e=i-(e=r||e===n?1:ya(e)))<0?0:e,i):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?mi(t,co(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?mi(t,co(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new It(r);return ra(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Bs(t,e,{leading:i,maxWait:e,trailing:o})},Hn.thru=gs,Hn.toArray=ma,Hn.toPairs=za,Hn.toPairsIn=Ha,Hn.toPath=function(t){return Vs(t)?Ne(t,Uo):ha(t)?[t]:Ni(Fo(Aa(t)))},Hn.toPlainObject=wa,Hn.transform=function(t,e,n){var r=Vs(t),i=r||Ks(t)||fa(t);if(e=co(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:ra(t)&&ta(o)?Wn(Vt(t)):{}}return(i?ke:_r)(t,(function(t,r,i){return e(n,t,r,i)})),n},Hn.unary=function(t){return Is(t,1)},Hn.union=is,Hn.unionBy=os,Hn.unionWith=ss,Hn.uniq=function(t){return t&&t.length?fi(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?fi(t,co(e,2)):[]},Hn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?fi(t,n,e):[]},Hn.unset=function(t,e){return null==t||di(t,e)},Hn.unzip=as,Hn.unzipWith=us,Hn.update=function(t,e,n){return null==t?t:pi(t,e,wi(n))},Hn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:pi(t,e,wi(r),i)},Hn.values=Wa,Hn.valuesIn=function(t){return null==t?[]:Ze(t,Oa(t))},Hn.without=ls,Hn.words=tu,Hn.wrap=function(t,e){return Us(wi(e),t)},Hn.xor=cs,Hn.xorBy=hs,Hn.xorWith=fs,Hn.zip=ds,Hn.zipObject=function(t,e){return vi(t||[],e||[],rr)},Hn.zipObjectDeep=function(t,e){return vi(t||[],e||[],ei)},Hn.zipWith=ps,Hn.entries=za,Hn.entriesIn=Ha,Hn.extend=Ea,Hn.extendWith=Ma,cu(Hn,Hn),Hn.add=Au,Hn.attempt=eu,Hn.camelCase=qa,Hn.capitalize=Ga,Hn.ceil=_u,Hn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=ba(r))==r?r:0),e!==n&&(e=(e=ba(e))==e?e:0),lr(ba(t),e,r)},Hn.clone=function(t){return cr(t,4)},Hn.cloneDeep=function(t){return cr(t,5)},Hn.cloneDeepWith=function(t,e){return cr(t,5,e="function"==typeof e?e:n)},Hn.cloneWith=function(t,e){return cr(t,4,e="function"==typeof e?e:n)},Hn.conformsTo=function(t,e){return null==e||hr(t,e,Ba(e))},Hn.deburr=Qa,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=Eu,Hn.endsWith=function(t,e,r){t=Aa(t),e=hi(e);var i=t.length,o=r=r===n?i:lr(ya(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},Hn.eq=Ws,Hn.escape=function(t){return(t=Aa(t))&&Z.test(t)?t.replace(Y,nn):t},Hn.escapeRegExp=function(t){return(t=Aa(t))&&it.test(t)?t.replace(rt,"\\$&"):t},Hn.every=function(t,e,r){var i=Vs(t)?Se:gr;return r&&_o(t,e,r)&&(e=n),i(t,co(e,3))},Hn.find=bs,Hn.findIndex=Qo,Hn.findKey=function(t,e){return De(t,co(e,3),_r)},Hn.findLast=ws,Hn.findLastIndex=Vo,Hn.findLastKey=function(t,e){return De(t,co(e,3),Er)},Hn.floor=Mu,Hn.forEach=As,Hn.forEachRight=_s,Hn.forIn=function(t,e){return null==t?t:wr(t,co(e,3),Oa)},Hn.forInRight=function(t,e){return null==t?t:Ar(t,co(e,3),Oa)},Hn.forOwn=function(t,e){return t&&_r(t,co(e,3))},Hn.forOwnRight=function(t,e){return t&&Er(t,co(e,3))},Hn.get=Ta,Hn.gt=qs,Hn.gte=Gs,Hn.has=function(t,e){return null!=t&&vo(t,e,Tr)},Hn.hasIn=Ia,Hn.head=Jo,Hn.identity=su,Hn.includes=function(t,e,n,r){t=Js(t)?t:Wa(t),n=n&&!r?ya(n):0;var i=t.length;return n<0&&(n=wn(i+n,0)),ca(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ya(n);return i<0&&(i=wn(r+i,0)),Fe(t,e,i)},Hn.inRange=function(t,e,r){return e=ga(e),r===n?(r=e,e=0):r=ga(r),function(t,e,n){return t>=An(e,n)&&t=-9007199254740991&&t<=d},Hn.isSet=la,Hn.isString=ca,Hn.isSymbol=ha,Hn.isTypedArray=fa,Hn.isUndefined=function(t){return t===n},Hn.isWeakMap=function(t){return ia(t)&&yo(t)==P},Hn.isWeakSet=function(t){return ia(t)&&"[object WeakSet]"==Sr(t)},Hn.join=function(t,e){return null==t?"":vn.call(t,e)},Hn.kebabCase=Va,Hn.last=$o,Hn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ya(r))<0?wn(i+o,0):An(o,i-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):je(t,ze,o,!0)},Hn.lowerCase=Ya,Hn.lowerFirst=Ja,Hn.lt=da,Hn.lte=pa,Hn.max=function(t){return t&&t.length?yr(t,su,Cr):n},Hn.maxBy=function(t,e){return t&&t.length?yr(t,co(e,2),Cr):n},Hn.mean=function(t){return He(t,su)},Hn.meanBy=function(t,e){return He(t,co(e,2))},Hn.min=function(t){return t&&t.length?yr(t,su,Ur):n},Hn.minBy=function(t,e){return t&&t.length?yr(t,co(e,2),Ur):n},Hn.stubArray=vu,Hn.stubFalse=bu,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=ku,Hn.nth=function(t,e){return t&&t.length?Gr(t,ya(e)):n},Hn.noConflict=function(){return he._===this&&(he._=zt),this},Hn.noop=hu,Hn.now=Ts,Hn.pad=function(t,e,n){t=Aa(t);var r=(e=ya(e))?hn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Qi(Le(i),n)+t+Qi(ge(i),n)},Hn.padEnd=function(t,e,n){t=Aa(t);var r=(e=ya(e))?hn(t):0;return e&&re){var i=t;t=e,e=i}if(r||t%1||e%1){var o=Mn();return An(t+o*(e-t+ae("1e-"+((o+"").length-1))),e)}return Zr(t,e)},Hn.reduce=function(t,e,n){var r=Vs(t)?Re:Ge,i=arguments.length<3;return r(t,co(e,4),n,i,pr)},Hn.reduceRight=function(t,e,n){var r=Vs(t)?Be:Ge,i=arguments.length<3;return r(t,co(e,4),n,i,mr)},Hn.repeat=function(t,e,r){return e=(r?_o(t,e,r):e===n)?1:ya(e),Kr(Aa(t),e)},Hn.replace=function(){var t=arguments,e=Aa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(t,e,r){var i=-1,o=(e=Ai(e,t)).length;for(o||(o=1,t=n);++id)return[];var n=m,r=An(t,m);e=co(e),t-=m;for(var i=Ve(r,e);++n=s)return t;var u=r-hn(i);if(u<1)return i;var l=a?Ei(a,0,u).join(""):t.slice(0,u);if(o===n)return l+i;if(a&&(u+=l.length-u),ua(o)){if(t.slice(u).search(o)){var c,h=l;for(o.global||(o=Ct(o.source,Aa(pt.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var f=c.index;l=l.slice(0,f===n?u:f)}}else if(t.indexOf(hi(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+i},Hn.unescape=function(t){return(t=Aa(t))&&J.test(t)?t.replace(V,pn):t},Hn.uniqueId=function(t){var e=++Dt;return Aa(t)+e},Hn.upperCase=Xa,Hn.upperFirst=$a,Hn.each=As,Hn.eachRight=_s,Hn.first=Jo,cu(Hn,(wu={},_r(Hn,(function(t,e){Lt.call(Hn.prototype,e)||(wu[e]=t)})),wu),{chain:!1}),Hn.VERSION="4.17.21",ke(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),ke(["drop","take"],(function(t,e){Qn.prototype[t]=function(r){r=r===n?1:wn(ya(r),0);var i=this.__filtered__&&!e?new Qn(this):this.clone();return i.__filtered__?i.__takeCount__=An(r,i.__takeCount__):i.__views__.push({size:An(r,m),type:t+(i.__dir__<0?"Right":"")}),i},Qn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ke(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Qn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:co(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),ke(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Qn.prototype[t]=function(){return this[n](1).value()[0]}})),ke(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Qn.prototype[t]=function(){return this.__filtered__?new Qn(this):this[n](1)}})),Qn.prototype.compact=function(){return this.filter(su)},Qn.prototype.find=function(t){return this.filter(t).head()},Qn.prototype.findLast=function(t){return this.reverse().find(t)},Qn.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new Qn(this):this.map((function(n){return Pr(n,t,e)}))})),Qn.prototype.reject=function(t){return this.filter(js(co(t)))},Qn.prototype.slice=function(t,e){t=ya(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Qn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=ya(e))<0?r.dropRight(-e):r.take(e-t)),r)},Qn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Qn.prototype.toArray=function(){return this.take(m)},_r(Qn.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Hn[i?"take"+("last"==e?"Right":""):e],s=i||/^find/.test(e);o&&(Hn.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,u=e instanceof Qn,l=a[0],c=u||Vs(e),h=function(t){var e=o.apply(Hn,Pe([t],a));return i&&f?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=s&&!f,m=u&&!d;if(!s&&c){e=m?e:new Qn(this);var g=t.apply(e,a);return g.__actions__.push({func:gs,args:[h],thisArg:n}),new Gn(g,f)}return p&&m?t.apply(this,a):(g=this.thru(h),p?i?g.value()[0]:g.value():g)})})),ke(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Nt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Vs(i)?i:[],t)}return this[n]((function(n){return e.apply(Vs(n)?n:[],t)}))}})),_r(Qn.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";Lt.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:e,func:n})}})),Rn[Hi(n,2).name]=[{name:"wrapper",func:n}],Qn.prototype.clone=function(){var t=new Qn(this.__wrapped__);return t.__actions__=Ni(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ni(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ni(this.__views__),t},Qn.prototype.reverse=function(){if(this.__filtered__){var t=new Qn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Qn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Vs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Hn.prototype.plant=function(t){for(var e,r=this;r instanceof qn;){var i=Ho(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},Hn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Qn){var e=t;return this.__actions__.length&&(e=new Qn(this)),(e=e.reverse()).__actions__.push({func:gs,args:[rs],thisArg:n}),new Gn(e,this.__chain__)}return this.thru(rs)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,se&&(Hn.prototype[se]=function(){return this}),Hn}();de?((de.exports=mn)._=mn,fe._=mn):he._=mn}).call(i)})),FB=9e15,UB=1e9,zB="0123456789abcdef",HB="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",WB="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",qB={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-FB,maxE:FB,crypto:!1},GB=!0,QB="[DecimalError] ",VB=QB+"Invalid argument: ",YB=QB+"Precision limit exceeded",JB=QB+"crypto unavailable",ZB="[object Decimal]",KB=Math.floor,XB=Math.pow,$B=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,tO=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,eO=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,nO=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,rO=1e7,iO=HB.length-1,oO=WB.length-1,sO={toStringTag:ZB};function aO(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;en)throw Error(VB+t)}function lO(t,e,n,r){var i,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=XB(10,7-e),a=t[i]%o|0,null==r?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(t[i+1]/o/100|0)==XB(10,e-2)-1||(a==o/2||0==a)&&0==(t[i+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),s=(r||n<4)&&9999==a||!r&&n>3&&4999==a):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(t[i+1]/o/1e3|0)==XB(10,e-3)-1,s}function cO(t,e,n){for(var r,i,o=[0],s=0,a=t.length;sn-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}sO.absoluteValue=sO.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),fO(t)},sO.ceil=function(){return fO(new this.constructor(this),this.e+1,2)},sO.clampedTo=sO.clamp=function(t,e){var n=this,r=n.constructor;if(t=new r(t),e=new r(e),!t.s||!e.s)return new r(NaN);if(t.gt(e))throw Error(VB+e);return n.cmp(t)<0?t:n.cmp(e)>0?e:new r(n)},sO.comparedTo=sO.cmp=function(t){var e,n,r,i,o=this,s=o.d,a=(t=new o.constructor(t)).d,u=o.s,l=t.s;if(!s||!a)return u&&l?u!==l?u:s===a?0:!s^u<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==t.e)return o.e>t.e^u<0?1:-1;for(e=0,n=(r=s.length)<(i=a.length)?r:i;ea[e]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},sO.cosine=sO.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r,i;if(e.isZero())return e;(r=e.d.length)<32?i=(1/CO(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),t.precision+=n,e=SO(t,1,e.times(i),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}(r,TO(r,n)),r.precision=t,r.rounding=e,fO(2==BB||3==BB?n.neg():n,t,e,!0)):new r(1):new r(NaN)},sO.cubeRoot=sO.cbrt=function(){var t,e,n,r,i,o,s,a,u,l,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(GB=!1,(o=c.s*XB(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=aO(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=XB(n,1/3),t=KB((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=c.s),s=(t=h.precision)+3;;)if(l=(u=(a=r).times(a).times(a)).plus(c),r=hO(l.plus(c).times(a),l.plus(u),s+2,1),aO(a.d).slice(0,s)===(n=aO(r.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(fO(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(fO(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}return GB=!0,fO(r,t,h.rounding,e)},sO.decimalPlaces=sO.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=7*((t=e.length-1)-KB(this.e/7)),t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},sO.dividedBy=sO.div=function(t){return hO(this,new this.constructor(t))},sO.dividedToIntegerBy=sO.divToInt=function(t){var e=this.constructor;return fO(hO(this,new e(t),0,1,1),e.precision,e.rounding)},sO.equals=sO.eq=function(t){return 0===this.cmp(t)},sO.floor=function(){return fO(new this.constructor(this),this.e+1,3)},sO.greaterThan=sO.gt=function(t){return this.cmp(t)>0},sO.greaterThanOrEqualTo=sO.gte=function(t){var e=this.cmp(t);return 1==e||0===e},sO.hyperbolicCosine=sO.cosh=function(){var t,e,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?e=(1/CO(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=SO(s,1,o.times(e),new s(1),!0);for(var u,l=t,c=new s(8);l--;)u=o.times(o),o=a.minus(u.times(c.minus(u.times(c))));return fO(o,s.precision=n,s.rounding=r,!0)},sO.hyperbolicSine=sO.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=SO(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=SO(o,2,i=i.times(1/CO(5,t)),i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);t--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=e,o.rounding=n,fO(i,e,n,!0)},sO.hyperbolicTangent=sO.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,hO(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},sO.inverseCosine=sO.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?gO(n,i,o):new n(0):new n(NaN):e.isZero()?gO(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=gO(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},sO.inverseHyperbolicCosine=sO.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,GB=!1,n=n.times(n).minus(1).sqrt().plus(n),GB=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},sO.inverseHyperbolicSine=sO.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,GB=!1,n=n.times(n).plus(1).sqrt().plus(n),GB=!0,r.precision=t,r.rounding=e,n.ln())},sO.inverseHyperbolicTangent=sO.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?fO(new o(i),t,e,!0):(o.precision=n=r-i.e,i=hO(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},sO.inverseSine=sO.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=gO(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},sO.inverseTangent=sO.atan=function(){var t,e,n,r,i,o,s,a,u,l=this,c=l.constructor,h=c.precision,f=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&h+4<=oO)return(s=gO(c,h+4,f).times(.25)).s=l.s,s}else{if(!l.s)return new c(NaN);if(h+4<=oO)return(s=gO(c,h+4,f).times(.5)).s=l.s,s}for(c.precision=a=h+10,c.rounding=1,t=n=Math.min(28,a/7+2|0);t;--t)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(GB=!1,e=Math.ceil(a/7),r=1,u=l.times(l),s=new c(l),i=l;-1!==t;)if(i=i.times(u),o=s.minus(i.div(r+=2)),i=i.times(u),void 0!==(s=o.plus(i.div(r+=2))).d[e])for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<this.d.length-2},sO.isNaN=function(){return!this.s},sO.isNegative=sO.isNeg=function(){return this.s<0},sO.isPositive=sO.isPos=function(){return this.s>0},sO.isZero=function(){return!!this.d&&0===this.d[0]},sO.lessThan=sO.lt=function(t){return this.cmp(t)<0},sO.lessThanOrEqualTo=sO.lte=function(t){return this.cmp(t)<1},sO.logarithm=sO.log=function(t){var e,n,r,i,o,s,a,u,l=this,c=l.constructor,h=c.precision,f=c.rounding;if(null==t)t=new c(10),e=!0;else{if(n=(t=new c(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new c(n&&!n[0]?-1/0:1!=l.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(GB=!1,s=EO(l,a=h+5),r=e?mO(c,a+10):EO(t,a),lO((u=hO(s,r,a,1)).d,i=h,f))do{if(s=EO(l,a+=10),r=e?mO(c,a+10):EO(t,a),u=hO(s,r,a,1),!o){+aO(u.d).slice(i+1,i+15)+1==1e14&&(u=fO(u,h+1,0));break}}while(lO(u.d,i+=10,f));return GB=!0,fO(u,h,f)},sO.minus=sO.sub=function(t){var e,n,r,i,o,s,a,u,l,c,h,f,d=this,p=d.constructor;if(t=new p(t),!d.d||!t.d)return d.s&&t.s?d.d?t.s=-t.s:t=new p(t.d||d.s!==t.s?d:NaN):t=new p(NaN),t;if(d.s!=t.s)return t.s=-t.s,d.plus(t);if(l=d.d,f=t.d,a=p.precision,u=p.rounding,!l[0]||!f[0]){if(f[0])t.s=-t.s;else{if(!l[0])return new p(3===u?-0:0);t=new p(d)}return GB?fO(t,a,u):t}if(n=KB(t.e/7),c=KB(d.e/7),l=l.slice(),o=c-n){for((h=o<0)?(e=l,o=-o,s=f.length):(e=f,n=c,s=l.length),o>(r=Math.max(Math.ceil(a/7),s)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((h=(r=l.length)<(s=f.length))&&(s=r),r=0;r0;--r)l[s++]=0;for(r=f.length;r>o;){if(l[--r](s=(o=Math.ceil(a/7))>s?o+1:s+1)&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((s=l.length)-(i=c.length)<0&&(i=s,n=c,c=l,l=n),e=0;i;)e=(l[--i]=l[i]+c[i]+e)/rO|0,l[i]%=rO;for(e&&(l.unshift(e),++r),s=l.length;0==l[--s];)l.pop();return t.d=l,t.e=pO(l,r),GB?fO(t,a,u):t},sO.precision=sO.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(VB+t);return n.d?(e=yO(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},sO.round=function(){var t=this,e=t.constructor;return fO(new e(t),t.e+1,e.rounding)},sO.sine=sO.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:SO(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=SO(t,2,e=e.times(1/CO(5,n)),e);for(var i,o=new t(5),s=new t(16),a=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}(r,TO(r,n)),r.precision=t,r.rounding=e,fO(BB>2?n.neg():n,t,e,!0)):new r(NaN)},sO.squareRoot=sO.sqrt=function(){var t,e,n,r,i,o,s=this,a=s.d,u=s.e,l=s.s,c=s.constructor;if(1!==l||!a||!a[0])return new c(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(GB=!1,0==(l=Math.sqrt(+s))||l==1/0?(((e=aO(a)).length+u)%2==0&&(e+="0"),l=Math.sqrt(e),u=KB((u+1)/2)-(u<0||u%2),r=new c(e=l==1/0?"5e"+u:(e=l.toExponential()).slice(0,e.indexOf("e")+1)+u)):r=new c(l.toString()),n=(u=c.precision)+3;;)if(r=(o=r).plus(hO(s,o,n+2,1)).times(.5),aO(o.d).slice(0,n)===(e=aO(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(fO(r,u+1,1),t=!r.times(r).eq(s));break}if(!i&&(fO(o,u+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}return GB=!0,fO(r,u,c.rounding,t)},sO.tangent=sO.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=hO(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,fO(2==BB||4==BB?n.neg():n,t,e,!0)):new r(NaN)},sO.times=sO.mul=function(t){var e,n,r,i,o,s,a,u,l,c=this,h=c.constructor,f=c.d,d=(t=new h(t)).d;if(t.s*=c.s,!(f&&f[0]&&d&&d[0]))return new h(!t.s||f&&!f[0]&&!d||d&&!d[0]&&!f?NaN:f&&d?0*t.s:t.s/0);for(n=KB(c.e/7)+KB(t.e/7),(u=f.length)<(l=d.length)&&(o=f,f=d,d=o,s=u,u=l,l=s),o=[],r=s=u+l;r--;)o.push(0);for(r=l;--r>=0;){for(e=0,i=u+r;i>r;)a=o[i]+d[r]*f[i-r-1]+e,o[i--]=a%rO|0,e=a/rO|0;o[i]=(o[i]+e)%rO|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=pO(o,n),GB?fO(t,h.precision,h.rounding):t},sO.toBinary=function(t,e){return IO(this,2,t,e)},sO.toDecimalPlaces=sO.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(uO(t,0,UB),void 0===e?e=r.rounding:uO(e,0,8),fO(n,t+n.e+1,e))},sO.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=dO(r,!0):(uO(t,0,UB),void 0===e?e=i.rounding:uO(e,0,8),n=dO(r=fO(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},sO.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=dO(i):(uO(t,0,UB),void 0===e?e=o.rounding:uO(e,0,8),n=dO(r=fO(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},sO.toFraction=function(t){var e,n,r,i,o,s,a,u,l,c,h,f,d=this,p=d.d,m=d.constructor;if(!p)return new m(d);if(l=n=new m(1),r=u=new m(0),s=(o=(e=new m(r)).e=yO(p)-d.e-1)%7,e.d[0]=XB(10,s<0?7+s:s),null==t)t=o>0?e:l;else{if(!(a=new m(t)).isInt()||a.lt(l))throw Error(VB+a);t=a.gt(e)?o>0?e:l:a}for(GB=!1,a=new m(aO(p)),c=m.precision,m.precision=o=7*p.length*2;h=hO(a,e,0,1,1),1!=(i=n.plus(h.times(r))).cmp(t);)n=r,r=i,i=l,l=u.plus(h.times(i)),u=i,i=e,e=a.minus(h.times(i)),a=i;return i=hO(t.minus(n),r,0,1,1),u=u.plus(i.times(l)),n=n.plus(i.times(r)),u.s=l.s=d.s,f=hO(l,r,o,1).minus(d).abs().cmp(hO(u,n,o,1).minus(d).abs())<1?[l,r]:[u,n],m.precision=c,GB=!0,f},sO.toHexadecimal=sO.toHex=function(t,e){return IO(this,16,t,e)},sO.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:uO(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(GB=!1,n=hO(n,t,0,e,1).times(t),GB=!0,fO(n)):(t.s=n.s,n=t),n},sO.toNumber=function(){return+this},sO.toOctal=function(t,e){return IO(this,8,t,e)},sO.toPower=sO.pow=function(t){var e,n,r,i,o,s,a=this,u=a.constructor,l=+(t=new u(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new u(XB(+a,l));if((a=new u(a)).eq(1))return a;if(r=u.precision,o=u.rounding,t.eq(1))return fO(a,r,o);if((e=KB(t.e/7))>=t.d.length-1&&(n=l<0?-l:l)<=9007199254740991)return i=bO(u,a,n,r),t.s<0?new u(1).div(i):fO(i,r,o);if((s=a.s)<0){if(eu.maxE+1||e0?s/0:0):(GB=!1,u.rounding=a.s=1,n=Math.min(12,(e+"").length),(i=_O(t.times(EO(a,r+n)),r)).d&&lO((i=fO(i,r+5,1)).d,r,o)&&(e=r+10,+aO((i=fO(_O(t.times(EO(a,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=fO(i,r+1,0))),i.s=s,GB=!0,u.rounding=o,fO(i,r,o))},sO.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=dO(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(uO(t,1,UB),void 0===e?e=i.rounding:uO(e,0,8),n=dO(r=fO(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},sO.toSignificantDigits=sO.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(uO(t,1,UB),void 0===e?e=n.rounding:uO(e,0,8)),fO(new n(this),t,e)},sO.toString=function(){var t=this,e=t.constructor,n=dO(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},sO.truncated=sO.trunc=function(){return fO(new this.constructor(this),this.e+1,1)},sO.valueOf=sO.toJSON=function(){var t=this,e=t.constructor,n=dO(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var hO=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;)t.shift()}return function(r,i,o,s,a,u){var l,c,h,f,d,p,m,g,y,v,b,w,A,_,E,M,k,x,S,C,T=r.constructor,I=r.s==i.s?1:-1,N=r.d,P=i.d;if(!(N&&N[0]&&P&&P[0]))return new T(r.s&&i.s&&(N?!P||N[0]!=P[0]:P)?N&&0==N[0]||!P?0*I:I/0:NaN);for(u?(d=1,c=r.e-i.e):(u=rO,d=7,c=KB(r.e/d)-KB(i.e/d)),S=P.length,k=N.length,v=(y=new T(I)).d=[],h=0;P[h]==(N[h]||0);h++);if(P[h]>(N[h]||0)&&c--,null==o?(_=o=T.precision,s=T.rounding):_=a?o+(r.e-i.e)+1:o,_<0)v.push(1),p=!0;else{if(_=_/d+2|0,h=0,1==S){for(f=0,P=P[0],_++;(h1&&(P=t(P,f,u),N=t(N,f,u),S=P.length,k=N.length),M=S,w=(b=N.slice(0,S)).length;w=u/2&&++x;do{f=0,(l=e(P,b,S,w))<0?(A=b[0],S!=w&&(A=A*u+(b[1]||0)),(f=A/x|0)>1?(f>=u&&(f=u-1),1==(l=e(m=t(P,f,u),b,g=m.length,w=b.length))&&(f--,n(m,S=10;f/=10)h++;y.e=h+c*d-1,fO(y,a?o+y.e+1:o,s,p)}return y}}();function fO(t,e,n,r){var i,o,s,a,u,l,c,h,f,d=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,a=h[0];a>=10;a/=10)i++;if((o=e-i)<0)o+=7,s=e,u=(c=h[f=0])/XB(10,i-s-1)%10|0;else if((f=Math.ceil((o+1)/7))>=(a=h.length)){if(!r)break t;for(;a++<=f;)h.push(0);c=u=0,i=1,s=(o%=7)-7+1}else{for(c=a=h[f],i=1;a>=10;a/=10)i++;u=(s=(o%=7)-7+i)<0?0:c/XB(10,i-s-1)%10|0}if(r=r||e<0||void 0!==h[f+1]||(s<0?c:c%XB(10,i-s-1)),l=n<4?(u||r)&&(0==n||n==(t.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?s>0?c/XB(10,i-s):0:h[f-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,l?(e-=t.e+1,h[0]=XB(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=f,a=1,f--):(h.length=f+1,a=XB(10,7-o),h[f]=s>0?(c/XB(10,i-s)%XB(10,s)|0)*a:0),l)for(;;){if(0==f){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,h[0]==rO&&(h[0]=1));break}if(h[f]+=a,h[f]!=rO)break;h[f--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return GB&&(t.e>d.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+vO(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+vO(-i-1)+o,n&&(r=n-s)>0&&(o+=vO(r))):i>=s?(o+=vO(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+vO(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=vO(r))),o}function pO(t,e){var n=t[0];for(e*=7;n>=10;n/=10)e++;return e}function mO(t,e,n){if(e>iO)throw GB=!0,n&&(t.precision=n),Error(YB);return fO(new t(HB),e,1,!0)}function gO(t,e,n){if(e>oO)throw Error(YB);return fO(new t(WB),e,n,!0)}function yO(t){var e=t.length-1,n=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function vO(t){for(var e="";t--;)e+="0";return e}function bO(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/7+4);for(GB=!1;;){if(n%2&&NO((o=o.times(e)).d,s)&&(i=!0),0===(n=KB(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}NO((e=e.times(e)).d,s)}return GB=!0,o}function wO(t){return 1&t.d[t.d.length-1]}function AO(t,e,n){for(var r,i=new t(e[0]),o=0;++o17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(GB=!1,u=p):u=e,a=new f(.03125);t.e>-2;)t=t.times(a),h+=5;for(u+=r=Math.log(XB(2,h))/Math.LN10*2+5|0,n=o=s=new f(1),f.precision=u;;){if(o=fO(o.times(t),u,1),n=n.times(++c),aO((a=s.plus(hO(o,n,u,1))).d).slice(0,u)===aO(s.d).slice(0,u)){for(i=h;i--;)s=fO(s.times(s),u,1);if(null!=e)return f.precision=p,s;if(!(l<3&&lO(s.d,u-r,d,l)))return fO(s,f.precision=p,d,GB=!0);f.precision=u+=10,n=o=a=new f(1),c=0,l++}s=a}}function EO(t,e){var n,r,i,o,s,a,u,l,c,h,f,d=1,p=t,m=p.d,g=p.constructor,y=g.rounding,v=g.precision;if(p.s<0||!m||!m[0]||!p.e&&1==m[0]&&1==m.length)return new g(m&&!m[0]?-1/0:1!=p.s?NaN:m?0:p);if(null==e?(GB=!1,c=v):c=e,g.precision=c+=10,r=(n=aO(m)).charAt(0),!(Math.abs(o=p.e)<15e14))return l=mO(g,c+2,v).times(o+""),p=EO(new g(r+"."+n.slice(1)),c-10).plus(l),g.precision=v,null==e?fO(p,v,y,GB=!0):p;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=aO((p=p.times(t)).d)).charAt(0),d++;for(o=p.e,r>1?(p=new g("0."+n),o++):p=new g(r+"."+n.slice(1)),h=p,u=s=p=hO(p.minus(1),p.plus(1),c,1),f=fO(p.times(p),c,1),i=3;;){if(s=fO(s.times(f),c,1),aO((l=u.plus(hO(s,new g(i),c,1))).d).slice(0,c)===aO(u.d).slice(0,c)){if(u=u.times(2),0!==o&&(u=u.plus(mO(g,c+2,v).times(o+""))),u=hO(u,new g(d),c,1),null!=e)return g.precision=v,u;if(!lO(u.d,c-10,y,a))return fO(u,g.precision=v,y,GB=!0);g.precision=c+=10,l=s=p=hO(h.minus(1),h.plus(1),c,1),f=fO(p.times(p),c,1),i=a=1}u=l,i+=2}}function MO(t){return String(t.s*t.s/0)}function kO(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%7,n<0&&(r+=7),rt.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),nO.test(e))return kO(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(tO.test(e))n=16,e=e.toLowerCase();else if($B.test(e))n=2;else{if(!eO.test(e))throw Error(VB+e);n=8}for((o=e.search(/p/i))>0?(u=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),s=(o=e.indexOf("."))>=0,r=t.constructor,s&&(o=(a=(e=e.replace(".","")).length)-o,i=bO(r,new r(n),o,2*o)),o=c=(l=cO(e,n,rO)).length-1;0===l[o];--o)l.pop();return o<0?new r(0*t.s):(t.e=pO(l,c),t.d=l,GB=!1,s&&(t=hO(t,i,4*a)),u&&(t=t.times(Math.abs(u)<54?XB(2,u):vL.pow(2,u))),GB=!0,t)}function SO(t,e,n,r,i){var o,s,a,u,l=t.precision,c=Math.ceil(l/7);for(GB=!1,u=n.times(n),a=new t(r);;){if(s=hO(a.times(u),new t(e++*e++),l,1),a=i?r.plus(s):r.minus(s),r=hO(s.times(u),new t(e++*e++),l,1),void 0!==(s=a.plus(r)).d[c]){for(o=c;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o}return GB=!0,s.d.length=c+1,s}function CO(t,e){for(var n=t;--e;)n*=t;return n}function TO(t,e){var n,r=e.s<0,i=gO(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return BB=r?4:1,e;if((n=e.divToInt(i)).isZero())BB=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return BB=wO(n)?r?2:3:r?4:1,e;BB=wO(n)?r?1:4:r?3:2}return e.minus(i).abs()}function IO(t,e,n,r){var i,o,s,a,u,l,c,h,f,d=t.constructor,p=void 0!==n;if(p?(uO(n,1,UB),void 0===r?r=d.rounding:uO(r,0,8)):(n=d.precision,r=d.rounding),t.isFinite()){for(p?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(s=(c=dO(t)).indexOf("."))>=0&&(c=c.replace(".",""),(f=new d(1)).e=c.length-s,f.d=cO(dO(f),10,i),f.e=f.d.length),o=u=(h=cO(c,10,i)).length;0==h[--u];)h.pop();if(h[0]){if(s<0?o--:((t=new d(t)).d=h,t.e=o,h=(t=hO(t,f,n,r,0,i)).d,o=t.e,l=RB),s=h[n],a=i/2,l=l||void 0!==h[n+1],l=r<4?(void 0!==s||l)&&(0===r||r===(t.s<0?3:2)):s>a||s===a&&(4===r||l||6===r&&1&h[n-1]||r===(t.s<0?8:7)),h.length=n,l)for(;++h[--n]>i-1;)h[n]=0,n||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(s=0,c="";s1)if(16==e||8==e){for(s=16==e?4:3,--u;u%s;u++)c+="0";for(u=(h=cO(c,i,e)).length;!h[u-1];--u);for(s=1,c="1.";su)for(o-=u;o--;)c+="0";else oe)return t.length=e,!0}function PO(t){return new this(t).abs()}function RO(t){return new this(t).acos()}function BO(t){return new this(t).acosh()}function OO(t,e){return new this(t).plus(e)}function LO(t){return new this(t).asin()}function DO(t){return new this(t).asinh()}function jO(t){return new this(t).atan()}function FO(t){return new this(t).atanh()}function UO(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?gO(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=gO(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(hO(t,e,o,1)),e=gO(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(hO(t,e,o,1)):(n=gO(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function zO(t){return new this(t).cbrt()}function HO(t){return fO(t=new this(t),t.e+1,2)}function WO(t,e,n){return new this(t).clamp(e,n)}function qO(t){if(!t||"object"!=typeof t)throw Error(QB+"Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,UB,"rounding",0,8,"toExpNeg",-FB,0,"toExpPos",0,FB,"maxE",0,FB,"minE",-FB,0,"modulo",0,9];for(e=0;e=o[e+1]&&r<=o[e+2]))throw Error(VB+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=qB[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(VB+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(JB);this[n]=!0}else this[n]=!1}return this}function GO(t){return new this(t).cos()}function QO(t){return new this(t).cosh()}function VO(t,e){return new this(t).div(e)}function YO(t){return new this(t).exp()}function JO(t){return fO(t=new this(t),t.e+1,3)}function ZO(){var t,e,n=new this(0);for(GB=!1,t=0;t=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(JB);for(e=crypto.randomBytes(r*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(i%1e7),o+=4);o=r/4}else for(;o=10;i/=10)r++;r<7&&(n-=7-r)}return s.e=n,s.d=a,s}function uL(t){return fO(t=new this(t),t.e+1,this.rounding)}function lL(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function cL(t){return new this(t).sin()}function hL(t){return new this(t).sinh()}function fL(t){return new this(t).sqrt()}function dL(t,e){return new this(t).sub(e)}function pL(){var t=0,e=arguments,n=new this(e[t]);for(GB=!1;n.s&&++to.maxE?(i.e=NaN,i.d=null):t.e=10;n/=10)e++;return void(GB?e>o.maxE?(i.e=NaN,i.d=null):enew _L({blockchain:e,address:n}).BigNumber(t),_L.readable=async({amount:t,blockchain:e,address:n})=>new _L({blockchain:e,address:n}).readable(t),_L.safeAmount=({amount:t,decimals:e})=>parseFloat(t.toFixed(e)),_L.ethereum={DEFAULT:wL,ERC20:wL},_L.bsc={DEFAULT:bL,BEP20:bL},_L.polygon={DEFAULT:AL,ERC20:AL};var EL={blockchain:"ethereum",name:"uniswap_v2",alternativeNames:[],label:"Uniswap v2",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIABAMAAAAGVsnJAAAALVBMVEVHcEz/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHr/AHoZcglmAAAADnRSTlMACBMiNEtieI+kuc7j9HuCgRkAABrlSURBVHja7F37b1vVHT+2rx9xQIqoxKMpkyUGY22KLCp+GE0rbxLV2i2RKagIBlbUVUITkpWNINptRN1Yi7pqVjeNdUPDSkFj3UMWXSugW7FKCusAYbG1EhA0a92axEns8zfs3uvHPa97fa+vJX+V7/38FD9y7fO938fn+zjHJECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIIAJjSBHeIogxy6CHDH0KnCEIEcyS3AjfI4gx3ia4Eb0EkGOH6YIbgz9heBG6K8jBDfGTxDc0FYIcuQPE9xILBPkKGFPicYWCW5E/p0huJG7SnAjXseeEhXnCW6MriFPicKVUwQ3JlYJbsQo9pSoUCO4kaTTBDVC5SWCGzso8hZBlGLnw/kG8pQoQZG3CEKlOnI+PEaRtwi06iryFkEOOx+OU+x8uIidD49S5Hw4UsHOhyco8hZBjGLnwwXsfDhJkbcIwhXsfHgHXcPNh6OUzhHUmKXIR2aGKMU9MhMqU+QjM2OU4h6Z0arY+XAeOx9OUOwtghJ2PjxKKe6RmUiVIh+ZyVGKe2QmRrHz4QJ2PryRIufD4Qp2PjxBkfNhvS6CvEUwi50PD1HkfFiviyBvEYxT5HxY093gGYIZeUpxj5DrdRHcIzOhEkU+MqOXh3GPzOjlYeQjMznsfDhOsf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TQCHsp3nOhiex4YcZOqQ/KU6EXtUSjWyTokHVSUzr0x6nysyvR6fCgCxICDmHdHG1Mt5j2uW1WgRDekt5V3RQXEUZwHP0pnvnawNUhh218rjhl0S7Bqh6BtDdSsaYOBPS0+ECO8gTRHD1Nuwr9si/IU7rc7FvcpSIGu6vitiZtd07bwkrXYoxL3KUChO/r9nTuAGmaO3nRNRsLEUHQNO24rXLG7b5DVAQLgxXUnQAvEJx58BnHy17z8tP0f3WSaGKzI+0lOAGvH+R3e7axYv7DVEu3DHpTApCAPlIbZkODxdcUijIhc1UkEAMV7MkAGMLNTBaePSyQBA4paUHus3grVWvpaNHVXthJ2Y2JR6Q8AK7KDp/lM5tpiL7wHaKLoAXCKYphriLLjNPR1aqPaalC70j8BBxA9rjdL9/Niq7Pq2lDIZNDUeYhE8whZKBZegfqYmA9BGYncCEdK9ggV0kGaj+M1UOkOQCs122ezvF+2oiycAjKfz9fS6A5u+7Utv4AH3eVwNIPhUj2+Jt3ssrHn+DwDt8sxVEZFM6AguD/bxRqSaQ3EcljBZnHf0W5ZMPAMjZyMOXqPwGSu6iFCu9M/AwfTwgdN/qoR/snf8vazQs9cp/EFx+4Im/nGTtkK783xOBEJTS0uqRBUPpcxlJRFPlcxlJxGYg3WtiUEhHw18eMjaU8DUpqKZE8iANBbXbMJKHTCv+BzzThatBRqASBMNZ4mRQqwVsFHmrtkSQQx2coHzDF1MjBBgaNdTBYaIXfjw9QoCh0TsC7e961dLPOvNLKUW+xR3G2a0t4t2Loyff0JYQvCGi+ZO/fOKPXY+wpPA2/6zpEsP11Fjq0nGAzCmL3y29369p1zl9P3CvtiRhHrQ7P//Y0k0Msx/dsePapXj6RxhhhBFGGGGEEUYYYYQRRhhhhBFGGOF/7cEhAQAAAICg/6/dYAcAAAAAAAAAAIAtmJHpTFcLUiUAAAAASUVORK5CYII=",contracts:{router:{address:"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",api:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},factory:{address:"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",api:[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},pair:{api:[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]}}};let ML=async({amount:t,blockchain:e,address:n})=>await _L.BigNumber({amount:t,blockchain:e,address:n});class kL{constructor({name:t,blockchain:e,alternativeNames:n,label:r,logo:i,contracts:o,route:s,getAmountIn:a}){this.name=t,this.blockchain=e,this.alternativeNames=n,this.label=r,this.logo=i,this.contracts=o,this._route=s,this.getAmountIn=a}async route({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:s,amountOutMin:a,amountOutMax:u,amountInMin:l}){return n===r?Promise.resolve():((({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:s,amountOutMin:a,amountOutMax:u,amountInMin:l})=>{if(void 0!==u)throw"You cannot not set amountOutMax! Only amountInMax or amountOutMin!";if(void 0!==l)throw"You cannot not set amountInMin! Only amountInMax or amountOutMin!";if(void 0!==o&&void 0!==i)throw"You cannot set amountIn and amountOut at the same time, use amountInMax or amountOutMin to describe the non exact part of the swap!";if(void 0!==s&&void 0!==a)throw"You cannot set amountInMax and amountOutMin at the same time, use amountIn or amountOut to describe the part of the swap that needs to be exact!";if(void 0!==i&&void 0!==s)throw"Setting amountIn and amountInMax at the same time makes no sense. Decide if amountIn needs to be exact or not!";if(void 0!==o&&void 0!==a)throw"Setting amountOut and amountOutMin at the same time makes no sense. Decide if amountOut needs to be exact or not!"})({fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:s,amountOutMin:a,amountOutMax:u,amountInMin:l}),await this._route(await(async({blockchain:t,exchange:e,fromAddress:n,toAddress:r,tokenIn:i,tokenOut:o,amountIn:s,amountOut:a,amountInMax:u,amountOutMin:l})=>{let c={exchange:e,fromAddress:n,toAddress:r,tokenIn:i,tokenOut:o,amountIn:s,amountOut:a,amountInMax:u,amountOutMin:l};return a&&"number"==typeof a&&(c.amountOut=await ML({amount:a,blockchain:t,address:o})),l&&"number"==typeof l&&(c.amountOutMin=await ML({amount:l,blockchain:t,address:o})),s&&"number"==typeof s&&(c.amountIn=await ML({amount:s,blockchain:t,address:i})),u&&"number"==typeof u&&(c.amountInMax=await ML({amount:u,blockchain:t,address:i})),c})({blockchain:this.blockchain,exchange:this,fromAddress:t,toAddress:e,tokenIn:n,tokenOut:r,amountIn:i,amountOut:o,amountInMax:s,amountOutMin:a})))}}function xL(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}class SL{constructor({tokenIn:t,tokenOut:e,path:n,amountIn:r,amountInMax:i,amountOut:o,amountOutMin:s,fromAddress:a,toAddress:u,transaction:l,exchange:c}){this.tokenIn=t,this.tokenOut=e,this.path=n,this.amountIn=xL([r,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountOutMin=xL([s,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountOut=xL([o,"optionalAccess",t=>t.toString,"call",t=>t()]),this.amountInMax=xL([i,"optionalAccess",t=>t.toString,"call",t=>t()]),this.fromAddress=a,this.toAddress=u,this.transaction=l,this.exchange=c}}function CL(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}let TL=t=>{let e=t.map(((e,n)=>e===qh.ethereum.NATIVE&&t[n+1]!=qh.ethereum.WRAPPED&&t[n-1]!=qh.ethereum.WRAPPED?qh.ethereum.WRAPPED:e));return e[0]==qh.ethereum.NATIVE&&e[1]==qh.ethereum.WRAPPED?e.splice(0,1):e[e.length-1]==qh.ethereum.NATIVE&&e[e.length-2]==qh.ethereum.WRAPPED&&e.splice(e.length-1,1),e},IL=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(Vy(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(Vy(e.toString(),o)),NL=async t=>{if(1==TL(t).length)return!1;let e=await $M({blockchain:"ethereum",address:EL.contracts.factory.address,method:"getPair"},{api:EL.contracts.factory.api,cache:36e5,params:TL(t)});if(e==qh.ethereum.ZERO)return!1;let[n,r,i]=await Promise.all([$M({blockchain:"ethereum",address:e,method:"getReserves"},{api:EL.contracts.pair.api,cache:36e5}),$M({blockchain:"ethereum",address:e,method:"token0"},{api:EL.contracts.pair.api,cache:36e5}),$M({blockchain:"ethereum",address:e,method:"token1"},{api:EL.contracts.pair.api,cache:36e5})]);if(t.includes(qh.ethereum.WRAPPED))return IL({min:1,token:qh.ethereum.WRAPPED,decimals:qh.ethereum.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(qh.ethereum.USD)){let t=new _L({blockchain:"ethereum",address:qh.ethereum.USD}),e=await t.decimals();return IL({min:1e3,token:qh.ethereum.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},PL=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{$M({blockchain:"ethereum",address:EL.contracts.router.address,method:"getAmountsOut"},{api:EL.contracts.router.api,params:{amountIn:e,path:TL(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),RL=({path:t,amountOut:e,block:n})=>new Promise((r=>{$M({blockchain:"ethereum",address:EL.contracts.router.address,method:"getAmountsIn"},{api:EL.contracts.router.api,params:{amountOut:e,path:TL(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))}));const BL=t=>Pg(t);var OL=new kL(Object.assign(EL,{route:({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u})=>(e=BL(e),n=BL(n),new Promise((async l=>{let c=await(async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(qh.ethereum.NATIVE)&&[t,e].includes(qh.ethereum.WRAPPED))return;let n;return await NL([t,e])?n=[t,e]:t!=qh.ethereum.WRAPPED&&await NL([t,qh.ethereum.WRAPPED])&&e!=qh.ethereum.WRAPPED&&await NL([e,qh.ethereum.WRAPPED])?n=[t,qh.ethereum.WRAPPED,e]:t!=qh.ethereum.USD&&await NL([t,qh.ethereum.USD])&&e!=qh.ethereum.WRAPPED&&await NL([qh.ethereum.WRAPPED,e])?n=[t,qh.ethereum.USD,qh.ethereum.WRAPPED,e]:t!=qh.ethereum.WRAPPED&&await NL([t,qh.ethereum.WRAPPED])&&e!=qh.ethereum.USD&&await NL([qh.ethereum.USD,e])&&(n=[t,qh.ethereum.WRAPPED,qh.ethereum.USD,e]),CL([n,"optionalAccess",t=>t.length])&&n[0]==qh.ethereum.NATIVE?n.splice(1,0,qh.ethereum.WRAPPED):CL([n,"optionalAccess",t=>t.length])&&n[n.length-1]==qh.ethereum.NATIVE&&n.splice(n.length-1,0,qh.ethereum.WRAPPED),n})({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,s,a,u];if(({amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u}=await(async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s})=>{if(r){if(null==(i=await RL({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await PL({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}else if(s){if(null==(i=await RL({path:t,amountOut:s,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await PL({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s}})({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u})),[o,a,s,u].every((t=>null==t)))return l();let m=(({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:s,amountInMaxInput:a,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"ethereum",from:c,to:EL.contracts.router.address,api:EL.contracts.router.api};return t[0]===qh.ethereum.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(s||a)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===qh.ethereum.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:TL(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h})({path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new SL({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:m}))}))),getAmountIn:RL})),LL={blockchain:"bsc",name:"pancakeswap",alternativeNames:["pancake"],label:"PancakeSwap",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAOVBMVEVHcExjMAH+3JBcJwCSb05+VC7RiE9qOg/EsZ+jhWpfLADXjlT/45Z5QxGVWiaubzi9fkXuxH3dqmiL4XhdAAAACnRSTlMA////msX/6i5cADBNDwAAGz9JREFUeNrsnOGSmzoMhcMYg60MhPd/2itjNrSNSQKWWPtyvj/d2bZbVT46lozJDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4CjO+9ba/om1tvXuVg7u7/j60uKrmZDbngwFmpnwFX+jKSPJc3xNDLCJLPH11pcQYNW4Nua2ScC/YahvfzXFztv38TUWGshafbPmdiPJze9pwLM1rYu/JQI2ghs4kN32ufofNfAbKWZ5Pkv/kwbsr2m0Wrw1Zs3h5xz3Jzute8rzS41CAruWv/86u8++qz/RBZzlJd0HJLArvevy76iyszaCUP3Nfkzf3sAXxPQeyTCdUmS+PxgfmTNdqlZm9z/KCRl2NiM+MjCBj+V/KL1rK2B1TWAp/5IlWjOxvDIzrKmANjs+IihArby0M+ysQHyNsTeQXn+2fwGIlDZaJ6HPoADlbapWfL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8ift7IX88zMLQ297OveufcU8af3cQC9IhGATnAfYApK5PHyL6h0JOnnC73xX62+P/d55AKf9+k7Y/NIgHqeEBAsKP3oCm7s/KpxL04kHPA2MMt7vhgrEHwL93CEgAM9WN/W7EXno+YuQmI6S3Hncn0Ff23yBVFwgEAoFAIBAIBAKBQCAQCAQCwb/24JAAAAAAQND/166wAQAAAAAAAAAAAAAAAAAAAAAAswCsVemaah0CHgAAAABJRU5ErkJggg==",contracts:{router:{address:"0x10ED43C718714eb63d5aA57B78B54704E256024E",api:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},factory:{address:"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73",api:[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[],name:"INIT_CODE_PAIR_HASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},pair:{api:[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]}}};function DL(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}let jL=t=>{let e=t.map(((e,n)=>e===qh.bsc.NATIVE&&t[n+1]!=qh.bsc.WRAPPED&&t[n-1]!=qh.bsc.WRAPPED?qh.bsc.WRAPPED:e));return e[0]==qh.bsc.NATIVE&&e[1]==qh.bsc.WRAPPED?e.splice(0,1):e[e.length-1]==qh.bsc.NATIVE&&e[e.length-2]==qh.bsc.WRAPPED&&e.splice(e.length-1,1),e},FL=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(Vy(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(Vy(e.toString(),o)),UL=async t=>{if(1==jL(t).length)return!1;let e=await $M({blockchain:"bsc",address:LL.contracts.factory.address,method:"getPair"},{api:LL.contracts.factory.api,cache:36e5,params:jL(t)});if(e==qh.bsc.ZERO)return!1;let[n,r,i]=await Promise.all([$M({blockchain:"bsc",address:e,method:"getReserves"},{api:LL.contracts.pair.api,cache:36e5}),$M({blockchain:"bsc",address:e,method:"token0"},{api:LL.contracts.pair.api,cache:36e5}),$M({blockchain:"bsc",address:e,method:"token1"},{api:LL.contracts.pair.api,cache:36e5})]);if(t.includes(qh.bsc.WRAPPED))return FL({min:1,token:qh.bsc.WRAPPED,decimals:qh.bsc.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(qh.bsc.USD)){let t=new _L({blockchain:"bsc",address:qh.bsc.USD}),e=await t.decimals();return FL({min:1e3,token:qh.bsc.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},zL=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{$M({blockchain:"bsc",address:LL.contracts.router.address,method:"getAmountsOut"},{api:LL.contracts.router.api,params:{amountIn:e,path:jL(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),HL=({path:t,amountOut:e,block:n})=>new Promise((r=>{$M({blockchain:"bsc",address:LL.contracts.router.address,method:"getAmountsIn"},{api:LL.contracts.router.api,params:{amountOut:e,path:jL(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))}));var WL=new kL(Object.assign(LL,{route:({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u})=>(e=BL(e),n=BL(n),new Promise((async l=>{let c=await(async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(qh.bsc.NATIVE)&&[t,e].includes(qh.bsc.WRAPPED))return;let n;return await UL([t,e])?n=[t,e]:t!=qh.bsc.WRAPPED&&await UL([t,qh.bsc.WRAPPED])&&e!=qh.bsc.WRAPPED&&await UL([e,qh.bsc.WRAPPED])?n=[t,qh.bsc.WRAPPED,e]:t!=qh.bsc.USD&&await UL([t,qh.bsc.USD])&&e!=qh.bsc.WRAPPED&&await UL([qh.bsc.WRAPPED,e])?n=[t,qh.bsc.USD,qh.bsc.WRAPPED,e]:t!=qh.bsc.WRAPPED&&await UL([t,qh.bsc.WRAPPED])&&e!=qh.bsc.USD&&await UL([qh.bsc.USD,e])&&(n=[t,qh.bsc.WRAPPED,qh.bsc.USD,e]),DL([n,"optionalAccess",t=>t.length])&&n[0]==qh.bsc.NATIVE?n.splice(1,0,qh.bsc.WRAPPED):DL([n,"optionalAccess",t=>t.length])&&n[n.length-1]==qh.bsc.NATIVE&&n.splice(n.length-1,0,qh.bsc.WRAPPED),n})({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,s,a,u];if(({amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u}=await(async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s})=>{if(r){if(null==(i=await HL({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await zL({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}else if(s){if(null==(i=await HL({path:t,amountOut:s,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await zL({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s}})({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u})),[o,a,s,u].every((t=>null==t)))return l();let m=(({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:s,amountInMaxInput:a,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"bsc",from:c,to:LL.contracts.router.address,api:LL.contracts.router.api};return t[0]===qh.bsc.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(s||a)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===qh.bsc.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:jL(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h})({path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new SL({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:m}))}))),getAmountIn:HL})),qL={blockchain:"polygon",name:"quickswap",alternativeNames:[],label:"QuickSwap",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAXVBMVEVHcEz////////////////////5+vwVHkEOH2UgKlMfKWkmL3E8RmwvXJZUWXxtcY45gsRBispRkc2Chp1fltBrnNN3otaanLCDqtqwscClxubFxdHL2uvl6vL////QD9cpAAAAB3RSTlMAHD9rl8L0VWZaUQAALS5JREFUeNrsnYt2mzgQhoMv+PisG9sYCMGI93/MlcRlkAQSBAkLmN9pNk3aHHe/ufwzktsvFAqFQqFQKBQKhUKhUCgUCoVCoVAoFAqFQqFWrSA4HI7H4+l0OjOFgvinTlT0VxwOwRdqM2LYTycGvBwtHhAnGgoBhsJ6FRxoujPucxTSQMCSsDZR9CzlS3sKeT34Qnkvxt4qejkMsBh4K6fsxSjAIPBNFP4C7Dsm8YQNwRsFhyUSXxUGgQ9aNvPVIMB28EEFx9Mn4beeAAvBJ/Th1MdC8FFR+qVnCs8YAwvJQ/oYA4sp8JU+xsACCnzq+8N+AD2hGx188PwYAx9SsBr6lbAVWNXB68aPZcCtguO6kh/LgFWtp/P3KcQQmCe/hz7jmSF2gp3W/krFu+4EGAJ78P2qft5gBr5Qe8Nflq8C/eCO8ZfkRtAP7hd/Wf5eCY4E+8VPO8BV+YOE6AV2g78Mb90AQDu4i8Gvq/flSt9jCEzRhvDTDnC5KZ/DvcBmt349HeDyPfjFE7rBTRz46TvA5VsTHhgCsvcrN6bX5XLv/hwHgt00/6YDXF71x2gFdlb96w5w+ak/Riuws+rPdG8DAPvA3qo/E7nSAPjlH2If2Fv1Z/q9UL35h9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ubp1rJJCcDpT7L+kSwEjjBgbxKQj37I2Z96/BdbBmzaAFGLpn++5MM/OAo+AqGRNEDe+wfg4pdJ/P9NAeAgsOBuYRQQ4w9/LvHvKQqig8BjFMTUANG1H/Hulk/8kw0CkTXg2Rew/szin3AQ2DAN3VX37ofk2M9u/Ms1As95oG9ZRwREYe5LsZ/h+BdsBJ7QBCMQFsFCfnebxMws1ccf/4sfcv9z23J466ScIPyr1+4mEvry3P7V9sEXJ+hbrBWQx7XtJU9+/vavMgYeuI+3TQVndLB9f+B+vEuTn23619sGXlQwDbdukcFXhbB/Q+upHyaxvFdI+tfcBv6A5j4Ot94LYSf2VQ90YDvyXeeZ1zj1eZc/sbLgX4QwjUOQgkfbttePaD26QPptGMbprkp8IelPPQv+G03T3D+g0We8vPRnwASsorDjb8QE7OBnKemvmkA9/tUE6vSvJlCPv/hDkUSQ+c1PnQM1/NU5UN2/zoHq/nUOVPevc6C6/6dzoBQJXKr7lxwF6vD/VxTIXgLNjzr8C06DTc1+JUug0l+0BCr9RUug0l90HKz0f0cC2fQCNfkXXQ1dKv2/2rF3LYRiEIiikgT+/5MFtbB0aR5wPbvUcgaC/lCBXv0Y4E/f2+1/70EbxD9B1WOA3T9NwZeA4Z+s1hpg+Feo0gGGf5kCTwHpL5a6AzZY/Ru0nB0g/Y18D+S6B0h/O+lpbkIdjfRPkDaOPwamnavvpKOLgNHPofX9m8CUVz8V2VgCY/JzkvWrIAaf8FOLFiz5jUj2hUQL5tXgGT3ZlyOvHtjXwesg+vq8B61HE/STLpjpI3eCvx7xKngXvAxB38UH/oV/Te4AAAAAAAAAAAAALuEOW2gZr0akk1cAAAAASUVORK5CYII=",contracts:{router:{address:"0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff",api:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"amountADesired",type:"uint256"},{internalType:"uint256",name:"amountBDesired",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountTokenDesired",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"addLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"},{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"reserveIn",type:"uint256"},{internalType:"uint256",name:"reserveOut",type:"uint256"}],name:"getAmountOut",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsIn",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"}],name:"getAmountsOut",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"reserveA",type:"uint256"},{internalType:"uint256",name:"reserveB",type:"uint256"}],name:"quote",outputs:[{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidity",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETH",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"removeLiquidityETHSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermit",outputs:[{internalType:"uint256",name:"amountToken",type:"uint256"},{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountTokenMin",type:"uint256"},{internalType:"uint256",name:"amountETHMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",outputs:[{internalType:"uint256",name:"amountETH",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"},{internalType:"uint256",name:"liquidity",type:"uint256"},{internalType:"uint256",name:"amountAMin",type:"uint256"},{internalType:"uint256",name:"amountBMin",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bool",name:"approveMax",type:"bool"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"removeLiquidityWithPermit",outputs:[{internalType:"uint256",name:"amountA",type:"uint256"},{internalType:"uint256",name:"amountB",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapETHForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactETHForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForETHSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapExactTokensForTokensSupportingFeeOnTransferTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactETH",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMax",type:"uint256"},{internalType:"address[]",name:"path",type:"address[]"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapTokensForExactTokens",outputs:[{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},factory:{address:"0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",api:[{inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token0",type:"address"},{indexed:!0,internalType:"address",name:"token1",type:"address"},{indexed:!1,internalType:"address",name:"pair",type:"address"},{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"PairCreated",type:"event"},{constant:!0,inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"allPairs",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allPairsLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"tokenA",type:"address"},{internalType:"address",name:"tokenB",type:"address"}],name:"createPair",outputs:[{internalType:"address",name:"pair",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeTo",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"feeToSetter",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"getPair",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeTo",type:"address"}],name:"setFeeTo",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_feeToSetter",type:"address"}],name:"setFeeToSetter",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},pair:{api:[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"_reserve0",type:"uint112"},{internalType:"uint112",name:"_reserve1",type:"uint112"},{internalType:"uint32",name:"_blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"_token0",type:"address"},{internalType:"address",name:"_token1",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]}}};function GL(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}let QL=t=>{let e=t.map(((e,n)=>e===qh.polygon.NATIVE&&t[n+1]!=qh.polygon.WRAPPED&&t[n-1]!=qh.polygon.WRAPPED?qh.polygon.WRAPPED:e));return e[0]==qh.polygon.NATIVE&&e[1]==qh.polygon.WRAPPED?e.splice(0,1):e[e.length-1]==qh.polygon.NATIVE&&e[e.length-2]==qh.polygon.WRAPPED&&e.splice(e.length-1,1),e},VL=({reserves:t,min:e,token:n,token0:r,token1:i,decimals:o})=>r.toLowerCase()==n.toLowerCase()?t[0].gte(Vy(e.toString(),o)):i.toLowerCase()==n.toLowerCase()&&t[1].gte(Vy(e.toString(),o)),YL=async t=>{if(1==QL(t).length)return!1;let e=await $M({blockchain:"polygon",address:qL.contracts.factory.address,method:"getPair"},{api:qL.contracts.factory.api,cache:36e5,params:QL(t)});if(e==qh.polygon.ZERO)return!1;let[n,r,i]=await Promise.all([$M({blockchain:"polygon",address:e,method:"getReserves"},{api:qL.contracts.pair.api,cache:36e5}),$M({blockchain:"polygon",address:e,method:"token0"},{api:qL.contracts.pair.api,cache:36e5}),$M({blockchain:"polygon",address:e,method:"token1"},{api:qL.contracts.pair.api,cache:36e5})]);if(t.includes(qh.polygon.WRAPPED))return VL({min:1,token:qh.polygon.WRAPPED,decimals:qh.polygon.DECIMALS,reserves:n,token0:r,token1:i});if(t.includes(qh.polygon.USD)){let t=new _L({blockchain:"polygon",address:qh.polygon.USD}),e=await t.decimals();return VL({min:1e3,token:qh.polygon.USD,decimals:e,reserves:n,token0:r,token1:i})}return!0},JL=({path:t,amountIn:e,tokenIn:n,tokenOut:r})=>new Promise((n=>{$M({blockchain:"polygon",address:qL.contracts.router.address,method:"getAmountsOut"},{api:qL.contracts.router.api,params:{amountIn:e,path:QL(t)}}).then((t=>{n(t[t.length-1])})).catch((()=>n()))})),ZL=({path:t,amountOut:e,block:n})=>new Promise((r=>{$M({blockchain:"polygon",address:qL.contracts.router.address,method:"getAmountsIn"},{api:qL.contracts.router.api,params:{amountOut:e,path:QL(t)},block:n}).then((t=>r(t[0]))).catch((()=>r()))})),KL=[OL,WL,new kL(Object.assign(qL,{route:({exchange:t,tokenIn:e,tokenOut:n,fromAddress:r,toAddress:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u})=>(e=BL(e),n=BL(n),new Promise((async l=>{let c=await(async({tokenIn:t,tokenOut:e})=>{if([t,e].includes(qh.polygon.NATIVE)&&[t,e].includes(qh.polygon.WRAPPED))return;let n;return await YL([t,e])?n=[t,e]:t!=qh.polygon.WRAPPED&&await YL([t,qh.polygon.WRAPPED])&&e!=qh.polygon.WRAPPED&&await YL([e,qh.polygon.WRAPPED])?n=[t,qh.polygon.WRAPPED,e]:t!=qh.polygon.USD&&await YL([t,qh.polygon.USD])&&e!=qh.polygon.WRAPPED&&await YL([qh.polygon.WRAPPED,e])?n=[t,qh.polygon.USD,qh.polygon.WRAPPED,e]:t!=qh.polygon.WRAPPED&&await YL([t,qh.polygon.WRAPPED])&&e!=qh.polygon.USD&&await YL([qh.polygon.USD,e])&&(n=[t,qh.polygon.WRAPPED,qh.polygon.USD,e]),GL([n,"optionalAccess",t=>t.length])&&n[0]==qh.polygon.NATIVE?n.splice(1,0,qh.polygon.WRAPPED):GL([n,"optionalAccess",t=>t.length])&&n[n.length-1]==qh.polygon.NATIVE&&n.splice(n.length-1,0,qh.polygon.WRAPPED),n})({tokenIn:e,tokenOut:n});if(void 0===c||0==c.length)return l();let[h,f,d,p]=[o,s,a,u];if(({amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u}=await(async({path:t,tokenIn:e,tokenOut:n,amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s})=>{if(r){if(null==(i=await ZL({path:t,amountOut:r,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(i){if(null==(r=await JL({path:t,amountIn:i,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}else if(s){if(null==(i=await ZL({path:t,amountOut:s,tokenIn:e,tokenOut:n}))||o&&i.gt(o))return{};void 0===o&&(o=i)}else if(o){if(null==(r=await JL({path:t,amountIn:o,tokenIn:e,tokenOut:n}))||s&&r.lt(s))return{};void 0===s&&(s=r)}return{amountOut:r,amountIn:i,amountInMax:o,amountOutMin:s}})({path:c,tokenIn:e,tokenOut:n,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u})),[o,a,s,u].every((t=>null==t)))return l();let m=(({path:t,amountIn:e,amountInMax:n,amountOut:r,amountOutMin:i,amountInInput:o,amountOutInput:s,amountInMaxInput:a,amountOutMinInput:u,toAddress:l,fromAddress:c})=>{let h={blockchain:"polygon",from:c,to:qL.contracts.router.address,api:qL.contracts.router.api};return t[0]===qh.polygon.NATIVE?o||u?(h.method="swapExactETHForTokens",h.value=e.toString(),h.params={amountOutMin:i.toString()}):(s||a)&&(h.method="swapETHForExactTokens",h.value=n.toString(),h.params={amountOut:r.toString()}):t[t.length-1]===qh.polygon.NATIVE?o||u?(h.method="swapExactTokensForETH",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactETH",h.params={amountInMax:n.toString(),amountOut:r.toString()}):o||u?(h.method="swapExactTokensForTokens",h.params={amountIn:e.toString(),amountOutMin:i.toString()}):(s||a)&&(h.method="swapTokensForExactTokens",h.params={amountInMax:n.toString(),amountOut:r.toString()}),h.params=Object.assign({},h.params,{path:QL(t),to:l,deadline:Math.round(Date.now()/1e3)+1800}),h})({path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,amountInInput:h,amountOutInput:f,amountInMaxInput:d,amountOutMinInput:p,toAddress:i,fromAddress:r});l(new SL({tokenIn:e,tokenOut:n,path:c,amountIn:o,amountInMax:a,amountOut:s,amountOutMin:u,fromAddress:r,toAddress:i,exchange:t,transaction:m}))}))),getAmountIn:ZL}))],XL=({blockchain:t,fromAddress:e,toAddress:n,tokenIn:r,tokenOut:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u,amountOutMax:l,amountInMin:c})=>Promise.all(KL.map((h=>h.blockchain!==t?null:h.route({fromAddress:e,toAddress:n,tokenIn:r,tokenOut:i,amountIn:o,amountOut:s,amountInMax:a,amountOutMin:u,amountOutMax:l,amountInMin:c})))).then((t=>t.filter(Boolean)));var $L=function(t){var e=function(t){return!t.every((function(t){return void 0!==t.amount||void 0!==t.fromAmount}))},n=V.useContext(IB),i=n.amount;n.toAmount;var o,s=n.recover,a=f(V.useState(null==s&&e(t.accept)),2),u=a[0],l=a[1],c=V.useContext(DB).account,h=V.useContext(NB),d=h.conversionRate,p=h.fixedCurrencyConversionRate,m=V.useContext(iB).setError,g=f(V.useState(),2),y=g[0],v=g[1],b=f(V.useState("object"==r(i)&&i.fix&&i.currency?i.fix:null),1)[0],w=f(V.useState("object"==r(i)&&i.fix&&i.currency?i.currency:null),1)[0];u&&(o="object"==r(i)&&i.start&&i.start?i.start:"object"==r(i)&&i.fix?i.fix:1);var A=f(V.useState(o),2),_=A[0],E=A[1],M=f(V.useState(),2),k=M[0],x=M[1],S=f(V.useState(),2),C=S[0],T=S[1];V.useEffect((function(){s||l(e(t.accept))}),[t.accept,s]);var I=function(e){var n=e.amount,r=e.conversionRate,o=e.fixedCurrencyConversionRate;return new Promise((function(e,s){i&&i.token?e(t.accept.map((function(){return n}))):Promise.all(t.accept.map((function(t){return b?qh[t.blockchain].USD.toLowerCase()==t.token.toLowerCase()?1/o*b:XL({blockchain:t.blockchain,tokenIn:qh[t.blockchain].USD,amountIn:1/o*b,tokenOut:t.token,fromAddress:c,toAddress:c}):qh[t.blockchain].USD.toLowerCase()==t.token.toLowerCase()?1/r*n:XL({blockchain:t.blockchain,tokenIn:qh[t.blockchain].USD,amountIn:1/r*n,tokenOut:t.token,fromAddress:c,toAddress:c})}))).then((function(n){Promise.all(n.map((function(e,n){return"number"==typeof e?e:null==e[0]?void 0:_L.readable({blockchain:t.accept[n].blockchain,amount:e[0].amountOut,address:e[0].tokenOut})}))).then(e).catch(m)})).catch(m)}))},N=V.useCallback(jB.debounce((function(e){var n=e.account,r=e.amount,i=e.conversionRate,o=e.fixedCurrencyConversionRate;I({amount:r,conversionRate:i,fixedCurrencyConversionRate:o}).then((function(e){v(t.accept.map((function(t,r){if(null!=e[r])return{blockchain:t.blockchain,amount:LB(e[r]),token:t.token,receiver:t.receiver||n}})).filter((function(t){return!!t})))})).catch(m)}),500),[]);return V.useEffect((function(){s||u&&c&&d&&(!b||p)&&N({account:c,amount:_,conversionRate:d,fixedCurrencyConversionRate:p})}),[u,c,d,b,p,_,s]),V.useEffect((function(){u&&k?k.fromToken.readable(k.fromBalance).then((function(t){if(i&&i.token)XL({blockchain:k.blockchain,tokenIn:k.fromToken.address,tokenOut:k.toToken.address,amountIn:parseFloat(t),fromAddress:c,toAddress:c}).then((function(t){null!=t[0]?_L.readable({amount:t[0].amountOut,blockchain:k.blockchain,address:k.toToken.address}).then((function(t){var e=parseFloat(new vL(t).div(1.01).mul(d).toString());T(e>10?Math.round(e-1):LB(e-1))})).catch(m):_L.readable({amount:k.fromBalance,blockchain:k.blockchain,address:k.toToken.address}).then(T)})).catch(m);else if(k.fromToken.address==qh[k.blockchain].USD){var e=parseFloat(new vL(t).mul(d).toString());T(e>10?Math.round(e-1):e-1)}else XL({blockchain:k.blockchain,tokenIn:k.fromToken.address,tokenOut:qh[k.blockchain].USD,amountIn:parseFloat(t),fromAddress:c,toAddress:c}).then((function(t){null!=t[0]&&_L.readable({amount:t[0].amountOut,blockchain:k.blockchain,address:qh[k.blockchain].USD}).then((function(t){var e=parseFloat(new vL(t).div(1.01).mul(d).toString());T(e>10?Math.round(e):LB(e))})).catch(m)})).catch(m)})).catch(m):T(100)}),[c,k]),V.createElement(TB.Provider,{value:{amountsMissing:u,fixedAmount:b,fixedCurrency:w,acceptWithAmount:y,amount:_,setAmount:E,setMaxRoute:x,maxAmount:C}},t.children)},tD={"Pacific/Midway":"USD","Pacific/Niue":"NZD","Pacific/Pago_Pago":"USD","America/Adak":"USD","Pacific/Honolulu":"USD","Pacific/Rarotonga":"NZD","Pacific/Tahiti":"XPF","Pacific/Marquesas":"XPF","America/Anchorage":"USD","America/Juneau":"USD","America/Metlakatla":"USD","America/Nome":"USD","America/Sitka":"USD","America/Yakutat":"USD","Pacific/Gambier":"XPF","America/Los_Angeles":"USD","America/Tijuana":"MXN","America/Vancouver":"CAD","Pacific/Pitcairn":"NZD","America/Boise":"USD","America/Cambridge_Bay":"CAD","America/Chihuahua":"MXN","America/Creston":"CAD","America/Dawson":"CAD","America/Dawson_Creek":"CAD","America/Denver":"USD","America/Edmonton":"CAD","America/Fort_Nelson":"CAD","America/Hermosillo":"MXN","America/Inuvik":"CAD","America/Mazatlan":"MXN","America/Ojinaga":"MXN","America/Phoenix":"USD","America/Whitehorse":"CAD","America/Yellowknife":"CAD","America/Bahia_Banderas":"MXN","America/Belize":"BZD","America/Chicago":"USD","America/Costa_Rica":"CRC","America/El_Salvador":"USD","America/Guatemala":"GTQ","America/Indiana/Knox":"USD","America/Indiana/Tell_City":"USD","America/Managua":"NIO","America/Matamoros":"MXN","America/Menominee":"USD","America/Merida":"MXN","America/Mexico_City":"MXN","America/Monterrey":"MXN","America/North_Dakota/Beulah":"USD","America/North_Dakota/Center":"USD","America/North_Dakota/New_Salem":"USD","America/Rainy_River":"CAD","America/Rankin_Inlet":"CAD","America/Regina":"CAD","America/Resolute":"CAD","America/Swift_Current":"CAD","America/Tegucigalpa":"HNL","America/Winnipeg":"CAD","Pacific/Easter":"CLP","Pacific/Galapagos":"USD","America/Atikokan":"CAD","America/Bogota":"COP","America/Cancun":"MXN","America/Cayman":"KYD","America/Detroit":"USD","America/Eirunepe":"BRL","America/Grand_Turk":"USD","America/Guayaquil":"USD","America/Havana":"CUP","America/Indiana/Indianapolis":"USD","America/Indiana/Marengo":"USD","America/Indiana/Petersburg":"USD","America/Indiana/Vevay":"USD","America/Indiana/Vincennes":"USD","America/Indiana/Winamac":"USD","America/Iqaluit":"CAD","America/Jamaica":"JMD","America/Kentucky/Louisville":"USD","America/Kentucky/Monticello":"USD","America/Lima":"PEN","America/Nassau":"BSD","America/New_York":"USD","America/Nipigon":"CAD","America/Panama":"PAB","America/Pangnirtung":"CAD","America/Port-au-Prince":"HTG","America/Rio_Branco":"BRL","America/Thunder_Bay":"CAD","America/Toronto":"CAD","America/AnguillaSandy Hill":"XCD","America/Antigua":"XCD","America/Aruba":"AWG","America/Asuncion":"PYG","America/Barbados":"BBD","America/Blanc-Sablon":"CAD","America/Boa_Vista":"BRL","America/Campo_Grande":"BRL","America/Caracas":"VEB","America/Cuiaba":"BRL","America/Curacao":"ANG","America/Dominica":"DOP","America/Glace_Bay":"CAD","America/Goose_Bay":"CAD","America/Grenada":"XCD","America/Guadeloupe":"EUR","America/Guyana":"GYD","America/Halifax":"CAD","America/Kralendijk":"USD","America/La_Paz":"BOB","America/Lower_Princes":"USD","America/Manaus":"BRL","America/Marigot":"EUR","America/Martinique":"EUR","America/Moncton":"CAD","America/Montserrat":"XCD","America/Porto_Velho":"BRL","America/Port_of_Spain":"BZD","America/Puerto_Rico":"USD","America/Santiago":"CLP","America/Santo_Domingo":"DOP","America/St_Barthelemy":"EUR","America/St_Kitts":"XCD","America/St_Lucia":"XCD","America/St_Thomas":"USD","America/St_Vincent":"XCD","America/Thule":"DKK","America/Tortola":"USD","Atlantic/Bermuda":"BMD","America/St_Johns":"CAD","America/Araguaina":"BRL","America/Argentina/Buenos_Aires":"ARS","America/Argentina/Catamarca":"ARS","America/Argentina/Cordoba":"ARS","America/Argentina/Jujuy":"ARS","America/Argentina/La_Rioja":"ARS","America/Argentina/Mendoza":"ARS","America/Argentina/Rio_Gallegos":"ARS","America/Argentina/Salta":"ARS","America/Argentina/San_Juan":"ARS","America/Argentina/San_Luis":"ARS","America/Argentina/Tucuman":"ARS","America/Argentina/Ushuaia":"ARS","America/Bahia":"BRL","America/Belem":"BRL","America/Cayenne":"EUR","America/Fortaleza":"BRL","America/Godthab":"DKK","America/Maceio":"BRL","America/Miquelon":"EUR","America/Montevideo":"UYU","America/Paramaribo":"SRD","America/Punta_Arenas":"CLP","America/Recife":"BRL","America/Santarem":"BRL","America/Sao_Paulo":"BRL","Antarctica/Palmer":"USD","Antarctica/Rothera":"USD","Atlantic/Stanley":"FKP","America/Noronha":"BRL","Atlantic/South_Georgia":"GBP","America/Scoresbysund":"DKK","Atlantic/Azores":"EUR","Atlantic/Cape_Verde":"CVE","Africa/Abidjan":"XOF","Africa/Accra":"GHC","Africa/Bamako":"XOF","Africa/Banjul":"GMD","Africa/Bissau":"XOF","Africa/Casablanca":"MAD","Africa/Conakry":"GNF","Africa/Dakar":"XOF","Africa/El_Aaiun":"MAD","Africa/Freetown":"SLL","Africa/Lome":"XOF","Africa/Monrovia":"LRD","Africa/Nouakchott":"MRU","Africa/Ouagadougou":"XOF","Africa/Sao_Tome":"STD","America/Danmarkshavn":"DKK","Antarctica/Troll":"NOK","Atlantic/Canary":"EUR","Atlantic/Faroe":"DKK","Atlantic/Madeira":"EUR","Atlantic/Reykjavik":"ISK","Atlantic/St_Helena":"SHP","Europe/Dublin":"EUR","Europe/Guernsey":"GBP","Europe/Isle_of_Man":"IMP","Europe/Jersey":"GBP","Europe/Lisbon":"EUR","Europe/London":"GBP","Africa/Algiers":"DZD","Africa/Bangui":"XAF","Africa/Brazzaville":"XAF","Africa/Ceuta":"EUR","Africa/Douala":"XAF","Africa/Kinshasa":"CDF","Africa/Lagos":"NGN","Africa/Libreville":"XAF","Africa/Luanda":"AOA","Africa/Malabo":"XAF","Africa/Ndjamena":"XAF","Africa/Niamey":"XOF","Africa/Porto-Novo":"XOF","Africa/Tunis":"TND","Africa/Windhoek":"NAD","Arctic/Longyearbyen":"NOK","Europe/Amsterdam":"EUR","Europe/Andorra":"EUR","Europe/Belgrade":"RSD","Europe/Berlin":"EUR","Europe/Bratislava":"EUR","Europe/Brussels":"EUR","Europe/Budapest":"HUF","Europe/Copenhagen":"DKK","Europe/Gibraltar":"GIP","Europe/Ljubljana":"EUR","Europe/Luxembourg":"EUR","Europe/Madrid":"EUR","Europe/Malta":"EUR","Europe/Monaco":"EUR","Europe/Oslo":"NOK","Europe/Paris":"EUR","Europe/Podgorica":"EUR","Europe/Prague":"CZK","Europe/Rome":"EUR","Europe/San_Marino":"EUR","Europe/Sarajevo":"BAM","Europe/Skopje":"MKD","Europe/Stockholm":"SEK","Europe/Tirane":"ALL","Europe/Vaduz":"CHF","Europe/Vatican":"EUR","Europe/Vienna":"EUR","Europe/Warsaw":"PLN","Europe/Zagreb":"HRK","Europe/Zurich":"CHF","Africa/Blantyre":"MWK","Africa/Bujumbura":"BIF","Africa/Cairo":"EGP","Africa/Gaborone":"BWP","Africa/Harare":"ZWL","Africa/Johannesburg":"ZAR","Africa/Juba":"SSP","Africa/Khartoum":"SDG","Africa/Kigali":"RWF","Africa/Lubumbashi":"CDF","Africa/Lusaka":"ZMW","Africa/Maputo":"MZM","Africa/Maseru":"LSL","Africa/Mbabane":"SZL","Africa/Tripoli":"LYD","Asia/Amman":"JOD","Asia/Beirut":"LBP","Asia/Damascus":"SYP","Asia/Famagusta":"TRY","Asia/Gaza":"ILS","Asia/Hebron":"ILS","Asia/Jerusalem":"ILS","Asia/Nicosia":"EUR","Europe/Athens":"EUR","Europe/Bucharest":"RON","Europe/Chisinau":"MDL","Europe/Helsinki":"EUR","Europe/Kaliningrad":"RUB","Europe/Kiev":"UAH","Europe/Mariehamn":"EUR","Europe/Riga":"EUR","Europe/Sofia":"BGN","Europe/Tallinn":"EUR","Europe/Uzhgorod":"UAH","Europe/Vilnius":"EUR","Europe/Zaporozhye":"UAH","Africa/Addis_Ababa":"ETB","Africa/Asmara":"ERN","Africa/Dar_es_Salaam":"TZS","Africa/Djibouti":"DJF","Africa/Kampala":"UGX","Africa/Mogadishu":"SOS","Africa/Nairobi":"KES","Antarctica/Syowa":"EUR","Asia/Aden":"YER","Asia/Baghdad":"IQD","Asia/Bahrain":"BHD","Asia/Kuwait":"KWD","Asia/Qatar":"QAR","Asia/Riyadh":"SAR","Europe/Istanbul":"TRY","Europe/Kirov":"RUB","Europe/Minsk":"BYN","Europe/Moscow":"RUB","Europe/Simferopol":"RUB","Europe/Volgograd":"RUB","Indian/Antananarivo":"MGA","Indian/Comoro":"USD","Indian/Mayotte":"EUR","Asia/Tehran":"IRR","Asia/Baku":"AZN","Asia/Dubai":"AED","Asia/Muscat":"OMR","Asia/Tbilisi":"GEL","Asia/Yerevan":"AMD","Europe/Astrakhan":"RUB","Europe/Samara":"RUB","Europe/Saratov":"RUB","Europe/Ulyanovsk":"RUB","Indian/Mahe":"SCR","Indian/Mauritius":"MUR","Indian/Reunion":"EUR","Asia/Kabul":"AFN","Antarctica/Mawson":"USD","Asia/Aqtau":"KZT","Asia/Aqtobe":"KZT","Asia/Ashgabat":"TMM","Asia/Atyrau":"KZT","Asia/Dushanbe":"TJS","Asia/Karachi":"PKR","Asia/Oral":"KZT","Asia/Qyzylorda":"KZT","Asia/Samarkand":"UZS","Asia/Tashkent":"UZS","Asia/Yekaterinburg":"RUB","Indian/Kerguelen":"EUR","Indian/Maldives":"MVR","Asia/Colombo":"LKR","Asia/Kolkata":"INR","Asia/Kathmandu":"NPR","Antarctica/Vostok":"USD","Asia/Almaty":"KZT","Asia/Bishkek":"KGS","Asia/Dhaka":"BDT","Asia/Omsk":"RUB","Asia/Qostanay":"KZT","Asia/Thimphu":"BTN","Asia/Urumqi":"CNY","Indian/Chagos":"USD","Asia/Yangon":"MMK","Indian/Cocos":"AUD","Antarctica/Davis":"USD","Asia/Bangkok":"THB","Asia/Barnaul":"RUB","Asia/Hovd":"MNT","Asia/Ho_Chi_Minh":"VND","Asia/Jakarta":"IDR","Asia/Krasnoyarsk":"RUB","Asia/Novokuznetsk":"RUB","Asia/Novosibirsk":"RUB","Asia/Phnom_Penh":"KHR","Asia/Pontianak":"IDR","Asia/Tomsk":"RUB","Asia/Vientiane":"LAK","Indian/Christmas":"AUD","Asia/Brunei":"BND","Asia/Choibalsan":"MNT","Asia/Hong_Kong":"HKD","Asia/Irkutsk":"RUB","Asia/Kuala_Lumpur":"MYR","Asia/Kuching":"MYR","Asia/Macau":"MOP","Asia/Makassar":"IDR","Asia/Manila":"PHP","Asia/Shanghai":"CNY","Asia/Singapore":"SGD","Asia/Taipei":"TWD","Asia/Ulaanbaatar":"MNT","Australia/Perth":"AUD","Australia/Eucla":"AUD","Asia/Chita":"RUB","Asia/Dili":"USD","Asia/Jayapura":"IDR","Asia/Khandyga":"RUB","Asia/Pyongyang":"KPW","Asia/Seoul":"KRW","Asia/Tokyo":"JPY","Asia/Yakutsk":"RUB","Pacific/Palau":"USD","Australia/Adelaide":"AUD","Australia/Broken_Hill":"AUD","Australia/Darwin":"AUD","Antarctica/DumontDUrville":"USD","Antarctica/Macquarie":"USD","Asia/Ust-Nera":"RUB","Asia/Vladivostok":"RUB","Australia/Brisbane":"AUD","Australia/Currie":"AUD","Australia/Hobart":"AUD","Australia/Lindeman":"AUD","Australia/Melbourne":"AUD","Australia/Sydney":"AUD","Pacific/Chuuk":"USD","Pacific/GuamVillage":"USD","Pacific/Port_Moresby":"PGK","Pacific/Saipan":"USD","Australia/Lord_Howe":"AUD","Antarctica/Casey":"USD","Asia/Magadan":"RUB","Asia/Sakhalin":"RUB","Asia/Srednekolymsk":"RUB","Pacific/Bougainville":"PGK","Pacific/Efate":"VUV","Pacific/Guadalcanal":"SBD","Pacific/Kosrae":"USD","Pacific/Norfolk":"USD","Pacific/Noumea":"XPF","Pacific/Pohnpei":"USD","Antarctica/McMurdo":"USD","Asia/Anadyr":"RUB","Asia/Kamchatka":"RUB","Pacific/Auckland":"NZD","Pacific/Fiji":"FJD","Pacific/Funafuti":"AUD","Pacific/Kwajalein":"USD","Pacific/Majuro":"USD","Pacific/Nauru":"AUD","Pacific/Tarawa":"AUD","Pacific/Wake":"USD","Pacific/Wallis":"XPF","Pacific/Chatham":"CAD","Pacific/Apia":"NGN","Pacific/Enderbury":"USD","Pacific/Fakaofo":"NZD","Pacific/Tongatapu":"TOP","Pacific/Kiritimati":"AUD"};class eD{constructor({amount:t,code:e,timeZone:n=eD.timeZone()}){this.amount=t,this.code=e||window._LocalCurrencyCode||eD.getCode(n),this.timeZone=n}static getCode(t){return window._LocalCurrencyCode||tD[t||eD.timeZone()]||"USD"}static async rate({from:t,to:e}){null==e&&(e=eD.getCode());let n=await eD.fromUSD({amount:1,code:t}),r=await eD.fromUSD({amount:1,code:e});return n.amount/r.amount}static async fromUSD({amount:t,code:e,timeZone:n}){let r=new eD({amount:t,code:e,timeZone:n}),i=await fetch("https://public.depay.com/currencies/"+r.code).then((t=>t.json())).then((t=>parseFloat(t))).catch((()=>(r.code="USD",1)));return r.amount=r.amount*i,r}static timeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}toString(t={}){return new Intl.NumberFormat(navigator.language,{...t,style:"currency",currency:this.code}).format(this.amount)}}var nD=function(t){var e=new eD({code:t.configuration.currency}).code;return V.useEffect((function(){null!=t.configuration.providers&&Object.entries(t.configuration.providers).forEach((function(t){((t,e)=>{switch(t){case"ethereum":return LM(e);case"bsc":return NM(e);case"polygon":return UM(e);default:throw"Unknown blockchain: "+t}})(t[0],t[1])}))}),[t.configuration]),V.createElement(IB.Provider,{value:Object.assign({},t.configuration,{currencyCode:e})},t.children)},rD=function(t){V.useContext(iB).setError;var e=V.useContext(IB),n=e.amount,i=e.currency,o=f(V.useState(),2),s=o[0],a=o[1],u=f(V.useState(),2),l=u[0],c=u[1];return V.useEffect((function(){"object"==r(n)&&n.currency&&eD.fromUSD({amount:1,code:n.currency}).then((function(t){return c(t.amount)})),eD.fromUSD({amount:1,code:i}).then((function(t){return a(t.amount)})).catch(a(1))}),[]),V.createElement(NB.Provider,{value:{conversionRate:s,fixedCurrencyConversionRate:l}},t.children)},iD=V.createContext(),oD=V.createContext(),sD=function(){var t=V.useContext(Y).close;return V.createElement(hh,{header:V.createElement("div",{className:"PaddingTopS PaddingLeftM PaddingRightM"}),body:V.createElement("div",{className:"TextCenter"},V.createElement("div",{className:"GraphicWrapper"},V.createElement("img",{className:"Graphic",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAHQCAMAAADgcCJ6AAAAXVBMVEVHcEwiGxq6jYEwExPTf2RKx+4uEhLSf2PSfmMvEhJKx+7UgWYvEhIvEhJOJyJrOzGHTkCdX023Y07Ab1bOd1/SgGPXhWhKx+7gm3roq5j/u6nx3mbu1MT37OL///+EeM1aAAAADXRSTlMADSZ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",{className:"LineHeightL Text FontSizeL PaddingTopS FontWeightBold"},"Insufficient Balance"),V.createElement("div",{className:"Text PaddingTopS PaddingBottomM PaddingLeftM PaddingRightM"},V.createElement("strong",{className:"FontSizeM"},"We were not able to find any asset with enough value in your wallet. Please top up your account in order to proceed with this payment."))),footer:V.createElement("div",{className:"PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"},V.createElement("button",{className:"ButtonPrimary",onClick:t},"Ok"))})},aD=V.createContext(),uD=V.createContext(),lD=V.createContext(),cD=V.createContext(),hD=function(t){var e=V.useContext(iB).setError,r=V.useContext(IB),i=r.sent,o=r.confirmed,s=r.failed,a=r.recover,u=r.before,c=V.useContext(uD),h=c.selectedRoute;c.getPaymentRoutes;var d=V.useContext(Y),p=d.open,m=d.close,g=d.setClosable,y=V.useContext(uD).allRoutes,v=V.useContext(J).setUpdatable,b=V.useContext(oD),w=b.navigate,A=b.set,_=V.useContext(DB).wallet,E=V.useContext(lD),M=E.release,k=E.tracking,x=E.initializeTracking,S=V.useContext(cD),C=S.foundTransaction,T=S.initializeTracking,I=f(V.useState(),2),N=I[0],P=I[1],R=f(V.useState(),2),B=R[0],O=R[1],L=f(V.useState(),2),D=L[0],j=L[1],F=f(V.useState("initialized"),2),U=F[0],z=F[1],H=function(t){1!=k&&g(!0),z("confirmed"),o&&o(t)},W=function(t,e){s&&s(t,e),g(!0),A(["PaymentError"])},q=function(){var t=n(l.mark((function t(){var e;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u){t.next=6;break}return t.next=3,u(N.route.transaction);case 3:if(!1!==t.sent){t.next=6;break}return t.abrupt("return");case 6:return g(!1),z("paying"),v(!1),t.next=11,$M({blockchain:N.route.transaction.blockchain,method:"latestBlockNumber"});case 11:e=t.sent,_.sendTransaction(Object.assign({},N.route.transaction,{sent:function(t){T(t,e),i&&i(t)},confirmed:H,failed:W})).then((function(t){x(t,e,N.route),O(t)})).catch((function(t){console.log("error",t),z("initialized"),g(!0),v(!0),"WRONG_NETWORK"==(null==t?void 0:t.code)&&w("WrongNetwork")}));case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return V.useEffect((function(){M&&z("confirmed")}),[M]),V.useEffect((function(){if(a){g(!1),v(!1),z("paying"),O({blockchain:a.blockchain,id:a.transaction,url:Wh(a.blockchain).explorerUrlFor({transaction:{id:a.transaction}})});var t=new _L({blockchain:a.blockchain,address:a.token});Promise.all([t.name(),t.symbol()]).then((function(t){var e=f(t,2),n=e[0],r=e[1];P({blockchain:a.blockchain,token:a.token,name:n,symbol:r.toUpperCase(),amount:a.amount})})).catch(e)}}),[a]),V.useEffect((function(){var t;C&&C.id&&C.status&&(C.id.toLowerCase()!=B.id.toLowerCase()&&(t=Object.assign({},B,{id:C.id,url:Wh(B.blockchain).explorerUrlFor({transaction:C})}),O(t)),"success"==C.status?H(t||B):"failed"==C.status&&W(t||B))}),[C,B]),V.useEffect((function(){if(h){var t=h.fromToken;Promise.all([t.name(),t.symbol(),t.readable(h.fromAmount)]).then((function(e){var n=f(e,3),r=n[0],i=n[1],o=n[2];P({blockchain:h.blockchain,route:h,token:t.address,name:r,symbol:i.toUpperCase(),amount:o})})).catch(e)}else P(void 0)}),[h]),V.useEffect((function(){y&&0==y.length?v(!1):y&&y.length>0&&v(!0)}),[y]),y instanceof Array&&0==y.length?V.createElement(ch,{open:p,close:m,start:"NoPaymentMethodFound",container:t.container,document:t.document,dialogs:{NoPaymentMethodFound:V.createElement(sD,null)}}):V.createElement(aD.Provider,{value:{payment:N,paymentState:U,pay:q,transaction:B,approve:function(){g(!1),z("approving"),_.sendTransaction(Object.assign({},N.route.approvalTransaction,{confirmed:function(){N.route.approvalRequired=!1,P(N),g(!0),z("initialized")}})).then((function(t){j(t)})).catch((function(t){console.log("error",t),z("initialized"),g(!0)}))},approvalTransaction:D}},t.children)};function fD(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const dD=({assets:t,blockchain:e,options:n})=>n.only?t.filter((t=>(n.only[e]||[]).find((e=>e.toLowerCase()==t.address.toLowerCase())))):n.exclude?t.filter((t=>(n.exclude[e]||[]).find((e=>e.toLowerCase()!=t.address.toLowerCase())))):t;var pD=async t=>{void 0===t&&(t={accounts:{}});let e=Promise.all(Object.keys(t.accounts).map((e=>new Promise(((n,r)=>{const i=t.accounts[e],o=new AbortController;setTimeout((()=>o.abort()),1e4),fetch(`https://public.depay.com/accounts/${e}/${i}/assets`,{signal:o.signal}).catch((t=>{console.log(t),n([])})).then((t=>{if(t&&t.ok)return t.json();n([])})).then((async r=>{if(r&&r.length)return await(async({address:t,options:e,assets:n,blockchain:r})=>{if(e.only&&e.only[r]&&!e.only[r].find((t=>t.toLowerCase()==qh[r].NATIVE.toLowerCase())))return n;if(e.exclude&&e.exclude[r]&&e.exclude[r].find((t=>t.toLowerCase()==qh[r].NATIVE.toLowerCase())))return n;if(!n.find((t=>t.address.toLowerCase()==qh[r].NATIVE.toLowerCase()))){let e=await $M({blockchain:r,address:t,method:"balance"},{cache:3e4});n=[{name:qh[r].CURRENCY,symbol:qh[r].SYMBOL,address:qh[r].NATIVE,type:"NATIVE",blockchain:r,balance:e.toString()},...n]}return n})({address:i,options:t,assets:dD({assets:r,blockchain:e,options:t}).map((t=>Object.assign(t,{blockchain:e}))),blockchain:e});n([])})).then(n).catch((t=>{console.log(t),n([])}))}))))).then((t=>t.flat()));return e};const mD=(t,e)=>Object.assign({},{address:t.address,symbol:t.symbol,name:t.name,decimals:t.decimals,type:t.type,blockchain:t.blockchain},{balance:e.toString()}),gD=({assets:t,asset:e})=>!!t.find((t=>t.blockchain==e.blockchain&&t.address.toLowerCase()==e.address.toLowerCase())),yD=({options:t,address:e,blockchain:n})=>!(!(t&&t.only&&t.only[n])||t.only[n].find((t=>t.toLowerCase()==e.toLowerCase())))||!!(t&&t.exclude&&t.exclude[n]&&t.exclude[n].find((t=>t.toLowerCase()==e.toLowerCase()))),vD=t=>(t.params.path=t.params.path.filter(((e,n,r)=>!(1==n&&e==qh[t.blockchain].WRAPPED&&r[0]==qh[t.blockchain].NATIVE||n==r.length-2&&e==qh[t.blockchain].WRAPPED&&r[r.length-1]==qh[t.blockchain].NATIVE))),t),bD=(t,e)=>(t.params.data=[e.signature,e.params[0]],t),wD=(t,e)=>(t.params.data=[e.signature,e.params[1]],t.params.amounts[1]||(t.params.amounts[1]="0"),t.params.amounts[2]||(t.params.amounts[2]="0"),t.params.amounts[3]||(t.params.amounts[3]="0"),t.params.amounts[4]||(t.params.amounts[4]="0"),t.params.amounts[5]=e.params[0],t),AD=t=>{};var _D={ethereum:{payment:{address:"0x99F3F4685a7178F26EB4F4Ca8B75a1724F1577B9"},uniswap_v2:{address:"0xe04b08Dfc6CaA0F4Ec523a3Ae283Ece7efE00019",prepareTransaction:vD},paymentWithEvent:{address:"0xD8fBC10787b019fE4059Eb5AA5fB11a5862229EF"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0xF984eb8b466AD6c728E0aCc7b69Af6f69B32437F",prepareTransaction:bD},approveAndCallContractAddressPassedAmountBoolean:{address:"0x2D18c5A46cc1780d2460DD51B5d0996e55Fd2446",prepareTransaction:wD}},paymentFee:{address:"0x874Cb669D7BFff79d4A6A30F4ea52c5e413BD6A7",prepareTransaction:AD}},bsc:{payment:{address:"0x8B127D169D232D5F3ebE1C3D06CE343FD7C1AA11"},pancakeswap:{address:"0xAC3Ec4e420DD78bA86d932501E1f3867dbbfb77B",prepareTransaction:vD},paymentWithEvent:{address:"0x1869E236c03eE67B9FfEd3aCA139f4AeBA79Dc21"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0xd73dFeF8F9c213b449fB39B84c2b33FBBc2C8eD3",prepareTransaction:bD},approveAndCallContractAddressPassedAmountBoolean:{address:"0x7E655088214d0657251A51aDccE9109CFd23B5B5",prepareTransaction:wD}},paymentFee:{address:"0xae33f10AD57A38113f74FCdc1ffA6B1eC47B94E3",prepareTransaction:AD}},polygon:{payment:{address:"0x78C0F1c712A9AA2004C1F401A7307d8bCB62abBd"},quickswap:{address:"0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220",prepareTransaction:vD},paymentWithEvent:{address:" 0xfAD2F276D464EAdB71435127BA2c2e9dDefb93a4"},contractCall:{approveAndCallContractAddressAmountBoolean:{address:"0x8698E529E9867eEbcC68b4792daC627cd8870736",prepareTransaction:bD},approveAndCallContractAddressPassedAmountBoolean:{address:"0xAB305eaDf5FB15AF6370106B231C67d103bBbbbC",prepareTransaction:wD}},paymentFee:{address:"0xd625c7087E940b2A91ed8bD8db45cB24D3526B56",prepareTransaction:AD}}},ED={ethereum:{address:"0xae60aC8e69414C2Dc362D0e6a03af643d1D85b92",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},bsc:{address:"0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},polygon:{address:"0x2CA727BC33915823e3D05fe043d310B8c5b2dC5b",api:[{inputs:[{internalType:"address",name:"_configuration",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"configuration",outputs:[{internalType:"contract DePayRouterV1Configuration",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pluginAddress",type:"address"}],name:"isApproved",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"path",type:"address[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"address[]",name:"addresses",type:"address[]"},{internalType:"address[]",name:"plugins",type:"address[]"},{internalType:"string[]",name:"data",type:"string[]"}],name:"route",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]}},MD="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==ph?ph:"undefined"!=typeof self?self:{};function kD(t){var e={exports:{}};return t(e,e.exports),e.exports}var xD=kD((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:af.Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function a(t,e,n){var r=s(t,n);return n-1>=e&&(r|=s(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)i=a(t,e,r)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,l=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;n.words[0]=a;for(var l=1;l>>26,h=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}n.words[l]=0|h,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?m+r:h[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===o?(n>=0&&(t[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,_=0|s[4],E=8191&_,M=_>>>13,k=0|s[5],x=8191&k,S=k>>>13,C=0|s[6],T=8191&C,I=C>>>13,N=0|s[7],P=8191&N,R=N>>>13,B=0|s[8],O=8191&B,L=B>>>13,D=0|s[9],j=8191&D,F=D>>>13,U=0|a[0],z=8191&U,H=U>>>13,W=0|a[1],q=8191&W,G=W>>>13,Q=0|a[2],V=8191&Q,Y=Q>>>13,J=0|a[3],Z=8191&J,K=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,lt=at>>>13,ct=0|a[8],ht=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(l+(r=Math.imul(h,z))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,z)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,H))+Math.imul(m,z)|0,o=Math.imul(m,H);var yt=(l+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,q)|0))<<13)|0;l=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,z),i=(i=Math.imul(y,H))+Math.imul(v,z)|0,o=Math.imul(v,H),r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,G)|0;var vt=(l+(r=r+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,V)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,H))+Math.imul(A,z)|0,o=Math.imul(A,H),r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,G)|0,r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Y)|0;var bt=(l+(r=r+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,H))+Math.imul(M,z)|0,o=Math.imul(M,H),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,G)|0,r=r+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,K)|0;var wt=(l+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(x,z),i=(i=Math.imul(x,H))+Math.imul(S,z)|0,o=Math.imul(S,H),r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,G)|0,r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var At=(l+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;l=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(T,z),i=(i=Math.imul(T,H))+Math.imul(I,z)|0,o=Math.imul(I,H),r=r+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,G)|0,r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var _t=(l+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;l=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,H))+Math.imul(R,z)|0,o=Math.imul(R,H),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,G)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,K)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(l+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((o=o+Math.imul(f,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(O,z),i=(i=Math.imul(O,H))+Math.imul(L,z)|0,o=Math.imul(L,H),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,G)|0,r=r+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,Y)|0,r=r+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,K)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,lt)|0;var Mt=(l+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;l=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(j,z),i=(i=Math.imul(j,H))+Math.imul(F,z)|0,o=Math.imul(F,H),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,G)|0,r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,r=r+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,lt)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var kt=(l+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(j,q),i=(i=Math.imul(j,G))+Math.imul(F,q)|0,o=Math.imul(F,G),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,K)|0,r=r+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,lt)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ft)|0;var xt=(l+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;l=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(j,V),i=(i=Math.imul(j,Y))+Math.imul(F,V)|0,o=Math.imul(F,Y),r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(I,nt)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,lt)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ft)|0;var St=(l+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;l=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,Z),i=(i=Math.imul(j,K))+Math.imul(F,Z)|0,o=Math.imul(F,K),r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(P,nt)|0,i=(i=i+Math.imul(P,rt)|0)+Math.imul(R,nt)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,lt)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(l+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(j,$),i=(i=Math.imul(j,tt))+Math.imul(F,$)|0,o=Math.imul(F,tt),r=r+Math.imul(O,nt)|0,i=(i=i+Math.imul(O,rt)|0)+Math.imul(L,nt)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,lt)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,ft)|0;var Tt=(l+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(M,pt)|0))<<13)|0;l=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(j,nt),i=(i=Math.imul(j,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,lt)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var It=(l+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(S,pt)|0))<<13)|0;l=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(j,ot),i=(i=Math.imul(j,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),r=r+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,lt)|0,r=r+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var Nt=(l+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;l=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(j,ut),i=(i=Math.imul(j,lt))+Math.imul(F,ut)|0,o=Math.imul(F,lt),r=r+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ft)|0;var Pt=(l+(r=r+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(R,pt)|0))<<13)|0;l=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(j,ht),i=(i=Math.imul(j,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(l+(r=r+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(L,pt)|0))<<13)|0;l=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Bt=(l+(r=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(F,pt)|0))<<13)|0;return l=((o=Math.imul(F,mt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=At,u[6]=_t,u[7]=Et,u[8]=Mt,u[9]=kt,u[10]=xt,u[11]=St,u[12]=Ct,u[13]=Tt,u[14]=It,u[15]=Nt,u[16]=Pt,u[17]=Rt,u[18]=Bt,0!==l&&(u[19]=l,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return g(t,e,n)}Math.imul||(m=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?p(this,t,e):n<1024?g(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,s=0|o.words[o.length-1];0!=(n=26-this._countBits(s))&&(o=o.ushln(n),r.iushln(n),s=0|o.words[o.length-1]);var a,u=r.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var l=0;l=0;h--){var f=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(o,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=f)}return a&&a._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a),s.isub(u)):(r.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new M(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);n(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;r--){for(var l=e.words[r],c=u-1;c>=0;c--){var h=l>>c&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===r&&0===c)&&(o=this.mul(o,n[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},r(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,MD)}));let SD=!1,CD=!1;const TD={debug:1,default:2,info:2,warning:3,error:4,off:5};let ID=TD.default,ND=null;const PD=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(n){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var RD,BD;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(RD||(RD={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(BD||(BD={}));const OD="0123456789abcdef";class LD{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();null==TD[n]&&this.throwArgumentError("invalid log level name","logLevel",t),ID>TD[n]||console.log.apply(console,e)}debug(...t){this._log(LD.levels.DEBUG,t)}info(...t){this._log(LD.levels.INFO,t)}warn(...t){this._log(LD.levels.WARNING,t)}makeError(t,e,n){if(CD)return this.makeError("censored error",e,{});e||(e=LD.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((t=>{const e=n[t];try{if(e instanceof Uint8Array){let n="";for(let t=0;t>4],n+=OD[15&e[t]];r.push(t+"=Uint8Array(0x"+n+")")}else r.push(t+"="+JSON.stringify(e))}catch(e){r.push(t+"="+JSON.stringify(n[t].toString()))}})),r.push(`code=${e}`),r.push(`version=${this.version}`);const i=t;let o="";switch(e){case BD.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case BD.CALL_EXCEPTION:case BD.INSUFFICIENT_FUNDS:case BD.MISSING_NEW:case BD.NONCE_EXPIRED:case BD.REPLACEMENT_UNDERPRICED:case BD.TRANSACTION_REPLACED:case BD.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),r.length&&(t+=" ("+r.join(", ")+")");const s=new Error(t);return s.reason=i,s.code=e,Object.keys(n).forEach((function(t){s[t]=n[t]})),s}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,LD.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,r){t||this.throwError(e,n,r)}assertArgument(t,e,n,r){t||this.throwArgumentError(e,n,r)}checkNormalize(t){PD&&this.throwError("platform missing String.prototype.normalize",LD.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:PD})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,LD.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,LD.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n=n?": "+n:"",te&&this.throwError("too many arguments"+n,LD.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",LD.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",LD.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",LD.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return ND||(ND=new LD("logger/5.6.0")),ND}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",LD.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),SD){if(!t)return;this.globalLogger().throwError("error censorship permanent",LD.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}CD=!!t,SD=!!e}static setLogLevel(t){const e=TD[t.toLowerCase()];null!=e?ID=e:LD.globalLogger().warn("invalid log level - "+t)}static from(t){return new LD(t)}}LD.errors=BD,LD.levels=RD;const DD=new LD("bytes/5.6.1");function jD(t){return!!t.toHexString}function FD(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return FD(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function UD(t){return"number"==typeof t&&t==t&&t%1==0}function zD(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!UD(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function HD(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const WD="0123456789abcdef";function qD(t,e){if(e||(e={}),"number"==typeof t){DD.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=WD[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),jD(t))return t.toHexString();if(HD(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":DD.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(zD(t)){let e="0x";for(let n=0;n>4]+WD[15&r]}return e}return DD.throwArgumentError("invalid hexlify value","value",t)}function GD(t,e){for("string"!=typeof t?t=qD(t):HD(t)||DD.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&DD.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}const QD="bignumber/5.6.2";var VD=xD.BN;const YD=new LD(QD),JD={},ZD=9007199254740991;let KD=!1;class XD{constructor(t,e){t!==JD&&YD.throwError("cannot call constructor directly; use BigNumber.from",LD.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return tj(ej(this).fromTwos(t))}toTwos(t){return tj(ej(this).toTwos(t))}abs(){return"-"===this._hex[0]?XD.from(this._hex.substring(1)):this}add(t){return tj(ej(this).add(ej(t)))}sub(t){return tj(ej(this).sub(ej(t)))}div(t){return XD.from(t).isZero()&&nj("division-by-zero","div"),tj(ej(this).div(ej(t)))}mul(t){return tj(ej(this).mul(ej(t)))}mod(t){const e=ej(t);return e.isNeg()&&nj("division-by-zero","mod"),tj(ej(this).umod(e))}pow(t){const e=ej(t);return e.isNeg()&&nj("negative-power","pow"),tj(ej(this).pow(e))}and(t){const e=ej(t);return(this.isNegative()||e.isNeg())&&nj("unbound-bitwise-result","and"),tj(ej(this).and(e))}or(t){const e=ej(t);return(this.isNegative()||e.isNeg())&&nj("unbound-bitwise-result","or"),tj(ej(this).or(e))}xor(t){const e=ej(t);return(this.isNegative()||e.isNeg())&&nj("unbound-bitwise-result","xor"),tj(ej(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&nj("negative-width","mask"),tj(ej(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&nj("negative-width","shl"),tj(ej(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&nj("negative-width","shr"),tj(ej(this).shrn(t))}eq(t){return ej(this).eq(ej(t))}lt(t){return ej(this).lt(ej(t))}lte(t){return ej(this).lte(ej(t))}gt(t){return ej(this).gt(ej(t))}gte(t){return ej(this).gte(ej(t))}isNegative(){return"-"===this._hex[0]}isZero(){return ej(this).isZero()}toNumber(){try{return ej(this).toNumber()}catch(t){nj("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return YD.throwError("this platform does not support BigInt",LD.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?KD||(KD=!0,YD.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?YD.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",LD.errors.UNEXPECTED_ARGUMENT,{}):YD.throwError("BigNumber.toString does not accept parameters",LD.errors.UNEXPECTED_ARGUMENT,{})),ej(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof XD)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new XD(JD,$D(t)):t.match(/^-?[0-9]+$/)?new XD(JD,$D(new VD(t))):YD.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&nj("underflow","BigNumber.from",t),(t>=ZD||t<=-ZD)&&nj("overflow","BigNumber.from",t),XD.from(String(t));const e=t;if("bigint"==typeof e)return XD.from(e.toString());if(zD(e))return XD.from(qD(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return XD.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(HD(t)||"-"===t[0]&&HD(t.substring(1))))return XD.from(t)}return YD.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function $D(t){if("string"!=typeof t)return $D(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&YD.throwArgumentError("invalid hex","value",t),"0x00"===(t=$D(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function tj(t){return XD.from($D(t))}function ej(t){const e=XD.from(t).toHexString();return"-"===e[0]?new VD("-"+e.substring(3),16):new VD(e.substring(2),16)}function nj(t,e,n){const r={fault:t,operation:e};return null!=n&&(r.value=n),YD.throwError(t,LD.errors.NUMERIC_FAULT,r)}const rj=new LD(QD),ij={},oj=XD.from(0),sj=XD.from(-1);function aj(t,e,n,r){const i={fault:e,operation:n};return void 0!==r&&(i.value=r),rj.throwError(t,LD.errors.NUMERIC_FAULT,i)}let uj="0";for(;uj.length<256;)uj+=uj;function lj(t){if("number"!=typeof t)try{t=XD.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+uj.substring(0,t):rj.throwArgumentError("invalid decimal size","decimals",t)}function cj(t,e){null==e&&(e=0);const n=lj(e),r=(t=XD.from(t)).lt(oj);r&&(t=t.mul(sj));let i=t.mod(n).toString();for(;i.length2&&rj.throwArgumentError("too many decimal points","value",t);let o=i[0],s=i[1];for(o||(o="0"),s||(s="0");"0"===s[s.length-1];)s=s.substring(0,s.length-1);for(s.length>n.length-1&&aj("fractional component exceeds decimals","underflow","parseFixed"),""===s&&(s="0");s.lengthnull==t[e]?r:(typeof t[e]!==n&&rj.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&rj.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&rj.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new fj(ij,e,n,r)}}class dj{constructor(t,e,n,r){t!==ij&&rj.throwError("cannot use FixedNumber constructor; use FixedNumber.from",LD.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=e,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&rj.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=hj(this._value,this.format.decimals),n=hj(t._value,t.format.decimals);return dj.fromValue(e.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=hj(this._value,this.format.decimals),n=hj(t._value,t.format.decimals);return dj.fromValue(e.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=hj(this._value,this.format.decimals),n=hj(t._value,t.format.decimals);return dj.fromValue(e.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=hj(this._value,this.format.decimals),n=hj(t._value,t.format.decimals);return dj.fromValue(e.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=dj.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(e=e.subUnsafe(pj.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=dj.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(e=e.addUnsafe(pj.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&rj.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const n=dj.from("1"+uj.substring(0,t),this.format),r=mj.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&rj.throwArgumentError("invalid byte width","width",t),GD(XD.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return dj.fromString(this._value,t)}static fromValue(t,e,n){return null!=n||null==e||function(t){return null!=t&&(XD.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||HD(t)||"bigint"==typeof t||zD(t))}(e)||(n=e,e=null),null==e&&(e=0),null==n&&(n="fixed"),dj.fromString(cj(t,e),fj.from(n))}static fromString(t,e){null==e&&(e="fixed");const n=fj.from(e),r=hj(t,n.decimals);!n.signed&&r.lt(oj)&&aj("unsigned value cannot be negative","overflow","value",t);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=GD(i,n.width/8));const o=cj(r,n.decimals);return new dj(ij,i,o,n)}static fromBytes(t,e){null==e&&(e="fixed");const n=fj.from(e);if(function(t,e){if(e||(e={}),"number"==typeof t){DD.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),FD(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),jD(t)&&(t=t.toHexString()),HD(t)){let n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":DD.throwArgumentError("hex data is odd-length","value",t));const r=[];for(let t=0;tn.width/8)throw new Error("overflow");let r=XD.from(t);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),o=cj(r,n.decimals);return new dj(ij,i,o,n)}static from(t,e){if("string"==typeof t)return dj.fromString(t,e);if(zD(t))return dj.fromBytes(t,e);try{return dj.fromValue(t,0,e)}catch(t){if(t.code!==LD.errors.INVALID_ARGUMENT)throw t}return rj.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const pj=dj.from(1),mj=dj.from("0.5"),gj=new LD("units/5.6.1"),yj=["wei","kwei","mwei","gwei","szabo","finney","ether"];let vj=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==qh[t.blockchain].NATIVE?t.toAddress:t.toToken.address:ED[t.blockchain].address,bj=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==qh[t.blockchain].NATIVE?void 0:_L[t.blockchain].DEFAULT:ED[t.blockchain].api,wj=({paymentRoute:t,fee:e})=>t.directTransfer&&!e?t.toToken.address==qh[t.blockchain].NATIVE?void 0:"transfer":"route",Aj=({paymentRoute:t,exchangeRoute:e,event:n,fee:r})=>t.directTransfer&&!r?t.toToken.address==qh[t.blockchain].NATIVE?void 0:[t.toAddress,t.toAmount]:{path:_j({paymentRoute:t,exchangeRoute:e}),amounts:Ej({paymentRoute:t,exchangeRoute:e,fee:r}),addresses:xj({paymentRoute:t,fee:r}),plugins:Sj({paymentRoute:t,exchangeRoute:e,event:n,fee:r}),data:[]},_j=({paymentRoute:t,exchangeRoute:e})=>e?e.path:[t.toToken.address],Ej=({paymentRoute:t,exchangeRoute:e,fee:n})=>{let r;r=e?[e.amountIn.toString(),Mj({amount:e.amountOutMin.toString(),paymentRoute:t,fee:n}),e.transaction.params.deadline]:[t.toAmount,Mj({amount:t.toAmount,paymentRoute:t,fee:n})],n&&(r[4]=kj({paymentRoute:t,fee:n}));for(var i=0;i{if(n){let r=kj({paymentRoute:e,fee:n});return XD.from(t).sub(r).toString()}return t},kj=({paymentRoute:t,fee:e})=>{if("string"==typeof e.amount&&e.amount.match("%"))return XD.from(t.toAmount).mul(10*parseFloat(e.amount)).div(1e3).toString();if("string"==typeof e.amount)return e.amount;if("number"==typeof e.amount)return function(t,e){if("string"!=typeof t&&gj.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=yj.indexOf(e);-1!==t&&(e=3*t)}return hj(t,null!=e?e:18)}(e.amount.toString(),t.toDecimals).toString();throw"Unknown fee amount type!"},xj=({paymentRoute:t,fee:e})=>e?[t.fromAddress,e.receiver,t.toAddress]:[t.fromAddress,t.toAddress],Sj=({paymentRoute:t,exchangeRoute:e,event:n,fee:r})=>{let i=[];if(e&&(t.exchangePlugin=_D[t.blockchain][e.exchange.name],i.push(t.exchangePlugin.address)),t.toContract){let e=t.toContract.signature.match(/\(.*\)/);if(e&&function(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}([e,"optionalAccess",t=>t.length])){e=e[0].replace(/[\(\)]/g,"");let n=e.split(",");if("address"==n[0]&&n[1].match("uint")&&"bool"==n[2]&&Number.isNaN(parseInt(t.toContract.params[0])))t.contractCallPlugin=_D[t.blockchain].contractCall.approveAndCallContractAddressAmountBoolean;else{if("address"!=n[0]||!n[1].match("uint")||"bool"!=n[2]||Number.isNaN(parseInt(t.toContract.params[0])))throw e;t.contractCallPlugin=_D[t.blockchain].contractCall.approveAndCallContractAddressPassedAmountBoolean}i.push(t.contractCallPlugin.address)}}else"ifSwapped"!=n||t.directTransfer?i.push(_D[t.blockchain].payment.address):i.push(_D[t.blockchain].paymentWithEvent.address);return r&&i.push(_D[t.blockchain].paymentFee.address),i},Cj=({paymentRoute:t,exchangeRoute:e})=>t.fromToken.address==qh[t.blockchain].NATIVE?e?e.amountIn.toString():t.toAmount.toString():XD.from("0").toString() /** * @license * Lodash diff --git a/package.json b/package.json index fabfe49..29c2fa7 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "private": false, "dependencies": { "@depay/web3-blockchains": "^6.1.0", - "@depay/widgets": "^7.16.1" + "@depay/widgets": "^7.16.2" }, "engines": { "node": ">=16" diff --git a/readme.txt b/readme.txt index abd79ad..b71326e 100644 --- a/readme.txt +++ b/readme.txt @@ -18,7 +18,7 @@ A WooCommerce plugin for P2P cryptocurrency payments on multiple blockchains. [youtube https://www.youtube.com/watch?v=bc1sPOnlGyk] = Features = -> 📌 Check out the [live demo](https://web3wordpress.xyz "WooCommerce Plugin for Crypto Web3 Payments (live demo) by DePay"). +> 📌 Check out the [live demo](https://web3woocommerce.xyz "WooCommerce Plugin for Crypto Web3 Payments (live demo) by DePay"). * **Wallet-to-wallet**: Middleman-free P2P payments. * **Multichain**: Your customers can perform payments on various blockchains. diff --git a/rollup.build.config.js b/rollup.build.config.js index 70083d8..b42a09b 100644 --- a/rollup.build.config.js +++ b/rollup.build.config.js @@ -10,7 +10,7 @@ import { terser } from "rollup-plugin-terser" const files = [ 'src/admin.js', 'src/checkout.js', - // 'src/widgets.bundle.js', // only build if necessary + 'src/widgets.bundle.js', // only build if necessary ] export default files.map((file)=>{ diff --git a/yarn.lock b/yarn.lock index 84e98aa..59471e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1088,10 +1088,10 @@ resolved "https://registry.yarnpkg.com/@depay/web3-wallets/-/web3-wallets-11.1.1.tgz#d52bb9b7bc2f24d00f25ef2add1583ed11751703" integrity sha512-LjfR6v50Qy+nbrNkG9tnU0neHkp4O3arIC7lA1OYMBxbpgG467c7uX27Lws+iTPJyN5o76m+1YZ2JmGXwImNlw== -"@depay/widgets@^7.16.1": - version "7.16.1" - resolved "https://registry.yarnpkg.com/@depay/widgets/-/widgets-7.16.1.tgz#1308fb8ae4ecc36d87099bf543ade5622ab63023" - integrity sha512-c/XXnngy3XDPJEU0/mZTWh3fF/iAVtSxsWOxBHh7jyp3kfmaTR1VXO7u+kuPLWOqpVpYvENKUIseyg9p3aOiBQ== +"@depay/widgets@^7.16.2": + version "7.16.2" + resolved "https://registry.yarnpkg.com/@depay/widgets/-/widgets-7.16.2.tgz#dc70f2195e26e604182c98bab08321c1f70d28e2" + integrity sha512-JUIhOShzDHW7z5K0zG4s+I6s5fDxEq48USiqLG6BSEih8Qmf4485lfmT4pQaWGQB7JfDONJPz9FJzGgCxKTFDw== dependencies: "@depay/coinbase-wallet-sdk" "^1.0.5" "@depay/local-currency" "^3.5.3"