Reading from NEAR testnet…
Reading from NEAR testnet…
DvcmWSB76xu3X5RTMXuyw2UJV5CQLkRgX1KGduvurLeL
sleetcreate.testnet to sleetcreate.testnet · failed
fs_store()
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/sleet_icon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SLEET CREATE</title>
<script type="module" crossorigin src="/assets/index-C_V5KBbT.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BZrXLpRU.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
fs_store()
"0000000000000000000000000"],He=[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],Ve=[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];Se.prototype.toString=function(Fe,Ke){Fe=Fe||10,Ke=Ke|0||1;var Je;if(Fe===16||Fe==="hex"){Je="";for(var wi=0,mo=0,Go=0;Go<this.length;Go++){var Qo=this.words[Go],Ao=((Qo<<wi|mo)&16777215).toString(16);mo=Qo>>>24-wi&16777215,wi+=2,wi>=26&&(wi-=26,Go--),mo!==0||Go!==this.length-1?Je=Ge[6-Ao.length]+Ao+Je:Je=Ao+Je}for(mo!==0&&(Je=mo.toString(16)+Je);Je.length%Ke!==0;)Je="0"+Je;return this.negative!==0&&(Je="-"+Je),Je}if(Fe===(Fe|0)&&Fe>=2&&Fe<=36){var Mn=He[Fe],Ho=Ve[Fe];Je="";var rc=this.clone();for(rc.negative=0;!rc.isZero();){var dc=rc.modrn(Ho).toString(Fe);rc=rc.idivn(Ho),rc.isZero()?Je=dc+Je:Je=Ge[Mn-dc.length]+dc+Je}for(this.isZero()&&(Je="0"+Je);Je.length%Ke!==0;)Je="0"+Je;return this.negative!==0&&(Je="-"+Je),Je}X(!1,"Base should be between 2 and 36")},Se.prototype.toNumber=function(){var Fe=this.words[0];return this.length===2?Fe+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Fe+=4503599627370496+this.words[1]*67108864:this.length>2&&X(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Fe:Fe},Se.prototype.toJSON=function(){return this.toString(16,2)},Ne&&(Se.prototype.toBuffer=function(Fe,Ke){return this.toArrayLike(Ne,Fe,Ke)}),Se.prototype.toArray=function(Fe,Ke){return this.toArrayLike(Array,Fe,Ke)};var Ye=function(Fe,Ke){return Fe.allocUnsafe?Fe.allocUnsafe(Ke):new Fe(Ke)};Se.prototype.toArrayLike=function(Fe,Ke,Je){this._strip();var wi=this.byteLength(),mo=Je||Math.max(1,wi);X(wi<=mo,"byte array longer than desired length"),X(mo>0,"Requested array length <= 0");var Go=Ye(Fe,mo),Qo=Ke==="le"?"LE":"BE";return this["_toArrayLike"+Qo](Go,wi),Go},Se.prototype._toArrayLikeLE=function(Fe,Ke){for(var Je=0,wi=0,mo=0,Go=0;mo<this.length;mo++){var Qo=this.words[mo]<<Go|wi;Fe[Je++]=Qo&255,Je<Fe.length&&(Fe[Je++]=Qo>>8&255),Je<Fe.length&&(Fe[Je++]=Qo>>16&255),Go===6?(Je<Fe.length&&(Fe[Je++]=Qo>>24&255),wi=0,Go=0):(wi=Qo>>>24,Go+=2)}if(Je<Fe.length)for(Fe[Je++]=wi;Je<Fe.length;)Fe[Je++]=0},Se.prototype._toArrayLikeBE=function(Fe,Ke){for(var Je=Fe.length-1,wi=0,mo=0,Go=0;mo<this.length;mo++){var Qo=this.words[mo]<<Go|wi;Fe[Je--]=Qo&255,Je>=0&&(Fe[Je--]=Qo>>8&255),Je>=0&&(Fe[Je--]=Qo>>16&255),Go===6?(Je>=0&&(Fe[Je--]=Qo>>24&255),wi=0,Go=0):(wi=Qo>>>24,Go+=2)}if(Je>=0)for(Fe[Je--]=wi;Je>=0;)Fe[Je--]=0},Math.clz32?Se.prototype._countBits=function(Fe){return 32-Math.clz32(Fe)}:Se.prototype._countBits=function(Fe){var Ke=Fe,Je=0;return Ke>=4096&&(Je+=13,Ke>>>=13),Ke>=64&&(Je+=7,Ke>>>=7),Ke>=8&&(Je+=4,Ke>>>=4),Ke>=2&&(Je+=2,Ke>>>=2),Je+Ke},Se.prototype._zeroBits=function(Fe){if(Fe===0)return 26;var Ke=Fe,Je=0;return Ke&8191||(Je+=13,Ke>>>=13),Ke&127||(Je+=7,Ke>>>=7),Ke&15||(Je+=4,Ke>>>=4),Ke&3||(Je+=2,Ke>>>=2),Ke&1||Je++,Je},Se.prototype.bitLength=function(){var Fe=this.words[this.length-1],Ke=this._countBits(Fe);return(this.length-1)*26+Ke};function Fn(Fe){for(var Ke=new Array(Fe.bitLength()),Je=0;Je<Ke.length;Je++){var wi=Je/26|0,mo=Je%26;Ke[Je]=Fe.words[wi]>>>mo&1}return Ke}Se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Fe=0,Ke=0;Ke<this.length;Ke++){var Je=this._zeroBits(this.words[Ke]);if(Fe+=Je,Je!==26)break}return Fe},Se.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Se.prototype.toTwos=function(Fe){return this.negative!==0?this.abs().inotn(Fe).iaddn(1):this.clone()},Se.prototype.fromTwos=function(Fe){return this.testn(Fe-1)?this.notn(Fe).iaddn(1).ineg():this.clone()},Se.prototype.isNeg=function(){return this.negative!==0},Se.prototype.neg=function(){return this.clone().ineg()},Se.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Se.prototype.iuor=function(Fe){for(;this.length<Fe.length;)this.words[this.length++]=0;for(var Ke=0;Ke<Fe.length;Ke++)this.words[Ke]=this.words[Ke]|Fe.words[Ke];return this._strip()},Se.prototype.ior=function(Fe){return X((this.negative|Fe.negative)===0),this.iuor(Fe)},Se.prototype.or=function(Fe){return this.length>Fe.length?this.clone().ior(Fe):Fe.clone().ior(this)},Se.prototype.uor=function(Fe){return this.length>Fe.length?this.clone().iuor(Fe):Fe.clone().iuor(this)},Se.prototype.iuand=function(Fe){var Ke;this.length>Fe.length?Ke=Fe:Ke=this;for(var Je=0;Je<Ke.length;Je++)this.words[Je]=this.words[Je]&Fe.words[Je];return this.length=Ke.length,this._strip()},Se.prototype.iand=function(Fe){return X((this.negative|Fe.negative)===0),this.iuand(Fe)},Se.prototype.and=function(Fe){return this.length>Fe.length?this.clone().iand(Fe):Fe.clone().iand(this)},Se.prototype.uand=function(Fe){return this.length>Fe.length?this.clone().iuand(Fe):Fe.clone().iuand(this)},Se.prototype.iuxor=function(Fe){var Ke,Je;this.length>Fe.length?(Ke=this,Je=Fe):(Ke=Fe,Je=this);for(var wi=0;wi<Je.length;wi++)this.words[wi]=Ke.words[wi]^Je.words[wi];if(this!==Ke)for(;wi<Ke.length;wi++)this.words[wi]=Ke.words[wi];return this.length=Ke.length,this._strip()},Se.prototype.ixor=function(Fe){return X((this.negative|Fe.negative)===0),this.iuxor(Fe)},Se.prototype.xor=function(Fe){return this.length>Fe.length?this.clone().ixor(Fe):Fe.clone().ixor(this)},Se.prototype.uxor=function(Fe){return this.length>Fe.length?this.clone().iuxor(Fe):Fe.clone().iuxor(this)},Se.prototype.inotn=function(Fe){X(typeof Fe=="number"&&Fe>=0);var Ke=Math.ceil(Fe/26)|0,Je=Fe%26;this._expand(Ke),Je>0&&Ke--;for(var wi=0;wi<Ke;wi++)this.words[wi]=~this.words[wi]&67108863;return Je>0&&(this.words[wi]=~this.words[wi]&67108863>>26-Je),this._strip()},Se.prototype.notn=function(Fe){return this.clone().inotn(Fe)},Se.prototype.setn=function(Fe,Ke){X(typeof Fe=="number"&&Fe>=0);var Je=Fe/26|0,wi=Fe%26;return this._expand(Je+1),Ke?this.words[Je]=this.words[Je]|1<<wi:this.words[Je]=this.words[Je]&~(1<<wi),this._strip()},Se.prototype.iadd=function(Fe){var Ke;if(this.negative!==0&&Fe.negative===0)return this.negative=0,Ke=this.isub(Fe),this.negative^=1,this._normSign();if(this.negative===0&&Fe.negative!==0)return Fe.negative=0,Ke=this.isub(Fe),Fe.negative=1,Ke._normSign();var Je,wi;this.length>Fe.length?(Je=this,wi=Fe):(Je=Fe,wi=this);for(var mo=0,Go=0;Go<wi.length;Go++)Ke=(Je.words[Go]|0)+(wi.words[Go]|0)+mo,this.words[Go]=Ke&67108863,mo=Ke>>>26;for(;mo!==0&&Go<Je.length;Go++)Ke=(Je.words[Go]|0)+mo,this.words[Go]=Ke&67108863,mo=Ke>>>26;if(this.length=Je.length,mo!==0)this.words[this.length]=mo,this.length++;else if(Je!==this)for(;Go<Je.length;Go++)this.words[Go]=Je.words[Go];return this},Se.prototype.add=function(Fe){var Ke;return Fe.negative!==0&&this.negative===0?(Fe.negative=0,Ke=this.sub(Fe),Fe.negative^=1,Ke):Fe.negative===0&&this.negative!==0?(this.negative=0,Ke=Fe.sub(this),this.negative=1,Ke):this.length>Fe.length?this.clone().iadd(Fe):Fe.clone().iadd(this)},Se.prototype.isub=function(Fe){if(Fe.negative!==0){Fe.negative=0;var Ke=this.iadd(Fe);return Fe.negative=1,Ke._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Fe),this.negative=1,this._normSign();var Je=this.cmp(Fe);if(Je===0)return this.negative=0,this.length=1,this.words[0]=0,this;var wi,mo;Je>0?(wi=this,mo=Fe):(wi=Fe,mo=this);for(var Go=0,Qo=0;Qo<mo.length;Qo++)Ke=(wi.words[Qo]|0)-(mo.words[Qo]|0)+Go,Go=Ke>>26,this.words[Qo]=Ke&67108863;for(;Go!==0&&Qo<wi.length;Qo++)Ke=(wi.words[Qo]|0)+Go,Go=Ke>>26,this.words[Qo]=Ke&67108863;if(Go===0&&Qo<wi.length&&wi!==this)for(;Qo<wi.length;Qo++)this.words[Qo]=wi.words[Qo];return this.length=Math.max(this.length,Qo),wi!==this&&(this.negative=1),this._strip()},Se.prototype.sub=function(Fe){return this.clone().isub(Fe)};function io(Fe,Ke,Je){Je.negative=Ke.negative^Fe.negative;var wi=Fe.length+Ke.length|0;Je.length=wi,wi=wi-1|0;var mo=Fe.words[0]|0,Go=Ke.words[0]|0,Qo=mo*Go,Ao=Qo&67108863,Mn=Qo/67108864|0;Je.words[0]=Ao;for(var Ho=1;Ho<wi;Ho++){for(var rc=Mn>>>26,dc=Mn&67108863,ds=Math.min(Ho,Ke.length-1),fc=Math.max(0,Ho-Fe.length+1);fc<=ds;fc++){var ac=Ho-fc|0;mo=Fe.words[ac]|0,Go=Ke.words[fc]|0,Qo=mo*Go+dc,rc+=Qo/67108864|0,dc=Qo&67108863}Je.words[Ho]=dc|0,Mn=rc|0}return Mn!==0?Je.words[Ho]=Mn|0:Je.length--,Je._strip()}var $o=function(Fe,Ke,Je){var wi=Fe.words,mo=Ke.words,Go=Je.words,Qo=0,Ao,Mn,Ho,rc=wi[0]|0,dc=rc&8191,ds=rc>>>13,fc=wi[1]|0,ac=fc&8191,lc=fc>>>13,uc=wi[2]|0,tc=uc&8191,hc=uc>>>13,gc=wi[3]|0,bc=gc&8191,wc=gc>>>13,Cc=wi[4]|0,Oc=Cc&8191,Tc=Cc>>>13,Fc=wi[5]|0,Sc=Fc&8191,jc=Fc>>>13,kc=wi[6]|0,Lc=kc&8191,zc=kc>>>13,Xc=wi[7]|0,Hc=Xc&8191,Jc=Xc>>>13,pc=wi[8]|0,ic=pc&8191,oc=pc>>>13,yc=wi[9]|0,Ec=yc&8191,Ic=yc>>>13,Mc=mo[0]|0,Vc=Mc&8191,Qc=Mc>>>13,nl=mo[1]|0,bu=nl&8191,yu=nl>>>13,Rl=mo[2]|0,bl=Rl&8191,vl=Rl>>>13,Ol=mo[3]|0,al=Ol&8191,il=Ol>>>13,Cl=mo[4]|0,hl=Cl&8191,ll=Cl>>>13,El=mo[5]|0,gl=El&8191,dl=El>>>13,Sl=mo[6]|0,fl=Sl&8191,pl=Sl>>>13,_l=mo[7]|0,cl=_l&8191,tl=_l>>>13,Il=mo[8]|0,yl=Il&8191,Tl=Il>>>13,Bl=mo[9]|0,Al=Bl&8191,wl=Bl>>>13;Je.negative=Fe.negative^Ke.negative,Je.length=19,Ao=Math.imul(dc,Vc),Mn=Math.imul(dc,Qc),Mn=Mn+Math.imul(ds,Vc)|0,Ho=Math.imul(ds,Qc);var Hl=(Qo+Ao|0)+((Mn&8191)<<13)|0;Qo=(Ho+(Mn>>>13)|0)+(Hl>>>26)|0,Hl&=67108863,Ao=Math.imul(ac,Vc),Mn=Math.imul(ac,Qc),Mn=Mn+Math.imul(lc,Vc)|0,Ho=Math.imul(lc,Qc),Ao=Ao+Math.imul(dc,bu)|0,Mn=Mn+Math.imul(dc,yu)|0,Mn=Mn+Math.imul(ds,bu)|0,Ho=Ho+Math.imul(ds,yu)|0;var yd=(Qo+Ao|0)+((Mn&8191)<<13)|0;Qo=(Ho+(Mn>>>13)|0)+(yd>>>26)|0,yd&=67108863,Ao=Math.imul(tc,Vc),Mn=Math.imul(tc,Qc),Mn=Mn+Math.imul(hc,Vc)|0,Ho=Math.imul(hc,Qc),Ao=Ao+Math.imul(ac,bu)|0,Mn=Mn+Math.imul(ac,yu)|0,Mn=Mn+Math.imul(lc,bu)|0,Ho=Ho+Math.imul(lc,yu)|0,Ao=Ao+Math.imul(dc,bl)|0,Mn=Mn+Math.imul(dc,vl)|0,Mn=Mn+Math.imul(ds,bl)|0,Ho=Ho+Math.imul(ds,vl)|0;var pd=(Qo+Ao|0)+((Mn&8191)<<13)|0;Qo=(Ho+(Mn>>>13)|0)+(pd>>>26)|0,pd&=67108863,Ao=Math.imul(bc,Vc),Mn=Math.imul(bc,Qc),Mn=Mn+Math.imul(wc,Vc)|0,Ho=Math.imul(wc,Qc),Ao=Ao+Math.imul(tc,bu)|0,Mn=Mn+Math.imul(tc,yu)|0,Mn=Mn+Math.imul(hc,bu)|0,Ho=Ho+Math.imul(hc,yu)|0,Ao=Ao+Math.imul(ac,bl)|0,Mn=Mn+Math.imul(ac,vl)|0,Mn=Mn+Math.im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)+((Mn&8191)<<13)|0;Qo=(Ho+(Mn>>>13)|0)+(Xf>>>26)|0,Xf&=67108863,Ao=Math.imul(Ec,Al),Mn=Math.imul(Ec,wl),Mn=Mn+Math.imul(Ic,Al)|0,Ho=Math.imul(Ic,wl);var Td=(Qo+Ao|0)+((Mn&8191)<<13)|0;return Qo=(Ho+(Mn>>>13)|0)+(Td>>>26)|0,Td&=67108863,Go[0]=Hl,Go[1]=yd,Go[2]=pd,Go[3]=gd,Go[4]=$d,Go[5]=nd,Go[6]=Ud,Go[7]=$f,Go[8]=Zl,Go[9]=Zf,Go[10]=zd,Go[11]=jd,Go[12]=kd,Go[13]=Yd,Go[14]=bd,Go[15]=Fd,Go[16]=wd,Go[17]=Xf,Go[18]=Td,Qo!==0&&(Go[19]=Qo,Je.length++),Je};Math.imul||($o=io);function Jo(Fe,Ke,Je){Je.negative=Ke.negative^Fe.negative,Je.length=Fe.length+Ke.length;for(var wi=0,mo=0,Go=0;Go<Je.length-1;Go++){var Qo=mo;mo=0;for(var Ao=wi&67108863,Mn=Math.min(Go,Ke.length-1),Ho=Math.max(0,Go-Fe.length+1);Ho<=Mn;Ho++){var rc=Go-Ho,dc=Fe.words[rc]|0,ds=Ke.words[Ho]|0,fc=dc*ds,ac=fc&67108863;Qo=Qo+(fc/67108864|0)|0,ac=ac+Ao|0,Ao=ac&67108863,Qo=Qo+(ac>>>26)|0,mo+=Qo>>>26,Qo&=67108863}Je.words[Go]=Ao,wi=Qo,Qo=mo}return wi!==0?Je.words[Go]=wi:Je.length--,Je._strip()}function rs(Fe,Ke,Je){return Jo(Fe,Ke,Je)}Se.prototype.mulTo=function(Fe,Ke){var Je,wi=this.length+Fe.length;return this.length===10&&Fe.length===10?Je=$o(this,Fe,Ke):wi<63?Je=io(this,Fe,Ke):wi<1024?Je=Jo(this,Fe,Ke):Je=rs(this,Fe,Ke),Je},Se.prototype.mul=function(Fe){var Ke=new Se(null);return Ke.words=new Array(this.length+Fe.length),this.mulTo(Fe,Ke)},Se.prototype.mulf=function(Fe){var Ke=new Se(null);return Ke.words=new Array(this.length+Fe.length),rs(this,Fe,Ke)},Se.prototype.imul=function(Fe){return this.clone().mulTo(Fe,this)},Se.prototype.imuln=function(Fe){var Ke=Fe<0;Ke&&(Fe=-Fe),X(typeof Fe=="number"),X(Fe<67108864);for(var Je=0,wi=0;wi<this.length;wi++){var mo=(this.words[wi]|0)*Fe,Go=(mo&67108863)+(Je&67108863);Je>>=26,Je+=mo/67108864|0,Je+=Go>>>26,this.words[wi]=Go&67108863}return Je!==0&&(this.words[wi]=Je,this.length++),Ke?this.ineg():this},Se.prototype.muln=function(Fe){return this.clone().imuln(Fe)},Se.prototype.sqr=function(){return this.mul(this)},Se.prototype.isqr=function(){return this.imul(this.clone())},Se.prototype.pow=function(Fe){var Ke=Fn(Fe);if(Ke.length===0)return new Se(1);for(var Je=this,wi=0;wi<Ke.length&&Ke[wi]===0;wi++,Je=Je.sqr());if(++wi<Ke.length)for(var mo=Je.sqr();wi<Ke.length;wi++,mo=mo.sqr())Ke[wi]!==0&&(Je=Je.mul(mo));return Je},Se.prototype.iushln=function(Fe){X(typeof Fe=="number"&&Fe>=0);var Ke=Fe%26,Je=(Fe-Ke)/26,wi=67108863>>>26-Ke<<26-Ke,mo;if(Ke!==0){var Go=0;for(mo=0;mo<this.length;mo++){var Qo=this.words[mo]&wi,Ao=(this.words[mo]|0)-Qo<<Ke;this.words[mo]=Ao|Go,Go=Qo>>>26-Ke}Go&&(this.words[mo]=Go,this.length++)}if(Je!==0){for(mo=this.length-1;mo>=0;mo--)this.words[mo+Je]=this.words[mo];for(mo=0;mo<Je;mo++)this.words[mo]=0;this.length+=Je}return this._strip()},Se.prototype.ishln=function(Fe){return X(this.negative===0),this.iushln(Fe)},Se.prototype.iushrn=function(Fe,Ke,Je){X(typeof Fe=="number"&&Fe>=0);var wi;Ke?wi=(Ke-Ke%26)/26:wi=0;var mo=Fe%26,Go=Math.min((Fe-mo)/26,this.length),Qo=67108863^67108863>>>mo<<mo,Ao=Je;if(wi-=Go,wi=Math.max(0,wi),Ao){for(var Mn=0;Mn<Go;Mn++)Ao.words[Mn]=this.words[Mn];Ao.length=Go}if(Go!==0)if(this.length>Go)for(this.length-=Go,Mn=0;Mn<this.length;Mn++)this.words[Mn]=this.words[Mn+Go];else this.words[0]=0,this.length=1;var Ho=0;for(Mn=this.length-1;Mn>=0&&(Ho!==0||Mn>=wi);Mn--){var rc=this.words[Mn]|0;this.words[Mn]=Ho<<26-mo|rc>>>mo,Ho=rc&Qo}return Ao&&Ho!==0&&(Ao.words[Ao.length++]=Ho),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},Se.prototype.ishrn=function(Fe,Ke,Je){return X(this.negative===0),this.iushrn(Fe,Ke,Je)},Se.prototype.shln=function(Fe){return this.clone().ishln(Fe)},Se.prototype.ushln=function(Fe){return this.clone().iushln(Fe)},Se.prototype.shrn=function(Fe){return this.clone().ishrn(Fe)},Se.prototype.ushrn=function(Fe){return this.clone().iushrn(Fe)},Se.prototype.testn=function(Fe){X(typeof Fe=="number"&&Fe>=0);var Ke=Fe%26,Je=(Fe-Ke)/26,wi=1<<Ke;if(this.length<=Je)return!1;var mo=this.words[Je];return!!(mo&wi)},Se.prototype.imaskn=function(Fe){X(typeof Fe=="number"&&Fe>=0);var Ke=Fe%26,Je=(Fe-Ke)/26;if(X(this.negative===0,"imaskn works only with positive numbers"),this.length<=Je)return this;if(Ke!==0&&Je++,this.length=Math.min(Je,this.length),Ke!==0){var wi=67108863^67108863>>>Ke<<Ke;this.words[this.length-1]&=wi}return this._strip()},Se.prototype.maskn=function(Fe){return this.clone().imaskn(Fe)},Se.prototype.iaddn=function(Fe){return X(typeof Fe=="number"),X(Fe<67108864),Fe<0?this.isubn(-Fe):this.negative!==0?this.length===1&&(this.words[0]|0)<=Fe?(this.words[0]=Fe-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Fe),this.negative=1,this):this._iaddn(Fe)},Se.prototype._iaddn=function(Fe){this.words[0]+=Fe;for(var Ke=0;Ke<this.length&&this.words[Ke]>=67108864;Ke++)this.words[Ke]-=67108864,Ke===this.length-1?this.words[Ke+1]=1:this.words[Ke+1]++;return this.length=Math.max(this.length,Ke+1),this},Se.prototype.isubn=function(Fe){if(X(typeof Fe=="number"),X(Fe<67108864),Fe<0)return this.iaddn(-Fe);if(this.negative!==0)return this.negative=0,this.iaddn(Fe),this.negative=1,this;if(this.words[0]-=Fe,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Ke=0;Ke<this.length&&this.words[Ke]<0;Ke++)this.words[Ke]+=67108864,this.words[Ke+1]-=1;return this._strip()},Se.prototype.addn=function(Fe){return this.clone().iaddn(Fe)},Se.prototype.subn=function(Fe){return this.clone().isubn(Fe)},Se.prototype.iabs=function(){return this.negative=0,this},Se.prototype.abs=function(){return this.clone().iabs()},Se.prototype._ishlnsubmul=function(Fe,Ke,Je){var wi=Fe.length+Je,mo;this._expand(wi);var Go,Qo=0;for(mo=0;mo<Fe.length;mo++){Go=(this.words[mo+Je]|0)+Qo;var Ao=(Fe.words[mo]|0)*Ke;Go-=Ao&67108863,Qo=(Go>>26)-(Ao/67108864|0),this.words[mo+Je]=Go&67108863}for(;mo<this.length-Je;mo++)Go=(this.words[mo+Je]|0)+Qo,Qo=Go>>26,this.words[mo+Je]=Go&67108863;if(Qo===0)return this._strip();for(X(Qo===-1),Qo=0,mo=0;mo<this.length;mo++)Go=-(this.words[mo]|0)+Qo,Qo=Go>>26,this.words[mo]=Go&67108863;return this.negative=1,this._strip()},Se.prototype._wordDiv=function(Fe,Ke){var Je=this.length-Fe.length,wi=this.clone(),mo=Fe,Go=mo.words[mo.length-1]|0,Qo=this._countBits(Go);Je=26-Qo,Je!==0&&(mo=mo.ushln(Je),wi.iushln(Je),Go=mo.words[mo.length-1]|0);var Ao=wi.length-mo.length,Mn;if(Ke!=="mod"){Mn=new Se(null),Mn.length=Ao+1,Mn.words=new Array(Mn.length);for(var Ho=0;Ho<Mn.length;Ho++)Mn.words[Ho]=0}var rc=wi.clone()._ishlnsubmul(mo,1,Ao);rc.negative===0&&(wi=rc,Mn&&(Mn.words[Ao]=1));for(var dc=Ao-1;dc>=0;dc--){var ds=(wi.words[mo.length+dc]|0)*67108864+(wi.words[mo.length+dc-1]|0);for(ds=Math.min(ds/Go|0,67108863),wi._ishlnsubmul(mo,ds,dc);wi.negative!==0;)ds--,wi.negative=0,wi._ishlnsubmul(mo,1,dc),wi.isZero()||(wi.negative^=1);Mn&&(Mn.words[dc]=ds)}return Mn&&Mn._strip(),wi._strip(),Ke!=="div"&&Je!==0&&wi.iushrn(Je),{div:Mn||null,mod:wi}},Se.prototype.divmod=function(Fe,Ke,Je){if(X(!Fe.isZero()),this.isZero())return{div:new Se(0),mod:new Se(0)};var wi,mo,Go;return this.negative!==0&&Fe.negative===0?(Go=this.neg().divmod(Fe,Ke),Ke!=="mod"&&(wi=Go.div.neg()),Ke!=="div"&&(mo=Go.mod.neg(),Je&&mo.negative!==0&&mo.iadd(Fe)),{div:wi,mod:mo}):this.negative===0&&Fe.negative!==0?(Go=this.divmod(Fe.neg(),Ke),Ke!=="mod"&&(wi=Go.div.neg()),{div:wi,mod:Go.mod}):this.negative&Fe.negative?(Go=this.neg().divmod(Fe.neg(),Ke),Ke!=="div"&&(mo=Go.mod.neg(),Je&&mo.negative!==0&&mo.isub(Fe)),{div:Go.div,mod:mo}):Fe.length>this.length||this.cmp(Fe)<0?{div:new Se(0),mod:this}:Fe.length===1?Ke==="div"?{div:this.divn(Fe.words[0]),mod:null}:Ke==="mod"?{div:null,mod:new Se(this.modrn(Fe.words[0]))}:{div:this.divn(Fe.words[0]),mod:new Se(this.modrn(Fe.words[0]))}:this._wordDiv(Fe,Ke)},Se.prototype.div=function(Fe){return this.divmod(Fe,"div",!1).div},Se.prototype.mod=function(Fe){return this.divmod(Fe,"mod",!1).mod},Se.prototype.umod=function(Fe){return this.divmod(Fe,"mod",!0).mod},Se.prototype.divRound=function(Fe){var Ke=this.divmod(Fe);if(Ke.mod.isZero())return Ke.div;var Je=Ke.div.negative!==0?Ke.mod.isub(Fe):Ke.mod,wi=Fe.ushrn(1),mo=Fe.andln(1),Go=Je.cmp(wi);return Go<0||mo===1&&Go===0?Ke.div:Ke.div.negative!==0?Ke.div.isubn(1):Ke.div.iaddn(1)},Se.prototype.modrn=function(Fe){var Ke=Fe<0;Ke&&(Fe=-Fe),X(Fe<=67108863);for(var Je=(1<<26)%Fe,wi=0,mo=this.length-1;mo>=0;mo--)wi=(Je*wi+(this.words[mo]|0))%Fe;return Ke?-wi:wi},Se.prototype.modn=function(Fe){return this.modrn(Fe)},Se.prototype.idivn=function(Fe){var Ke=Fe<0;Ke&&(Fe=-Fe),X(Fe<=67108863);for(var Je=0,wi=this.length-1;wi>=0;wi--){var mo=(this.words[wi]|0)+Je*67108864;this.words[wi]=mo/Fe|0,Je=mo%Fe}return this._strip(),Ke?this.ineg():this},Se.prototype.divn=function(Fe){return this.clone().idivn(Fe)},Se.prototype.egcd=function(Fe){X(Fe.negative===0),X(!Fe.isZero());var Ke=this,Je=Fe.clone();Ke.negative!==0?Ke=Ke.umod(Fe):Ke=Ke.clone();for(var wi=new Se(1),mo=new Se(0),Go=new Se(0),Qo=new Se(1),Ao=0;Ke.isEven()&&Je.isEven();)Ke.iushrn(1),Je.iushrn(1),++Ao;for(var Mn=Je.clone(),Ho=Ke.clone();!Ke.isZero();){for(var rc=0,dc=1;!(Ke.words[0]&dc)&&rc<26;++rc,dc<<=1);if(rc>0)for(Ke.iushrn(rc);rc-- >0;)(wi.isOdd()||mo.isOdd())&&(wi.iadd(Mn),mo.isub(Ho)),wi.iushrn(1),mo.iushrn(1);for(var ds=0,fc=1;!(Je.words[0]&fc)&&ds<26;++ds,fc<<=1);if(ds>0)for(Je.iushrn(ds);ds-- >0;)(Go.isOdd()||Qo.isOdd())&&(Go.iadd(Mn),Qo.isub(Ho)),Go.iushrn(1),Qo.iushrn(1);Ke.cmp(Je)>=0?(Ke.isub(Je),wi.isub(Go),mo.isub(Qo)):(Je.isub(Ke),Go.isub(wi),Qo.isub(mo))}return{a:Go,b:Qo,gcd:Je.iushln(Ao)}},Se.prototype._invmp=function(Fe){X(Fe.negative===0),X(!Fe.isZero());var Ke=this,Je=Fe.clone();Ke.negative!==0?Ke=Ke.umod(Fe):Ke=Ke.clone();for(var wi=new Se(1),mo=new Se(0),Go=Je.clone();Ke.cmpn(1)>0&&Je.cmpn(1)>0;){for(var Qo=0,Ao=1;!(Ke.words[0]&Ao)&&Qo<26;++Qo,Ao<<=1);if(Qo>0)for(Ke.iushrn(Qo);Qo-- >0;)wi.isOdd()&&wi.iadd(Go),wi.iushrn(1);for(var Mn=0,Ho=1;!(Je.words[0]&Ho)&&Mn<26;++Mn,Ho<<=1);if(Mn>0)for(Je.iushrn(Mn);Mn-- >0;)mo.isOdd()&&mo.iadd(Go),mo.iushrn(1);Ke.cmp(Je)>=0?(Ke.isub(Je),wi.isub(mo)):(Je.isub(Ke),mo.isub(wi))}var rc;return Ke.cmpn(1)===0?rc=wi:rc=mo,rc.cmpn(0)<0&&rc.iadd(Fe),rc},Se.prototype.gcd=function(Fe){if(this.isZero())return Fe.abs();if(Fe.isZero())return this.abs();var Ke=this.clone(),Je=Fe.clone();Ke.negative=0,Je.negative=0;for(var wi=0;Ke.isEven()&&Je.isEven();wi++)Ke.iushrn(1),Je.iushrn(1);do{for(;Ke.isEven();)Ke.iushrn(1);for(;Je.isEven();)Je.iushrn(1);var mo=Ke.cmp(Je);if(mo<0){var Go=Ke;Ke=Je,Je=Go}else if(mo===0||Je.cmpn(1)===0)break;Ke.isub(Je)}while(!0);return Je.iushln(wi)},Se.prototype.invm=function(Fe){return this.egcd(Fe).a.umod(Fe)},Se.prototype.isEven=function(){return(this.words[0]&1)===0},Se.prototype.isOdd=function(){return(this.words[0]&1)===1},Se.prototype.andln=function(Fe){return this.words[0]&Fe},Se.prototype.bincn=function(Fe){X(typeof Fe=="number");var Ke=Fe%26,Je=(Fe-Ke)/26,wi=1<<Ke;if(this.length<=Je)return this._expand(Je+1),this.words[Je]|=wi,this;for(var mo=wi,Go=Je;mo!==0&&Go<this.length;Go++){var Qo=this.words[Go]|0;Qo+=mo,mo=Qo>>>26,Qo&=67108863,this.words[Go]=Qo}return mo!==0&&(this.words[Go]=mo,this.length++),this},Se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Se.prototype.cmpn=function(Fe){var Ke=Fe<0;if(this.negative!==0&&!Ke)return-1;if(this.negative===0&&Ke)return 1;this._strip();var Je;if(this.length>1)Je=1;else{Ke&&(Fe=-Fe),X(Fe<=67108863,"Number is too big");var wi=this.words[0]|0;Je=wi===Fe?0:wi<Fe?-1:1}return this.negative!==0?-Je|0:Je},Se.prototype.cmp=function(Fe){if(this.negative!==0&&Fe.negative===0)return-1;if(this.negative===0&&Fe.negative!==0)return 1;var Ke=this.ucmp(Fe);return this.negative!==0?-Ke|0:Ke},Se.prototype.ucmp=function(Fe){if(this.length>Fe.length)return 1;if(this.length<Fe.length)return-1;for(var Ke=0,Je=this.length-1;Je>=0;Je--){var wi=this.words[Je]|0,mo=Fe.words[Je]|0;if(wi!==mo){wi<mo?Ke=-1:wi>mo&&(Ke=1);break}}return Ke},Se.prototype.gtn=function(Fe){return this.cmpn(Fe)===1},Se.prototype.gt=function(Fe){return this.cmp(Fe)===1},Se.prototype.gten=function(Fe){return this.cmpn(Fe)>=0},Se.prototype.gte=function(Fe){return this.cmp(Fe)>=0},Se.prototype.ltn=function(Fe){return this.cmpn(Fe)===-1},Se.prototype.lt=function(Fe){return this.cmp(Fe)===-1},Se.prototype.lten=function(Fe){return this.cmpn(Fe)<=0},Se.prototype.lte=function(Fe){return this.cmp(Fe)<=0},Se.prototype.eqn=function(Fe){return this.cmpn(Fe)===0},Se.prototype.eq=function(Fe){return this.cmp(Fe)===0},Se.red=function(Fe){return new is(Fe)},Se.prototype.toRed=function(Fe){return X(!this.red,"Already a number in reduction context"),X(this.negative===0,"red works only with positives"),Fe.convertTo(this)._forceRed(Fe)},Se.prototype.fromRed=function(){return X(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Se.prototype._forceRed=function(Fe){return this.red=Fe,this},Se.prototype.forceRed=function(Fe){return X(!this.red,"Already a number in reduction context"),this._forceRed(Fe)},Se.prototype.redAdd=function(Fe){return X(this.red,"redAdd works only with red numbers"),this.red.add(this,Fe)},Se.prototype.redIAdd=function(Fe){return X(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Fe)},Se.prototype.redSub=function(Fe){return X(this.red,"redSub works only with red numbers"),this.red.sub(this,Fe)},Se.prototype.redISub=function(Fe){return X(this.red,"redISub works only with red numbers"),this.red.isub(this,Fe)},Se.prototype.redShl=function(Fe){return X(this.red,"redShl works only with red numbers"),this.red.shl(this,Fe)},Se.prototype.redMul=function(Fe){return X(this.red,"redMul works only with red numbers"),this.red._verify2(this,Fe),this.red.mul(this,Fe)},Se.prototype.redIMul=function(Fe){return X(this.red,"redMul works only with red numbers"),this.red._verify2(this,Fe),this.red.imul(this,Fe)},Se.prototype.redSqr=function(){return X(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Se.prototype.redISqr=function(){return X(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Se.prototype.redSqrt=function(){return X(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Se.prototype.redInvm=function(){return X(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Se.prototype.redNeg=function(){return X(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Se.prototype.redPow=function(Fe){return X(this.red&&!Fe.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Fe)};var Yo={k256:null,p224:null,p192:null,p25519:null};function zo(Fe,Ke){this.name=Fe,this.p=new Se(Ke,16),this.n=this.p.bitLength(),this.k=new Se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}zo.prototype._tmp=function(){var Fe=new Se(null);return Fe.words=new Array(Math.ceil(this.n/13)),Fe},zo.prototype.ireduce=function(Fe){var Ke=Fe,Je;do this.split(Ke,this.tmp),Ke=this.imulK(Ke),Ke=Ke.iadd(this.tmp),Je=Ke.bitLength();while(Je>this.n);var wi=Je<this.n?-1:Ke.ucmp(this.p);return wi===0?(Ke.words[0]=0,Ke.length=1):wi>0?Ke.isub(this.p):Ke.strip!==void 0?Ke.strip():Ke._strip(),Ke},zo.prototype.split=function(Fe,Ke){Fe.iushrn(this.n,0,Ke)},zo.prototype.imulK=function(Fe){return Fe.imul(this.k)};function jo(){zo.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Me(jo,zo),jo.prototype.split=function(Fe,Ke){for(var Je=4194303,wi=Math.min(Fe.length,9),mo=0;mo<wi;mo++)Ke.words[mo]=Fe.words[mo];if(Ke.length=wi,Fe.length<=9){Fe.words[0]=0,Fe.length=1;return}var Go=Fe.words[9];for(Ke.words[Ke.length++]=Go&Je,mo=10;mo<Fe.length;mo++){var Qo=Fe.words[mo]|0;Fe.words[mo-10]=(Qo&Je)<<4|Go>>>22,Go=Qo}Go>>>=22,Fe.words[mo-10]=Go,Go===0&&Fe.length>10?Fe.length-=10:Fe.length-=9},jo.prototype.imulK=function(Fe){Fe.words[Fe.length]=0,Fe.words[Fe.length+1]=0,Fe.length+=2;for(var Ke=0,Je=0;Je<Fe.length;Je++){var wi=Fe.words[Je]|0;Ke+=wi*977,Fe.words[Je]=Ke&67108863,Ke=wi*64+(Ke/67108864|0)}return Fe.words[Fe.length-1]===0&&(Fe.length--,Fe.words[Fe.length-1]===0&&Fe.length--),Fe};function Vo(){zo.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Me(Vo,zo);function os(){zo.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Me(os,zo);function us(){zo.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Me(us,zo),us.prototype.imulK=function(Fe){for(var Ke=0,Je=0;Je<Fe.length;Je++){var wi=(Fe.words[Je]|0)*19+Ke,mo=wi&67108863;wi>>>=26,Fe.words[Je]=mo,Ke=wi}return Ke!==0&&(Fe.words[Fe.length++]=Ke),Fe},Se._prime=function(Fe){if(Yo[Fe])return Yo[Fe];var Ke;if(Fe==="k256")Ke=new jo;else if(Fe==="p224")Ke=new Vo;else if(Fe==="p192")Ke=new os;else if(Fe==="p25519")Ke=new us;else throw new Error("Unknown prime "+Fe);return Yo[Fe]=Ke,Ke};function is(Fe){if(typeof Fe=="string"){var Ke=Se._prime(Fe);this.m=Ke.p,this.prime=Ke}else X(Fe.gtn(1),"modulus must be greater than 1"),this.m=Fe,this.prime=null}is.prototype._verify1=function(Fe){X(Fe.negative===0,"red works only with positives"),X(Fe.red,"red works only with red numbers")},is.prototype._verify2=function(Fe,Ke){X((Fe.negative|Ke.negative)===0,"red works only with positives"),X(Fe.red&&Fe.red===Ke.red,"red works only with red numbers")},is.prototype.imod=function(Fe){return this.prime?this.prime.ireduce(Fe)._forceRed(this):(qe(Fe,Fe.umod(this.m)._forceRed(this)),Fe)},is.prototype.neg=function(Fe){return Fe.isZero()?Fe.clone():this.m.sub(Fe)._forceRed(this)},is.prototype.add=function(Fe,Ke){this._verify2(Fe,Ke);var Je=Fe.add(Ke);return Je.cmp(this.m)>=0&&Je.isub(this.m),Je._forceRed(this)},is.prototype.iadd=function(Fe,Ke){this._verify2(Fe,Ke);var Je=Fe.iadd(Ke);return Je.cmp(this.m)>=0&&Je.isub(this.m),Je},is.prototype.sub=function(Fe,Ke){this._verify2(Fe,Ke);var Je=Fe.sub(Ke);return Je.cmpn(0)<0&&Je.iadd(this.m),Je._forceRed(this)},is.prototype.isub=function(Fe,Ke){this._verify2(Fe,Ke);var Je=Fe.isub(Ke);return Je.cmpn(0)<0&&Je.iadd(this.m),Je},is.prototype.shl=function(Fe,Ke){return this._verify1(Fe),this.imod(Fe.ushln(Ke))},is.prototype.imul=function(Fe,Ke){return this._verify2(Fe,Ke),this.imod(Fe.imul(Ke))},is.prototype.mul=function(Fe,Ke){return this._verify2(Fe,Ke),this.imod(Fe.mul(Ke))},is.prototype.isqr=function(Fe){return this.imul(Fe,Fe.clone())},is.prototype.sqr=function(Fe){return this.mul(Fe,Fe)},is.prototype.sqrt=function(Fe){if(Fe.isZero())return Fe.clone();var Ke=this.m.andln(3);if(X(Ke%2===1),Ke===3){var Je=this.m.add(new Se(1)).iushrn(2);return this.pow(Fe,Je)}for(var wi=this.m.subn(1),mo=0;!wi.isZero()&&wi.andln(1)===0;)mo++,wi.iushrn(1);X(!wi.isZero());var Go=new Se(1).toRed(this),Qo=Go.redNeg(),Ao=this.m.subn(1).iushrn(1),Mn=this.m.bitLength();for(Mn=new Se(2*Mn*Mn).toRed(this);this.pow(Mn,Ao).cmp(Qo)!==0;)Mn.redIAdd(Qo);for(var Ho=this.pow(Mn,wi),rc=this.pow(Fe,wi.addn(1).iushrn(1)),dc=this.pow(Fe,wi),ds=mo;dc.cmp(Go)!==0;){for(var fc=dc,ac=0;fc.cmp(Go)!==0;ac++)fc=fc.redSqr();X(ac<ds);var lc=this.pow(Ho,new Se(1).iushln(ds-ac-1));rc=rc.redMul(lc),Ho=lc.redSqr(),dc=dc.redMul(Ho),ds=ac}return rc},is.prototype.invm=function(Fe){var Ke=Fe._invmp(this.m);return Ke.negative!==0?(Ke.negative=0,this.imod(Ke).redNeg()):this.imod(Ke)},is.prototype.pow=function(Fe,Ke){if(Ke.isZero())return new Se(1).toRed(this);if(Ke.cmpn(1)===0)return Fe.clone();var Je=4,wi=new Array(1<<Je);wi[0]=new Se(1).toRed(this),wi[1]=Fe;for(var mo=2;mo<wi.length;mo++)wi[mo]=this.mul(wi[mo-1],Fe);var Go=wi[0],Qo=0,Ao=0,Mn=Ke.bitLength()%26;for(Mn===0&&(Mn=26),mo=Ke.length-1;mo>=0;mo--){for(var Ho=Ke.words[mo],rc=Mn-1;rc>=0;rc--){var dc=Ho>>rc&1;if(Go!==wi[0]&&(Go=this.sqr(Go)),dc===0&&Qo===0){Ao=0;continue}Qo<<=1,Qo|=dc,Ao++,!(Ao!==Je&&(mo!==0||rc!==0))&&(Go=this.mul(Go,wi[Qo]),Ao=0,Qo=0)}Mn=26}return Go},is.prototype.convertTo=function(Fe){var Ke=Fe.umod(this.m);return Ke===Fe?Ke.clone():Ke},is.prototype.convertFrom=function(Fe){var Ke=Fe.clone();return Ke.red=null,Ke},Se.mont=function(Fe){return new Lo(Fe)};function Lo(Fe){is.call(this,Fe),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Se(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)}Me(Lo,is),Lo.prototype.convertTo=function(Fe){return this.imod(Fe.ushln(this.shift))},Lo.prototype.convertFrom=function(Fe){var Ke=this.imod(Fe.mul(this.rinv));return Ke.red=null,Ke},Lo.prototype.imul=function(Fe,Ke){if(Fe.isZero()||Ke.isZero())return Fe.words[0]=0,Fe.length=1,Fe;var Je=Fe.imul(Ke),wi=Je.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mo=Je.isub(wi).iushrn(this.shift),Go=mo;return mo.cmp(this.m)>=0?Go=mo.isub(this.m):mo.cmpn(0)<0&&(Go=mo.iadd(this.m)),Go._forceRed(this)},Lo.prototype.mul=function(Fe,Ke){if(Fe.isZero()||Ke.isZero())return new Se(0)._forceRed(this);var Je=Fe.mul(Ke),wi=Je.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mo=Je.isub(wi).iushrn(this.shift),Go=mo;return mo.cmp(this.m)>=0?Go=mo.isub(this.m):mo.cmpn(0)<0&&(Go=mo.iadd(this.m)),Go._forceRed(this)},Lo.prototype.invm=function(Fe){var Ke=this.imod(Fe._invmp(this.m).mul(this.r2));return Ke._forceRed(this)}})(W,Tn)})(Gn);var K=Gn.exports;const Yn="bignumber/5.7.0";var Fr=K.BN;const Ae=new z(Yn),Ni={},Vn=9007199254740991;function Ts(W){return W!=null&&(V.isBigNumber(W)||typeof W=="number"&&W%1===0||typeof W=="string"&&!!W.match(/^-?[0-9]+$/)||Jt(W)||typeof W=="bigint"||nr(W))}let Wn=!1;class V{constructor(Y,J){Y!==Ni&&Ae.throwError("cannot call constructor directly; use BigNumber.from",z.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=J,this._isBigNumber=!0,Object.freeze(this)}fromTwos(Y){return zt(j(this).fromTwos(Y))}toTwos(Y){return zt(j(this).toTwos(Y))}abs(){return this._hex[0]==="-"?V.from(this._hex.substring(1)):this}add(Y){return zt(j(this).add(j(Y)))}sub(Y){return zt(j(this).sub(j(Y)))}div(Y){return V.from(Y).isZero()&&Zt("division-by-zero","div"),zt(j(this).div(j(Y)))}mul(Y){return zt(j(this).mul(j(Y)))}mod(Y){const J=j(Y);return J.isNeg()&&Zt("division-by-zero","mod"),zt(j(this).umod(J))}pow(Y){const J=j(Y);return J.isNeg()&&Zt("negative-power","pow"),zt(j(this).pow(J))}and(Y){const J=j(Y);return(this.isNegative()||J.isNeg())&&Zt("unbound-bitwise-result","and"),zt(j(this).and(J))}or(Y){const J=j(Y);return(this.isNegative()||J.isNeg())&&Zt("unbound-bitwise-result","or"),zt(j(this).or(J))}xor(Y){const J=j(Y);return(this.isNegative()||J.isNeg())&&Zt("unbound-bitwise-result","xor"),zt(j(this).xor(J))}mask(Y){return(this.isNegative()||Y<0)&&Zt("negative-width","mask"),zt(j(this).maskn(Y))}shl(Y){return(this.isNegative()||Y<0)&&Zt("negative-width","shl"),zt(j(this).shln(Y))}shr(Y){return(this.isNegative()||Y<0)&&Zt("negative-width","shr"),zt(j(this).shrn(Y))}eq(Y){return j(this).eq(j(Y))}lt(Y){return j(this).lt(j(Y))}lte(Y){return j(this).lte(j(Y))}gt(Y){return j(this).gt(j(Y))}gte(Y){return j(this).gte(j(Y))}isNegative(){return this._hex[0]==="-"}isZero(){return j(this).isZero()}toNumber(){try{return j(this).toNumber()}catch{Zt("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ae.throwError("this platform does not support BigInt",z.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Wn||(Wn=!0,Ae.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ae.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",z.errors.UNEXPECTED_ARGUMENT,{}):Ae.throwError("BigNumber.toString does not accept parameters",z.errors.UNEXPECTED_ARGUMENT,{})),j(this).toString(10)}toHexString(){return this._hex}toJSON(Y){return{type:"BigNumber",hex:this.toHexString()}}static from(Y){if(Y instanceof V)return Y;if(typeof Y=="string")return Y.match(/^-?0x[0-9a-f]+$/i)?new V(Ni,mr(Y)):Y.match(/^-?[0-9]+$/)?new V(Ni,mr(new Fr(Y))):Ae.throwArgumentError("invalid BigNumber string","value",Y);if(typeof Y=="number")return Y%1&&Zt("underflow","BigNumber.from",Y),(Y>=Vn||Y<=-9007199254740991)&&Zt("overflow","BigNumber.from",Y),V.from(String(Y));const J=Y;if(typeof J=="bigint")return V.from(J.toString());if(nr(J))return V.from(Kt(J));if(J)if(J.toHexString){const X=J.toHexString();if(typeof X=="string")return V.from(X)}else{let X=J._hex;if(X==null&&J.type==="BigNumber"&&(X=J.hex),typeof X=="string"&&(Jt(X)||X[0]==="-"&&Jt(X.substring(1))))return V.from(X)}return Ae.throwArgumentError("invalid BigNumber value","value",Y)}static isBigNumber(Y){return!!(Y&&Y._isBigNumber)}}function mr(W){if(typeof W!="string")return mr(W.toString(16));if(W[0]==="-")return W=W.substring(1),W[0]==="-"&&Ae.throwArgumentError("invalid hex","value",W),W=mr(W),W==="0x00"?W:"-"+W;if(W.substring(0,2)!=="0x"&&(W="0x"+W),W==="0x")return"0x00";for(W.length%2&&(W="0x0"+W.substring(2));W.length>4&&W.substring(0,4)==="0x00";)W="0x"+W.substring(4);return W}function zt(W){return V.from(mr(W))}function j(W){const Y=V.from(W).toHexString();return Y[0]==="-"?new Fr("-"+Y.substring(3),16):new Fr(Y.substring(2),16)}function Zt(W,Y,J){const X={fault:W,operation:Y};return J!=null&&(X.value=J),Ae.throwError(W,z.errors.NUMERIC_FAULT,X)}const Ht=new z(Yn),Ar={},Xn=V.from(0),Zn=V.from(-1);function $n(W,Y,J,X){const Me={fault:Y,operation:J};return X!==void 0&&(Me.value=X),Ht.throwError(W,z.errors.NUMERIC_FAULT,Me)}let br="0";for(;br.length<256;)br+=br;function Ii(W){if(typeof W!="number")try{W=V.from(W).toNumber()}catch{}return typeof W=="number"&&W>=0&&W<=256&&!(W%1)?"1"+br.substring(0,W):Ht.throwArgumentError("invalid decimal size","decimals",W)}function _i(W,Y){Y==null&&(Y=0);const J=Ii(Y);W=V.from(W);const X=W.lt(Xn);X&&(W=W.mul(Zn));let Me=W.mod(J).toString();for(;Me.length<J.length-1;)Me="0"+Me;Me=Me.match(/^([0-9]*[1-9]|0)(0*)/)[1];const Se=W.div(J).toString();return J.length===1?W=Se:W=Se+"."+Me,X&&(W="-"+W),W}function be(W,Y){Y==null&&(Y=0);const J=Ii(Y);(typeof W!="string"||!W.match(/^-?[0-9.]+$/))&&Ht.throwArgumentError("invalid decimal value","value",W);const X=W.substring(0,1)==="-";X&&(W=W.substring(1)),W==="."&&Ht.throwArgumentError("missing value","value",W);const Me=W.split(".");Me.length>2&&Ht.throwArgumentError("too many decimal points","value",W);let Se=Me[0],Ne=Me[1];for(Se||(Se="0"),Ne||(Ne="0");Ne[Ne.length-1]==="0";)Ne=Ne.substring(0,Ne.length-1);for(Ne.length>J.length-1&&$n("fractional component exceeds decimals","underflow","parseFixed"),Ne===""&&(Ne="0");Ne.length<J.length-1;)Ne+="0";const je=V.from(Se),ke=V.from(Ne);let De=je.mul(J).add(ke);return X&&(De=De.mul(Zn)),De}class vr{constructor(Y,J,X,Me){Y!==Ar&&Ht.throwError("cannot use FixedFormat constructor; use FixedFormat.from",z.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=J,this.width=X,this.decimals=Me,this.name=(J?"":"u")+"fixed"+String(X)+"x"+String(Me),this._multiplier=Ii(Me),Object.freeze(this)}static from(Y){if(Y instanceof vr)return Y;typeof Y=="number"&&(Y=`fixed128x${Y}`);let J=!0,X=128,Me=18;if(typeof Y=="string"){if(Y!=="fixed")if(Y==="ufixed")J=!1;else{const Se=Y.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Se||Ht.throwArgumentError("invalid fixed format","format",Y),J=Se[1]!=="u",X=parseInt(Se[2]),Me=parseInt(Se[3])}}else if(Y){const Se=(Ne,je,ke)=>Y[Ne]==null?ke:(typeof Y[Ne]!==je&&Ht.throwArgumentError("invalid fixed format ("+Ne+" not "+je+")","format."+Ne,Y[Ne]),Y[Ne]);J=Se("signed","boolean",J),X=Se("width","number",X),Me=Se("decimals","number",Me)}return X%8&&Ht.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",X),Me>80&&Ht.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",Me),new vr(Ar,J,X,Me)}}class Ut{constructor(Y,J,X,Me){Y!==Ar&&Ht.throwError("cannot use FixedNumber constructor; use FixedNumber.from",z.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=Me,this._hex=J,this._value=X,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(Y){this.format.name!==Y.format.name&&Ht.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",Y)}addUnsafe(Y){this._checkFormat(Y);const J=be(this._value,this.format.decimals),X=be(Y._value,Y.format.decimals);return Ut.fromValue(J.add(X),this.format.decimals,this.format)}subUnsafe(Y){this._checkFormat(Y);const J=be(this._value,this.format.decimals),X=be(Y._value,Y.format.decimals);return Ut.fromValue(J.sub(X),this.format.decimals,this.format)}mulUnsafe(Y){this._checkFormat(Y);const J=be(this._value,this.format.decimals),X=be(Y._value,Y.format.decimals);return Ut.fromValue(J.mul(X).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(Y){this._checkFormat(Y);const J=be(this._value,this.format.decimals),X=be(Y._value,Y.format.decimals);return Ut.fromValue(J.mul(this.format._multiplier).div(X),this.format.decimals,this.format)}floor(){const Y=this.toString().split(".");Y.length===1&&Y.push("0");let J=Ut.from(Y[0],this.format);const X=!Y[1].match(/^(0*)$/);return this.isNegative()&&X&&(J=J.subUnsafe(tf.toFormat(J.format))),J}ceiling(){const Y=this.toString().split(".");Y.length===1&&Y.push("0");let J=Ut.from(Y[0],this.format);const X=!Y[1].match(/^(0*)$/);return!this.isNegative()&&X&&(J=J.addUnsafe(tf.toFormat(J.format))),J}round(Y){Y==null&&(Y=0);const J=this.toString().split(".");if(J.length===1&&J.push("0"),(Y<0||Y>80||Y%1)&&Ht.throwArgumentError("invalid decimal count","decimals",Y),J[1].length<=Y)return this;const X=Ut.from("1"+br.substring(0,Y),this.format),Me=ks.toFormat(this.format);return this.mulUnsafe(X).addUnsafe(Me).floor().divUnsafe(X)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(Y){if(Y==null)return this._hex;Y%8&&Ht.throwArgumentError("invalid byte width","width",Y);const J=V.from(this._hex).fromTwos(this.format.width).toTwos(Y).toHexString();return oe(J,Y/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(Y){return Ut.fromString(this._value,Y)}static fromValue(Y,J,X){return X==null&&J!=null&&!Ts(J)&&(X=J,J=null),J==null&&(J=0),X==null&&(X="fixed"),Ut.fromString(_i(Y,J),vr.from(X))}static fromString(Y,J){J==null&&(J="fixed");const X=vr.from(J),Me=be(Y,X.decimals);!X.signed&&Me.lt(Xn)&&$n("unsigned value cannot be negative","overflow","value",Y);let Se=null;X.signed?Se=Me.toTwos(X.width).toHexString():(Se=Me.toHexString(),Se=oe(Se,X.width/8));const Ne=_i(Me,X.decimals);return new Ut(Ar,Se,Ne,X)}static fromBytes(Y,J){J==null&&(J="fixed");const X=vr.from(J);if(Ot(Y).length>X.width/8)throw new Error("overflow");let Me=V.from(Y);X.signed&&(Me=Me.fromTwos(X.width));const Se=Me.toTwos((X.signed?0:1)+X.width).toHexString(),Ne=_i(Me,X.decimals);return new Ut(Ar,Se,Ne,X)}static from(Y,J){if(typeof Y=="string")return Ut.fromString(Y,J);if(nr(Y))return Ut.fromBytes(Y,J);try{return Ut.fromValue(Y,0,J)}catch(X){if(X.code!==z.errors.INVALID_ARGUMENT)throw X}return Ht.throwArgumentError("invalid FixedNumber value","value",Y)}static isFixedNumber(Y){return!!(Y&&Y._isFixedNumber)}}const tf=Ut.from(1),ks=Ut.from("0.5");var Tr;(function(W){W.current="",W.NFC="NFC",W.NFD="NFD",W.NFKC="NFKC",W.NFKD="NFKD"})(Tr||(Tr={}));var fr;(function(W){W.UNEXPECTED_CONTINUE="unexpected continuation byte",W.BAD_PREFIX="bad codepoint prefix",W.OVERRUN="string overrun",W.MISSING_CONTINUE="missing continuation byte",W.OUT_OF_RANGE="out of UTF-8 range",W.UTF16_SURROGATE="UTF-16 surrogate",W.OVERLONG="overlong representation"})(fr||(fr={}));function Ls(W){if(W.length%4!==0)throw new Error("bad data");let Y=[];for(let J=0;J<W.length;J+=4)Y.push(parseInt(W.substring(J,J+4),16));return Y}function Ci(W,Y){Y||(Y=function(Me){return[parseInt(Me,16)]});let J=0,X={};return W.split(",").forEach(Me=>{let Se=Me.split(":");J+=parseInt(Se[0],16),X[J]=Y(Se[1])}),X}function nf(W){let Y=0;return W.split(",").map(J=>{let X=J.split("-");X.length===1?X[1]="0":X[1]===""&&(X[1]="1");let Me=Y+parseInt(X[0],16);return Y=parseInt(X[1],16),{l:Me,h:Y}})}nf("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"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(W=>parseInt(W,16)),Ci("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"),Ci("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"),Ci("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",Ls),nf("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function zs(W){W=atob(W);const Y=[];for(let J=0;J<W.length;J++)Y.push(W.charCodeAt(J));return Ot(Y)}function of(W,Y){Y==null&&(Y=1);const J=[],X=J.forEach,Me=function(Se,Ne){X.call(Se,function(je){Ne>0&&Array.isArray(je)?Me(je,Ne-1):J.push(je)})};return Me(W,Y),J}function js(W){const Y={};for(let J=0;J<W.length;J++){const X=W[J];Y[X[0]]=X[1]}return Y}function Qs(W){let Y=0;function J(){return W[Y++]<<8|W[Y++]}let X=J(),Me=1,Se=[0,1];for(let Yo=1;Yo<X;Yo++)Se.push(Me+=J());let Ne=J(),je=Y;Y+=Ne;let ke=0,De=0;function qe(){return ke==0&&(De=De<<8|W[Y++],ke=8),De>>--ke&1}const Ue=31,Ge=Math.pow(2,Ue),He=Ge>>>1,Ve=He>>1,Ye=Ge-1;let Fn=0;for(let Yo=0;Yo<Ue;Yo++)Fn=Fn<<1|qe();let io=[],$o=0,Jo=Ge;for(;;){let Yo=Math.floor(((Fn-$o+1)*Me-1)/Jo),zo=0,jo=X;for(;jo-zo>1;){let us=zo+jo>>>1;Yo<Se[us]?jo=us:zo=us}if(zo==0)break;io.push(zo);let Vo=$o+Math.floor(Jo*Se[zo]/Me),os=$o+Math.floor(Jo*Se[zo+1]/Me)-1;for(;!((Vo^os)&He);)Fn=Fn<<1&Ye|qe(),Vo=Vo<<1&Ye,os=os<<1&Ye|1;for(;Vo&~os&Ve;)Fn=Fn&He|Fn<<1&Ye>>>1|qe(),Vo=Vo<<1^He,os=(os^He)<<1|He|1;$o=Vo,Jo=1+os-Vo}let rs=X-4;return io.map(Yo=>{switch(Yo-rs){case 3:return rs+65792+(W[je++]<<16|W[je++]<<8|W[je++]);case 2:return rs+256+(W[je++]<<8|W[je++]);case 1:return rs+W[je++];default:return Yo-1}})}function Js(W){let Y=0;return()=>W[Y++]}function Gs(W){return Js(Qs(W))}function Ys(W){return W&1?~W>>1:W>>1}function Vs(W,Y){let J=Array(W);for(let X=0;X<W;X++)J[X]=1+Y();return J}function sf(W,Y){let J=Array(W);for(let X=0,Me=-1;X<W;X++)J[X]=Me+=1+Y();return J}function Ws(W,Y){let J=Array(W);for(let X=0,Me=0;X<W;X++)J[X]=Me+=Ys(Y());return J}function Ur(W,Y){let J=sf(W(),W),X=W(),Me=sf(X,W),Se=Vs(X,W);for(let Ne=0;Ne<X;Ne++)for(let je=0;je<Se[Ne];je++)J.push(Me[Ne]+je);return Y?J.map(Ne=>Y[Ne]):J}function Xs(W){let Y=[];for(;;){let J=W();if(J==0)break;Y.push($s(J,W))}for(;;){let J=W()-1;if(J<0)break;Y.push(t0(J,W))}return js(of(Y))}function Zs(W){let Y=[];for(;;){let J=W();if(J==0)break;Y.push(J)}return Y}function af(W,Y,J){let X=Array(W).fill(void 0).map(()=>[]);for(let Me=0;Me<Y;Me++)Ws(W,J).forEach((Se,Ne)=>X[Ne].push(Se));return X}function $s(W,Y){let J=1+Y(),X=Y(),Me=Zs(Y),Se=af(Me.length,1+W,Y);return of(Se.map((Ne,je)=>{const ke=Ne[0],De=Ne.slice(1);return Array(Me[je]).fill(void 0).map((qe,Ue)=>{let Ge=Ue*X;return[ke+Ue*J,De.map(He=>He+Ge)]})}))}function t0(W,Y){let J=1+Y();return af(J,1+W,Y).map(X=>[X[0],X.slice(1)])}function e0(W){let Y=Ur(W).sort((X,Me)=>X-Me);return J();function J(){let X=[];for(;;){let De=Ur(W,Y);if(De.length==0)break;X.push({set:new Set(De),node:J()})}X.sort((De,qe)=>qe.set.size-De.set.size);let Me=W(),Se=Me%3;Me=Me/3|0;let Ne=!!(Me&1);Me>>=1;let je=Me==1,ke=Me==2;return{branches:X,valid:Se,fe0f:Ne,save:je,check:ke}}}function r0(){return Gs(zs("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5Xi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vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const kr=r0();new Set(Ur(kr)),new Set(Ur(kr)),Xs(kr),e0(kr);const i0=new Uint8Array(32);i0.fill(0);const l0=new Uint8Array(32);l0.fill(0),V.from(-1);const d0=V.from(0),p0=V.from(1);V.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),oe(p0.toHexString(),32),oe(d0.toHexString(),32);var se={},Q={},xr=lf;function lf(W,Y){if(!W)throw new Error(Y||"Assertion failed")}lf.equal=function(W,Y,J){if(W!=Y)throw new Error(J||"Assertion failed: "+W+" != "+Y)};var Oi={exports:{}};typeof Object.create=="function"?Oi.exports=function(W,Y){Y&&(W.super_=Y,W.prototype=Object.create(Y.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}))}:Oi.exports=function(W,Y){if(Y){W.super_=Y;var J=function(){};J.prototype=Y.prototype,W.prototype=new J,W.prototype.constructor=W}};var v0=xr,g0=Oi.exports;Q.inherits=g0;function m0(W,Y){return(W.charCodeAt(Y)&64512)!==55296||Y<0||Y+1>=W.length?!1:(W.charCodeAt(Y+1)&64512)===56320}function A0(W,Y){if(Array.isArray(W))return W.slice();if(!W)return[];var J=[];if(typeof W=="string")if(Y){if(Y==="hex")for(W=W.replace(/[^a-z0-9]+/ig,""),W.length%2!==0&&(W="0"+W),Me=0;Me<W.length;Me+=2)J.push(parseInt(W[Me]+W[Me+1],16))}else for(var X=0,Me=0;Me<W.length;Me++){var Se=W.charCodeAt(Me);Se<128?J[X++]=Se:Se<2048?(J[X++]=Se>>6|192,J[X++]=Se&63|128):m0(W,Me)?(Se=65536+((Se&1023)<<10)+(W.charCodeAt(++Me)&1023),J[X++]=Se>>18|240,J[X++]=Se>>12&63|128,J[X++]=Se>>6&63|128,J[X++]=Se&63|128):(J[X++]=Se>>12|224,J[X++]=Se>>6&63|128,J[X++]=Se&63|128)}else for(Me=0;Me<W.length;Me++)J[Me]=W[Me]|0;return J}Q.toArray=A0;function b0(W){for(var Y="",J=0;J<W.length;J++)Y+=pf(W[J].toString(16));return Y}Q.toHex=b0;function df(W){var Y=W>>>24|W>>>8&65280|W<<8&16711680|(W&255)<<24;return Y>>>0}Q.htonl=df;function y0(W,Y){for(var J="",X=0;X<W.length;X++){var Me=W[X];Y==="little"&&(Me=df(Me)),J+=vf(Me.toString(16))}return J}Q.toHex32=y0;function pf(W){return W.length===1?"0"+W:W}Q.zero2=pf;function vf(W){return W.length===7?"0"+W:W.length===6?"00"+W:W.length===5?"000"+W:W.length===4?"0000"+W:W.length===3?"00000"+W:W.length===2?"000000"+W:W.length===1?"0000000"+W:W}Q.zero8=vf;function w0(W,Y,J,X){var Me=J-Y;v0(Me%4===0);for(var Se=new Array(Me/4),Ne=0,je=Y;Ne<Se.length;Ne++,je+=4){var ke;X==="big"?ke=W[je]<<24|W[je+1]<<16|W[je+2]<<8|W[je+3]:ke=W[je+3]<<24|W[je+2]<<16|W[je+1]<<8|W[je],Se[Ne]=ke>>>0}return Se}Q.join32=w0;function x0(W,Y){for(var J=new Array(W.length*4),X=0,Me=0;X<W.length;X++,Me+=4){var Se=W[X];Y==="big"?(J[Me]=Se>>>24,J[Me+1]=Se>>>16&255,J[Me+2]=Se>>>8&255,J[Me+3]=Se&255):(J[Me+3]=Se>>>24,J[Me+2]=Se>>>16&255,J[Me+1]=Se>>>8&255,J[Me]=Se&255)}return J}Q.split32=x0;function M0(W,Y){return W>>>Y|W<<32-Y}Q.rotr32=M0;function E0(W,Y){return W<<Y|W>>>32-Y}Q.rotl32=E0;function S0$1(W,Y){return W+Y>>>0}Q.sum32=S0$1;function N0(W,Y,J){return W+Y+J>>>0}Q.sum32_3=N0;function I0(W,Y,J,X){return W+Y+J+X>>>0}Q.sum32_4=I0;function _0(W,Y,J,X,Me){return W+Y+J+X+Me>>>0}Q.sum32_5=_0;function B0(W,Y,J,X){var Me=W[Y],Se=W[Y+1],Ne=X+Se>>>0,je=(Ne<X?1:0)+J+Me;W[Y]=je>>>0,W[Y+1]=Ne}Q.sum64=B0;function C0(W,Y,J,X){var Me=Y+X>>>0,Se=(Me<Y?1:0)+W+J;return Se>>>0}Q.sum64_hi=C0;function R0(W,Y,J,X){var Me=Y+X;return Me>>>0}Q.sum64_lo=R0;function O0(W,Y,J,X,Me,Se,Ne,je){var ke=0,De=Y;De=De+X>>>0,ke+=De<Y?1:0,De=De+Se>>>0,ke+=De<Se?1:0,De=De+je>>>0,ke+=De<je?1:0;var qe=W+J+Me+Ne+ke;return qe>>>0}Q.sum64_4_hi=O0;function P0(W,Y,J,X,Me,Se,Ne,je){var ke=Y+X+Se+je;return ke>>>0}Q.sum64_4_lo=P0;function D0(W,Y,J,X,Me,Se,Ne,je,ke,De){var qe=0,Ue=Y;Ue=Ue+X>>>0,qe+=Ue<Y?1:0,Ue=Ue+Se>>>0,qe+=Ue<Se?1:0,Ue=Ue+je>>>0,qe+=Ue<je?1:0,Ue=Ue+De>>>0,qe+=Ue<De?1:0;var Ge=W+J+Me+Ne+ke+qe;return Ge>>>0}Q.sum64_5_hi=D0;function F0(W,Y,J,X,Me,Se,Ne,je,ke,De){var qe=Y+X+Se+je+De;return qe>>>0}Q.sum64_5_lo=F0;function T0$1(W,Y,J){var X=Y<<32-J|W>>>J;return X>>>0}Q.rotr64_hi=T0$1;function U0(W,Y,J){var X=W<<32-J|Y>>>J;return X>>>0}Q.rotr64_lo=U0;function k0(W,Y,J){return W>>>J}Q.shr64_hi=k0;function q0(W,Y,J){var X=W<<32-J|Y>>>J;return X>>>0}Q.shr64_lo=q0;var or={},gf=Q,K0=xr;function qr(){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}or.BlockHash=qr,qr.prototype.update=function(W,Y){if(W=gf.toArray(W,Y),this.pending?this.pending=this.pending.concat(W):this.pending=W,this.pendingTotal+=W.length,this.pending.length>=this._delta8){W=this.pending;var J=W.length%this._delta8;this.pending=W.slice(W.length-J,W.length),this.pending.length===0&&(this.pending=null),W=gf.join32(W,0,W.length-J,this.endian);for(var X=0;X<W.length;X+=this._delta32)this._update(W,X,X+this._delta32)}return this},qr.prototype.digest=function(W){return this.update(this._pad()),K0(this.pending===null),this._digest(W)},qr.prototype._pad=function(){var W=this.pendingTotal,Y=this._delta8,J=Y-(W+this.padLength)%Y,X=new Array(J+this.padLength);X[0]=128;for(var Me=1;Me<J;Me++)X[Me]=0;if(W<<=3,this.endian==="big"){for(var Se=8;Se<this.padLength;Se++)X[Me++]=0;X[Me++]=0,X[Me++]=0,X[Me++]=0,X[Me++]=0,X[Me++]=W>>>24&255,X[Me++]=W>>>16&255,X[Me++]=W>>>8&255,X[Me++]=W&255}else for(X[Me++]=W&255,X[Me++]=W>>>8&255,X[Me++]=W>>>16&255,X[Me++]=W>>>24&255,X[Me++]=0,X[Me++]=0,X[Me++]=0,X[Me++]=0,Se=8;Se<this.padLength;Se++)X[Me++]=0;return X};var sr={},ae={},H0=Q,ue=H0.rotr32;function L0$1(W,Y,J,X){if(W===0)return mf(Y,J,X);if(W===1||W===3)return bf(Y,J,X);if(W===2)return Af(Y,J,X)}ae.ft_1=L0$1;function mf(W,Y,J){return W&Y^~W&J}ae.ch32=mf;function Af(W,Y,J){return W&Y^W&J^Y&J}ae.maj32=Af;function bf(W,Y,J){return W^Y^J}ae.p32=bf;function z0(W){return ue(W,2)^ue(W,13)^ue(W,22)}ae.s0_256=z0;function j0(W){return ue(W,6)^ue(W,11)^ue(W,25)}ae.s1_256=j0;function Q0(W){return ue(W,7)^ue(W,18)^W>>>3}ae.g0_256=Q0;function J0(W){return ue(W,17)^ue(W,19)^W>>>10}ae.g1_256=J0;var ar=Q,G0=or,Y0=ae,Pi=ar.rotl32,Mr=ar.sum32,V0$1=ar.sum32_5,W0=Y0.ft_1,yf=G0.BlockHash,X0=[1518500249,1859775393,2400959708,3395469782];function he(){if(!(this instanceof he))return new he;yf.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}ar.inherits(he,yf);var Z0=he;he.blockSize=512,he.outSize=160,he.hmacStrength=80,he.padLength=64,he.prototype._update=function(W,Y){for(var J=this.W,X=0;X<16;X++)J[X]=W[Y+X];for(;X<J.length;X++)J[X]=Pi(J[X-3]^J[X-8]^J[X-14]^J[X-16],1);var Me=this.h[0],Se=this.h[1],Ne=this.h[2],je=this.h[3],ke=this.h[4];for(X=0;X<J.length;X++){var De=~~(X/20),qe=V0$1(Pi(Me,5),W0(De,Se,Ne,je),ke,J[X],X0[De]);ke=je,je=Ne,Ne=Pi(Se,30),Se=Me,Me=qe}this.h[0]=Mr(this.h[0],Me),this.h[1]=Mr(this.h[1],Se),this.h[2]=Mr(this.h[2],Ne),this.h[3]=Mr(this.h[3],je),this.h[4]=Mr(this.h[4],ke)},he.prototype._digest=function(W){return W==="hex"?ar.toHex32(this.h,"big"):ar.split32(this.h,"big")};var ur=Q,$0=or,hr=ae,ta=xr,ie=ur.sum32,ea=ur.sum32_4,ra=ur.sum32_5,ia=hr.ch32,na=hr.maj32,fa=hr.s0_256,oa=hr.s1_256,sa=hr.g0_256,aa=hr.g1_256,wf=$0.BlockHash,ua=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function ce(){if(!(this instanceof ce))return new ce;wf.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=ua,this.W=new Array(64)}ur.inherits(ce,wf);var xf=ce;ce.blockSize=512,ce.outSize=256,ce.hmacStrength=192,ce.padLength=64,ce.prototype._update=function(W,Y){for(var J=this.W,X=0;X<16;X++)J[X]=W[Y+X];for(;X<J.length;X++)J[X]=ea(aa(J[X-2]),J[X-7],sa(J[X-15]),J[X-16]);var Me=this.h[0],Se=this.h[1],Ne=this.h[2],je=this.h[3],ke=this.h[4],De=this.h[5],qe=this.h[6],Ue=this.h[7];for(ta(this.k.length===J.length),X=0;X<J.length;X++){var Ge=ra(Ue,oa(ke),ia(ke,De,qe),this.k[X],J[X]),He=ie(fa(Me),na(Me,Se,Ne));Ue=qe,qe=De,De=ke,ke=ie(je,Ge),je=Ne,Ne=Se,Se=Me,Me=ie(Ge,He)}this.h[0]=ie(this.h[0],Me),this.h[1]=ie(this.h[1],Se),this.h[2]=ie(this.h[2],Ne),this.h[3]=ie(this.h[3],je),this.h[4]=ie(this.h[4],ke),this.h[5]=ie(this.h[5],De),this.h[6]=ie(this.h[6],qe),this.h[7]=ie(this.h[7],Ue)},ce.prototype._digest=function(W){return W==="hex"?ur.toHex32(this.h,"big"):ur.split32(this.h,"big")};var Di=Q,Mf=xf;function ye(){if(!(this instanceof ye))return new ye;Mf.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Di.inherits(ye,Mf);var ha=ye;ye.blockSize=512,ye.outSize=224,ye.hmacStrength=192,ye.padLength=64,ye.prototype._digest=function(W){return W==="hex"?Di.toHex32(this.h.slice(0,7),"big"):Di.split32(this.h.slice(0,7),"big")};var jt=Q,ca=or,la=xr,le=jt.rotr64_hi,de=jt.rotr64_lo,Ef=jt.shr64_hi,Sf=jt.shr64_lo,Be=jt.sum64,Fi=jt.sum64_hi,Ti=jt.sum64_lo,da=jt.sum64_4_hi,pa=jt.sum64_4_lo,va=jt.sum64_5_hi,ga=jt.sum64_5_lo,Nf=ca.BlockHash,ma=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ne(){if(!(this instanceof ne))return new ne;Nf.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=ma,this.W=new Array(160)}jt.inherits(ne,Nf);var If=ne;ne.blockSize=1024,ne.outSize=512,ne.hmacStrength=192,ne.padLength=128,ne.prototype._prepareBlock=function(W,Y){for(var J=this.W,X=0;X<32;X++)J[X]=W[Y+X];for(;X<J.length;X+=2){var Me=_a(J[X-4],J[X-3]),Se=Ba(J[X-4],J[X-3]),Ne=J[X-14],je=J[X-13],ke=Na(J[X-30],J[X-29]),De=Ia(J[X-30],J[X-29]),qe=J[X-32],Ue=J[X-31];J[X]=da(Me,Se,Ne,je,ke,De,qe,Ue),J[X+1]=pa(Me,Se,Ne,je,ke,De,qe,Ue)}},ne.prototype._update=function(W,Y){this._prepareBlock(W,Y);var J=this.W,X=this.h[0],Me=this.h[1],Se=this.h[2],Ne=this.h[3],je=this.h[4],ke=this.h[5],De=this.h[6],qe=this.h[7],Ue=this.h[8],Ge=this.h[9],He=this.h[10],Ve=this.h[11],Ye=this.h[12],Fn=this.h[13],io=this.h[14],$o=this.h[15];la(this.k.length===J.length);for(var Jo=0;Jo<J.length;Jo+=2){var rs=io,Yo=$o,zo=Ea(Ue,Ge),jo=Sa(Ue,Ge),Vo=Aa(Ue,Ge,He,Ve,Ye),os=ba(Ue,Ge,He,Ve,Ye,Fn),us=this.k[Jo],is=this.k[Jo+1],Lo=J[Jo],Fe=J[Jo+1],Ke=va(rs,Yo,zo,jo,Vo,os,us,is,Lo,Fe),Je=ga(rs,Yo,zo,jo,Vo,os,us,is,Lo,Fe);rs=xa(X,Me),Yo=Ma(X,Me),zo=ya(X,Me,Se,Ne,je),jo=wa(X,Me,Se,Ne,je,ke);var wi=Fi(rs,Yo,zo,jo),mo=Ti(rs,Yo,zo,jo);io=Ye,$o=Fn,Ye=He,Fn=Ve,He=Ue,Ve=Ge,Ue=Fi(De,qe,Ke,Je),Ge=Ti(qe,qe,Ke,Je),De=je,qe=ke,je=Se,ke=Ne,Se=X,Ne=Me,X=Fi(Ke,Je,wi,mo),Me=Ti(Ke,Je,wi,mo)}Be(this.h,0,X,Me),Be(this.h,2,Se,Ne),Be(this.h,4,je,ke),Be(this.h,6,De,qe),Be(this.h,8,Ue,Ge),Be(this.h,10,He,Ve),Be(this.h,12,Ye,Fn),Be(this.h,14,io,$o)},ne.prototype._digest=function(W){return W==="hex"?jt.toHex32(this.h,"big"):jt.split32(this.h,"big")};function Aa(W,Y,J,X,Me){var Se=W&J^~W&Me;return Se<0&&(Se+=4294967296),Se}function ba(W,Y,J,X,Me,Se){var Ne=Y&X^~Y&Se;return Ne<0&&(Ne+=4294967296),Ne}function ya(W,Y,J,X,Me){var Se=W&J^W&Me^J&Me;return Se<0&&(Se+=4294967296),Se}function wa(W,Y,J,X,Me,Se){var Ne=Y&X^Y&Se^X&Se;return Ne<0&&(Ne+=4294967296),Ne}function xa(W,Y){var J=le(W,Y,28),X=le(Y,W,2),Me=le(Y,W,7),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Ma(W,Y){var J=de(W,Y,28),X=de(Y,W,2),Me=de(Y,W,7),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Ea(W,Y){var J=le(W,Y,14),X=le(W,Y,18),Me=le(Y,W,9),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Sa(W,Y){var J=de(W,Y,14),X=de(W,Y,18),Me=de(Y,W,9),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Na(W,Y){var J=le(W,Y,1),X=le(W,Y,8),Me=Ef(W,Y,7),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Ia(W,Y){var J=de(W,Y,1),X=de(W,Y,8),Me=Sf(W,Y,7),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function _a(W,Y){var J=le(W,Y,19),X=le(Y,W,29),Me=Ef(W,Y,6),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Ba(W,Y){var J=de(W,Y,19),X=de(Y,W,29),Me=Sf(W,Y,6),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}var Ui=Q,_f=If;function we(){if(!(this instanceof we))return new we;_f.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Ui.inherits(we,_f);var Ca=we;we.blockSize=1024,we.outSize=384,we.hmacStrength=192,we.padLength=128,we.prototype._digest=function(W){return W==="hex"?Ui.toHex32(this.h.slice(0,12),"big"):Ui.split32(this.h.slice(0,12),"big")},sr.sha1=Z0,sr.sha224=ha,sr.sha256=xf,sr.sha384=Ca,sr.sha512=If;var Bf={},Xe=Q,Ra=or,Kr=Xe.rotl32,Cf=Xe.sum32,Er=Xe.sum32_3,Rf=Xe.sum32_4,Of=Ra.BlockHash;function pe(){if(!(this instanceof pe))return new pe;Of.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Xe.inherits(pe,Of),Bf.ripemd160=pe,pe.blockSize=512,pe.outSize=160,pe.hmacStrength=192,pe.padLength=64,pe.prototype._update=function(W,Y){for(var J=this.h[0],X=this.h[1],Me=this.h[2],Se=this.h[3],Ne=this.h[4],je=J,ke=X,De=Me,qe=Se,Ue=Ne,Ge=0;Ge<80;Ge++){var He=Cf(Kr(Rf(J,Pf(Ge,X,Me,Se),W[Da[Ge]+Y],Oa(Ge)),Ta[Ge]),Ne);J=Ne,Ne=Se,Se=Kr(Me,10),Me=X,X=He,He=Cf(Kr(Rf(je,Pf(79-Ge,ke,De,qe),W[Fa[Ge]+Y],Pa(Ge)),Ua[Ge]),Ue),je=Ue,Ue=qe,qe=Kr(De,10),De=ke,ke=He}He=Er(this.h[1],Me,qe),this.h[1]=Er(this.h[2],Se,Ue),this.h[2]=Er(this.h[3],Ne,je),this.h[3]=Er(this.h[4],J,ke),this.h[4]=Er(this.h[0],X,De),this.h[0]=He},pe.prototype._digest=function(W){return W==="hex"?Xe.toHex32(this.h,"little"):Xe.split32(this.h,"little")};function Pf(W,Y,J,X){return W<=15?Y^J^X:W<=31?Y&J|~Y&X:W<=47?(Y|~J)^X:W<=63?Y&X|J&~X:Y^(J|~X)}function Oa(W){return W<=15?0:W<=31?1518500249:W<=47?1859775393:W<=63?2400959708:2840853838}function Pa(W){return W<=15?1352829926:W<=31?1548603684:W<=47?1836072691:W<=63?2053994217:0}var Da=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Fa=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ta=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Ua=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],ka=Q,qa=xr;function cr(W,Y,J){if(!(this instanceof cr))return new cr(W,Y,J);this.Hash=W,this.blockSize=W.blockSize/8,this.outSize=W.outSize/8,this.inner=null,this.outer=null,this._init(ka.toArray(Y,J))}var Ka=cr;cr.prototype._init=function(W){W.length>this.blockSize&&(W=new this.Hash().update(W).digest()),qa(W.length<=this.blockSize);for(var Y=W.length;Y<this.blockSize;Y++)W.push(0);for(Y=0;Y<W.length;Y++)W[Y]^=54;for(this.inner=new this.Hash().update(W),Y=0;Y<W.length;Y++)W[Y]^=106;this.outer=new this.Hash().update(W)},cr.prototype.update=function(W,Y){return this.inner.update(W,Y),this},cr.prototype.digest=function(W){return this.outer.update(this.inner.digest()),this.outer.digest(W)},function(W){var Y=W;Y.utils=Q,Y.common=or,Y.sha=sr,Y.ripemd=Bf,Y.hmac=Ka,Y.sha1=Y.sha.sha1,Y.sha256=Y.sha.sha256,Y.sha224=Y.sha.sha224,Y.sha384=Y.sha.sha384,Y.sha512=Y.sha.sha512,Y.ripemd160=Y.ripemd.ripemd160}(se);function lr(W,Y,J){return J={path:Y,exports:{},require:function(X,Me){return Ha(X,Me??J.path)}},W(J,J.exports),J.exports}function Ha(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var ki=Df;function Df(W,Y){if(!W)throw new Error(Y||"Assertion failed")}Df.equal=function(W,Y,J){if(W!=Y)throw new Error(J||"Assertion failed: "+W+" != "+Y)};var fe=lr(function(W,Y){var J=Y;function X(Ne,je){if(Array.isArray(Ne))return Ne.slice();if(!Ne)return[];var ke=[];if(typeof Ne!="string"){for(var De=0;De<Ne.length;De++)ke[De]=Ne[De]|0;return ke}if(je==="hex"){Ne=Ne.replace(/[^a-z0-9]+/ig,""),Ne.length%2!==0&&(Ne="0"+Ne);for(var De=0;De<Ne.length;De+=2)ke.push(parseInt(Ne[De]+Ne[De+1],16))}else for(var De=0;De<Ne.length;De++){var qe=Ne.charCodeAt(De),Ue=qe>>8,Ge=qe&255;Ue?ke.push(Ue,Ge):ke.push(Ge)}return ke}J.toArray=X;function Me(Ne){return Ne.length===1?"0"+Ne:Ne}J.zero2=Me;function Se(Ne){for(var je="",ke=0;ke<Ne.length;ke++)je+=Me(Ne[ke].toString(16));return je}J.toHex=Se,J.encode=function(Ne,je){return je==="hex"?Se(Ne):Ne}}),Gt=lr(function(W,Y){var J=Y;J.assert=ki,J.toArray=fe.toArray,J.zero2=fe.zero2,J.toHex=fe.toHex,J.encode=fe.encode;function X(ke,De,qe){var Ue=new Array(Math.max(ke.bitLength(),qe)+1);Ue.fill(0);for(var Ge=1<<De+1,He=ke.clone(),Ve=0;Ve<Ue.length;Ve++){var Ye,Fn=He.andln(Ge-1);He.isOdd()?(Fn>(Ge>>1)-1?Ye=(Ge>>1)-Fn:Ye=Fn,He.isubn(Ye)):Ye=0,Ue[Ve]=Ye,He.iushrn(1)}return Ue}J.getNAF=X;function Me(ke,De){var qe=[[],[]];ke=ke.clone(),De=De.clone();for(var Ue=0,Ge=0,He;ke.cmpn(-Ue)>0||De.cmpn(-Ge)>0;){var Ve=ke.andln(3)+Ue&3,Ye=De.andln(3)+Ge&3;Ve===3&&(Ve=-1),Ye===3&&(Ye=-1);var Fn;Ve&1?(He=ke.andln(7)+Ue&7,(He===3||He===5)&&Ye===2?Fn=-Ve:Fn=Ve):Fn=0,qe[0].push(Fn);var io;Ye&1?(He=De.andln(7)+Ge&7,(He===3||He===5)&&Ve===2?io=-Ye:io=Ye):io=0,qe[1].push(io),2*Ue===Fn+1&&(Ue=1-Ue),2*Ge===io+1&&(Ge=1-Ge),ke.iushrn(1),De.iushrn(1)}return qe}J.getJSF=Me;function Se(ke,De,qe){var Ue="_"+De;ke.prototype[De]=function(){return this[Ue]!==void 0?this[Ue]:this[Ue]=qe.call(this)}}J.cachedProperty=Se;function Ne(ke){return typeof ke=="string"?J.toArray(ke,"hex"):ke}J.parseBytes=Ne;function je(ke){return new K(ke,"hex","le")}J.intFromLE=je}),Hr=Gt.getNAF,La=Gt.getJSF,Lr=Gt.assert;function Ce(W,Y){this.type=W,this.p=new K(Y.p,16),this.red=Y.prime?K.red(Y.prime):K.mont(this.p),this.zero=new K(0).toRed(this.red),this.one=new K(1).toRed(this.red),this.two=new K(2).toRed(this.red),this.n=Y.n&&new K(Y.n,16),this.g=Y.g&&this.pointFromJSON(Y.g,Y.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 J=this.n&&this.p.div(this.n);!J||J.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ze=Ce;Ce.prototype.point=function(){throw new Error("Not implemented")},Ce.prototype.validate=function(){throw new Error("Not implemented")},Ce.prototype._fixedNafMul=function(W,Y){Lr(W.precomputed);var J=W._getDoubles(),X=Hr(Y,1,this._bitLength),Me=(1<<J.step+1)-(J.step%2===0?2:1);Me/=3;var Se=[],Ne,je;for(Ne=0;Ne<X.length;Ne+=J.step){je=0;for(var ke=Ne+J.step-1;ke>=Ne;ke--)je=(je<<1)+X[ke];Se.push(je)}for(var De=this.jpoint(null,null,null),qe=this.jpoint(null,null,null),Ue=Me;Ue>0;Ue--){for(Ne=0;Ne<Se.length;Ne++)je=Se[Ne],je===Ue?qe=qe.mixedAdd(J.points[Ne]):je===-Ue&&(qe=qe.mixedAdd(J.points[Ne].neg()));De=De.add(qe)}return De.toP()},Ce.prototype._wnafMul=function(W,Y){var J=4,X=W._getNAFPoints(J);J=X.wnd;for(var Me=X.points,Se=Hr(Y,J,this._bitLength),Ne=this.jpoint(null,null,null),je=Se.length-1;je>=0;je--){for(var ke=0;je>=0&&Se[je]===0;je--)ke++;if(je>=0&&ke++,Ne=Ne.dblp(ke),je<0)break;var De=Se[je];Lr(De!==0),W.type==="affine"?De>0?Ne=Ne.mixedAdd(Me[De-1>>1]):Ne=Ne.mixedAdd(Me[-De-1>>1].neg()):De>0?Ne=Ne.add(Me[De-1>>1]):Ne=Ne.add(Me[-De-1>>1].neg())}return W.type==="affine"?Ne.toP():Ne},Ce.prototype._wnafMulAdd=function(W,Y,J,X,Me){var Se=this._wnafT1,Ne=this._wnafT2,je=this._wnafT3,ke=0,De,qe,Ue;for(De=0;De<X;De++){Ue=Y[De];var Ge=Ue._getNAFPoints(W);Se[De]=Ge.wnd,Ne[De]=Ge.points}for(De=X-1;De>=1;De-=2){var He=De-1,Ve=De;if(Se[He]!==1||Se[Ve]!==1){je[He]=Hr(J[He],Se[He],this._bitLength),je[Ve]=Hr(J[Ve],Se[Ve],this._bitLength),ke=Math.max(je[He].length,ke),ke=Math.max(je[Ve].length,ke);continue}var Ye=[Y[He],null,null,Y[Ve]];Y[He].y.cmp(Y[Ve].y)===0?(Ye[1]=Y[He].add(Y[Ve]),Ye[2]=Y[He].toJ().mixedAdd(Y[Ve].neg())):Y[He].y.cmp(Y[Ve].y.redNeg())===0?(Ye[1]=Y[He].toJ().mixedAdd(Y[Ve]),Ye[2]=Y[He].add(Y[Ve].neg())):(Ye[1]=Y[He].toJ().mixedAdd(Y[Ve]),Ye[2]=Y[He].toJ().mixedAdd(Y[Ve].neg()));var Fn=[-3,-1,-5,-7,0,7,5,1,3],io=La(J[He],J[Ve]);for(ke=Math.max(io[0].length,ke),je[He]=new Array(ke),je[Ve]=new Array(ke),qe=0;qe<ke;qe++){var $o=io[0][qe]|0,Jo=io[1][qe]|0;je[He][qe]=Fn[($o+1)*3+(Jo+1)],je[Ve][qe]=0,Ne[He]=Ye}}var rs=this.jpoint(null,null,null),Yo=this._wnafT4;for(De=ke;De>=0;De--){for(var zo=0;De>=0;){var jo=!0;for(qe=0;qe<X;qe++)Yo[qe]=je[qe][De]|0,Yo[qe]!==0&&(jo=!1);if(!jo)break;zo++,De--}if(De>=0&&zo++,rs=rs.dblp(zo),De<0)break;for(qe=0;qe<X;qe++){var Vo=Yo[qe];Vo!==0&&(Vo>0?Ue=Ne[qe][Vo-1>>1]:Vo<0&&(Ue=Ne[qe][-Vo-1>>1].neg()),Ue.type==="affine"?rs=rs.mixedAdd(Ue):rs=rs.add(Ue))}}for(De=0;De<X;De++)Ne[De]=null;return Me?rs:rs.toP()};function $t(W,Y){this.curve=W,this.type=Y,this.precomputed=null}Ce.BasePoint=$t,$t.prototype.eq=function(){throw new Error("Not implemented")},$t.prototype.validate=function(){return this.curve.validate(this)},Ce.prototype.decodePoint=function(W,Y){W=Gt.toArray(W,Y);var J=this.p.byteLength();if((W[0]===4||W[0]===6||W[0]===7)&&W.length-1===2*J){W[0]===6?Lr(W[W.length-1]%2===0):W[0]===7&&Lr(W[W.length-1]%2===1);var X=this.point(W.slice(1,1+J),W.slice(1+J,1+2*J));return X}else if((W[0]===2||W[0]===3)&&W.length-1===J)return this.pointFromX(W.slice(1,1+J),W[0]===3);throw new Error("Unknown point format")},$t.prototype.encodeCompressed=function(W){return this.encode(W,!0)},$t.prototype._encode=function(W){var Y=this.curve.p.byteLength(),J=this.getX().toArray("be",Y);return W?[this.getY().isEven()?2:3].concat(J):[4].concat(J,this.getY().toArray("be",Y))},$t.prototype.encode=function(W,Y){return Gt.encode(this._encode(Y),W)},$t.prototype.precompute=function(W){if(this.precomputed)return this;var Y={doubles:null,naf:null,beta:null};return Y.naf=this._getNAFPoints(8),Y.doubles=this._getDoubles(4,W),Y.beta=this._getBeta(),this.precomputed=Y,this},$t.prototype._hasDoubles=function(W){if(!this.precomputed)return!1;var Y=this.precomputed.doubles;return Y?Y.points.length>=Math.ceil((W.bitLength()+1)/Y.step):!1},$t.prototype._getDoubles=function(W,Y){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var J=[this],X=this,Me=0;Me<Y;Me+=W){for(var Se=0;Se<W;Se++)X=X.dbl();J.push(X)}return{step:W,points:J}},$t.prototype._getNAFPoints=function(W){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var Y=[this],J=(1<<W)-1,X=J===1?null:this.dbl(),Me=1;Me<J;Me++)Y[Me]=Y[Me-1].add(X);return{wnd:W,points:Y}},$t.prototype._getBeta=function(){return null},$t.prototype.dblp=function(W){for(var Y=this,J=0;J<W;J++)Y=Y.dbl();return Y};var qi=lr(function(W){typeof Object.create=="function"?W.exports=function(Y,J){J&&(Y.super_=J,Y.prototype=Object.create(J.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}}))}:W.exports=function(Y,J){if(J){Y.super_=J;var X=function(){};X.prototype=J.prototype,Y.prototype=new X,Y.prototype.constructor=Y}}}),za=Gt.assert;function te(W){Ze.call(this,"short",W),this.a=new K(W.a,16).toRed(this.red),this.b=new K(W.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(W),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}qi(te,Ze);var ja=te;te.prototype._getEndomorphism=function(W){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var Y,J;if(W.beta)Y=new K(W.beta,16).toRed(this.red);else{var X=this._getEndoRoots(this.p);Y=X[0].cmp(X[1])<0?X[0]:X[1],Y=Y.toRed(this.red)}if(W.lambda)J=new K(W.lambda,16);else{var Me=this._getEndoRoots(this.n);this.g.mul(Me[0]).x.cmp(this.g.x.redMul(Y))===0?J=Me[0]:(J=Me[1],za(this.g.mul(J).x.cmp(this.g.x.redMul(Y))===0))}var Se;return W.basis?Se=W.basis.map(function(Ne){return{a:new K(Ne.a,16),b:new K(Ne.b,16)}}):Se=this._getEndoBasis(J),{beta:Y,lambda:J,basis:Se}}},te.prototype._getEndoRoots=function(W){var Y=W===this.p?this.red:K.mont(W),J=new K(2).toRed(Y).redInvm(),X=J.redNeg(),Me=new K(3).toRed(Y).redNeg().redSqrt().redMul(J),Se=X.redAdd(Me).fromRed(),Ne=X.redSub(Me).fromRed();return[Se,Ne]},te.prototype._getEndoBasis=function(W){for(var Y=this.n.ushrn(Math.floor(this.n.bitLength()/2)),J=W,X=this.n.clone(),Me=new K(1),Se=new K(0),Ne=new K(0),je=new K(1),ke,De,qe,Ue,Ge,He,Ve,Ye=0,Fn,io;J.cmpn(0)!==0;){var $o=X.div(J);Fn=X.sub($o.mul(J)),io=Ne.sub($o.mul(Me));var Jo=je.sub($o.mul(Se));if(!qe&&Fn.cmp(Y)<0)ke=Ve.neg(),De=Me,qe=Fn.neg(),Ue=io;else if(qe&&++Ye===2)break;Ve=Fn,X=J,J=Fn,Ne=Me,Me=io,je=Se,Se=Jo}Ge=Fn.neg(),He=io;var rs=qe.sqr().add(Ue.sqr()),Yo=Ge.sqr().add(He.sqr());return Yo.cmp(rs)>=0&&(Ge=ke,He=De),qe.negative&&(qe=qe.neg(),Ue=Ue.neg()),Ge.negative&&(Ge=Ge.neg(),He=He.neg()),[{a:qe,b:Ue},{a:Ge,b:He}]},te.prototype._endoSplit=function(W){var Y=this.endo.basis,J=Y[0],X=Y[1],Me=X.b.mul(W).divRound(this.n),Se=J.b.neg().mul(W).divRound(this.n),Ne=Me.mul(J.a),je=Se.mul(X.a),ke=Me.mul(J.b),De=Se.mul(X.b),qe=W.sub(Ne).sub(je),Ue=ke.add(De).neg();return{k1:qe,k2:Ue}},te.prototype.pointFromX=function(W,Y){W=new K(W,16),W.red||(W=W.toRed(this.red));var J=W.redSqr().redMul(W).redIAdd(W.redMul(this.a)).redIAdd(this.b),X=J.redSqrt();if(X.redSqr().redSub(J).cmp(this.zero)!==0)throw new Error("invalid point");var Me=X.fromRed().isOdd();return(Y&&!Me||!Y&&Me)&&(X=X.redNeg()),this.point(W,X)},te.prototype.validate=function(W){if(W.inf)return!0;var Y=W.x,J=W.y,X=this.a.redMul(Y),Me=Y.redSqr().redMul(Y).redIAdd(X).redIAdd(this.b);return J.redSqr().redISub(Me).cmpn(0)===0},te.prototype._endoWnafMulAdd=function(W,Y,J){for(var X=this._endoWnafT1,Me=this._endoWnafT2,Se=0;Se<W.length;Se++){var Ne=this._endoSplit(Y[Se]),je=W[Se],ke=je._getBeta();Ne.k1.negative&&(Ne.k1.ineg(),je=je.neg(!0)),Ne.k2.negative&&(Ne.k2.ineg(),ke=ke.neg(!0)),X[Se*2]=je,X[Se*2+1]=ke,Me[Se*2]=Ne.k1,Me[Se*2+1]=Ne.k2}for(var De=this._wnafMulAdd(1,X,Me,Se*2,J),qe=0;qe<Se*2;qe++)X[qe]=null,Me[qe]=null;return De};function Ft(W,Y,J,X){Ze.BasePoint.call(this,W,"affine"),Y===null&&J===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new K(Y,16),this.y=new K(J,16),X&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}qi(Ft,Ze.BasePoint),te.prototype.point=function(W,Y,J){return new Ft(this,W,Y,J)},te.prototype.pointFromJSON=function(W,Y){return Ft.fromJSON(this,W,Y)},Ft.prototype._getBeta=function(){if(this.curve.endo){var W=this.precomputed;if(W&&W.beta)return W.beta;var Y=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(W){var J=this.curve,X=function(Me){return J.point(Me.x.redMul(J.endo.beta),Me.y)};W.beta=Y,Y.precomputed={beta:null,naf:W.naf&&{wnd:W.naf.wnd,points:W.naf.points.map(X)},doubles:W.doubles&&{step:W.doubles.step,points:W.doubles.points.map(X)}}}return Y}},Ft.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Ft.fromJSON=function(W,Y,J){typeof Y=="string"&&(Y=JSON.parse(Y));var X=W.point(Y[0],Y[1],J);if(!Y[2])return X;function Me(Ne){return W.point(Ne[0],Ne[1],J)}var Se=Y[2];return X.precomputed={beta:null,doubles:Se.doubles&&{step:Se.doubles.step,points:[X].concat(Se.doubles.points.map(Me))},naf:Se.naf&&{wnd:Se.naf.wnd,points:[X].concat(Se.naf.points.map(Me))}},X},Ft.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Ft.prototype.isInfinity=function(){return this.inf},Ft.prototype.add=function(W){if(this.inf)return W;if(W.inf)return this;if(this.eq(W))return this.dbl();if(this.neg().eq(W))return this.curve.point(null,null);if(this.x.cmp(W.x)===0)return this.curve.point(null,null);var Y=this.y.redSub(W.y);Y.cmpn(0)!==0&&(Y=Y.redMul(this.x.redSub(W.x).redInvm()));var J=Y.redSqr().redISub(this.x).redISub(W.x),X=Y.redMul(this.x.redSub(J)).redISub(this.y);return this.curve.point(J,X)},Ft.prototype.dbl=function(){if(this.inf)return this;var W=this.y.redAdd(this.y);if(W.cmpn(0)===0)return this.curve.point(null,null);var Y=this.curve.a,J=this.x.redSqr(),X=W.redInvm(),Me=J.redAdd(J).redIAdd(J).redIAdd(Y).redMul(X),Se=Me.redSqr().redISub(this.x.redAdd(this.x)),Ne=Me.redMul(this.x.redSub(Se)).redISub(this.y);return this.curve.point(Se,Ne)},Ft.prototype.getX=function(){return this.x.fromRed()},Ft.prototype.getY=function(){return this.y.fromRed()},Ft.prototype.mul=function(W){return W=new K(W,16),this.isInfinity()?this:this._hasDoubles(W)?this.curve._fixedNafMul(this,W):this.curve.endo?this.curve._endoWnafMulAdd([this],[W]):this.curve._wnafMul(this,W)},Ft.prototype.mulAdd=function(W,Y,J){var X=[this,Y],Me=[W,J];return this.curve.endo?this.curve._endoWnafMulAdd(X,Me):this.curve._wnafMulAdd(1,X,Me,2)},Ft.prototype.jmulAdd=function(W,Y,J){var X=[this,Y],Me=[W,J];return this.curve.endo?this.curve._endoWnafMulAdd(X,Me,!0):this.curve._wnafMulAdd(1,X,Me,2,!0)},Ft.prototype.eq=function(W){return this===W||this.inf===W.inf&&(this.inf||this.x.cmp(W.x)===0&&this.y.cmp(W.y)===0)},Ft.prototype.neg=function(W){if(this.inf)return this;var Y=this.curve.point(this.x,this.y.redNeg());if(W&&this.precomputed){var J=this.precomputed,X=function(Me){return Me.neg()};Y.precomputed={naf:J.naf&&{wnd:J.naf.wnd,points:J.naf.points.map(X)},doubles:J.doubles&&{step:J.doubles.step,points:J.doubles.points.map(X)}}}return Y},Ft.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var W=this.curve.jpoint(this.x,this.y,this.curve.one);return W};function Tt(W,Y,J,X){Ze.BasePoint.call(this,W,"jacobian"),Y===null&&J===null&&X===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new K(0)):(this.x=new K(Y,16),this.y=new K(J,16),this.z=new K(X,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}qi(Tt,Ze.BasePoint),te.prototype.jpoint=function(W,Y,J){return new Tt(this,W,Y,J)},Tt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var W=this.z.redInvm(),Y=W.redSqr(),J=this.x.redMul(Y),X=this.y.redMul(Y).redMul(W);return this.curve.point(J,X)},Tt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Tt.prototype.add=function(W){if(this.isInfinity())return W;if(W.isInfinity())return this;var Y=W.z.redSqr(),J=this.z.redSqr(),X=this.x.redMul(Y),Me=W.x.redMul(J),Se=this.y.redMul(Y.redMul(W.z)),Ne=W.y.redMul(J.redMul(this.z)),je=X.redSub(Me),ke=Se.redSub(Ne);if(je.cmpn(0)===0)return ke.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var De=je.redSqr(),qe=De.redMul(je),Ue=X.redMul(De),Ge=ke.redSqr().redIAdd(qe).redISub(Ue).redISub(Ue),He=ke.redMul(Ue.redISub(Ge)).redISub(Se.redMul(qe)),Ve=this.z.redMul(W.z).redMul(je);return this.curve.jpoint(Ge,He,Ve)},Tt.prototype.mixedAdd=function(W){if(this.isInfinity())return W.toJ();if(W.isInfinity())return this;var Y=this.z.redSqr(),J=this.x,X=W.x.redMul(Y),Me=this.y,Se=W.y.redMul(Y).redMul(this.z),Ne=J.redSub(X),je=Me.redSub(Se);if(Ne.cmpn(0)===0)return je.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ke=Ne.redSqr(),De=ke.redMul(Ne),qe=J.redMul(ke),Ue=je.redSqr().redIAdd(De).redISub(qe).redISub(qe),Ge=je.redMul(qe.redISub(Ue)).redISub(Me.redMul(De)),He=this.z.redMul(Ne);return this.curve.jpoint(Ue,Ge,He)},Tt.prototype.dblp=function(W){if(W===0)return this;if(this.isInfinity())return this;if(!W)return this.dbl();var Y;if(this.curve.zeroA||this.curve.threeA){var J=this;for(Y=0;Y<W;Y++)J=J.dbl();return J}var X=this.curve.a,Me=this.curve.tinv,Se=this.x,Ne=this.y,je=this.z,ke=je.redSqr().redSqr(),De=Ne.redAdd(Ne);for(Y=0;Y<W;Y++){var qe=Se.redSqr(),Ue=De.redSqr(),Ge=Ue.redSqr(),He=qe.redAdd(qe).redIAdd(qe).redIAdd(X.redMul(ke)),Ve=Se.redMul(Ue),Ye=He.redSqr().redISub(Ve.redAdd(Ve)),Fn=Ve.redISub(Ye),io=He.redMul(Fn);io=io.redIAdd(io).redISub(Ge);var $o=De.redMul(je);Y+1<W&&(ke=ke.redMul(Ge)),Se=Ye,je=$o,De=io}return this.curve.jpoint(Se,De.redMul(Me),je)},Tt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Tt.prototype._zeroDbl=function(){var W,Y,J;if(this.zOne){var X=this.x.redSqr(),Me=this.y.redSqr(),Se=Me.redSqr(),Ne=this.x.redAdd(Me).redSqr().redISub(X).redISub(Se);Ne=Ne.redIAdd(Ne);var je=X.redAdd(X).redIAdd(X),ke=je.redSqr().redISub(Ne).redISub(Ne),De=Se.redIAdd(Se);De=De.redIAdd(De),De=De.redIAdd(De),W=ke,Y=je.redMul(Ne.redISub(ke)).redISub(De),J=this.y.redAdd(this.y)}else{var qe=this.x.redSqr(),Ue=this.y.redSqr(),Ge=Ue.redSqr(),He=this.x.redAdd(Ue).redSqr().redISub(qe).redISub(Ge);He=He.redIAdd(He);var Ve=qe.redAdd(qe).redIAdd(qe),Ye=Ve.redSqr(),Fn=Ge.redIAdd(Ge);Fn=Fn.redIAdd(Fn),Fn=Fn.redIAdd(Fn),W=Ye.redISub(He).redISub(He),Y=Ve.redMul(He.redISub(W)).redISub(Fn),J=this.y.redMul(this.z),J=J.redIAdd(J)}return this.curve.jpoint(W,Y,J)},Tt.prototype._threeDbl=function(){var W,Y,J;if(this.zOne){var X=this.x.redSqr(),Me=this.y.redSqr(),Se=Me.redSqr(),Ne=this.x.redAdd(Me).redSqr().redISub(X).redISub(Se);Ne=Ne.redIAdd(Ne);var je=X.redAdd(X).redIAdd(X).redIAdd(this.curve.a),ke=je.redSqr().redISub(Ne).redISub(Ne);W=ke;var De=Se.redIAdd(Se);De=De.redIAdd(De),De=De.redIAdd(De),Y=je.redMul(Ne.redISub(ke)).redISub(De),J=this.y.redAdd(this.y)}else{var qe=this.z.redSqr(),Ue=this.y.redSqr(),Ge=this.x.redMul(Ue),He=this.x.redSub(qe).redMul(this.x.redAdd(qe));He=He.redAdd(He).redIAdd(He);var Ve=Ge.redIAdd(Ge);Ve=Ve.redIAdd(Ve);var Ye=Ve.redAdd(Ve);W=He.redSqr().redISub(Ye),J=this.y.redAdd(this.z).redSqr().redISub(Ue).redISub(qe);var Fn=Ue.redSqr();Fn=Fn.redIAdd(Fn),Fn=Fn.redIAdd(Fn),Fn=Fn.redIAdd(Fn),Y=He.redMul(Ve.redISub(W)).redISub(Fn)}return this.curve.jpoint(W,Y,J)},Tt.prototype._dbl=function(){var W=this.curve.a,Y=this.x,J=this.y,X=this.z,Me=X.redSqr().redSqr(),Se=Y.redSqr(),Ne=J.redSqr(),je=Se.redAdd(Se).redIAdd(Se).redIAdd(W.redMul(Me)),ke=Y.redAdd(Y);ke=ke.redIAdd(ke);var De=ke.redMul(Ne),qe=je.redSqr().redISub(De.redAdd(De)),Ue=De.redISub(qe),Ge=Ne.redSqr();Ge=Ge.redIAdd(Ge),Ge=Ge.redIAdd(Ge),Ge=Ge.redIAdd(Ge);var He=je.redMul(Ue).redISub(Ge),Ve=J.redAdd(J).redMul(X);return this.curve.jpoint(qe,He,Ve)},Tt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var W=this.x.redSqr(),Y=this.y.redSqr(),J=this.z.redSqr(),X=Y.redSqr(),Me=W.redAdd(W).redIAdd(W),Se=Me.redSqr(),Ne=this.x.redAdd(Y).redSqr().redISub(W).redISub(X);Ne=Ne.redIAdd(Ne),Ne=Ne.redAdd(Ne).redIAdd(Ne),Ne=Ne.redISub(Se);var je=Ne.redSqr(),ke=X.redIAdd(X);ke=ke.redIAdd(ke),ke=ke.redIAdd(ke),ke=ke.redIAdd(ke);var De=Me.redIAdd(Ne).redSqr().redISub(Se).redISub(je).redISub(ke),qe=Y.redMul(De);qe=qe.redIAdd(qe),qe=qe.redIAdd(qe);var Ue=this.x.redMul(je).redISub(qe);Ue=Ue.redIAdd(Ue),Ue=Ue.redIAdd(Ue);var Ge=this.y.redMul(De.redMul(ke.redISub(De)).redISub(Ne.redMul(je)));Ge=Ge.redIAdd(Ge),Ge=Ge.redIAdd(Ge),Ge=Ge.redIAdd(Ge);var He=this.z.redAdd(Ne).redSqr().redISub(J).redISub(je);return this.curve.jpoint(Ue,Ge,He)},Tt.prototype.mul=function(W,Y){return W=new K(W,Y),this.curve._wnafMul(this,W)},Tt.prototype.eq=function(W){if(W.type==="affine")return this.eq(W.toJ());if(this===W)return!0;var Y=this.z.redSqr(),J=W.z.redSqr();if(this.x.redMul(J).redISub(W.x.redMul(Y)).cmpn(0)!==0)return!1;var X=Y.redMul(this.z),Me=J.redMul(W.z);return this.y.redMul(Me).redISub(W.y.redMul(X)).cmpn(0)===0},Tt.prototype.eqXToP=function(W){var Y=this.z.redSqr(),J=W.toRed(this.curve.red).redMul(Y);if(this.x.cmp(J)===0)return!0;for(var X=W.clone(),Me=this.curve.redN.redMul(Y);;){if(X.iadd(this.curve.n),X.cmp(this.curve.p)>=0)return!1;if(J.redIAdd(Me),this.x.cmp(J)===0)return!0}},Tt.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Tt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var zr=lr(function(W,Y){var J=Y;J.base=Ze,J.short=ja,J.mont=null,J.edwards=null}),jr=lr(function(W,Y){var J=Y,X=Gt.assert;function Me(je){je.type==="short"?this.curve=new zr.short(je):je.type==="edwards"?this.curve=new zr.edwards(je):this.curve=new zr.mont(je),this.g=this.curve.g,this.n=this.curve.n,this.hash=je.hash,X(this.g.validate(),"Invalid curve"),X(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}J.PresetCurve=Me;function Se(je,ke){Object.defineProperty(J,je,{configurable:!0,enumerable:!0,get:function(){var De=new Me(ke);return Object.defineProperty(J,je,{configurable:!0,enumerable:!0,value:De}),De}})}Se("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:se.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),Se("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:se.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),Se("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:se.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),Se("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:se.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"]}),Se("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:se.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"]}),Se("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:se.sha256,gRed:!1,g:["9"]}),Se("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:se.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Ne;try{Ne=null.crash()}catch{Ne=void 0}Se("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:se.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Ne]})});function Re(W){if(!(this instanceof Re))return new Re(W);this.hash=W.hash,this.predResist=!!W.predResist,this.outLen=this.hash.outSize,this.minEntropy=W.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var Y=fe.toArray(W.entropy,W.entropyEnc||"hex"),J=fe.toArray(W.nonce,W.nonceEnc||"hex"),X=fe.toArray(W.pers,W.persEnc||"hex");ki(Y.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Y,J,X)}var Ff=Re;Re.prototype._init=function(W,Y,J){var X=W.concat(Y).concat(J);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var Me=0;Me<this.V.length;Me++)this.K[Me]=0,this.V[Me]=1;this._update(X),this._reseed=1,this.reseedInterval=281474976710656},Re.prototype._hmac=function(){return new se.hmac(this.hash,this.K)},Re.prototype._update=function(W){var Y=this._hmac().update(this.V).update([0]);W&&(Y=Y.update(W)),this.K=Y.digest(),this.V=this._hmac().update(this.V).digest(),W&&(this.K=this._hmac().update(this.V).update([1]).update(W).digest(),this.V=this._hmac().update(this.V).digest())},Re.prototype.reseed=function(W,Y,J,X){typeof Y!="string"&&(X=J,J=Y,Y=null),W=fe.toArray(W,Y),J=fe.toArray(J,X),ki(W.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(W.concat(J||[])),this._reseed=1},Re.prototype.generate=function(W,Y,J,X){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof Y!="string"&&(X=J,J=Y,Y=null),J&&(J=fe.toArray(J,X||"hex"),this._update(J));for(var Me=[];Me.length<W;)this.V=this._hmac().update(this.V).digest(),Me=Me.concat(this.V);var Se=Me.slice(0,W);return this._update(J),this._reseed++,fe.encode(Se,Y)};var Ki=Gt.assert;function kt(W,Y){this.ec=W,this.priv=null,this.pub=null,Y.priv&&this._importPrivate(Y.priv,Y.privEnc),Y.pub&&this._importPublic(Y.pub,Y.pubEnc)}var Hi=kt;kt.fromPublic=function(W,Y,J){return Y instanceof kt?Y:new kt(W,{pub:Y,pubEnc:J})},kt.fromPrivate=function(W,Y,J){return Y instanceof kt?Y:new kt(W,{priv:Y,privEnc:J})},kt.prototype.validate=function(){var W=this.getPublic();return W.isInfinity()?{result:!1,reason:"Invalid public key"}:W.validate()?W.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},kt.prototype.getPublic=function(W,Y){return typeof W=="string"&&(Y=W,W=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),Y?this.pub.encode(Y,W):this.pub},kt.prototype.getPrivate=function(W){return W==="hex"?this.priv.toString(16,2):this.priv},kt.prototype._importPrivate=function(W,Y){this.priv=new K(W,Y||16),this.priv=this.priv.umod(this.ec.curve.n)},kt.prototype._importPublic=function(W,Y){if(W.x||W.y){this.ec.curve.type==="mont"?Ki(W.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Ki(W.x&&W.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(W.x,W.y);return}this.pub=this.ec.curve.decodePoint(W,Y)},kt.prototype.derive=function(W){return W.validate()||Ki(W.validate(),"public point not validated"),W.mul(this.priv).getX()},kt.prototype.sign=function(W,Y,J){return this.ec.sign(W,this,Y,J)},kt.prototype.verify=function(W,Y){return this.ec.verify(W,Y,this)},kt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Qa=Gt.assert;function Qr(W,Y){if(W instanceof Qr)return W;this._importDER(W,Y)||(Qa(W.r&&W.s,"Signature without r or s"),this.r=new K(W.r,16),this.s=new K(W.s,16),W.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=W.recoveryParam)}var Jr=Qr;function Ja(){this.place=0}function Li(W,Y){var J=W[Y.place++];if(!(J&128))return J;var X=J&15;if(X===0||X>4)return!1;for(var Me=0,Se=0,Ne=Y.place;Se<X;Se++,Ne++)Me<<=8,Me|=W[Ne],Me>>>=0;return Me<=127?!1:(Y.place=Ne,Me)}function Tf(W){for(var Y=0,J=W.length-1;!W[Y]&&!(W[Y+1]&128)&&Y<J;)Y++;return Y===0?W:W.slice(Y)}Qr.prototype._importDER=function(W,Y){W=Gt.toArray(W,Y);var J=new Ja;if(W[J.place++]!==48)return!1;var X=Li(W,J);if(X===!1||X+J.place!==W.length||W[J.place++]!==2)return!1;var Me=Li(W,J);if(Me===!1)return!1;var Se=W.slice(J.place,Me+J.place);if(J.place+=Me,W[J.place++]!==2)return!1;var Ne=Li(W,J);if(Ne===!1||W.length!==Ne+J.place)return!1;var je=W.slice(J.place,Ne+J.place);if(Se[0]===0)if(Se[1]&128)Se=Se.slice(1);else return!1;if(je[0]===0)if(je[1]&128)je=je.slice(1);else return!1;return this.r=new K(Se),this.s=new K(je),this.recoveryParam=null,!0};function zi(W,Y){if(Y<128){W.push(Y);return}var J=1+(Math.log(Y)/Math.LN2>>>3);for(W.push(J|128);--J;)W.push(Y>>>(J<<3)&255);W.push(Y)}Qr.prototype.toDER=function(W){var Y=this.r.toArray(),J=this.s.toArray();for(Y[0]&128&&(Y=[0].concat(Y)),J[0]&128&&(J=[0].concat(J)),Y=Tf(Y),J=Tf(J);!J[0]&&!(J[1]&128);)J=J.slice(1);var X=[2];zi(X,Y.length),X=X.concat(Y),X.push(2),zi(X,J.length);var Me=X.concat(J),Se=[48];return zi(Se,Me.length),Se=Se.concat(Me),Gt.encode(Se,W)};var Ga=function(){throw new Error("unsupported")},Uf=Gt.assert;function ee(W){if(!(this instanceof ee))return new ee(W);typeof W=="string"&&(Uf(Object.prototype.hasOwnProperty.call(jr,W),"Unknown curve "+W),W=jr[W]),W instanceof jr.PresetCurve&&(W={curve:W}),this.curve=W.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=W.curve.g,this.g.precompute(W.curve.n.bitLength()+1),this.hash=W.hash||W.curve.hash}var Ya=ee;ee.prototype.keyPair=function(W){return new Hi(this,W)},ee.prototype.keyFromPrivate=function(W,Y){return Hi.fromPrivate(this,W,Y)},ee.prototype.keyFromPublic=function(W,Y){return Hi.fromPublic(this,W,Y)},ee.prototype.genKeyPair=function(W){W||(W={});for(var Y=new Ff({hash:this.hash,pers:W.pers,persEnc:W.persEnc||"utf8",entropy:W.entropy||Ga(this.hash.hmacStrength),entropyEnc:W.entropy&&W.entropyEnc||"utf8",nonce:this.n.toArray()}),J=this.n.byteLength(),X=this.n.sub(new K(2));;){var Me=new K(Y.generate(J));if(!(Me.cmp(X)>0))return Me.iaddn(1),this.keyFromPrivate(Me)}},ee.prototype._truncateToN=function(W,Y){var J=W.byteLength()*8-this.n.bitLength();return J>0&&(W=W.ushrn(J)),!Y&&W.cmp(this.n)>=0?W.sub(this.n):W},ee.prototype.sign=function(W,Y,J,X){typeof J=="object"&&(X=J,J=null),X||(X={}),Y=this.keyFromPrivate(Y,J),W=this._truncateToN(new K(W,16));for(var Me=this.n.byteLength(),Se=Y.getPrivate().toArray("be",Me),Ne=W.toArray("be",Me),je=new Ff({hash:this.hash,entropy:Se,nonce:Ne,pers:X.pers,persEnc:X.persEnc||"utf8"}),ke=this.n.sub(new K(1)),De=0;;De++){var qe=X.k?X.k(De):new K(je.generate(this.n.byteLength()));if(qe=this._truncateToN(qe,!0),!(qe.cmpn(1)<=0||qe.cmp(ke)>=0)){var Ue=this.g.mul(qe);if(!Ue.isInfinity()){var Ge=Ue.getX(),He=Ge.umod(this.n);if(He.cmpn(0)!==0){var Ve=qe.invm(this.n).mul(He.mul(Y.getPrivate()).iadd(W));if(Ve=Ve.umod(this.n),Ve.cmpn(0)!==0){var Ye=(Ue.getY().isOdd()?1:0)|(Ge.cmp(He)!==0?2:0);return X.canonical&&Ve.cmp(this.nh)>0&&(Ve=this.n.sub(Ve),Ye^=1),new Jr({r:He,s:Ve,recoveryParam:Ye})}}}}}},ee.prototype.verify=function(W,Y,J,X){W=this._truncateToN(new K(W,16)),J=this.keyFromPublic(J,X),Y=new Jr(Y,"hex");var Me=Y.r,Se=Y.s;if(Me.cmpn(1)<0||Me.cmp(this.n)>=0||Se.cmpn(1)<0||Se.cmp(this.n)>=0)return!1;var Ne=Se.invm(this.n),je=Ne.mul(W).umod(this.n),ke=Ne.mul(Me).umod(this.n),De;return this.curve._maxwellTrick?(De=this.g.jmulAdd(je,J.getPublic(),ke),De.isInfinity()?!1:De.eqXToP(Me)):(De=this.g.mulAdd(je,J.getPublic(),ke),De.isInfinity()?!1:De.getX().umod(this.n).cmp(Me)===0)},ee.prototype.recoverPubKey=function(W,Y,J,X){Uf((3&J)===J,"The recovery param is more than two bits"),Y=new Jr(Y,X);var Me=this.n,Se=new K(W),Ne=Y.r,je=Y.s,ke=J&1,De=J>>1;if(Ne.cmp(this.curve.p.umod(this.curve.n))>=0&&De)throw new Error("Unable to find sencond key candinate");De?Ne=this.curve.pointFromX(Ne.add(this.curve.n),ke):Ne=this.curve.pointFromX(Ne,ke);var qe=Y.r.invm(Me),Ue=Me.sub(Se).mul(qe).umod(Me),Ge=je.mul(qe).umod(Me);return this.g.mulAdd(Ue,Ne,Ge)},ee.prototype.getKeyRecoveryParam=function(W,Y,J,X){if(Y=new Jr(Y,X),Y.recoveryParam!==null)return Y.recoveryParam;for(var Me=0;Me<4;Me++){var Se;try{Se=this.recoverPubKey(W,Y,Me)}catch{continue}if(Se.eq(J))return Me}throw new Error("Unable to find valid recovery factor")};var Va=lr(function(W,Y){var J=Y;J.version="6.5.4",J.utils=Gt,J.rand=function(){throw new Error("unsupported")},J.curve=zr,J.curves=jr,J.ec=Ya,J.eddsa=null});Va.ec;var qf;(function(W){W[W.legacy=0]="legacy",W[W.eip2930=1]="eip2930",W[W.eip1559=2]="eip1559"})(qf||(qf={}));const hu="did:pkh:",Gr=W=>W==null?void 0:W.split(":"),Gi=W=>{const Y=W&&Gr(W);if(Y)return W.includes(hu)?Y[3]:Y[1]},Yi=W=>{const Y=W&&Gr(W);if(Y)return Y.pop()};function getCaipDefaultChain(W){if(W)return{id:`${ConstantsUtil$3.EIP155}:${W.id}`,name:W.name,imageId:PresetsUtil.EIP155NetworkImageIds[W.id],chain:ConstantsUtil$2.CHAIN.EVM}}async function getWalletConnectCaipNetworks(W){var Se,Ne,je,ke;if(!W)throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");const Y=await(W==null?void 0:W.getProvider()),J=(Ne=(Se=Y==null?void 0:Y.signer)==null?void 0:Se.session)==null?void 0:Ne.namespaces,X=(je=J==null?void 0:J[ConstantsUtil$3.EIP155])==null?void 0:je.methods,Me=xn(((ke=J==null?void 0:J[ConstantsUtil$3.EIP155])==null?void 0:ke.accounts)||[]);return{supportsAllNetworks:!!(X!=null&&X.includes(ConstantsUtil$3.ADD_CHAIN_METHOD)),approvedCaipNetworkIds:Me}}function getEmailCaipNetworks(){return{supportsAllNetworks:!1,approvedCaipNetworkIds:PresetsUtil.WalletConnectRpcChainIds.map(W=>`${ConstantsUtil$3.EIP155}:${W}`)}}function requireCaipAddress(W){if(!W)throw new Error("No CAIP address provided");const Y=W.split(":")[2];if(!Y)throw new Error("Invalid CAIP address");return Y}var COMPRESSED$1="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9C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2iyIqLI";const FENCED=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),NSM_MAX=4;function decode_arithmetic(W){let Y=0;function J(){return W[Y++]<<8|W[Y++]}let X=J(),Me=1,Se=[0,1];for(let Yo=1;Yo<X;Yo++)Se.push(Me+=J());let Ne=J(),je=Y;Y+=Ne;let ke=0,De=0;function qe(){return ke==0&&(De=De<<8|W[Y++],ke=8),De>>--ke&1}const Ue=31,Ge=2**Ue,He=Ge>>>1,Ve=He>>1,Ye=Ge-1;let Fn=0;for(let Yo=0;Yo<Ue;Yo++)Fn=Fn<<1|qe();let io=[],$o=0,Jo=Ge;for(;;){let Yo=Math.floor(((Fn-$o+1)*Me-1)/Jo),zo=0,jo=X;for(;jo-zo>1;){let us=zo+jo>>>1;Yo<Se[us]?jo=us:zo=us}if(zo==0)break;io.push(zo);let Vo=$o+Math.floor(Jo*Se[zo]/Me),os=$o+Math.floor(Jo*Se[zo+1]/Me)-1;for(;!((Vo^os)&He);)Fn=Fn<<1&Ye|qe(),Vo=Vo<<1&Ye,os=os<<1&Ye|1;for(;Vo&~os&Ve;)Fn=Fn&He|Fn<<1&Ye>>>1|qe(),Vo=Vo<<1^He,os=(os^He)<<1|He|1;$o=Vo,Jo=1+os-Vo}let rs=X-4;return io.map(Yo=>{switch(Yo-rs){case 3:return rs+65792+(W[je++]<<16|W[je++]<<8|W[je++]);case 2:return rs+256+(W[je++]<<8|W[je++]);case 1:return rs+W[je++];default:return Yo-1}})}function read_payload(W){let Y=0;return()=>W[Y++]}function read_compressed_payload(W){return read_payload(decode_arithmetic(unsafe_atob(W)))}function unsafe_atob(W){let Y=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((Me,Se)=>Y[Me.charCodeAt(0)]=Se);let J=W.length,X=new Uint8Array(6*J>>3);for(let Me=0,Se=0,Ne=0,je=0;Me<J;Me++)je=je<<6|Y[W.charCodeAt(Me)],Ne+=6,Ne>=8&&(X[Se++]=je>>(Ne-=8));return X}function signed(W){return W&1?~W>>1:W>>1}function read_deltas(W,Y){let J=Array(W);for(let X=0,Me=0;X<W;X++)J[X]=Me+=signed(Y());return J}function read_sorted(W,Y=0){let J=[];for(;;){let X=W(),Me=W();if(!Me)break;Y+=X;for(let Se=0;Se<Me;Se++)J.push(Y+Se);Y+=Me+1}return J}function read_sorted_arrays(W){return read_array_while(()=>{let Y=read_sorted(W);if(Y.length)return Y})}function read_mapped(W){let Y=[];for(;;){let J=W();if(J==0)break;Y.push(read_linear_table(J,W))}for(;;){let J=W()-1;if(J<0)break;Y.push(read_replacement_table(J,W))}return Y.flat()}function read_array_while(W){let Y=[];for(;;){let J=W(Y.length);if(!J)break;Y.push(J)}return Y}function read_transposed(W,Y,J){let X=Array(W).fill().map(()=>[]);for(let Me=0;Me<Y;Me++)read_deltas(W,J).forEach((Se,Ne)=>X[Ne].push(Se));return X}function read_linear_table(W,Y){let J=1+Y(),X=Y(),Me=read_array_while(Y);return read_transposed(Me.length,1+W,Y).flatMap((Ne,je)=>{let[ke,...De]=Ne;return Array(Me[je]).fill().map((qe,Ue)=>{let Ge=Ue*X;return[ke+Ue*J,De.map(He=>He+Ge)]})})}function read_replacement_table(W,Y){let J=1+Y();return read_transposed(J,1+W,Y).map(Me=>[Me[0],Me.slice(1)])}function read_trie(W){let Y=[],J=read_sorted(W);return Me(X([]),[]),Y;function X(Se){let Ne=W(),je=read_array_while(()=>{let ke=read_sorted(W).map(De=>J[De]);if(ke.length)return X(ke)});return{S:Ne,B:je,Q:Se}}function Me({S:Se,B:Ne},je,ke){if(!(Se&4&&ke===je[je.length-1])){Se&2&&(ke=je[je.length-1]),Se&1&&Y.push(je);for(let De of Ne)for(let qe of De.Q)Me(De,[...je,qe],ke)}}}function hex_cp(W){return W.toString(16).toUpperCase().padStart(2,"0")}function quote_cp(W){return`{${hex_cp(W)}}`}function explode_cp(W){let Y=[];for(let J=0,X=W.length;J<X;){let Me=W.codePointAt(J);J+=Me<65536?1:2,Y.push(Me)}return Y}function str_from_cps(W){let J=W.length;if(J<4096)return String.fromCodePoint(...W);let X=[];for(let Me=0;Me<J;)X.push(String.fromCodePoint(...W.slice(Me,Me+=4096)));return X.join("")}function compare_arrays(W,Y){let J=W.length,X=J-Y.length;for(let Me=0;X==0&&Me<J;Me++)X=W[Me]-Y[Me];return X}var COMPRESSED="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30Z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SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const S0=44032,L0=4352,V0=4449,T0=4519,L_COUNT=19,V_COUNT=21,T_COUNT=28,N_COUNT=V_COUNT*T_COUNT,S_COUNT=L_COUNT*N_COUNT,S1=S0+S_COUNT,L1=L0+L_COUNT,V1=V0+V_COUNT,T1=T0+T_COUNT;function unpack_cc(W){return W>>24&255}function unpack_cp(W){return W&16777215}let SHIFTED_RANK,EXCLUSIONS,DECOMP,RECOMP;function init$1(){let W=read_compressed_payload(COMPRESSED);SHIFTED_RANK=new Map(read_sorted_arrays(W).flatMap((Y,J)=>Y.map(X=>[X,J+1<<24]))),EXCLUSIONS=new Set(read_sorted(W)),DECOMP=new Map,RECOMP=new Map;for(let[Y,J]of read_mapped(W)){if(!EXCLUSIONS.has(Y)&&J.length==2){let[X,Me]=J,Se=RECOMP.get(X);Se||(Se=new Map,RECOMP.set(X,Se)),Se.set(Me,Y)}DECOMP.set(Y,J.reverse())}}function is_hangul(W){return W>=S0&&W<S1}function compose_pair(W,Y){if(W>=L0&&W<L1&&Y>=V0&&Y<V1)return S0+(W-L0)*N_COUNT+(Y-V0)*T_COUNT;if(is_hangul(W)&&Y>T0&&Y<T1&&(W-S0)%T_COUNT==0)return W+(Y-T0);{let J=RECOMP.get(W);return J&&(J=J.get(Y),J)?J:-1}}function decomposed(W){SHIFTED_RANK||init$1();let Y=[],J=[],X=!1;function Me(Se){let Ne=SHIFTED_RANK.get(Se);Ne&&(X=!0,Se|=Ne),Y.push(Se)}for(let Se of W)for(;;){if(Se<128)Y.push(Se);else if(is_hangul(Se)){let Ne=Se-S0,je=Ne/N_COUNT|0,ke=Ne%N_COUNT/T_COUNT|0,De=Ne%T_COUNT;Me(L0+je),Me(V0+ke),De>0&&Me(T0+De)}else{let Ne=DECOMP.get(Se);Ne?J.push(...Ne):Me(Se)}if(!J.length)break;Se=J.pop()}if(X&&Y.length>1){let Se=unpack_cc(Y[0]);for(let Ne=1;Ne<Y.length;Ne++){let je=unpack_cc(Y[Ne]);if(je==0||Se<=je){Se=je;continue}let ke=Ne-1;for(;;){let De=Y[ke+1];if(Y[ke+1]=Y[ke],Y[ke]=De,!ke||(Se=unpack_cc(Y[--ke]),Se<=je))break}Se=unpack_cc(Y[Ne])}}return Y}function composed_from_decomposed(W){let Y=[],J=[],X=-1,Me=0;for(let Se of W){let Ne=unpack_cc(Se),je=unpack_cp(Se);if(X==-1)Ne==0?X=je:Y.push(je);else if(Me>0&&Me>=Ne)Ne==0?(Y.push(X,...J),J.length=0,X=je):J.push(je),Me=Ne;else{let ke=compose_pair(X,je);ke>=0?X=ke:Me==0&&Ne==0?(Y.push(X),X=je):(J.push(je),Me=Ne)}}return X>=0&&Y.push(X,...J),Y}function nfd(W){return decomposed(W).map(unpack_cp)}function nfc(W){return composed_from_decomposed(decomposed(W))}const HYPHEN=45,STOP_CH=".",FE0F=65039,UNIQUE_PH=1,Array_from=W=>Array.from(W);function group_has_cp(W,Y){return W.P.has(Y)||W.Q.has(Y)}class Emoji extends Array{get is_emoji(){return!0}}let MAPPED,IGNORED,CM,NSM,ESCAPE,GROUPS,WHOLE_VALID,WHOLE_MAP,VALID,EMOJI_LIST,EMOJI_ROOT;function init(){if(MAPPED)return;let W=read_compressed_payload(COMPRESSED$1);const Y=()=>read_sorted(W),J=()=>new Set(Y());MAPPED=new Map(read_mapped(W)),IGNORED=J(),CM=Y(),NSM=new Set(Y().map(qe=>CM[qe])),CM=new Set(CM),ESCAPE=J(),J();let X=read_sorted_arrays(W),Me=W();const Se=()=>new Set(Y().flatMap(qe=>X[qe]).concat(Y()));GROUPS=read_array_while(qe=>{let Ue=read_array_while(W).map(Ge=>Ge+96);if(Ue.length){let Ge=qe>=Me;Ue[0]-=32,Ue=str_from_cps(Ue),Ge&&(Ue=`Restricted[${Ue}]`);let He=Se(),Ve=Se(),Ye=!W();return{N:Ue,P:He,Q:Ve,M:Ye,R:Ge}}}),WHOLE_VALID=J(),WHOLE_MAP=new Map;let Ne=Y().concat(Array_from(WHOLE_VALID)).sort((qe,Ue)=>qe-Ue);Ne.forEach((qe,Ue)=>{let Ge=W(),He=Ne[Ue]=Ge?Ne[Ue-Ge]:{V:[],M:new Map};He.V.push(qe),WHOLE_VALID.has(qe)||WHOLE_MAP.set(qe,He)});for(let{V:qe,M:Ue}of new Set(WHOLE_MAP.values())){let Ge=[];for(let Ve of qe){let Ye=GROUPS.filter(io=>group_has_cp(io,Ve)),Fn=Ge.find(({G:io})=>Ye.some($o=>io.has($o)));Fn||(Fn={G:new Set,V:[]},Ge.push(Fn)),Fn.V.push(Ve),Ye.forEach(io=>Fn.G.add(io))}let He=Ge.flatMap(Ve=>Array_from(Ve.G));for(let{G:Ve,V:Ye}of Ge){let Fn=new Set(He.filter(io=>!Ve.has(io)));for(let io of Ye)Ue.set(io,Fn)}}let je=new Set,ke=new Set;const De=qe=>je.has(qe)?ke.add(qe):je.add(qe);for(let qe of GROUPS){for(let Ue of qe.P)De(Ue);for(let Ue of qe.Q)De(Ue)}for(let qe of je)!WHOLE_MAP.has(qe)&&!ke.has(qe)&&WHOLE_MAP.set(qe,UNIQUE_PH);VALID=new Set(Array_from(je).concat(Array_from(nfd(je)))),EMOJI_LIST=read_trie(W).map(qe=>Emoji.from(qe)).sort(compare_arrays),EMOJI_ROOT=new Map;for(let qe of EMOJI_LIST){let Ue=[EMOJI_ROOT];for(let Ge of qe){let He=Ue.map(Ve=>{let Ye=Ve.get(Ge);return Ye||(Ye=new Map,Ve.set(Ge,Ye)),Ye});Ge===FE0F?Ue.push(...He):Ue=He}for(let Ge of Ue)Ge.V=qe}}function quoted_cp(W){return(should_escape(W)?"":`${bidi_qq(safe_str_from_cps([W]))} `)+quote_cp(W)}function bidi_qq(W){return`"${W}"`}function check_label_extension(W){if(W.length>=4&&W[2]==HYPHEN&&W[3]==HYPHEN)throw new Error(`invalid label extension: "${str_from_cps(W.slice(0,4))}"`)}function check_leading_underscore(W){for(let J=W.lastIndexOf(95);J>0;)if(W[--J]!==95)throw new Error("underscore allowed only at start")}function check_fenced(W){let Y=W[0],J=FENCED.get(Y);if(J)throw error_placement(`leading ${J}`);let X=W.length,Me=-1;for(let Se=1;Se<X;Se++){Y=W[Se];let Ne=FENCED.get(Y);if(Ne){if(Me==Se)throw error_placement(`${J} + ${Ne}`);Me=Se+1,J=Ne}}if(Me==X)throw error_placement(`trailing ${J}`)}function safe_str_from_cps(W,Y=quote_cp){let J=[];is_combining_mark(W[0])&&J.push("◌");let X=0,Me=W.length;for(let Se=0;Se<Me;Se++){let Ne=W[Se];should_escape(Ne)&&(J.push(str_from_cps(W.slice(X,Se))),J.push(Y(Ne)),X=Se+1)}return J.push(str_from_cps(W.slice(X,Me))),J.join("")}function is_combining_mark(W){return init(),CM.has(W)}function should_escape(W){return init(),ESCAPE.has(W)}function ens_normalize(W){return flatten(split(W,nfc,filter_fe0f))}function split(W,Y,J){if(!W)return[];init();let X=0;return W.split(STOP_CH).map(Me=>{let Se=explode_cp(Me),Ne={input:Se,offset:X};X+=Se.length+1;try{let je=Ne.tokens=tokens_from_str(Se,Y,J),ke=je.length,De;if(!ke)throw new Error("empty label");let qe=Ne.output=je.flat();if(check_leading_underscore(qe),!(Ne.emoji=ke>1||je[0].is_emoji)&&qe.every(Ge=>Ge<128))check_label_extension(qe),De="ASCII";else{let Ge=je.flatMap(He=>He.is_emoji?[]:He);if(!Ge.length)De="Emoji";else{if(CM.has(qe[0]))throw error_placement("leading combining mark");for(let Ye=1;Ye<ke;Ye++){let Fn=je[Ye];if(!Fn.is_emoji&&CM.has(Fn[0]))throw error_placement(`emoji + combining mark: "${str_from_cps(je[Ye-1])} + ${safe_str_from_cps([Fn[0]])}"`)}check_fenced(qe);let He=Array_from(new Set(Ge)),[Ve]=determine_group(He);check_group(Ve,Ge),check_whole(Ve,He),De=Ve.N}}Ne.type=De}catch(je){Ne.error=je}return Ne})}function check_whole(W,Y){let J,X=[];for(let Me of Y){let Se=WHOLE_MAP.get(Me);if(Se===UNIQUE_PH)return;if(Se){let Ne=Se.M.get(Me);if(J=J?J.filter(je=>Ne.has(je)):Array_from(Ne),!J.length)return}else X.push(Me)}if(J){for(let Me of J)if(X.every(Se=>group_has_cp(Me,Se)))throw new Error(`whole-script confusable: ${W.N}/${Me.N}`)}}function determine_group(W){let Y=GROUPS;for(let J of W){let X=Y.filter(Me=>group_has_cp(Me,J));if(!X.length)throw GROUPS.some(Me=>group_has_cp(Me,J))?error_group_member(Y[0],J):error_disallowed(J);if(Y=X,X.length==1)break}return Y}function flatten(W){return W.map(({input:Y,error:J,output:X})=>{if(J){let Me=J.message;throw new Error(W.length==1?Me:`Invalid label ${bidi_qq(safe_str_from_cps(Y))}: ${Me}`)}return str_from_cps(X)}).join(STOP_CH)}function error_disallowed(W){return new Error(`disallowed character: ${quoted_cp(W)}`)}function error_group_member(W,Y){let J=quoted_cp(Y),X=GROUPS.find(Me=>Me.P.has(Y));return X&&(J=`${X.N} ${J}`),new Error(`illegal mixture: ${W.N} + ${J}`)}function error_placement(W){return new Error(`illegal placement: ${W}`)}function check_group(W,Y){for(let J of Y)if(!group_has_cp(W,J))throw error_group_member(W,J);if(W.M){let J=nfd(Y);for(let X=1,Me=J.length;X<Me;X++)if(NSM.has(J[X])){let Se=X+1;for(let Ne;Se<Me&&NSM.has(Ne=J[Se]);Se++)for(let je=X;je<Se;je++)if(J[je]==Ne)throw new Error(`duplicate non-spacing marks: ${quoted_cp(Ne)}`);if(Se-X>NSM_MAX)throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(J.slice(X-1,Se)))} (${Se-X}/${NSM_MAX})`);X=Se}}}function tokens_from_str(W,Y,J){let X=[],Me=[];for(W=W.slice().reverse();W.length;){let Se=consume_emoji_reversed(W);if(Se)Me.length&&(X.push(Y(Me)),Me=[]),X.push(J(Se));else{let Ne=W.pop();if(VALID.has(Ne))Me.push(Ne);else{let je=MAPPED.get(Ne);if(je)Me.push(...je);else if(!IGNORED.has(Ne))throw error_disallowed(Ne)}}}return Me.length&&X.push(Y(Me)),X}function filter_fe0f(W){return W.filter(Y=>Y!=FE0F)}function consume_emoji_reversed(W,Y){let J=EMOJI_ROOT,X,Me=W.length;for(;Me&&(J=J.get(W[--Me]),!!J);){let{V:Se}=J;Se&&(X=Se,W.length=Me)}return X}function normalize(W){return ens_normalize(W)}class EVMWagmiClient{constructor(Y){var Me,Se,Ne;this.appKit=void 0,this.options=void 0,this.chain=ConstantsUtil$2.CHAIN.EVM,this.defaultChain=void 0,this.tokens=HelpersUtil.getCaipTokens((Me=this.options)==null?void 0:Me.tokens),this.getCaipDefaultChain=(Se=this.options)==null?void 0:Se.defaultChain,this.siweControllerClient=(Ne=this.options)==null?void 0:Ne.siweConfig;const{wagmiConfig:J,defaultChain:X}=Y;if(!J)throw new Error("wagmiConfig is undefined");this.wagmiConfig=J,this.defaultChain=getCaipDefaultChain(X),this.siweControllerClient=Y.siweConfig,this.networkControllerClient={switchCaipNetwork:async je=>{const ke=NetworkUtil$1.caipNetworkIdToNumber(je==null?void 0:je.id);ke&&await switchChain(this.wagmiConfig,{chainId:ke})},getApprovedCaipNetworksData:async()=>new Promise(je=>{var qe,Ue;const De=new Map(this.wagmiConfig.state.connections).get(this.wagmiConfig.state.current||"");if(((qe=De==null?void 0:De.connector)==null?void 0:qe.id)===ConstantsUtil$3.AUTH_CONNECTOR_ID)je(getEmailCaipNetworks());else if(((Ue=De==null?void 0:De.connector)==null?void 0:Ue.id)===ConstantsUtil$3.WALLET_CONNECT_CONNECTOR_ID){const Ge=this.wagmiConfig.connectors.find(He=>He.id===ConstantsUtil$3.WALLET_CONNECT_CONNECTOR_ID);je(getWalletConnectCaipNetworks(Ge))}je({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})},this.connectionControllerClient={connectWalletConnect:async je=>{var Ve,Ye,Fn,io,$o,Jo,rs,Yo,zo,jo,Vo;const ke=(Ve=this.options)==null?void 0:Ve.siweConfig,De=this.wagmiConfig.connectors.find(os=>os.id===ConstantsUtil$3.WALLET_CONNECT_CONNECTOR_ID);if(!De)throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");const qe=await De.getProvider();qe.on("display_uri",os=>{je(os)});const Ue=await(($o=(io=(Fn=(Ye=qe.signer)==null?void 0:Ye.client)==null?void 0:Fn.core)==null?void 0:io.crypto)==null?void 0:$o.getClientId());Ue&&((Jo=this.appKit)==null||Jo.setClientId(Ue));const Ge=NetworkUtil$1.caipNetworkIdToNumber((Yo=(rs=this.appKit)==null?void 0:rs.getCaipNetwork())==null?void 0:Yo.id),He=await((zo=ke==null?void 0:ke.getMessageParams)==null?void 0:zo.call(ke));if((jo=ke==null?void 0:ke.options)!=null&&jo.enabled&&typeof(qe==null?void 0:qe.authenticate)=="function"&&He&&Object.keys(He||{}).length>0){const{SIWEController:os,getDidChainId:us,getDidAddress:is}=await __vitePreload(async()=>{const{SIWEController:Je,getDidChainId:wi,getDidAddress:mo}=await import("./index-Dmz8iooL.js");return{SIWEController:Je,getDidChainId:wi,getDidAddress:mo}},[]);await De.setRequestedChainsIds(He.chains);let Lo=He.chains;Ge&&(Lo=[Ge,...He.chains.filter(Je=>Je!==Ge)]);const Fe=await qe.authenticate({nonce:await ke.getNonce(),methods:[...y],...He,chains:Lo}),Ke=(Vo=Fe==null?void 0:Fe.auths)==null?void 0:Vo[0];if(Ke){const{p:Je,s:wi}=Ke,mo=us(Je.iss)||"",Go=is(Je.iss);Go&&mo&&os.setSession({address:Go,chainId:parseInt(mo,10)});try{const Qo=qe.signer.client.formatAuthMessage({request:Je,iss:Je.iss});await os.verifyMessage({message:Qo,signature:wi.s,cacao:Ke})}catch(Qo){throw console.error("Error verifying message",Qo),await qe.disconnect().catch(console.error),await os.signOut().catch(console.error),Qo}}this.wagmiConfig.state.current=""}await connect(this.wagmiConfig,{connector:De,chainId:Ge})},connectExternal:async({id:je,provider:ke,info:De})=>{var Ge,He,Ve,Ye;const qe=this.wagmiConfig.connectors.find(Fn=>Fn.id===je);if(!qe)throw new Error("connectionControllerClient:connectExternal - connector is undefined");(Ge=this.appKit)==null||Ge.setClientId(null),ke&&De&&qe.id===ConstantsUtil$3.EIP6963_CONNECTOR_ID&&((He=qe.setEip6963Wallet)==null||He.call(qe,{provider:ke,info:De}));const Ue=NetworkUtil$1.caipNetworkIdToNumber((Ye=(Ve=this.appKit)==null?void 0:Ve.getCaipNetwork())==null?void 0:Ye.id);await connect(this.wagmiConfig,{connector:qe,chainId:Ue})},checkInstalled:je=>{var De;const ke=(De=this.appKit)==null?void 0:De.getConnectors().find(qe=>qe.type==="INJECTED");return je?ke&&window!=null&&window.ethereum?je.some(qe=>{var Ue;return!!((Ue=window.ethereum)!=null&&Ue[String(qe)])}):!1:!!window.ethereum},disconnect:async()=>{var je,ke,De,qe;if(await disconnect(this.wagmiConfig),(je=this.appKit)==null||je.setClientId(null),(qe=(De=(ke=this.options)==null?void 0:ke.siweConfig)==null?void 0:De.options)!=null&&qe.signOutOnDisconnect){const{SIWEController:Ue}=await __vitePreload(async()=>{const{SIWEController:Ge}=await import("./index-Dmz8iooL.js");return{SIWEController:Ge}},[]);await Ue.signOut()}},signMessage:async je=>{var qe;const ke=((qe=this.appKit)==null?void 0:qe.getCaipAddress())||"",De=requireCaipAddress(ke);return signMessage(this.wagmiConfig,{message:je,account:De})},estimateGas:async je=>{if(je.chainNamespace&&je.chainNamespace!=="eip155")throw new Error("connectionControllerClient:estimateGas - invalid chain namespace");try{return await estimateGas(this.wagmiConfig,{account:je.address,to:je.to,data:je.data,type:"legacy"})}catch{return 0n}},sendTransaction:async je=>{if(je.chainNamespace&&je.chainNamespace!=="eip155")throw new Error("connectionControllerClient:sendTransaction - invalid chain namespace");const{chainId:ke}=getAccount(this.wagmiConfig),De={account:je.address,to:je.to,value:je.value,gas:je.gas,gasPrice:je.gasPrice,data:je.data,chainId:ke,type:"legacy"};await prepareTransactionRequest(this.wagmiConfig,De);const qe=await sendTransaction(this.wagmiConfig,De);return await waitForTransactionReceipt(this.wagmiConfig,{hash:qe,timeout:25e3}),qe},writeContract:async je=>{var Ge,He,Ve;const ke=((Ge=this.appKit)==null?void 0:Ge.getCaipAddress())||"",De=requireCaipAddress(ke),qe=NetworkUtil$1.caipNetworkIdToNumber((Ve=(He=this.appKit)==null?void 0:He.getCaipNetwork())==null?void 0:Ve.id);return await writeContract(this.wagmiConfig,{chainId:qe,address:je.tokenAddress,account:De,abi:je.abi,functionName:je.method,args:[je.receiverAddress,je.tokenAmount]})},getEnsAddress:async je=>{var ke,De,qe;try{const Ue=NetworkUtil$1.caipNetworkIdToNumber((De=(ke=this.appKit)==null?void 0:ke.getCaipNetwork())==null?void 0:De.id);let Ge=!1,He=!1;return je!=null&&je.endsWith(ConstantsUtil$2.WC_NAME_SUFFIX)&&(He=await((qe=this.appKit)==null?void 0:qe.resolveWalletConnectName(je))||!1),Ue===mainnet.id&&(Ge=await getEnsAddress(this.wagmiConfig,{name:normalize(je),chainId:Ue})),Ge||He||!1}catch{return!1}},getEnsAvatar:async je=>{var qe,Ue;const ke=NetworkUtil$1.caipNetworkIdToNumber((Ue=(qe=this.appKit)==null?void 0:qe.getCaipNetwork())==null?void 0:Ue.id);return ke!==mainnet.id?!1:await getEnsAvatar(this.wagmiConfig,{name:normalize(je),chainId:ke})||!1},parseUnits,formatUnits}}construct(Y,J){var X,Me;if(!J.projectId)throw new Error("projectId is undefined");this.appKit=Y,this.options=J,this.tokens=HelpersUtil.getCaipTokens(J.tokens),this.syncRequestedNetworks([...this.wagmiConfig.chains]),this.syncConnectors(this.wagmiConfig.connectors),this.initAuthConnectorListeners([...this.wagmiConfig.connectors]),watchConnectors(this.wagmiConfig,{onChange:Se=>this.syncConnectors(Se)}),watchAccount(this.wagmiConfig,{onChange:Se=>this.syncAccount({...Se})}),(X=this.appKit)==null||X.setEIP6963Enabled(J.enableEIP6963!==!1),(Me=this.appKit)==null||Me.subscribeShouldUpdateToAddress(Se=>{var Ne;if(Se){const ke=(Ne=getConnections(this.wagmiConfig)[0])==null?void 0:Ne.connector;ke&&switchAccount(this.wagmiConfig,{connector:ke}).then(De=>this.syncAccount({address:Se,isConnected:!0,addresses:De.accounts,connector:ke,chainId:De.chainId}))}})}subscribeState(Y){var J;return(J=this.appKit)==null?void 0:J.subscribeState(X=>Y({...X,selectedNetworkId:NetworkUtil$1.caipNetworkIdToNumber(X.selectedNetworkId)}))}syncRequestedNetworks(Y){var X;const J=Y==null?void 0:Y.map(Me=>{var Se,Ne;return{id:`${ConstantsUtil$3.EIP155}:${Me.id}`,name:Me.name,imageId:PresetsUtil.EIP155NetworkImageIds[Me.id],imageUrl:(Ne=(Se=this.options)==null?void 0:Se.chainImages)==null?void 0:Ne[Me.id],chain:this.chain}});(X=this.appKit)==null||X.setRequestedCaipNetworks(J??[],this.chain)}async syncAccount({address:Y,chainId:J,connector:X,addresses:Me,status:Se}){var je,ke,De,qe,Ue,Ge,He,Ve,Ye,Fn;const Ne=`${ConstantsUtil$3.EIP155}:${J}:${Y}`;((je=this.appKit)==null?void 0:je.getCaipAddress())!==Ne&&(Se==="connected"&&Y&&J?(this.syncNetwork(Y,J,!0),(ke=this.appKit)==null||ke.setIsConnected(!0,this.chain),(De=this.appKit)==null||De.setCaipAddress(Ne,this.chain),await Promise.all([this.syncProfile(Y,J),this.syncBalance(Y,J),this.syncConnectedWalletInfo(X),(qe=this.appKit)==null?void 0:qe.setApprovedCaipNetworksData(this.chain)]),X&&this.syncConnectedWalletInfo(X),!((X==null?void 0:X.id)===ConstantsUtil$3.AUTH_CONNECTOR_ID)&&(Me!=null&&Me.length)&&((Ue=this.appKit)==null||Ue.setAllAccounts(Me.map($o=>({address:$o,type:"eoa"})),this.chain))):Se==="disconnected"&&((Ge=this.appKit)==null||Ge.resetAccount(this.chain),(He=this.appKit)==null||He.resetWcConnection(),(Ve=this.appKit)==null||Ve.resetNetwork(),(Ye=this.appKit)==null||Ye.setAllAccounts([],this.chain),(Fn=this.appKit)==null||Fn.setIsConnected(!1,this.chain)))}async syncNetwork(Y,J,X){var Se,Ne,je,ke,De,qe,Ue,Ge;const Me=this.wagmiConfig.chains.find(He=>He.id===J);if(Me||J){const He=(Me==null?void 0:Me.name)??(J==null?void 0:J.toString()),Ve=Number((Me==null?void 0:Me.id)??J),Ye=`${ConstantsUtil$3.EIP155}:${Ve}`;if((je=this.appKit)==null||je.setCaipNetwork({id:Ye,name:He,imageId:PresetsUtil.EIP155NetworkImageIds[Ve],imageUrl:(Ne=(Se=this.options)==null?void 0:Se.chainImages)==null?void 0:Ne[Ve],chain:this.chain}),X&&Y&&J){const Fn=`${ConstantsUtil$3.EIP155}:${Ve}:${Y}`;if((ke=this.appKit)==null||ke.setCaipAddress(Fn,this.chain),(qe=(De=Me==null?void 0:Me.blockExplorers)==null?void 0:De.default)!=null&&qe.url){const io=`${Me.blockExplorers.default.url}/address/${Y}`;(Ue=this.appKit)==null||Ue.setAddressExplorerUrl(io,this.chain)}else(Ge=this.appKit)==null||Ge.setAddressExplorerUrl(void 0,this.chain);await this.syncBalance(Y,J)}}}async syncWalletConnectName(Y){var J,X,Me;if(!this.appKit)throw new Error("syncWalletConnectName - appKit is undefined");try{const Se=await this.appKit.getWalletConnectName(Y);if(Se[0]){const Ne=Se[0];(J=this.appKit)==null||J.setProfileName(Ne.name,this.chain)}else(X=this.appKit)==null||X.setProfileName(null,this.chain)}catch{(Me=this.appKit)==null||Me.setProfileName(null,this.chain)}}async syncProfile(Y,J){var X,Me,Se,Ne,je,ke;if(!this.appKit)throw new Error("syncProfile - appKit is undefined");try{const{name:De,avatar:qe}=await this.appKit.fetchIdentity({address:Y});(X=this.appKit)==null||X.setProfileName(De,this.chain),(Me=this.appKit)==null||Me.setProfileImage(qe,this.chain),De||await this.syncWalletConnectName(Y)}catch{if(J===mainnet.id){const De=await getEnsName(this.wagmiConfig,{address:Y,chainId:J});if(De){(Se=this.appKit)==null||Se.setProfileName(De,this.chain);const qe=await getEnsAvatar(this.wagmiConfig,{name:De,chainId:J});qe&&((Ne=this.appKit)==null||Ne.setProfileImage(qe,this.chain))}else await this.syncWalletConnectName(Y),(je=this.appKit)==null||je.setProfileImage(null,this.chain)}else await this.syncWalletConnectName(Y),(ke=this.appKit)==null||ke.setProfileImage(null,this.chain)}}async syncBalance(Y,J){var Me,Se,Ne,je,ke;const X=this.wagmiConfig.chains.find(De=>De.id===J);if(X){const De=await getBalance(this.wagmiConfig,{address:Y,chainId:X.id,token:(Ne=(Se=(Me=this.options)==null?void 0:Me.tokens)==null?void 0:Se[X.id])==null?void 0:Ne.address});(je=this.appKit)==null||je.setBalance(De.formatted,De.symbol,this.chain);return}(ke=this.appKit)==null||ke.setBalance(void 0,void 0,this.chain)}async syncConnectedWalletInfo(Y){var J,X,Me,Se;if(!Y)throw Error("syncConnectedWalletInfo - connector is undefined");if(Y.id===ConstantsUtil$3.WALLET_CONNECT_CONNECTOR_ID&&Y.getProvider){const Ne=await Y.getProvider();Ne.session&&((X=this.appKit)==null||X.setConnectedWalletInfo({...Ne.session.peer.metadata,name:Ne.session.peer.metadata.name,icon:(J=Ne.session.peer.metadata.icons)==null?void 0:J[0]},this.chain))}else{const Ne=(Me=this.appKit)==null?void 0:Me.getConnectors().find(je=>je.id===Y.id);(Se=this.appKit)==null||Se.setConnectedWalletInfo({name:Y.name,icon:Y.icon||this.appKit.getConnectorImage(Ne)},this.chain)}}syncConnectors(Y){var Se;const J=new Set,X=Y.filter(Ne=>!J.has(Ne.id)&&J.add(Ne.id)),Me=[];X.forEach(({id:Ne,name:je,type:ke,icon:De})=>{var Ue,Ge;ConstantsUtil$3.AUTH_CONNECTOR_ID===Ne||Me.push({id:Ne,explorerId:PresetsUtil.ConnectorExplorerIds[Ne],imageUrl:((Ge=(Ue=this.options)==null?void 0:Ue.connectorImages)==null?void 0:Ge[Ne])??De,name:PresetsUtil.ConnectorNamesMap[Ne]??je,imageId:PresetsUtil.ConnectorImageIds[Ne],type:PresetsUtil.ConnectorTypesMap[ke]??"EXTERNAL",info:{rdns:Ne},chain:this.chain})}),(Se=this.appKit)==null||Se.setConnectors(Me),this.syncAuthConnector(X)}async syncAuthConnector(Y){var X;const J=Y.find(({id:Me})=>Me===ConstantsUtil$3.AUTH_CONNECTOR_ID);if(J){const Me=await J.getProvider();(X=this.appKit)==null||X.addConnector({id:ConstantsUtil$3.AUTH_CONNECTOR_ID,type:"AUTH",name:"Auth",provider:Me,email:J.email,socials:J.socials,showWallets:J.showWallets,chain:this.chain,walletFeatures:J.walletFeatures})}}async initAuthConnectorListeners(Y){const J=Y.find(({id:X})=>X===ConstantsUtil$3.AUTH_CONNECTOR_ID);J&&(await this.listenAuthConnector(J),await this.listenModal(J))}async listenAuthConnector(Y){var J,X,Me;if(typeof window<"u"&&Y){(J=this.appKit)==null||J.setLoading(!0);const Se=await Y.getProvider(),Ne=Se.getLoginEmailUsed();(X=this.appKit)==null||X.setLoading(Ne),Ne&&((Me=this.appKit)==null||Me.setIsConnected(!1,this.chain)),Se.onRpcRequest(je=>{var ke,De;W3mFrameHelpers.checkIfRequestExists(je)?W3mFrameHelpers.checkIfRequestIsSafe(je)||(ke=this.appKit)==null||ke.handleUnsafeRPCRequest():((De=this.appKit)==null||De.open(),console.error(W3mFrameRpcConstants.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:je.method}),setTimeout(()=>{var qe;(qe=this.appKit)==null||qe.showErrorMessage(W3mFrameRpcConstants.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),Se.rejectRpcRequests())}),Se.onRpcError(()=>{var ke,De,qe,Ue;((ke=this.appKit)==null?void 0:ke.isOpen())&&((De=this.appKit)!=null&&De.isTransactionStackEmpty()?(qe=this.appKit)==null||qe.close():(Ue=this.appKit)==null||Ue.popTransactionStack(!0))}),Se.onRpcSuccess((je,ke)=>{var qe,Ue,Ge;W3mFrameHelpers.checkIfRequestIsSafe(ke)||((qe=this.appKit)!=null&&qe.isTransactionStackEmpty()?(Ue=this.appKit)==null||Ue.close():(Ge=this.appKit)==null||Ge.popTransactionStack())}),Se.onNotConnected(()=>{var ke,De,qe;((ke=this.appKit)==null?void 0:ke.getIsConnectedState())||((De=this.appKit)==null||De.setIsConnected(!1,this.chain),(qe=this.appKit)==null||qe.setLoading(!1))}),Se.onIsConnected(je=>{var ke,De,qe,Ue,Ge;(ke=this.appKit)==null||ke.setIsConnected(!0,this.chain),(De=this.appKit)==null||De.setSmartAccountDeployed(!!je.smartAccountDeployed,this.chain),(qe=this.appKit)==null||qe.setPreferredAccountType(je.preferredAccountType,this.chain),(Ue=this.appKit)==null||Ue.setLoading(!1),(Ge=this.appKit)==null||Ge.setAllAccounts(je.accounts||[{address:je.address,type:je.preferredAccountType||"eoa"}],this.chain)}),Se.onGetSmartAccountEnabledNetworks(je=>{var ke;(ke=this.appKit)==null||ke.setSmartAccountEnabledNetworks(je,this.chain)}),Se.onSetPreferredAccount(({address:je,type:ke})=>{var De;je&&((De=this.appKit)==null||De.setPreferredAccountType(ke,this.chain),reconnect(this.wagmiConfig,{connectors:[Y]}))})}}async listenModal(Y){const J=await Y.getProvider();this.subscribeState(X=>{X.open||J.rejectRpcRequests()})}}function createWeb3Modal(W){const Y=new EVMWagmiClient({wagmiConfig:W.wagmiConfig,siweConfig:W.siweConfig,defaultChain:W.defaultChain});return new AppKit({...W,defaultChain:Y.defaultChain,adapters:[Y],sdkType:"w3m",sdkVersion:`html-wagmi-${ConstantsUtil$3.VERSION}`})}const evmWalletChains={mainnet:{chainId:397,name:"Near Mainnet",explorer:"https://eth-explorer.near.org",rpc:"https://eth-rpc.mainnet.near.org"},testnet:{chainId:398,name:"Near Testnet",explorer:"https://eth-explorer-testnet.near.org",rpc:"https://eth-rpc.testnet.near.org"}};let NetworkId="testnet";const EVMWalletChain=evmWalletChains[NetworkId],near={id:EVMWalletChain.chainId,name:EVMWalletChain.name,nativeCurrency:{decimals:18,name:"NEAR",symbol:"NEAR"},rpcUrls:{default:{http:[EVMWalletChain.rpc]},public:{http:[EVMWalletChain.rpc]}},blockExplorers:{default:{name:"NEAR Explorer",url:EVMWalletChain.explorer}},testnet:NetworkId==="testnet"},projectId="5bb0fe33763b3bea40b8d69e4269b4ae",wagmiConfig=createConfig({chains:[near],transports:{[near.id]:http()},connectors:[walletConnect({projectId,showQrModal:!1}),injected({shimDisconnect:!0})]});reconnect(wagmiConfig);const web3Modal=createWeb3Modal({wagmiConfig,projectId}),THIRTY_TGAS="30000000000000",NO_DEPOSIT="0";class Wallet{constructor({networkId:Y="testnet",createAccessKeyFor:J=void 0}){Kc(this,"startUp",async Y=>{this.selector=setupWalletSelector({network:this.networkId,modules:[setupMeteorWallet(),setupEthereumWallets({wagmiConfig,web3Modal,alwaysOnboardDuringSignIn:!0}),setupLedger(),libExports.setupBitteWallet(),setupHereWallet(),setupSender(),setupNearMobileWallet(),setupWelldoneWallet(),setupMyNearWallet()],options:{allowAccountCreation:!0}});const J=await this.selector,Me=J.isSignedIn()?J.store.getState().accounts[0].accountId:"";return J.store.observable.subscribe(async Se=>{var je;const Ne=(je=Se==null?void 0:Se.accounts.find(ke=>ke.active))==null?void 0:je.accountId;Y(Ne||"")}),Me});Kc(this,"signIn",async()=>{setupModal(await this.selector,{contractId:this.createAccessKeyFor}).show()});Kc(this,"cleanup",async()=>{if(this.selector){const Y=await this.selector;Y.store.observable&&typeof Y.store.observable.unsubscribe=="function"&&Y.store.observable.unsubscribe()}});Kc(this,"signOut",async()=>{await(await(await this.selector).wallet()).signOut(),await this.cleanup()});Kc(this,"viewMethod",async({contractId:Y,method:J,args:X={}})=>{const Me=`https://rpc.${this.networkId}.near.org`,Ne=await new browserIndexExports$1.providers.JsonRpcProvider({url:Me}).query({request_type:"call_function",account_id:Y,method_name:J,args_base64:bufferExports.Buffer.from(JSON.stringify(X)).toString("base64"),finality:"optimistic"});return JSON.parse(bufferExports.Buffer.from(Ne.result).toString())});Kc(this,"callMethod",async({contractId:Y,method:J,args:X={},gas:Me=THIRTY_TGAS,deposit:Se=NO_DEPOSIT})=>{const je=await(await(await this.selector).wallet()).signAndSendTransaction({receiverId:Y,actions:[{type:"FunctionCall",params:{methodName:J,args:X,gas:Me,deposit:Se}}]});return browserIndexExports$1.providers.getTransactionLastResult(je)});Kc(this,"getTransactionResult",async Y=>{const J=await this.selector,{network:X}=J.options,Se=await new browserIndexExports$1.providers.JsonRpcProvider({url:X.nodeUrl}).txStatus(Y,"unnused");return browserIndexExports$1.providers.getTransactionLastResult(Se)});Kc(this,"getBalance",async(Y,J=!1)=>{const X=await this.selector,{network:Me}=X.options,Ne=await new browserIndexExports$1.providers.JsonRpcProvider({url:Me.nodeUrl}).query({request_type:"view_account",account_id:Y,finality:"final"});return J?Ne.amount?browserIndexExports$1.utils.format.formatNearAmount(Ne.amount):"0":Ne.amount||"0"});Kc(this,"signAndSendTransactions",async({transactions:Y})=>(await(await this.selector).wallet()).signAndSendTransactions({transactions:Y}));Kc(this,"getAccessKeys",async Y=>{const J=await this.selector,{network:X}=J.options;return(await new browserIndexExports$1.providers.JsonRpcProvider({url:X.nodeUrl}).query({request_type:"view_access_key_list",account_id:Y,finality:"final"})).keys});Kc(this,"createAccount",async(Y,J)=>{const X=await(await this.selector).wallet(),Me={receiverId:this.networkId==="mainnet"?"near":"testnet",actions:[{type:"FunctionCall",params:{methodName:"create_account",args:{new_account_id:Y,new_public_key:J},gas:"300000000000000",deposit:browserIndexExports$1.utils.format.parseNearAmount("0.00182")}}]};await X.signAndSendTransactions({transactions:[Me]})});this.createAccessKeyFor=J,this.networkId=Y}}const NearContext=reactExports.createContext({wallet:void 0,signedAccountId:""}),Navigation=()=>{const{networkId:W,onNetworkChange:Y,signedAccountId:J,wallet:X}=reactExports.useContext(NearContext),Me=Ne=>{const je=Ne.target.checked?"mainnet":"testnet";Y(je)},Se=()=>{J?X.signOut():X.signIn()};return jsxRuntimeExports.jsx("nav",{className:styles$2h.navbar,children:jsxRuntimeExports.jsxs("div",{className:styles$2h.navContent,children:[jsxRuntimeExports.jsx("div",{className:styles$2h.toggleContainer,children:jsxRuntimeExports.jsxs("div",{className:networkStyles.networkToggle,children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:networkStyles.networkToggleInput,id:"networkToggle",checked:W==="mainnet",onChange:Me}),jsxRuntimeExports.jsx("label",{className:networkStyles.networkToggleLabel,htmlFor:"networkToggle",children:jsxRuntimeExports.jsx("div",{className:networkStyles.networkToggleInner,children:jsxRuntimeExports.jsx("div",{className:networkStyles.networkToggleSwitch})})})]})}),jsxRuntimeExports.jsx("button",{className:styles$2h.loginButton,onClick:Se,children:J?"Logout":"Login"})]})})},footer="_footer_1leot_1",styles$2={footer},Footer=()=>jsxRuntimeExports.jsx("footer",{className:styles$2.footer,children:jsxRuntimeExports.jsx("div",{className:"text-uppercase",children:"COPYRIGHT 2025 BY SLEET"})}),container="_container_1by93_1",title="_title_1by93_9",subtitle="_subtitle_1by93_17",notice="_notice_1by93_24",styles$1={container,title,subtitle,notice},accountCreationContainer="_accountCreationContainer_b9c1z_1",buttonContainer="_buttonContainer_b9c1z_8",actionButton="_actionButton_b9c1z_15",active="_active_b9c1z_31",formContainer="_formContainer_b9c1z_35",formGroup="_formGroup_b9c1z_42",inputWrapper="_inputWrapper_b9c1z_62",checking="_checking_b9c1z_67",available="_available_b9c1z_68",unavailable="_unavailable_b9c1z_69",keyDisplay="_keyDisplay_b9c1z_89",submitButton="_submitButton_b9c1z_105",styles={accountCreationContainer,buttonContainer,actionButton,active,formContainer,formGroup,inputWrapper,checking,available,unavailable,keyDisplay,submitButton};class AccountCreator{constructor(Y){Kc(this,"validateAccountId",Y=>{if(!Y)throw new Error("Account ID is required");if(Y.length<2||Y.length>64)throw new Error("Account ID must be between 2 and 64 characters");if(!/^[a-z0-9-_]+$/.test(Y))throw new Error("Account ID can only contain lowercase letters, numbers, hyphens, and underscores");if(Y.startsWith("-")||Y.endsWith("-")||Y.startsWith("_")||Y.endsWith("_"))throw new Error("Account ID cannot start or end with a hyphen or underscore")});Kc(this,"checkAccountAvailability",async Y=>{try{this.validateAccountId(Y);const J=this.wallet.networkId==="mainnet"?".near":".testnet",X=Y+J;try{return await new browserIndexExports$1.providers.JsonRpcProvider({url:`https://rpc.${this.wallet.networkId}.near.org`}).query({request_type:"view_account",account_id:X,finality:"final"}),{available:!1,error:"Account already exists"}}catch(Me){const Se=Me.toString().toLowerCase();return Se.includes("does not exist")||Se.includes("not found")||Se.includes("unknown account")||Me.type==="AccountDoesNotExist"?{available:!0,error:null}:Se.includes("failed to fetch")||Se.includes("network error")?{available:!1,error:"Network error: Unable to check account availability"}:{available:!1,error:"Unable to verify account availability: "+Me.message}}}catch(J){return{available:!1,error:J.message||"Invalid account format"}}});Kc(this,"generateKeyPair",()=>{const Y=browserIndexExports$1.KeyPair.fromRandom("ed25519"),J=Y.getPublicKey().toString(),X=Y.toString();return{publicKey:J,privateKey:X}});Kc(this,"createAccount",async Y=>{try{this.validateAccountId(Y);const J=this.wallet.networkId==="mainnet"?".near":".testnet",X=Y+J,{publicKey:Me,privateKey:Se}=this.generateKeyPair();return await this.wallet.createAccount(X,Me),{accountId:Y,publicKey:Me,privateKey:Se,success:!0}}catch(J){return console.error("Error creating account:",J),{success:!1,error:J.message}}});this.wallet=Y}}var propTypes={exports:{}},ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var W="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=W,ReactPropTypesSecret_1}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var W=requireReactPropTypesSecret();function Y(){}function J(){}return J.resetWarningCache=Y,factoryWithThrowingShims=function(){function X(Ne,je,ke,De,qe,Ue){if(Ue!==W){var Ge=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw Ge.name="Invariant Violation",Ge}}X.isRequired=X;function Me(){return X}var Se={array:X,bigint:X,bool:X,func:X,number:X,object:X,string:X,symbol:X,any:X,arrayOf:Me,element:X,elementType:X,instanceOf:Me,node:X,objectOf:Me,oneOf:Me,oneOfType:Me,shape:Me,exact:Me,checkPropTypes:J,resetWarningCache:Y};return Se.PropTypes=Se,Se},factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){return hasRequiredPropTypes||(hasRequiredPropTypes=1,propTypes.exports=requireFactoryWithThrowingShims()()),propTypes.exports}var propTypesExports=requirePropTypes();const PropTypes=getDefaultExportFromCjs(propTypesExports),AccountInfoDisplay=({accountInfo:W})=>{const{wallet:Y}=reactExports.useContext(NearContext);if(!W)return null;const J=Y.networkId==="mainnet"?".near":".testnet",X=W.accountId+J;return jsxRuntimeExports.jsxs("div",{className:styles.formContainer,children:[jsxRuntimeExports.jsx("h2",{children:"Account Created Successfully!"}),jsxRuntimeExports.jsxs("div",{className:styles.formGroup,children:[jsxRuntimeExports.jsx("label",{children:"Full Account Name"}),jsxRuntimeExports.jsx("p",{className:styles.keyDisplay,children:X})]}),jsxRuntimeExports.jsxs("div",{className:styles.formGroup,children:[jsxRuntimeExports.jsx("label",{children:"Public Key"}),jsxRuntimeExports.jsx("p",{className:styles.keyDisplay,children:W.publicKey})]}),jsxRuntimeExports.jsxs("div",{className:styles.formGroup,children:[jsxRuntimeExports.jsx("label",{children:"Private Key"}),jsxRuntimeExports.jsx("p",{className:styles.keyDisplay,children:W.privateKey})]}),jsxRuntimeExports.jsxs("div",{className:styles.warning,children:[jsxRuntimeExports.jsx("p",{children:"⚠️ IMPORTANT: Save your private key in a secure place. Never share it with anyone!"}),jsxRuntimeExports.jsx("p",{children:"Your account will be permanently lost if you lose these credentials."})]})]})};AccountInfoDisplay.propTypes={accountInfo:PropTypes.shape({accountId:PropTypes.string.isRequired,publicKey:PropTypes.string.isRequired,privateKey:PropTypes.string.isRequired,seedPhrase:PropTypes.string.isRequired})};const NewAccountForm=()=>{const{wallet:W,signedAccountId:Y}=reactExports.useContext(NearContext),[J,X]=reactExports.useState(""),[Me,Se]=reactExports.useState(null),[Ne,je]=reactExports.useState(!1),[ke,De]=reactExports.useState(null),[qe,Ue]=reactExports.useState(null),[Ge,He]=reactExports.useState(!1);reactExports.useEffect(()=>{const Fn=setTimeout(async()=>{if(!(!J||!W)){He(!0),Ue(null),De(null);try{const $o=await new AccountCreator(W).checkAccountAvailability(J);Ue($o)}catch(io){De(io.message)}finally{He(!1)}}},500);return()=>clearTimeout(Fn)},[J,W]);const Ve=async Ye=>{if(Ye.preventDefault(),je(!0),De(null),!W){De("Please connect your wallet first"),je(!1);return}if(!Y){De("Please sign in to create a new account"),je(!1);return}try{const io=await new AccountCreator(W).createAccount(J);io.success?Se(io):De(io.error)}catch(Fn){De(Fn.message)}finally{je(!1)}};return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("form",{className:styles.formContainer,onSubmit:Ve,children:[jsxRuntimeExports.jsxs("div",{className:styles.formGroup,children:[jsxRuntimeExports.jsx("label",{htmlFor:"accountId",children:"Account Name"}),jsxRuntimeExports.jsxs("div",{className:styles.inputWrapper,children:[jsxRuntimeExports.jsx("input",{type:"text",id:"accountId",value:J,onChange:Ye=>{const Fn=Ye.target.value.toLowerCase();(Fn===""||/^[a-z0-9-_]*$/.test(Fn))&&X(Fn)},placeholder:"Enter account name (lowercase letters, numbers, hyphens, and underscores only)",pattern:"[a-z0-9-_]+",required:!0}),Ge&&jsxRuntimeExports.jsx("span",{className:styles.checking,children:"Checking..."}),!Ge&&qe&&jsxRuntimeExports.jsx("span",{className:qe.available?styles.available:styles.unavailable,children:qe.available?"✓ Available":"✗ Unavailable"})]})]}),ke&&jsxRuntimeExports.jsx("div",{className:styles.error,children:ke}),jsxRuntimeExports.jsx("button",{type:"submit",className:styles.submitButton,disabled:Ne||Ge||qe&&!qe.available,children:Ne?"Creating Account...":"Create New Account"})]}),Me&&jsxRuntimeExports.jsx(AccountInfoDisplay,{accountInfo:Me})]})},SubAccountForm=()=>jsxRuntimeExports.jsx("div",{className:styles.formContainer,children:jsxRuntimeExports.jsxs("div",{className:styles.formGroup,children:[jsxRuntimeExports.jsx("h3",{children:"Sub-Account Creation Currently Unavailable"}),jsxRuntimeExports.jsx("p",{children:"Sub-account creation through the web interface is not currently supported. Please use the NEAR CLI to create sub-accounts."}),jsxRuntimeExports.jsxs("div",{className:styles.cliExample,children:[jsxRuntimeExports.jsx("p",{children:"Example CLI command:"}),jsxRuntimeExports.jsx("code",{children:"near create-account sub1.myaccount.testnet --masterAccount myaccount.testnet --initialBalance 1"})]}),jsxRuntimeExports.jsx("p",{children:"For detailed instructions on using NEAR CLI for sub-account creation, please refer to the official NEAR documentation."})]})}),AccountCreationButtons=()=>{const[W,Y]=reactExports.useState(null);return jsxRuntimeExports.jsxs("div",{className:styles.accountCreationContainer,children:[jsxRuntimeExports.jsxs("div",{className:styles.buttonContainer,children:[jsxRuntimeExports.jsx("button",{className:`${styles.actionButton} ${W==="new"?styles.active:""}`,onClick:()=>Y(W==="new"?null:"new"),children:"Create a New Account"}),jsxRuntimeExports.jsx("button",{className:`${styles.actionButton} ${W==="sub"?styles.active:""}`,onClick:()=>Y(W==="sub"?null:"sub"),children:"Create a Sub Account"})]}),W==="new"&&jsxRuntimeExports.jsx(NewAccountForm,{}),W==="sub"&&jsxRuntimeExports.jsx(SubAccountForm,{})]})},MainContent=()=>jsxRuntimeExports.jsxs("div",{className:styles$1.container,children:[jsxRuntimeExports.jsx("h1",{className:styles$1.title,children:"SLEET ACCOUNT"}),jsxRuntimeExports.jsx("p",{className:styles$1.subtitle,children:"NEAR ACCOUNT CREATION PLAYGROUND"}),jsxRuntimeExports.jsx(AccountCreationButtons,{}),jsxRuntimeExports.jsx("div",{className:styles$1.notice,children:jsxRuntimeExports.jsx("p",{children:"NOTE: THE RECOMMEND WAY FOR USERS TO CREATE NEW NEAR ACCOUNTS IS WITH A NEAR WALLET APP LIKE METEOR WALLET OR BITTE. ONLY USE THIS TOOL IF YOU KNOW WHAT YOU ARE DOING!"})})]});function App(){const[W,Y]=reactExports.useState(null),[J,X]=reactExports.useState(()=>localStorage.getItem("networkId")||"testnet"),[Me,Se]=reactExports.useState(()=>new Wallet({networkId:J,createAccessKeyFor:W}));reactExports.useEffect(()=>(Me.startUp(Y),()=>{Me.cleanup()}),[Me]);const Ne=async je=>{if(W){if(!window.confirm("Please log out before changing networks to ensure proper wallet state management."))return;await Me.signOut()}await Me.cleanup(),localStorage.setItem("networkId",je),X(je);const ke=new Wallet({networkId:je,createAccessKeyFor:W});await ke.startUp(Y),Se(ke),window.location.reload()};return jsxRuntimeExports.jsx(NearContext.Provider,{value:{wallet:Me,signedAccountId:W,networkId:J,onNetworkChange:Ne},children:jsxRuntimeExports.jsxs("div",{className:"container d-flex flex-column min-vh-100",children:[jsxRuntimeExports.jsx(Navigation,{}),jsxRuntimeExports.jsx("main",{className:"mt-4 flex-grow-1",children:jsxRuntimeExports.jsx(MainContent,{})}),jsxRuntimeExports.jsx(Footer,{})]})})}clientExports.createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(App,{})})}));export{concatHex as $,AbiEventNotFoundError as A,BaseError$1 as B,createTransport as C,DecodeLogTopicsMismatch as D,wait$1 as E,getChainContractAddress as F,toHex as G,packetToBytes as H,InvalidInputRpcError as I,hexToNumber as J,createBatchScheduler as K,idCache as L,withTimeout as M,TimeoutError as N,getHttpRpcClient as O,PositionOutOfBoundsError as P,concat$1 as Q,isAddress as R,InvalidAddressError as S,TransactionRejectedRpcError as T,UserRejectedRequestError as U,BytesSizeMismatchError as V,WebSocketRequestError as W,stringToHex as X,bytesToHex as Y,sliceHex as Z,__vitePreload as _,toBytes$1 as a,OptionsController as a$,getTransaction as a0,isHex as a1,Hash as a2,hash$2 as a3,toBytes as a4,exists as a5,bytes as a6,concatBytes$1 as a7,randomBytes as a8,sha256$3 as a9,AccountNotFoundError as aA,assertRequest as aB,assertCurrentChain as aC,formatTransactionRequest as aD,signMessage$1 as aE,writeContract$1 as aF,UrlRequiredError as aG,RpcRequestError as aH,createClient as aI,custom$1 as aJ,weiUnits as aK,formatUnits as aL,ContractFunctionExecutionError as aM,hexToString as aN,trim$1 as aO,ResourceUnavailableRpcError as aP,withRetry as aQ,SwitchChainError as aR,fromHex as aS,EventEmitter as aT,ProviderDisconnectedError as aU,ChainDisconnectedError as aV,http as aW,proxy as aX,subscribeKey as aY,subscribe as aZ,ref as a_,hexToBigInt as aa,encodeDeployData as ab,universalSignatureValidatorAbi as ac,universalSignatureValidatorByteCode as ad,CallExecutionError as ae,formatBlock as af,getBlock as ag,getBalance$1 as ah,getChainId as ai,getEnsAddress$1 as aj,getEnsAvatar$1 as ak,getEnsName$1 as al,getEnsText as am,estimateFeesPerGas as an,getGasPrice as ao,estimateMaxPriorityFeePerGas as ap,getTransactionCount as aq,getTransactionReceipt as ar,multicall$1 as as,prepareTransactionRequest$1 as at,sendRawTransaction as au,waitForTransactionReceipt$1 as av,watchBlockNumber as aw,sendTransaction$1 as ax,checksumAddress as ay,getAddress as az,encodeFunctionData as b,WuiTabs as b$,i$5 as b0,customElement as b1,r$5 as b2,AccountController as b3,x$4 as b4,r$3 as b5,ModalController as b6,EventsController as b7,NetworkController as b8,W3mFrameRpcConstants as b9,WuiCardSelect as bA,WuiChip as bB,WuiConnectButton as bC,WuiCtaButton as bD,WuiDetailsGroup as bE,WuiDetailsGroupItem as bF,WuiDropdownMenu as bG,WuiEmailInput as bH,WuiEnsInput as bI,WuiIconBox as bJ,WuiIconLink as bK,WuiInputElement as bL,WuiInputNumeric as bM,WuiInputText as bN,WuiLink as bO,WuiListItem as bP,WuiTransactionListItem as bQ,WuiTransactionListItemLoader as bR,WuiListWallet as bS,WuiLogoSelect as bT,WuiLogo as bU,WuiNetworkButton as bV,WuiNetworkImage as bW,WuiOtp as bX,WuiQrCode as bY,WuiSearchBar as bZ,WuiSnackbar as b_,SnackController as ba,ConnectionController as bb,RouterController as bc,Gi as bd,Yi as be,b$2 as bf,MathUtil as bg,initializeTheming as bh,setColorTheme as bi,setThemeVariables as bj,UiHelperUtil as bk,TransactionUtil as bl,WuiCard as bm,WuiIcon as bn,WuiImage as bo,WuiLoadingHexagon as bp,WuiLoadingSpinner as bq,WuiLoadingThumbnail as br,WuiShimmer as bs,WuiText as bt,WuiVisual as bu,WuiAccountButton as bv,WuiAllWalletsImage as bw,WuiAvatar as bx,WuiButton as by,WuiCardSelectLoader as bz,getAction$1 as c,WuiTokenButton as c0,WuiTag as c1,WuiTooltip as c2,WuiTokenListItem as c3,WuiTransactionVisual as c4,WuiVisualThumbnail as c5,WuiWalletImage as c6,WuiNoticeCard as c7,WuiListAccordion as c8,WuiListContent as c9,getUrl as cA,decodeErrorResult as cB,HttpRequestError as cC,QRCodeUtil as cD,WuiListNetwork as ca,WuiListWalletTransaction as cb,WuiPromo as cc,WuiBalance as cd,WuiProfileButton as ce,WuiProfileButtonV2 as cf,WuiChipButton as cg,WuiCompatibleNetwork as ch,WuiBanner as ci,WuiBannerImg as cj,WuiListToken as ck,WuiListDescription as cl,WuiInputAmount as cm,WuiPreviewItem as cn,WuiListAccount as co,WuiIconButton as cp,WuiListButton as cq,WuiListSocial as cr,WuiSelect as cs,WuiFlex as ct,WuiGrid as cu,WuiSeparator as cv,ApiController as cw,CoreHelperUtil as cx,ThemeController as cy,snapshot as cz,estimateGas$1 as d,encodeAbiParameters as e,formatAbiItem as f,getAbiItem as g,getContractError as h,AbiEventSignatureEmptyTopicsError as i,AbiEventSignatureNotFoundError as j,keccak256 as k,decodeAbiParameters as l,AbiDecodingDataSizeTooSmallError as m,numberToHex as n,DecodeLogDataMismatch as o,parseAccount as p,formatLog as q,call as r,size$2 as s,toEventSelector as t,decodeFunctionResult as u,stringify$1 as v,observe as w,poll$1 as x,getBlockNumber as y,readContract$1 as z};
fs_store()
tion He(Ye){try{Ve(ke.throw(Ye))}catch(Fn){Ue(Fn)}}function Ve(Ye){Ye.done?qe(Ye.value):De(Ye.value).then(Ge,He)}Ve((ke=ke.apply(Se,Ne||[])).next())})};Object.defineProperty(bitteWalletSetup,"__esModule",{value:!0}),bitteWalletSetup.setupBitteWallet=void 0;const Y=requireBitteWallet(),J=requireUtils$c(),X="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTUiIGhlaWdodD0iOTUiIHZpZXdCb3g9IjAgMCA5NSA5NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjc3NjE3IDU5LjE4MjZMNjIuNzIyNyA2My4zMTNDNjMuMTE4NSA2My40MzA5IDYzLjQ3ODggNjMuNjQ1NiA2My43NzA4IDYzLjkzNzdDNjQuMDYyOSA2NC4yMjk3IDY0LjI3NzUgNjQuNTg5OSA2NC4zOTU0IDY0Ljk4NThMNjguNTI1OSA3OC44NTU1QzY4LjY3ODcgNzkuMzY4NiA2OC45OTMyIDc5LjgxODYgNjkuNDIyNCA4MC4xMzg3QzY5Ljg1MTYgODAuNDU4NyA3MC4zNzI3IDgwLjYzMTYgNzAuOTA4MiA4MC42MzE2QzcxLjQ0MzYgODAuNjMxNiA3MS45NjQ3IDgwLjQ1ODcgNzIuMzkzOSA4MC4xMzg3QzcyLjgyMzEgNzkuODE4NiA3My4xMzc2IDc5LjM2ODYgNzMuMjkwNCA3OC44NTU1TDc3LjQyMDkgNjQuOTg1OEM3Ny41Mzg4IDY0LjU4OTkgNzcuNzUzNCA2NC4yMjk3IDc4LjA0NTUgNjMuOTM3N0M3OC4zMzc2IDYzLjY0NTYgNzguNjk3OCA2My40MzA5IDc5LjA5MzYgNjMuMzEzTDkyLjk2MzMgNTkuMTgyNkM5My40Nz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zE3QzQ5Ljc5NTggMjQuMTYyMSA0OS41ODI5IDI0LjAzNTIgNDkuNDEwNCAyMy44NjI3QzQ5LjIzNzkgMjMuNjkwMiA0OS4xMTEgMjMuNDc3MyA0OS4wNDE0IDIzLjI0MzRMNDYuNjAxMSAxNS4wNDkzQzQ2LjUxMDggMTQuNzQ2MiA0Ni4zMjUgMTQuNDgwMyA0Ni4wNzE1IDE0LjI5MTJDNDUuODE3OSAxNC4xMDIxIDQ1LjUxIDE0IDQ1LjE5MzcgMTRDNDQuODc3NCAxNCA0NC41Njk1IDE0LjEwMjEgNDQuMzE1OSAxNC4yOTEyQzQ0LjA2MjMgMTQuNDgwMyA0My44NzY2IDE0Ljc0NjIgNDMuNzg2MyAxNS4wNDkzTDQxLjM0NiAyMy4yNDM0QzQxLjI3NjQgMjMuNDc3MyA0MS4xNDk1IDIzLjY5MDIgNDAuOTc3IDIzLjg2MjdDNDAuODA0NCAyNC4wMzUyIDQwLjU5MTYgMjQuMTYyMSA0MC4zNTc4IDI0LjIzMTdMMzIuMTYzNyAyNi42NzJDMzEuODYwNSAyNi43NjIyIDMxLjU5NDYgMjYuOTQ4IDMxLjQwNTUgMjcuMjAxNkMzMS4yMTY0IDI3LjQ1NTIgMzEuMTE0MyAyNy43NjMxIDMxLjExNDMgMjguMDc5NEMzMS4xMTQzIDI4LjM5NTggMzEuMjE2NCAyOC43MDM3IDMxLjQwNTUgMjguOTU3MkMzMS41OTQ2IDI5LjIxMDggMzEuODYwNSAyOS4zOTY2IDMyLjE2MzcgMjkuNDg2OFoiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo=";function Me({walletUrl:Se="",deprecated:Ne=!1,successUrl:je="",failureUrl:ke="",callbackUrl:De="",contractId:qe=""}={}){return Ue=>W(this,void 0,void 0,function*(){return{id:"bitte-wallet",type:"browser",metadata:{name:"Bitte Wallet",description:"NEAR wallet to store, buy, send and stake assets for DeFi.",iconUrl:X,deprecated:Ne,available:!0,successUrl:je,failureUrl:ke,walletUrl:(0,J.resolveBitteWallet)(Ue.options.network.networkId,Se)},init:He=>(0,Y.BitteWallet)(Object.assign({callback:De,networkId:Ue.options.network.networkId,successUrl:je,failureUrl:ke,contractId:qe},He))}})}return bitteWalletSetup.setupBitteWallet=Me,bitteWalletSetup}var setup={},mintbaseWallet={},hasRequiredMintbaseWallet;function requireMintbaseWallet(){return hasRequiredMintbaseWallet||(hasRequiredMintbaseWallet=1,function(W){var Y=mintbaseWallet.__createBinding||(Object.create?function(De,qe,Ue,Ge){Ge===void 0&&(Ge=Ue);var He=Object.getOwnPropertyDescriptor(qe,Ue);(!He||("get"in He?!qe.__esModule:He.writable||He.configurable))&&(He={enumerable:!0,get:function(){return qe[Ue]}}),Object.defineProperty(De,Ge,He)}:function(De,qe,Ue,Ge){Ge===void 0&&(Ge=Ue),De[Ge]=qe[Ue]}),J=mintbaseWallet.__setModuleDefault||(Object.create?function(De,qe){Object.defineProperty(De,"default",{enumerable:!0,value:qe})}:function(De,qe){De.default=qe}),X=mintbaseWallet.__importStar||function(De){if(De&&De.__esModule)return De;var qe={};if(De!=null)for(var Ue in De)Ue!=="default"&&Object.prototype.hasOwnProperty.call(De,Ue)&&Y(qe,De,Ue);return J(qe,De),qe},Me=mintbaseWallet.__awaiter||function(De,qe,Ue,Ge){function He(Ve){return Ve instanceof Ue?Ve:new Ue(function(Ye){Ye(Ve)})}return new(Ue||(Ue=Promise))(function(Ve,Ye){function Fn(Jo){try{$o(Ge.next(Jo))}catch(rs){Ye(rs)}}function io(Jo){try{$o(Ge.throw(Jo))}catch(rs){Ye(rs)}}function $o(Jo){Jo.done?Ve(Jo.value):He(Jo.value).then(Fn,io)}$o((Ge=Ge.apply(De,qe||[])).next())})};Object.defineProperty(W,"__esModule",{value:!0}),W.MintbaseWallet=W.TransactionSuccessEnum=void 0;const Se=X(requireBrowserIndex$4()),Ne=requireUtils$c(),je=require$$2$2;(function(De){De.MINT="mint",De.TRANSFER="transfer",De.BURN="burn",De.DEPLOY_STORE="deploy-store",De.MAKE_OFFER="make-offer",De.REVOKE_MINTER="revoke-minter",De.ADD_MINTER="add-minter",De.TRANSFER_STORE_OWNERSHIP="transfer-store-ownership",De.AUCTION_LIST="list",De.SIMPLE_SALE_LIST="simple-sale-list",De.UNLIST="unlist",De.TAKE_OFFER="take-offer",De.WITHDRAW_OFFER="withdraw-offer"})(W.TransactionSuccessEnum||(W.TransactionSuccessEnum={}));const ke=({metadata:De,options:qe,successUrl:Ue,failureUrl:Ge,contractId:He,callback:Ve,networkId:Ye})=>Me(void 0,void 0,void 0,function*(){const io=yield Me(void 0,void 0,void 0,function*(){if(typeof window!==void 0){const{connect:mo,WalletConnection:Go,keyStores:Qo}=Se,Ao={networkId:Ye,keyStore:new Qo.BrowserLocalStorageKeyStore,nodeUrl:qe.network.nodeUrl,walletUrl:De.walletUrl,headers:{}},Ho=new URL(window.location.href).searchParams.get("account_id");Ho&&!He&&localStorage.setItem("mintbase-wallet_wallet_auth_key",JSON.stringify({accountId:Ho,allKeys:[]}));const rc=yield mo(Ao),dc=new Go(rc,"mintbase-wallet");return localStorage.setItem("mintbase-wallet:callback_url",Ve),{wallet:dc}}return null});let $o;const Jo=()=>$o,rs=()=>Me(void 0,void 0,void 0,function*(){return!!$o}),Yo=()=>Me(void 0,void 0,void 0,function*(){var mo;const Go=yield Ke(),Qo=encodeURI((mo=window==null?void 0:window.location)===null||mo===void 0?void 0:mo.href);return Go.length?Go:(yield io.wallet.requestSignIn({methodNames:[],successUrl:Ue||Qo,failureUrl:Ge||Qo,contractId:He}),Ke())}),zo=()=>Me(void 0,void 0,void 0,function*(){window.localStorage.removeItem("mintbase-wallet:account-data"),io.wallet.isSignedIn()&&io.wallet.signOut()}),jo=mo=>{if(mo&&mo!==io.wallet.getAccountId())throw new Error(`Cannot sign transactions for ${mo} while signed in as ${$o}`)},Vo=({transactions:mo,callbackUrl:Go})=>Me(void 0,void 0,void 0,function*(){if(!io.wallet.isSignedIn())throw new Error("Wallet not signed in");const{cbUrl:Qo}=(0,Ne.getCallbackUrl)(Go??"");for(const{signerId:rc}of mo)jo(rc);const Ao=JSON.stringify(mo),Mn=encodeURIComponent(Ao),Ho=new URL(`${De.walletUrl}/sign-transaction`);Ho.searchParams.set("transactions_data",Mn),Ho.searchParams.set("callback_url",Qo),window.location.assign(Ho.toString())}),os=({receiverId:mo,actions:Go,signerId:Qo,callbackUrl:Ao})=>Me(void 0,void 0,void 0,function*(){if(jo(Qo),!mo&&!He)throw new Error("No receiver found to send the transaction to");const{cbUrl:Mn}=(0,Ne.getCallbackUrl)(Ao??""),Ho=Mn||Ue;if(!He){const dc=new URL(`${De.walletUrl}/sign-transaction`),ds=JSON.stringify([{receiverId:mo,signerId:Qo,actions:Go}]),fc=encodeURIComponent(ds);dc.searchParams.set("transactions_data",fc),dc.searchParams.set("callback_url",Ho),window.location.assign(dc.toString())}return io.wallet.account().signAndSendTransaction({receiverId:mo||He,actions:Go.map(dc=>(0,je.createAction)(dc)),walletCallbackUrl:Ho})}),us=()=>Me(void 0,void 0,void 0,function*(){throw new Error(`The verifyOwner method is not supported by ${De.name}`)}),is=({message:mo,nonce:Go,recipient:Qo,callbackUrl:Ao})=>Me(void 0,void 0,void 0,function*(){const{cbUrl:Mn}=(0,Ne.getCallbackUrl)(Ao??""),Ho=new URL(`${De.walletUrl}/sign-message`);Ho.searchParams.set("message",mo),Ho.searchParams.set("nonce",Buffer.from(Go).toString("base64")),Ho.searchParams.set("recipient",Qo),Ho.searchParams.set("callbackUrl",Mn),window.location.assign(Ho.toString())}),Lo=({accountId:mo,publicKey:Go,signature:Qo,message:Ao,nonce:Mn,recipient:Ho,callbackUrl:rc})=>Me(void 0,void 0,void 0,function*(){const dc=new URL(`${De.walletUrl}/api/verify-message`);dc.searchParams.set("message",Ao),dc.searchParams.set("accountId",mo),dc.searchParams.set("publicKey",Go),dc.searchParams.set("signature",Qo),dc.searchParams.set("nonce",Buffer.from(Mn).toString("base64")),dc.searchParams.set("recipient",Ho),dc.searchParams.set("callbackUrl",rc);try{const fc=yield(yield fetch(dc.toString())).json(),{isValid:ac}=fc;return ac}catch{return!1}}),Fe=()=>Me(void 0,void 0,void 0,function*(){throw`The getAvailableBalance method is not supported by ${De.name}`}),Ke=()=>Me(void 0,void 0,void 0,function*(){var mo;const Go=io.wallet.getAccountId(),Qo=io.wallet.account();if(!Go||!Qo)return[];const Ao=window.localStorage.getItem("mintbase-wallet:account-creation-data");return[{accountId:Go,publicKey:(mo=JSON.parse(Ao))===null||mo===void 0?void 0:mo.devicePublicKey}]}),Je=mo=>Me(void 0,void 0,void 0,function*(){return wi(mo),null}),wi=mo=>($o=mo,window.localStorage.setItem("mintbase-wallet:activeAccountId",mo),null);return{getAccountId:Jo,isSignedIn:rs,signIn:Yo,signOut:zo,signAndSendTransaction:os,verifyOwner:us,signMessage:is,getAvailableBalance:Fe,getAccounts:Ke,switchAccount:Je,signAndSendTransactions:Vo,verifyMessage:Lo}});W.MintbaseWallet=ke}(mintbaseWallet)),mintbaseWallet}var hasRequiredSetup;function requireSetup(){if(hasRequiredSetup)return setup;hasRequiredSetup=1;var W=setup.__awaiter||function(Se,Ne,je,ke){function De(qe){return qe instanceof je?qe:new je(function(Ue){Ue(qe)})}return new(je||(je=Promise))(function(qe,Ue){function Ge(Ye){try{Ve(ke.next(Ye))}catch(Fn){Ue(Fn)}}function He(Ye){try{Ve(ke.throw(Ye))}catch(Fn){Ue(Fn)}}function Ve(Ye){Ye.done?qe(Ye.value):De(Ye.value).then(Ge,He)}Ve((ke=ke.apply(Se,Ne||[])).next())})};Object.defineProperty(setup,"__esModule",{value:!0}),setup.setupMintbaseWallet=void 0;const Y=requireMintbaseWallet(),J=requireUtils$c(),X="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAnySURBVHgB7Z0HjBVFHMa/B/YK9u6BvUSwd8EeGyrWxM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ILLUoNvDBZQSE4XdlfiTHCfKPsCW8Rpg+0MG1c1cXj0AjdzRiptmdb6m+LfwEGoUIy8K/6BwAAAABJRU5ErkJggg==";function Me({walletUrl:Se="",deprecated:Ne=!1,successUrl:je="",failureUrl:ke="",callbackUrl:De="",contractId:qe=""}={}){return Ue=>W(this,void 0,void 0,function*(){return{id:"mintbase-wallet",type:"browser",metadata:{name:"Mintbase Wallet",description:"NEAR wallet to store, buy, send and stake assets for DeFi.",iconUrl:X,deprecated:Ne,available:!0,successUrl:je,failureUrl:ke,walletUrl:(0,J.resolveWalletUrl)(Ue.options.network.networkId,Se)},init:He=>(0,Y.MintbaseWallet)(Object.assign({callback:De,networkId:Ue.options.network.networkId,successUrl:je,failureUrl:ke,contractId:qe},He))}})}return setup.setupMintbaseWallet=Me,setup}var hasRequiredLib$a;function requireLib$a(){return hasRequiredLib$a||(hasRequiredLib$a=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.setupMintbaseWallet=W.setupBitteWallet=void 0;var Y=requireBitteWalletSetup();Object.defineProperty(W,"setupBitteWallet",{enumerable:!0,get:function(){return Y.setupBitteWallet}});var J=requireSetup();Object.defineProperty(W,"setupMintbaseWallet",{enumerable:!0,get:function(){return J.setupMintbaseWallet}})}(lib$m)),lib$m}var libExports=requireLib$a(),browserIndex$4={},browserIndex$3={},keystore$3={},commonjs$9={},in_memory_key_store$3={},commonjs$8={},constants$7={},hasRequiredConstants$7;function requireConstants$7(){if(hasRequiredConstants$7)return constants$7;hasRequiredConstants$7=1,Object.defineProperty(constants$7,"__esModule",{value:!0}),constants$7.KeySize=constants$7.KeyType=void 0;var W;return function(Y){Y[Y.ED25519=0]="ED25519",Y[Y.SECP256K1=1]="SECP256K1"}(W||(constants$7.KeyType=W={})),constants$7.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64},constants$7}var key_pair$3={},key_pair_base$1={},hasRequiredKey_pair_base$1;function requireKey_pair_base$1(){if(hasRequiredKey_pair_base$1)return key_pair_base$1;hasRequiredKey_pair_base$1=1,Object.defineProperty(key_pair_base$1,"__esModule",{value:!0}),key_pair_base$1.KeyPairBase=void 0;class W{}return key_pair_base$1.KeyPairBase=W,key_pair_base$1}var key_pair_ed25519$1={},commonjs$7={},constants$6={},hasRequiredConstants$6;function requireConstants$6(){return hasRequiredConstants$6||(hasRequiredConstants$6=1,Object.defineProperty(constants$6,"__esModule",{value:!0}),constants$6.DEFAULT_FUNCTION_CALL_GAS=void 0,constants$6.DEFAULT_FUNCTION_CALL_GAS=30000000000000n),constants$6}var errors$9={},errors$8={};const GasLimitExceeded$1="Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName$1="Method name is empty",WasmerCompileError$1="Wasmer compilation error: {{msg}}",GuestPanic$1="Smart contract panicked: {{panic_msg}}",Memory$1="Error creating Wasm memory",GasExceeded$1="Exceeded the prepaid gas",MethodUTF8Error$1="Method name is not valid UTF8 string",BadUTF16$1="String encoding is bad UTF-16 sequence",WasmTrap$1="WebAssembly trap: {{msg}}",GasInstrumentation$1="Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex$1="{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex$1="Accessed invalid promise result index: {{result_idx}}",Deserialization$1="Error happened while deserializing the module",MethodNotFound$1="Contract method is not found",InvalidRegisterId$1="Accessed invalid register id: {{register_id}}",InvalidReceiptIndex$1="VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName$1="Method name is empty in contract call",CannotReturnJointPromise$1="Returning joint promise is currently prohibited",StackHeightInstrumentation$1="Stack instrumentation failed",CodeDoesNotExist$1="Cannot find contract code for account {{account_id}}",MethodInvalidSignature$1="Invalid method signature",IntegerOverflow$1="Integer overflow happened during contract execution",MemoryAccessViolation$1="MemoryAccessViolation",InvalidIteratorIndex$1="Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated$1="Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId$1="VM Logic returned an invalid account id",Serialization$1="Error happened while serializing the module",CannotAppendActionToJointPromise$1="Actions can only be appended to non-joint promise.",InternalMemoryDeclared$1="Internal memory declaration has been found in the module",Instantiate$1="Error happened during instantiation",ProhibitedInView$1="{{method_name}} is not allowed in view calls",InvalidMethodName$1="VM Logic returned an invalid method name",BadUTF8$1="String encoding is bad UTF-8 sequence",BalanceExceeded$1="Exceeded the account balance",LinkError$1="Wasm contract link error: {{msg}}",InvalidPublicKey$1="VM Logic provided an invalid public key",ActorNoPermission$1="Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState$1="The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch$1="Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow$1="Transaction gas or balance cost is too high",InvalidSignature$1="Transaction is not signed with the given public key",AccessKeyNotFound$1=`Signer "{{account_id}}" doesn't have access key with the given public_key {{public_key}}`,NotEnoughBalance$1="Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance$1="Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired$1="Transaction has expired",DeleteAccountStaking$1="Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist$1="Signer {{signer_id}} does not exist",TriesToStake$1="Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists$1="The public key {{public_key}} is already used for an existing access key",InvalidSigner$1="Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed$1="The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess$1="The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake$1="Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce$1="Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists$1="Can't create a new account {{account_id}}, because it already exists",InvalidChain$1="Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist$1="Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist$1="Can't complete the action because access key {{public_key}} doesn't exist",MethodNameMismatch$1="Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent$1="Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance$1="Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver$1="Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist$1="Account {{account_id}} tries to remove an access key that doesn't exist",Timeout$1="Timeout exceeded",Closed$1="Connection closed",ShardCongested="Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck="Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later",require$$0$5={GasLimitExceeded:GasLimitExceeded$1,MethodEmptyName:MethodEmptyName$1,WasmerCompileError:WasmerCompileError$1,GuestPanic:GuestPanic$1,Memory:Memory$1,GasExceeded:GasExceeded$1,MethodUTF8Error:MethodUTF8Error$1,BadUTF16:BadUTF16$1,WasmTrap:WasmTrap$1,GasInstrumentation:GasInstrumentation$1,InvalidPromiseIndex:InvalidPromiseIndex$1,InvalidPromiseResultIndex:InvalidPromiseResultIndex$1,Deserialization:Deserialization$1,MethodNotFound:MethodNotFound$1,InvalidRegisterId:InvalidRegisterId$1,InvalidReceiptIndex:InvalidReceiptIndex$1,EmptyMethodName:EmptyMethodName$1,CannotReturnJointPromise:CannotReturnJointPromise$1,StackHeightInstrumentation:StackHeightInstrumentation$1,CodeDoesNotExist:CodeDoesNotExist$1,MethodInvalidSignature:MethodInvalidSignature$1,IntegerOverflow:IntegerOverflow$1,MemoryAccessViolation:MemoryAccessViolation$1,InvalidIteratorIndex:InvalidIteratorIndex$1,IteratorWasInvalidated:IteratorWasInvalidated$1,InvalidAccountId:InvalidAccountId$1,Serialization:Serialization$1,CannotAppendActionToJointPromise:CannotAppendActionToJointPromise$1,InternalMemoryDeclared:InternalMemoryDeclared$1,Instantiate:Instantiate$1,ProhibitedInView:ProhibitedInView$1,InvalidMethodName:InvalidMethodName$1,BadUTF8:BadUTF8$1,BalanceExceeded:BalanceExceeded$1,LinkError:LinkError$1,InvalidPublicKey:InvalidPublicKey$1,ActorNoPermission:ActorNoPermission$1,LackBalanceForState:LackBalanceForState$1,ReceiverMismatch:ReceiverMismatch$1,CostOverflow:CostOverflow$1,InvalidSignature:InvalidSignature$1,AccessKeyNotFound:AccessKeyNotFound$1,NotEnoughBalance:NotEnoughBalance$1,NotEnoughAllowance:NotEnoughAllowance$1,Expired:Expired$1,DeleteAccountStaking:DeleteAccountStaking$1,SignerDoesNotExist:SignerDoesNotExist$1,TriesToStake:TriesToStake$1,AddKeyAlreadyExists:AddKeyAlreadyExists$1,InvalidSigner:InvalidSigner$1,CreateAccountNotAllowed:CreateAccountNotAllowed$1,RequiresFullAccess:RequiresFullAccess$1,TriesToUnstake:TriesToUnstake$1,InvalidNonce:InvalidNonce$1,AccountAlreadyExists:AccountAlreadyExists$1,InvalidChain:InvalidChain$1,AccountDoesNotExist:AccountDoesNotExist$1,AccessKeyDoesNotExist:AccessKeyDoesNotExist$1,MethodNameMismatch:MethodNameMismatch$1,DeleteAccountHasRent:DeleteAccountHasRent$1,DeleteAccountHasEnoughBalance:DeleteAccountHasEnoughBalance$1,InvalidReceiver:InvalidReceiver$1,DeleteKeyDoesNotExist:DeleteKeyDoesNotExist$1,Timeout:Timeout$1,Closed:Closed$1,ShardCongested,ShardStuck};var hasRequiredErrors$9;function requireErrors$9(){if(hasRequiredErrors$9)return errors$8;hasRequiredErrors$9=1;var W=errors$8.__importDefault||function(J){return J&&J.__esModule?J:{default:J}};Object.defineProperty(errors$8,"__esModule",{value:!0}),errors$8.ErrorMessages=void 0;const Y=W(require$$0$5);return errors$8.ErrorMessages=Y.default,errors$8}var rpc_errors$3={},commonjs$6={},assignable={},hasRequiredAssignable;function requireAssignable(){if(hasRequiredAssignable)return assignable;hasRequiredAssignable=1,Object.defineProperty(assignable,"__esModule",{value:!0}),assignable.Assignable=void 0;class W{constructor(J){Object.keys(J).map(X=>{this[X]=J[X]})}}return assignable.Assignable=W,assignable}var _enum={},hasRequired_enum;function require_enum(){if(hasRequired_enum)return _enum;hasRequired_enum=1,Object.defineProperty(_enum,"__esModule",{value:!0}),_enum.Enum=void 0;class W{constructor(J){if(Object.keys(J).length!==1)throw new Error("Enum can only take single value");Object.keys(J).map(X=>{this[X]=J[X]})}}return _enum.Enum=W,_enum}var errors$7={},hasRequiredErrors$8;function requireErrors$8(){if(hasRequiredErrors$8)return errors$7;hasRequiredErrors$8=1,Object.defineProperty(errors$7,"__esModule",{value:!0}),errors$7.ErrorContext=errors$7.TypedError=errors$7.ArgumentTypeError=errors$7.PositionalArgsError=void 0;class W extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}errors$7.PositionalArgsError=W;class Y extends Error{constructor(Se,Ne,je){super(`Expected ${Ne} for '${Se}' argument, but got '${JSON.stringify(je)}'`)}}errors$7.ArgumentTypeError=Y;class J extends Error{constructor(Ne,je,ke){super(Ne);Kc(this,"type");Kc(this,"context");this.type=je||"UntypedError",this.context=ke}}errors$7.TypedError=J;class X{constructor(Se){Kc(this,"transactionHash");this.transactionHash=Se}}return errors$7.ErrorContext=X,errors$7}var provider$6={},light_client={},hasRequiredLight_client;function requireLight_client(){if(hasRequiredLight_client)return light_client;hasRequiredLight_client=1,Object.defineProperty(light_client,"__esModule",{value:!0}),light_client.IdType=void 0;var W;return function(Y){Y.Transaction="transaction",Y.Receipt="receipt"}(W||(light_client.IdType=W={})),light_client}var response={},hasRequiredResponse;function requireResponse(){if(hasRequiredResponse)return response;hasRequiredResponse=1,Object.defineProperty(response,"__esModule",{value:!0}),response.FinalExecutionStatusBasic=response.ExecutionStatusBasic=void 0;var W;(function(J){J.Unknown="Unknown",J.Pending="Pending",J.Failure="Failure"})(W||(response.ExecutionStatusBasic=W={}));var Y;return function(J){J.NotStarted="NotStarted",J.Started="Started",J.Failure="Failure"}(Y||(response.FinalExecutionStatusBasic=Y={})),response}var hasRequiredProvider$6;function requireProvider$6(){return hasRequiredProvider$6||(hasRequiredProvider$6=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.FinalExecutionStatusBasic=W.ExecutionStatusBasic=W.IdType=void 0;var Y=requireLight_client();Object.defineProperty(W,"IdType",{enumerable:!0,get:function(){return Y.IdType}});var J=requireResponse();Object.defineProperty(W,"ExecutionStatusBasic",{enumerable:!0,get:function(){return J.ExecutionStatusBasic}}),Object.defineProperty(W,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return J.FinalExecutionStatusBasic}})}(provider$6)),provider$6}var hasRequiredCommonjs$9;function requireCommonjs$9(){return hasRequiredCommonjs$9||(hasRequiredCommonjs$9=1,function(W){var Y=commonjs$6.__createBinding||(Object.create?function(X,Me,Se,Ne){Ne===void 0&&(Ne=Se);var je=Object.getOwnPropertyDescriptor(Me,Se);(!je||("get"in je?!Me.__esModule:je.writable||je.configurable))&&(je={enumerable:!0,get:function(){return Me[Se]}}),Object.defineProperty(X,Ne,je)}:function(X,Me,Se,Ne){Ne===void 0&&(Ne=Se),X[Ne]=Me[Se]}),J=commonjs$6.__exportStar||function(X,Me){for(var Se in X)Se!=="default"&&!Object.prototype.hasOwnProperty.call(Me,Se)&&Y(Me,X,Se)};Object.defineProperty(W,"__esModule",{value:!0}),J(requireAssignable(),W),J(require_enum(),W),J(requireErrors$8(),W),J(requireProvider$6(),W)}(commonjs$6)),commonjs$6}var format$3={},hasRequiredFormat$3;function requireFormat$3(){return hasRequiredFormat$3||(hasRequiredFormat$3=1,function(W){var Y=format$3.__importDefault||function(He){return He&&He.__esModule?He:{default:He}};Object.defineProperty(W,"__esModule",{value:!0}),W.baseDecode=W.baseEncode=W.parseNearAmount=W.formatNearAmount=W.NEAR_NOMINATION=W.NEAR_NOMINATION_EXP=void 0;const J=Y(requireBs58$2());W.NEAR_NOMINATION_EXP=24,W.NEAR_NOMINATION=10n**BigInt(W.NEAR_NOMINATION_EXP);const X=[],Me=10n;for(let He=0,Ve=5n;He<W.NEAR_NOMINATION_EXP;He++,Ve=Ve*Me)X[He]=Ve;function Se(He,Ve=W.NEAR_NOMINATION_EXP){let Ye=BigInt(He);if(Ve!==W.NEAR_NOMINATION_EXP){const $o=W.NEAR_NOMINATION_EXP-Ve-1;$o>0&&(Ye+=X[$o])}He=Ye.toString();const Fn=He.substring(0,He.length-W.NEAR_NOMINATION_EXP)||"0",io=He.substring(He.length-W.NEAR_NOMINATION_EXP).padStart(W.NEAR_NOMINATION_EXP,"0").substring(0,Ve);return ke(`${qe(Fn)}.${io}`)}W.formatNearAmount=Se;function Ne(He){if(!He)return null;He=je(He);const Ve=He.split("."),Ye=Ve[0],Fn=Ve[1]||"";if(Ve.length>2||Fn.length>W.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${He}' as NEAR amount`);return De(Ye+Fn.padEnd(W.NEAR_NOMINATION_EXP,"0"))}W.parseNearAmount=Ne;function je(He){return He.replace(/,/g,"").trim()}function ke(He){return He.replace(/\.?0*$/,"")}function De(He){return He=He.replace(/^0+/,""),He===""?"0":He}function qe(He){const Ve=/(-?\d+)(\d{3})/;for(;Ve.test(He);)He=He.replace(Ve,"$1,$2");return He}function Ue(He){if(typeof He=="string"){const Ve=[];for(let Ye=0;Ye<He.length;Ye++)Ve.push(He.charCodeAt(Ye));He=new Uint8Array(Ve)}return J.default.encode(He)}W.baseEncode=Ue;function Ge(He){return new Uint8Array(J.default.decode(He))}W.baseDecode=Ge}(format$3)),format$3}const schema$3=JSON.parse('{"AccessKeyNotFound":{"name":"AccessKeyNotFound","subtypes":[],"props":{"account_id":"","public_key":""}},"AccountAlreadyExists":{"name":"AccountAlreadyExists","subtypes":[],"props":{"account_id":""}},"AccountDoesNotExist":{"name":"AccountDoesNotExist","subtypes":[],"props":{"account_id":""}},"ActionError":{"name":"ActionError","subtypes":["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],"props":{"index":""}},"ActionsValidationError":{"name":"ActionsValidationError","subtypes":["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],"props":{}},"ActorNoPermission":{"name":"ActorNoPermission","subtypes":[],"props":{"account_id":"","actor_id":""}},"AddKeyAlreadyExists":{"name":"AddKeyAlreadyExists","subtypes":[],"props":{"account_id":"","public_key":""}},"AddKeyMethodNameLengthExceeded":{"name":"AddKeyMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"AddKeyMethodNamesNumberOfBytesExceeded":{"name":"AddKeyMethodNamesNumberOfBytesExceeded","subtypes":[],"props":{"limit":"","total_number_of_bytes":""}},"AltBn128InvalidInput":{"name":"AltBn128InvalidInput","subtypes":[],"props":{"msg":""}},"BadUTF16":{"name":"BadUTF16","subtypes":[],"props":{}},"BadUTF8":{"name":"BadUTF8","subtypes":[],"props":{}},"BalanceExceeded":{"name":"BalanceExceeded","subtypes":[],"props":{}},"BalanceMismatchError":{"name":"BalanceMismatchError","subtypes":[],"props":{"final_accounts_balance":"","final_postponed_receipts_balance":"","forwarded_buffered_receipts_balance":"","incoming_receipts_balance":"","incoming_validator_rewards":"","initial_accounts_balance":"","initial_postponed_receipts_balance":"","new_buffered_receipts_balance":"","new_delayed_receipts_balance":"","other_burnt_amount":"","outgoing_receipts_balance":"","processed_delayed_receipts_balance":"","slashed_burnt_amount":"","tx_burnt_amount":""}},"CallIndirectOOB":{"name":"CallIndirectOOB","subtypes":[],"props":{}},"CannotAppendActionToJointPromise":{"name":"CannotAppendActionToJointPromise","subtypes":[],"props":{}},"CannotReturnJointPromise":{"name":"CannotReturnJointPromise","subtypes":[],"props":{}},"CodeDoesNotExist":{"name":"CodeDoesNotExist","subtypes":[],"props":{"account_id":""}},"CompilationError":{"name":"CompilationError","subtypes":["CodeDoesNotExist","PrepareError","WasmerCompileError"],"props":{}},"ContractSizeExceeded":{"name":"ContractSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"CostOverflow":{"name":"CostOverflow","subtypes":[],"props":{}},"CreateAccountNotAllowed":{"name":"CreateAccountNotAllowed","subtypes":[],"props":{"account_id":"","predecessor_id":""}},"CreateAccountOnlyByRegistrar":{"name":"CreateAccountOnlyByRegistrar","subtypes":[],"props":{"account_id":"","predecessor_id":"","registrar_account_id":""}},"DelegateActionExpired":{"name":"DelegateActionExpired","subtypes":[],"props":{}},"DelegateActionInvalidNonce":{"name":"DelegateActionInvalidNonce","subtypes":[],"props":{"ak_nonce":"","delegate_nonce":""}},"DelegateActionInvalidSignature":{"name":"DelegateActionInvalidSignature","subtypes":[],"props":{}},"DelegateActionMustBeOnlyOne":{"name":"DelegateActionMustBeOnlyOne","subtypes":[],"props":{}},"DelegateActionNonceTooLarge":{"name":"DelegateActionNonceTooLarge","subtypes":[],"props":{"delegate_nonce":"","upper_bound":""}},"DelegateActionSenderDoesNotMatchTxReceiver":{"name":"DelegateActionSenderDoesNotMatchTxReceiver","subtypes":[],"props":{"receiver_id":"","sender_id":""}},"DeleteAccountStaking":{"name":"DeleteAccountStaking","subtypes":[],"props":{"account_id":""}},"DeleteAccountWithLargeState":{"name":"DeleteAccountWithLargeState","subtypes":[],"props":{"account_id":""}},"DeleteActionMustBeFinal":{"name":"DeleteActionMustBeFinal","subtypes":[],"props":{}},"DeleteKeyDoesNotExist":{"name":"DeleteKeyDoesNotExist","subtypes":[],"props":{"account_id":"","public_key":""}},"DepositWithFunctionCall":{"name":"DepositWithFunctionCall","subtypes":[],"props":{}},"Deprecated":{"name":"Deprecated","subtypes":[],"props":{"method_name":""}},"Deserialization":{"name":"Deserialization","subtypes":[],"props":{}},"ECRecoverError":{"name":"ECRecoverError","subtypes":[],"props":{"msg":""}},"Ed25519VerifyInvalidInput":{"name":"Ed25519VerifyInvalidInput","subtypes":[],"props":{"msg":""}},"EmptyMethodName":{"name":"EmptyMethodName","subtypes":[],"props":{}},"Expired":{"name":"Expired","subtypes":[],"props":{}},"FunctionCallArgumentsLengthExceeded":{"name":"FunctionCallArgumentsLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallMethodNameLengthExceeded":{"name":"FunctionCallMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallZeroAttachedGas":{"name":"FunctionCallZeroAttachedGas","subtypes":[],"props":{}},"GasExceeded":{"name":"GasExceeded","subtypes":[],"props":{}},"GasInstrumentation":{"name":"GasInstrumentation","subtypes":[],"props":{}},"GasLimitExceeded":{"name":"GasLimitExceeded","subtypes":[],"props":{}},"GenericTrap":{"name":"GenericTrap","subtypes":[],"props":{}},"GuestPanic":{"name":"GuestPanic","subtypes":[],"props":{"panic_msg":""}},"HostError":{"name":"HostError","subtypes":["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],"props":{}},"IllegalArithmetic":{"name":"IllegalArithmetic","subtypes":[],"props":{}},"IncorrectCallIndirectSignature":{"name":"IncorrectCallIndirectSignature","subtypes":[],"props":{}},"IndirectCallToNull":{"name":"IndirectCallToNull","subtypes":[],"props":{}},"Instantiate":{"name":"Instantiate","subtypes":[],"props":{}},"InsufficientStake":{"name":"InsufficientStake","subtypes":[],"props":{"account_id":"","minimum_stake":"","stake":""}},"IntegerOverflow":{"name":"IntegerOverflow","subtypes":[],"props":{}},"InternalMemoryDeclared":{"name":"InternalMemoryDeclared","subtypes":[],"props":{}},"InvalidAccessKeyError":{"name":"InvalidAccessKeyError","subtypes":["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],"props":{}},"InvalidAccountId":{"name":"InvalidAccountId","subtypes":[],"props":{}},"InvalidChain":{"name":"InvalidChain","subtypes":[],"props":{}},"InvalidDataReceiverId":{"name":"InvalidDataReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidIteratorIndex":{"name":"InvalidIteratorIndex","subtypes":[],"props":{"iterator_index":""}},"InvalidMethodName":{"name":"InvalidMethodName","subtypes":[],"props":{}},"InvalidNonce":{"name":"InvalidNonce","subtypes":[],"props":{"ak_nonce":"","tx_nonce":""}},"InvalidPredecessorId":{"name":"InvalidPredecessorId","subtypes":[],"props":{"account_id":""}},"InvalidPromiseIndex":{"name":"InvalidPromiseIndex","subtypes":[],"props":{"promise_idx":""}},"InvalidPromiseResultIndex":{"name":"InvalidPromiseResultIndex","subtypes":[],"props":{"result_idx":""}},"InvalidPublicKey":{"name":"InvalidPublicKey","subtypes":[],"props":{}},"InvalidReceiptIndex":{"name":"InvalidReceiptIndex","subtypes":[],"props":{"receipt_index":""}},"InvalidReceiverId":{"name":"InvalidReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidRegisterId":{"name":"InvalidRegisterId","subtypes":[],"props":{"register_id":""}},"InvalidSignature":{"name":"InvalidSignature","subtypes":[],"props":{}},"InvalidSignerId":{"name":"InvalidSignerId","subtypes":[],"props":{"account_id":""}},"InvalidTxError":{"name":"InvalidTxError","subtypes":["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],"props":{}},"IteratorWasInvalidated":{"name":"IteratorWasInvalidated","subtypes":[],"props":{"iterator_index":""}},"KeyLengthExceeded":{"name":"KeyLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"LackBalanceForState":{"name":"LackBalanceForState","subtypes":[],"props":{"account_id":"","amount":""}},"Memory":{"name":"Memory","subtypes":[],"props":{}},"MemoryAccessViolation":{"name":"MemoryAccessViolation","subtypes":[],"props":{}},"MemoryOutOfBounds":{"name":"MemoryOutOfBounds","subtypes":[],"props":{}},"MethodEmptyName":{"name":"MethodEmptyName","subtypes":[],"props":{}},"MethodInvalidSignature":{"name":"MethodInvalidSignature","subtypes":[],"props":{}},"MethodNameMismatch":{"name":"MethodNameMismatch","subtypes":[],"props":{"method_name":""}},"MethodNotFound":{"name":"MethodNotFound","subtypes":[],"props":{}},"MethodResolveError":{"name":"MethodResolveError","subtypes":["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],"props":{}},"MisalignedAtomicAccess":{"name":"MisalignedAtomicAccess","subtypes":[],"props":{}},"NonceTooLarge":{"name":"NonceTooLarge","subtypes":[],"props":{"tx_nonce":"","upper_bound":""}},"NotEnoughAllowance":{"name":"NotEnoughAllowance","subtypes":[],"props":{"account_id":"","allowance":"","cost":"","public_key":""}},"NotEnoughBalance":{"name":"NotEnoughBalance","subtypes":[],"props":{"balance":"","cost":"","signer_id":""}},"NumberInputDataDependenciesExceeded":{"name":"NumberInputDataDependenciesExceeded","subtypes":[],"props":{"limit":"","number_of_input_data_dependencies":""}},"NumberOfLogsExceeded":{"name":"NumberOfLogsExceeded","subtypes":[],"props":{"limit":""}},"NumberPromisesExceeded":{"name":"NumberPromisesExceeded","subtypes":[],"props":{"limit":"","number_of_promises":""}},"OnlyImplicitAccountCreationAllowed":{"name":"OnlyImplicitAccountCreationAllowed","subtypes":[],"props":{"account_id":""}},"PrepareError":{"name":"PrepareError","subtypes":["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],"props":{}},"ProhibitedInView":{"name":"ProhibitedInView","subtypes":[],"props":{"method_name":""}},"ReceiptSizeExceeded":{"name":"ReceiptSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"ReceiptValidationError":{"name":"ReceiptValidationError","subtypes":["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],"props":{}},"ReceiverMismatch":{"name":"ReceiverMismatch","subtypes":[],"props":{"ak_receiver":"","tx_receiver":""}},"RequiresFullAccess":{"name":"RequiresFullAccess","subtypes":[],"props":{}},"ReturnedValueLengthExceeded":{"name":"ReturnedValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"Serialization":{"name":"Serialization","subtypes":[],"props":{}},"ShardCongested":{"name":"ShardCongested","subtypes":[],"props":{"congestion_level":"","shard_id":""}},"ShardStuck":{"name":"ShardStuck","subtypes":[],"props":{"missed_chunks":"","shard_id":""}},"SignerDoesNotExist":{"name":"SignerDoesNotExist","subtypes":[],"props":{"signer_id":""}},"StackHeightInstrumentation":{"name":"StackHeightInstrumentation","subtypes":[],"props":{}},"StackOverflow":{"name":"StackOverflow","subtypes":[],"props":{}},"TooManyFunctions":{"name":"TooManyFunctions","subtypes":[],"props":{}},"TooManyLocals":{"name":"TooManyLocals","subtypes":[],"props":{}},"TotalLogLengthExceeded":{"name":"TotalLogLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"TotalNumberOfActionsExceeded":{"name":"TotalNumberOfActionsExceeded","subtypes":[],"props":{"limit":"","total_number_of_actions":""}},"TotalPrepaidGasExceeded":{"name":"TotalPrepaidGasExceeded","subtypes":[],"props":{"limit":"","total_prepaid_gas":""}},"TransactionSizeExceeded":{"name":"TransactionSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"TriesToStake":{"name":"TriesToStake","subtypes":[],"props":{"account_id":"","balance":"","locked":"","stake":""}},"TriesToUnstake":{"name":"TriesToUnstake","subtypes":[],"props":{"account_id":""}},"TxExecutionError":{"name":"TxExecutionError","subtypes":["ActionError","InvalidTxError"],"props":{}},"Unreachable":{"name":"Unreachable","subtypes":[],"props":{}},"UnsuitableStakingKey":{"name":"UnsuitableStakingKey","subtypes":[],"props":{"public_key":""}},"UnsupportedProtocolFeature":{"name":"UnsupportedProtocolFeature","subtypes":[],"props":{"protocol_feature":"","version":""}},"ValueLengthExceeded":{"name":"ValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"WasmTrap":{"name":"WasmTrap","subtypes":["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],"props":{}},"WasmerCompileError":{"name":"WasmerCompileError","subtypes":[],"props":{"msg":""}},"Closed":{"name":"Closed","subtypes":[],"props":{}},"ServerError":{"name":"ServerError","subtypes":["TxExecutionError","Timeout","Closed"],"props":{}},"Timeout":{"name":"Timeout","subtypes":[],"props":{}}}'),require$$4$2={schema:schema$3};var hasRequiredRpc_errors$3;function requireRpc_errors$3(){if(hasRequiredRpc_errors$3)return rpc_errors$3;hasRequiredRpc_errors$3=1;var W=rpc_errors$3.__importDefault||function(Fn){return Fn&&Fn.__esModule?Fn:{default:Fn}};Object.defineProperty(rpc_errors$3,"__esModule",{value:!0}),rpc_errors$3.getErrorTypeFromErrorMessage=rpc_errors$3.formatError=rpc_errors$3.parseResultError=rpc_errors$3.parseRpcError=rpc_errors$3.ServerError=void 0;const Y=requireCommonjs$9(),J=W(requireMustache()),X=requireFormat$3(),Me=requireErrors$9(),Se=W(require$$4$2),Ne={formatNear:()=>(Fn,io)=>(0,X.formatNearAmount)(io(Fn))};class je extends Y.TypedError{}rpc_errors$3.ServerError=je;class ke extends je{constructor(){super(...arguments);Kc(this,"transaction_outcome")}}function De(Fn){const io={},$o=Ge(Fn,Se.default.schema,io,""),Jo=new je(Ue($o,io),$o);return Object.assign(Jo,io),Jo}rpc_errors$3.parseRpcError=De;function qe(Fn){const io=De(Fn.status.Failure),$o=new ke;return Object.assign($o,io),$o.type=io.type,$o.message=io.message,$o.transaction_outcome=Fn.transaction_outcome,$o}rpc_errors$3.parseResultError=qe;function Ue(Fn,io){return typeof Me.ErrorMessages[Fn]=="string"?J.default.render(Me.ErrorMessages[Fn],{...io,...Ne}):JSON.stringify(io)}rpc_errors$3.formatError=Ue;function Ge(Fn,io,$o,Jo){let rs,Yo,zo;for(const jo in io){if(Ye(Fn[jo]))return Fn[jo];if(Ve(Fn[jo]))rs=Fn[jo],Yo=io[jo],zo=jo;else if(Ve(Fn.kind)&&Ve(Fn.kind[jo]))rs=Fn.kind[jo],Yo=io[jo],zo=jo;else continue}if(rs&&Yo){for(const jo of Object.keys(Yo.props))$o[jo]=rs[jo];return Ge(rs,io,$o,zo)}else return $o.kind=Fn,Jo}function He(Fn,io){switch(!0){case/^account .*? does not exist while viewing$/.test(Fn):return"AccountDoesNotExist";case/^Account .*? doesn't exist$/.test(Fn):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(Fn):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(Fn):return"CodeDoesNotExist";case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(Fn):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(Fn):return"MethodNotFound";case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(Fn):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(Fn):return"InvalidNonce";default:return io}}rpc_errors$3.getErrorTypeFromErrorMessage=He;function Ve(Fn){return Object.prototype.toString.call(Fn)==="[object Object]"}function Ye(Fn){return Object.prototype.toString.call(Fn)==="[object String]"}return rpc_errors$3}var hasRequiredErrors$7;function requireErrors$7(){return hasRequiredErrors$7||(hasRequiredErrors$7=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.parseRpcError=W.parseResultError=W.getErrorTypeFromErrorMessage=W.formatError=W.ServerError=W.ErrorMessages=void 0;var Y=requireErrors$9();Object.defineProperty(W,"ErrorMessages",{enumerable:!0,get:function(){return Y.ErrorMessages}});var J=requireRpc_errors$3();Object.defineProperty(W,"ServerError",{enumerable:!0,get:function(){return J.ServerError}}),Object.defineProperty(W,"formatError",{enumerable:!0,get:function(){return J.formatError}}),Object.defineProperty(W,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return J.getErrorTypeFromErrorMessage}}),Object.defineProperty(W,"parseResultError",{enumerable:!0,get:function(){return J.parseResultError}}),Object.defineProperty(W,"parseRpcError",{enumerable:!0,get:function(){return J.parseRpcError}})}(errors$9)),errors$9}var logging$1={},logger$6={},console_logger$1={},hasRequiredConsole_logger$1;function requireConsole_logger$1(){if(hasRequiredConsole_logger$1)return console_logger$1;hasRequiredConsole_logger$1=1,Object.defineProperty(console_logger$1,"__esModule",{value:!0}),console_logger$1.ConsoleLogger=void 0;class W{constructor(J){Kc(this,"logLevels");Kc(this,"isLevelEnabled",J=>this.logLevels.includes(J));this.logLevels=J}print(J,X,...Me){switch(J){case"error":case"fatal":return console.error(X,...Me);case"warn":return console.warn(X,...Me);case"log":return console.log(X,...Me);case"debug":case"verbose":return console.debug(X,...Me)}}verbose(J,...X){this.isLevelEnabled("verbose")&&this.print("verbose",J,...X)}debug(J,...X){this.isLevelEnabled("debug")&&this.print("debug",J,...X)}log(J,...X){this.isLevelEnabled("log")&&this.print("log",J,...X)}warn(J,...X){this.isLevelEnabled("warn")&&this.print("warn",J,...X)}error(J,...X){this.isLevelEnabled("error")&&this.print("error",J,...X)}fatal(J,...X){this.isLevelEnabled("fatal")&&this.print("fatal",J,...X)}}return console_logger$1.ConsoleLogger=W,console_logger$1}var logger$5={},hasRequiredLogger$5;function requireLogger$5(){if(hasRequiredLogger$5)return logger$5;hasRequiredLogger$5=1,Object.defineProperty(logger$5,"__esModule",{value:!0}),logger$5.Logger=void 0;const W=requireConsole_logger$1(),Y=["verbose","debug","log","warn","error","fatal"],J=new W.ConsoleLogger(Y),Me=class Me{static error(Ne,...je){var ke;(ke=this.instanceRef)==null||ke.error(Ne,...je)}static log(Ne,...je){var ke;(ke=this.instanceRef)==null||ke.log(Ne,...je)}static warn(Ne,...je){var ke;(ke=this.instanceRef)==null||ke.warn(Ne,...je)}static debug(Ne,...je){var ke,De;(De=(ke=this.instanceRef)==null?void 0:ke.debug)==null||De.call(ke,Ne,...je)}static verbose(Ne,...je){var ke,De;(De=(ke=this.instanceRef)==null?void 0:ke.verbose)==null||De.call(ke,Ne,...je)}static fatal(Ne,...je){var ke,De;(De=(ke=this.instanceRef)==null?void 0:ke.fatal)==null||De.call(ke,Ne,...je)}};Kc(Me,"instanceRef",J),Kc(Me,"overrideLogger",Ne=>{Me.instanceRef=Ne});let X=Me;return logger$5.Logger=X,logger$5}var hasRequiredLogger$4;function requireLogger$4(){return hasRequiredLogger$4||(hasRequiredLogger$4=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Logger=W.ConsoleLogger=void 0;var Y=requireConsole_logger$1();Object.defineProperty(W,"ConsoleLogger",{enumerable:!0,get:function(){return Y.ConsoleLogger}});var J=requireLogger$5();Object.defineProperty(W,"Logger",{enumerable:!0,get:function(){return J.Logger}})}(logger$6)),logger$6}var hasRequiredLogging$1;function requireLogging$1(){if(hasRequiredLogging$1)return logging$1;hasRequiredLogging$1=1,Object.defineProperty(logging$1,"__esModule",{value:!0}),logging$1.printTxOutcomeLogs=logging$1.printTxOutcomeLogsAndFailures=void 0;const W=requireErrors$7(),Y=requireLogger$4();function J({contractId:Me,outcome:Se}){const Ne=[Se.transaction_outcome,...Se.receipts_outcome].reduce((je,ke)=>{const De=typeof ke.outcome.status=="object"&&typeof ke.outcome.status.Failure=="object";return ke.outcome.logs.length||De?je.concat({receiptIds:ke.outcome.receipt_ids,logs:ke.outcome.logs,failure:typeof ke.outcome.status=="object"&&ke.outcome.status.Failure!==void 0?(0,W.parseRpcError)(ke.outcome.status.Failure):null}):je},[]);for(const je of Ne)Y.Logger.log(`Receipt${je.receiptIds.length>1?"s":""}: ${je.receiptIds.join(", ")}`),X({contractId:Me,logs:je.logs,prefix:" "}),je.failure&&Y.Logger.warn(` Failure [${Me}]: ${je.failure}`)}logging$1.printTxOutcomeLogsAndFailures=J;function X({contractId:Me,logs:Se,prefix:Ne=""}){for(const je of Se)Y.Logger.log(`${Ne}Log [${Me}]: ${je}`)}return logging$1.printTxOutcomeLogs=X,logging$1}var provider$5={},hasRequiredProvider$5;function requireProvider$5(){if(hasRequiredProvider$5)return provider$5;hasRequiredProvider$5=1,Object.defineProperty(provider$5,"__esModule",{value:!0}),provider$5.getTransactionLastResult=void 0;function W(Y){if(typeof Y.status=="object"&&typeof Y.status.SuccessValue=="string"){const J=Buffer.from(Y.status.SuccessValue,"base64").toString();try{return JSON.parse(J)}catch{return J}}return null}return provider$5.getTransactionLastResult=W,provider$5}var validators$3={},utils$c={},hasRequiredUtils$b;function requireUtils$b(){if(hasRequiredUtils$b)return utils$c;hasRequiredUtils$b=1,Object.defineProperty(utils$c,"__esModule",{value:!0}),utils$c.sortBigIntAsc=void 0;function W(Y,J){return Y<J?-1:Y>J?1:0}return utils$c.sortBigIntAsc=W,utils$c}var hasRequiredValidators$3;function requireValidators$3(){if(hasRequiredValidators$3)return validators$3;hasRequiredValidators$3=1;var W=validators$3.__importDefault||function(je){return je&&je.__esModule?je:{default:je}};Object.defineProperty(validators$3,"__esModule",{value:!0}),validators$3.diffEpochValidators=validators$3.findSeatPrice=void 0;const Y=W(requireBrowser$8()),J=requireUtils$b();function X(je,ke,De,qe){return qe&&qe<49?Me(je,ke):(De||((0,Y.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),De=[1,6250]),Se(je,ke,De))}validators$3.findSeatPrice=X;function Me(je,ke){const De=je.map(Ve=>BigInt(Ve.stake)).sort(J.sortBigIntAsc),qe=BigInt(ke),Ue=De.reduce((Ve,Ye)=>Ve+Ye);if(Ue<qe)throw new Error("Stakes are below seats");let Ge=1n,He=Ue+1n;for(;Ge!==He-1n;){const Ve=(Ge+He)/2n;let Ye=!1,Fn=0n;for(let io=0;io<De.length;++io)if(Fn=Fn+De[io]/Ve,Fn>=qe){Ge=Ve,Ye=!0;break}Ye||(He=Ve)}return Ge}function Se(je,ke,De){if(De.length!=2)throw Error("minimumStakeRatio should have 2 elements");const qe=je.map(Ge=>BigInt(Ge.stake)).sort(J.sortBigIntAsc),Ue=qe.reduce((Ge,He)=>Ge+He);return je.length<ke?Ue*BigInt(De[0])/BigInt(De[1]):qe[0]+1n}function Ne(je,ke){const De=new Map;je.forEach(Ue=>De.set(Ue.account_id,Ue));const qe=new Set(ke.map(Ue=>Ue.account_id));return{newValidators:ke.filter(Ue=>!De.has(Ue.account_id)),removedValidators:je.filter(Ue=>!qe.has(Ue.account_id)),changedValidators:ke.filter(Ue=>De.has(Ue.account_id)&&De.get(Ue.account_id).stake!=Ue.stake).map(Ue=>({current:De.get(Ue.account_id),next:Ue}))}}return validators$3.diffEpochValidators=Ne,validators$3}var hasRequiredCommonjs$8;function requireCommonjs$8(){return hasRequiredCommonjs$8||(hasRequiredCommonjs$8=1,function(W){var Y=commonjs$7.__createBinding||(Object.create?function(X,Me,Se,Ne){Ne===void 0&&(Ne=Se);var je=Object.getOwnPropertyDescriptor(Me,Se);(!je||("get"in je?!Me.__esModule:je.writable||je.configurable))&&(je={enumerable:!0,get:function(){return Me[Se]}}),Object.defineProperty(X,Ne,je)}:function(X,Me,Se,Ne){Ne===void 0&&(Ne=Se),X[Ne]=Me[Se]}),J=commonjs$7.__exportStar||function(X,Me){for(var Se in X)Se!=="default"&&!Object.prototype.hasOwnProperty.call(Me,Se)&&Y(Me,X,Se)};Object.defineProperty(W,"__esModule",{value:!0}),J(requireConstants$6(),W),J(requireErrors$7(),W),J(requireFormat$3(),W),J(requireLogging$1(),W),J(requireProvider$5(),W),J(requireValidators$3(),W),J(requireLogger$4(),W),J(requireUtils$b(),W)}(commonjs$7)),commonjs$7}var public_key$1={},hasRequiredPublic_key$1;function requirePublic_key$1(){if(hasRequiredPublic_key$1)return public_key$1;hasRequiredPublic_key$1=1;var W=public_key$1.__importDefault||function(qe){return qe&&qe.__esModule?qe:{default:qe}};Object.defineProperty(public_key$1,"__esModule",{value:!0}),public_key$1.PublicKey=void 0;const Y=requireCommonjs$8(),J=requireEd25519$1(),X=W(requireElliptic()),Me=requireConstants$7();function Se(qe){switch(qe){case Me.KeyType.ED25519:return"ed25519";case Me.KeyType.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${qe}`)}}function Ne(qe){switch(qe.toLowerCase()){case"ed25519":return Me.KeyType.ED25519;case"secp256k1":return Me.KeyType.SECP256K1;default:throw new Error(`Unknown key type ${qe}`)}}function je(qe){switch(qe){case Me.KeyType.ED25519:return"ed25519Key";case Me.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${qe}`)}}class ke{constructor(Ue){if(Object.keys(Ue).length!==1)throw new Error("Enum can only take single value");Object.keys(Ue).map(Ge=>{this[Ge]=Ue[Ge]})}}class De extends ke{constructor(Ge){const He=je(Ge.keyType);super({[He]:Ge});Kc(this,"enum");Kc(this,"ed25519Key");Kc(this,"secp256k1Key");this[He]=Ge,this.enum=He}static from(Ge){return typeof Ge=="string"?De.fromString(Ge):Ge}static fromString(Ge){const He=Ge.split(":");let Ve,Ye;if(He.length===1)Ve=He[0];else if(He.length===2)Ve=He[1],Ye=Ne(He[0]);else throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");const Fn=(0,Y.baseDecode)(Ve);Ye||(Ye=Fn.length===Me.KeySize.SECP256k1_PUBLIC_KEY?Me.KeyType.SECP256K1:Me.KeyType.ED25519);const io=Ye===Me.KeyType.ED25519?Me.KeySize.ED25519_PUBLIC_KEY:Me.KeySize.SECP256k1_PUBLIC_KEY;if(Fn.length!==io)throw new Error(`Invalid public key size (${Fn.length}), must be ${io}`);return new De({keyType:Ye,data:Fn})}toString(){const Ge=(0,Y.baseEncode)(this.data);return`${Se(this.keyType)}:${Ge}`}verify(Ge,He){const Ve=this.keyType,Ye=this.data;switch(Ve){case Me.KeyType.ED25519:return J.ed25519.verify(He,Ge,Ye);case Me.KeyType.SECP256K1:return X.default.ecdsaVerify(He.subarray(0,64),Ge,new Uint8Array([4,...Ye]));default:throw new Error(`Unknown key type: ${Ve}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}return public_key$1.PublicKey=De,public_key$1}var hasRequiredKey_pair_ed25519$1;function requireKey_pair_ed25519$1(){if(hasRequiredKey_pair_ed25519$1)return key_pair_ed25519$1;hasRequiredKey_pair_ed25519$1=1;var W=key_pair_ed25519$1.__importDefault||function(ke){return ke&&ke.__esModule?ke:{default:ke}};Object.defineProperty(key_pair_ed25519$1,"__esModule",{value:!0}),key_pair_ed25519$1.KeyPairEd25519=void 0;const Y=requireCommonjs$8(),J=requireEd25519$1(),X=W(requireBrowser$7()),Me=requireConstants$7(),Se=requireKey_pair_base$1(),Ne=requirePublic_key$1();class je extends Se.KeyPairBase{constructor(qe){super();Kc(this,"publicKey");Kc(this,"secretKey");Kc(this,"extendedSecretKey");const Ue=(0,Y.baseDecode)(qe),Ge=new Uint8Array(Ue.slice(0,Me.KeySize.SECRET_KEY)),He=J.ed25519.getPublicKey(new Uint8Array(Ge));this.publicKey=new Ne.PublicKey({keyType:Me.KeyType.ED25519,data:He}),this.secretKey=(0,Y.baseEncode)(Ge),this.extendedSecretKey=qe}static fromRandom(){const qe=(0,X.default)(Me.KeySize.SECRET_KEY),Ue=J.ed25519.getPublicKey(new Uint8Array(qe)),Ge=new Uint8Array([...qe,...Ue]);return new je((0,Y.baseEncode)(Ge))}sign(qe){return{signature:J.ed25519.sign(qe,(0,Y.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(qe,Ue){return this.publicKey.verify(qe,Ue)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return key_pair_ed25519$1.KeyPairEd25519=je,key_pair_ed25519$1}var key_pair_secp256k1={},hasRequiredKey_pair_secp256k1;function requireKey_pair_secp256k1(){if(hasRequiredKey_pair_secp256k1)return key_pair_secp256k1;hasRequiredKey_pair_secp256k1=1;var W=key_pair_secp256k1.__importDefault||function(ke){return ke&&ke.__esModule?ke:{default:ke}};Object.defineProperty(key_pair_secp256k1,"__esModule",{value:!0}),key_pair_secp256k1.KeyPairSecp256k1=void 0;const Y=requireCommonjs$8(),J=W(requireBrowser$7()),X=W(requireElliptic()),Me=requireConstants$7(),Se=requireKey_pair_base$1(),Ne=requirePublic_key$1();class je extends Se.KeyPairBase{constructor(qe){super();Kc(this,"publicKey");Kc(this,"secretKey");Kc(this,"extendedSecretKey");const Ue=(0,Y.baseDecode)(qe),Ge=new Uint8Array(Ue.slice(0,Me.KeySize.SECRET_KEY)),He=X.default.publicKeyCreate(new Uint8Array(Ge),!1),Ve=He.subarray(1,He.length);this.publicKey=new Ne.PublicKey({keyType:Me.KeyType.SECP256K1,data:Ve}),this.secretKey=(0,Y.baseEncode)(Ge),this.extendedSecretKey=qe}static fromRandom(){const qe=(0,J.default)(Me.KeySize.SECRET_KEY),Ue=X.default.publicKeyCreate(new Uint8Array(qe),!1),Ge=Ue.subarray(1,Ue.length),He=new Uint8Array([...qe,...Ge]);return new je((0,Y.baseEncode)(He))}sign(qe){const{signature:Ue,recid:Ge}=X.default.ecdsaSign(qe,(0,Y.baseDecode)(this.secretKey));return{signature:new Uint8Array([...Ue,Ge]),publicKey:this.publicKey}}verify(qe,Ue){return this.publicKey.verify(qe,Ue)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return key_pair_secp256k1.KeyPairSecp256k1=je,key_pair_secp256k1}var hasRequiredKey_pair$3;function requireKey_pair$3(){if(hasRequiredKey_pair$3)return key_pair$3;hasRequiredKey_pair$3=1,Object.defineProperty(key_pair$3,"__esModule",{value:!0}),key_pair$3.KeyPair=void 0;const W=requireKey_pair_base$1(),Y=requireKey_pair_ed25519$1(),J=requireKey_pair_secp256k1();class X extends W.KeyPairBase{static fromRandom(Se){switch(Se.toUpperCase()){case"ED25519":return Y.KeyPairEd25519.fromRandom();case"SECP256K1":return J.KeyPairSecp256k1.fromRandom();default:throw new Error(`Unknown curve ${Se}`)}}static fromString(Se){const Ne=Se.split(":");if(Ne.length===2)switch(Ne[0].toUpperCase()){case"ED25519":return new Y.KeyPairEd25519(Ne[1]);case"SECP256K1":return new J.KeyPairSecp256k1(Ne[1]);default:throw new Error(`Unknown curve: ${Ne[0]}`)}else throw new Error("Invalid encoded key format, must be <curve>:<encoded key>")}}return key_pair$3.KeyPair=X,key_pair$3}var hasRequiredCommonjs$7;function requireCommonjs$7(){return hasRequiredCommonjs$7||(hasRequiredCommonjs$7=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.PublicKey=W.KeyPairSecp256k1=W.KeyPairEd25519=W.KeyPair=W.KeyType=void 0;var Y=requireConstants$7();Object.defineProperty(W,"KeyType",{enumerable:!0,get:function(){return Y.KeyType}});var J=requireKey_pair$3();Object.defineProperty(W,"KeyPair",{enumerable:!0,get:function(){return J.KeyPair}});var X=requireKey_pair_ed25519$1();Object.defineProperty(W,"KeyPairEd25519",{enumerable:!0,get:function(){return X.KeyPairEd25519}});var Me=requireKey_pair_secp256k1();Object.defineProperty(W,"KeyPairSecp256k1",{enumerable:!0,get:function(){return Me.KeyPairSecp256k1}});var Se=requirePublic_key$1();Object.defineProperty(W,"PublicKey",{enumerable:!0,get:function(){return Se.PublicKey}})}(commonjs$8)),commonjs$8}var keystore$2={},hasRequiredKeystore$3;function requireKeystore$3(){if(hasRequiredKeystore$3)return keystore$2;hasRequiredKeystore$3=1,Object.defineProperty(keystore$2,"__esModule",{value:!0}),keystore$2.KeyStore=void 0;class W{}return keystore$2.KeyStore=W,keystore$2}var hasRequiredIn_memory_key_store$3;function requireIn_memory_key_store$3(){if(hasRequiredIn_memory_key_store$3)return in_memory_key_store$3;hasRequiredIn_memory_key_store$3=1,Object.defineProperty(in_memory_key_store$3,"__esModule",{value:!0}),in_memory_key_store$3.InMemoryKeyStore=void 0;const W=requireCommonjs$7(),Y=requireKeystore$3();class J extends Y.KeyStore{constructor(){super();Kc(this,"keys");this.keys={}}async setKey(Se,Ne,je){this.keys[`${Ne}:${Se}`]=je.toString()}async getKey(Se,Ne){const je=this.keys[`${Ne}:${Se}`];return je?W.KeyPair.fromString(je):null}async removeKey(Se,Ne){delete this.keys[`${Ne}:${Se}`]}async clear(){this.keys={}}async getNetworks(){const Se=new Set;return Object.keys(this.keys).forEach(Ne=>{const je=Ne.split(":");Se.add(je[1])}),Array.from(Se.values())}async getAccounts(Se){const Ne=new Array;return Object.keys(this.keys).forEach(je=>{const ke=je.split(":");ke[ke.length-1]===Se&&Ne.push(ke.slice(0,ke.length-1).join(":"))}),Ne}toString(){return"InMemoryKeyStore"}}return in_memory_key_store$3.InMemoryKeyStore=J,in_memory_key_store$3}var merge_key_store$3={},hasRequiredMerge_key_store$3;function requireMerge_key_store$3(){if(hasRequiredMerge_key_store$3)return merge_key_store$3;hasRequiredMerge_key_store$3=1,Object.defineProperty(merge_key_store$3,"__esModule",{value:!0}),merge_key_store$3.MergeKeyStore=void 0;const W=requireKeystore$3();class Y extends W.KeyStore{constructor(Me,Se={writeKeyStoreIndex:0}){super();Kc(this,"options");Kc(this,"keyStores");this.options=Se,this.keyStores=Me}async setKey(Me,Se,Ne){await this.keyStores[this.options.writeKeyStoreIndex].setKey(Me,Se,Ne)}async getKey(Me,Se){for(const Ne of this.keyStores){const je=await Ne.getKey(Me,Se);if(je)return je}return null}async removeKey(Me,Se){for(const Ne of this.keyStores)await Ne.removeKey(Me,Se)}async clear(){for(const Me of this.keyStores)await Me.clear()}async getNetworks(){const Me=new Set;for(const Se of this.keyStores)for(const Ne of await Se.getNetworks())Me.add(Ne);return Array.from(Me)}async getAccounts(Me){const Se=new Set;for(const Ne of this.keyStores)for(const je of await Ne.getAccounts(Me))Se.add(je);return Array.from(Se)}toString(){return`MergeKeyStore(${this.keyStores.join(", ")})`}}return merge_key_store$3.MergeKeyStore=Y,merge_key_store$3}var multi_contract_keystore={},hasRequiredMulti_contract_keystore;function requireMulti_contract_keystore(){if(hasRequiredMulti_contract_keystore)return multi_contract_keystore;hasRequiredMulti_contract_keystore=1,Object.defineProperty(multi_contract_keystore,"__esModule",{value:!0}),multi_contract_keystore.MultiContractKeyStore=void 0;class W{}return multi_contract_keystore.MultiContractKeyStore=W,multi_contract_keystore}var hasRequiredCommonjs$6;function requireCommonjs$6(){return hasRequiredCommonjs$6||(hasRequiredCommonjs$6=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.MultiContractKeyStore=W.MergeKeyStore=W.KeyStore=W.InMemoryKeyStore=void 0;var Y=requireIn_memory_key_store$3();Object.defineProperty(W,"InMemoryKeyStore",{enumerable:!0,get:function(){return Y.InMemoryKeyStore}});var J=requireKeystore$3();Object.defineProperty(W,"KeyStore",{enumerable:!0,get:function(){return J.KeyStore}});var X=requireMerge_key_store$3();Object.defineProperty(W,"MergeKeyStore",{enumerable:!0,get:function(){return X.MergeKeyStore}});var Me=requireMulti_contract_keystore();Object.defineProperty(W,"MultiContractKeyStore",{enumerable:!0,get:function(){return Me.MultiContractKeyStore}})}(commonjs$9)),commonjs$9}var hasRequiredKeystore$2;function requireKeystore$2(){return hasRequiredKeystore$2||(hasRequiredKeystore$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.KeyStore=void 0;var Y=requireCommonjs$6();Object.defineProperty(W,"KeyStore",{enumerable:!0,get:function(){return Y.KeyStore}})}(keystore$3)),keystore$3}var in_memory_key_store$2={},hasRequiredIn_memory_key_store$2;function requireIn_memory_key_store$2(){return hasRequiredIn_memory_key_store$2||(hasRequiredIn_memory_key_store$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.InMemoryKeyStore=void 0;var Y=requireCommonjs$6();Object.defineProperty(W,"InMemoryKeyStore",{enumerable:!0,get:function(){return Y.InMemoryKeyStore}})}(in_memory_key_store$2)),in_memory_key_store$2}var browser_local_storage_key_store$3={},commonjs$5={},browser_local_storage_key_store$2={},hasRequiredBrowser_local_storage_key_store$3;function requireBrowser_local_storage_key_store$3(){if(hasRequiredBrowser_local_storage_key_store$3)return browser_local_storage_key_store$2;hasRequiredBrowser_local_storage_key_store$3=1,Object.defineProperty(browser_local_storage_key_store$2,"__esModule",{value:!0}),browser_local_storage_key_store$2.BrowserLocalStorageKeyStore=void 0;const W=requireCommonjs$7(),Y=requireCommonjs$6(),J="near-api-js:keystore:";class X extends Y.KeyStore{constructor(Ne=window.localStorage,je=J){super();Kc(this,"localStorage");Kc(this,"prefix");this.localStorage=Ne,this.prefix=je}async setKey(Ne,je,ke){this.localStorage.setItem(this.storageKeyForSecretKey(Ne,je),ke.toString())}async getKey(Ne,je){const ke=this.localStorage.getItem(this.storageKeyForSecretKey(Ne,je));return ke?W.KeyPair.fromString(ke):null}async removeKey(Ne,je){this.localStorage.removeItem(this.storageKeyForSecretKey(Ne,je))}async clear(){for(const Ne of this.storageKeys())Ne.startsWith(this.prefix)&&this.localStorage.removeItem(Ne)}async getNetworks(){const Ne=new Set;for(const je of this.storageKeys())if(je.startsWith(this.prefix)){const ke=je.substring(this.prefix.length).split(":");Ne.add(ke[1])}return Array.from(Ne.values())}async getAccounts(Ne){const je=new Array;for(const ke of this.storageKeys())if(ke.startsWith(this.prefix)){const De=ke.substring(this.prefix.length).split(":");De[1]===Ne&&je.push(De[0])}return je}storageKeyForSecretKey(Ne,je){return`${this.prefix}${je}:${Ne}`}*storageKeys(){for(let Ne=0;Ne<this.localStorage.length;Ne++)yield this.localStorage.key(Ne)}}return browser_local_storage_key_store$2.BrowserLocalStorageKeyStore=X,browser_local_storage_key_store$2}var multi_contract_browser_local_storage_key_store={},hasRequiredMulti_contract_browser_local_storage_key_store;function requireMulti_contract_browser_local_storage_key_store(){if(hasRequiredMulti_contract_browser_local_storage_key_store)return multi_contract_browser_local_storage_key_store;hasRequiredMulti_contract_browser_local_storage_key_store=1,Object.defineProperty(multi_contract_browser_local_storage_key_store,"__esModule",{value:!0}),multi_contract_browser_local_storage_key_store.MultiContractBrowserLocalStorageKeyStore=void 0;const W=requireCommonjs$7(),Y=requireCommonjs$6(),J="near-api-js:keystore:";class X extends Y.MultiContractKeyStore{constructor(Ne=window.localStorage,je=J){super();Kc(this,"localStorage");Kc(this,"prefix");this.localStorage=Ne,this.prefix=je||J}async setKey(Ne,je,ke,De){this.localStorage.setItem(this.storageKeyForSecretKey(Ne,je,De),ke.toString())}async getKey(Ne,je,ke){const De=this.localStorage.getItem(this.storageKeyForSecretKey(Ne,je,ke));return De?W.KeyPair.fromString(De):null}async removeKey(Ne,je,ke){this.localStorage.removeItem(this.storageKeyForSecretKey(Ne,je,ke))}async clear(){for(const Ne of this.storageKeys())Ne.startsWith(this.prefix)&&this.localStorage.removeItem(Ne)}async getNetworks(){const Ne=new Set;for(const je of this.storageKeys())if(je.startsWith(this.prefix)){const ke=je.substring(this.prefix.length).split(":");Ne.add(ke[1])}return Array.from(Ne.values())}async getAccounts(Ne){const je=[];for(const ke of this.storageKeys())if(ke.startsWith(this.prefix)){const De=ke.substring(this.prefix.length).split(":");De[1]===Ne&&je.push(De[0])}return je}async getContracts(Ne,je){const ke=[];for(const De of this.storageKeys())if(De.startsWith(this.prefix)){const qe=De.substring(this.prefix.length).split(":");qe[1]===Ne&&qe[0]===je&&ke.push(qe[2])}return ke}storageKeyForSecretKey(Ne,je,ke){return`${this.prefix}${je}:${Ne}:${ke}`}*storageKeys(){for(let Ne=0;Ne<this.localStorage.length;Ne++)yield this.localStorage.key(Ne)}}return multi_contract_browser_local_storage_key_store.MultiContractBrowserLocalStorageKeyStore=X,multi_contract_browser_local_storage_key_store}var hasRequiredCommonjs$5;function requireCommonjs$5(){return hasRequiredCommonjs$5||(hasRequiredCommonjs$5=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.MultiContractBrowserLocalStorageKeyStore=W.BrowserLocalStorageKeyStore=void 0;var Y=requireBrowser_local_storage_key_store$3();Object.defineProperty(W,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return Y.BrowserLocalStorageKeyStore}});var J=requireMulti_contract_browser_local_storage_key_store();Object.defineProperty(W,"MultiContractBrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return J.MultiContractBrowserLocalStorageKeyStore}})}(commonjs$5)),commonjs$5}var hasRequiredBrowser_local_storage_key_store$2;function requireBrowser_local_storage_key_store$2(){return hasRequiredBrowser_local_storage_key_store$2||(hasRequiredBrowser_local_storage_key_store$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.BrowserLocalStorageKeyStore=void 0;var Y=requireCommonjs$5();Object.defineProperty(W,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return Y.BrowserLocalStorageKeyStore}})}(browser_local_storage_key_store$3)),browser_local_storage_key_store$3}var merge_key_store$2={},hasRequiredMerge_key_store$2;function requireMerge_key_store$2(){return hasRequiredMerge_key_store$2||(hasRequiredMerge_key_store$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.MergeKeyStore=void 0;var Y=requireCommonjs$6();Object.defineProperty(W,"MergeKeyStore",{enumerable:!0,get:function(){return Y.MergeKeyStore}})}(merge_key_store$2)),merge_key_store$2}var hasRequiredBrowserIndex$3;function requireBrowserIndex$3(){return hasRequiredBrowserIndex$3||(hasRequiredBrowserIndex$3=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.MergeKeyStore=W.BrowserLocalStorageKeyStore=W.InMemoryKeyStore=W.KeyStore=void 0;const Y=requireKeystore$2();Object.defineProperty(W,"KeyStore",{enumerable:!0,get:function(){return Y.KeyStore}});const J=requireIn_memory_key_store$2();Object.defineProperty(W,"InMemoryKeyStore",{enumerable:!0,get:function(){return J.InMemoryKeyStore}});const X=requireBrowser_local_storage_key_store$2();Object.defineProperty(W,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return X.BrowserLocalStorageKeyStore}});const Me=requireMerge_key_store$2();Object.defineProperty(W,"MergeKeyStore",{enumerable:!0,get:function(){return Me.MergeKeyStore}})}(browserIndex$3)),browserIndex$3}var commonIndex$1={},providers$1={},provider$4={},commonjs$4={},exponentialBackoff$1={},hasRequiredExponentialBackoff$1;function requireExponentialBackoff$1(){if(hasRequiredExponentialBackoff$1)return exponentialBackoff$1;hasRequiredExponentialBackoff$1=1,Object.defineProperty(exponentialBackoff$1,"__esModule",{value:!0}),exponentialBackoff$1.exponentialBackoff=void 0;async function W(J,X,Me,Se){let Ne=J;for(let je=0;je<X;je++){const ke=await Se();if(ke)return ke;await Y(Ne),Ne*=Me}return null}exponentialBackoff$1.exponentialBackoff=W;function Y(J){return new Promise(X=>setTimeout(X,J))}return exponentialBackoff$1}var jsonRpcProvider$3={},commonjs$3={},action_creators$1={},actions$2={},hasRequiredActions$2;function requireActions$2(){if(hasRequiredActions$2)return actions$2;hasRequiredActions$2=1,Object.defineProperty(actions$2,"__esModule",{value:!0}),actions$2.Action=actions$2.SignedDelegate=actions$2.DeleteAccount=actions$2.DeleteKey=actions$2.AddKey=actions$2.Stake=actions$2.Transfer=actions$2.FunctionCall=actions$2.DeployContract=actions$2.CreateAccount=actions$2.AccessKey=actions$2.AccessKeyPermission=actions$2.FullAccessPermission=actions$2.FunctionCallPermission=void 0;const W=requireCommonjs$9();class Y{constructor({allowance:Fn,receiverId:io,methodNames:$o}){Kc(this,"allowance");Kc(this,"receiverId");Kc(this,"methodNames");this.allowance=Fn,this.receiverId=io,this.methodNames=$o}}actions$2.FunctionCallPermission=Y;class J{}actions$2.FullAccessPermission=J;class X extends W.Enum{constructor(io){super(io);Kc(this,"enum");Kc(this,"functionCall");Kc(this,"fullAccess");for(const[$o,Jo]of Object.entries(io||{}))this[$o]=Jo,this.enum=$o}}actions$2.AccessKeyPermission=X;class Me{constructor({nonce:Fn,permission:io}){Kc(this,"nonce");Kc(this,"permission");this.nonce=Fn,this.permission=io}}actions$2.AccessKey=Me;class Se{}actions$2.CreateAccount=Se;class Ne{constructor({code:Fn}){Kc(this,"code");this.code=Fn}}actions$2.DeployContract=Ne;class je{constructor({methodName:Fn,args:io,gas:$o,deposit:Jo}){Kc(this,"methodName");Kc(this,"args");Kc(this,"gas");Kc(this,"deposit");this.methodName=Fn,this.args=io,this.gas=$o,this.deposit=Jo}}actions$2.FunctionCall=je;class ke{constructor({deposit:Fn}){Kc(this,"deposit");this.deposit=Fn}}actions$2.Transfer=ke;class De{constructor({stake:Fn,publicKey:io}){Kc(this,"stake");Kc(this,"publicKey");this.stake=Fn,this.publicKey=io}}actions$2.Stake=De;class qe{constructor({publicKey:Fn,accessKey:io}){Kc(this,"publicKey");Kc(this,"accessKey");this.publicKey=Fn,this.accessKey=io}}actions$2.AddKey=qe;class Ue{constructor({publicKey:Fn}){Kc(this,"publicKey");this.publicKey=Fn}}actions$2.DeleteKey=Ue;class Ge{constructor({beneficiaryId:Fn}){Kc(this,"beneficiaryId");this.beneficiaryId=Fn}}actions$2.DeleteAccount=Ge;class He{constructor({delegateAction:Fn,signature:io}){Kc(this,"delegateAction");Kc(this,"signature");this.delegateAction=Fn,this.signature=io}}actions$2.SignedDelegate=He;class Ve extends W.Enum{constructor(io){super(io);Kc(this,"enum");Kc(this,"createAccount");Kc(this,"deployContract");Kc(this,"functionCall");Kc(this,"transfer");Kc(this,"stake");Kc(this,"addKey");Kc(this,"deleteKey");Kc(this,"deleteAccount");Kc(this,"signedDelegate");for(const[$o,Jo]of Object.entries(io||{}))this[$o]=Jo,this.enum=$o}}return actions$2.Action=Ve,actions$2}var hasRequiredAction_creators$1;function requireAction_creators$1(){if(hasRequiredAction_creators$1)return action_creators$1;hasRequiredAction_creators$1=1,Object.defineProperty(action_creators$1,"__esModule",{value:!0}),action_creators$1.actionCreators=action_creators$1.stringifyJsonOrBytes=void 0;const W=requireActions$2();function Y(){return new W.AccessKey({nonce:0n,permission:new W.AccessKeyPermission({fullAccess:new W.FullAccessPermission})})}function J(He,Ve,Ye){return new W.AccessKey({nonce:0n,permission:new W.AccessKeyPermission({functionCall:new W.FunctionCallPermission({receiverId:He,allowance:Ye,methodNames:Ve})})})}function X(){return new W.Action({createAccount:new W.CreateAccount})}function Me(He){return new W.Action({deployContract:new W.DeployContract({code:He})})}function Se(He){return He.byteLength!==void 0&&He.byteLength===He.length?He:Buffer.from(JSON.stringify(He))}action_creators$1.stringifyJsonOrBytes=Se;function Ne(He,Ve,Ye=0n,Fn=0n,io=Se,$o=!1){return $o?new W.Action({functionCall:new W.FunctionCall({methodName:He,args:Ve,gas:Ye,deposit:Fn})}):new W.Action({functionCall:new W.FunctionCall({methodName:He,args:io(Ve),gas:Ye,deposit:Fn})})}function je(He=0n){return new W.Action({transfer:new W.Transfer({deposit:He})})}function ke(He=0n,Ve){return new W.Action({stake:new W.Stake({stake:He,publicKey:Ve})})}function De(He,Ve){return new W.Action({addKey:new W.AddKey({publicKey:He,accessKey:Ve})})}function qe(He){return new W.Action({deleteKey:new W.DeleteKey({publicKey:He})})}function Ue(He){return new W.Action({deleteAccount:new W.DeleteAccount({beneficiaryId:He})})}function Ge({delegateAction:He,signature:Ve}){return new W.Action({signedDelegate:new W.SignedDelegate({delegateAction:He,signature:Ve})})}return action_creators$1.actionCreators={addKey:De,createAccount:X,deleteAccount:Ue,deleteKey:qe,deployContract:Me,fullAccessKey:Y,functionCall:Ne,functionCallAccessKey:J,signedDelegate:Ge,stake:ke,transfer:je},action_creators$1}var create_transaction$1={},schema$2={},prefix$1={},hasRequiredPrefix$1;function requirePrefix$1(){if(hasRequiredPrefix$1)return prefix$1;hasRequiredPrefix$1=1,Object.defineProperty(prefix$1,"__esModule",{value:!0}),prefix$1.DelegateActionPrefix=void 0;const W=Math.pow(2,30),Y={MetaTransactions:366};class J{constructor({prefix:Ne}){Kc(this,"prefix");this.prefix=Ne}}class X extends J{constructor(Ne){super({prefix:W+Ne})}}class Me extends X{constructor(){super(Y.MetaTransactions)}}return prefix$1.DelegateActionPrefix=Me,prefix$1}var hasRequiredSchema$1;function requireSchema$1(){return hasRequiredSchema$1||(hasRequiredSchema$1=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.SCHEMA=W.SignedTransaction=W.Transaction=W.decodeSignedTransaction=W.decodeTransaction=W.encodeTransaction=W.encodeSignedDelegate=W.encodeDelegateAction=void 0;const Y=requireCjs$4(),J=requirePrefix$1();function X(qe){return new Uint8Array([...(0,Y.serialize)(W.SCHEMA.DelegateActionPrefix,new J.DelegateActionPrefix),...(0,Y.serialize)(W.SCHEMA.DelegateAction,qe)])}W.encodeDelegateAction=X;function Me(qe){return(0,Y.serialize)(W.SCHEMA.SignedDelegate,qe)}W.encodeSignedDelegate=Me;function Se(qe){const Ue=qe instanceof De?W.SCHEMA.SignedTransaction:W.SCHEMA.Transaction;return(0,Y.serialize)(Ue,qe)}W.encodeTransaction=Se;function Ne(qe){return new ke((0,Y.deserialize)(W.SCHEMA.Transaction,qe))}W.decodeTransaction=Ne;function je(qe){return new De((0,Y.deserialize)(W.SCHEMA.SignedTransaction,qe))}W.decodeSignedTransaction=je;class ke{constructor({signerId:Ue,publicKey:Ge,nonce:He,receiverId:Ve,actions:Ye,blockHash:Fn}){Kc(this,"signerId");Kc(this,"publicKey");Kc(this,"nonce");Kc(this,"receiverId");Kc(this,"actions");Kc(this,"blockHash");this.signerId=Ue,this.publicKey=Ge,this.nonce=He,this.receiverId=Ve,this.actions=Ye,this.blockHash=Fn}encode(){return Se(this)}static decode(Ue){return Ne(Ue)}}W.Transaction=ke;class De{constructor({transaction:Ue,signature:Ge}){Kc(this,"transaction");Kc(this,"signature");this.transaction=Ue,this.signature=Ge}encode(){return Se(this)}static decode(Ue){return je(Ue)}}W.SignedTransaction=De,W.SCHEMA=new class{constructor(){Kc(this,"Ed25519Signature",{struct:{data:{array:{type:"u8",len:64}}}});Kc(this,"Secp256k1Signature",{struct:{data:{array:{type:"u8",len:65}}}});Kc(this,"Signature",{enum:[{struct:{ed25519Signature:this.Ed25519Signature}},{struct:{secp256k1Signature:this.Secp256k1Signature}}]});Kc(this,"Ed25519Data",{struct:{data:{array:{type:"u8",len:32}}}});Kc(this,"Secp256k1Data",{struct:{data:{array:{type:"u8",len:64}}}});Kc(this,"PublicKey",{enum:[{struct:{ed25519Key:this.Ed25519Data}},{struct:{secp256k1Key:this.Secp256k1Data}}]});Kc(this,"FunctionCallPermission",{struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}});Kc(this,"FullAccessPermission",{struct:{}});Kc(this,"AccessKeyPermission",{enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]});Kc(this,"AccessKey",{struct:{nonce:"u64",permission:this.AccessKeyPermission}});Kc(this,"CreateAccount",{struct:{}});Kc(this,"DeployContract",{struct:{code:{array:{type:"u8"}}}});Kc(this,"FunctionCall",{struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}});Kc(this,"Transfer",{struct:{deposit:"u128"}});Kc(this,"Stake",{struct:{stake:"u128",publicKey:this.PublicKey}});Kc(this,"AddKey",{struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}});Kc(this,"DeleteKey",{struct:{publicKey:this.PublicKey}});Kc(this,"DeleteAccount",{struct:{beneficiaryId:"string"}});Kc(this,"DelegateActionPrefix",{struct:{prefix:"u32"}});Kc(this,"ClassicActions",{enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}}]});Kc(this,"DelegateAction",{struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}});Kc(this,"SignedDelegate",{struct:{delegateAction:this.DelegateAction,signature:this.Signature}});Kc(this,"Action",{enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}}]});Kc(this,"Transaction",{struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}});Kc(this,"SignedTransaction",{struct:{transaction:this.Transaction,signature:this.Signature}})}}}(schema$2)),schema$2}var hasRequiredCreate_transaction$1;function requireCreate_transaction$1(){if(hasRequiredCreate_transaction$1)return create_transaction$1;hasRequiredCreate_transaction$1=1,Object.defineProperty(create_transaction$1,"__esModule",{value:!0}),create_transaction$1.createTransaction=void 0;const W=requireSchema$1();function Y(J,X,Me,Se,Ne,je){const ke=typeof Se=="bigint"?Se:BigInt(Se);return new W.Transaction({signerId:J,publicKey:X,nonce:ke,receiverId:Me,actions:Ne,blockHash:je})}return create_transaction$1.createTransaction=Y,create_transaction$1}var delegate$1={},hasRequiredDelegate$1;function requireDelegate$1(){if(hasRequiredDelegate$1)return delegate$1;hasRequiredDelegate$1=1,Object.defineProperty(delegate$1,"__esModule",{value:!0}),delegate$1.buildDelegateAction=delegate$1.DelegateAction=void 0;const W=requireAction_creators$1(),{addKey:Y,createAccount:J,deleteAccount:X,deleteKey:Me,deployContract:Se,functionCall:Ne,stake:je,transfer:ke}=W.actionCreators;class De{constructor({senderId:Ge,receiverId:He,actions:Ve,nonce:Ye,maxBlockHeight:Fn,publicKey:io}){Kc(this,"senderId");Kc(this,"receiverId");Kc(this,"actions");Kc(this,"nonce");Kc(this,"maxBlockHeight");Kc(this,"publicKey");this.senderId=Ge,this.receiverId=He,this.actions=Ve,this.nonce=Ye,this.maxBlockHeight=Fn,this.publicKey=io}}delegate$1.DelegateAction=De;function qe({actions:Ue,maxBlockHeight:Ge,nonce:He,publicKey:Ve,receiverId:Ye,senderId:Fn}){return new De({senderId:Fn,receiverId:Ye,actions:Ue.map(io=>{if(!io.type&&!io.params)return io;switch(io.type){case"AddKey":{const{publicKey:$o,accessKey:Jo}=io.params;return Y($o,Jo)}case"CreateAccount":return J(io.params.createAccount);case"DeleteAccount":return X(io.params.deleteAccount);case"DeleteKey":return Me(io.params.publicKey);case"DeployContract":return Se(io.params.code);case"FunctionCall":{const{methodName:$o,args:Jo,gas:rs,deposit:Yo}=io.params;return Ne($o,Jo,rs,Yo)}case"Stake":return je(io.params.stake,io.params.publicKey);case"Transfer":{const{deposit:$o}=io.params;return ke($o)}}throw new Error("Unrecognized action")}),nonce:He,maxBlockHeight:Ge,publicKey:Ve})}return delegate$1.buildDelegateAction=qe,delegate$1}var sign$1={},signature$1={},hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1,Object.defineProperty(signature$1,"__esModule",{value:!0}),signature$1.Signature=void 0;const W=requireCommonjs$7(),Y=requireCommonjs$9();function J(Me){switch(Me){case W.KeyType.ED25519:return"ed25519Signature";case W.KeyType.SECP256K1:return"secp256k1Signature";default:throw Error(`unknown type ${Me}`)}}class X extends Y.Enum{constructor(Ne){const je=J(Ne.keyType);super({[je]:Ne});Kc(this,"enum");Kc(this,"ed25519Signature");Kc(this,"secp256k1Signature");this[je]=Ne,this.enum=je}get signature(){return this.ed25519Signature||this.secp256k1Signature}get signatureType(){return this.signature.keyType}get data(){return this.signature.data}}return signature$1.Signature=X,signature$1}var hasRequiredSign$1;function requireSign$1(){if(hasRequiredSign$1)return sign$1;hasRequiredSign$1=1,Object.defineProperty(sign$1,"__esModule",{value:!0}),sign$1.signDelegateAction=sign$1.signTransaction=void 0;const W=requireSha256$3(),Y=requireActions$2(),J=requireCreate_transaction$1(),X=requireSchema$1(),Me=requireSignature$1(),Se=requireCommonjs$7();async function Ne(De,qe,Ue,Ge){const He=(0,X.encodeTransaction)(De),Ve=new Uint8Array((0,W.sha256)(He)),Ye=await qe.signMessage(He,Ue,Ge),Fn=De.publicKey.ed25519Key?Se.KeyType.ED25519:Se.KeyType.SECP256K1,io=new X.SignedTransaction({transaction:De,signature:new Me.Signature({keyType:Fn,data:Ye.signature})});return[Ve,io]}async function je(...De){if(De[0].constructor===X.Transaction){const[qe,Ue,Ge,He]=De;return Ne(qe,Ue,Ge,He)}else{const[qe,Ue,Ge,He,Ve,Ye,Fn]=De,io=await Ve.getPublicKey(Ye,Fn),$o=(0,J.createTransaction)(Ye,io,qe,Ue,Ge,He);return Ne($o,Ve,Ye,Fn)}}sign$1.signTransaction=je;async function ke({delegateAction:De,signer:qe}){const Ue=(0,X.encodeDelegateAction)(De),Ge=await qe.sign(Ue),He=De.publicKey.ed25519Key?Se.KeyType.ED25519:Se.KeyType.SECP256K1,Ve=new Y.SignedDelegate({delegateAction:De,signature:new Me.Signature({keyType:He,data:Ge})});return{hash:new Uint8Array((0,W.sha256)(Ue)),signedDelegateAction:Ve}}return sign$1.signDelegateAction=ke,sign$1}var hasRequiredCommonjs$4;function requireCommonjs$4(){return hasRequiredCommonjs$4||(hasRequiredCommonjs$4=1,function(W){var Y=commonjs$3.__createBinding||(Object.create?function(X,Me,Se,Ne){Ne===void 0&&(Ne=Se);var je=Object.getOwnPropertyDescriptor(Me,Se);(!je||("get"in je?!Me.__esModule:je.writable||je.configurable))&&(je={enumerable:!0,get:function(){return Me[Se]}}),Object.defineProperty(X,Ne,je)}:function(X,Me,Se,Ne){Ne===void 0&&(Ne=Se),X[Ne]=Me[Se]}),J=commonjs$3.__exportStar||function(X,Me){for(var Se in X)Se!=="default"&&!Object.prototype.hasOwnProperty.call(Me,Se)&&Y(Me,X,Se)};Object.defineProperty(W,"__esModule",{value:!0}),J(requireAction_creators$1(),W),J(requireActions$2(),W),J(requireCreate_transaction$1(),W),J(requireDelegate$1(),W),J(requireSchema$1(),W),J(requireSign$1(),W),J(requireSignature$1(),W)}(commonjs$3)),commonjs$3}var provider$3={},hasRequiredProvider$4;function requireProvider$4(){if(hasRequiredProvider$4)return provider$3;hasRequiredProvider$4=1,Object.defineProperty(provider$3,"__esModule",{value:!0}),provider$3.Provider=void 0;class W{}return provider$3.Provider=W,provider$3}var fetch_json$1={},backoff={},options={},hasRequiredOptions;function requireOptions(){if(hasRequiredOptions)return options;hasRequiredOptions=1;var W=options.__assign||function(){return W=Object.assign||function(X){for(var Me,Se=1,Ne=arguments.length;Se<Ne;Se++){Me=arguments[Se];for(var je in Me)Object.prototype.hasOwnProperty.call(Me,je)&&(X[je]=Me[je])}return X},W.apply(this,arguments)};Object.defineProperty(options,"__esModule",{value:!0});var Y={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function J(X){var Me=W(W({},Y),X);return Me.numOfAttempts<1&&(Me.numOfAttempts=1),Me}return options.getSanitizedOptions=J,options}var delay_factory={},skipFirst_delay={},delay_base={},jitter_factory={},full_jitter={},hasRequiredFull_jitter;function requireFull_jitter(){if(hasRequiredFull_jitter)return full_jitter;hasRequiredFull_jitter=1,Object.defineProperty(full_jitter,"__esModule",{value:!0});function W(Y){var J=Math.random()*Y;return Math.round(J)}return full_jitter.fullJitter=W,full_jitter}var no_jitter={},hasRequiredNo_jitter;function requireNo_jitter(){if(hasRequiredNo_jitter)return no_jitter;hasRequiredNo_jitter=1,Object.defineProperty(no_jitter,"__esModule",{value:!0});function W(Y){return Y}return no_jitter.noJitter=W,no_jitter}var hasRequiredJitter_factory;function requireJitter_factory(){if(hasRequiredJitter_factory)return jitter_factory;hasRequiredJitter_factory=1,Object.defineProperty(jitter_factory,"__esModule",{value:!0});var W=requireFull_jitter(),Y=requireNo_jitter();function J(X){switch(X.jitter){case"full":return W.fullJitter;case"none":default:return Y.noJitter}}return jitter_factory.JitterFactory=J,jitter_factory}var hasRequiredDelay_base;function requireDelay_base(){if(hasRequiredDelay_base)return delay_base;hasRequiredDelay_base=1,Object.defineProperty(delay_base,"__esModule",{value:!0});var W=requireJitter_factory(),Y=function(){function J(X){this.options=X,this.attempt=0}return J.prototype.apply=function(){var X=this;return new Promise(function(Me){return setTimeout(Me,X.jitteredDelay)})},J.prototype.setAttemptNumber=function(X){this.attempt=X},Object.defineProperty(J.prototype,"jitteredDelay",{get:function(){var X=W.JitterFactory(this.options);return X(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(J.prototype,"delay",{get:function(){var X=this.options.startingDelay,Me=this.options.timeMultiple,Se=this.numOfDelayedAttempts,Ne=X*Math.pow(Me,Se);return Math.min(Ne,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(J.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),J}();return delay_base.Delay=Y,delay_base}var hasRequiredSkipFirst_delay;function requireSkipFirst_delay(){if(hasRequiredSkipFirst_delay)return skipFirst_delay;hasRequiredSkipFirst_delay=1;var W=skipFirst_delay.__extends||function(){var Se=function(Ne,je){return Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ke,De){ke.__proto__=De}||function(ke,De){for(var qe in De)De.hasOwnProperty(qe)&&(ke[qe]=De[qe])},Se(Ne,je)};return function(Ne,je){Se(Ne,je);function ke(){this.constructor=Ne}Ne.prototype=je===null?Object.create(je):(ke.prototype=je.prototype,new ke)}}(),Y=skipFirst_delay.__awaiter||function(Se,Ne,je,ke){function De(qe){return qe instanceof je?qe:new je(function(Ue){Ue(qe)})}return new(je||(je=Promise))(function(qe,Ue){function Ge(Ye){try{Ve(ke.next(Ye))}catch(Fn){Ue(Fn)}}function He(Ye){try{Ve(ke.throw(Ye))}catch(Fn){Ue(Fn)}}function Ve(Ye){Ye.done?qe(Ye.value):De(Ye.value).then(Ge,He)}Ve((ke=ke.apply(Se,Ne||[])).next())})},J=skipFirst_delay.__generator||function(Se,Ne){var je={label:0,sent:function(){if(qe[0]&1)throw qe[1];return qe[1]},trys:[],ops:[]},ke,De,qe,Ue;return Ue={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(Ue[Symbol.iterator]=function(){return this}),Ue;function Ge(Ve){return function(Ye){return He([Ve,Ye])}}function He(Ve){if(ke)throw new TypeError("Generator is already executing.");for(;je;)try{if(ke=1,De&&(qe=Ve[0]&2?De.return:Ve[0]?De.throw||((qe=De.return)&&qe.call(De),0):De.next)&&!(qe=qe.call(De,Ve[1])).done)return qe;switch(De=0,qe&&(Ve=[Ve[0]&2,qe.value]),Ve[0]){case 0:case 1:qe=Ve;break;case 4:return je.label++,{value:Ve[1],done:!1};case 5:je.label++,De=Ve[1],Ve=[0];continue;case 7:Ve=je.ops.pop(),je.trys.pop();continue;default:if(qe=je.trys,!(qe=qe.length>0&&qe[qe.length-1])&&(Ve[0]===6||Ve[0]===2)){je=0;continue}if(Ve[0]===3&&(!qe||Ve[1]>qe[0]&&Ve[1]<qe[3])){je.label=Ve[1];break}if(Ve[0]===6&&je.label<qe[1]){je.label=qe[1],qe=Ve;break}if(qe&&je.label<qe[2]){je.label=qe[2],je.ops.push(Ve);break}qe[2]&&je.ops.pop(),je.trys.pop();continue}Ve=Ne.call(Se,je)}catch(Ye){Ve=[6,Ye],De=0}finally{ke=qe=0}if(Ve[0]&5)throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}};Object.defineProperty(skipFirst_delay,"__esModule",{value:!0});var X=requireDelay_base(),Me=function(Se){W(Ne,Se);function Ne(){return Se!==null&&Se.apply(this,arguments)||this}return Ne.prototype.apply=function(){return Y(this,void 0,void 0,function(){return J(this,function(je){return[2,this.isFirstAttempt?!0:Se.prototype.apply.call(this)]})})},Object.defineProperty(Ne.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(Ne.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),Ne}(X.Delay);return skipFirst_delay.SkipFirstDelay=Me,skipFirst_delay}var always_delay={},hasRequiredAlways_delay;function requireAlways_delay(){if(hasRequiredAlways_delay)return always_delay;hasRequiredAlways_delay=1;var W=always_delay.__extends||function(){var X=function(Me,Se){return X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ne,je){Ne.__proto__=je}||function(Ne,je){for(var ke in je)je.hasOwnProperty(ke)&&(Ne[ke]=je[ke])},X(Me,Se)};return function(Me,Se){X(Me,Se);function Ne(){this.constructor=Me}Me.prototype=Se===null?Object.create(Se):(Ne.prototype=Se.prototype,new Ne)}}();Object.defineProperty(always_delay,"__esModule",{value:!0});var Y=requireDelay_base(),J=function(X){W(Me,X);function Me(){return X!==null&&X.apply(this,arguments)||this}return Me}(Y.Delay);return always_delay.AlwaysDelay=J,always_delay}var hasRequiredDelay_factory;function requireDelay_factory(){if(hasRequiredDelay_factory)return delay_factory;hasRequiredDelay_factory=1,Object.defineProperty(delay_factory,"__esModule",{value:!0});var W=requireSkipFirst_delay(),Y=requireAlways_delay();function J(Me,Se){var Ne=X(Me);return Ne.setAttemptNumber(Se),Ne}delay_factory.DelayFactory=J;function X(Me){return Me.delayFirstAttempt?new Y.AlwaysDelay(Me):new W.SkipFirstDelay(Me)}return delay_factory}var hasRequiredBackoff;function requireBackoff(){if(hasRequiredBackoff)return backoff;hasRequiredBackoff=1;var W=backoff.__awaiter||function(Ne,je,ke,De){function qe(Ue){return Ue instanceof ke?Ue:new ke(function(Ge){Ge(Ue)})}return new(ke||(ke=Promise))(function(Ue,Ge){function He(Fn){try{Ye(De.next(Fn))}catch(io){Ge(io)}}function Ve(Fn){try{Ye(De.throw(Fn))}catch(io){Ge(io)}}function Ye(Fn){Fn.done?Ue(Fn.value):qe(Fn.value).then(He,Ve)}Ye((De=De.apply(Ne,je||[])).next())})},Y=backoff.__generator||function(Ne,je){var ke={label:0,sent:function(){if(Ue[0]&1)throw Ue[1];return Ue[1]},trys:[],ops:[]},De,qe,Ue,Ge;return Ge={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(Ge[Symbol.iterator]=function(){return this}),Ge;function He(Ye){return function(Fn){return Ve([Ye,Fn])}}function Ve(Ye){if(De)throw new TypeError("Generator is already executing.");for(;ke;)try{if(De=1,qe&&(Ue=Ye[0]&2?qe.return:Ye[0]?qe.throw||((Ue=qe.return)&&Ue.call(qe),0):qe.next)&&!(Ue=Ue.call(qe,Ye[1])).done)return Ue;switch(qe=0,Ue&&(Ye=[Ye[0]&2,Ue.value]),Ye[0]){case 0:case 1:Ue=Ye;break;case 4:return ke.label++,{value:Ye[1],done:!1};case 5:ke.label++,qe=Ye[1],Ye=[0];continue;case 7:Ye=ke.ops.pop(),ke.trys.pop();continue;default:if(Ue=ke.trys,!(Ue=Ue.length>0&&Ue[Ue.length-1])&&(Ye[0]===6||Ye[0]===2)){ke=0;continue}if(Ye[0]===3&&(!Ue||Ye[1]>Ue[0]&&Ye[1]<Ue[3])){ke.label=Ye[1];break}if(Ye[0]===6&&ke.label<Ue[1]){ke.label=Ue[1],Ue=Ye;break}if(Ue&&ke.label<Ue[2]){ke.label=Ue[2],ke.ops.push(Ye);break}Ue[2]&&ke.ops.pop(),ke.trys.pop();continue}Ye=je.call(Ne,ke)}catch(Fn){Ye=[6,Fn],qe=0}finally{De=Ue=0}if(Ye[0]&5)throw Ye[1];return{value:Ye[0]?Ye[1]:void 0,done:!0}}};Object.defineProperty(backoff,"__esModule",{value:!0});var J=requireOptions(),X=requireDelay_factory();function Me(Ne,je){return je===void 0&&(je={}),W(this,void 0,void 0,function(){var ke,De;return Y(this,function(qe){switch(qe.label){case 0:return ke=J.getSanitizedOptions(je),De=new Se(Ne,ke),[4,De.execute()];case 1:return[2,qe.sent()]}})})}backoff.backOff=Me;var Se=function(){function Ne(je,ke){this.request=je,this.options=ke,this.attemptNumber=0}return Ne.prototype.execute=function(){return W(this,void 0,void 0,function(){var je,ke;return Y(this,function(De){switch(De.label){case 0:if(this.attemptLimitReached)return[3,7];De.label=1;case 1:return De.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return De.sent(),[4,this.request()];case 3:return[2,De.sent()];case 4:return je=De.sent(),this.attemptNumber++,[4,this.options.retry(je,this.attemptNumber)];case 5:if(ke=De.sent(),!ke||this.attemptLimitReached)throw je;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(Ne.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),Ne.prototype.applyDelay=function(){return W(this,void 0,void 0,function(){var je;return Y(this,function(ke){switch(ke.label){case 0:return je=X.DelayFactory(this.options,this.attemptNumber),[4,je.apply()];case 1:return ke.sent(),[2]}})})},Ne}();return backoff}function unfetch_module(W,Y){return Y=Y||{},new Promise(function(J,X){var Me=new XMLHttpRequest,Se=[],Ne=[],je={},ke=function(){return{ok:(Me.status/100|0)==2,statusText:Me.statusText,status:Me.status,url:Me.responseURL,text:function(){return Promise.resolve(Me.responseText)},json:function(){return Promise.resolve(Me.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([Me.response]))},clone:ke,headers:{keys:function(){return Se},entries:function(){return Ne},get:function(qe){return je[qe.toLowerCase()]},has:function(qe){return qe.toLowerCase()in je}}}};for(var De in Me.open(Y.method||"get",W,!0),Me.onload=function(){Me.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(qe,Ue,Ge){Se.push(Ue=Ue.toLowerCase()),Ne.push([Ue,Ge]),je[Ue]=je[Ue]?je[Ue]+","+Ge:Ge}),J(ke())},Me.onerror=X,Me.withCredentials=Y.credentials=="include",Y.headers)Me.setRequestHeader(De,Y.headers[De]);Me.send(Y.body||null)})}const unfetch_module$1=Object.freeze(Object.defineProperty({__proto__:null,default:unfetch_module},Symbol.toStringTag,{value:"Module"})),require$$0$4=getAugmentedNamespace(unfetch_module$1);var browser$5,hasRequiredBrowser$4;function requireBrowser$4(){return hasRequiredBrowser$4||(hasRequiredBrowser$4=1,browser$5=self.fetch||(self.fetch=require$$0$4.default||require$$0$4)),browser$5}var hasRequiredFetch_json$1;function requireFetch_json$1(){if(hasRequiredFetch_json$1)return fetch_json$1;hasRequiredFetch_json$1=1;var W=fetch_json$1.__importDefault||function(De){return De&&De.__esModule?De:{default:De}};Object.defineProperty(fetch_json$1,"__esModule",{value:!0}),fetch_json$1.fetchJsonRpc=void 0;const Y=requireCommonjs$9(),J=requireBackoff(),X=W(requireBrowser$4()),Me=1.5,Se=10,Ne={numOfAttempts:Se,timeMultiple:Me,retry:De=>!!([503,408].includes(De.cause)||De.toString().includes("FetchError")||De.toString().includes("Failed to fetch"))};class je extends Error{constructor(Ue,Ge){super(Ue,Ge);Kc(this,"cause")}}async function ke(De,qe,Ue){const Ge=await(0,J.backOff)(async()=>{const He=await(0,X.default)(De,{method:"POST",body:JSON.stringify(qe),headers:{...Ue,"Content-Type":"application/json"}}),{ok:Ve,status:Ye}=He;if(!Ve)throw new je(await He.text(),{cause:Ye});if(Ye===503)throw new je(`${De} unavailable`,{cause:Ye});if(Ye===408)throw new je("Unused connection",{cause:Ye});return He},Ne);if(!Ge)throw new Y.TypedError(`Exceeded ${Se} attempts for ${De}.`,"RetriesExceeded");return await Ge.json()}return fetch_json$1.fetchJsonRpc=ke,fetch_json$1}var hasRequiredJsonRpcProvider$3;function requireJsonRpcProvider$3(){if(hasRequiredJsonRpcProvider$3)return jsonRpcProvider$3;hasRequiredJsonRpcProvider$3=1,Object.defineProperty(jsonRpcProvider$3,"__esModule",{value:!0}),jsonRpcProvider$3.JsonRpcProvider=void 0;const W=requireCommonjs$8(),Y=requireCommonjs$9(),J=requireCommonjs$4(),X=requireExponentialBackoff$1(),Me=requireProvider$4(),Se=requireFetch_json$1(),Ne=12,je=500,ke=1.5;let De=123;class qe extends Me.Provider{constructor(He,Ve){super();Kc(this,"connection");Kc(this,"options");this.connection=He||{url:""};const Ye={retries:Ne,wait:je,backoff:ke};this.options=Object.assign({},Ye,Ve)}async status(){return this.sendJsonRpc("status",[])}async sendTransactionUntil(He,Ve){const Ye=(0,J.encodeTransaction)(He);return this.sendJsonRpc("send_tx",{signed_tx_base64:Buffer.from(Ye).toString("base64"),wait_until:Ve})}async sendTransaction(He){return this.sendTransactionUntil(He,"EXECUTED_OPTIMISTIC")}async sendTransactionAsync(He){return this.sendTransactionUntil(He,"NONE")}async txStatus(He,Ve,Ye="EXECUTED_OPTIMISTIC"){return typeof He=="string"?this.txStatusString(He,Ve,Ye):this.txStatusUint8Array(He,Ve,Ye)}async txStatusUint8Array(He,Ve,Ye){return this.sendJsonRpc("tx",{tx_hash:(0,W.baseEncode)(He),sender_account_id:Ve,wait_until:Ye})}async txStatusString(He,Ve,Ye){return this.sendJsonRpc("tx",{tx_hash:He,sender_account_id:Ve,wait_until:Ye})}async txStatusReceipts(He,Ve,Ye="EXECUTED_OPTIMISTIC"){return typeof He=="string"?this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:He,sender_account_id:Ve,wait_until:Ye}):this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:(0,W.baseEncode)(He),sender_account_id:Ve,wait_until:Ye})}async query(...He){let Ve;if(He.length===1){const{block_id:Ye,blockId:Fn,...io}=He[0];Ve=await this.sendJsonRpc("query",{...io,block_id:Ye||Fn})}else{const[Ye,Fn]=He;Ve=await this.sendJsonRpc("query",[Ye,Fn])}if(Ve&&Ve.error)throw new Y.TypedError(`Querying failed: ${Ve.error}.
${JSON.stringify(Ve,null,2)}`,(0,W.getErrorTypeFromErrorMessage)(Ve.error,Ve.error.name));return Ve}async block(He){const{finality:Ve}=He,{blockId:Ye}=He;return this.sendJsonRpc("block",{block_id:Ye,finality:Ve})}async blockChanges(He){const{finality:Ve}=He,{blockId:Ye}=He;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:Ye,finality:Ve})}async chunk(He){return this.sendJsonRpc("chunk",[He])}async validators(He){return this.sendJsonRpc("validators",[He])}async experimental_protocolConfig(He){const{blockId:Ve,...Ye}=He;return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{...Ye,block_id:Ve})}async lightClientProof(He){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",He)}async nextLightClientBlock(He){return await this.sendJsonRpc("next_light_client_block",He)}async accessKeyChanges(He,Ve){const{finality:Ye}=Ve,{blockId:Fn}=Ve;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:He,block_id:Fn,finality:Ye})}async singleAccessKeyChanges(He,Ve){const{finality:Ye}=Ve,{blockId:Fn}=Ve;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:He,block_id:Fn,finality:Ye})}async accountChanges(He,Ve){const{finality:Ye}=Ve,{blockId:Fn}=Ve;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:He,block_id:Fn,finality:Ye})}async contractStateChanges(He,Ve,Ye=""){const{finality:Fn}=Ve,{blockId:io}=Ve;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:He,key_prefix_base64:Ye,block_id:io,finality:Fn})}async contractCodeChanges(He,Ve){const{finality:Ye}=Ve,{blockId:Fn}=Ve;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:He,block_id:Fn,finality:Ye})}async gasPrice(He){return await this.sendJsonRpc("gas_price",[He])}async sendJsonRpc(He,Ve){const Ye=await(0,X.exponentialBackoff)(this.options.wait,this.options.retries,this.options.backoff,async()=>{var io;try{const $o={method:He,params:Ve,id:De++,jsonrpc:"2.0"},Jo=await(0,Se.fetchJsonRpc)(this.connection.url,$o,this.connection.headers);if(Jo.error){if(typeof Jo.error.data=="object")throw typeof Jo.error.data.error_message=="string"&&typeof Jo.error.data.error_type=="string"?new Y.TypedError(Jo.error.data.error_message,Jo.error.data.error_type):(0,W.parseRpcError)(Jo.error.data);{const rs=`[${Jo.error.code}] ${Jo.error.message}: ${Jo.error.data}`;if(Jo.error.data==="Timeout"||rs.includes("Timeout error")||rs.includes("query has timed out"))throw new Y.TypedError(rs,"TimeoutError");const Yo=(0,W.getErrorTypeFromErrorMessage)(Jo.error.data,"");throw Yo?new Y.TypedError((0,W.formatError)(Yo,Ve),Yo):new Y.TypedError(rs,Jo.error.name)}}else if(typeof((io=Jo.result)==null?void 0:io.error)=="string"){const rs=(0,W.getErrorTypeFromErrorMessage)(Jo.result.error,"");if(rs)throw new W.ServerError((0,W.formatError)(rs,Ve),rs)}return Jo}catch($o){if($o.type==="TimeoutError")return W.Logger.warn(`Retrying request to ${He} as it has timed out`,Ve),null;throw $o}}),{result:Fn}=Ye;if(typeof Fn>"u")throw new Y.TypedError(`Exceeded ${this.options.retries} attempts for request to ${He}.`,"RetriesExceeded");return Fn}}return jsonRpcProvider$3.JsonRpcProvider=qe,jsonRpcProvider$3}var failoverRpcProvider$3={},hasRequiredFailoverRpcProvider$3;function requireFailoverRpcProvider$3(){if(hasRequiredFailoverRpcProvider$3)return failoverRpcProvider$3;hasRequiredFailoverRpcProvider$3=1,Object.defineProperty(failoverRpcProvider$3,"__esModule",{value:!0}),failoverRpcProvider$3.FailoverRpcProvider=void 0;const W=requireCommonjs$8(),Y=requireCommonjs$9(),J=requireProvider$4();class X extends J.Provider{constructor(Ne){super();Kc(this,"providers");Kc(this,"currentProviderIndex");if(Ne.length===0)throw new Error("At least one provider must be specified");this.providers=Ne,this.currentProviderIndex=0}switchToNextProvider(){this.providers.length!==1&&(this.providers.length-1<=this.currentProviderIndex?this.currentProviderIndex=0:this.currentProviderIndex+=1,W.Logger.debug(`Switched to provider at the index ${this.currentProviderIndex}`))}get currentProvider(){const Ne=this.providers[this.currentProviderIndex];if(!Ne)throw new Error(`Provider wasn't found at index ${this.currentProviderIndex}`);return Ne}async withBackoff(Ne){for(let je=0;je<this.providers.length;je++)try{const ke=await Ne(this.currentProvider);if(ke)return ke}catch(ke){console.error(ke),this.switchToNextProvider()}throw new Y.TypedError(`Exceeded ${this.providers.length} providers to execute request`,"RetriesExceeded")}async status(){return this.withBackoff(Ne=>Ne.status())}async sendTransactionUntil(Ne,je){return this.withBackoff(ke=>ke.sendTransactionUntil(Ne,je))}async sendTransaction(Ne){return this.withBackoff(je=>je.sendTransaction(Ne))}async sendTransactionAsync(Ne){return this.withBackoff(je=>je.sendTransactionAsync(Ne))}async txStatus(Ne,je,ke){return this.withBackoff(De=>De.txStatus(Ne,je,ke))}async txStatusReceipts(Ne,je,ke){return this.withBackoff(De=>De.txStatusReceipts(Ne,je,ke))}async query(Ne,je){return je?this.withBackoff(ke=>ke.query(Ne,je)):this.withBackoff(ke=>ke.query(Ne))}async block(Ne){return this.withBackoff(je=>je.block(Ne))}async blockChanges(Ne){return this.withBackoff(je=>je.blockChanges(Ne))}async chunk(Ne){return this.withBackoff(je=>je.chunk(Ne))}async validators(Ne){return this.withBackoff(je=>je.validators(Ne))}async experimental_protocolConfig(Ne){return this.withBackoff(je=>je.experimental_protocolConfig(Ne))}async lightClientProof(Ne){return this.withBackoff(je=>je.lightClientProof(Ne))}async nextLightClientBlock(Ne){return this.withBackoff(je=>je.nextLightClientBlock(Ne))}async accessKeyChanges(Ne,je){return this.withBackoff(ke=>ke.accessKeyChanges(Ne,je))}async singleAccessKeyChanges(Ne,je){return this.withBackoff(ke=>ke.singleAccessKeyChanges(Ne,je))}async accountChanges(Ne,je){return this.withBackoff(ke=>ke.accountChanges(Ne,je))}async contractStateChanges(Ne,je,ke=""){return this.withBackoff(De=>De.contractStateChanges(Ne,je,ke))}async contractCodeChanges(Ne,je){return this.withBackoff(ke=>ke.contractCodeChanges(Ne,je))}async gasPrice(Ne){return this.withBackoff(je=>je.gasPrice(Ne))}}return failoverRpcProvider$3.FailoverRpcProvider=X,failoverRpcProvider$3}var hasRequiredCommonjs$3;function requireCommonjs$3(){return hasRequiredCommonjs$3||(hasRequiredCommonjs$3=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Provider=W.FailoverRpcProvider=W.JsonRpcProvider=W.exponentialBackoff=void 0;var Y=requireExponentialBackoff$1();Object.defineProperty(W,"exponentialBackoff",{enumerable:!0,get:function(){return Y.exponentialBackoff}});var J=requireJsonRpcProvider$3();Object.defineProperty(W,"JsonRpcProvider",{enumerable:!0,get:function(){return J.JsonRpcProvider}});var X=requireFailoverRpcProvider$3();Object.defineProperty(W,"FailoverRpcProvider",{enumerable:!0,get:function(){return X.FailoverRpcProvider}});var Me=requireProvider$4();Object.defineProperty(W,"Provider",{enumerable:!0,get:function(){return Me.Provider}})}(commonjs$4)),commonjs$4}var hasRequiredProvider$3;function requireProvider$3(){return hasRequiredProvider$3||(hasRequiredProvider$3=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.FinalExecutionStatusBasic=W.ExecutionStatusBasic=W.IdType=W.Provider=W.getTransactionLastResult=void 0;var Y=requireCommonjs$8();Object.defineProperty(W,"getTransactionLastResult",{enumerable:!0,get:function(){return Y.getTransactionLastResult}});var J=requireCommonjs$3();Object.defineProperty(W,"Provider",{enumerable:!0,get:function(){return J.Provider}});var X=requireCommonjs$9();Object.defineProperty(W,"IdType",{enumerable:!0,get:function(){return X.IdType}}),Object.defineProperty(W,"ExecutionStatusBasic",{enumerable:!0,get:function(){return X.ExecutionStatusBasic}}),Object.defineProperty(W,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return X.FinalExecutionStatusBasic}})}(provider$4)),provider$4}var jsonRpcProvider$2={},hasRequiredJsonRpcProvider$2;function requireJsonRpcProvider$2(){return hasRequiredJsonRpcProvider$2||(hasRequiredJsonRpcProvider$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.JsonRpcProvider=W.TypedError=W.ErrorContext=void 0;var Y=requireCommonjs$9();Object.defineProperty(W,"ErrorContext",{enumerable:!0,get:function(){return Y.ErrorContext}}),Object.defineProperty(W,"TypedError",{enumerable:!0,get:function(){return Y.TypedError}});var J=requireCommonjs$3();Object.defineProperty(W,"JsonRpcProvider",{enumerable:!0,get:function(){return J.JsonRpcProvider}})}(jsonRpcProvider$2)),jsonRpcProvider$2}var failoverRpcProvider$2={},hasRequiredFailoverRpcProvider$2;function requireFailoverRpcProvider$2(){return hasRequiredFailoverRpcProvider$2||(hasRequiredFailoverRpcProvider$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.FailoverRpcProvider=void 0;var Y=requireCommonjs$3();Object.defineProperty(W,"FailoverRpcProvider",{enumerable:!0,get:function(){return Y.FailoverRpcProvider}})}(failoverRpcProvider$2)),failoverRpcProvider$2}var hasRequiredProviders$1;function requireProviders$1(){return hasRequiredProviders$1||(hasRequiredProviders$1=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.ErrorContext=W.TypedError=W.getTransactionLastResult=W.FinalExecutionStatusBasic=W.FailoverRpcProvider=W.JsonRpcProvider=W.Provider=void 0;const Y=requireProvider$3();Object.defineProperty(W,"Provider",{enumerable:!0,get:function(){return Y.Provider}}),Object.defineProperty(W,"getTransactionLastResult",{enumerable:!0,get:function(){return Y.getTransactionLastResult}}),Object.defineProperty(W,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return Y.FinalExecutionStatusBasic}});const J=requireJsonRpcProvider$2();Object.defineProperty(W,"JsonRpcProvider",{enumerable:!0,get:function(){return J.JsonRpcProvider}}),Object.defineProperty(W,"TypedError",{enumerable:!0,get:function(){return J.TypedError}}),Object.defineProperty(W,"ErrorContext",{enumerable:!0,get:function(){return J.ErrorContext}});const X=requireFailoverRpcProvider$2();Object.defineProperty(W,"FailoverRpcProvider",{enumerable:!0,get:function(){return X.FailoverRpcProvider}})}(providers$1)),providers$1}var utils$b={},key_pair$2={},hasRequiredKey_pair$2;function requireKey_pair$2(){return hasRequiredKey_pair$2||(hasRequiredKey_pair$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.PublicKey=W.KeyType=W.KeyPairEd25519=W.KeyPair=void 0;var Y=requireCommonjs$7();Object.defineProperty(W,"KeyPair",{enumerable:!0,get:function(){return Y.KeyPair}}),Object.defineProperty(W,"KeyPairEd25519",{enumerable:!0,get:function(){return Y.KeyPairEd25519}}),Object.defineProperty(W,"KeyType",{enumerable:!0,get:function(){return Y.KeyType}}),Object.defineProperty(W,"PublicKey",{enumerable:!0,get:function(){return Y.PublicKey}})}(key_pair$2)),key_pair$2}var serialize$4={},hasRequiredSerialize$1;function requireSerialize$1(){return hasRequiredSerialize$1||(hasRequiredSerialize$1=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.base_decode=W.base_encode=W.deserialize=W.serialize=void 0;var Y=requireCjs$4();Object.defineProperty(W,"serialize",{enumerable:!0,get:function(){return Y.serialize}}),Object.defineProperty(W,"deserialize",{enumerable:!0,get:function(){return Y.deserialize}});var J=requireCommonjs$8();Object.defineProperty(W,"base_encode",{enumerable:!0,get:function(){return J.baseEncode}}),Object.defineProperty(W,"base_decode",{enumerable:!0,get:function(){return J.baseDecode}})}(serialize$4)),serialize$4}var enums$1={},hasRequiredEnums$1;function requireEnums$1(){return hasRequiredEnums$1||(hasRequiredEnums$1=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Enum=void 0;var Y=requireCommonjs$9();Object.defineProperty(W,"Enum",{enumerable:!0,get:function(){return Y.Enum}})}(enums$1)),enums$1}var format$2={},hasRequiredFormat$2;function requireFormat$2(){return hasRequiredFormat$2||(hasRequiredFormat$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.parseNearAmount=W.formatNearAmount=W.NEAR_NOMINATION_EXP=W.NEAR_NOMINATION=void 0;var Y=requireCommonjs$8();Object.defineProperty(W,"NEAR_NOMINATION",{enumerable:!0,get:function(){return Y.NEAR_NOMINATION}}),Object.defineProperty(W,"NEAR_NOMINATION_EXP",{enumerable:!0,get:function(){return Y.NEAR_NOMINATION_EXP}}),Object.defineProperty(W,"formatNearAmount",{enumerable:!0,get:function(){return Y.formatNearAmount}}),Object.defineProperty(W,"parseNearAmount",{enumerable:!0,get:function(){return Y.parseNearAmount}})}(format$2)),format$2}var rpc_errors$2={},hasRequiredRpc_errors$2;function requireRpc_errors$2(){return hasRequiredRpc_errors$2||(hasRequiredRpc_errors$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.ServerError=W.getErrorTypeFromErrorMessage=W.formatError=W.parseResultError=W.parseRpcError=void 0;var Y=requireCommonjs$8();Object.defineProperty(W,"parseRpcError",{enumerable:!0,get:function(){return Y.parseRpcError}}),Object.defineProperty(W,"parseResultError",{enumerable:!0,get:function(){return Y.parseResultError}}),Object.defineProperty(W,"formatError",{enumerable:!0,get:function(){return Y.formatError}}),Object.defineProperty(W,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return Y.getErrorTypeFromErrorMessage}}),Object.defineProperty(W,"ServerError",{enumerable:!0,get:function(){return Y.ServerError}})}(rpc_errors$2)),rpc_errors$2}var logger$4={},hasRequiredLogger$3;function requireLogger$3(){return hasRequiredLogger$3||(hasRequiredLogger$3=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Logger=void 0;var Y=requireCommonjs$8();Object.defineProperty(W,"Logger",{enumerable:!0,get:function(){return Y.Logger}})}(logger$4)),logger$4}var hasRequiredUtils$a;function requireUtils$a(){return hasRequiredUtils$a||(hasRequiredUtils$a=1,function(W){var Y=utils$b.__createBinding||(Object.create?function(Ue,Ge,He,Ve){Ve===void 0&&(Ve=He);var Ye=Object.getOwnPropertyDescriptor(Ge,He);(!Ye||("get"in Ye?!Ge.__esModule:Ye.writable||Ye.configurable))&&(Ye={enumerable:!0,get:function(){return Ge[He]}}),Object.defineProperty(Ue,Ve,Ye)}:function(Ue,Ge,He,Ve){Ve===void 0&&(Ve=He),Ue[Ve]=Ge[He]}),J=utils$b.__setModuleDefault||(Object.create?function(Ue,Ge){Object.defineProperty(Ue,"default",{enumerable:!0,value:Ge})}:function(Ue,Ge){Ue.default=Ge}),X=utils$b.__importStar||function(Ue){if(Ue&&Ue.__esModule)return Ue;var Ge={};if(Ue!=null)for(var He in Ue)He!=="default"&&Object.prototype.hasOwnProperty.call(Ue,He)&&Y(Ge,Ue,He);return J(Ge,Ue),Ge};Object.defineProperty(W,"__esModule",{value:!0}),W.Logger=W.rpc_errors=W.KeyPairEd25519=W.KeyPair=W.PublicKey=W.format=W.enums=W.serialize=W.key_pair=void 0;const Me=X(requireKey_pair$2());W.key_pair=Me;const Se=X(requireSerialize$1());W.serialize=Se;const Ne=X(requireEnums$1());W.enums=Ne;const je=X(requireFormat$2());W.format=je;const ke=X(requireRpc_errors$2());W.rpc_errors=ke;const De=requireKey_pair$2();Object.defineProperty(W,"PublicKey",{enumerable:!0,get:function(){return De.PublicKey}}),Object.defineProperty(W,"KeyPair",{enumerable:!0,get:function(){return De.KeyPair}}),Object.defineProperty(W,"KeyPairEd25519",{enumerable:!0,get:function(){return De.KeyPairEd25519}});const qe=requireLogger$3();Object.defineProperty(W,"Logger",{enumerable:!0,get:function(){return qe.Logger}})}(utils$b)),utils$b}var transaction$1={},hasRequiredTransaction$1;function requireTransaction$1(){return hasRequiredTransaction$1||(hasRequiredTransaction$1=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.transfer=W.stake=W.functionCallAccessKey=W.functionCall=W.fullAccessKey=W.deployContract=W.deleteKey=W.deleteAccount=W.createAccount=W.addKey=W.encodeTransaction=W.encodeDelegateAction=W.encodeSignedDelegate=W.Transaction=W.SignedTransaction=W.Signature=W.signTransaction=W.createTransaction=W.SCHEMA=W.Transfer=W.Stake=W.FunctionCallPermission=W.FunctionCall=W.FullAccessPermission=W.DeployContract=W.DeleteKey=W.DeleteAccount=W.CreateAccount=W.AddKey=W.AccessKeyPermission=W.AccessKey=W.Action=W.stringifyJsonOrBytes=void 0;var Y=requireCommonjs$4();Object.defineProperty(W,"stringifyJsonOrBytes",{enumerable:!0,get:function(){return Y.stringifyJsonOrBytes}}),Object.defineProperty(W,"Action",{enumerable:!0,get:function(){return Y.Action}}),Object.defineProperty(W,"AccessKey",{enumerable:!0,get:function(){return Y.AccessKey}}),Object.defineProperty(W,"AccessKeyPermission",{enumerable:!0,get:function(){return Y.AccessKeyPermission}}),Object.defineProperty(W,"AddKey",{enumerable:!0,get:function(){return Y.AddKey}}),Object.defineProperty(W,"CreateAccount",{enumerable:!0,get:function(){return Y.CreateAccount}}),Object.defineProperty(W,"DeleteAccount",{enumerable:!0,get:function(){return Y.DeleteAccount}}),Object.defineProperty(W,"DeleteKey",{enumerable:!0,get:function(){return Y.DeleteKey}}),Object.defineProperty(W,"DeployContract",{enumerable:!0,get:function(){return Y.DeployContract}}),Object.defineProperty(W,"FullAccessPermission",{enumerable:!0,get:function(){return Y.FullAccessPermission}}),Object.defineProperty(W,"FunctionCall",{enumerable:!0,get:function(){return Y.FunctionCall}}),Object.defineProperty(W,"FunctionCallPermission",{enumerable:!0,get:function(){return Y.FunctionCallPermission}}),Object.defineProperty(W,"Stake",{enumerable:!0,get:function(){return Y.Stake}}),Object.defineProperty(W,"Transfer",{enumerable:!0,get:function(){return Y.Transfer}}),Object.defineProperty(W,"SCHEMA",{enumerable:!0,get:function(){return Y.SCHEMA}}),Object.defineProperty(W,"createTransaction",{enumerable:!0,get:function(){return Y.createTransaction}}),Object.defineProperty(W,"signTransaction",{enumerable:!0,get:function(){return Y.signTransaction}}),Object.defineProperty(W,"Signature",{enumerable:!0,get:function(){return Y.Signature}}),Object.defineProperty(W,"SignedTransaction",{enumerable:!0,get:function(){return Y.SignedTransaction}}),Object.defineProperty(W,"Transaction",{enumerable:!0,get:function(){return Y.Transaction}}),Object.defineProperty(W,"encodeSignedDelegate",{enumerable:!0,get:function(){return Y.encodeSignedDelegate}}),Object.defineProperty(W,"encodeDelegateAction",{enumerable:!0,get:function(){return Y.encodeDelegateAction}}),Object.defineProperty(W,"encodeTransaction",{enumerable:!0,get:function(){return Y.encodeTransaction}});const J=requireCommonjs$4(),X=(He,Ve)=>J.actionCreators.addKey(He,Ve);W.addKey=X;const Me=()=>J.actionCreators.createAccount();W.createAccount=Me;const Se=He=>J.actionCreators.deleteAccount(He);W.deleteAccount=Se;const Ne=He=>J.actionCreators.deleteKey(He);W.deleteKey=Ne;const je=He=>J.actionCreators.deployContract(He);W.deployContract=je;const ke=()=>J.actionCreators.fullAccessKey();W.fullAccessKey=ke;const De=(He,Ve,Ye,Fn,io,$o)=>J.actionCreators.functionCall(He,Ve,Ye,Fn,io,$o);W.functionCall=De;const qe=(He,Ve,Ye)=>J.actionCreators.functionCallAccessKey(He,Ve,Ye);W.functionCallAccessKey=qe;const Ue=(He,Ve)=>J.actionCreators.stake(He,Ve);W.stake=Ue;const Ge=He=>J.actionCreators.transfer(He);W.transfer=Ge}(transaction$1)),transaction$1}var validators$2={},hasRequiredValidators$2;function requireValidators$2(){return hasRequiredValidators$2||(hasRequiredValidators$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.findSeatPrice=W.diffEpochValidators=void 0;var Y=requireCommonjs$8();Object.defineProperty(W,"diffEpochValidators",{enumerable:!0,get:function(){return Y.diffEpochValidators}}),Object.defineProperty(W,"findSeatPrice",{enumerable:!0,get:function(){return Y.findSeatPrice}})}(validators$2)),validators$2}var account$3={},commonjs$2={},account$2={},utils$a={},hasRequiredUtils$9;function requireUtils$9(){if(hasRequiredUtils$9)return utils$a;hasRequiredUtils$9=1,Object.defineProperty(utils$a,"__esModule",{value:!0}),utils$a.viewFunction=utils$a.viewState=utils$a.encodeJSContractArgs=utils$a.validateArgs=void 0;const W=requireCommonjs$9(),Y=requireCommonjs$8();function J(ke){return JSON.parse(Buffer.from(ke).toString())}function X(ke){return Buffer.from(JSON.stringify(ke))}function Me(ke){if(!(ke.byteLength!==void 0&&ke.byteLength===ke.length)&&(Array.isArray(ke)||typeof ke!="object"))throw new W.PositionalArgsError}utils$a.validateArgs=Me;function Se(ke,De,qe){return Buffer.concat([Buffer.from(ke),Buffer.from([0]),Buffer.from(De),Buffer.from([0]),Buffer.from(qe)])}utils$a.encodeJSContractArgs=Se;async function Ne(ke,De,qe,Ue={finality:"optimistic"}){const{values:Ge}=await ke.provider.query({request_type:"view_state",...Ue,account_id:De,prefix_base64:Buffer.from(qe).toString("base64")});return Ge.map(({key:He,value:Ve})=>({key:Buffer.from(He,"base64"),value:Buffer.from(Ve,"base64")}))}utils$a.viewState=Ne;async function je(ke,{contractId:De,methodName:qe,args:Ue={},parse:Ge=J,stringify:He=X,jsContract:Ve=!1,blockQuery:Ye={finality:"optimistic"}}){let Fn;Me(Ue),Ve?Fn=Se(De,qe,Object.keys(Ue).length>0?JSON.stringify(Ue):""):Fn=He(Ue);const io=await ke.provider.query({request_type:"call_function",...Ye,account_id:Ve?ke.jsvmAccountId:De,method_name:Ve?"view_js_contract":qe,args_base64:Fn.toString("base64")});return io.logs&&(0,Y.printTxOutcomeLogs)({contractId:De,logs:io.logs}),io.result&&io.result.length>0&&Ge(Buffer.from(io.result))}return utils$a.viewFunction=je,utils$a}var hasRequiredAccount$3;function requireAccount$3(){if(hasRequiredAccount$3)return account$2;hasRequiredAccount$3=1,Object.defineProperty(account$2,"__esModule",{value:!0}),account$2.Account=void 0;const W=requireCommonjs$7(),Y=requireCommonjs$3(),J=requireCommonjs$4(),X=requireCommonjs$9(),Me=requireCommonjs$8(),Se=requireUtils$9(),{addKey:Ne,createAccount:je,deleteAccount:ke,deleteKey:De,deployContract:qe,fullAccessKey:Ue,functionCall:Ge,functionCallAccessKey:He,stake:Ve,transfer:Ye}=J.actionCreators,Fn=12,io=500,$o=1.5;class Jo{constructor(Yo,zo){Kc(this,"connection");Kc(this,"accountId");Kc(this,"accessKeyByPublicKeyCache",{});this.connection=Yo,this.accountId=zo}getConnection(){return this.connection}async state(){return this.connection.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}async signTransaction(Yo,zo){const jo=await this.findAccessKey(Yo,zo);if(!jo)throw new X.TypedError(`Can not sign transactions for account ${this.accountId} on network ${this.connection.networkId}, no matching key pair exists for this account`,"KeyNotFound");const{accessKey:Vo}=jo,us=(await this.connection.provider.block({finality:"final"})).header.hash,is=Vo.nonce+1n;return await(0,J.signTransaction)(Yo,is,zo,(0,Me.baseDecode)(us),this.connection.signer,this.accountId,this.connection.networkId)}async signAndSendTransaction({receiverId:Yo,actions:zo,returnError:jo}){let Vo,os;const us=await(0,Y.exponentialBackoff)(io,Fn,$o,async()=>{[Vo,os]=await this.signTransaction(Yo,zo);const is=os.transaction.publicKey;try{return await this.connection.provider.sendTransaction(os)}catch(Lo){if(Lo.type==="InvalidNonce")return Me.Logger.warn(`Retrying transaction ${Yo}:${(0,Me.baseEncode)(Vo)} with new nonce.`),delete this.accessKeyByPublicKeyCache[is.toString()],null;if(Lo.type==="Expired")return Me.Logger.warn(`Retrying transaction ${Yo}:${(0,Me.baseEncode)(Vo)} due to expired block hash`),null;throw Lo.context=new X.ErrorContext((0,Me.baseEncode)(Vo)),Lo}});if(!us)throw new X.TypedError("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");if((0,Me.printTxOutcomeLogsAndFailures)({contractId:os.transaction.receiverId,outcome:us}),!jo&&typeof us.status=="object"&&typeof us.status.Failure=="object"&&us.status.Failure!==null)throw us.status.Failure.error_message&&us.status.Failure.error_type?new X.TypedError(`Transaction ${us.transaction_outcome.id} failed. ${us.status.Failure.error_message}`,us.status.Failure.error_type):(0,Me.parseResultError)(us);return us}async findAccessKey(Yo,zo){const jo=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);if(!jo)throw new X.TypedError(`no matching key pair found in ${this.connection.signer}`,"PublicKeyNotFound");const Vo=this.accessKeyByPublicKeyCache[jo.toString()];if(Vo!==void 0)return{publicKey:jo,accessKey:Vo};try{const os=await this.connection.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:jo.toString(),finality:"optimistic"}),us={...os,nonce:BigInt(os.nonce||0)};return this.accessKeyByPublicKeyCache[jo.toString()]?{publicKey:jo,accessKey:this.accessKeyByPublicKeyCache[jo.toString()]}:(this.accessKeyByPublicKeyCache[jo.toString()]=us,{publicKey:jo,accessKey:us})}catch(os){if(os.type=="AccessKeyDoesNotExist")return null;throw os}}async createAndDeployContract(Yo,zo,jo,Vo){const os=Ue();return await this.signAndSendTransaction({receiverId:Yo,actions:[je(),Ye(Vo),Ne(W.PublicKey.from(zo),os),qe(jo)]}),new Jo(this.connection,Yo)}async sendMoney(Yo,zo){return this.signAndSendTransaction({receiverId:Yo,actions:[Ye(zo)]})}async createAccount(Yo,zo,jo){const Vo=Ue();return this.signAndSendTransaction({receiverId:Yo,actions:[je(),Ye(jo),Ne(W.PublicKey.from(zo),Vo)]})}async deleteAccount(Yo){return Me.Logger.log("Deleting an account does not automatically transfer NFTs and FTs to the beneficiary address. Ensure to transfer assets before deleting."),this.signAndSendTransaction({receiverId:this.accountId,actions:[ke(Yo)]})}async deployContract(Yo){return this.signAndSendTransaction({receiverId:this.accountId,actions:[qe(Yo)]})}encodeJSContractArgs(Yo,zo,jo){return Buffer.concat([Buffer.from(Yo),Buffer.from([0]),Buffer.from(zo),Buffer.from([0]),Buffer.from(jo)])}async functionCall({contractId:Yo,methodName:zo,args:jo={},gas:Vo=Me.DEFAULT_FUNCTION_CALL_GAS,attachedDeposit:os,walletMeta:us,walletCallbackUrl:is,stringify:Lo,jsContract:Fe}){this.validateArgs(jo);let Ke;if(Fe)Ke=["call_js_contract",this.encodeJSContractArgs(Yo,zo,JSON.stringify(jo)),Vo,os,null,!0];else{const Je=Lo===void 0?J.stringifyJsonOrBytes:Lo;Ke=[zo,jo,Vo,os,Je,!1]}return this.signAndSendTransaction({receiverId:Fe?this.connection.jsvmAccountId:Yo,actions:[Ge.apply(void 0,Ke)],walletMeta:us,walletCallbackUrl:is})}async addKey(Yo,zo,jo,Vo){jo||(jo=[]),Array.isArray(jo)||(jo=[jo]);let os;return zo?os=He(zo,jo,Vo):os=Ue(),this.signAndSendTransaction({receiverId:this.accountId,actions:[Ne(W.PublicKey.from(Yo),os)]})}async deleteKey(Yo){return this.signAndSendTransaction({receiverId:this.accountId,actions:[De(W.PublicKey.from(Yo))]})}async stake(Yo,zo){return this.signAndSendTransaction({receiverId:this.accountId,actions:[Ve(zo,W.PublicKey.from(Yo))]})}async signedDelegate({actions:Yo,blockHeightTtl:zo,receiverId:jo}){const{provider:Vo,signer:os}=this.connection,{header:us}=await Vo.block({finality:"final"}),{accessKey:is,publicKey:Lo}=await this.findAccessKey(null,null),Fe=(0,J.buildDelegateAction)({actions:Yo,maxBlockHeight:BigInt(us.height)+BigInt(zo),nonce:BigInt(is.nonce)+1n,publicKey:Lo,receiverId:jo,senderId:this.accountId}),{signedDelegateAction:Ke}=await(0,J.signDelegateAction)({delegateAction:Fe,signer:{sign:async Je=>{const{signature:wi}=await os.signMessage(Je,Fe.senderId,this.connection.networkId);return wi}}});return Ke}validateArgs(Yo){if(!(Yo.byteLength!==void 0&&Yo.byteLength===Yo.length)&&(Array.isArray(Yo)||typeof Yo!="object"))throw new X.PositionalArgsError}async viewFunction(Yo){return await(0,Se.viewFunction)(this.connection,Yo)}async viewState(Yo,zo={finality:"optimistic"}){return await(0,Se.viewState)(this.connection,this.accountId,Yo,zo)}async getAccessKeys(){var zo;const Yo=await this.connection.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:"optimistic"});return(zo=Yo==null?void 0:Yo.keys)==null?void 0:zo.map(jo=>({...jo,access_key:{...jo.access_key,nonce:BigInt(jo.access_key.nonce)}}))}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(jo=>jo.access_key.permission!=="FullAccess").map(jo=>{const Vo=jo.access_key.permission;return{contractId:Vo.FunctionCall.receiver_id,amount:Vo.FunctionCall.allowance,publicKey:jo.public_key}})}}async getAccountBalance(){const Yo=await this.connection.provider.experimental_protocolConfig({finality:"final"}),zo=await this.state(),jo=BigInt(Yo.runtime_config.storage_amount_per_byte),Vo=BigInt(zo.storage_usage)*jo,os=BigInt(zo.locked),us=BigInt(zo.amount)+os,is=us-(os>Vo?os:Vo);return{total:us.toString(),stateStaked:Vo.toString(),staked:os.toString(),available:is.toString()}}async getActiveDelegatedStakeBalance(){const Yo=await this.connection.provider.block({finality:"final"}),zo=Yo.header.hash,jo=Yo.header.epoch_id,{current_validators:Vo,next_validators:os,current_proposals:us}=await this.connection.provider.validators(jo),is=new Set;[...Vo,...os,...us].forEach(mo=>is.add(mo.account_id));const Lo=[...is],Fe=Lo.map(mo=>this.viewFunction({contractId:mo,methodName:"get_account_total_balance",args:{account_id:this.accountId},blockQuery:{blockId:zo}})),Ke=await Promise.allSettled(Fe);if(Ke.some(mo=>mo.status==="rejected"&&mo.reason.type==="TimeoutError"))throw new Error("Failed to get delegated stake balance");const wi=Ke.reduce((mo,Go,Qo)=>{const Ao=Lo[Qo];if(Go.status==="fulfilled"){const Mn=BigInt(Go.value);if(Mn!==0n)return{...mo,stakedValidators:[...mo.stakedValidators,{validatorId:Ao,amount:Mn.toString()}],total:mo.total+Mn}}return Go.status==="rejected"?{...mo,failedValidators:[...mo.failedValidators,{validatorId:Ao,error:Go.reason}]}:mo},{stakedValidators:[],failedValidators:[],total:0n});return{...wi,total:wi.total.toString()}}}return account$2.Account=Jo,account$2}var account_2fa$1={},account_multisig$3={},constants$5={},hasRequiredConstants$5;function requireConstants$5(){if(hasRequiredConstants$5)return constants$5;hasRequiredConstants$5=1,Object.defineProperty(constants$5,"__esModule",{value:!0}),constants$5.MULTISIG_CONFIRM_METHODS=constants$5.MULTISIG_CHANGE_METHODS=constants$5.MULTISIG_DEPOSIT=constants$5.MULTISIG_GAS=constants$5.MULTISIG_ALLOWANCE=constants$5.MULTISIG_STORAGE_KEY=void 0;const W=requireCommonjs$8();return constants$5.MULTISIG_STORAGE_KEY="__multisigRequest",constants$5.MULTISIG_ALLOWANCE=BigInt((0,W.parseNearAmount)("1")),constants$5.MULTISIG_GAS=100000000000000n,constants$5.MULTISIG_DEPOSIT=0n,constants$5.MULTISIG_CHANGE_METHODS=["add_request","add_request_and_confirm","delete_request","confirm"],constants$5.MULTISIG_CONFIRM_METHODS=["confirm"],constants$5}var types$4={},hasRequiredTypes$4;function requireTypes$4(){if(hasRequiredTypes$4)return types$4;hasRequiredTypes$4=1,Object.defineProperty(types$4,"__esModule",{value:!0}),types$4.MultisigStateStatus=types$4.MultisigDeleteRequestRejectionError=void 0;var W;(function(J){J.CANNOT_DESERIALIZE_STATE="Cannot deserialize the contract state",J.MULTISIG_NOT_INITIALIZED="Smart contract panicked: Multisig contract should be initialized before usage",J.NO_SUCH_REQUEST="Smart contract panicked: panicked at 'No such request: either wrong number or already confirmed'",J.REQUEST_COOLDOWN_ERROR="Request cannot be deleted immediately after creation.",J.METHOD_NOT_FOUND="Contract method is not found"})(W||(types$4.MultisigDeleteRequestRejectionError=W={}));var Y;return function(J){J[J.INVALID_STATE=0]="INVALID_STATE",J[J.STATE_NOT_INITIALIZED=1]="STATE_NOT_INITIALIZED",J[J.VALID_STATE=2]="VALID_STATE",J[J.UNKNOWN_STATE=3]="UNKNOWN_STATE"}(Y||(types$4.MultisigStateStatus=Y={})),types$4}var hasRequiredAccount_multisig$3;function requireAccount_multisig$3(){if(hasRequiredAccount_multisig$3)return account_multisig$3;hasRequiredAccount_multisig$3=1,Object.defineProperty(account_multisig$3,"__esModule",{value:!0}),account_multisig$3.AccountMultisig=void 0;const W=requireCommonjs$4(),Y=requireCommonjs$8(),J=requireAccount$3(),X=requireConstants$5(),Me=requireTypes$4(),{deployContract:Se,functionCall:Ne}=W.actionCreators;var je;(function(Ge){Ge[Ge.INVALID_CODE=0]="INVALID_CODE",Ge[Ge.VALID_CODE=1]="VALID_CODE",Ge[Ge.UNKNOWN_CODE=2]="UNKNOWN_CODE"})(je||(je={}));const ke={[X.MULTISIG_STORAGE_KEY]:null};class De extends J.Account{constructor(Ve,Ye,Fn){super(Ve,Ye);Kc(this,"storage");Kc(this,"onAddRequestResult");this.storage=Fn.storage,this.onAddRequestResult=Fn.onAddRequestResult}async signAndSendTransactionWithAccount(Ve,Ye){return super.signAndSendTransaction({receiverId:Ve,actions:Ye})}async signAndSendTransaction({receiverId:Ve,actions:Ye}){const{accountId:Fn}=this,io=Buffer.from(JSON.stringify({request:{receiver_id:Ve,actions:Ue(Ye,Fn,Ve)}}));let $o;try{$o=await super.signAndSendTransaction({receiverId:Fn,actions:[Ne("add_request_and_confirm",io,X.MULTISIG_GAS,X.MULTISIG_DEPOSIT)]})}catch(rs){if(rs.toString().includes("Account has too many active requests. Confirm or delete some"))return await this.deleteUnconfirmedRequests(),await this.signAndSendTransaction({receiverId:Ve,actions:Ye});throw rs}if(!$o.status)throw new Error("Request failed");const Jo={...$o.status};if(!Jo.SuccessValue||typeof Jo.SuccessValue!="string")throw new Error("Request failed");return this.setRequest({accountId:Fn,actions:Ye,requestId:parseInt(Buffer.from(Jo.SuccessValue,"base64").toString("ascii"),10)}),this.onAddRequestResult&&await this.onAddRequestResult($o),this.deleteUnconfirmedRequests(),$o}async checkMultisigCodeAndStateStatus(Ve){const Fn=Ve?je.UNKNOWN_CODE:je.VALID_CODE;try{return Ve?await super.signAndSendTransaction({receiverId:this.accountId,actions:[Se(Ve),Ne("delete_request",{request_id:4294967295},X.MULTISIG_GAS,X.MULTISIG_DEPOSIT)]}):await this.deleteRequest(4294967295),{codeStatus:je.VALID_CODE,stateStatus:Me.MultisigStateStatus.VALID_STATE}}catch(io){if(new RegExp(Me.MultisigDeleteRequestRejectionError.CANNOT_DESERIALIZE_STATE).test(io&&io.kind&&io.kind.ExecutionError))return{codeStatus:Fn,stateStatus:Me.MultisigStateStatus.INVALID_STATE};if(new RegExp(Me.MultisigDeleteRequestRejectionError.MULTISIG_NOT_INITIALIZED).test(io&&io.kind&&io.kind.ExecutionError))return{codeStatus:Fn,stateStatus:Me.MultisigStateStatus.STATE_NOT_INITIALIZED};if(new RegExp(Me.MultisigDeleteRequestRejectionError.NO_SUCH_REQUEST).test(io&&io.kind&&io.kind.ExecutionError))return{codeStatus:Fn,stateStatus:Me.MultisigStateStatus.VALID_STATE};if(new RegExp(Me.MultisigDeleteRequestRejectionError.METHOD_NOT_FOUND).test(io&&io.message))return{codeStatus:je.INVALID_CODE,stateStatus:Me.MultisigStateStatus.UNKNOWN_STATE};throw io}}deleteRequest(Ve){return super.signAndSendTransaction({receiverId:this.accountId,actions:[Ne("delete_request",{request_id:Ve},X.MULTISIG_GAS,X.MULTISIG_DEPOSIT)]})}async deleteAllRequests(){const Ve=await this.getRequestIds();Ve.length&&await Promise.all(Ve.map(Ye=>this.deleteRequest(Ye)))}async deleteUnconfirmedRequests(){const Ve=await this.getRequestIds(),{requestId:Ye}=this.getRequest();for(const Fn of Ve)if(Fn!=Ye)try{await super.signAndSendTransaction({receiverId:this.accountId,actions:[Ne("delete_request",{request_id:Fn},X.MULTISIG_GAS,X.MULTISIG_DEPOSIT)]})}catch{Y.Logger.warn("Attempt to delete an earlier request before 15 minutes failed. Will try again.")}}async getRequestIds(){return this.viewFunction({contractId:this.accountId,methodName:"list_request_ids"})}getRequest(){return this.storage?JSON.parse(this.storage.getItem(X.MULTISIG_STORAGE_KEY)||"{}"):ke[X.MULTISIG_STORAGE_KEY]}setRequest(Ve){if(this.storage)return this.storage.setItem(X.MULTISIG_STORAGE_KEY,JSON.stringify(Ve));ke[X.MULTISIG_STORAGE_KEY]=Ve}}account_multisig$3.AccountMultisig=De;const qe=Ge=>Ge.toString().replace("ed25519:",""),Ue=(Ge,He,Ve)=>Ge.map(Ye=>{const Fn=Ye.enum,{gas:io,publicKey:$o,methodName:Jo,args:rs,deposit:Yo,accessKey:zo,code:jo}=Ye[Fn],Vo={type:Fn[0].toUpperCase()+Fn.substr(1),gas:io&&io.toString()||void 0,public_key:$o&&qe($o)||void 0,method_name:Jo,args:rs&&Buffer.from(rs).toString("base64")||void 0,code:jo&&Buffer.from(jo).toString("base64")||void 0,amount:Yo&&Yo.toString()||void 0,deposit:Yo&&Yo.toString()||"0",permission:void 0};if(zo&&(Ve===He&&zo.permission.enum!=="fullAccess"&&(Vo.permission={receiver_id:He,allowance:X.MULTISIG_ALLOWANCE.toString(),method_names:X.MULTISIG_CHANGE_METHODS}),zo.permission.enum==="functionCall")){const{receiverId:os,methodNames:us,allowance:is}=zo.permission.functionCall;Vo.permission={receiver_id:os,allowance:is&&is.toString()||void 0,method_names:us}}return Vo});return account_multisig$3}var hasRequiredAccount_2fa$1;function requireAccount_2fa$1(){if(hasRequiredAccount_2fa$1)return account_2fa$1;hasRequiredAccount_2fa$1=1;var W=account_2fa$1.__importDefault||function(io){return io&&io.__esModule?io:{default:io}};Object.defineProperty(account_2fa$1,"__esModule",{value:!0}),account_2fa$1.Account2FA=void 0;const Y=requireCommonjs$7(),J=requireCommonjs$9(),X=requireCommonjs$4(),Me=requireCommonjs$8(),Se=W(requireBrowser$4()),Ne=requireAccount_multisig$3(),je=requireConstants$5(),ke=requireTypes$4(),{addKey:De,deleteKey:qe,deployContract:Ue,fullAccessKey:Ge,functionCall:He,functionCallAccessKey:Ve}=X.actionCreators;class Ye extends Ne.AccountMultisig{constructor(Jo,rs,Yo){super(Jo,rs,Yo);Kc(this,"sendCode");Kc(this,"getCode");Kc(this,"verifyCode");Kc(this,"onConfirmResult");Kc(this,"helperUrl","https://helper.testnet.near.org");this.helperUrl=Yo.helperUrl||this.helperUrl,this.storage=Yo.storage,this.sendCode=Yo.sendCode||this.sendCodeDefault,this.getCode=Yo.getCode||this.getCodeDefault,this.verifyCode=Yo.verifyCode||this.verifyCodeDefault,this.onConfirmResult=Yo.onConfirmResult}async signAndSendTransaction({receiverId:Jo,actions:rs}){await super.signAndSendTransaction({receiverId:Jo,actions:rs}),await this.sendCode();const Yo=await this.promptAndVerify();return this.onConfirmResult&&await this.onConfirmResult(Yo),Yo}async deployMultisig(Jo){const{accountId:rs}=this,Yo=(await this.getRecoveryMethods()).data.filter(({kind:Lo,publicKey:Fe})=>(Lo==="phrase"||Lo==="ledger")&&Fe!==null).map(Lo=>Lo.publicKey),zo=(await this.getAccessKeys()).filter(({public_key:Lo,access_key:{permission:Fe}})=>Fe==="FullAccess"&&!Yo.includes(Lo)).map(Lo=>Lo.public_key).map(Fn),jo=Fn((await this.postSignedJson("/2fa/getAccessKey",{accountId:rs})).publicKey),Vo=Buffer.from(JSON.stringify({num_confirmations:2})),os=[...zo.map(Lo=>qe(Lo)),...zo.map(Lo=>De(Lo,Ve(rs,je.MULTISIG_CHANGE_METHODS,null))),De(jo,Ve(rs,je.MULTISIG_CONFIRM_METHODS,null)),Ue(Jo)],us=os.concat(He("new",Vo,je.MULTISIG_GAS,je.MULTISIG_DEPOSIT));Me.Logger.log("deploying multisig contract for",rs);const{stateStatus:is}=await this.checkMultisigCodeAndStateStatus(Jo);switch(is){case ke.MultisigStateStatus.STATE_NOT_INITIALIZED:return await super.signAndSendTransactionWithAccount(rs,us);case ke.MultisigStateStatus.VALID_STATE:return await super.signAndSendTransactionWithAccount(rs,os);case ke.MultisigStateStatus.INVALID_STATE:throw new J.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState");default:throw new J.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown")}}async disableWithFAK({contractBytes:Jo,cleanupContractBytes:rs}){let Yo=[];rs&&(await this.deleteAllRequests().catch(os=>os),Yo=await this.get2faDisableCleanupActions(rs));const zo=await this.get2faDisableKeyConversionActions(),jo=[...Yo,...zo,Ue(Jo)],Vo=await this.findAccessKey(this.accountId,jo);if(Vo&&Vo.accessKey&&Vo.accessKey.permission!=="FullAccess")throw new J.TypedError("No full access key found in keystore. Unable to bypass multisig","NoFAKFound");return this.signAndSendTransactionWithAccount(this.accountId,jo)}async get2faDisableCleanupActions(Jo){const rs=await this.viewState("").catch(zo=>{const jo=zo.cause&&zo.cause.name;if(jo=="NO_CONTRACT_CODE")return[];throw jo=="TOO_LARGE_CONTRACT_STATE"?new J.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState"):zo}),Yo=rs.map(({key:zo})=>zo.toString("base64"));return rs.length?[Ue(Jo),He("clean",{keys:Yo},je.MULTISIG_GAS,0n)]:[]}async get2faDisableKeyConversionActions(){const{accountId:Jo}=this,Yo=(await this.getAccessKeys()).filter(({access_key:jo})=>jo.permission!=="FullAccess").filter(({access_key:jo})=>{const Vo=jo.permission.FunctionCall;return Vo.receiver_id===Jo&&Vo.method_names.length===4&&Vo.method_names.includes("add_request_and_confirm")}),zo=Y.PublicKey.from((await this.postSignedJson("/2fa/getAccessKey",{accountId:Jo})).publicKey);return[qe(zo),...Yo.map(({public_key:jo})=>qe(Y.PublicKey.from(jo))),...Yo.map(({public_key:jo})=>De(Y.PublicKey.from(jo),Ge()))]}async disable(Jo,rs){const{stateStatus:Yo}=await this.checkMultisigCodeAndStateStatus();if(Yo!==ke.MultisigStateStatus.VALID_STATE&&Yo!==ke.MultisigStateStatus.STATE_NOT_INITIALIZED)throw new J.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown");let zo;await this.deleteAllRequests().catch(os=>zo=os);const Vo=[...await this.get2faDisableCleanupActions(rs).catch(os=>{throw os.type==="ContractHasExistingState"&&zo||os}),...await this.get2faDisableKeyConversionActions(),Ue(Jo)];return Me.Logger.log("disabling 2fa for",this.accountId),await this.signAndSendTransaction({receiverId:this.accountId,actions:Vo})}async sendCodeDefault(){const{accountId:Jo}=this,{requestId:rs}=this.getRequest(),Yo=await this.get2faMethod();return await this.postSignedJson("/2fa/send",{accountId:Jo,method:Yo,requestId:rs}),rs}async getCodeDefault(){throw new Error('There is no getCode callback provided. Please provide your own in AccountMultisig constructor options. It has a parameter method where method.kind is "email" or "phone".')}async promptAndVerify(){const Jo=await this.get2faMethod(),rs=await this.getCode(Jo);try{return await this.verifyCode(rs)}catch(Yo){if(Me.Logger.warn("Error validating security code:",Yo),Yo.toString().includes("invalid 2fa code provided")||Yo.toString().includes("2fa code not valid"))return await this.promptAndVerify();throw Yo}}async verifyCodeDefault(Jo){const{accountId:rs}=this,Yo=this.getRequest();if(!Yo)throw new Error("no request pending");const{requestId:zo}=Yo;return await this.postSignedJson("/2fa/verify",{accountId:rs,securityCode:Jo,requestId:zo})}async getRecoveryMethods(){const{accountId:Jo}=this;return{accountId:Jo,data:await this.postSignedJson("/account/recoveryMethods",{accountId:Jo})}}async get2faMethod(){let{data:Jo}=await this.getRecoveryMethods();if(Jo&&Jo.length&&(Jo=Jo.find(zo=>zo.kind.indexOf("2fa-")===0)),!Jo)return null;const{kind:rs,detail:Yo}=Jo;return{kind:rs,detail:Yo}}async signatureFor(){const{accountId:Jo}=this,Yo=(await this.connection.provider.block({finality:"final"})).header.height.toString(),zo=await this.connection.signer.signMessage(Buffer.from(Yo),Jo,this.connection.networkId),jo=Buffer.from(zo.signature).toString("base64");return{blockNumber:Yo,blockNumberSignature:jo}}async postSignedJson(Jo,rs){return await(0,Se.default)(this.helperUrl+Jo,{body:JSON.stringify({...rs,...await this.signatureFor()}),method:"POST"})}}account_2fa$1.Account2FA=Ye;const Fn=io=>Y.PublicKey.from(io);return account_2fa$1}var account_creator$3={},hasRequiredAccount_creator$3;function requireAccount_creator$3(){if(hasRequiredAccount_creator$3)return account_creator$3;hasRequiredAccount_creator$3=1;var W=account_creator$3.__importDefault||function(Se){return Se&&Se.__esModule?Se:{default:Se}};Object.defineProperty(account_creator$3,"__esModule",{value:!0}),account_creator$3.UrlAccountCreator=account_creator$3.LocalAccountCreator=account_creator$3.AccountCreator=void 0;const Y=W(requireBrowser$4());class J{}account_creator$3.AccountCreator=J;class X extends J{constructor(je,ke){super();Kc(this,"masterAccount");Kc(this,"initialBalance");this.masterAccount=je,this.initialBalance=ke}async createAccount(je,ke){await this.masterAccount.createAccount(je,ke,this.initialBalance)}}account_creator$3.LocalAccountCreator=X;class Me extends J{constructor(je,ke){super();Kc(this,"connection");Kc(this,"helperUrl");this.connection=je,this.helperUrl=ke}async createAccount(je,ke){await(0,Y.default)(`${this.helperUrl}/account`,{body:JSON.stringify({newAccountId:je,newAccountPublicKey:ke.toString()}),method:"POST"})}}return account_creator$3.UrlAccountCreator=Me,account_creator$3}var connection$3={},commonjs$1={},in_memory_signer$1={},signer$3={},hasRequiredSigner$3;function requireSigner$3(){if(hasRequiredSigner$3)return signer$3;hasRequiredSigner$3=1,Object.defineProperty(signer$3,"__esModule",{value:!0}),signer$3.Signer=void 0;class W{}return signer$3.Signer=W,signer$3}var hasRequiredIn_memory_signer$1;function requireIn_memory_signer$1(){if(hasRequiredIn_memory_signer$1)return in_memory_signer$1;hasRequiredIn_memory_signer$1=1,Object.defineProperty(in_memory_signer$1,"__esModule",{value:!0}),in_memory_signer$1.InMemorySigner=void 0;const W=requireCommonjs$7(),Y=requireCommonjs$6(),J=requireSha256$3(),X=requireSigner$3();class Me extends X.Signer{constructor(je){super();Kc(this,"keyStore");this.keyStore=je}static async fromKeyPair(je,ke,De){const qe=new Y.InMemoryKeyStore;return await qe.setKey(je,ke,De),new Me(qe)}async createKey(je,ke,De){const qe=De===W.KeyType.SECP256K1?W.KeyPair.fromRandom("secp256k1"):W.KeyPair.fromRandom("ed25519");return await this.keyStore.setKey(ke,je,qe),qe.getPublicKey()}async getPublicKey(je,ke){const De=await this.keyStore.getKey(ke,je);return De===null?null:De.getPublicKey()}async signMessage(je,ke,De){const qe=new Uint8Array((0,J.sha256)(je));if(!ke)throw new Error("InMemorySigner requires provided account id");const Ue=await this.keyStore.getKey(De,ke);if(Ue===null)throw new Error(`Key for ${ke} not found in ${De}`);return Ue.sign(qe)}toString(){return`InMemorySigner(${this.keyStore})`}}return in_memory_signer$1.InMemorySigner=Me,in_memory_signer$1}var hasRequiredCommonjs$2;function requireCommonjs$2(){return hasRequiredCommonjs$2||(hasRequiredCommonjs$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Signer=W.InMemorySigner=void 0;var Y=requireIn_memory_signer$1();Object.defineProperty(W,"InMemorySigner",{enumerable:!0,get:function(){return Y.InMemorySigner}});var J=requireSigner$3();Object.defineProperty(W,"Signer",{enumerable:!0,get:function(){return J.Signer}})}(commonjs$1)),commonjs$1}var hasRequiredConnection$3;function requireConnection$3(){if(hasRequiredConnection$3)return connection$3;hasRequiredConnection$3=1,Object.defineProperty(connection$3,"__esModule",{value:!0}),connection$3.Connection=void 0;const W=requireCommonjs$2(),Y=requireCommonjs$3();function J(Se){switch(Se.type){case void 0:return Se;case"JsonRpcProvider":return new Y.JsonRpcProvider({...Se.args});case"FailoverRpcProvider":{const Ne=((Se==null?void 0:Se.args)||[]).map(je=>new Y.JsonRpcProvider(je));return new Y.FailoverRpcProvider(Ne)}default:throw new Error(`Unknown provider type ${Se.type}`)}}function X(Se){switch(Se.type){case void 0:return Se;case"InMemorySigner":return new W.InMemorySigner(Se.keyStore);default:throw new Error(`Unknown signer type ${Se.type}`)}}class Me{constructor(Ne,je,ke,De){Kc(this,"networkId");Kc(this,"provider");Kc(this,"signer");Kc(this,"jsvmAccountId");this.networkId=Ne,this.provider=je,this.signer=ke,this.jsvmAccountId=De}getConnection(){return this}static fromConfig(Ne){const je=J(Ne.provider),ke=X(Ne.signer);return new Me(Ne.networkId,je,ke,Ne.jsvmAccountId)}}return connection$3.Connection=Me,connection$3}var contract$3={},localViewExecution$1={},storage$1={},hasRequiredStorage$1;function requireStorage$1(){if(hasRequiredStorage$1)return storage$1;hasRequiredStorage$1=1,Object.defineProperty(storage$1,"__esModule",{value:!0}),storage$1.Storage=void 0;const W=requireLru(),J=class J{constructor(Me={max:J.MAX_ELEMENTS}){Kc(this,"cache");Kc(this,"blockHeights");this.cache=new W.LRUMap(Me.max),this.blockHeights=new Map}load(Me){if(!("blockId"in Me))return;let Ne=Me.blockId;return Ne.toString().length==44&&(Ne=this.blockHeights.get(Ne.toString())),this.cache.get(Ne)}save(Me,{blockHeight:Se,blockTimestamp:Ne,contractCode:je,contractState:ke}){this.blockHeights.set(Me,Se),this.cache.set(Se,{blockHeight:Se,blockTimestamp:Ne,contractCode:je,contractState:ke})}};Kc(J,"MAX_ELEMENTS",100);let Y=J;return storage$1.Storage=Y,storage$1}var runtime$1={},hasRequiredRuntime$1;function requireRuntime$1(){if(hasRequiredRuntime$1)return runtime$1;hasRequiredRuntime$1=1,Object.defineProperty(runtime$1,"__esModule",{value:!0}),runtime$1.Runtime=void 0;const W=requireSha256$3(),Y=Me=>()=>{throw new Error("method not implemented: "+Me)},J=Me=>()=>{throw new Error("method not available for view calls: "+Me)};class X{constructor({contractCode:Se,...Ne}){Kc(this,"context");Kc(this,"wasm");Kc(this,"memory");Kc(this,"registers");Kc(this,"logs");Kc(this,"result");this.context=Ne,this.wasm=this.prepareWASM(Buffer.from(Se,"base64")),this.memory=new WebAssembly.Memory({initial:1024,maximum:2048}),this.registers={},this.logs=[],this.result=Buffer.from([])}readUTF16CStr(Se){const Ne=[],je=new Uint16Array(this.memory.buffer);let ke=Number(Se)/2;for(;je[ke]!=0;)Ne.push(je[ke]),ke++;return Buffer.from(Uint16Array.from(Ne).buffer).toString("ucs2")}readUTF8CStr(Se,Ne){const je=[],ke=new Uint8Array(this.memory.buffer);let De=Number(Ne);for(let qe=0;qe<Se&&ke[De]!=0;qe++)je.push(ke[De]),De++;return Buffer.from(je).toString("utf8")}storageRead(Se,Ne){const je=Buffer.from(new Uint8Array(this.memory.buffer,Number(Ne),Number(Se))),ke=this.context.contractState.filter(De=>Buffer.compare(De.key,je)===0).map(De=>De.value);return ke.length===0?null:ke.length>1?ke:ke[0]}prepareWASM(Se){const Ne=[];if(Se.subarray(0,4).toString("utf8")!=="\0asm")throw new Error("Invalid magic number");const ke=Se.readUInt32LE(4);if(ke!=1)throw new Error("Invalid version: "+ke);let De=8;Ne.push(Se.subarray(0,De));function qe(){let Ye=0,Fn=0,io;do io=Se[De++],Ye|=(io&127)<<Fn,Fn+=7;while(io&128);return Ye}function Ue(){const Fn=Se[De++]&1,io=qe(),$o=Fn?qe():null;return{initial:io,max:$o}}function Ge(){const Ye=qe(),Fn=Se.subarray(De,De+Ye);return De+=Ye,Fn.toString("utf8")}function He(Ye){const Fn=[];do{let io=Ye&127;Ye>>=7,Ye!==0&&(io|=128),Fn.push(io)}while(Ye!==0);return Buffer.from(Fn)}function Ve(Ye){const Fn=Buffer.from(Ye,"utf8");return Buffer.concat([He(Fn.length),Fn])}do{const Ye=De,Fn=Se.readUInt8(De);De++;const io=qe(),$o=De+io;if(Fn==5)Ne.push(Buffer.from([5,1,0]));else if(Fn==2){const Jo=[],rs=qe();for(let jo=0;jo<rs;jo++){const Vo=De;Ge(),Ge();const os=Se.readUInt8(De);De++;let us=!1;switch(os){case 0:qe();break;case 1:De++,Ue();break;case 2:Ue(),us=!0;break;case 3:De++,De++;break;default:throw new Error("Invalid import kind: "+os)}us||Jo.push(Se.subarray(Vo,De))}const Yo=Buffer.concat([Ve("env"),Ve("memory"),Buffer.from([2]),Buffer.from([0]),He(1)]);Jo.push(Yo);const zo=Buffer.concat([He(Jo.length),...Jo]);Ne.push(Buffer.concat([Buffer.from([2]),He(zo.length),zo]))}else if(Fn==7){const Jo=[],rs=qe();for(let zo=0;zo<rs;zo++){const jo=De;Ge();const Vo=Se.readUInt8(De);De++,qe(),Vo!==2&&Jo.push(Se.subarray(jo,De))}const Yo=Buffer.concat([He(Jo.length),...Jo]);Ne.push(Buffer.concat([Buffer.from([7]),He(Yo.length),Yo]))}else Ne.push(Se.subarray(Ye,$o));De=$o}while(De<Se.length);return Buffer.concat(Ne)}getRegisterLength(Se){return BigInt(this.registers[Se.toString()]?this.registers[Se.toString()].length:Number.MAX_SAFE_INTEGER)}readFromRegister(Se,Ne){new Uint8Array(this.memory.buffer).set(this.registers[Se.toString()]||Buffer.from([]),Number(Ne))}getCurrentAccountId(Se){this.registers[Se.toString()]=Buffer.from(this.context.contractId)}inputMethodArgs(Se){this.registers[Se.toString()]=Buffer.from(this.context.methodArgs)}getBlockHeight(){return BigInt(this.context.blockHeight)}getBlockTimestamp(){return BigInt(this.context.blockTimestamp)}sha256(Se,Ne,je){const ke=new Uint8Array(this.memory.buffer,Number(Ne),Number(Se));this.registers[je.toString()]=(0,W.sha256)(ke)}returnValue(Se,Ne){this.result=Buffer.from(new Uint8Array(this.memory.buffer,Number(Ne),Number(Se)))}panic(Se){throw new Error("panic: "+Se)}abort(Se,Ne,je,ke){const De=this.readUTF16CStr(Se),qe=this.readUTF16CStr(Ne),Ue=`${De} ${qe}:${je}:${ke}`;throw!De||!qe?new Error("abort: String encoding is bad UTF-16 sequence."):new Error("abort: "+Ue)}appendToLog(Se,Ne){this.logs.push(this.readUTF8CStr(Se,Ne))}readStorage(Se,Ne,je){const ke=this.storageRead(Se,Ne);return ke==null?0n:(this.registers[je]=ke,1n)}hasStorageKey(Se,Ne){return this.storageRead(Se,Ne)==null?0n:1n}getHostImports(){return{register_len:this.getRegisterLength.bind(this),read_register:this.readFromRegister.bind(this),current_account_id:this.getCurrentAccountId.bind(this),input:this.inputMethodArgs.bind(this),block_index:this.getBlockHeight.bind(this),block_timestamp:this.getBlockTimestamp.bind(this),sha256:this.sha256.bind(this),value_return:this.returnValue.bind(this),abort:this.abort.bind(this),log_utf8:this.appendToLog.bind(this),log_utf16:this.appendToLog.bind(this),storage_read:this.readStorage.bind(this),storage_has_key:this.hasStorageKey.bind(this),panic:()=>this.panic("explicit guest panic"),panic_utf8:(Se,Ne)=>this.panic(this.readUTF8CStr(Se,Ne)),epoch_height:Y("epoch_height"),storage_usage:Y("storage_usage"),account_balance:Y("account_balance"),account_locked_balance:Y("account_locked_balance"),random_seed:Y("random_seed"),ripemd160:Y("ripemd160"),keccak256:Y("keccak256"),keccak512:Y("keccak512"),ecrecover:Y("ecrecover"),validator_stake:Y("validator_stake"),validator_total_stake:Y("validator_total_stake"),write_register:J("write_register"),signer_account_id:J("signer_account_id"),signer_account_pk:J("signer_account_pk"),predecessor_account_id:J("predecessor_account_id"),attached_deposit:J("attached_deposit"),prepaid_gas:J("prepaid_gas"),used_gas:J("used_gas"),promise_create:J("promise_create"),promise_then:J("promise_then"),promise_and:J("promise_and"),promise_batch_create:J("promise_batch_create"),promise_batch_then:J("promise_batch_then"),promise_batch_action_create_account:J("promise_batch_action_create_account"),promise_batch_action_deploy_contract:J("promise_batch_action_deploy_contract"),promise_batch_action_function_call:J("promise_batch_action_function_call"),promise_batch_action_function_call_weight:J("promise_batch_action_function_call_weight"),promise_batch_action_transfer:J("promise_batch_action_transfer"),promise_batch_action_stake:J("promise_batch_action_stake"),promise_batch_action_add_key_with_full_access:J("promise_batch_action_add_key_with_full_access"),promise_batch_action_add_key_with_function_call:J("promise_batch_action_add_key_with_function_call"),promise_batch_action_delete_key:J("promise_batch_action_delete_key"),promise_batch_action_delete_account:J("promise_batch_action_delete_account"),promise_results_count:J("promise_results_count"),promise_result:J("promise_result"),promise_return:J("promise_return"),storage_write:J("storage_write"),storage_remove:J("storage_remove")}}async execute(Se){const Ne=await WebAssembly.compile(this.wasm),ke=(await WebAssembly.instantiate(Ne,{env:{...this.getHostImports(),memory:this.memory}})).exports[Se];if(ke==null)throw new Error(`Contract method '${Se}' does not exists in contract ${this.context.contractId} for block id ${this.context.blockHeight}`);return ke(),{result:this.result,logs:this.logs}}}return runtime$1.Runtime=X,runtime$1}var hasRequiredLocalViewExecution$1;function requireLocalViewExecution$1(){if(hasRequiredLocalViewExecution$1)return localViewExecution$1;hasRequiredLocalViewExecution$1=1,Object.defineProperty(localViewExecution$1,"__esModule",{value:!0}),localViewExecution$1.LocalViewExecution=void 0;const W=requireCommonjs$8(),Y=requireStorage$1(),J=requireRuntime$1(),X=requireUtils$9();class Me{constructor(Ne){Kc(this,"connection");Kc(this,"storage");this.connection=Ne.getConnection(),this.storage=new Y.Storage}async fetchContractCode(Ne,je){return(await this.connection.provider.query({request_type:"view_code",account_id:Ne,...je})).code_base64}async fetchContractState(Ne,je){return(0,X.viewState)(this.connection,Ne,"",je)}async fetch(Ne,je){const ke=await this.connection.provider.block(je),De=ke.header.hash,qe=ke.header.height,Ue=ke.header.timestamp,Ge=await this.fetchContractCode(Ne,je),He=await this.fetchContractState(Ne,je);return{blockHash:De,blockHeight:qe,blockTimestamp:Ue,contractCode:Ge,contractState:He}}async loadOrFetch(Ne,je){const ke=this.storage.load(je);if(ke)return ke;const{blockHash:De,...qe}=await this.fetch(Ne,je);return this.storage.save(De,qe),qe}async viewFunction({contractId:Ne,methodName:je,args:ke={},blockQuery:De={finality:"optimistic"}}){const qe=JSON.stringify(ke),{contractCode:Ue,contractState:Ge,blockHeight:He,blockTimestamp:Ve}=await this.loadOrFetch(Ne,De),Ye=new J.Runtime({contractId:Ne,contractCode:Ue,contractState:Ge,blockHeight:He,blockTimestamp:Ve,methodArgs:qe}),{result:Fn,logs:io}=await Ye.execute(je);return io&&(0,W.printTxOutcomeLogs)({contractId:Ne,logs:io}),JSON.parse(Buffer.from(Fn).toString())}}return localViewExecution$1.LocalViewExecution=Me,localViewExecution$1}var errors$6={},hasRequiredErrors$6;function requireErrors$6(){if(hasRequiredErrors$6)return errors$6;hasRequiredErrors$6=1,Object.defineProperty(errors$6,"__esModule",{value:!0}),errors$6.ConflictingOptions=errors$6.ArgumentSchemaError=errors$6.UnknownArgumentError=errors$6.UnsupportedSerializationError=void 0;class W extends Error{constructor(Se,Ne){super(`Contract method '${Se}' is using an unsupported serialization type ${Ne}`)}}errors$6.UnsupportedSerializationError=W;class Y extends Error{constructor(Se,Ne){super(`Unrecognized argument '${Se}', expected '${JSON.stringify(Ne)}'`)}}errors$6.UnknownArgumentError=Y;class J extends Error{constructor(Se,Ne){super(`Argument '${Se}' does not conform to the specified ABI schema: '${JSON.stringify(Ne)}'`)}}errors$6.ArgumentSchemaError=J;class X extends Error{constructor(){super("Conflicting contract method options have been passed. You can either specify ABI or a list of view/call methods.")}}return errors$6.ConflictingOptions=X,errors$6}var hasRequiredContract$3;function requireContract$3(){if(hasRequiredContract$3)return contract$3;hasRequiredContract$3=1;var W=contract$3.__importDefault||function(Fn){return Fn&&Fn.__esModule?Fn:{default:Fn}};Object.defineProperty(contract$3,"__esModule",{value:!0}),contract$3.Contract=void 0;const Y=requireCommonjs$8(),J=requireCommonjs$9(),X=requireLocalViewExecution$1(),Me=W(requireIsMyJsonValid()),Se=W(requireBrowser$8()),Ne=requireLib$d(),je=requireAccount$3(),ke=requireErrors$6(),De=requireUtils$9();function qe(Fn,io){return{[Fn](...$o){return io(...$o)}}[Fn]}function Ue(Fn,io,$o){var rs;if(!He(Fn))return;if(io.params&&io.params.serialization_type!==Ne.AbiSerializationType.Json)throw new ke.UnsupportedSerializationError(io.name,io.params.serialization_type);if(io.result&&io.result.serialization_type!==Ne.AbiSerializationType.Json)throw new ke.UnsupportedSerializationError(io.name,io.result.serialization_type);const Jo=((rs=io.params)==null?void 0:rs.args)||[];for(const Yo of Jo){const zo=Fn[Yo.name],jo=Yo.type_schema;jo.definitions=$o.body.root_schema.definitions;const Vo=(0,Me.default)(jo);if(!Vo(zo))throw new ke.ArgumentSchemaError(Yo.name,Vo.errors)}for(const Yo of Object.keys(Fn))if(!Jo.find(jo=>jo.name===Yo))throw new ke.UnknownArgumentError(Yo,Jo.map(jo=>jo.name))}const Ge=Fn=>Fn&&Fn.byteLength!==void 0&&Fn.byteLength===Fn.length,He=Fn=>Object.prototype.toString.call(Fn)==="[object Object]";class Ve{constructor(io,$o,Jo){Kc(this,"account");Kc(this,"connection");Kc(this,"contractId");Kc(this,"lve");this.connection=io.getConnection(),io instanceof je.Account&&((0,Se.default)("new Contract(account, contractId, options)")("use `new Contract(connection, contractId, options)` instead"),this.account=io),this.contractId=$o,this.lve=new X.LocalViewExecution(io);const{viewMethods:rs=[],changeMethods:Yo=[],abi:zo,useLocalViewExecution:jo}=Jo;let Vo=rs.map(us=>({name:us,abi:null})),os=Yo.map(us=>({name:us,abi:null}));if(zo){if(Vo.length>0||os.length>0)throw new ke.ConflictingOptions;Vo=zo.body.functions.filter(us=>us.kind===Ne.AbiFunctionKind.View).map(us=>({name:us.name,abi:us})),os=zo.body.functions.filter(us=>us.kind===Ne.AbiFunctionKind.Call).map(us=>({name:us.name,abi:us}))}Vo.forEach(({name:us,abi:is})=>{Object.defineProperty(this,us,{writable:!1,enumerable:!0,value:qe(us,async(Lo={},Fe={},...Ke)=>{if(Ke.length||!(He(Lo)||Ge(Lo))||!He(Fe))throw new J.PositionalArgsError;if(is&&Ue(Lo,is,zo),jo)try{return await this.lve.viewFunction({contractId:this.contractId,methodName:us,args:Lo,...Fe})}catch(Je){Y.Logger.warn(`Local view execution failed with: "${Je.message}"`),Y.Logger.warn("Fallback to normal RPC call")}return this.account?this.account.viewFunction({contractId:this.contractId,methodName:us,args:Lo,...Fe}):(0,De.viewFunction)(this.connection,{contractId:this.contractId,methodName:us,args:Lo,...Fe})})})}),os.forEach(({name:us,abi:is})=>{Object.defineProperty(this,us,{writable:!1,enumerable:!0,value:qe(us,async(...Lo)=>{if(Lo.length&&(Lo.length>3||!(He(Lo[0])||Ge(Lo[0]))))throw new J.PositionalArgsError;return(Lo.length>1||!(Lo[0]&&Lo[0].args))&&((0,Se.default)("contract.methodName(args, gas, amount)")("use `contract.methodName({ signerAccount, args, gas?, amount?, callbackUrl?, meta? })` instead"),Lo[0]={args:Lo[0],gas:Lo[1],amount:Lo[2]}),is&&Ue(Lo[0].args,is,zo),this._changeMethod({methodName:us,...Lo[0]})})})})}async _changeMethod({signerAccount:io,args:$o,methodName:Jo,gas:rs,amount:Yo,meta:zo,callbackUrl:jo}){Ye({gas:rs,amount:Yo});const Vo=this.account||io;if(!Vo)throw new Error("signerAccount must be specified");const os=await Vo.functionCall({contractId:this.contractId,methodName:Jo,args:$o,gas:rs,attachedDeposit:Yo,walletMeta:zo,walletCallbackUrl:jo});return(0,Y.getTransactionLastResult)(os)}}contract$3.Contract=Ve;function Ye(Fn){const io="number, decimal string or BigInt";for(const $o of Object.keys(Fn)){const Jo=Fn[$o];if(Jo&&typeof Jo!="bigint"&&isNaN(Jo))throw new J.ArgumentTypeError($o,io,Jo)}}return contract$3}var hasRequiredCommonjs$1;function requireCommonjs$1(){return hasRequiredCommonjs$1||(hasRequiredCommonjs$1=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.MultisigStateStatus=W.MultisigDeleteRequestRejectionError=W.UnsupportedSerializationError=W.UnknownArgumentError=W.ConflictingOptions=W.ArgumentSchemaError=W.Contract=W.MULTISIG_CONFIRM_METHODS=W.MULTISIG_CHANGE_METHODS=W.MULTISIG_DEPOSIT=W.MULTISIG_GAS=W.MULTISIG_ALLOWANCE=W.MULTISIG_STORAGE_KEY=W.Connection=W.AccountMultisig=W.UrlAccountCreator=W.LocalAccountCreator=W.AccountCreator=W.Account2FA=W.Account=void 0;var Y=requireAccount$3();Object.defineProperty(W,"Account",{enumerable:!0,get:function(){return Y.Account}});var J=requireAccount_2fa$1();Object.defineProperty(W,"Account2FA",{enumerable:!0,get:function(){return J.Account2FA}});var X=requireAccount_creator$3();Object.defineProperty(W,"AccountCreator",{enumerable:!0,get:function(){return X.AccountCreator}}),Object.defineProperty(W,"LocalAccountCreator",{enumerable:!0,get:function(){return X.LocalAccountCreator}}),Object.defineProperty(W,"UrlAccountCreator",{enumerable:!0,get:function(){return X.UrlAccountCreator}});var Me=requireAccount_multisig$3();Object.defineProperty(W,"AccountMultisig",{enumerable:!0,get:function(){return Me.AccountMultisig}});var Se=requireConnection$3();Object.defineProperty(W,"Connection",{enumerable:!0,get:function(){return Se.Connection}});var Ne=requireConstants$5();Object.defineProperty(W,"MULTISIG_STORAGE_KEY",{enumerable:!0,get:function(){return Ne.MULTISIG_STORAGE_KEY}}),Object.defineProperty(W,"MULTISIG_ALLOWANCE",{enumerable:!0,get:function(){return Ne.MULTISIG_ALLOWANCE}}),Object.defineProperty(W,"MULTISIG_GAS",{enumerable:!0,get:function(){return Ne.MULTISIG_GAS}}),Object.defineProperty(W,"MULTISIG_DEPOSIT",{enumerable:!0,get:function(){return Ne.MULTISIG_DEPOSIT}}),Object.defineProperty(W,"MULTISIG_CHANGE_METHODS",{enumerable:!0,get:function(){return Ne.MULTISIG_CHANGE_METHODS}}),Object.defineProperty(W,"MULTISIG_CONFIRM_METHODS",{enumerable:!0,get:function(){return Ne.MULTISIG_CONFIRM_METHODS}});var je=requireContract$3();Object.defineProperty(W,"Contract",{enumerable:!0,get:function(){return je.Contract}});var ke=requireErrors$6();Object.defineProperty(W,"ArgumentSchemaError",{enumerable:!0,get:function(){return ke.ArgumentSchemaError}}),Object.defineProperty(W,"ConflictingOptions",{enumerable:!0,get:function(){return ke.ConflictingOptions}}),Object.defineProperty(W,"UnknownArgumentError",{enumerable:!0,get:function(){return ke.UnknownArgumentError}}),Object.defineProperty(W,"UnsupportedSerializationError",{enumerable:!0,get:function(){return ke.UnsupportedSerializationError}});var De=requireTypes$4();Object.defineProperty(W,"MultisigDeleteRequestRejectionError",{enumerable:!0,get:function(){return De.MultisigDeleteRequestRejectionError}}),Object.defineProperty(W,"MultisigStateStatus",{enumerable:!0,get:function(){return De.MultisigStateStatus}})}(commonjs$2)),commonjs$2}var hasRequiredAccount$2;function requireAccount$2(){return hasRequiredAccount$2||(hasRequiredAccount$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Account=void 0;var Y=requireCommonjs$1();Object.defineProperty(W,"Account",{enumerable:!0,get:function(){return Y.Account}})}(account$3)),account$3}var account_multisig$2={},hasRequiredAccount_multisig$2;function requireAccount_multisig$2(){return hasRequiredAccount_multisig$2||(hasRequiredAccount_multisig$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.MultisigStateStatus=W.MultisigDeleteRequestRejectionError=W.MULTISIG_CONFIRM_METHODS=W.MULTISIG_CHANGE_METHODS=W.MULTISIG_DEPOSIT=W.MULTISIG_GAS=W.MULTISIG_ALLOWANCE=W.MULTISIG_STORAGE_KEY=W.AccountMultisig=W.Account2FA=void 0;var Y=requireCommonjs$1();Object.defineProperty(W,"Account2FA",{enumerable:!0,get:function(){return Y.Account2FA}}),Object.defineProperty(W,"AccountMultisig",{enumerable:!0,get:function(){return Y.AccountMultisig}}),Object.defineProperty(W,"MULTISIG_STORAGE_KEY",{enumerable:!0,get:function(){return Y.MULTISIG_STORAGE_KEY}}),Object.defineProperty(W,"MULTISIG_ALLOWANCE",{enumerable:!0,get:function(){return Y.MULTISIG_ALLOWANCE}}),Object.defineProperty(W,"MULTISIG_GAS",{enumerable:!0,get:function(){return Y.MULTISIG_GAS}}),Object.defineProperty(W,"MULTISIG_DEPOSIT",{enumerable:!0,get:function(){return Y.MULTISIG_DEPOSIT}}),Object.defineProperty(W,"MULTISIG_CHANGE_METHODS",{enumerable:!0,get:function(){return Y.MULTISIG_CHANGE_METHODS}}),Object.defineProperty(W,"MULTISIG_CONFIRM_METHODS",{enumerable:!0,get:function(){return Y.MULTISIG_CONFIRM_METHODS}}),Object.defineProperty(W,"MultisigDeleteRequestRejectionError",{enumerable:!0,get:function(){return Y.MultisigDeleteRequestRejectionError}}),Object.defineProperty(W,"MultisigStateStatus",{enumerable:!0,get:function(){return Y.MultisigStateStatus}})}(account_multisig$2)),account_multisig$2}var account_creator$2={},hasRequiredAccount_creator$2;function requireAccount_creator$2(){return hasRequiredAccount_creator$2||(hasRequiredAccount_creator$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.UrlAccountCreator=W.LocalAccountCreator=W.AccountCreator=void 0;var Y=requireCommonjs$1();Object.defineProperty(W,"AccountCreator",{enumerable:!0,get:function(){return Y.AccountCreator}}),Object.defineProperty(W,"LocalAccountCreator",{enumerable:!0,get:function(){return Y.LocalAccountCreator}}),Object.defineProperty(W,"UrlAccountCreator",{enumerable:!0,get:function(){return Y.UrlAccountCreator}})}(account_creator$2)),account_creator$2}var connection$2={},hasRequiredConnection$2;function requireConnection$2(){return hasRequiredConnection$2||(hasRequiredConnection$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Connection=void 0;var Y=requireCommonjs$1();Object.defineProperty(W,"Connection",{enumerable:!0,get:function(){return Y.Connection}})}(connection$2)),connection$2}var signer$2={},hasRequiredSigner$2;function requireSigner$2(){return hasRequiredSigner$2||(hasRequiredSigner$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Signer=W.InMemorySigner=void 0;var Y=requireCommonjs$2();Object.defineProperty(W,"InMemorySigner",{enumerable:!0,get:function(){return Y.InMemorySigner}}),Object.defineProperty(W,"Signer",{enumerable:!0,get:function(){return Y.Signer}})}(signer$2)),signer$2}var contract$2={},hasRequiredContract$2;function requireContract$2(){return hasRequiredContract$2||(hasRequiredContract$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Contract=void 0;var Y=requireCommonjs$1();Object.defineProperty(W,"Contract",{enumerable:!0,get:function(){return Y.Contract}})}(contract$2)),contract$2}var near$4={},commonjs={},near$3={},hasRequiredNear$3;function requireNear$3(){if(hasRequiredNear$3)return near$3;hasRequiredNear$3=1,Object.defineProperty(near$3,"__esModule",{value:!0}),near$3.Near=void 0;const W=requireCommonjs$1();class Y{constructor(X){Kc(this,"config");Kc(this,"connection");Kc(this,"accountCreator");var Me;if(this.config=X,this.connection=W.Connection.fromConfig({networkId:X.networkId,provider:X.provider||{type:"JsonRpcProvider",args:{url:X.nodeUrl,headers:X.headers}},signer:X.signer||{type:"InMemorySigner",keyStore:X.keyStore||((Me=X.deps)==null?void 0:Me.keyStore)},jsvmAccountId:X.jsvmAccountId||`jsvm.${X.networkId}`}),X.masterAccount){const Se=X.initialBalance?BigInt(X.initialBalance):500000000000000000000000000n;this.accountCreator=new W.LocalAccountCreator(new W.Account(this.connection,X.masterAccount),Se)}else X.helperUrl?this.accountCreator=new W.UrlAccountCreator(this.connection,X.helperUrl):this.accountCreator=null}async account(X){return new W.Account(this.connection,X)}async createAccount(X,Me){if(!this.accountCreator)throw new Error("Must specify account creator, either via masterAccount or helperUrl configuration settings.");return await this.accountCreator.createAccount(X,Me),new W.Account(this.connection,X)}}return near$3.Near=Y,near$3}var wallet_account$1={},hasRequiredWallet_account$1;function requireWallet_account$1(){if(hasRequiredWallet_account$1)return wallet_account$1;hasRequiredWallet_account$1=1,Object.defineProperty(wallet_account$1,"__esModule",{value:!0}),wallet_account$1.ConnectedWalletAccount=wallet_account$1.WalletConnection=void 0;const W=requireCommonjs$1(),Y=requireCommonjs$7(),J=requireCommonjs$8(),X=requireCommonjs$4(),Me=requireCjs$4(),Se="/login/",Ne="add_request_and_confirm",je="_wallet_auth_key",ke="pending_key";class De{constructor(Ge,He){Kc(this,"_walletBaseUrl");Kc(this,"_authDataKey");Kc(this,"_keyStore");Kc(this,"_authData");Kc(this,"_networkId");Kc(this,"_near");Kc(this,"_connectedAccount");Kc(this,"_completeSignInPromise");if(typeof He!="string")throw new Error("Please define a clear appKeyPrefix for this WalletConnection instance as the second argument to the constructor");if(typeof window>"u")return new Proxy(this,{get(Fn,io){return io==="isSignedIn"?()=>!1:io==="getAccountId"?()=>"":Fn[io]&&typeof Fn[io]=="function"?()=>{throw new Error("No window found in context, please ensure you are using WalletConnection on the browser")}:Fn[io]}});this._near=Ge;const Ve=He+je,Ye=JSON.parse(window.localStorage.getItem(Ve));this._networkId=Ge.config.networkId,this._walletBaseUrl=Ge.config.walletUrl,He=He||Ge.config.contractName||"default",this._keyStore=Ge.connection.signer.keyStore,this._authData=Ye||{allKeys:[]},this._authDataKey=Ve,this.isSignedIn()||(this._completeSignInPromise=this._completeSignInWithAccessKey())}isSignedIn(){return!!this._authData.accountId}async isSignedInAsync(){return this._completeSignInPromise?(await this._completeSignInPromise,this.isSignedIn()):this.isSignedIn()}getAccountId(){return this._authData.accountId||""}async requestSignInUrl({contractId:Ge,methodNames:He,successUrl:Ve,failureUrl:Ye,keyType:Fn="ed25519"}){const io=new URL(window.location.href),$o=new URL(this._walletBaseUrl+Se);if($o.searchParams.set("success_url",Ve||io.href),$o.searchParams.set("failure_url",Ye||io.href),Ge){await(await this._near.account(Ge)).state(),$o.searchParams.set("contract_id",Ge);const rs=Y.KeyPair.fromRandom(Fn);$o.searchParams.set("public_key",rs.getPublicKey().toString()),await this._keyStore.setKey(this._networkId,ke+rs.getPublicKey(),rs)}return He&&He.forEach(Jo=>{$o.searchParams.append("methodNames",Jo)}),$o.toString()}async requestSignIn(Ge){const He=await this.requestSignInUrl(Ge);window.location.assign(He)}requestSignTransactionsUrl({transactions:Ge,meta:He,callbackUrl:Ve}){const Ye=new URL(window.location.href),Fn=new URL("sign",this._walletBaseUrl);return Fn.searchParams.set("transactions",Ge.map(io=>(0,Me.serialize)(X.SCHEMA.Transaction,io)).map(io=>Buffer.from(io).toString("base64")).join(",")),Fn.searchParams.set("callbackUrl",Ve||Ye.href),He&&Fn.searchParams.set("meta",He),Fn.toString()}requestSignTransactions(Ge){const He=this.requestSignTransactionsUrl(Ge);window.location.assign(He)}async _completeSignInWithAccessKey(){const Ge=new URL(window.location.href),He=Ge.searchParams.get("public_key")||"",Ve=(Ge.searchParams.get("all_keys")||"").split(","),Ye=Ge.searchParams.get("account_id")||"";if(Ye){const Fn={accountId:Ye,allKeys:Ve};window.localStorage.setItem(this._authDataKey,JSON.stringify(Fn)),He&&await this._moveKeyFromTempToPermanent(Ye,He),this._authData=Fn}Ge.searchParams.delete("public_key"),Ge.searchParams.delete("all_keys"),Ge.searchParams.delete("account_id"),Ge.searchParams.delete("meta"),Ge.searchParams.delete("transactionHashes"),window.history.replaceState({},document.title,Ge.toString())}async _moveKeyFromTempToPermanent(Ge,He){const Ve=await this._keyStore.getKey(this._networkId,ke+He);await this._keyStore.setKey(this._networkId,Ge,Ve),await this._keyStore.removeKey(this._networkId,ke+He)}signOut(){this._authData={},window.localStorage.removeItem(this._authDataKey)}account(){return this._connectedAccount||(this._connectedAccount=new qe(this,this._near.connection,this._authData.accountId)),this._connectedAccount}}wallet_account$1.WalletConnection=De;class qe extends W.Account{constructor(He,Ve,Ye){super(Ve,Ye);Kc(this,"walletConnection");this.walletConnection=He}async signAndSendTransaction({receiverId:He,actions:Ve,walletMeta:Ye,walletCallbackUrl:Fn=window.location.href}){const io=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);let $o=await this.accessKeyForTransaction(He,Ve,io);if(!$o)throw new Error(`Cannot find matching key for transaction sent to ${He}`);if(io&&io.toString()===$o.public_key)try{return await super.signAndSendTransaction({receiverId:He,actions:Ve})}catch(Vo){if(Vo.type==="NotEnoughAllowance")$o=await this.accessKeyForTransaction(He,Ve);else throw Vo}const Jo=await this.connection.provider.block({finality:"final"}),rs=(0,J.baseDecode)(Jo.header.hash),Yo=Y.PublicKey.from($o.public_key),zo=$o.access_key.nonce+1n,jo=(0,X.createTransaction)(this.accountId,Yo,He,zo,Ve,rs);return await this.walletConnection.requestSignTransactions({transactions:[jo],meta:Ye,callbackUrl:Fn}),new Promise((Vo,os)=>{setTimeout(()=>{os(new Error("Failed to redirect to sign transaction"))},1e3)})}async accessKeyMatchesTransaction(He,Ve,Ye){const{access_key:{permission:Fn}}=He;if(Fn==="FullAccess")return!0;if(Fn.FunctionCall){const{receiver_id:io,method_names:$o}=Fn.FunctionCall;if(io===this.accountId&&$o.includes(Ne))return!0;if(io===Ve){if(Ye.length!==1)return!1;const[{functionCall:Jo}]=Ye;return Jo&&(!Jo.deposit||Jo.deposit.toString()==="0")&&($o.length===0||$o.includes(Jo.methodName))}}return!1}async accessKeyForTransaction(He,Ve,Ye){const Fn=await this.getAccessKeys();if(Ye){const $o=Fn.find(Jo=>Jo.public_key.toString()===Ye.toString());if($o&&await this.accessKeyMatchesTransaction($o,He,Ve))return $o}const io=this.walletConnection._authData.allKeys;for(const $o of Fn)if(io.indexOf($o.public_key)!==-1&&await this.accessKeyMatchesTransaction($o,He,Ve))return $o;return null}}return wallet_account$1.ConnectedWalletAccount=qe,wallet_account$1}var hasRequiredCommonjs;function requireCommonjs(){return hasRequiredCommonjs||(hasRequiredCommonjs=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.WalletConnection=W.ConnectedWalletAccount=W.Near=void 0;var Y=requireNear$3();Object.defineProperty(W,"Near",{enumerable:!0,get:function(){return Y.Near}});var J=requireWallet_account$1();Object.defineProperty(W,"ConnectedWalletAccount",{enumerable:!0,get:function(){return J.ConnectedWalletAccount}}),Object.defineProperty(W,"WalletConnection",{enumerable:!0,get:function(){return J.WalletConnection}})}(commonjs)),commonjs}var hasRequiredNear$2;function requireNear$2(){return hasRequiredNear$2||(hasRequiredNear$2=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.Near=void 0;var Y=requireCommonjs();Object.defineProperty(W,"Near",{enumerable:!0,get:function(){return Y.Near}})}(near$4)),near$4}var walletAccount$1={},hasRequiredWalletAccount$1;function requireWalletAccount$1(){return hasRequiredWalletAccount$1||(hasRequiredWalletAccount$1=1,function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.WalletConnection=W.ConnectedWalletAccount=void 0;var Y=requireCommonjs();Object.defineProperty(W,"ConnectedWalletAccount",{enumerable:!0,get:function(){return Y.ConnectedWalletAccount}}),Object.defineProperty(W,"WalletConnection",{enumerable:!0,get:function(){return Y.WalletConnection}})}(walletAccount$1)),walletAccount$1}var hasRequiredCommonIndex$1;function requireCommonIndex$1(){return hasRequiredCommonIndex$1||(hasRequiredCommonIndex$1=1,function(W){var Y=commonIndex$1.__createBinding||(Object.create?function(io,$o,Jo,rs){rs===void 0&&(rs=Jo);var Yo=Object.getOwnPropertyDescriptor($o,Jo);(!Yo||("get"in Yo?!$o.__esModule:Yo.writable||Yo.configurable))&&(Yo={enumerable:!0,get:function(){return $o[Jo]}}),Object.defineProperty(io,rs,Yo)}:function(io,$o,Jo,rs){rs===void 0&&(rs=Jo),io[rs]=$o[Jo]}),J=commonIndex$1.__setModuleDefault||(Object.create?function(io,$o){Object.defineProperty(io,"default",{enumerable:!0,value:$o})}:function(io,$o){io.default=$o}),X=commonIndex$1.__importStar||function(io){if(io&&io.__esModule)return io;var $o={};if(io!=null)for(var Jo in io)Jo!=="default"&&Object.prototype.hasOwnProperty.call(io,Jo)&&Y($o,io,Jo);return J($o,io),$o};Object.defineProperty(W,"__esModule",{value:!0}),W.WalletConnection=W.ConnectedWalletAccount=W.Near=W.KeyPair=W.Signer=W.InMemorySigner=W.Contract=W.Connection=W.Account=W.multisig=W.validators=W.transactions=W.utils=W.providers=W.accountCreator=void 0;const Me=X(requireProviders$1());W.providers=Me;const Se=X(requireUtils$a());W.utils=Se;const Ne=X(requireTransaction$1());W.transactions=Ne;const je=X(requireValidators$2());W.validators=je;const ke=requireAccount$2();Object.defineProperty(W,"Account",{enumerable:!0,get:function(){return ke.Account}});const De=X(requireAccount_multisig$2());W.multisig=De;const qe=X(requireAccount_creator$2());W.accountCreator=qe;const Ue=requireConnection$2();Object.defineProperty(W,"Connection",{enumerable:!0,get:function(){return Ue.Connection}});const Ge=requireSigner$2();Object.defineProperty(W,"Signer",{enumerable:!0,get:function(){return Ge.Signer}}),Object.defineProperty(W,"InMemorySigner",{enumerable:!0,get:function(){return Ge.InMemorySigner}});const He=requireContract$2();Object.defineProperty(W,"Contract",{enumerable:!0,get:function(){return He.Contract}});const Ve=requireKey_pair$2();Object.defineProperty(W,"KeyPair",{enumerable:!0,get:function(){return Ve.KeyPair}});const Ye=requireNear$2();Object.defineProperty(W,"Near",{enumerable:!0,get:function(){return Ye.Near}});const Fn=requireWalletAccount$1();Object.defineProperty(W,"ConnectedWalletAccount",{enumerable:!0,get:function(){return Fn.ConnectedWalletAccount}}),Object.defineProperty(W,"WalletConnection",{enumerable:!0,get:function(){return Fn.WalletConnection}})}(commonIndex$1)),commonIndex$1}var browserConnect$1={},hasRequiredBrowserConnect$1;function requireBrowserConnect$1(){if(hasRequiredBrowserConnect$1)return browserConnect$1;hasRequiredBrowserConnect$1=1,Object.defineProperty(browserConnect$1,"__esModule",{value:!0}),browserConnect$1.connect=void 0;const W=requireNear$2();async function Y(J){return new W.Near(J)}return browserConnect$1.connect=Y,browserConnect$1}var hasRequiredBrowserIndex$2;function requireBrowserIndex$2(){return hasRequiredBrowserIndex$2||(hasRequiredBrowserIndex$2=1,function(W){var Y=browserIndex$4.__createBinding||(Object.create?function(Se,Ne,je,ke){ke===void 0&&(ke=je);var De=Object.getOwnPropertyDescriptor(Ne,je);(!De||("get"in De?!Ne.__esModule:De.writable||De.configurable))&&(De={enumerable:!0,get:function(){return Ne[je]}}),Object.defineProperty(Se,ke,De)}:function(Se,Ne,je,ke){ke===void 0&&(ke=je),Se[ke]=Ne[je]}),J=browserIndex$4.__setModuleDefault||(Object.create?function(Se,Ne){Object.defineProperty(Se,"default",{enumerable:!0,value:Ne})}:function(Se,Ne){Se.default=Ne}),X=browserIndex$4.__importStar||function(Se){if(Se&&Se.__esModule)return Se;var Ne={};if(Se!=null)for(var je in Se)je!=="default"&&Object.prototype.hasOwnProperty.call(Se,je)&&Y(Ne,Se,je);return J(Ne,Se),Ne},Me=browserIndex$4.__exportStar||function(Se,Ne){for(var je in Se)je!=="default"&&!Object.prototype.hasOwnProperty.call(Ne,je)&&Y(Ne,Se,je)};Object.defineProperty(W,"__esModule",{value:!0}),W.keyStores=void 0,W.keyStores=X(requireBrowserIndex$3()),Me(requireCommonIndex$1(),W),Me(requireBrowserConnect$1(),W)}(browserIndex$4)),browserIndex$4}var browserIndexExports$1=requireBrowserIndex$2(),providersExports$1=requireProviders$1(),events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var W=typeof Reflect=="object"?Reflect:null,Y=W&&typeof W.apply=="function"?W.apply:function(Yo,zo,jo){return Function.prototype.apply.call(Yo,zo,jo)},J;W&&typeof W.ownKeys=="function"?J=W.ownKeys:Object.getOwnPropertySymbols?J=function(Yo){return Object.getOwnPropertyNames(Yo).concat(Object.getOwnPropertySymbols(Yo))}:J=function(Yo){return Object.getOwnPropertyNames(Yo)};function X(rs){console&&console.warn&&console.warn(rs)}var Me=Number.isNaN||function(Yo){return Yo!==Yo};function Se(){Se.init.call(this)}events.exports=Se,events.exports.once=io,Se.EventEmitter=Se,Se.prototype._events=void 0,Se.prototype._eventsCount=0,Se.prototype._maxListeners=void 0;var Ne=10;function je(rs){if(typeof rs!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof rs)}Object.defineProperty(Se,"defaultMaxListeners",{enumerable:!0,get:function(){return Ne},set:function(rs){if(typeof rs!="number"||rs<0||Me(rs))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+rs+".");Ne=rs}}),Se.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Se.prototype.setMaxListeners=function(Yo){if(typeof Yo!="number"||Yo<0||Me(Yo))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+Yo+".");return this._maxListeners=Yo,this};function ke(rs){return rs._maxListeners===void 0?Se.defaultMaxListeners:rs._maxListeners}Se.prototype.getMaxListeners=function(){return ke(this)},Se.prototype.emit=function(Yo){for(var zo=[],jo=1;jo<arguments.length;jo++)zo.push(arguments[jo]);var Vo=Yo==="error",os=this._events;if(os!==void 0)Vo=Vo&&os.error===void 0;else if(!Vo)return!1;if(Vo){var us;if(zo.length>0&&(us=zo[0]),us instanceof Error)throw us;var is=new Error("Unhandled error."+(us?" ("+us.message+")":""));throw is.context=us,is}var Lo=os[Yo];if(Lo===void 0)return!1;if(typeof Lo=="function")Y(Lo,this,zo);else for(var Fe=Lo.length,Ke=Ve(Lo,Fe),jo=0;jo<Fe;++jo)Y(Ke[jo],this,zo);return!0};function De(rs,Yo,zo,jo){var Vo,os,us;if(je(zo),os=rs._events,os===void 0?(os=rs._events=Object.create(null),rs._eventsCount=0):(os.newListener!==void 0&&(rs.emit("newListener",Yo,zo.listener?zo.listener:zo),os=rs._events),us=os[Yo]),us===void 0)us=os[Yo]=zo,++rs._eventsCount;else if(typeof us=="function"?us=os[Yo]=jo?[zo,us]:[us,zo]:jo?us.unshift(zo):us.push(zo),Vo=ke(rs),Vo>0&&us.length>Vo&&!us.warned){us.warned=!0;var is=new Error("Possible EventEmitter memory leak detected. "+us.length+" "+String(Yo)+" listeners added. Use emitter.setMaxListeners() to increase limit");is.name="MaxListenersExceededWarning",is.emitter=rs,is.type=Yo,is.count=us.length,X(is)}return rs}Se.prototype.addListener=function(Yo,zo){return De(this,Yo,zo,!1)},Se.prototype.on=Se.prototype.addListener,Se.prototype.prependListener=function(Yo,zo){return De(this,Yo,zo,!0)};function qe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Ue(rs,Yo,zo){var jo={fired:!1,wrapFn:void 0,target:rs,type:Yo,listener:zo},Vo=qe.bind(jo);return Vo.listener=zo,jo.wrapFn=Vo,Vo}Se.prototype.once=function(Yo,zo){return je(zo),this.on(Yo,Ue(this,Yo,zo)),this},Se.prototype.prependOnceListener=function(Yo,zo){return je(zo),this.prependListener(Yo,Ue(this,Yo,zo)),this},Se.prototype.removeListener=function(Yo,zo){var jo,Vo,os,us,is;if(je(zo),Vo=this._events,Vo===void 0)return this;if(jo=Vo[Yo],jo===void 0)return this;if(jo===zo||jo.listener===zo)--this._eventsCount===0?this._events=Object.create(null):(delete Vo[Yo],Vo.removeListener&&this.emit("removeListener",Yo,jo.listener||zo));else if(typeof jo!="function"){for(os=-1,us=jo.length-1;us>=0;us--)if(jo[us]===zo||jo[us].listener===zo){is=jo[us].listener,os=us;break}if(os<0)return this;os===0?jo.shift():Ye(jo,os),jo.length===1&&(Vo[Yo]=jo[0]),Vo.removeListener!==void 0&&this.emit("removeListener",Yo,is||zo)}return this},Se.prototype.off=Se.prototype.removeListener,Se.prototype.removeAllListeners=function(Yo){var zo,jo,Vo;if(jo=this._events,jo===void 0)return this;if(jo.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):jo[Yo]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete jo[Yo]),this;if(arguments.length===0){var os=Object.keys(jo),us;for(Vo=0;Vo<os.length;++Vo)us=os[Vo],us!=="removeListener"&&this.removeAllListeners(us);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(zo=jo[Yo],typeof zo=="function")this.removeListener(Yo,zo);else if(zo!==void 0)for(Vo=zo.length-1;Vo>=0;Vo--)this.removeListener(Yo,zo[Vo]);return this};function Ge(rs,Yo,zo){var jo=rs._events;if(jo===void 0)return[];var Vo=jo[Yo];return Vo===void 0?[]:typeof Vo=="function"?zo?[Vo.listener||Vo]:[Vo]:zo?Fn(Vo):Ve(Vo,Vo.length)}Se.prototype.listeners=function(Yo){return Ge(this,Yo,!0)},Se.prototype.rawListeners=function(Yo){return Ge(this,Yo,!1)},Se.listenerCount=function(rs,Yo){return typeof rs.listenerCount=="function"?rs.listenerCount(Yo):He.call(rs,Yo)},Se.prototype.listenerCount=He;function He(rs){var Yo=this._events;if(Yo!==void 0){var zo=Yo[rs];if(typeof zo=="function")return 1;if(zo!==void 0)return zo.length}return 0}Se.prototype.eventNames=function(){return this._eventsCount>0?J(this._events):[]};function Ve(rs,Yo){for(var zo=new Array(Yo),jo=0;jo<Yo;++jo)zo[jo]=rs[jo];return zo}function Ye(rs,Yo){for(;Yo+1<rs.length;Yo++)rs[Yo]=rs[Yo+1];rs.pop()}function Fn(rs){for(var Yo=new Array(rs.length),zo=0;zo<Yo.length;++zo)Yo[zo]=rs[zo].listener||rs[zo];return Yo}function io(rs,Yo){return new Promise(function(zo,jo){function Vo(us){rs.removeListener(Yo,os),jo(us)}function os(){typeof rs.removeListener=="function"&&rs.removeListener("error",Vo),zo([].slice.call(arguments))}Jo(rs,Yo,os,{once:!0}),Yo!=="error"&&$o(rs,Vo,{once:!0})})}function $o(rs,Yo,zo){typeof rs.on=="function"&&Jo(rs,"error",Yo,zo)}function Jo(rs,Yo,zo,jo){if(typeof rs.on=="function")jo.once?rs.once(Yo,zo):rs.on(Yo,zo);else if(typeof rs.addEventListener=="function")rs.addEventListener(Yo,function Vo(os){jo.once&&rs.removeEventListener(Yo,Vo),zo(os)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof rs)}return events.exports}var eventsExports=requireEvents();const Jg=getDefaultExportFromCjs(eventsExports);var extendStatics$1=function(W,Y){return extendStatics$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,X){J.__proto__=X}||function(J,X){for(var Me in X)Object.prototype.hasOwnProperty.call(X,Me)&&(J[Me]=X[Me])},extendStatics$1(W,Y)};function __extends$2(W,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Class extends value "+String(Y)+" is not a constructor or null");extendStatics$1(W,Y);function J(){this.constructor=W}W.prototype=Y===null?Object.create(Y):(J.prototype=Y.prototype,new J)}function __values$1(W){var Y=typeof Symbol=="function"&&Symbol.iterator,J=Y&&W[Y],X=0;if(J)return J.call(W);if(W&&typeof W.length=="number")return{next:function(){return W&&X>=W.length&&(W=void 0),{value:W&&W[X++],done:!W}}};throw new TypeError(Y?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read$1(W,Y){var J=typeof Symbol=="function"&&W[Symbol.iterator];if(!J)return W;var X=J.call(W),Me,Se=[],Ne;try{for(;(Y===void 0||Y-- >0)&&!(Me=X.next()).done;)Se.push(Me.value)}catch(je){Ne={error:je}}finally{try{Me&&!Me.done&&(J=X.return)&&J.call(X)}finally{if(Ne)throw Ne.error}}return Se}function __spreadArray$1(W,Y,J){if(J||arguments.length===2)for(var X=0,Me=Y.length,Se;X<Me;X++)(Se||!(X in Y))&&(Se||(Se=Array.prototype.slice.call(Y,0,X)),Se[X]=Y[X]);return W.concat(Se||Array.prototype.slice.call(Y))}typeof SuppressedError=="function"&&SuppressedError;function isFunction(W){return typeof W=="function"}function createErrorClass(W){var Y=function(X){Error.call(X),X.stack=new Error().stack},J=W(Y);return J.prototype=Object.create(Error.prototype),J.prototype.constructor=J,J}var UnsubscriptionError=createErrorClass(function(W){return function(J){W(this),this.message=J?J.length+` errors occurred during unsubscription:
`+J.map(function(X,Me){return Me+1+") "+X.toString()}).join(`
`):"",this.name="UnsubscriptionError",this.errors=J}});function arrRemove(W,Y){if(W){var J=W.indexOf(Y);0<=J&&W.splice(J,1)}}var Subscription=function(){function W(Y){this.initialTeardown=Y,this.closed=!1,this._parentage=null,this._finalizers=null}return W.prototype.unsubscribe=function(){var Y,J,X,Me,Se;if(!this.closed){this.closed=!0;var Ne=this._parentage;if(Ne)if(this._parentage=null,Array.isArray(Ne))try{for(var je=__values$1(Ne),ke=je.next();!ke.done;ke=je.next()){var De=ke.value;De.remove(this)}}catch(Ye){Y={error:Ye}}finally{try{ke&&!ke.done&&(J=je.return)&&J.call(je)}finally{if(Y)throw Y.error}}else Ne.remove(this);var qe=this.initialTeardown;if(isFunction(qe))try{qe()}catch(Ye){Se=Ye instanceof UnsubscriptionError?Ye.errors:[Ye]}var Ue=this._finalizers;if(Ue){this._finalizers=null;try{for(var Ge=__values$1(Ue),He=Ge.next();!He.done;He=Ge.next()){var Ve=He.value;try{execFinalizer(Ve)}catch(Ye){Se=Se??[],Ye instanceof UnsubscriptionError?Se=__spreadArray$1(__spreadArray$1([],__read$1(Se)),__read$1(Ye.errors)):Se.push(Ye)}}}catch(Ye){X={error:Ye}}finally{try{He&&!He.done&&(Me=Ge.return)&&Me.call(Ge)}finally{if(X)throw X.error}}}if(Se)throw new UnsubscriptionError(Se)}},W.prototype.add=function(Y){var J;if(Y&&Y!==this)if(this.closed)execFinalizer(Y);else{if(Y instanceof W){if(Y.closed||Y._hasParent(this))return;Y._addParent(this)}(this._finalizers=(J=this._finalizers)!==null&&J!==void 0?J:[]).push(Y)}},W.prototype._hasParent=function(Y){var J=this._parentage;return J===Y||Array.isArray(J)&&J.includes(Y)},W.prototype._addParent=function(Y){var J=this._parentage;this._parentage=Array.isArray(J)?(J.push(Y),J):J?[J,Y]:Y},W.prototype._removeParent=function(Y){var J=this._parentage;J===Y?this._parentage=null:Array.isArray(J)&&arrRemove(J,Y)},W.prototype.remove=function(Y){var J=this._finalizers;J&&arrRemove(J,Y),Y instanceof W&&Y._removeParent(this)},W.EMPTY=function(){var Y=new W;return Y.closed=!0,Y}(),W}(),EMPTY_SUBSCRIPTION=Subscription.EMPTY;function isSubscription(W){return W instanceof Subscription||W&&"closed"in W&&isFunction(W.remove)&&isFunction(W.add)&&isFunction(W.unsubscribe)}function execFinalizer(W){isFunction(W)?W():W.unsubscribe()}var config$1={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},timeoutProvider={setTimeout:function(W,Y){for(var J=[],X=2;X<arguments.length;X++)J[X-2]=arguments[X];return setTimeout.apply(void 0,__spreadArray$1([W,Y],__read$1(J)))},clearTimeout:function(W){return clearTimeout(W)},delegate:void 0};function reportUnhandledError(W){timeoutProvider.setTimeout(function(){throw W})}function noop(){}function errorContext(W){W()}var Subscriber=function(W){__extends$2(Y,W);function Y(J){var X=W.call(this)||this;return X.isStopped=!1,J?(X.destination=J,isSubscription(J)&&J.add(X)):X.destination=EMPTY_OBSERVER,X}return Y.create=function(J,X,Me){return new SafeSubscriber(J,X,Me)},Y.prototype.next=function(J){this.isStopped||this._next(J)},Y.prototype.error=function(J){this.isStopped||(this.isStopped=!0,this._error(J))},Y.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Y.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,W.prototype.unsubscribe.call(this),this.destination=null)},Y.prototype._next=function(J){this.destination.next(J)},Y.prototype._error=function(J){try{this.destination.error(J)}finally{this.unsubscribe()}},Y.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Y}(Subscription),ConsumerObserver=function(){function W(Y){this.partialObserver=Y}return W.prototype.next=function(Y){var J=this.partialObserver;if(J.next)try{J.next(Y)}catch(X){handleUnhandledError(X)}},W.prototype.error=function(Y){var J=this.partialObserver;if(J.error)try{J.error(Y)}catch(X){handleUnhandledError(X)}else handleUnhandledError(Y)},W.prototype.complete=function(){var Y=this.partialObserver;if(Y.complete)try{Y.complete()}catch(J){handleUnhandledError(J)}},W}(),SafeSubscriber=function(W){__extends$2(Y,W);function Y(J,X,Me){var Se=W.call(this)||this,Ne;return isFunction(J)||!J?Ne={next:J??void 0,error:X??void 0,complete:Me??void 0}:Ne=J,Se.destination=new ConsumerObserver(Ne),Se}return Y}(Subscriber);function handleUnhandledError(W){reportUnhandledError(W)}function defaultErrorHandler(W){throw W}var EMPTY_OBSERVER={closed:!0,next:noop,error:defaultErrorHandler,complete:noop},observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function identity$1(W){return W}function pipeFromArray(W){return W.length===0?identity$1:W.length===1?W[0]:function(J){return W.reduce(function(X,Me){return Me(X)},J)}}var Observable=function(){function W(Y){Y&&(this._subscribe=Y)}return W.prototype.lift=function(Y){var J=new W;return J.source=this,J.operator=Y,J},W.prototype.subscribe=function(Y,J,X){var Me=this,Se=isSubscriber(Y)?Y:new SafeSubscriber(Y,J,X);return errorContext(function(){var Ne=Me,je=Ne.operator,ke=Ne.source;Se.add(je?je.call(Se,ke):ke?Me._subscribe(Se):Me._trySubscribe(Se))}),Se},W.prototype._trySubscribe=function(Y){try{return this._subscribe(Y)}catch(J){Y.error(J)}},W.prototype.forEach=function(Y,J){var X=this;return J=getPromiseCtor(J),new J(function(Me,Se){var Ne=new SafeSubscriber({next:function(je){try{Y(je)}catch(ke){Se(ke),Ne.unsubscribe()}},error:Se,complete:Me});X.subscribe(Ne)})},W.prototype._subscribe=function(Y){var J;return(J=this.source)===null||J===void 0?void 0:J.subscribe(Y)},W.prototype[observable]=function(){return this},W.prototype.pipe=function(){for(var Y=[],J=0;J<arguments.length;J++)Y[J]=arguments[J];return pipeFromArray(Y)(this)},W.prototype.toPromise=function(Y){var J=this;return Y=getPromiseCtor(Y),new Y(function(X,Me){var Se;J.subscribe(function(Ne){return Se=Ne},function(Ne){return Me(Ne)},function(){return X(Se)})})},W.create=function(Y){return new W(Y)},W}();function getPromiseCtor(W){var Y;return(Y=W??config$1.Promise)!==null&&Y!==void 0?Y:Promise}function isObserver(W){return W&&isFunction(W.next)&&isFunction(W.error)&&isFunction(W.complete)}function isSubscriber(W){return W&&W instanceof Subscriber||isObserver(W)&&isSubscription(W)}function hasLift(W){return isFunction(W==null?void 0:W.lift)}function operate(W){return function(Y){if(hasLift(Y))return Y.lift(function(J){try{return W(J,this)}catch(X){this.error(X)}});throw new TypeError("Unable to lift unknown Observable type")}}function createOperatorSubscriber(W,Y,J,X,Me){return new OperatorSubscriber(W,Y,J,X,Me)}var OperatorSubscriber=function(W){__extends$2(Y,W);function Y(J,X,Me,Se,Ne,je){var ke=W.call(this,J)||this;return ke.onFinalize=Ne,ke.shouldUnsubscribe=je,ke._next=X?function(De){try{X(De)}catch(qe){J.error(qe)}}:W.prototype._next,ke._error=Se?function(De){try{Se(De)}catch(qe){J.error(qe)}finally{this.unsubscribe()}}:W.prototype._error,ke._complete=Me?function(){try{Me()}catch(De){J.error(De)}finally{this.unsubscribe()}}:W.prototype._complete,ke}return Y.prototype.unsubscribe=function(){var J;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var X=this.closed;W.prototype.unsubscribe.call(this),!X&&((J=this.onFinalize)===null||J===void 0||J.call(this))}},Y}(Subscriber),ObjectUnsubscribedError=createErrorClass(function(W){return function(){W(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Subject=function(W){__extends$2(Y,W);function Y(){var J=W.call(this)||this;return J.closed=!1,J.currentObservers=null,J.observers=[],J.isStopped=!1,J.hasError=!1,J.thrownError=null,J}return Y.prototype.lift=function(J){var X=new AnonymousSubject(this,this);return X.operator=J,X},Y.prototype._throwIfClosed=function(){if(this.closed)throw new ObjectUnsubscribedError},Y.prototype.next=function(J){var X=this;errorContext(function(){var Me,Se;if(X._throwIfClosed(),!X.isStopped){X.currentObservers||(X.currentObservers=Array.from(X.observers));try{for(var Ne=__values$1(X.currentObservers),je=Ne.next();!je.done;je=Ne.next()){var ke=je.value;ke.next(J)}}catch(De){Me={error:De}}finally{try{je&&!je.done&&(Se=Ne.return)&&Se.call(Ne)}finally{if(Me)throw Me.error}}}})},Y.prototype.error=function(J){var X=this;errorContext(function(){if(X._throwIfClosed(),!X.isStopped){X.hasError=X.isStopped=!0,X.thrownError=J;for(var Me=X.observers;Me.length;)Me.shift().error(J)}})},Y.prototype.complete=function(){var J=this;errorContext(function(){if(J._throwIfClosed(),!J.isStopped){J.isStopped=!0;for(var X=J.observers;X.length;)X.shift().complete()}})},Y.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(Y.prototype,"observed",{get:function(){var J;return((J=this.observers)===null||J===void 0?void 0:J.length)>0},enumerable:!1,configurable:!0}),Y.prototype._trySubscribe=function(J){return this._throwIfClosed(),W.prototype._trySubscribe.call(this,J)},Y.prototype._subscribe=function(J){return this._throwIfClosed(),this._checkFinalizedStatuses(J),this._innerSubscribe(J)},Y.prototype._innerSubscribe=function(J){var X=this,Me=this,Se=Me.hasError,Ne=Me.isStopped,je=Me.observers;return Se||Ne?EMPTY_SUBSCRIPTION:(this.currentObservers=null,je.push(J),new Subscription(function(){X.currentObservers=null,arrRemove(je,J)}))},Y.prototype._checkFinalizedStatuses=function(J){var X=this,Me=X.hasError,Se=X.thrownError,Ne=X.isStopped;Me?J.error(Se):Ne&&J.complete()},Y.prototype.asObservable=function(){var J=new Observable;return J.source=this,J},Y.create=function(J,X){return new AnonymousSubject(J,X)},Y}(Observable),AnonymousSubject=function(W){__extends$2(Y,W);function Y(J,X){var Me=W.call(this)||this;return Me.destination=J,Me.source=X,Me}return Y.prototype.next=function(J){var X,Me;(Me=(X=this.destination)===null||X===void 0?void 0:X.next)===null||Me===void 0||Me.call(X,J)},Y.prototype.error=function(J){var X,Me;(Me=(X=this.destination)===null||X===void 0?void 0:X.error)===null||Me===void 0||Me.call(X,J)},Y.prototype.complete=function(){var J,X;(X=(J=this.destination)===null||J===void 0?void 0:J.complete)===null||X===void 0||X.call(J)},Y.prototype._subscribe=function(J){var X,Me;return(Me=(X=this.source)===null||X===void 0?void 0:X.subscribe(J))!==null&&Me!==void 0?Me:EMPTY_SUBSCRIPTION},Y}(Subject),BehaviorSubject=function(W){__extends$2(Y,W);function Y(J){var X=W.call(this)||this;return X._value=J,X}return Object.defineProperty(Y.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),Y.prototype._subscribe=function(J){var X=W.prototype._subscribe.call(this,J);return!X.closed&&J.next(this._value),X},Y.prototype.getValue=function(){var J=this,X=J.hasError,Me=J.thrownError,Se=J._value;if(X)throw Me;return this._throwIfClosed(),Se},Y.prototype.next=function(J){W.prototype.next.call(this,this._value=J)},Y}(Subject);function scanInternals(W,Y,J,X,Me){return function(Se,Ne){var je=J,ke=Y,De=0;Se.subscribe(createOperatorSubscriber(Ne,function(qe){var Ue=De++;ke=je?W(ke,qe,Ue):(je=!0,qe),Ne.next(ke)},Me))}}function scan(W,Y){return operate(scanInternals(W,Y,arguments.length>=2,!0))}var integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"],EncodeBuffer=function(){function W(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return W.prototype.resize_if_necessary=function(Y){if(this.buffer_size-this.offset<Y){this.buffer_size=Math.max(this.buffer_size*2,this.buffer_size+Y);var J=new ArrayBuffer(this.buffer_size);new Uint8Array(J).set(new Uint8Array(this.buffer)),this.buffer=J,this.view=new DataView(J)}},W.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},W.prototype.store_value=function(Y,J){var X=J.substring(1),Me=parseInt(X)/8;this.resize_if_necessary(Me);var Se=J[0]==="f"?"setFloat".concat(X):J[0]==="i"?"setInt".concat(X):"setUint".concat(X);this.view[Se](this.offset,Y,!0),this.offset+=Me},W.prototype.store_bytes=function(Y){this.resize_if_necessary(Y.length),new Uint8Array(this.buffer).set(new Uint8Array(Y),this.offset),this.offset+=Y.length},W}(),__extends$1=function(){var W=function(Y,J){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,Me){X.__proto__=Me}||function(X,Me){for(var Se in Me)Object.prototype.hasOwnProperty.call(Me,Se)&&(X[Se]=Me[Se])},W(Y,J)};return function(Y,J){if(typeof J!="function"&&J!==null)throw new TypeError("Class extends value "+String(J)+" is not a constructor or null");W(Y,J);function X(){this.constructor=Y}Y.prototype=J===null?Object.create(J):(X.prototype=J.prototype,new X)}}();function isArrayLike(W){return Array.isArray(W)||!!W&&typeof W=="object"&&"length"in W&&typeof W.length=="number"&&(W.length===0||W.length>0&&W.length-1 in W)}function expect_type(W,Y,J){if(typeof W!==Y)throw new Error("Expected ".concat(Y," not ").concat(typeof W,"(").concat(W,") at ").concat(J.join(".")))}function expect_bigint(W,Y){var J=["number","string","bigint","boolean"].includes(typeof W),X=typeof W=="object"&&W!==null&&"toString"in W;if(!J&&!X)throw new Error("Expected bigint, number, boolean or string not ".concat(typeof W,"(").concat(W,") at ").concat(Y.join(".")))}function expect_same_size(W,Y,J){if(W!==Y)throw new Error("Array length ".concat(W," does not match schema length ").concat(Y," at ").concat(J.join(".")))}function expect_enum(W,Y){if(typeof W!="object"||W===null)throw new Error("Expected object not ".concat(typeof W,"(").concat(W,") at ").concat(Y.join(".")))}var VALID_STRING_TYPES=integers.concat(["bool","string"]),VALID_OBJECT_KEYS=["option","enum","array","set","map","struct"],ErrorSchema=function(W){__extends$1(Y,W);function Y(J,X){var Me="Invalid schema: ".concat(JSON.stringify(J)," expected ").concat(X);return W.call(this,Me)||this}return Y}(Error);function validate_schema(W){if(!(typeof W=="string"&&VALID_STRING_TYPES.includes(W))){if(W&&typeof W=="object"){var Y=Object.keys(W);if(Y.length===1&&VALID_OBJECT_KEYS.includes(Y[0])){var J=Y[0];if(J==="option")return validate_schema(W[J]);if(J==="enum")return validate_enum_schema(W[J]);if(J==="array")return validate_array_schema(W[J]);if(J==="set")return validate_schema(W[J]);if(J==="map")return validate_map_schema(W[J]);if(J==="struct")return validate_struct_schema(W[J])}}throw new ErrorSchema(W,VALID_OBJECT_KEYS.join(", ")+" or "+VALID_STRING_TYPES.join(", "))}}function validate_enum_schema(W){if(!Array.isArray(W))throw new ErrorSchema(W,"Array");for(var Y=0,J=W;Y<J.length;Y++){var X=J[Y];if(typeof X!="object"||!("struct"in X))throw new Error('Missing "struct" key in enum schema');if(typeof X.struct!="object"||Object.keys(X.struct).length!==1)throw new Error('The "struct" in each enum must have a single key');validate_schema({struct:X.struct})}}function validate_array_schema(W){if(typeof W!="object")throw new ErrorSchema(W,"{ type, len? }");if(W.len&&typeof W.len!="number")throw new Error("Invalid schema: ".concat(W));if("type"in W)return validate_schema(W.type);throw new ErrorSchema(W,"{ type, len? }")}function validate_map_schema(W){if(typeof W=="object"&&"key"in W&&"value"in W)validate_schema(W.key),validate_schema(W.value);else throw new ErrorSchema(W,"{ key, value }")}function validate_struct_schema(W){if(typeof W!="object")throw new ErrorSchema(W,"object");for(var Y in W)validate_schema(W[Y])}var BorshSerializer=function(){function W(Y){this.encoded=new EncodeBuffer,this.fieldPath=["value"],this.checkTypes=Y}return W.prototype.encode=function(Y,J){return this.encode_value(Y,J),this.encoded.get_used_buffer()},W.prototype.encode_value=function(Y,J){if(typeof J=="string"){if(integers.includes(J))return this.encode_integer(Y,J);if(J==="string")return this.encode_string(Y);if(J==="bool")return this.encode_boolean(Y)}if(typeof J=="object"){if("option"in J)return this.encode_option(Y,J);if("enum"in J)return this.encode_enum(Y,J);if("array"in J)return this.encode_array(Y,J);if("set"in J)return this.encode_set(Y,J);if("map"in J)return this.encode_map(Y,J);if("struct"in J)return this.encode_struct(Y,J)}},W.prototype.encode_integer=function(Y,J){var X=parseInt(J.substring(1));X<=32||J=="f64"?(this.checkTypes&&expect_type(Y,"number",this.fieldPath),this.encoded.store_value(Y,J)):(this.checkTypes&&expect_bigint(Y,this.fieldPath),this.encode_bigint(BigInt(Y),X))},W.prototype.encode_bigint=function(Y,J){for(var X=J/8,Me=new Uint8Array(X),Se=0;Se<X;Se++)Me[Se]=Number(Y&BigInt(255)),Y=Y>>BigInt(8);this.encoded.store_bytes(new Uint8Array(Me))},W.prototype.encode_string=function(Y){this.checkTypes&&expect_type(Y,"string",this.fieldPath);var J=Y;this.encoded.store_value(J.length,"u32");for(var X=0;X<J.length;X++)this.encoded.store_value(J.charCodeAt(X),"u8")},W.prototype.encode_boolean=function(Y){this.checkTypes&&expect_type(Y,"boolean",this.fieldPath),this.encoded.store_value(Y?1:0,"u8")},W.prototype.encode_option=function(Y,J){Y==null?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(Y,J.option))},W.prototype.encode_enum=function(Y,J){this.checkTypes&&expect_enum(Y,this.fieldPath);for(var X=Object.keys(Y)[0],Me=0;Me<J.enum.length;Me++){var Se=J.enum[Me];if(X===Object.keys(Se.struct)[0])return this.encoded.store_value(Me,"u8"),this.encode_struct(Y,Se)}throw new Error("Enum key (".concat(X,") not found in enum schema: ").concat(JSON.stringify(J)," at ").concat(this.fieldPath.join(".")))},W.prototype.encode_array=function(Y,J){if(isArrayLike(Y))return this.encode_arraylike(Y,J);if(Y instanceof ArrayBuffer)return this.encode_buffer(Y,J);throw new Error("Expected Array-like not ".concat(typeof Y,"(").concat(Y,") at ").concat(this.fieldPath.join(".")))},W.prototype.encode_arraylike=function(Y,J){J.array.len?expect_same_size(Y.length,J.array.len,this.fieldPath):this.encoded.store_value(Y.length,"u32");for(var X=0;X<Y.length;X++)this.encode_value(Y[X],J.array.type)},W.prototype.encode_buffer=function(Y,J){J.array.len?expect_same_size(Y.byteLength,J.array.len,this.fieldPath):this.encoded.store_value(Y.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(Y))},W.prototype.encode_set=function(Y,J){this.checkTypes&&expect_type(Y,"object",this.fieldPath);var X=Y instanceof Set,Me=X?Array.from(Y.values()):Object.values(Y);this.encoded.store_value(Me.length,"u32");for(var Se=0,Ne=Me;Se<Ne.length;Se++){var je=Ne[Se];this.encode_value(je,J.set)}},W.prototype.encode_map=function(Y,J){this.checkTypes&&expect_type(Y,"object",this.fieldPath);var X=Y instanceof Map,Me=X?Array.from(Y.keys()):Object.keys(Y);this.encoded.store_value(Me.length,"u32");for(var Se=0,Ne=Me;Se<Ne.length;Se++){var je=Ne[Se];this.encode_value(je,J.map.key),this.encode_value(X?Y.get(je):Y[je],J.map.value)}},W.prototype.encode_struct=function(Y,J){this.checkTypes&&expect_type(Y,"object",this.fieldPath);for(var X=0,Me=Object.keys(J.struct);X<Me.length;X++){var Se=Me[X];this.fieldPath.push(Se),this.encode_value(Y[Se],J.struct[Se]),this.fieldPath.pop()}},W}();function serialize$3(W,Y,J){J===void 0&&(J=!0),J&&validate_schema(W);var X=new BorshSerializer(J);return X.encode(Y,W)}var sha256$4={exports:{}};/**
* [js-sha256]{@link https://github.com/emn178/js-sha256}
*
* @version 0.9.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/var hasRequiredSha256$2;function requireSha256$2(){return hasRequiredSha256$2||(hasRequiredSha256$2=1,function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=globalThis:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(W){return Object.prototype.toString.call(W)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(W){return typeof W=="object"&&W.buffer&&W.buffer.constructor===ArrayBuffer});var createOutputMethod=function(W,Y){return function(J){return new Sha256(Y,!0).update(J)[W]()}},createMethod=function(W){var Y=createOutputMethod("hex",W);NODE_JS&&(Y=nodeWrap(Y,W)),Y.create=function(){return new Sha256(W)},Y.update=function(Me){return Y.create().update(Me)};for(var J=0;J<OUTPUT_TYPES.length;++J){var X=OUTPUT_TYPES[J];Y[X]=createOutputMethod(X,W)}return Y},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(W){if(typeof W=="string")return crypto.createHash(algorithm).update(W,"utf8").digest("hex");if(W==null)throw new Error(ERROR);return W.constructor===ArrayBuffer&&(W=new Uint8Array(W)),Array.isArray(W)||ArrayBuffer.isView(W)||W.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(W)).digest("hex"):method(W)};return nodeMethod},createHmacOutputMethod=function(W,Y){return function(J,X){return new HmacSha256(J,Y,!0).update(X)[W]()}},createHmacMethod=function(W){var Y=createHmacOutputMethod("hex",W);Y.create=function(Me){return new HmacSha256(Me,W)},Y.update=function(Me,Se){return Y.create(Me).update(Se)};for(var J=0;J<OUTPUT_TYPES.length;++J){var X=OUTPUT_TYPES[J];Y[X]=createHmacOutputMethod(X,W)}return Y};function Sha256(W,Y){Y?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],W?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=W}Sha256.prototype.update=function(W){if(!this.finalized){var Y,J=typeof W;if(J!=="string"){if(J==="object"){if(W===null)throw new Error(ERROR);if(ARRAY_BUFFER&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(W)))throw new Error(ERROR)}else throw new Error(ERROR);Y=!0}for(var X,Me=0,Se,Ne=W.length,je=this.blocks;Me<Ne;){if(this.hashed&&(this.hashed=!1,je[0]=this.block,je[16]=je[1]=je[2]=je[3]=je[4]=je[5]=je[6]=je[7]=je[8]=je[9]=je[10]=je[11]=je[12]=je[13]=je[14]=je[15]=0),Y)for(Se=this.start;Me<Ne&&Se<64;++Me)je[Se>>2]|=W[Me]<<SHIFT[Se++&3];else for(Se=this.start;Me<Ne&&Se<64;++Me)X=W.charCodeAt(Me),X<128?je[Se>>2]|=X<<SHIFT[Se++&3]:X<2048?(je[Se>>2]|=(192|X>>6)<<SHIFT[Se++&3],je[Se>>2]|=(128|X&63)<<SHIFT[Se++&3]):X<55296||X>=57344?(je[Se>>2]|=(224|X>>12)<<SHIFT[Se++&3],je[Se>>2]|=(128|X>>6&63)<<SHIFT[Se++&3],je[Se>>2]|=(128|X&63)<<SHIFT[Se++&3]):(X=65536+((X&1023)<<10|W.charCodeAt(++Me)&1023),je[Se>>2]|=(240|X>>18)<<SHIFT[Se++&3],je[Se>>2]|=(128|X>>12&63)<<SHIFT[Se++&3],je[Se>>2]|=(128|X>>6&63)<<SHIFT[Se++&3],je[Se>>2]|=(128|X&63)<<SHIFT[Se++&3]);this.lastByteIndex=Se,this.bytes+=Se-this.start,Se>=64?(this.block=je[16],this.start=Se-64,this.hash(),this.hashed=!0):this.start=Se}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var W=this.blocks,Y=this.lastByteIndex;W[16]=this.block,W[Y>>2]|=EXTRA[Y&3],this.block=W[16],Y>=56&&(this.hashed||this.hash(),W[0]=this.block,W[16]=W[1]=W[2]=W[3]=W[4]=W[5]=W[6]=W[7]=W[8]=W[9]=W[10]=W[11]=W[12]=W[13]=W[14]=W[15]=0),W[14]=this.hBytes<<3|this.bytes>>>29,W[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var W=this.h0,Y=this.h1,J=this.h2,X=this.h3,Me=this.h4,Se=this.h5,Ne=this.h6,je=this.h7,ke=this.blocks,De,qe,Ue,Ge,He,Ve,Ye,Fn,io,$o,Jo;for(De=16;De<64;++De)He=ke[De-15],qe=(He>>>7|He<<25)^(He>>>18|He<<14)^He>>>3,He=ke[De-2],Ue=(He>>>17|He<<15)^(He>>>19|He<<13)^He>>>10,ke[De]=ke[De-16]+qe+ke[De-7]+Ue<<0;for(Jo=Y&J,De=0;De<64;De+=4)this.first?(this.is224?(Fn=300032,He=ke[0]-1413257819,je=He-150054599<<0,X=He+24177077<<0):(Fn=704751109,He=ke[0]-210244248,je=He-1521486534<<0,X=He+143694565<<0),this.first=!1):(qe=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),Ue=(Me>>>6|Me<<26)^(Me>>>11|Me<<21)^(Me>>>25|Me<<7),Fn=W&Y,Ge=Fn^W&J^Jo,Ye=Me&Se^~Me&Ne,He=je+Ue+Ye+K[De]+ke[De],Ve=qe+Ge,je=X+He<<0,X=He+Ve<<0),qe=(X>>>2|X<<30)^(X>>>13|X<<19)^(X>>>22|X<<10),Ue=(je>>>6|je<<26)^(je>>>11|je<<21)^(je>>>25|je<<7),io=X&W,Ge=io^X&Y^Fn,Ye=je&Me^~je&Se,He=Ne+Ue+Ye+K[De+1]+ke[De+1],Ve=qe+Ge,Ne=J+He<<0,J=He+Ve<<0,qe=(J>>>2|J<<30)^(J>>>13|J<<19)^(J>>>22|J<<10),Ue=(Ne>>>6|Ne<<26)^(Ne>>>11|Ne<<21)^(Ne>>>25|Ne<<7),$o=J&X,Ge=$o^J&W^io,Ye=Ne&je^~Ne&Me,He=Se+Ue+Ye+K[De+2]+ke[De+2],Ve=qe+Ge,Se=Y+He<<0,Y=He+Ve<<0,qe=(Y>>>2|Y<<30)^(Y>>>13|Y<<19)^(Y>>>22|Y<<10),Ue=(Se>>>6|Se<<26)^(Se>>>11|Se<<21)^(Se>>>25|Se<<7),Jo=Y&J,Ge=Jo^Y&X^$o,Ye=Se&Ne^~Se&je,He=Me+Ue+Ye+K[De+3]+ke[De+3],Ve=qe+Ge,Me=W+He<<0,W=He+Ve<<0;this.h0=this.h0+W<<0,this.h1=this.h1+Y<<0,this.h2=this.h2+J<<0,this.h3=this.h3+X<<0,this.h4=this.h4+Me<<0,this.h5=this.h5+Se<<0,this.h6=this.h6+Ne<<0,this.h7=this.h7+je<<0},Sha256.prototype.hex=function(){this.finalize();var W=this.h0,Y=this.h1,J=this.h2,X=this.h3,Me=this.h4,Se=this.h5,Ne=this.h6,je=this.h7,ke=HEX_CHARS[W>>28&15]+HEX_CHARS[W>>24&15]+HEX_CHARS[W>>20&15]+HEX_CHARS[W>>16&15]+HEX_CHARS[W>>12&15]+HEX_CHARS[W>>8&15]+HEX_CHARS[W>>4&15]+HEX_CHARS[W&15]+HEX_CHARS[Y>>28&15]+HEX_CHARS[Y>>24&15]+HEX_CHARS[Y>>20&15]+HEX_CHARS[Y>>16&15]+HEX_CHARS[Y>>12&15]+HEX_CHARS[Y>>8&15]+HEX_CHARS[Y>>4&15]+HEX_CHARS[Y&15]+HEX_CHARS[J>>28&15]+HEX_CHARS[J>>24&15]+HEX_CHARS[J>>20&15]+HEX_CHARS[J>>16&15]+HEX_CHARS[J>>12&15]+HEX_CHARS[J>>8&15]+HEX_CHARS[J>>4&15]+HEX_CHARS[J&15]+HEX_CHARS[X>>28&15]+HEX_CHARS[X>>24&15]+HEX_CHARS[X>>20&15]+HEX_CHARS[X>>16&15]+HEX_CHARS[X>>12&15]+HEX_CHARS[X>>8&15]+HEX_CHARS[X>>4&15]+HEX_CHARS[X&15]+HEX_CHARS[Me>>28&15]+HEX_CHARS[Me>>24&15]+HEX_CHARS[Me>>20&15]+HEX_CHARS[Me>>16&15]+HEX_CHARS[Me>>12&15]+HEX_CHARS[Me>>8&15]+HEX_CHARS[Me>>4&15]+HEX_CHARS[Me&15]+HEX_CHARS[Se>>28&15]+HEX_CHARS[Se>>24&15]+HEX_CHARS[Se>>20&15]+HEX_CHARS[Se>>16&15]+HEX_CHARS[Se>>12&15]+HEX_CHARS[Se>>8&15]+HEX_CHARS[Se>>4&15]+HEX_CHARS[Se&15]+HEX_CHARS[Ne>>28&15]+HEX_CHARS[Ne>>24&15]+HEX_CHARS[Ne>>20&15]+HEX_CHARS[Ne>>16&15]+HEX_CHARS[Ne>>12&15]+HEX_CHARS[Ne>>8&15]+HEX_CHARS[Ne>>4&15]+HEX_CHARS[Ne&15];return this.is224||(ke+=HEX_CHARS[je>>28&15]+HEX_CHARS[je>>24&15]+HEX_CHARS[je>>20&15]+HEX_CHARS[je>>16&15]+HEX_CHARS[je>>12&15]+HEX_CHARS[je>>8&15]+HEX_CHARS[je>>4&15]+HEX_CHARS[je&15]),ke},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var W=this.h0,Y=this.h1,J=this.h2,X=this.h3,Me=this.h4,Se=this.h5,Ne=this.h6,je=this.h7,ke=[W>>24&255,W>>16&255,W>>8&255,W&255,Y>>24&255,Y>>16&255,Y>>8&255,Y&255,J>>24&255,J>>16&255,J>>8&255,J&255,X>>24&255,X>>16&255,X>>8&255,X&255,Me>>24&255,Me>>16&255,Me>>8&255,Me&255,Se>>24&255,Se>>16&255,Se>>8&255,Se&255,Ne>>24&255,Ne>>16&255,Ne>>8&255,Ne&255];return this.is224||ke.push(je>>24&255,je>>16&255,je>>8&255,je&255),ke},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var W=new ArrayBuffer(this.is224?28:32),Y=new DataView(W);return Y.setUint32(0,this.h0),Y.setUint32(4,this.h1),Y.setUint32(8,this.h2),Y.setUint32(12,this.h3),Y.setUint32(16,this.h4),Y.setUint32(20,this.h5),Y.setUint32(24,this.h6),this.is224||Y.setUint32(28,this.h7),W};function HmacSha256(W,Y,J){var X,Me=typeof W;if(Me==="string"){var Se=[],Ne=W.length,je=0,ke;for(X=0;X<Ne;++X)ke=W.charCodeAt(X),ke<128?Se[je++]=ke:ke<2048?(Se[je++]=192|ke>>6,Se[je++]=128|ke&63):ke<55296||ke>=57344?(Se[je++]=224|ke>>12,Se[je++]=128|ke>>6&63,Se[je++]=128|ke&63):(ke=65536+((ke&1023)<<10|W.charCodeAt(++X)&1023),Se[je++]=240|ke>>18,Se[je++]=128|ke>>12&63,Se[je++]=128|ke>>6&63,Se[je++]=128|ke&63);W=Se}else if(Me==="object"){if(W===null)throw new Error(ERROR);if(ARRAY_BUFFER&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(W)))throw new Error(ERROR)}else throw new Error(ERROR);W.length>64&&(W=new Sha256(Y,!0).update(W).array());var De=[],qe=[];for(X=0;X<64;++X){var Ue=W[X]||0;De[X]=92^Ue,qe[X]=54^Ue}Sha256.call(this,Y,J),this.update(qe),this.oKeyPad=De,this.inner=!0,this.sharedMemory=J}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var W=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(W),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()}(sha256$4)),sha256$4.exports}var sha256Exports$1=requireSha256$2();function __awaiter$e(W,Y,J,X){function Me(Se){return Se instanceof J?Se:new J(function(Ne){Ne(Se)})}return new(J||(J=Promise))(function(Se,Ne){function je(qe){try{De(X.next(qe))}catch(Ue){Ne(Ue)}}function ke(qe){try{De(X.throw(qe))}catch(Ue){Ne(Ue)}}function De(qe){qe.done?Se(qe.value):Me(qe.value).then(je,ke)}De((X=X.apply(W,[])).next())})}typeof SuppressedError=="function"&&SuppressedError;class Provider{constructor(Y){this.provider=new browserIndexExports$1.providers.FailoverRpcProvider(this.urlsToProviders(Y))}query(Y,J){return typeof Y=="string"&&J!==void 0?this.provider.query(Y,J):this.provider.query(Y)}viewAccessKey({accountId:Y,publicKey:J}){return this.query({request_type:"view_access_key",finality:"final",account_id:Y,public_key:J})}block(Y){return this.provider.block(Y)}sendTransaction(Y){return this.provider.sendTransaction(Y)}urlsToProviders(Y){return Y&&Y.length>0?Y.map(J=>new providersExports$1.JsonRpcProvider({url:J})):[]}}const KEY_DELIMITER=":";class JsonStorage{constructor(Y,J){this.storage=Y,this.namespace=Array.isArray(J)?J.join(KEY_DELIMITER):J}resolveKey(Y){return[this.namespace,Y].join(KEY_DELIMITER)}getItem(Y){return this.storage.getItem(this.resolveKey(Y)).then(J=>typeof J=="string"?JSON.parse(J):null)}setItem(Y,J){return this.storage.setItem(this.resolveKey(Y),JSON.stringify(J))}removeItem(Y){return this.storage.removeItem(this.resolveKey(Y))}}var commonjsGlobal$b=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},check$b=function(W){return W&&W.Math==Math&&W},global$n$1=check$b(typeof globalThis=="object"&&globalThis)||check$b(typeof window=="object"&&window)||check$b(typeof self=="object"&&self)||check$b(typeof commonjsGlobal$b=="object"&&commonjsGlobal$b)||Function("return this")(),objectGetOwnPropertyDescriptor$b={},fails$h$2=function(W){try{return!!W()}catch{return!0}},fails$g$2=fails$h$2,descriptors$b=!fails$g$2(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),objectPropertyIsEnumerable$b={},nativePropertyIsEnumerable$b={}.propertyIsEnumerable,getOwnPropertyDescriptor$2$6=Object.getOwnPropertyDescriptor,NASHORN_BUG$b=getOwnPropertyDescriptor$2$6&&!nativePropertyIsEnumerable$b.call({1:2},1);objectPropertyIsEnumerable$b.f=NASHORN_BUG$b?function W(Y){var J=getOwnPropertyDescriptor$2$6(this,Y);return!!J&&J.enumerable}:nativePropertyIsEnumerable$b;var createPropertyDescriptor$4$4=function(W,Y){return{enumerable:!(W&1),configurable:!(W&2),writable:!(W&4),value:Y}},toString$c={}.toString,classofRaw$1$7=function(W){return toString$c.call(W).slice(8,-1)},fails$f$2=fails$h$2,classof$9$2=classofRaw$1$7,split$d="".split,indexedObject$b=fails$f$2(function(){return!Object("z").propertyIsEnumerable(0)})?function(W){return classof$9$2(W)=="String"?split$d.call(W,""):Object(W)}:Object,requireObjectCoercible$4$4=function(W){if(W==null)throw TypeError("Can't call method on "+W);return W},IndexedObject$3$2=indexedObject$b,requireObjectCoercible$3$6=requireObjectCoercible$4$4,toIndexedObject$4$8=function(W){return IndexedObject$3$2(requireObjectCoercible$3$6(W))},isObject$c$2=function(W){return typeof W=="object"?W!==null:typeof W=="function"},isObject$b$2=isObject$c$2,toPrimitive$3$4=function(W,Y){if(!isObject$b$2(W))return W;var J,X;if(Y&&typeof(J=W.toString)=="function"&&!isObject$b$2(X=J.call(W))||typeof(J=W.valueOf)=="function"&&!isObject$b$2(X=J.call(W))||!Y&&typeof(J=W.toString)=="function"&&!isObject$b$2(X=J.call(W)))return X;throw TypeError("Can't convert object to primitive value")},hasOwnProperty$b={}.hasOwnProperty,has$c$2=function(W,Y){return hasOwnProperty$b.call(W,Y)},global$m$1=global$n$1,isObject$a$2=isObject$c$2,document$2$6=global$m$1.document,EXISTS$b=isObject$a$2(document$2$6)&&isObject$a$2(document$2$6.createElement),documentCreateElement$1$8=function(W){return EXISTS$b?document$2$6.createElement(W):{}},DESCRIPTORS$a$2=descriptors$b,fails$e$2=fails$h$2,createElement$1$6=documentCreateElement$1$8,ie8DomDefine$b=!DESCRIPTORS$a$2&&!fails$e$2(function(){return Object.defineProperty(createElement$1$6("div"),"a",{get:function(){return 7}}).a!=7}),DESCRIPTORS$9$3=descriptors$b,propertyIsEnumerableModule$1$a=objectPropertyIsEnumerable$b,createPropertyDescriptor$3$8=createPropertyDescriptor$4$4,toIndexedObject$3$b=toIndexedObject$4$8,toPrimitive$2$b=toPrimitive$3$4,has$b$4=has$c$2,IE8_DOM_DEFINE$1$b=ie8DomDefine$b,nativeGetOwnPropertyDescriptor$1$3=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor$b.f=DESCRIPTORS$9$3?nativeGetOwnPropertyDescriptor$1$3:function W(Y,J){if(Y=toIndexedObject$3$b(Y),J=toPrimitive$2$b(J,!0),IE8_DOM_DEFINE$1$b)try{return nativeGetOwnPropertyDescriptor$1$3(Y,J)}catch{}if(has$b$4(Y,J))return createPropertyDescriptor$3$8(!propertyIsEnumerableModule$1$a.f.call(Y,J),Y[J])};var objectDefineProperty$b={},isObject$9$5=isObject$c$2,anObject$b$6=function(W){if(!isObject$9$5(W))throw TypeError(String(W)+" is not an object");return W},DESCRIPTORS$8$4=descriptors$b,IE8_DOM_DEFINE$c=ie8DomDefine$b,anObject$a$6=anObject$b$6,toPrimitive$1$b=toPrimitive$3$4,nativeDefineProperty$1$3=Object.defineProperty;objectDefineProperty$b.f=DESCRIPTORS$8$4?nativeDefineProperty$1$3:function W(Y,J,X){if(anObject$a$6(Y),J=toPrimitive$1$b(J,!0),anObject$a$6(X),IE8_DOM_DEFINE$c)try{return nativeDefineProperty$1$3(Y,J,X)}catch{}if("get"in X||"set"in X)throw TypeError("Accessors not supported");return"value"in X&&(Y[J]=X.value),Y};var DESCRIPTORS$7$6=descriptors$b,definePropertyModule$5$4=objectDefineProperty$b,createPropertyDescriptor$2$b=createPropertyDescriptor$4$4,createNonEnumerableProperty$a$2=DESCRIPTORS$7$6?function(W,Y,J){return definePropertyModule$5$4.f(W,Y,createPropertyDescriptor$2$b(1,J))}:function(W,Y,J){return W[Y]=J,W},redefine$5$7={exports:{}},global$l$1=global$n$1,createNonEnumerableProperty$9$3=createNonEnumerableProperty$a$2,setGlobal$3$b=function(W,Y){try{createNonEnumerableProperty$9$3(global$l$1,W,Y)}catch{global$l$1[W]=Y}return Y},global$k$1=global$n$1,setGlobal$2$b=setGlobal$3$b,SHARED$b="__core-js_shared__",store$3$b=global$k$1[SHARED$b]||setGlobal$2$b(SHARED$b,{}),sharedStore$b=store$3$b,store$2$b=sharedStore$b,functionToString$b=Function.toString;typeof store$2$b.inspectSource!="function"&&(store$2$b.inspectSource=function(W){return functionToString$b.call(W)});var inspectSource$3$6=store$2$b.inspectSource,global$j$3=global$n$1,inspectSource$2$b=inspectSource$3$6,WeakMap$1$b=global$j$3.WeakMap,nativeWeakMap$b=typeof WeakMap$1$b=="function"&&/native code/.test(inspectSource$2$b(WeakMap$1$b)),shared$2$8={exports:{}},store$1$b=sharedStore$b;(shared$2$8.exports=function(W,Y){return store$1$b[W]||(store$1$b[W]=Y!==void 0?Y:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var id$c=0,postfix$b=Math.random(),uid$3$3=function(W){return"Symbol("+String(W===void 0?"":W)+")_"+(++id$c+postfix$b).toString(36)},shared$1$b=shared$2$8.exports,uid$2$8=uid$3$3,keys$1$3=shared$1$b("keys"),sharedKey$3$8=function(W){return keys$1$3[W]||(keys$1$3[W]=uid$2$8(W))},hiddenKeys$4$8={},NATIVE_WEAK_MAP$b=nativeWeakMap$b,global$i$5=global$n$1,isObject$8$6=isObject$c$2,createNonEnumerableProperty$8$4=createNonEnumerableProperty$a$2,objectHas$b=has$c$2,sharedKey$2$8=sharedKey$3$8,hiddenKeys$3$b=hiddenKeys$4$8,WeakMap$d=global$i$5.WeakMap,set$2$2,get$1$3,has$a$6,enforce$b=function(W){return has$a$6(W)?get$1$3(W):set$2$2(W,{})},getterFor$b=function(W){return function(Y){var J;if(!isObject$8$6(Y)||(J=get$1$3(Y)).type!==W)throw TypeError("Incompatible receiver, "+W+" required");return J}};if(NATIVE_WEAK_MAP$b){var store$e=new WeakMap$d,wmget$b=store$e.get,wmhas$b=store$e.has,wmset$b=store$e.set;set$2$2=function(W,Y){return wmset$b.call(store$e,W,Y),Y},get$1$3=function(W){return wmget$b.call(store$e,W)||{}},has$a$6=function(W){return wmhas$b.call(store$e,W)}}else{var STATE$b=sharedKey$2$8("state");hiddenKeys$3$b[STATE$b]=!0,set$2$2=function(W,Y){return createNonEnumerableProperty$8$4(W,STATE$b,Y),Y},get$1$3=function(W){return objectHas$b(W,STATE$b)?W[STATE$b]:{}},has$a$6=function(W){return objectHas$b(W,STATE$b)}}var internalState$b={set:set$2$2,get:get$1$3,has:has$a$6,enforce:enforce$b,getterFor:getterFor$b},global$h$6=global$n$1,createNonEnumerableProperty$7$8=createNonEnumerableProperty$a$2,has$9$8=has$c$2,setGlobal$1$b=setGlobal$3$b,inspectSource$1$b=inspectSource$3$6,InternalStateModule$4$3=internalState$b,getInternalState$4$2=InternalStateModule$4$3.get,enforceInternalState$b=InternalStateModule$4$3.enforce,TEMPLATE$b=String(String).split("String");(redefine$5$7.exports=function(W,Y,J,X){var Me=X?!!X.unsafe:!1,Se=X?!!X.enumerable:!1,Ne=X?!!X.noTargetGet:!1;if(typeof J=="function"&&(typeof Y=="string"&&!has$9$8(J,"name")&&createNonEnumerableProperty$7$8(J,"name",Y),enforceInternalState$b(J).source=TEMPLATE$b.join(typeof Y=="string"?Y:"")),W===global$h$6){Se?W[Y]=J:setGlobal$1$b(Y,J);return}else Me?!Ne&&W[Y]&&(Se=!0):delete W[Y];Se?W[Y]=J:createNonEnumerableProperty$7$8(W,Y,J)})(Function.prototype,"toString",function W(){return typeof this=="function"&&getInternalState$4$2(this).source||inspectSource$1$b(this)});var global$g$7=global$n$1,path$1$b=global$g$7,path$c=path$1$b,global$f$7=global$n$1,aFunction$6$3=function(W){return typeof W=="function"?W:void 0},getBuiltIn$5$6=function(W,Y){return arguments.length<2?aFunction$6$3(path$c[W])||aFunction$6$3(global$f$7[W]):path$c[W]&&path$c[W][Y]||global$f$7[W]&&global$f$7[W][Y]},objectGetOwnPropertyNames$b={},ceil$b=Math.ceil,floor$1$4=Math.floor,toInteger$5$3=function(W){return isNaN(W=+W)?0:(W>0?floor$1$4:ceil$b)(W)},toInteger$4$4=toInteger$5$3,min$1$b=Math.min,toLength$b$2=function(W){return W>0?min$1$b(toInteger$4$4(W),9007199254740991):0},toInteger$3$5=toInteger$5$3,max$b=Math.max,min$c=Math.min,toAbsoluteIndex$3$3=function(W,Y){var J=toInteger$3$5(W);return J<0?max$b(J+Y,0):min$c(J,Y)},toIndexedObject$2$b=toIndexedObject$4$8,toLength$a$2=toLength$b$2,toAbsoluteIndex$2$3=toAbsoluteIndex$3$3,createMethod$3$2=function(W){return function(Y,J,X){var Me=toIndexedObject$2$b(Y),Se=toLength$a$2(Me.length),Ne=toAbsoluteIndex$2$3(X,Se),je;if(W&&J!=J){for(;Se>Ne;)if(je=Me[Ne++],je!=je)return!0}else for(;Se>Ne;Ne++)if((W||Ne in Me)&&Me[Ne]===J)return W||Ne||0;return!W&&-1}},arrayIncludes$b={includes:createMethod$3$2(!0),indexOf:createMethod$3$2(!1)},has$8$8=has$c$2,toIndexedObject$1$b=toIndexedObject$4$8,indexOf$b=arrayIncludes$b.indexOf,hiddenKeys$2$b=hiddenKeys$4$8,objectKeysInternal$b=function(W,Y){var J=toIndexedObject$1$b(W),X=0,Me=[],Se;for(Se in J)!has$8$8(hiddenKeys$2$b,Se)&&has$8$8(J,Se)&&Me.push(Se);for(;Y.length>X;)has$8$8(J,Se=Y[X++])&&(~indexOf$b(Me,Se)||Me.push(Se));return Me},enumBugKeys$3$8=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1$b=objectKeysInternal$b,enumBugKeys$2$b=enumBugKeys$3$8,hiddenKeys$1$b=enumBugKeys$2$b.concat("length","prototype");objectGetOwnPropertyNames$b.f=Object.getOwnPropertyNames||function W(Y){return internalObjectKeys$1$b(Y,hiddenKeys$1$b)};var objectGetOwnPropertySymbols$b={};objectGetOwnPropertySymbols$b.f=Object.getOwnPropertySymbols;var getBuiltIn$4$6=getBuiltIn$5$6,getOwnPropertyNamesModule$b=objectGetOwnPropertyNames$b,getOwnPropertySymbolsModule$1$a=objectGetOwnPropertySymbols$b,anObject$9$7=anObject$b$6,ownKeys$1$b=getBuiltIn$4$6("Reflect","ownKeys")||function W(Y){var J=getOwnPropertyNamesModule$b.f(anObject$9$7(Y)),X=getOwnPropertySymbolsModule$1$a.f;return X?J.concat(X(Y)):J},has$7$8=has$c$2,ownKeys2$b=ownKeys$1$b,getOwnPropertyDescriptorModule$1$3=objectGetOwnPropertyDescriptor$b,definePropertyModule$4$7=objectDefineProperty$b,copyConstructorProperties$1$b=function(W,Y){for(var J=ownKeys2$b(Y),X=definePropertyModule$4$7.f,Me=getOwnPropertyDescriptorModule$1$3.f,Se=0;Se<J.length;Se++){var Ne=J[Se];has$7$8(W,Ne)||X(W,Ne,Me(Y,Ne))}},fails$d$3=fails$h$2,replacement$b=/#|\.prototype\./,isForced$2$6=function(W,Y){var J=data$d[normalize$c(W)];return J==POLYFILL$b?!0:J==NATIVE$b?!1:typeof Y=="function"?fails$d$3(Y):!!Y},normalize$c=isForced$2$6.normalize=function(W){return String(W).replace(replacement$b,".").toLowerCase()},data$d=isForced$2$6.data={},NATIVE$b=isForced$2$6.NATIVE="N",POLYFILL$b=isForced$2$6.POLYFILL="P",isForced_1$b=isForced$2$6,global$e$7=global$n$1,getOwnPropertyDescriptor$1$b=objectGetOwnPropertyDescriptor$b.f,createNonEnumerableProperty$6$8=createNonEnumerableProperty$a$2,redefine$4$7=redefine$5$7.exports,setGlobal$e=setGlobal$3$b,copyConstructorProperties$c=copyConstructorProperties$1$b,isForced$1$b=isForced_1$b,_export$b=function(W,Y){var J=W.target,X=W.global,Me=W.stat,Se,Ne,je,ke,De,qe;if(X?Ne=global$e$7:Me?Ne=global$e$7[J]||setGlobal$e(J,{}):Ne=(global$e$7[J]||{}).prototype,Ne)for(je in Y){if(De=Y[je],W.noTargetGet?(qe=getOwnPropertyDescriptor$1$b(Ne,je),ke=qe&&qe.value):ke=Ne[je],Se=isForced$1$b(X?je:J+(Me?".":"#")+je,W.forced),!Se&&ke!==void 0){if(typeof De==typeof ke)continue;copyConstructorProperties$c(De,ke)}(W.sham||ke&&ke.sham)&&createNonEnumerableProperty$6$8(De,"sham",!0),redefine$4$7(Ne,je,De,W)}},global$d$8=global$n$1,nativePromiseConstructor$5=global$d$8.Promise,redefine$3$8=redefine$5$7.exports,redefineAll$2$3=function(W,Y,J){for(var X in Y)redefine$3$8(W,X,Y[X],J);return W},fails$c$5=fails$h$2,nativeSymbol$8=!!Object.getOwnPropertySymbols&&!fails$c$5(function(){return!String(Symbol())}),NATIVE_SYMBOL$1$8=nativeSymbol$8,useSymbolAsUid$8=NATIVE_SYMBOL$1$8&&!Symbol.sham&&typeof Symbol.iterator=="symbol",global$c$8=global$n$1,shared$d=shared$2$8.exports,has$6$8=has$c$2,uid$1$b=uid$3$3,NATIVE_SYMBOL$9=nativeSymbol$8,USE_SYMBOL_AS_UID$8=useSymbolAsUid$8,WellKnownSymbolsStore$8=shared$d("wks"),Symbol$1$8=global$c$8.Symbol,createWellKnownSymbol$8=USE_SYMBOL_AS_UID$8?Symbol$1$8:Symbol$1$8&&Symbol$1$8.withoutSetter||uid$1$b,wellKnownSymbol$h$2=function(W){return has$6$8(WellKnownSymbolsStore$8,W)||(NATIVE_SYMBOL$9&&has$6$8(Symbol$1$8,W)?WellKnownSymbolsStore$8[W]=Symbol$1$8[W]:WellKnownSymbolsStore$8[W]=createWellKnownSymbol$8("Symbol."+W)),WellKnownSymbolsStore$8[W]},defineProperty$4$1=objectDefineProperty$b.f,has$5$b=has$c$2,wellKnownSymbol$g$3=wellKnownSymbol$h$2,TO_STRING_TAG$4$2=wellKnownSymbol$g$3("toStringTag"),setToStringTag$4$3=function(W,Y,J){W&&!has$5$b(W=J?W:W.prototype,TO_STRING_TAG$4$2)&&defineProperty$4$1(W,TO_STRING_TAG$4$2,{configurable:!0,value:Y})},getBuiltIn$3$7=getBuiltIn$5$6,definePropertyModule$3$8=objectDefineProperty$b,wellKnownSymbol$f$5=wellKnownSymbol$h$2,DESCRIPTORS$6$6=descriptors$b,SPECIES$3$4=wellKnownSymbol$f$5("species"),setSpecies$2$2=function(W){var Y=getBuiltIn$3$7(W),J=definePropertyModule$3$8.f;DESCRIPTORS$6$6&&Y&&!Y[SPECIES$3$4]&&J(Y,SPECIES$3$4,{configurable:!0,get:function(){return this}})},aFunction$5$6=function(W){if(typeof W!="function")throw TypeError(String(W)+" is not a function");return W},anInstance$3$3=function(W,Y,J){if(!(W instanceof Y))throw TypeError("Incorrect "+(J?J+" ":"")+"invocation");return W},iterate$2$5={exports:{}},iterators$8={},wellKnownSymbol$e$5=wellKnownSymbol$h$2,Iterators$4$7=iterators$8,ITERATOR$5$6=wellKnownSymbol$e$5("iterator"),ArrayPrototype$1$7=Array.prototype,isArrayIteratorMethod$2$3=function(W){return W!==void 0&&(Iterators$4$7.Array===W||ArrayPrototype$1$7[ITERATOR$5$6]===W)},aFunction$4$6=aFunction$5$6,functionBindContext$7=function(W,Y,J){if(aFunction$4$6(W),Y===void 0)return W;switch(J){case 0:return function(){return W.call(Y)};case 1:return function(X){return W.call(Y,X)};case 2:return function(X,Me){return W.call(Y,X,Me)};case 3:return function(X,Me,Se){return W.call(Y,X,Me,Se)}}return function(){return W.apply(Y,arguments)}},wellKnownSymbol$d$7=wellKnownSymbol$h$2,TO_STRING_TAG$3$7=wellKnownSymbol$d$7("toStringTag"),test$7={};test$7[TO_STRING_TAG$3$7]="z";var toStringTagSupport$7=String(test$7)==="[object z]",TO_STRING_TAG_SUPPORT$7=toStringTagSupport$7,classofRaw$c=classofRaw$1$7,wellKnownSymbol$c$7=wellKnownSymbol$h$2,TO_STRING_TAG$2$7=wellKnownSymbol$c$7("toStringTag"),CORRECT_ARGUMENTS$7=classofRaw$c(function(){return arguments}())=="Arguments",tryGet$7=function(W,Y){try{return W[Y]}catch{}},classof$8$2=TO_STRING_TAG_SUPPORT$7?classofRaw$c:function(W){var Y,J,X;return W===void 0?"Undefined":W===null?"Null":typeof(J=tryGet$7(Y=Object(W),TO_STRING_TAG$2$7))=="string"?J:CORRECT_ARGUMENTS$7?classofRaw$c(Y):(X=classofRaw$c(Y))=="Object"&&typeof Y.callee=="function"?"Arguments":X},classof$7$4=classof$8$2,Iterators$3$7=iterators$8,wellKnownSymbol$b$7=wellKnownSymbol$h$2,ITERATOR$4$7=wellKnownSymbol$b$7("iterator"),getIteratorMethod$2$3=function(W){if(W!=null)return W[ITERATOR$4$7]||W["@@iterator"]||Iterators$3$7[classof$7$4(W)]},anObject$8$7=anObject$b$6,callWithSafeIterationClosing$1$5=function(W,Y,J,X){try{return X?Y(anObject$8$7(J)[0],J[1]):Y(J)}catch(Se){var Me=W.return;throw Me!==void 0&&anObject$8$7(Me.call(W)),Se}},anObject$7$8=anObject$b$6,isArrayIteratorMethod$1$7=isArrayIteratorMethod$2$3,toLength$9$3=toLength$b$2,bind$4$2=functionBindContext$7,getIteratorMethod$1$7=getIteratorMethod$2$3,callWithSafeIterationClosing$7=callWithSafeIterationClosing$1$5,Result$5=function(W,Y){this.stopped=W,this.result=Y},iterate$1$5=iterate$2$5.exports=function(W,Y,J,X,Me){var Se=bind$4$2(Y,J,X?2:1),Ne,je,ke,De,qe,Ue,Ge;if(Me)Ne=W;else{if(je=getIteratorMethod$1$7(W),typeof je!="function")throw TypeError("Target is not iterable");if(isArrayIteratorMethod$1$7(je)){for(ke=0,De=toLength$9$3(W.length);De>ke;ke++)if(qe=X?Se(anObject$7$8(Ge=W[ke])[0],Ge[1]):Se(W[ke]),qe&&qe instanceof Result$5)return qe;return new Result$5(!1)}Ne=je.call(W)}for(Ue=Ne.next;!(Ge=Ue.call(Ne)).done;)if(qe=callWithSafeIterationClosing$7(Ne,Se,Ge.value,X),typeof qe=="object"&&qe&&qe instanceof Result$5)return qe;return new Result$5(!1)};iterate$1$5.stop=function(W){return new Result$5(!0,W)};var wellKnownSymbol$a$7=wellKnownSymbol$h$2,ITERATOR$3$7=wellKnownSymbol$a$7("iterator"),SAFE_CLOSING$7=!1;try{var called$7=0,iteratorWithReturn$7={next:function(){return{done:!!called$7++}},return:function(){SAFE_CLOSING$7=!0}};iteratorWithReturn$7[ITERATOR$3$7]=function(){return this},Array.from(iteratorWithReturn$7,function(){throw 2})}catch(W){}var checkCorrectnessOfIteration$2$2=function(W,Y){if(!Y&&!SAFE_CLOSING$7)return!1;var J=!1;try{var X={};X[ITERATOR$3$7]=function(){return{next:function(){return{done:J=!0}}}},W(X)}catch{}return J},anObject$6$8=anObject$b$6,aFunction$3$7=aFunction$5$6,wellKnownSymbol$9$7=wellKnownSymbol$h$2,SPECIES$2$7=wellKnownSymbol$9$7("species"),speciesConstructor$2$2=function(W,Y){var J=anObject$6$8(W).constructor,X;return J===void 0||(X=anObject$6$8(J)[SPECIES$2$7])==null?Y:aFunction$3$7(X)},getBuiltIn$2$8=getBuiltIn$5$6,html$2$6=getBuiltIn$2$8("document","documentElement"),getBuiltIn$1$b=getBuiltIn$5$6,engineUserAgent$5=getBuiltIn$1$b("navigator","userAgent")||"",userAgent$1$5=engineUserAgent$5,engineIsIos$5=/(iphone|ipod|ipad).*applewebkit/i.test(userAgent$1$5),global$b$8=global$n$1,fails$b$6=fails$h$2,classof$6$5=classofRaw$1$7,bind$3$3=functionBindContext$7,html$1$8=html$2$6,createElement$b=documentCreateElement$1$8,IS_IOS$1$5=engineIsIos$5,location$6=global$b$8.location,set$1$7=global$b$8.setImmediate,clear$6=global$b$8.clearImmediate,process$3$5=global$b$8.process,MessageChannel$6=global$b$8.MessageChannel,Dispatch$5=global$b$8.Dispatch,counter$5=0,queue$5={},ONREADYSTATECHANGE$5="onreadystatechange",defer$5,channel$5,port$5,run$5=function(W){if(queue$5.hasOwnProperty(W)){var Y=queue$5[W];delete queue$5[W],Y()}},runner$5=function(W){return function(){run$5(W)}},listener$5=function(W){run$5(W.data)},post$5=function(W){global$b$8.postMessage(W+"",location$6.protocol+"//"+location$6.host)};(!set$1$7||!clear$6)&&(set$1$7=function(Y){for(var J=[],X=1;arguments.length>X;)J.push(arguments[X++]);return queue$5[++counter$5]=function(){(typeof Y=="function"?Y:Function(Y)).apply(void 0,J)},defer$5(counter$5),counter$5},clear$6=function(Y){delete queue$5[Y]},classof$6$5(process$3$5)=="process"?defer$5=function(W){process$3$5.nextTick(runner$5(W))}:Dispatch$5&&Dispatch$5.now?defer$5=function(W){Dispatch$5.now(runner$5(W))}:MessageChannel$6&&!IS_IOS$1$5?(channel$5=new MessageChannel$6,port$5=channel$5.port2,channel$5.port1.onmessage=listener$5,defer$5=bind$3$3(port$5.postMessage,port$5,1)):global$b$8.addEventListener&&typeof postMessage=="function"&&!global$b$8.importScripts&&!fails$b$6(post$5)&&location$6.protocol!=="file:"?(defer$5=post$5,global$b$8.addEventListener("message",listener$5,!1)):ONREADYSTATECHANGE$5 in createElement$b("script")?defer$5=function(W){html$1$8.appendChild(createElement$b("script"))[ONREADYSTATECHANGE$5]=function(){html$1$8.removeChild(this),run$5(W)}}:defer$5=function(W){setTimeout(runner$5(W),0)});var task$1$5={set:set$1$7,clear:clear$6},global$a$b=global$n$1,getOwnPropertyDescriptor2$b=objectGetOwnPropertyDescriptor$b.f,classof$5$7=classofRaw$1$7,macrotask$5=task$1$5.set,IS_IOS$6=engineIsIos$5,MutationObserver$6=global$a$b.MutationObserver||global$a$b.WebKitMutationObserver,process$2$5=global$a$b.process,Promise$1$5=global$a$b.Promise,IS_NODE$1$5=classof$5$7(process$2$5)=="process",queueMicrotaskDescriptor$5=getOwnPropertyDescriptor2$b(global$a$b,"queueMicrotask"),queueMicrotask$6=queueMicrotaskDescriptor$5&&queueMicrotaskDescriptor$5.value,flush$5,head$5,last$5,notify$1$5,toggle$5,node$6,promise$5,then$5;queueMicrotask$6||(flush$5=function(){var W,Y;for(IS_NODE$1$5&&(W=process$2$5.domain)&&W.exit();head$5;){Y=head$5.fn,head$5=head$5.next;try{Y()}catch(J){throw head$5?notify$1$5():last$5=void 0,J}}last$5=void 0,W&&W.enter()},IS_NODE$1$5?notify$1$5=function(){process$2$5.nextTick(flush$5)}:MutationObserver$6&&!IS_IOS$6?(toggle$5=!0,node$6=document.createTextNode(""),new MutationObserver$6(flush$5).observe(node$6,{characterData:!0}),notify$1$5=function(){node$6.data=toggle$5=!toggle$5}):Promise$1$5&&Promise$1$5.resolve?(promise$5=Promise$1$5.resolve(void 0),then$5=promise$5.then,notify$1$5=function(){then$5.call(promise$5,flush$5)}):notify$1$5=function(){macrotask$5.call(global$a$b,flush$5)});var microtask$1$5=queueMicrotask$6||function(W){var Y={fn:W,next:void 0};last$5&&(last$5.next=Y),head$5||(head$5=Y,notify$1$5()),last$5=Y},newPromiseCapability$2$5={},aFunction$2$7=aFunction$5$6,PromiseCapability$5=function(W){var Y,J;this.promise=new W(function(X,Me){if(Y!==void 0||J!==void 0)throw TypeError("Bad Promise constructor");Y=X,J=Me}),this.resolve=aFunction$2$7(Y),this.reject=aFunction$2$7(J)};newPromiseCapability$2$5.f=function(W){return new PromiseCapability$5(W)};var anObject$5$8=anObject$b$6,isObject$7$7=isObject$c$2,newPromiseCapability$1$5=newPromiseCapability$2$5,promiseResolve$1$5=function(W,Y){if(anObject$5$8(W),isObject$7$7(Y)&&Y.constructor===W)return Y;var J=newPromiseCapability$1$5.f(W),X=J.resolve;return X(Y),J.promise},global$9$b=global$n$1,hostReportErrors$1$5=function(W,Y){var J=global$9$b.console;J&&J.error&&(arguments.length===1?J.error(W):J.error(W,Y))},perform$1$5=function(W){try{return{error:!1,value:W()}}catch(Y){return{error:!0,value:Y}}},global$8$b=global$n$1,userAgent$6=engineUserAgent$5,process$1$5=global$8$b.process,versions$5=process$1$5&&process$1$5.versions,v8$5=versions$5&&versions$5.v8,match$5,version$a;v8$5?(match$5=v8$5.split("."),version$a=match$5[0]+match$5[1]):userAgent$6&&(match$5=userAgent$6.match(/Edge\/(\d+)/),(!match$5||match$5[1]>=74)&&(match$5=userAgent$6.match(/Chrome\/(\d+)/),match$5&&(version$a=match$5[1])));var engineV8Version$5=version$a&&+version$a,$$9$2=_export$b,global$7$b=global$n$1,getBuiltIn$e=getBuiltIn$5$6,NativePromise$5=nativePromiseConstructor$5,redefine$2$b=redefine$5$7.exports,redefineAll$1$7=redefineAll$2$3,setToStringTag$3$7=setToStringTag$4$3,setSpecies$1$7=setSpecies$2$2,isObject$6$8=isObject$c$2,aFunction$1$7=aFunction$5$6,anInstance$2$4=anInstance$3$3,classof$4$7=classofRaw$1$7,inspectSource$d=inspectSource$3$6,iterate$7=iterate$2$5.exports,checkCorrectnessOfIteration$1$7=checkCorrectnessOfIteration$2$2,speciesConstructor$1$7=speciesConstructor$2$2,task$6=task$1$5.set,microtask$6=microtask$1$5,promiseResolve$6=promiseResolve$1$5,hostReportErrors$6=hostReportErrors$1$5,newPromiseCapabilityModule$5=newPromiseCapability$2$5,perform$6=perform$1$5,InternalStateModule$3$4=internalState$b,isForced$c=isForced_1$b,wellKnownSymbol$8$7=wellKnownSymbol$h$2,V8_VERSION$5=engineV8Version$5,SPECIES$1$7=wellKnownSymbol$8$7("species"),PROMISE$5="Promise",getInternalState$3$4=InternalStateModule$3$4.get,setInternalState$3$3=InternalStateModule$3$4.set,getInternalPromiseState$5=InternalStateModule$3$4.getterFor(PROMISE$5),PromiseConstructor$5=NativePromise$5,TypeError$1$5=global$7$b.TypeError,document$1$8=global$7$b.document,process$9=global$7$b.process,$fetch$6=getBuiltIn$e("fetch"),newPromiseCapability$7=newPromiseCapabilityModule$5.f,newGenericPromiseCapability$5=newPromiseCapability$7,IS_NODE$6=classof$4$7(process$9)=="process",DISPATCH_EVENT$5=!!(document$1$8&&document$1$8.createEvent&&global$7$b.dispatchEvent),UNHANDLED_REJECTION$5="unhandledrejection",REJECTION_HANDLED$5="rejectionhandled",PENDING$5=0,FULFILLED$5=1,REJECTED$5=2,HANDLED$5=1,UNHANDLED$5=2,Internal$5,OwnPromiseCapability$5,PromiseWrapper$5,nativeThen$5,FORCED$2$2=isForced$c(PROMISE$5,function(){var W=inspectSource$d(PromiseConstructor$5)!==String(PromiseConstructor$5);if(!W&&(V8_VERSION$5===66||!IS_NODE$6&&typeof PromiseRejectionEvent!="function"))return!0;if(V8_VERSION$5>=51&&/native code/.test(PromiseConstructor$5))return!1;var Y=PromiseConstructor$5.resolve(1),J=function(Me){Me(function(){},function(){})},X=Y.constructor={};return X[SPECIES$1$7]=J,!(Y.then(function(){})instanceof J)}),INCORRECT_ITERATION$5=FORCED$2$2||!checkCorrectnessOfIteration$1$7(function(W){PromiseConstructor$5.all(W).catch(function(){})}),isThenable$5=function(W){var Y;return isObject$6$8(W)&&typeof(Y=W.then)=="function"?Y:!1},notify$6=function(W,Y,J){if(!Y.notified){Y.notified=!0;var X=Y.reactions;microtask$6(function(){for(var Me=Y.value,Se=Y.state==FULFILLED$5,Ne=0;X.length>Ne;){var je=X[Ne++],ke=Se?je.ok:je.fail,De=je.resolve,qe=je.reject,Ue=je.domain,Ge,He,Ve;try{ke?(Se||(Y.rejection===UNHANDLED$5&&onHandleUnhandled$5(W,Y),Y.rejection=HANDLED$5),ke===!0?Ge=Me:(Ue&&Ue.enter(),Ge=ke(Me),Ue&&(Ue.exit(),Ve=!0)),Ge===je.promise?qe(TypeError$1$5("Promise-chain cycle")):(He=isThenable$5(Ge))?He.call(Ge,De,qe):De(Ge)):qe(Me)}catch(Ye){Ue&&!Ve&&Ue.exit(),qe(Ye)}}Y.reactions=[],Y.notified=!1,J&&!Y.rejection&&onUnhandled$5(W,Y)})}},dispatchEvent$5=function(W,Y,J){var X,Me;DISPATCH_EVENT$5?(X=document$1$8.createEvent("Event"),X.promise=Y,X.reason=J,X.initEvent(W,!1,!0),global$7$b.dispatchEvent(X)):X={promise:Y,reason:J},(Me=global$7$b["on"+W])?Me(X):W===UNHANDLED_REJECTION$5&&hostReportErrors$6("Unhandled promise rejection",J)},onUnhandled$5=function(W,Y){task$6.call(global$7$b,function(){var J=Y.value,X=isUnhandled$5(Y),Me;if(X&&(Me=perform$6(function(){IS_NODE$6?process$9.emit("unhandledRejection",J,W):dispatchEvent$5(UNHANDLED_REJECTION$5,W,J)}),Y.rejection=IS_NODE$6||isUnhandled$5(Y)?UNHANDLED$5:HANDLED$5,Me.error))throw Me.value})},isUnhandled$5=function(W){return W.rejection!==HANDLED$5&&!W.parent},onHandleUnhandled$5=function(W,Y){task$6.call(global$7$b,function(){IS_NODE$6?process$9.emit("rejectionHandled",W):dispatchEvent$5(REJECTION_HANDLED$5,W,Y.value)})},bind$2$6=function(W,Y,J,X){return function(Me){W(Y,J,Me,X)}},internalReject$5=function(W,Y,J,X){Y.done||(Y.done=!0,X&&(Y=X),Y.value=J,Y.state=REJECTED$5,notify$6(W,Y,!0))},internalResolve$5=function(W,Y,J,X){if(!Y.done){Y.done=!0,X&&(Y=X);try{if(W===J)throw TypeError$1$5("Promise can't be resolved itself");var Me=isThenable$5(J);Me?microtask$6(function(){var Se={done:!1};try{Me.call(J,bind$2$6(internalResolve$5,W,Se,Y),bind$2$6(internalReject$5,W,Se,Y))}catch(Ne){internalReject$5(W,Se,Ne,Y)}}):(Y.value=J,Y.state=FULFILLED$5,notify$6(W,Y,!1))}catch(Se){internalReject$5(W,{done:!1},Se,Y)}}};FORCED$2$2&&(PromiseConstructor$5=function(Y){anInstance$2$4(this,PromiseConstructor$5,PROMISE$5),aFunction$1$7(Y),Internal$5.call(this);var J=getInternalState$3$4(this);try{Y(bind$2$6(internalResolve$5,this,J),bind$2$6(internalReject$5,this,J))}catch(X){internalReject$5(this,J,X)}},Internal$5=function(Y){setInternalState$3$3(this,{type:PROMISE$5,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:PENDING$5,value:void 0})},Internal$5.prototype=redefineAll$1$7(PromiseConstructor$5.prototype,{then:function(Y,J){var X=getInternalPromiseState$5(this),Me=newPromiseCapability$7(speciesConstructor$1$7(this,PromiseConstructor$5));return Me.ok=typeof Y=="function"?Y:!0,Me.fail=typeof J=="function"&&J,Me.domain=IS_NODE$6?process$9.domain:void 0,X.parent=!0,X.reactions.push(Me),X.state!=PENDING$5&¬ify$6(this,X,!1),Me.promise},catch:function(W){return this.then(void 0,W)}}),OwnPromiseCapability$5=function(){var W=new Internal$5,Y=getInternalState$3$4(W);this.promise=W,this.resolve=bind$2$6(internalResolve$5,W,Y),this.reject=bind$2$6(internalReject$5,W,Y)},newPromiseCapabilityModule$5.f=newPromiseCapability$7=function(W){return W===PromiseConstructor$5||W===PromiseWrapper$5?new OwnPromiseCapability$5(W):newGenericPromiseCapability$5(W)},typeof NativePromise$5=="function"&&(nativeThen$5=NativePromise$5.prototype.then,redefine$2$b(NativePromise$5.prototype,"then",function(Y,J){var X=this;return new PromiseConstructor$5(function(Me,Se){nativeThen$5.call(X,Me,Se)}).then(Y,J)},{unsafe:!0}),typeof $fetch$6=="function"&&$$9$2({global:!0,enumerable:!0,forced:!0},{fetch:function(Y){return promiseResolve$6(PromiseConstructor$5,$fetch$6.apply(global$7$b,arguments))}})));$$9$2({global:!0,wrap:!0,forced:FORCED$2$2},{Promise:PromiseConstructor$5});setToStringTag$3$7(PromiseConstructor$5,PROMISE$5,!1);setSpecies$1$7(PROMISE$5);PromiseWrapper$5=getBuiltIn$e(PROMISE$5);$$9$2({target:PROMISE$5,stat:!0,forced:FORCED$2$2},{reject:function W(Y){var J=newPromiseCapability$7(this);return J.reject.call(void 0,Y),J.promise}});$$9$2({target:PROMISE$5,stat:!0,forced:FORCED$2$2},{resolve:function W(Y){return promiseResolve$6(this,Y)}});$$9$2({target:PROMISE$5,stat:!0,forced:INCORRECT_ITERATION$5},{all:function W(Y){var J=this,X=newPromiseCapability$7(J),Me=X.resolve,Se=X.reject,Ne=perform$6(function(){var je=aFunction$1$7(J.resolve),ke=[],De=0,qe=1;iterate$7(Y,function(Ue){var Ge=De++,He=!1;ke.push(void 0),qe++,je.call(J,Ue).then(function(Ve){He||(He=!0,ke[Ge]=Ve,--qe||Me(ke))},Se)}),--qe||Me(ke)});return Ne.error&&Se(Ne.value),X.promise},race:function W(Y){var J=this,X=newPromiseCapability$7(J),Me=X.reject,Se=perform$6(function(){var Ne=aFunction$1$7(J.resolve);iterate$7(Y,function(je){Ne.call(J,je).then(X.resolve,Me)})});return Se.error&&Me(Se.value),X.promise}});class WebStorageService{getItem(Y){return new Promise(J=>{const X=localStorage.getItem(Y);J(X)})}setItem(Y,J){return new Promise(X=>{localStorage.setItem(Y,J),X()})}removeItem(Y){return new Promise(J=>{localStorage.removeItem(Y),J()})}}var internalObjectKeys$c=objectKeysInternal$b,enumBugKeys$1$b=enumBugKeys$3$8,objectKeys$2$7=Object.keys||function W(Y){return internalObjectKeys$c(Y,enumBugKeys$1$b)},DESCRIPTORS$5$8=descriptors$b,definePropertyModule$2$8=objectDefineProperty$b,anObject$4$b=anObject$b$6,objectKeys$1$b=objectKeys$2$7,objectDefineProperties$8=DESCRIPTORS$5$8?Object.defineProperties:function W(Y,J){anObject$4$b(Y);for(var X=objectKeys$1$b(J),Me=X.length,Se=0,Ne;Me>Se;)definePropertyModule$2$8.f(Y,Ne=X[Se++],J[Ne]);return Y},anObject$3$b=anObject$b$6,defineProperties2$8=objectDefineProperties$8,enumBugKeys$e=enumBugKeys$3$8,hiddenKeys$f=hiddenKeys$4$8,html$9=html$2$6,documentCreateElement$c=documentCreateElement$1$8,sharedKey$1$b=sharedKey$3$8,GT$8=">",LT$8="<",PROTOTYPE$1$3="prototype",SCRIPT$8="script",IE_PROTO$1$8=sharedKey$1$b("IE_PROTO"),EmptyConstructor$8=function(){},scriptTag$8=function(W){return LT$8+SCRIPT$8+GT$8+W+LT$8+"/"+SCRIPT$8+GT$8},NullProtoObjectViaActiveX$8=function(W){W.write(scriptTag$8("")),W.close();var Y=W.parentWindow.Object;return W=null,Y},NullProtoObjectViaIFrame$8=function(){var W=documentCreateElement$c("iframe"),Y="java"+SCRIPT$8+":",J;return W.style.display="none",html$9.appendChild(W),W.src=String(Y),J=W.contentWindow.document,J.open(),J.write(scriptTag$8("document.F=Object")),J.close(),J.F},activeXDocument$8,NullProtoObject$8=function(){try{activeXDocument$8=document.domain&&new ActiveXObject("htmlfile")}catch{}NullProtoObject$8=activeXDocument$8?NullProtoObjectViaActiveX$8(activeXDocument$8):NullProtoObjectViaIFrame$8();for(var W=enumBugKeys$e.length;W--;)delete NullProtoObject$8[PROTOTYPE$1$3][enumBugKeys$e[W]];return NullProtoObject$8()};hiddenKeys$f[IE_PROTO$1$8]=!0;var objectCreate$8=Object.create||function W(Y,J){var X;return Y!==null?(EmptyConstructor$8[PROTOTYPE$1$3]=anObject$3$b(Y),X=new EmptyConstructor$8,EmptyConstructor$8[PROTOTYPE$1$3]=null,X[IE_PROTO$1$8]=Y):X=NullProtoObject$8(),J===void 0?X:defineProperties2$8(X,J)},wellKnownSymbol$7$8=wellKnownSymbol$h$2,create$2$4=objectCreate$8,definePropertyModule$1$b=objectDefineProperty$b,UNSCOPABLES$8=wellKnownSymbol$7$8("unscopables"),ArrayPrototype$9=Array.prototype;ArrayPrototype$9[UNSCOPABLES$8]==null&&definePropertyModule$1$b.f(ArrayPrototype$9,UNSCOPABLES$8,{configurable:!0,value:create$2$4(null)});var addToUnscopables$2$4=function(W){ArrayPrototype$9[UNSCOPABLES$8][W]=!0},requireObjectCoercible$2$b=requireObjectCoercible$4$4,toObject$7$2=function(W){return Object(requireObjectCoercible$2$b(W))},fails$a$6=fails$h$2,correctPrototypeGetter$8=!fails$a$6(function(){function W(){}return W.prototype.constructor=null,Object.getPrototypeOf(new W)!==W.prototype}),has$4$b=has$c$2,toObject$6$3=toObject$7$2,sharedKey$e=sharedKey$3$8,CORRECT_PROTOTYPE_GETTER$8=correctPrototypeGetter$8,IE_PROTO$9=sharedKey$e("IE_PROTO"),ObjectPrototype$2$3=Object.prototype,objectGetPrototypeOf$8=CORRECT_PROTOTYPE_GETTER$8?Object.getPrototypeOf:function(W){return W=toObject$6$3(W),has$4$b(W,IE_PROTO$9)?W[IE_PROTO$9]:typeof W.constructor=="function"&&W instanceof W.constructor?W.constructor.prototype:W instanceof Object?ObjectPrototype$2$3:null},getPrototypeOf$3$3=objectGetPrototypeOf$8,createNonEnumerableProperty$5$8=createNonEnumerableProperty$a$2,has$3$b=has$c$2,wellKnownSymbol$6$8=wellKnownSymbol$h$2,ITERATOR$2$8=wellKnownSymbol$6$8("iterator"),BUGGY_SAFARI_ITERATORS$1$8=!1,returnThis$2$8=function(){return this},IteratorPrototype$2$8,PrototypeOfArrayIteratorPrototype$8,arrayIterator$8;[].keys&&(arrayIterator$8=[].keys(),"next"in arrayIterator$8?(PrototypeOfArrayIteratorPrototype$8=getPrototypeOf$3$3(getPrototypeOf$3$3(arrayIterator$8)),PrototypeOfArrayIteratorPrototype$8!==Object.prototype&&(IteratorPrototype$2$8=PrototypeOfArrayIteratorPrototype$8)):BUGGY_SAFARI_ITERATORS$1$8=!0);IteratorPrototype$2$8==null&&(IteratorPrototype$2$8={});has$3$b(IteratorPrototype$2$8,ITERATOR$2$8)||createNonEnumerableProperty$5$8(IteratorPrototype$2$8,ITERATOR$2$8,returnThis$2$8);var iteratorsCore$8={IteratorPrototype:IteratorPrototype$2$8,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1$8},IteratorPrototype$1$8=iteratorsCore$8.IteratorPrototype,create$1$8=objectCreate$8,createPropertyDescriptor$1$b=createPropertyDescriptor$4$4,setToStringTag$2$8=setToStringTag$4$3,Iterators$2$8=iterators$8,returnThis$1$8=function(){return this},createIteratorConstructor$1$8=function(W,Y,J){var X=Y+" Iterator";return W.prototype=create$1$8(IteratorPrototype$1$8,{next:createPropertyDescriptor$1$b(1,J)}),setToStringTag$2$8(W,X,!1),Iterators$2$8[X]=returnThis$1$8,W},isObject$5$8=isObject$c$2,aPossiblePrototype$1$8=function(W){if(!isObject$5$8(W)&&W!==null)throw TypeError("Can't set "+String(W)+" as a prototype");return W},anObject$2$b=anObject$b$6,aPossiblePrototype$9=aPossiblePrototype$1$8,objectSetPrototypeOf$8=Object.setPrototypeOf||("__proto__"in{}?function(){var W=!1,Y={},J;try{J=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,J.call(Y,[]),W=Y instanceof Array}catch{}return function(Me,Se){return anObject$2$b(Me),aPossiblePrototype$9(Se),W?J.call(Me,Se):Me.__proto__=Se,Me}}():void 0),$$8$2=_export$b,createIteratorConstructor$9=createIteratorConstructor$1$8,getPrototypeOf$2$3=objectGetPrototypeOf$8,setPrototypeOf$4$3=objectSetPrototypeOf$8,setToStringTag$1$8=setToStringTag$4$3,createNonEnumerableProperty$4$b=createNonEnumerableProperty$a$2,redefine$1$b=redefine$5$7.exports,wellKnownSymbol$5$8=wellKnownSymbol$h$2,Iterators$1$8=iterators$8,IteratorsCore$8=iteratorsCore$8,IteratorPrototype$a=IteratorsCore$8.IteratorPrototype,BUGGY_SAFARI_ITERATORS$9=IteratorsCore$8.BUGGY_SA{"ActionError":{"index":0,"kind":{"FunctionCallError":{"MethodResolveError":"MethodNotFound"}}}}
1 automatic refund step from the network not shown.
This page reads FastNEAR's public transaction index and stores nothing. This command asks a NEAR archival node for the same transaction and needs no keys.
curl -s https://archival-rpc.testnet.fastnear.com -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tx","params":{"tx_hash":"DvcmWSB76xu3X5RTMXuyw2UJV5CQLkRgX1KGduvurLeL","sender_account_id":"sleetcreate.testnet","wait_until":"FINAL"}}'Vouch has its own page because testnet.nearblocks.io stopped indexing on 27 Sep 2026, so it can't show newer transactions.